@seniorsistemas/angular-components 17.1.4 → 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.
Files changed (26) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +117 -70
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/gantt/components/gantt/gantt.d.ts +1 -3
  6. package/components/gantt/components/side-table/side-table.component.d.ts +4 -1
  7. package/components/gantt/gantt.component.d.ts +1 -0
  8. package/components/gantt/models/view-mode.d.ts +1 -0
  9. package/esm2015/components/gantt/components/gantt/bar.js +2 -2
  10. package/esm2015/components/gantt/components/gantt/gantt.js +92 -64
  11. package/esm2015/components/gantt/components/gantt/utils/date-utils.js +3 -2
  12. package/esm2015/components/gantt/components/side-table/side-table.component.js +7 -1
  13. package/esm2015/components/gantt/gantt.component.js +14 -3
  14. package/esm2015/components/gantt/models/view-mode.js +2 -1
  15. package/esm5/components/gantt/components/gantt/bar.js +2 -2
  16. package/esm5/components/gantt/components/gantt/gantt.js +95 -67
  17. package/esm5/components/gantt/components/gantt/utils/date-utils.js +3 -2
  18. package/esm5/components/gantt/components/side-table/side-table.component.js +7 -1
  19. package/esm5/components/gantt/gantt.component.js +14 -3
  20. package/esm5/components/gantt/models/view-mode.js +2 -1
  21. package/fesm2015/seniorsistemas-angular-components.js +114 -67
  22. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  23. package/fesm5/seniorsistemas-angular-components.js +117 -70
  24. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  25. package/package.json +1 -1
  26. 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,6 +8964,7 @@ $.attr = function (element, attr, value) {
8963
8964
 
8964
8965
  var ViewMode;
8965
8966
  (function (ViewMode) {
8967
+ ViewMode["QuarterHour"] = "quarterHour";
8966
8968
  ViewMode["Hour"] = "hour";
8967
8969
  ViewMode["QuarterDay"] = "quarterDay";
8968
8970
  ViewMode["HalfDay"] = "halfDay";
@@ -9213,7 +9215,7 @@ var Bar = /** @class */ (function () {
9213
9215
  Bar.prototype._computeX = function () {
9214
9216
  var _a = this._gantt.options, step = _a.step, columnWidth = _a.columnWidth;
9215
9217
  var x;
9216
- if (this._gantt.view_is([ViewMode.Hour, ViewMode.QuarterDay, ViewMode.HalfDay, ViewMode.Day])) {
9218
+ if (this._gantt.view_is([ViewMode.QuarterHour, ViewMode.Hour, ViewMode.QuarterDay, ViewMode.HalfDay, ViewMode.Day])) {
9217
9219
  var diff = DateUtils.diff(this.task.start, this._gantt.minDate, "minutes");
9218
9220
  x = (diff / step) * (columnWidth / 60);
9219
9221
  }
@@ -9620,7 +9622,11 @@ var Gantt = /** @class */ (function () {
9620
9622
  Gantt.prototype.update_view_scale = function (view_mode) {
9621
9623
  this.options.viewMode = view_mode;
9622
9624
  // this.isHourView = false;
9623
- if (view_mode === ViewMode.Hour) {
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) {
9624
9630
  this.options.step = 24 / 24;
9625
9631
  this.options.columnWidth = 50;
9626
9632
  }
@@ -9654,12 +9660,12 @@ var Gantt = /** @class */ (function () {
9654
9660
  };
9655
9661
  Gantt.prototype.setup_gantt_dates = function () {
9656
9662
  var e_3, _a;
9657
- 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;
9658
9664
  this._minDate = null;
9659
9665
  this._maxDate = null;
9660
9666
  try {
9661
- for (var _r = __values(this.tasks), _s = _r.next(); !_s.done; _s = _r.next()) {
9662
- var task = _s.value;
9667
+ for (var _t = __values(this.tasks), _u = _t.next(); !_u.done; _u = _t.next()) {
9668
+ var task = _u.value;
9663
9669
  // set global start and end date
9664
9670
  if (!this.minDate || task.start < this.minDate) {
9665
9671
  this._minDate = DateUtils.startOf(task.start, 'day');
@@ -9672,40 +9678,41 @@ var Gantt = /** @class */ (function () {
9672
9678
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
9673
9679
  finally {
9674
9680
  try {
9675
- if (_s && !_s.done && (_a = _r.return)) _a.call(_r);
9681
+ if (_u && !_u.done && (_a = _t.return)) _a.call(_t);
9676
9682
  }
9677
9683
  finally { if (e_3) throw e_3.error; }
9678
9684
  }
9679
- this._realMinDate = this.minDate;
9680
- this._realMaxDate = this.maxDate;
9681
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");
9682
9689
  case ViewMode.Hour:
9683
- this._minDate = DateUtils.add(this.minDate, -((_b = this.options.marginBeforeStart) !== null && _b !== void 0 ? _b : 1), "hour");
9684
- this._maxDate = DateUtils.add(this.maxDate, (_c = this.options.marginAfterEnd) !== null && _c !== void 0 ? _c : 1, "hour");
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");
9685
9692
  break;
9686
9693
  case ViewMode.QuarterDay:
9687
- this._minDate = DateUtils.add(this.minDate, -((_d = this.options.marginBeforeStart) !== null && _d !== void 0 ? _d : 6), "hour");
9688
- this._maxDate = DateUtils.add(this.maxDate, (_e = this.options.marginAfterEnd) !== null && _e !== void 0 ? _e : 6, "hour");
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");
9689
9696
  break;
9690
9697
  case ViewMode.HalfDay:
9691
- this._minDate = DateUtils.add(this.minDate, -((_f = this.options.marginBeforeStart) !== null && _f !== void 0 ? _f : 12), "hour");
9692
- this._maxDate = DateUtils.add(this.maxDate, (_g = this.options.marginAfterEnd) !== null && _g !== void 0 ? _g : 12, "hour");
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");
9693
9700
  break;
9694
9701
  case ViewMode.Day:
9695
- this._minDate = DateUtils.add(this.minDate, -((_h = this.options.marginBeforeStart) !== null && _h !== void 0 ? _h : 1), "day");
9696
- this._maxDate = DateUtils.add(this.maxDate, (_j = this.options.marginAfterEnd) !== null && _j !== void 0 ? _j : 1, "day");
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");
9697
9704
  break;
9698
9705
  case ViewMode.Week:
9699
- this._minDate = DateUtils.add(this.minDate, -((_k = this.options.marginBeforeStart) !== null && _k !== void 0 ? _k : 1), "week");
9700
- this._maxDate = DateUtils.add(this.maxDate, (_l = this.options.marginAfterEnd) !== null && _l !== void 0 ? _l : 1, "week");
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");
9701
9708
  break;
9702
9709
  case ViewMode.Month:
9703
- this._minDate = DateUtils.add(this.minDate, -((_m = this.options.marginBeforeStart) !== null && _m !== void 0 ? _m : 1), "month");
9704
- this._maxDate = DateUtils.add(this.maxDate, (_o = this.options.marginAfterEnd) !== null && _o !== void 0 ? _o : 1, "month");
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");
9705
9712
  break;
9706
9713
  case ViewMode.Year:
9707
- this._minDate = DateUtils.add(this.minDate, -((_p = this.options.marginBeforeStart) !== null && _p !== void 0 ? _p : 1), "year");
9708
- this._maxDate = DateUtils.add(this.maxDate, (_q = this.options.marginAfterEnd) !== null && _q !== void 0 ? _q : 1, "year");
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");
9709
9716
  break;
9710
9717
  }
9711
9718
  };
@@ -9733,8 +9740,6 @@ var Gantt = /** @class */ (function () {
9733
9740
  var columnWidth = (this.options.containerWidth - 1) / this.dates.length;
9734
9741
  this.options.columnWidth = columnWidth < 45 ? 45 : columnWidth;
9735
9742
  }
9736
- console.log("cur_date", cur_date);
9737
- console.log("dates", this.dates);
9738
9743
  };
9739
9744
  Gantt.prototype.bind_events = function () {
9740
9745
  this.bind_grid_click();
@@ -9854,23 +9859,24 @@ var Gantt = /** @class */ (function () {
9854
9859
  for (var _b = __values(this.dates), _c = _b.next(); !_c.done; _c = _b.next()) {
9855
9860
  var date = _c.value;
9856
9861
  var tick_class = "tick";
9857
- // thick tick for monday
9858
- if (this.view_is(ViewMode.Day) && date.getDate() === 1) {
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.
9859
9868
  tick_class += " thick";
9860
9869
  }
9861
- // thick tick for first week
9862
- if (this.view_is(ViewMode.Week) &&
9863
- date.getDate() >= 1 &&
9864
- date.getDate() < 8) {
9870
+ else if (this.view_is(ViewMode.Day) && date.getDate() === 1) {
9871
+ // thick tick for monday
9865
9872
  tick_class += " thick";
9866
9873
  }
9867
- // thick ticks for quarters
9868
- if (this.view_is(ViewMode.Month) && date.getMonth() % 3 === 0) {
9874
+ else if (this.view_is(ViewMode.Week) && date.getDate() >= 1 && date.getDate() < 8) {
9875
+ // thick tick for first week
9869
9876
  tick_class += " thick";
9870
9877
  }
9871
- // Thick ticks for hours
9872
- if (this.view_is(ViewMode.Hour) &&
9873
- date.getHours() == 0) {
9878
+ else if (this.view_is(ViewMode.Month) && date.getMonth() % 3 === 0) {
9879
+ // thick ticks for quarters
9874
9880
  tick_class += " thick";
9875
9881
  }
9876
9882
  createSVG("path", {
@@ -9910,7 +9916,7 @@ var Gantt = /** @class */ (function () {
9910
9916
  for (var _b = __values(this.dates), _c = _b.next(); !_c.done; _c = _b.next()) {
9911
9917
  var date = _c.value;
9912
9918
  var y = (this.options.headerHeight + this.options.padding) / 2;
9913
- var isToday = date.toString() == DateUtils.today();
9919
+ var isToday = date == DateUtils.today();
9914
9920
  var isWeekend = (date.getDay() == 0 || date.getDay() == 6);
9915
9921
  var className = void 0;
9916
9922
  if (isToday) {
@@ -9948,19 +9954,8 @@ var Gantt = /** @class */ (function () {
9948
9954
  };
9949
9955
  Gantt.prototype.make_dates = function () {
9950
9956
  var dates = this.get_dates_to_draw();
9951
- var isHourView = this.view_is([ViewMode.Hour, ViewMode.QuarterDay, ViewMode.HalfDay]);
9952
- var counter = 0;
9953
9957
  for (var i = 0; i < dates.length; i++) {
9954
9958
  var date = dates[i];
9955
- if (isHourView && date.date >= this._realMinDate && date.date <= this._realMaxDate) {
9956
- createSVG("text", {
9957
- x: date.lower_x,
9958
- y: date.lower_y,
9959
- innerHTML: "H" + counter++ * this.options.step,
9960
- class: "title-1",
9961
- append_to: this.layers.date,
9962
- });
9963
- }
9964
9959
  createSVG("text", {
9965
9960
  x: date.lower_x,
9966
9961
  y: date.lower_y + 20,
@@ -9968,6 +9963,15 @@ var Gantt = /** @class */ (function () {
9968
9963
  class: "title-2",
9969
9964
  append_to: this.layers.date,
9970
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
+ }
9971
9975
  if (date.upper_text) {
9972
9976
  var $upper_text = createSVG("text", {
9973
9977
  x: date.upper_x,
@@ -9998,67 +10002,93 @@ var Gantt = /** @class */ (function () {
9998
10002
  last_date = DateUtils.add(date, 1, "year");
9999
10003
  }
10000
10004
  var date_text = {
10001
- hourLower: DateUtils.format(date, "HH:mm", this.options.language),
10002
- quarterDayLower: DateUtils.format(date, "HH:mm", this.options.language),
10003
- halfDayLower: DateUtils.format(date, "HH:mm", this.options.language),
10004
- dayLower: DateUtils.format(date, "D", this.options.language),
10005
- weekLower: date.getMonth() !== last_date.getMonth()
10005
+ // quarter hour
10006
+ quarterHourUpper: date.getDate() !== last_date.getDate()
10006
10007
  ? DateUtils.format(date, "D MMM", this.options.language)
10007
- : DateUtils.format(date, "D", this.options.language),
10008
- monthLower: DateUtils.format(date, "MMMM", this.options.language),
10009
- yearLower: DateUtils.format(date, "YYYY", this.options.language),
10008
+ : "",
10009
+ quarterHourLower: DateUtils.format(date, "HH:mm", this.options.language),
10010
+ // hour
10011
+ hourUpper: date.getDate() !== last_date.getDate()
10012
+ ? DateUtils.format(date, "D MMM", this.options.language)
10013
+ : "",
10014
+ hourLower: DateUtils.format(date, "HH:mm", this.options.language),
10015
+ // quarter day
10010
10016
  quarterDayUpper: date.getDate() !== last_date.getDate()
10011
10017
  ? DateUtils.format(date, "D MMM", this.options.language)
10012
10018
  : "",
10019
+ quarterDayLower: DateUtils.format(date, "HH:mm", this.options.language),
10020
+ // half day
10013
10021
  halfDayUpper: (date.getDate() !== last_date.getDate())
10014
10022
  ? (((date.getMonth() !== last_date.getMonth()) || i < 2)
10015
10023
  ? DateUtils.format(date, "D MMM", this.options.language)
10016
10024
  : DateUtils.format(date, "D", this.options.language))
10017
10025
  : "",
10026
+ halfDayLower: DateUtils.format(date, "HH:mm", this.options.language),
10027
+ // day
10018
10028
  dayUpper: ((date.getMonth() !== last_date.getMonth()) || i === 0)
10019
10029
  ? DateUtils.format(date, "MMMM", this.options.language)
10020
10030
  : "",
10031
+ dayMiddle: DateUtils.format(date, "ddd", this.options.language),
10032
+ dayLower: DateUtils.format(date, "D", this.options.language),
10033
+ // week
10021
10034
  weekUpper: date.getMonth() !== last_date.getMonth()
10022
10035
  ? DateUtils.format(date, "MMMM", this.options.language)
10023
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
10024
10041
  monthUpper: date.getFullYear() !== last_date.getFullYear()
10025
10042
  ? DateUtils.format(date, "YYYY", this.options.language)
10026
10043
  : "",
10044
+ monthLower: DateUtils.format(date, "MMMM", this.options.language),
10045
+ // year
10027
10046
  yearUpper: date.getFullYear() !== last_date.getFullYear()
10028
10047
  ? DateUtils.format(date, "YYYY", this.options.language)
10029
10048
  : "",
10030
- hourUpper: date.getDate() !== last_date.getDate()
10031
- ? DateUtils.format(date, "D MMM", this.options.language)
10032
- : "",
10049
+ yearLower: DateUtils.format(date, "YYYY", this.options.language),
10033
10050
  };
10034
10051
  // Descontando 20 para adcionar uma segunda linha de informação no cabeçalho
10035
10052
  var base_pos = {
10036
10053
  x: i * this.options.columnWidth,
10037
- lower_y: this.options.headerHeight - 20,
10038
10054
  upper_y: this.options.headerHeight - 20 - 25,
10055
+ middle_y: this.options.headerHeight - 20,
10056
+ lower_y: this.options.headerHeight - 20,
10039
10057
  };
10040
- debugger;
10041
10058
  var x_pos = {
10042
- hourLower: this.options.columnWidth / 2,
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,
10043
10062
  hourUpper: (this.dates.length < 14) ? (this.options.columnWidth) : (this.options.columnWidth * 24 / 2),
10044
- quarterDayLower: this.options.columnWidth / 2,
10063
+ hourMiddle: this.options.columnWidth / 2,
10064
+ hourLower: this.options.columnWidth / 2,
10045
10065
  quarterDayUpper: this.options.columnWidth * 4 / 2,
10046
- halfDayLower: this.options.columnWidth / 2,
10066
+ quarterDayMiddle: this.options.columnWidth / 2,
10067
+ quarterDayLower: this.options.columnWidth / 2,
10047
10068
  halfDayUpper: this.options.columnWidth * 2 / 2,
10048
- dayLower: this.options.columnWidth / 2,
10069
+ halfDayMiddle: this.options.columnWidth / 2,
10070
+ halfDayLower: this.options.columnWidth / 2,
10049
10071
  dayUpper: (this.dates.length < 15) ? (this.options.columnWidth) : ((this.options.columnWidth * 30) / 2),
10050
- weekLower: 0,
10072
+ dayMiddle: this.options.columnWidth / 2 - 12,
10073
+ dayLower: this.options.columnWidth / 2,
10051
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,
10052
10079
  monthLower: this.options.columnWidth / 2,
10053
- monthUpper: (this.options.columnWidth * 12) / 2,
10054
- yearLower: this.options.columnWidth / 2,
10055
10080
  yearUpper: (this.options.columnWidth * 30) / 2,
10081
+ yearMiddle: this.options.columnWidth / 2,
10082
+ yearLower: this.options.columnWidth / 2,
10056
10083
  };
10057
10084
  return {
10058
10085
  upper_text: date_text[this.options.viewMode + "Upper"],
10086
+ middle_text: date_text[this.options.viewMode + "Middle"],
10059
10087
  lower_text: date_text[this.options.viewMode + "Lower"],
10060
10088
  upper_x: base_pos.x + x_pos[this.options.viewMode + "Upper"],
10061
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,
10062
10092
  lower_x: base_pos.x + x_pos[this.options.viewMode + "Lower"],
10063
10093
  lower_y: base_pos.lower_y,
10064
10094
  date: date,
@@ -10350,6 +10380,7 @@ var GanttComponent = /** @class */ (function () {
10350
10380
  }
10351
10381
  GanttComponent.prototype.ngOnInit = function () {
10352
10382
  this._validateViewMode();
10383
+ this._validateTasks();
10353
10384
  };
10354
10385
  GanttComponent.prototype.ngAfterViewInit = function () {
10355
10386
  var _this = this;
@@ -10360,7 +10391,7 @@ var GanttComponent = /** @class */ (function () {
10360
10391
  viewMode: this.viewMode,
10361
10392
  marginBeforeStart: this.marginBeforeStart,
10362
10393
  marginAfterEnd: this.marginAfterEnd,
10363
- language: "pt-BR",
10394
+ language: "pt-br",
10364
10395
  allowMovement: this.allowMovement,
10365
10396
  hasPopup: this.hasPopup,
10366
10397
  containerWidth: this.containerWidth,
@@ -10404,6 +10435,7 @@ var GanttComponent = /** @class */ (function () {
10404
10435
  };
10405
10436
  GanttComponent.prototype._validateViewMode = function () {
10406
10437
  if (![
10438
+ ViewMode.QuarterHour,
10407
10439
  ViewMode.Hour,
10408
10440
  ViewMode.QuarterDay,
10409
10441
  ViewMode.HalfDay,
@@ -10415,6 +10447,15 @@ var GanttComponent = /** @class */ (function () {
10415
10447
  throw new Error("Invalid gantt view mode");
10416
10448
  }
10417
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
+ };
10418
10459
  __decorate([
10419
10460
  Input()
10420
10461
  ], GanttComponent.prototype, "columnTitle", void 0);
@@ -10474,7 +10515,7 @@ var GanttComponent = /** @class */ (function () {
10474
10515
  selector: "s-gantt",
10475
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",
10476
10517
  encapsulation: ViewEncapsulation.None,
10477
- 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:#533a3a8c;stroke-width:.4}.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
+ 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}"]
10478
10519
  })
10479
10520
  ], GanttComponent);
10480
10521
  return GanttComponent;
@@ -10485,6 +10526,12 @@ var SideTableComponent = /** @class */ (function () {
10485
10526
  this.ROW_HEIGHT = 44;
10486
10527
  this.multipleTaskPerLine = false;
10487
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
+ };
10488
10535
  __decorate([
10489
10536
  Input()
10490
10537
  ], SideTableComponent.prototype, "columnTitle", void 0);