javascriptgantt 1.0.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Zehntech
3
+ Copyright (c) 2023 Sunil Solanki
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <head>
5
5
  <meta charset="UTF-8" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>jsGantt</title>
7
+ <title>javascriptgantt</title>
8
8
  <link rel="stylesheet" href="./style.css" />
9
9
  <link rel="stylesheet" href="src/gantt.css" />
10
10
  <link rel="stylesheet" href="src/assets/zt-tour/zt-tour.css" />
@@ -110,8 +110,8 @@
110
110
  </g>
111
111
  </svg>
112
112
  </div>
113
- <!-- <button onclick="ZT_Gantt.destroy()">destroy</button>
114
- <button onclick="ZT_Gantt.render()">render</button> -->
113
+ <!-- <button onclick="javascriptgantt.destroy()">destroy</button>
114
+ <button onclick="javascriptgantt.render()">render</button> -->
115
115
  <!-- <button onclick="addCol()">Add Column</button>
116
116
  <button onclick="removeCol()">Remove Column</button> -->
117
117
  <input type="search" placeholder="Search Task" id="gantt-search" name="gantt-search" class="gantt-search"
@@ -294,8 +294,8 @@
294
294
  // }
295
295
 
296
296
  let element = document.getElementById("js-gantt");
297
- let ZT_Gantt = new jsGantt(element);
298
- window.jsGantt = ZT_Gantt;
297
+ let javascriptGantt = new javascriptgantt(element);
298
+ window.javascriptgantt = javascriptGantt;
299
299
 
300
300
  const textEditor = { type: "text", map_to: "text" };
