react-big-schedule 4.2.5 → 4.3.1
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/README.md +91 -121
- package/dist/components/AddMore.js +5 -5
- package/dist/components/AddMorePopover.js +7 -7
- package/dist/components/AgendaEventItem.js +21 -13
- package/dist/components/AgendaResourceEvents.js +26 -47
- package/dist/components/AgendaView.js +1 -2
- package/dist/components/BodyView.js +4 -5
- package/dist/components/DnDContext.js +47 -32
- package/dist/components/DnDSource.js +30 -36
- package/dist/components/EventItem.js +375 -368
- package/dist/components/EventItemPopover.js +13 -24
- package/dist/components/HeaderView.js +94 -116
- package/dist/components/ResourceEvents.js +66 -54
- package/dist/components/ResourceView.js +22 -29
- package/dist/components/SchedulerData.js +315 -233
- package/dist/components/SchedulerHeader.js +15 -17
- package/dist/components/SelectedArea.js +3 -4
- package/dist/components/Summary.js +7 -8
- package/dist/components/WrapperFun.js +6 -5
- package/dist/components/index.js +42 -39
- package/dist/config/default.js +7 -13
- package/dist/config/scheduler.js +2 -3
- package/dist/css/style.css +6 -1
- package/dist/helper/behaviors.js +20 -28
- package/dist/helper/utility.js +1 -2
- package/dist/index.d.ts +378 -0
- package/dist/sample-data/sample1.js +1 -2
- package/package.json +20 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -10,19 +10,19 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
10
|
var _antd = require("antd");
|
|
11
11
|
var _icons = require("@ant-design/icons");
|
|
12
12
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
13
|
-
var
|
|
13
|
+
var _default2 = require("../config/default");
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
17
17
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
18
18
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
19
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
20
20
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
21
|
-
function _iterableToArrayLimit(
|
|
21
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
22
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
23
|
var RadioButton = _antd.Radio.Button;
|
|
24
24
|
var RadioGroup = _antd.Radio.Group;
|
|
25
|
-
|
|
25
|
+
function SchedulerHeader(_ref) {
|
|
26
26
|
var _schedulerData$getCal;
|
|
27
27
|
var onViewChange = _ref.onViewChange,
|
|
28
28
|
goNext = _ref.goNext,
|
|
@@ -53,19 +53,14 @@ var SchedulerHeader = function SchedulerHeader(_ref) {
|
|
|
53
53
|
var defaultValue = "".concat(viewType).concat(showAgenda ? 1 : 0).concat(isEventPerspective ? 1 : 0);
|
|
54
54
|
var handleEvents = function handleEvents(func, isViewSpinning) {
|
|
55
55
|
var funcArg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
56
|
-
var config = schedulerData.config;
|
|
57
56
|
if (isViewSpinning) {
|
|
58
57
|
if (config.viewChangeSpinEnabled) setViewSpinning(true);
|
|
59
|
-
} else
|
|
60
|
-
if (config.dateChangeSpinEnabled) setDateSpinning(true);
|
|
61
|
-
}
|
|
58
|
+
} else if (config.dateChangeSpinEnabled) setDateSpinning(true);
|
|
62
59
|
var coreFunc = function coreFunc() {
|
|
63
60
|
if (funcArg !== undefined) func(funcArg);else func();
|
|
64
61
|
if (isViewSpinning) {
|
|
65
62
|
if (config.viewChangeSpinEnabled) setViewSpinning(false);
|
|
66
|
-
} else
|
|
67
|
-
if (config.dateChangeSpinEnabled) setDateSpinning(false);
|
|
68
|
-
}
|
|
63
|
+
} else if (config.dateChangeSpinEnabled) setDateSpinning(false);
|
|
69
64
|
};
|
|
70
65
|
if (config.viewChangeSpinEnabled || config.dateChangeSpinEnabled) {
|
|
71
66
|
setTimeout(coreFunc, config.schedulerHeaderEventsFuncsTimeoutMs); // 100ms
|
|
@@ -81,7 +76,7 @@ var SchedulerHeader = function SchedulerHeader(_ref) {
|
|
|
81
76
|
fullscreen: false,
|
|
82
77
|
onSelect: function onSelect(date) {
|
|
83
78
|
setVisible(false);
|
|
84
|
-
handleEvents(onSelectDate, false, date.format(
|
|
79
|
+
handleEvents(onSelectDate, false, date.format(_default2.DATE_FORMAT));
|
|
85
80
|
}
|
|
86
81
|
}));
|
|
87
82
|
var radioButtonList = config.views.map(function (item) {
|
|
@@ -148,7 +143,7 @@ var SchedulerHeader = function SchedulerHeader(_ref) {
|
|
|
148
143
|
return handleEvents(onViewChange, true, event);
|
|
149
144
|
}
|
|
150
145
|
}, radioButtonList))), rightCustomHeader);
|
|
151
|
-
}
|
|
146
|
+
}
|
|
152
147
|
SchedulerHeader.propTypes = {
|
|
153
148
|
onViewChange: _propTypes["default"].func.isRequired,
|
|
154
149
|
goNext: _propTypes["default"].func.isRequired,
|
|
@@ -158,5 +153,8 @@ SchedulerHeader.propTypes = {
|
|
|
158
153
|
leftCustomHeader: _propTypes["default"].object,
|
|
159
154
|
rightCustomHeader: _propTypes["default"].object
|
|
160
155
|
};
|
|
161
|
-
|
|
162
|
-
|
|
156
|
+
SchedulerHeader.defaultProps = {
|
|
157
|
+
leftCustomHeader: null,
|
|
158
|
+
rightCustomHeader: null
|
|
159
|
+
};
|
|
160
|
+
var _default = exports["default"] = SchedulerHeader;
|
|
@@ -7,7 +7,7 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
-
|
|
10
|
+
function SelectedArea(_ref) {
|
|
11
11
|
var left = _ref.left,
|
|
12
12
|
width = _ref.width,
|
|
13
13
|
schedulerData = _ref.schedulerData;
|
|
@@ -23,11 +23,10 @@ var SelectedArea = function SelectedArea(_ref) {
|
|
|
23
23
|
className: "selected-area",
|
|
24
24
|
style: selectedAreaStyle
|
|
25
25
|
});
|
|
26
|
-
}
|
|
26
|
+
}
|
|
27
27
|
SelectedArea.propTypes = {
|
|
28
28
|
schedulerData: _propTypes["default"].object.isRequired,
|
|
29
29
|
left: _propTypes["default"].number.isRequired,
|
|
30
30
|
width: _propTypes["default"].number.isRequired
|
|
31
31
|
};
|
|
32
|
-
var _default = SelectedArea;
|
|
33
|
-
exports["default"] = _default;
|
|
32
|
+
var _default = exports["default"] = SelectedArea;
|
|
@@ -8,13 +8,13 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _default2 = require("../config/default");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
function _typeof(
|
|
12
|
-
function ownKeys(
|
|
13
|
-
function _objectSpread(
|
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
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; }
|
|
15
15
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
16
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
17
|
-
|
|
17
|
+
function Summary(_ref) {
|
|
18
18
|
var schedulerData = _ref.schedulerData,
|
|
19
19
|
summary = _ref.summary,
|
|
20
20
|
left = _ref.left,
|
|
@@ -37,7 +37,7 @@ var Summary = function Summary(_ref) {
|
|
|
37
37
|
}, summary.fontSize !== undefined ? {
|
|
38
38
|
fontSize: summary.fontSize
|
|
39
39
|
} : {});
|
|
40
|
-
return /*#__PURE__*/_react["default"].createElement("
|
|
40
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
41
41
|
className: "timeline-event header2-text",
|
|
42
42
|
style: {
|
|
43
43
|
left: left,
|
|
@@ -48,7 +48,7 @@ var Summary = function Summary(_ref) {
|
|
|
48
48
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
49
49
|
style: style
|
|
50
50
|
}, summary.text));
|
|
51
|
-
}
|
|
51
|
+
}
|
|
52
52
|
Summary.propTypes = {
|
|
53
53
|
schedulerData: _propTypes["default"].object.isRequired,
|
|
54
54
|
summary: _propTypes["default"].object.isRequired,
|
|
@@ -56,5 +56,4 @@ Summary.propTypes = {
|
|
|
56
56
|
width: _propTypes["default"].number.isRequired,
|
|
57
57
|
top: _propTypes["default"].number.isRequired
|
|
58
58
|
};
|
|
59
|
-
var _default = Summary;
|
|
60
|
-
exports["default"] = _default;
|
|
59
|
+
var _default = exports["default"] = Summary;
|
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] =
|
|
6
|
+
exports["default"] = WrapperFun;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactDnd = require("react-dnd");
|
|
9
9
|
var _reactDndHtml5Backend = require("react-dnd-html5-backend");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/* eslint-disable react/jsx-props-no-spreading */
|
|
12
|
+
|
|
13
|
+
function WrapperFun(Component) {
|
|
14
|
+
return function WrappedComponent(props) {
|
|
13
15
|
return /*#__PURE__*/_react["default"].createElement(_reactDnd.DndProvider, {
|
|
14
16
|
backend: _reactDndHtml5Backend.HTML5Backend
|
|
15
17
|
}, /*#__PURE__*/_react["default"].createElement(Component, props));
|
|
16
18
|
};
|
|
17
|
-
}
|
|
18
|
-
exports["default"] = _default;
|
|
19
|
+
}
|
package/dist/components/index.js
CHANGED
|
@@ -87,9 +87,9 @@ var _SchedulerHeader = _interopRequireDefault(require("./SchedulerHeader"));
|
|
|
87
87
|
var _default = require("../config/default");
|
|
88
88
|
var _WrapperFun = _interopRequireDefault(require("./WrapperFun"));
|
|
89
89
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
90
|
-
function _getRequireWildcardCache(
|
|
91
|
-
function _interopRequireWildcard(
|
|
92
|
-
function _typeof(
|
|
90
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
91
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
92
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
93
93
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
94
94
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
95
95
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -97,8 +97,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
97
97
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
98
98
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
99
99
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
100
|
-
function ownKeys(
|
|
101
|
-
function _objectSpread(
|
|
100
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
101
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
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; }
|
|
@@ -128,7 +128,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
128
128
|
// The next components have their own specific stylesheets which we import
|
|
129
129
|
// separately here to avoid importing from files which have required the global
|
|
130
130
|
// antd styles.
|
|
131
|
-
var Scheduler = /*#__PURE__*/function (_Component) {
|
|
131
|
+
var Scheduler = exports.Scheduler = /*#__PURE__*/function (_Component) {
|
|
132
132
|
_inherits(Scheduler, _Component);
|
|
133
133
|
var _super = _createSuper(Scheduler);
|
|
134
134
|
function Scheduler(props) {
|
|
@@ -145,39 +145,39 @@ var Scheduler = /*#__PURE__*/function (_Component) {
|
|
|
145
145
|
});
|
|
146
146
|
_defineProperty(_assertThisInitialized(_this), "resolveScrollbarSize", function () {
|
|
147
147
|
var schedulerData = _this.props.schedulerData;
|
|
148
|
-
var contentScrollbarHeight = 17
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (
|
|
148
|
+
var contentScrollbarHeight = 17;
|
|
149
|
+
var contentScrollbarWidth = 17;
|
|
150
|
+
var resourceScrollbarHeight = 17;
|
|
151
|
+
var resourceScrollbarWidth = 17;
|
|
152
|
+
if (_this.schedulerContent) {
|
|
153
153
|
contentScrollbarHeight = _this.schedulerContent.offsetHeight - _this.schedulerContent.clientHeight;
|
|
154
154
|
contentScrollbarWidth = _this.schedulerContent.offsetWidth - _this.schedulerContent.clientWidth;
|
|
155
155
|
}
|
|
156
|
-
if (
|
|
156
|
+
if (_this.schedulerResource) {
|
|
157
157
|
resourceScrollbarHeight = _this.schedulerResource.offsetHeight - _this.schedulerResource.clientHeight;
|
|
158
158
|
resourceScrollbarWidth = _this.schedulerResource.offsetWidth - _this.schedulerResource.clientWidth;
|
|
159
159
|
}
|
|
160
160
|
var tmpState = {};
|
|
161
161
|
var needSet = false;
|
|
162
|
-
if (contentScrollbarHeight
|
|
162
|
+
if (contentScrollbarHeight !== _this.state.contentScrollbarHeight) {
|
|
163
163
|
tmpState = _objectSpread(_objectSpread({}, tmpState), {}, {
|
|
164
164
|
contentScrollbarHeight: contentScrollbarHeight
|
|
165
165
|
});
|
|
166
166
|
needSet = true;
|
|
167
167
|
}
|
|
168
|
-
if (contentScrollbarWidth
|
|
168
|
+
if (contentScrollbarWidth !== _this.state.contentScrollbarWidth) {
|
|
169
169
|
tmpState = _objectSpread(_objectSpread({}, tmpState), {}, {
|
|
170
170
|
contentScrollbarWidth: contentScrollbarWidth
|
|
171
171
|
});
|
|
172
172
|
needSet = true;
|
|
173
173
|
}
|
|
174
|
-
if (resourceScrollbarHeight
|
|
174
|
+
if (resourceScrollbarHeight !== _this.state.resourceScrollbarHeight) {
|
|
175
175
|
tmpState = _objectSpread(_objectSpread({}, tmpState), {}, {
|
|
176
176
|
resourceScrollbarHeight: resourceScrollbarHeight
|
|
177
177
|
});
|
|
178
178
|
needSet = true;
|
|
179
179
|
}
|
|
180
|
-
if (resourceScrollbarWidth
|
|
180
|
+
if (resourceScrollbarWidth !== _this.state.resourceScrollbarWidth) {
|
|
181
181
|
tmpState = _objectSpread(_objectSpread({}, tmpState), {}, {
|
|
182
182
|
resourceScrollbarWidth: resourceScrollbarWidth
|
|
183
183
|
});
|
|
@@ -195,7 +195,9 @@ var Scheduler = /*#__PURE__*/function (_Component) {
|
|
|
195
195
|
_this.currentArea = -1;
|
|
196
196
|
});
|
|
197
197
|
_defineProperty(_assertThisInitialized(_this), "onSchedulerHeadScroll", function (proxy, event) {
|
|
198
|
-
if ((_this.currentArea === 2 || _this.currentArea === -1) && _this.schedulerContent.scrollLeft
|
|
198
|
+
if ((_this.currentArea === 2 || _this.currentArea === -1) && _this.schedulerContent.scrollLeft !== _this.schedulerHead.scrollLeft) {
|
|
199
|
+
_this.schedulerContent.scrollLeft = _this.schedulerHead.scrollLeft;
|
|
200
|
+
}
|
|
199
201
|
});
|
|
200
202
|
_defineProperty(_assertThisInitialized(_this), "schedulerResourceRef", function (element) {
|
|
201
203
|
_this.schedulerResource = element;
|
|
@@ -207,8 +209,10 @@ var Scheduler = /*#__PURE__*/function (_Component) {
|
|
|
207
209
|
_this.currentArea = -1;
|
|
208
210
|
});
|
|
209
211
|
_defineProperty(_assertThisInitialized(_this), "onSchedulerResourceScroll", function (proxy, event) {
|
|
210
|
-
if (
|
|
211
|
-
if ((_this.currentArea === 1 || _this.currentArea === -1) && _this.schedulerContent.scrollTop
|
|
212
|
+
if (_this.schedulerResource) {
|
|
213
|
+
if ((_this.currentArea === 1 || _this.currentArea === -1) && _this.schedulerContent.scrollTop !== _this.schedulerResource.scrollTop) {
|
|
214
|
+
_this.schedulerContent.scrollTop = _this.schedulerResource.scrollTop;
|
|
215
|
+
}
|
|
212
216
|
}
|
|
213
217
|
});
|
|
214
218
|
_defineProperty(_assertThisInitialized(_this), "schedulerContentRef", function (element) {
|
|
@@ -224,10 +228,10 @@ var Scheduler = /*#__PURE__*/function (_Component) {
|
|
|
224
228
|
_this.currentArea = -1;
|
|
225
229
|
});
|
|
226
230
|
_defineProperty(_assertThisInitialized(_this), "onSchedulerContentScroll", function (proxy, event) {
|
|
227
|
-
if (
|
|
231
|
+
if (_this.schedulerResource) {
|
|
228
232
|
if (_this.currentArea === 0 || _this.currentArea === -1) {
|
|
229
|
-
if (_this.schedulerHead.scrollLeft
|
|
230
|
-
if (_this.schedulerResource.scrollTop
|
|
233
|
+
if (_this.schedulerHead.scrollLeft !== _this.schedulerContent.scrollLeft) _this.schedulerHead.scrollLeft = _this.schedulerContent.scrollLeft;
|
|
234
|
+
if (_this.schedulerResource.scrollTop !== _this.schedulerContent.scrollTop) _this.schedulerResource.scrollTop = _this.schedulerContent.scrollTop;
|
|
231
235
|
}
|
|
232
236
|
}
|
|
233
237
|
var _this$props = _this.props,
|
|
@@ -237,17 +241,17 @@ var Scheduler = /*#__PURE__*/function (_Component) {
|
|
|
237
241
|
onScrollTop = _this$props.onScrollTop,
|
|
238
242
|
onScrollBottom = _this$props.onScrollBottom;
|
|
239
243
|
if (_this.schedulerContent.scrollLeft !== _this.scrollLeft) {
|
|
240
|
-
if (_this.schedulerContent.scrollLeft === 0 && onScrollLeft
|
|
244
|
+
if (_this.schedulerContent.scrollLeft === 0 && onScrollLeft !== undefined) {
|
|
241
245
|
onScrollLeft(schedulerData, _this.schedulerContent, _this.schedulerContent.scrollWidth - _this.schedulerContent.clientWidth);
|
|
242
246
|
}
|
|
243
|
-
if (Math.round(_this.schedulerContent.scrollLeft) === _this.schedulerContent.scrollWidth - _this.schedulerContent.clientWidth && onScrollRight
|
|
247
|
+
if (Math.round(_this.schedulerContent.scrollLeft) === _this.schedulerContent.scrollWidth - _this.schedulerContent.clientWidth && onScrollRight !== undefined) {
|
|
244
248
|
onScrollRight(schedulerData, _this.schedulerContent, _this.schedulerContent.scrollWidth - _this.schedulerContent.clientWidth);
|
|
245
249
|
}
|
|
246
250
|
} else if (_this.schedulerContent.scrollTop !== _this.scrollTop) {
|
|
247
|
-
if (_this.schedulerContent.scrollTop === 0 && onScrollTop
|
|
251
|
+
if (_this.schedulerContent.scrollTop === 0 && onScrollTop !== undefined) {
|
|
248
252
|
onScrollTop(schedulerData, _this.schedulerContent, _this.schedulerContent.scrollHeight - _this.schedulerContent.clientHeight);
|
|
249
253
|
}
|
|
250
|
-
if (Math.round(_this.schedulerContent.scrollTop) === _this.schedulerContent.scrollHeight - _this.schedulerContent.clientHeight && onScrollBottom
|
|
254
|
+
if (Math.round(_this.schedulerContent.scrollTop) === _this.schedulerContent.scrollHeight - _this.schedulerContent.clientHeight && onScrollBottom !== undefined) {
|
|
251
255
|
onScrollBottom(schedulerData, _this.schedulerContent, _this.schedulerContent.scrollHeight - _this.schedulerContent.clientHeight);
|
|
252
256
|
}
|
|
253
257
|
}
|
|
@@ -292,10 +296,10 @@ var Scheduler = /*#__PURE__*/function (_Component) {
|
|
|
292
296
|
dndSources = props.dndSources,
|
|
293
297
|
parentRef = props.parentRef;
|
|
294
298
|
var sources = [];
|
|
295
|
-
sources.push(new _DnDSource["default"](function (
|
|
296
|
-
return
|
|
299
|
+
sources.push(new _DnDSource["default"](function (dndProps) {
|
|
300
|
+
return dndProps.eventItem;
|
|
297
301
|
}, _EventItem["default"], _schedulerData.config.dragAndDropEnabled));
|
|
298
|
-
if (dndSources
|
|
302
|
+
if (dndSources !== undefined && dndSources.length > 0) {
|
|
299
303
|
sources = [].concat(_toConsumableArray(sources), _toConsumableArray(dndSources));
|
|
300
304
|
}
|
|
301
305
|
var dndContext = new _DnDContext["default"](sources, _ResourceEvents["default"]);
|
|
@@ -329,7 +333,7 @@ var Scheduler = /*#__PURE__*/function (_Component) {
|
|
|
329
333
|
if (schedulerData.config.responsiveByParent && !!parentRef.current) {
|
|
330
334
|
schedulerData._setDocumentWidth(parentRef.current.offsetWidth);
|
|
331
335
|
this.ulObserver = new ResizeObserver(function (entries, observer) {
|
|
332
|
-
if (
|
|
336
|
+
if (parentRef.current) {
|
|
333
337
|
var width = parentRef.current.offsetWidth;
|
|
334
338
|
var height = parentRef.current.offsetHeight;
|
|
335
339
|
schedulerData._setDocumentWidth(width);
|
|
@@ -352,9 +356,9 @@ var Scheduler = /*#__PURE__*/function (_Component) {
|
|
|
352
356
|
behaviors = schedulerData.behaviors;
|
|
353
357
|
if (schedulerData.getScrollToSpecialDayjs() && !!behaviors.getScrollSpecialDayjsFunc) {
|
|
354
358
|
if (!!this.schedulerContent && this.schedulerContent.scrollWidth > this.schedulerContent.clientWidth) {
|
|
355
|
-
var start = localeDayjs(new Date(schedulerData.startDate)).startOf('day')
|
|
356
|
-
|
|
357
|
-
|
|
359
|
+
var start = localeDayjs(new Date(schedulerData.startDate)).startOf('day');
|
|
360
|
+
var end = localeDayjs(new Date(schedulerData.endDate)).endOf('day');
|
|
361
|
+
var specialDayjs = behaviors.getScrollSpecialDayjsFunc(schedulerData, start, end);
|
|
358
362
|
if (specialDayjs >= start && specialDayjs <= end) {
|
|
359
363
|
var index = 0;
|
|
360
364
|
schedulerData.headers.forEach(function (item) {
|
|
@@ -399,11 +403,11 @@ var Scheduler = /*#__PURE__*/function (_Component) {
|
|
|
399
403
|
dndSource: eventDndSource
|
|
400
404
|
}));
|
|
401
405
|
});
|
|
402
|
-
var contentScrollbarHeight = this.state.contentScrollbarHeight
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
406
|
+
var contentScrollbarHeight = this.state.contentScrollbarHeight;
|
|
407
|
+
var contentScrollbarWidth = this.state.contentScrollbarWidth;
|
|
408
|
+
var resourceScrollbarHeight = this.state.resourceScrollbarHeight;
|
|
409
|
+
var resourceScrollbarWidth = this.state.resourceScrollbarWidth;
|
|
410
|
+
var contentHeight = config.schedulerContentHeight;
|
|
407
411
|
var resourcePaddingBottom = resourceScrollbarHeight === 0 ? contentScrollbarHeight : 0;
|
|
408
412
|
var contentPaddingBottom = contentScrollbarHeight === 0 ? resourceScrollbarHeight : 0;
|
|
409
413
|
var schedulerContentStyle = {
|
|
@@ -544,7 +548,6 @@ var Scheduler = /*#__PURE__*/function (_Component) {
|
|
|
544
548
|
}]);
|
|
545
549
|
return Scheduler;
|
|
546
550
|
}(_react.Component);
|
|
547
|
-
exports.Scheduler = Scheduler;
|
|
548
551
|
_defineProperty(Scheduler, "propTypes", {
|
|
549
552
|
parentRef: _propTypes["default"].object,
|
|
550
553
|
schedulerData: _propTypes["default"].object.isRequired,
|
package/dist/config/default.js
CHANGED
|
@@ -4,11 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ViewType = exports.SummaryPos = exports.DnDTypes = exports.DATE_FORMAT = exports.DATETIME_FORMAT = exports.CellUnit = void 0;
|
|
7
|
-
var DATE_FORMAT = 'YYYY-MM-DD';
|
|
8
|
-
exports.
|
|
9
|
-
var
|
|
10
|
-
exports.DATETIME_FORMAT = DATETIME_FORMAT;
|
|
11
|
-
var ViewType = {
|
|
7
|
+
var DATE_FORMAT = exports.DATE_FORMAT = 'YYYY-MM-DD';
|
|
8
|
+
var DATETIME_FORMAT = exports.DATETIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
|
9
|
+
var ViewType = exports.ViewType = {
|
|
12
10
|
Day: 0,
|
|
13
11
|
Week: 1,
|
|
14
12
|
Month: 2,
|
|
@@ -18,16 +16,14 @@ var ViewType = {
|
|
|
18
16
|
Custom1: 6,
|
|
19
17
|
Custom2: 7
|
|
20
18
|
};
|
|
21
|
-
exports.
|
|
22
|
-
var CellUnit = {
|
|
19
|
+
var CellUnit = exports.CellUnit = {
|
|
23
20
|
Day: 0,
|
|
24
21
|
Hour: 1,
|
|
25
22
|
Week: 2,
|
|
26
23
|
Month: 3,
|
|
27
24
|
Year: 4
|
|
28
25
|
};
|
|
29
|
-
exports.
|
|
30
|
-
var SummaryPos = {
|
|
26
|
+
var SummaryPos = exports.SummaryPos = {
|
|
31
27
|
Top: 0,
|
|
32
28
|
TopRight: 1,
|
|
33
29
|
TopLeft: 2,
|
|
@@ -35,8 +31,6 @@ var SummaryPos = {
|
|
|
35
31
|
BottomRight: 4,
|
|
36
32
|
BottomLeft: 5
|
|
37
33
|
};
|
|
38
|
-
exports.
|
|
39
|
-
var DnDTypes = {
|
|
34
|
+
var DnDTypes = exports.DnDTypes = {
|
|
40
35
|
EVENT: 'event'
|
|
41
|
-
};
|
|
42
|
-
exports.DnDTypes = DnDTypes;
|
|
36
|
+
};
|
package/dist/config/scheduler.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _default2 = require("./default");
|
|
8
|
-
var _default = {
|
|
8
|
+
var _default = exports["default"] = {
|
|
9
9
|
schedulerWidth: '100%',
|
|
10
10
|
besidesWidth: 20,
|
|
11
11
|
schedulerMaxHeight: 0,
|
|
@@ -105,5 +105,4 @@ var _default = {
|
|
|
105
105
|
showAgenda: false,
|
|
106
106
|
isEventPerspective: false
|
|
107
107
|
}]
|
|
108
|
-
};
|
|
109
|
-
exports["default"] = _default;
|
|
108
|
+
};
|
package/dist/css/style.css
CHANGED
|
@@ -143,7 +143,7 @@ table.scheduler-table tr:last-child td {
|
|
|
143
143
|
|
|
144
144
|
.day-event-container {
|
|
145
145
|
text-align: left;
|
|
146
|
-
padding: 5px 5px 0
|
|
146
|
+
padding: 5px 5px 0;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
.round-all {
|
|
@@ -250,3 +250,8 @@ table.scheduler-table tr:last-child td {
|
|
|
250
250
|
padding-left: 4px;
|
|
251
251
|
padding-right: 4px;
|
|
252
252
|
}
|
|
253
|
+
|
|
254
|
+
.txt-btn-dis {
|
|
255
|
+
border: none;
|
|
256
|
+
background-color: transparent;
|
|
257
|
+
}
|
package/dist/helper/behaviors.js
CHANGED
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.isNonWorkingTime = exports.getSummary = exports.getScrollSpecialDayjs = exports.getNonAgendaViewBodyCellBgColor = exports.getEventText = exports.getDateLabel = exports.getCustomDate = exports["default"] = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _default2 = require("../config/default");
|
|
8
8
|
// getSummary func example
|
|
9
9
|
// export const getSummary = (schedulerData, headerEvents, slotId, slotName, headerStart, headerEnd) => ({ text: 'Summary', color: 'red', fontSize: '1.2rem' });
|
|
10
|
-
var getSummary = function getSummary() {
|
|
10
|
+
var getSummary = exports.getSummary = function getSummary() {
|
|
11
11
|
return {
|
|
12
12
|
text: 'Summary',
|
|
13
13
|
color: 'red',
|
|
@@ -16,28 +16,27 @@ var getSummary = function getSummary() {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
// getCustomDate example
|
|
19
|
-
exports.
|
|
20
|
-
var getCustomDate = function getCustomDate(schedulerData, num) {
|
|
19
|
+
var getCustomDate = exports.getCustomDate = function getCustomDate(schedulerData, num) {
|
|
21
20
|
var date = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : schedulerData.startDate;
|
|
22
21
|
var viewType = schedulerData.viewType,
|
|
23
22
|
localeDayjs = schedulerData.localeDayjs;
|
|
24
23
|
var startDate;
|
|
25
24
|
var endDate;
|
|
26
25
|
var cellUnit;
|
|
27
|
-
if (viewType ===
|
|
26
|
+
if (viewType === _default2.ViewType.Custom1) {
|
|
28
27
|
var monday = localeDayjs(new Date(date)).startOf('week');
|
|
29
28
|
startDate = num === 0 ? monday : localeDayjs(new Date(monday)).add(2 * num, 'weeks');
|
|
30
29
|
endDate = localeDayjs(new Date(startDate)).add(1, 'weeks').endOf('week');
|
|
31
|
-
cellUnit =
|
|
32
|
-
} else if (viewType ===
|
|
30
|
+
cellUnit = _default2.CellUnit.Day;
|
|
31
|
+
} else if (viewType === _default2.ViewType.Custom2) {
|
|
33
32
|
var firstDayOfMonth = localeDayjs(new Date(date)).startOf('month');
|
|
34
33
|
startDate = num === 0 ? firstDayOfMonth : localeDayjs(new Date(firstDayOfMonth)).add(2 * num, 'months');
|
|
35
34
|
endDate = localeDayjs(new Date(startDate)).add(1, 'months').endOf('month');
|
|
36
|
-
cellUnit =
|
|
35
|
+
cellUnit = _default2.CellUnit.Day;
|
|
37
36
|
} else {
|
|
38
37
|
startDate = num === 0 ? date : localeDayjs(new Date(date)).add(2 * num, 'days');
|
|
39
38
|
endDate = localeDayjs(new Date(startDate)).add(1, 'days');
|
|
40
|
-
cellUnit =
|
|
39
|
+
cellUnit = _default2.CellUnit.Hour;
|
|
41
40
|
}
|
|
42
41
|
return {
|
|
43
42
|
startDate: startDate,
|
|
@@ -47,58 +46,52 @@ var getCustomDate = function getCustomDate(schedulerData, num) {
|
|
|
47
46
|
};
|
|
48
47
|
|
|
49
48
|
// getNonAgendaViewBodyCellBgColor example
|
|
50
|
-
exports.
|
|
51
|
-
var getNonAgendaViewBodyCellBgColor = function getNonAgendaViewBodyCellBgColor(schedulerData, slotId, header) {
|
|
49
|
+
var getNonAgendaViewBodyCellBgColor = exports.getNonAgendaViewBodyCellBgColor = function getNonAgendaViewBodyCellBgColor(schedulerData, slotId, header) {
|
|
52
50
|
return header.nonWorkingTime ? undefined : '#87e8de';
|
|
53
51
|
};
|
|
54
52
|
|
|
55
53
|
// getDateLabel func example
|
|
56
|
-
exports.
|
|
57
|
-
var getDateLabel = function getDateLabel(schedulerData, viewType, startDate, endDate) {
|
|
54
|
+
var getDateLabel = exports.getDateLabel = function getDateLabel(schedulerData, viewType, startDate, endDate) {
|
|
58
55
|
var localeDayjs = schedulerData.localeDayjs;
|
|
59
56
|
var start = localeDayjs(new Date(startDate));
|
|
60
57
|
var end = localeDayjs(endDate);
|
|
61
58
|
var dateLabel = '';
|
|
62
|
-
if (viewType ===
|
|
59
|
+
if (viewType === _default2.ViewType.Week || start !== end && (viewType === _default2.ViewType.Custom || viewType === _default2.ViewType.Custom1 || viewType === _default2.ViewType.Custom2)) {
|
|
63
60
|
dateLabel = "".concat(start.format('MMM D'), "-").concat(end.format('D, YYYY'));
|
|
64
61
|
if (start.month() !== end.month()) dateLabel = "".concat(start.format('MMM D'), "-").concat(end.format('MMM D, YYYY'));
|
|
65
62
|
if (start.year() !== end.year()) dateLabel = "".concat(start.format('MMM D, YYYY'), "-").concat(end.format('MMM D, YYYY'));
|
|
66
|
-
} else if (viewType ===
|
|
63
|
+
} else if (viewType === _default2.ViewType.Month) {
|
|
67
64
|
dateLabel = start.format('MMMM YYYY');
|
|
68
|
-
} else if (viewType ===
|
|
65
|
+
} else if (viewType === _default2.ViewType.Quarter) {
|
|
69
66
|
dateLabel = "".concat(start.format('MMM D'), "-").concat(end.format('MMM D, YYYY'));
|
|
70
|
-
} else if (viewType ===
|
|
67
|
+
} else if (viewType === _default2.ViewType.Year) {
|
|
71
68
|
dateLabel = start.format('YYYY');
|
|
72
69
|
} else {
|
|
73
70
|
dateLabel = start.format('MMM D, YYYY');
|
|
74
71
|
}
|
|
75
72
|
return dateLabel;
|
|
76
73
|
};
|
|
77
|
-
exports.
|
|
78
|
-
var getEventText = function getEventText(schedulerData, event) {
|
|
74
|
+
var getEventText = exports.getEventText = function getEventText(schedulerData, event) {
|
|
79
75
|
var _schedulerData$resour;
|
|
80
76
|
return schedulerData.isEventPerspective ? ((_schedulerData$resour = schedulerData.resources.find(function (item) {
|
|
81
77
|
return item.id === event.resourceId;
|
|
82
78
|
})) === null || _schedulerData$resour === void 0 ? void 0 : _schedulerData$resour.name) || event.title : event.title;
|
|
83
79
|
};
|
|
84
|
-
exports.
|
|
85
|
-
var getScrollSpecialDayjs = function getScrollSpecialDayjs(schedulerData) {
|
|
80
|
+
var getScrollSpecialDayjs = exports.getScrollSpecialDayjs = function getScrollSpecialDayjs(schedulerData) {
|
|
86
81
|
var localeDayjs = schedulerData.localeDayjs;
|
|
87
82
|
return localeDayjs(new Date());
|
|
88
83
|
};
|
|
89
|
-
exports.
|
|
90
|
-
var isNonWorkingTime = function isNonWorkingTime(schedulerData, time) {
|
|
84
|
+
var isNonWorkingTime = exports.isNonWorkingTime = function isNonWorkingTime(schedulerData, time) {
|
|
91
85
|
var localeDayjs = schedulerData.localeDayjs,
|
|
92
86
|
cellUnit = schedulerData.cellUnit;
|
|
93
|
-
if (cellUnit ===
|
|
87
|
+
if (cellUnit === _default2.CellUnit.Hour) {
|
|
94
88
|
var hour = localeDayjs(new Date(time)).hour();
|
|
95
89
|
return hour < 9 || hour > 18;
|
|
96
90
|
}
|
|
97
91
|
var dayOfWeek = localeDayjs(new Date(time)).weekday();
|
|
98
92
|
return dayOfWeek === 0 || dayOfWeek === 6;
|
|
99
93
|
};
|
|
100
|
-
exports
|
|
101
|
-
var _default = {
|
|
94
|
+
var _default = exports["default"] = {
|
|
102
95
|
getSummaryFunc: undefined,
|
|
103
96
|
getCustomDateFunc: undefined,
|
|
104
97
|
getNonAgendaViewBodyCellBgColorFunc: undefined,
|
|
@@ -106,5 +99,4 @@ var _default = {
|
|
|
106
99
|
getDateLabelFunc: getDateLabel,
|
|
107
100
|
getEventTextFunc: getEventText,
|
|
108
101
|
isNonWorkingTimeFunc: isNonWorkingTime
|
|
109
|
-
};
|
|
110
|
-
exports["default"] = _default;
|
|
102
|
+
};
|
package/dist/helper/utility.js
CHANGED