@seniorsistemas/angular-components 17.1.3 → 17.1.5
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/bundles/seniorsistemas-angular-components.umd.js +271 -117
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/gantt/components/gantt/bar.d.ts +1 -0
- package/components/gantt/components/gantt/gantt.d.ts +2 -4
- package/components/gantt/components/gantt/popup.d.ts +4 -1
- package/components/gantt/components/side-table/side-table.component.d.ts +4 -1
- package/components/gantt/gantt.component.d.ts +10 -1
- package/components/gantt/models/options.d.ts +5 -0
- package/components/gantt/models/view-mode.d.ts +3 -2
- package/esm2015/components/gantt/components/gantt/bar.js +61 -33
- package/esm2015/components/gantt/components/gantt/gantt-options.js +5 -1
- package/esm2015/components/gantt/components/gantt/gantt.js +113 -72
- package/esm2015/components/gantt/components/gantt/popup.js +37 -5
- package/esm2015/components/gantt/components/gantt/utils/date-utils.js +3 -2
- package/esm2015/components/gantt/components/side-table/side-table.component.js +9 -3
- package/esm2015/components/gantt/gantt.component.js +53 -5
- package/esm2015/components/gantt/gantt.module.js +3 -2
- package/esm2015/components/gantt/models/options.js +1 -1
- package/esm2015/components/gantt/models/view-mode.js +3 -2
- package/esm5/components/gantt/components/gantt/bar.js +62 -34
- package/esm5/components/gantt/components/gantt/gantt-options.js +5 -1
- package/esm5/components/gantt/components/gantt/gantt.js +115 -74
- package/esm5/components/gantt/components/gantt/popup.js +30 -5
- package/esm5/components/gantt/components/gantt/utils/date-utils.js +3 -2
- package/esm5/components/gantt/components/side-table/side-table.component.js +9 -3
- package/esm5/components/gantt/gantt.component.js +53 -5
- package/esm5/components/gantt/gantt.module.js +3 -2
- package/esm5/components/gantt/models/options.js +1 -1
- package/esm5/components/gantt/models/view-mode.js +3 -2
- package/fesm2015/seniorsistemas-angular-components.js +276 -115
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +271 -117
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -8096,11 +8096,12 @@ class DateUtils {
|
|
|
8096
8096
|
.startOf("month")
|
|
8097
8097
|
.format("MMMM");
|
|
8098
8098
|
const monthNameCapitalized = monthName.charAt(0).toUpperCase() + monthName.slice(1);
|
|
8099
|
-
const dateToFormat = moment$7(date);
|
|
8099
|
+
const dateToFormat = moment$7(date).locale(lang);
|
|
8100
8100
|
const format_map = {
|
|
8101
8101
|
YYYY: dateToFormat.format("YYYY"),
|
|
8102
8102
|
MM: dateToFormat.format("MM"),
|
|
8103
8103
|
DD: dateToFormat.format("DD"),
|
|
8104
|
+
ddd: dateToFormat.format("ddd").toUpperCase().replace(".", ""),
|
|
8104
8105
|
HH: dateToFormat.format("HH"),
|
|
8105
8106
|
mm: dateToFormat.format("mm"),
|
|
8106
8107
|
ss: dateToFormat.format("ss"),
|
|
@@ -8319,17 +8320,19 @@ $.attr = (element, attr, value) => {
|
|
|
8319
8320
|
|
|
8320
8321
|
var ViewMode;
|
|
8321
8322
|
(function (ViewMode) {
|
|
8323
|
+
ViewMode["QuarterHour"] = "quarterHour";
|
|
8324
|
+
ViewMode["Hour"] = "hour";
|
|
8322
8325
|
ViewMode["QuarterDay"] = "quarterDay";
|
|
8323
8326
|
ViewMode["HalfDay"] = "halfDay";
|
|
8324
8327
|
ViewMode["Day"] = "day";
|
|
8325
8328
|
ViewMode["Week"] = "week";
|
|
8326
8329
|
ViewMode["Month"] = "month";
|
|
8327
8330
|
ViewMode["Year"] = "year";
|
|
8328
|
-
ViewMode["Hour"] = "hour";
|
|
8329
8331
|
})(ViewMode || (ViewMode = {}));
|
|
8330
8332
|
|
|
8331
8333
|
class Bar {
|
|
8332
8334
|
constructor(gantt, task) {
|
|
8335
|
+
this._isPopUpOpen = false;
|
|
8333
8336
|
this._setDefaults(gantt, task);
|
|
8334
8337
|
this._prepare();
|
|
8335
8338
|
this._draw();
|
|
@@ -8480,37 +8483,61 @@ class Bar {
|
|
|
8480
8483
|
}
|
|
8481
8484
|
}
|
|
8482
8485
|
_setupClickEvent() {
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
|
|
8486
|
-
|
|
8487
|
-
this.
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
|
|
8496
|
-
|
|
8486
|
+
//TODO
|
|
8487
|
+
if (this._gantt.options.hasPopup) {
|
|
8488
|
+
$.on(this.group, "focus " + this._gantt.options.popupTrigger, (e) => {
|
|
8489
|
+
// just finished a move action, wait for a few seconds
|
|
8490
|
+
if (!this._actionCompleted) {
|
|
8491
|
+
this._showPopup();
|
|
8492
|
+
this._gantt.unselect_all();
|
|
8493
|
+
this.group.classList.add("active");
|
|
8494
|
+
}
|
|
8495
|
+
}, null);
|
|
8496
|
+
$.on(this.group, "dblclick", (e) => {
|
|
8497
|
+
// just finished a move action, wait for a few seconds
|
|
8498
|
+
if (!this._actionCompleted) {
|
|
8499
|
+
this._gantt.trigger_event("onClick", [this.task]);
|
|
8500
|
+
}
|
|
8501
|
+
}, null);
|
|
8502
|
+
}
|
|
8503
|
+
else {
|
|
8504
|
+
$.on(this.group, "mouseenter", (e) => {
|
|
8505
|
+
if (!this._isPopUpOpen) {
|
|
8506
|
+
this._showPopup({
|
|
8507
|
+
x: e.clientX,
|
|
8508
|
+
y: this.group.getBoundingClientRect().top + 30,
|
|
8509
|
+
position: 'middle'
|
|
8510
|
+
});
|
|
8511
|
+
this._isPopUpOpen = true;
|
|
8512
|
+
}
|
|
8513
|
+
}, null);
|
|
8514
|
+
$.on(this.group, "mouseleave", (e) => {
|
|
8515
|
+
this._gantt.hide_popup();
|
|
8516
|
+
this._isPopUpOpen = false;
|
|
8517
|
+
}, null);
|
|
8518
|
+
$.on(this.group, "focus click", (e) => {
|
|
8519
|
+
if (!this._actionCompleted) {
|
|
8520
|
+
this._gantt.unselect_all();
|
|
8521
|
+
this.group.classList.add("active");
|
|
8522
|
+
this._gantt.trigger_event("onClick", [this.task]);
|
|
8523
|
+
}
|
|
8524
|
+
}, null);
|
|
8525
|
+
}
|
|
8497
8526
|
}
|
|
8498
|
-
_showPopup() {
|
|
8527
|
+
_showPopup(args) {
|
|
8499
8528
|
if (this._gantt.bar_being_dragged) {
|
|
8500
8529
|
return;
|
|
8501
8530
|
}
|
|
8502
|
-
const
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
task: this.task,
|
|
8513
|
-
});
|
|
8531
|
+
const subtitle = {};
|
|
8532
|
+
if (!this._gantt.options.showOnlyHours) {
|
|
8533
|
+
subtitle.startDate = DateUtils.format(this.task.start, 'DD/MM/YYYY', this._gantt.options.language);
|
|
8534
|
+
subtitle.endDate = DateUtils.format(this.task.end, 'DD/MM/YYYY', this._gantt.options.language);
|
|
8535
|
+
}
|
|
8536
|
+
if (!this._gantt.options.showOnlyDays) {
|
|
8537
|
+
subtitle.startHour = DateUtils.format(this.task.start, 'HH:mm:ss', this._gantt.options.language);
|
|
8538
|
+
subtitle.endHour = DateUtils.format(this.task.end, 'HH:mm:ss', this._gantt.options.language);
|
|
8539
|
+
}
|
|
8540
|
+
this._gantt.show_popup(Object.assign({ target_element: this.element, title: this.task.name, subtitle: subtitle, task: this.task }, args));
|
|
8514
8541
|
}
|
|
8515
8542
|
_computeStartEndDate() {
|
|
8516
8543
|
const bar = this.element;
|
|
@@ -8522,11 +8549,14 @@ class Bar {
|
|
|
8522
8549
|
}
|
|
8523
8550
|
_computeX() {
|
|
8524
8551
|
const { step, columnWidth } = this._gantt.options;
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8552
|
+
let x;
|
|
8553
|
+
if (this._gantt.view_is([ViewMode.QuarterHour, ViewMode.Hour, ViewMode.QuarterDay, ViewMode.HalfDay, ViewMode.Day])) {
|
|
8554
|
+
const diff = DateUtils.diff(this.task.start, this._gantt.minDate, "minutes");
|
|
8555
|
+
x = (diff / step) * (columnWidth / 60);
|
|
8556
|
+
}
|
|
8557
|
+
else {
|
|
8558
|
+
const diff = DateUtils.diff(this.task.start, this._gantt.minDate, "hour");
|
|
8559
|
+
x = (diff / step) * (columnWidth);
|
|
8530
8560
|
}
|
|
8531
8561
|
return x;
|
|
8532
8562
|
}
|
|
@@ -8568,6 +8598,7 @@ class Popup {
|
|
|
8568
8598
|
this.make();
|
|
8569
8599
|
}
|
|
8570
8600
|
show(options) {
|
|
8601
|
+
var _a, _b, _c, _d;
|
|
8571
8602
|
if (!options.target_element) {
|
|
8572
8603
|
throw new Error("target_element is required to show popup");
|
|
8573
8604
|
}
|
|
@@ -8575,6 +8606,7 @@ class Popup {
|
|
|
8575
8606
|
options.position = "left";
|
|
8576
8607
|
}
|
|
8577
8608
|
const target_element = options.target_element;
|
|
8609
|
+
this.parent.style.display = 'block';
|
|
8578
8610
|
if (this.customHtml) {
|
|
8579
8611
|
let html = this.customHtml(options.task);
|
|
8580
8612
|
html += '<div class="pointer"></div>';
|
|
@@ -8584,7 +8616,10 @@ class Popup {
|
|
|
8584
8616
|
else {
|
|
8585
8617
|
// set data
|
|
8586
8618
|
this.title.innerHTML = options.title;
|
|
8587
|
-
this.
|
|
8619
|
+
this.startDate.innerHTML = (_a = options.subtitle.startDate) !== null && _a !== void 0 ? _a : '';
|
|
8620
|
+
this.startHour.innerHTML = (_b = options.subtitle.startHour) !== null && _b !== void 0 ? _b : '';
|
|
8621
|
+
this.endDate.innerHTML = (_c = options.subtitle.endDate) !== null && _c !== void 0 ? _c : '';
|
|
8622
|
+
this.endHour.innerHTML = (_d = options.subtitle.endHour) !== null && _d !== void 0 ? _d : '';
|
|
8588
8623
|
this.parent.style.width = this.parent.clientWidth + "px";
|
|
8589
8624
|
}
|
|
8590
8625
|
// set position
|
|
@@ -8595,7 +8630,23 @@ class Popup {
|
|
|
8595
8630
|
else if (target_element instanceof SVGElement) {
|
|
8596
8631
|
positionMeta = options.target_element.getBBox();
|
|
8597
8632
|
}
|
|
8598
|
-
if (options.position === '
|
|
8633
|
+
if (options.position === 'middle') {
|
|
8634
|
+
this.parent.style.position = 'fixed';
|
|
8635
|
+
this.parent.style.top = options.y + "px";
|
|
8636
|
+
this.pointer.style.transform = "rotateZ(180deg)";
|
|
8637
|
+
this.pointer.style.top = "-10px";
|
|
8638
|
+
if ((options.x - 17) + this.parent.offsetWidth > window.innerWidth) {
|
|
8639
|
+
this.parent.style.left = (options.x - this.parent.offsetWidth + 17) + "px";
|
|
8640
|
+
this.pointer.style.right = "16px";
|
|
8641
|
+
this.pointer.style.left = "auto";
|
|
8642
|
+
}
|
|
8643
|
+
else {
|
|
8644
|
+
this.parent.style.left = (options.x - 17) + "px";
|
|
8645
|
+
this.pointer.style.left = "16px";
|
|
8646
|
+
this.pointer.style.right = "auto";
|
|
8647
|
+
}
|
|
8648
|
+
}
|
|
8649
|
+
else if (options.position === 'left') {
|
|
8599
8650
|
this.parent.style.left = positionMeta.x + (positionMeta.width + 10) + "px";
|
|
8600
8651
|
this.parent.style.top = positionMeta.y + "px";
|
|
8601
8652
|
this.pointer.style.transform = "rotateZ(90deg)";
|
|
@@ -8613,18 +8664,29 @@ class Popup {
|
|
|
8613
8664
|
</div>
|
|
8614
8665
|
<div class="wrp-subtitle">
|
|
8615
8666
|
<span class="icon fas fa-calendar-alt"></span>
|
|
8616
|
-
<
|
|
8667
|
+
<div style="margin-right: 15px">
|
|
8668
|
+
<p class="startDate"></p>
|
|
8669
|
+
<p class="startHour"></p>
|
|
8670
|
+
</div>
|
|
8671
|
+
<div>
|
|
8672
|
+
<p class="endDate"></p>
|
|
8673
|
+
<p class="endHour"></p>
|
|
8674
|
+
</div>
|
|
8617
8675
|
</div>
|
|
8618
8676
|
<div class="pointer"></div>
|
|
8619
8677
|
</div>
|
|
8620
8678
|
`;
|
|
8621
8679
|
this.hide();
|
|
8622
8680
|
this.title = this.parent.querySelector(".title");
|
|
8623
|
-
this.
|
|
8681
|
+
this.startDate = this.parent.querySelector(".startDate");
|
|
8682
|
+
this.startHour = this.parent.querySelector(".startHour");
|
|
8683
|
+
this.endDate = this.parent.querySelector(".endDate");
|
|
8684
|
+
this.endHour = this.parent.querySelector(".endHour");
|
|
8624
8685
|
this.pointer = this.parent.querySelector(".pointer");
|
|
8625
8686
|
}
|
|
8626
8687
|
hide() {
|
|
8627
8688
|
this.parent.style.opacity = 0;
|
|
8689
|
+
this.parent.style.display = 'none';
|
|
8628
8690
|
this.parent.style.left = 0;
|
|
8629
8691
|
}
|
|
8630
8692
|
}
|
|
@@ -8723,12 +8785,16 @@ const defaultOptions = {
|
|
|
8723
8785
|
popupTrigger: "click",
|
|
8724
8786
|
customPopupHtml: null,
|
|
8725
8787
|
language: "en",
|
|
8788
|
+
allowMovement: true,
|
|
8789
|
+
hasPopup: true,
|
|
8790
|
+
showOnlyHours: false,
|
|
8791
|
+
showOnlyDays: false,
|
|
8726
8792
|
};
|
|
8727
8793
|
|
|
8728
8794
|
class Gantt {
|
|
8729
8795
|
constructor(wrapper, tasks, options) {
|
|
8730
|
-
this.setup_wrapper(wrapper);
|
|
8731
8796
|
this.setup_options(options);
|
|
8797
|
+
this.setup_wrapper(wrapper);
|
|
8732
8798
|
this.setup_tasks(tasks);
|
|
8733
8799
|
// initialize with default view mode
|
|
8734
8800
|
this.change_view_mode();
|
|
@@ -8772,6 +8838,9 @@ class Gantt {
|
|
|
8772
8838
|
// wrapper element
|
|
8773
8839
|
this.$container = document.createElement("div");
|
|
8774
8840
|
this.$container.classList.add("gantt-container");
|
|
8841
|
+
if (this.options.containerWidth) {
|
|
8842
|
+
this.$container.style.width = this.options.containerWidth + 'px';
|
|
8843
|
+
}
|
|
8775
8844
|
const parent_element = this.$svg.parentElement;
|
|
8776
8845
|
parent_element.appendChild(this.$container);
|
|
8777
8846
|
this.$container.appendChild(this.$svg);
|
|
@@ -8855,6 +8924,7 @@ class Gantt {
|
|
|
8855
8924
|
this.change_view_mode();
|
|
8856
8925
|
}
|
|
8857
8926
|
change_view_mode(mode = this.options.viewMode) {
|
|
8927
|
+
this.setup_gantt_dates();
|
|
8858
8928
|
this.update_view_scale(mode);
|
|
8859
8929
|
this.setup_dates();
|
|
8860
8930
|
this.render();
|
|
@@ -8864,10 +8934,13 @@ class Gantt {
|
|
|
8864
8934
|
update_view_scale(view_mode) {
|
|
8865
8935
|
this.options.viewMode = view_mode;
|
|
8866
8936
|
// this.isHourView = false;
|
|
8867
|
-
if (view_mode === ViewMode.
|
|
8937
|
+
if (view_mode === ViewMode.QuarterHour) {
|
|
8938
|
+
this.options.step = 24 / 24 / 4;
|
|
8939
|
+
this.options.columnWidth = 50;
|
|
8940
|
+
}
|
|
8941
|
+
else if (view_mode === ViewMode.Hour) {
|
|
8868
8942
|
this.options.step = 24 / 24;
|
|
8869
8943
|
this.options.columnWidth = 50;
|
|
8870
|
-
// this.isHourView = true;
|
|
8871
8944
|
}
|
|
8872
8945
|
else if (view_mode === ViewMode.Day) {
|
|
8873
8946
|
this.options.step = 24;
|
|
@@ -8895,52 +8968,52 @@ class Gantt {
|
|
|
8895
8968
|
}
|
|
8896
8969
|
}
|
|
8897
8970
|
setup_dates() {
|
|
8898
|
-
this.setup_gantt_dates();
|
|
8899
8971
|
this.setup_date_values();
|
|
8900
8972
|
}
|
|
8901
8973
|
setup_gantt_dates() {
|
|
8902
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
8974
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
8903
8975
|
this._minDate = null;
|
|
8904
8976
|
this._maxDate = null;
|
|
8905
8977
|
for (let task of this.tasks) {
|
|
8906
8978
|
// set global start and end date
|
|
8907
8979
|
if (!this.minDate || task.start < this.minDate) {
|
|
8908
|
-
this._minDate = task.start;
|
|
8980
|
+
this._minDate = DateUtils.startOf(task.start, 'day');
|
|
8909
8981
|
}
|
|
8910
8982
|
if (!this.maxDate || task.end > this.maxDate) {
|
|
8911
8983
|
this._maxDate = task.end;
|
|
8912
8984
|
}
|
|
8913
8985
|
}
|
|
8914
|
-
this._realMinDate = this.minDate;
|
|
8915
|
-
this._realMaxDate = this.maxDate;
|
|
8916
8986
|
switch (this.options.viewMode) {
|
|
8987
|
+
case ViewMode.QuarterHour:
|
|
8988
|
+
this._minDate = DateUtils.add(this.minDate, -((_a = this.options.marginBeforeStart) !== null && _a !== void 0 ? _a : 15), "minutes");
|
|
8989
|
+
this._maxDate = DateUtils.add(this.maxDate, (_b = this.options.marginAfterEnd) !== null && _b !== void 0 ? _b : 15, "minutes");
|
|
8917
8990
|
case ViewMode.Hour:
|
|
8918
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
8919
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
8991
|
+
this._minDate = DateUtils.add(this.minDate, -((_c = this.options.marginBeforeStart) !== null && _c !== void 0 ? _c : 1), "hour");
|
|
8992
|
+
this._maxDate = DateUtils.add(this.maxDate, (_d = this.options.marginAfterEnd) !== null && _d !== void 0 ? _d : 1, "hour");
|
|
8920
8993
|
break;
|
|
8921
8994
|
case ViewMode.QuarterDay:
|
|
8922
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
8923
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
8995
|
+
this._minDate = DateUtils.add(this.minDate, -((_e = this.options.marginBeforeStart) !== null && _e !== void 0 ? _e : 6), "hour");
|
|
8996
|
+
this._maxDate = DateUtils.add(this.maxDate, (_f = this.options.marginAfterEnd) !== null && _f !== void 0 ? _f : 6, "hour");
|
|
8924
8997
|
break;
|
|
8925
8998
|
case ViewMode.HalfDay:
|
|
8926
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
8927
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
8999
|
+
this._minDate = DateUtils.add(this.minDate, -((_g = this.options.marginBeforeStart) !== null && _g !== void 0 ? _g : 12), "hour");
|
|
9000
|
+
this._maxDate = DateUtils.add(this.maxDate, (_h = this.options.marginAfterEnd) !== null && _h !== void 0 ? _h : 12, "hour");
|
|
8928
9001
|
break;
|
|
8929
9002
|
case ViewMode.Day:
|
|
8930
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
8931
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9003
|
+
this._minDate = DateUtils.add(this.minDate, -((_j = this.options.marginBeforeStart) !== null && _j !== void 0 ? _j : 1), "day");
|
|
9004
|
+
this._maxDate = DateUtils.add(this.maxDate, (_k = this.options.marginAfterEnd) !== null && _k !== void 0 ? _k : 1, "day");
|
|
8932
9005
|
break;
|
|
8933
9006
|
case ViewMode.Week:
|
|
8934
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
8935
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9007
|
+
this._minDate = DateUtils.add(this.minDate, -((_l = this.options.marginBeforeStart) !== null && _l !== void 0 ? _l : 1), "week");
|
|
9008
|
+
this._maxDate = DateUtils.add(this.maxDate, (_m = this.options.marginAfterEnd) !== null && _m !== void 0 ? _m : 1, "week");
|
|
8936
9009
|
break;
|
|
8937
9010
|
case ViewMode.Month:
|
|
8938
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
8939
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9011
|
+
this._minDate = DateUtils.add(this.minDate, -((_o = this.options.marginBeforeStart) !== null && _o !== void 0 ? _o : 1), "month");
|
|
9012
|
+
this._maxDate = DateUtils.add(this.maxDate, (_p = this.options.marginAfterEnd) !== null && _p !== void 0 ? _p : 1, "month");
|
|
8940
9013
|
break;
|
|
8941
9014
|
case ViewMode.Year:
|
|
8942
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
8943
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9015
|
+
this._minDate = DateUtils.add(this.minDate, -((_q = this.options.marginBeforeStart) !== null && _q !== void 0 ? _q : 1), "year");
|
|
9016
|
+
this._maxDate = DateUtils.add(this.maxDate, (_r = this.options.marginAfterEnd) !== null && _r !== void 0 ? _r : 1, "year");
|
|
8944
9017
|
break;
|
|
8945
9018
|
}
|
|
8946
9019
|
}
|
|
@@ -8964,8 +9037,10 @@ class Gantt {
|
|
|
8964
9037
|
}
|
|
8965
9038
|
this.dates.push(cur_date);
|
|
8966
9039
|
}
|
|
8967
|
-
|
|
8968
|
-
|
|
9040
|
+
if (this.options.containerWidth) {
|
|
9041
|
+
const columnWidth = (this.options.containerWidth - 1) / this.dates.length;
|
|
9042
|
+
this.options.columnWidth = columnWidth < 45 ? 45 : columnWidth;
|
|
9043
|
+
}
|
|
8969
9044
|
}
|
|
8970
9045
|
bind_events() {
|
|
8971
9046
|
this.bind_grid_click();
|
|
@@ -9001,7 +9076,10 @@ class Gantt {
|
|
|
9001
9076
|
this.make_grid_ticks();
|
|
9002
9077
|
}
|
|
9003
9078
|
make_grid_background() {
|
|
9004
|
-
|
|
9079
|
+
let grid_width = this.dates.length * this.options.columnWidth;
|
|
9080
|
+
if (this.options.containerWidth) {
|
|
9081
|
+
grid_width = this.options.containerWidth;
|
|
9082
|
+
}
|
|
9005
9083
|
const distinct_rows = [...new Set(this.tasks.map((x) => x._row_id))];
|
|
9006
9084
|
const grid_height = this.options.headerHeight +
|
|
9007
9085
|
this.options.padding / 2 +
|
|
@@ -9067,18 +9145,24 @@ class Gantt {
|
|
|
9067
9145
|
this.tasks.length;
|
|
9068
9146
|
for (let date of this.dates) {
|
|
9069
9147
|
let tick_class = "tick";
|
|
9070
|
-
|
|
9071
|
-
|
|
9148
|
+
if (this.view_is(ViewMode.QuarterHour) && date.getHours() === 0 && date.getMinutes() === 0) {
|
|
9149
|
+
// thick tick for first hour of day.
|
|
9072
9150
|
tick_class += " thick";
|
|
9073
9151
|
}
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
date.getDate() >= 1 &&
|
|
9077
|
-
date.getDate() < 8) {
|
|
9152
|
+
else if (this.view_is([ViewMode.Hour, ViewMode.QuarterDay, ViewMode.HalfDay]) && date.getHours() === 0) {
|
|
9153
|
+
// thick tick for first hour of day.
|
|
9078
9154
|
tick_class += " thick";
|
|
9079
9155
|
}
|
|
9080
|
-
|
|
9081
|
-
|
|
9156
|
+
else if (this.view_is(ViewMode.Day) && date.getDate() === 1) {
|
|
9157
|
+
// thick tick for monday
|
|
9158
|
+
tick_class += " thick";
|
|
9159
|
+
}
|
|
9160
|
+
else if (this.view_is(ViewMode.Week) && date.getDate() >= 1 && date.getDate() < 8) {
|
|
9161
|
+
// thick tick for first week
|
|
9162
|
+
tick_class += " thick";
|
|
9163
|
+
}
|
|
9164
|
+
else if (this.view_is(ViewMode.Month) && date.getMonth() % 3 === 0) {
|
|
9165
|
+
// thick ticks for quarters
|
|
9082
9166
|
tick_class += " thick";
|
|
9083
9167
|
}
|
|
9084
9168
|
createSVG("path", {
|
|
@@ -9107,7 +9191,7 @@ class Gantt {
|
|
|
9107
9191
|
let x = 0;
|
|
9108
9192
|
for (let date of this.dates) {
|
|
9109
9193
|
let y = (this.options.headerHeight + this.options.padding) / 2;
|
|
9110
|
-
let isToday = date
|
|
9194
|
+
let isToday = date == DateUtils.today();
|
|
9111
9195
|
let isWeekend = (date.getDay() == 0 || date.getDay() == 6);
|
|
9112
9196
|
let className;
|
|
9113
9197
|
if (isToday) {
|
|
@@ -9137,19 +9221,8 @@ class Gantt {
|
|
|
9137
9221
|
}
|
|
9138
9222
|
make_dates() {
|
|
9139
9223
|
const dates = this.get_dates_to_draw();
|
|
9140
|
-
const isHourView = this.view_is([ViewMode.Hour, ViewMode.QuarterDay, ViewMode.HalfDay]);
|
|
9141
|
-
let counter = 0;
|
|
9142
9224
|
for (let i = 0; i < dates.length; i++) {
|
|
9143
9225
|
const date = dates[i];
|
|
9144
|
-
if (isHourView && date.date >= this._realMinDate && date.date <= this._realMaxDate) {
|
|
9145
|
-
createSVG("text", {
|
|
9146
|
-
x: date.lower_x,
|
|
9147
|
-
y: date.lower_y,
|
|
9148
|
-
innerHTML: `H${counter++ * this.options.step}`,
|
|
9149
|
-
class: "title-1",
|
|
9150
|
-
append_to: this.layers.date,
|
|
9151
|
-
});
|
|
9152
|
-
}
|
|
9153
9226
|
createSVG("text", {
|
|
9154
9227
|
x: date.lower_x,
|
|
9155
9228
|
y: date.lower_y + 20,
|
|
@@ -9157,6 +9230,15 @@ class Gantt {
|
|
|
9157
9230
|
class: "title-2",
|
|
9158
9231
|
append_to: this.layers.date,
|
|
9159
9232
|
});
|
|
9233
|
+
if (date.middle_text) {
|
|
9234
|
+
createSVG("text", {
|
|
9235
|
+
x: date.middle_x,
|
|
9236
|
+
y: date.middle_y,
|
|
9237
|
+
innerHTML: date.middle_text,
|
|
9238
|
+
class: "middle-text",
|
|
9239
|
+
append_to: this.layers.date,
|
|
9240
|
+
});
|
|
9241
|
+
}
|
|
9160
9242
|
if (date.upper_text) {
|
|
9161
9243
|
const $upper_text = createSVG("text", {
|
|
9162
9244
|
x: date.upper_x,
|
|
@@ -9186,68 +9268,93 @@ class Gantt {
|
|
|
9186
9268
|
last_date = DateUtils.add(date, 1, "year");
|
|
9187
9269
|
}
|
|
9188
9270
|
const date_text = {
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
dayLower: date.getDate() !== last_date.getDate()
|
|
9193
|
-
? DateUtils.format(date, "D", this.options.language)
|
|
9271
|
+
// quarter hour
|
|
9272
|
+
quarterHourUpper: date.getDate() !== last_date.getDate()
|
|
9273
|
+
? DateUtils.format(date, "D MMM", this.options.language)
|
|
9194
9274
|
: "",
|
|
9195
|
-
|
|
9275
|
+
quarterHourLower: DateUtils.format(date, "HH:mm", this.options.language),
|
|
9276
|
+
// hour
|
|
9277
|
+
hourUpper: date.getDate() !== last_date.getDate()
|
|
9196
9278
|
? DateUtils.format(date, "D MMM", this.options.language)
|
|
9197
|
-
:
|
|
9198
|
-
|
|
9199
|
-
|
|
9279
|
+
: "",
|
|
9280
|
+
hourLower: DateUtils.format(date, "HH:mm", this.options.language),
|
|
9281
|
+
// quarter day
|
|
9200
9282
|
quarterDayUpper: date.getDate() !== last_date.getDate()
|
|
9201
9283
|
? DateUtils.format(date, "D MMM", this.options.language)
|
|
9202
9284
|
: "",
|
|
9203
|
-
|
|
9204
|
-
|
|
9285
|
+
quarterDayLower: DateUtils.format(date, "HH:mm", this.options.language),
|
|
9286
|
+
// half day
|
|
9287
|
+
halfDayUpper: (date.getDate() !== last_date.getDate())
|
|
9288
|
+
? (((date.getMonth() !== last_date.getMonth()) || i < 2)
|
|
9205
9289
|
? DateUtils.format(date, "D MMM", this.options.language)
|
|
9206
|
-
: DateUtils.format(date, "D", this.options.language)
|
|
9290
|
+
: DateUtils.format(date, "D", this.options.language))
|
|
9207
9291
|
: "",
|
|
9208
|
-
|
|
9292
|
+
halfDayLower: DateUtils.format(date, "HH:mm", this.options.language),
|
|
9293
|
+
// day
|
|
9294
|
+
dayUpper: ((date.getMonth() !== last_date.getMonth()) || i === 0)
|
|
9209
9295
|
? DateUtils.format(date, "MMMM", this.options.language)
|
|
9210
9296
|
: "",
|
|
9297
|
+
dayMiddle: DateUtils.format(date, "ddd", this.options.language),
|
|
9298
|
+
dayLower: DateUtils.format(date, "D", this.options.language),
|
|
9299
|
+
// week
|
|
9211
9300
|
weekUpper: date.getMonth() !== last_date.getMonth()
|
|
9212
9301
|
? DateUtils.format(date, "MMMM", this.options.language)
|
|
9213
9302
|
: "",
|
|
9303
|
+
weekLower: date.getMonth() !== last_date.getMonth()
|
|
9304
|
+
? DateUtils.format(date, "D MMM", this.options.language)
|
|
9305
|
+
: DateUtils.format(date, "D", this.options.language),
|
|
9306
|
+
// month
|
|
9214
9307
|
monthUpper: date.getFullYear() !== last_date.getFullYear()
|
|
9215
9308
|
? DateUtils.format(date, "YYYY", this.options.language)
|
|
9216
9309
|
: "",
|
|
9310
|
+
monthLower: DateUtils.format(date, "MMMM", this.options.language),
|
|
9311
|
+
// year
|
|
9217
9312
|
yearUpper: date.getFullYear() !== last_date.getFullYear()
|
|
9218
9313
|
? DateUtils.format(date, "YYYY", this.options.language)
|
|
9219
9314
|
: "",
|
|
9220
|
-
|
|
9221
|
-
? DateUtils.format(date, "HH:mm", this.options.language)
|
|
9222
|
-
: "",
|
|
9315
|
+
yearLower: DateUtils.format(date, "YYYY", this.options.language),
|
|
9223
9316
|
};
|
|
9224
9317
|
// Descontando 20 para adcionar uma segunda linha de informação no cabeçalho
|
|
9225
9318
|
const base_pos = {
|
|
9226
9319
|
x: i * this.options.columnWidth,
|
|
9227
|
-
lower_y: this.options.headerHeight - 20,
|
|
9228
9320
|
upper_y: this.options.headerHeight - 20 - 25,
|
|
9321
|
+
middle_y: this.options.headerHeight - 20,
|
|
9322
|
+
lower_y: this.options.headerHeight - 20,
|
|
9229
9323
|
};
|
|
9230
9324
|
const x_pos = {
|
|
9325
|
+
quarterHourUpper: (this.dates.length < 14) ? (this.options.columnWidth) : (this.options.columnWidth * 24 / 2),
|
|
9326
|
+
quarterHourMiddle: this.options.columnWidth / 2,
|
|
9327
|
+
quarterHourLower: this.options.columnWidth / 2,
|
|
9328
|
+
hourUpper: (this.dates.length < 14) ? (this.options.columnWidth) : (this.options.columnWidth * 24 / 2),
|
|
9329
|
+
hourMiddle: this.options.columnWidth / 2,
|
|
9231
9330
|
hourLower: this.options.columnWidth / 2,
|
|
9232
|
-
hourUpper: this.options.columnWidth * 24 / 2,
|
|
9233
|
-
quarterDayLower: this.options.columnWidth / 2,
|
|
9234
9331
|
quarterDayUpper: this.options.columnWidth * 4 / 2,
|
|
9235
|
-
|
|
9332
|
+
quarterDayMiddle: this.options.columnWidth / 2,
|
|
9333
|
+
quarterDayLower: this.options.columnWidth / 2,
|
|
9236
9334
|
halfDayUpper: this.options.columnWidth * 2 / 2,
|
|
9335
|
+
halfDayMiddle: this.options.columnWidth / 2,
|
|
9336
|
+
halfDayLower: this.options.columnWidth / 2,
|
|
9337
|
+
dayUpper: (this.dates.length < 15) ? (this.options.columnWidth) : ((this.options.columnWidth * 30) / 2),
|
|
9338
|
+
dayMiddle: this.options.columnWidth / 2 - 12,
|
|
9237
9339
|
dayLower: this.options.columnWidth / 2,
|
|
9238
|
-
dayUpper: (this.options.columnWidth * 30) / 2,
|
|
9239
|
-
weekLower: 0,
|
|
9240
9340
|
weekUpper: (this.options.columnWidth * 4) / 2,
|
|
9341
|
+
weekMiddle: 0,
|
|
9342
|
+
weekLower: 0,
|
|
9343
|
+
monthUpper: (this.dates.length < 15) ? (this.options.columnWidth) : ((this.options.columnWidth * 12) / 2),
|
|
9344
|
+
monthMiddle: 0,
|
|
9241
9345
|
monthLower: this.options.columnWidth / 2,
|
|
9242
|
-
monthUpper: (this.options.columnWidth * 12) / 2,
|
|
9243
|
-
yearLower: this.options.columnWidth / 2,
|
|
9244
9346
|
yearUpper: (this.options.columnWidth * 30) / 2,
|
|
9347
|
+
yearMiddle: this.options.columnWidth / 2,
|
|
9348
|
+
yearLower: this.options.columnWidth / 2,
|
|
9245
9349
|
};
|
|
9246
9350
|
return {
|
|
9247
9351
|
upper_text: date_text[`${this.options.viewMode}Upper`],
|
|
9352
|
+
middle_text: date_text[`${this.options.viewMode}Middle`],
|
|
9248
9353
|
lower_text: date_text[`${this.options.viewMode}Lower`],
|
|
9249
9354
|
upper_x: base_pos.x + x_pos[`${this.options.viewMode}Upper`],
|
|
9250
9355
|
upper_y: base_pos.upper_y,
|
|
9356
|
+
middle_x: base_pos.x + x_pos[`${this.options.viewMode}Middle`],
|
|
9357
|
+
middle_y: base_pos.middle_y,
|
|
9251
9358
|
lower_x: base_pos.x + x_pos[`${this.options.viewMode}Lower`],
|
|
9252
9359
|
lower_y: base_pos.lower_y,
|
|
9253
9360
|
date,
|
|
@@ -9331,7 +9438,7 @@ class Gantt {
|
|
|
9331
9438
|
else if (element.classList.contains("right")) {
|
|
9332
9439
|
is_resizing_right = true;
|
|
9333
9440
|
}
|
|
9334
|
-
else if (element.classList.contains("bar-wrapper")) {
|
|
9441
|
+
else if (element.classList.contains("bar-wrapper") && this.options.allowMovement) {
|
|
9335
9442
|
is_dragging = true;
|
|
9336
9443
|
}
|
|
9337
9444
|
bar_wrapper.classList.add("active");
|
|
@@ -9386,7 +9493,7 @@ class Gantt {
|
|
|
9386
9493
|
});
|
|
9387
9494
|
}, null);
|
|
9388
9495
|
document.addEventListener("mouseup", (e) => {
|
|
9389
|
-
if (is_dragging || is_resizing_left || is_resizing_right) {
|
|
9496
|
+
if (is_dragging || is_resizing_left || is_resizing_right || !this.options.allowMovement) {
|
|
9390
9497
|
bars.forEach((bar) => bar.group.classList.remove("active"));
|
|
9391
9498
|
}
|
|
9392
9499
|
is_dragging = false;
|
|
@@ -9490,19 +9597,33 @@ let GanttComponent = class GanttComponent {
|
|
|
9490
9597
|
this.multipleTaskPerLine = false;
|
|
9491
9598
|
this.showSideTable = true;
|
|
9492
9599
|
this.viewMode = ViewMode.Day;
|
|
9600
|
+
this.allowMovement = true;
|
|
9601
|
+
this.hasPopup = true;
|
|
9602
|
+
this.fullWidth = false;
|
|
9603
|
+
this.showOnlyHours = false;
|
|
9604
|
+
this.showOnlyDays = false;
|
|
9493
9605
|
this.taskClicked = new EventEmitter();
|
|
9494
9606
|
this.taskDateChanged = new EventEmitter();
|
|
9495
9607
|
this.viewChanged = new EventEmitter();
|
|
9496
9608
|
}
|
|
9497
9609
|
ngOnInit() {
|
|
9498
9610
|
this._validateViewMode();
|
|
9611
|
+
this._validateTasks();
|
|
9499
9612
|
}
|
|
9500
9613
|
ngAfterViewInit() {
|
|
9614
|
+
if (this.fullWidth) {
|
|
9615
|
+
this.containerWidth = this.outer.nativeElement.offsetWidth - this.side.nativeElement.offsetWidth;
|
|
9616
|
+
}
|
|
9501
9617
|
this._gantt = new Gantt("#gantt", this._filterTask(this.tasks), {
|
|
9502
9618
|
viewMode: this.viewMode,
|
|
9503
9619
|
marginBeforeStart: this.marginBeforeStart,
|
|
9504
9620
|
marginAfterEnd: this.marginAfterEnd,
|
|
9505
|
-
language: "pt-
|
|
9621
|
+
language: "pt-br",
|
|
9622
|
+
allowMovement: this.allowMovement,
|
|
9623
|
+
hasPopup: this.hasPopup,
|
|
9624
|
+
containerWidth: this.containerWidth,
|
|
9625
|
+
showOnlyHours: this.showOnlyHours,
|
|
9626
|
+
showOnlyDays: this.showOnlyDays,
|
|
9506
9627
|
onClick: (task) => this.taskClicked.emit(task),
|
|
9507
9628
|
onDateChange: (task, start, end) => this.taskDateChanged.emit({ task, start, end }),
|
|
9508
9629
|
onViewChange: (viewMode) => this.viewChanged.emit(viewMode),
|
|
@@ -9541,6 +9662,7 @@ let GanttComponent = class GanttComponent {
|
|
|
9541
9662
|
}
|
|
9542
9663
|
_validateViewMode() {
|
|
9543
9664
|
if (![
|
|
9665
|
+
ViewMode.QuarterHour,
|
|
9544
9666
|
ViewMode.Hour,
|
|
9545
9667
|
ViewMode.QuarterDay,
|
|
9546
9668
|
ViewMode.HalfDay,
|
|
@@ -9552,6 +9674,15 @@ let GanttComponent = class GanttComponent {
|
|
|
9552
9674
|
throw new Error("Invalid gantt view mode");
|
|
9553
9675
|
}
|
|
9554
9676
|
}
|
|
9677
|
+
_validateTasks() {
|
|
9678
|
+
this.tasks.forEach(group => {
|
|
9679
|
+
group.tasks.forEach(task => {
|
|
9680
|
+
if (task.start > task.end) {
|
|
9681
|
+
throw new Error("invalid task. The start date must be less than the end date.");
|
|
9682
|
+
}
|
|
9683
|
+
});
|
|
9684
|
+
});
|
|
9685
|
+
}
|
|
9555
9686
|
};
|
|
9556
9687
|
__decorate([
|
|
9557
9688
|
Input()
|
|
@@ -9574,6 +9705,24 @@ __decorate([
|
|
|
9574
9705
|
__decorate([
|
|
9575
9706
|
Input()
|
|
9576
9707
|
], GanttComponent.prototype, "marginAfterEnd", void 0);
|
|
9708
|
+
__decorate([
|
|
9709
|
+
Input()
|
|
9710
|
+
], GanttComponent.prototype, "allowMovement", void 0);
|
|
9711
|
+
__decorate([
|
|
9712
|
+
Input()
|
|
9713
|
+
], GanttComponent.prototype, "hasPopup", void 0);
|
|
9714
|
+
__decorate([
|
|
9715
|
+
Input()
|
|
9716
|
+
], GanttComponent.prototype, "containerWidth", void 0);
|
|
9717
|
+
__decorate([
|
|
9718
|
+
Input()
|
|
9719
|
+
], GanttComponent.prototype, "fullWidth", void 0);
|
|
9720
|
+
__decorate([
|
|
9721
|
+
Input()
|
|
9722
|
+
], GanttComponent.prototype, "showOnlyHours", void 0);
|
|
9723
|
+
__decorate([
|
|
9724
|
+
Input()
|
|
9725
|
+
], GanttComponent.prototype, "showOnlyDays", void 0);
|
|
9577
9726
|
__decorate([
|
|
9578
9727
|
Output()
|
|
9579
9728
|
], GanttComponent.prototype, "taskClicked", void 0);
|
|
@@ -9583,12 +9732,18 @@ __decorate([
|
|
|
9583
9732
|
__decorate([
|
|
9584
9733
|
Output()
|
|
9585
9734
|
], GanttComponent.prototype, "viewChanged", void 0);
|
|
9735
|
+
__decorate([
|
|
9736
|
+
ViewChild('outer')
|
|
9737
|
+
], GanttComponent.prototype, "outer", void 0);
|
|
9738
|
+
__decorate([
|
|
9739
|
+
ViewChild('side')
|
|
9740
|
+
], GanttComponent.prototype, "side", void 0);
|
|
9586
9741
|
GanttComponent = __decorate([
|
|
9587
9742
|
Component({
|
|
9588
9743
|
selector: "s-gantt",
|
|
9589
|
-
template: "<div class=\"outer\">\n <gantt-side-table\n
|
|
9744
|
+
template: "<div class=\"outer\" #outer>\n <div #side>\n <gantt-side-table\n *ngIf=\"showSideTable\"\n [tasks]=\"tasks\"\n [columnTitle]=\"columnTitle\"\n [multipleTaskPerLine]=\"multipleTaskPerLine\">\n </gantt-side-table>\n </div>\n <svg id=\"gantt\"></svg>\n</div>\n",
|
|
9590
9745
|
encapsulation: ViewEncapsulation.None,
|
|
9591
|
-
styles: [".outer{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:start;align-items:flex-start;-ms-flex-line-pack:center;align-content:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row}", ".gantt{border:1px solid #e0e0e0}.gantt .weekend-highlight{fill:#b8c2cc;opacity:.5;stroke:#ebeff2;stroke-width:1}.gantt .grid-background{fill:none}.gantt .grid-header,.gantt .grid-row{fill:#fff}.gantt .grid-row:nth-child(even){fill:#f5f5f5}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.
|
|
9746
|
+
styles: [".outer{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:start;align-items:flex-start;-ms-flex-line-pack:center;align-content:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row}", ".gantt{border:1px solid #e0e0e0}.gantt .weekend-highlight{fill:#b8c2cc;opacity:.5;stroke:#ebeff2;stroke-width:1}.gantt .grid-background{fill:none}.gantt .grid-header,.gantt .grid-row{fill:#fff}.gantt .grid-row:nth-child(even){fill:#f5f5f5}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.4}.gantt .tick.thick{stroke:#428bca;stroke-width:2}.gantt .today-highlight{fill:#ffe979;opacity:.5}.gantt .arrow{fill:none;stroke:#666;stroke-width:1.4}.gantt .bar{opacity:.8;stroke:#8d99a6;stroke-width:0;transition:stroke-width .3s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.gantt .bar-invalid{fill:transparent;stroke:#8d99a6;stroke-dasharray:5;stroke-width:1}.gantt .bar-invalid~.bar-label{fill:#555}.gantt .bar-label{fill:#fff;text-anchor:middle;font-size:12px;font-weight:lighter}.gantt .bar-label.big{fill:#555;text-anchor:start}.gantt .bar-wrapper{cursor:pointer;outline:0}.gantt .bar-wrapper.active .bar,.gantt .bar-wrapper:hover .bar{opacity:1}.gantt .bar-wrapper.active .bar{stroke:#212533;stroke-width:2}.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{border-left:1px solid #e0e0e0;font-size:12px;overflow:auto;position:relative}.gantt-container .title-1{fill:#999;font-size:12px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .title-2{fill:#333;font-size:14px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .popup-wrapper{left:0;position:absolute;top:0}.gantt-container .popup-wrapper .popup{background:#0e1119;border-radius:2px;color:#fff;padding:8px;font-family:\"Open Sans\" sans-serif;line-height:150%;font-weight:400}.gantt-container .popup-wrapper .popup .wrp-title{border-bottom:1px solid #525966;padding-bottom:10px}.gantt-container .popup-wrapper .popup .wrp-title .title{font-size:14px}.gantt-container .popup-wrapper .popup .wrp-subtitle{color:#dfe2e5;padding-top:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.gantt-container .popup-wrapper .popup .wrp-subtitle .icon{margin-right:10px}.gantt-container .popup-wrapper .popup .wrp-subtitle .subtitle{font-size:12px}.gantt-container .popup-wrapper .popup .pointer{border:6px solid transparent;border-top-color:#0e1119;height:6px;margin-left:-4px;position:absolute}"]
|
|
9592
9747
|
})
|
|
9593
9748
|
], GanttComponent);
|
|
9594
9749
|
|
|
@@ -9597,6 +9752,12 @@ let SideTableComponent = class SideTableComponent {
|
|
|
9597
9752
|
this.ROW_HEIGHT = 44;
|
|
9598
9753
|
this.multipleTaskPerLine = false;
|
|
9599
9754
|
}
|
|
9755
|
+
ngOnInit() {
|
|
9756
|
+
this._removeEmptyTasks();
|
|
9757
|
+
}
|
|
9758
|
+
_removeEmptyTasks() {
|
|
9759
|
+
this.tasks = this.tasks.filter(task => task.tasks.length);
|
|
9760
|
+
}
|
|
9600
9761
|
};
|
|
9601
9762
|
__decorate([
|
|
9602
9763
|
Input()
|
|
@@ -9610,8 +9771,8 @@ __decorate([
|
|
|
9610
9771
|
SideTableComponent = __decorate([
|
|
9611
9772
|
Component({
|
|
9612
9773
|
selector: 'gantt-side-table',
|
|
9613
|
-
template: "<div class=\"side-table\">\n <div class=\"column-title\">\n <span>{{ columnTitle }}</span>\n </div>\n <div class=\"tasks\">\n <div
|
|
9614
|
-
styles: [".side-table{background:#fff;height:100%;min-width:175px}.side-table .column-title{height:106px;border:1px solid #e0e0e0;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center;padding:8px}.side-table .column-title span{font-family:\"Open Sans\" sans-serif;font-size:14px;font-weight:700;line-height:150%}.side-table .task{-ms-flex-align:center;align-items:center;background-color:#fff;border:1px solid #e0e0e0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:\"Open Sans\"
|
|
9774
|
+
template: "<div class=\"side-table\">\n <div class=\"column-title\">\n <span>{{ columnTitle }}</span>\n </div>\n <div class=\"tasks\" >\n <div\n *ngFor=\"let task of tasks; let i = index\"\n class=\"task\"\n [ngStyle]=\"{'height.px': multipleTaskPerLine\n ? ROW_HEIGHT\n : ROW_HEIGHT * task.tasks.length}\"\n [sTooltip]=\"task.title.length > 20 || task.subtitle.length > 20 ? '<span><strong>' + task.title + ' </strong></br><span> ' + task.subtitle + ' </span></span>' : '' \"\n [escape]=\"false\">\n <div class=\"title\">\n {{ task.title }}\n </div>\n <div class=\"subtitle\">\n {{ task.subtitle }}\n </div>\n </div>\n </div>\n</div>\n",
|
|
9775
|
+
styles: [".side-table{background:#fff;height:100%;min-width:175px}.side-table .column-title{height:106px;border:1px solid #e0e0e0;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center;padding:8px}.side-table .column-title span{font-family:\"Open Sans\" sans-serif;font-size:14px;font-weight:700;line-height:150%}.side-table .task{-ms-flex-align:center;align-items:center;background-color:#fff;border:1px solid #e0e0e0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:\"Open Sans\",sans-serif;font-weight:400;-ms-flex-pack:center;justify-content:center;line-height:150%;padding:0 5px}.side-table .task .title{color:#333;font-size:14px;max-width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.side-table .task .subtitle{color:#999;font-size:12px;max-width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]
|
|
9615
9776
|
})
|
|
9616
9777
|
], SideTableComponent);
|
|
9617
9778
|
|
|
@@ -9619,7 +9780,7 @@ let GanttModule = class GanttModule {
|
|
|
9619
9780
|
};
|
|
9620
9781
|
GanttModule = __decorate([
|
|
9621
9782
|
NgModule({
|
|
9622
|
-
imports: [CommonModule],
|
|
9783
|
+
imports: [CommonModule, TooltipModule],
|
|
9623
9784
|
declarations: [
|
|
9624
9785
|
GanttComponent,
|
|
9625
9786
|
SideTableComponent,
|