react-big-schedule 4.2.1 → 4.2.2
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/CHANGELOG.md +4 -2
- package/README.md +1005 -3
- package/dist/helper/behaviors.js +11 -9
- package/dist/helper/utility.js +6 -2
- package/package.json +4 -4
- package/dist/index.d.ts +0 -247
package/dist/helper/behaviors.js
CHANGED
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.isNonWorkingTime = exports.getSummary = exports.getScrollSpecialDayjs = exports.getNonAgendaViewBodyCellBgColor = exports.getEventText = exports.getDateLabel = exports.getCustomDate = exports["default"] = void 0;
|
|
7
7
|
var _components = require("../components");
|
|
8
|
-
//getSummary func example
|
|
9
|
-
|
|
8
|
+
// getSummary func example
|
|
9
|
+
// export const getSummary = (schedulerData, headerEvents, slotId, slotName, headerStart, headerEnd) => ({ text: 'Summary', color: 'red', fontSize: '1.2rem' });
|
|
10
|
+
var getSummary = function getSummary() {
|
|
10
11
|
return {
|
|
11
12
|
text: 'Summary',
|
|
12
13
|
color: 'red',
|
|
@@ -14,13 +15,15 @@ var getSummary = function getSummary(schedulerData, headerEvents, slotId, slotNa
|
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
17
|
|
|
17
|
-
//getCustomDate example
|
|
18
|
+
// getCustomDate example
|
|
18
19
|
exports.getSummary = getSummary;
|
|
19
20
|
var getCustomDate = function getCustomDate(schedulerData, num) {
|
|
20
21
|
var date = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : schedulerData.startDate;
|
|
21
22
|
var viewType = schedulerData.viewType,
|
|
22
23
|
localeDayjs = schedulerData.localeDayjs;
|
|
23
|
-
var startDate
|
|
24
|
+
var startDate;
|
|
25
|
+
var endDate;
|
|
26
|
+
var cellUnit;
|
|
24
27
|
if (viewType === _components.ViewType.Custom1) {
|
|
25
28
|
var monday = localeDayjs(new Date(date)).startOf('week');
|
|
26
29
|
startDate = num === 0 ? monday : localeDayjs(new Date(monday)).add(2 * num, 'weeks');
|
|
@@ -43,13 +46,13 @@ var getCustomDate = function getCustomDate(schedulerData, num) {
|
|
|
43
46
|
};
|
|
44
47
|
};
|
|
45
48
|
|
|
46
|
-
//getNonAgendaViewBodyCellBgColor example
|
|
49
|
+
// getNonAgendaViewBodyCellBgColor example
|
|
47
50
|
exports.getCustomDate = getCustomDate;
|
|
48
51
|
var getNonAgendaViewBodyCellBgColor = function getNonAgendaViewBodyCellBgColor(schedulerData, slotId, header) {
|
|
49
52
|
return header.nonWorkingTime ? undefined : '#87e8de';
|
|
50
53
|
};
|
|
51
54
|
|
|
52
|
-
//getDateLabel func example
|
|
55
|
+
// getDateLabel func example
|
|
53
56
|
exports.getNonAgendaViewBodyCellBgColor = getNonAgendaViewBodyCellBgColor;
|
|
54
57
|
var getDateLabel = function getDateLabel(schedulerData, viewType, startDate, endDate) {
|
|
55
58
|
var localeDayjs = schedulerData.localeDayjs;
|
|
@@ -90,10 +93,9 @@ var isNonWorkingTime = function isNonWorkingTime(schedulerData, time) {
|
|
|
90
93
|
if (cellUnit === _components.CellUnit.Hour) {
|
|
91
94
|
var hour = localeDayjs(new Date(time)).hour();
|
|
92
95
|
return hour < 9 || hour > 18;
|
|
93
|
-
} else {
|
|
94
|
-
var dayOfWeek = localeDayjs(new Date(time)).weekday();
|
|
95
|
-
return dayOfWeek === 0 || dayOfWeek === 6;
|
|
96
96
|
}
|
|
97
|
+
var dayOfWeek = localeDayjs(new Date(time)).weekday();
|
|
98
|
+
return dayOfWeek === 0 || dayOfWeek === 6;
|
|
97
99
|
};
|
|
98
100
|
exports.isNonWorkingTime = isNonWorkingTime;
|
|
99
101
|
var _default = {
|
package/dist/helper/utility.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = void 0;
|
|
7
7
|
function getPos(element) {
|
|
8
8
|
var x = 0;
|
|
9
9
|
var y = 0;
|
|
@@ -17,4 +17,8 @@ function getPos(element) {
|
|
|
17
17
|
x: x,
|
|
18
18
|
y: y
|
|
19
19
|
};
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
|
+
var _default = {
|
|
22
|
+
getPos: getPos
|
|
23
|
+
};
|
|
24
|
+
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-big-schedule",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.2",
|
|
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",
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@ant-design/icons": "^5.1.4",
|
|
60
|
-
"antd": "^5.6.
|
|
60
|
+
"antd": "^5.6.3",
|
|
61
61
|
"dayjs": "^1.11.8",
|
|
62
62
|
"prop-types": "^15.8.1",
|
|
63
63
|
"react": "^18.2.0",
|
|
64
64
|
"react-dnd": "^14.0.5",
|
|
65
65
|
"react-dnd-html5-backend": "^14.1.0",
|
|
66
66
|
"react-dom": "^18.2.0",
|
|
67
|
-
"rrule": "^2.7.
|
|
67
|
+
"rrule": "^2.7.1"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@babel/cli": "^7.22.5",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"fs-extra": "^11.1.1",
|
|
78
78
|
"html-webpack-plugin": "^5.5.3",
|
|
79
79
|
"style-loader": "^3.3.3",
|
|
80
|
-
"webpack": "^5.
|
|
80
|
+
"webpack": "^5.88.0",
|
|
81
81
|
"webpack-cli": "^5.1.4",
|
|
82
82
|
"webpack-dev-server": "^4.15.1"
|
|
83
83
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { Dayjs } from 'dayjs';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
export const DATE_FORMAT: string;
|
|
5
|
-
export const DATETIME_FORMAT: string;
|
|
6
|
-
|
|
7
|
-
export class Scheduler<T extends EventItem = EventItem> extends React.Component<SchedulerProps<T>, any> {}
|
|
8
|
-
export class SchedulerData {}
|
|
9
|
-
|
|
10
|
-
export enum ViewType {
|
|
11
|
-
Day = 'Day',
|
|
12
|
-
Week = 'Week',
|
|
13
|
-
Month = 'Month',
|
|
14
|
-
Quarter = 'Quarter',
|
|
15
|
-
Year = 'Year',
|
|
16
|
-
Custom = 'Custom',
|
|
17
|
-
Custom1 = 'Custom1',
|
|
18
|
-
Custom2 = 'Custom2',
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export enum CellUnit {
|
|
22
|
-
Day = 'Day',
|
|
23
|
-
Hour = 'Hour',
|
|
24
|
-
Week = 'Week',
|
|
25
|
-
Month = 'Month',
|
|
26
|
-
Year = 'Year',
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export enum SummaryPos {
|
|
30
|
-
Top = 'Top',
|
|
31
|
-
TopRight = 'TopRight',
|
|
32
|
-
TopLeft = 'TopLeft',
|
|
33
|
-
Bottom = 'Bottom',
|
|
34
|
-
BottomRight = 'BottomRight',
|
|
35
|
-
BottomLeft = 'BottomLeft',
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export class DnDSource {}
|
|
39
|
-
export class DnDContext {}
|
|
40
|
-
export class AddMorePopover extends React.Component<AddMorePopoverProps, any> {}
|
|
41
|
-
export class DemoData {}
|
|
42
|
-
export function wrapperFun(): void {}
|
|
43
|
-
|
|
44
|
-
export interface SchedulerProps<T extends EventItem = EventItem> {}
|
|
45
|
-
export interface AddMorePopoverProps {}
|
|
46
|
-
export class SchedulerData {}
|
|
47
|
-
|
|
48
|
-
export interface View {
|
|
49
|
-
viewName?: string;
|
|
50
|
-
viewType: ViewType;
|
|
51
|
-
showAgenda: boolean;
|
|
52
|
-
isEventPerspective: boolean;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface EventGroup {
|
|
56
|
-
id: string;
|
|
57
|
-
name: string;
|
|
58
|
-
state: EventItem;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface EventItem {
|
|
62
|
-
id: number | string;
|
|
63
|
-
start: string;
|
|
64
|
-
end: string;
|
|
65
|
-
resourceId: string;
|
|
66
|
-
title: string;
|
|
67
|
-
bgColor?: string;
|
|
68
|
-
rrule?: string;
|
|
69
|
-
showPopover?: boolean;
|
|
70
|
-
resizable?: boolean;
|
|
71
|
-
movable?: boolean;
|
|
72
|
-
startResizable?: boolean;
|
|
73
|
-
endResizable?: boolean;
|
|
74
|
-
groupId?: string;
|
|
75
|
-
groupName?: string;
|
|
76
|
-
/**
|
|
77
|
-
* @deprecated This property should not be used as EXRULE has been [deprecated in RFC 5545](https://icalendar.org/iCalendar-RFC-5545/a-3-deprecated-features.html) and does not support a DTSTART property
|
|
78
|
-
*/
|
|
79
|
-
exrule?: string;
|
|
80
|
-
exdates: string[];
|
|
81
|
-
[x: string]: unknown;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface ResourceEvent {
|
|
85
|
-
id: number;
|
|
86
|
-
name: string;
|
|
87
|
-
parentId?: string;
|
|
88
|
-
groupOnly?: boolean;
|
|
89
|
-
hasSummary?: boolean;
|
|
90
|
-
expanded?: boolean;
|
|
91
|
-
headerItems?: EventItem[];
|
|
92
|
-
render?: boolean;
|
|
93
|
-
rowHeight: number;
|
|
94
|
-
rowMaxCount: number;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface Resource {
|
|
98
|
-
id: string;
|
|
99
|
-
name: string;
|
|
100
|
-
parentId?: string;
|
|
101
|
-
groupOnly?: boolean;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface HeaderItem {
|
|
105
|
-
time: string;
|
|
106
|
-
start: string;
|
|
107
|
-
end: string;
|
|
108
|
-
addMore: number;
|
|
109
|
-
addMoreIndex: number;
|
|
110
|
-
count: number;
|
|
111
|
-
nonWorkingTime: boolean;
|
|
112
|
-
events: EventItem[];
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export interface HeaderEvent {
|
|
116
|
-
render: boolean;
|
|
117
|
-
span: number;
|
|
118
|
-
eventItem: EventItem;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export interface State {
|
|
122
|
-
headerItem: HeaderItem;
|
|
123
|
-
left: number;
|
|
124
|
-
top: number;
|
|
125
|
-
height: number;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export interface SchedulerDataConfig {
|
|
129
|
-
schedulerWidth?: `${number}%`;
|
|
130
|
-
besidesWidth?: number;
|
|
131
|
-
schedulerMaxHeight?: number;
|
|
132
|
-
tableHeaderHeight?: number;
|
|
133
|
-
schedulerContentHeight?: string | number;
|
|
134
|
-
agendaResourceTableWidth?: string | number;
|
|
135
|
-
agendaMaxEventWidth?: string | number;
|
|
136
|
-
dayResourceTableWidth?: string | number;
|
|
137
|
-
weekResourceTableWidth?: string | number;
|
|
138
|
-
monthResourceTableWidth?: string | number;
|
|
139
|
-
quarterResourceTableWidth?: string | number;
|
|
140
|
-
yearResourceTableWidth?: string | number;
|
|
141
|
-
customResourceTableWidth?: string | number;
|
|
142
|
-
dayCellWidth?: string | number;
|
|
143
|
-
weekCellWidth?: string | number;
|
|
144
|
-
monthCellWidth?: string | number;
|
|
145
|
-
quarterCellWidth?: string | number;
|
|
146
|
-
yearCellWidth?: string | number;
|
|
147
|
-
customCellWidth?: string | number;
|
|
148
|
-
dayMaxEvents?: number;
|
|
149
|
-
weekMaxEvents?: number;
|
|
150
|
-
monthMaxEvents?: number;
|
|
151
|
-
quarterMaxEvents?: number;
|
|
152
|
-
yearMaxEvents?: number;
|
|
153
|
-
customMaxEvents?: number;
|
|
154
|
-
eventItemPopoverTrigger?: 'hover' | 'click';
|
|
155
|
-
eventItemPopoverPlacement?:
|
|
156
|
-
| 'topLeftMousePosition'
|
|
157
|
-
| 'bottomLeftMousePosition'
|
|
158
|
-
| 'topRightMousePosition'
|
|
159
|
-
| 'bottomRightMousePosition'
|
|
160
|
-
| 'top'
|
|
161
|
-
| 'left'
|
|
162
|
-
| 'right'
|
|
163
|
-
| 'bottom'
|
|
164
|
-
| 'topLeft'
|
|
165
|
-
| 'topRight'
|
|
166
|
-
| 'bottomLeft'
|
|
167
|
-
| 'bottomRight'
|
|
168
|
-
| 'leftTop'
|
|
169
|
-
| 'leftBottom'
|
|
170
|
-
| 'rightTop'
|
|
171
|
-
| 'rightBottom';
|
|
172
|
-
eventItemPopoverWidth?: number;
|
|
173
|
-
eventItemHeight?: number;
|
|
174
|
-
eventItemLineHeight?: number;
|
|
175
|
-
nonAgendaSlotMinHeight?: number;
|
|
176
|
-
dayStartFrom?: number;
|
|
177
|
-
dayStopTo?: number;
|
|
178
|
-
defaultEventBgColor?: string;
|
|
179
|
-
selectedAreaColor?: string;
|
|
180
|
-
nonWorkingTimeHeadColor?: string;
|
|
181
|
-
nonWorkingTimeHeadBgColor?: string;
|
|
182
|
-
nonWorkingTimeBodyBgColor?: string;
|
|
183
|
-
summaryColor?: string;
|
|
184
|
-
summaryPos?: SummaryPos;
|
|
185
|
-
groupOnlySlotColor?: string;
|
|
186
|
-
startResizable?: boolean;
|
|
187
|
-
endResizable?: boolean;
|
|
188
|
-
movable?: boolean;
|
|
189
|
-
creatable?: boolean;
|
|
190
|
-
crossResourceMove?: boolean;
|
|
191
|
-
checkConflict?: boolean;
|
|
192
|
-
scrollToSpecialDaysjsEnabled?: boolean;
|
|
193
|
-
eventItemPopoverEnabled?: boolean;
|
|
194
|
-
calendarPopoverEnabled?: boolean;
|
|
195
|
-
recurringEventsEnabled?: boolean;
|
|
196
|
-
viewChangeSpinEnabled?: boolean;
|
|
197
|
-
dateChangeSpinEnabled?: boolean;
|
|
198
|
-
headerEnabled?: boolean;
|
|
199
|
-
resourceViewEnabled?: boolean;
|
|
200
|
-
displayWeekend?: boolean;
|
|
201
|
-
relativeMove?: boolean;
|
|
202
|
-
defaultExpanded?: boolean;
|
|
203
|
-
dragAndDropEnabled?: boolean;
|
|
204
|
-
schedulerHeaderEventsFuncsTimeoutMs?: number;
|
|
205
|
-
resourceName?: string;
|
|
206
|
-
taskName?: string;
|
|
207
|
-
agendaViewHeader?: string;
|
|
208
|
-
addMorePopoverHeaderFormat?: string;
|
|
209
|
-
eventItemPopoverDateFormat?: string;
|
|
210
|
-
nonAgendaDayCellHeaderFormat?: string;
|
|
211
|
-
nonAgendaOtherCellHeaderFormat?: string;
|
|
212
|
-
minuteStep?: number;
|
|
213
|
-
views?: View[];
|
|
214
|
-
responsiveByParent?: boolean;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export interface SchedulerDataBehaviors {
|
|
218
|
-
isNonWorkingTimeFunc?: (schedulerData: SchedulerData, time: string) => boolean;
|
|
219
|
-
getCustomDateFunc?: (schedulerData: SchedulerData, num: number, date?: string | Dayjs) => { startDate: string | Dayjs; endDate: string | Dayjs; cellUnit: CellUnit };
|
|
220
|
-
getEventTextFunc?: (schedulerData: SchedulerData, event: EventItem) => string;
|
|
221
|
-
getDateLabel?: (schedulerData: SchedulerData, viewType: ViewType, startDate: string | Date, endDate: string | Date) => string;
|
|
222
|
-
getScrollSpecialDayjs?: (schedulerData: SchedulerData, startDayjs: Dayjs, endDays: Dayjs) => Dayjs;
|
|
223
|
-
getSummaryFunc?: (
|
|
224
|
-
schedulerData: SchedulerData,
|
|
225
|
-
headerEvents: HeaderEvent[],
|
|
226
|
-
slotId: string,
|
|
227
|
-
slotName: string,
|
|
228
|
-
headerStart: string,
|
|
229
|
-
headerEnd: string
|
|
230
|
-
) => { text: string; color: string; fontSize: string };
|
|
231
|
-
getNonAgendaViewBodyCellBgColorFunc?: (schedulerData: SchedulerData, slotId: string, header: { nonWorkingTime: boolean; time: string }) => string;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export {
|
|
235
|
-
DATE_FORMAT,
|
|
236
|
-
DATETIME_FORMAT,
|
|
237
|
-
Scheduler,
|
|
238
|
-
SchedulerData,
|
|
239
|
-
ViewType,
|
|
240
|
-
CellUnit,
|
|
241
|
-
SummaryPos,
|
|
242
|
-
DnDSource,
|
|
243
|
-
DnDContext,
|
|
244
|
-
AddMorePopover,
|
|
245
|
-
DemoData,
|
|
246
|
-
wrapperFun,
|
|
247
|
-
} from './components/index';
|