react-big-schedule 4.4.2 → 4.4.3
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/dist/components/AddMore.js +12 -19
- package/dist/components/AddMorePopover.js +31 -41
- package/dist/components/AgendaEventItem.js +22 -29
- package/dist/components/AgendaResourceEvents.js +21 -28
- package/dist/components/AgendaView.js +18 -25
- package/dist/components/BodyView.js +8 -15
- package/dist/components/DnDContext.js +23 -28
- package/dist/components/DnDSource.js +12 -17
- package/dist/components/EventItem.js +50 -58
- package/dist/components/EventItemPopover.js +38 -45
- package/dist/components/HeaderView.js +15 -23
- package/dist/components/ResourceEvents.js +41 -50
- package/dist/components/ResourceView.js +22 -29
- package/dist/components/SchedulerData.js +73 -79
- package/dist/components/SchedulerHeader.js +35 -45
- package/dist/components/SelectedArea.js +7 -14
- package/dist/components/Summary.js +13 -20
- package/dist/components/WrapperFun.js +7 -15
- package/dist/components/index.js +88 -159
- package/dist/config/default.js +6 -12
- package/dist/config/scheduler.js +8 -14
- package/dist/helper/behaviors.js +19 -24
- package/dist/helper/utility.js +2 -8
- package/dist/index.js +1 -78
- package/dist/sample-data/sample1.js +1 -7
- package/package.json +2 -2
package/dist/helper/behaviors.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { ViewType, CellUnit } from '../config/default';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isNonWorkingTime = exports.getSummary = exports.getScrollSpecialDayjs = exports.getNonAgendaViewBodyCellBgColor = exports.getEventText = exports.getDateLabel = exports.getCustomDate = exports["default"] = void 0;
|
|
7
|
-
var _default2 = require("../config/default");
|
|
8
3
|
// getSummary func example
|
|
9
4
|
// export const getSummary = (schedulerData, headerEvents, slotId, slotName, headerStart, headerEnd) => ({ text: 'Summary', color: 'red', fontSize: '1.2rem' });
|
|
10
|
-
var getSummary =
|
|
5
|
+
export var getSummary = function getSummary() {
|
|
11
6
|
return {
|
|
12
7
|
text: 'Summary',
|
|
13
8
|
color: 'red',
|
|
@@ -16,27 +11,27 @@ var getSummary = exports.getSummary = function getSummary() {
|
|
|
16
11
|
};
|
|
17
12
|
|
|
18
13
|
// getCustomDate example
|
|
19
|
-
var getCustomDate =
|
|
14
|
+
export var getCustomDate = function getCustomDate(schedulerData, num) {
|
|
20
15
|
var date = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : schedulerData.startDate;
|
|
21
16
|
var viewType = schedulerData.viewType,
|
|
22
17
|
localeDayjs = schedulerData.localeDayjs;
|
|
23
18
|
var startDate;
|
|
24
19
|
var endDate;
|
|
25
20
|
var cellUnit;
|
|
26
|
-
if (viewType ===
|
|
21
|
+
if (viewType === ViewType.Custom1) {
|
|
27
22
|
var monday = localeDayjs(new Date(date)).startOf('week');
|
|
28
23
|
startDate = num === 0 ? monday : localeDayjs(new Date(monday)).add(2 * num, 'weeks');
|
|
29
24
|
endDate = localeDayjs(new Date(startDate)).add(1, 'weeks').endOf('week');
|
|
30
|
-
cellUnit =
|
|
31
|
-
} else if (viewType ===
|
|
25
|
+
cellUnit = CellUnit.Day;
|
|
26
|
+
} else if (viewType === ViewType.Custom2) {
|
|
32
27
|
var firstDayOfMonth = localeDayjs(new Date(date)).startOf('month');
|
|
33
28
|
startDate = num === 0 ? firstDayOfMonth : localeDayjs(new Date(firstDayOfMonth)).add(2 * num, 'months');
|
|
34
29
|
endDate = localeDayjs(new Date(startDate)).add(1, 'months').endOf('month');
|
|
35
|
-
cellUnit =
|
|
30
|
+
cellUnit = CellUnit.Day;
|
|
36
31
|
} else {
|
|
37
32
|
startDate = num === 0 ? date : localeDayjs(new Date(date)).add(2 * num, 'days');
|
|
38
33
|
endDate = localeDayjs(new Date(startDate)).add(1, 'days');
|
|
39
|
-
cellUnit =
|
|
34
|
+
cellUnit = CellUnit.Hour;
|
|
40
35
|
}
|
|
41
36
|
return {
|
|
42
37
|
startDate: startDate,
|
|
@@ -46,52 +41,52 @@ var getCustomDate = exports.getCustomDate = function getCustomDate(schedulerData
|
|
|
46
41
|
};
|
|
47
42
|
|
|
48
43
|
// getNonAgendaViewBodyCellBgColor example
|
|
49
|
-
var getNonAgendaViewBodyCellBgColor =
|
|
44
|
+
export var getNonAgendaViewBodyCellBgColor = function getNonAgendaViewBodyCellBgColor(schedulerData, slotId, header) {
|
|
50
45
|
return header.nonWorkingTime ? undefined : '#87e8de';
|
|
51
46
|
};
|
|
52
47
|
|
|
53
48
|
// getDateLabel func example
|
|
54
|
-
var getDateLabel =
|
|
49
|
+
export var getDateLabel = function getDateLabel(schedulerData, viewType, startDate, endDate) {
|
|
55
50
|
var localeDayjs = schedulerData.localeDayjs;
|
|
56
51
|
var start = localeDayjs(new Date(startDate));
|
|
57
52
|
var end = localeDayjs(endDate);
|
|
58
53
|
var dateLabel = '';
|
|
59
|
-
if (viewType ===
|
|
54
|
+
if (viewType === ViewType.Week || start !== end && (viewType === ViewType.Custom || viewType === ViewType.Custom1 || viewType === ViewType.Custom2)) {
|
|
60
55
|
dateLabel = "".concat(start.format('MMM D'), "-").concat(end.format('D, YYYY'));
|
|
61
56
|
if (start.month() !== end.month()) dateLabel = "".concat(start.format('MMM D'), "-").concat(end.format('MMM D, YYYY'));
|
|
62
57
|
if (start.year() !== end.year()) dateLabel = "".concat(start.format('MMM D, YYYY'), "-").concat(end.format('MMM D, YYYY'));
|
|
63
|
-
} else if (viewType ===
|
|
58
|
+
} else if (viewType === ViewType.Month) {
|
|
64
59
|
dateLabel = start.format('MMMM YYYY');
|
|
65
|
-
} else if (viewType ===
|
|
60
|
+
} else if (viewType === ViewType.Quarter) {
|
|
66
61
|
dateLabel = "".concat(start.format('MMM D'), "-").concat(end.format('MMM D, YYYY'));
|
|
67
|
-
} else if (viewType ===
|
|
62
|
+
} else if (viewType === ViewType.Year) {
|
|
68
63
|
dateLabel = start.format('YYYY');
|
|
69
64
|
} else {
|
|
70
65
|
dateLabel = start.format('MMM D, YYYY');
|
|
71
66
|
}
|
|
72
67
|
return dateLabel;
|
|
73
68
|
};
|
|
74
|
-
var getEventText =
|
|
69
|
+
export var getEventText = function getEventText(schedulerData, event) {
|
|
75
70
|
var _schedulerData$resour;
|
|
76
71
|
return schedulerData.isEventPerspective ? ((_schedulerData$resour = schedulerData.resources.find(function (item) {
|
|
77
72
|
return item.id === event.resourceId;
|
|
78
73
|
})) === null || _schedulerData$resour === void 0 ? void 0 : _schedulerData$resour.name) || event.title : event.title;
|
|
79
74
|
};
|
|
80
|
-
var getScrollSpecialDayjs =
|
|
75
|
+
export var getScrollSpecialDayjs = function getScrollSpecialDayjs(schedulerData) {
|
|
81
76
|
var localeDayjs = schedulerData.localeDayjs;
|
|
82
77
|
return localeDayjs(new Date());
|
|
83
78
|
};
|
|
84
|
-
var isNonWorkingTime =
|
|
79
|
+
export var isNonWorkingTime = function isNonWorkingTime(schedulerData, time) {
|
|
85
80
|
var localeDayjs = schedulerData.localeDayjs,
|
|
86
81
|
cellUnit = schedulerData.cellUnit;
|
|
87
|
-
if (cellUnit ===
|
|
82
|
+
if (cellUnit === CellUnit.Hour) {
|
|
88
83
|
var hour = localeDayjs(new Date(time)).hour();
|
|
89
84
|
return hour < 9 || hour > 18;
|
|
90
85
|
}
|
|
91
86
|
var dayOfWeek = localeDayjs(new Date(time)).weekday();
|
|
92
87
|
return dayOfWeek === 0 || dayOfWeek === 6;
|
|
93
88
|
};
|
|
94
|
-
|
|
89
|
+
export default {
|
|
95
90
|
getSummaryFunc: undefined,
|
|
96
91
|
getCustomDateFunc: undefined,
|
|
97
92
|
getNonAgendaViewBodyCellBgColorFunc: undefined,
|
package/dist/helper/utility.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
exports.getPos = getPos;
|
|
8
1
|
function getPos(element) {
|
|
9
2
|
var x = 0;
|
|
10
3
|
var y = 0;
|
|
@@ -19,4 +12,5 @@ function getPos(element) {
|
|
|
19
12
|
y: y
|
|
20
13
|
};
|
|
21
14
|
}
|
|
22
|
-
|
|
15
|
+
export { getPos };
|
|
16
|
+
export default getPos;
|
package/dist/index.js
CHANGED
|
@@ -1,78 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "AddMorePopover", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _index.AddMorePopover;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "CellUnit", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _index.CellUnit;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "DATETIME_FORMAT", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _index.DATETIME_FORMAT;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "DATE_FORMAT", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _index.DATE_FORMAT;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "DemoData", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _index.DemoData;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "DnDContext", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function get() {
|
|
39
|
-
return _index.DnDContext;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "DnDSource", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function get() {
|
|
45
|
-
return _index.DnDSource;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "Scheduler", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function get() {
|
|
51
|
-
return _index.Scheduler;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "SchedulerData", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function get() {
|
|
57
|
-
return _index.SchedulerData;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(exports, "SummaryPos", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function get() {
|
|
63
|
-
return _index.SummaryPos;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(exports, "ViewType", {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function get() {
|
|
69
|
-
return _index.ViewType;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(exports, "wrapperFun", {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function get() {
|
|
75
|
-
return _index.wrapperFun;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
var _index = require("./components/index");
|
|
1
|
+
export { AddMorePopover, CellUnit, DATE_FORMAT, DATETIME_FORMAT, DnDContext, DnDSource, DemoData, Scheduler, SchedulerData, SummaryPos, ViewType, wrapperFun } from './components/index';
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
1
|
var DemoData = {
|
|
8
2
|
resources: [{
|
|
9
3
|
id: 'r0',
|
|
@@ -334,4 +328,4 @@ var DemoData = {
|
|
|
334
328
|
type: 3
|
|
335
329
|
}]
|
|
336
330
|
};
|
|
337
|
-
|
|
331
|
+
export default DemoData;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-big-schedule",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.3",
|
|
4
4
|
"description": "React Big Schedule is a powerful and intuitive scheduler and resource planning solution built with React. Seamlessly integrate this modern browser-compatible component into your applications to effectively manage time, appointments, and resources. With drag-and-drop functionality, interactive UI, and granular views, react-big-schedule empowers users to effortlessly schedule and allocate resources with precision. Enhance productivity and streamline your workflow with this React-based solution, designed to optimize time management and simplify calendar-based operations. Perfect for applications requiring advanced scheduling capabilities, react-big-schedule offers a seamless and intuitive experience for managing appointments, resource allocation, and time slots. Unlock the potential of your React projects with react-big-schedule and revolutionize the way you handle scheduling and resource planning. It is the updated version of react-big-scheduler",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-big-schedule",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"scripts": {
|
|
56
56
|
"start": "vite",
|
|
57
57
|
"build": "vite build",
|
|
58
|
-
"build-lib": "node scripts/build.
|
|
58
|
+
"build-lib": "node scripts/build.js",
|
|
59
59
|
"clean": "rimraf ./dist && mkdir dist",
|
|
60
60
|
"lint": "eslint ./src"
|
|
61
61
|
},
|