@isma91/react-scheduler 4.0.2 → 4.0.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/README.md +1 -0
- package/index.js +982 -974
- package/package.json +1 -1
- package/store/default.d.ts +2 -0
- package/store/types.d.ts +7 -0
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { isWithinInterval as j, endOfDay as q, startOfDay as X, format as N, isSameDay as ye, isBefore as me, isAfter as
|
|
4
|
-
import { useTheme as
|
|
1
|
+
import { jsxs as E, jsx as r, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as yt, useContext as mt, useMemo as U, useState as L, Fragment as ie, useRef as rt, useEffect as K, useCallback as Z, forwardRef as _t } from "react";
|
|
3
|
+
import { isWithinInterval as j, endOfDay as q, startOfDay as X, format as N, isSameDay as ye, isBefore as me, isAfter as Me, differenceInDays as vt, addSeconds as Zt, subMinutes as qt, addMinutes as de, differenceInMilliseconds as Xt, addDays as Q, addMilliseconds as Yt, isToday as _e, differenceInMinutes as $e, set as xe, startOfWeek as Re, eachMinuteOfInterval as bt, endOfMonth as wt, endOfWeek as Dt, startOfMonth as qe, getMonth as Qt, setMonth as ot, getDaysInMonth as Jt, isSameMonth as xt, differenceInCalendarWeeks as Kt, closestTo as en, setHours as it, eachWeekOfInterval as tn, eachDayOfInterval as nn, isEqual as at } from "date-fns";
|
|
4
|
+
import { useTheme as ee, ListItem as rn, ListItemAvatar as kt, Avatar as Xe, ListItemText as Tt, Typography as $, Tabs as on, Tab as an, Box as Se, styled as le, alpha as Ie, Paper as Ct, Grow as sn, IconButton as ve, Slide as ln, Button as J, Popover as ke, List as dn, ListItemButton as cn, ButtonBase as un, useMediaQuery as Et, MenuList as hn, MenuItem as Ve, TextField as fn, FormControl as gn, InputLabel as pn, Select as yn, Checkbox as mn, Chip as _n, CircularProgress as St, FormHelperText as vn, Dialog as bn, DialogTitle as wn, DialogContent as Dn, Grid as st, DialogActions as xn } from "@mui/material";
|
|
5
5
|
import { enUS as kn } from "date-fns/locale";
|
|
6
6
|
import { styled as Tn } from "@mui/material/styles";
|
|
7
7
|
import Cn from "@mui/icons-material/DeleteRounded";
|
|
@@ -9,13 +9,13 @@ import En from "@mui/icons-material/EditRounded";
|
|
|
9
9
|
import Sn from "@mui/icons-material/EventNoteRounded";
|
|
10
10
|
import Mn from "@mui/icons-material/ClearRounded";
|
|
11
11
|
import In from "@mui/icons-material/SupervisorAccountRounded";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
12
|
+
import lt from "@mui/icons-material/ArrowRightRounded";
|
|
13
|
+
import dt from "@mui/icons-material/ArrowLeftRounded";
|
|
14
14
|
import { LocalizationProvider as Nn } from "@mui/x-date-pickers/LocalizationProvider";
|
|
15
15
|
import { AdapterDateFns as On } from "@mui/x-date-pickers/AdapterDateFns";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { DateCalendar as
|
|
16
|
+
import ct from "@mui/icons-material/NavigateBeforeRounded";
|
|
17
|
+
import Be from "@mui/icons-material/NavigateNextRounded";
|
|
18
|
+
import { DateCalendar as Ye } from "@mui/x-date-pickers";
|
|
19
19
|
import Fn from "@mui/icons-material/MoreVert";
|
|
20
20
|
import $n from "@mui/icons-material/ViewAgenda";
|
|
21
21
|
import { DatePicker as Rn } from "@mui/x-date-pickers/DatePicker";
|
|
@@ -32,21 +32,21 @@ const Wn = (e) => {
|
|
|
32
32
|
}, Pn = (e) => {
|
|
33
33
|
const t = [];
|
|
34
34
|
return e.month && t.push("month"), e.week && t.push("week"), e.day && t.push("day"), t;
|
|
35
|
-
},
|
|
35
|
+
}, Ge = (e, t, n) => {
|
|
36
36
|
var a;
|
|
37
37
|
const o = ((a = e.config) == null ? void 0 : a.multiple) && !Array.isArray((n == null ? void 0 : n[e.name]) || e.default), i = o ? t ? [t] : [] : t, s = o ? i.length : i;
|
|
38
38
|
return { value: i, validity: s };
|
|
39
|
-
},
|
|
39
|
+
}, Te = (e, t, n, o) => {
|
|
40
40
|
var f;
|
|
41
|
-
const i = n.idField, s = o.find((
|
|
42
|
-
for (const
|
|
43
|
-
const _ = a && !Array.isArray(
|
|
44
|
-
(a || Array.isArray(_) ? _.includes(t[i]) : _ === t[i]) &&
|
|
45
|
-
...
|
|
46
|
-
color:
|
|
41
|
+
const i = n.idField, s = o.find((u) => u.name === i), a = !!((f = s == null ? void 0 : s.config) != null && f.multiple), c = [];
|
|
42
|
+
for (const u of e) {
|
|
43
|
+
const _ = a && !Array.isArray(u[i]) ? [u[i]] : u[i];
|
|
44
|
+
(a || Array.isArray(_) ? _.includes(t[i]) : _ === t[i]) && c.push({
|
|
45
|
+
...u,
|
|
46
|
+
color: u.color || t[n.colorField || ""]
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
return
|
|
49
|
+
return c;
|
|
50
50
|
}, zn = (e, t) => e.filter(
|
|
51
51
|
(n) => n.event_id !== t.event_id && (j(de(t.start, 1), {
|
|
52
52
|
start: n.start,
|
|
@@ -61,87 +61,87 @@ const Wn = (e) => {
|
|
|
61
61
|
start: t.start,
|
|
62
62
|
end: t.end
|
|
63
63
|
}))
|
|
64
|
-
),
|
|
64
|
+
), Mt = (e, t) => Math.ceil(e) / t, It = (e, t) => Math.max(e / t, 60), se = (e, t) => vt(q(Zt(t, -1)), X(e)), Bn = (e) => new Date(
|
|
65
65
|
e.getUTCFullYear(),
|
|
66
66
|
e.getUTCMonth(),
|
|
67
67
|
e.getUTCDate(),
|
|
68
68
|
e.getUTCHours(),
|
|
69
69
|
e.getUTCMinutes()
|
|
70
|
-
),
|
|
70
|
+
), Nt = (e, t, n) => {
|
|
71
71
|
var i;
|
|
72
72
|
const o = Xt(e.end, e.start);
|
|
73
73
|
return e.recurring ? (i = e.recurring) == null ? void 0 : i.between(Q(t, -1), Q(t, 1), !0).map((s, a) => {
|
|
74
|
-
const
|
|
74
|
+
const c = Bn(s);
|
|
75
75
|
return {
|
|
76
76
|
...e,
|
|
77
77
|
recurrenceId: a,
|
|
78
|
-
start:
|
|
79
|
-
end: Yt(
|
|
78
|
+
start: c,
|
|
79
|
+
end: Yt(c, o)
|
|
80
80
|
};
|
|
81
|
-
}).map((s) =>
|
|
82
|
-
},
|
|
81
|
+
}).map((s) => Fe(s, n)) : [Fe(e, n)];
|
|
82
|
+
}, Ot = (e, t, n, o) => {
|
|
83
83
|
const i = [];
|
|
84
84
|
for (let s = 0; s < e.length; s++)
|
|
85
|
-
for (const a of
|
|
86
|
-
if (!a.allDay && ye(t, a.start) && !
|
|
85
|
+
for (const a of Nt(e[s], t, n)) {
|
|
86
|
+
if (!a.allDay && ye(t, a.start) && !se(a.start, a.end)) {
|
|
87
87
|
i.push(a);
|
|
88
88
|
continue;
|
|
89
89
|
}
|
|
90
|
-
if (o && !a.allDay &&
|
|
91
|
-
const f = X(t),
|
|
92
|
-
if (j(t, { start: X(a.start), end: q(a.end) }) || j(a.start, { start: f, end:
|
|
93
|
-
const _ = me(a.start, f) ? f : a.start,
|
|
90
|
+
if (o && !a.allDay && se(a.start, a.end) > 0) {
|
|
91
|
+
const f = X(t), u = q(t);
|
|
92
|
+
if (j(t, { start: X(a.start), end: q(a.end) }) || j(a.start, { start: f, end: u }) || j(a.end, { start: f, end: u })) {
|
|
93
|
+
const _ = me(a.start, f) ? f : a.start, g = Me(a.end, u) ? u : a.end;
|
|
94
94
|
i.push({
|
|
95
95
|
...a,
|
|
96
96
|
start: _,
|
|
97
|
-
end:
|
|
97
|
+
end: g,
|
|
98
98
|
_originalStart: a.start,
|
|
99
99
|
_originalEnd: a.end,
|
|
100
100
|
_hasPrev: me(a.start, f),
|
|
101
|
-
_hasNext:
|
|
101
|
+
_hasNext: Me(a.end, u)
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
return
|
|
107
|
-
},
|
|
106
|
+
return Ft(i);
|
|
107
|
+
}, Ne = (e, t) => {
|
|
108
108
|
const n = e.filter(
|
|
109
109
|
(o) => j(t, {
|
|
110
110
|
start: X(o.start),
|
|
111
111
|
end: q(qt(o.end, 1))
|
|
112
112
|
})
|
|
113
113
|
);
|
|
114
|
-
return
|
|
115
|
-
},
|
|
114
|
+
return Ae(n);
|
|
115
|
+
}, Ft = (e) => e.sort((t, n) => {
|
|
116
116
|
const o = t.end.getTime() - t.start.getTime();
|
|
117
117
|
return n.end.getTime() - n.start.getTime() - o;
|
|
118
|
-
}),
|
|
118
|
+
}), Ae = (e) => e.sort((t, n) => t.allDay || se(t.start, t.end) > 0 ? -1 : t.start.getTime() - n.start.getTime()), Oe = (e, t, n, o, i) => {
|
|
119
119
|
var f;
|
|
120
|
-
const s = Array.isArray(t), a = [],
|
|
121
|
-
for (let
|
|
122
|
-
const h =
|
|
123
|
-
let
|
|
124
|
-
if (
|
|
125
|
-
(
|
|
120
|
+
const s = Array.isArray(t), a = [], c = {};
|
|
121
|
+
for (let u = 0; u < e.length; u++) {
|
|
122
|
+
const h = Fe(e[u], n), _ = se(h.start, h.end) > 0, g = i && !h.allDay && _;
|
|
123
|
+
let w = h.allDay || _ && !g;
|
|
124
|
+
if (w && (s ? w = t.some(
|
|
125
|
+
(d) => j(d, {
|
|
126
126
|
start: X(h.start),
|
|
127
127
|
end: q(h.end)
|
|
128
128
|
})
|
|
129
|
-
) :
|
|
129
|
+
) : w = j(t, {
|
|
130
130
|
start: X(h.start),
|
|
131
131
|
end: q(h.end)
|
|
132
|
-
}),
|
|
132
|
+
}), w))
|
|
133
133
|
if (a.push(h), s)
|
|
134
|
-
for (const
|
|
135
|
-
const
|
|
136
|
-
j(
|
|
134
|
+
for (const d of t) {
|
|
135
|
+
const p = N(d, "yyyy-MM-dd");
|
|
136
|
+
j(d, { start: X(h.start), end: q(h.end) }) && (c[p] = (c[p] || []).concat(h));
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
|
-
const
|
|
140
|
-
d
|
|
139
|
+
const d = N(h.start, "yyyy-MM-dd");
|
|
140
|
+
c[d] = (c[d] || []).concat(h);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
return s && o ? ((f = Object.values(
|
|
144
|
-
},
|
|
143
|
+
return s && o ? ((f = Object.values(c).sort((u, h) => h.length - u.length)) == null ? void 0 : f[0]) || [] : a;
|
|
144
|
+
}, Fe = (e, t) => ({
|
|
145
145
|
...e,
|
|
146
146
|
start: ue(e.start, t),
|
|
147
147
|
end: ue(e.end, t),
|
|
@@ -152,7 +152,7 @@ const Wn = (e) => {
|
|
|
152
152
|
timeStyle: "medium",
|
|
153
153
|
timeZone: t
|
|
154
154
|
}).format(e)
|
|
155
|
-
),
|
|
155
|
+
), je = (e, t) => {
|
|
156
156
|
if (!t)
|
|
157
157
|
return e;
|
|
158
158
|
const n = -e.getTimezoneOffset(), o = Ln(t), i = n - o;
|
|
@@ -236,7 +236,7 @@ const Vn = {
|
|
|
236
236
|
week: n !== null ? Object.assign(Gn, n) : null,
|
|
237
237
|
day: o !== null ? Object.assign(jn, o) : null
|
|
238
238
|
};
|
|
239
|
-
},
|
|
239
|
+
}, $t = (e) => {
|
|
240
240
|
const {
|
|
241
241
|
translations: t,
|
|
242
242
|
resourceFields: n,
|
|
@@ -244,16 +244,16 @@ const Vn = {
|
|
|
244
244
|
agenda: i,
|
|
245
245
|
selectedDate: s,
|
|
246
246
|
resourceViewMode: a,
|
|
247
|
-
direction:
|
|
247
|
+
direction: c,
|
|
248
248
|
dialogMaxWidth: f,
|
|
249
|
-
hourFormat:
|
|
249
|
+
hourFormat: u,
|
|
250
250
|
...h
|
|
251
|
-
} = e, _ = qn(e),
|
|
251
|
+
} = e, _ = qn(e), g = o || "week", w = _[g] ? g : Wn(_);
|
|
252
252
|
return {
|
|
253
253
|
..._,
|
|
254
254
|
translations: Zn(t),
|
|
255
255
|
resourceFields: Object.assign(Un, n),
|
|
256
|
-
view:
|
|
256
|
+
view: w,
|
|
257
257
|
selectedDate: ue(s || /* @__PURE__ */ new Date(), e.timeZone),
|
|
258
258
|
height: 600,
|
|
259
259
|
navigation: !0,
|
|
@@ -268,12 +268,12 @@ const Vn = {
|
|
|
268
268
|
resources: [],
|
|
269
269
|
resourceHeaderComponent: void 0,
|
|
270
270
|
resourceViewMode: a || "default",
|
|
271
|
-
direction:
|
|
271
|
+
direction: c || "ltr",
|
|
272
272
|
dialogMaxWidth: f || "md",
|
|
273
273
|
locale: kn,
|
|
274
274
|
deletable: !0,
|
|
275
275
|
editable: !0,
|
|
276
|
-
hourFormat:
|
|
276
|
+
hourFormat: u || "12",
|
|
277
277
|
draggable: !0,
|
|
278
278
|
agenda: i,
|
|
279
279
|
enableAgenda: typeof i > "u" || i,
|
|
@@ -281,8 +281,8 @@ const Vn = {
|
|
|
281
281
|
forceInlineMultiDay: !1,
|
|
282
282
|
...h
|
|
283
283
|
};
|
|
284
|
-
},
|
|
285
|
-
|
|
284
|
+
}, Rt = {
|
|
285
|
+
...$t({}),
|
|
286
286
|
setProps: () => {
|
|
287
287
|
},
|
|
288
288
|
dialog: !1,
|
|
@@ -305,10 +305,13 @@ const Vn = {
|
|
|
305
305
|
setCurrentDragged: () => {
|
|
306
306
|
},
|
|
307
307
|
onDrop: () => {
|
|
308
|
+
},
|
|
309
|
+
_refetchToken: 0,
|
|
310
|
+
refetch: () => {
|
|
308
311
|
}
|
|
309
|
-
},
|
|
310
|
-
const { resourceHeaderComponent: t, resourceFields: n, direction: o, resourceViewMode: i } = O(), s =
|
|
311
|
-
return t instanceof Function ? t(e) : /* @__PURE__ */
|
|
312
|
+
}, At = yt(Rt), O = () => mt(At), Ue = ({ resource: e }) => {
|
|
313
|
+
const { resourceHeaderComponent: t, resourceFields: n, direction: o, resourceViewMode: i } = O(), s = ee(), a = e[n.textField], c = e[n.subTextField || ""], f = e[n.avatarField || ""], u = e[n.colorField || ""];
|
|
314
|
+
return t instanceof Function ? t(e) : /* @__PURE__ */ E(
|
|
312
315
|
rn,
|
|
313
316
|
{
|
|
314
317
|
sx: {
|
|
@@ -327,18 +330,18 @@ const Vn = {
|
|
|
327
330
|
},
|
|
328
331
|
component: "div",
|
|
329
332
|
children: [
|
|
330
|
-
/* @__PURE__ */ r(
|
|
333
|
+
/* @__PURE__ */ r(kt, { children: /* @__PURE__ */ r(Xe, { sx: { background: u, margin: "auto" }, alt: a, src: f }) }),
|
|
331
334
|
/* @__PURE__ */ r(
|
|
332
|
-
|
|
335
|
+
Tt,
|
|
333
336
|
{
|
|
334
|
-
primary: /* @__PURE__ */ r(
|
|
337
|
+
primary: /* @__PURE__ */ r($, { variant: "body2", noWrap: i !== "vertical", children: a }),
|
|
335
338
|
secondary: /* @__PURE__ */ r(
|
|
336
|
-
|
|
339
|
+
$,
|
|
337
340
|
{
|
|
338
341
|
variant: "caption",
|
|
339
342
|
color: "textSecondary",
|
|
340
343
|
noWrap: i !== "vertical",
|
|
341
|
-
children:
|
|
344
|
+
children: c
|
|
342
345
|
}
|
|
343
346
|
)
|
|
344
347
|
}
|
|
@@ -403,7 +406,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
403
406
|
setTab: o,
|
|
404
407
|
indicator: i = "primary",
|
|
405
408
|
style: s
|
|
406
|
-
}) => /* @__PURE__ */
|
|
409
|
+
}) => /* @__PURE__ */ E(Qn, { style: s, children: [
|
|
407
410
|
/* @__PURE__ */ r(
|
|
408
411
|
on,
|
|
409
412
|
{
|
|
@@ -412,7 +415,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
412
415
|
scrollButtons: !0,
|
|
413
416
|
className: "tabs",
|
|
414
417
|
classes: { indicator: i },
|
|
415
|
-
children: e.map((a,
|
|
418
|
+
children: e.map((a, c) => /* @__PURE__ */ r(
|
|
416
419
|
an,
|
|
417
420
|
{
|
|
418
421
|
label: a.label,
|
|
@@ -422,18 +425,18 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
422
425
|
onClick: () => o(a.id),
|
|
423
426
|
onDragEnter: () => o(a.id)
|
|
424
427
|
},
|
|
425
|
-
a.id ||
|
|
428
|
+
a.id || c
|
|
426
429
|
))
|
|
427
430
|
}
|
|
428
431
|
),
|
|
429
432
|
e.map(
|
|
430
|
-
(a,
|
|
433
|
+
(a, c) => a.component && /* @__PURE__ */ r(Xn, { value: n, index: a.id, children: a.component }, c)
|
|
431
434
|
)
|
|
432
|
-
] }),
|
|
433
|
-
const { resources: t, resourceFields: n, resourceViewMode: o } = O(), i =
|
|
434
|
-
return o === "tabs" ? /* @__PURE__ */ r(Kn, { renderChildren: e }) : o === "vertical" ? /* @__PURE__ */ r(Y, { children: t.map((s, a) => /* @__PURE__ */
|
|
435
|
+
] }), Qe = ({ renderChildren: e }) => {
|
|
436
|
+
const { resources: t, resourceFields: n, resourceViewMode: o } = O(), i = ee();
|
|
437
|
+
return o === "tabs" ? /* @__PURE__ */ r(Kn, { renderChildren: e }) : o === "vertical" ? /* @__PURE__ */ r(Y, { children: t.map((s, a) => /* @__PURE__ */ E(Se, { sx: { display: "flex" }, children: [
|
|
435
438
|
/* @__PURE__ */ r(
|
|
436
|
-
|
|
439
|
+
Se,
|
|
437
440
|
{
|
|
438
441
|
sx: {
|
|
439
442
|
borderColor: i.palette.grey[300],
|
|
@@ -442,36 +445,36 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
442
445
|
paddingTop: 1,
|
|
443
446
|
flexBasis: 140
|
|
444
447
|
},
|
|
445
|
-
children: /* @__PURE__ */ r(
|
|
448
|
+
children: /* @__PURE__ */ r(Ue, { resource: s })
|
|
446
449
|
}
|
|
447
450
|
),
|
|
448
451
|
/* @__PURE__ */ r(
|
|
449
|
-
|
|
452
|
+
Se,
|
|
450
453
|
{
|
|
451
454
|
sx: { width: "100%", overflowX: "auto" },
|
|
452
455
|
children: e(s)
|
|
453
456
|
}
|
|
454
457
|
)
|
|
455
|
-
] }, `${s[n.idField]}_${a}`)) }) : /* @__PURE__ */ r(Y, { children: t.map((s, a) => /* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */ r(
|
|
458
|
+
] }, `${s[n.idField]}_${a}`)) }) : /* @__PURE__ */ r(Y, { children: t.map((s, a) => /* @__PURE__ */ E("div", { children: [
|
|
459
|
+
/* @__PURE__ */ r(Ue, { resource: s }),
|
|
457
460
|
e(s)
|
|
458
461
|
] }, `${s[n.idField]}_${a}`)) });
|
|
459
462
|
}, Kn = ({ renderChildren: e }) => {
|
|
460
|
-
const { resources: t, resourceFields: n, selectedTab: o, handleState: i, onResourceChange: s } = O(), a = t.map((
|
|
461
|
-
id:
|
|
462
|
-
label: /* @__PURE__ */ r(
|
|
463
|
-
component: /* @__PURE__ */ r(Y, { children: e(
|
|
464
|
-
})),
|
|
465
|
-
if (i(
|
|
466
|
-
const h = t.find((_) => _[n.idField] ===
|
|
463
|
+
const { resources: t, resourceFields: n, selectedTab: o, handleState: i, onResourceChange: s } = O(), a = t.map((u) => ({
|
|
464
|
+
id: u[n.idField],
|
|
465
|
+
label: /* @__PURE__ */ r(Ue, { resource: u }),
|
|
466
|
+
component: /* @__PURE__ */ r(Y, { children: e(u) })
|
|
467
|
+
})), c = (u) => {
|
|
468
|
+
if (i(u, "selectedTab"), typeof s == "function") {
|
|
469
|
+
const h = t.find((_) => _[n.idField] === u);
|
|
467
470
|
h && s(h);
|
|
468
471
|
}
|
|
469
472
|
}, f = U(() => {
|
|
470
|
-
const
|
|
471
|
-
return !o || t.findIndex((_) => _[n.idField] === o) < 0 ?
|
|
473
|
+
const u = t[0][n.idField];
|
|
474
|
+
return !o || t.findIndex((_) => _[n.idField] === o) < 0 ? u : o;
|
|
472
475
|
}, [t, n.idField, o]);
|
|
473
|
-
return /* @__PURE__ */ r(Jn, { tabs: a, tab: f, setTab:
|
|
474
|
-
}, er =
|
|
476
|
+
return /* @__PURE__ */ r(Jn, { tabs: a, tab: f, setTab: c, style: { display: "grid" } });
|
|
477
|
+
}, er = le("div")(({ theme: e, dialog: t }) => ({
|
|
475
478
|
position: "relative",
|
|
476
479
|
"& .rs__table_loading": {
|
|
477
480
|
position: "absolute",
|
|
@@ -481,7 +484,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
481
484
|
bottom: 0,
|
|
482
485
|
zIndex: 999999,
|
|
483
486
|
"& .rs__table_loading_internal": {
|
|
484
|
-
background: t ? "" :
|
|
487
|
+
background: t ? "" : Ie(e.palette.background.paper, 0.4),
|
|
485
488
|
height: "100%",
|
|
486
489
|
"& > span": {
|
|
487
490
|
display: "flex",
|
|
@@ -495,7 +498,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
495
498
|
}
|
|
496
499
|
}
|
|
497
500
|
}
|
|
498
|
-
})), tr =
|
|
501
|
+
})), tr = le("div")(({ resource_count: e }) => ({
|
|
499
502
|
position: "relative",
|
|
500
503
|
display: "flex",
|
|
501
504
|
flexDirection: e > 1 ? "row" : "column",
|
|
@@ -505,7 +508,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
505
508
|
flexShrink: 0,
|
|
506
509
|
flexGrow: 1
|
|
507
510
|
}
|
|
508
|
-
})), nr =
|
|
511
|
+
})), nr = le(Ct)(
|
|
509
512
|
({ sticky: e = "0", offset: t = 0 }) => ({
|
|
510
513
|
display: "flex",
|
|
511
514
|
justifyContent: "space-between",
|
|
@@ -520,7 +523,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
520
523
|
alignItems: "center"
|
|
521
524
|
}
|
|
522
525
|
})
|
|
523
|
-
),
|
|
526
|
+
), He = le("div")(
|
|
524
527
|
({ theme: e, stickyOffset: t = 0, stickyHeight: n = 40 }) => ({
|
|
525
528
|
borderStyle: "solid",
|
|
526
529
|
borderColor: e.palette.grey[300],
|
|
@@ -553,7 +556,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
553
556
|
}
|
|
554
557
|
}
|
|
555
558
|
})
|
|
556
|
-
), be =
|
|
559
|
+
), be = le("div")(
|
|
557
560
|
({
|
|
558
561
|
days: e,
|
|
559
562
|
sticky: t = "0",
|
|
@@ -613,7 +616,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
613
616
|
borderRadius: 0,
|
|
614
617
|
cursor: "pointer",
|
|
615
618
|
"&:hover": {
|
|
616
|
-
background:
|
|
619
|
+
background: Ie(i.palette.primary.main, 0.1)
|
|
617
620
|
}
|
|
618
621
|
},
|
|
619
622
|
"& .rs__event__item": {
|
|
@@ -641,7 +644,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
641
644
|
}
|
|
642
645
|
}
|
|
643
646
|
})
|
|
644
|
-
),
|
|
647
|
+
), ut = le(Ct)(({ disabled: e }) => ({
|
|
645
648
|
width: "99.5%",
|
|
646
649
|
height: "100%",
|
|
647
650
|
display: "block",
|
|
@@ -657,7 +660,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
657
660
|
// padding: "2px 4px",
|
|
658
661
|
}
|
|
659
662
|
}
|
|
660
|
-
})), rr =
|
|
663
|
+
})), rr = le("div")(({ theme: e }) => ({
|
|
661
664
|
maxWidth: "100%",
|
|
662
665
|
width: 400,
|
|
663
666
|
"& > div": {
|
|
@@ -671,7 +674,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
671
674
|
}
|
|
672
675
|
}
|
|
673
676
|
}
|
|
674
|
-
})), or =
|
|
677
|
+
})), or = le("div")(({ theme: e }) => ({
|
|
675
678
|
display: "inherit",
|
|
676
679
|
"& .MuiIconButton-root": {
|
|
677
680
|
color: e.palette.primary.contrastText
|
|
@@ -684,7 +687,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
684
687
|
color: e.palette.action.disabled
|
|
685
688
|
}
|
|
686
689
|
}
|
|
687
|
-
})), ir =
|
|
690
|
+
})), ir = le("div")(({ theme: e, color: t }) => ({
|
|
688
691
|
position: "absolute",
|
|
689
692
|
zIndex: 9,
|
|
690
693
|
width: "100%",
|
|
@@ -701,7 +704,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
701
704
|
borderTop: `solid 2px ${t || e.palette.error.light}`,
|
|
702
705
|
width: "100%"
|
|
703
706
|
}
|
|
704
|
-
})),
|
|
707
|
+
})), Ht = (e) => {
|
|
705
708
|
const { editable: t, deletable: n, draggable: o } = O(), i = U(() => typeof e.editable < "u" ? e.editable : t, [t, e.editable]), s = U(() => typeof e.deletable < "u" ? e.deletable : n, [n, e.deletable]), a = U(() => {
|
|
706
709
|
if (i)
|
|
707
710
|
return typeof e.draggable < "u" ? e.draggable : o;
|
|
@@ -712,15 +715,15 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
712
715
|
canDrag: a
|
|
713
716
|
};
|
|
714
717
|
}, ar = ({ event: e, onDelete: t, onEdit: n }) => {
|
|
715
|
-
const { translations: o, direction: i } = O(), [s, a] = L(!1),
|
|
718
|
+
const { translations: o, direction: i } = O(), [s, a] = L(!1), c = () => {
|
|
716
719
|
if (!s)
|
|
717
720
|
return a(!0);
|
|
718
721
|
t();
|
|
719
|
-
}, { canEdit: f, canDelete:
|
|
720
|
-
return /* @__PURE__ */
|
|
721
|
-
/* @__PURE__ */ r(sn, { in: !s, exit: !1, timeout: 400, unmountOnExit: !0, children: /* @__PURE__ */
|
|
722
|
-
f && /* @__PURE__ */ r(
|
|
723
|
-
|
|
722
|
+
}, { canEdit: f, canDelete: u } = Ht(e);
|
|
723
|
+
return /* @__PURE__ */ E(or, { children: [
|
|
724
|
+
/* @__PURE__ */ r(sn, { in: !s, exit: !1, timeout: 400, unmountOnExit: !0, children: /* @__PURE__ */ E("div", { children: [
|
|
725
|
+
f && /* @__PURE__ */ r(ve, { size: "small", onClick: n, children: /* @__PURE__ */ r(En, {}) }),
|
|
726
|
+
u && /* @__PURE__ */ r(ve, { size: "small", onClick: c, children: /* @__PURE__ */ r(Cn, {}) })
|
|
724
727
|
] }) }),
|
|
725
728
|
/* @__PURE__ */ r(
|
|
726
729
|
ln,
|
|
@@ -730,54 +733,54 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
730
733
|
unmountOnExit: !0,
|
|
731
734
|
timeout: 400,
|
|
732
735
|
exit: !1,
|
|
733
|
-
children: /* @__PURE__ */
|
|
734
|
-
/* @__PURE__ */ r(
|
|
735
|
-
/* @__PURE__ */ r(
|
|
736
|
+
children: /* @__PURE__ */ E("div", { children: [
|
|
737
|
+
/* @__PURE__ */ r(J, { className: "delete", size: "small", onClick: c, children: o.form.delete.toUpperCase() }),
|
|
738
|
+
/* @__PURE__ */ r(J, { className: "cancel", size: "small", onClick: () => a(!1), children: o.form.cancel.toUpperCase() })
|
|
736
739
|
] })
|
|
737
740
|
}
|
|
738
741
|
)
|
|
739
742
|
] });
|
|
740
|
-
},
|
|
743
|
+
}, Wt = ({ anchorEl: e, event: t, onTriggerViewer: n }) => {
|
|
741
744
|
const {
|
|
742
745
|
triggerDialog: o,
|
|
743
746
|
onDelete: i,
|
|
744
747
|
events: s,
|
|
745
748
|
handleState: a,
|
|
746
|
-
triggerLoading:
|
|
749
|
+
triggerLoading: c,
|
|
747
750
|
customViewer: f,
|
|
748
|
-
viewerExtraComponent:
|
|
751
|
+
viewerExtraComponent: u,
|
|
749
752
|
fields: h,
|
|
750
753
|
resources: _,
|
|
751
|
-
resourceFields:
|
|
752
|
-
locale:
|
|
753
|
-
viewerTitleComponent:
|
|
754
|
-
viewerSubtitleComponent:
|
|
755
|
-
hourFormat:
|
|
754
|
+
resourceFields: g,
|
|
755
|
+
locale: w,
|
|
756
|
+
viewerTitleComponent: d,
|
|
757
|
+
viewerSubtitleComponent: p,
|
|
758
|
+
hourFormat: y,
|
|
756
759
|
translations: l,
|
|
757
|
-
onEventEdit:
|
|
758
|
-
} = O(),
|
|
759
|
-
(
|
|
760
|
-
),
|
|
760
|
+
onEventEdit: m
|
|
761
|
+
} = O(), k = ee(), C = De(y), D = t._originalStart || t.start, T = t._originalEnd || t.end, M = se(D, T) <= 0 && t.allDay, I = g.idField, v = _.filter(
|
|
762
|
+
(S) => Array.isArray(t[I]) ? t[I].includes(S[I]) : S[I] === t[I]
|
|
763
|
+
), b = async () => {
|
|
761
764
|
try {
|
|
762
|
-
|
|
763
|
-
let
|
|
765
|
+
c(!0);
|
|
766
|
+
let S = t.event_id;
|
|
764
767
|
if (i) {
|
|
765
|
-
const
|
|
766
|
-
|
|
768
|
+
const x = await i(S);
|
|
769
|
+
x ? S = x : S = "";
|
|
767
770
|
}
|
|
768
|
-
if (
|
|
771
|
+
if (S) {
|
|
769
772
|
n();
|
|
770
|
-
const
|
|
771
|
-
a(
|
|
773
|
+
const x = s.filter((W) => W.event_id !== S);
|
|
774
|
+
a(x, "events");
|
|
772
775
|
}
|
|
773
|
-
} catch (
|
|
774
|
-
console.error(
|
|
776
|
+
} catch (S) {
|
|
777
|
+
console.error(S);
|
|
775
778
|
} finally {
|
|
776
|
-
|
|
779
|
+
c(!1);
|
|
777
780
|
}
|
|
778
781
|
};
|
|
779
782
|
return /* @__PURE__ */ r(
|
|
780
|
-
|
|
783
|
+
ke,
|
|
781
784
|
{
|
|
782
785
|
open: !!e,
|
|
783
786
|
anchorEl: e,
|
|
@@ -792,21 +795,21 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
792
795
|
vertical: "top",
|
|
793
796
|
horizontal: "center"
|
|
794
797
|
},
|
|
795
|
-
onClick: (
|
|
796
|
-
|
|
798
|
+
onClick: (S) => {
|
|
799
|
+
S.stopPropagation();
|
|
797
800
|
},
|
|
798
|
-
children: typeof f == "function" ? f(t, () => n()) : /* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
|
|
801
|
+
children: typeof f == "function" ? f(t, () => n()) : /* @__PURE__ */ E(rr, { children: [
|
|
802
|
+
/* @__PURE__ */ E(
|
|
803
|
+
Se,
|
|
801
804
|
{
|
|
802
805
|
sx: {
|
|
803
|
-
bgcolor: t.color ||
|
|
804
|
-
color:
|
|
806
|
+
bgcolor: t.color || k.palette.primary.main,
|
|
807
|
+
color: k.palette.primary.contrastText
|
|
805
808
|
},
|
|
806
809
|
children: [
|
|
807
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ E("div", { className: "rs__popper_actions", children: [
|
|
808
811
|
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
809
|
-
|
|
812
|
+
ve,
|
|
810
813
|
{
|
|
811
814
|
size: "small",
|
|
812
815
|
onClick: () => {
|
|
@@ -819,20 +822,20 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
819
822
|
ar,
|
|
820
823
|
{
|
|
821
824
|
event: t,
|
|
822
|
-
onDelete:
|
|
825
|
+
onDelete: b,
|
|
823
826
|
onEdit: () => {
|
|
824
|
-
n(), o(!0, t),
|
|
827
|
+
n(), o(!0, t), m && typeof m == "function" && m(t);
|
|
825
828
|
}
|
|
826
829
|
}
|
|
827
830
|
)
|
|
828
831
|
] }),
|
|
829
|
-
|
|
832
|
+
d instanceof Function ? d(t) : /* @__PURE__ */ r($, { style: { padding: "5px 0" }, noWrap: !0, children: t.title })
|
|
830
833
|
]
|
|
831
834
|
}
|
|
832
835
|
),
|
|
833
|
-
/* @__PURE__ */
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
-
|
|
836
|
+
/* @__PURE__ */ E("div", { style: { padding: "5px 10px" }, children: [
|
|
837
|
+
/* @__PURE__ */ E(
|
|
838
|
+
$,
|
|
836
839
|
{
|
|
837
840
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
838
841
|
color: "textSecondary",
|
|
@@ -840,17 +843,17 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
840
843
|
noWrap: !0,
|
|
841
844
|
children: [
|
|
842
845
|
/* @__PURE__ */ r(Sn, {}),
|
|
843
|
-
|
|
844
|
-
locale:
|
|
845
|
-
})} - ${N(
|
|
846
|
-
locale:
|
|
846
|
+
M ? l.event.allDay : `${N(D, `dd MMMM yyyy ${C}`, {
|
|
847
|
+
locale: w
|
|
848
|
+
})} - ${N(T, `dd MMMM yyyy ${C}`, {
|
|
849
|
+
locale: w
|
|
847
850
|
})}`
|
|
848
851
|
]
|
|
849
852
|
}
|
|
850
853
|
),
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
+
p instanceof Function ? p(t) : /* @__PURE__ */ r($, { variant: "body2", style: { padding: "5px 0" }, children: t.subtitle }),
|
|
855
|
+
v.length > 0 && /* @__PURE__ */ E(
|
|
856
|
+
$,
|
|
854
857
|
{
|
|
855
858
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
856
859
|
color: "textSecondary",
|
|
@@ -858,75 +861,75 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
858
861
|
noWrap: !0,
|
|
859
862
|
children: [
|
|
860
863
|
/* @__PURE__ */ r(In, {}),
|
|
861
|
-
|
|
864
|
+
v.map((S) => S[g.textField]).join(", ")
|
|
862
865
|
]
|
|
863
866
|
}
|
|
864
867
|
),
|
|
865
|
-
|
|
868
|
+
u instanceof Function ? u(h, t) : u
|
|
866
869
|
] })
|
|
867
870
|
] })
|
|
868
871
|
}
|
|
869
872
|
);
|
|
870
|
-
},
|
|
871
|
-
const [n, o] = L(null), [i, s] = L(), [a,
|
|
872
|
-
!(l != null && l.currentTarget) && a &&
|
|
873
|
+
}, Je = ({ day: e, events: t }) => {
|
|
874
|
+
const [n, o] = L(null), [i, s] = L(), [a, c] = L(!1), { locale: f, hourFormat: u, eventRenderer: h, onEventClick: _, timeZone: g, disableViewer: w } = O(), d = ee(), p = De(u), y = (l) => {
|
|
875
|
+
!(l != null && l.currentTarget) && a && c(!1), o((l == null ? void 0 : l.currentTarget) || null);
|
|
873
876
|
};
|
|
874
|
-
return /* @__PURE__ */
|
|
877
|
+
return /* @__PURE__ */ E(ie, { children: [
|
|
875
878
|
/* @__PURE__ */ r(dn, { children: t.map((l) => {
|
|
876
|
-
const
|
|
879
|
+
const k = he({
|
|
877
880
|
dateLeft: l.start,
|
|
878
881
|
dateRight: e,
|
|
879
|
-
timeZone:
|
|
880
|
-
}) ?
|
|
882
|
+
timeZone: g
|
|
883
|
+
}) ? p : `MMM d, ${p}`, C = N(l.start, k, {
|
|
881
884
|
locale: f
|
|
882
|
-
}),
|
|
885
|
+
}), T = he({ dateLeft: l.end, dateRight: e, timeZone: g }) ? p : `MMM d, ${p}`, M = N(l.end, T, {
|
|
883
886
|
locale: f
|
|
884
887
|
});
|
|
885
888
|
return typeof h == "function" ? h({
|
|
886
889
|
event: l,
|
|
887
890
|
onClick: (I) => {
|
|
888
|
-
s(l),
|
|
891
|
+
s(l), y(I);
|
|
889
892
|
}
|
|
890
|
-
}) : /* @__PURE__ */
|
|
893
|
+
}) : /* @__PURE__ */ E(
|
|
891
894
|
cn,
|
|
892
895
|
{
|
|
893
896
|
focusRipple: !0,
|
|
894
|
-
disableRipple:
|
|
895
|
-
tabIndex:
|
|
897
|
+
disableRipple: w,
|
|
898
|
+
tabIndex: w ? -1 : 0,
|
|
896
899
|
disabled: l.disabled,
|
|
897
900
|
onClick: (I) => {
|
|
898
|
-
I.preventDefault(), I.stopPropagation(),
|
|
901
|
+
I.preventDefault(), I.stopPropagation(), w || y(I), s(l), typeof _ == "function" && _(l);
|
|
899
902
|
},
|
|
900
903
|
children: [
|
|
901
|
-
/* @__PURE__ */ r(
|
|
902
|
-
|
|
904
|
+
/* @__PURE__ */ r(kt, { children: /* @__PURE__ */ r(
|
|
905
|
+
Xe,
|
|
903
906
|
{
|
|
904
907
|
sx: {
|
|
905
|
-
bgcolor: l.disabled ? "#d0d0d0" : l.color ||
|
|
906
|
-
color: l.disabled ? "#808080" : l.textColor ||
|
|
908
|
+
bgcolor: l.disabled ? "#d0d0d0" : l.color || d.palette.primary.main,
|
|
909
|
+
color: l.disabled ? "#808080" : l.textColor || d.palette.primary.contrastText
|
|
907
910
|
},
|
|
908
911
|
children: l.agendaAvatar || " "
|
|
909
912
|
}
|
|
910
913
|
) }),
|
|
911
|
-
/* @__PURE__ */ r(
|
|
914
|
+
/* @__PURE__ */ r(Tt, { primary: l.title, secondary: `${C} - ${M}` })
|
|
912
915
|
]
|
|
913
916
|
},
|
|
914
917
|
`${l.start.getTime()}_${l.end.getTime()}_${l.event_id}`
|
|
915
918
|
);
|
|
916
919
|
}) }),
|
|
917
920
|
i && /* @__PURE__ */ r(
|
|
918
|
-
|
|
921
|
+
Wt,
|
|
919
922
|
{
|
|
920
923
|
anchorEl: n,
|
|
921
924
|
event: i,
|
|
922
|
-
onTriggerViewer:
|
|
925
|
+
onTriggerViewer: y
|
|
923
926
|
}
|
|
924
927
|
)
|
|
925
928
|
] });
|
|
926
|
-
},
|
|
929
|
+
}, Ke = () => {
|
|
927
930
|
const { height: e, translations: t, stickyNavigationOffset: n, stickyNavigationHeight: o } = O();
|
|
928
931
|
return /* @__PURE__ */ r(
|
|
929
|
-
|
|
932
|
+
He,
|
|
930
933
|
{
|
|
931
934
|
stickyOffset: n,
|
|
932
935
|
stickyHeight: o,
|
|
@@ -938,7 +941,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
938
941
|
alignItems: "center",
|
|
939
942
|
justifyContent: "center"
|
|
940
943
|
},
|
|
941
|
-
children: /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: /* @__PURE__ */ r(
|
|
944
|
+
children: /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: /* @__PURE__ */ r($, { children: t.noDataToDisplay }) })
|
|
942
945
|
}
|
|
943
946
|
);
|
|
944
947
|
}, sr = ({ daysList: e, resource: t, events: n }) => {
|
|
@@ -947,33 +950,33 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
947
950
|
handleGotoDay: i,
|
|
948
951
|
locale: s,
|
|
949
952
|
timeZone: a,
|
|
950
|
-
translations:
|
|
953
|
+
translations: c,
|
|
951
954
|
alwaysShowAgendaDays: f,
|
|
952
|
-
stickyNavigationOffset:
|
|
955
|
+
stickyNavigationOffset: u,
|
|
953
956
|
stickyNavigationHeight: h
|
|
954
|
-
} = O(), { disableGoToDay: _, headRenderer:
|
|
955
|
-
return !f && !
|
|
956
|
-
const
|
|
957
|
-
return !f && !l.length ? null : /* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof
|
|
959
|
-
|
|
957
|
+
} = O(), { disableGoToDay: _, headRenderer: g } = o, w = U(() => e.some((d) => Ne(n, d).length > 0), [e, n]);
|
|
958
|
+
return !f && !w ? /* @__PURE__ */ r(Ke, {}) : /* @__PURE__ */ r(He, { stickyOffset: u, stickyHeight: h, children: e.map((d, p) => {
|
|
959
|
+
const y = he({ dateLeft: d, timeZone: a }), l = Ne(n, d);
|
|
960
|
+
return !f && !l.length ? null : /* @__PURE__ */ E("div", { className: `rs__agenda_row ${_e(d) ? "rs__today_cell" : ""}`, children: [
|
|
961
|
+
/* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof g == "function" ? /* @__PURE__ */ r("div", { children: g({ day: d, events: n, resource: t }) }) : /* @__PURE__ */ r(
|
|
962
|
+
$,
|
|
960
963
|
{
|
|
961
|
-
sx: { fontWeight:
|
|
962
|
-
color:
|
|
964
|
+
sx: { fontWeight: y ? "bold" : "inherit" },
|
|
965
|
+
color: y ? "primary" : "inherit",
|
|
963
966
|
variant: "body2",
|
|
964
967
|
className: _ ? "" : "rs__hover__op",
|
|
965
|
-
onClick: (
|
|
966
|
-
|
|
968
|
+
onClick: (m) => {
|
|
969
|
+
m.stopPropagation(), _ || i(d);
|
|
967
970
|
},
|
|
968
|
-
children: N(
|
|
971
|
+
children: N(d, "dd E", { locale: s })
|
|
969
972
|
}
|
|
970
973
|
) }),
|
|
971
|
-
/* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: l.length > 0 ? /* @__PURE__ */ r(
|
|
972
|
-
] },
|
|
974
|
+
/* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: l.length > 0 ? /* @__PURE__ */ r(Je, { day: d, events: l }) : /* @__PURE__ */ r($, { sx: { padding: 1 }, children: c.noDataToDisplay }) })
|
|
975
|
+
] }, p);
|
|
973
976
|
}) });
|
|
974
|
-
},
|
|
975
|
-
const e =
|
|
976
|
-
return
|
|
977
|
+
}, Ze = 1, pe = 28, ht = 27, lr = 23, Pt = () => {
|
|
978
|
+
const e = rt(null), t = rt(null);
|
|
979
|
+
return K(() => {
|
|
977
980
|
const n = e.current, o = t.current, i = (s) => {
|
|
978
981
|
const a = s.currentTarget;
|
|
979
982
|
o == null || o.scroll({ left: a.scrollLeft }), n == null || n.scroll({ left: a.scrollLeft });
|
|
@@ -982,11 +985,11 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
982
985
|
n == null || n.removeEventListener("scroll", i), o == null || o.removeEventListener("scroll", i);
|
|
983
986
|
};
|
|
984
987
|
}), { headersRef: e, bodyRef: t };
|
|
985
|
-
},
|
|
988
|
+
}, zt = ({ date: e, onClick: t, locale: n }) => {
|
|
986
989
|
const { timeZone: o } = O(), i = he({ dateLeft: e, timeZone: o });
|
|
987
|
-
return /* @__PURE__ */
|
|
990
|
+
return /* @__PURE__ */ E("div", { children: [
|
|
988
991
|
/* @__PURE__ */ r(
|
|
989
|
-
|
|
992
|
+
$,
|
|
990
993
|
{
|
|
991
994
|
style: {
|
|
992
995
|
fontWeight: i ? "bold" : "inherit"
|
|
@@ -1000,7 +1003,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
1000
1003
|
}
|
|
1001
1004
|
),
|
|
1002
1005
|
/* @__PURE__ */ r(
|
|
1003
|
-
|
|
1006
|
+
$,
|
|
1004
1007
|
{
|
|
1005
1008
|
color: i ? "primary" : "inherit",
|
|
1006
1009
|
style: {
|
|
@@ -1011,12 +1014,12 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
1011
1014
|
}
|
|
1012
1015
|
)
|
|
1013
1016
|
] });
|
|
1014
|
-
},
|
|
1017
|
+
}, Bt = yt({
|
|
1015
1018
|
renderedSlots: {},
|
|
1016
1019
|
setRenderedSlot: () => {
|
|
1017
1020
|
}
|
|
1018
|
-
}),
|
|
1019
|
-
const { setCurrentDragged: t } = O(), n =
|
|
1021
|
+
}), Lt = () => mt(Bt), dr = (e) => {
|
|
1022
|
+
const { setCurrentDragged: t } = O(), n = ee();
|
|
1020
1023
|
return {
|
|
1021
1024
|
draggable: !0,
|
|
1022
1025
|
onDragStart: (o) => {
|
|
@@ -1032,26 +1035,26 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
1032
1035
|
o.stopPropagation(), o.preventDefault();
|
|
1033
1036
|
}
|
|
1034
1037
|
};
|
|
1035
|
-
},
|
|
1036
|
-
const { direction: s, locale: a, hourFormat:
|
|
1037
|
-
(
|
|
1038
|
-
!(
|
|
1038
|
+
}, We = ({ event: e, multiday: t, hasPrev: n, hasNext: o, showdate: i = !0 }) => {
|
|
1039
|
+
const { direction: s, locale: a, hourFormat: c, eventRenderer: f, onEventClick: u, view: h, disableViewer: _ } = O(), g = dr(e), [w, d] = L(null), [p, y] = L(!1), l = ee(), m = De(c), k = s === "rtl" ? dt : lt, C = s === "rtl" ? lt : dt, D = se(e.start, e.end) <= 0 && e.allDay, { canDrag: T } = Ht(e), M = Z(
|
|
1040
|
+
(v) => {
|
|
1041
|
+
!(v != null && v.currentTarget) && p && y(!1), d((v == null ? void 0 : v.currentTarget) || null);
|
|
1039
1042
|
},
|
|
1040
|
-
[
|
|
1043
|
+
[p]
|
|
1041
1044
|
), I = U(() => {
|
|
1042
1045
|
if (typeof f == "function" && !t && h !== "month") {
|
|
1043
|
-
const
|
|
1044
|
-
if (
|
|
1045
|
-
return /* @__PURE__ */ r(
|
|
1046
|
+
const b = f({ event: e, onClick: M, ...g });
|
|
1047
|
+
if (b)
|
|
1048
|
+
return /* @__PURE__ */ r(ut, { children: b }, `${e.start.getTime()}_${e.end.getTime()}_${e.event_id}`);
|
|
1046
1049
|
}
|
|
1047
|
-
let
|
|
1048
|
-
/* @__PURE__ */ r(
|
|
1049
|
-
e.subtitle && /* @__PURE__ */ r(
|
|
1050
|
-
i && /* @__PURE__ */ r(
|
|
1050
|
+
let v = /* @__PURE__ */ E("div", { style: { padding: "2px 6px" }, children: [
|
|
1051
|
+
/* @__PURE__ */ r($, { variant: "subtitle2", style: { fontSize: 12 }, noWrap: !0, children: e.title }),
|
|
1052
|
+
e.subtitle && /* @__PURE__ */ r($, { variant: "body2", style: { fontSize: 11 }, noWrap: !0, children: e.subtitle }),
|
|
1053
|
+
i && /* @__PURE__ */ r($, { style: { fontSize: 11 }, noWrap: !0, children: `${N(e.start, m, {
|
|
1051
1054
|
locale: a
|
|
1052
|
-
})} - ${N(e.end,
|
|
1055
|
+
})} - ${N(e.end, m, { locale: a })}` })
|
|
1053
1056
|
] });
|
|
1054
|
-
return t && (
|
|
1057
|
+
return t && (v = /* @__PURE__ */ E(
|
|
1055
1058
|
"div",
|
|
1056
1059
|
{
|
|
1057
1060
|
style: {
|
|
@@ -1061,13 +1064,13 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
1061
1064
|
justifyContent: "space-between"
|
|
1062
1065
|
},
|
|
1063
1066
|
children: [
|
|
1064
|
-
/* @__PURE__ */ r(
|
|
1065
|
-
/* @__PURE__ */ r(
|
|
1066
|
-
/* @__PURE__ */ r(
|
|
1067
|
+
/* @__PURE__ */ r($, { sx: { fontSize: 11 }, noWrap: !0, children: n ? /* @__PURE__ */ r(C, { fontSize: "small", sx: { display: "flex" } }) : i && !D && N(e.start, m, { locale: a }) }),
|
|
1068
|
+
/* @__PURE__ */ r($, { variant: "subtitle2", align: "center", sx: { fontSize: 12 }, noWrap: !0, children: e.title }),
|
|
1069
|
+
/* @__PURE__ */ r($, { sx: { fontSize: 11 }, noWrap: !0, children: o ? /* @__PURE__ */ r(k, { fontSize: "small", sx: { display: "flex" } }) : i && !D && N(e.end, m, { locale: a }) })
|
|
1067
1070
|
]
|
|
1068
1071
|
}
|
|
1069
1072
|
)), /* @__PURE__ */ r(
|
|
1070
|
-
|
|
1073
|
+
ut,
|
|
1071
1074
|
{
|
|
1072
1075
|
disabled: e.disabled,
|
|
1073
1076
|
sx: {
|
|
@@ -1080,14 +1083,14 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
1080
1083
|
children: /* @__PURE__ */ r(
|
|
1081
1084
|
un,
|
|
1082
1085
|
{
|
|
1083
|
-
onClick: (
|
|
1084
|
-
|
|
1086
|
+
onClick: (b) => {
|
|
1087
|
+
b.preventDefault(), b.stopPropagation(), _ || M(b), typeof u == "function" && u(e);
|
|
1085
1088
|
},
|
|
1086
1089
|
focusRipple: !0,
|
|
1087
1090
|
tabIndex: _ ? -1 : 0,
|
|
1088
1091
|
disableRipple: _,
|
|
1089
1092
|
disabled: e.disabled,
|
|
1090
|
-
children: /* @__PURE__ */ r("div", { ...
|
|
1093
|
+
children: /* @__PURE__ */ r("div", { ...g, draggable: T, children: v })
|
|
1091
1094
|
}
|
|
1092
1095
|
)
|
|
1093
1096
|
},
|
|
@@ -1099,48 +1102,48 @@ const Qn = Tn("div")(({ theme: e }) => ({
|
|
|
1099
1102
|
h,
|
|
1100
1103
|
e,
|
|
1101
1104
|
i,
|
|
1102
|
-
|
|
1105
|
+
m,
|
|
1103
1106
|
a,
|
|
1104
1107
|
l.palette.primary.main,
|
|
1105
1108
|
l.palette.primary.contrastText,
|
|
1106
1109
|
_,
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
+
g,
|
|
1111
|
+
T,
|
|
1112
|
+
M,
|
|
1110
1113
|
n,
|
|
1111
|
-
|
|
1114
|
+
C,
|
|
1112
1115
|
D,
|
|
1113
1116
|
o,
|
|
1114
|
-
|
|
1115
|
-
|
|
1117
|
+
k,
|
|
1118
|
+
u
|
|
1116
1119
|
]);
|
|
1117
|
-
return /* @__PURE__ */
|
|
1120
|
+
return /* @__PURE__ */ E(ie, { children: [
|
|
1118
1121
|
I,
|
|
1119
|
-
/* @__PURE__ */ r(
|
|
1122
|
+
/* @__PURE__ */ r(Wt, { anchorEl: w, event: e, onTriggerViewer: M })
|
|
1120
1123
|
] });
|
|
1121
1124
|
};
|
|
1122
|
-
function
|
|
1125
|
+
function Le({
|
|
1123
1126
|
startHour: e,
|
|
1124
1127
|
step: t,
|
|
1125
1128
|
minuteHeight: n,
|
|
1126
1129
|
timeZone: o,
|
|
1127
1130
|
currentTime: i
|
|
1128
1131
|
}) {
|
|
1129
|
-
const s = ue(i || /* @__PURE__ */ new Date(), o), a =
|
|
1130
|
-
return
|
|
1132
|
+
const s = ue(i || /* @__PURE__ */ new Date(), o), a = $e(s, xe(s, { hours: e, minutes: 0 })), c = a * n, u = a / t + Ze;
|
|
1133
|
+
return c + u;
|
|
1131
1134
|
}
|
|
1132
1135
|
const cr = (e) => {
|
|
1133
|
-
const [t, n] = L(
|
|
1134
|
-
return
|
|
1135
|
-
const
|
|
1136
|
-
n(
|
|
1137
|
-
const h = setInterval(() => n(
|
|
1136
|
+
const [t, n] = L(Le(e)), { startHour: o, step: i, minuteHeight: s, timeZone: a, currentTime: c, color: f } = e;
|
|
1137
|
+
return K(() => {
|
|
1138
|
+
const u = { startHour: o, step: i, minuteHeight: s, timeZone: a, currentTime: c };
|
|
1139
|
+
n(Le(u));
|
|
1140
|
+
const h = setInterval(() => n(Le(u)), 60 * 1e3);
|
|
1138
1141
|
return () => clearInterval(h);
|
|
1139
|
-
}, [o, i, s, a,
|
|
1142
|
+
}, [o, i, s, a, c]), t < 0 ? null : /* @__PURE__ */ E(ir, { style: { top: t, zIndex: e.zIndex }, color: f, children: [
|
|
1140
1143
|
/* @__PURE__ */ r("div", {}),
|
|
1141
1144
|
/* @__PURE__ */ r("div", {})
|
|
1142
1145
|
] });
|
|
1143
|
-
},
|
|
1146
|
+
}, Vt = ({
|
|
1144
1147
|
todayEvents: e,
|
|
1145
1148
|
today: t,
|
|
1146
1149
|
startHour: n,
|
|
@@ -1148,42 +1151,42 @@ const cr = (e) => {
|
|
|
1148
1151
|
step: i,
|
|
1149
1152
|
minuteHeight: s,
|
|
1150
1153
|
direction: a,
|
|
1151
|
-
timeZone:
|
|
1154
|
+
timeZone: c,
|
|
1152
1155
|
currentTime: f,
|
|
1153
|
-
showCurrentTimeBar:
|
|
1156
|
+
showCurrentTimeBar: u = !0,
|
|
1154
1157
|
currentTimeBarColor: h
|
|
1155
1158
|
}) => {
|
|
1156
1159
|
const _ = [];
|
|
1157
|
-
return /* @__PURE__ */
|
|
1158
|
-
|
|
1160
|
+
return /* @__PURE__ */ E(ie, { children: [
|
|
1161
|
+
u && he({ dateLeft: t, timeZone: c }) && /* @__PURE__ */ r(
|
|
1159
1162
|
cr,
|
|
1160
1163
|
{
|
|
1161
1164
|
startHour: n,
|
|
1162
1165
|
step: i,
|
|
1163
1166
|
minuteHeight: s,
|
|
1164
|
-
timeZone:
|
|
1167
|
+
timeZone: c,
|
|
1165
1168
|
zIndex: 2 * e.length + 1,
|
|
1166
1169
|
currentTime: f,
|
|
1167
1170
|
color: h
|
|
1168
1171
|
}
|
|
1169
1172
|
),
|
|
1170
|
-
e.map((
|
|
1171
|
-
const
|
|
1172
|
-
return _.push(
|
|
1173
|
+
e.map((g, w) => {
|
|
1174
|
+
const d = (o * 60 - n * 60) * s, p = $e(g.end, g.start) * s, y = Math.min(p, d) - Ze, l = n * 60, m = g.start.getHours() * 60 + g.start.getMinutes(), k = Math.max(m - l, 0), C = k * s, T = y / 60 * Ze, M = k / i, I = C + M, v = zn(e, g), b = v.filter((S) => _.includes(S.event_id));
|
|
1175
|
+
return _.push(g.event_id), /* @__PURE__ */ r(
|
|
1173
1176
|
"div",
|
|
1174
1177
|
{
|
|
1175
1178
|
className: "rs__event__item",
|
|
1176
1179
|
style: {
|
|
1177
|
-
height:
|
|
1180
|
+
height: y + T,
|
|
1178
1181
|
top: I,
|
|
1179
|
-
width:
|
|
1182
|
+
width: b.length > 0 ? `calc(100% - ${100 - 98 / (b.length + 1)}%)` : "98%",
|
|
1180
1183
|
// Leave some space to click cell
|
|
1181
|
-
zIndex: e.length +
|
|
1182
|
-
[a === "rtl" ? "right" : "left"]:
|
|
1184
|
+
zIndex: e.length + w,
|
|
1185
|
+
[a === "rtl" ? "right" : "left"]: b.length > 0 ? `${100 / (v.length + 1) * b.length}%` : ""
|
|
1183
1186
|
},
|
|
1184
|
-
children: /* @__PURE__ */ r(
|
|
1187
|
+
children: /* @__PURE__ */ r(We, { event: g })
|
|
1185
1188
|
},
|
|
1186
|
-
`${
|
|
1189
|
+
`${g.event_id}/${g.recurrenceId || ""}`
|
|
1187
1190
|
);
|
|
1188
1191
|
})
|
|
1189
1192
|
] });
|
|
@@ -1192,40 +1195,40 @@ const cr = (e) => {
|
|
|
1192
1195
|
triggerDialog: i,
|
|
1193
1196
|
onCellClick: s,
|
|
1194
1197
|
onDrop: a,
|
|
1195
|
-
currentDragged:
|
|
1198
|
+
currentDragged: c,
|
|
1196
1199
|
setCurrentDragged: f,
|
|
1197
|
-
editable:
|
|
1200
|
+
editable: u,
|
|
1198
1201
|
timeZone: h
|
|
1199
|
-
} = O(), _ =
|
|
1202
|
+
} = O(), _ = ee();
|
|
1200
1203
|
return {
|
|
1201
|
-
tabIndex:
|
|
1202
|
-
disableRipple: !
|
|
1204
|
+
tabIndex: u ? 0 : -1,
|
|
1205
|
+
disableRipple: !u,
|
|
1203
1206
|
onClick: () => {
|
|
1204
|
-
|
|
1207
|
+
u && i(!0, {
|
|
1205
1208
|
start: e,
|
|
1206
1209
|
end: t,
|
|
1207
1210
|
[n]: o
|
|
1208
1211
|
}), s && typeof s == "function" && s(e, t, n, o);
|
|
1209
1212
|
},
|
|
1210
|
-
onDragOver: (
|
|
1211
|
-
|
|
1213
|
+
onDragOver: (g) => {
|
|
1214
|
+
g.preventDefault(), c && (g.currentTarget.style.backgroundColor = Ie(_.palette.secondary.main, 0.3));
|
|
1212
1215
|
},
|
|
1213
|
-
onDragEnter: (
|
|
1214
|
-
|
|
1216
|
+
onDragEnter: (g) => {
|
|
1217
|
+
c && (g.currentTarget.style.backgroundColor = Ie(_.palette.secondary.main, 0.3));
|
|
1215
1218
|
},
|
|
1216
|
-
onDragLeave: (
|
|
1217
|
-
|
|
1219
|
+
onDragLeave: (g) => {
|
|
1220
|
+
c && (g.currentTarget.style.backgroundColor = "");
|
|
1218
1221
|
},
|
|
1219
|
-
onDrop: (
|
|
1220
|
-
if (
|
|
1221
|
-
|
|
1222
|
-
const
|
|
1223
|
-
a(
|
|
1222
|
+
onDrop: (g) => {
|
|
1223
|
+
if (c && c.event_id) {
|
|
1224
|
+
g.preventDefault(), g.currentTarget.style.backgroundColor = "";
|
|
1225
|
+
const w = je(e, h);
|
|
1226
|
+
a(g, c.event_id.toString(), w, n, o), f();
|
|
1224
1227
|
}
|
|
1225
1228
|
},
|
|
1226
1229
|
[n]: o
|
|
1227
1230
|
};
|
|
1228
|
-
},
|
|
1231
|
+
}, et = ({
|
|
1229
1232
|
day: e,
|
|
1230
1233
|
start: t,
|
|
1231
1234
|
end: n,
|
|
@@ -1233,7 +1236,7 @@ const cr = (e) => {
|
|
|
1233
1236
|
resourceVal: i,
|
|
1234
1237
|
cellRenderer: s,
|
|
1235
1238
|
height: a,
|
|
1236
|
-
children:
|
|
1239
|
+
children: c
|
|
1237
1240
|
}) => {
|
|
1238
1241
|
const f = ur({ start: t, end: n, resourceKey: o, resourceVal: i });
|
|
1239
1242
|
return s ? s({
|
|
@@ -1243,7 +1246,7 @@ const cr = (e) => {
|
|
|
1243
1246
|
height: a,
|
|
1244
1247
|
...f
|
|
1245
1248
|
}) : /* @__PURE__ */ r(
|
|
1246
|
-
|
|
1249
|
+
J,
|
|
1247
1250
|
{
|
|
1248
1251
|
fullWidth: !0,
|
|
1249
1252
|
"aria-label": `${t.toLocaleString("en", {
|
|
@@ -1251,7 +1254,7 @@ const cr = (e) => {
|
|
|
1251
1254
|
timeStyle: "long"
|
|
1252
1255
|
})} - ${n.toLocaleString("en", { dateStyle: "full", timeStyle: "long" })}`,
|
|
1253
1256
|
...f,
|
|
1254
|
-
children:
|
|
1257
|
+
children: c
|
|
1255
1258
|
}
|
|
1256
1259
|
);
|
|
1257
1260
|
}, hr = ({
|
|
@@ -1264,140 +1267,140 @@ const cr = (e) => {
|
|
|
1264
1267
|
}) => {
|
|
1265
1268
|
const {
|
|
1266
1269
|
week: a,
|
|
1267
|
-
events:
|
|
1270
|
+
events: c,
|
|
1268
1271
|
handleGotoDay: f,
|
|
1269
|
-
resources:
|
|
1272
|
+
resources: u,
|
|
1270
1273
|
resourceFields: h,
|
|
1271
1274
|
resourceViewMode: _,
|
|
1272
|
-
direction:
|
|
1273
|
-
locale:
|
|
1274
|
-
hourFormat:
|
|
1275
|
-
timeZone:
|
|
1276
|
-
stickyNavigation:
|
|
1275
|
+
direction: g,
|
|
1276
|
+
locale: w,
|
|
1277
|
+
hourFormat: d,
|
|
1278
|
+
timeZone: p,
|
|
1279
|
+
stickyNavigation: y,
|
|
1277
1280
|
stickyNavigationOffset: l,
|
|
1278
|
-
stickyNavigationHeight:
|
|
1279
|
-
currentTime:
|
|
1280
|
-
showCurrentTimeBar:
|
|
1281
|
+
stickyNavigationHeight: m,
|
|
1282
|
+
currentTime: k,
|
|
1283
|
+
showCurrentTimeBar: C,
|
|
1281
1284
|
currentTimeBarColor: D,
|
|
1282
|
-
forceInlineMultiDay:
|
|
1283
|
-
} = O(), { startHour:
|
|
1284
|
-
const
|
|
1285
|
-
|
|
1285
|
+
forceInlineMultiDay: T
|
|
1286
|
+
} = O(), { startHour: M, endHour: I, step: v, cellRenderer: b, disableGoToDay: S, headRenderer: x, hourRenderer: W } = a, { renderedSlots: R } = Lt(), { headersRef: V, bodyRef: te } = Pt(), G = pe, ae = X(e[0]), ne = q(e[e.length - 1]), P = De(d), fe = U(() => {
|
|
1287
|
+
const F = u.length && _ === "default", A = Oe(
|
|
1288
|
+
F ? c : i,
|
|
1286
1289
|
e,
|
|
1287
|
-
|
|
1290
|
+
p,
|
|
1288
1291
|
!0,
|
|
1289
|
-
|
|
1292
|
+
T
|
|
1290
1293
|
);
|
|
1291
|
-
return
|
|
1294
|
+
return G * A.length + 45;
|
|
1292
1295
|
}, [
|
|
1293
|
-
|
|
1296
|
+
G,
|
|
1294
1297
|
e,
|
|
1295
|
-
|
|
1298
|
+
c,
|
|
1296
1299
|
_,
|
|
1297
1300
|
i,
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
]),
|
|
1301
|
-
const
|
|
1302
|
-
return
|
|
1303
|
-
|
|
1301
|
+
u.length,
|
|
1302
|
+
p
|
|
1303
|
+
]), ge = (F, A, H) => {
|
|
1304
|
+
const re = ye(ae, A);
|
|
1305
|
+
return Oe(
|
|
1306
|
+
F,
|
|
1304
1307
|
e,
|
|
1305
|
-
|
|
1308
|
+
p,
|
|
1306
1309
|
void 0,
|
|
1307
|
-
|
|
1308
|
-
).filter((B) => me(B.start,
|
|
1309
|
-
var
|
|
1310
|
-
const
|
|
1310
|
+
T
|
|
1311
|
+
).filter((B) => me(B.start, ae) ? re : ye(B.start, A)).sort((B, ce) => ce.end.getTime() - B.end.getTime()).map((B) => {
|
|
1312
|
+
var nt;
|
|
1313
|
+
const ce = me(X(B.start), ae), Ce = Me(q(B.end), ne), Ee = se(ce ? ae : B.start, Ce ? ne : B.end) + 1, Gt = N(A, "yyyy-MM-dd"), jt = H ? H[h.idField] : "all", ze = (nt = R == null ? void 0 : R[jt]) == null ? void 0 : nt[Gt], Ut = (ze == null ? void 0 : ze[B.event_id]) || 0;
|
|
1311
1314
|
return /* @__PURE__ */ r(
|
|
1312
1315
|
"div",
|
|
1313
1316
|
{
|
|
1314
1317
|
className: "rs__multi_day",
|
|
1315
1318
|
style: {
|
|
1316
|
-
top: Ut *
|
|
1317
|
-
width: `${99.9 *
|
|
1319
|
+
top: Ut * G + 45,
|
|
1320
|
+
width: `${99.9 * Ee}%`,
|
|
1318
1321
|
overflowX: "hidden"
|
|
1319
1322
|
},
|
|
1320
|
-
children: /* @__PURE__ */ r(
|
|
1323
|
+
children: /* @__PURE__ */ r(We, { event: B, hasPrev: ce, hasNext: Ce, multiday: !0 })
|
|
1321
1324
|
},
|
|
1322
1325
|
B.event_id
|
|
1323
1326
|
);
|
|
1324
1327
|
});
|
|
1325
1328
|
};
|
|
1326
|
-
return /* @__PURE__ */
|
|
1327
|
-
/* @__PURE__ */
|
|
1329
|
+
return /* @__PURE__ */ E(Y, { children: [
|
|
1330
|
+
/* @__PURE__ */ E(
|
|
1328
1331
|
be,
|
|
1329
1332
|
{
|
|
1330
1333
|
days: e.length,
|
|
1331
|
-
ref:
|
|
1334
|
+
ref: V,
|
|
1332
1335
|
sticky: "1",
|
|
1333
|
-
stickyNavigation:
|
|
1336
|
+
stickyNavigation: y,
|
|
1334
1337
|
stickyOffset: l,
|
|
1335
|
-
stickyHeight:
|
|
1338
|
+
stickyHeight: m,
|
|
1336
1339
|
children: [
|
|
1337
1340
|
/* @__PURE__ */ r("span", { className: "rs__cell rs__time" }),
|
|
1338
|
-
e.map((
|
|
1341
|
+
e.map((F, A) => /* @__PURE__ */ E(
|
|
1339
1342
|
"span",
|
|
1340
1343
|
{
|
|
1341
|
-
className: `rs__cell rs__header ${
|
|
1344
|
+
className: `rs__cell rs__header ${_e(F) ? "rs__today_cell" : ""}`,
|
|
1342
1345
|
style: { height: fe },
|
|
1343
1346
|
children: [
|
|
1344
|
-
typeof
|
|
1345
|
-
|
|
1347
|
+
typeof x == "function" ? /* @__PURE__ */ r("div", { children: x({ day: F, events: i, resource: s }) }) : /* @__PURE__ */ r(
|
|
1348
|
+
zt,
|
|
1346
1349
|
{
|
|
1347
|
-
date:
|
|
1348
|
-
onClick:
|
|
1349
|
-
locale:
|
|
1350
|
+
date: F,
|
|
1351
|
+
onClick: S ? void 0 : f,
|
|
1352
|
+
locale: w
|
|
1350
1353
|
}
|
|
1351
1354
|
),
|
|
1352
|
-
|
|
1355
|
+
ge(i, F, s)
|
|
1353
1356
|
]
|
|
1354
1357
|
},
|
|
1355
|
-
|
|
1358
|
+
A
|
|
1356
1359
|
))
|
|
1357
1360
|
]
|
|
1358
1361
|
}
|
|
1359
1362
|
),
|
|
1360
|
-
/* @__PURE__ */ r(be, { days: e.length, ref:
|
|
1361
|
-
/* @__PURE__ */ r("span", { style: { height: n }, className: "rs__cell rs__header rs__time", children: typeof W == "function" ? /* @__PURE__ */ r("div", { children: W(N(
|
|
1362
|
-
e.map((
|
|
1363
|
-
const
|
|
1364
|
-
return /* @__PURE__ */
|
|
1365
|
-
|
|
1366
|
-
|
|
1363
|
+
/* @__PURE__ */ r(be, { days: e.length, ref: te, children: t.map((F, A) => /* @__PURE__ */ E(ie, { children: [
|
|
1364
|
+
/* @__PURE__ */ r("span", { style: { height: n }, className: "rs__cell rs__header rs__time", children: typeof W == "function" ? /* @__PURE__ */ r("div", { children: W(N(F, P, { locale: w })) }) : /* @__PURE__ */ r($, { variant: "caption", children: N(F, P, { locale: w }) }) }),
|
|
1365
|
+
e.map((H, re) => {
|
|
1366
|
+
const z = /* @__PURE__ */ new Date(`${N(H, "yyyy/MM/dd")} ${N(F, P)}`), oe = de(z, v), B = h.idField;
|
|
1367
|
+
return /* @__PURE__ */ E("span", { className: `rs__cell ${_e(H) ? "rs__today_cell" : ""}`, children: [
|
|
1368
|
+
A === 0 && /* @__PURE__ */ r(
|
|
1369
|
+
Vt,
|
|
1367
1370
|
{
|
|
1368
|
-
todayEvents:
|
|
1371
|
+
todayEvents: Ot(
|
|
1369
1372
|
i,
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
+
H,
|
|
1374
|
+
p,
|
|
1375
|
+
T
|
|
1373
1376
|
),
|
|
1374
|
-
today:
|
|
1377
|
+
today: H,
|
|
1375
1378
|
minuteHeight: o,
|
|
1376
|
-
startHour:
|
|
1379
|
+
startHour: M,
|
|
1377
1380
|
endHour: I,
|
|
1378
|
-
step:
|
|
1379
|
-
direction:
|
|
1380
|
-
timeZone:
|
|
1381
|
-
currentTime:
|
|
1382
|
-
showCurrentTimeBar:
|
|
1381
|
+
step: v,
|
|
1382
|
+
direction: g,
|
|
1383
|
+
timeZone: p,
|
|
1384
|
+
currentTime: k,
|
|
1385
|
+
showCurrentTimeBar: C,
|
|
1383
1386
|
currentTimeBarColor: D
|
|
1384
1387
|
}
|
|
1385
1388
|
),
|
|
1386
1389
|
/* @__PURE__ */ r(
|
|
1387
|
-
|
|
1390
|
+
et,
|
|
1388
1391
|
{
|
|
1389
|
-
start:
|
|
1390
|
-
end:
|
|
1391
|
-
day:
|
|
1392
|
+
start: z,
|
|
1393
|
+
end: oe,
|
|
1394
|
+
day: H,
|
|
1392
1395
|
height: n,
|
|
1393
1396
|
resourceKey: B,
|
|
1394
1397
|
resourceVal: s ? s[B] : null,
|
|
1395
|
-
cellRenderer:
|
|
1398
|
+
cellRenderer: b
|
|
1396
1399
|
}
|
|
1397
1400
|
)
|
|
1398
|
-
] },
|
|
1401
|
+
] }, re);
|
|
1399
1402
|
})
|
|
1400
|
-
] },
|
|
1403
|
+
] }, A)) })
|
|
1401
1404
|
] });
|
|
1402
1405
|
}, fr = () => {
|
|
1403
1406
|
const {
|
|
@@ -1408,22 +1411,23 @@ const cr = (e) => {
|
|
|
1408
1411
|
getRemoteEvents: i,
|
|
1409
1412
|
triggerLoading: s,
|
|
1410
1413
|
handleState: a,
|
|
1411
|
-
resources:
|
|
1414
|
+
resources: c,
|
|
1412
1415
|
resourceFields: f,
|
|
1413
|
-
fields:
|
|
1414
|
-
agenda: h
|
|
1415
|
-
|
|
1416
|
+
fields: u,
|
|
1417
|
+
agenda: h,
|
|
1418
|
+
_refetchToken: _
|
|
1419
|
+
} = O(), { weekStartOn: g, weekDays: w, startHour: d, endHour: p, step: y } = e, l = Re(t, { weekStartsOn: g }), m = w.map((x) => Q(l, x)), k = X(m[0]), C = q(m[m.length - 1]), D = xe(t, { hours: d, minutes: 0, seconds: 0 }), T = xe(t, { hours: p, minutes: -y, seconds: 0 }), M = bt(
|
|
1416
1420
|
{
|
|
1417
|
-
start:
|
|
1418
|
-
end:
|
|
1421
|
+
start: D,
|
|
1422
|
+
end: T
|
|
1419
1423
|
},
|
|
1420
|
-
{ step:
|
|
1421
|
-
),
|
|
1424
|
+
{ step: y }
|
|
1425
|
+
), I = It(n, M.length), v = Mt(I, y), b = Z(async () => {
|
|
1422
1426
|
try {
|
|
1423
1427
|
s(!0);
|
|
1424
1428
|
const x = await i({
|
|
1425
|
-
start:
|
|
1426
|
-
end:
|
|
1429
|
+
start: k,
|
|
1430
|
+
end: C,
|
|
1427
1431
|
view: "week"
|
|
1428
1432
|
});
|
|
1429
1433
|
Array.isArray(x) && a(x, "events");
|
|
@@ -1432,33 +1436,33 @@ const cr = (e) => {
|
|
|
1432
1436
|
} finally {
|
|
1433
1437
|
s(!1);
|
|
1434
1438
|
}
|
|
1435
|
-
}, [i]);
|
|
1436
|
-
|
|
1437
|
-
i instanceof Function &&
|
|
1438
|
-
}, [
|
|
1439
|
-
const
|
|
1440
|
-
let
|
|
1441
|
-
return x && (
|
|
1439
|
+
}, [i, _]);
|
|
1440
|
+
K(() => {
|
|
1441
|
+
i instanceof Function && b();
|
|
1442
|
+
}, [b, i, _]);
|
|
1443
|
+
const S = (x) => {
|
|
1444
|
+
let W = o;
|
|
1445
|
+
return x && (W = Te(o, x, f, u)), h ? /* @__PURE__ */ r(sr, { daysList: m, resource: x, events: W }) : /* @__PURE__ */ r(
|
|
1442
1446
|
hr,
|
|
1443
1447
|
{
|
|
1444
|
-
resourcedEvents:
|
|
1448
|
+
resourcedEvents: W,
|
|
1445
1449
|
resource: x,
|
|
1446
|
-
hours:
|
|
1447
|
-
cellHeight:
|
|
1448
|
-
minutesHeight:
|
|
1449
|
-
daysList:
|
|
1450
|
+
hours: M,
|
|
1451
|
+
cellHeight: I,
|
|
1452
|
+
minutesHeight: v,
|
|
1453
|
+
daysList: m
|
|
1450
1454
|
}
|
|
1451
1455
|
);
|
|
1452
1456
|
};
|
|
1453
|
-
return
|
|
1454
|
-
},
|
|
1457
|
+
return c.length ? /* @__PURE__ */ r(Qe, { renderChildren: S }) : S();
|
|
1458
|
+
}, Pe = ({ children: e }) => {
|
|
1455
1459
|
const { locale: t } = O();
|
|
1456
1460
|
return /* @__PURE__ */ r(Nn, { dateAdapter: On, adapterLocale: t, children: e });
|
|
1457
1461
|
}, we = ({ type: e, onClick: t, ...n }) => {
|
|
1458
1462
|
const { direction: o } = O();
|
|
1459
|
-
let i =
|
|
1460
|
-
return e === "prev" ? i = o === "rtl" ?
|
|
1461
|
-
|
|
1463
|
+
let i = Be;
|
|
1464
|
+
return e === "prev" ? i = o === "rtl" ? Be : ct : e === "next" && (i = o === "rtl" ? ct : Be), /* @__PURE__ */ r(
|
|
1465
|
+
ve,
|
|
1462
1466
|
{
|
|
1463
1467
|
style: { padding: 2 },
|
|
1464
1468
|
onClick: t,
|
|
@@ -1469,54 +1473,54 @@ const cr = (e) => {
|
|
|
1469
1473
|
children: /* @__PURE__ */ r(i, {})
|
|
1470
1474
|
}
|
|
1471
1475
|
);
|
|
1472
|
-
},
|
|
1473
|
-
const { selectedDate: e, week: t, navigationPickerProps: n, view: o } = O(), i = n == null ? void 0 : n.minDate, s = n == null ? void 0 : n.maxDate, a = o === "month" ?
|
|
1474
|
-
return { prevDisabled: f, nextDisabled:
|
|
1476
|
+
}, tt = () => {
|
|
1477
|
+
const { selectedDate: e, week: t, navigationPickerProps: n, view: o } = O(), i = n == null ? void 0 : n.minDate, s = n == null ? void 0 : n.maxDate, a = o === "month" ? wt(e) : o === "week" ? Dt(e, { weekStartsOn: t == null ? void 0 : t.weekStartOn }) : e, c = o === "month" ? qe(e) : o === "week" ? Re(e, { weekStartsOn: t == null ? void 0 : t.weekStartOn }) : e, f = i ? c <= i : !1, u = s ? a >= s : !1;
|
|
1478
|
+
return { prevDisabled: f, nextDisabled: u };
|
|
1475
1479
|
}, gr = ({ selectedDate: e, onChange: t, weekProps: n }) => {
|
|
1476
|
-
const { locale: o, navigationPickerProps: i } = O(), [s, a] = L(null), { weekStartOn:
|
|
1480
|
+
const { locale: o, navigationPickerProps: i } = O(), [s, a] = L(null), { weekStartOn: c } = n, f = Re(e, { weekStartsOn: c }), u = Dt(e, { weekStartsOn: c }), { prevDisabled: h, nextDisabled: _ } = tt(), g = (l) => {
|
|
1477
1481
|
a(l.currentTarget);
|
|
1478
|
-
},
|
|
1482
|
+
}, w = () => {
|
|
1479
1483
|
a(null);
|
|
1480
|
-
},
|
|
1481
|
-
t(l || /* @__PURE__ */ new Date()),
|
|
1482
|
-
},
|
|
1484
|
+
}, d = (l) => {
|
|
1485
|
+
t(l || /* @__PURE__ */ new Date()), w();
|
|
1486
|
+
}, p = () => {
|
|
1483
1487
|
const l = Q(f, -1);
|
|
1484
1488
|
t(l);
|
|
1485
|
-
},
|
|
1486
|
-
const l = Q(
|
|
1489
|
+
}, y = () => {
|
|
1490
|
+
const l = Q(u, 1);
|
|
1487
1491
|
t(l);
|
|
1488
1492
|
};
|
|
1489
|
-
return /* @__PURE__ */
|
|
1493
|
+
return /* @__PURE__ */ E(Y, { children: [
|
|
1490
1494
|
/* @__PURE__ */ r(
|
|
1491
1495
|
we,
|
|
1492
1496
|
{
|
|
1493
1497
|
type: "prev",
|
|
1494
|
-
onClick:
|
|
1498
|
+
onClick: p,
|
|
1495
1499
|
disabled: h,
|
|
1496
1500
|
"aria-label": "previous week"
|
|
1497
1501
|
}
|
|
1498
1502
|
),
|
|
1499
|
-
/* @__PURE__ */ r(
|
|
1503
|
+
/* @__PURE__ */ r(J, { style: { padding: 4 }, onClick: g, "aria-label": "selected week", children: `${N(f, "dd", { locale: o })} - ${N(u, "dd MMM yyyy", {
|
|
1500
1504
|
locale: o
|
|
1501
1505
|
})}` }),
|
|
1502
1506
|
/* @__PURE__ */ r(
|
|
1503
|
-
|
|
1507
|
+
ke,
|
|
1504
1508
|
{
|
|
1505
1509
|
open: !!s,
|
|
1506
1510
|
anchorEl: s,
|
|
1507
|
-
onClose:
|
|
1511
|
+
onClose: w,
|
|
1508
1512
|
anchorOrigin: {
|
|
1509
1513
|
vertical: "bottom",
|
|
1510
1514
|
horizontal: "left"
|
|
1511
1515
|
},
|
|
1512
|
-
children: /* @__PURE__ */ r(
|
|
1513
|
-
|
|
1516
|
+
children: /* @__PURE__ */ r(Pe, { children: /* @__PURE__ */ r(
|
|
1517
|
+
Ye,
|
|
1514
1518
|
{
|
|
1515
1519
|
...i,
|
|
1516
1520
|
openTo: "day",
|
|
1517
1521
|
views: ["month", "day"],
|
|
1518
1522
|
value: e,
|
|
1519
|
-
onChange:
|
|
1523
|
+
onChange: d
|
|
1520
1524
|
}
|
|
1521
1525
|
) })
|
|
1522
1526
|
}
|
|
@@ -1525,27 +1529,27 @@ const cr = (e) => {
|
|
|
1525
1529
|
we,
|
|
1526
1530
|
{
|
|
1527
1531
|
type: "next",
|
|
1528
|
-
onClick:
|
|
1532
|
+
onClick: y,
|
|
1529
1533
|
disabled: _,
|
|
1530
1534
|
"aria-label": "next week"
|
|
1531
1535
|
}
|
|
1532
1536
|
)
|
|
1533
1537
|
] });
|
|
1534
1538
|
}, pr = ({ selectedDate: e, onChange: t }) => {
|
|
1535
|
-
const { locale: n, navigationPickerProps: o } = O(), [i, s] = L(null), { prevDisabled: a, nextDisabled:
|
|
1536
|
-
s(
|
|
1537
|
-
},
|
|
1539
|
+
const { locale: n, navigationPickerProps: o } = O(), [i, s] = L(null), { prevDisabled: a, nextDisabled: c } = tt(), f = (w) => {
|
|
1540
|
+
s(w.currentTarget);
|
|
1541
|
+
}, u = () => {
|
|
1538
1542
|
s(null);
|
|
1539
|
-
}, h = (
|
|
1540
|
-
t(
|
|
1543
|
+
}, h = (w) => {
|
|
1544
|
+
t(w || /* @__PURE__ */ new Date()), u();
|
|
1541
1545
|
}, _ = () => {
|
|
1542
|
-
const
|
|
1543
|
-
t(
|
|
1544
|
-
},
|
|
1545
|
-
const
|
|
1546
|
-
t(
|
|
1546
|
+
const w = Q(e, -1);
|
|
1547
|
+
t(w);
|
|
1548
|
+
}, g = () => {
|
|
1549
|
+
const w = Q(e, 1);
|
|
1550
|
+
t(w);
|
|
1547
1551
|
};
|
|
1548
|
-
return /* @__PURE__ */
|
|
1552
|
+
return /* @__PURE__ */ E(Y, { children: [
|
|
1549
1553
|
/* @__PURE__ */ r(
|
|
1550
1554
|
we,
|
|
1551
1555
|
{
|
|
@@ -1555,19 +1559,19 @@ const cr = (e) => {
|
|
|
1555
1559
|
"aria-label": "previous day"
|
|
1556
1560
|
}
|
|
1557
1561
|
),
|
|
1558
|
-
/* @__PURE__ */ r(
|
|
1562
|
+
/* @__PURE__ */ r(J, { style: { padding: 4 }, onClick: f, "aria-label": "selected date", children: N(e, "dd MMMM yyyy", { locale: n }) }),
|
|
1559
1563
|
/* @__PURE__ */ r(
|
|
1560
|
-
|
|
1564
|
+
ke,
|
|
1561
1565
|
{
|
|
1562
1566
|
open: !!i,
|
|
1563
1567
|
anchorEl: i,
|
|
1564
|
-
onClose:
|
|
1568
|
+
onClose: u,
|
|
1565
1569
|
anchorOrigin: {
|
|
1566
1570
|
vertical: "bottom",
|
|
1567
1571
|
horizontal: "left"
|
|
1568
1572
|
},
|
|
1569
|
-
children: /* @__PURE__ */ r(
|
|
1570
|
-
|
|
1573
|
+
children: /* @__PURE__ */ r(Pe, { children: /* @__PURE__ */ r(
|
|
1574
|
+
Ye,
|
|
1571
1575
|
{
|
|
1572
1576
|
...o,
|
|
1573
1577
|
openTo: "day",
|
|
@@ -1578,35 +1582,35 @@ const cr = (e) => {
|
|
|
1578
1582
|
) })
|
|
1579
1583
|
}
|
|
1580
1584
|
),
|
|
1581
|
-
/* @__PURE__ */ r(we, { type: "next", onClick:
|
|
1585
|
+
/* @__PURE__ */ r(we, { type: "next", onClick: g, disabled: c, "aria-label": "next day" })
|
|
1582
1586
|
] });
|
|
1583
1587
|
}, yr = ({ selectedDate: e, onChange: t }) => {
|
|
1584
|
-
const { locale: n, navigationPickerProps: o } = O(), i = Qt(e), [s, a] = L(null), { prevDisabled:
|
|
1585
|
-
a(
|
|
1588
|
+
const { locale: n, navigationPickerProps: o } = O(), i = Qt(e), [s, a] = L(null), { prevDisabled: c, nextDisabled: f } = tt(), u = (d) => {
|
|
1589
|
+
a(d.currentTarget);
|
|
1586
1590
|
}, h = () => {
|
|
1587
1591
|
a(null);
|
|
1588
|
-
}, _ = (
|
|
1589
|
-
t(
|
|
1590
|
-
},
|
|
1591
|
-
const
|
|
1592
|
-
t(
|
|
1593
|
-
},
|
|
1594
|
-
const
|
|
1595
|
-
t(
|
|
1592
|
+
}, _ = (d) => {
|
|
1593
|
+
t(d || /* @__PURE__ */ new Date()), h();
|
|
1594
|
+
}, g = () => {
|
|
1595
|
+
const d = i - 1;
|
|
1596
|
+
t(ot(e, d));
|
|
1597
|
+
}, w = () => {
|
|
1598
|
+
const d = i + 1;
|
|
1599
|
+
t(ot(e, d));
|
|
1596
1600
|
};
|
|
1597
|
-
return /* @__PURE__ */
|
|
1601
|
+
return /* @__PURE__ */ E(Y, { children: [
|
|
1598
1602
|
/* @__PURE__ */ r(
|
|
1599
1603
|
we,
|
|
1600
1604
|
{
|
|
1601
1605
|
type: "prev",
|
|
1602
|
-
onClick:
|
|
1603
|
-
disabled:
|
|
1606
|
+
onClick: g,
|
|
1607
|
+
disabled: c,
|
|
1604
1608
|
"aria-label": "previous month"
|
|
1605
1609
|
}
|
|
1606
1610
|
),
|
|
1607
|
-
/* @__PURE__ */ r(
|
|
1611
|
+
/* @__PURE__ */ r(J, { style: { padding: 4 }, onClick: u, "aria-label": "selected month", children: N(e, "MMMM yyyy", { locale: n }) }),
|
|
1608
1612
|
/* @__PURE__ */ r(
|
|
1609
|
-
|
|
1613
|
+
ke,
|
|
1610
1614
|
{
|
|
1611
1615
|
open: !!s,
|
|
1612
1616
|
anchorEl: s,
|
|
@@ -1615,8 +1619,8 @@ const cr = (e) => {
|
|
|
1615
1619
|
vertical: "bottom",
|
|
1616
1620
|
horizontal: "left"
|
|
1617
1621
|
},
|
|
1618
|
-
children: /* @__PURE__ */ r(
|
|
1619
|
-
|
|
1622
|
+
children: /* @__PURE__ */ r(Pe, { children: /* @__PURE__ */ r(
|
|
1623
|
+
Ye,
|
|
1620
1624
|
{
|
|
1621
1625
|
...o,
|
|
1622
1626
|
openTo: "month",
|
|
@@ -1631,7 +1635,7 @@ const cr = (e) => {
|
|
|
1631
1635
|
we,
|
|
1632
1636
|
{
|
|
1633
1637
|
type: "next",
|
|
1634
|
-
onClick:
|
|
1638
|
+
onClick: w,
|
|
1635
1639
|
disabled: f,
|
|
1636
1640
|
"aria-label": "next month"
|
|
1637
1641
|
}
|
|
@@ -1646,107 +1650,107 @@ const cr = (e) => {
|
|
|
1646
1650
|
getViews: i,
|
|
1647
1651
|
translations: s,
|
|
1648
1652
|
navigation: a,
|
|
1649
|
-
day:
|
|
1653
|
+
day: c,
|
|
1650
1654
|
month: f,
|
|
1651
|
-
disableViewNavigator:
|
|
1655
|
+
disableViewNavigator: u,
|
|
1652
1656
|
onSelectedDateChange: h,
|
|
1653
1657
|
onViewChange: _,
|
|
1654
|
-
stickyNavigation:
|
|
1655
|
-
timeZone:
|
|
1656
|
-
agenda:
|
|
1657
|
-
toggleAgenda:
|
|
1658
|
-
enableAgenda:
|
|
1658
|
+
stickyNavigation: g,
|
|
1659
|
+
timeZone: w,
|
|
1660
|
+
agenda: d,
|
|
1661
|
+
toggleAgenda: p,
|
|
1662
|
+
enableAgenda: y,
|
|
1659
1663
|
customHeaderContent: l,
|
|
1660
|
-
stickyNavigationOffset:
|
|
1661
|
-
} = O(), [
|
|
1662
|
-
|
|
1663
|
-
},
|
|
1664
|
-
o(
|
|
1665
|
-
},
|
|
1666
|
-
o(
|
|
1667
|
-
},
|
|
1664
|
+
stickyNavigationOffset: m
|
|
1665
|
+
} = O(), [k, C] = L(null), D = ee(), T = Et(D.breakpoints.up("sm")), M = i(), I = (x) => {
|
|
1666
|
+
C(x || null);
|
|
1667
|
+
}, v = (x) => {
|
|
1668
|
+
o(x, "selectedDate"), h && typeof h == "function" && h(x);
|
|
1669
|
+
}, b = (x) => {
|
|
1670
|
+
o(x, "view"), _ && typeof _ == "function" && _(x, d);
|
|
1671
|
+
}, S = () => {
|
|
1668
1672
|
switch (t) {
|
|
1669
1673
|
case "month":
|
|
1670
|
-
return (f == null ? void 0 : f.navigation) && /* @__PURE__ */ r(yr, { selectedDate: e, onChange:
|
|
1674
|
+
return (f == null ? void 0 : f.navigation) && /* @__PURE__ */ r(yr, { selectedDate: e, onChange: v });
|
|
1671
1675
|
case "week":
|
|
1672
1676
|
return (n == null ? void 0 : n.navigation) && /* @__PURE__ */ r(
|
|
1673
1677
|
gr,
|
|
1674
1678
|
{
|
|
1675
1679
|
selectedDate: e,
|
|
1676
|
-
onChange:
|
|
1680
|
+
onChange: v,
|
|
1677
1681
|
weekProps: n
|
|
1678
1682
|
}
|
|
1679
1683
|
);
|
|
1680
1684
|
case "day":
|
|
1681
|
-
return (
|
|
1685
|
+
return (c == null ? void 0 : c.navigation) && /* @__PURE__ */ r(pr, { selectedDate: e, onChange: v });
|
|
1682
1686
|
default:
|
|
1683
1687
|
return "";
|
|
1684
1688
|
}
|
|
1685
1689
|
};
|
|
1686
|
-
return !a &&
|
|
1687
|
-
/* @__PURE__ */ r("div", { "data-testid": "date-navigator", children: a &&
|
|
1690
|
+
return !a && u ? null : /* @__PURE__ */ E(nr, { sticky: g ? "1" : "0", offset: m, children: [
|
|
1691
|
+
/* @__PURE__ */ r("div", { "data-testid": "date-navigator", children: a && S() }),
|
|
1688
1692
|
l && /* @__PURE__ */ r("div", { className: "rs__custom_header_content", children: l() }),
|
|
1689
|
-
/* @__PURE__ */
|
|
1693
|
+
/* @__PURE__ */ E(
|
|
1690
1694
|
"div",
|
|
1691
1695
|
{
|
|
1692
1696
|
className: "rs__view_navigator",
|
|
1693
1697
|
"data-testid": "view-navigator",
|
|
1694
1698
|
style: {
|
|
1695
|
-
visibility:
|
|
1699
|
+
visibility: u ? "hidden" : "visible"
|
|
1696
1700
|
},
|
|
1697
1701
|
children: [
|
|
1698
1702
|
/* @__PURE__ */ r(
|
|
1699
|
-
|
|
1703
|
+
J,
|
|
1700
1704
|
{
|
|
1701
|
-
onClick: () =>
|
|
1705
|
+
onClick: () => v(ue(/* @__PURE__ */ new Date(), w)),
|
|
1702
1706
|
"aria-label": s.navigation.today,
|
|
1703
1707
|
children: s.navigation.today
|
|
1704
1708
|
}
|
|
1705
1709
|
),
|
|
1706
|
-
|
|
1707
|
-
|
|
1710
|
+
y && (T ? /* @__PURE__ */ r(
|
|
1711
|
+
J,
|
|
1708
1712
|
{
|
|
1709
|
-
color:
|
|
1710
|
-
onClick:
|
|
1713
|
+
color: d ? "primary" : "inherit",
|
|
1714
|
+
onClick: p,
|
|
1711
1715
|
"aria-label": s.navigation.agenda,
|
|
1712
1716
|
children: s.navigation.agenda
|
|
1713
1717
|
}
|
|
1714
1718
|
) : /* @__PURE__ */ r(
|
|
1715
|
-
|
|
1719
|
+
ve,
|
|
1716
1720
|
{
|
|
1717
|
-
color:
|
|
1721
|
+
color: d ? "primary" : "default",
|
|
1718
1722
|
style: { padding: 5 },
|
|
1719
|
-
onClick:
|
|
1723
|
+
onClick: p,
|
|
1720
1724
|
children: /* @__PURE__ */ r($n, {})
|
|
1721
1725
|
}
|
|
1722
1726
|
)),
|
|
1723
|
-
|
|
1724
|
-
|
|
1727
|
+
M.length > 1 && (T ? M.map((x) => /* @__PURE__ */ r(
|
|
1728
|
+
J,
|
|
1725
1729
|
{
|
|
1726
|
-
color:
|
|
1727
|
-
onClick: () =>
|
|
1730
|
+
color: x === t ? "primary" : "inherit",
|
|
1731
|
+
onClick: () => b(x),
|
|
1728
1732
|
onDragOver: (W) => {
|
|
1729
|
-
W.preventDefault(),
|
|
1733
|
+
W.preventDefault(), b(x);
|
|
1730
1734
|
},
|
|
1731
|
-
children: s.navigation[
|
|
1735
|
+
children: s.navigation[x]
|
|
1732
1736
|
},
|
|
1733
|
-
|
|
1734
|
-
)) : /* @__PURE__ */
|
|
1737
|
+
x
|
|
1738
|
+
)) : /* @__PURE__ */ E(ie, { children: [
|
|
1735
1739
|
/* @__PURE__ */ r(
|
|
1736
|
-
|
|
1740
|
+
ve,
|
|
1737
1741
|
{
|
|
1738
1742
|
style: { padding: 5 },
|
|
1739
|
-
onClick: (
|
|
1740
|
-
I(
|
|
1743
|
+
onClick: (x) => {
|
|
1744
|
+
I(x.currentTarget);
|
|
1741
1745
|
},
|
|
1742
1746
|
children: /* @__PURE__ */ r(Fn, {})
|
|
1743
1747
|
}
|
|
1744
1748
|
),
|
|
1745
1749
|
/* @__PURE__ */ r(
|
|
1746
|
-
|
|
1750
|
+
ke,
|
|
1747
1751
|
{
|
|
1748
|
-
open: !!
|
|
1749
|
-
anchorEl:
|
|
1752
|
+
open: !!k,
|
|
1753
|
+
anchorEl: k,
|
|
1750
1754
|
onClose: () => {
|
|
1751
1755
|
I();
|
|
1752
1756
|
},
|
|
@@ -1758,16 +1762,16 @@ const cr = (e) => {
|
|
|
1758
1762
|
vertical: "top",
|
|
1759
1763
|
horizontal: "center"
|
|
1760
1764
|
},
|
|
1761
|
-
children: /* @__PURE__ */ r(hn, { autoFocusItem: !!
|
|
1762
|
-
|
|
1765
|
+
children: /* @__PURE__ */ r(hn, { autoFocusItem: !!k, disablePadding: !0, children: M.map((x) => /* @__PURE__ */ r(
|
|
1766
|
+
Ve,
|
|
1763
1767
|
{
|
|
1764
|
-
selected:
|
|
1768
|
+
selected: x === t,
|
|
1765
1769
|
onClick: () => {
|
|
1766
|
-
I(),
|
|
1770
|
+
I(), b(x);
|
|
1767
1771
|
},
|
|
1768
|
-
children: s.navigation[
|
|
1772
|
+
children: s.navigation[x]
|
|
1769
1773
|
},
|
|
1770
|
-
|
|
1774
|
+
x
|
|
1771
1775
|
)) })
|
|
1772
1776
|
}
|
|
1773
1777
|
)
|
|
@@ -1776,7 +1780,7 @@ const cr = (e) => {
|
|
|
1776
1780
|
}
|
|
1777
1781
|
)
|
|
1778
1782
|
] });
|
|
1779
|
-
},
|
|
1783
|
+
}, _r = ({
|
|
1780
1784
|
type: e = "datetime",
|
|
1781
1785
|
value: t,
|
|
1782
1786
|
label: n,
|
|
@@ -1784,46 +1788,46 @@ const cr = (e) => {
|
|
|
1784
1788
|
onChange: i,
|
|
1785
1789
|
variant: s = "outlined",
|
|
1786
1790
|
error: a,
|
|
1787
|
-
errMsg:
|
|
1791
|
+
errMsg: c,
|
|
1788
1792
|
touched: f,
|
|
1789
|
-
required:
|
|
1793
|
+
required: u
|
|
1790
1794
|
}) => {
|
|
1791
|
-
var
|
|
1792
|
-
const { translations: h } = O(), [_,
|
|
1795
|
+
var y, l;
|
|
1796
|
+
const { translations: h } = O(), [_, g] = L({
|
|
1793
1797
|
touched: !1,
|
|
1794
1798
|
valid: !!t,
|
|
1795
|
-
errorMsg:
|
|
1796
|
-
}),
|
|
1797
|
-
(
|
|
1798
|
-
var
|
|
1799
|
-
const
|
|
1800
|
-
let D = !0,
|
|
1801
|
-
|
|
1799
|
+
errorMsg: c || (u ? ((y = h == null ? void 0 : h.validation) == null ? void 0 : y.required) || "Required" : void 0)
|
|
1800
|
+
}), w = e === "date" ? Rn : An, d = _.touched && (a || !_.valid), p = Z(
|
|
1801
|
+
(m) => {
|
|
1802
|
+
var M;
|
|
1803
|
+
const k = !isNaN(Date.parse(m)), C = typeof m == "string" && k ? new Date(m) : m;
|
|
1804
|
+
let D = !0, T = c;
|
|
1805
|
+
u && !C && (D = !1, T = c || ((M = h == null ? void 0 : h.validation) == null ? void 0 : M.required) || "Required"), g((I) => ({ ...I, touched: !0, valid: D, errorMsg: T })), i(o, C);
|
|
1802
1806
|
},
|
|
1803
|
-
[
|
|
1807
|
+
[c, o, i, u, (l = h == null ? void 0 : h.validation) == null ? void 0 : l.required]
|
|
1804
1808
|
);
|
|
1805
|
-
return
|
|
1806
|
-
f &&
|
|
1807
|
-
}, [
|
|
1808
|
-
|
|
1809
|
+
return K(() => {
|
|
1810
|
+
f && p(t);
|
|
1811
|
+
}, [p, f, t]), /* @__PURE__ */ r(Pe, { children: /* @__PURE__ */ r(
|
|
1812
|
+
w,
|
|
1809
1813
|
{
|
|
1810
1814
|
value: t instanceof Date ? t : new Date(t),
|
|
1811
1815
|
label: n,
|
|
1812
|
-
onChange: (
|
|
1813
|
-
|
|
1816
|
+
onChange: (m) => {
|
|
1817
|
+
p(m);
|
|
1814
1818
|
},
|
|
1815
1819
|
minutesStep: 5,
|
|
1816
1820
|
slotProps: {
|
|
1817
1821
|
textField: {
|
|
1818
1822
|
variant: s,
|
|
1819
|
-
helperText:
|
|
1820
|
-
error:
|
|
1823
|
+
helperText: d && _.errorMsg,
|
|
1824
|
+
error: d,
|
|
1821
1825
|
fullWidth: !0
|
|
1822
1826
|
}
|
|
1823
1827
|
}
|
|
1824
1828
|
}
|
|
1825
1829
|
) });
|
|
1826
|
-
},
|
|
1830
|
+
}, vr = ({
|
|
1827
1831
|
variant: e = "outlined",
|
|
1828
1832
|
label: t,
|
|
1829
1833
|
placeholder: n,
|
|
@@ -1831,43 +1835,43 @@ const cr = (e) => {
|
|
|
1831
1835
|
name: i,
|
|
1832
1836
|
required: s,
|
|
1833
1837
|
min: a,
|
|
1834
|
-
max:
|
|
1838
|
+
max: c,
|
|
1835
1839
|
email: f,
|
|
1836
|
-
decimal:
|
|
1840
|
+
decimal: u,
|
|
1837
1841
|
onChange: h,
|
|
1838
1842
|
disabled: _,
|
|
1839
|
-
multiline:
|
|
1840
|
-
rows:
|
|
1841
|
-
touched:
|
|
1843
|
+
multiline: g,
|
|
1844
|
+
rows: w,
|
|
1845
|
+
touched: d
|
|
1842
1846
|
}) => {
|
|
1843
|
-
const [
|
|
1847
|
+
const [p, y] = L({
|
|
1844
1848
|
touched: !1,
|
|
1845
1849
|
valid: !1,
|
|
1846
1850
|
errorMsg: ""
|
|
1847
|
-
}), { translations: l } = O(),
|
|
1848
|
-
(
|
|
1849
|
-
var
|
|
1850
|
-
const
|
|
1851
|
-
let D = !0,
|
|
1852
|
-
f && (D = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(
|
|
1851
|
+
}), { translations: l } = O(), m = Z(
|
|
1852
|
+
(k) => {
|
|
1853
|
+
var M, I, v, b, S, x, W, R, V;
|
|
1854
|
+
const C = k;
|
|
1855
|
+
let D = !0, T = "";
|
|
1856
|
+
f && (D = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(C) && D, T = ((M = l == null ? void 0 : l.validation) == null ? void 0 : M.invalidEmail) || "Invalid Email"), u && (D = /^[0-9]+(\.[0-9]*)?$/.test(C) && D, T = ((I = l == null ? void 0 : l.validation) == null ? void 0 : I.onlyNumbers) || "Only Numbers Allowed"), a && `${C}`.trim().length < a && (D = !1, T = typeof ((v = l == null ? void 0 : l.validation) == null ? void 0 : v.min) == "function" ? (b = l == null ? void 0 : l.validation) == null ? void 0 : b.min(a) : ((S = l == null ? void 0 : l.validation) == null ? void 0 : S.min) || `Minimum ${a} letters`), c && `${C}`.trim().length > c && (D = !1, T = typeof ((x = l == null ? void 0 : l.validation) == null ? void 0 : x.max) == "function" ? (W = l == null ? void 0 : l.validation) == null ? void 0 : W.max(c) : ((R = l == null ? void 0 : l.validation) == null ? void 0 : R.max) || `Maximum ${c} letters`), s && `${C}`.trim().length <= 0 && (D = !1, T = ((V = l == null ? void 0 : l.validation) == null ? void 0 : V.required) || "Required"), y({ touched: !0, valid: D, errorMsg: T }), h(i, C, D);
|
|
1853
1857
|
},
|
|
1854
|
-
[
|
|
1858
|
+
[u, f, c, a, i, h, s, l == null ? void 0 : l.validation]
|
|
1855
1859
|
);
|
|
1856
|
-
return
|
|
1857
|
-
|
|
1858
|
-
}, [
|
|
1860
|
+
return K(() => {
|
|
1861
|
+
d && m(o);
|
|
1862
|
+
}, [m, d, o]), /* @__PURE__ */ r(
|
|
1859
1863
|
fn,
|
|
1860
1864
|
{
|
|
1861
1865
|
variant: e,
|
|
1862
|
-
label: t && /* @__PURE__ */ r(
|
|
1866
|
+
label: t && /* @__PURE__ */ r($, { variant: "body2", children: `${t} ${s ? "*" : ""}` }),
|
|
1863
1867
|
value: o,
|
|
1864
1868
|
name: i,
|
|
1865
|
-
onChange: (
|
|
1869
|
+
onChange: (k) => m(k.target.value),
|
|
1866
1870
|
disabled: _,
|
|
1867
|
-
error:
|
|
1868
|
-
helperText:
|
|
1869
|
-
multiline:
|
|
1870
|
-
rows:
|
|
1871
|
+
error: p.touched && !p.valid,
|
|
1872
|
+
helperText: p.touched && !p.valid && p.errorMsg,
|
|
1873
|
+
multiline: g,
|
|
1874
|
+
rows: w,
|
|
1871
1875
|
style: { width: "100%" },
|
|
1872
1876
|
InputProps: {
|
|
1873
1877
|
placeholder: n || ""
|
|
@@ -1882,50 +1886,50 @@ const cr = (e) => {
|
|
|
1882
1886
|
onChange: i,
|
|
1883
1887
|
label: s,
|
|
1884
1888
|
disabled: a,
|
|
1885
|
-
touched:
|
|
1889
|
+
touched: c,
|
|
1886
1890
|
variant: f = "outlined",
|
|
1887
|
-
loading:
|
|
1891
|
+
loading: u,
|
|
1888
1892
|
multiple: h,
|
|
1889
1893
|
placeholder: _,
|
|
1890
|
-
errMsg:
|
|
1894
|
+
errMsg: g
|
|
1891
1895
|
}) => {
|
|
1892
|
-
var
|
|
1893
|
-
const
|
|
1896
|
+
var k, C;
|
|
1897
|
+
const w = ee(), { translations: d } = O(), [p, y] = L({
|
|
1894
1898
|
touched: !1,
|
|
1895
1899
|
valid: !!t,
|
|
1896
|
-
errorMsg:
|
|
1900
|
+
errorMsg: g || (o ? ((k = d == null ? void 0 : d.validation) == null ? void 0 : k.required) || "Required" : void 0)
|
|
1897
1901
|
}), l = Z(() => {
|
|
1898
|
-
|
|
1899
|
-
}, [
|
|
1902
|
+
p.touched || y((D) => ({ ...D, touched: !0, errorMsg: g || D.errorMsg }));
|
|
1903
|
+
}, [g, p.touched]), m = Z(
|
|
1900
1904
|
(D) => {
|
|
1901
|
-
var
|
|
1902
|
-
const
|
|
1903
|
-
let
|
|
1904
|
-
o && (h ? !
|
|
1905
|
+
var v;
|
|
1906
|
+
const T = D;
|
|
1907
|
+
let M = !0, I = g;
|
|
1908
|
+
o && (h ? !T.length : !T) && (M = !1, I = g || ((v = d == null ? void 0 : d.validation) == null ? void 0 : v.required) || "Required"), y((b) => ({ ...b, touched: !0, valid: M, errorMsg: I })), i(n, T, M);
|
|
1905
1909
|
},
|
|
1906
|
-
[
|
|
1910
|
+
[g, h, n, i, o, (C = d == null ? void 0 : d.validation) == null ? void 0 : C.required]
|
|
1907
1911
|
);
|
|
1908
|
-
return
|
|
1909
|
-
|
|
1910
|
-
}, [
|
|
1911
|
-
/* @__PURE__ */
|
|
1912
|
+
return K(() => {
|
|
1913
|
+
c && m(t);
|
|
1914
|
+
}, [m, c, t]), /* @__PURE__ */ E(Y, { children: [
|
|
1915
|
+
/* @__PURE__ */ E(
|
|
1912
1916
|
gn,
|
|
1913
1917
|
{
|
|
1914
1918
|
variant: f || "outlined",
|
|
1915
1919
|
fullWidth: !0,
|
|
1916
|
-
error: o &&
|
|
1920
|
+
error: o && p.touched && !p.valid,
|
|
1917
1921
|
disabled: a,
|
|
1918
1922
|
children: [
|
|
1919
|
-
s && /* @__PURE__ */ r(pn, { id: `input_${n}`, children: /* @__PURE__ */ r(
|
|
1920
|
-
/* @__PURE__ */
|
|
1923
|
+
s && /* @__PURE__ */ r(pn, { id: `input_${n}`, children: /* @__PURE__ */ r($, { variant: "body2", children: `${s} ${o ? "*" : ""}` }) }),
|
|
1924
|
+
/* @__PURE__ */ E(
|
|
1921
1925
|
yn,
|
|
1922
1926
|
{
|
|
1923
1927
|
label: s,
|
|
1924
1928
|
labelId: `input_${n}`,
|
|
1925
1929
|
value: t,
|
|
1926
1930
|
onBlur: l,
|
|
1927
|
-
onChange: (D) =>
|
|
1928
|
-
IconComponent:
|
|
1931
|
+
onChange: (D) => m(D.target.value),
|
|
1932
|
+
IconComponent: u ? () => /* @__PURE__ */ r(St, { size: 5 }) : Hn,
|
|
1929
1933
|
multiple: !!h,
|
|
1930
1934
|
classes: {
|
|
1931
1935
|
select: h === "chips" ? "flex__wrap" : void 0
|
|
@@ -1933,20 +1937,20 @@ const cr = (e) => {
|
|
|
1933
1937
|
renderValue: (D) => {
|
|
1934
1938
|
if (!D || D.length === 0)
|
|
1935
1939
|
return /* @__PURE__ */ r("em", { children: s });
|
|
1936
|
-
const
|
|
1940
|
+
const T = [];
|
|
1937
1941
|
if (h) {
|
|
1938
|
-
for (const
|
|
1939
|
-
D.includes(
|
|
1940
|
-
return h === "chips" ?
|
|
1942
|
+
for (const M of e)
|
|
1943
|
+
D.includes(M.value) && T.push([M.text]);
|
|
1944
|
+
return h === "chips" ? T.map((M, I) => /* @__PURE__ */ r(_n, { label: M, style: { margin: "0 2px" }, color: "primary" }, `${M}_${I}`)) : T.join(",");
|
|
1941
1945
|
} else {
|
|
1942
|
-
for (const
|
|
1943
|
-
D ===
|
|
1944
|
-
return
|
|
1946
|
+
for (const M of e)
|
|
1947
|
+
D === M.value && T.push([M.text]);
|
|
1948
|
+
return T.join(",");
|
|
1945
1949
|
}
|
|
1946
1950
|
},
|
|
1947
1951
|
children: [
|
|
1948
|
-
_ && /* @__PURE__ */ r(
|
|
1949
|
-
e.map((D) => /* @__PURE__ */
|
|
1952
|
+
_ && /* @__PURE__ */ r(Ve, { value: "", children: /* @__PURE__ */ r("em", { children: _ }) }),
|
|
1953
|
+
e.map((D) => /* @__PURE__ */ E(Ve, { value: D.value, children: [
|
|
1950
1954
|
h && /* @__PURE__ */ r(mn, { checked: t.indexOf(D.value) > -1, color: "primary" }),
|
|
1951
1955
|
D.text
|
|
1952
1956
|
] }, D.id || D.value))
|
|
@@ -1956,13 +1960,13 @@ const cr = (e) => {
|
|
|
1956
1960
|
]
|
|
1957
1961
|
}
|
|
1958
1962
|
),
|
|
1959
|
-
/* @__PURE__ */ r(
|
|
1963
|
+
/* @__PURE__ */ r(vn, { style: { color: w.palette.error.main }, children: p.touched && !p.valid && p.errorMsg })
|
|
1960
1964
|
] });
|
|
1961
|
-
},
|
|
1965
|
+
}, ft = (e, t) => {
|
|
1962
1966
|
var o;
|
|
1963
1967
|
const n = {};
|
|
1964
1968
|
for (const i of e) {
|
|
1965
|
-
const s =
|
|
1969
|
+
const s = Ge(i, i.default, t), a = Ge(i, t == null ? void 0 : t[i.name], t);
|
|
1966
1970
|
n[i.name] = {
|
|
1967
1971
|
value: a.value || s.value || "",
|
|
1968
1972
|
validity: (o = i.config) != null && o.required ? !!a.validity || !!s.validity : !0,
|
|
@@ -2011,74 +2015,74 @@ const cr = (e) => {
|
|
|
2011
2015
|
selectedEvent: i,
|
|
2012
2016
|
resourceFields: s,
|
|
2013
2017
|
selectedResource: a,
|
|
2014
|
-
triggerLoading:
|
|
2018
|
+
triggerLoading: c,
|
|
2015
2019
|
onConfirm: f,
|
|
2016
|
-
customEditor:
|
|
2020
|
+
customEditor: u,
|
|
2017
2021
|
confirmEvent: h,
|
|
2018
2022
|
dialogMaxWidth: _,
|
|
2019
|
-
translations:
|
|
2020
|
-
timeZone:
|
|
2021
|
-
} = O(), [
|
|
2022
|
-
|
|
2023
|
-
...
|
|
2024
|
-
[
|
|
2023
|
+
translations: g,
|
|
2024
|
+
timeZone: w
|
|
2025
|
+
} = O(), [d, p] = L(ft(e, i || o)), [y, l] = L(!1), m = ee(), k = Et(m.breakpoints.down("sm")), C = (v, b, S) => {
|
|
2026
|
+
p((x) => ({
|
|
2027
|
+
...x,
|
|
2028
|
+
[v]: { ...x[v], value: b, validity: S }
|
|
2025
2029
|
}));
|
|
2026
|
-
}, D = (
|
|
2027
|
-
|
|
2028
|
-
},
|
|
2029
|
-
let
|
|
2030
|
-
for (const
|
|
2031
|
-
if (
|
|
2030
|
+
}, D = (v) => {
|
|
2031
|
+
v && p(ft(e)), n(!1);
|
|
2032
|
+
}, T = async () => {
|
|
2033
|
+
let v = {};
|
|
2034
|
+
for (const b in d)
|
|
2035
|
+
if (v[b] = d[b].value, !u && !d[b].validity)
|
|
2032
2036
|
return l(!0);
|
|
2033
2037
|
try {
|
|
2034
|
-
|
|
2035
|
-
const
|
|
2036
|
-
f ?
|
|
2037
|
-
} catch (
|
|
2038
|
-
console.error(
|
|
2038
|
+
c(!0), v.end = v.start >= v.end ? de(v.start, $e(o == null ? void 0 : o.end, o == null ? void 0 : o.start)) : v.end;
|
|
2039
|
+
const b = i != null && i.event_id ? "edit" : "create";
|
|
2040
|
+
f ? v = await f(v, b) : v.event_id = (i == null ? void 0 : i.event_id) || Date.now().toString(36) + Math.random().toString(36).slice(2), v.start = je(v.start, w), v.end = je(v.end, w), h(v, b), D(!0);
|
|
2041
|
+
} catch (b) {
|
|
2042
|
+
console.error(b);
|
|
2039
2043
|
} finally {
|
|
2040
|
-
|
|
2044
|
+
c(!1);
|
|
2041
2045
|
}
|
|
2042
|
-
},
|
|
2043
|
-
var
|
|
2044
|
-
const
|
|
2045
|
-
switch (
|
|
2046
|
+
}, M = (v) => {
|
|
2047
|
+
var S, x, W;
|
|
2048
|
+
const b = d[v];
|
|
2049
|
+
switch (b.type) {
|
|
2046
2050
|
case "input":
|
|
2047
2051
|
return /* @__PURE__ */ r(
|
|
2048
|
-
|
|
2052
|
+
vr,
|
|
2049
2053
|
{
|
|
2050
|
-
value:
|
|
2051
|
-
name:
|
|
2052
|
-
onChange:
|
|
2053
|
-
touched:
|
|
2054
|
-
...
|
|
2055
|
-
label:
|
|
2054
|
+
value: b.value,
|
|
2055
|
+
name: v,
|
|
2056
|
+
onChange: C,
|
|
2057
|
+
touched: y,
|
|
2058
|
+
...b.config,
|
|
2059
|
+
label: g.event[v] || ((S = b.config) == null ? void 0 : S.label)
|
|
2056
2060
|
}
|
|
2057
2061
|
);
|
|
2058
2062
|
case "date":
|
|
2059
2063
|
return /* @__PURE__ */ r(
|
|
2060
|
-
|
|
2064
|
+
_r,
|
|
2061
2065
|
{
|
|
2062
|
-
value:
|
|
2063
|
-
name:
|
|
2064
|
-
onChange: (...
|
|
2065
|
-
touched:
|
|
2066
|
-
...
|
|
2067
|
-
label:
|
|
2066
|
+
value: b.value,
|
|
2067
|
+
name: v,
|
|
2068
|
+
onChange: (...V) => C(...V, !0),
|
|
2069
|
+
touched: y,
|
|
2070
|
+
...b.config,
|
|
2071
|
+
label: g.event[v] || ((x = b.config) == null ? void 0 : x.label)
|
|
2068
2072
|
}
|
|
2069
2073
|
);
|
|
2070
2074
|
case "select":
|
|
2071
|
-
const
|
|
2075
|
+
const R = e.find((V) => V.name === v);
|
|
2072
2076
|
return /* @__PURE__ */ r(
|
|
2073
2077
|
br,
|
|
2074
2078
|
{
|
|
2075
|
-
value:
|
|
2076
|
-
name:
|
|
2077
|
-
options: (
|
|
2078
|
-
onChange:
|
|
2079
|
-
touched:
|
|
2080
|
-
...
|
|
2081
|
-
label:
|
|
2079
|
+
value: b.value,
|
|
2080
|
+
name: v,
|
|
2081
|
+
options: (R == null ? void 0 : R.options) || [],
|
|
2082
|
+
onChange: C,
|
|
2083
|
+
touched: y,
|
|
2084
|
+
...b.config,
|
|
2085
|
+
label: g.event[v] || ((W = b.config) == null ? void 0 : W.label)
|
|
2082
2086
|
}
|
|
2083
2087
|
);
|
|
2084
2088
|
default:
|
|
@@ -2089,33 +2093,33 @@ const cr = (e) => {
|
|
|
2089
2093
|
bn,
|
|
2090
2094
|
{
|
|
2091
2095
|
open: t,
|
|
2092
|
-
fullScreen:
|
|
2096
|
+
fullScreen: k,
|
|
2093
2097
|
maxWidth: _,
|
|
2094
2098
|
onClose: () => {
|
|
2095
2099
|
n(!1);
|
|
2096
2100
|
},
|
|
2097
2101
|
children: (() => {
|
|
2098
|
-
if (
|
|
2099
|
-
const
|
|
2100
|
-
state:
|
|
2102
|
+
if (u) {
|
|
2103
|
+
const v = {
|
|
2104
|
+
state: d,
|
|
2101
2105
|
close: () => n(!1),
|
|
2102
|
-
loading: (
|
|
2106
|
+
loading: (b) => c(b),
|
|
2103
2107
|
edited: i,
|
|
2104
2108
|
onConfirm: h,
|
|
2105
2109
|
[s.idField]: a
|
|
2106
2110
|
};
|
|
2107
|
-
return
|
|
2111
|
+
return u(v);
|
|
2108
2112
|
}
|
|
2109
|
-
return /* @__PURE__ */
|
|
2110
|
-
/* @__PURE__ */ r(wn, { children: i ?
|
|
2111
|
-
/* @__PURE__ */ r(Dn, { style: { overflowX: "hidden" }, children: /* @__PURE__ */ r(
|
|
2112
|
-
var
|
|
2113
|
-
const
|
|
2114
|
-
return /* @__PURE__ */ r(
|
|
2113
|
+
return /* @__PURE__ */ E(ie, { children: [
|
|
2114
|
+
/* @__PURE__ */ r(wn, { children: i ? g.form.editTitle : g.form.addTitle }),
|
|
2115
|
+
/* @__PURE__ */ r(Dn, { style: { overflowX: "hidden" }, children: /* @__PURE__ */ r(st, { container: !0, spacing: 2, children: Object.keys(d).map((v) => {
|
|
2116
|
+
var S;
|
|
2117
|
+
const b = d[v];
|
|
2118
|
+
return /* @__PURE__ */ r(st, { size: { sm: (S = b.config) == null ? void 0 : S.sm, xs: 12 }, children: M(v) }, v);
|
|
2115
2119
|
}) }) }),
|
|
2116
|
-
/* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */ r(
|
|
2118
|
-
/* @__PURE__ */ r(
|
|
2120
|
+
/* @__PURE__ */ E(xn, { children: [
|
|
2121
|
+
/* @__PURE__ */ r(J, { color: "inherit", fullWidth: !0, onClick: () => D(), children: g.form.cancel }),
|
|
2122
|
+
/* @__PURE__ */ r(J, { color: "primary", fullWidth: !0, onClick: T, children: g.form.confirm })
|
|
2119
2123
|
] })
|
|
2120
2124
|
] });
|
|
2121
2125
|
})()
|
|
@@ -2128,29 +2132,29 @@ const cr = (e) => {
|
|
|
2128
2132
|
locale: i,
|
|
2129
2133
|
timeZone: s,
|
|
2130
2134
|
selectedDate: a,
|
|
2131
|
-
translations:
|
|
2135
|
+
translations: c,
|
|
2132
2136
|
alwaysShowAgendaDays: f,
|
|
2133
|
-
stickyNavigationOffset:
|
|
2137
|
+
stickyNavigationOffset: u,
|
|
2134
2138
|
stickyNavigationHeight: h
|
|
2135
|
-
} = O(), { disableGoToDay: _, headRenderer:
|
|
2136
|
-
return !f && !
|
|
2137
|
-
const l = new Date(a.getFullYear(), a.getMonth(),
|
|
2138
|
-
return !f && !
|
|
2139
|
-
/* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof
|
|
2140
|
-
|
|
2139
|
+
} = O(), { disableGoToDay: _, headRenderer: g } = n, w = Jt(a), d = Array.from({ length: w }, (y, l) => l + 1), p = U(() => e.filter((y) => xt(y.start, a)), [e, a]);
|
|
2140
|
+
return !f && !p.length ? /* @__PURE__ */ r(Ke, {}) : /* @__PURE__ */ r(He, { stickyOffset: u, stickyHeight: h, children: d.map((y) => {
|
|
2141
|
+
const l = new Date(a.getFullYear(), a.getMonth(), y), m = he({ dateLeft: l, timeZone: s }), k = Ne(e, l);
|
|
2142
|
+
return !f && !k.length ? null : /* @__PURE__ */ E("div", { className: `rs__agenda_row ${_e(l) ? "rs__today_cell" : ""}`, children: [
|
|
2143
|
+
/* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof g == "function" ? /* @__PURE__ */ r("div", { children: g({ day: l, events: e, resource: t }) }) : /* @__PURE__ */ r(
|
|
2144
|
+
$,
|
|
2141
2145
|
{
|
|
2142
|
-
sx: { fontWeight:
|
|
2143
|
-
color:
|
|
2146
|
+
sx: { fontWeight: m ? "bold" : "inherit" },
|
|
2147
|
+
color: m ? "primary" : "inherit",
|
|
2144
2148
|
variant: "body2",
|
|
2145
2149
|
className: _ ? "" : "rs__hover__op",
|
|
2146
|
-
onClick: (
|
|
2147
|
-
|
|
2150
|
+
onClick: (C) => {
|
|
2151
|
+
C.stopPropagation(), _ || o(l);
|
|
2148
2152
|
},
|
|
2149
2153
|
children: N(l, "dd E", { locale: i })
|
|
2150
2154
|
}
|
|
2151
2155
|
) }),
|
|
2152
|
-
/* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children:
|
|
2153
|
-
] },
|
|
2156
|
+
/* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: k.length > 0 ? /* @__PURE__ */ r(Je, { day: l, events: k }) : /* @__PURE__ */ r($, { sx: { padding: 1 }, children: c.noDataToDisplay }) })
|
|
2157
|
+
] }, y);
|
|
2154
2158
|
}) });
|
|
2155
2159
|
}, xr = ({
|
|
2156
2160
|
events: e,
|
|
@@ -2160,73 +2164,73 @@ const cr = (e) => {
|
|
|
2160
2164
|
eachFirstDayInCalcRow: i,
|
|
2161
2165
|
daysList: s,
|
|
2162
2166
|
onViewMore: a,
|
|
2163
|
-
cellHeight:
|
|
2167
|
+
cellHeight: c
|
|
2164
2168
|
}) => {
|
|
2165
|
-
const f = Math.round((
|
|
2166
|
-
var
|
|
2167
|
-
const
|
|
2169
|
+
const f = Math.round((c - ht) / pe - 1), { translations: u, month: h, locale: _, timeZone: g } = O(), { renderedSlots: w } = Lt(), d = U(() => {
|
|
2170
|
+
var y;
|
|
2171
|
+
const p = [];
|
|
2168
2172
|
for (let l = 0; l < Math.min(e.length, f + 1); l++) {
|
|
2169
|
-
const
|
|
2170
|
-
let D =
|
|
2171
|
-
const
|
|
2173
|
+
const m = Fe(e[l], g), k = !!i && me(m.start, i), C = k && i ? i : m.start;
|
|
2174
|
+
let D = se(C, m.end) + 1;
|
|
2175
|
+
const T = Kt(m.end, C, {
|
|
2172
2176
|
weekStartsOn: h == null ? void 0 : h.weekStartOn,
|
|
2173
2177
|
locale: _
|
|
2174
2178
|
}) > 0;
|
|
2175
|
-
if (
|
|
2176
|
-
const
|
|
2179
|
+
if (T) {
|
|
2180
|
+
const S = Re(m.start, {
|
|
2177
2181
|
weekStartsOn: h == null ? void 0 : h.weekStartOn,
|
|
2178
2182
|
locale: _
|
|
2179
|
-
}),
|
|
2180
|
-
|
|
2183
|
+
}), x = en(S, o);
|
|
2184
|
+
x && (D = s.length - (i ? 0 : vt(m.start, x)));
|
|
2181
2185
|
}
|
|
2182
|
-
const
|
|
2183
|
-
if (
|
|
2184
|
-
|
|
2186
|
+
const M = N(n, "yyyy-MM-dd"), I = (y = w == null ? void 0 : w[t || "all"]) == null ? void 0 : y[M], v = (I == null ? void 0 : I[m.event_id]) || 0, b = Math.min(v, f) * pe + ht;
|
|
2187
|
+
if (v >= f) {
|
|
2188
|
+
p.push(
|
|
2185
2189
|
/* @__PURE__ */ r(
|
|
2186
|
-
|
|
2190
|
+
$,
|
|
2187
2191
|
{
|
|
2188
2192
|
width: "100%",
|
|
2189
2193
|
className: "rs__multi_day rs__hover__op",
|
|
2190
|
-
style: { top:
|
|
2191
|
-
onClick: (
|
|
2192
|
-
|
|
2194
|
+
style: { top: b, fontSize: 11 },
|
|
2195
|
+
onClick: (S) => {
|
|
2196
|
+
S.stopPropagation(), a(n);
|
|
2193
2197
|
},
|
|
2194
|
-
children: `${Math.abs(e.length - l)} ${
|
|
2198
|
+
children: `${Math.abs(e.length - l)} ${u.moreEvents}`
|
|
2195
2199
|
},
|
|
2196
2200
|
l
|
|
2197
2201
|
)
|
|
2198
2202
|
);
|
|
2199
2203
|
break;
|
|
2200
2204
|
}
|
|
2201
|
-
|
|
2205
|
+
p.push(
|
|
2202
2206
|
/* @__PURE__ */ r(
|
|
2203
2207
|
"div",
|
|
2204
2208
|
{
|
|
2205
2209
|
className: "rs__multi_day",
|
|
2206
2210
|
style: {
|
|
2207
|
-
top:
|
|
2211
|
+
top: b,
|
|
2208
2212
|
width: `${100 * D}%`,
|
|
2209
2213
|
height: lr
|
|
2210
2214
|
},
|
|
2211
2215
|
children: /* @__PURE__ */ r(
|
|
2212
|
-
|
|
2216
|
+
We,
|
|
2213
2217
|
{
|
|
2214
|
-
event:
|
|
2218
|
+
event: m,
|
|
2215
2219
|
showdate: !1,
|
|
2216
|
-
multiday:
|
|
2217
|
-
hasPrev:
|
|
2218
|
-
hasNext:
|
|
2220
|
+
multiday: se(m.start, m.end) > 0,
|
|
2221
|
+
hasPrev: k,
|
|
2222
|
+
hasNext: T
|
|
2219
2223
|
}
|
|
2220
2224
|
)
|
|
2221
2225
|
},
|
|
2222
|
-
`${
|
|
2226
|
+
`${m.event_id}_${l}`
|
|
2223
2227
|
)
|
|
2224
2228
|
);
|
|
2225
2229
|
}
|
|
2226
|
-
return
|
|
2230
|
+
return p;
|
|
2227
2231
|
}, [
|
|
2228
2232
|
t,
|
|
2229
|
-
|
|
2233
|
+
w,
|
|
2230
2234
|
e,
|
|
2231
2235
|
f,
|
|
2232
2236
|
i,
|
|
@@ -2235,72 +2239,72 @@ const cr = (e) => {
|
|
|
2235
2239
|
n,
|
|
2236
2240
|
o,
|
|
2237
2241
|
s.length,
|
|
2238
|
-
|
|
2242
|
+
u.moreEvents,
|
|
2239
2243
|
a,
|
|
2240
|
-
|
|
2244
|
+
g
|
|
2241
2245
|
]);
|
|
2242
|
-
return /* @__PURE__ */ r(ie, { children:
|
|
2246
|
+
return /* @__PURE__ */ r(ie, { children: d });
|
|
2243
2247
|
}, kr = ({ daysList: e, resource: t, eachWeekStart: n }) => {
|
|
2244
2248
|
const {
|
|
2245
2249
|
height: o,
|
|
2246
2250
|
month: i,
|
|
2247
2251
|
selectedDate: s,
|
|
2248
2252
|
events: a,
|
|
2249
|
-
handleGotoDay:
|
|
2253
|
+
handleGotoDay: c,
|
|
2250
2254
|
resourceFields: f,
|
|
2251
|
-
fields:
|
|
2255
|
+
fields: u,
|
|
2252
2256
|
locale: h,
|
|
2253
2257
|
hourFormat: _,
|
|
2254
|
-
stickyNavigation:
|
|
2255
|
-
timeZone:
|
|
2256
|
-
onClickMore:
|
|
2257
|
-
stickyNavigationOffset:
|
|
2258
|
-
stickyNavigationHeight:
|
|
2259
|
-
} = O(), { weekDays: l, startHour:
|
|
2260
|
-
(
|
|
2261
|
-
let
|
|
2262
|
-
|
|
2263
|
-
const
|
|
2264
|
-
for (const
|
|
2265
|
-
const
|
|
2266
|
-
const P = Q(
|
|
2267
|
-
if (ye(
|
|
2268
|
-
const
|
|
2269
|
-
return !!(
|
|
2270
|
-
}),
|
|
2271
|
-
return /* @__PURE__ */
|
|
2258
|
+
stickyNavigation: g,
|
|
2259
|
+
timeZone: w,
|
|
2260
|
+
onClickMore: d,
|
|
2261
|
+
stickyNavigationOffset: p,
|
|
2262
|
+
stickyNavigationHeight: y
|
|
2263
|
+
} = O(), { weekDays: l, startHour: m, endHour: k, cellRenderer: C, headRenderer: D, disableGoToDay: T } = i, { headersRef: M, bodyRef: I } = Pt(), v = ee(), b = qe(s), S = De(_), x = o / n.length, W = Z(
|
|
2264
|
+
(R) => {
|
|
2265
|
+
let V = Ae(a);
|
|
2266
|
+
R && (V = Te(a, R, f, u));
|
|
2267
|
+
const te = [];
|
|
2268
|
+
for (const G of n) {
|
|
2269
|
+
const ae = l.map((ne) => {
|
|
2270
|
+
const P = Q(G, ne), fe = /* @__PURE__ */ new Date(`${N(it(P, m), `yyyy/MM/dd ${S}`)}`), ge = /* @__PURE__ */ new Date(`${N(it(P, k), `yyyy/MM/dd ${S}`)}`), F = f.idField, A = ye(G, P) ? P : null, H = V.flatMap((z) => Nt(z, P)).filter((z) => {
|
|
2271
|
+
if (ye(z.start, P)) return !0;
|
|
2272
|
+
const oe = { start: X(z.start), end: q(z.end) };
|
|
2273
|
+
return !!(A && j(A, oe));
|
|
2274
|
+
}), re = he({ dateLeft: P, timeZone: w });
|
|
2275
|
+
return /* @__PURE__ */ E("span", { style: { height: x }, className: "rs__cell", children: [
|
|
2272
2276
|
/* @__PURE__ */ r(
|
|
2273
|
-
|
|
2277
|
+
et,
|
|
2274
2278
|
{
|
|
2275
2279
|
start: fe,
|
|
2276
|
-
end:
|
|
2280
|
+
end: ge,
|
|
2277
2281
|
day: s,
|
|
2278
|
-
height:
|
|
2279
|
-
resourceKey:
|
|
2280
|
-
resourceVal:
|
|
2281
|
-
cellRenderer:
|
|
2282
|
+
height: x,
|
|
2283
|
+
resourceKey: F,
|
|
2284
|
+
resourceVal: R ? R[F] : null,
|
|
2285
|
+
cellRenderer: C
|
|
2282
2286
|
}
|
|
2283
2287
|
),
|
|
2284
|
-
/* @__PURE__ */
|
|
2285
|
-
typeof D == "function" ? /* @__PURE__ */ r("div", { style: { position: "absolute", top: 0 }, children: D({ day: P, events:
|
|
2286
|
-
|
|
2288
|
+
/* @__PURE__ */ E(ie, { children: [
|
|
2289
|
+
typeof D == "function" ? /* @__PURE__ */ r("div", { style: { position: "absolute", top: 0 }, children: D({ day: P, events: V, resource: R }) }) : /* @__PURE__ */ r(
|
|
2290
|
+
Xe,
|
|
2287
2291
|
{
|
|
2288
2292
|
style: {
|
|
2289
2293
|
width: 27,
|
|
2290
2294
|
height: 27,
|
|
2291
2295
|
position: "absolute",
|
|
2292
2296
|
top: 0,
|
|
2293
|
-
background:
|
|
2294
|
-
color:
|
|
2297
|
+
background: re ? v.palette.secondary.main : "transparent",
|
|
2298
|
+
color: re ? v.palette.secondary.contrastText : "",
|
|
2295
2299
|
marginBottom: 2
|
|
2296
2300
|
},
|
|
2297
2301
|
children: /* @__PURE__ */ r(
|
|
2298
|
-
|
|
2302
|
+
$,
|
|
2299
2303
|
{
|
|
2300
|
-
color:
|
|
2301
|
-
className:
|
|
2302
|
-
onClick: (
|
|
2303
|
-
|
|
2304
|
+
color: xt(P, b) ? "textPrimary" : "#ccc",
|
|
2305
|
+
className: T ? "" : "rs__hover__op",
|
|
2306
|
+
onClick: (z) => {
|
|
2307
|
+
z.stopPropagation(), T || c(P);
|
|
2304
2308
|
},
|
|
2305
2309
|
children: N(P, "dd")
|
|
2306
2310
|
}
|
|
@@ -2310,68 +2314,68 @@ const cr = (e) => {
|
|
|
2310
2314
|
/* @__PURE__ */ r(
|
|
2311
2315
|
xr,
|
|
2312
2316
|
{
|
|
2313
|
-
events:
|
|
2314
|
-
resourceId:
|
|
2317
|
+
events: H,
|
|
2318
|
+
resourceId: R == null ? void 0 : R[F],
|
|
2315
2319
|
today: P,
|
|
2316
2320
|
eachWeekStart: n,
|
|
2317
|
-
eachFirstDayInCalcRow:
|
|
2321
|
+
eachFirstDayInCalcRow: A,
|
|
2318
2322
|
daysList: e,
|
|
2319
|
-
onViewMore: (
|
|
2320
|
-
|
|
2323
|
+
onViewMore: (z) => {
|
|
2324
|
+
d && typeof d == "function" ? d(z, c) : c(z);
|
|
2321
2325
|
},
|
|
2322
|
-
cellHeight:
|
|
2326
|
+
cellHeight: x
|
|
2323
2327
|
}
|
|
2324
2328
|
)
|
|
2325
2329
|
] })
|
|
2326
|
-
] },
|
|
2330
|
+
] }, ne.toString());
|
|
2327
2331
|
});
|
|
2328
|
-
|
|
2332
|
+
te.push(/* @__PURE__ */ r(ie, { children: ae }, G.toString()));
|
|
2329
2333
|
}
|
|
2330
|
-
return
|
|
2334
|
+
return te;
|
|
2331
2335
|
},
|
|
2332
2336
|
[
|
|
2337
|
+
x,
|
|
2333
2338
|
C,
|
|
2334
|
-
E,
|
|
2335
2339
|
e,
|
|
2336
|
-
k,
|
|
2337
|
-
n,
|
|
2338
2340
|
T,
|
|
2341
|
+
n,
|
|
2342
|
+
k,
|
|
2339
2343
|
a,
|
|
2344
|
+
u,
|
|
2345
|
+
S,
|
|
2340
2346
|
c,
|
|
2341
|
-
x,
|
|
2342
|
-
d,
|
|
2343
2347
|
D,
|
|
2344
|
-
|
|
2345
|
-
|
|
2348
|
+
b,
|
|
2349
|
+
d,
|
|
2346
2350
|
f,
|
|
2347
2351
|
s,
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
+
m,
|
|
2353
|
+
v.palette.secondary.contrastText,
|
|
2354
|
+
v.palette.secondary.main,
|
|
2355
|
+
w,
|
|
2352
2356
|
l
|
|
2353
2357
|
]
|
|
2354
2358
|
);
|
|
2355
|
-
return /* @__PURE__ */
|
|
2359
|
+
return /* @__PURE__ */ E(Y, { children: [
|
|
2356
2360
|
/* @__PURE__ */ r(
|
|
2357
2361
|
be,
|
|
2358
2362
|
{
|
|
2359
2363
|
days: e.length,
|
|
2360
|
-
ref:
|
|
2364
|
+
ref: M,
|
|
2361
2365
|
indent: "0",
|
|
2362
2366
|
sticky: "1",
|
|
2363
|
-
stickyNavigation:
|
|
2364
|
-
stickyOffset:
|
|
2365
|
-
stickyHeight:
|
|
2366
|
-
children: e.map((
|
|
2367
|
-
|
|
2367
|
+
stickyNavigation: g,
|
|
2368
|
+
stickyOffset: p,
|
|
2369
|
+
stickyHeight: y,
|
|
2370
|
+
children: e.map((R, V) => /* @__PURE__ */ r(
|
|
2371
|
+
$,
|
|
2368
2372
|
{
|
|
2369
2373
|
className: "rs__cell rs__header rs__header__center",
|
|
2370
2374
|
align: "center",
|
|
2371
2375
|
variant: "body2",
|
|
2372
|
-
children: N(
|
|
2376
|
+
children: N(R, "EE", { locale: h })
|
|
2373
2377
|
},
|
|
2374
|
-
|
|
2378
|
+
V
|
|
2375
2379
|
))
|
|
2376
2380
|
}
|
|
2377
2381
|
),
|
|
@@ -2386,44 +2390,44 @@ const cr = (e) => {
|
|
|
2386
2390
|
triggerLoading: i,
|
|
2387
2391
|
handleState: s,
|
|
2388
2392
|
resources: a,
|
|
2389
|
-
resourceFields:
|
|
2393
|
+
resourceFields: c,
|
|
2390
2394
|
fields: f,
|
|
2391
|
-
agenda:
|
|
2392
|
-
} = O(), { weekStartOn: h, weekDays: _ } = e,
|
|
2395
|
+
agenda: u
|
|
2396
|
+
} = O(), { weekStartOn: h, weekDays: _ } = e, g = qe(t), w = wt(t), d = tn(
|
|
2393
2397
|
{
|
|
2394
|
-
start:
|
|
2395
|
-
end:
|
|
2398
|
+
start: g,
|
|
2399
|
+
end: w
|
|
2396
2400
|
},
|
|
2397
2401
|
{ weekStartsOn: h }
|
|
2398
|
-
),
|
|
2402
|
+
), p = _.map((m) => Q(d[0], m)), y = Z(async () => {
|
|
2399
2403
|
try {
|
|
2400
2404
|
i(!0);
|
|
2401
|
-
const
|
|
2402
|
-
start:
|
|
2403
|
-
end:
|
|
2405
|
+
const m = d[0], k = Q(d[d.length - 1], p.length), C = await o({
|
|
2406
|
+
start: m,
|
|
2407
|
+
end: k,
|
|
2404
2408
|
view: "month"
|
|
2405
2409
|
});
|
|
2406
|
-
|
|
2407
|
-
} catch (
|
|
2408
|
-
throw
|
|
2410
|
+
C && (C != null && C.length) && s(C, "events");
|
|
2411
|
+
} catch (m) {
|
|
2412
|
+
throw m;
|
|
2409
2413
|
} finally {
|
|
2410
2414
|
i(!1);
|
|
2411
2415
|
}
|
|
2412
|
-
}, [
|
|
2413
|
-
|
|
2414
|
-
o instanceof Function &&
|
|
2415
|
-
}, [
|
|
2416
|
+
}, [p.length, o]);
|
|
2417
|
+
K(() => {
|
|
2418
|
+
o instanceof Function && y();
|
|
2419
|
+
}, [y, o]);
|
|
2416
2420
|
const l = Z(
|
|
2417
|
-
(
|
|
2418
|
-
if (
|
|
2419
|
-
let
|
|
2420
|
-
return
|
|
2421
|
+
(m) => {
|
|
2422
|
+
if (u) {
|
|
2423
|
+
let k = Ae(n);
|
|
2424
|
+
return m && (k = Te(n, m, c, f)), /* @__PURE__ */ r(Dr, { resource: m, events: k });
|
|
2421
2425
|
}
|
|
2422
|
-
return /* @__PURE__ */ r(kr, { daysList:
|
|
2426
|
+
return /* @__PURE__ */ r(kr, { daysList: p, eachWeekStart: d, resource: m });
|
|
2423
2427
|
},
|
|
2424
|
-
[
|
|
2428
|
+
[u, p, d, n, f, c]
|
|
2425
2429
|
);
|
|
2426
|
-
return a.length ? /* @__PURE__ */ r(
|
|
2430
|
+
return a.length ? /* @__PURE__ */ r(Qe, { renderChildren: l }) : l();
|
|
2427
2431
|
}, Cr = ({ events: e, resource: t }) => {
|
|
2428
2432
|
const {
|
|
2429
2433
|
day: n,
|
|
@@ -2431,12 +2435,12 @@ const cr = (e) => {
|
|
|
2431
2435
|
selectedDate: i,
|
|
2432
2436
|
translations: s,
|
|
2433
2437
|
alwaysShowAgendaDays: a,
|
|
2434
|
-
stickyNavigationOffset:
|
|
2438
|
+
stickyNavigationOffset: c,
|
|
2435
2439
|
stickyNavigationHeight: f
|
|
2436
|
-
} = O(), { headRenderer:
|
|
2437
|
-
return !a && !h.length ? /* @__PURE__ */ r(
|
|
2438
|
-
/* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof
|
|
2439
|
-
/* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: h.length > 0 ? /* @__PURE__ */ r(
|
|
2440
|
+
} = O(), { headRenderer: u } = n, h = U(() => Ne(e, i), [e, i]);
|
|
2441
|
+
return !a && !h.length ? /* @__PURE__ */ r(Ke, {}) : /* @__PURE__ */ r(He, { stickyOffset: c, stickyHeight: f, children: /* @__PURE__ */ E("div", { className: "rs__agenda_row rs__today_cell", children: [
|
|
2442
|
+
/* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof u == "function" ? /* @__PURE__ */ r("div", { children: u({ day: i, events: e, resource: t }) }) : /* @__PURE__ */ r($, { variant: "body2", children: N(i, "dd E", { locale: o }) }) }),
|
|
2443
|
+
/* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: h.length > 0 ? /* @__PURE__ */ r(Je, { day: i, events: h }) : /* @__PURE__ */ r($, { sx: { padding: 1 }, children: s.noDataToDisplay }) })
|
|
2440
2444
|
] }) });
|
|
2441
2445
|
}, Er = () => {
|
|
2442
2446
|
const {
|
|
@@ -2447,226 +2451,227 @@ const cr = (e) => {
|
|
|
2447
2451
|
getRemoteEvents: i,
|
|
2448
2452
|
triggerLoading: s,
|
|
2449
2453
|
handleState: a,
|
|
2450
|
-
resources:
|
|
2454
|
+
resources: c,
|
|
2451
2455
|
resourceFields: f,
|
|
2452
|
-
resourceViewMode:
|
|
2456
|
+
resourceViewMode: u,
|
|
2453
2457
|
fields: h,
|
|
2454
2458
|
direction: _,
|
|
2455
|
-
locale:
|
|
2456
|
-
hourFormat:
|
|
2457
|
-
timeZone:
|
|
2458
|
-
stickyNavigation:
|
|
2459
|
-
agenda:
|
|
2459
|
+
locale: g,
|
|
2460
|
+
hourFormat: w,
|
|
2461
|
+
timeZone: d,
|
|
2462
|
+
stickyNavigation: p,
|
|
2463
|
+
agenda: y,
|
|
2460
2464
|
stickyNavigationOffset: l,
|
|
2461
|
-
stickyNavigationHeight:
|
|
2462
|
-
currentTime:
|
|
2463
|
-
showCurrentTimeBar:
|
|
2465
|
+
stickyNavigationHeight: m,
|
|
2466
|
+
currentTime: k,
|
|
2467
|
+
showCurrentTimeBar: C,
|
|
2464
2468
|
currentTimeBarColor: D,
|
|
2465
|
-
forceInlineMultiDay:
|
|
2466
|
-
|
|
2469
|
+
forceInlineMultiDay: T,
|
|
2470
|
+
_refetchToken: M
|
|
2471
|
+
} = O(), { startHour: I, endHour: v, step: b, cellRenderer: S, headRenderer: x, hourRenderer: W } = e, R = xe(t, { hours: I, minutes: 0, seconds: 0 }), V = xe(t, { hours: v, minutes: -b, seconds: 0 }), te = bt(
|
|
2467
2472
|
{
|
|
2468
|
-
start:
|
|
2469
|
-
end:
|
|
2473
|
+
start: R,
|
|
2474
|
+
end: V
|
|
2470
2475
|
},
|
|
2471
|
-
{ step:
|
|
2472
|
-
),
|
|
2476
|
+
{ step: b }
|
|
2477
|
+
), G = It(o, te.length), ae = Mt(G, b), ne = De(w), P = Z(async () => {
|
|
2473
2478
|
try {
|
|
2474
2479
|
s(!0);
|
|
2475
|
-
const
|
|
2476
|
-
start:
|
|
2477
|
-
end:
|
|
2480
|
+
const F = Q(R, -1), A = Q(V, 1), H = await i({
|
|
2481
|
+
start: F,
|
|
2482
|
+
end: A,
|
|
2478
2483
|
view: "day"
|
|
2479
2484
|
});
|
|
2480
|
-
|
|
2481
|
-
} catch (
|
|
2482
|
-
throw
|
|
2485
|
+
H && (H != null && H.length) && a(H, "events");
|
|
2486
|
+
} catch (F) {
|
|
2487
|
+
throw F;
|
|
2483
2488
|
} finally {
|
|
2484
2489
|
s(!1);
|
|
2485
2490
|
}
|
|
2486
|
-
}, [i]);
|
|
2487
|
-
|
|
2488
|
-
i instanceof Function &&
|
|
2489
|
-
}, [
|
|
2490
|
-
const
|
|
2491
|
-
(
|
|
2492
|
-
const
|
|
2493
|
-
|
|
2491
|
+
}, [i, M]);
|
|
2492
|
+
K(() => {
|
|
2493
|
+
i instanceof Function && P();
|
|
2494
|
+
}, [P, i, M]);
|
|
2495
|
+
const fe = Z(
|
|
2496
|
+
(F) => {
|
|
2497
|
+
const A = Oe(
|
|
2498
|
+
F,
|
|
2494
2499
|
t,
|
|
2495
|
-
|
|
2500
|
+
d,
|
|
2496
2501
|
void 0,
|
|
2497
|
-
|
|
2502
|
+
T
|
|
2498
2503
|
);
|
|
2499
2504
|
return /* @__PURE__ */ r(
|
|
2500
2505
|
"div",
|
|
2501
2506
|
{
|
|
2502
2507
|
className: "rs__block_col",
|
|
2503
|
-
style: { height: pe *
|
|
2504
|
-
children:
|
|
2505
|
-
const
|
|
2508
|
+
style: { height: pe * A.length },
|
|
2509
|
+
children: A.map((H, re) => {
|
|
2510
|
+
const z = me(H.start, X(t)), oe = Me(H.end, q(t));
|
|
2506
2511
|
return /* @__PURE__ */ r(
|
|
2507
2512
|
"div",
|
|
2508
2513
|
{
|
|
2509
2514
|
className: "rs__multi_day",
|
|
2510
2515
|
style: {
|
|
2511
|
-
top:
|
|
2516
|
+
top: re * pe,
|
|
2512
2517
|
width: "99.9%",
|
|
2513
2518
|
overflowX: "hidden"
|
|
2514
2519
|
},
|
|
2515
|
-
children: /* @__PURE__ */ r(
|
|
2520
|
+
children: /* @__PURE__ */ r(We, { event: H, multiday: !0, hasPrev: z, hasNext: oe })
|
|
2516
2521
|
},
|
|
2517
|
-
|
|
2522
|
+
H.event_id
|
|
2518
2523
|
);
|
|
2519
2524
|
})
|
|
2520
2525
|
}
|
|
2521
2526
|
);
|
|
2522
2527
|
},
|
|
2523
|
-
[t,
|
|
2524
|
-
),
|
|
2525
|
-
(
|
|
2526
|
-
let
|
|
2527
|
-
if (
|
|
2528
|
-
return /* @__PURE__ */ r(Cr, { resource:
|
|
2529
|
-
const
|
|
2530
|
-
|
|
2528
|
+
[t, d]
|
|
2529
|
+
), ge = Z(
|
|
2530
|
+
(F) => {
|
|
2531
|
+
let A = n;
|
|
2532
|
+
if (F && (A = Te(n, F, f, h)), y)
|
|
2533
|
+
return /* @__PURE__ */ r(Cr, { resource: F, events: A });
|
|
2534
|
+
const H = c.length && u === "default", re = Oe(
|
|
2535
|
+
H ? n : A,
|
|
2531
2536
|
t,
|
|
2532
|
-
|
|
2537
|
+
d,
|
|
2533
2538
|
void 0,
|
|
2534
|
-
|
|
2535
|
-
),
|
|
2536
|
-
return /* @__PURE__ */
|
|
2537
|
-
/* @__PURE__ */
|
|
2539
|
+
T
|
|
2540
|
+
), z = pe * re.length + 45;
|
|
2541
|
+
return /* @__PURE__ */ E(Y, { children: [
|
|
2542
|
+
/* @__PURE__ */ E(
|
|
2538
2543
|
be,
|
|
2539
2544
|
{
|
|
2540
2545
|
days: 1,
|
|
2541
2546
|
sticky: "1",
|
|
2542
|
-
stickyNavigation:
|
|
2547
|
+
stickyNavigation: p,
|
|
2543
2548
|
stickyOffset: l,
|
|
2544
|
-
stickyHeight:
|
|
2549
|
+
stickyHeight: m,
|
|
2545
2550
|
children: [
|
|
2546
2551
|
/* @__PURE__ */ r("span", { className: "rs__cell" }),
|
|
2547
|
-
/* @__PURE__ */
|
|
2552
|
+
/* @__PURE__ */ E(
|
|
2548
2553
|
"span",
|
|
2549
2554
|
{
|
|
2550
|
-
className: `rs__cell rs__header ${
|
|
2551
|
-
style: { height:
|
|
2555
|
+
className: `rs__cell rs__header ${_e(t) ? "rs__today_cell" : ""}`,
|
|
2556
|
+
style: { height: z },
|
|
2552
2557
|
children: [
|
|
2553
|
-
typeof x == "function" ? /* @__PURE__ */ r("div", { children: x({ day: t, events:
|
|
2554
|
-
|
|
2558
|
+
typeof x == "function" ? /* @__PURE__ */ r("div", { children: x({ day: t, events: A, resource: F }) }) : /* @__PURE__ */ r(zt, { date: t, locale: g }),
|
|
2559
|
+
fe(A)
|
|
2555
2560
|
]
|
|
2556
2561
|
}
|
|
2557
2562
|
)
|
|
2558
2563
|
]
|
|
2559
2564
|
}
|
|
2560
2565
|
),
|
|
2561
|
-
/* @__PURE__ */ r(be, { days: 1, children:
|
|
2562
|
-
const
|
|
2563
|
-
return /* @__PURE__ */
|
|
2564
|
-
/* @__PURE__ */ r("span", { className: "rs__cell rs__header rs__time", style: { height:
|
|
2565
|
-
/* @__PURE__ */
|
|
2566
|
-
|
|
2567
|
-
|
|
2566
|
+
/* @__PURE__ */ r(be, { days: 1, children: te.map((oe, B) => {
|
|
2567
|
+
const ce = /* @__PURE__ */ new Date(`${N(t, "yyyy/MM/dd")} ${N(oe, ne)}`), Ce = de(ce, b), Ee = f.idField;
|
|
2568
|
+
return /* @__PURE__ */ E(ie, { children: [
|
|
2569
|
+
/* @__PURE__ */ r("span", { className: "rs__cell rs__header rs__time", style: { height: G }, children: typeof W == "function" ? /* @__PURE__ */ r("div", { children: W(N(oe, ne, { locale: g })) }) : /* @__PURE__ */ r($, { variant: "caption", children: N(oe, ne, { locale: g }) }) }),
|
|
2570
|
+
/* @__PURE__ */ E("span", { className: `rs__cell ${_e(t) ? "rs__today_cell" : ""}`, children: [
|
|
2571
|
+
B === 0 && /* @__PURE__ */ r(
|
|
2572
|
+
Vt,
|
|
2568
2573
|
{
|
|
2569
|
-
todayEvents:
|
|
2570
|
-
|
|
2574
|
+
todayEvents: Ot(
|
|
2575
|
+
A,
|
|
2571
2576
|
t,
|
|
2572
|
-
|
|
2573
|
-
|
|
2577
|
+
d,
|
|
2578
|
+
T
|
|
2574
2579
|
),
|
|
2575
|
-
today:
|
|
2576
|
-
minuteHeight:
|
|
2577
|
-
startHour:
|
|
2578
|
-
endHour:
|
|
2579
|
-
step:
|
|
2580
|
+
today: R,
|
|
2581
|
+
minuteHeight: ae,
|
|
2582
|
+
startHour: I,
|
|
2583
|
+
endHour: v,
|
|
2584
|
+
step: b,
|
|
2580
2585
|
direction: _,
|
|
2581
|
-
timeZone:
|
|
2582
|
-
currentTime:
|
|
2583
|
-
showCurrentTimeBar:
|
|
2586
|
+
timeZone: d,
|
|
2587
|
+
currentTime: k,
|
|
2588
|
+
showCurrentTimeBar: C,
|
|
2584
2589
|
currentTimeBarColor: D
|
|
2585
2590
|
}
|
|
2586
2591
|
),
|
|
2587
2592
|
/* @__PURE__ */ r(
|
|
2588
|
-
|
|
2593
|
+
et,
|
|
2589
2594
|
{
|
|
2590
|
-
start:
|
|
2591
|
-
end:
|
|
2595
|
+
start: ce,
|
|
2596
|
+
end: Ce,
|
|
2592
2597
|
day: t,
|
|
2593
|
-
height:
|
|
2594
|
-
resourceKey:
|
|
2595
|
-
resourceVal:
|
|
2596
|
-
cellRenderer:
|
|
2598
|
+
height: G,
|
|
2599
|
+
resourceKey: Ee,
|
|
2600
|
+
resourceVal: F ? F[Ee] : null,
|
|
2601
|
+
cellRenderer: S
|
|
2597
2602
|
}
|
|
2598
2603
|
)
|
|
2599
2604
|
] })
|
|
2600
|
-
] },
|
|
2605
|
+
] }, B);
|
|
2601
2606
|
}) })
|
|
2602
2607
|
] });
|
|
2603
2608
|
},
|
|
2604
2609
|
[
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
+
G,
|
|
2611
|
+
ae,
|
|
2612
|
+
R,
|
|
2613
|
+
y,
|
|
2614
|
+
S,
|
|
2610
2615
|
_,
|
|
2611
|
-
|
|
2616
|
+
v,
|
|
2612
2617
|
n,
|
|
2613
2618
|
h,
|
|
2614
|
-
|
|
2619
|
+
ne,
|
|
2615
2620
|
x,
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
y,
|
|
2619
|
-
P,
|
|
2620
|
-
f,
|
|
2621
|
-
c,
|
|
2622
|
-
d.length,
|
|
2623
|
-
t,
|
|
2624
|
-
S,
|
|
2625
|
-
m,
|
|
2621
|
+
W,
|
|
2622
|
+
te,
|
|
2626
2623
|
g,
|
|
2624
|
+
fe,
|
|
2625
|
+
f,
|
|
2627
2626
|
u,
|
|
2628
|
-
|
|
2629
|
-
|
|
2627
|
+
c.length,
|
|
2628
|
+
t,
|
|
2629
|
+
I,
|
|
2630
|
+
b,
|
|
2631
|
+
p,
|
|
2632
|
+
d,
|
|
2633
|
+
k,
|
|
2634
|
+
C,
|
|
2630
2635
|
D
|
|
2631
2636
|
]
|
|
2632
2637
|
);
|
|
2633
|
-
return
|
|
2634
|
-
},
|
|
2638
|
+
return c.length ? /* @__PURE__ */ r(Qe, { renderChildren: ge }) : ge();
|
|
2639
|
+
}, gt = (e) => {
|
|
2635
2640
|
const t = {};
|
|
2636
2641
|
let n = 0;
|
|
2637
2642
|
for (let o = 0; o < e.length; o++) {
|
|
2638
2643
|
const i = e[o], s = nn({ start: i.start, end: i.end });
|
|
2639
2644
|
for (let a = 0; a < s.length; a++) {
|
|
2640
|
-
const
|
|
2641
|
-
if (t[
|
|
2642
|
-
const f = Object.values(t[
|
|
2645
|
+
const c = N(s[a], "yyyy-MM-dd");
|
|
2646
|
+
if (t[c]) {
|
|
2647
|
+
const f = Object.values(t[c]);
|
|
2643
2648
|
for (; f.includes(n); )
|
|
2644
2649
|
n += 1;
|
|
2645
|
-
t[
|
|
2650
|
+
t[c][i.event_id] = n;
|
|
2646
2651
|
} else
|
|
2647
|
-
t[
|
|
2652
|
+
t[c] = { [i.event_id]: n };
|
|
2648
2653
|
}
|
|
2649
2654
|
n = 0;
|
|
2650
2655
|
}
|
|
2651
2656
|
return t;
|
|
2652
|
-
},
|
|
2653
|
-
const s = i === "month" ?
|
|
2657
|
+
}, pt = (e, t, n, o, i) => {
|
|
2658
|
+
const s = i === "month" ? Ft(e) : Ae(e), a = {};
|
|
2654
2659
|
if (t.length)
|
|
2655
|
-
for (const
|
|
2656
|
-
const f =
|
|
2657
|
-
a[
|
|
2660
|
+
for (const c of t) {
|
|
2661
|
+
const f = Te(s, c, n, o), u = gt(f);
|
|
2662
|
+
a[c[n.idField]] = u;
|
|
2658
2663
|
}
|
|
2659
2664
|
else
|
|
2660
|
-
a.all =
|
|
2665
|
+
a.all = gt(s);
|
|
2661
2666
|
return a;
|
|
2662
2667
|
}, Sr = ({ children: e }) => {
|
|
2663
|
-
const { events: t, resources: n, resourceFields: o, fields: i, view: s } = O(), [a,
|
|
2664
|
-
renderedSlots:
|
|
2668
|
+
const { events: t, resources: n, resourceFields: o, fields: i, view: s } = O(), [a, c] = L({
|
|
2669
|
+
renderedSlots: pt(t, n, o, i, s)
|
|
2665
2670
|
});
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
...
|
|
2669
|
-
renderedSlots:
|
|
2671
|
+
K(() => {
|
|
2672
|
+
c((u) => ({
|
|
2673
|
+
...u,
|
|
2674
|
+
renderedSlots: pt(
|
|
2670
2675
|
t,
|
|
2671
2676
|
n,
|
|
2672
2677
|
o,
|
|
@@ -2675,17 +2680,17 @@ const cr = (e) => {
|
|
|
2675
2680
|
)
|
|
2676
2681
|
}));
|
|
2677
2682
|
}, [t, i, o, n, s]);
|
|
2678
|
-
const f = (
|
|
2679
|
-
|
|
2680
|
-
var
|
|
2683
|
+
const f = (u, h, _, g) => {
|
|
2684
|
+
c((w) => {
|
|
2685
|
+
var d, p, y, l, m;
|
|
2681
2686
|
return {
|
|
2682
|
-
...
|
|
2687
|
+
...w,
|
|
2683
2688
|
renderedSlots: {
|
|
2684
|
-
...
|
|
2685
|
-
[
|
|
2686
|
-
...(
|
|
2687
|
-
[
|
|
2688
|
-
...(
|
|
2689
|
+
...w.renderedSlots,
|
|
2690
|
+
[g || "all"]: {
|
|
2691
|
+
...(d = w.renderedSlots) == null ? void 0 : d[g || "all"],
|
|
2692
|
+
[u]: (y = (p = w.renderedSlots) == null ? void 0 : p[g || "all"]) != null && y[u] ? {
|
|
2693
|
+
...(m = (l = w.renderedSlots) == null ? void 0 : l[g || "all"]) == null ? void 0 : m[u],
|
|
2689
2694
|
[h]: _
|
|
2690
2695
|
} : { [h]: _ }
|
|
2691
2696
|
}
|
|
@@ -2694,7 +2699,7 @@ const cr = (e) => {
|
|
|
2694
2699
|
});
|
|
2695
2700
|
};
|
|
2696
2701
|
return /* @__PURE__ */ r(
|
|
2697
|
-
|
|
2702
|
+
Bt.Provider,
|
|
2698
2703
|
{
|
|
2699
2704
|
value: {
|
|
2700
2705
|
...a,
|
|
@@ -2703,8 +2708,8 @@ const cr = (e) => {
|
|
|
2703
2708
|
children: e
|
|
2704
2709
|
}
|
|
2705
2710
|
);
|
|
2706
|
-
}, Mr =
|
|
2707
|
-
const o = O(), { view: i, dialog: s, loading: a, loadingComponent:
|
|
2711
|
+
}, Mr = _t(function(t, n) {
|
|
2712
|
+
const o = O(), { view: i, dialog: s, loading: a, loadingComponent: c, resourceViewMode: f, resources: u, translations: h } = o, _ = U(() => {
|
|
2708
2713
|
switch (i) {
|
|
2709
2714
|
case "month":
|
|
2710
2715
|
return /* @__PURE__ */ r(Tr, {});
|
|
@@ -2715,31 +2720,31 @@ const cr = (e) => {
|
|
|
2715
2720
|
default:
|
|
2716
2721
|
return "";
|
|
2717
2722
|
}
|
|
2718
|
-
}, [i]),
|
|
2719
|
-
/* @__PURE__ */ r(
|
|
2720
|
-
/* @__PURE__ */ r(
|
|
2721
|
-
] }) }) }), [
|
|
2722
|
-
return /* @__PURE__ */
|
|
2723
|
+
}, [i]), g = U(() => /* @__PURE__ */ r("div", { className: "rs__table_loading", children: c || /* @__PURE__ */ r("div", { className: "rs__table_loading_internal", children: /* @__PURE__ */ E("span", { children: [
|
|
2724
|
+
/* @__PURE__ */ r(St, { size: 50 }),
|
|
2725
|
+
/* @__PURE__ */ r($, { align: "center", children: h.loading })
|
|
2726
|
+
] }) }) }), [c, h.loading]);
|
|
2727
|
+
return /* @__PURE__ */ E(
|
|
2723
2728
|
er,
|
|
2724
2729
|
{
|
|
2725
2730
|
dialog: s ? 1 : 0,
|
|
2726
2731
|
"data-testid": "rs-wrapper",
|
|
2727
|
-
ref: (
|
|
2728
|
-
const
|
|
2729
|
-
|
|
2730
|
-
el:
|
|
2732
|
+
ref: (w) => {
|
|
2733
|
+
const d = n;
|
|
2734
|
+
d && (d.current = {
|
|
2735
|
+
el: w,
|
|
2731
2736
|
scheduler: o
|
|
2732
2737
|
});
|
|
2733
2738
|
},
|
|
2734
2739
|
children: [
|
|
2735
|
-
a ?
|
|
2740
|
+
a ? g : null,
|
|
2736
2741
|
/* @__PURE__ */ r(mr, {}),
|
|
2737
2742
|
/* @__PURE__ */ r(
|
|
2738
2743
|
tr,
|
|
2739
2744
|
{
|
|
2740
|
-
resource_count: f === "default" ?
|
|
2745
|
+
resource_count: f === "default" ? u.length : 1,
|
|
2741
2746
|
sx: {
|
|
2742
|
-
overflowX: f === "default" &&
|
|
2747
|
+
overflowX: f === "default" && u.length > 1 ? "auto" : void 0,
|
|
2743
2748
|
flexDirection: f === "vertical" ? "column" : void 0
|
|
2744
2749
|
},
|
|
2745
2750
|
"data-testid": "grid",
|
|
@@ -2751,10 +2756,10 @@ const cr = (e) => {
|
|
|
2751
2756
|
}
|
|
2752
2757
|
);
|
|
2753
2758
|
}), Ir = ({ children: e, initial: t }) => {
|
|
2754
|
-
const [n, o] = L({ ...$t
|
|
2755
|
-
|
|
2756
|
-
o((
|
|
2757
|
-
...
|
|
2759
|
+
const [n, o] = L({ ...Rt, ...$t(t) });
|
|
2760
|
+
K(() => {
|
|
2761
|
+
o((d) => ({
|
|
2762
|
+
...d,
|
|
2758
2763
|
onEventDrop: t.onEventDrop,
|
|
2759
2764
|
customEditor: t.customEditor,
|
|
2760
2765
|
customHeaderContent: t.customHeaderContent,
|
|
@@ -2768,99 +2773,102 @@ const cr = (e) => {
|
|
|
2768
2773
|
t.events,
|
|
2769
2774
|
t.customHeaderContent,
|
|
2770
2775
|
t.getRemoteEvents
|
|
2771
|
-
]),
|
|
2772
|
-
typeof t.loading < "u" && o((
|
|
2776
|
+
]), K(() => {
|
|
2777
|
+
typeof t.loading < "u" && o((d) => ({ ...d, loading: t.loading }));
|
|
2773
2778
|
}, [t.loading]);
|
|
2774
|
-
const i = (
|
|
2775
|
-
o((
|
|
2779
|
+
const i = (d, p) => {
|
|
2780
|
+
o((y) => ({ ...y, [p]: d }));
|
|
2776
2781
|
}, s = () => Pn(n), a = () => {
|
|
2777
|
-
o((
|
|
2778
|
-
const
|
|
2779
|
-
return n.onViewChange && typeof n.onViewChange == "function" && n.onViewChange(n.view,
|
|
2782
|
+
o((d) => {
|
|
2783
|
+
const p = !d.agenda;
|
|
2784
|
+
return n.onViewChange && typeof n.onViewChange == "function" && n.onViewChange(n.view, p), { ...d, agenda: p };
|
|
2780
2785
|
});
|
|
2781
|
-
},
|
|
2782
|
-
const
|
|
2783
|
-
o((
|
|
2784
|
-
var
|
|
2786
|
+
}, c = (d, p) => {
|
|
2787
|
+
const y = p;
|
|
2788
|
+
o((l) => {
|
|
2789
|
+
var m;
|
|
2785
2790
|
return {
|
|
2786
|
-
...
|
|
2787
|
-
dialog:
|
|
2788
|
-
selectedRange:
|
|
2791
|
+
...l,
|
|
2792
|
+
dialog: d,
|
|
2793
|
+
selectedRange: y != null && y.event_id ? void 0 : y || {
|
|
2789
2794
|
start: /* @__PURE__ */ new Date(),
|
|
2790
2795
|
end: new Date(Date.now() + 3600 * 1e3)
|
|
2791
2796
|
},
|
|
2792
|
-
selectedEvent:
|
|
2793
|
-
selectedResource:
|
|
2797
|
+
selectedEvent: y != null && y.event_id ? y : void 0,
|
|
2798
|
+
selectedResource: y == null ? void 0 : y[(m = n.resourceFields) == null ? void 0 : m.idField]
|
|
2794
2799
|
};
|
|
2795
2800
|
});
|
|
2796
|
-
}, f = (
|
|
2797
|
-
typeof t.loading > "u" && o((
|
|
2798
|
-
},
|
|
2799
|
-
const
|
|
2800
|
-
let
|
|
2801
|
-
|
|
2802
|
-
}, h = (
|
|
2803
|
-
let
|
|
2804
|
-
|
|
2805
|
-
const
|
|
2806
|
-
return
|
|
2807
|
-
}) :
|
|
2808
|
-
(
|
|
2809
|
-
) :
|
|
2810
|
-
}, _ = (
|
|
2811
|
-
o((
|
|
2812
|
-
},
|
|
2813
|
-
var
|
|
2814
|
-
const
|
|
2815
|
-
let
|
|
2816
|
-
if (
|
|
2817
|
-
const
|
|
2818
|
-
if (
|
|
2819
|
-
if (
|
|
2820
|
-
if (
|
|
2801
|
+
}, f = (d) => {
|
|
2802
|
+
typeof t.loading > "u" && o((p) => ({ ...p, loading: d }));
|
|
2803
|
+
}, u = (d) => {
|
|
2804
|
+
const p = s();
|
|
2805
|
+
let y;
|
|
2806
|
+
p.includes("day") ? (y = "day", o((l) => ({ ...l, view: "day", selectedDate: d }))) : p.includes("week") ? (y = "week", o((l) => ({ ...l, view: "week", selectedDate: d }))) : console.warn("No Day/Week views available"), y && n.onViewChange && typeof n.onViewChange == "function" && n.onViewChange(y, n.agenda), y && n.onSelectedDateChange && typeof n.onSelectedDateChange == "function" && n.onSelectedDateChange(d);
|
|
2807
|
+
}, h = (d, p) => {
|
|
2808
|
+
let y;
|
|
2809
|
+
p === "edit" ? Array.isArray(d) ? y = n.events.map((l) => {
|
|
2810
|
+
const m = d.find((k) => k.event_id === l.event_id);
|
|
2811
|
+
return m ? { ...l, ...m } : l;
|
|
2812
|
+
}) : y = n.events.map(
|
|
2813
|
+
(l) => l.event_id === d.event_id ? { ...l, ...d } : l
|
|
2814
|
+
) : y = n.events.concat(d), o((l) => ({ ...l, events: y }));
|
|
2815
|
+
}, _ = (d) => {
|
|
2816
|
+
o((p) => ({ ...p, currentDragged: d }));
|
|
2817
|
+
}, g = async (d, p, y, l, m) => {
|
|
2818
|
+
var v;
|
|
2819
|
+
const k = n.events.find((b) => typeof b.event_id == "number" ? b.event_id === +p : b.event_id === p), C = n.fields.find((b) => b.name === l), D = !!((v = C == null ? void 0 : C.config) != null && v.multiple);
|
|
2820
|
+
let T = m;
|
|
2821
|
+
if (C) {
|
|
2822
|
+
const b = k[l], S = Ge(C, b, k).value;
|
|
2823
|
+
if (D)
|
|
2824
|
+
if (S.includes(m)) {
|
|
2825
|
+
if (at(k.start, y))
|
|
2821
2826
|
return;
|
|
2822
|
-
|
|
2827
|
+
T = S;
|
|
2823
2828
|
} else
|
|
2824
|
-
|
|
2829
|
+
T = S.length > 1 ? [...S, m] : [m];
|
|
2825
2830
|
}
|
|
2826
|
-
if (
|
|
2831
|
+
if (at(k.start, y) && (!T || !D && T === k[l]))
|
|
2827
2832
|
return;
|
|
2828
|
-
const
|
|
2829
|
-
...
|
|
2830
|
-
start:
|
|
2831
|
-
end: de(
|
|
2833
|
+
const M = $e(k.end, k.start), I = {
|
|
2834
|
+
...k,
|
|
2835
|
+
start: y,
|
|
2836
|
+
end: de(y, M),
|
|
2832
2837
|
recurring: void 0,
|
|
2833
|
-
[
|
|
2838
|
+
[l]: T || ""
|
|
2834
2839
|
};
|
|
2835
2840
|
if (!n.onEventDrop || typeof n.onEventDrop != "function")
|
|
2836
|
-
return h(
|
|
2841
|
+
return h(I, "edit");
|
|
2837
2842
|
try {
|
|
2838
2843
|
f(!0);
|
|
2839
|
-
const
|
|
2840
|
-
|
|
2844
|
+
const b = await n.onEventDrop(d, y, I, k);
|
|
2845
|
+
b && h(b, "edit");
|
|
2841
2846
|
} finally {
|
|
2842
2847
|
f(!1);
|
|
2843
2848
|
}
|
|
2849
|
+
}, w = () => {
|
|
2850
|
+
t.getRemoteEvents && o((d) => ({ ...d, _refetchToken: d._refetchToken + 1 }));
|
|
2844
2851
|
};
|
|
2845
2852
|
return /* @__PURE__ */ r(
|
|
2846
|
-
|
|
2853
|
+
At.Provider,
|
|
2847
2854
|
{
|
|
2848
2855
|
value: {
|
|
2849
2856
|
...n,
|
|
2850
2857
|
handleState: i,
|
|
2851
2858
|
getViews: s,
|
|
2852
2859
|
toggleAgenda: a,
|
|
2853
|
-
triggerDialog:
|
|
2860
|
+
triggerDialog: c,
|
|
2854
2861
|
triggerLoading: f,
|
|
2855
|
-
handleGotoDay:
|
|
2862
|
+
handleGotoDay: u,
|
|
2856
2863
|
confirmEvent: h,
|
|
2857
2864
|
setCurrentDragged: _,
|
|
2858
|
-
onDrop:
|
|
2865
|
+
onDrop: g,
|
|
2866
|
+
refetch: w
|
|
2859
2867
|
},
|
|
2860
2868
|
children: e
|
|
2861
2869
|
}
|
|
2862
2870
|
);
|
|
2863
|
-
}, eo =
|
|
2871
|
+
}, eo = _t(function(t, n) {
|
|
2864
2872
|
return /* @__PURE__ */ r(Ir, { initial: t, children: /* @__PURE__ */ r(Mr, { ref: n }) });
|
|
2865
2873
|
});
|
|
2866
2874
|
export {
|