react-big-schedule 5.5.2-beta.5 → 6.1.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.
- package/README.md +6 -0
- package/dist/components/AddMore.js +29 -35
- package/dist/components/AddMorePopover.js +65 -83
- package/dist/components/AgendaEventItem.js +44 -54
- package/dist/components/AgendaResourceEvents.js +55 -65
- package/dist/components/AgendaView.js +50 -53
- package/dist/components/BodyView.js +30 -35
- package/dist/components/DnDContext.js +144 -159
- package/dist/components/DnDSource.js +107 -116
- package/dist/components/EventItem.js +659 -704
- package/dist/components/EventItemPopover.js +74 -83
- package/dist/components/HeaderView.js +81 -91
- package/dist/components/ResourceEvents.js +613 -675
- package/dist/components/ResourceView.js +71 -81
- package/dist/components/SchedulerData.js +1031 -1258
- package/dist/components/SchedulerHeader.js +83 -116
- package/dist/components/SelectedArea.js +18 -22
- package/dist/components/Summary.js +36 -45
- package/dist/components/WrapperFun.js +9 -19
- package/dist/components/index.js +317 -463
- package/dist/config/default.js +6 -12
- package/dist/config/i18n.js +13 -27
- package/dist/config/scheduler.js +8 -13
- package/dist/helper/behaviors.js +53 -61
- package/dist/helper/utility.js +40 -26
- package/dist/index.js +2 -103
- package/dist/sample-data/sample1.js +44 -8
- package/package.json +18 -18
|
@@ -1,121 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var localeDayjs = schedulerData.localeDayjs,
|
|
25
|
-
config = schedulerData.config;
|
|
26
|
-
var start = localeDayjs(new Date(startTime));
|
|
27
|
-
var end = localeDayjs(new Date(endTime));
|
|
1
|
+
import { Col, Row } from 'antd';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
function EventItemPopover({
|
|
5
|
+
schedulerData,
|
|
6
|
+
eventItem,
|
|
7
|
+
title,
|
|
8
|
+
startTime,
|
|
9
|
+
endTime,
|
|
10
|
+
statusColor,
|
|
11
|
+
subtitleGetter,
|
|
12
|
+
viewEventClick,
|
|
13
|
+
viewEventText,
|
|
14
|
+
viewEvent2Click,
|
|
15
|
+
viewEvent2Text,
|
|
16
|
+
eventItemPopoverTemplateResolver
|
|
17
|
+
}) {
|
|
18
|
+
const {
|
|
19
|
+
localeDayjs,
|
|
20
|
+
config
|
|
21
|
+
} = schedulerData;
|
|
22
|
+
const start = localeDayjs(new Date(startTime));
|
|
23
|
+
const end = localeDayjs(new Date(endTime));
|
|
28
24
|
if (eventItemPopoverTemplateResolver) {
|
|
29
25
|
return eventItemPopoverTemplateResolver(schedulerData, eventItem, title, start, end, statusColor);
|
|
30
26
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
children: text
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
27
|
+
const subtitle = subtitleGetter ? subtitleGetter(schedulerData, eventItem) : null;
|
|
28
|
+
const showViewEvent = viewEventText && viewEventClick && (eventItem.clickable1 === undefined || eventItem.clickable1);
|
|
29
|
+
const showViewEvent2 = viewEvent2Text && viewEvent2Click && (eventItem.clickable2 === undefined || eventItem.clickable2);
|
|
30
|
+
const renderViewEvent = (text, clickHandler, marginLeft = 0) => /*#__PURE__*/_jsx("button", {
|
|
31
|
+
className: "header2-text rbs-txt-btn-dis",
|
|
32
|
+
type: "button",
|
|
33
|
+
style: {
|
|
34
|
+
color: '#108EE9',
|
|
35
|
+
cursor: 'pointer',
|
|
36
|
+
marginLeft: `${marginLeft}px`
|
|
37
|
+
},
|
|
38
|
+
onClick: () => clickHandler(schedulerData, eventItem),
|
|
39
|
+
children: text
|
|
40
|
+
});
|
|
41
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
51
42
|
style: {
|
|
52
43
|
width: config.eventItemPopoverWidth
|
|
53
44
|
},
|
|
54
|
-
children: [/*#__PURE__*/(
|
|
45
|
+
children: [/*#__PURE__*/_jsxs(Row, {
|
|
55
46
|
type: "flex",
|
|
56
47
|
align: "middle",
|
|
57
|
-
children: [config.eventItemPopoverShowColor && /*#__PURE__*/(
|
|
48
|
+
children: [config.eventItemPopoverShowColor && /*#__PURE__*/_jsx(Col, {
|
|
58
49
|
span: 2,
|
|
59
|
-
children: /*#__PURE__*/(
|
|
50
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
60
51
|
className: "status-dot",
|
|
61
52
|
style: {
|
|
62
53
|
backgroundColor: statusColor
|
|
63
54
|
}
|
|
64
55
|
})
|
|
65
|
-
}), /*#__PURE__*/(
|
|
56
|
+
}), /*#__PURE__*/_jsx(Col, {
|
|
66
57
|
span: 22,
|
|
67
58
|
className: "overflow-text",
|
|
68
|
-
children: /*#__PURE__*/(
|
|
59
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
69
60
|
className: "header2-text",
|
|
70
61
|
title: title,
|
|
71
62
|
children: title
|
|
72
63
|
})
|
|
73
64
|
})]
|
|
74
|
-
}), subtitle && /*#__PURE__*/(
|
|
65
|
+
}), subtitle && /*#__PURE__*/_jsxs(Row, {
|
|
75
66
|
type: "flex",
|
|
76
67
|
align: "middle",
|
|
77
|
-
children: [/*#__PURE__*/(
|
|
68
|
+
children: [/*#__PURE__*/_jsx(Col, {
|
|
78
69
|
span: 2,
|
|
79
|
-
children: /*#__PURE__*/(
|
|
80
|
-
}), /*#__PURE__*/(
|
|
70
|
+
children: /*#__PURE__*/_jsx("div", {})
|
|
71
|
+
}), /*#__PURE__*/_jsx(Col, {
|
|
81
72
|
span: 22,
|
|
82
73
|
className: "overflow-text",
|
|
83
|
-
children: /*#__PURE__*/(
|
|
74
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
84
75
|
className: "header2-text",
|
|
85
76
|
title: subtitle,
|
|
86
77
|
children: subtitle
|
|
87
78
|
})
|
|
88
79
|
})]
|
|
89
|
-
}), /*#__PURE__*/(
|
|
80
|
+
}), /*#__PURE__*/_jsxs(Row, {
|
|
90
81
|
type: "flex",
|
|
91
82
|
align: "middle",
|
|
92
|
-
children: [/*#__PURE__*/(
|
|
83
|
+
children: [/*#__PURE__*/_jsx(Col, {
|
|
93
84
|
span: 2,
|
|
94
|
-
children: /*#__PURE__*/(
|
|
95
|
-
}), /*#__PURE__*/(
|
|
85
|
+
children: /*#__PURE__*/_jsx("div", {})
|
|
86
|
+
}), /*#__PURE__*/_jsxs(Col, {
|
|
96
87
|
span: 22,
|
|
97
|
-
children: [/*#__PURE__*/(
|
|
88
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
98
89
|
className: "header1-text",
|
|
99
90
|
children: start.format('HH:mm')
|
|
100
|
-
}), config.eventItemPopoverDateFormat && /*#__PURE__*/(
|
|
91
|
+
}), config.eventItemPopoverDateFormat && /*#__PURE__*/_jsx("span", {
|
|
101
92
|
className: "help-text",
|
|
102
93
|
style: {
|
|
103
94
|
marginLeft: '8px'
|
|
104
95
|
},
|
|
105
96
|
children: start.format(config.eventItemPopoverDateFormat)
|
|
106
|
-
}), /*#__PURE__*/(
|
|
97
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
107
98
|
className: "header2-text",
|
|
108
99
|
style: {
|
|
109
100
|
marginLeft: '8px'
|
|
110
101
|
},
|
|
111
102
|
children: "-"
|
|
112
|
-
}), /*#__PURE__*/(
|
|
103
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
113
104
|
className: "header1-text",
|
|
114
105
|
style: {
|
|
115
106
|
marginLeft: '8px'
|
|
116
107
|
},
|
|
117
108
|
children: end.format('HH:mm')
|
|
118
|
-
}), config.eventItemPopoverDateFormat && /*#__PURE__*/(
|
|
109
|
+
}), config.eventItemPopoverDateFormat && /*#__PURE__*/_jsx("span", {
|
|
119
110
|
className: "help-text",
|
|
120
111
|
style: {
|
|
121
112
|
marginLeft: '8px'
|
|
@@ -123,13 +114,13 @@ function EventItemPopover(_ref) {
|
|
|
123
114
|
children: end.format(config.eventItemPopoverDateFormat)
|
|
124
115
|
})]
|
|
125
116
|
})]
|
|
126
|
-
}), (showViewEvent || showViewEvent2) && /*#__PURE__*/(
|
|
117
|
+
}), (showViewEvent || showViewEvent2) && /*#__PURE__*/_jsxs(Row, {
|
|
127
118
|
type: "flex",
|
|
128
119
|
align: "middle",
|
|
129
|
-
children: [/*#__PURE__*/(
|
|
120
|
+
children: [/*#__PURE__*/_jsx(Col, {
|
|
130
121
|
span: 2,
|
|
131
|
-
children: /*#__PURE__*/(
|
|
132
|
-
}), /*#__PURE__*/(
|
|
122
|
+
children: /*#__PURE__*/_jsx("div", {})
|
|
123
|
+
}), /*#__PURE__*/_jsxs(Col, {
|
|
133
124
|
span: 22,
|
|
134
125
|
children: [showViewEvent && renderViewEvent(viewEventText, viewEventClick), showViewEvent2 && renderViewEvent(viewEvent2Text, viewEvent2Click, 16)]
|
|
135
126
|
})]
|
|
@@ -137,17 +128,17 @@ function EventItemPopover(_ref) {
|
|
|
137
128
|
});
|
|
138
129
|
}
|
|
139
130
|
EventItemPopover.propTypes = {
|
|
140
|
-
schedulerData:
|
|
141
|
-
eventItem:
|
|
142
|
-
title:
|
|
143
|
-
startTime:
|
|
144
|
-
endTime:
|
|
145
|
-
statusColor:
|
|
146
|
-
subtitleGetter:
|
|
147
|
-
viewEventClick:
|
|
148
|
-
viewEventText:
|
|
149
|
-
viewEvent2Click:
|
|
150
|
-
viewEvent2Text:
|
|
151
|
-
eventItemPopoverTemplateResolver:
|
|
131
|
+
schedulerData: PropTypes.object.isRequired,
|
|
132
|
+
eventItem: PropTypes.object.isRequired,
|
|
133
|
+
title: PropTypes.string.isRequired,
|
|
134
|
+
startTime: PropTypes.string.isRequired,
|
|
135
|
+
endTime: PropTypes.string.isRequired,
|
|
136
|
+
statusColor: PropTypes.string.isRequired,
|
|
137
|
+
subtitleGetter: PropTypes.func,
|
|
138
|
+
viewEventClick: PropTypes.func,
|
|
139
|
+
viewEventText: PropTypes.string,
|
|
140
|
+
viewEvent2Click: PropTypes.func,
|
|
141
|
+
viewEvent2Text: PropTypes.string,
|
|
142
|
+
eventItemPopoverTemplateResolver: PropTypes.func
|
|
152
143
|
};
|
|
153
|
-
|
|
144
|
+
export default EventItemPopover;
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import React, { useCallback, useMemo } from 'react';
|
|
3
|
+
import { CellUnit } from '../config/default';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _default2 = require("../config/default");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
|
-
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); }
|
|
14
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
-
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); } /**
|
|
5
|
+
/**
|
|
17
6
|
* Render the table header rows for a scheduler view, including an optional week-number row and the main header cells.
|
|
18
7
|
* @param {Object} props.schedulerData - Scheduler configuration and utilities (headers array,
|
|
19
8
|
* cell unit, formatting, sizing, and locale/date functions).
|
|
@@ -22,32 +11,37 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
22
11
|
* @returns {JSX.Element} A <thead> element containing the optional week-number row and the
|
|
23
12
|
* main header row for the scheduler table.
|
|
24
13
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
14
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
function HeaderView({
|
|
16
|
+
schedulerData,
|
|
17
|
+
nonAgendaCellHeaderTemplateResolver
|
|
18
|
+
}) {
|
|
19
|
+
const {
|
|
20
|
+
headers,
|
|
21
|
+
cellUnit,
|
|
22
|
+
config,
|
|
23
|
+
localeDayjs
|
|
24
|
+
} = schedulerData;
|
|
25
|
+
const {
|
|
26
|
+
showWeekNumber,
|
|
27
|
+
weekNumberRowHeight = 24
|
|
28
|
+
} = config;
|
|
29
|
+
const headerHeight = schedulerData.getTableHeaderHeight();
|
|
30
|
+
const cellWidth = schedulerData.getContentCellWidth();
|
|
31
|
+
const minuteStepsInHour = schedulerData.getMinuteStepsInHour();
|
|
38
32
|
|
|
39
33
|
// Week number row generation
|
|
40
|
-
|
|
34
|
+
const weekNumberRow = useMemo(() => {
|
|
41
35
|
if (!showWeekNumber) return null;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
headers.forEach(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
const weekGroups = [];
|
|
37
|
+
let currentWeekKey = null;
|
|
38
|
+
let currentWeek = null;
|
|
39
|
+
let currentYear = null;
|
|
40
|
+
let colspan = 0;
|
|
41
|
+
headers.forEach(item => {
|
|
42
|
+
const year = localeDayjs(new Date(item.time)).year();
|
|
43
|
+
const weekNum = localeDayjs(new Date(item.time)).isoWeek();
|
|
44
|
+
const weekKey = `${year}-${weekNum}`;
|
|
51
45
|
if (currentWeekKey === weekKey) {
|
|
52
46
|
colspan += 1;
|
|
53
47
|
} else {
|
|
@@ -55,7 +49,7 @@ function HeaderView(_ref) {
|
|
|
55
49
|
weekGroups.push({
|
|
56
50
|
week: currentWeek,
|
|
57
51
|
year: currentYear,
|
|
58
|
-
colspan
|
|
52
|
+
colspan
|
|
59
53
|
});
|
|
60
54
|
}
|
|
61
55
|
currentWeekKey = weekKey;
|
|
@@ -70,27 +64,25 @@ function HeaderView(_ref) {
|
|
|
70
64
|
weekGroups.push({
|
|
71
65
|
week: currentWeek,
|
|
72
66
|
year: currentYear,
|
|
73
|
-
colspan
|
|
67
|
+
colspan
|
|
74
68
|
});
|
|
75
69
|
}
|
|
76
|
-
|
|
70
|
+
const cellStyle = {
|
|
77
71
|
fontSize: '0.85em',
|
|
78
72
|
opacity: 0.7,
|
|
79
|
-
borderBottom:
|
|
73
|
+
borderBottom: `1px solid ${config.headerBorderColor || '#e9e9e9'}`,
|
|
80
74
|
padding: '4px 8px',
|
|
81
75
|
textAlign: 'center'
|
|
82
76
|
};
|
|
83
|
-
return weekGroups.map(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}, "week-".concat(group.year, "-").concat(group.week));
|
|
89
|
-
});
|
|
77
|
+
return weekGroups.map(group => /*#__PURE__*/_jsxs("th", {
|
|
78
|
+
colSpan: group.colspan,
|
|
79
|
+
style: cellStyle,
|
|
80
|
+
children: ["W", group.week]
|
|
81
|
+
}, `week-${group.year}-${group.week}`));
|
|
90
82
|
}, [showWeekNumber, headers, localeDayjs, config.headerBorderColor]);
|
|
91
83
|
|
|
92
84
|
// Extract common style creation logic
|
|
93
|
-
|
|
85
|
+
const createCellStyle = useCallback((item, width, isLastCell) => {
|
|
94
86
|
if (isLastCell) {
|
|
95
87
|
return item.nonWorkingTime ? {
|
|
96
88
|
color: config.nonWorkingTimeHeadColor,
|
|
@@ -98,78 +90,76 @@ function HeaderView(_ref) {
|
|
|
98
90
|
} : {};
|
|
99
91
|
}
|
|
100
92
|
return item.nonWorkingTime ? {
|
|
101
|
-
width
|
|
93
|
+
width,
|
|
102
94
|
color: config.nonWorkingTimeHeadColor,
|
|
103
95
|
backgroundColor: config.nonWorkingTimeHeadBgColor
|
|
104
96
|
} : {
|
|
105
|
-
width
|
|
97
|
+
width
|
|
106
98
|
};
|
|
107
99
|
}, [config]);
|
|
108
100
|
|
|
109
101
|
// Extract cell format selection logic
|
|
110
|
-
|
|
111
|
-
|
|
102
|
+
const getCellFormat = useCallback(cellUnitParam => {
|
|
103
|
+
const formatMap = {
|
|
104
|
+
[CellUnit.Week]: config.nonAgendaWeekCellHeaderFormat,
|
|
105
|
+
[CellUnit.Month]: config.nonAgendaMonthCellHeaderFormat,
|
|
106
|
+
[CellUnit.Year]: config.nonAgendaYearCellHeaderFormat
|
|
107
|
+
};
|
|
112
108
|
return formatMap[cellUnitParam] || config.nonAgendaOtherCellHeaderFormat;
|
|
113
109
|
}, [config]);
|
|
114
110
|
|
|
115
111
|
// Render cell content helper
|
|
116
|
-
|
|
112
|
+
const renderCellContent = useCallback((item, formattedList, style) => {
|
|
117
113
|
if (typeof nonAgendaCellHeaderTemplateResolver === 'function') {
|
|
118
114
|
return nonAgendaCellHeaderTemplateResolver(schedulerData, item, formattedList, style);
|
|
119
115
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
});
|
|
125
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
|
|
116
|
+
const content = formattedList.map(text => /*#__PURE__*/_jsx("div", {
|
|
117
|
+
children: text
|
|
118
|
+
}, `${item.time}-${text}`));
|
|
119
|
+
return /*#__PURE__*/_jsx("th", {
|
|
126
120
|
className: "header3-text",
|
|
127
121
|
style: style,
|
|
128
|
-
children: /*#__PURE__*/(
|
|
122
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
129
123
|
children: content
|
|
130
124
|
})
|
|
131
|
-
},
|
|
125
|
+
}, `header-${item.time}`);
|
|
132
126
|
}, [nonAgendaCellHeaderTemplateResolver, schedulerData]);
|
|
133
127
|
|
|
134
128
|
// Memoize header list generation
|
|
135
|
-
|
|
136
|
-
if (cellUnit ===
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
headers.forEach(
|
|
129
|
+
const headerList = useMemo(() => {
|
|
130
|
+
if (cellUnit === CellUnit.Hour) {
|
|
131
|
+
const result = [];
|
|
132
|
+
const lastIndex = headers.length - minuteStepsInHour;
|
|
133
|
+
headers.forEach((item, index) => {
|
|
140
134
|
if (index % minuteStepsInHour !== 0) return;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return datetime.format(format);
|
|
147
|
-
});
|
|
135
|
+
const datetime = localeDayjs(new Date(item.time));
|
|
136
|
+
const width = cellWidth * minuteStepsInHour;
|
|
137
|
+
const isLastCell = index === lastIndex;
|
|
138
|
+
const style = createCellStyle(item, width, isLastCell);
|
|
139
|
+
const formattedList = config.nonAgendaDayCellHeaderFormat.split('|').map(format => datetime.format(format));
|
|
148
140
|
result.push(renderCellContent(item, formattedList, style));
|
|
149
141
|
});
|
|
150
142
|
return result;
|
|
151
143
|
}
|
|
152
144
|
|
|
153
145
|
// Non-hour cell units
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
return headers.map(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return datetime.format(format);
|
|
162
|
-
});
|
|
146
|
+
const cellFormat = getCellFormat(cellUnit);
|
|
147
|
+
const lastIndex = headers.length - 1;
|
|
148
|
+
return headers.map((item, index) => {
|
|
149
|
+
const datetime = localeDayjs(new Date(item.time));
|
|
150
|
+
const isLastCell = index === lastIndex;
|
|
151
|
+
const style = createCellStyle(item, cellWidth, isLastCell);
|
|
152
|
+
const formattedList = cellFormat.split('|').map(format => datetime.format(format));
|
|
163
153
|
return renderCellContent(item, formattedList, style);
|
|
164
154
|
});
|
|
165
155
|
}, [cellUnit, headers, minuteStepsInHour, cellWidth, config, localeDayjs, createCellStyle, getCellFormat, renderCellContent]);
|
|
166
|
-
return /*#__PURE__*/(
|
|
167
|
-
children: [weekNumberRow && /*#__PURE__*/(
|
|
156
|
+
return /*#__PURE__*/_jsxs("thead", {
|
|
157
|
+
children: [weekNumberRow && /*#__PURE__*/_jsx("tr", {
|
|
168
158
|
style: {
|
|
169
159
|
height: weekNumberRowHeight
|
|
170
160
|
},
|
|
171
161
|
children: weekNumberRow
|
|
172
|
-
}), /*#__PURE__*/(
|
|
162
|
+
}), /*#__PURE__*/_jsx("tr", {
|
|
173
163
|
style: {
|
|
174
164
|
height: headerHeight
|
|
175
165
|
},
|
|
@@ -178,8 +168,8 @@ function HeaderView(_ref) {
|
|
|
178
168
|
});
|
|
179
169
|
}
|
|
180
170
|
HeaderView.propTypes = {
|
|
181
|
-
schedulerData:
|
|
182
|
-
schedulerDataVersion:
|
|
183
|
-
nonAgendaCellHeaderTemplateResolver:
|
|
171
|
+
schedulerData: PropTypes.object.isRequired,
|
|
172
|
+
schedulerDataVersion: PropTypes.number,
|
|
173
|
+
nonAgendaCellHeaderTemplateResolver: PropTypes.func
|
|
184
174
|
};
|
|
185
|
-
|
|
175
|
+
export default /*#__PURE__*/React.memo(HeaderView);
|