react-big-schedule 8.1.0 → 9.0.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 +20 -1129
- package/dist/calendar/Calendar.d.ts +28 -0
- package/dist/calendar/Calendar.js +95 -0
- package/dist/calendar/Toolbar.d.ts +18 -0
- package/dist/calendar/Toolbar.js +6 -0
- package/dist/calendar/recurrence.check.d.ts +1 -0
- package/dist/calendar/recurrence.check.js +49 -0
- package/dist/calendar/recurrence.d.ts +8 -0
- package/dist/calendar/recurrence.js +90 -0
- package/dist/calendar/timezone.d.ts +6 -0
- package/dist/calendar/timezone.js +14 -0
- package/dist/calendar/types.d.ts +187 -0
- package/dist/calendar/types.js +1 -0
- package/dist/calendar/useEventSources.d.ts +11 -0
- package/dist/calendar/useEventSources.js +89 -0
- package/dist/calendar/useRecurrence.d.ts +4 -0
- package/dist/calendar/useRecurrence.js +15 -0
- package/dist/calendar/utils.d.ts +38 -0
- package/dist/calendar/utils.js +143 -0
- package/dist/calendar/views/DayGridView.d.ts +3 -0
- package/dist/calendar/views/DayGridView.js +375 -0
- package/dist/calendar/views/ListView.d.ts +4 -0
- package/dist/calendar/views/ListView.js +56 -0
- package/dist/calendar/views/MultiMonthView.d.ts +4 -0
- package/dist/calendar/views/MultiMonthView.js +36 -0
- package/dist/calendar/views/TimeGridView.d.ts +3 -0
- package/dist/calendar/views/TimeGridView.js +334 -0
- package/dist/calendar/views/daygrid/DayCell.d.ts +19 -0
- package/dist/calendar/views/daygrid/DayCell.js +17 -0
- package/dist/calendar/views/daygrid/EventChip.d.ts +19 -0
- package/dist/calendar/views/daygrid/EventChip.js +40 -0
- package/dist/calendar/views/daygrid/layout.d.ts +30 -0
- package/dist/calendar/views/daygrid/layout.js +63 -0
- package/dist/calendar/views/list/bucket.d.ts +8 -0
- package/dist/calendar/views/list/bucket.js +37 -0
- package/dist/calendar/views/multimonth/Cell.d.ts +12 -0
- package/dist/calendar/views/multimonth/Cell.js +44 -0
- package/dist/calendar/views/multimonth/Continuous.d.ts +8 -0
- package/dist/calendar/views/multimonth/Continuous.js +28 -0
- package/dist/calendar/views/multimonth/MonthGrid.d.ts +10 -0
- package/dist/calendar/views/multimonth/MonthGrid.js +36 -0
- package/dist/calendar/views/multimonth/shared.d.ts +27 -0
- package/dist/calendar/views/multimonth/shared.js +40 -0
- package/dist/calendar/views/timegrid/DayColumn.d.ts +49 -0
- package/dist/calendar/views/timegrid/DayColumn.js +86 -0
- package/dist/calendar/views/timegrid/model.d.ts +55 -0
- package/dist/calendar/views/timegrid/model.js +102 -0
- package/dist/components/AddMore.d.ts +13 -0
- package/dist/components/AddMore.js +9 -42
- package/dist/components/AddMorePopover.d.ts +13 -0
- package/dist/components/AddMorePopover.js +24 -95
- package/dist/components/AgendaEventItem.d.ts +10 -0
- package/dist/components/AgendaEventItem.js +33 -81
- package/dist/components/AgendaResourceEvents.d.ts +10 -0
- package/dist/components/AgendaResourceEvents.js +37 -91
- package/dist/components/AgendaView.d.ts +9 -0
- package/dist/components/AgendaView.js +10 -69
- package/dist/components/BodyView.d.ts +11 -0
- package/dist/components/BodyView.js +36 -67
- package/dist/components/DnDContext.d.ts +48 -0
- package/dist/components/DnDContext.js +200 -221
- package/dist/components/DnDSource.d.ts +49 -0
- package/dist/components/DnDSource.js +125 -120
- package/dist/components/EventItem.d.ts +41 -0
- package/dist/components/EventItem.js +585 -787
- package/dist/components/EventItemPopover.d.ts +12 -0
- package/dist/components/EventItemPopover.js +19 -143
- package/dist/components/HeaderView.d.ts +14 -0
- package/dist/components/HeaderView.js +123 -186
- package/dist/components/ResourceEvents.d.ts +54 -0
- package/dist/components/ResourceEvents.js +534 -703
- package/dist/components/ResourceView.d.ts +26 -0
- package/dist/components/ResourceView.js +64 -184
- package/dist/components/SchedulerData.d.ts +136 -0
- package/dist/components/SchedulerData.js +1296 -1226
- package/dist/components/SchedulerHeader.d.ts +25 -0
- package/dist/components/SchedulerHeader.js +50 -150
- package/dist/components/SelectedArea.d.ts +8 -0
- package/dist/components/SelectedArea.js +11 -26
- package/dist/components/Summary.d.ts +11 -0
- package/dist/components/Summary.js +21 -50
- package/dist/components/WrapperFun.d.ts +2 -0
- package/dist/components/WrapperFun.js +5 -10
- package/dist/components/index.d.ts +44 -0
- package/dist/components/index.js +428 -654
- package/dist/components/ui/Icons.d.ts +8 -0
- package/dist/components/ui/Icons.js +7 -0
- package/dist/components/ui/MiniCalendar.d.ts +9 -0
- package/dist/components/ui/MiniCalendar.js +17 -0
- package/dist/components/ui/Popover.d.ts +13 -0
- package/dist/components/ui/Popover.js +80 -0
- package/dist/config/default.d.ts +36 -0
- package/dist/config/default.js +17 -26
- package/dist/config/i18n.d.ts +27 -0
- package/dist/config/i18n.js +21 -37
- package/dist/config/scheduler.d.ts +12 -0
- package/dist/config/scheduler.js +126 -119
- package/dist/css/style.css +2 -316
- package/dist/helper/behaviors.d.ts +14 -0
- package/dist/helper/behaviors.js +75 -75
- package/dist/helper/utility.d.ts +26 -0
- package/dist/helper/utility.js +23 -30
- package/dist/index.d.ts +6 -477
- package/dist/index.js +4 -2
- package/dist/sample-data/sample1.d.ts +11 -0
- package/dist/sample-data/sample1.js +427 -372
- package/dist/types.d.ts +267 -0
- package/dist/types.js +1 -0
- package/package.json +35 -26
|
@@ -1,373 +1,428 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
// The sample events are written for the week starting Monday 2022-12-19; createDemoData shifts them to any other week.
|
|
3
|
+
const BASE_MONDAY = dayjs('2022-12-19');
|
|
4
|
+
const BASE = {
|
|
5
|
+
resources: [
|
|
6
|
+
{ id: 'r0', name: 'Resource0', title: 'Resource 0', groupOnly: true },
|
|
7
|
+
{ id: 'r1', name: 'Resource1', title: 'Resource 1', parentId: 'r0' },
|
|
8
|
+
{ id: 'r2', name: 'Resource2', parentId: 'r3' },
|
|
9
|
+
{ id: 'r3', name: 'Resource3', parentId: 'r1' },
|
|
10
|
+
{ id: 'r4', name: 'Resource4' },
|
|
11
|
+
{ id: 'r5', name: 'Resource5' },
|
|
12
|
+
{ id: 'r6', name: 'Resource6' },
|
|
13
|
+
{ id: 'r7', name: 'Resource7' },
|
|
14
|
+
],
|
|
15
|
+
events: [
|
|
16
|
+
{
|
|
17
|
+
id: 1,
|
|
18
|
+
start: '2022-12-18 09:30:00',
|
|
19
|
+
end: '2022-12-19 23:30:00',
|
|
20
|
+
resourceId: 'r1',
|
|
21
|
+
title: 'I am finished',
|
|
22
|
+
bgColor: '#D9D9D9',
|
|
23
|
+
showPopover: false,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 2,
|
|
27
|
+
start: '2022-12-18 12:30:00',
|
|
28
|
+
end: '2022-12-26 23:30:00',
|
|
29
|
+
resourceId: 'r2',
|
|
30
|
+
title: 'I am not resizable',
|
|
31
|
+
resizable: false,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 3,
|
|
35
|
+
start: '2022-12-19 12:30:00',
|
|
36
|
+
end: '2022-12-20 23:30:00',
|
|
37
|
+
resourceId: 'r3',
|
|
38
|
+
title: 'I am not movable',
|
|
39
|
+
movable: false,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: 4,
|
|
43
|
+
start: '2022-12-19 14:30:00',
|
|
44
|
+
end: '2022-12-20 23:30:00',
|
|
45
|
+
resourceId: 'r4',
|
|
46
|
+
title: 'I am not start-resizable',
|
|
47
|
+
startResizable: false,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 5,
|
|
51
|
+
start: '2022-12-19 15:30:00',
|
|
52
|
+
end: '2022-12-20 23:30:00',
|
|
53
|
+
resourceId: 'r5',
|
|
54
|
+
title: 'I am not end-resizable',
|
|
55
|
+
endResizable: false,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 6,
|
|
59
|
+
start: '2022-12-19 15:35:00',
|
|
60
|
+
end: '2022-12-19 23:30:00',
|
|
61
|
+
resourceId: 'r6',
|
|
62
|
+
title: 'I am normal',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 7,
|
|
66
|
+
start: '2022-12-19 15:40:00',
|
|
67
|
+
end: '2022-12-20 23:30:00',
|
|
68
|
+
resourceId: 'r7',
|
|
69
|
+
title: 'I am exceptional',
|
|
70
|
+
bgColor: '#FA9E95',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 8,
|
|
74
|
+
start: '2022-12-19 15:50:00',
|
|
75
|
+
end: '2022-12-19 23:30:00',
|
|
76
|
+
resourceId: 'r1',
|
|
77
|
+
title: 'I am locked',
|
|
78
|
+
movable: false,
|
|
79
|
+
resizable: false,
|
|
80
|
+
bgColor: 'red',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 9,
|
|
84
|
+
start: '2022-12-19 16:30:00',
|
|
85
|
+
end: '2022-12-27 23:30:00',
|
|
86
|
+
resourceId: 'r1',
|
|
87
|
+
title: 'R1 has many tasks 1',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 10,
|
|
91
|
+
start: '2022-12-19 17:30:00',
|
|
92
|
+
end: '2022-12-19 23:30:00',
|
|
93
|
+
resourceId: 'r1',
|
|
94
|
+
title: 'R1 has recurring tasks every week on Tuesday, Friday',
|
|
95
|
+
rrule: 'FREQ=WEEKLY;DTSTART=20221219T013000Z;BYDAY=TU,FR',
|
|
96
|
+
bgColor: '#f759ab',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 11,
|
|
100
|
+
start: '2022-12-19 18:30:00',
|
|
101
|
+
end: '2022-12-20 23:30:00',
|
|
102
|
+
resourceId: 'r1',
|
|
103
|
+
title: 'R1 has many tasks 3',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: 12,
|
|
107
|
+
start: '2022-12-20 18:30:00',
|
|
108
|
+
end: '2022-12-20 23:30:00',
|
|
109
|
+
resourceId: 'r1',
|
|
110
|
+
title: 'R1 has many tasks 4',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: 13,
|
|
114
|
+
start: '2022-12-21 18:30:00',
|
|
115
|
+
end: '2022-12-24 23:30:00',
|
|
116
|
+
resourceId: 'r1',
|
|
117
|
+
title: 'R1 has many tasks 5',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 14,
|
|
121
|
+
start: '2022-12-23 18:30:00',
|
|
122
|
+
end: '2022-12-27 23:30:00',
|
|
123
|
+
resourceId: 'r1',
|
|
124
|
+
title: 'R1 has many tasks 6',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: 15,
|
|
128
|
+
start: '2022-12-06',
|
|
129
|
+
end: '2022-12-09',
|
|
130
|
+
resourceId: 'r3',
|
|
131
|
+
title: 'SAMPLE TASK (DATE-ONLY FORMAT)',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: 16,
|
|
135
|
+
start: '2022-12-12',
|
|
136
|
+
end: '2022-12-14',
|
|
137
|
+
resourceId: 'r3',
|
|
138
|
+
title: 'SAMPLE TASK (DATE-ONLY FORMAT)',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: 17,
|
|
142
|
+
resourceId: 'r4',
|
|
143
|
+
title: '#198 Sat→Mon',
|
|
144
|
+
start: '2022-12-17 23:00:00',
|
|
145
|
+
end: '2022-12-19 09:00:00',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: 18,
|
|
149
|
+
resourceId: 'r5',
|
|
150
|
+
title: '#198 Sun→Mon',
|
|
151
|
+
start: '2022-12-18 10:00:00',
|
|
152
|
+
end: '2022-12-19 10:00:00',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: 19,
|
|
156
|
+
resourceId: 'r6',
|
|
157
|
+
title: '#198 prev-month carry',
|
|
158
|
+
start: '2022-11-30 10:00:00',
|
|
159
|
+
end: '2022-12-15 10:00:00',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
id: 20,
|
|
163
|
+
resourceId: 'r7',
|
|
164
|
+
title: '#198 month boundary',
|
|
165
|
+
start: '2022-11-30 10:00:00',
|
|
166
|
+
end: '2022-12-02 10:00:00',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: 21,
|
|
170
|
+
resourceId: 'r4',
|
|
171
|
+
title: '#112 short',
|
|
172
|
+
start: '2022-12-19 10:10:00',
|
|
173
|
+
end: '2022-12-19 11:20:00',
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
eventsForTaskView: [
|
|
177
|
+
{
|
|
178
|
+
id: 1,
|
|
179
|
+
start: '2022-12-18 09:30:00',
|
|
180
|
+
end: '2022-12-18 23:30:00',
|
|
181
|
+
resourceId: 'r1',
|
|
182
|
+
title: 'I am finished',
|
|
183
|
+
bgColor: '#D9D9D9',
|
|
184
|
+
groupId: 1,
|
|
185
|
+
groupName: 'Task1',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: 2,
|
|
189
|
+
start: '2022-12-18 12:30:00',
|
|
190
|
+
end: '2022-12-26 23:30:00',
|
|
191
|
+
resourceId: 'r2',
|
|
192
|
+
title: 'I am not resizable',
|
|
193
|
+
resizable: false,
|
|
194
|
+
groupId: 2,
|
|
195
|
+
groupName: 'Task2',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: 3,
|
|
199
|
+
start: '2022-12-19 12:30:00',
|
|
200
|
+
end: '2022-12-20 23:30:00',
|
|
201
|
+
resourceId: 'r3',
|
|
202
|
+
title: 'I am not movable',
|
|
203
|
+
movable: false,
|
|
204
|
+
groupId: 3,
|
|
205
|
+
groupName: 'Task3',
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: 7,
|
|
209
|
+
start: '2022-12-19 15:40:00',
|
|
210
|
+
end: '2022-12-20 23:30:00',
|
|
211
|
+
resourceId: 'r7',
|
|
212
|
+
title: 'I am exceptional',
|
|
213
|
+
bgColor: '#FA9E95',
|
|
214
|
+
groupId: 4,
|
|
215
|
+
groupName: 'Task4',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: 4,
|
|
219
|
+
start: '2022-12-20 14:30:00',
|
|
220
|
+
end: '2022-12-21 23:30:00',
|
|
221
|
+
resourceId: 'r4',
|
|
222
|
+
title: 'I am not start-resizable',
|
|
223
|
+
startResizable: false,
|
|
224
|
+
groupId: 1,
|
|
225
|
+
groupName: 'Task1',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: 5,
|
|
229
|
+
start: '2022-12-21 15:30:00',
|
|
230
|
+
end: '2022-12-22 23:30:00',
|
|
231
|
+
resourceId: 'r5',
|
|
232
|
+
title: 'I am not end-resizable',
|
|
233
|
+
endResizable: false,
|
|
234
|
+
groupId: 3,
|
|
235
|
+
groupName: 'Task3',
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
id: 9,
|
|
239
|
+
start: '2022-12-21 16:30:00',
|
|
240
|
+
end: '2022-12-21 23:30:00',
|
|
241
|
+
resourceId: 'r1',
|
|
242
|
+
title: 'R1 has many tasks',
|
|
243
|
+
groupId: 4,
|
|
244
|
+
groupName: 'Task4',
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
id: 6,
|
|
248
|
+
start: '2022-12-22 15:35:00',
|
|
249
|
+
end: '2022-12-23 23:30:00',
|
|
250
|
+
resourceId: 'r6',
|
|
251
|
+
title: 'I am normal',
|
|
252
|
+
groupId: 1,
|
|
253
|
+
groupName: 'Task1',
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: 8,
|
|
257
|
+
start: '2022-12-25 15:50:00',
|
|
258
|
+
end: '2022-12-26 23:30:00',
|
|
259
|
+
resourceId: 'r1',
|
|
260
|
+
title: 'I am locked',
|
|
261
|
+
movable: false,
|
|
262
|
+
resizable: false,
|
|
263
|
+
bgColor: 'red',
|
|
264
|
+
groupId: 1,
|
|
265
|
+
groupName: 'Task1',
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: 10,
|
|
269
|
+
start: '2022-12-26 18:30:00',
|
|
270
|
+
end: '2022-12-26 23:30:00',
|
|
271
|
+
resourceId: 'r2',
|
|
272
|
+
title: 'R2 has many tasks',
|
|
273
|
+
groupId: 4,
|
|
274
|
+
groupName: 'Task4',
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
id: 11,
|
|
278
|
+
start: '2022-12-27 18:30:00',
|
|
279
|
+
end: '2022-12-27 23:30:00',
|
|
280
|
+
resourceId: 'r4',
|
|
281
|
+
title: 'R4 has many tasks',
|
|
282
|
+
groupId: 4,
|
|
283
|
+
groupName: 'Task4',
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
id: 12,
|
|
287
|
+
start: '2022-12-28 18:30:00',
|
|
288
|
+
end: '2022-12-28 23:30:00',
|
|
289
|
+
resourceId: 'r6',
|
|
290
|
+
title: 'R6 has many tasks',
|
|
291
|
+
groupId: 3,
|
|
292
|
+
groupName: 'Task3',
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
eventsForCustomEventStyle: [
|
|
296
|
+
{
|
|
297
|
+
id: 1,
|
|
298
|
+
start: '2022-12-18 09:30:00',
|
|
299
|
+
end: '2022-12-19 23:30:00',
|
|
300
|
+
resourceId: 'r1',
|
|
301
|
+
title: 'I am finished',
|
|
302
|
+
bgColor: '#D9D9D9',
|
|
303
|
+
type: 1,
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
id: 2,
|
|
307
|
+
start: '2022-12-18 12:30:00',
|
|
308
|
+
end: '2022-12-26 23:30:00',
|
|
309
|
+
resourceId: 'r2',
|
|
310
|
+
title: 'I am not resizable',
|
|
311
|
+
resizable: false,
|
|
312
|
+
type: 2,
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
id: 3,
|
|
316
|
+
start: '2022-12-19 12:30:00',
|
|
317
|
+
end: '2022-12-20 23:30:00',
|
|
318
|
+
resourceId: 'r3',
|
|
319
|
+
title: 'I am not movable',
|
|
320
|
+
movable: false,
|
|
321
|
+
type: 3,
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
id: 4,
|
|
325
|
+
start: '2022-12-19 14:30:00',
|
|
326
|
+
end: '2022-12-20 23:30:00',
|
|
327
|
+
resourceId: 'r4',
|
|
328
|
+
title: 'I am not start-resizable',
|
|
329
|
+
startResizable: false,
|
|
330
|
+
type: 1,
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
id: 5,
|
|
334
|
+
start: '2022-12-19 15:30:00',
|
|
335
|
+
end: '2022-12-20 23:30:00',
|
|
336
|
+
resourceId: 'r5',
|
|
337
|
+
title: 'I am not end-resizable',
|
|
338
|
+
endResizable: false,
|
|
339
|
+
type: 2,
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
id: 6,
|
|
343
|
+
start: '2022-12-19 15:35:00',
|
|
344
|
+
end: '2022-12-19 23:30:00',
|
|
345
|
+
resourceId: 'r6',
|
|
346
|
+
title: 'I am normal',
|
|
347
|
+
type: 3,
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
id: 7,
|
|
351
|
+
start: '2022-12-19 15:40:00',
|
|
352
|
+
end: '2022-12-20 23:30:00',
|
|
353
|
+
resourceId: 'r7',
|
|
354
|
+
title: 'I am exceptional',
|
|
355
|
+
bgColor: '#FA9E95',
|
|
356
|
+
type: 1,
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
id: 8,
|
|
360
|
+
start: '2022-12-19 15:50:00',
|
|
361
|
+
end: '2022-12-19 23:30:00',
|
|
362
|
+
resourceId: 'r1',
|
|
363
|
+
title: 'I am locked',
|
|
364
|
+
movable: false,
|
|
365
|
+
resizable: false,
|
|
366
|
+
bgColor: 'red',
|
|
367
|
+
type: 2,
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
id: 9,
|
|
371
|
+
start: '2022-12-19 16:30:00',
|
|
372
|
+
end: '2022-12-27 23:30:00',
|
|
373
|
+
resourceId: 'r1',
|
|
374
|
+
title: 'R1 has many tasks 1',
|
|
375
|
+
type: 3,
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
id: 10,
|
|
379
|
+
start: '2022-12-20 18:30:00',
|
|
380
|
+
end: '2022-12-20 23:30:00',
|
|
381
|
+
resourceId: 'r1',
|
|
382
|
+
title: 'R1 has many tasks 2',
|
|
383
|
+
type: 1,
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
id: 11,
|
|
387
|
+
start: '2022-12-21 18:30:00',
|
|
388
|
+
end: '2022-12-22 23:30:00',
|
|
389
|
+
resourceId: 'r1',
|
|
390
|
+
title: 'R1 has many tasks 3',
|
|
391
|
+
type: 2,
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
id: 12,
|
|
395
|
+
start: '2022-12-23 18:30:00',
|
|
396
|
+
end: '2022-12-27 23:30:00',
|
|
397
|
+
resourceId: 'r1',
|
|
398
|
+
title: 'R1 has many tasks 4',
|
|
399
|
+
type: 3,
|
|
400
|
+
},
|
|
401
|
+
],
|
|
372
402
|
};
|
|
373
|
-
|
|
403
|
+
const FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
|
404
|
+
/** Sample resources and events moved to the week that contains `anchor` (default: today), so demos always show the current period. */
|
|
405
|
+
export function createDemoData(anchor = dayjs()) {
|
|
406
|
+
const a = dayjs(anchor);
|
|
407
|
+
const monday = a.subtract((a.day() + 6) % 7, 'day').startOf('day');
|
|
408
|
+
const delta = monday.diff(BASE_MONDAY, 'day');
|
|
409
|
+
const move = (value) => dayjs(value).add(delta, 'day').format(FORMAT);
|
|
410
|
+
const shift = (events) => events.map(e => ({
|
|
411
|
+
...e,
|
|
412
|
+
start: move(e.start),
|
|
413
|
+
end: move(e.end),
|
|
414
|
+
...(e.rrule
|
|
415
|
+
? {
|
|
416
|
+
rrule: e.rrule.replace(/DTSTART=(\d{8})T/, (_m, d) => `DTSTART=${dayjs(d).add(delta, 'day').format('YYYYMMDD')}T`),
|
|
417
|
+
}
|
|
418
|
+
: {}),
|
|
419
|
+
}));
|
|
420
|
+
return {
|
|
421
|
+
resources: BASE.resources,
|
|
422
|
+
events: shift(BASE.events),
|
|
423
|
+
eventsForTaskView: shift(BASE.eventsForTaskView),
|
|
424
|
+
eventsForCustomEventStyle: shift(BASE.eventsForCustomEventStyle),
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
const DemoData = createDemoData();
|
|
428
|
+
export default DemoData;
|