react-big-schedule 4.2.5 → 4.3.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.
@@ -1,400 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _propTypes = require("prop-types");
9
- var _AddMore = _interopRequireDefault(require("./AddMore"));
10
- var _Summary = _interopRequireDefault(require("./Summary"));
11
- var _SelectedArea = _interopRequireDefault(require("./SelectedArea"));
12
- var _index = require("./index");
13
- var _utility = require("../helper/utility");
14
- var _default2 = require("../config/default");
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
16
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
19
- 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); }
20
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
- 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); }; }
26
- 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; } }
29
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
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
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
32
- 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); }
33
- var ResourceEvents = /*#__PURE__*/function (_Component) {
34
- _inherits(ResourceEvents, _Component);
35
- var _super = _createSuper(ResourceEvents);
36
- function ResourceEvents(props) {
37
- var _this;
38
- _classCallCheck(this, ResourceEvents);
39
- _this = _super.call(this, props);
40
- _defineProperty(_assertThisInitialized(_this), "initDrag", function (ev) {
41
- var isSelecting = _this.state.isSelecting;
42
- if (isSelecting) return;
43
- if ((ev.srcElement || ev.target) !== _this.eventContainer) return;
44
- ev.stopPropagation();
45
- var resourceEvents = _this.props.resourceEvents;
46
- if (resourceEvents.groupOnly) return;
47
- var clientX = 0;
48
- if (_this.supportTouch) {
49
- if (ev.changedTouches.length == 0) return;
50
- var touch = ev.changedTouches[0];
51
- clientX = touch.pageX;
52
- } else {
53
- if (ev.buttons !== undefined && ev.buttons !== 1) return;
54
- clientX = ev.clientX;
55
- }
56
- var schedulerData = _this.props.schedulerData;
57
- var cellWidth = schedulerData.getContentCellWidth();
58
- var pos = (0, _utility.getPos)(_this.eventContainer);
59
- var startX = clientX - pos.x;
60
- var leftIndex = Math.floor(startX / cellWidth);
61
- var left = leftIndex * cellWidth;
62
- var rightIndex = Math.ceil(startX / cellWidth);
63
- var width = (rightIndex - leftIndex) * cellWidth;
64
- _this.setState({
65
- startX: startX,
66
- left: left,
67
- leftIndex: leftIndex,
68
- width: width,
69
- rightIndex: rightIndex,
70
- isSelecting: true
71
- });
72
- if (_this.supportTouch) {
73
- document.documentElement.addEventListener('touchmove', _this.doDrag, false);
74
- document.documentElement.addEventListener('touchend', _this.stopDrag, false);
75
- document.documentElement.addEventListener('touchcancel', _this.cancelDrag, false);
76
- } else {
77
- document.documentElement.addEventListener('mousemove', _this.doDrag, false);
78
- document.documentElement.addEventListener('mouseup', _this.stopDrag, false);
79
- }
80
- document.onselectstart = function () {
81
- return false;
82
- };
83
- document.ondragstart = function () {
84
- return false;
85
- };
86
- });
87
- _defineProperty(_assertThisInitialized(_this), "doDrag", function (ev) {
88
- ev.stopPropagation();
89
- var clientX = 0;
90
- if (_this.supportTouch) {
91
- if (ev.changedTouches.length == 0) return;
92
- var touch = ev.changedTouches[0];
93
- clientX = touch.pageX;
94
- } else {
95
- clientX = ev.clientX;
96
- }
97
- var startX = _this.state.startX;
98
- var schedulerData = _this.props.schedulerData;
99
- var headers = schedulerData.headers;
100
- var cellWidth = schedulerData.getContentCellWidth();
101
- var pos = (0, _utility.getPos)(_this.eventContainer);
102
- var currentX = clientX - pos.x;
103
- var leftIndex = Math.floor(Math.min(startX, currentX) / cellWidth);
104
- leftIndex = leftIndex < 0 ? 0 : leftIndex;
105
- var left = leftIndex * cellWidth;
106
- var rightIndex = Math.ceil(Math.max(startX, currentX) / cellWidth);
107
- rightIndex = rightIndex > headers.length ? headers.length : rightIndex;
108
- var width = (rightIndex - leftIndex) * cellWidth;
109
- _this.setState({
110
- leftIndex: leftIndex,
111
- left: left,
112
- rightIndex: rightIndex,
113
- width: width,
114
- isSelecting: true
115
- });
116
- });
117
- _defineProperty(_assertThisInitialized(_this), "stopDrag", function (ev) {
118
- ev.stopPropagation();
119
- var _this$props = _this.props,
120
- schedulerData = _this$props.schedulerData,
121
- newEvent = _this$props.newEvent,
122
- resourceEvents = _this$props.resourceEvents;
123
- var headers = schedulerData.headers,
124
- events = schedulerData.events,
125
- config = schedulerData.config,
126
- cellUnit = schedulerData.cellUnit,
127
- localeDayjs = schedulerData.localeDayjs;
128
- var _this$state = _this.state,
129
- leftIndex = _this$state.leftIndex,
130
- rightIndex = _this$state.rightIndex;
131
- if (_this.supportTouch) {
132
- document.documentElement.removeEventListener('touchmove', _this.doDrag, false);
133
- document.documentElement.removeEventListener('touchend', _this.stopDrag, false);
134
- document.documentElement.removeEventListener('touchcancel', _this.cancelDrag, false);
135
- } else {
136
- document.documentElement.removeEventListener('mousemove', _this.doDrag, false);
137
- document.documentElement.removeEventListener('mouseup', _this.stopDrag, false);
138
- }
139
- document.onselectstart = null;
140
- document.ondragstart = null;
141
- var startTime = headers[leftIndex].time;
142
- var endTime = resourceEvents.headerItems[rightIndex - 1].end;
143
- if (cellUnit !== _index.CellUnit.Hour) endTime = localeDayjs(new Date(resourceEvents.headerItems[rightIndex - 1].start)).hour(23).minute(59).second(59).format(_index.DATETIME_FORMAT);
144
- var slotId = resourceEvents.slotId;
145
- var slotName = resourceEvents.slotName;
146
- _this.setState({
147
- startX: 0,
148
- leftIndex: 0,
149
- left: 0,
150
- rightIndex: 0,
151
- width: 0,
152
- isSelecting: false
153
- });
154
- var hasConflict = false;
155
- if (config.checkConflict) {
156
- var start = localeDayjs(new Date(startTime)),
157
- end = localeDayjs(endTime);
158
- events.forEach(function (e) {
159
- if (schedulerData._getEventSlotId(e) === slotId) {
160
- var eStart = localeDayjs(e.start),
161
- eEnd = localeDayjs(e.end);
162
- if (start >= eStart && start < eEnd || end > eStart && end <= eEnd || eStart >= start && eStart < end || eEnd > start && eEnd <= end) hasConflict = true;
163
- }
164
- });
165
- }
166
- if (hasConflict) {
167
- var conflictOccurred = _this.props.conflictOccurred;
168
- if (conflictOccurred != undefined) {
169
- conflictOccurred(schedulerData, 'New', {
170
- id: undefined,
171
- start: startTime,
172
- end: endTime,
173
- slotId: slotId,
174
- slotName: slotName,
175
- title: undefined
176
- }, _default2.DnDTypes.EVENT, slotId, slotName, startTime, endTime);
177
- } else {
178
- console.log('Conflict occurred, set conflictOccurred func in Scheduler to handle it');
179
- }
180
- } else {
181
- if (newEvent != undefined) newEvent(schedulerData, slotId, slotName, startTime, endTime);
182
- }
183
- });
184
- _defineProperty(_assertThisInitialized(_this), "cancelDrag", function (ev) {
185
- ev.stopPropagation();
186
- var isSelecting = _this.state.isSelecting;
187
- if (isSelecting) {
188
- document.documentElement.removeEventListener('touchmove', _this.doDrag, false);
189
- document.documentElement.removeEventListener('touchend', _this.stopDrag, false);
190
- document.documentElement.removeEventListener('touchcancel', _this.cancelDrag, false);
191
- document.onselectstart = null;
192
- document.ondragstart = null;
193
- _this.setState({
194
- startX: 0,
195
- leftIndex: 0,
196
- left: 0,
197
- rightIndex: 0,
198
- width: 0,
199
- isSelecting: false
200
- });
201
- }
202
- });
203
- _defineProperty(_assertThisInitialized(_this), "onAddMoreClick", function (headerItem) {
204
- var _this$props2 = _this.props,
205
- onSetAddMoreState = _this$props2.onSetAddMoreState,
206
- resourceEvents = _this$props2.resourceEvents,
207
- schedulerData = _this$props2.schedulerData;
208
- if (!!onSetAddMoreState) {
209
- var config = schedulerData.config;
210
- var cellWidth = schedulerData.getContentCellWidth();
211
- var index = resourceEvents.headerItems.indexOf(headerItem);
212
- if (index !== -1) {
213
- var left = index * (cellWidth - 1);
214
- var pos = (0, _utility.getPos)(_this.eventContainer);
215
- left = left + pos.x;
216
- var top = pos.y;
217
- var height = (headerItem.count + 1) * config.eventItemLineHeight + 20;
218
- onSetAddMoreState({
219
- headerItem: headerItem,
220
- left: left,
221
- top: top,
222
- height: height
223
- });
224
- }
225
- }
226
- });
227
- _defineProperty(_assertThisInitialized(_this), "eventContainerRef", function (element) {
228
- _this.eventContainer = element;
229
- });
230
- _this.state = {
231
- isSelecting: false,
232
- left: 0,
233
- width: 0
234
- };
235
- _this.supportTouch = false; //'ontouchstart' in window;
236
- return _this;
237
- }
238
- _createClass(ResourceEvents, [{
239
- key: "componentDidMount",
240
- value: function componentDidMount() {
241
- var schedulerData = this.props.schedulerData;
242
- var config = schedulerData.config;
243
- this.supportTouch = 'ontouchstart' in window;
244
- if (config.creatable === true) {
245
- if (this.supportTouch) {
246
- // this.eventContainer.addEventListener('touchstart', this.initDrag, false);
247
- } else {
248
- this.eventContainer.addEventListener('mousedown', this.initDrag, false);
249
- }
250
- }
251
- }
252
- }, {
253
- key: "componentDidUpdate",
254
- value: function componentDidUpdate(prevProps, nextProps) {
255
- if (prevProps !== this.props) {
256
- if (this.supportTouch) {
257
- // this.eventContainer.removeEventListener('touchstart', this.initDrag, false);
258
- } else {
259
- this.eventContainer.removeEventListener('mousedown', this.initDrag, false);
260
- }
261
- if (this.props.schedulerData.config.creatable) {
262
- if (this.supportTouch) {
263
- // this.eventContainer.addEventListener('touchstart', this.initDrag, false);
264
- } else {
265
- this.eventContainer.addEventListener('mousedown', this.initDrag, false);
266
- }
267
- }
268
- }
269
- }
270
- }, {
271
- key: "render",
272
- value: function render() {
273
- var _this2 = this;
274
- var _this$props3 = this.props,
275
- resourceEvents = _this$props3.resourceEvents,
276
- schedulerData = _this$props3.schedulerData,
277
- connectDropTarget = _this$props3.connectDropTarget,
278
- dndSource = _this$props3.dndSource;
279
- var cellUnit = schedulerData.cellUnit,
280
- startDate = schedulerData.startDate,
281
- endDate = schedulerData.endDate,
282
- config = schedulerData.config,
283
- localeDayjs = schedulerData.localeDayjs;
284
- var _this$state2 = this.state,
285
- isSelecting = _this$state2.isSelecting,
286
- left = _this$state2.left,
287
- width = _this$state2.width;
288
- var cellWidth = schedulerData.getContentCellWidth();
289
- var cellMaxEvents = schedulerData.getCellMaxEvents();
290
- var rowWidth = schedulerData.getContentTableWidth();
291
- var DnDEventItem = dndSource.getDragSource();
292
- var selectedArea = isSelecting ? /*#__PURE__*/_react["default"].createElement(_SelectedArea["default"], _extends({}, this.props, {
293
- left: left,
294
- width: width
295
- })) : /*#__PURE__*/_react["default"].createElement("div", null);
296
- var eventList = [];
297
- resourceEvents.headerItems.forEach(function (headerItem, index) {
298
- if (headerItem.count > 0 || headerItem.summary != undefined) {
299
- var isTop = config.summaryPos === _index.SummaryPos.TopRight || config.summaryPos === _index.SummaryPos.Top || config.summaryPos === _index.SummaryPos.TopLeft;
300
- var marginTop = resourceEvents.hasSummary && isTop ? 1 + config.eventItemLineHeight : 1;
301
- var renderEventsMaxIndex = headerItem.addMore === 0 ? cellMaxEvents : headerItem.addMoreIndex;
302
- headerItem.events.forEach(function (evt, idx) {
303
- if (idx < renderEventsMaxIndex && evt !== undefined && evt.render) {
304
- var durationStart = localeDayjs(new Date(startDate));
305
- var durationEnd = localeDayjs(endDate);
306
- if (cellUnit === _index.CellUnit.Hour) {
307
- durationStart = localeDayjs(new Date(startDate)).add(config.dayStartFrom, 'hours');
308
- durationEnd = localeDayjs(endDate).add(config.dayStopTo + 1, 'hours');
309
- }
310
- var eventStart = localeDayjs(evt.eventItem.start);
311
- var eventEnd = localeDayjs(evt.eventItem.end);
312
- var isStart = eventStart >= durationStart;
313
- var isEnd = eventEnd <= durationEnd;
314
- var _left = index * cellWidth + (index > 0 ? 2 : 3);
315
- var _width = evt.span * cellWidth - (index > 0 ? 5 : 6) > 0 ? evt.span * cellWidth - (index > 0 ? 5 : 6) : 0;
316
- var top = marginTop + idx * config.eventItemLineHeight;
317
- var eventItem = /*#__PURE__*/_react["default"].createElement(DnDEventItem, _extends({}, _this2.props, {
318
- key: evt.eventItem.id,
319
- eventItem: evt.eventItem,
320
- isStart: isStart,
321
- isEnd: isEnd,
322
- isInPopover: false,
323
- left: _left,
324
- width: _width,
325
- top: top,
326
- leftIndex: index,
327
- rightIndex: index + evt.span
328
- }));
329
- eventList.push(eventItem);
330
- }
331
- });
332
- if (headerItem.addMore > 0) {
333
- var _left2 = index * cellWidth + (index > 0 ? 2 : 3);
334
- var _width2 = cellWidth - (index > 0 ? 5 : 6);
335
- var top = marginTop + headerItem.addMoreIndex * config.eventItemLineHeight;
336
- var addMoreItem = /*#__PURE__*/_react["default"].createElement(_AddMore["default"], _extends({}, _this2.props, {
337
- key: headerItem.time,
338
- headerItem: headerItem,
339
- number: headerItem.addMore,
340
- left: _left2,
341
- width: _width2,
342
- top: top,
343
- clickAction: _this2.onAddMoreClick
344
- }));
345
- eventList.push(addMoreItem);
346
- }
347
- if (headerItem.summary != undefined) {
348
- var _top = isTop ? 1 : resourceEvents.rowHeight - config.eventItemLineHeight + 1;
349
- var _left3 = index * cellWidth + (index > 0 ? 2 : 3);
350
- var _width3 = cellWidth - (index > 0 ? 5 : 6);
351
- var key = "".concat(resourceEvents.slotId, "_").concat(headerItem.time);
352
- var summary = /*#__PURE__*/_react["default"].createElement(_Summary["default"], {
353
- key: key,
354
- schedulerData: schedulerData,
355
- summary: headerItem.summary,
356
- left: _left3,
357
- width: _width3,
358
- top: _top
359
- });
360
- eventList.push(summary);
361
- }
362
- }
363
- });
364
- var eventContainer = /*#__PURE__*/_react["default"].createElement("div", {
365
- ref: this.eventContainerRef,
366
- className: "event-container",
367
- style: {
368
- height: resourceEvents.rowHeight
369
- }
370
- }, selectedArea, eventList);
371
- return /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", {
372
- style: {
373
- width: rowWidth
374
- }
375
- }, config.dragAndDropEnabled ? connectDropTarget(eventContainer) : eventContainer));
376
- }
377
- }]);
378
- return ResourceEvents;
379
- }(_react.Component);
380
- _defineProperty(ResourceEvents, "propTypes", {
381
- resourceEvents: _propTypes.PropTypes.object.isRequired,
382
- schedulerData: _propTypes.PropTypes.object.isRequired,
383
- dndSource: _propTypes.PropTypes.object.isRequired,
384
- onSetAddMoreState: _propTypes.PropTypes.func,
385
- updateEventStart: _propTypes.PropTypes.func,
386
- updateEventEnd: _propTypes.PropTypes.func,
387
- moveEvent: _propTypes.PropTypes.func,
388
- movingEvent: _propTypes.PropTypes.func,
389
- conflictOccurred: _propTypes.PropTypes.func,
390
- subtitleGetter: _propTypes.PropTypes.func,
391
- eventItemClick: _propTypes.PropTypes.func,
392
- viewEventClick: _propTypes.PropTypes.func,
393
- viewEventText: _propTypes.PropTypes.string,
394
- viewEvent2Click: _propTypes.PropTypes.func,
395
- viewEvent2Text: _propTypes.PropTypes.string,
396
- newEvent: _propTypes.PropTypes.func,
397
- eventItemTemplateResolver: _propTypes.PropTypes.func
398
- });
399
- var _default = ResourceEvents;
400
- exports["default"] = _default;
@@ -1,119 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _icons = require("@ant-design/icons");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
- var ResourceView = function ResourceView(_ref) {
12
- var schedulerData = _ref.schedulerData,
13
- contentScrollbarHeight = _ref.contentScrollbarHeight,
14
- slotClickedFunc = _ref.slotClickedFunc,
15
- slotItemTemplateResolver = _ref.slotItemTemplateResolver,
16
- toggleExpandFunc = _ref.toggleExpandFunc;
17
- var renderData = schedulerData.renderData;
18
- var width = schedulerData.getResourceTableWidth() - 2;
19
- var paddingBottom = contentScrollbarHeight;
20
- var displayRenderData = renderData.filter(function (o) {
21
- return o.render;
22
- });
23
- var handleToggleExpand = function handleToggleExpand(item) {
24
- if (!!toggleExpandFunc) {
25
- toggleExpandFunc(schedulerData, item.slotId);
26
- }
27
- };
28
- var renderSlotItem = function renderSlotItem(item, indents) {
29
- var indent = /*#__PURE__*/_react["default"].createElement("span", {
30
- key: "es".concat(item.indent),
31
- className: "expander-space"
32
- });
33
- if (item.hasChildren) {
34
- indent = item.expanded ? /*#__PURE__*/_react["default"].createElement(_icons.MinusSquareOutlined, {
35
- key: "es".concat(item.indent),
36
- style: {},
37
- className: "",
38
- onClick: function onClick() {
39
- return handleToggleExpand(item);
40
- }
41
- }) : /*#__PURE__*/_react["default"].createElement(_icons.PlusSquareOutlined, {
42
- key: "es".concat(item.indent),
43
- style: {},
44
- className: "",
45
- onClick: function onClick() {
46
- return handleToggleExpand(item);
47
- }
48
- });
49
- }
50
- indents.push(indent);
51
- var slotCell = slotClickedFunc ? /*#__PURE__*/_react["default"].createElement("span", {
52
- className: "slot-cell"
53
- }, indents, /*#__PURE__*/_react["default"].createElement("a", {
54
- style: {
55
- cursor: 'pointer'
56
- },
57
- className: "slot-text",
58
- onClick: function onClick() {
59
- return slotClickedFunc(schedulerData, item);
60
- }
61
- }, item.slotName)) : /*#__PURE__*/_react["default"].createElement("span", {
62
- className: "slot-cell"
63
- }, indents, /*#__PURE__*/_react["default"].createElement("span", {
64
- className: "slot-text",
65
- style: {
66
- cursor: slotClickedFunc === undefined ? undefined : 'pointer'
67
- }
68
- }, item.slotName));
69
- var slotItem = /*#__PURE__*/_react["default"].createElement("div", {
70
- title: item.slotName,
71
- className: "overflow-text header2-text",
72
- style: {
73
- textAlign: 'left'
74
- }
75
- }, slotCell);
76
- if (!!slotItemTemplateResolver) {
77
- var temp = slotItemTemplateResolver(schedulerData, item, slotClickedFunc, width, 'overflow-text header2-text');
78
- if (!!temp) {
79
- slotItem = temp;
80
- }
81
- }
82
- var tdStyle = {
83
- height: item.rowHeight,
84
- backgroundColor: item.groupOnly ? schedulerData.config.groupOnlySlotColor : undefined
85
- };
86
- return /*#__PURE__*/_react["default"].createElement("tr", {
87
- key: item.slotId
88
- }, /*#__PURE__*/_react["default"].createElement("td", {
89
- "data-resource-id": item.slotId,
90
- style: tdStyle
91
- }, slotItem));
92
- };
93
- var resourceList = displayRenderData.map(function (item) {
94
- var indents = [];
95
- for (var i = 0; i < item.indent; i++) {
96
- indents.push( /*#__PURE__*/_react["default"].createElement("span", {
97
- key: "es".concat(i),
98
- className: "expander-space"
99
- }));
100
- }
101
- return renderSlotItem(item, indents);
102
- });
103
- return /*#__PURE__*/_react["default"].createElement("div", {
104
- style: {
105
- paddingBottom: paddingBottom
106
- }
107
- }, /*#__PURE__*/_react["default"].createElement("table", {
108
- className: "resource-table"
109
- }, /*#__PURE__*/_react["default"].createElement("tbody", null, resourceList)));
110
- };
111
- ResourceView.propTypes = {
112
- schedulerData: _propTypes["default"].object.isRequired,
113
- contentScrollbarHeight: _propTypes["default"].number.isRequired,
114
- slotClickedFunc: _propTypes["default"].func,
115
- slotItemTemplateResolver: _propTypes["default"].func,
116
- toggleExpandFunc: _propTypes["default"].func
117
- };
118
- var _default = ResourceView;
119
- exports["default"] = _default;