@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
|
@@ -8736,11 +8736,12 @@ var DateUtils = /** @class */ (function () {
|
|
|
8736
8736
|
.startOf("month")
|
|
8737
8737
|
.format("MMMM");
|
|
8738
8738
|
var monthNameCapitalized = monthName.charAt(0).toUpperCase() + monthName.slice(1);
|
|
8739
|
-
var dateToFormat = moment$7(date);
|
|
8739
|
+
var dateToFormat = moment$7(date).locale(lang);
|
|
8740
8740
|
var format_map = {
|
|
8741
8741
|
YYYY: dateToFormat.format("YYYY"),
|
|
8742
8742
|
MM: dateToFormat.format("MM"),
|
|
8743
8743
|
DD: dateToFormat.format("DD"),
|
|
8744
|
+
ddd: dateToFormat.format("ddd").toUpperCase().replace(".", ""),
|
|
8744
8745
|
HH: dateToFormat.format("HH"),
|
|
8745
8746
|
mm: dateToFormat.format("mm"),
|
|
8746
8747
|
ss: dateToFormat.format("ss"),
|
|
@@ -8963,17 +8964,19 @@ $.attr = function (element, attr, value) {
|
|
|
8963
8964
|
|
|
8964
8965
|
var ViewMode;
|
|
8965
8966
|
(function (ViewMode) {
|
|
8967
|
+
ViewMode["QuarterHour"] = "quarterHour";
|
|
8968
|
+
ViewMode["Hour"] = "hour";
|
|
8966
8969
|
ViewMode["QuarterDay"] = "quarterDay";
|
|
8967
8970
|
ViewMode["HalfDay"] = "halfDay";
|
|
8968
8971
|
ViewMode["Day"] = "day";
|
|
8969
8972
|
ViewMode["Week"] = "week";
|
|
8970
8973
|
ViewMode["Month"] = "month";
|
|
8971
8974
|
ViewMode["Year"] = "year";
|
|
8972
|
-
ViewMode["Hour"] = "hour";
|
|
8973
8975
|
})(ViewMode || (ViewMode = {}));
|
|
8974
8976
|
|
|
8975
8977
|
var Bar = /** @class */ (function () {
|
|
8976
8978
|
function Bar(gantt, task) {
|
|
8979
|
+
this._isPopUpOpen = false;
|
|
8977
8980
|
this._setDefaults(gantt, task);
|
|
8978
8981
|
this._prepare();
|
|
8979
8982
|
this._draw();
|
|
@@ -9144,38 +9147,62 @@ var Bar = /** @class */ (function () {
|
|
|
9144
9147
|
}
|
|
9145
9148
|
};
|
|
9146
9149
|
Bar.prototype._setupClickEvent = function () {
|
|
9150
|
+
//TODO
|
|
9147
9151
|
var _this = this;
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
_this.
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9152
|
+
if (this._gantt.options.hasPopup) {
|
|
9153
|
+
$.on(this.group, "focus " + this._gantt.options.popupTrigger, function (e) {
|
|
9154
|
+
// just finished a move action, wait for a few seconds
|
|
9155
|
+
if (!_this._actionCompleted) {
|
|
9156
|
+
_this._showPopup();
|
|
9157
|
+
_this._gantt.unselect_all();
|
|
9158
|
+
_this.group.classList.add("active");
|
|
9159
|
+
}
|
|
9160
|
+
}, null);
|
|
9161
|
+
$.on(this.group, "dblclick", function (e) {
|
|
9162
|
+
// just finished a move action, wait for a few seconds
|
|
9163
|
+
if (!_this._actionCompleted) {
|
|
9164
|
+
_this._gantt.trigger_event("onClick", [_this.task]);
|
|
9165
|
+
}
|
|
9166
|
+
}, null);
|
|
9167
|
+
}
|
|
9168
|
+
else {
|
|
9169
|
+
$.on(this.group, "mouseenter", function (e) {
|
|
9170
|
+
if (!_this._isPopUpOpen) {
|
|
9171
|
+
_this._showPopup({
|
|
9172
|
+
x: e.clientX,
|
|
9173
|
+
y: _this.group.getBoundingClientRect().top + 30,
|
|
9174
|
+
position: 'middle'
|
|
9175
|
+
});
|
|
9176
|
+
_this._isPopUpOpen = true;
|
|
9177
|
+
}
|
|
9178
|
+
}, null);
|
|
9179
|
+
$.on(this.group, "mouseleave", function (e) {
|
|
9180
|
+
_this._gantt.hide_popup();
|
|
9181
|
+
_this._isPopUpOpen = false;
|
|
9182
|
+
}, null);
|
|
9183
|
+
$.on(this.group, "focus click", function (e) {
|
|
9184
|
+
if (!_this._actionCompleted) {
|
|
9185
|
+
_this._gantt.unselect_all();
|
|
9186
|
+
_this.group.classList.add("active");
|
|
9187
|
+
_this._gantt.trigger_event("onClick", [_this.task]);
|
|
9188
|
+
}
|
|
9189
|
+
}, null);
|
|
9190
|
+
}
|
|
9162
9191
|
};
|
|
9163
|
-
Bar.prototype._showPopup = function () {
|
|
9192
|
+
Bar.prototype._showPopup = function (args) {
|
|
9164
9193
|
if (this._gantt.bar_being_dragged) {
|
|
9165
9194
|
return;
|
|
9166
9195
|
}
|
|
9167
|
-
var
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
task: this.task,
|
|
9178
|
-
});
|
|
9196
|
+
var subtitle = {};
|
|
9197
|
+
if (!this._gantt.options.showOnlyHours) {
|
|
9198
|
+
subtitle.startDate = DateUtils.format(this.task.start, 'DD/MM/YYYY', this._gantt.options.language);
|
|
9199
|
+
subtitle.endDate = DateUtils.format(this.task.end, 'DD/MM/YYYY', this._gantt.options.language);
|
|
9200
|
+
}
|
|
9201
|
+
if (!this._gantt.options.showOnlyDays) {
|
|
9202
|
+
subtitle.startHour = DateUtils.format(this.task.start, 'HH:mm:ss', this._gantt.options.language);
|
|
9203
|
+
subtitle.endHour = DateUtils.format(this.task.end, 'HH:mm:ss', this._gantt.options.language);
|
|
9204
|
+
}
|
|
9205
|
+
this._gantt.show_popup(__assign({ target_element: this.element, title: this.task.name, subtitle: subtitle, task: this.task }, args));
|
|
9179
9206
|
};
|
|
9180
9207
|
Bar.prototype._computeStartEndDate = function () {
|
|
9181
9208
|
var bar = this.element;
|
|
@@ -9187,11 +9214,14 @@ var Bar = /** @class */ (function () {
|
|
|
9187
9214
|
};
|
|
9188
9215
|
Bar.prototype._computeX = function () {
|
|
9189
9216
|
var _a = this._gantt.options, step = _a.step, columnWidth = _a.columnWidth;
|
|
9190
|
-
var
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9217
|
+
var x;
|
|
9218
|
+
if (this._gantt.view_is([ViewMode.QuarterHour, ViewMode.Hour, ViewMode.QuarterDay, ViewMode.HalfDay, ViewMode.Day])) {
|
|
9219
|
+
var diff = DateUtils.diff(this.task.start, this._gantt.minDate, "minutes");
|
|
9220
|
+
x = (diff / step) * (columnWidth / 60);
|
|
9221
|
+
}
|
|
9222
|
+
else {
|
|
9223
|
+
var diff = DateUtils.diff(this.task.start, this._gantt.minDate, "hour");
|
|
9224
|
+
x = (diff / step) * (columnWidth);
|
|
9195
9225
|
}
|
|
9196
9226
|
return x;
|
|
9197
9227
|
};
|
|
@@ -9245,6 +9275,7 @@ var Popup = /** @class */ (function () {
|
|
|
9245
9275
|
this.make();
|
|
9246
9276
|
}
|
|
9247
9277
|
Popup.prototype.show = function (options) {
|
|
9278
|
+
var _a, _b, _c, _d;
|
|
9248
9279
|
if (!options.target_element) {
|
|
9249
9280
|
throw new Error("target_element is required to show popup");
|
|
9250
9281
|
}
|
|
@@ -9252,6 +9283,7 @@ var Popup = /** @class */ (function () {
|
|
|
9252
9283
|
options.position = "left";
|
|
9253
9284
|
}
|
|
9254
9285
|
var target_element = options.target_element;
|
|
9286
|
+
this.parent.style.display = 'block';
|
|
9255
9287
|
if (this.customHtml) {
|
|
9256
9288
|
var html = this.customHtml(options.task);
|
|
9257
9289
|
html += '<div class="pointer"></div>';
|
|
@@ -9261,7 +9293,10 @@ var Popup = /** @class */ (function () {
|
|
|
9261
9293
|
else {
|
|
9262
9294
|
// set data
|
|
9263
9295
|
this.title.innerHTML = options.title;
|
|
9264
|
-
this.
|
|
9296
|
+
this.startDate.innerHTML = (_a = options.subtitle.startDate) !== null && _a !== void 0 ? _a : '';
|
|
9297
|
+
this.startHour.innerHTML = (_b = options.subtitle.startHour) !== null && _b !== void 0 ? _b : '';
|
|
9298
|
+
this.endDate.innerHTML = (_c = options.subtitle.endDate) !== null && _c !== void 0 ? _c : '';
|
|
9299
|
+
this.endHour.innerHTML = (_d = options.subtitle.endHour) !== null && _d !== void 0 ? _d : '';
|
|
9265
9300
|
this.parent.style.width = this.parent.clientWidth + "px";
|
|
9266
9301
|
}
|
|
9267
9302
|
// set position
|
|
@@ -9272,7 +9307,23 @@ var Popup = /** @class */ (function () {
|
|
|
9272
9307
|
else if (target_element instanceof SVGElement) {
|
|
9273
9308
|
positionMeta = options.target_element.getBBox();
|
|
9274
9309
|
}
|
|
9275
|
-
if (options.position === '
|
|
9310
|
+
if (options.position === 'middle') {
|
|
9311
|
+
this.parent.style.position = 'fixed';
|
|
9312
|
+
this.parent.style.top = options.y + "px";
|
|
9313
|
+
this.pointer.style.transform = "rotateZ(180deg)";
|
|
9314
|
+
this.pointer.style.top = "-10px";
|
|
9315
|
+
if ((options.x - 17) + this.parent.offsetWidth > window.innerWidth) {
|
|
9316
|
+
this.parent.style.left = (options.x - this.parent.offsetWidth + 17) + "px";
|
|
9317
|
+
this.pointer.style.right = "16px";
|
|
9318
|
+
this.pointer.style.left = "auto";
|
|
9319
|
+
}
|
|
9320
|
+
else {
|
|
9321
|
+
this.parent.style.left = (options.x - 17) + "px";
|
|
9322
|
+
this.pointer.style.left = "16px";
|
|
9323
|
+
this.pointer.style.right = "auto";
|
|
9324
|
+
}
|
|
9325
|
+
}
|
|
9326
|
+
else if (options.position === 'left') {
|
|
9276
9327
|
this.parent.style.left = positionMeta.x + (positionMeta.width + 10) + "px";
|
|
9277
9328
|
this.parent.style.top = positionMeta.y + "px";
|
|
9278
9329
|
this.pointer.style.transform = "rotateZ(90deg)";
|
|
@@ -9283,14 +9334,18 @@ var Popup = /** @class */ (function () {
|
|
|
9283
9334
|
this.parent.style.opacity = 1;
|
|
9284
9335
|
};
|
|
9285
9336
|
Popup.prototype.make = function () {
|
|
9286
|
-
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 <
|
|
9337
|
+
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 ";
|
|
9287
9338
|
this.hide();
|
|
9288
9339
|
this.title = this.parent.querySelector(".title");
|
|
9289
|
-
this.
|
|
9340
|
+
this.startDate = this.parent.querySelector(".startDate");
|
|
9341
|
+
this.startHour = this.parent.querySelector(".startHour");
|
|
9342
|
+
this.endDate = this.parent.querySelector(".endDate");
|
|
9343
|
+
this.endHour = this.parent.querySelector(".endHour");
|
|
9290
9344
|
this.pointer = this.parent.querySelector(".pointer");
|
|
9291
9345
|
};
|
|
9292
9346
|
Popup.prototype.hide = function () {
|
|
9293
9347
|
this.parent.style.opacity = 0;
|
|
9348
|
+
this.parent.style.display = 'none';
|
|
9294
9349
|
this.parent.style.left = 0;
|
|
9295
9350
|
};
|
|
9296
9351
|
return Popup;
|
|
@@ -9388,12 +9443,16 @@ var defaultOptions = {
|
|
|
9388
9443
|
popupTrigger: "click",
|
|
9389
9444
|
customPopupHtml: null,
|
|
9390
9445
|
language: "en",
|
|
9446
|
+
allowMovement: true,
|
|
9447
|
+
hasPopup: true,
|
|
9448
|
+
showOnlyHours: false,
|
|
9449
|
+
showOnlyDays: false,
|
|
9391
9450
|
};
|
|
9392
9451
|
|
|
9393
9452
|
var Gantt = /** @class */ (function () {
|
|
9394
9453
|
function Gantt(wrapper, tasks, options) {
|
|
9395
|
-
this.setup_wrapper(wrapper);
|
|
9396
9454
|
this.setup_options(options);
|
|
9455
|
+
this.setup_wrapper(wrapper);
|
|
9397
9456
|
this.setup_tasks(tasks);
|
|
9398
9457
|
// initialize with default view mode
|
|
9399
9458
|
this.change_view_mode();
|
|
@@ -9445,6 +9504,9 @@ var Gantt = /** @class */ (function () {
|
|
|
9445
9504
|
// wrapper element
|
|
9446
9505
|
this.$container = document.createElement("div");
|
|
9447
9506
|
this.$container.classList.add("gantt-container");
|
|
9507
|
+
if (this.options.containerWidth) {
|
|
9508
|
+
this.$container.style.width = this.options.containerWidth + 'px';
|
|
9509
|
+
}
|
|
9448
9510
|
var parent_element = this.$svg.parentElement;
|
|
9449
9511
|
parent_element.appendChild(this.$container);
|
|
9450
9512
|
this.$container.appendChild(this.$svg);
|
|
@@ -9550,6 +9612,7 @@ var Gantt = /** @class */ (function () {
|
|
|
9550
9612
|
};
|
|
9551
9613
|
Gantt.prototype.change_view_mode = function (mode) {
|
|
9552
9614
|
if (mode === void 0) { mode = this.options.viewMode; }
|
|
9615
|
+
this.setup_gantt_dates();
|
|
9553
9616
|
this.update_view_scale(mode);
|
|
9554
9617
|
this.setup_dates();
|
|
9555
9618
|
this.render();
|
|
@@ -9559,10 +9622,13 @@ var Gantt = /** @class */ (function () {
|
|
|
9559
9622
|
Gantt.prototype.update_view_scale = function (view_mode) {
|
|
9560
9623
|
this.options.viewMode = view_mode;
|
|
9561
9624
|
// this.isHourView = false;
|
|
9562
|
-
if (view_mode === ViewMode.
|
|
9625
|
+
if (view_mode === ViewMode.QuarterHour) {
|
|
9626
|
+
this.options.step = 24 / 24 / 4;
|
|
9627
|
+
this.options.columnWidth = 50;
|
|
9628
|
+
}
|
|
9629
|
+
else if (view_mode === ViewMode.Hour) {
|
|
9563
9630
|
this.options.step = 24 / 24;
|
|
9564
9631
|
this.options.columnWidth = 50;
|
|
9565
|
-
// this.isHourView = true;
|
|
9566
9632
|
}
|
|
9567
9633
|
else if (view_mode === ViewMode.Day) {
|
|
9568
9634
|
this.options.step = 24;
|
|
@@ -9590,20 +9656,19 @@ var Gantt = /** @class */ (function () {
|
|
|
9590
9656
|
}
|
|
9591
9657
|
};
|
|
9592
9658
|
Gantt.prototype.setup_dates = function () {
|
|
9593
|
-
this.setup_gantt_dates();
|
|
9594
9659
|
this.setup_date_values();
|
|
9595
9660
|
};
|
|
9596
9661
|
Gantt.prototype.setup_gantt_dates = function () {
|
|
9597
9662
|
var e_3, _a;
|
|
9598
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
9663
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
9599
9664
|
this._minDate = null;
|
|
9600
9665
|
this._maxDate = null;
|
|
9601
9666
|
try {
|
|
9602
|
-
for (var
|
|
9603
|
-
var task =
|
|
9667
|
+
for (var _t = __values(this.tasks), _u = _t.next(); !_u.done; _u = _t.next()) {
|
|
9668
|
+
var task = _u.value;
|
|
9604
9669
|
// set global start and end date
|
|
9605
9670
|
if (!this.minDate || task.start < this.minDate) {
|
|
9606
|
-
this._minDate = task.start;
|
|
9671
|
+
this._minDate = DateUtils.startOf(task.start, 'day');
|
|
9607
9672
|
}
|
|
9608
9673
|
if (!this.maxDate || task.end > this.maxDate) {
|
|
9609
9674
|
this._maxDate = task.end;
|
|
@@ -9613,40 +9678,41 @@ var Gantt = /** @class */ (function () {
|
|
|
9613
9678
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
9614
9679
|
finally {
|
|
9615
9680
|
try {
|
|
9616
|
-
if (
|
|
9681
|
+
if (_u && !_u.done && (_a = _t.return)) _a.call(_t);
|
|
9617
9682
|
}
|
|
9618
9683
|
finally { if (e_3) throw e_3.error; }
|
|
9619
9684
|
}
|
|
9620
|
-
this._realMinDate = this.minDate;
|
|
9621
|
-
this._realMaxDate = this.maxDate;
|
|
9622
9685
|
switch (this.options.viewMode) {
|
|
9686
|
+
case ViewMode.QuarterHour:
|
|
9687
|
+
this._minDate = DateUtils.add(this.minDate, -((_b = this.options.marginBeforeStart) !== null && _b !== void 0 ? _b : 15), "minutes");
|
|
9688
|
+
this._maxDate = DateUtils.add(this.maxDate, (_c = this.options.marginAfterEnd) !== null && _c !== void 0 ? _c : 15, "minutes");
|
|
9623
9689
|
case ViewMode.Hour:
|
|
9624
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9625
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9690
|
+
this._minDate = DateUtils.add(this.minDate, -((_d = this.options.marginBeforeStart) !== null && _d !== void 0 ? _d : 1), "hour");
|
|
9691
|
+
this._maxDate = DateUtils.add(this.maxDate, (_e = this.options.marginAfterEnd) !== null && _e !== void 0 ? _e : 1, "hour");
|
|
9626
9692
|
break;
|
|
9627
9693
|
case ViewMode.QuarterDay:
|
|
9628
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9629
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9694
|
+
this._minDate = DateUtils.add(this.minDate, -((_f = this.options.marginBeforeStart) !== null && _f !== void 0 ? _f : 6), "hour");
|
|
9695
|
+
this._maxDate = DateUtils.add(this.maxDate, (_g = this.options.marginAfterEnd) !== null && _g !== void 0 ? _g : 6, "hour");
|
|
9630
9696
|
break;
|
|
9631
9697
|
case ViewMode.HalfDay:
|
|
9632
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9633
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9698
|
+
this._minDate = DateUtils.add(this.minDate, -((_h = this.options.marginBeforeStart) !== null && _h !== void 0 ? _h : 12), "hour");
|
|
9699
|
+
this._maxDate = DateUtils.add(this.maxDate, (_j = this.options.marginAfterEnd) !== null && _j !== void 0 ? _j : 12, "hour");
|
|
9634
9700
|
break;
|
|
9635
9701
|
case ViewMode.Day:
|
|
9636
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9637
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9702
|
+
this._minDate = DateUtils.add(this.minDate, -((_k = this.options.marginBeforeStart) !== null && _k !== void 0 ? _k : 1), "day");
|
|
9703
|
+
this._maxDate = DateUtils.add(this.maxDate, (_l = this.options.marginAfterEnd) !== null && _l !== void 0 ? _l : 1, "day");
|
|
9638
9704
|
break;
|
|
9639
9705
|
case ViewMode.Week:
|
|
9640
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9641
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9706
|
+
this._minDate = DateUtils.add(this.minDate, -((_m = this.options.marginBeforeStart) !== null && _m !== void 0 ? _m : 1), "week");
|
|
9707
|
+
this._maxDate = DateUtils.add(this.maxDate, (_o = this.options.marginAfterEnd) !== null && _o !== void 0 ? _o : 1, "week");
|
|
9642
9708
|
break;
|
|
9643
9709
|
case ViewMode.Month:
|
|
9644
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9645
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9710
|
+
this._minDate = DateUtils.add(this.minDate, -((_p = this.options.marginBeforeStart) !== null && _p !== void 0 ? _p : 1), "month");
|
|
9711
|
+
this._maxDate = DateUtils.add(this.maxDate, (_q = this.options.marginAfterEnd) !== null && _q !== void 0 ? _q : 1, "month");
|
|
9646
9712
|
break;
|
|
9647
9713
|
case ViewMode.Year:
|
|
9648
|
-
this._minDate = DateUtils.add(this.minDate, -((
|
|
9649
|
-
this._maxDate = DateUtils.add(this.maxDate, (
|
|
9714
|
+
this._minDate = DateUtils.add(this.minDate, -((_r = this.options.marginBeforeStart) !== null && _r !== void 0 ? _r : 1), "year");
|
|
9715
|
+
this._maxDate = DateUtils.add(this.maxDate, (_s = this.options.marginAfterEnd) !== null && _s !== void 0 ? _s : 1, "year");
|
|
9650
9716
|
break;
|
|
9651
9717
|
}
|
|
9652
9718
|
};
|
|
@@ -9670,8 +9736,10 @@ var Gantt = /** @class */ (function () {
|
|
|
9670
9736
|
}
|
|
9671
9737
|
this.dates.push(cur_date);
|
|
9672
9738
|
}
|
|
9673
|
-
|
|
9674
|
-
|
|
9739
|
+
if (this.options.containerWidth) {
|
|
9740
|
+
var columnWidth = (this.options.containerWidth - 1) / this.dates.length;
|
|
9741
|
+
this.options.columnWidth = columnWidth < 45 ? 45 : columnWidth;
|
|
9742
|
+
}
|
|
9675
9743
|
};
|
|
9676
9744
|
Gantt.prototype.bind_events = function () {
|
|
9677
9745
|
this.bind_grid_click();
|
|
@@ -9719,6 +9787,9 @@ var Gantt = /** @class */ (function () {
|
|
|
9719
9787
|
};
|
|
9720
9788
|
Gantt.prototype.make_grid_background = function () {
|
|
9721
9789
|
var grid_width = this.dates.length * this.options.columnWidth;
|
|
9790
|
+
if (this.options.containerWidth) {
|
|
9791
|
+
grid_width = this.options.containerWidth;
|
|
9792
|
+
}
|
|
9722
9793
|
var distinct_rows = __spread(new Set(this.tasks.map(function (x) { return x._row_id; })));
|
|
9723
9794
|
var grid_height = this.options.headerHeight +
|
|
9724
9795
|
this.options.padding / 2 +
|
|
@@ -9788,18 +9859,24 @@ var Gantt = /** @class */ (function () {
|
|
|
9788
9859
|
for (var _b = __values(this.dates), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
9789
9860
|
var date = _c.value;
|
|
9790
9861
|
var tick_class = "tick";
|
|
9791
|
-
|
|
9792
|
-
|
|
9862
|
+
if (this.view_is(ViewMode.QuarterHour) && date.getHours() === 0 && date.getMinutes() === 0) {
|
|
9863
|
+
// thick tick for first hour of day.
|
|
9864
|
+
tick_class += " thick";
|
|
9865
|
+
}
|
|
9866
|
+
else if (this.view_is([ViewMode.Hour, ViewMode.QuarterDay, ViewMode.HalfDay]) && date.getHours() === 0) {
|
|
9867
|
+
// thick tick for first hour of day.
|
|
9868
|
+
tick_class += " thick";
|
|
9869
|
+
}
|
|
9870
|
+
else if (this.view_is(ViewMode.Day) && date.getDate() === 1) {
|
|
9871
|
+
// thick tick for monday
|
|
9793
9872
|
tick_class += " thick";
|
|
9794
9873
|
}
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
date.getDate() >= 1 &&
|
|
9798
|
-
date.getDate() < 8) {
|
|
9874
|
+
else if (this.view_is(ViewMode.Week) && date.getDate() >= 1 && date.getDate() < 8) {
|
|
9875
|
+
// thick tick for first week
|
|
9799
9876
|
tick_class += " thick";
|
|
9800
9877
|
}
|
|
9801
|
-
|
|
9802
|
-
|
|
9878
|
+
else if (this.view_is(ViewMode.Month) && date.getMonth() % 3 === 0) {
|
|
9879
|
+
// thick ticks for quarters
|
|
9803
9880
|
tick_class += " thick";
|
|
9804
9881
|
}
|
|
9805
9882
|
createSVG("path", {
|
|
@@ -9839,7 +9916,7 @@ var Gantt = /** @class */ (function () {
|
|
|
9839
9916
|
for (var _b = __values(this.dates), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
9840
9917
|
var date = _c.value;
|
|
9841
9918
|
var y = (this.options.headerHeight + this.options.padding) / 2;
|
|
9842
|
-
var isToday = date
|
|
9919
|
+
var isToday = date == DateUtils.today();
|
|
9843
9920
|
var isWeekend = (date.getDay() == 0 || date.getDay() == 6);
|
|
9844
9921
|
var className = void 0;
|
|
9845
9922
|
if (isToday) {
|
|
@@ -9877,19 +9954,8 @@ var Gantt = /** @class */ (function () {
|
|
|
9877
9954
|
};
|
|
9878
9955
|
Gantt.prototype.make_dates = function () {
|
|
9879
9956
|
var dates = this.get_dates_to_draw();
|
|
9880
|
-
var isHourView = this.view_is([ViewMode.Hour, ViewMode.QuarterDay, ViewMode.HalfDay]);
|
|
9881
|
-
var counter = 0;
|
|
9882
9957
|
for (var i = 0; i < dates.length; i++) {
|
|
9883
9958
|
var date = dates[i];
|
|
9884
|
-
if (isHourView && date.date >= this._realMinDate && date.date <= this._realMaxDate) {
|
|
9885
|
-
createSVG("text", {
|
|
9886
|
-
x: date.lower_x,
|
|
9887
|
-
y: date.lower_y,
|
|
9888
|
-
innerHTML: "H" + counter++ * this.options.step,
|
|
9889
|
-
class: "title-1",
|
|
9890
|
-
append_to: this.layers.date,
|
|
9891
|
-
});
|
|
9892
|
-
}
|
|
9893
9959
|
createSVG("text", {
|
|
9894
9960
|
x: date.lower_x,
|
|
9895
9961
|
y: date.lower_y + 20,
|
|
@@ -9897,6 +9963,15 @@ var Gantt = /** @class */ (function () {
|
|
|
9897
9963
|
class: "title-2",
|
|
9898
9964
|
append_to: this.layers.date,
|
|
9899
9965
|
});
|
|
9966
|
+
if (date.middle_text) {
|
|
9967
|
+
createSVG("text", {
|
|
9968
|
+
x: date.middle_x,
|
|
9969
|
+
y: date.middle_y,
|
|
9970
|
+
innerHTML: date.middle_text,
|
|
9971
|
+
class: "middle-text",
|
|
9972
|
+
append_to: this.layers.date,
|
|
9973
|
+
});
|
|
9974
|
+
}
|
|
9900
9975
|
if (date.upper_text) {
|
|
9901
9976
|
var $upper_text = createSVG("text", {
|
|
9902
9977
|
x: date.upper_x,
|
|
@@ -9927,68 +10002,93 @@ var Gantt = /** @class */ (function () {
|
|
|
9927
10002
|
last_date = DateUtils.add(date, 1, "year");
|
|
9928
10003
|
}
|
|
9929
10004
|
var date_text = {
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
dayLower: date.getDate() !== last_date.getDate()
|
|
9934
|
-
? DateUtils.format(date, "D", this.options.language)
|
|
10005
|
+
// quarter hour
|
|
10006
|
+
quarterHourUpper: date.getDate() !== last_date.getDate()
|
|
10007
|
+
? DateUtils.format(date, "D MMM", this.options.language)
|
|
9935
10008
|
: "",
|
|
9936
|
-
|
|
10009
|
+
quarterHourLower: DateUtils.format(date, "HH:mm", this.options.language),
|
|
10010
|
+
// hour
|
|
10011
|
+
hourUpper: date.getDate() !== last_date.getDate()
|
|
9937
10012
|
? DateUtils.format(date, "D MMM", this.options.language)
|
|
9938
|
-
:
|
|
9939
|
-
|
|
9940
|
-
|
|
10013
|
+
: "",
|
|
10014
|
+
hourLower: DateUtils.format(date, "HH:mm", this.options.language),
|
|
10015
|
+
// quarter day
|
|
9941
10016
|
quarterDayUpper: date.getDate() !== last_date.getDate()
|
|
9942
10017
|
? DateUtils.format(date, "D MMM", this.options.language)
|
|
9943
10018
|
: "",
|
|
9944
|
-
|
|
9945
|
-
|
|
10019
|
+
quarterDayLower: DateUtils.format(date, "HH:mm", this.options.language),
|
|
10020
|
+
// half day
|
|
10021
|
+
halfDayUpper: (date.getDate() !== last_date.getDate())
|
|
10022
|
+
? (((date.getMonth() !== last_date.getMonth()) || i < 2)
|
|
9946
10023
|
? DateUtils.format(date, "D MMM", this.options.language)
|
|
9947
|
-
: DateUtils.format(date, "D", this.options.language)
|
|
10024
|
+
: DateUtils.format(date, "D", this.options.language))
|
|
9948
10025
|
: "",
|
|
9949
|
-
|
|
10026
|
+
halfDayLower: DateUtils.format(date, "HH:mm", this.options.language),
|
|
10027
|
+
// day
|
|
10028
|
+
dayUpper: ((date.getMonth() !== last_date.getMonth()) || i === 0)
|
|
9950
10029
|
? DateUtils.format(date, "MMMM", this.options.language)
|
|
9951
10030
|
: "",
|
|
10031
|
+
dayMiddle: DateUtils.format(date, "ddd", this.options.language),
|
|
10032
|
+
dayLower: DateUtils.format(date, "D", this.options.language),
|
|
10033
|
+
// week
|
|
9952
10034
|
weekUpper: date.getMonth() !== last_date.getMonth()
|
|
9953
10035
|
? DateUtils.format(date, "MMMM", this.options.language)
|
|
9954
10036
|
: "",
|
|
10037
|
+
weekLower: date.getMonth() !== last_date.getMonth()
|
|
10038
|
+
? DateUtils.format(date, "D MMM", this.options.language)
|
|
10039
|
+
: DateUtils.format(date, "D", this.options.language),
|
|
10040
|
+
// month
|
|
9955
10041
|
monthUpper: date.getFullYear() !== last_date.getFullYear()
|
|
9956
10042
|
? DateUtils.format(date, "YYYY", this.options.language)
|
|
9957
10043
|
: "",
|
|
10044
|
+
monthLower: DateUtils.format(date, "MMMM", this.options.language),
|
|
10045
|
+
// year
|
|
9958
10046
|
yearUpper: date.getFullYear() !== last_date.getFullYear()
|
|
9959
10047
|
? DateUtils.format(date, "YYYY", this.options.language)
|
|
9960
10048
|
: "",
|
|
9961
|
-
|
|
9962
|
-
? DateUtils.format(date, "HH:mm", this.options.language)
|
|
9963
|
-
: "",
|
|
10049
|
+
yearLower: DateUtils.format(date, "YYYY", this.options.language),
|
|
9964
10050
|
};
|
|
9965
10051
|
// Descontando 20 para adcionar uma segunda linha de informação no cabeçalho
|
|
9966
10052
|
var base_pos = {
|
|
9967
10053
|
x: i * this.options.columnWidth,
|
|
9968
|
-
lower_y: this.options.headerHeight - 20,
|
|
9969
10054
|
upper_y: this.options.headerHeight - 20 - 25,
|
|
10055
|
+
middle_y: this.options.headerHeight - 20,
|
|
10056
|
+
lower_y: this.options.headerHeight - 20,
|
|
9970
10057
|
};
|
|
9971
10058
|
var x_pos = {
|
|
10059
|
+
quarterHourUpper: (this.dates.length < 14) ? (this.options.columnWidth) : (this.options.columnWidth * 24 / 2),
|
|
10060
|
+
quarterHourMiddle: this.options.columnWidth / 2,
|
|
10061
|
+
quarterHourLower: this.options.columnWidth / 2,
|
|
10062
|
+
hourUpper: (this.dates.length < 14) ? (this.options.columnWidth) : (this.options.columnWidth * 24 / 2),
|
|
10063
|
+
hourMiddle: this.options.columnWidth / 2,
|
|
9972
10064
|
hourLower: this.options.columnWidth / 2,
|
|
9973
|
-
hourUpper: this.options.columnWidth * 24 / 2,
|
|
9974
|
-
quarterDayLower: this.options.columnWidth / 2,
|
|
9975
10065
|
quarterDayUpper: this.options.columnWidth * 4 / 2,
|
|
9976
|
-
|
|
10066
|
+
quarterDayMiddle: this.options.columnWidth / 2,
|
|
10067
|
+
quarterDayLower: this.options.columnWidth / 2,
|
|
9977
10068
|
halfDayUpper: this.options.columnWidth * 2 / 2,
|
|
10069
|
+
halfDayMiddle: this.options.columnWidth / 2,
|
|
10070
|
+
halfDayLower: this.options.columnWidth / 2,
|
|
10071
|
+
dayUpper: (this.dates.length < 15) ? (this.options.columnWidth) : ((this.options.columnWidth * 30) / 2),
|
|
10072
|
+
dayMiddle: this.options.columnWidth / 2 - 12,
|
|
9978
10073
|
dayLower: this.options.columnWidth / 2,
|
|
9979
|
-
dayUpper: (this.options.columnWidth * 30) / 2,
|
|
9980
|
-
weekLower: 0,
|
|
9981
10074
|
weekUpper: (this.options.columnWidth * 4) / 2,
|
|
10075
|
+
weekMiddle: 0,
|
|
10076
|
+
weekLower: 0,
|
|
10077
|
+
monthUpper: (this.dates.length < 15) ? (this.options.columnWidth) : ((this.options.columnWidth * 12) / 2),
|
|
10078
|
+
monthMiddle: 0,
|
|
9982
10079
|
monthLower: this.options.columnWidth / 2,
|
|
9983
|
-
monthUpper: (this.options.columnWidth * 12) / 2,
|
|
9984
|
-
yearLower: this.options.columnWidth / 2,
|
|
9985
10080
|
yearUpper: (this.options.columnWidth * 30) / 2,
|
|
10081
|
+
yearMiddle: this.options.columnWidth / 2,
|
|
10082
|
+
yearLower: this.options.columnWidth / 2,
|
|
9986
10083
|
};
|
|
9987
10084
|
return {
|
|
9988
10085
|
upper_text: date_text[this.options.viewMode + "Upper"],
|
|
10086
|
+
middle_text: date_text[this.options.viewMode + "Middle"],
|
|
9989
10087
|
lower_text: date_text[this.options.viewMode + "Lower"],
|
|
9990
10088
|
upper_x: base_pos.x + x_pos[this.options.viewMode + "Upper"],
|
|
9991
10089
|
upper_y: base_pos.upper_y,
|
|
10090
|
+
middle_x: base_pos.x + x_pos[this.options.viewMode + "Middle"],
|
|
10091
|
+
middle_y: base_pos.middle_y,
|
|
9992
10092
|
lower_x: base_pos.x + x_pos[this.options.viewMode + "Lower"],
|
|
9993
10093
|
lower_y: base_pos.lower_y,
|
|
9994
10094
|
date: date,
|
|
@@ -10106,7 +10206,7 @@ var Gantt = /** @class */ (function () {
|
|
|
10106
10206
|
else if (element.classList.contains("right")) {
|
|
10107
10207
|
is_resizing_right = true;
|
|
10108
10208
|
}
|
|
10109
|
-
else if (element.classList.contains("bar-wrapper")) {
|
|
10209
|
+
else if (element.classList.contains("bar-wrapper") && _this.options.allowMovement) {
|
|
10110
10210
|
is_dragging = true;
|
|
10111
10211
|
}
|
|
10112
10212
|
bar_wrapper.classList.add("active");
|
|
@@ -10160,7 +10260,7 @@ var Gantt = /** @class */ (function () {
|
|
|
10160
10260
|
});
|
|
10161
10261
|
}, null);
|
|
10162
10262
|
document.addEventListener("mouseup", function (e) {
|
|
10163
|
-
if (is_dragging || is_resizing_left || is_resizing_right) {
|
|
10263
|
+
if (is_dragging || is_resizing_left || is_resizing_right || !_this.options.allowMovement) {
|
|
10164
10264
|
bars.forEach(function (bar) { return bar.group.classList.remove("active"); });
|
|
10165
10265
|
}
|
|
10166
10266
|
is_dragging = false;
|
|
@@ -10269,20 +10369,34 @@ var GanttComponent = /** @class */ (function () {
|
|
|
10269
10369
|
this.multipleTaskPerLine = false;
|
|
10270
10370
|
this.showSideTable = true;
|
|
10271
10371
|
this.viewMode = ViewMode.Day;
|
|
10372
|
+
this.allowMovement = true;
|
|
10373
|
+
this.hasPopup = true;
|
|
10374
|
+
this.fullWidth = false;
|
|
10375
|
+
this.showOnlyHours = false;
|
|
10376
|
+
this.showOnlyDays = false;
|
|
10272
10377
|
this.taskClicked = new EventEmitter();
|
|
10273
10378
|
this.taskDateChanged = new EventEmitter();
|
|
10274
10379
|
this.viewChanged = new EventEmitter();
|
|
10275
10380
|
}
|
|
10276
10381
|
GanttComponent.prototype.ngOnInit = function () {
|
|
10277
10382
|
this._validateViewMode();
|
|
10383
|
+
this._validateTasks();
|
|
10278
10384
|
};
|
|
10279
10385
|
GanttComponent.prototype.ngAfterViewInit = function () {
|
|
10280
10386
|
var _this = this;
|
|
10387
|
+
if (this.fullWidth) {
|
|
10388
|
+
this.containerWidth = this.outer.nativeElement.offsetWidth - this.side.nativeElement.offsetWidth;
|
|
10389
|
+
}
|
|
10281
10390
|
this._gantt = new Gantt("#gantt", this._filterTask(this.tasks), {
|
|
10282
10391
|
viewMode: this.viewMode,
|
|
10283
10392
|
marginBeforeStart: this.marginBeforeStart,
|
|
10284
10393
|
marginAfterEnd: this.marginAfterEnd,
|
|
10285
|
-
language: "pt-
|
|
10394
|
+
language: "pt-br",
|
|
10395
|
+
allowMovement: this.allowMovement,
|
|
10396
|
+
hasPopup: this.hasPopup,
|
|
10397
|
+
containerWidth: this.containerWidth,
|
|
10398
|
+
showOnlyHours: this.showOnlyHours,
|
|
10399
|
+
showOnlyDays: this.showOnlyDays,
|
|
10286
10400
|
onClick: function (task) { return _this.taskClicked.emit(task); },
|
|
10287
10401
|
onDateChange: function (task, start, end) { return _this.taskDateChanged.emit({ task: task, start: start, end: end }); },
|
|
10288
10402
|
onViewChange: function (viewMode) { return _this.viewChanged.emit(viewMode); },
|
|
@@ -10321,6 +10435,7 @@ var GanttComponent = /** @class */ (function () {
|
|
|
10321
10435
|
};
|
|
10322
10436
|
GanttComponent.prototype._validateViewMode = function () {
|
|
10323
10437
|
if (![
|
|
10438
|
+
ViewMode.QuarterHour,
|
|
10324
10439
|
ViewMode.Hour,
|
|
10325
10440
|
ViewMode.QuarterDay,
|
|
10326
10441
|
ViewMode.HalfDay,
|
|
@@ -10332,6 +10447,15 @@ var GanttComponent = /** @class */ (function () {
|
|
|
10332
10447
|
throw new Error("Invalid gantt view mode");
|
|
10333
10448
|
}
|
|
10334
10449
|
};
|
|
10450
|
+
GanttComponent.prototype._validateTasks = function () {
|
|
10451
|
+
this.tasks.forEach(function (group) {
|
|
10452
|
+
group.tasks.forEach(function (task) {
|
|
10453
|
+
if (task.start > task.end) {
|
|
10454
|
+
throw new Error("invalid task. The start date must be less than the end date.");
|
|
10455
|
+
}
|
|
10456
|
+
});
|
|
10457
|
+
});
|
|
10458
|
+
};
|
|
10335
10459
|
__decorate([
|
|
10336
10460
|
Input()
|
|
10337
10461
|
], GanttComponent.prototype, "columnTitle", void 0);
|
|
@@ -10353,6 +10477,24 @@ var GanttComponent = /** @class */ (function () {
|
|
|
10353
10477
|
__decorate([
|
|
10354
10478
|
Input()
|
|
10355
10479
|
], GanttComponent.prototype, "marginAfterEnd", void 0);
|
|
10480
|
+
__decorate([
|
|
10481
|
+
Input()
|
|
10482
|
+
], GanttComponent.prototype, "allowMovement", void 0);
|
|
10483
|
+
__decorate([
|
|
10484
|
+
Input()
|
|
10485
|
+
], GanttComponent.prototype, "hasPopup", void 0);
|
|
10486
|
+
__decorate([
|
|
10487
|
+
Input()
|
|
10488
|
+
], GanttComponent.prototype, "containerWidth", void 0);
|
|
10489
|
+
__decorate([
|
|
10490
|
+
Input()
|
|
10491
|
+
], GanttComponent.prototype, "fullWidth", void 0);
|
|
10492
|
+
__decorate([
|
|
10493
|
+
Input()
|
|
10494
|
+
], GanttComponent.prototype, "showOnlyHours", void 0);
|
|
10495
|
+
__decorate([
|
|
10496
|
+
Input()
|
|
10497
|
+
], GanttComponent.prototype, "showOnlyDays", void 0);
|
|
10356
10498
|
__decorate([
|
|
10357
10499
|
Output()
|
|
10358
10500
|
], GanttComponent.prototype, "taskClicked", void 0);
|
|
@@ -10362,12 +10504,18 @@ var GanttComponent = /** @class */ (function () {
|
|
|
10362
10504
|
__decorate([
|
|
10363
10505
|
Output()
|
|
10364
10506
|
], GanttComponent.prototype, "viewChanged", void 0);
|
|
10507
|
+
__decorate([
|
|
10508
|
+
ViewChild('outer')
|
|
10509
|
+
], GanttComponent.prototype, "outer", void 0);
|
|
10510
|
+
__decorate([
|
|
10511
|
+
ViewChild('side')
|
|
10512
|
+
], GanttComponent.prototype, "side", void 0);
|
|
10365
10513
|
GanttComponent = __decorate([
|
|
10366
10514
|
Component({
|
|
10367
10515
|
selector: "s-gantt",
|
|
10368
|
-
template: "<div class=\"outer\">\n <gantt-side-table\n
|
|
10516
|
+
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",
|
|
10369
10517
|
encapsulation: ViewEncapsulation.None,
|
|
10370
|
-
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:.
|
|
10518
|
+
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}"]
|
|
10371
10519
|
})
|
|
10372
10520
|
], GanttComponent);
|
|
10373
10521
|
return GanttComponent;
|
|
@@ -10378,6 +10526,12 @@ var SideTableComponent = /** @class */ (function () {
|
|
|
10378
10526
|
this.ROW_HEIGHT = 44;
|
|
10379
10527
|
this.multipleTaskPerLine = false;
|
|
10380
10528
|
}
|
|
10529
|
+
SideTableComponent.prototype.ngOnInit = function () {
|
|
10530
|
+
this._removeEmptyTasks();
|
|
10531
|
+
};
|
|
10532
|
+
SideTableComponent.prototype._removeEmptyTasks = function () {
|
|
10533
|
+
this.tasks = this.tasks.filter(function (task) { return task.tasks.length; });
|
|
10534
|
+
};
|
|
10381
10535
|
__decorate([
|
|
10382
10536
|
Input()
|
|
10383
10537
|
], SideTableComponent.prototype, "columnTitle", void 0);
|
|
@@ -10390,8 +10544,8 @@ var SideTableComponent = /** @class */ (function () {
|
|
|
10390
10544
|
SideTableComponent = __decorate([
|
|
10391
10545
|
Component({
|
|
10392
10546
|
selector: 'gantt-side-table',
|
|
10393
|
-
template: "<div class=\"side-table\">\n <div class=\"column-title\">\n <span>{{ columnTitle }}</span>\n </div>\n <div class=\"tasks\">\n <div
|
|
10394
|
-
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\"
|
|
10547
|
+
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",
|
|
10548
|
+
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}"]
|
|
10395
10549
|
})
|
|
10396
10550
|
], SideTableComponent);
|
|
10397
10551
|
return SideTableComponent;
|
|
@@ -10402,7 +10556,7 @@ var GanttModule = /** @class */ (function () {
|
|
|
10402
10556
|
}
|
|
10403
10557
|
GanttModule = __decorate([
|
|
10404
10558
|
NgModule({
|
|
10405
|
-
imports: [CommonModule],
|
|
10559
|
+
imports: [CommonModule, TooltipModule],
|
|
10406
10560
|
declarations: [
|
|
10407
10561
|
GanttComponent,
|
|
10408
10562
|
SideTableComponent,
|