@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
|
@@ -8883,11 +8883,12 @@
|
|
|
8883
8883
|
.startOf("month")
|
|
8884
8884
|
.format("MMMM");
|
|
8885
8885
|
var monthNameCapitalized = monthName.charAt(0).toUpperCase() + monthName.slice(1);
|
|
8886
|
-
var dateToFormat = moment$7(date);
|
|
8886
|
+
var dateToFormat = moment$7(date).locale(lang);
|
|
8887
8887
|
var format_map = {
|
|
8888
8888
|
YYYY: dateToFormat.format("YYYY"),
|
|
8889
8889
|
MM: dateToFormat.format("MM"),
|
|
8890
8890
|
DD: dateToFormat.format("DD"),
|
|
8891
|
+
ddd: dateToFormat.format("ddd").toUpperCase().replace(".", ""),
|
|
8891
8892
|
HH: dateToFormat.format("HH"),
|
|
8892
8893
|
mm: dateToFormat.format("mm"),
|
|
8893
8894
|
ss: dateToFormat.format("ss"),
|
|
@@ -9110,17 +9111,19 @@
|
|
|
9110
9111
|
|
|
9111
9112
|
|
|
9112
9113
|
(function (ViewMode) {
|
|
9114
|
+
ViewMode["QuarterHour"] = "quarterHour";
|
|
9115
|
+
ViewMode["Hour"] = "hour";
|
|
9113
9116
|
ViewMode["QuarterDay"] = "quarterDay";
|
|
9114
9117
|
ViewMode["HalfDay"] = "halfDay";
|
|
9115
9118
|
ViewMode["Day"] = "day";
|
|
9116
9119
|
ViewMode["Week"] = "week";
|
|
9117
9120
|
ViewMode["Month"] = "month";
|
|
9118
9121
|
ViewMode["Year"] = "year";
|
|
9119
|
-
ViewMode["Hour"] = "hour";
|
|
9120
9122
|
})(exports.ViewMode || (exports.ViewMode = {}));
|
|
9121
9123
|
|
|
9122
9124
|
var Bar = /** @class */ (function () {
|
|
9123
9125
|
function Bar(gantt, task) {
|
|
9126
|
+
this._isPopUpOpen = false;
|
|
9124
9127
|
this._setDefaults(gantt, task);
|
|
9125
9128
|
this._prepare();
|
|
9126
9129
|
this._draw();
|
|
@@ -9291,38 +9294,62 @@
|
|
|
9291
9294
|
}
|
|
9292
9295
|
};
|
|
9293
9296
|
Bar.prototype._setupClickEvent = function () {
|
|
9297
|
+
//TODO
|
|
9294
9298
|
var _this = this;
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
_this.
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9299
|
+
if (this._gantt.options.hasPopup) {
|
|
9300
|
+
$.on(this.group, "focus " + this._gantt.options.popupTrigger, function (e) {
|
|
9301
|
+
// just finished a move action, wait for a few seconds
|
|
9302
|
+
if (!_this._actionCompleted) {
|
|
9303
|
+
_this._showPopup();
|
|
9304
|
+
_this._gantt.unselect_all();
|
|
9305
|
+
_this.group.classList.add("active");
|
|
9306
|
+
}
|
|
9307
|
+
}, null);
|
|
9308
|
+
$.on(this.group, "dblclick", function (e) {
|
|
9309
|
+
// just finished a move action, wait for a few seconds
|
|
9310
|
+
if (!_this._actionCompleted) {
|
|
9311
|
+
_this._gantt.trigger_event("onClick", [_this.task]);
|
|
9312
|
+
}
|
|
9313
|
+
}, null);
|
|
9314
|
+
}
|
|
9315
|
+
else {
|
|
9316
|
+
$.on(this.group, "mouseenter", function (e) {
|
|
9317
|
+
if (!_this._isPopUpOpen) {
|
|
9318
|
+
_this._showPopup({
|
|
9319
|
+
x: e.clientX,
|
|
9320
|
+
y: _this.group.getBoundingClientRect().top + 30,
|
|
9321
|
+
position: 'middle'
|
|
9322
|
+
});
|
|
9323
|
+
_this._isPopUpOpen = true;
|
|
9324
|
+
}
|
|
9325
|
+
}, null);
|
|
9326
|
+
$.on(this.group, "mouseleave", function (e) {
|
|
9327
|
+
_this._gantt.hide_popup();
|
|
9328
|
+
_this._isPopUpOpen = false;
|
|
9329
|
+
}, null);
|
|
9330
|
+
$.on(this.group, "focus click", function (e) {
|
|
9331
|
+
if (!_this._actionCompleted) {
|
|
9332
|
+
_this._gantt.unselect_all();
|
|
9333
|
+
_this.group.classList.add("active");
|
|
9334
|
+
_this._gantt.trigger_event("onClick", [_this.task]);
|
|
9335
|
+
}
|
|
9336
|
+
}, null);
|
|
9337
|
+
}
|
|
9309
9338
|
};
|
|
9310
|
-
Bar.prototype._showPopup = function () {
|
|
9339
|
+
Bar.prototype._showPopup = function (args) {
|
|
9311
9340
|
if (this._gantt.bar_being_dragged) {
|
|
9312
9341
|
return;
|
|
9313
9342
|
}
|
|
9314
|
-
var
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
task: this.task,
|
|
9325
|
-
});
|
|
9343
|
+
var subtitle = {};
|
|
9344
|
+
if (!this._gantt.options.showOnlyHours) {
|
|
9345
|
+
subtitle.startDate = DateUtils.format(this.task.start, 'DD/MM/YYYY', this._gantt.options.language);
|
|
9346
|
+
subtitle.endDate = DateUtils.format(this.task.end, 'DD/MM/YYYY', this._gantt.options.language);
|
|
9347
|
+
}
|
|
9348
|
+
if (!this._gantt.options.showOnlyDays) {
|
|
9349
|
+
subtitle.startHour = DateUtils.format(this.task.start, 'HH:mm:ss', this._gantt.options.language);
|
|
9350
|
+
subtitle.endHour = DateUtils.format(this.task.end, 'HH:mm:ss', this._gantt.options.language);
|
|
9351
|
+
}
|
|
9352
|
+
this._gantt.show_popup(__assign({ target_element: this.element, title: this.task.name, subtitle: subtitle, task: this.task }, args));
|
|
9326
9353
|
};
|
|
9327
9354
|
Bar.prototype._computeStartEndDate = function () {
|
|
9328
9355
|
var bar = this.element;
|
|
@@ -9334,11 +9361,14 @@
|
|
|
9334
9361
|
};
|
|
9335
9362
|
Bar.prototype._computeX = function () {
|
|
9336
9363
|
var _a = this._gantt.options, step = _a.step, columnWidth = _a.columnWidth;
|
|
9337
|
-
var
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9364
|
+
var x;
|
|
9365
|
+
if (this._gantt.view_is([exports.ViewMode.QuarterHour, exports.ViewMode.Hour, exports.ViewMode.QuarterDay, exports.ViewMode.HalfDay, exports.ViewMode.Day])) {
|
|
9366
|
+
var diff = DateUtils.diff(this.task.start, this._gantt.minDate, "minutes");
|
|
9367
|
+
x = (diff / step) * (columnWidth / 60);
|
|
9368
|
+
}
|
|
9369
|
+
else {
|
|
9370
|
+
var diff = DateUtils.diff(this.task.start, this._gantt.minDate, "hour");
|
|
9371
|
+
x = (diff / step) * (columnWidth);
|
|
9342
9372
|
}
|
|
9343
9373
|
return x;
|
|
9344
9374
|
};
|
|
@@ -9392,6 +9422,7 @@
|
|
|
9392
9422
|
this.make();
|
|
9393
9423
|
}
|
|
9394
9424
|
Popup.prototype.show = function (options) {
|
|
9425
|
+
var _a, _b, _c, _d;
|
|
9395
9426
|
if (!options.target_element) {
|
|
9396
9427
|
throw new Error("target_element is required to show popup");
|
|
9397
9428
|
}
|
|
@@ -9399,6 +9430,7 @@
|
|
|
9399
9430
|
options.position = "left";
|
|
9400
9431
|
}
|
|
9401
9432
|
var target_element = options.target_element;
|
|
9433
|
+
this.parent.style.display = 'block';
|
|
9402
9434
|
if (this.customHtml) {
|
|
9403
9435
|
var html = this.customHtml(options.task);
|
|
9404
9436
|
html += '<div class="pointer"></div>';
|
|
@@ -9408,7 +9440,10 @@
|
|
|
9408
9440
|
else {
|
|
9409
9441
|
// set data
|
|
9410
9442
|
this.title.innerHTML = options.title;
|
|
9411
|
-
this.
|
|
9443
|
+
this.startDate.innerHTML = (_a = options.subtitle.startDate) !== null && _a !== void 0 ? _a : '';
|
|
9444
|
+
this.startHour.innerHTML = (_b = options.subtitle.startHour) !== null && _b !== void 0 ? _b : '';
|
|
9445
|
+
this.endDate.innerHTML = (_c = options.subtitle.endDate) !== null && _c !== void 0 ? _c : '';
|
|
9446
|
+
this.endHour.innerHTML = (_d = options.subtitle.endHour) !== null && _d !== void 0 ? _d : '';
|
|
9412
9447
|
this.parent.style.width = this.parent.clientWidth + "px";
|
|
9413
9448
|
}
|
|
9414
9449
|
// set position
|
|
@@ -9419,7 +9454,23 @@
|
|
|
9419
9454
|
else if (target_element instanceof SVGElement) {
|
|
9420
9455
|
positionMeta = options.target_element.getBBox();
|
|
9421
9456
|
}
|
|
9422
|
-
if (options.position === '
|
|
9457
|
+
if (options.position === 'middle') {
|
|
9458
|
+
this.parent.style.position = 'fixed';
|
|
9459
|
+
this.parent.style.top = options.y + "px";
|
|
9460
|
+
this.pointer.style.transform = "rotateZ(180deg)";
|
|
9461
|
+
this.pointer.style.top = "-10px";
|
|
9462
|
+
if ((options.x - 17) + this.parent.offsetWidth > window.innerWidth) {
|
|
9463
|
+
this.parent.style.left = (options.x - this.parent.offsetWidth + 17) + "px";
|
|
9464
|
+
this.pointer.style.right = "16px";
|
|
9465
|
+
this.pointer.style.left = "auto";
|
|
9466
|
+
}
|
|
9467
|
+
else {
|
|
9468
|
+
this.parent.style.left = (options.x - 17) + "px";
|
|
9469
|
+
this.pointer.style.left = "16px";
|
|
9470
|
+
this.pointer.style.right = "auto";
|
|
9471
|
+
}
|
|
9472
|
+
}
|
|
9473
|
+
else if (options.position === 'left') {
|
|
9423
9474
|
this.parent.style.left = positionMeta.x + (positionMeta.width + 10) + "px";
|
|
9424
9475
|
this.parent.style.top = positionMeta.y + "px";
|
|
9425
9476
|
this.pointer.style.transform = "rotateZ(90deg)";
|
|
@@ -9430,14 +9481,18 @@
|
|
|
9430
9481
|
this.parent.style.opacity = 1;
|
|
9431
9482
|
};
|
|
9432
9483
|
Popup.prototype.make = function () {
|
|
9433
|
-
this.parent.innerHTML = "\n <div class=\"popup\">\n <div class=\"wrp-title\">\n <span class=\"title\"></span>\n </div>\n <div class=\"wrp-subtitle\">\n <span class=\"icon fas fa-calendar-alt\"></span>\n <
|
|
9484
|
+
this.parent.innerHTML = "\n <div class=\"popup\">\n <div class=\"wrp-title\">\n <span class=\"title\"></span>\n </div>\n <div class=\"wrp-subtitle\">\n <span class=\"icon fas fa-calendar-alt\"></span>\n <div style=\"margin-right: 15px\">\n <p class=\"startDate\"></p>\n <p class=\"startHour\"></p>\n </div>\n <div>\n <p class=\"endDate\"></p>\n <p class=\"endHour\"></p>\n </div>\n </div>\n <div class=\"pointer\"></div>\n </div>\n ";
|
|
9434
9485
|
this.hide();
|
|
9435
9486
|
this.title = this.parent.querySelector(".title");
|
|
9436
|
-
this.
|
|
9487
|
+
this.startDate = this.parent.querySelector(".startDate");
|
|
9488
|
+
this.startHour = this.parent.querySelector(".startHour");
|
|
9489
|
+
this.endDate = this.parent.querySelector(".endDate");
|
|
9490
|
+
this.endHour = this.parent.querySelector(".endHour");
|
|
9437
9491
|
this.pointer = this.parent.querySelector(".pointer");
|
|
9438
9492
|
};
|
|
9439
9493
|
Popup.prototype.hide = function () {
|
|
9440
9494
|
this.parent.style.opacity = 0;
|
|
9495
|
+
this.parent.style.display = 'none';
|
|
9441
9496
|
this.parent.style.left = 0;
|
|
9442
9497
|
};
|
|
9443
9498
|
return Popup;
|
|
@@ -9535,12 +9590,16 @@
|
|
|
9535
9590
|
popupTrigger: "click",
|
|
9536
9591
|
customPopupHtml: null,
|
|
9537
9592
|
language: "en",
|
|
9593
|
+
allowMovement: true,
|
|
9594
|
+
hasPopup: true,
|
|
9595
|
+
showOnlyHours: false,
|
|
9596
|
+
showOnlyDays: false,
|
|
9538
9597
|
};
|
|
9539
9598
|
|
|
9540
9599
|
var Gantt = /** @class */ (function () {
|
|
9541
9600
|
function Gantt(wrapper, tasks, options) {
|
|
9542
|
-
this.setup_wrapper(wrapper);
|
|
9543
9601
|
this.setup_options(options);
|
|
9602
|
+
this.setup_wrapper(wrapper);
|
|
9544
9603
|
this.setup_tasks(tasks);
|
|
9545
9604
|
// initialize with default view mode
|
|
9546
9605
|
this.change_view_mode();
|
|
@@ -9592,6 +9651,9 @@
|
|
|
9592
9651
|
// wrapper element
|
|
9593
9652
|
this.$container = document.createElement("div");
|
|
9594
9653
|
this.$container.classList.add("gantt-container");
|
|
9654
|
+
if (this.options.containerWidth) {
|
|
9655
|
+
this.$container.style.width = this.options.containerWidth + 'px';
|
|
9656
|
+
}
|
|
9595
9657
|
var parent_element = this.$svg.parentElement;
|
|
9596
9658
|
parent_element.appendChild(this.$container);
|
|
9597
9659
|
this.$container.appendChild(this.$svg);
|
|
@@ -9697,6 +9759,7 @@
|
|
|
9697
9759
|
};
|
|
9698
9760
|
Gantt.prototype.change_view_mode = function (mode) {
|
|
9699
9761
|
if (mode === void 0) { mode = this.options.viewMode; }
|
|
9762
|
+
this.setup_gantt_dates();
|
|
9700
9763
|
this.update_view_scale(mode);
|
|
9701
9764
|
this.setup_dates();
|
|
9702
9765
|
this.render();
|
|
@@ -9706,10 +9769,13 @@
|
|
|
9706
9769
|
Gantt.prototype.update_view_scale = function (view_mode) {
|
|
9707
9770
|
this.options.viewMode = view_mode;
|
|
9708
9771
|
// this.isHourView = false;
|
|
9709
|
-
if (view_mode === exports.ViewMode.
|
|
9772
|
+
if (view_mode === exports.ViewMode.QuarterHour) {
|
|
9773
|
+
this.options.step = 24 / 24 / 4;
|
|
9774
|
+
this.options.columnWidth = 50;
|
|
9775
|
+
}
|
|
9776
|
+
else if (view_mode === exports.ViewMode.Hour) {
|
|
9710
9777
|
this.options.step = 24 / 24;
|
|
9711
9778
|
this.options.columnWidth = 50;
|
|
9712
|
-
// this.isHourView = true;
|
|
9713
9779
|
}
|
|
9714
9780
|
else if (view_mode === exports.ViewMode.Day) {
|
|
9715
9781
|
this.options.step = 24;
|
|
@@ -9737,20 +9803,19 @@
|
|
|
9737
9803
|
}
|
|
9738
9804
|
};
|
|
9739
9805
|
Gantt.prototype.setup_dates = function () {
|
|
9740
|
-
this.setup_gantt_dates();
|
|
9741
9806
|
this.setup_date_values();
|
|
9742
9807
|
};
|
|
9743
9808
|
Gantt.prototype.setup_gantt_dates = function () {
|
|
9744
9809
|
var e_3, _a;
|
|
9745
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
9810
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
9746
9811
|
this._minDate = null;
|
|
9747
9812
|
this._maxDate = null;
|
|
9748
9813
|
try {
|
|
9749
|
-
for (var
|
|
9750
|
-
var task =
|
|
9814
|
+
for (var _t = __values(this.tasks), _u = _t.next(); !_u.done; _u = _t.next()) {
|
|
9815
|
+
var task = _u.value;
|
|
9751
9816
|
// set global start and end date
|
|
9752
9817
|
if (!this.minDate || task.start < this.minDate) {
|
|
9753
|
-
this._minDate = task.start;
|
|
9818
|
+
this._minDate = DateUtils.startOf(task.start, 'day');
|
|
9754
9819
|
}
|
|
9755
9820
|
if (!this.maxDate || task.end > this.maxDate) {
|
|
9756
9821
|
this._maxDate = task.end;
|
|
@@ -9760,40 +9825,41 @@
|
|
|
9760
9825
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
9761
9826
|
finally {
|
|
9762
9827
|
try {
|
|
9763
|
-
if (
|
|
9828
|
+
if (_u && !_u.done && (_a = _t.return)) _a.call(_t);
|
|
9764
9829
|
}
|
|
9765
9830
|
finally { if (e_3) throw e_3.error; }
|
|
9766
9831
|
}
|
|
9767
|
-
this._realMinDate = this.minDate;
|
|
9768
|
-
this._realMaxDate = this.maxDate;
|
|
9769
9832
|
switch (this.options.viewMode) {
|
|
9833
|
+
case exports.ViewMode.QuarterHour:
|
|
9834
|
+
this._minDate = DateUtils.add(this.minDate, -((_b = this.options.marginBeforeStart) !== null && _b !== void 0 ? _b : 15), "minutes");
|
|
9835
|
+
this._maxDate = DateUtils.add(this.maxDate, (_c = this.options.marginAfterEnd) !== null && _c !== void 0 ? _c : 15, "minutes");
|
|
9770
9836
|
case exports.ViewMode.Hour:
|
|
9771
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9772
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9837
|
+
this._minDate = DateUtils.add(this.minDate, -((_d = this.options.marginBeforeStart) !== null && _d !== void 0 ? _d : 1), "hour");
|
|
9838
|
+
this._maxDate = DateUtils.add(this.maxDate, (_e = this.options.marginAfterEnd) !== null && _e !== void 0 ? _e : 1, "hour");
|
|
9773
9839
|
break;
|
|
9774
9840
|
case exports.ViewMode.QuarterDay:
|
|
9775
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9776
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9841
|
+
this._minDate = DateUtils.add(this.minDate, -((_f = this.options.marginBeforeStart) !== null && _f !== void 0 ? _f : 6), "hour");
|
|
9842
|
+
this._maxDate = DateUtils.add(this.maxDate, (_g = this.options.marginAfterEnd) !== null && _g !== void 0 ? _g : 6, "hour");
|
|
9777
9843
|
break;
|
|
9778
9844
|
case exports.ViewMode.HalfDay:
|
|
9779
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9780
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9845
|
+
this._minDate = DateUtils.add(this.minDate, -((_h = this.options.marginBeforeStart) !== null && _h !== void 0 ? _h : 12), "hour");
|
|
9846
|
+
this._maxDate = DateUtils.add(this.maxDate, (_j = this.options.marginAfterEnd) !== null && _j !== void 0 ? _j : 12, "hour");
|
|
9781
9847
|
break;
|
|
9782
9848
|
case exports.ViewMode.Day:
|
|
9783
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9784
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9849
|
+
this._minDate = DateUtils.add(this.minDate, -((_k = this.options.marginBeforeStart) !== null && _k !== void 0 ? _k : 1), "day");
|
|
9850
|
+
this._maxDate = DateUtils.add(this.maxDate, (_l = this.options.marginAfterEnd) !== null && _l !== void 0 ? _l : 1, "day");
|
|
9785
9851
|
break;
|
|
9786
9852
|
case exports.ViewMode.Week:
|
|
9787
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9788
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9853
|
+
this._minDate = DateUtils.add(this.minDate, -((_m = this.options.marginBeforeStart) !== null && _m !== void 0 ? _m : 1), "week");
|
|
9854
|
+
this._maxDate = DateUtils.add(this.maxDate, (_o = this.options.marginAfterEnd) !== null && _o !== void 0 ? _o : 1, "week");
|
|
9789
9855
|
break;
|
|
9790
9856
|
case exports.ViewMode.Month:
|
|
9791
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9792
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9857
|
+
this._minDate = DateUtils.add(this.minDate, -((_p = this.options.marginBeforeStart) !== null && _p !== void 0 ? _p : 1), "month");
|
|
9858
|
+
this._maxDate = DateUtils.add(this.maxDate, (_q = this.options.marginAfterEnd) !== null && _q !== void 0 ? _q : 1, "month");
|
|
9793
9859
|
break;
|
|
9794
9860
|
case exports.ViewMode.Year:
|
|
9795
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9796
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9861
|
+
this._minDate = DateUtils.add(this.minDate, -((_r = this.options.marginBeforeStart) !== null && _r !== void 0 ? _r : 1), "year");
|
|
9862
|
+
this._maxDate = DateUtils.add(this.maxDate, (_s = this.options.marginAfterEnd) !== null && _s !== void 0 ? _s : 1, "year");
|
|
9797
9863
|
break;
|
|
9798
9864
|
}
|
|
9799
9865
|
};
|
|
@@ -9817,8 +9883,10 @@
|
|
|
9817
9883
|
}
|
|
9818
9884
|
this.dates.push(cur_date);
|
|
9819
9885
|
}
|
|
9820
|
-
|
|
9821
|
-
|
|
9886
|
+
if (this.options.containerWidth) {
|
|
9887
|
+
var columnWidth = (this.options.containerWidth - 1) / this.dates.length;
|
|
9888
|
+
this.options.columnWidth = columnWidth < 45 ? 45 : columnWidth;
|
|
9889
|
+
}
|
|
9822
9890
|
};
|
|
9823
9891
|
Gantt.prototype.bind_events = function () {
|
|
9824
9892
|
this.bind_grid_click();
|
|
@@ -9866,6 +9934,9 @@
|
|
|
9866
9934
|
};
|
|
9867
9935
|
Gantt.prototype.make_grid_background = function () {
|
|
9868
9936
|
var grid_width = this.dates.length * this.options.columnWidth;
|
|
9937
|
+
if (this.options.containerWidth) {
|
|
9938
|
+
grid_width = this.options.containerWidth;
|
|
9939
|
+
}
|
|
9869
9940
|
var distinct_rows = __spread(new Set(this.tasks.map(function (x) { return x._row_id; })));
|
|
9870
9941
|
var grid_height = this.options.headerHeight +
|
|
9871
9942
|
this.options.padding / 2 +
|
|
@@ -9935,18 +10006,24 @@
|
|
|
9935
10006
|
for (var _b = __values(this.dates), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
9936
10007
|
var date = _c.value;
|
|
9937
10008
|
var tick_class = "tick";
|
|
9938
|
-
|
|
9939
|
-
|
|
10009
|
+
if (this.view_is(exports.ViewMode.QuarterHour) && date.getHours() === 0 && date.getMinutes() === 0) {
|
|
10010
|
+
// thick tick for first hour of day.
|
|
10011
|
+
tick_class += " thick";
|
|
10012
|
+
}
|
|
10013
|
+
else if (this.view_is([exports.ViewMode.Hour, exports.ViewMode.QuarterDay, exports.ViewMode.HalfDay]) && date.getHours() === 0) {
|
|
10014
|
+
// thick tick for first hour of day.
|
|
10015
|
+
tick_class += " thick";
|
|
10016
|
+
}
|
|
10017
|
+
else if (this.view_is(exports.ViewMode.Day) && date.getDate() === 1) {
|
|
10018
|
+
// thick tick for monday
|
|
9940
10019
|
tick_class += " thick";
|
|
9941
10020
|
}
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
date.getDate() >= 1 &&
|
|
9945
|
-
date.getDate() < 8) {
|
|
10021
|
+
else if (this.view_is(exports.ViewMode.Week) && date.getDate() >= 1 && date.getDate() < 8) {
|
|
10022
|
+
// thick tick for first week
|
|
9946
10023
|
tick_class += " thick";
|
|
9947
10024
|
}
|
|
9948
|
-
|
|
9949
|
-
|
|
10025
|
+
else if (this.view_is(exports.ViewMode.Month) && date.getMonth() % 3 === 0) {
|
|
10026
|
+
// thick ticks for quarters
|
|
9950
10027
|
tick_class += " thick";
|
|
9951
10028
|
}
|
|
9952
10029
|
createSVG("path", {
|
|
@@ -9986,7 +10063,7 @@
|
|
|
9986
10063
|
for (var _b = __values(this.dates), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
9987
10064
|
var date = _c.value;
|
|
9988
10065
|
var y = (this.options.headerHeight + this.options.padding) / 2;
|
|
9989
|
-
var isToday = date
|
|
10066
|
+
var isToday = date == DateUtils.today();
|
|
9990
10067
|
var isWeekend = (date.getDay() == 0 || date.getDay() == 6);
|
|
9991
10068
|
var className = void 0;
|
|
9992
10069
|
if (isToday) {
|
|
@@ -10024,19 +10101,8 @@
|
|
|
10024
10101
|
};
|
|
10025
10102
|
Gantt.prototype.make_dates = function () {
|
|
10026
10103
|
var dates = this.get_dates_to_draw();
|
|
10027
|
-
var isHourView = this.view_is([exports.ViewMode.Hour, exports.ViewMode.QuarterDay, exports.ViewMode.HalfDay]);
|
|
10028
|
-
var counter = 0;
|
|
10029
10104
|
for (var i = 0; i < dates.length; i++) {
|
|
10030
10105
|
var date = dates[i];
|
|
10031
|
-
if (isHourView && date.date >= this._realMinDate && date.date <= this._realMaxDate) {
|
|
10032
|
-
createSVG("text", {
|
|
10033
|
-
x: date.lower_x,
|
|
10034
|
-
y: date.lower_y,
|
|
10035
|
-
innerHTML: "H" + counter++ * this.options.step,
|
|
10036
|
-
class: "title-1",
|
|
10037
|
-
append_to: this.layers.date,
|
|
10038
|
-
});
|
|
10039
|
-
}
|
|
10040
10106
|
createSVG("text", {
|
|
10041
10107
|
x: date.lower_x,
|
|
10042
10108
|
y: date.lower_y + 20,
|
|
@@ -10044,6 +10110,15 @@
|
|
|
10044
10110
|
class: "title-2",
|
|
10045
10111
|
append_to: this.layers.date,
|
|
10046
10112
|
});
|
|
10113
|
+
if (date.middle_text) {
|
|
10114
|
+
createSVG("text", {
|
|
10115
|
+
x: date.middle_x,
|
|
10116
|
+
y: date.middle_y,
|
|
10117
|
+
innerHTML: date.middle_text,
|
|
10118
|
+
class: "middle-text",
|
|
10119
|
+
append_to: this.layers.date,
|
|
10120
|
+
});
|
|
10121
|
+
}
|
|
10047
10122
|
if (date.upper_text) {
|
|
10048
10123
|
var $upper_text = createSVG("text", {
|
|
10049
10124
|
x: date.upper_x,
|
|
@@ -10074,68 +10149,93 @@
|
|
|
10074
10149
|
last_date = DateUtils.add(date, 1, "year");
|
|
10075
10150
|
}
|
|
10076
10151
|
var date_text = {
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
dayLower: date.getDate() !== last_date.getDate()
|
|
10081
|
-
? DateUtils.format(date, "D", this.options.language)
|
|
10152
|
+
// quarter hour
|
|
10153
|
+
quarterHourUpper: date.getDate() !== last_date.getDate()
|
|
10154
|
+
? DateUtils.format(date, "D MMM", this.options.language)
|
|
10082
10155
|
: "",
|
|
10083
|
-
|
|
10156
|
+
quarterHourLower: DateUtils.format(date, "HH:mm", this.options.language),
|
|
10157
|
+
// hour
|
|
10158
|
+
hourUpper: date.getDate() !== last_date.getDate()
|
|
10084
10159
|
? DateUtils.format(date, "D MMM", this.options.language)
|
|
10085
|
-
:
|
|
10086
|
-
|
|
10087
|
-
|
|
10160
|
+
: "",
|
|
10161
|
+
hourLower: DateUtils.format(date, "HH:mm", this.options.language),
|
|
10162
|
+
// quarter day
|
|
10088
10163
|
quarterDayUpper: date.getDate() !== last_date.getDate()
|
|
10089
10164
|
? DateUtils.format(date, "D MMM", this.options.language)
|
|
10090
10165
|
: "",
|
|
10091
|
-
|
|
10092
|
-
|
|
10166
|
+
quarterDayLower: DateUtils.format(date, "HH:mm", this.options.language),
|
|
10167
|
+
// half day
|
|
10168
|
+
halfDayUpper: (date.getDate() !== last_date.getDate())
|
|
10169
|
+
? (((date.getMonth() !== last_date.getMonth()) || i < 2)
|
|
10093
10170
|
? DateUtils.format(date, "D MMM", this.options.language)
|
|
10094
|
-
: DateUtils.format(date, "D", this.options.language)
|
|
10171
|
+
: DateUtils.format(date, "D", this.options.language))
|
|
10095
10172
|
: "",
|
|
10096
|
-
|
|
10173
|
+
halfDayLower: DateUtils.format(date, "HH:mm", this.options.language),
|
|
10174
|
+
// day
|
|
10175
|
+
dayUpper: ((date.getMonth() !== last_date.getMonth()) || i === 0)
|
|
10097
10176
|
? DateUtils.format(date, "MMMM", this.options.language)
|
|
10098
10177
|
: "",
|
|
10178
|
+
dayMiddle: DateUtils.format(date, "ddd", this.options.language),
|
|
10179
|
+
dayLower: DateUtils.format(date, "D", this.options.language),
|
|
10180
|
+
// week
|
|
10099
10181
|
weekUpper: date.getMonth() !== last_date.getMonth()
|
|
10100
10182
|
? DateUtils.format(date, "MMMM", this.options.language)
|
|
10101
10183
|
: "",
|
|
10184
|
+
weekLower: date.getMonth() !== last_date.getMonth()
|
|
10185
|
+
? DateUtils.format(date, "D MMM", this.options.language)
|
|
10186
|
+
: DateUtils.format(date, "D", this.options.language),
|
|
10187
|
+
// month
|
|
10102
10188
|
monthUpper: date.getFullYear() !== last_date.getFullYear()
|
|
10103
10189
|
? DateUtils.format(date, "YYYY", this.options.language)
|
|
10104
10190
|
: "",
|
|
10191
|
+
monthLower: DateUtils.format(date, "MMMM", this.options.language),
|
|
10192
|
+
// year
|
|
10105
10193
|
yearUpper: date.getFullYear() !== last_date.getFullYear()
|
|
10106
10194
|
? DateUtils.format(date, "YYYY", this.options.language)
|
|
10107
10195
|
: "",
|
|
10108
|
-
|
|
10109
|
-
? DateUtils.format(date, "HH:mm", this.options.language)
|
|
10110
|
-
: "",
|
|
10196
|
+
yearLower: DateUtils.format(date, "YYYY", this.options.language),
|
|
10111
10197
|
};
|
|
10112
10198
|
// Descontando 20 para adcionar uma segunda linha de informação no cabeçalho
|
|
10113
10199
|
var base_pos = {
|
|
10114
10200
|
x: i * this.options.columnWidth,
|
|
10115
|
-
lower_y: this.options.headerHeight - 20,
|
|
10116
10201
|
upper_y: this.options.headerHeight - 20 - 25,
|
|
10202
|
+
middle_y: this.options.headerHeight - 20,
|
|
10203
|
+
lower_y: this.options.headerHeight - 20,
|
|
10117
10204
|
};
|
|
10118
10205
|
var x_pos = {
|
|
10206
|
+
quarterHourUpper: (this.dates.length < 14) ? (this.options.columnWidth) : (this.options.columnWidth * 24 / 2),
|
|
10207
|
+
quarterHourMiddle: this.options.columnWidth / 2,
|
|
10208
|
+
quarterHourLower: this.options.columnWidth / 2,
|
|
10209
|
+
hourUpper: (this.dates.length < 14) ? (this.options.columnWidth) : (this.options.columnWidth * 24 / 2),
|
|
10210
|
+
hourMiddle: this.options.columnWidth / 2,
|
|
10119
10211
|
hourLower: this.options.columnWidth / 2,
|
|
10120
|
-
hourUpper: this.options.columnWidth * 24 / 2,
|
|
10121
|
-
quarterDayLower: this.options.columnWidth / 2,
|
|
10122
10212
|
quarterDayUpper: this.options.columnWidth * 4 / 2,
|
|
10123
|
-
|
|
10213
|
+
quarterDayMiddle: this.options.columnWidth / 2,
|
|
10214
|
+
quarterDayLower: this.options.columnWidth / 2,
|
|
10124
10215
|
halfDayUpper: this.options.columnWidth * 2 / 2,
|
|
10216
|
+
halfDayMiddle: this.options.columnWidth / 2,
|
|
10217
|
+
halfDayLower: this.options.columnWidth / 2,
|
|
10218
|
+
dayUpper: (this.dates.length < 15) ? (this.options.columnWidth) : ((this.options.columnWidth * 30) / 2),
|
|
10219
|
+
dayMiddle: this.options.columnWidth / 2 - 12,
|
|
10125
10220
|
dayLower: this.options.columnWidth / 2,
|
|
10126
|
-
dayUpper: (this.options.columnWidth * 30) / 2,
|
|
10127
|
-
weekLower: 0,
|
|
10128
10221
|
weekUpper: (this.options.columnWidth * 4) / 2,
|
|
10222
|
+
weekMiddle: 0,
|
|
10223
|
+
weekLower: 0,
|
|
10224
|
+
monthUpper: (this.dates.length < 15) ? (this.options.columnWidth) : ((this.options.columnWidth * 12) / 2),
|
|
10225
|
+
monthMiddle: 0,
|
|
10129
10226
|
monthLower: this.options.columnWidth / 2,
|
|
10130
|
-
monthUpper: (this.options.columnWidth * 12) / 2,
|
|
10131
|
-
yearLower: this.options.columnWidth / 2,
|
|
10132
10227
|
yearUpper: (this.options.columnWidth * 30) / 2,
|
|
10228
|
+
yearMiddle: this.options.columnWidth / 2,
|
|
10229
|
+
yearLower: this.options.columnWidth / 2,
|
|
10133
10230
|
};
|
|
10134
10231
|
return {
|
|
10135
10232
|
upper_text: date_text[this.options.viewMode + "Upper"],
|
|
10233
|
+
middle_text: date_text[this.options.viewMode + "Middle"],
|
|
10136
10234
|
lower_text: date_text[this.options.viewMode + "Lower"],
|
|
10137
10235
|
upper_x: base_pos.x + x_pos[this.options.viewMode + "Upper"],
|
|
10138
10236
|
upper_y: base_pos.upper_y,
|
|
10237
|
+
middle_x: base_pos.x + x_pos[this.options.viewMode + "Middle"],
|
|
10238
|
+
middle_y: base_pos.middle_y,
|
|
10139
10239
|
lower_x: base_pos.x + x_pos[this.options.viewMode + "Lower"],
|
|
10140
10240
|
lower_y: base_pos.lower_y,
|
|
10141
10241
|
date: date,
|
|
@@ -10253,7 +10353,7 @@
|
|
|
10253
10353
|
else if (element.classList.contains("right")) {
|
|
10254
10354
|
is_resizing_right = true;
|
|
10255
10355
|
}
|
|
10256
|
-
else if (element.classList.contains("bar-wrapper")) {
|
|
10356
|
+
else if (element.classList.contains("bar-wrapper") && _this.options.allowMovement) {
|
|
10257
10357
|
is_dragging = true;
|
|
10258
10358
|
}
|
|
10259
10359
|
bar_wrapper.classList.add("active");
|
|
@@ -10307,7 +10407,7 @@
|
|
|
10307
10407
|
});
|
|
10308
10408
|
}, null);
|
|
10309
10409
|
document.addEventListener("mouseup", function (e) {
|
|
10310
|
-
if (is_dragging || is_resizing_left || is_resizing_right) {
|
|
10410
|
+
if (is_dragging || is_resizing_left || is_resizing_right || !_this.options.allowMovement) {
|
|
10311
10411
|
bars.forEach(function (bar) { return bar.group.classList.remove("active"); });
|
|
10312
10412
|
}
|
|
10313
10413
|
is_dragging = false;
|
|
@@ -10416,20 +10516,34 @@
|
|
|
10416
10516
|
this.multipleTaskPerLine = false;
|
|
10417
10517
|
this.showSideTable = true;
|
|
10418
10518
|
this.viewMode = exports.ViewMode.Day;
|
|
10519
|
+
this.allowMovement = true;
|
|
10520
|
+
this.hasPopup = true;
|
|
10521
|
+
this.fullWidth = false;
|
|
10522
|
+
this.showOnlyHours = false;
|
|
10523
|
+
this.showOnlyDays = false;
|
|
10419
10524
|
this.taskClicked = new core.EventEmitter();
|
|
10420
10525
|
this.taskDateChanged = new core.EventEmitter();
|
|
10421
10526
|
this.viewChanged = new core.EventEmitter();
|
|
10422
10527
|
}
|
|
10423
10528
|
GanttComponent.prototype.ngOnInit = function () {
|
|
10424
10529
|
this._validateViewMode();
|
|
10530
|
+
this._validateTasks();
|
|
10425
10531
|
};
|
|
10426
10532
|
GanttComponent.prototype.ngAfterViewInit = function () {
|
|
10427
10533
|
var _this = this;
|
|
10534
|
+
if (this.fullWidth) {
|
|
10535
|
+
this.containerWidth = this.outer.nativeElement.offsetWidth - this.side.nativeElement.offsetWidth;
|
|
10536
|
+
}
|
|
10428
10537
|
this._gantt = new Gantt("#gantt", this._filterTask(this.tasks), {
|
|
10429
10538
|
viewMode: this.viewMode,
|
|
10430
10539
|
marginBeforeStart: this.marginBeforeStart,
|
|
10431
10540
|
marginAfterEnd: this.marginAfterEnd,
|
|
10432
|
-
language: "pt-
|
|
10541
|
+
language: "pt-br",
|
|
10542
|
+
allowMovement: this.allowMovement,
|
|
10543
|
+
hasPopup: this.hasPopup,
|
|
10544
|
+
containerWidth: this.containerWidth,
|
|
10545
|
+
showOnlyHours: this.showOnlyHours,
|
|
10546
|
+
showOnlyDays: this.showOnlyDays,
|
|
10433
10547
|
onClick: function (task) { return _this.taskClicked.emit(task); },
|
|
10434
10548
|
onDateChange: function (task, start, end) { return _this.taskDateChanged.emit({ task: task, start: start, end: end }); },
|
|
10435
10549
|
onViewChange: function (viewMode) { return _this.viewChanged.emit(viewMode); },
|
|
@@ -10468,6 +10582,7 @@
|
|
|
10468
10582
|
};
|
|
10469
10583
|
GanttComponent.prototype._validateViewMode = function () {
|
|
10470
10584
|
if (![
|
|
10585
|
+
exports.ViewMode.QuarterHour,
|
|
10471
10586
|
exports.ViewMode.Hour,
|
|
10472
10587
|
exports.ViewMode.QuarterDay,
|
|
10473
10588
|
exports.ViewMode.HalfDay,
|
|
@@ -10479,6 +10594,15 @@
|
|
|
10479
10594
|
throw new Error("Invalid gantt view mode");
|
|
10480
10595
|
}
|
|
10481
10596
|
};
|
|
10597
|
+
GanttComponent.prototype._validateTasks = function () {
|
|
10598
|
+
this.tasks.forEach(function (group) {
|
|
10599
|
+
group.tasks.forEach(function (task) {
|
|
10600
|
+
if (task.start > task.end) {
|
|
10601
|
+
throw new Error("invalid task. The start date must be less than the end date.");
|
|
10602
|
+
}
|
|
10603
|
+
});
|
|
10604
|
+
});
|
|
10605
|
+
};
|
|
10482
10606
|
__decorate([
|
|
10483
10607
|
core.Input()
|
|
10484
10608
|
], GanttComponent.prototype, "columnTitle", void 0);
|
|
@@ -10500,6 +10624,24 @@
|
|
|
10500
10624
|
__decorate([
|
|
10501
10625
|
core.Input()
|
|
10502
10626
|
], GanttComponent.prototype, "marginAfterEnd", void 0);
|
|
10627
|
+
__decorate([
|
|
10628
|
+
core.Input()
|
|
10629
|
+
], GanttComponent.prototype, "allowMovement", void 0);
|
|
10630
|
+
__decorate([
|
|
10631
|
+
core.Input()
|
|
10632
|
+
], GanttComponent.prototype, "hasPopup", void 0);
|
|
10633
|
+
__decorate([
|
|
10634
|
+
core.Input()
|
|
10635
|
+
], GanttComponent.prototype, "containerWidth", void 0);
|
|
10636
|
+
__decorate([
|
|
10637
|
+
core.Input()
|
|
10638
|
+
], GanttComponent.prototype, "fullWidth", void 0);
|
|
10639
|
+
__decorate([
|
|
10640
|
+
core.Input()
|
|
10641
|
+
], GanttComponent.prototype, "showOnlyHours", void 0);
|
|
10642
|
+
__decorate([
|
|
10643
|
+
core.Input()
|
|
10644
|
+
], GanttComponent.prototype, "showOnlyDays", void 0);
|
|
10503
10645
|
__decorate([
|
|
10504
10646
|
core.Output()
|
|
10505
10647
|
], GanttComponent.prototype, "taskClicked", void 0);
|
|
@@ -10509,12 +10651,18 @@
|
|
|
10509
10651
|
__decorate([
|
|
10510
10652
|
core.Output()
|
|
10511
10653
|
], GanttComponent.prototype, "viewChanged", void 0);
|
|
10654
|
+
__decorate([
|
|
10655
|
+
core.ViewChild('outer')
|
|
10656
|
+
], GanttComponent.prototype, "outer", void 0);
|
|
10657
|
+
__decorate([
|
|
10658
|
+
core.ViewChild('side')
|
|
10659
|
+
], GanttComponent.prototype, "side", void 0);
|
|
10512
10660
|
GanttComponent = __decorate([
|
|
10513
10661
|
core.Component({
|
|
10514
10662
|
selector: "s-gantt",
|
|
10515
|
-
template: "<div class=\"outer\">\n <gantt-side-table\n
|
|
10663
|
+
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",
|
|
10516
10664
|
encapsulation: core.ViewEncapsulation.None,
|
|
10517
|
-
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:.
|
|
10665
|
+
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}"]
|
|
10518
10666
|
})
|
|
10519
10667
|
], GanttComponent);
|
|
10520
10668
|
return GanttComponent;
|
|
@@ -10525,6 +10673,12 @@
|
|
|
10525
10673
|
this.ROW_HEIGHT = 44;
|
|
10526
10674
|
this.multipleTaskPerLine = false;
|
|
10527
10675
|
}
|
|
10676
|
+
SideTableComponent.prototype.ngOnInit = function () {
|
|
10677
|
+
this._removeEmptyTasks();
|
|
10678
|
+
};
|
|
10679
|
+
SideTableComponent.prototype._removeEmptyTasks = function () {
|
|
10680
|
+
this.tasks = this.tasks.filter(function (task) { return task.tasks.length; });
|
|
10681
|
+
};
|
|
10528
10682
|
__decorate([
|
|
10529
10683
|
core.Input()
|
|
10530
10684
|
], SideTableComponent.prototype, "columnTitle", void 0);
|
|
@@ -10537,8 +10691,8 @@
|
|
|
10537
10691
|
SideTableComponent = __decorate([
|
|
10538
10692
|
core.Component({
|
|
10539
10693
|
selector: 'gantt-side-table',
|
|
10540
|
-
template: "<div class=\"side-table\">\n <div class=\"column-title\">\n <span>{{ columnTitle }}</span>\n </div>\n <div class=\"tasks\">\n <div
|
|
10541
|
-
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\"
|
|
10694
|
+
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",
|
|
10695
|
+
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}"]
|
|
10542
10696
|
})
|
|
10543
10697
|
], SideTableComponent);
|
|
10544
10698
|
return SideTableComponent;
|
|
@@ -10549,7 +10703,7 @@
|
|
|
10549
10703
|
}
|
|
10550
10704
|
GanttModule = __decorate([
|
|
10551
10705
|
core.NgModule({
|
|
10552
|
-
imports: [common.CommonModule],
|
|
10706
|
+
imports: [common.CommonModule, TooltipModule],
|
|
10553
10707
|
declarations: [
|
|
10554
10708
|
GanttComponent,
|
|
10555
10709
|
SideTableComponent,
|