big-scheduler
Version:
Big scheduler 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-a
600 lines (599 loc) • 32.3 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "AddMorePopover", {
enumerable: true,
get: function get() {
return _AddMorePopover["default"];
}
});
Object.defineProperty(exports, "CellUnit", {
enumerable: true,
get: function get() {
return _default.CellUnit;
}
});
Object.defineProperty(exports, "DATETIME_FORMAT", {
enumerable: true,
get: function get() {
return _default.DATETIME_FORMAT;
}
});
Object.defineProperty(exports, "DATE_FORMAT", {
enumerable: true,
get: function get() {
return _default.DATE_FORMAT;
}
});
Object.defineProperty(exports, "DemoData", {
enumerable: true,
get: function get() {
return _sample["default"];
}
});
Object.defineProperty(exports, "DnDContext", {
enumerable: true,
get: function get() {
return _DnDContext["default"];
}
});
Object.defineProperty(exports, "DnDSource", {
enumerable: true,
get: function get() {
return _DnDSource["default"];
}
});
exports.Scheduler = void 0;
Object.defineProperty(exports, "SchedulerData", {
enumerable: true,
get: function get() {
return _SchedulerData["default"];
}
});
Object.defineProperty(exports, "SummaryPos", {
enumerable: true,
get: function get() {
return _default.SummaryPos;
}
});
Object.defineProperty(exports, "ViewType", {
enumerable: true,
get: function get() {
return _default.ViewType;
}
});
Object.defineProperty(exports, "wrapperFun", {
enumerable: true,
get: function get() {
return _WrapperFun["default"];
}
});
var _react = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _EventItem = _interopRequireDefault(require("./EventItem"));
var _EventItemFuctional = _interopRequireDefault(require("./EventItemFuctional"));
var _DnDSource = _interopRequireDefault(require("./DnDSource"));
var _DnDContext = _interopRequireDefault(require("./DnDContext"));
var _ResourceView = _interopRequireDefault(require("./ResourceView"));
var _HeaderView = _interopRequireDefault(require("./HeaderView"));
var _BodyView = _interopRequireDefault(require("./BodyView"));
var _ResourceEvents = _interopRequireDefault(require("./ResourceEvents"));
var _AgendaView = _interopRequireDefault(require("./AgendaView"));
var _AddMorePopover = _interopRequireDefault(require("./AddMorePopover"));
var _SchedulerData = _interopRequireDefault(require("./SchedulerData"));
var _sample = _interopRequireDefault(require("../sample-data/sample1"));
var _SchedulerHeader = _interopRequireDefault(require("./SchedulerHeader"));
var _default = require("../config/default");
var _WrapperFun = _interopRequireDefault(require("./WrapperFun"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
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); }
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; }
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); }
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); }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
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."); }
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); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
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; }
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; }
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
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); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
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); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
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; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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
// rules declared in antd's global css. If these styles are imported directly
// from within antd, they'll include, for instance, reset rules. These will
// affect everything on the page and in essence would leak antd's global styles
// into all projects using this library. Instead of doing that, we are using
// a hack which allows us to wrap all antd styles to target specific root. In
// this case the root id will be "RBS-Scheduler-root". This way the reset styles
// won't be applied to elements declared outside of <Scheduler /> component.
//
// For development
// This fix is implemented with webpack's NormalModuleReplacementPlugin in
// webpack/webpack-dev.config.js.
//
//
// The next components have their own specific stylesheets which we import
// separately here to avoid importing from files which have required the global
// antd styles.
var Scheduler = exports.Scheduler = /*#__PURE__*/function (_Component) {
function Scheduler(props) {
var _this;
_classCallCheck(this, Scheduler);
_this = _callSuper(this, Scheduler, [props]);
_defineProperty(_this, "onWindowResize", function (e) {
var schedulerData = _this.props.schedulerData;
schedulerData._setDocumentWidth(document.documentElement.clientWidth);
_this.setState({
documentWidth: document.documentElement.clientWidth,
documentHeight: document.documentElement.clientHeight
});
});
_defineProperty(_this, "resolveScrollbarSize", function () {
var schedulerData = _this.props.schedulerData;
var contentScrollbarHeight = 17;
var contentScrollbarWidth = 17;
var resourceScrollbarHeight = 17;
var resourceScrollbarWidth = 17;
if (_this.schedulerContent) {
contentScrollbarHeight = _this.schedulerContent.offsetHeight - _this.schedulerContent.clientHeight;
contentScrollbarWidth = _this.schedulerContent.offsetWidth - _this.schedulerContent.clientWidth;
}
if (_this.schedulerResource) {
resourceScrollbarHeight = _this.schedulerResource.offsetHeight - _this.schedulerResource.clientHeight;
resourceScrollbarWidth = _this.schedulerResource.offsetWidth - _this.schedulerResource.clientWidth;
}
var tmpState = {};
var needSet = false;
if (contentScrollbarHeight !== _this.state.contentScrollbarHeight) {
tmpState = _objectSpread(_objectSpread({}, tmpState), {}, {
contentScrollbarHeight: contentScrollbarHeight
});
needSet = true;
}
if (contentScrollbarWidth !== _this.state.contentScrollbarWidth) {
tmpState = _objectSpread(_objectSpread({}, tmpState), {}, {
contentScrollbarWidth: contentScrollbarWidth
});
needSet = true;
}
if (resourceScrollbarHeight !== _this.state.resourceScrollbarHeight) {
tmpState = _objectSpread(_objectSpread({}, tmpState), {}, {
resourceScrollbarHeight: resourceScrollbarHeight
});
needSet = true;
}
if (resourceScrollbarWidth !== _this.state.resourceScrollbarWidth) {
tmpState = _objectSpread(_objectSpread({}, tmpState), {}, {
resourceScrollbarWidth: resourceScrollbarWidth
});
needSet = true;
}
if (needSet) _this.setState(tmpState);
});
_defineProperty(_this, "schedulerHeadRef", function (element) {
_this.schedulerHead = element;
});
_defineProperty(_this, "onSchedulerHeadMouseOver", function () {
_this.currentArea = 2;
});
_defineProperty(_this, "onSchedulerHeadMouseOut", function () {
_this.currentArea = -1;
});
_defineProperty(_this, "onSchedulerHeadScroll", function (proxy, event) {
if ((_this.currentArea === 2 || _this.currentArea === -1) && _this.schedulerContent.scrollLeft !== _this.schedulerHead.scrollLeft) {
_this.schedulerContent.scrollLeft = _this.schedulerHead.scrollLeft;
}
});
_defineProperty(_this, "schedulerResourceRef", function (element) {
_this.schedulerResource = element;
});
_defineProperty(_this, "onSchedulerResourceMouseOver", function () {
_this.currentArea = 1;
});
_defineProperty(_this, "onSchedulerResourceMouseOut", function () {
_this.currentArea = -1;
});
_defineProperty(_this, "onSchedulerResourceScroll", function (proxy, event) {
if (_this.schedulerResource) {
if ((_this.currentArea === 1 || _this.currentArea === -1) && _this.schedulerContent.scrollTop !== _this.schedulerResource.scrollTop) {
_this.schedulerContent.scrollTop = _this.schedulerResource.scrollTop;
}
}
});
_defineProperty(_this, "schedulerContentRef", function (element) {
_this.schedulerContent = element;
});
_defineProperty(_this, "schedulerContentBgTableRef", function (element) {
_this.schedulerContentBgTable = element;
});
_defineProperty(_this, "onSchedulerContentMouseOver", function () {
_this.currentArea = 0;
});
_defineProperty(_this, "onSchedulerContentMouseOut", function () {
_this.currentArea = -1;
});
_defineProperty(_this, "onSchedulerContentScroll", function (proxy, event) {
if (_this.schedulerResource) {
if (_this.currentArea === 0 || _this.currentArea === -1) {
if (_this.schedulerHead.scrollLeft !== _this.schedulerContent.scrollLeft) _this.schedulerHead.scrollLeft = _this.schedulerContent.scrollLeft;
if (_this.schedulerResource.scrollTop !== _this.schedulerContent.scrollTop) _this.schedulerResource.scrollTop = _this.schedulerContent.scrollTop;
}
}
var _this$props = _this.props,
schedulerData = _this$props.schedulerData,
onScrollLeft = _this$props.onScrollLeft,
onScrollRight = _this$props.onScrollRight,
onScrollTop = _this$props.onScrollTop,
onScrollBottom = _this$props.onScrollBottom,
onScrolling = _this$props.onScrolling;
if (_this.schedulerContent.scrollLeft !== _this.scrollLeft) {
if (onScrolling !== undefined) {
onScrolling(_this.target);
}
if (_this.schedulerContent.scrollLeft === 0 && onScrollLeft !== undefined) {
onScrollLeft(schedulerData, _this.schedulerContent, _this.schedulerContent.scrollWidth - _this.schedulerContent.clientWidth);
}
if (Math.round(_this.schedulerContent.scrollLeft) === _this.schedulerContent.scrollWidth - _this.schedulerContent.clientWidth && onScrollRight !== undefined) {
onScrollRight(schedulerData, _this.schedulerContent, _this.schedulerContent.scrollWidth - _this.schedulerContent.clientWidth);
}
} else if (_this.schedulerContent.scrollTop !== _this.scrollTop) {
if (_this.schedulerContent.scrollTop === 0 && onScrollTop !== undefined) {
onScrollTop(schedulerData, _this.schedulerContent, _this.schedulerContent.scrollHeight - _this.schedulerContent.clientHeight);
}
if (Math.round(_this.schedulerContent.scrollTop) === _this.schedulerContent.scrollHeight - _this.schedulerContent.clientHeight && onScrollBottom !== undefined) {
onScrollBottom(schedulerData, _this.schedulerContent, _this.schedulerContent.scrollHeight - _this.schedulerContent.clientHeight);
}
}
_this.scrollLeft = _this.schedulerContent.scrollLeft;
_this.scrollTop = _this.schedulerContent.scrollTop;
});
_defineProperty(_this, "onViewChange", function (e) {
var _this$props2 = _this.props,
onViewChange = _this$props2.onViewChange,
schedulerData = _this$props2.schedulerData;
var viewType = parseInt(e.target.value.charAt(0));
var showAgenda = e.target.value.charAt(1) === "1";
var isEventPerspective = e.target.value.charAt(2) === "1";
onViewChange(schedulerData, {
viewType: viewType,
showAgenda: showAgenda,
isEventPerspective: isEventPerspective
});
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
spinning: false
}));
});
_defineProperty(_this, "goNext", function () {
var _this$props3 = _this.props,
nextClick = _this$props3.nextClick,
schedulerData = _this$props3.schedulerData;
nextClick(schedulerData);
});
_defineProperty(_this, "goBack", function () {
var _this$props4 = _this.props,
prevClick = _this$props4.prevClick,
schedulerData = _this$props4.schedulerData;
prevClick(schedulerData);
});
_defineProperty(_this, "onSelect", function (date) {
var _this$props5 = _this.props,
onSelectDate = _this$props5.onSelectDate,
schedulerData = _this$props5.schedulerData;
onSelectDate(schedulerData, date);
});
var _schedulerData = props.schedulerData,
dndSources = props.dndSources,
parentRef = props.parentRef;
var sources = [];
sources.push(new _DnDSource["default"](function (dndProps) {
return dndProps.eventItem;
}, _EventItem["default"], _schedulerData.config.dragAndDropEnabled));
if (dndSources !== undefined && dndSources.length > 0) {
sources = [].concat(_toConsumableArray(sources), _toConsumableArray(dndSources));
}
var dndContext = new _DnDContext["default"](sources, _ResourceEvents["default"]);
_this.currentArea = -1;
_this.state = {
dndContext: dndContext,
contentScrollbarHeight: 17,
contentScrollbarWidth: 17,
resourceScrollbarHeight: 17,
resourceScrollbarWidth: 17,
documentWidth: 0,
documentHeight: 0
};
_this.scrollLeft = 0;
_this.scrollTop = 0;
_this.target = 0;
if (_schedulerData.isSchedulerResponsive() && !_schedulerData.config.responsiveByParent || parentRef === undefined) {
_schedulerData._setDocumentWidth(document.documentElement.clientWidth);
window.onresize = _this.onWindowResize;
}
return _this;
}
_inherits(Scheduler, _Component);
return _createClass(Scheduler, [{
key: "componentDidMount",
value: function componentDidMount(props, state) {
var _this2 = this;
var _this$props6 = this.props,
schedulerData = _this$props6.schedulerData,
parentRef = _this$props6.parentRef;
this.resolveScrollbarSize();
if (parentRef !== undefined) {
if (schedulerData.config.responsiveByParent && !!parentRef.current) {
schedulerData._setDocumentWidth(parentRef.current.offsetWidth);
this.ulObserver = new ResizeObserver(function (entries, observer) {
if (parentRef.current) {
var width = parentRef.current.offsetWidth;
var height = parentRef.current.offsetHeight;
schedulerData._setDocumentWidth(width);
_this2.setState({
documentWidth: width,
documentHeight: height
});
}
});
this.ulObserver.observe(parentRef.current);
}
}
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(props, state) {
this.resolveScrollbarSize();
var schedulerData = this.props.schedulerData;
var localeDayjs = schedulerData.localeDayjs,
behaviors = schedulerData.behaviors;
if (schedulerData.getScrollToSpecialDayjs() && !!behaviors.getScrollSpecialDayjsFunc) {
if (!!this.schedulerContent && this.schedulerContent.scrollWidth > this.schedulerContent.clientWidth) {
var start = localeDayjs(new Date(schedulerData.startDate)).startOf("day");
var end = localeDayjs(new Date(schedulerData.endDate)).endOf("day");
var specialDayjs = behaviors.getScrollSpecialDayjsFunc(schedulerData, start, end);
if (specialDayjs >= start && specialDayjs <= end) {
var index = 0;
schedulerData.headers.forEach(function (item) {
var header = localeDayjs(new Date(item.time));
if (specialDayjs >= header) index++;
});
this.schedulerContent.scrollLeft = (index - 1) * schedulerData.getContentCellWidth();
schedulerData.setScrollToSpecialDayjs(false);
}
}
}
}
}, {
key: "render",
value: function render() {
var _this3 = this;
var _this$props7 = this.props,
schedulerData = _this$props7.schedulerData,
leftCustomHeader = _this$props7.leftCustomHeader,
rightCustomHeader = _this$props7.rightCustomHeader;
var viewType = schedulerData.viewType,
renderData = schedulerData.renderData,
showAgenda = schedulerData.showAgenda,
config = schedulerData.config;
var width = schedulerData.getSchedulerWidth();
var tbodyContent = /*#__PURE__*/_react["default"].createElement("tr", null);
if (showAgenda) {
tbodyContent = /*#__PURE__*/_react["default"].createElement(_AgendaView["default"], this.props);
} else {
var resourceTableWidth = schedulerData.getResourceTableWidth();
var schedulerContainerWidth = width - (config.resourceViewEnabled ? resourceTableWidth : 0);
var schedulerWidth = schedulerData.getContentTableWidth() - 1;
var DndResourceEvents = this.state.dndContext.getDropTarget(config.dragAndDropEnabled);
var eventDndSource = this.state.dndContext.getDndSource();
var displayRenderData = renderData.filter(function (o) {
return o.render;
});
var resourceEventsList = displayRenderData.map(function (item) {
return /*#__PURE__*/_react["default"].createElement(DndResourceEvents, _extends({}, _this3.props, {
key: item.slotId,
resourceEvents: item,
dndSource: eventDndSource
}));
});
var contentScrollbarHeight = this.state.contentScrollbarHeight;
var contentScrollbarWidth = this.state.contentScrollbarWidth;
var resourceScrollbarHeight = this.state.resourceScrollbarHeight;
var resourceScrollbarWidth = this.state.resourceScrollbarWidth;
var contentHeight = config.schedulerContentHeight;
var resourcePaddingBottom = resourceScrollbarHeight === 0 ? contentScrollbarHeight : 0;
var contentPaddingBottom = contentScrollbarHeight === 0 ? resourceScrollbarHeight : 0;
var schedulerContentStyle = {
overflowX: viewType === _default.ViewType.Week ? "hidden" : "auto",
overflowY: "auto",
margin: "0px",
position: "relative",
height: contentHeight,
paddingBottom: contentPaddingBottom,
scrollbarWidth: "thin"
};
var resourceContentStyle = {
height: contentHeight,
overflowX: "auto",
overflowY: "auto",
// chnage here to make resource view fixed with the actual height
width: resourceTableWidth + resourceScrollbarWidth - 9,
// if don't need a scollbar
// margin: `0px -${contentScrollbarWidth}px 0px 0px`,
// when need a scrollbar
margin: "0px 0px 0px 0px"
};
if (config.schedulerMaxHeight > 0) {
schedulerContentStyle = _objectSpread(_objectSpread({}, schedulerContentStyle), {}, {
maxHeight: config.schedulerMaxHeight - config.tableHeaderHeight
});
resourceContentStyle = _objectSpread(_objectSpread({}, resourceContentStyle), {}, {
maxHeight: config.schedulerMaxHeight - config.tableHeaderHeight
});
}
var resourceName = schedulerData.isEventPerspective ? config.taskName : config.resourceName;
tbodyContent = /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", {
style: {
display: config.resourceViewEnabled ? undefined : "none",
width: resourceTableWidth,
verticalAlign: "top"
}
}, /*#__PURE__*/_react["default"].createElement("div", {
className: "resource-view"
}, /*#__PURE__*/_react["default"].createElement("div", {
style: {
overflow: "hidden",
borderBottom: "1px solid #e9e9e9",
height: config.tableHeaderHeight
}
}, /*#__PURE__*/_react["default"].createElement("div", {
style: {
overflowX: "scroll",
overflowY: "hidden",
margin: "0px 0px -".concat(contentScrollbarHeight, "px")
}
}, /*#__PURE__*/_react["default"].createElement("table", {
className: "resource-table"
}, /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", {
style: {
height: config.tableHeaderHeight,
background: "#646464"
}
}, /*#__PURE__*/_react["default"].createElement("th", {
className: "header3-text"
}, resourceName)))))), /*#__PURE__*/_react["default"].createElement("div", {
className: "resource-scrollbar",
style: resourceContentStyle,
ref: this.schedulerResourceRef,
onMouseOver: this.onSchedulerResourceMouseOver,
onMouseOut: this.onSchedulerResourceMouseOut,
onScroll: this.onSchedulerResourceScroll
}, /*#__PURE__*/_react["default"].createElement(_ResourceView["default"], _extends({}, this.props, {
contentScrollbarHeight: resourcePaddingBottom
}))))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("div", {
className: "scheduler-view",
style: {
width: schedulerContainerWidth,
verticalAlign: "top"
}
}, /*#__PURE__*/_react["default"].createElement("div", {
style: {
overflow: "hidden",
borderBottom: "1px solid #e9e9e9",
height: config.tableHeaderHeight
}
}, /*#__PURE__*/_react["default"].createElement("div", {
style: {
overflowX: "scroll",
overflowY: "hidden",
margin: "0px 0px -".concat(contentScrollbarHeight, "px")
},
ref: this.schedulerHeadRef,
onMouseOver: this.onSchedulerHeadMouseOver,
onMouseOut: this.onSchedulerHeadMouseOut,
onScroll: this.onSchedulerHeadScroll
}, /*#__PURE__*/_react["default"].createElement("div", {
style: {
// paddingRight: `${contentScrollbarWidth}px`,
paddingRight: "20px",
width: schedulerWidth + contentScrollbarWidth
}
}, /*#__PURE__*/_react["default"].createElement("table", {
className: "scheduler-bg-table"
}, /*#__PURE__*/_react["default"].createElement(_HeaderView["default"], this.props))))), /*#__PURE__*/_react["default"].createElement("div", {
style: schedulerContentStyle,
ref: this.schedulerContentRef,
onMouseOver: this.onSchedulerContentMouseOver,
onMouseOut: this.onSchedulerContentMouseOut,
onScroll: this.onSchedulerContentScroll
}, /*#__PURE__*/_react["default"].createElement("div", {
style: {
width: schedulerWidth
}
}, /*#__PURE__*/_react["default"].createElement("div", {
className: "scheduler-content"
}, /*#__PURE__*/_react["default"].createElement("table", {
className: "scheduler-content-table"
}, /*#__PURE__*/_react["default"].createElement("tbody", null, resourceEventsList))), /*#__PURE__*/_react["default"].createElement("div", {
className: "scheduler-bg"
}, /*#__PURE__*/_react["default"].createElement("table", {
className: "scheduler-bg-table",
style: {
width: schedulerWidth
},
ref: this.schedulerContentBgTableRef
}, /*#__PURE__*/_react["default"].createElement(_BodyView["default"], this.props))))))));
}
var schedulerHeader = /*#__PURE__*/_react["default"].createElement("div", null);
if (config.headerEnabled) {
schedulerHeader = /*#__PURE__*/_react["default"].createElement(_SchedulerHeader["default"], {
onViewChange: this.onViewChange,
schedulerData: schedulerData,
onSelectDate: this.onSelect,
goNext: this.goNext,
goBack: this.goBack,
rightCustomHeader: rightCustomHeader,
leftCustomHeader: leftCustomHeader
});
}
return /*#__PURE__*/_react["default"].createElement("table", {
id: "RBS-Scheduler-root",
className: "scheduler",
style: {
width: "".concat(width, "px")
}
}, /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", {
colSpan: "2"
}, schedulerHeader))), /*#__PURE__*/_react["default"].createElement("tbody", null, tbodyContent));
}
}]);
}(_react.Component);
_defineProperty(Scheduler, "propTypes", {
parentRef: _propTypes["default"].object,
schedulerData: _propTypes["default"].object.isRequired,
prevClick: _propTypes["default"].func.isRequired,
nextClick: _propTypes["default"].func.isRequired,
onViewChange: _propTypes["default"].func.isRequired,
onSelectDate: _propTypes["default"].func.isRequired,
onSetAddMoreState: _propTypes["default"].func,
updateEventStart: _propTypes["default"].func,
updateEventEnd: _propTypes["default"].func,
moveEvent: _propTypes["default"].func,
movingEvent: _propTypes["default"].func,
leftCustomHeader: _propTypes["default"].object,
rightCustomHeader: _propTypes["default"].object,
newEvent: _propTypes["default"].func,
subtitleGetter: _propTypes["default"].func,
eventItemClick: _propTypes["default"].func,
eventContextMenuOpen: _propTypes["default"].func,
viewEventClick: _propTypes["default"].func,
viewEventText: _propTypes["default"].string,
viewEvent2Click: _propTypes["default"].func,
viewEvent2Text: _propTypes["default"].string,
conflictOccurred: _propTypes["default"].func,
eventItemTemplateResolver: _propTypes["default"].func,
dndSources: _propTypes["default"].array,
slotClickedFunc: _propTypes["default"].func,
toggleExpandFunc: _propTypes["default"].func,
slotItemTemplateResolver: _propTypes["default"].func,
nonAgendaCellHeaderTemplateResolver: _propTypes["default"].func,
onScroll: _propTypes["default"].func,
onScrolling: _propTypes["default"].func,
onScrollLeft: _propTypes["default"].func,
onScrollRight: _propTypes["default"].func,
onScrollTop: _propTypes["default"].func,
onScrollBottom: _propTypes["default"].func,
target: _propTypes["default"].number
});
//# sourceMappingURL=index.js.map