301
301
  const dateEditor = {
@@ -305,7 +305,7 @@
305
305
  const numberEditor = { type: "number", map_to: "progress", min: 0, max: 100 };
306
306
  const selectEditor = { type: "select", map_to: "priority", options: ["Low", "Medium", "High"] };
307
307
 
308
- ZT_Gantt.options.columns = [
308
+ javascriptGantt.options.columns = [
309
309
  {
310
310
  name: "text",
311
311
  width: 245,
@@ -363,15 +363,15 @@
363
363
  // },
364
364
  ];
365
365
 
366
- ZT_Gantt.options.date_format = "%m-%d-%Y";
367
- ZT_Gantt.options.localLang = "en";
368
- ZT_Gantt.options.data = data;
369
- ZT_Gantt.options.collapse = false;
370
- ZT_Gantt.options.weekends = ["Sat", "Sun"];
371
- ZT_Gantt.options.fullWeek = true;
372
- ZT_Gantt.options.todayMarker = true;
373
- ZT_Gantt.options.dropArea = true;
374
- ZT_Gantt.options.customMarker = [
366
+ javascriptGantt.options.date_format = "%m-%d-%Y";
367
+ javascriptGantt.options.localLang = "en";
368
+ javascriptGantt.options.data = data;
369
+ javascriptGantt.options.collapse = false;
370
+ javascriptGantt.options.weekends = ["Sat", "Sun"];
371
+ javascriptGantt.options.fullWeek = true;
372
+ javascriptGantt.options.todayMarker = true;
373
+ javascriptGantt.options.dropArea = true;
374
+ javascriptGantt.options.customMarker = [
375
375
  {
376
376
  start_date: '06-20-2024',
377
377
  css: "party",
@@ -379,27 +379,27 @@
379
379
  title: "Ek aur Sal Barbad!"
380
380
  }
381
381
  ];
382
- ZT_Gantt.options.updateLinkOnDrag = true;
383
- ZT_Gantt.options.splitTask = false;
384
- ZT_Gantt.options.sort = true;
385
- // ZT_Gantt.templates.showLightBox = false;
382
+ javascriptGantt.options.updateLinkOnDrag = true;
383
+ javascriptGantt.options.splitTask = false;
384
+ javascriptGantt.options.sort = true;
385
+ // javascriptgantt.templates.showLightBox = false;
386
386
 
387
387
  // new feature of gantt -----
388
- ZT_Gantt.options.mouseScroll = true; // default is false
389
- ZT_Gantt.options.ctrlKeyRequiredForMouseScroll = true; // default is true
388
+ javascriptGantt.options.mouseScroll = true; // default is false
389
+ javascriptGantt.options.ctrlKeyRequiredForMouseScroll = true; // default is true
390
390
 
391
- ZT_Gantt.options.addLinks = (task) => {
391
+ javascriptGantt.options.addLinks = (task) => {
392
392
  if (task.parent === 0) {
393
393
  return false;
394
394
  }
395
395
  return true;
396
396
  };
397
397
 
398
- ZT_Gantt.options.exportApi = "https://js-gantt.zehntech.net/";
399
- // ZT_Gantt.options.exportApi = "http://192.168.0.155:8300/";
400
- ZT_Gantt.options.taskColor = true;
401
- ZT_Gantt.options.taskOpacity = 0.7;
402
- ZT_Gantt.options.links = [
398
+ javascriptGantt.options.exportApi = "";
399
+ // javascriptgantt.options.exportApi = "http://192.168.0.155:8300/";
400
+ javascriptGantt.options.taskColor = true;
401
+ javascriptGantt.options.taskOpacity = 0.7;
402
+ javascriptGantt.options.links = [
403
403
  // 0 is finish_to_start
404
404
  // 1 is start_to_start
405
405
  // 2 is finish_to_finish
@@ -409,18 +409,18 @@
409
409
  { id: 3, source: 4, target: 23, type: 3 },
410
410
  { id: 4, source: 12, target: 15 },
411
411
  ];
412
- ZT_Gantt.options.weekStart = 1; // set the start of the week
413
- ZT_Gantt.options.sidebarWidth = 300;
414
- ZT_Gantt.options.scales = [
412
+ javascriptGantt.options.weekStart = 1; // set the start of the week
413
+ javascriptGantt.options.sidebarWidth = 300;
414
+ javascriptGantt.options.scales = [
415
415
  {
416
416
  unit: "week",
417
417
  step: 1,
418
418
  format: (t) => {
419
419
  const { startDate: a, endDate: n, weekNum: i } = weekStartAndEnd(t);
420
- return ` ${ZT_Gantt.formatDateToString(
420
+ return ` ${javascriptGantt.formatDateToString(
421
421
  "%j %M",
422
422
  a
423
- )} - ${ZT_Gantt.formatDateToString(
423
+ )} - ${javascriptGantt.formatDateToString(
424
424
  "%j %M",
425
425
  n
426
426
  )}, ${a.getFullYear()}`;
@@ -429,10 +429,10 @@
429
429
  { unit: "day", step: 1, format: "%d %D" },
430
430
  ];
431
431
 
432
- ZT_Gantt.options.zoomLevel = "day";
432
+ javascriptGantt.options.zoomLevel = "day";
433
433
 
434
434
  // zoom config
435
- ZT_Gantt.options.zoomConfig = {
435
+ javascriptGantt.options.zoomConfig = {
436
436
  levels: [
437
437
  {
438
438
  name: "hour",
@@ -467,10 +467,10 @@
467
467
  endDate: n,
468
468
  weekNum: i,
469
469
  } = weekStartAndEnd(t);
470
- return ` ${ZT_Gantt.formatDateToString(
470
+ return ` ${javascriptGantt.formatDateToString(
471
471
  "%j %M",
472
472
  a
473
- )} - ${ZT_Gantt.formatDateToString(
473
+ )} - ${javascriptGantt.formatDateToString(
474
474
  "%j %M",
475
475
  n
476
476
  )}, ${a.getFullYear()}`;
@@ -509,14 +509,14 @@
509
509
  ],
510
510
  };
511
511
 
512
- ZT_Gantt.options.scale_height = 30;
513
- ZT_Gantt.options.row_height = 24;
514
- ZT_Gantt.options.minColWidth = 80;
515
- ZT_Gantt.options.selectAreaOnDrag = true;
516
- ZT_Gantt.options.taskProgress = true;
512
+ javascriptGantt.options.scale_height = 30;
513
+ javascriptGantt.options.row_height = 24;
514
+ javascriptGantt.options.minColWidth = 80;
515
+ javascriptGantt.options.selectAreaOnDrag = true;
516
+ javascriptGantt.options.taskProgress = true;
517
517
 
518
518
  // Gantt layout to implement columns in right side
519
- // ZT_Gantt.options.rightGrid = [
519
+ // javascriptgantt.options.rightGrid = [
520
520
  // {
521
521
  // name: "text",
522
522
  // width: 245,
@@ -548,31 +548,31 @@
548
548
  const e = t.getDay();
549
549
  let a, n;
550
550
  0 === e
551
- ? ((a = ZT_Gantt.add(t, -6, "day")), (n = t))
552
- : ((a = ZT_Gantt.add(t, -1 * e + 1, "day")),
553
- (n = ZT_Gantt.add(t, 7 - e, "day")));
551
+ ? ((a = javascriptGantt.add(t, -6, "day")), (n = t))
552
+ : ((a = javascriptGantt.add(t, -1 * e + 1, "day")),
553
+ (n = javascriptGantt.add(t, 7 - e, "day")));
554
554
  return {
555
555
  startDate: a,
556
556
  endDate: n,
557
- weekNum: ZT_Gantt.formatDateToString("%W", t),
557
+ weekNum: javascriptGantt.formatDateToString("%W", t),
558
558
  };
559
559
  }
560
560
 
561
- ZT_Gantt.options.startDate = "2024-06-01T11:46:17.775Z";
562
- ZT_Gantt.options.endDate = "2024-10-30T11:46:17.775Z";
561
+ javascriptGantt.options.startDate = "2024-06-01T11:46:17.775Z";
562
+ javascriptGantt.options.endDate = "2024-10-30T11:46:17.775Z";
563
563
 
564
- ZT_Gantt.templates.tooltip_text = function (start, end, task) {
564
+ javascriptGantt.templates.tooltip_text = function (start, end, task) {
565
565
  return `<b>${task.parent === 0 ? "Project" : "Task"}:</b>
566
566
  ${task.text}
567
567
  <br/><b>Start date:</b>
568
- ${ZT_Gantt.formatDateToString("%d-%m-%y %H:%i", start)}
568
+ ${javascriptGantt.formatDateToString("%d-%m-%y %H:%i", start)}
569
569
  <br/><b>End date:</b>
570
- ${ZT_Gantt.formatDateToString("%d-%m-%y %H:%i", end)}<br/>
570
+ ${javascriptGantt.formatDateToString("%d-%m-%y %H:%i", end)}<br/>
571
571
  <b>Duration:</b> ${task.duration} ${task.duration > 1 ? "Days" : "Day"
572
572
  }`;
573
573
  };
574
574
 
575
- ZT_Gantt.templates.taskbar_text = function (start, end, task) {
575
+ javascriptGantt.templates.taskbar_text = function (start, end, task) {
576
576
  if (task.parent == 0 && task.type !== "milestone") {
577
577
  return `Project : ${task.text}`;
578
578
  } else if (task.type === "milestone") {
@@ -582,7 +582,7 @@
582
582
  }
583
583
  };
584
584
 
585
- ZT_Gantt.templates.grid_folder = (task) => {
585
+ javascriptGantt.templates.grid_folder = (task) => {
586
586
  var name = task?.text?.trim().split(" ");
587
587
  var firstname = name?.[0];
588
588
  var lastname = name?.[1] ? name?.[1] : "";
@@ -592,7 +592,7 @@
592
592
  return `<div></div>`;
593
593
  };
594
594
 
595
- ZT_Gantt.templates.grid_file = (task) => {
595
+ javascriptGantt.templates.grid_file = (task) => {
596
596
  if (task.parent != 0) {
597
597
  var tracker_name = task.hasOwnProperty("tracker")
598
598
  ? task.tracker.name
@@ -602,7 +602,7 @@
602
602
  }
603
603
  };
604
604
 
605
- ZT_Gantt.templates.task_drag = (mode, task) => {
605
+ javascriptGantt.templates.task_drag = (mode, task) => {
606
606
  if (task.parent == 0 || (task.children && task.children.length > 0)) {
607
607
  // || task.children
608
608
  return false;
@@ -611,97 +611,97 @@
611
611
  };
612
612
 
613
613
  // add custom classes
614
- // ZT_Gantt.templates.grid_header_class = (columns,i) => {
614
+ // javascriptgantt.templates.grid_header_class = (columns,i) => {
615
615
  // return "my-header-class test"
616
616
  // }
617
- // ZT_Gantt.templates.grid_row_class = (start, end, task) => {
617
+ // javascriptgantt.templates.grid_row_class = (start, end, task) => {
618
618
  // console.log(start, end);
619
619
  // return "my-grid-row-class test"
620
620
  // }
621
- ZT_Gantt.templates.task_class = (start, end, task) => {
621
+ javascriptGantt.templates.task_class = (start, end, task) => {
622
622
  if (task.parent == 0) {
623
623
  return "parent-task test";
624
624
  } else {
625
625
  return "child-task test";
626
626
  }
627
627
  };
628
- // ZT_Gantt.templates.task_row_class = (start, end, task) => {
628
+ // javascriptgantt.templates.task_row_class = (start, end, task) => {
629
629
  // return "my-task-row-class test"
630
630
  // }
631
- ZT_Gantt.templates.scale_cell_class = (date, scale, scaleIndex) => {
631
+ javascriptGantt.templates.scale_cell_class = (date, scale, scaleIndex) => {
632
632
  if (scaleIndex === 1) {
633
633
  return "my-scale-class-2";
634
634
  } else {
635
635
  return "my-scale-class-1";
636
636
  }
637
637
  };
638
- // ZT_Gantt.templates.grid_cell_class = (col, task) => {
638
+ // javascriptgantt.templates.grid_cell_class = (col, task) => {
639
639
  // return "my-grid-cell-class test"
640
640
  // }
641
- // ZT_Gantt.templates.timeline_cell_class = (task, date) => {
641
+ // javascriptgantt.templates.timeline_cell_class = (task, date) => {
642
642
  // return "my-task-cell-class Test "
643
643
  // }
644
644
 
645
645
  // add custom marker
646
- ZT_Gantt.addMarker({
647
- start_date: ZT_Gantt.add(new Date(), 1, "day"), //a Date object that sets the marker's date
646
+ javascriptGantt.addMarker({
647
+ start_date: javascriptGantt.add(new Date(), 1, "day"), //a Date object that sets the marker's date
648
648
  css: "tomorrow", //a CSS class applied to the marker
649
649
  text: "Tomorrow", //the marker title
650
- title: ZT_Gantt.formatDateToString(
650
+ title: javascriptGantt.formatDateToString(
651
651
  "%d %F %y",
652
- ZT_Gantt.add(new Date(), 1, "day")
652
+ javascriptGantt.add(new Date(), 1, "day")
653
653
  ), // the marker's tooltip
654
654
  });
655
655
 
656
- // ZT_Gantt.addMarker({
657
- // start_date: ZT_Gantt.add(new Date(),-1, "day"), //a Date object that sets the marker's date
656
+ // javascriptgantt.addMarker({
657
+ // start_date: javascriptgantt.add(new Date(),-1, "day"), //a Date object that sets the marker's date
658
658
  // css: "yesterday", //a CSS class applied to the marker
659
659
  // text: "Yesterday", //the marker title
660
- // title: ZT_Gantt.formatDateToString("%d %F %Y", ZT_Gantt.add(new Date(),-1, "day")), // the marker's tooltip
660
+ // title: javascriptgantt.formatDateToString("%d %F %Y", javascriptgantt.add(new Date(),-1, "day")), // the marker's tooltip
661
661
  // });
662
662
 
663
663
  // render gantt
664
- ZT_Gantt.render(element);
664
+ javascriptGantt.render(element);
665
665
 
666
- const jsGanttTheme = localStorage.getItem('jsGantt-theme');
666
+ const jsGanttTheme = localStorage.getItem('javascriptgantt-theme');
667
667
 
668
668
 
669
- // console.log(ZT_Gantt);
669
+ // console.log(javascriptgantt);
670
670
 
671
671
  // to find task in gantt
672
- // console.log(ZT_Gantt.getTask(69));
672
+ // console.log(javascriptgantt.getTask(69));
673
673
 
674
674
  // custom events
675
- ZT_Gantt.attachEvent("onTaskDblClick", (event) => {
675
+ javascriptGantt.attachEvent("onTaskDblClick", (event) => {
676
676
  // console.log("onTaskDblClick: ", event);
677
677
  });
678
678
  let idCount = 0;
679
- ZT_Gantt.attachEvent("selectAreaOnDrag", (event) => {
679
+ javascriptGantt.attachEvent("selectAreaOnDrag", (event) => {
680
680
  // console.log("selectAreaOnDrag: ", event.task);
681
- ZT_Gantt.addTask({
681
+ javascriptGantt.addTask({
682
682
  id: "Added" + idCount,
683
683
  start_date: new Date(event.task.startDate),
684
684
  end_date: new Date(event.task.endDate),
685
685
  parent: event.task.parent,
686
686
  text: "Task Added",
687
687
  });
688
- ZT_Gantt.render();
688
+ javascriptGantt.render();
689
689
  idCount += 1;
690
690
  });
691
- ZT_Gantt.attachEvent("onLinkDblClick", (event) => {
691
+ javascriptGantt.attachEvent("onLinkDblClick", (event) => {
692
692
  // console.log("onLinkDblClick: ", event);
693
- // ZT_Gantt.deleteLink(event.link.id);
693
+ // javascriptgantt.deleteLink(event.link.id);
694
694
  });
695
- ZT_Gantt.attachEvent("onBeforeLinkAdd", (event) => {
695
+ javascriptGantt.attachEvent("onBeforeLinkAdd", (event) => {
696
696
  // console.log("onBeforeLinkAdd: ", event);
697
697
  });
698
- ZT_Gantt.attachEvent("onLinkAdd", (event) => {
698
+ javascriptGantt.attachEvent("onLinkAdd", (event) => {
699
699
  // console.log("onLinkAdd: ", event);
700
700
  });
701
- ZT_Gantt.attachEvent("onDeleteLink", (event) => {
701
+ javascriptGantt.attachEvent("onDeleteLink", (event) => {
702
702
  // console.log("onDeleteLink: ", event);
703
703
  });
704
- ZT_Gantt.attachEvent("onBeforeTaskDrag", (event) => {
704
+ javascriptGantt.attachEvent("onBeforeTaskDrag", (event) => {
705
705
  // console.log("onBeforeTaskDrag: ", event);
706
706
  if (event.task.children.length !== 0) {
707
707
  return false;
@@ -709,49 +709,49 @@
709
709
  return true;
710
710
  }
711
711
  });
712
- ZT_Gantt.attachEvent("onTaskDrag", (event) => {
712
+ javascriptGantt.attachEvent("onTaskDrag", (event) => {
713
713
  // console.log("onTaskDrag: ", event);
714
714
  });
715
- ZT_Gantt.attachEvent("onAfterTaskDrag", (event) => {
715
+ javascriptGantt.attachEvent("onAfterTaskDrag", (event) => {
716
716
  console.log("onAfterTaskDrag: ", event);
717
- console.log("onAfterTaskDrag??: ", ZT_Gantt.options.data);
718
- // ZT_Gantt.autoScheduling();
717
+ console.log("onAfterTaskDrag??: ", javascriptGantt.options.data);
718
+ // javascriptgantt.autoScheduling();
719
719
  });
720
- ZT_Gantt.attachEvent("onBeforeTaskDrop", (event) => {
720
+ javascriptGantt.attachEvent("onBeforeTaskDrop", (event) => {
721
721
  console.log("onBeforeTaskDrop: ", event);
722
722
  if (event.parentTask?.id == 12) {
723
723
  return false;
724
724
  }
725
725
  });
726
- ZT_Gantt.attachEvent("onTaskToggle", (event) => {
726
+ javascriptGantt.attachEvent("onTaskToggle", (event) => {
727
727
  // console.log("onTaskToggle: ", event);
728
728
  });
729
729
 
730
- ZT_Gantt.attachEvent("onTaskDelete", (event) => {
730
+ javascriptGantt.attachEvent("onTaskDelete", (event) => {
731
731
  console.log("onTaskDelete: ", event);
732
732
  });
733
- ZT_Gantt.attachEvent("onAfterTaskUpdate", (event) => {
733
+ javascriptGantt.attachEvent("onAfterTaskUpdate", (event) => {
734
734
  // console.log("onAfterTaskUpdate: ", event);
735
735
  });
736
- ZT_Gantt.attachEvent("onCellClick", (event) => {
736
+ javascriptGantt.attachEvent("onCellClick", (event) => {
737
737
  // console.log("onCellClick: ", event);
738
738
  });
739
- ZT_Gantt.attachEvent("onRequestFullScreen", (event) => {
739
+ javascriptGantt.attachEvent("onRequestFullScreen", (event) => {
740
740
  // console.log("onRequestFullScreen: ", event);
741
741
  });
742
- ZT_Gantt.attachEvent("onExitFullScreen", (event) => {
742
+ javascriptGantt.attachEvent("onExitFullScreen", (event) => {
743
743
  // console.log("onExitFullScreen: ", event);
744
744
  });
745
- // ZT_Gantt.attachEvent("onScroll", (event) => {
745
+ // javascriptgantt.attachEvent("onScroll", (event) => {
746
746
  // console.log("onScroll: ", event);
747
747
  // });
748
- // ZT_Gantt.attachEvent("onResize", (event) => {
748
+ // javascriptgantt.attachEvent("onResize", (event) => {
749
749
  // console.log("onResize: ", event);
750
750
  // });
751
- ZT_Gantt.attachEvent("onAfterProgressDrag", (event) => {
751
+ javascriptGantt.attachEvent("onAfterProgressDrag", (event) => {
752
752
  // console.log("onAfterProgressDrag: ", event);
753
753
  });
754
- ZT_Gantt.attachEvent("onBeforeProgressDrag", (event) => {
754
+ javascriptGantt.attachEvent("onBeforeProgressDrag", (event) => {
755
755
  // console.log("onBeforeProgressDrag: ", event);
756
756
  // if(event.task.parent === 0){
757
757
  // return false;
@@ -759,90 +759,87 @@
759
759
  // return true;
760
760
  // }
761
761
  });
762
- ZT_Gantt.attachEvent("onAutoScheduling", (event) => {
762
+ javascriptGantt.attachEvent("onAutoScheduling", (event) => {
763
763
  // console.log("onAutoScheduling: ", event);
764
764
  });
765
- ZT_Gantt.attachEvent("onColorChange", (event) => {
765
+ javascriptGantt.attachEvent("onColorChange", (event) => {
766
766
  // console.log("onColorChange: ", event);
767
767
  });
768
- ZT_Gantt.attachEvent("onBeforeTaskDblClick", (event) => {
768
+ javascriptGantt.attachEvent("onBeforeTaskDblClick", (event) => {
769
769
  // console.log("onBeforeTaskDblClick: ", event);
770
770
  // if(event.task.id === 3){
771
771
  // return false;
772
772
  // }
773
773
  });
774
- ZT_Gantt.attachEvent("onBeforeSave", (event) => {
774
+ javascriptGantt.attachEvent("onBeforeSave", (event) => {
775
775
  // console.log("onBeforeSave: ", event);
776
776
  });
777
- ZT_Gantt.attachEvent("onSave", (event) => {
777
+ javascriptGantt.attachEvent("onSave", (event) => {
778
778
  // console.log("onSave: ", event);
779
779
  });
780
780
 
781
781
  let fullscreen = false;
782
782
  function changeScreen() {
783
783
  if (fullscreen === false) {
784
- ZT_Gantt.requestFullScreen();
785
- // ZT_Gantt.openTask(3);
784
+ javascriptGantt.requestFullScreen();
785
+ // javascriptgantt.openTask(3);
786
786
  } else {
787
- ZT_Gantt.exitFullScreen();
787
+ javascriptGantt.exitFullScreen();
788
788
  }
789
789
  }
790
790
 
791
791
  function changeZoom(e) {
792
- ZT_Gantt.options.zoomLevel = e.target.value;
792
+ javascriptGantt.options.zoomLevel = e.target.value;
793
793
  if (e.target.value === "month" || e.target.value === "quarter") {
794
- ZT_Gantt.options.startDate = "2024-01-01T11:46:17.775Z";
795
- ZT_Gantt.options.endDate = "2024-12-31T11:46:17.775Z";
794
+ javascriptGantt.options.startDate = "2024-01-01T11:46:17.775Z";
795
+ javascriptGantt.options.endDate = "2024-12-31T11:46:17.775Z";
796
796
  } else if (e.target.value === "year") {
797
- ZT_Gantt.options.startDate = "2022-01-01T11:46:17.775Z";
798
- ZT_Gantt.options.endDate = "2024-12-31T11:46:17.775Z";
797
+ javascriptGantt.options.startDate = "2022-01-01T11:46:17.775Z";
798
+ javascriptGantt.options.endDate = "2024-12-31T11:46:17.775Z";
799
799
  } else {
800
- ZT_Gantt.options.startDate = "2024-03-01T11:46:17.775Z";
801
- ZT_Gantt.options.endDate = "2024-03-30T11:46:17.775Z";
800
+ javascriptGantt.options.startDate = "2024-03-01T11:46:17.775Z";
801
+ javascriptGantt.options.endDate = "2024-03-30T11:46:17.775Z";
802
802
  }
803
- ZT_Gantt.zoomInit();
803
+ javascriptGantt.zoomInit();
804
804
  }
805
805
 
806
806
  function changeLang(e) {
807
- ZT_Gantt.setLocalLang(e.target.value);
807
+ javascriptGantt.setLocalLang(e.target.value);
808
808
  }
809
809
 
810
810
  function changeCollapse(e) {
811
811
  if (e.target.checked === true) {
812
- ZT_Gantt.collapseAll();
812
+ javascriptGantt.collapseAll();
813
813
  } else {
814
- ZT_Gantt.expandAll();
814
+ javascriptGantt.expandAll();
815
815
  }
816
816
  }
817
817
 
818
818
  function changeToday(e) {
819
819
  if (event.target.checked === true) {
820
- ZT_Gantt.addTodayFlag();
820
+ javascriptGantt.addTodayFlag();
821
821
  } else {
822
- ZT_Gantt.removeTodayFlag();
822
+ javascriptGantt.removeTodayFlag();
823
823
  }
824
824
  }
825
825
 
826
826
  function exportChange(e) {
827
- let stylesheet = [
828
- "https://zehntech.github.io/js-gantt/gantt.css",
829
- "https://zehntech.github.io/js-gantt/style.css",
830
- ];
827
+ let stylesheet = [];
831
828
  if (e.target.value === "png") {
832
- ZT_Gantt.exportToPNG("jsGanttChart", stylesheet);
829
+ javascriptGantt.exportToPNG("jsGanttChart", stylesheet);
833
830
  } else if (e.target.value === "pdf") {
834
- ZT_Gantt.exportToPDF("jsGanttChart", stylesheet);
831
+ javascriptGantt.exportToPDF("jsGanttChart", stylesheet);
835
832
  } else {
836
- ZT_Gantt.exportToExcel("jsGanttChart");
833
+ javascriptGantt.exportToExcel("jsGanttChart");
837
834
  }
838
835
  e.target.value = "";
839
836
  }
840
837
 
841
838
  function autoScheduling() {
842
- ZT_Gantt.autoScheduling();
839
+ javascriptGantt.autoScheduling();
843
840
  }
844
841
  function addTask() {
845
- ZT_Gantt.addTask({
842
+ javascriptGantt.addTask({
846
843
  id: 5354653546,
847
844
  tracker_id: 4,
848
845
  project_id: 86,
@@ -874,18 +871,18 @@
874
871
  });
875
872
  // setTimeout(()=>{
876
873
 
877
- // ZT_Gantt.openTask(280);
874
+ // javascriptgantt.openTask(280);
878
875
  // },0)
879
- // ZT_Gantt.parse(data);
880
- ZT_Gantt.render();
881
- // ZT_Gantt.deleteLink(1);
876
+ // javascriptgantt.parse(data);
877
+ javascriptGantt.render();
878
+ // javascriptgantt.deleteLink(1);
882
879
  }
883
880
 
884
881
  // get the position of the cell
885
- // console.log(ZT_Gantt.posFromDate(new Date()));
882
+ // console.log(javascriptgantt.posFromDate(new Date()));
886
883
 
887
884
  // iterate over each task
888
- // ZT_Gantt.eachTask((task)=>{
885
+ // javascriptgantt.eachTask((task)=>{
889
886
  // console.log(task._id,"task _id ?????????????????????????????????");
890
887
  // })
891
888
 
@@ -899,7 +896,7 @@
899
896
  cssStyle.setAttribute("rel", "stylesheet");
900
897
  cssStyle.setAttribute("href", "src/theme/dark.css");
901
898
  document.getElementsByTagName("head")[0].append(cssStyle);
902
- localStorage.setItem('jsGantt-theme', 'dark');
899
+ localStorage.setItem('javascriptgantt-theme', 'dark');
903
900
 
904
901
  root.style.setProperty("--bg-color", "#333332");
905
902
  root.style.setProperty("--text-color", "#fff");
@@ -915,24 +912,24 @@
915
912
  root.style.setProperty("--text-secondary-color", "#fff");
916
913
  root.style.setProperty("--index-primary-color", "#4ca0fff2");
917
914
  root.style.setProperty("--index-primary-hover-color", "#3585e0f2");
918
- localStorage.setItem('jsGantt-theme', 'light');
915
+ localStorage.setItem('javascriptgantt-theme', 'light');
919
916
  }
920
917
  }
921
918
 
922
919
  this.changeTheme(jsGanttTheme == 'dark');
923
920
 
924
921
  let getScale = () => {
925
- console.log(ZT_Gantt.getScale());
922
+ console.log(javascriptGantt.getScale());
926
923
  };
927
924
 
928
925
  function searchTask(e) {
929
926
  let isFilter = e.target.value.trim() !== "";
930
- ZT_Gantt.filterTask((task) => {
927
+ javascriptGantt.filterTask((task) => {
931
928
  return task.text.toLowerCase().includes(e.target.value.toLowerCase());
932
929
  }, isFilter, true);
933
930
  }
934
931
  function addCol() {
935
- ZT_Gantt.options.columns.push({
932
+ javascriptGantt.options.columns.push({
936
933
  name: "progress",
937
934
  width: 245,
938
935
  min_width: 80,
@@ -945,12 +942,12 @@
945
942
  return `<span>${task.progress || 0}</span>`;
946
943
  },
947
944
  });
948
- ZT_Gantt.render();
945
+ javascriptGantt.render();
949
946
  }
950
947
 
951
948
  function removeCol() {
952
- ZT_Gantt.options.columns.splice(ZT_Gantt.options.columns.length - 1, 1);
953
- ZT_Gantt.render();
949
+ javascriptGantt.options.columns.splice(javascriptGantt.options.columns.length - 1, 1);
950
+ javascriptGantt.render();
954
951
  }
955
952
 
956
953
  function startTour() {
@@ -1098,8 +1095,8 @@
1098
1095
  });
1099
1096
  }
1100
1097
  let intro = `
1101
- <h2 style="font-size: 18px; margin-bottom: 5px; font-weight: 600; text-align:center">jsGantt Chart</h2>
1102
- <p style="line-height: 18px; text-align: justify;margin-bottom: 5px;">Welcome to the jsGantt Chart Library.
1098
+ <h2 style="font-size: 18px; margin-bottom: 5px; font-weight: 600; text-align:center">javascriptgantt Chart</h2>
1099
+ <p style="line-height: 18px; text-align: justify;margin-bottom: 5px;">Welcome to the javascriptgantt Chart Library.
1103
1100
  This library provides a powerful set of tools and functionalities to create interactive Gantt charts for project management. This documentation will guide you through the installation process,
1104
1101
  usage instructions, and available features of the library.</p>
1105
1102
  <p>Click on "Start Tour" to start the tour.</p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascriptgantt",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "description": "An open source JavaScript Gantt. This library provides a powerful set of tools and functionalities to create interactive Gantt charts for project management.",
5
5
  "main": "src/gantt.js",
6
6
  "scripts": {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/Sunilsolankiji/jsgantt"
11
+ "url": "git+https://github.com/Sunilsolankiji/javascriptgantt"
12
12
  },
13
13
  "keywords": [
14
14
  "gantt",
@@ -17,14 +17,15 @@
17
17
  "scheduler",
18
18
  "timeline",
19
19
  "jsganttchart",
20
- "jsgantt"
20
+ "jsgantt",
21
+ "javascriptgantt"
21
22
  ],
22
23
  "author": "Sunil Solanki",
23
24
  "license": "MIT",
24
25
  "bugs": {
25
- "url": "https://github.com/Sunilsolankiji/jsgantt/issues"
26
+ "url": "https://github.com/Sunilsolankiji/javascriptgantt/issues"
26
27
  },
27
- "homepage": "https://github.com/Sunilsolankiji/jsgantt#readme",
28
+ "homepage": "https://github.com/Sunilsolankiji/javascriptgantt#readme",
28
29
  "devDependencies": {
29
30
  "@eslint/js": "^9.6.0",
30
31
  "eslint": "^9.6.0",
package/readme.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  ## Introduction
5
- Welcome to the documentation for [javascriptgantt](https://sunilsolankiji.github.io/jsgantt/) Chart Library. This library provides a powerful set of tools and functionalities to create interactive Gantt charts for project management. This documentation will guide you through the installation process, usage instructions, and available features of the library.
5
+ Welcome to the documentation for [javascriptgantt](https://sunilsolankiji.github.io/javascriptgantt/) Chart Library. This library provides a powerful set of tools and functionalities to create interactive Gantt charts for project management. This documentation will guide you through the installation process, usage instructions, and available features of the library.
6
6
 
7
7
 
8
8
  ## Table of Contents
@@ -22,7 +22,7 @@ To integrate the Gantt Chart Library, adhere to the steps below:
22
22
  3. Link the library files in your HTML file.
23
23
  4. You're now ready to start using the javascriptgantt Chart Library!
24
24
 
25
- <a href="https://sunilsolankiji.github.io/jsgantt/">
25
+ <a href="https://sunilsolankiji.github.io/javascriptgantt/">
26
26
  <img src="./src/assets/images/jsgantt-screenshot.png">
27
27
  </a>
28
28
 
@@ -104,7 +104,7 @@ gantt.render();
104
104
 
105
105
  **Note:** Remember to call `gantt.render();` whenever you wish to visualize the updated data.
106
106
 
107
- [Live demo](https://sunilsolankiji.github.io/jsgantt/)
107
+ [Live demo](https://sunilsolankiji.github.io/javascriptgantt/)
108
108
 
109
109
  **Complete Documentation:** [javascriptgantt Documentation](./docs/Gantt-Chart-Documentation.pdf)
110
110
 
@@ -115,7 +115,7 @@ gantt.render();
115
115
 
116
116
  * **Task Linking:** Four types - finish-to-start, start-to-start, finish-to-finish, start-to-finish.
117
117
 
118
- <a href="https://sunilsolankiji.github.io/jsgantt/">
118
+ <a href="https://sunilsolankiji.github.io/javascriptgantt/">
119
119
  <img src="./src/assets/images/links.gif">
120
120
  </a>
121
121
 
@@ -125,7 +125,7 @@ gantt.render();
125
125
  * **Grid:** Columns in the grid are fully customizable.
126
126
  * **Customization:** Modify the time scale, task edit form, and much more.
127
127
 
128
- <a href="https://sunilsolankiji.github.io/jsgantt/">
128
+ <a href="https://sunilsolankiji.github.io/javascriptgantt/">
129
129
  <img src="./src/assets/images/popup.gif">
130
130
  </a>
131
131
 
@@ -139,14 +139,14 @@ gantt.render();
139
139
  * **Mouse Scroll:** Scroll timeline using mouse click.
140
140
  * **Aesthetics:** Customize the task colors via a color picker.
141
141
 
142
- <a href="https://sunilsolankiji.github.io/jsgantt/">
142
+ <a href="https://sunilsolankiji.github.io/javascriptgantt/">
143
143
  <img src="./src/assets/images/taskColor.gif">
144
144
  </a>
145
145
 
146
146
  * **Localization:** Multilingual support to cater to a global audience.
147
147
  * **Themes:** Dark mode for those late-night work sessions.
148
148
 
149
- <a href="https://sunilsolankiji.github.io/jsgantt/">
149
+ <a href="https://sunilsolankiji.github.io/javascriptgantt/">
150
150
  <img src="./src/assets/images/theme.gif">
151
151
  </a>
152
152
 
package/src/gantt.js CHANGED
@@ -15,7 +15,7 @@
15
15
  * ========================================================= */
16
16
 
17
17
  (function (global) {
18
- class jsGantt {
18
+ class javascriptgantt {
19
19
  #arrangeData = true;
20
20
  #ganttHeight = 0;
21
21
  #debounceTimers = new Map();
@@ -5001,12 +5001,12 @@
5001
5001
  }
5002
5002
 
5003
5003
  // export Gantt as PNG
5004
- exportToPNG(name = "jsGantt", styleSheet) {
5004
+ exportToPNG(name = "javascriptgantt", styleSheet) {
5005
5005
  this.getFile(name, "png", styleSheet);
5006
5006
  }
5007
5007
 
5008
5008
  // export Gantt as PDF
5009
- exportToPDF(name = "jsGantt", styleSheet) {
5009
+ exportToPDF(name = "javascriptgantt", styleSheet) {
5010
5010
  this.getFile(name, "pdf", styleSheet);
5011
5011
  }
5012
5012
 
@@ -5014,7 +5014,7 @@
5014
5014
  * Method to export Gantt as Excel.
5015
5015
  * @param { string } name - Name of the exported excel file.
5016
5016
  */
5017
- exportToExcel(name = "jsGantt") {
5017
+ exportToExcel(name = "javascriptgantt") {
5018
5018
  let csv = "";
5019
5019
  const regexIgnorePattern =
5020
5020
  /<[^>]+?\sjs-gantt-ignore=(["'])(true)\1[^>]*>.*?<\/[^>]+?>/g;
@@ -5081,7 +5081,7 @@
5081
5081
  }
5082
5082
 
5083
5083
  // Method for calling api
5084
- getFile(filename = "jsGantt", type, styleSheet) {
5084
+ getFile(filename = "javascriptgantt", type, styleSheet) {
5085
5085
  const apiUrl = this.options.exportApi;
5086
5086
 
5087
5087
  if (!this.options.exportApi) {
@@ -9667,5 +9667,5 @@
9667
9667
  }
9668
9668
  }
9669
9669
 
9670
- global.jsGantt = jsGantt;
9670
+ global.javascriptgantt = javascriptgantt;
9671
9671
  })(this);