react-big-schedule 4.3.3 → 4.4.0

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.
@@ -20,13 +20,13 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
20
20
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
21
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
22
22
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
23
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
24
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
23
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
26
24
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
27
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
28
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
25
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
29
26
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
27
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
28
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
29
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
30
30
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
31
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
32
32
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable no-return-assign */
@@ -74,11 +74,10 @@ var endResizable = function endResizable(_ref3) {
74
74
  };
75
75
  var EventItem = /*#__PURE__*/function (_Component) {
76
76
  _inherits(EventItem, _Component);
77
- var _super = _createSuper(EventItem);
78
77
  function EventItem(_props) {
79
78
  var _this;
80
79
  _classCallCheck(this, EventItem);
81
- _this = _super.call(this, _props);
80
+ _this = _callSuper(this, EventItem, [_props]);
82
81
  _defineProperty(_assertThisInitialized(_this), "resizerHelper", function (dragtype) {
83
82
  var eventType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'addEventListener';
84
83
  var resizer = dragtype === 'start' ? _this.startResizer : _this.endResizer;
@@ -25,23 +25,22 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
25
25
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26
26
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
27
27
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
28
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
29
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
30
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
28
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
31
29
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
32
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
33
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
30
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
34
31
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
33
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
34
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
35
35
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
36
36
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
37
37
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
38
38
  var ResourceEvents = /*#__PURE__*/function (_Component) {
39
39
  _inherits(ResourceEvents, _Component);
40
- var _super = _createSuper(ResourceEvents);
41
40
  function ResourceEvents(props) {
42
41
  var _this;
43
42
  _classCallCheck(this, ResourceEvents);
44
- _this = _super.call(this, props);
43
+ _this = _callSuper(this, ResourceEvents, [props]);
45
44
  _defineProperty(_assertThisInitialized(_this), "supportTouchHelper", function () {
46
45
  var evType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'add';
47
46
  var ev = evType === 'add' ? _this.eventContainer.addEventListener : _this.eventContainer.removeEventListener;
@@ -697,133 +697,137 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
697
697
  }
698
698
 
699
699
  // Previous Code
700
- // _createHeaders() {
701
- // const headers = [];
702
- // let start = this.localeDayjs(new Date(this.startDate));
703
- // let end = this.localeDayjs(new Date(this.endDate));
704
- // let header = start;
705
-
706
- // if (this.showAgenda) {
707
- // headers.push({ time: header.format(DATETIME_FORMAT), nonWorkingTime: false });
708
- // } else if (this.cellUnit === CellUnit.Hour) {
709
- // if (start.hour() === 0) {
710
- // start = start.add(this.config.dayStartFrom, 'hours');
711
- // }
712
- // if (end.hour() === 0) {
713
- // end = end.add(this.config.dayStopTo, 'hours');
714
- // }
715
- // header = start;
716
-
717
- // let prevHour = -1;
718
- // while (header >= start && header <= end) {
719
- // // prevent doubled hours on time change
720
- // if (header.hour() === prevHour) {
721
- // header = header.add(1, 'hours');
722
- // continue;
723
- // }
724
- // prevHour = header.hour();
725
- // const minuteSteps = this.getMinuteStepsInHour();
726
- // for (let i = 0; i < minuteSteps; i++) {
727
- // const hour = header.hour();
728
- // if (hour >= this.config.dayStartFrom && hour <= this.config.dayStopTo) {
729
- // const time = header.format(DATETIME_FORMAT);
730
- // const nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
731
- // headers.push({ time, nonWorkingTime });
732
- // }
733
-
734
- // header = header.add(this.config.minuteStep, 'minutes');
735
- // }
736
- // }
737
- // } else if (this.cellUnit === CellUnit.Day) {
738
- // while (header >= start && header <= end) {
739
- // const time = header.format(DATETIME_FORMAT);
740
- // const dayOfWeek = header.weekday();
741
- // if (this.config.displayWeekend || (dayOfWeek !== 0 && dayOfWeek !== 6)) {
742
- // const nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
743
- // headers.push({ time, nonWorkingTime });
744
- // }
745
-
746
- // header = header.add(1, 'days');
747
- // }
748
- // } else if (this.cellUnit === CellUnit.Week) {
749
- // while (header >= start && header <= end) {
750
- // const time = header.format(DATE_FORMAT);
751
- // headers.push({ time });
752
- // header = header.add(1, 'weeks').startOf('week');
753
- // }
754
- // } else if (this.cellUnit === CellUnit.Month) {
755
- // while (header >= start && header <= end) {
756
- // const time = header.format(DATE_FORMAT);
757
- // headers.push({ time });
758
- // header = header.add(1, 'months').startOf('month');
759
- // }
760
- // } else if (this.cellUnit === CellUnit.Year) {
761
- // while (header >= start && header <= end) {
762
- // const time = header.format(DATE_FORMAT);
763
- // headers.push({ time });
764
- // header = header.add(1, 'years').startOf('year');
765
- // }
766
- // }
767
-
768
- // this.headers = headers;
769
- // }
770
700
  }, {
771
701
  key: "_createHeaders",
772
702
  value: function _createHeaders() {
773
- var _this4 = this;
774
703
  var headers = [];
775
704
  var start = this.localeDayjs(new Date(this.startDate));
776
705
  var end = this.localeDayjs(new Date(this.endDate));
777
- var processHeader = function processHeader(header, format, unit, incrementFn) {
778
- var head = header;
779
- while (head >= start && head <= end) {
780
- var time = head.format(format);
781
- if (unit === _default.CellUnit.Day) {
782
- var dayOfWeek = head.weekday();
783
- if (_this4.config.displayWeekend || dayOfWeek !== 0 && dayOfWeek !== 6) {
784
- var nonWorkingTime = _this4.behaviors.isNonWorkingTimeFunc(_this4, time);
706
+ var header = start;
707
+ if (this.showAgenda) {
708
+ headers.push({
709
+ time: header.format(_default.DATETIME_FORMAT),
710
+ nonWorkingTime: false
711
+ });
712
+ } else if (this.cellUnit === _default.CellUnit.Hour) {
713
+ if (start.hour() === 0) {
714
+ start = start.add(this.config.dayStartFrom, 'hours');
715
+ }
716
+ if (end.hour() === 0) {
717
+ end = end.add(this.config.dayStopTo, 'hours');
718
+ }
719
+ header = start;
720
+ var prevHour = -1;
721
+ while (header >= start && header <= end) {
722
+ // prevent doubled hours on time change
723
+ if (header.hour() === prevHour) {
724
+ header = header.add(1, 'hours');
725
+ // eslint-disable-next-line no-continue
726
+ continue;
727
+ }
728
+ prevHour = header.hour();
729
+ var minuteSteps = this.getMinuteStepsInHour();
730
+ for (var i = 0; i < minuteSteps; i += 1) {
731
+ var hour = header.hour();
732
+ if (hour >= this.config.dayStartFrom && hour <= this.config.dayStopTo) {
733
+ var time = header.format(_default.DATETIME_FORMAT);
734
+ var nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
785
735
  headers.push({
786
736
  time: time,
787
737
  nonWorkingTime: nonWorkingTime
788
738
  });
789
739
  }
790
- } else {
791
- headers.push({
792
- time: time
793
- });
740
+ header = header.add(this.config.minuteStep, 'minutes');
794
741
  }
795
- head = head.add(1, incrementFn);
796
742
  }
797
- };
798
- if (this.showAgenda) {
799
- headers.push({
800
- time: start.format(_default.DATETIME_FORMAT),
801
- nonWorkingTime: false
802
- });
803
- } else if (this.cellUnit === _default.CellUnit.Hour) {
804
- var hourIncrement = this.config.minuteStep < 60 ? 'minutes' : 'hours';
805
- var minuteSteps = this.getMinuteStepsInHour();
806
- var header = start.hour() === 0 ? start.add(this.config.dayStartFrom, 'hours') : start;
807
- while (header <= end) {
808
- var hour = header.hour();
809
- if (hour >= this.config.dayStartFrom && hour <= this.config.dayStopTo) {
810
- var time = header.format(_default.DATETIME_FORMAT);
811
- var nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
743
+ } else if (this.cellUnit === _default.CellUnit.Day) {
744
+ while (header >= start && header <= end) {
745
+ var _time = header.format(_default.DATETIME_FORMAT);
746
+ var dayOfWeek = header.weekday();
747
+ if (this.config.displayWeekend || dayOfWeek !== 0 && dayOfWeek !== 6) {
748
+ var _nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, _time);
812
749
  headers.push({
813
- time: time,
814
- nonWorkingTime: nonWorkingTime
750
+ time: _time,
751
+ nonWorkingTime: _nonWorkingTime
815
752
  });
816
753
  }
817
- header = header.add(minuteSteps, hourIncrement);
754
+ header = header.add(1, 'days');
755
+ }
756
+ } else if (this.cellUnit === _default.CellUnit.Week) {
757
+ while (header >= start && header <= end) {
758
+ var _time2 = header.format(_default.DATE_FORMAT);
759
+ headers.push({
760
+ time: _time2
761
+ });
762
+ header = header.add(1, 'weeks').startOf('week');
763
+ }
764
+ } else if (this.cellUnit === _default.CellUnit.Month) {
765
+ while (header >= start && header <= end) {
766
+ var _time3 = header.format(_default.DATE_FORMAT);
767
+ headers.push({
768
+ time: _time3
769
+ });
770
+ header = header.add(1, 'months').startOf('month');
771
+ }
772
+ } else if (this.cellUnit === _default.CellUnit.Year) {
773
+ while (header >= start && header <= end) {
774
+ var _time4 = header.format(_default.DATE_FORMAT);
775
+ headers.push({
776
+ time: _time4
777
+ });
778
+ header = header.add(1, 'years').startOf('year');
818
779
  }
819
- } else {
820
- var _header = start;
821
- var format = this.cellUnit === _default.CellUnit.Day ? _default.DATETIME_FORMAT : _default.DATE_FORMAT;
822
- var incrementFn = this.cellUnit === _default.CellUnit.Day ? 'days' : "".concat(this.cellUnit, "s");
823
- processHeader(_header, format, this.cellUnit, incrementFn);
824
780
  }
825
781
  this.headers = headers;
826
782
  }
783
+
784
+ // Fix Optimited code
785
+ // _createHeaders() {
786
+ // const headers = [];
787
+ // const start = this.localeDayjs(new Date(this.startDate));
788
+ // const end = this.localeDayjs(new Date(this.endDate));
789
+
790
+ // const processHeader = (header, format, unit, incrementFn) => {
791
+ // let head = header;
792
+ // while (head >= start && head <= end) {
793
+ // const time = head.format(format);
794
+ // if (unit === CellUnit.Day) {
795
+ // const dayOfWeek = head.weekday();
796
+ // if (this.config.displayWeekend || (dayOfWeek !== 0 && dayOfWeek !== 6)) {
797
+ // const nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
798
+ // headers.push({ time, nonWorkingTime });
799
+ // }
800
+ // } else {
801
+ // headers.push({ time });
802
+ // }
803
+ // head = head.add(1, incrementFn);
804
+ // }
805
+ // };
806
+
807
+ // if (this.showAgenda) {
808
+ // headers.push({ time: start.format(DATETIME_FORMAT), nonWorkingTime: false });
809
+ // } else if (this.cellUnit === CellUnit.Hour) {
810
+ // const hourIncrement = this.config.minuteStep < 60 ? 'minutes' : 'hours';
811
+ // const minuteSteps = this.getMinuteStepsInHour();
812
+ // let header = start.hour() === 0 ? start.add(this.config.dayStartFrom, 'hours') : start;
813
+ // while (header <= end) {
814
+ // const hour = header.hour();
815
+ // if (hour >= this.config.dayStartFrom && hour <= this.config.dayStopTo) {
816
+ // const time = header.format(DATETIME_FORMAT);
817
+ // const nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
818
+ // headers.push({ time, nonWorkingTime });
819
+ // }
820
+ // header = header.add(minuteSteps, hourIncrement);
821
+ // }
822
+ // } else {
823
+ // const header = start;
824
+ // const format = this.cellUnit === CellUnit.Day ? DATETIME_FORMAT : DATE_FORMAT;
825
+ // const incrementFn = this.cellUnit === CellUnit.Day ? 'days' : `${this.cellUnit}s`;
826
+ // processHeader(header, format, this.cellUnit, incrementFn);
827
+ // }
828
+
829
+ // this.headers = headers;
830
+ // }
827
831
  }, {
828
832
  key: "_createInitHeaderEvents",
829
833
  value: function _createInitHeaderEvents(header) {
@@ -879,12 +883,12 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
879
883
  }, {
880
884
  key: "_generateEventGroups",
881
885
  value: function _generateEventGroups() {
882
- var _this5 = this;
886
+ var _this4 = this;
883
887
  var eventGroups = [];
884
888
  var set = new Set();
885
889
  this.events.forEach(function (item) {
886
- var groupId = _this5._getEventGroupId(item);
887
- var groupName = _this5._getEventGroupName(item);
890
+ var groupId = _this4._getEventGroupId(item);
891
+ var groupName = _this4._getEventGroupName(item);
888
892
  if (!set.has(groupId)) {
889
893
  eventGroups.push({
890
894
  id: groupId,
@@ -899,13 +903,13 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
899
903
  }, {
900
904
  key: "_createInitRenderData",
901
905
  value: function _createInitRenderData(isEventPerspective, eventGroups, resources, headers) {
902
- var _this6 = this;
906
+ var _this5 = this;
903
907
  var slots = isEventPerspective ? eventGroups : resources;
904
908
  var slotTree = [];
905
909
  var slotMap = new Map();
906
910
  slots.forEach(function (slot) {
907
911
  var headerEvents = headers.map(function (header) {
908
- return _this6._createInitHeaderEvents(header);
912
+ return _this5._createInitHeaderEvents(header);
909
913
  });
910
914
  var slotRenderData = {
911
915
  slotId: slot.id,
@@ -915,7 +919,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
915
919
  groupOnly: slot.groupOnly,
916
920
  hasSummary: false,
917
921
  rowMaxCount: 0,
918
- rowHeight: _this6.config.nonAgendaSlotMinHeight !== 0 ? _this6.config.nonAgendaSlotMinHeight : _this6.config.eventItemLineHeight + 2,
922
+ rowHeight: _this5.config.nonAgendaSlotMinHeight !== 0 ? _this5.config.nonAgendaSlotMinHeight : _this5.config.eventItemLineHeight + 2,
919
923
  headerItems: headerEvents,
920
924
  indent: 0,
921
925
  hasChildren: false,
@@ -1127,18 +1131,18 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
1127
1131
  }, {
1128
1132
  key: "_createRenderData",
1129
1133
  value: function _createRenderData() {
1130
- var _this7 = this;
1134
+ var _this6 = this;
1131
1135
  var initRenderData = this._createInitRenderData(this.isEventPerspective, this.eventGroups, this.resources, this.headers);
1132
1136
  // this.events.sort(this._compare);
1133
1137
  var cellMaxEventsCount = this.getCellMaxEvents();
1134
1138
  var cellMaxEventsCountValue = 30;
1135
1139
  this.events.forEach(function (item) {
1136
1140
  var resourceEventsList = initRenderData.filter(function (x) {
1137
- return x.slotId === _this7._getEventSlotId(item);
1141
+ return x.slotId === _this6._getEventSlotId(item);
1138
1142
  });
1139
1143
  if (resourceEventsList.length > 0) {
1140
1144
  var resourceEvents = resourceEventsList[0];
1141
- var span = _this7._getSpan(item.start, item.end, _this7.headers);
1145
+ var span = _this6._getSpan(item.start, item.end, _this6.headers);
1142
1146
  var eventStart = new Date(item.start);
1143
1147
  var eventEnd = new Date(item.end);
1144
1148
  var pos = -1;
@@ -1150,7 +1154,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
1150
1154
  if (header.count > resourceEvents.rowMaxCount) {
1151
1155
  resourceEvents.rowMaxCount = header.count;
1152
1156
  var rowsCount = cellMaxEventsCount <= cellMaxEventsCountValue && resourceEvents.rowMaxCount > cellMaxEventsCount ? cellMaxEventsCount : resourceEvents.rowMaxCount;
1153
- var newRowHeight = rowsCount * _this7.config.eventItemLineHeight + (_this7.config.creatable && _this7.config.checkConflict === false ? 20 : 2);
1157
+ var newRowHeight = rowsCount * _this6.config.eventItemLineHeight + (_this6.config.creatable && _this6.config.checkConflict === false ? 20 : 2);
1154
1158
  if (newRowHeight > resourceEvents.rowHeight) resourceEvents.rowHeight = newRowHeight;
1155
1159
  }
1156
1160
  if (pos === -1) {
@@ -1166,7 +1170,7 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
1166
1170
  if (previousHeaderEnd <= eventStart || previousHeaderStart >= eventEnd) render = true;
1167
1171
  }
1168
1172
  // console.log(`span: ${span}`)
1169
- header.events[pos] = _this7._createHeaderEvent(render, span, item);
1173
+ header.events[pos] = _this6._createHeaderEvent(render, span, item);
1170
1174
  }
1171
1175
  });
1172
1176
  }
@@ -1196,19 +1200,19 @@ var SchedulerData = exports["default"] = /*#__PURE__*/function () {
1196
1200
  headerItem.addMoreIndex = addMoreIndex;
1197
1201
  }
1198
1202
  }
1199
- if (_this7.behaviors.getSummaryFunc !== undefined) {
1203
+ if (_this6.behaviors.getSummaryFunc !== undefined) {
1200
1204
  var events = [];
1201
1205
  headerItem.events.forEach(function (e) {
1202
1206
  if (!!e && !!e.eventItem) events.push(e.eventItem);
1203
1207
  });
1204
- headerItem.summary = _this7.behaviors.getSummaryFunc(_this7, events, resourceEvents.slotId, resourceEvents.slotName, headerItem.start, headerItem.end);
1208
+ headerItem.summary = _this6.behaviors.getSummaryFunc(_this6, events, resourceEvents.slotId, resourceEvents.slotName, headerItem.start, headerItem.end);
1205
1209
  if (!!headerItem.summary && headerItem.summary.text !== undefined) hasSummary = true;
1206
1210
  }
1207
1211
  });
1208
1212
  resourceEvents.hasSummary = hasSummary;
1209
1213
  if (hasSummary) {
1210
1214
  var rowsCount = cellMaxEventsCount <= cellMaxEventsCountValue && resourceEvents.rowMaxCount > cellMaxEventsCount ? cellMaxEventsCount : resourceEvents.rowMaxCount;
1211
- var newRowHeight = (rowsCount + 1) * _this7.config.eventItemLineHeight + (_this7.config.creatable && _this7.config.checkConflict === false ? 20 : 2);
1215
+ var newRowHeight = (rowsCount + 1) * _this6.config.eventItemLineHeight + (_this6.config.creatable && _this6.config.checkConflict === false ? 20 : 2);
1212
1216
  if (newRowHeight > resourceEvents.rowHeight) resourceEvents.rowHeight = newRowHeight;
1213
1217
  }
1214
1218
  });
@@ -102,13 +102,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
102
102
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
103
103
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
104
104
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
105
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
106
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
107
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
105
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
108
106
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
109
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
110
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
107
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
111
108
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
109
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
110
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
111
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
112
112
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
113
113
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
114
114
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // Col, Row and Icon do not have their own less files for styling. They use
@@ -130,11 +130,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
130
130
  // antd styles.
131
131
  var Scheduler = exports.Scheduler = /*#__PURE__*/function (_Component) {
132
132
  _inherits(Scheduler, _Component);
133
- var _super = _createSuper(Scheduler);
134
133
  function Scheduler(props) {
135
134
  var _this;
136
135
  _classCallCheck(this, Scheduler);
137
- _this = _super.call(this, props);
136
+ _this = _callSuper(this, Scheduler, [props]);
138
137
  _defineProperty(_assertThisInitialized(_this), "onWindowResize", function (e) {
139
138
  var schedulerData = _this.props.schedulerData;
140
139
  schedulerData._setDocumentWidth(document.documentElement.clientWidth);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-big-schedule",
3
- "version": "4.3.3",
3
+ "version": "4.4.0",
4
4
  "description": "React Big Schedule is a powerful and intuitive scheduler and resource planning solution built with React. Seamlessly integrate this modern browser-compatible component into your applications to effectively manage time, appointments, and resources. With drag-and-drop functionality, interactive UI, and granular views, react-big-schedule empowers users to effortlessly schedule and allocate resources with precision. Enhance productivity and streamline your workflow with this React-based solution, designed to optimize time management and simplify calendar-based operations. Perfect for applications requiring advanced scheduling capabilities, react-big-schedule offers a seamless and intuitive experience for managing appointments, resource allocation, and time slots. Unlock the potential of your React projects with react-big-schedule and revolutionize the way you handle scheduling and resource planning. It is the updated version of react-big-scheduler",
5
5
  "keywords": [
6
6
  "react-big-schedule",
@@ -59,8 +59,8 @@
59
59
  "fix": "eslint ./"
60
60
  },
61
61
  "dependencies": {
62
- "@ant-design/icons": "^5.2.6",
63
- "antd": "^5.12.2",
62
+ "@ant-design/icons": "^5.3.0",
63
+ "antd": "^5.14.1",
64
64
  "dayjs": "^1.11.10",
65
65
  "prop-types": "^15.8.1",
66
66
  "react": "^18.2.0",
@@ -70,14 +70,14 @@
70
70
  "rrule": "^2.8.1"
71
71
  },
72
72
  "devDependencies": {
73
- "@babel/cli": "^7.23.4",
74
- "@babel/core": "^7.23.6",
75
- "@babel/eslint-parser": "^7.23.3",
76
- "@babel/preset-env": "^7.23.6",
73
+ "@babel/cli": "^7.23.9",
74
+ "@babel/core": "^7.23.9",
75
+ "@babel/eslint-parser": "^7.23.10",
76
+ "@babel/preset-env": "^7.23.9",
77
77
  "@babel/preset-react": "^7.23.3",
78
78
  "babel-loader": "^9.1.3",
79
- "copy-webpack-plugin": "^11.0.0",
80
- "css-loader": "^6.8.1",
79
+ "copy-webpack-plugin": "^12.0.2",
80
+ "css-loader": "^6.10.0",
81
81
  "eslint": "^8.56.0",
82
82
  "eslint-config-airbnb": "^19.0.4",
83
83
  "eslint-plugin-import": "^2.29.1",
@@ -86,10 +86,10 @@
86
86
  "eslint-plugin-react-hooks": "^4.6.0",
87
87
  "eslint-webpack-plugin": "^4.0.1",
88
88
  "fs-extra": "^11.2.0",
89
- "html-webpack-plugin": "^5.5.4",
90
- "style-loader": "^3.3.3",
91
- "webpack": "^5.89.0",
89
+ "html-webpack-plugin": "^5.6.0",
90
+ "style-loader": "^3.3.4",
91
+ "webpack": "^5.90.3",
92
92
  "webpack-cli": "^5.1.4",
93
- "webpack-dev-server": "^4.15.1"
93
+ "webpack-dev-server": "^5.0.2"
94
94
  }
95
95
  }