chore: build
This commit is contained in:
parent
0e6e0154b4
commit
ab9ecf753f
97
dist/frappe-gantt.css
vendored
97
dist/frappe-gantt.css
vendored
@ -81,9 +81,6 @@
|
|||||||
.gantt .grid-row {
|
.gantt .grid-row {
|
||||||
fill: #ffffff;
|
fill: #ffffff;
|
||||||
}
|
}
|
||||||
.gantt .grid-row:nth-child(even) {
|
|
||||||
fill: #f5f5f5;
|
|
||||||
}
|
|
||||||
.gantt .row-line {
|
.gantt .row-line {
|
||||||
stroke: #ebeff2;
|
stroke: #ebeff2;
|
||||||
}
|
}
|
||||||
@ -104,7 +101,7 @@
|
|||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
.gantt .holiday-highlight {
|
.gantt .holiday-highlight {
|
||||||
fill: #EEE;
|
fill: #f3f4f7;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
.gantt .month-highlight {
|
.gantt .month-highlight {
|
||||||
@ -120,73 +117,96 @@
|
|||||||
stroke: #666;
|
stroke: #666;
|
||||||
stroke-width: 1.4;
|
stroke-width: 1.4;
|
||||||
}
|
}
|
||||||
.gantt .bar {
|
.gantt .bar-wrapper .bar {
|
||||||
fill: #b8c2cc;
|
fill: #fff;
|
||||||
stroke: #8d99a6;
|
stroke: #fff;
|
||||||
stroke-width: 0;
|
stroke-width: 0;
|
||||||
transition: stroke-width 0.3s ease;
|
transition: stroke-width 0.3s ease;
|
||||||
}
|
}
|
||||||
.gantt .bar-progress {
|
.gantt .bar-progress {
|
||||||
fill: #acacfa;
|
fill: #dedfe0;
|
||||||
|
}
|
||||||
|
.gantt .date-highlight {
|
||||||
|
fill: #e8e8e8;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
.gantt .bar-expected-progress {
|
.gantt .bar-expected-progress {
|
||||||
fill: #c4c4e9;
|
fill: #c4c4e9;
|
||||||
}
|
}
|
||||||
.gantt .bar-invalid {
|
.gantt .bar-invalid {
|
||||||
fill: transparent;
|
fill: transparent;
|
||||||
stroke: #8d99a6;
|
stroke: #fff;
|
||||||
stroke-width: 1;
|
stroke-width: 1;
|
||||||
stroke-dasharray: 5;
|
stroke-dasharray: 5;
|
||||||
}
|
}
|
||||||
.gantt .bar-invalid ~ .bar-label {
|
.gantt .bar-invalid ~ .bar-label {
|
||||||
fill: #555;
|
fill: #fff;
|
||||||
}
|
}
|
||||||
.gantt .bar-label {
|
.gantt .bar-label {
|
||||||
fill: #fff;
|
fill: #333;
|
||||||
dominant-baseline: central;
|
dominant-baseline: central;
|
||||||
font-size: 12px;
|
font-family: Helvetica;
|
||||||
font-weight: 500;
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
.gantt .bar-label.big {
|
.gantt .bar-label.big {
|
||||||
fill: #555;
|
fill: #333;
|
||||||
text-anchor: start;
|
text-anchor: start;
|
||||||
}
|
}
|
||||||
|
.gantt .bar-wrapper.important .bar {
|
||||||
|
fill: #94c4f4;
|
||||||
|
}
|
||||||
|
.gantt .bar-wrapper.important .bar-progress {
|
||||||
|
fill: #2c94ec;
|
||||||
|
}
|
||||||
|
.gantt .bar-wrapper.important .bar-label {
|
||||||
|
fill: #fff;
|
||||||
|
}
|
||||||
|
.gantt .bar-wrapper.important .handle {
|
||||||
|
fill: #94c4f4;
|
||||||
|
}
|
||||||
.gantt .handle {
|
.gantt .handle {
|
||||||
fill: #ddd;
|
fill: #dcdce4;
|
||||||
cursor: ew-resize;
|
cursor: ew-resize;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
transition: opacity 0.3s ease;
|
transition: opacity 0.3s ease;
|
||||||
}
|
}
|
||||||
.gantt .bar-wrapper {
|
.gantt:hover .handle {
|
||||||
cursor: pointer;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
.gantt .bar-wrapper:hover .bar {
|
|
||||||
fill: #a9b5c1;
|
|
||||||
}
|
|
||||||
.gantt .bar-wrapper:hover .bar-progress {
|
|
||||||
fill: #9494f9;
|
|
||||||
}
|
|
||||||
.gantt .bar-wrapper:hover .handle {
|
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
.gantt .bar-wrapper.active .bar {
|
.gantt .bar-wrapper {
|
||||||
fill: #a9b5c1;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.gantt .bar-wrapper.active .bar-progress {
|
.gantt .bar-wrapper .bar {
|
||||||
fill: #9494f9;
|
outline: groove 1px black;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
.gantt .bar-wrapper.important .bar {
|
||||||
|
outline: none;
|
||||||
|
outline-width: 1.5px;
|
||||||
|
}
|
||||||
|
.gantt .bar-wrapper.important .bar:active {
|
||||||
|
outline: 1px dotted;
|
||||||
|
}
|
||||||
|
.gantt .bar-wrapper:hover .bar {
|
||||||
|
outline-width: 1.5px;
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
}
|
||||||
|
.gantt .bar-wrapper:hover .date-highlight {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.gantt .bar-wrapper.active .bar {
|
||||||
|
outline-style: dotted;
|
||||||
}
|
}
|
||||||
.gantt .lower-text,
|
.gantt .lower-text,
|
||||||
.gantt .upper-text {
|
.gantt .upper-text {
|
||||||
font-size: 12px;
|
font-size: 14px;
|
||||||
text-anchor: middle;
|
text-anchor: middle;
|
||||||
}
|
}
|
||||||
|
.gantt .lower-text,
|
||||||
.gantt .upper-text {
|
.gantt .upper-text {
|
||||||
fill: #555;
|
|
||||||
}
|
|
||||||
.gantt .lower-text {
|
|
||||||
fill: #333;
|
fill: #333;
|
||||||
}
|
}
|
||||||
.gantt .hide {
|
.gantt .hide {
|
||||||
@ -203,14 +223,17 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
background: rgba(0, 0, 0, 0.8);
|
background: rgb(0, 0, 0);
|
||||||
padding: 0;
|
padding: 0;
|
||||||
color: #959da5;
|
color: #959da5;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
border: 1px solid rgb(0, 0, 0);
|
||||||
}
|
}
|
||||||
.gantt-container .popup-wrapper .title {
|
.gantt-container .popup-wrapper .title {
|
||||||
border-bottom: 3px solid #acacfa;
|
border-bottom: 1px solid #dedfe0;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
.gantt-container .popup-wrapper .subtitle {
|
.gantt-container .popup-wrapper .subtitle {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
@ -221,5 +244,5 @@
|
|||||||
height: 5px;
|
height: 5px;
|
||||||
margin: 0 0 0 -5px;
|
margin: 0 0 0 -5px;
|
||||||
border: 5px solid transparent;
|
border: 5px solid transparent;
|
||||||
border-top-color: rgba(0, 0, 0, 0.8);
|
border-bottom-color: rgba(0, 0, 0, 0.8);
|
||||||
}
|
}
|
||||||
94
dist/frappe-gantt.js
vendored
94
dist/frappe-gantt.js
vendored
@ -9,6 +9,21 @@ var Gantt = (function () {
|
|||||||
const SECOND = "second";
|
const SECOND = "second";
|
||||||
const MILLISECOND = "millisecond";
|
const MILLISECOND = "millisecond";
|
||||||
|
|
||||||
|
const SHORTENED = {
|
||||||
|
January: "Jan",
|
||||||
|
February: "Feb",
|
||||||
|
March: "Mar",
|
||||||
|
April: "Apr",
|
||||||
|
May: "May",
|
||||||
|
June: "Jun",
|
||||||
|
July: "Jul",
|
||||||
|
August: "Aug",
|
||||||
|
September: "Sep",
|
||||||
|
October: "Oct",
|
||||||
|
November: "Nov",
|
||||||
|
December: "Dec"
|
||||||
|
};
|
||||||
|
|
||||||
var date_utils = {
|
var date_utils = {
|
||||||
parse_duration(duration) {
|
parse_duration(duration) {
|
||||||
const regex = /([0-9])+(y|m|d|h|min|s|ms)/gm;
|
const regex = /([0-9])+(y|m|d|h|min|s|ms)/gm;
|
||||||
@ -101,7 +116,7 @@ var Gantt = (function () {
|
|||||||
SSS: values[6],
|
SSS: values[6],
|
||||||
D: values[2],
|
D: values[2],
|
||||||
MMMM: month_name_capitalized,
|
MMMM: month_name_capitalized,
|
||||||
MMM: month_name_capitalized,
|
MMM: SHORTENED[month_name_capitalized],
|
||||||
};
|
};
|
||||||
|
|
||||||
let str = format_string;
|
let str = format_string;
|
||||||
@ -422,7 +437,7 @@ var Gantt = (function () {
|
|||||||
this.duration *
|
this.duration *
|
||||||
(this.task.progress / 100) || 0;
|
(this.task.progress / 100) || 0;
|
||||||
this.group = createSVG("g", {
|
this.group = createSVG("g", {
|
||||||
class: "bar-wrapper " + (this.task.custom_class || ""),
|
class: "bar-wrapper " + (this.task.custom_class || "") + (this.task.important && 'important'),
|
||||||
"data-id": this.task.id,
|
"data-id": this.task.id,
|
||||||
});
|
});
|
||||||
this.bar_group = createSVG("g", {
|
this.bar_group = createSVG("g", {
|
||||||
@ -463,11 +478,11 @@ var Gantt = (function () {
|
|||||||
|
|
||||||
draw() {
|
draw() {
|
||||||
this.draw_bar();
|
this.draw_bar();
|
||||||
|
this.draw_progress_bar();
|
||||||
if (this.gantt.options.show_expected_progress) {
|
if (this.gantt.options.show_expected_progress) {
|
||||||
this.prepare_expected_progress_values();
|
this.prepare_expected_progress_values();
|
||||||
this.draw_expected_progress_bar();
|
this.draw_expected_progress_bar();
|
||||||
}
|
}
|
||||||
this.draw_progress_bar();
|
|
||||||
this.draw_label();
|
this.draw_label();
|
||||||
this.draw_resize_handles();
|
this.draw_resize_handles();
|
||||||
|
|
||||||
@ -528,12 +543,26 @@ var Gantt = (function () {
|
|||||||
class: "bar-progress",
|
class: "bar-progress",
|
||||||
append_to: this.bar_group,
|
append_to: this.bar_group,
|
||||||
});
|
});
|
||||||
|
const x = (date_utils.diff(this.task._start, this.gantt.gantt_start, 'hour') /
|
||||||
|
this.gantt.options.step) *
|
||||||
|
this.gantt.options.column_width;
|
||||||
|
|
||||||
|
this.$date_highlight = createSVG("rect", {
|
||||||
|
x,
|
||||||
|
y: this.gantt.options.header_height - 17,
|
||||||
|
width: this.width,
|
||||||
|
height: this.height * 0.8,
|
||||||
|
rx: 12,
|
||||||
|
class: "date-highlight",
|
||||||
|
append_to: this.bar_group,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
animateSVG(this.$bar_progress, "width", 0, this.progress_width);
|
animateSVG(this.$bar_progress, "width", 0, this.progress_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_label() {
|
draw_label() {
|
||||||
let x_coord = this.x + 5;
|
let x_coord = this.x + this.$bar.getWidth() / 2;
|
||||||
|
|
||||||
if (this.task.thumbnail) {
|
if (this.task.thumbnail) {
|
||||||
x_coord = this.x + this.image_size + 5;
|
x_coord = this.x + this.image_size + 5;
|
||||||
@ -597,7 +626,7 @@ var Gantt = (function () {
|
|||||||
const handle_width = 8;
|
const handle_width = 8;
|
||||||
|
|
||||||
createSVG("rect", {
|
createSVG("rect", {
|
||||||
x: bar.getX() + bar.getWidth() - 9,
|
x: bar.getX() + bar.getWidth() + handle_width - 4,
|
||||||
y: bar.getY() + 1,
|
y: bar.getY() + 1,
|
||||||
width: handle_width,
|
width: handle_width,
|
||||||
height: this.height - 2,
|
height: this.height - 2,
|
||||||
@ -608,7 +637,7 @@ var Gantt = (function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
createSVG("rect", {
|
createSVG("rect", {
|
||||||
x: bar.getX() + 1,
|
x: bar.getX() - handle_width - 4,
|
||||||
y: bar.getY() + 1,
|
y: bar.getY() + 1,
|
||||||
width: handle_width,
|
width: handle_width,
|
||||||
height: this.height - 2,
|
height: this.height - 2,
|
||||||
@ -628,12 +657,12 @@ var Gantt = (function () {
|
|||||||
get_progress_polygon_points() {
|
get_progress_polygon_points() {
|
||||||
const bar_progress = this.$bar_progress;
|
const bar_progress = this.$bar_progress;
|
||||||
return [
|
return [
|
||||||
bar_progress.getEndX() - 5,
|
bar_progress.getEndX() - 6,
|
||||||
bar_progress.getY() + bar_progress.getHeight(),
|
bar_progress.getY() + bar_progress.getHeight() + 8,
|
||||||
bar_progress.getEndX() + 5,
|
bar_progress.getEndX() + 6,
|
||||||
bar_progress.getY() + bar_progress.getHeight(),
|
bar_progress.getY() + bar_progress.getHeight() + 8,
|
||||||
bar_progress.getEndX(),
|
bar_progress.getEndX(),
|
||||||
bar_progress.getY() + bar_progress.getHeight() - 8.66,
|
bar_progress.getY() + bar_progress.getHeight() + 0.5,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -656,7 +685,7 @@ var Gantt = (function () {
|
|||||||
this.gantt.hide_popup();
|
this.gantt.hide_popup();
|
||||||
this.group.classList.remove("active");
|
this.group.classList.remove("active");
|
||||||
} else {
|
} else {
|
||||||
this.show_popup();
|
this.show_popup(e.offsetX);
|
||||||
this.gantt.unselect_all();
|
this.gantt.unselect_all();
|
||||||
this.group.classList.add("active");
|
this.group.classList.add("active");
|
||||||
}
|
}
|
||||||
@ -674,7 +703,7 @@ var Gantt = (function () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
show_popup() {
|
show_popup(x) {
|
||||||
if (this.gantt.bar_being_dragged) return;
|
if (this.gantt.bar_being_dragged) return;
|
||||||
|
|
||||||
const start_date = date_utils.format(
|
const start_date = date_utils.format(
|
||||||
@ -690,6 +719,7 @@ var Gantt = (function () {
|
|||||||
const subtitle = start_date + " - " + end_date;
|
const subtitle = start_date + " - " + end_date;
|
||||||
|
|
||||||
this.gantt.show_popup({
|
this.gantt.show_popup({
|
||||||
|
x,
|
||||||
target_element: this.$bar,
|
target_element: this.$bar,
|
||||||
title: this.task.name,
|
title: this.task.name,
|
||||||
subtitle: subtitle,
|
subtitle: subtitle,
|
||||||
@ -925,10 +955,12 @@ var Gantt = (function () {
|
|||||||
label = this.group.querySelector(".bar-label"),
|
label = this.group.querySelector(".bar-label"),
|
||||||
img = this.group.querySelector('.bar-img');
|
img = this.group.querySelector('.bar-img');
|
||||||
|
|
||||||
|
|
||||||
let padding = 5;
|
let padding = 5;
|
||||||
let x_offset_label_img = this.image_size + 10;
|
let x_offset_label_img = this.image_size + 10;
|
||||||
|
const labelWidth = label.getBBox().width;
|
||||||
if (label.getBBox().width > bar.getWidth()) {
|
const barWidth = bar.getWidth();
|
||||||
|
if (labelWidth > barWidth) {
|
||||||
label.classList.add("big");
|
label.classList.add("big");
|
||||||
if (img) {
|
if (img) {
|
||||||
img.setAttribute('x', bar.getX() + bar.getWidth() + padding);
|
img.setAttribute('x', bar.getX() + bar.getWidth() + padding);
|
||||||
@ -942,9 +974,9 @@ var Gantt = (function () {
|
|||||||
if (img) {
|
if (img) {
|
||||||
img.setAttribute('x', bar.getX() + padding);
|
img.setAttribute('x', bar.getX() + padding);
|
||||||
img_mask.setAttribute('x', bar.getX() + padding);
|
img_mask.setAttribute('x', bar.getX() + padding);
|
||||||
label.setAttribute('x', bar.getX() + x_offset_label_img);
|
label.setAttribute('x', bar.getX() + barWidth / 2 + x_offset_label_img);
|
||||||
} else {
|
} else {
|
||||||
label.setAttribute('x', bar.getX() + padding);
|
label.setAttribute('x', bar.getX() + barWidth / 2 - labelWidth / 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -954,10 +986,10 @@ var Gantt = (function () {
|
|||||||
const bar = this.$bar;
|
const bar = this.$bar;
|
||||||
this.handle_group
|
this.handle_group
|
||||||
.querySelector(".handle.left")
|
.querySelector(".handle.left")
|
||||||
.setAttribute("x", bar.getX() + 1);
|
.setAttribute("x", bar.getX() - 12);
|
||||||
this.handle_group
|
this.handle_group
|
||||||
.querySelector(".handle.right")
|
.querySelector(".handle.right")
|
||||||
.setAttribute("x", bar.getEndX() - 9);
|
.setAttribute("x", bar.getEndX() + 4);
|
||||||
const handle = this.group.querySelector(".handle.progress");
|
const handle = this.group.querySelector(".handle.progress");
|
||||||
handle && handle.setAttribute("points", this.get_progress_polygon_points());
|
handle && handle.setAttribute("points", this.get_progress_polygon_points());
|
||||||
}
|
}
|
||||||
@ -999,7 +1031,7 @@ var Gantt = (function () {
|
|||||||
this.from_task.task._index +
|
this.from_task.task._index +
|
||||||
this.gantt.options.padding;
|
this.gantt.options.padding;
|
||||||
|
|
||||||
const end_x = this.to_task.$bar.getX() - this.gantt.options.padding / 2;
|
const end_x = this.to_task.$bar.getX() - this.gantt.options.padding / 2 - 7;
|
||||||
const end_y =
|
const end_y =
|
||||||
this.gantt.options.header_height +
|
this.gantt.options.header_height +
|
||||||
this.gantt.options.bar_height / 2 +
|
this.gantt.options.bar_height / 2 +
|
||||||
@ -1088,9 +1120,6 @@ var Gantt = (function () {
|
|||||||
if (!options.target_element) {
|
if (!options.target_element) {
|
||||||
throw new Error("target_element is required to show popup");
|
throw new Error("target_element is required to show popup");
|
||||||
}
|
}
|
||||||
if (!options.position) {
|
|
||||||
options.position = "left";
|
|
||||||
}
|
|
||||||
const target_element = options.target_element;
|
const target_element = options.target_element;
|
||||||
|
|
||||||
if (this.custom_html) {
|
if (this.custom_html) {
|
||||||
@ -1113,15 +1142,11 @@ var Gantt = (function () {
|
|||||||
position_meta = options.target_element.getBBox();
|
position_meta = options.target_element.getBBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.position === "left") {
|
this.parent.style.left = options.x - this.parent.clientWidth / 2 + "px";
|
||||||
this.parent.style.left =
|
this.parent.style.top = position_meta.y + position_meta.height + 10 + "px";
|
||||||
position_meta.x + (position_meta.width + 10) + "px";
|
|
||||||
this.parent.style.top = position_meta.y + "px";
|
|
||||||
|
|
||||||
this.pointer.style.transform = "rotateZ(90deg)";
|
this.pointer.style.left = this.parent.clientWidth / 2 + "px";
|
||||||
this.pointer.style.left = "-7px";
|
this.pointer.style.top = "-15px";
|
||||||
this.pointer.style.top = "2px";
|
|
||||||
}
|
|
||||||
|
|
||||||
// show
|
// show
|
||||||
this.parent.style.opacity = 1;
|
this.parent.style.opacity = 1;
|
||||||
@ -1602,13 +1627,10 @@ var Gantt = (function () {
|
|||||||
const x = (date_utils.diff(d, this.gantt_start, 'hour') /
|
const x = (date_utils.diff(d, this.gantt_start, 'hour') /
|
||||||
this.options.step) *
|
this.options.step) *
|
||||||
this.options.column_width;
|
this.options.column_width;
|
||||||
const height =
|
const height = (this.options.bar_height + this.options.padding) * this.tasks.length;
|
||||||
(this.options.bar_height + this.options.padding) * this.tasks.length +
|
|
||||||
this.options.header_height +
|
|
||||||
this.options.padding / 2;
|
|
||||||
createSVG('rect', {
|
createSVG('rect', {
|
||||||
x,
|
x,
|
||||||
y: 0,
|
y: this.options.header_height + this.options.padding / 2,
|
||||||
width: (this.view_is('Day') ? 1 : 2) * this.options.column_width,
|
width: (this.view_is('Day') ? 1 : 2) * this.options.column_width,
|
||||||
height,
|
height,
|
||||||
class: 'holiday-highlight',
|
class: 'holiday-highlight',
|
||||||
|
|||||||
2
dist/frappe-gantt.js.map
vendored
2
dist/frappe-gantt.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/frappe-gantt.min.css
vendored
2
dist/frappe-gantt.min.css
vendored
@ -1 +1 @@
|
|||||||
.dark>.gantt-container .gantt .grid-header{fill:#252525;stroke:#616161}.dark>.gantt-container .gantt .grid-row{fill:#252525}.dark>.gantt-container .gantt .grid-row:nth-child(even){fill:#3e3e3e}.dark>.gantt-container .gantt .row-line{stroke:#3e3e3e}.dark>.gantt-container .gantt .tick{stroke:#616161}.dark>.gantt-container .gantt .today-highlight{opacity:.2}.dark>.gantt-container .gantt .arrow{stroke:#eee}.dark>.gantt-container .gantt .bar{fill:#616161;stroke:none}.dark>.gantt-container .gantt .bar-progress{fill:#8a8aff}.dark>.gantt-container .gantt .bar-invalid{fill:rgba(0,0,0,0);stroke:#c6ccd2}.dark>.gantt-container .gantt .bar-invalid~.bar-label{fill:#ececec}.dark>.gantt-container .gantt .bar-label.big{fill:#ececec}.dark>.gantt-container .gantt .bar-wrapper:hover .bar{fill:#6e6e6e}.dark>.gantt-container .gantt .bar-wrapper:hover .bar-progress{fill:#a4a4ff}.dark>.gantt-container .gantt .bar-wrapper.active .bar{fill:#6e6e6e}.dark>.gantt-container .gantt .bar-wrapper.active .bar-progress{fill:#a4a4ff}.dark>.gantt-container .gantt .upper-text{fill:#a2a2a2}.dark>.gantt-container .gantt .lower-text{fill:#f7f7f7}.dark>.gantt-container .popup-wrapper{background-color:#333}.dark>.gantt-container .popup-wrapper .title{border-color:#a4a4ff}.dark>.gantt-container .popup-wrapper .pointer{border-top-color:#333}.gantt{user-select:none;-webkit-user-select:none}.gantt .grid-background{fill:none}.gantt .grid-header{fill:#fff;stroke:#e0e0e0;stroke-width:1.4}.gantt .grid-row{fill:#fff}.gantt .grid-row:nth-child(even){fill:#f5f5f5}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.2}.gantt .tick.thick{stroke:#000;stroke-width:.5}.gantt .today-highlight{fill:#f6e796;opacity:.5}.gantt .week-highlight{fill:#f6e796;opacity:.5}.gantt .holiday-highlight{fill:#eee;opacity:.5}.gantt .month-highlight{fill:#f6e796;opacity:.5}.gantt .year-highlight{fill:#f6e796;opacity:.5}.gantt .arrow{fill:none;stroke:#666;stroke-width:1.4}.gantt .bar{fill:#b8c2cc;stroke:#8d99a6;stroke-width:0;transition:stroke-width .3s ease}.gantt .bar-progress{fill:#acacfa}.gantt .bar-expected-progress{fill:#c4c4e9}.gantt .bar-invalid{fill:rgba(0,0,0,0);stroke:#8d99a6;stroke-width:1;stroke-dasharray:5}.gantt .bar-invalid~.bar-label{fill:#555}.gantt .bar-label{fill:#fff;dominant-baseline:central;font-size:12px;font-weight:500}.gantt .bar-label.big{fill:#555;text-anchor:start}.gantt .handle{fill:#ddd;cursor:ew-resize;opacity:0;visibility:hidden;transition:opacity .3s ease}.gantt .bar-wrapper{cursor:pointer;outline:none}.gantt .bar-wrapper:hover .bar{fill:#a9b5c1}.gantt .bar-wrapper:hover .bar-progress{fill:#9494f9}.gantt .bar-wrapper:hover .handle{visibility:visible;opacity:1}.gantt .bar-wrapper.active .bar{fill:#a9b5c1}.gantt .bar-wrapper.active .bar-progress{fill:#9494f9}.gantt .lower-text,.gantt .upper-text{font-size:12px;text-anchor:middle}.gantt .upper-text{fill:#555}.gantt .lower-text{fill:#333}.gantt .hide{display:none}.gantt-container{position:relative;overflow:auto;font-size:12px;height:500px}.gantt-container .popup-wrapper{position:absolute;top:0;left:0;background:rgba(0,0,0,.8);padding:0;color:#959da5;border-radius:3px}.gantt-container .popup-wrapper .title{border-bottom:3px solid #acacfa;padding:10px}.gantt-container .popup-wrapper .subtitle{padding:10px;color:#dfe2e5}.gantt-container .popup-wrapper .pointer{position:absolute;height:5px;margin:0 0 0 -5px;border:5px solid rgba(0,0,0,0);border-top-color:rgba(0,0,0,.8)}
|
.dark>.gantt-container .gantt .grid-header{fill:#252525;stroke:#616161}.dark>.gantt-container .gantt .grid-row{fill:#252525}.dark>.gantt-container .gantt .grid-row:nth-child(even){fill:#3e3e3e}.dark>.gantt-container .gantt .row-line{stroke:#3e3e3e}.dark>.gantt-container .gantt .tick{stroke:#616161}.dark>.gantt-container .gantt .today-highlight{opacity:.2}.dark>.gantt-container .gantt .arrow{stroke:#eee}.dark>.gantt-container .gantt .bar{fill:#616161;stroke:none}.dark>.gantt-container .gantt .bar-progress{fill:#8a8aff}.dark>.gantt-container .gantt .bar-invalid{fill:rgba(0,0,0,0);stroke:#c6ccd2}.dark>.gantt-container .gantt .bar-invalid~.bar-label{fill:#ececec}.dark>.gantt-container .gantt .bar-label.big{fill:#ececec}.dark>.gantt-container .gantt .bar-wrapper:hover .bar{fill:#6e6e6e}.dark>.gantt-container .gantt .bar-wrapper:hover .bar-progress{fill:#a4a4ff}.dark>.gantt-container .gantt .bar-wrapper.active .bar{fill:#6e6e6e}.dark>.gantt-container .gantt .bar-wrapper.active .bar-progress{fill:#a4a4ff}.dark>.gantt-container .gantt .upper-text{fill:#a2a2a2}.dark>.gantt-container .gantt .lower-text{fill:#f7f7f7}.dark>.gantt-container .popup-wrapper{background-color:#333}.dark>.gantt-container .popup-wrapper .title{border-color:#a4a4ff}.dark>.gantt-container .popup-wrapper .pointer{border-top-color:#333}.gantt{user-select:none;-webkit-user-select:none}.gantt .grid-background{fill:none}.gantt .grid-header{fill:#fff;stroke:#e0e0e0;stroke-width:1.4}.gantt .grid-row{fill:#fff}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.2}.gantt .tick.thick{stroke:#000;stroke-width:.5}.gantt .today-highlight{fill:#f6e796;opacity:.5}.gantt .week-highlight{fill:#f6e796;opacity:.5}.gantt .holiday-highlight{fill:#f3f4f7;opacity:.5}.gantt .month-highlight{fill:#f6e796;opacity:.5}.gantt .year-highlight{fill:#f6e796;opacity:.5}.gantt .arrow{fill:none;stroke:#666;stroke-width:1.4}.gantt .bar-wrapper .bar{fill:#fff;stroke:#fff;stroke-width:0;transition:stroke-width .3s ease}.gantt .bar-progress{fill:#dedfe0}.gantt .date-highlight{fill:#e8e8e8;display:none}.gantt .bar-expected-progress{fill:#c4c4e9}.gantt .bar-invalid{fill:rgba(0,0,0,0);stroke:#fff;stroke-width:1;stroke-dasharray:5}.gantt .bar-invalid~.bar-label{fill:#fff}.gantt .bar-label{fill:#333;dominant-baseline:central;font-family:Helvetica;font-size:14px;font-weight:400}.gantt .bar-label.big{fill:#333;text-anchor:start}.gantt .bar-wrapper.important .bar{fill:#94c4f4}.gantt .bar-wrapper.important .bar-progress{fill:#2c94ec}.gantt .bar-wrapper.important .bar-label{fill:#fff}.gantt .bar-wrapper.important .handle{fill:#94c4f4}.gantt .handle{fill:#dcdce4;cursor:ew-resize;opacity:0;visibility:hidden;transition:opacity .3s ease}.gantt:hover .handle{visibility:visible;opacity:1}.gantt .bar-wrapper{cursor:pointer}.gantt .bar-wrapper .bar{outline:groove 1px #000;border-radius:3px}.gantt .bar-wrapper.important .bar{outline:none;outline-width:1.5px}.gantt .bar-wrapper.important .bar:active{outline:1px dotted}.gantt .bar-wrapper:hover .bar{outline-width:1.5px;transition:transform .3s ease}.gantt .bar-wrapper:hover .date-highlight{display:block}.gantt .bar-wrapper.active .bar{outline-style:dotted}.gantt .lower-text,.gantt .upper-text{font-size:14px;text-anchor:middle}.gantt .lower-text,.gantt .upper-text{fill:#333}.gantt .hide{display:none}.gantt-container{position:relative;overflow:auto;font-size:12px;height:500px}.gantt-container .popup-wrapper{position:absolute;top:0;left:0;background:#000;padding:0;color:#959da5;border-radius:3px;border:1px solid #000}.gantt-container .popup-wrapper .title{border-bottom:1px solid #dedfe0;padding:10px;text-align:center;color:#fff}.gantt-container .popup-wrapper .subtitle{padding:10px;color:#dfe2e5}.gantt-container .popup-wrapper .pointer{position:absolute;height:5px;margin:0 0 0 -5px;border:5px solid rgba(0,0,0,0);border-bottom-color:rgba(0,0,0,.8)}
|
||||||
2
dist/frappe-gantt.min.js
vendored
2
dist/frappe-gantt.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/frappe-gantt.min.js.map
vendored
2
dist/frappe-gantt.min.js.map
vendored
File diff suppressed because one or more lines are too long
66
index.html
66
index.html
@ -34,48 +34,48 @@
|
|||||||
<script>
|
<script>
|
||||||
let tasks = [
|
let tasks = [
|
||||||
{
|
{
|
||||||
start: '2018-10-01',
|
start: '2024-10-01',
|
||||||
end: '2018-10-08',
|
end: '2024-10-08',
|
||||||
name: 'Redesign website',
|
name: 'Redesign website',
|
||||||
id: "Task 0",
|
id: "Task 0",
|
||||||
progress: 80
|
progress: 30
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
start: '2018-09-26',
|
start: '2024-09-26',
|
||||||
// Utilizes duration
|
// Utilizes duration
|
||||||
duration: '1m 4d',
|
duration: '6d',
|
||||||
name: 'Write new content',
|
name: 'Write new content',
|
||||||
id: "Task 1",
|
id: "Task 1",
|
||||||
progress: 5,
|
progress: 5,
|
||||||
dependencies: 'Task 0'
|
important: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
start: '2018-10-04',
|
start: '2024-10-04',
|
||||||
end: '2018-10-08',
|
end: '2024-10-08',
|
||||||
name: 'Apply new styles',
|
name: 'Apply new styles',
|
||||||
id: "Task 2",
|
id: "Task 2",
|
||||||
progress: 100,
|
progress: 80,
|
||||||
dependencies: 'Task 1'
|
dependencies: 'Task 1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
start: '2018-10-08',
|
start: '2024-10-08',
|
||||||
end: '2018-10-09',
|
end: '2024-10-09',
|
||||||
name: 'Review',
|
name: 'Review',
|
||||||
id: "Task 3",
|
id: "Task 3",
|
||||||
progress: 5,
|
progress: 5,
|
||||||
dependencies: 'Task 2'
|
dependencies: 'Task 2'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
start: '2018-10-08',
|
start: '2024-10-08',
|
||||||
end: '2018-10-10',
|
end: '2024-10-10',
|
||||||
name: 'Deploy',
|
name: 'Deploy',
|
||||||
id: "Task 4",
|
id: "Task 4",
|
||||||
progress: 0,
|
progress: 0,
|
||||||
// dependencies: 'Task 2'
|
// dependencies: 'Task 2'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
start: '2018-10-11',
|
start: '2024-10-11',
|
||||||
end: '2018-10-11',
|
end: '2024-10-11',
|
||||||
name: 'Go Live!',
|
name: 'Go Live!',
|
||||||
id: "Task 5",
|
id: "Task 5",
|
||||||
progress: 0,
|
progress: 0,
|
||||||
@ -95,24 +95,24 @@
|
|||||||
// tasks = [...tasks, ...Array.from({length: tasks.length * 3}, (_, i) => ({...tasks[i % 3], id: i}))]
|
// tasks = [...tasks, ...Array.from({length: tasks.length * 3}, (_, i) => ({...tasks[i % 3], id: i}))]
|
||||||
|
|
||||||
let gantt_chart = new Gantt(".gantt-target", tasks, {
|
let gantt_chart = new Gantt(".gantt-target", tasks, {
|
||||||
on_click: (task) => {
|
// on_click: (task) => {
|
||||||
console.log("Double Click", task);
|
// console.log("Double Click", task);
|
||||||
},
|
// },
|
||||||
on_double_click: (task) => {
|
// on_double_click: (task) => {
|
||||||
console.log("Double Click", task);
|
// console.log("Double Click", task);
|
||||||
},
|
// },
|
||||||
on_date_change: (task, start, end) => {
|
// on_date_change: (task, start, end) => {
|
||||||
console.log("Date change", task, start, end);
|
// console.log("Date change", task, start, end);
|
||||||
},
|
// },
|
||||||
on_progress_change: (task, progress) => {
|
// on_progress_change: (task, progress) => {
|
||||||
console.log("Progress Change", task, progress);
|
// console.log("Progress Change", task, progress);
|
||||||
},
|
// },
|
||||||
on_view_change: (mode) => {
|
// on_view_change: (mode) => {
|
||||||
console.log("View Change", mode);
|
// console.log("View Change", mode);
|
||||||
},
|
// },
|
||||||
on_hover: (task, x, y) => {
|
// on_hover: (task, x, y) => {
|
||||||
console.log("Hover", x, y);
|
// console.log("Hover", x, y);
|
||||||
},
|
// },
|
||||||
view_mode: "Day",
|
view_mode: "Day",
|
||||||
view_mode_padding: { DAY: "7d" },
|
view_mode_padding: { DAY: "7d" },
|
||||||
language: "en",
|
language: "en",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user