@object-ui/plugin-calendar 17.3.0 → 17.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +594 -0
- package/README.md +133 -48
- package/dist/CalendarView.d.ts +24 -4
- package/dist/CalendarView.d.ts.map +1 -1
- package/dist/ObjectCalendar.d.ts +18 -2
- package/dist/ObjectCalendar.d.ts.map +1 -1
- package/dist/index.d.ts +27 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +338 -248
- package/dist/index.umd.cjs +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import t, { useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
3
|
-
import { ComponentRegistry as s, buildExpandFields as c,
|
|
4
|
-
import { extractWriteErrorMessage as
|
|
5
|
-
import { CalendarIcon as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { createSafeTranslation as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { usePullToRefresh as
|
|
10
|
-
import { RecordDetailDrawer as
|
|
3
|
+
import { ComponentRegistry as s, buildExpandFields as c, convertSortToQueryParams as l, extractRecords as u, getRecordDisplayName as d } from "@object-ui/core";
|
|
4
|
+
import { ElementDataSourceGate as f, extractWriteErrorMessage as p, isPermissionError as m, useNavigationOverlay as h, useSafeTranslate as g, useSchemaContext as _ } from "@object-ui/react";
|
|
5
|
+
import { CalendarIcon as v, ChevronLeftIcon as y, ChevronRightIcon as b, PlusIcon as x } from "lucide-react";
|
|
6
|
+
import { Button as S, Calendar as C, Dialog as w, DialogContent as T, DialogDescription as E, DialogFooter as D, DialogHeader as ee, DialogTitle as te, Input as O, Label as ne, Popover as k, PopoverContent as A, PopoverTrigger as j, Select as M, SelectContent as N, SelectItem as P, SelectTrigger as re, SelectValue as F, cn as I, toast as ie, useIsMobile as ae } from "@object-ui/components";
|
|
7
|
+
import { createSafeTranslation as oe } from "@object-ui/i18n";
|
|
8
|
+
import { Fragment as se, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
9
|
+
import { usePullToRefresh as ce } from "@object-ui/mobile";
|
|
10
|
+
import { RecordDetailDrawer as le, deriveRecordPageHref as ue } from "@object-ui/plugin-detail";
|
|
11
11
|
//#region src/CalendarView.tsx
|
|
12
|
-
var
|
|
12
|
+
var z = "bg-blue-100 text-blue-900 border border-blue-200", de = /* @__PURE__ */ new Date(), fe = [
|
|
13
13
|
"bg-blue-100 text-blue-900 border border-blue-200",
|
|
14
14
|
"bg-emerald-100 text-emerald-900 border border-emerald-200",
|
|
15
15
|
"bg-amber-100 text-amber-900 border border-amber-200",
|
|
@@ -18,19 +18,19 @@ var le = "bg-blue-100 text-blue-900 border border-blue-200", z = /* @__PURE__ */
|
|
|
18
18
|
"bg-cyan-100 text-cyan-900 border border-cyan-200",
|
|
19
19
|
"bg-orange-100 text-orange-900 border border-orange-200",
|
|
20
20
|
"bg-fuchsia-100 text-fuchsia-900 border border-fuchsia-200"
|
|
21
|
-
],
|
|
21
|
+
], pe = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i, me = /(^|\s)(bg|text|from|to|via)-/;
|
|
22
22
|
function B(e) {
|
|
23
|
-
if (!e) return { className:
|
|
24
|
-
if (
|
|
23
|
+
if (!e) return { className: z };
|
|
24
|
+
if (pe.test(e)) return {
|
|
25
25
|
className: "text-white",
|
|
26
26
|
inlineColor: e
|
|
27
27
|
};
|
|
28
|
-
if (
|
|
28
|
+
if (me.test(e)) return { className: e };
|
|
29
29
|
let t = 0;
|
|
30
30
|
for (let n = 0; n < e.length; n++) t = (t << 5) - t + e.charCodeAt(n) | 0;
|
|
31
|
-
return { className:
|
|
31
|
+
return { className: fe[Math.abs(t) % fe.length] };
|
|
32
32
|
}
|
|
33
|
-
var V =
|
|
33
|
+
var V = oe({
|
|
34
34
|
"calendar.today": "Today",
|
|
35
35
|
"calendar.month": "Month",
|
|
36
36
|
"calendar.week": "Week",
|
|
@@ -39,10 +39,10 @@ var V = F({
|
|
|
39
39
|
"calendar.moreEvents": "+{{count}} more",
|
|
40
40
|
"calendar.allDay": "all-day"
|
|
41
41
|
}, "calendar.today");
|
|
42
|
-
function
|
|
43
|
-
let [m, h] = e.useState(n), [
|
|
42
|
+
function he({ events: t = [], view: n = "month", currentDate: r = de, locale: i = "default", onEventClick: a, onDateClick: o, onViewChange: s, onNavigate: c, onAddClick: l, onEventDrop: u, onTimeRangeSelect: d, slotMinutes: f = 30, className: p }) {
|
|
43
|
+
let [m, h] = e.useState(n), [g, _] = e.useState(r), { t: w, language: T } = V(), E = i === "default" ? T : i;
|
|
44
44
|
e.useEffect(() => {
|
|
45
|
-
|
|
45
|
+
_(r);
|
|
46
46
|
}, [r]), e.useEffect(() => {
|
|
47
47
|
h(n);
|
|
48
48
|
}, [n]);
|
|
@@ -54,23 +54,23 @@ function pe({ events: t = [], view: n = "month", currentDate: r = z, locale: i =
|
|
|
54
54
|
return t(e), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
55
55
|
}, []);
|
|
56
56
|
let ee = () => {
|
|
57
|
-
let e = new Date(
|
|
58
|
-
m === "month" ? e.setMonth(e.getMonth() - 1) : m === "week" ? e.setDate(e.getDate() - 7) : e.setDate(e.getDate() - 1),
|
|
57
|
+
let e = new Date(g);
|
|
58
|
+
m === "month" ? e.setMonth(e.getMonth() - 1) : m === "week" ? e.setDate(e.getDate() - 7) : e.setDate(e.getDate() - 1), _(e), c?.(e);
|
|
59
59
|
}, te = () => {
|
|
60
|
-
let e = new Date(
|
|
61
|
-
m === "month" ? e.setMonth(e.getMonth() + 1) : m === "week" ? e.setDate(e.getDate() + 7) : e.setDate(e.getDate() + 1),
|
|
62
|
-
},
|
|
60
|
+
let e = new Date(g);
|
|
61
|
+
m === "month" ? e.setMonth(e.getMonth() + 1) : m === "week" ? e.setDate(e.getDate() + 7) : e.setDate(e.getDate() + 1), _(e), c?.(e);
|
|
62
|
+
}, O = () => {
|
|
63
63
|
let e = /* @__PURE__ */ new Date();
|
|
64
|
-
|
|
65
|
-
},
|
|
64
|
+
_(e), c?.(e);
|
|
65
|
+
}, ne = (e) => {
|
|
66
66
|
h(e), s?.(e);
|
|
67
|
-
},
|
|
68
|
-
if (m === "month") return
|
|
67
|
+
}, ie = () => {
|
|
68
|
+
if (m === "month") return g.toLocaleDateString(E, {
|
|
69
69
|
month: "long",
|
|
70
70
|
year: "numeric"
|
|
71
71
|
});
|
|
72
72
|
if (m === "week") {
|
|
73
|
-
let e = H(
|
|
73
|
+
let e = H(g), t = new Date(e);
|
|
74
74
|
return t.setDate(t.getDate() + 6), `${e.toLocaleDateString(E, {
|
|
75
75
|
month: "short",
|
|
76
76
|
day: "numeric"
|
|
@@ -80,17 +80,17 @@ function pe({ events: t = [], view: n = "month", currentDate: r = z, locale: i =
|
|
|
80
80
|
year: "numeric"
|
|
81
81
|
})}`;
|
|
82
82
|
}
|
|
83
|
-
return
|
|
83
|
+
return g.toLocaleDateString(E, {
|
|
84
84
|
weekday: "long",
|
|
85
85
|
month: "long",
|
|
86
86
|
day: "numeric",
|
|
87
87
|
year: "numeric"
|
|
88
88
|
});
|
|
89
|
-
},
|
|
89
|
+
}, ae = e.useRef(0);
|
|
90
90
|
return /* @__PURE__ */ R("div", {
|
|
91
91
|
role: "region",
|
|
92
92
|
"aria-label": "Calendar",
|
|
93
|
-
className:
|
|
93
|
+
className: I("flex flex-col h-full bg-background min-w-0 overflow-hidden", p),
|
|
94
94
|
children: [/* @__PURE__ */ R("div", {
|
|
95
95
|
className: "flex flex-wrap items-center justify-between gap-2 p-2 sm:p-4 border-b min-w-0",
|
|
96
96
|
children: [/* @__PURE__ */ R("div", {
|
|
@@ -98,48 +98,48 @@ function pe({ events: t = [], view: n = "month", currentDate: r = z, locale: i =
|
|
|
98
98
|
children: [/* @__PURE__ */ R("div", {
|
|
99
99
|
className: "flex items-center bg-muted/50 rounded-lg p-1 gap-1",
|
|
100
100
|
children: [
|
|
101
|
-
/* @__PURE__ */ L(
|
|
101
|
+
/* @__PURE__ */ L(S, {
|
|
102
102
|
variant: "ghost",
|
|
103
103
|
size: "sm",
|
|
104
|
-
onClick:
|
|
104
|
+
onClick: O,
|
|
105
105
|
className: "h-8",
|
|
106
106
|
"aria-label": "Go to today",
|
|
107
107
|
children: w("calendar.today")
|
|
108
108
|
}),
|
|
109
109
|
/* @__PURE__ */ L("div", { className: "h-4 w-px bg-border mx-1" }),
|
|
110
|
-
/* @__PURE__ */ L(
|
|
110
|
+
/* @__PURE__ */ L(S, {
|
|
111
111
|
variant: "ghost",
|
|
112
112
|
size: "icon",
|
|
113
113
|
"aria-label": "Previous period",
|
|
114
114
|
onClick: ee,
|
|
115
115
|
className: "h-8 w-8",
|
|
116
|
-
children: /* @__PURE__ */ L(
|
|
116
|
+
children: /* @__PURE__ */ L(y, { className: "h-4 w-4" })
|
|
117
117
|
}),
|
|
118
|
-
/* @__PURE__ */ L(
|
|
118
|
+
/* @__PURE__ */ L(S, {
|
|
119
119
|
variant: "ghost",
|
|
120
120
|
size: "icon",
|
|
121
121
|
"aria-label": "Next period",
|
|
122
122
|
onClick: te,
|
|
123
123
|
className: "h-8 w-8",
|
|
124
|
-
children: /* @__PURE__ */ L(
|
|
124
|
+
children: /* @__PURE__ */ L(b, { className: "h-4 w-4" })
|
|
125
125
|
})
|
|
126
126
|
]
|
|
127
|
-
}), /* @__PURE__ */ R(
|
|
127
|
+
}), /* @__PURE__ */ R(k, { children: [/* @__PURE__ */ L(j, {
|
|
128
128
|
asChild: !0,
|
|
129
|
-
children: /* @__PURE__ */ R(
|
|
129
|
+
children: /* @__PURE__ */ R(S, {
|
|
130
130
|
variant: "ghost",
|
|
131
|
-
"aria-label": `Current date: ${
|
|
132
|
-
className:
|
|
133
|
-
children: [/* @__PURE__ */ L(
|
|
131
|
+
"aria-label": `Current date: ${ie()}`,
|
|
132
|
+
className: I("text-base sm:text-xl font-semibold h-auto px-2 sm:px-3 py-1 hover:bg-muted/50 transition-colors", "flex items-center gap-2"),
|
|
133
|
+
children: [/* @__PURE__ */ L(v, { className: "h-5 w-5 text-muted-foreground" }), /* @__PURE__ */ L("span", { children: ie() })]
|
|
134
134
|
})
|
|
135
|
-
}), /* @__PURE__ */ L(
|
|
135
|
+
}), /* @__PURE__ */ L(A, {
|
|
136
136
|
className: "w-auto p-0",
|
|
137
137
|
align: "start",
|
|
138
|
-
children: /* @__PURE__ */ L(
|
|
138
|
+
children: /* @__PURE__ */ L(C, {
|
|
139
139
|
mode: "single",
|
|
140
|
-
selected:
|
|
140
|
+
selected: g,
|
|
141
141
|
onSelect: (e) => {
|
|
142
|
-
e && (
|
|
142
|
+
e && (_(e), c?.(e));
|
|
143
143
|
},
|
|
144
144
|
autoFocus: !0,
|
|
145
145
|
startMonth: new Date(2e3, 0),
|
|
@@ -148,57 +148,57 @@ function pe({ events: t = [], view: n = "month", currentDate: r = z, locale: i =
|
|
|
148
148
|
})] })]
|
|
149
149
|
}), /* @__PURE__ */ R("div", {
|
|
150
150
|
className: "flex items-center gap-2",
|
|
151
|
-
children: [/* @__PURE__ */ R(
|
|
151
|
+
children: [/* @__PURE__ */ R(M, {
|
|
152
152
|
value: m,
|
|
153
|
-
onValueChange:
|
|
154
|
-
children: [/* @__PURE__ */ L(
|
|
153
|
+
onValueChange: ne,
|
|
154
|
+
children: [/* @__PURE__ */ L(re, {
|
|
155
155
|
className: "w-32 bg-background",
|
|
156
|
-
children: /* @__PURE__ */ L(
|
|
157
|
-
}), /* @__PURE__ */ R(
|
|
158
|
-
/* @__PURE__ */ L(
|
|
156
|
+
children: /* @__PURE__ */ L(F, {})
|
|
157
|
+
}), /* @__PURE__ */ R(N, { children: [
|
|
158
|
+
/* @__PURE__ */ L(P, {
|
|
159
159
|
value: "day",
|
|
160
160
|
children: w("calendar.day")
|
|
161
161
|
}),
|
|
162
|
-
/* @__PURE__ */ L(
|
|
162
|
+
/* @__PURE__ */ L(P, {
|
|
163
163
|
value: "week",
|
|
164
164
|
children: w("calendar.week")
|
|
165
165
|
}),
|
|
166
|
-
/* @__PURE__ */ L(
|
|
166
|
+
/* @__PURE__ */ L(P, {
|
|
167
167
|
value: "month",
|
|
168
168
|
children: w("calendar.month")
|
|
169
169
|
})
|
|
170
170
|
] })]
|
|
171
|
-
}), l && /* @__PURE__ */ R(
|
|
171
|
+
}), l && /* @__PURE__ */ R(S, {
|
|
172
172
|
onClick: l,
|
|
173
173
|
size: "sm",
|
|
174
174
|
className: "gap-1",
|
|
175
|
-
children: [/* @__PURE__ */ L(
|
|
175
|
+
children: [/* @__PURE__ */ L(x, { className: "h-4 w-4" }), w("calendar.newEvent")]
|
|
176
176
|
})]
|
|
177
177
|
})]
|
|
178
178
|
}), /* @__PURE__ */ R("div", {
|
|
179
179
|
className: "flex-1 overflow-auto",
|
|
180
180
|
onTouchStart: (e) => {
|
|
181
|
-
|
|
181
|
+
ae.current = e.touches[0].clientX;
|
|
182
182
|
},
|
|
183
183
|
onTouchEnd: (e) => {
|
|
184
|
-
let t =
|
|
184
|
+
let t = ae.current - e.changedTouches[0].clientX;
|
|
185
185
|
if (Math.abs(t) > 50) {
|
|
186
|
-
let e = new Date(
|
|
187
|
-
m === "day" ? e.setDate(e.getDate() + (t > 0 ? 1 : -1)) : m === "week" ? e.setDate(e.getDate() + (t > 0 ? 7 : -7)) : e.setMonth(e.getMonth() + (t > 0 ? 1 : -1)),
|
|
186
|
+
let e = new Date(g);
|
|
187
|
+
m === "day" ? e.setDate(e.getDate() + (t > 0 ? 1 : -1)) : m === "week" ? e.setDate(e.getDate() + (t > 0 ? 7 : -7)) : e.setMonth(e.getMonth() + (t > 0 ? 1 : -1)), _(e), c?.(e);
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
190
|
children: [
|
|
191
|
-
m === "month" && /* @__PURE__ */ L(
|
|
192
|
-
date:
|
|
191
|
+
m === "month" && /* @__PURE__ */ L(_e, {
|
|
192
|
+
date: g,
|
|
193
193
|
events: t,
|
|
194
194
|
locale: E,
|
|
195
195
|
onEventClick: a,
|
|
196
196
|
onDateClick: o,
|
|
197
197
|
onEventDrop: u
|
|
198
198
|
}),
|
|
199
|
-
m === "week" && /* @__PURE__ */ L(
|
|
199
|
+
m === "week" && /* @__PURE__ */ L(J, {
|
|
200
200
|
mode: "week",
|
|
201
|
-
date:
|
|
201
|
+
date: g,
|
|
202
202
|
events: t,
|
|
203
203
|
locale: E,
|
|
204
204
|
slotMinutes: f,
|
|
@@ -206,9 +206,9 @@ function pe({ events: t = [], view: n = "month", currentDate: r = z, locale: i =
|
|
|
206
206
|
onEventDrop: u,
|
|
207
207
|
onTimeRangeSelect: d
|
|
208
208
|
}),
|
|
209
|
-
m === "day" && /* @__PURE__ */ L(
|
|
209
|
+
m === "day" && /* @__PURE__ */ L(J, {
|
|
210
210
|
mode: "day",
|
|
211
|
-
date:
|
|
211
|
+
date: g,
|
|
212
212
|
events: t,
|
|
213
213
|
locale: E,
|
|
214
214
|
slotMinutes: f,
|
|
@@ -224,7 +224,7 @@ function H(e) {
|
|
|
224
224
|
let t = new Date(e), n = t.getDay(), r = t.getDate() - n;
|
|
225
225
|
return t.setDate(r), t;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function ge(e) {
|
|
228
228
|
let t = e.getFullYear(), n = e.getMonth(), r = new Date(t, n, 1), i = new Date(t, n + 1, 0), a = r.getDay(), o = [];
|
|
229
229
|
for (let e = a - 1; e >= 0; e--) {
|
|
230
230
|
let t = new Date(r.getTime());
|
|
@@ -238,11 +238,11 @@ function me(e) {
|
|
|
238
238
|
}
|
|
239
239
|
return o;
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function U(e, t) {
|
|
242
242
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
let s = e.useMemo(() =>
|
|
244
|
+
function _e({ date: t, events: n, locale: r = "default", onEventClick: i, onDateClick: a, onEventDrop: o }) {
|
|
245
|
+
let s = e.useMemo(() => ge(t), [t.getFullYear(), t.getMonth()]), c = e.useMemo(() => /* @__PURE__ */ new Date(), []), { t: l } = V(), u = e.useMemo(() => {
|
|
246
246
|
let e = new Date(2024, 0, 7);
|
|
247
247
|
return Array.from({ length: 7 }, (t, n) => {
|
|
248
248
|
let i = new Date(e);
|
|
@@ -328,7 +328,7 @@ function ge({ date: t, events: n, locale: r = "default", onEventClick: i, onDate
|
|
|
328
328
|
"aria-label": "Calendar grid",
|
|
329
329
|
className: "grid grid-cols-7 flex-1 auto-rows-fr",
|
|
330
330
|
children: s.map((e, n) => {
|
|
331
|
-
let r = `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`, s = h.get(r) || [], u = e.getMonth() === t.getMonth(), f =
|
|
331
|
+
let r = `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`, s = h.get(r) || [], u = e.getMonth() === t.getMonth(), f = U(e, c);
|
|
332
332
|
return /* @__PURE__ */ R("div", {
|
|
333
333
|
role: "gridcell",
|
|
334
334
|
"aria-label": `${e.toLocaleDateString("default", {
|
|
@@ -337,13 +337,13 @@ function ge({ date: t, events: n, locale: r = "default", onEventClick: i, onDate
|
|
|
337
337
|
day: "numeric",
|
|
338
338
|
year: "numeric"
|
|
339
339
|
})}${s.length > 0 ? `, ${s.length} event${s.length > 1 ? "s" : ""}` : ""}`,
|
|
340
|
-
className:
|
|
340
|
+
className: I("border-b border-r last:border-r-0 p-2 min-h-[100px] cursor-pointer hover:bg-accent/50", !u && "bg-muted/50 text-muted-foreground opacity-50", p === n && "ring-2 ring-primary"),
|
|
341
341
|
onClick: () => a?.(e),
|
|
342
342
|
onDragOver: (e) => v(e, n),
|
|
343
343
|
onDragLeave: y,
|
|
344
344
|
onDrop: (t) => b(t, e),
|
|
345
345
|
children: [/* @__PURE__ */ L("div", {
|
|
346
|
-
className:
|
|
346
|
+
className: I("text-sm font-medium mb-2", f && "inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground h-6 w-6"),
|
|
347
347
|
...f ? { "aria-current": "date" } : {},
|
|
348
348
|
children: e.getDate()
|
|
349
349
|
}), /* @__PURE__ */ R("div", {
|
|
@@ -357,7 +357,7 @@ function ge({ date: t, events: n, locale: r = "default", onEventClick: i, onDate
|
|
|
357
357
|
draggable: !!o,
|
|
358
358
|
onDragStart: (n) => g(n, t, "move", e),
|
|
359
359
|
onDragEnd: _,
|
|
360
|
-
className:
|
|
360
|
+
className: I("relative text-xs hover:opacity-80 truncate", o ? "cursor-move" : "cursor-pointer", c ? "h-1.5" : "px-2 py-0.5", r ? "rounded-l" : "rounded-l-none", a ? "rounded-r" : "rounded-r-none", !a && "-mr-2", l, d === t.id && "opacity-50"),
|
|
361
361
|
style: u ? { backgroundColor: u } : void 0,
|
|
362
362
|
onClick: (e) => {
|
|
363
363
|
e.stopPropagation(), i?.(t);
|
|
@@ -383,24 +383,24 @@ function ge({ date: t, events: n, locale: r = "default", onEventClick: i, onDate
|
|
|
383
383
|
})]
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
var
|
|
387
|
-
function
|
|
386
|
+
var W = 48;
|
|
387
|
+
function G(e) {
|
|
388
388
|
let t = new Date(e);
|
|
389
389
|
return t.setHours(0, 0, 0, 0), t;
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function K(e) {
|
|
392
392
|
return e.getHours() * 60 + e.getMinutes();
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function q(e) {
|
|
395
395
|
return `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`;
|
|
396
396
|
}
|
|
397
|
-
function
|
|
398
|
-
let { t: l } = V(), u =
|
|
399
|
-
if (t === "day") return [
|
|
397
|
+
function J({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a = 30, onEventClick: o, onEventDrop: s, onTimeRangeSelect: c }) {
|
|
398
|
+
let { t: l } = V(), u = W * a / 60, d = 1152, f = e.useMemo(() => {
|
|
399
|
+
if (t === "day") return [G(n)];
|
|
400
400
|
let e = H(n);
|
|
401
401
|
return Array.from({ length: 7 }, (t, n) => {
|
|
402
402
|
let r = new Date(e);
|
|
403
|
-
return r.setDate(e.getDate() + n),
|
|
403
|
+
return r.setDate(e.getDate() + n), G(r);
|
|
404
404
|
});
|
|
405
405
|
}, [
|
|
406
406
|
t,
|
|
@@ -420,13 +420,13 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
420
420
|
};
|
|
421
421
|
}, [r, m]), _ = e.useMemo(() => {
|
|
422
422
|
let e = /* @__PURE__ */ new Map();
|
|
423
|
-
for (let t of f) e.set(
|
|
423
|
+
for (let t of f) e.set(q(t), []);
|
|
424
424
|
for (let t of h) {
|
|
425
|
-
let n =
|
|
425
|
+
let n = G(new Date(t.start)), r = t.end ? new Date(t.end) : new Date(t.start), i = G(r);
|
|
426
426
|
r.getHours() === 0 && r.getMinutes() === 0 && r.getSeconds() === 0 && r.getTime() > n.getTime() && (i = new Date(i), i.setDate(i.getDate() - 1));
|
|
427
427
|
for (let r of f) {
|
|
428
|
-
let a =
|
|
429
|
-
a < n || a > i || e.get(
|
|
428
|
+
let a = G(r);
|
|
429
|
+
a < n || a > i || e.get(q(r)).push({
|
|
430
430
|
event: t,
|
|
431
431
|
isStart: a.getTime() === n.getTime(),
|
|
432
432
|
isEnd: a.getTime() === i.getTime()
|
|
@@ -436,14 +436,14 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
436
436
|
return e;
|
|
437
437
|
}, [f, h]), v = e.useMemo(() => {
|
|
438
438
|
let e = /* @__PURE__ */ new Map();
|
|
439
|
-
for (let t of f) e.set(
|
|
439
|
+
for (let t of f) e.set(q(t), []);
|
|
440
440
|
for (let t of g) {
|
|
441
441
|
let n = new Date(t.start), r = t.end ? new Date(t.end) : new Date(n.getTime() + 36e5);
|
|
442
442
|
for (let i of f) {
|
|
443
|
-
let a =
|
|
443
|
+
let a = G(i), o = new Date(a);
|
|
444
444
|
if (o.setDate(o.getDate() + 1), r <= a || n >= o) continue;
|
|
445
|
-
let s = n < a ? a : n, c = r > o ? o : r, l =
|
|
446
|
-
e.get(
|
|
445
|
+
let s = n < a ? a : n, c = r > o ? o : r, l = K(s), u = c.getTime() === o.getTime() ? 1440 : K(c);
|
|
446
|
+
e.get(q(i)).push({
|
|
447
447
|
event: t,
|
|
448
448
|
startMin: l,
|
|
449
449
|
endMin: Math.max(u, l + 15),
|
|
@@ -486,7 +486,7 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
486
486
|
let T = e.useRef(!1), E = e.useCallback((e, t) => {
|
|
487
487
|
let n = x.current[t];
|
|
488
488
|
if (!n) return 0;
|
|
489
|
-
let r = (e - n.getBoundingClientRect().top + n.scrollTop) /
|
|
489
|
+
let r = (e - n.getBoundingClientRect().top + n.scrollTop) / W * 60, i = Math.round(r / a) * a;
|
|
490
490
|
return Math.max(0, Math.min(1440, i));
|
|
491
491
|
}, [a]), D = e.useCallback((e) => {
|
|
492
492
|
for (let t = 0; t < x.current.length; t++) {
|
|
@@ -573,7 +573,7 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
573
573
|
weekday: e.toLocaleDateString(i, { weekday: "short" }),
|
|
574
574
|
day: e.getDate(),
|
|
575
575
|
month: e.toLocaleDateString(i, { month: "short" }),
|
|
576
|
-
isToday:
|
|
576
|
+
isToday: U(e, p)
|
|
577
577
|
})), [
|
|
578
578
|
f,
|
|
579
579
|
i,
|
|
@@ -602,7 +602,7 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
602
602
|
dayIndex: n,
|
|
603
603
|
minutes: i
|
|
604
604
|
});
|
|
605
|
-
},
|
|
605
|
+
}, ne = (e, t) => {
|
|
606
606
|
if (!c || e.button !== 0) return;
|
|
607
607
|
e.preventDefault();
|
|
608
608
|
let n = E(e.clientY, t);
|
|
@@ -612,10 +612,10 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
612
612
|
anchorMinutes: n,
|
|
613
613
|
headMinutes: n
|
|
614
614
|
});
|
|
615
|
-
},
|
|
615
|
+
}, k = (e) => {
|
|
616
616
|
if (!S) return null;
|
|
617
617
|
if (S.kind === "select" && S.dayIndex === e) {
|
|
618
|
-
let t = Math.min(S.anchorMinutes, S.headMinutes), n = Math.max(S.anchorMinutes, S.headMinutes), r = t / 60 *
|
|
618
|
+
let t = Math.min(S.anchorMinutes, S.headMinutes), n = Math.max(S.anchorMinutes, S.headMinutes), r = t / 60 * W, a = Math.max(u, (n - t) / 60 * W);
|
|
619
619
|
return /* @__PURE__ */ L("div", {
|
|
620
620
|
className: "absolute left-1 right-1 rounded bg-primary/30 border border-primary pointer-events-none z-10",
|
|
621
621
|
style: {
|
|
@@ -625,12 +625,12 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
625
625
|
"aria-hidden": !0,
|
|
626
626
|
children: /* @__PURE__ */ L("div", {
|
|
627
627
|
className: "px-2 py-0.5 text-xs font-medium text-primary",
|
|
628
|
-
children:
|
|
628
|
+
children: Y(f[e], t, n, i)
|
|
629
629
|
})
|
|
630
630
|
});
|
|
631
631
|
}
|
|
632
632
|
if (S.kind === "move" && S.dayIndex === e) {
|
|
633
|
-
let t = S.minutes - S.grabMinuteOffset, n = Math.max(0, Math.min(1440 - S.durationMin, Math.round(t / a) * a)), r = n / 60 *
|
|
633
|
+
let t = S.minutes - S.grabMinuteOffset, n = Math.max(0, Math.min(1440 - S.durationMin, Math.round(t / a) * a)), r = n / 60 * W, o = S.durationMin / 60 * W;
|
|
634
634
|
return /* @__PURE__ */ L("div", {
|
|
635
635
|
className: "absolute left-1 right-1 rounded border-2 border-dashed border-primary bg-primary/10 pointer-events-none z-10",
|
|
636
636
|
style: {
|
|
@@ -640,14 +640,14 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
640
640
|
"aria-hidden": !0,
|
|
641
641
|
children: /* @__PURE__ */ L("div", {
|
|
642
642
|
className: "px-2 py-0.5 text-xs font-medium text-primary",
|
|
643
|
-
children:
|
|
643
|
+
children: Y(f[e], n, n + S.durationMin, i)
|
|
644
644
|
})
|
|
645
645
|
});
|
|
646
646
|
}
|
|
647
647
|
if ((S.kind === "resize-top" || S.kind === "resize-bottom") && S.dayIndex === e) {
|
|
648
648
|
let t, n;
|
|
649
649
|
S.kind === "resize-top" ? (t = Math.min(S.anchorEndMin - a, Math.max(0, S.minutes)), n = S.anchorEndMin) : (t = S.anchorStartMin, n = Math.max(S.anchorStartMin + a, Math.min(1440, S.minutes)));
|
|
650
|
-
let r = t / 60 *
|
|
650
|
+
let r = t / 60 * W, o = (n - t) / 60 * W;
|
|
651
651
|
return /* @__PURE__ */ L("div", {
|
|
652
652
|
className: "absolute left-1 right-1 rounded border-2 border-dashed border-primary bg-primary/10 pointer-events-none z-10",
|
|
653
653
|
style: {
|
|
@@ -657,7 +657,7 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
657
657
|
"aria-hidden": !0,
|
|
658
658
|
children: /* @__PURE__ */ L("div", {
|
|
659
659
|
className: "px-2 py-0.5 text-xs font-medium text-primary",
|
|
660
|
-
children:
|
|
660
|
+
children: Y(f[e], t, n, i)
|
|
661
661
|
})
|
|
662
662
|
});
|
|
663
663
|
}
|
|
@@ -674,12 +674,12 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
674
674
|
"aria-hidden": !0
|
|
675
675
|
}), ee.map((e, t) => /* @__PURE__ */ R("div", {
|
|
676
676
|
role: "columnheader",
|
|
677
|
-
className:
|
|
677
|
+
className: I("flex-1 p-2 text-center text-sm border-r last:border-r-0", e.isToday && "bg-primary/5"),
|
|
678
678
|
children: [/* @__PURE__ */ L("div", {
|
|
679
679
|
className: "text-xs text-muted-foreground",
|
|
680
680
|
children: e.weekday
|
|
681
681
|
}), /* @__PURE__ */ L("div", {
|
|
682
|
-
className:
|
|
682
|
+
className: I("font-medium", e.isToday && "inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground h-6 w-6 mx-auto"),
|
|
683
683
|
children: e.day
|
|
684
684
|
})]
|
|
685
685
|
}, t))]
|
|
@@ -690,7 +690,7 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
690
690
|
className: "w-14 shrink-0 border-r flex items-start justify-end pr-1 pt-1 text-[10px] text-muted-foreground sticky left-0 bg-muted/20",
|
|
691
691
|
children: l("calendar.allDay") === "calendar.allDay" ? "all-day" : l("calendar.allDay")
|
|
692
692
|
}), f.map((e) => {
|
|
693
|
-
let t =
|
|
693
|
+
let t = q(e), n = _.get(t) ?? [];
|
|
694
694
|
return /* @__PURE__ */ L("div", {
|
|
695
695
|
className: "flex-1 border-r last:border-r-0 min-h-[28px] p-0.5 space-y-0.5",
|
|
696
696
|
children: n.map(({ event: e, isStart: t, isEnd: n }, r) => {
|
|
@@ -701,7 +701,7 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
701
701
|
onClick: (t) => {
|
|
702
702
|
t.stopPropagation(), o?.(e);
|
|
703
703
|
},
|
|
704
|
-
className:
|
|
704
|
+
className: I("text-[11px] px-2 py-0.5 truncate cursor-pointer hover:opacity-80", t ? "rounded-l" : "rounded-l-none -ml-0.5", n ? "rounded-r" : "rounded-r-none -mr-0.5", i),
|
|
705
705
|
style: a ? { backgroundColor: a } : void 0,
|
|
706
706
|
children: t ? e.title : "\xA0"
|
|
707
707
|
}, `${e.id}-${r}`);
|
|
@@ -718,18 +718,18 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
718
718
|
className: "w-14 shrink-0 border-r relative",
|
|
719
719
|
children: te.map((e, t) => /* @__PURE__ */ L("div", {
|
|
720
720
|
className: "absolute right-1 text-[10px] text-muted-foreground -translate-y-1/2",
|
|
721
|
-
style: { top: t *
|
|
721
|
+
style: { top: t * W },
|
|
722
722
|
children: t === 0 ? "" : e
|
|
723
723
|
}, t))
|
|
724
724
|
}), f.map((e, t) => {
|
|
725
|
-
let n =
|
|
725
|
+
let n = q(e), r = y.get(n) ?? [];
|
|
726
726
|
return /* @__PURE__ */ R("div", {
|
|
727
727
|
ref: (e) => {
|
|
728
728
|
x.current[t] = e;
|
|
729
729
|
},
|
|
730
730
|
className: "flex-1 border-r last:border-r-0 relative select-none",
|
|
731
731
|
style: { height: d },
|
|
732
|
-
onPointerDown: (e) =>
|
|
732
|
+
onPointerDown: (e) => ne(e, t),
|
|
733
733
|
"aria-label": e.toLocaleDateString(i, {
|
|
734
734
|
weekday: "long",
|
|
735
735
|
month: "long",
|
|
@@ -739,17 +739,17 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
739
739
|
children: [
|
|
740
740
|
Array.from({ length: 24 }, (e, t) => /* @__PURE__ */ L("div", {
|
|
741
741
|
className: "absolute left-0 right-0 border-t border-muted/60 pointer-events-none",
|
|
742
|
-
style: { top: t *
|
|
742
|
+
style: { top: t * W }
|
|
743
743
|
}, t)),
|
|
744
744
|
a < 60 && Array.from({ length: Math.floor(1440 / a) }, (e, t) => {
|
|
745
745
|
let n = t * a;
|
|
746
746
|
return n % 60 == 0 ? null : /* @__PURE__ */ L("div", {
|
|
747
747
|
className: "absolute left-0 right-0 border-t border-dashed border-muted/30 pointer-events-none",
|
|
748
|
-
style: { top: n / 60 *
|
|
748
|
+
style: { top: n / 60 * W }
|
|
749
749
|
}, t);
|
|
750
750
|
}),
|
|
751
751
|
r.map((n) => {
|
|
752
|
-
let r = n.startMin / 60 *
|
|
752
|
+
let r = n.startMin / 60 * W, a = Math.max(u, (n.endMin - n.startMin) / 60 * W), c = 100 / n.cols, l = n.col * c, { className: d, inlineColor: f } = B(n.event.color), p = S && S.eventId === n.event.id;
|
|
753
753
|
return /* @__PURE__ */ R("div", {
|
|
754
754
|
role: "button",
|
|
755
755
|
tabIndex: 0,
|
|
@@ -763,7 +763,7 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
763
763
|
}
|
|
764
764
|
e.stopPropagation(), o?.(n.event);
|
|
765
765
|
},
|
|
766
|
-
className:
|
|
766
|
+
className: I("absolute rounded text-xs px-2 py-1 overflow-hidden shadow-sm", s ? "cursor-move" : "cursor-pointer", d, p && "opacity-40"),
|
|
767
767
|
style: {
|
|
768
768
|
top: r,
|
|
769
769
|
height: a,
|
|
@@ -778,7 +778,7 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
778
778
|
}),
|
|
779
779
|
/* @__PURE__ */ L("div", {
|
|
780
780
|
className: "text-[10px] opacity-80 truncate",
|
|
781
|
-
children:
|
|
781
|
+
children: Y(e, n.startMin, n.endMin, i)
|
|
782
782
|
}),
|
|
783
783
|
s && n.isStart && /* @__PURE__ */ L("div", {
|
|
784
784
|
onPointerDown: (e) => O(e, n, t, "top"),
|
|
@@ -793,7 +793,7 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
793
793
|
]
|
|
794
794
|
}, `${n.event.id}-${n.startMin}`);
|
|
795
795
|
}),
|
|
796
|
-
|
|
796
|
+
k(t)
|
|
797
797
|
]
|
|
798
798
|
}, n);
|
|
799
799
|
})]
|
|
@@ -802,7 +802,7 @@ function K({ mode: t, date: n, events: r, locale: i = "default", slotMinutes: a
|
|
|
802
802
|
]
|
|
803
803
|
});
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function Y(e, t, n, r) {
|
|
806
806
|
let i = new Date(e);
|
|
807
807
|
i.setHours(0, Math.round(t), 0, 0);
|
|
808
808
|
let a = new Date(e);
|
|
@@ -825,15 +825,6 @@ function ve(e) {
|
|
|
825
825
|
} : null;
|
|
826
826
|
}
|
|
827
827
|
function ye(e) {
|
|
828
|
-
if (e) {
|
|
829
|
-
if (typeof e == "string") {
|
|
830
|
-
let t = e.split(" "), n = t[0], r = t[1]?.toLowerCase() === "desc" ? "desc" : "asc";
|
|
831
|
-
return { [n]: r };
|
|
832
|
-
}
|
|
833
|
-
if (Array.isArray(e)) return e.reduce((e, t) => (t.field && t.order && (e[t.field] = t.order), e), {});
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
function be(e) {
|
|
837
828
|
return "filter" in e && e.filter && typeof e.filter == "object" && "calendar" in e.filter ? e.filter.calendar : e.calendar ? e.calendar : e.startDateField || e.dateField ? {
|
|
838
829
|
startDateField: e.startDateField || e.dateField,
|
|
839
830
|
endDateField: e.endDateField || e.endField,
|
|
@@ -842,87 +833,87 @@ function be(e) {
|
|
|
842
833
|
allDayField: e.allDayField
|
|
843
834
|
} : null;
|
|
844
835
|
}
|
|
845
|
-
var
|
|
846
|
-
let
|
|
847
|
-
let e =
|
|
848
|
-
return typeof window < "u" && window.innerWidth < 768 && e ? "month" :
|
|
836
|
+
var be = ({ schema: e, dataSource: t, className: s, data: f, loading: _, onEventClick: v, onRowClick: y, onDateClick: b, onNavigate: x, onViewChange: C, onEventDrop: k, locale: A }) => {
|
|
837
|
+
let j = g(), M = Array.isArray(f), [N, P] = o(M ? f : []), [re, F] = o(M ? _ ?? !1 : !0), [I, oe] = o(null), [z, de] = o(null), [fe, pe] = o(/* @__PURE__ */ new Date()), me = ae(), B = e.defaultView, [V, H] = o(() => {
|
|
838
|
+
let e = B === "day" || !B;
|
|
839
|
+
return typeof window < "u" && window.innerWidth < 768 && e ? "month" : B || "month";
|
|
849
840
|
});
|
|
850
841
|
r(() => {
|
|
851
|
-
|
|
852
|
-
}, [
|
|
853
|
-
let [
|
|
842
|
+
me && V === "day" && (B === "day" || !B) && H("month");
|
|
843
|
+
}, [me]);
|
|
844
|
+
let [ge, U] = o(0);
|
|
854
845
|
r(() => {
|
|
855
|
-
if (!
|
|
856
|
-
t.resource === e.objectName &&
|
|
846
|
+
if (!M && !(!t?.onMutation || !e.objectName)) return t.onMutation((t) => {
|
|
847
|
+
t.resource === e.objectName && U((e) => e + 1);
|
|
857
848
|
});
|
|
858
849
|
}, [
|
|
859
850
|
t,
|
|
860
851
|
e.objectName,
|
|
861
|
-
|
|
852
|
+
M
|
|
862
853
|
]);
|
|
863
|
-
let
|
|
864
|
-
|
|
865
|
-
}, []), { ref: W, isRefreshing:
|
|
866
|
-
onRefresh:
|
|
854
|
+
let _e = n(async () => {
|
|
855
|
+
U((e) => e + 1);
|
|
856
|
+
}, []), { ref: W, isRefreshing: G, pullDistance: K } = ce({
|
|
857
|
+
onRefresh: _e,
|
|
867
858
|
enabled: !!t && !!e.objectName
|
|
868
|
-
}),
|
|
859
|
+
}), q = i(() => ve(e), [
|
|
869
860
|
e.data,
|
|
870
861
|
e.staticData,
|
|
871
862
|
e.objectName
|
|
872
|
-
]),
|
|
863
|
+
]), J = i(() => ye(e), [
|
|
873
864
|
e.filter,
|
|
874
865
|
e.calendar,
|
|
875
866
|
e.dateField,
|
|
876
867
|
e.endField,
|
|
877
868
|
e.titleField,
|
|
878
869
|
e.colorField
|
|
879
|
-
]),
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
}, [
|
|
883
|
-
|
|
884
|
-
}, [
|
|
885
|
-
if (
|
|
870
|
+
]), Y = q?.provider === "value", be = a(null);
|
|
871
|
+
be.current = z, r(() => {
|
|
872
|
+
M && P(f);
|
|
873
|
+
}, [f, M]), r(() => {
|
|
874
|
+
M && _ !== void 0 && F(_);
|
|
875
|
+
}, [_, M]), r(() => {
|
|
876
|
+
if (M) return;
|
|
886
877
|
let n = !0;
|
|
887
878
|
return (async () => {
|
|
888
879
|
try {
|
|
889
880
|
if (!n) return;
|
|
890
|
-
if (
|
|
891
|
-
n && (
|
|
881
|
+
if (F(!0), Y && q?.provider === "value") {
|
|
882
|
+
n && (P(q.items), F(!1));
|
|
892
883
|
return;
|
|
893
884
|
}
|
|
894
885
|
if (!t || typeof t.find != "function") throw Error("DataSource required for object/api providers");
|
|
895
|
-
if (
|
|
896
|
-
let r =
|
|
886
|
+
if (q?.provider === "object") {
|
|
887
|
+
let r = q.object, i = c(be.current?.fields), a = await t.find(r, {
|
|
897
888
|
$filter: e.filter,
|
|
898
|
-
$orderby:
|
|
889
|
+
$orderby: l(e.sort),
|
|
899
890
|
...i.length > 0 ? { $expand: i } : {}
|
|
900
|
-
}), o =
|
|
901
|
-
n &&
|
|
902
|
-
} else
|
|
903
|
-
n &&
|
|
891
|
+
}), o = u(a);
|
|
892
|
+
n && P(o);
|
|
893
|
+
} else q?.provider === "api" && (console.warn("API provider not yet implemented for ObjectCalendar"), n && P([]));
|
|
894
|
+
n && F(!1);
|
|
904
895
|
} catch (e) {
|
|
905
|
-
console.error("[ObjectCalendar] Error fetching data:", e), n && (
|
|
896
|
+
console.error("[ObjectCalendar] Error fetching data:", e), n && (oe(e), F(!1));
|
|
906
897
|
}
|
|
907
898
|
})(), () => {
|
|
908
899
|
n = !1;
|
|
909
900
|
};
|
|
910
901
|
}, [
|
|
911
|
-
|
|
912
|
-
|
|
902
|
+
M,
|
|
903
|
+
q,
|
|
913
904
|
t,
|
|
914
|
-
|
|
905
|
+
Y,
|
|
915
906
|
e.filter,
|
|
916
907
|
e.sort,
|
|
917
|
-
|
|
908
|
+
ge
|
|
918
909
|
]), r(() => {
|
|
919
|
-
!
|
|
910
|
+
!Y && t && (async () => {
|
|
920
911
|
try {
|
|
921
912
|
if (!t) return;
|
|
922
|
-
let n =
|
|
913
|
+
let n = q?.provider === "object" ? q.object : e.objectName;
|
|
923
914
|
if (!n) return;
|
|
924
915
|
let r = await t.getObjectSchema(n);
|
|
925
|
-
|
|
916
|
+
de(r);
|
|
926
917
|
} catch (e) {
|
|
927
918
|
console.error("Failed to fetch object schema:", e);
|
|
928
919
|
}
|
|
@@ -930,19 +921,19 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
930
921
|
}, [
|
|
931
922
|
e.objectName,
|
|
932
923
|
t,
|
|
933
|
-
|
|
934
|
-
|
|
924
|
+
Y,
|
|
925
|
+
q
|
|
935
926
|
]);
|
|
936
927
|
let xe = i(() => {
|
|
937
|
-
if (!
|
|
938
|
-
let { startDateField: e, endDateField: t, titleField: n, colorField: r } =
|
|
928
|
+
if (!J || !N.length) return [];
|
|
929
|
+
let { startDateField: e, endDateField: t, titleField: n, colorField: r } = J, i = (e) => {
|
|
939
930
|
if (n) {
|
|
940
931
|
let t = e[n], r = typeof t == "string" ? t.trim() : t;
|
|
941
932
|
if (r) return String(r);
|
|
942
933
|
}
|
|
943
|
-
return
|
|
934
|
+
return d(z, e);
|
|
944
935
|
};
|
|
945
|
-
return
|
|
936
|
+
return N.map((n, a) => {
|
|
946
937
|
let o = n[e], s = t ? n[t] : null, c = i(n), l = r ? n[r] : void 0;
|
|
947
938
|
return {
|
|
948
939
|
id: n.id || n._id || `event-${a}`,
|
|
@@ -955,65 +946,65 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
955
946
|
};
|
|
956
947
|
}).filter((e) => !isNaN(e.start.getTime()));
|
|
957
948
|
}, [
|
|
958
|
-
|
|
959
|
-
|
|
949
|
+
N,
|
|
950
|
+
J,
|
|
960
951
|
z
|
|
961
952
|
]);
|
|
962
953
|
n(() => {
|
|
963
|
-
|
|
964
|
-
}, [
|
|
954
|
+
b?.(/* @__PURE__ */ new Date());
|
|
955
|
+
}, [b]);
|
|
965
956
|
let X = e.navigation ?? {
|
|
966
957
|
mode: "drawer",
|
|
967
958
|
width: "min(960px, 60vw)"
|
|
968
|
-
}, Se = X.mode === "drawer" || X.mode === "modal" || X.mode === "split" || X.mode === "popover", Z =
|
|
959
|
+
}, Se = X.mode === "drawer" || X.mode === "modal" || X.mode === "split" || X.mode === "popover", Z = h({
|
|
969
960
|
navigation: X,
|
|
970
961
|
objectName: e.objectName,
|
|
971
|
-
onRowClick: Se ? void 0 :
|
|
962
|
+
onRowClick: Se ? void 0 : y
|
|
972
963
|
}), Ce = n(async (n, r, i) => {
|
|
973
|
-
if (!
|
|
974
|
-
let { startDateField: a, endDateField: o } =
|
|
964
|
+
if (!J) return;
|
|
965
|
+
let { startDateField: a, endDateField: o } = J, s = n?.id ?? n?._id;
|
|
975
966
|
if (!s || !e.objectName || !t?.update) return;
|
|
976
967
|
let c = { [a]: r.toISOString() };
|
|
977
968
|
o && i && (c[o] = i.toISOString());
|
|
978
|
-
let l =
|
|
979
|
-
|
|
969
|
+
let l = N;
|
|
970
|
+
P((e) => e.map((e) => (e?.id ?? e?._id) === s ? {
|
|
980
971
|
...e,
|
|
981
972
|
...c
|
|
982
973
|
} : e));
|
|
983
974
|
try {
|
|
984
975
|
await t.update(e.objectName, s, c);
|
|
985
976
|
} catch (e) {
|
|
986
|
-
|
|
977
|
+
P(l), console.error("[ObjectCalendar] Failed to persist drag-and-drop reschedule:", e), ie.error(m(e) ? j("errors.unauthorized", "You are not authorized to perform this action.") : p(e) ?? j("table.saveFailed", "Save failed"));
|
|
987
978
|
}
|
|
988
979
|
}, [
|
|
989
|
-
|
|
980
|
+
J,
|
|
990
981
|
e.objectName,
|
|
991
982
|
t,
|
|
992
|
-
|
|
993
|
-
|
|
983
|
+
N,
|
|
984
|
+
j
|
|
994
985
|
]), [Q, $] = o(null), we = n((n) => {
|
|
995
|
-
!
|
|
986
|
+
!J || !e.objectName || !t?.create || $({
|
|
996
987
|
start: n,
|
|
997
988
|
title: "",
|
|
998
989
|
submitting: !1
|
|
999
990
|
});
|
|
1000
991
|
}, [
|
|
1001
|
-
|
|
992
|
+
J,
|
|
1002
993
|
e.objectName,
|
|
1003
994
|
t
|
|
1004
995
|
]), Te = n((n, r) => {
|
|
1005
|
-
!
|
|
996
|
+
!J || !e.objectName || !t?.create || $({
|
|
1006
997
|
start: n,
|
|
1007
998
|
end: r,
|
|
1008
999
|
title: "",
|
|
1009
1000
|
submitting: !1
|
|
1010
1001
|
});
|
|
1011
1002
|
}, [
|
|
1012
|
-
|
|
1003
|
+
J,
|
|
1013
1004
|
e.objectName,
|
|
1014
1005
|
t
|
|
1015
1006
|
]), Ee = n(async () => {
|
|
1016
|
-
if (!Q || !
|
|
1007
|
+
if (!Q || !J) return;
|
|
1017
1008
|
let n = Q.title.trim();
|
|
1018
1009
|
if (!n) {
|
|
1019
1010
|
$((e) => e && {
|
|
@@ -1028,7 +1019,7 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
1028
1019
|
submitting: !0,
|
|
1029
1020
|
error: void 0
|
|
1030
1021
|
});
|
|
1031
|
-
let { startDateField: r, endDateField: i, titleField: a } =
|
|
1022
|
+
let { startDateField: r, endDateField: i, titleField: a } = J, o = {
|
|
1032
1023
|
[a || "name"]: n,
|
|
1033
1024
|
[r]: Q.start.toISOString()
|
|
1034
1025
|
};
|
|
@@ -1051,7 +1042,7 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
1051
1042
|
}
|
|
1052
1043
|
try {
|
|
1053
1044
|
let n = await t.create(e.objectName, o), r = (n && (n.record || n.data || n)) ?? null;
|
|
1054
|
-
r && (r.id !== void 0 || r._id !== void 0) &&
|
|
1045
|
+
r && (r.id !== void 0 || r._id !== void 0) && P((e) => [...e, r]), $(null);
|
|
1055
1046
|
} catch (e) {
|
|
1056
1047
|
let t = e?.message || String(e);
|
|
1057
1048
|
$((e) => e && {
|
|
@@ -1062,7 +1053,7 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
1062
1053
|
}
|
|
1063
1054
|
}, [
|
|
1064
1055
|
Q,
|
|
1065
|
-
|
|
1056
|
+
J,
|
|
1066
1057
|
e.objectName,
|
|
1067
1058
|
t,
|
|
1068
1059
|
z
|
|
@@ -1076,42 +1067,42 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
1076
1067
|
children: "Loading calendar..."
|
|
1077
1068
|
})
|
|
1078
1069
|
})
|
|
1079
|
-
}) :
|
|
1070
|
+
}) : I ? /* @__PURE__ */ L("div", {
|
|
1080
1071
|
className: s,
|
|
1081
1072
|
children: /* @__PURE__ */ L("div", {
|
|
1082
1073
|
className: "flex items-center justify-center h-96",
|
|
1083
1074
|
children: /* @__PURE__ */ R("div", {
|
|
1084
1075
|
className: "text-destructive",
|
|
1085
|
-
children: ["Error: ",
|
|
1076
|
+
children: ["Error: ", I.message]
|
|
1086
1077
|
})
|
|
1087
1078
|
})
|
|
1088
|
-
}) :
|
|
1079
|
+
}) : J ? /* @__PURE__ */ R("div", {
|
|
1089
1080
|
ref: W,
|
|
1090
1081
|
className: s,
|
|
1091
1082
|
children: [
|
|
1092
|
-
|
|
1083
|
+
K > 0 && /* @__PURE__ */ L("div", {
|
|
1093
1084
|
className: "flex items-center justify-center text-xs text-muted-foreground",
|
|
1094
|
-
style: { height:
|
|
1095
|
-
children:
|
|
1085
|
+
style: { height: K },
|
|
1086
|
+
children: G ? "Refreshing…" : "Pull to refresh"
|
|
1096
1087
|
}),
|
|
1097
1088
|
/* @__PURE__ */ L("div", {
|
|
1098
1089
|
className: "bg-background h-[calc(100vh-120px)] sm:h-[calc(100vh-160px)] md:h-[calc(100vh-200px)] min-h-[400px] sm:min-h-[600px]",
|
|
1099
|
-
children: /* @__PURE__ */ L(
|
|
1090
|
+
children: /* @__PURE__ */ L(he, {
|
|
1100
1091
|
events: xe,
|
|
1101
|
-
currentDate:
|
|
1102
|
-
view:
|
|
1092
|
+
currentDate: fe,
|
|
1093
|
+
view: V,
|
|
1103
1094
|
locale: A,
|
|
1104
1095
|
onEventClick: (e) => {
|
|
1105
|
-
Z.handleClick(e.data), Se ||
|
|
1096
|
+
Z.handleClick(e.data), Se || v?.(e.data);
|
|
1106
1097
|
},
|
|
1107
1098
|
onDateClick: (e) => {
|
|
1108
|
-
|
|
1099
|
+
b ? b(e) : we(e);
|
|
1109
1100
|
},
|
|
1110
1101
|
onNavigate: (e) => {
|
|
1111
|
-
|
|
1102
|
+
pe(e), x?.(e);
|
|
1112
1103
|
},
|
|
1113
1104
|
onViewChange: (e) => {
|
|
1114
|
-
|
|
1105
|
+
H(e), C?.(e);
|
|
1115
1106
|
},
|
|
1116
1107
|
onAddClick: void 0,
|
|
1117
1108
|
onEventDrop: (e, t, n) => {
|
|
@@ -1120,15 +1111,15 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
1120
1111
|
onTimeRangeSelect: Te
|
|
1121
1112
|
})
|
|
1122
1113
|
}),
|
|
1123
|
-
/* @__PURE__ */ L(
|
|
1114
|
+
/* @__PURE__ */ L(w, {
|
|
1124
1115
|
open: !!Q,
|
|
1125
1116
|
onOpenChange: (e) => {
|
|
1126
1117
|
e || $(null);
|
|
1127
1118
|
},
|
|
1128
|
-
children: /* @__PURE__ */ R(
|
|
1119
|
+
children: /* @__PURE__ */ R(T, {
|
|
1129
1120
|
className: "sm:max-w-md",
|
|
1130
1121
|
children: [
|
|
1131
|
-
/* @__PURE__ */ R(
|
|
1122
|
+
/* @__PURE__ */ R(ee, { children: [/* @__PURE__ */ L(te, { children: "New event" }), /* @__PURE__ */ L(E, { children: Q && (() => {
|
|
1132
1123
|
let e = Q.end && Q.end.getTime() !== Q.start.getTime(), t = Q.start.toLocaleDateString(A, {
|
|
1133
1124
|
year: "numeric",
|
|
1134
1125
|
month: "long",
|
|
@@ -1139,7 +1130,7 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
1139
1130
|
hour: "numeric",
|
|
1140
1131
|
minute: "2-digit"
|
|
1141
1132
|
});
|
|
1142
|
-
return /* @__PURE__ */ R(
|
|
1133
|
+
return /* @__PURE__ */ R(se, { children: [
|
|
1143
1134
|
t,
|
|
1144
1135
|
" · ",
|
|
1145
1136
|
e(Q.start),
|
|
@@ -1147,16 +1138,16 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
1147
1138
|
e(Q.end)
|
|
1148
1139
|
] });
|
|
1149
1140
|
}
|
|
1150
|
-
return /* @__PURE__ */ R(
|
|
1141
|
+
return /* @__PURE__ */ R(se, { children: ["On ", t] });
|
|
1151
1142
|
})() })] }),
|
|
1152
1143
|
/* @__PURE__ */ R("div", {
|
|
1153
1144
|
className: "space-y-2",
|
|
1154
1145
|
children: [
|
|
1155
|
-
/* @__PURE__ */ L(
|
|
1146
|
+
/* @__PURE__ */ L(ne, {
|
|
1156
1147
|
htmlFor: "quick-create-title",
|
|
1157
1148
|
children: "Title"
|
|
1158
1149
|
}),
|
|
1159
|
-
/* @__PURE__ */ L(
|
|
1150
|
+
/* @__PURE__ */ L(O, {
|
|
1160
1151
|
id: "quick-create-title",
|
|
1161
1152
|
autoFocus: !0,
|
|
1162
1153
|
value: Q?.title ?? "",
|
|
@@ -1177,12 +1168,12 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
1177
1168
|
})
|
|
1178
1169
|
]
|
|
1179
1170
|
}),
|
|
1180
|
-
/* @__PURE__ */ R(
|
|
1171
|
+
/* @__PURE__ */ R(D, { children: [/* @__PURE__ */ L(S, {
|
|
1181
1172
|
variant: "outline",
|
|
1182
1173
|
onClick: () => $(null),
|
|
1183
1174
|
disabled: Q?.submitting,
|
|
1184
1175
|
children: "Cancel"
|
|
1185
|
-
}), /* @__PURE__ */ L(
|
|
1176
|
+
}), /* @__PURE__ */ L(S, {
|
|
1186
1177
|
onClick: () => void Ee(),
|
|
1187
1178
|
disabled: Q?.submitting || !Q?.title.trim(),
|
|
1188
1179
|
children: Q?.submitting ? "Creating…" : "Create"
|
|
@@ -1191,10 +1182,10 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
1191
1182
|
})
|
|
1192
1183
|
}),
|
|
1193
1184
|
Z.isOverlay && Z.isOpen && Z.selectedRecord && (() => {
|
|
1194
|
-
let n =
|
|
1185
|
+
let n = q?.provider === "object" ? q.object : e.objectName, r = Z.selectedRecord, i = r.id ?? r._id;
|
|
1195
1186
|
if (!n || i == null) return null;
|
|
1196
|
-
let a =
|
|
1197
|
-
return /* @__PURE__ */ L(
|
|
1187
|
+
let a = J?.titleField ? String(r[J.titleField] ?? "Event Details") : "Event Details";
|
|
1188
|
+
return /* @__PURE__ */ L(le, {
|
|
1198
1189
|
open: !0,
|
|
1199
1190
|
onClose: Z.close,
|
|
1200
1191
|
title: a,
|
|
@@ -1204,15 +1195,15 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
1204
1195
|
dataSource: t,
|
|
1205
1196
|
objectSchema: z,
|
|
1206
1197
|
width: Z.width ?? "min(960px, 60vw)",
|
|
1207
|
-
fullPageHref:
|
|
1198
|
+
fullPageHref: ue(n, i) ?? void 0,
|
|
1208
1199
|
onFieldSave: async (e, r) => {
|
|
1209
|
-
t?.update && (await t.update(n, String(i), { [e]: r }),
|
|
1200
|
+
t?.update && (await t.update(n, String(i), { [e]: r }), P((t) => t.map((t) => String(t.id ?? t._id) === String(i) ? {
|
|
1210
1201
|
...t,
|
|
1211
1202
|
[e]: r
|
|
1212
1203
|
} : t)));
|
|
1213
1204
|
},
|
|
1214
1205
|
onDelete: async () => {
|
|
1215
|
-
t?.delete && (await t.delete(n, String(i)),
|
|
1206
|
+
t?.delete && (await t.delete(n, String(i)), P((e) => e.filter((e) => String(e.id ?? e._id) !== String(i))));
|
|
1216
1207
|
}
|
|
1217
1208
|
});
|
|
1218
1209
|
})()
|
|
@@ -1227,11 +1218,55 @@ var J = ({ schema: e, dataSource: t, className: s, data: h, loading: g, onEventC
|
|
|
1227
1218
|
})
|
|
1228
1219
|
})
|
|
1229
1220
|
});
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1221
|
+
}, xe = [
|
|
1222
|
+
"onEventClick",
|
|
1223
|
+
"onDateClick",
|
|
1224
|
+
"onViewChange",
|
|
1225
|
+
"onNavigate",
|
|
1226
|
+
"onAddClick",
|
|
1227
|
+
"onEventDrop",
|
|
1228
|
+
"onTimeRangeSelect"
|
|
1229
|
+
];
|
|
1230
|
+
function X(e) {
|
|
1231
|
+
let t = {};
|
|
1232
|
+
for (let n of xe) {
|
|
1233
|
+
let r = e[n];
|
|
1234
|
+
typeof r == "function" && (t[n] = r);
|
|
1235
|
+
}
|
|
1236
|
+
return t;
|
|
1237
|
+
}
|
|
1238
|
+
var Se = [
|
|
1239
|
+
"month",
|
|
1240
|
+
"week",
|
|
1241
|
+
"day"
|
|
1242
|
+
];
|
|
1243
|
+
function Z(e) {
|
|
1244
|
+
return Se.includes(e) ? e : void 0;
|
|
1245
|
+
}
|
|
1246
|
+
function Ce(e) {
|
|
1247
|
+
if (typeof e == "string") {
|
|
1248
|
+
try {
|
|
1249
|
+
Intl.getCanonicalLocales(e);
|
|
1250
|
+
} catch {
|
|
1251
|
+
return;
|
|
1252
|
+
}
|
|
1253
|
+
return e;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
function Q(e) {
|
|
1257
|
+
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : void 0;
|
|
1258
|
+
}
|
|
1259
|
+
function $(e) {
|
|
1260
|
+
if (e instanceof Date) return e;
|
|
1261
|
+
if (typeof e != "string") return;
|
|
1262
|
+
let t = new Date(e);
|
|
1263
|
+
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
1264
|
+
}
|
|
1265
|
+
function we(e) {
|
|
1266
|
+
return e === !0;
|
|
1267
|
+
}
|
|
1268
|
+
s.register("calendar-view", ({ schema: e, className: n, onAction: r, events: i, currentDate: a, view: o, allowCreate: s, ...c }) => {
|
|
1269
|
+
let l = t.useMemo(() => !e.data || !Array.isArray(e.data) ? [] : e.data.map((t, n) => {
|
|
1235
1270
|
let r = e.titleField || "title", i = e.startDateField || "start", a = e.endDateField || "end", o = e.colorField || "color", s = e.allDayField || "allDay";
|
|
1236
1271
|
return {
|
|
1237
1272
|
id: t.id || t._id || n,
|
|
@@ -1249,17 +1284,27 @@ s.register("calendar-view", ({ schema: e, className: n, onAction: r, ...i }) =>
|
|
|
1249
1284
|
e.endDateField,
|
|
1250
1285
|
e.colorField,
|
|
1251
1286
|
e.allDayField
|
|
1252
|
-
])
|
|
1253
|
-
|
|
1287
|
+
]), u = t.useMemo(() => $(a), [a]), d = Z(o), f = we(s), p = X(c), m = Ce(c.locale), h = Q(c.slotMinutes), g = typeof r == "function" ? r : void 0, _ = (e) => {
|
|
1288
|
+
g?.({
|
|
1289
|
+
type: "event-click",
|
|
1290
|
+
payload: e
|
|
1291
|
+
});
|
|
1292
|
+
}, v = () => {
|
|
1293
|
+
g?.({
|
|
1294
|
+
type: "create",
|
|
1295
|
+
payload: {}
|
|
1296
|
+
});
|
|
1297
|
+
};
|
|
1298
|
+
return /* @__PURE__ */ L(he, {
|
|
1254
1299
|
className: n,
|
|
1255
|
-
events:
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1300
|
+
events: l,
|
|
1301
|
+
currentDate: u,
|
|
1302
|
+
view: d,
|
|
1303
|
+
locale: m,
|
|
1304
|
+
slotMinutes: h,
|
|
1305
|
+
...p,
|
|
1306
|
+
onEventClick: p.onEventClick ?? _,
|
|
1307
|
+
onAddClick: p.onAddClick ?? (f ? v : void 0)
|
|
1263
1308
|
});
|
|
1264
1309
|
}, {
|
|
1265
1310
|
namespace: "plugin-calendar",
|
|
@@ -1306,12 +1351,6 @@ s.register("calendar-view", ({ schema: e, className: n, onAction: r, ...i }) =>
|
|
|
1306
1351
|
defaultValue: "color",
|
|
1307
1352
|
description: "Field name for event color"
|
|
1308
1353
|
},
|
|
1309
|
-
{
|
|
1310
|
-
name: "colorMapping",
|
|
1311
|
-
type: "object",
|
|
1312
|
-
label: "Color Mapping",
|
|
1313
|
-
description: "Map field values to colors (e.g., {meeting: \"blue\", deadline: \"red\"})"
|
|
1314
|
-
},
|
|
1315
1354
|
{
|
|
1316
1355
|
name: "view",
|
|
1317
1356
|
type: "enum",
|
|
@@ -1381,15 +1420,66 @@ s.register("calendar-view", ({ schema: e, className: n, onAction: r, ...i }) =>
|
|
|
1381
1420
|
});
|
|
1382
1421
|
//#endregion
|
|
1383
1422
|
//#region src/index.tsx
|
|
1384
|
-
var
|
|
1385
|
-
|
|
1386
|
-
|
|
1423
|
+
var Te = {
|
|
1424
|
+
filter: !0,
|
|
1425
|
+
sort: !0
|
|
1426
|
+
}, Ee = [
|
|
1427
|
+
"onEventClick",
|
|
1428
|
+
"onRowClick",
|
|
1429
|
+
"onDateClick",
|
|
1430
|
+
"onEdit",
|
|
1431
|
+
"onDelete",
|
|
1432
|
+
"onNavigate",
|
|
1433
|
+
"onViewChange",
|
|
1434
|
+
"onEventDrop"
|
|
1435
|
+
];
|
|
1436
|
+
function De(e) {
|
|
1437
|
+
let t = {};
|
|
1438
|
+
for (let n of Ee) {
|
|
1439
|
+
let r = e[n];
|
|
1440
|
+
typeof r == "function" && (t[n] = r);
|
|
1441
|
+
}
|
|
1442
|
+
return t;
|
|
1443
|
+
}
|
|
1444
|
+
function Oe(e) {
|
|
1445
|
+
if (typeof e == "string") {
|
|
1446
|
+
try {
|
|
1447
|
+
Intl.getCanonicalLocales(e);
|
|
1448
|
+
} catch {
|
|
1449
|
+
return;
|
|
1450
|
+
}
|
|
1451
|
+
return e;
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
function ke(e) {
|
|
1455
|
+
return Array.isArray(e) ? e : void 0;
|
|
1456
|
+
}
|
|
1457
|
+
function Ae(e) {
|
|
1458
|
+
return typeof e == "boolean" ? e : void 0;
|
|
1459
|
+
}
|
|
1460
|
+
function je(e) {
|
|
1461
|
+
return e && typeof e.find == "function" ? e : void 0;
|
|
1462
|
+
}
|
|
1463
|
+
var Me = ({ schema: e, className: t, ...n }) => {
|
|
1464
|
+
let { dataSource: r } = _() || {}, i = De(n), a = Oe(n.locale), o = ke(n.data), s = Ae(n.loading), c = je(n.dataSource);
|
|
1465
|
+
return /* @__PURE__ */ L(f, {
|
|
1387
1466
|
schema: e,
|
|
1388
|
-
|
|
1389
|
-
|
|
1467
|
+
mapping: Te,
|
|
1468
|
+
dataSource: r,
|
|
1469
|
+
testId: "object-calendar",
|
|
1470
|
+
errorTitle: "This calendar’s data source could not be resolved",
|
|
1471
|
+
children: (e) => /* @__PURE__ */ L(be, {
|
|
1472
|
+
schema: e,
|
|
1473
|
+
dataSource: c ?? r,
|
|
1474
|
+
className: t,
|
|
1475
|
+
data: o,
|
|
1476
|
+
loading: s,
|
|
1477
|
+
locale: a,
|
|
1478
|
+
...i
|
|
1479
|
+
})
|
|
1390
1480
|
});
|
|
1391
1481
|
};
|
|
1392
|
-
s.register("object-calendar",
|
|
1482
|
+
s.register("object-calendar", Me, {
|
|
1393
1483
|
namespace: "plugin-calendar",
|
|
1394
1484
|
label: "Object Calendar",
|
|
1395
1485
|
category: "view",
|
|
@@ -1404,7 +1494,7 @@ s.register("object-calendar", Y, {
|
|
|
1404
1494
|
label: "Calendar Config",
|
|
1405
1495
|
description: "startDateField, endDateField, titleField, colorField"
|
|
1406
1496
|
}]
|
|
1407
|
-
}), s.register("calendar",
|
|
1497
|
+
}), s.register("calendar", Me, {
|
|
1408
1498
|
namespace: "view",
|
|
1409
1499
|
label: "Calendar View",
|
|
1410
1500
|
category: "view",
|
|
@@ -1421,4 +1511,4 @@ s.register("object-calendar", Y, {
|
|
|
1421
1511
|
}]
|
|
1422
1512
|
});
|
|
1423
1513
|
//#endregion
|
|
1424
|
-
export {
|
|
1514
|
+
export { he as CalendarView, be as ObjectCalendar, Me as ObjectCalendarRenderer };
|