@object-ui/plugin-calendar 3.0.3 → 3.1.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/.turbo/turbo-build.log +6 -6
- package/dist/index.js +959 -618
- package/dist/index.umd.cjs +2 -2
- package/dist/src/CalendarView.d.ts.map +1 -1
- package/dist/src/ObjectCalendar.d.ts +2 -0
- package/dist/src/ObjectCalendar.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/CalendarView.test.tsx +1 -1
- package/src/CalendarView.tsx +117 -25
- package/src/ObjectCalendar.tsx +20 -14
- package/src/__tests__/accessibility.test.tsx +2 -2
- package/src/__tests__/calendar-bugfixes.test.tsx +230 -0
- package/src/__tests__/calendar-optimizations.test.tsx +178 -0
- package/src/__tests__/view-states.test.tsx +3 -3
- package/src/calendar-view-renderer.tsx +4 -10
- package/src/index.tsx +3 -3
package/dist/index.js
CHANGED
|
@@ -1,392 +1,712 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import { ComponentRegistry as
|
|
4
|
-
import { useNavigationOverlay as
|
|
5
|
-
import { ChevronLeftIcon as
|
|
6
|
-
import { Button as
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
for (var
|
|
18
|
-
|
|
19
|
-
} else
|
|
20
|
-
return
|
|
21
|
-
$$typeof:
|
|
22
|
-
type:
|
|
23
|
-
key:
|
|
24
|
-
ref:
|
|
25
|
-
props:
|
|
1
|
+
import * as M from "react";
|
|
2
|
+
import oe, { createContext as ue, useContext as Se, useMemo as X, useRef as G, useCallback as z, useState as Y, useEffect as ae } from "react";
|
|
3
|
+
import { buildExpandFields as ke, extractRecords as Ae, ComponentRegistry as fe } from "@object-ui/core";
|
|
4
|
+
import { useNavigationOverlay as Le, useSchemaContext as Pe } from "@object-ui/react";
|
|
5
|
+
import { ChevronLeftIcon as Ie, ChevronRightIcon as Me, CalendarIcon as $e, PlusIcon as Ve } from "lucide-react";
|
|
6
|
+
import { Button as Q, Popover as Ye, PopoverTrigger as Ue, cn as H, PopoverContent as He, Calendar as We, Select as qe, SelectTrigger as Ge, SelectValue as ze, SelectContent as Be, SelectItem as le, NavigationOverlay as Je } from "@object-ui/components";
|
|
7
|
+
var re = { exports: {} }, Z = {};
|
|
8
|
+
var me;
|
|
9
|
+
function Xe() {
|
|
10
|
+
if (me) return Z;
|
|
11
|
+
me = 1;
|
|
12
|
+
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
13
|
+
function a(c, i, o) {
|
|
14
|
+
var u = null;
|
|
15
|
+
if (o !== void 0 && (u = "" + o), i.key !== void 0 && (u = "" + i.key), "key" in i) {
|
|
16
|
+
o = {};
|
|
17
|
+
for (var v in i)
|
|
18
|
+
v !== "key" && (o[v] = i[v]);
|
|
19
|
+
} else o = i;
|
|
20
|
+
return i = o.ref, {
|
|
21
|
+
$$typeof: e,
|
|
22
|
+
type: c,
|
|
23
|
+
key: u,
|
|
24
|
+
ref: i !== void 0 ? i : null,
|
|
25
|
+
props: o
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return Z.Fragment = r, Z.jsx = a, Z.jsxs = a, Z;
|
|
29
29
|
}
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
function
|
|
33
|
-
return
|
|
34
|
-
function t
|
|
35
|
-
if (
|
|
36
|
-
if (typeof
|
|
37
|
-
return
|
|
38
|
-
if (typeof
|
|
39
|
-
switch (
|
|
40
|
-
case
|
|
30
|
+
var ee = {};
|
|
31
|
+
var pe;
|
|
32
|
+
function Ke() {
|
|
33
|
+
return pe || (pe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
34
|
+
function e(t) {
|
|
35
|
+
if (t == null) return null;
|
|
36
|
+
if (typeof t == "function")
|
|
37
|
+
return t.$$typeof === j ? null : t.displayName || t.name || null;
|
|
38
|
+
if (typeof t == "string") return t;
|
|
39
|
+
switch (t) {
|
|
40
|
+
case F:
|
|
41
41
|
return "Fragment";
|
|
42
|
-
case
|
|
42
|
+
case P:
|
|
43
43
|
return "Profiler";
|
|
44
|
-
case
|
|
44
|
+
case O:
|
|
45
45
|
return "StrictMode";
|
|
46
|
-
case
|
|
46
|
+
case L:
|
|
47
47
|
return "Suspense";
|
|
48
|
-
case
|
|
48
|
+
case _:
|
|
49
49
|
return "SuspenseList";
|
|
50
|
-
case
|
|
50
|
+
case f:
|
|
51
51
|
return "Activity";
|
|
52
52
|
}
|
|
53
|
-
if (typeof
|
|
54
|
-
switch (typeof
|
|
53
|
+
if (typeof t == "object")
|
|
54
|
+
switch (typeof t.tag == "number" && console.error(
|
|
55
55
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
56
|
-
),
|
|
57
|
-
case
|
|
56
|
+
), t.$$typeof) {
|
|
57
|
+
case D:
|
|
58
58
|
return "Portal";
|
|
59
|
-
case
|
|
60
|
-
return
|
|
61
|
-
case
|
|
62
|
-
return (
|
|
63
|
-
case
|
|
64
|
-
var
|
|
65
|
-
return
|
|
66
|
-
case
|
|
67
|
-
return
|
|
68
|
-
case
|
|
69
|
-
|
|
59
|
+
case y:
|
|
60
|
+
return t.displayName || "Context";
|
|
61
|
+
case $:
|
|
62
|
+
return (t._context.displayName || "Context") + ".Consumer";
|
|
63
|
+
case N:
|
|
64
|
+
var x = t.render;
|
|
65
|
+
return t = t.displayName, t || (t = x.displayName || x.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
66
|
+
case A:
|
|
67
|
+
return x = t.displayName || null, x !== null ? x : e(t.type) || "Memo";
|
|
68
|
+
case b:
|
|
69
|
+
x = t._payload, t = t._init;
|
|
70
70
|
try {
|
|
71
|
-
return t(
|
|
71
|
+
return e(t(x));
|
|
72
72
|
} catch {
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return "" +
|
|
77
|
+
function r(t) {
|
|
78
|
+
return "" + t;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function a(t) {
|
|
81
81
|
try {
|
|
82
|
-
|
|
83
|
-
var
|
|
82
|
+
r(t);
|
|
83
|
+
var x = !1;
|
|
84
84
|
} catch {
|
|
85
|
-
|
|
85
|
+
x = !0;
|
|
86
86
|
}
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
var
|
|
90
|
-
return
|
|
91
|
-
|
|
87
|
+
if (x) {
|
|
88
|
+
x = console;
|
|
89
|
+
var S = x.error, R = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
90
|
+
return S.call(
|
|
91
|
+
x,
|
|
92
92
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
93
|
-
|
|
94
|
-
),
|
|
93
|
+
R
|
|
94
|
+
), r(t);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
if (
|
|
99
|
-
if (typeof
|
|
97
|
+
function c(t) {
|
|
98
|
+
if (t === F) return "<>";
|
|
99
|
+
if (typeof t == "object" && t !== null && t.$$typeof === b)
|
|
100
100
|
return "<...>";
|
|
101
101
|
try {
|
|
102
|
-
var
|
|
103
|
-
return
|
|
102
|
+
var x = e(t);
|
|
103
|
+
return x ? "<" + x + ">" : "<...>";
|
|
104
104
|
} catch {
|
|
105
105
|
return "<...>";
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
function m() {
|
|
109
|
-
var e = Y.A;
|
|
110
|
-
return e === null ? null : e.getOwner();
|
|
111
|
-
}
|
|
112
108
|
function i() {
|
|
109
|
+
var t = d.A;
|
|
110
|
+
return t === null ? null : t.getOwner();
|
|
111
|
+
}
|
|
112
|
+
function o() {
|
|
113
113
|
return Error("react-stack-top-frame");
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
if (
|
|
117
|
-
var
|
|
118
|
-
if (
|
|
115
|
+
function u(t) {
|
|
116
|
+
if (w.call(t, "key")) {
|
|
117
|
+
var x = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
118
|
+
if (x && x.isReactWarning) return !1;
|
|
119
119
|
}
|
|
120
|
-
return
|
|
120
|
+
return t.key !== void 0;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
function
|
|
124
|
-
|
|
122
|
+
function v(t, x) {
|
|
123
|
+
function S() {
|
|
124
|
+
K || (K = !0, console.error(
|
|
125
125
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
126
|
-
|
|
126
|
+
x
|
|
127
127
|
));
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
get:
|
|
129
|
+
S.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
130
|
+
get: S,
|
|
131
131
|
configurable: !0
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
var
|
|
136
|
-
return
|
|
134
|
+
function h() {
|
|
135
|
+
var t = e(this.type);
|
|
136
|
+
return te[t] || (te[t] = !0, console.error(
|
|
137
137
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
138
|
-
)),
|
|
138
|
+
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
var
|
|
142
|
-
return
|
|
143
|
-
$$typeof:
|
|
144
|
-
type:
|
|
145
|
-
key:
|
|
146
|
-
props:
|
|
147
|
-
_owner:
|
|
148
|
-
}, (
|
|
140
|
+
function m(t, x, S, R, W, q) {
|
|
141
|
+
var k = S.ref;
|
|
142
|
+
return t = {
|
|
143
|
+
$$typeof: p,
|
|
144
|
+
type: t,
|
|
145
|
+
key: x,
|
|
146
|
+
props: S,
|
|
147
|
+
_owner: R
|
|
148
|
+
}, (k !== void 0 ? k : null) !== null ? Object.defineProperty(t, "ref", {
|
|
149
149
|
enumerable: !1,
|
|
150
|
-
get:
|
|
151
|
-
}) : Object.defineProperty(
|
|
150
|
+
get: h
|
|
151
|
+
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
152
152
|
configurable: !1,
|
|
153
153
|
enumerable: !1,
|
|
154
154
|
writable: !0,
|
|
155
155
|
value: 0
|
|
156
|
-
}), Object.defineProperty(
|
|
156
|
+
}), Object.defineProperty(t, "_debugInfo", {
|
|
157
157
|
configurable: !1,
|
|
158
158
|
enumerable: !1,
|
|
159
159
|
writable: !0,
|
|
160
160
|
value: null
|
|
161
|
-
}), Object.defineProperty(
|
|
161
|
+
}), Object.defineProperty(t, "_debugStack", {
|
|
162
162
|
configurable: !1,
|
|
163
163
|
enumerable: !1,
|
|
164
164
|
writable: !0,
|
|
165
|
-
value:
|
|
166
|
-
}), Object.defineProperty(
|
|
165
|
+
value: W
|
|
166
|
+
}), Object.defineProperty(t, "_debugTask", {
|
|
167
167
|
configurable: !1,
|
|
168
168
|
enumerable: !1,
|
|
169
169
|
writable: !0,
|
|
170
|
-
value:
|
|
171
|
-
}), Object.freeze && (Object.freeze(
|
|
170
|
+
value: q
|
|
171
|
+
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
var
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
if (
|
|
178
|
-
for (
|
|
179
|
-
|
|
180
|
-
Object.freeze && Object.freeze(
|
|
173
|
+
function E(t, x, S, R, W, q) {
|
|
174
|
+
var k = x.children;
|
|
175
|
+
if (k !== void 0)
|
|
176
|
+
if (R)
|
|
177
|
+
if (C(k)) {
|
|
178
|
+
for (R = 0; R < k.length; R++)
|
|
179
|
+
n(k[R]);
|
|
180
|
+
Object.freeze && Object.freeze(k);
|
|
181
181
|
} else
|
|
182
182
|
console.error(
|
|
183
183
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
184
184
|
);
|
|
185
|
-
else
|
|
186
|
-
if (
|
|
187
|
-
|
|
188
|
-
var
|
|
189
|
-
return
|
|
185
|
+
else n(k);
|
|
186
|
+
if (w.call(x, "key")) {
|
|
187
|
+
k = e(t);
|
|
188
|
+
var U = Object.keys(x).filter(function(Fe) {
|
|
189
|
+
return Fe !== "key";
|
|
190
190
|
});
|
|
191
|
-
|
|
191
|
+
R = 0 < U.length ? "{key: someKey, " + U.join(": ..., ") + ": ...}" : "{key: someKey}", I[k + R] || (U = 0 < U.length ? "{" + U.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
192
192
|
`A props object containing a "key" prop is being spread into JSX:
|
|
193
193
|
let props = %s;
|
|
194
194
|
<%s {...props} />
|
|
195
195
|
React keys must be passed directly to JSX without using spread:
|
|
196
196
|
let props = %s;
|
|
197
197
|
<%s key={someKey} {...props} />`,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
),
|
|
198
|
+
R,
|
|
199
|
+
k,
|
|
200
|
+
U,
|
|
201
|
+
k
|
|
202
|
+
), I[k + R] = !0);
|
|
203
203
|
}
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
for (var
|
|
207
|
-
|
|
208
|
-
} else
|
|
209
|
-
return
|
|
210
|
-
|
|
211
|
-
typeof
|
|
212
|
-
),
|
|
213
|
-
|
|
204
|
+
if (k = null, S !== void 0 && (a(S), k = "" + S), u(x) && (a(x.key), k = "" + x.key), "key" in x) {
|
|
205
|
+
S = {};
|
|
206
|
+
for (var se in x)
|
|
207
|
+
se !== "key" && (S[se] = x[se]);
|
|
208
|
+
} else S = x;
|
|
209
|
+
return k && v(
|
|
210
|
+
S,
|
|
211
|
+
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
212
|
+
), m(
|
|
213
|
+
t,
|
|
214
|
+
k,
|
|
214
215
|
S,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
J
|
|
216
|
+
i(),
|
|
217
|
+
W,
|
|
218
|
+
q
|
|
219
219
|
);
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
|
|
221
|
+
function n(t) {
|
|
222
|
+
g(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === b && (t._payload.status === "fulfilled" ? g(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
return typeof
|
|
224
|
+
function g(t) {
|
|
225
|
+
return typeof t == "object" && t !== null && t.$$typeof === p;
|
|
226
226
|
}
|
|
227
|
-
var
|
|
227
|
+
var s = oe, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), D = /* @__PURE__ */ Symbol.for("react.portal"), F = /* @__PURE__ */ Symbol.for("react.fragment"), O = /* @__PURE__ */ Symbol.for("react.strict_mode"), P = /* @__PURE__ */ Symbol.for("react.profiler"), $ = /* @__PURE__ */ Symbol.for("react.consumer"), y = /* @__PURE__ */ Symbol.for("react.context"), N = /* @__PURE__ */ Symbol.for("react.forward_ref"), L = /* @__PURE__ */ Symbol.for("react.suspense"), _ = /* @__PURE__ */ Symbol.for("react.suspense_list"), A = /* @__PURE__ */ Symbol.for("react.memo"), b = /* @__PURE__ */ Symbol.for("react.lazy"), f = /* @__PURE__ */ Symbol.for("react.activity"), j = /* @__PURE__ */ Symbol.for("react.client.reference"), d = s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, w = Object.prototype.hasOwnProperty, C = Array.isArray, V = console.createTask ? console.createTask : function() {
|
|
228
228
|
return null;
|
|
229
229
|
};
|
|
230
|
-
|
|
231
|
-
react_stack_bottom_frame: function(
|
|
232
|
-
return
|
|
230
|
+
s = {
|
|
231
|
+
react_stack_bottom_frame: function(t) {
|
|
232
|
+
return t();
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
|
-
var
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
)(),
|
|
239
|
-
|
|
240
|
-
var
|
|
241
|
-
return
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
235
|
+
var K, te = {}, J = s.react_stack_bottom_frame.bind(
|
|
236
|
+
s,
|
|
237
|
+
o
|
|
238
|
+
)(), T = V(c(o)), I = {};
|
|
239
|
+
ee.Fragment = F, ee.jsx = function(t, x, S) {
|
|
240
|
+
var R = 1e4 > d.recentlyCreatedOwnerStacks++;
|
|
241
|
+
return E(
|
|
242
|
+
t,
|
|
243
|
+
x,
|
|
244
|
+
S,
|
|
245
245
|
!1,
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
R ? Error("react-stack-top-frame") : J,
|
|
247
|
+
R ? V(c(t)) : T
|
|
248
248
|
);
|
|
249
|
-
},
|
|
250
|
-
var
|
|
251
|
-
return
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
249
|
+
}, ee.jsxs = function(t, x, S) {
|
|
250
|
+
var R = 1e4 > d.recentlyCreatedOwnerStacks++;
|
|
251
|
+
return E(
|
|
252
|
+
t,
|
|
253
|
+
x,
|
|
254
|
+
S,
|
|
255
255
|
!0,
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
R ? Error("react-stack-top-frame") : J,
|
|
257
|
+
R ? V(c(t)) : T
|
|
258
258
|
);
|
|
259
259
|
};
|
|
260
|
-
})()),
|
|
260
|
+
})()), ee;
|
|
261
261
|
}
|
|
262
|
-
var
|
|
263
|
-
function
|
|
264
|
-
return
|
|
262
|
+
var he;
|
|
263
|
+
function Qe() {
|
|
264
|
+
return he || (he = 1, process.env.NODE_ENV === "production" ? re.exports = Xe() : re.exports = Ke()), re.exports;
|
|
265
265
|
}
|
|
266
|
-
var
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
266
|
+
var l = Qe();
|
|
267
|
+
const Ze = (e, r, a, c) => {
|
|
268
|
+
const i = [a, {
|
|
269
|
+
code: r,
|
|
270
|
+
...c || {}
|
|
271
|
+
}];
|
|
272
|
+
if (e?.services?.logger?.forward)
|
|
273
|
+
return e.services.logger.forward(i, "warn", "react-i18next::", !0);
|
|
274
|
+
B(i[0]) && (i[0] = `react-i18next:: ${i[0]}`), e?.services?.logger?.warn ? e.services.logger.warn(...i) : console?.warn && console.warn(...i);
|
|
275
|
+
}, xe = {}, Ee = (e, r, a, c) => {
|
|
276
|
+
B(a) && xe[a] || (B(a) && (xe[a] = /* @__PURE__ */ new Date()), Ze(e, r, a, c));
|
|
277
|
+
}, je = (e, r) => () => {
|
|
278
|
+
if (e.isInitialized)
|
|
279
|
+
r();
|
|
280
|
+
else {
|
|
281
|
+
const a = () => {
|
|
282
|
+
setTimeout(() => {
|
|
283
|
+
e.off("initialized", a);
|
|
284
|
+
}, 0), r();
|
|
285
|
+
};
|
|
286
|
+
e.on("initialized", a);
|
|
287
|
+
}
|
|
288
|
+
}, de = (e, r, a) => {
|
|
289
|
+
e.loadNamespaces(r, je(e, a));
|
|
290
|
+
}, ye = (e, r, a, c) => {
|
|
291
|
+
if (B(a) && (a = [a]), e.options.preload && e.options.preload.indexOf(r) > -1) return de(e, a, c);
|
|
292
|
+
a.forEach((i) => {
|
|
293
|
+
e.options.ns.indexOf(i) < 0 && e.options.ns.push(i);
|
|
294
|
+
}), e.loadLanguages(r, je(e, c));
|
|
295
|
+
}, et = (e, r, a = {}) => !r.languages || !r.languages.length ? (Ee(r, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
|
|
296
|
+
languages: r.languages
|
|
297
|
+
}), !0) : r.hasLoadedNamespace(e, {
|
|
298
|
+
lng: a.lng,
|
|
299
|
+
precheck: (c, i) => {
|
|
300
|
+
if (a.bindI18n && a.bindI18n.indexOf("languageChanging") > -1 && c.services.backendConnector.backend && c.isLanguageChangingTo && !i(c.isLanguageChangingTo, e)) return !1;
|
|
301
|
+
}
|
|
302
|
+
}), B = (e) => typeof e == "string", tt = (e) => typeof e == "object" && e !== null, rt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, nt = {
|
|
303
|
+
"&": "&",
|
|
304
|
+
"&": "&",
|
|
305
|
+
"<": "<",
|
|
306
|
+
"<": "<",
|
|
307
|
+
">": ">",
|
|
308
|
+
">": ">",
|
|
309
|
+
"'": "'",
|
|
310
|
+
"'": "'",
|
|
311
|
+
""": '"',
|
|
312
|
+
""": '"',
|
|
313
|
+
" ": " ",
|
|
314
|
+
" ": " ",
|
|
315
|
+
"©": "©",
|
|
316
|
+
"©": "©",
|
|
317
|
+
"®": "®",
|
|
318
|
+
"®": "®",
|
|
319
|
+
"…": "…",
|
|
320
|
+
"…": "…",
|
|
321
|
+
"/": "/",
|
|
322
|
+
"/": "/"
|
|
323
|
+
}, at = (e) => nt[e], ot = (e) => e.replace(rt, at);
|
|
324
|
+
let st = {
|
|
325
|
+
bindI18n: "languageChanged",
|
|
326
|
+
bindI18nStore: "",
|
|
327
|
+
transEmptyNodeValue: "",
|
|
328
|
+
transSupportBasicHtmlNodes: !0,
|
|
329
|
+
transWrapTextNodes: "",
|
|
330
|
+
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
331
|
+
useSuspense: !0,
|
|
332
|
+
unescape: ot,
|
|
333
|
+
transDefaultProps: void 0
|
|
334
|
+
};
|
|
335
|
+
const lt = () => st;
|
|
336
|
+
let it;
|
|
337
|
+
const ct = () => it, dt = ue();
|
|
338
|
+
class ut {
|
|
339
|
+
constructor() {
|
|
340
|
+
this.usedNamespaces = {};
|
|
341
|
+
}
|
|
342
|
+
addUsedNamespaces(r) {
|
|
343
|
+
r.forEach((a) => {
|
|
344
|
+
this.usedNamespaces[a] || (this.usedNamespaces[a] = !0);
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
getUsedNamespaces() {
|
|
348
|
+
return Object.keys(this.usedNamespaces);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
var ne = { exports: {} }, ie = {};
|
|
352
|
+
var ve;
|
|
353
|
+
function ft() {
|
|
354
|
+
if (ve) return ie;
|
|
355
|
+
ve = 1;
|
|
356
|
+
var e = oe;
|
|
357
|
+
function r(n, g) {
|
|
358
|
+
return n === g && (n !== 0 || 1 / n === 1 / g) || n !== n && g !== g;
|
|
359
|
+
}
|
|
360
|
+
var a = typeof Object.is == "function" ? Object.is : r, c = e.useState, i = e.useEffect, o = e.useLayoutEffect, u = e.useDebugValue;
|
|
361
|
+
function v(n, g) {
|
|
362
|
+
var s = g(), p = c({ inst: { value: s, getSnapshot: g } }), D = p[0].inst, F = p[1];
|
|
363
|
+
return o(
|
|
364
|
+
function() {
|
|
365
|
+
D.value = s, D.getSnapshot = g, h(D) && F({ inst: D });
|
|
366
|
+
},
|
|
367
|
+
[n, s, g]
|
|
368
|
+
), i(
|
|
369
|
+
function() {
|
|
370
|
+
return h(D) && F({ inst: D }), n(function() {
|
|
371
|
+
h(D) && F({ inst: D });
|
|
372
|
+
});
|
|
373
|
+
},
|
|
374
|
+
[n]
|
|
375
|
+
), u(s), s;
|
|
376
|
+
}
|
|
377
|
+
function h(n) {
|
|
378
|
+
var g = n.getSnapshot;
|
|
379
|
+
n = n.value;
|
|
380
|
+
try {
|
|
381
|
+
var s = g();
|
|
382
|
+
return !a(n, s);
|
|
383
|
+
} catch {
|
|
384
|
+
return !0;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function m(n, g) {
|
|
388
|
+
return g();
|
|
389
|
+
}
|
|
390
|
+
var E = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? m : v;
|
|
391
|
+
return ie.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : E, ie;
|
|
392
|
+
}
|
|
393
|
+
var ce = {};
|
|
394
|
+
var be;
|
|
395
|
+
function gt() {
|
|
396
|
+
return be || (be = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
397
|
+
function e(s, p) {
|
|
398
|
+
return s === p && (s !== 0 || 1 / s === 1 / p) || s !== s && p !== p;
|
|
399
|
+
}
|
|
400
|
+
function r(s, p) {
|
|
401
|
+
E || i.startTransition === void 0 || (E = !0, console.error(
|
|
402
|
+
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
403
|
+
));
|
|
404
|
+
var D = p();
|
|
405
|
+
if (!n) {
|
|
406
|
+
var F = p();
|
|
407
|
+
o(D, F) || (console.error(
|
|
408
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
409
|
+
), n = !0);
|
|
410
|
+
}
|
|
411
|
+
F = u({
|
|
412
|
+
inst: { value: D, getSnapshot: p }
|
|
413
|
+
});
|
|
414
|
+
var O = F[0].inst, P = F[1];
|
|
415
|
+
return h(
|
|
416
|
+
function() {
|
|
417
|
+
O.value = D, O.getSnapshot = p, a(O) && P({ inst: O });
|
|
418
|
+
},
|
|
419
|
+
[s, D, p]
|
|
420
|
+
), v(
|
|
421
|
+
function() {
|
|
422
|
+
return a(O) && P({ inst: O }), s(function() {
|
|
423
|
+
a(O) && P({ inst: O });
|
|
424
|
+
});
|
|
425
|
+
},
|
|
426
|
+
[s]
|
|
427
|
+
), m(D), D;
|
|
428
|
+
}
|
|
429
|
+
function a(s) {
|
|
430
|
+
var p = s.getSnapshot;
|
|
431
|
+
s = s.value;
|
|
432
|
+
try {
|
|
433
|
+
var D = p();
|
|
434
|
+
return !o(s, D);
|
|
435
|
+
} catch {
|
|
436
|
+
return !0;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
function c(s, p) {
|
|
440
|
+
return p();
|
|
441
|
+
}
|
|
442
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
443
|
+
var i = oe, o = typeof Object.is == "function" ? Object.is : e, u = i.useState, v = i.useEffect, h = i.useLayoutEffect, m = i.useDebugValue, E = !1, n = !1, g = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? c : r;
|
|
444
|
+
ce.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : g, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
445
|
+
})()), ce;
|
|
446
|
+
}
|
|
447
|
+
var De;
|
|
448
|
+
function mt() {
|
|
449
|
+
return De || (De = 1, process.env.NODE_ENV === "production" ? ne.exports = ft() : ne.exports = gt()), ne.exports;
|
|
450
|
+
}
|
|
451
|
+
var pt = mt();
|
|
452
|
+
const ht = (e, r) => B(r) ? r : tt(r) && B(r.defaultValue) ? r.defaultValue : Array.isArray(e) ? e[e.length - 1] : e, xt = {
|
|
453
|
+
t: ht,
|
|
454
|
+
ready: !1
|
|
455
|
+
}, yt = () => () => {
|
|
456
|
+
}, vt = (e, r = {}) => {
|
|
457
|
+
const {
|
|
458
|
+
i18n: a
|
|
459
|
+
} = r, {
|
|
460
|
+
i18n: c,
|
|
461
|
+
defaultNS: i
|
|
462
|
+
} = Se(dt) || {}, o = a || c || ct();
|
|
463
|
+
o && !o.reportNamespaces && (o.reportNamespaces = new ut()), o || Ee(o, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
|
|
464
|
+
const u = X(() => ({
|
|
465
|
+
...lt(),
|
|
466
|
+
...o?.options?.react,
|
|
467
|
+
...r
|
|
468
|
+
}), [o, r]), {
|
|
469
|
+
useSuspense: v,
|
|
470
|
+
keyPrefix: h
|
|
471
|
+
} = u, m = i || o?.options?.defaultNS, E = B(m) ? [m] : m || ["translation"], n = X(() => E, E);
|
|
472
|
+
o?.reportNamespaces?.addUsedNamespaces?.(n);
|
|
473
|
+
const g = G(0), s = z((b) => {
|
|
474
|
+
if (!o) return yt;
|
|
475
|
+
const {
|
|
476
|
+
bindI18n: f,
|
|
477
|
+
bindI18nStore: j
|
|
478
|
+
} = u, d = () => {
|
|
479
|
+
g.current += 1, b();
|
|
480
|
+
};
|
|
481
|
+
return f && o.on(f, d), j && o.store.on(j, d), () => {
|
|
482
|
+
f && f.split(" ").forEach((w) => o.off(w, d)), j && j.split(" ").forEach((w) => o.store.off(w, d));
|
|
483
|
+
};
|
|
484
|
+
}, [o, u]), p = G(), D = z(() => {
|
|
485
|
+
if (!o)
|
|
486
|
+
return xt;
|
|
487
|
+
const b = !!(o.isInitialized || o.initializedStoreOnce) && n.every((V) => et(V, o, u)), f = r.lng || o.language, j = g.current, d = p.current;
|
|
488
|
+
if (d && d.ready === b && d.lng === f && d.keyPrefix === h && d.revision === j)
|
|
489
|
+
return d;
|
|
490
|
+
const C = {
|
|
491
|
+
t: o.getFixedT(f, u.nsMode === "fallback" ? n : n[0], h),
|
|
492
|
+
ready: b,
|
|
493
|
+
lng: f,
|
|
494
|
+
keyPrefix: h,
|
|
495
|
+
revision: j
|
|
496
|
+
};
|
|
497
|
+
return p.current = C, C;
|
|
498
|
+
}, [o, n, h, u, r.lng]), [F, O] = Y(0), {
|
|
499
|
+
t: P,
|
|
500
|
+
ready: $
|
|
501
|
+
} = pt.useSyncExternalStore(s, D, D);
|
|
502
|
+
ae(() => {
|
|
503
|
+
if (o && !$ && !v) {
|
|
504
|
+
const b = () => O((f) => f + 1);
|
|
505
|
+
r.lng ? ye(o, r.lng, n, b) : de(o, n, b);
|
|
506
|
+
}
|
|
507
|
+
}, [o, r.lng, n, $, v, F]);
|
|
508
|
+
const y = o || {}, N = G(null), L = G(), _ = (b) => {
|
|
509
|
+
const f = Object.getOwnPropertyDescriptors(b);
|
|
510
|
+
f.__original && delete f.__original;
|
|
511
|
+
const j = Object.create(Object.getPrototypeOf(b), f);
|
|
512
|
+
if (!Object.prototype.hasOwnProperty.call(j, "__original"))
|
|
513
|
+
try {
|
|
514
|
+
Object.defineProperty(j, "__original", {
|
|
515
|
+
value: b,
|
|
516
|
+
writable: !1,
|
|
517
|
+
enumerable: !1,
|
|
518
|
+
configurable: !1
|
|
519
|
+
});
|
|
520
|
+
} catch {
|
|
521
|
+
}
|
|
522
|
+
return j;
|
|
523
|
+
}, A = X(() => {
|
|
524
|
+
const b = y, f = b?.language;
|
|
525
|
+
let j = b;
|
|
526
|
+
b && (N.current && N.current.__original === b ? L.current !== f ? (j = _(b), N.current = j, L.current = f) : j = N.current : (j = _(b), N.current = j, L.current = f));
|
|
527
|
+
const d = [P, j, $];
|
|
528
|
+
return d.t = P, d.i18n = j, d.ready = $, d;
|
|
529
|
+
}, [P, y, $, y.resolvedLanguage, y.language, y.languages]);
|
|
530
|
+
if (o && v && !$)
|
|
531
|
+
throw new Promise((b) => {
|
|
532
|
+
const f = () => b();
|
|
533
|
+
r.lng ? ye(o, r.lng, n, f) : de(o, n, f);
|
|
534
|
+
});
|
|
535
|
+
return A;
|
|
536
|
+
}, bt = ue(null);
|
|
537
|
+
function Dt(e) {
|
|
538
|
+
const r = Se(bt), { t: a, i18n: c } = vt();
|
|
539
|
+
return {
|
|
540
|
+
/** Translation function */
|
|
541
|
+
t: a,
|
|
542
|
+
/** Current language code */
|
|
543
|
+
language: r?.language || c.language || "en",
|
|
544
|
+
/** Change the active language */
|
|
545
|
+
changeLanguage: r?.changeLanguage || (async (i) => {
|
|
546
|
+
await c.changeLanguage(i);
|
|
547
|
+
}),
|
|
548
|
+
/** Current text direction */
|
|
549
|
+
direction: r?.direction || "ltr",
|
|
550
|
+
/** The underlying i18next instance */
|
|
551
|
+
i18n: c
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
const ge = "bg-blue-500 text-white", wt = /* @__PURE__ */ new Date(), we = {
|
|
555
|
+
"calendar.today": "Today",
|
|
556
|
+
"calendar.month": "Month",
|
|
557
|
+
"calendar.week": "Week",
|
|
558
|
+
"calendar.day": "Day",
|
|
559
|
+
"calendar.newEvent": "New event",
|
|
560
|
+
"calendar.moreEvents": "+{{count}} more"
|
|
561
|
+
};
|
|
562
|
+
function _e() {
|
|
563
|
+
try {
|
|
564
|
+
const e = Dt();
|
|
565
|
+
return e.t("calendar.today") === "calendar.today" ? {
|
|
566
|
+
t: (a, c) => {
|
|
567
|
+
let i = we[a] || a;
|
|
568
|
+
if (c)
|
|
569
|
+
for (const [o, u] of Object.entries(c))
|
|
570
|
+
i = i.replace(`{{${o}}}`, String(u));
|
|
571
|
+
return i;
|
|
572
|
+
},
|
|
573
|
+
language: "en"
|
|
574
|
+
} : { t: e.t, language: e.language };
|
|
575
|
+
} catch {
|
|
576
|
+
return {
|
|
577
|
+
t: (e, r) => {
|
|
578
|
+
let a = we[e] || e;
|
|
579
|
+
if (r)
|
|
580
|
+
for (const [c, i] of Object.entries(r))
|
|
581
|
+
a = a.replace(`{{${c}}}`, String(i));
|
|
582
|
+
return a;
|
|
583
|
+
},
|
|
584
|
+
language: "en"
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
function Te({
|
|
589
|
+
events: e = [],
|
|
590
|
+
view: r = "month",
|
|
591
|
+
currentDate: a = wt,
|
|
592
|
+
locale: c = "default",
|
|
593
|
+
onEventClick: i,
|
|
594
|
+
onDateClick: o,
|
|
595
|
+
onViewChange: u,
|
|
596
|
+
onNavigate: v,
|
|
597
|
+
onAddClick: h,
|
|
598
|
+
onEventDrop: m,
|
|
599
|
+
className: E
|
|
280
600
|
}) {
|
|
281
|
-
const [
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}, [
|
|
285
|
-
|
|
286
|
-
}, [
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
const
|
|
290
|
-
|
|
601
|
+
const [n, g] = M.useState(r), [s, p] = M.useState(a), { t: D, language: F } = _e(), O = c !== "default" ? c : F;
|
|
602
|
+
M.useEffect(() => {
|
|
603
|
+
p(a);
|
|
604
|
+
}, [a]), M.useEffect(() => {
|
|
605
|
+
g(r);
|
|
606
|
+
}, [r]);
|
|
607
|
+
const P = M.useRef(u);
|
|
608
|
+
P.current = u, M.useEffect(() => {
|
|
609
|
+
const d = window.matchMedia("(max-width: 639px)"), w = (C) => {
|
|
610
|
+
C.matches && (g("day"), P.current?.("day"));
|
|
291
611
|
};
|
|
292
|
-
return
|
|
612
|
+
return w(d), d.addEventListener("change", w), () => d.removeEventListener("change", w);
|
|
293
613
|
}, []);
|
|
294
|
-
const
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
},
|
|
298
|
-
const
|
|
299
|
-
|
|
614
|
+
const $ = () => {
|
|
615
|
+
const d = new Date(s);
|
|
616
|
+
n === "month" ? d.setMonth(d.getMonth() - 1) : n === "week" ? d.setDate(d.getDate() - 7) : d.setDate(d.getDate() - 1), p(d), v?.(d);
|
|
617
|
+
}, y = () => {
|
|
618
|
+
const d = new Date(s);
|
|
619
|
+
n === "month" ? d.setMonth(d.getMonth() + 1) : n === "week" ? d.setDate(d.getDate() + 7) : d.setDate(d.getDate() + 1), p(d), v?.(d);
|
|
300
620
|
}, N = () => {
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
},
|
|
304
|
-
|
|
305
|
-
},
|
|
306
|
-
if (
|
|
307
|
-
return
|
|
621
|
+
const d = /* @__PURE__ */ new Date();
|
|
622
|
+
p(d), v?.(d);
|
|
623
|
+
}, L = (d) => {
|
|
624
|
+
g(d), u?.(d);
|
|
625
|
+
}, _ = () => {
|
|
626
|
+
if (n === "month")
|
|
627
|
+
return s.toLocaleDateString(O, {
|
|
308
628
|
month: "long",
|
|
309
629
|
year: "numeric"
|
|
310
630
|
});
|
|
311
|
-
if (
|
|
312
|
-
const
|
|
313
|
-
return
|
|
631
|
+
if (n === "week") {
|
|
632
|
+
const d = Ne(s), w = new Date(d);
|
|
633
|
+
return w.setDate(w.getDate() + 6), `${d.toLocaleDateString(O, {
|
|
314
634
|
month: "short",
|
|
315
635
|
day: "numeric"
|
|
316
|
-
})} - ${
|
|
636
|
+
})} - ${w.toLocaleDateString(O, {
|
|
317
637
|
month: "short",
|
|
318
638
|
day: "numeric",
|
|
319
639
|
year: "numeric"
|
|
320
640
|
})}`;
|
|
321
641
|
} else
|
|
322
|
-
return
|
|
642
|
+
return s.toLocaleDateString(O, {
|
|
323
643
|
weekday: "long",
|
|
324
644
|
month: "long",
|
|
325
645
|
day: "numeric",
|
|
326
646
|
year: "numeric"
|
|
327
647
|
});
|
|
328
|
-
},
|
|
329
|
-
|
|
330
|
-
},
|
|
331
|
-
const
|
|
332
|
-
if (Math.abs(
|
|
333
|
-
const
|
|
334
|
-
|
|
648
|
+
}, A = M.useRef(0), b = (d) => {
|
|
649
|
+
A.current = d.touches[0].clientX;
|
|
650
|
+
}, f = (d) => {
|
|
651
|
+
const w = A.current - d.changedTouches[0].clientX;
|
|
652
|
+
if (Math.abs(w) > 50) {
|
|
653
|
+
const C = new Date(s);
|
|
654
|
+
n === "day" ? C.setDate(C.getDate() + (w > 0 ? 1 : -1)) : n === "week" ? C.setDate(C.getDate() + (w > 0 ? 7 : -7)) : C.setMonth(C.getMonth() + (w > 0 ? 1 : -1)), p(C), v?.(C);
|
|
335
655
|
}
|
|
336
|
-
},
|
|
337
|
-
|
|
656
|
+
}, j = (d) => {
|
|
657
|
+
d && (p(d), v?.(d));
|
|
338
658
|
};
|
|
339
|
-
return /* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
/* @__PURE__ */
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
|
|
659
|
+
return /* @__PURE__ */ l.jsxs("div", { role: "region", "aria-label": "Calendar", className: H("flex flex-col h-full bg-background min-w-0 overflow-hidden", E), children: [
|
|
660
|
+
/* @__PURE__ */ l.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 p-2 sm:p-4 border-b min-w-0", children: [
|
|
661
|
+
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
662
|
+
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center bg-muted/50 rounded-lg p-1 gap-1", children: [
|
|
663
|
+
/* @__PURE__ */ l.jsx(Q, { variant: "ghost", size: "sm", onClick: N, className: "h-8", "aria-label": "Go to today", children: D("calendar.today") }),
|
|
664
|
+
/* @__PURE__ */ l.jsx("div", { className: "h-4 w-px bg-border mx-1" }),
|
|
665
|
+
/* @__PURE__ */ l.jsx(
|
|
666
|
+
Q,
|
|
347
667
|
{
|
|
348
668
|
variant: "ghost",
|
|
349
669
|
size: "icon",
|
|
350
670
|
"aria-label": "Previous period",
|
|
351
|
-
onClick:
|
|
671
|
+
onClick: $,
|
|
352
672
|
className: "h-8 w-8",
|
|
353
|
-
children: /* @__PURE__ */
|
|
673
|
+
children: /* @__PURE__ */ l.jsx(Ie, { className: "h-4 w-4" })
|
|
354
674
|
}
|
|
355
675
|
),
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
|
|
676
|
+
/* @__PURE__ */ l.jsx(
|
|
677
|
+
Q,
|
|
358
678
|
{
|
|
359
679
|
variant: "ghost",
|
|
360
680
|
size: "icon",
|
|
361
681
|
"aria-label": "Next period",
|
|
362
|
-
onClick:
|
|
682
|
+
onClick: y,
|
|
363
683
|
className: "h-8 w-8",
|
|
364
|
-
children: /* @__PURE__ */
|
|
684
|
+
children: /* @__PURE__ */ l.jsx(Me, { className: "h-4 w-4" })
|
|
365
685
|
}
|
|
366
686
|
)
|
|
367
687
|
] }),
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
|
|
688
|
+
/* @__PURE__ */ l.jsxs(Ye, { children: [
|
|
689
|
+
/* @__PURE__ */ l.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ l.jsxs(
|
|
690
|
+
Q,
|
|
371
691
|
{
|
|
372
692
|
variant: "ghost",
|
|
373
|
-
"aria-label": `Current date: ${
|
|
374
|
-
className:
|
|
375
|
-
"text-xl font-semibold h-auto px-3 py-1 hover:bg-muted/50 transition-colors",
|
|
693
|
+
"aria-label": `Current date: ${_()}`,
|
|
694
|
+
className: H(
|
|
695
|
+
"text-base sm:text-xl font-semibold h-auto px-2 sm:px-3 py-1 hover:bg-muted/50 transition-colors",
|
|
376
696
|
"flex items-center gap-2"
|
|
377
697
|
),
|
|
378
698
|
children: [
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ l.jsx($e, { className: "h-5 w-5 text-muted-foreground" }),
|
|
700
|
+
/* @__PURE__ */ l.jsx("span", { children: _() })
|
|
381
701
|
]
|
|
382
702
|
}
|
|
383
703
|
) }),
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
|
|
704
|
+
/* @__PURE__ */ l.jsx(He, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ l.jsx(
|
|
705
|
+
We,
|
|
386
706
|
{
|
|
387
707
|
mode: "single",
|
|
388
|
-
selected:
|
|
389
|
-
onSelect:
|
|
708
|
+
selected: s,
|
|
709
|
+
onSelect: j,
|
|
390
710
|
initialFocus: !0,
|
|
391
711
|
fromYear: 2e3,
|
|
392
712
|
toYear: 2050
|
|
@@ -394,176 +714,192 @@ function fe({
|
|
|
394
714
|
) })
|
|
395
715
|
] })
|
|
396
716
|
] }),
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
/* @__PURE__ */
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
718
|
+
/* @__PURE__ */ l.jsxs(qe, { value: n, onValueChange: L, children: [
|
|
719
|
+
/* @__PURE__ */ l.jsx(Ge, { className: "w-32 bg-background", children: /* @__PURE__ */ l.jsx(ze, {}) }),
|
|
720
|
+
/* @__PURE__ */ l.jsxs(Be, { children: [
|
|
721
|
+
/* @__PURE__ */ l.jsx(le, { value: "day", children: D("calendar.day") }),
|
|
722
|
+
/* @__PURE__ */ l.jsx(le, { value: "week", children: D("calendar.week") }),
|
|
723
|
+
/* @__PURE__ */ l.jsx(le, { value: "month", children: D("calendar.month") })
|
|
404
724
|
] })
|
|
405
725
|
] }),
|
|
406
|
-
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
-
"
|
|
726
|
+
h && /* @__PURE__ */ l.jsxs(Q, { onClick: h, size: "sm", className: "gap-1", children: [
|
|
727
|
+
/* @__PURE__ */ l.jsx(Ve, { className: "h-4 w-4" }),
|
|
728
|
+
D("calendar.newEvent")
|
|
409
729
|
] })
|
|
410
730
|
] })
|
|
411
731
|
] }),
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
|
|
414
|
-
|
|
732
|
+
/* @__PURE__ */ l.jsxs("div", { className: "flex-1 overflow-auto", onTouchStart: b, onTouchEnd: f, children: [
|
|
733
|
+
n === "month" && /* @__PURE__ */ l.jsx(
|
|
734
|
+
Et,
|
|
415
735
|
{
|
|
416
|
-
date:
|
|
417
|
-
events:
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
736
|
+
date: s,
|
|
737
|
+
events: e,
|
|
738
|
+
locale: O,
|
|
739
|
+
onEventClick: i,
|
|
740
|
+
onDateClick: o,
|
|
741
|
+
onEventDrop: m
|
|
421
742
|
}
|
|
422
743
|
),
|
|
423
|
-
|
|
424
|
-
|
|
744
|
+
n === "week" && /* @__PURE__ */ l.jsx(
|
|
745
|
+
jt,
|
|
425
746
|
{
|
|
426
|
-
date:
|
|
427
|
-
events:
|
|
428
|
-
locale:
|
|
429
|
-
onEventClick:
|
|
430
|
-
onDateClick:
|
|
747
|
+
date: s,
|
|
748
|
+
events: e,
|
|
749
|
+
locale: O,
|
|
750
|
+
onEventClick: i,
|
|
751
|
+
onDateClick: o
|
|
431
752
|
}
|
|
432
753
|
),
|
|
433
|
-
|
|
434
|
-
|
|
754
|
+
n === "day" && /* @__PURE__ */ l.jsx(
|
|
755
|
+
_t,
|
|
435
756
|
{
|
|
436
|
-
date:
|
|
437
|
-
events:
|
|
438
|
-
onEventClick:
|
|
439
|
-
onDateClick:
|
|
757
|
+
date: s,
|
|
758
|
+
events: e,
|
|
759
|
+
onEventClick: i,
|
|
760
|
+
onDateClick: o
|
|
440
761
|
}
|
|
441
762
|
)
|
|
442
763
|
] })
|
|
443
764
|
] });
|
|
444
765
|
}
|
|
445
|
-
function
|
|
446
|
-
const
|
|
447
|
-
return
|
|
766
|
+
function Ne(e) {
|
|
767
|
+
const r = new Date(e), a = r.getDay(), c = r.getDate() - a;
|
|
768
|
+
return r.setDate(c), r;
|
|
448
769
|
}
|
|
449
|
-
function
|
|
450
|
-
const
|
|
451
|
-
for (let
|
|
452
|
-
const
|
|
453
|
-
|
|
770
|
+
function St(e) {
|
|
771
|
+
const r = e.getFullYear(), a = e.getMonth(), c = new Date(r, a, 1), i = new Date(r, a + 1, 0), o = c.getDay(), u = [];
|
|
772
|
+
for (let h = o - 1; h >= 0; h--) {
|
|
773
|
+
const m = new Date(c.getTime());
|
|
774
|
+
m.setDate(m.getDate() - (h + 1)), u.push(m);
|
|
454
775
|
}
|
|
455
|
-
for (let
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
for (let
|
|
459
|
-
const
|
|
460
|
-
|
|
776
|
+
for (let h = 1; h <= i.getDate(); h++)
|
|
777
|
+
u.push(new Date(r, a, h));
|
|
778
|
+
const v = 42 - u.length;
|
|
779
|
+
for (let h = 1; h <= v; h++) {
|
|
780
|
+
const m = new Date(i.getTime());
|
|
781
|
+
m.setDate(m.getDate() + h), u.push(m);
|
|
461
782
|
}
|
|
462
|
-
return
|
|
783
|
+
return u;
|
|
463
784
|
}
|
|
464
|
-
function
|
|
465
|
-
return
|
|
785
|
+
function Oe(e, r) {
|
|
786
|
+
return e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth() && e.getDate() === r.getDate();
|
|
466
787
|
}
|
|
467
|
-
function
|
|
468
|
-
return
|
|
469
|
-
const
|
|
470
|
-
|
|
471
|
-
const
|
|
472
|
-
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
return
|
|
788
|
+
function Re(e, r) {
|
|
789
|
+
return r.filter((a) => {
|
|
790
|
+
const c = new Date(a.start), i = a.end ? new Date(a.end) : new Date(c), o = new Date(e);
|
|
791
|
+
o.setHours(0, 0, 0, 0);
|
|
792
|
+
const u = new Date(e);
|
|
793
|
+
u.setHours(23, 59, 59, 999);
|
|
794
|
+
const v = new Date(c);
|
|
795
|
+
v.setHours(0, 0, 0, 0);
|
|
796
|
+
const h = new Date(i);
|
|
797
|
+
return h.setHours(23, 59, 59, 999), o <= h && u >= v;
|
|
477
798
|
});
|
|
478
799
|
}
|
|
479
|
-
function
|
|
480
|
-
const
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}, M = (
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
800
|
+
function Et({ date: e, events: r, locale: a = "default", onEventClick: c, onDateClick: i, onEventDrop: o }) {
|
|
801
|
+
const u = M.useMemo(() => St(e), [e.getFullYear(), e.getMonth()]), v = M.useMemo(() => /* @__PURE__ */ new Date(), []), { t: h } = _e(), m = M.useMemo(() => {
|
|
802
|
+
const y = new Date(2024, 0, 7);
|
|
803
|
+
return Array.from({ length: 7 }, (N, L) => {
|
|
804
|
+
const _ = new Date(y);
|
|
805
|
+
return _.setDate(_.getDate() + L), _.toLocaleDateString(a, { weekday: "short" });
|
|
806
|
+
});
|
|
807
|
+
}, [a]), [E, n] = M.useState(null), [g, s] = M.useState(null), p = M.useMemo(() => {
|
|
808
|
+
const y = /* @__PURE__ */ new Map();
|
|
809
|
+
for (const N of r) {
|
|
810
|
+
const L = new Date(N.start), _ = N.end ? new Date(N.end) : new Date(L);
|
|
811
|
+
L.setHours(0, 0, 0, 0), _.setHours(0, 0, 0, 0);
|
|
812
|
+
const A = new Date(L);
|
|
813
|
+
for (; A <= _; ) {
|
|
814
|
+
const b = `${A.getFullYear()}-${A.getMonth()}-${A.getDate()}`, f = y.get(b);
|
|
815
|
+
f ? f.push(N) : y.set(b, [N]), A.setDate(A.getDate() + 1);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
return y;
|
|
819
|
+
}, [r]), D = (y, N) => {
|
|
820
|
+
n(N.id), y.dataTransfer.effectAllowed = "move", y.dataTransfer.setData("text/plain", String(N.id));
|
|
821
|
+
}, F = () => {
|
|
822
|
+
n(null), s(null);
|
|
823
|
+
}, O = (y, N) => {
|
|
824
|
+
y.preventDefault(), y.dataTransfer.dropEffect = "move", s(N);
|
|
825
|
+
}, P = (y) => {
|
|
826
|
+
y.currentTarget.contains(y.relatedTarget) || s(null);
|
|
827
|
+
}, $ = (y, N) => {
|
|
828
|
+
if (y.preventDefault(), s(null), n(null), !o) return;
|
|
829
|
+
const L = y.dataTransfer.getData("text/plain"), _ = r.find((C) => String(C.id) === L);
|
|
830
|
+
if (!_) return;
|
|
831
|
+
const A = new Date(_.start), b = new Date(A);
|
|
832
|
+
b.setHours(0, 0, 0, 0);
|
|
833
|
+
const f = new Date(N);
|
|
834
|
+
f.setHours(0, 0, 0, 0);
|
|
835
|
+
const j = f.getTime() - b.getTime();
|
|
836
|
+
if (j === 0) return;
|
|
837
|
+
const d = new Date(A.getTime() + j);
|
|
838
|
+
let w;
|
|
839
|
+
_.end && (w = new Date(new Date(_.end).getTime() + j)), o(_, d, w);
|
|
501
840
|
};
|
|
502
|
-
return /* @__PURE__ */
|
|
503
|
-
/* @__PURE__ */
|
|
841
|
+
return /* @__PURE__ */ l.jsxs("div", { className: "flex flex-col h-full", children: [
|
|
842
|
+
/* @__PURE__ */ l.jsx("div", { role: "row", className: "grid grid-cols-7 border-b", children: m.map((y) => /* @__PURE__ */ l.jsx(
|
|
504
843
|
"div",
|
|
505
844
|
{
|
|
506
845
|
role: "columnheader",
|
|
507
846
|
className: "p-2 text-center text-sm font-medium text-muted-foreground border-r last:border-r-0",
|
|
508
|
-
children:
|
|
847
|
+
children: y
|
|
509
848
|
},
|
|
510
|
-
|
|
849
|
+
y
|
|
511
850
|
)) }),
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
const
|
|
514
|
-
return /* @__PURE__ */
|
|
851
|
+
/* @__PURE__ */ l.jsx("div", { role: "grid", "aria-label": "Calendar grid", className: "grid grid-cols-7 flex-1 auto-rows-fr", children: u.map((y, N) => {
|
|
852
|
+
const L = `${y.getFullYear()}-${y.getMonth()}-${y.getDate()}`, _ = p.get(L) || [], A = y.getMonth() === e.getMonth(), b = Oe(y, v);
|
|
853
|
+
return /* @__PURE__ */ l.jsxs(
|
|
515
854
|
"div",
|
|
516
855
|
{
|
|
517
856
|
role: "gridcell",
|
|
518
|
-
"aria-label": `${
|
|
519
|
-
className:
|
|
857
|
+
"aria-label": `${y.toLocaleDateString("default", { weekday: "long", month: "long", day: "numeric", year: "numeric" })}${_.length > 0 ? `, ${_.length} event${_.length > 1 ? "s" : ""}` : ""}`,
|
|
858
|
+
className: H(
|
|
520
859
|
"border-b border-r last:border-r-0 p-2 min-h-[100px] cursor-pointer hover:bg-accent/50",
|
|
521
|
-
!
|
|
522
|
-
|
|
860
|
+
!A && "bg-muted/50 text-muted-foreground opacity-50",
|
|
861
|
+
g === N && "ring-2 ring-primary"
|
|
523
862
|
),
|
|
524
|
-
onClick: () =>
|
|
525
|
-
onDragOver: (
|
|
526
|
-
onDragLeave:
|
|
527
|
-
onDrop: (
|
|
863
|
+
onClick: () => i?.(y),
|
|
864
|
+
onDragOver: (f) => O(f, N),
|
|
865
|
+
onDragLeave: P,
|
|
866
|
+
onDrop: (f) => $(f, y),
|
|
528
867
|
children: [
|
|
529
|
-
/* @__PURE__ */
|
|
868
|
+
/* @__PURE__ */ l.jsx(
|
|
530
869
|
"div",
|
|
531
870
|
{
|
|
532
|
-
className:
|
|
533
|
-
"text-sm font-medium mb-
|
|
534
|
-
|
|
871
|
+
className: H(
|
|
872
|
+
"text-sm font-medium mb-2",
|
|
873
|
+
b && "inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground h-6 w-6"
|
|
535
874
|
),
|
|
536
|
-
...
|
|
537
|
-
children:
|
|
875
|
+
...b ? { "aria-current": "date" } : {},
|
|
876
|
+
children: y.getDate()
|
|
538
877
|
}
|
|
539
878
|
),
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
|
|
879
|
+
/* @__PURE__ */ l.jsxs("div", { className: "space-y-1", children: [
|
|
880
|
+
_.slice(0, 3).map((f) => /* @__PURE__ */ l.jsx(
|
|
542
881
|
"div",
|
|
543
882
|
{
|
|
544
883
|
role: "button",
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
884
|
+
title: f.title,
|
|
885
|
+
"aria-label": f.title,
|
|
886
|
+
draggable: !!o,
|
|
887
|
+
onDragStart: (j) => D(j, f),
|
|
888
|
+
onDragEnd: F,
|
|
889
|
+
className: H(
|
|
550
890
|
"text-xs px-2 py-1 rounded truncate cursor-pointer hover:opacity-80",
|
|
551
|
-
|
|
552
|
-
|
|
891
|
+
f.color?.startsWith("#") ? "text-white" : f.color || ge,
|
|
892
|
+
E === f.id && "opacity-50"
|
|
553
893
|
),
|
|
554
|
-
style:
|
|
555
|
-
onClick: (
|
|
556
|
-
|
|
894
|
+
style: f.color && f.color.startsWith("#") ? { backgroundColor: f.color } : void 0,
|
|
895
|
+
onClick: (j) => {
|
|
896
|
+
j.stopPropagation(), c?.(f);
|
|
557
897
|
},
|
|
558
|
-
children:
|
|
898
|
+
children: f.title
|
|
559
899
|
},
|
|
560
|
-
|
|
900
|
+
f.id
|
|
561
901
|
)),
|
|
562
|
-
|
|
563
|
-
"+",
|
|
564
|
-
k.length - 3,
|
|
565
|
-
" more"
|
|
566
|
-
] })
|
|
902
|
+
_.length > 3 && /* @__PURE__ */ l.jsx("div", { className: "text-xs text-muted-foreground px-2", children: h("calendar.moreEvents", { count: _.length - 3 }) })
|
|
567
903
|
] })
|
|
568
904
|
]
|
|
569
905
|
},
|
|
@@ -572,361 +908,366 @@ function Le({ date: t, events: n, onEventClick: s, onDateClick: d, onEventDrop:
|
|
|
572
908
|
}) })
|
|
573
909
|
] });
|
|
574
910
|
}
|
|
575
|
-
function
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
|
|
911
|
+
function jt({ date: e, events: r, locale: a = "default", onEventClick: c, onDateClick: i }) {
|
|
912
|
+
const o = M.useRef(null), u = (n) => {
|
|
913
|
+
i && (o.current = setTimeout(() => {
|
|
914
|
+
i(n);
|
|
579
915
|
}, 500));
|
|
580
|
-
},
|
|
581
|
-
|
|
582
|
-
},
|
|
583
|
-
const
|
|
584
|
-
return
|
|
585
|
-
}),
|
|
586
|
-
return /* @__PURE__ */
|
|
587
|
-
/* @__PURE__ */
|
|
588
|
-
const
|
|
589
|
-
return /* @__PURE__ */
|
|
916
|
+
}, v = () => {
|
|
917
|
+
o.current && (clearTimeout(o.current), o.current = null);
|
|
918
|
+
}, h = Ne(e), m = Array.from({ length: 7 }, (n, g) => {
|
|
919
|
+
const s = new Date(h);
|
|
920
|
+
return s.setDate(s.getDate() + g), s;
|
|
921
|
+
}), E = /* @__PURE__ */ new Date();
|
|
922
|
+
return /* @__PURE__ */ l.jsxs("div", { className: "flex flex-col h-full", children: [
|
|
923
|
+
/* @__PURE__ */ l.jsx("div", { className: "grid grid-cols-7 border-b", children: m.map((n) => {
|
|
924
|
+
const g = Oe(n, E);
|
|
925
|
+
return /* @__PURE__ */ l.jsxs(
|
|
590
926
|
"div",
|
|
591
927
|
{
|
|
592
928
|
className: "p-3 text-center border-r last:border-r-0",
|
|
593
929
|
children: [
|
|
594
|
-
/* @__PURE__ */
|
|
595
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ l.jsx("div", { className: "text-sm font-medium text-muted-foreground", children: n.toLocaleDateString(a, { weekday: "short" }) }),
|
|
931
|
+
/* @__PURE__ */ l.jsx(
|
|
596
932
|
"div",
|
|
597
933
|
{
|
|
598
|
-
className:
|
|
934
|
+
className: H(
|
|
599
935
|
"text-lg font-semibold mt-1",
|
|
600
|
-
|
|
936
|
+
g && "inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground h-8 w-8"
|
|
601
937
|
),
|
|
602
|
-
children:
|
|
938
|
+
children: n.getDate()
|
|
603
939
|
}
|
|
604
940
|
)
|
|
605
941
|
]
|
|
606
942
|
},
|
|
607
|
-
|
|
943
|
+
n.toISOString()
|
|
608
944
|
);
|
|
609
945
|
}) }),
|
|
610
|
-
/* @__PURE__ */
|
|
611
|
-
const
|
|
612
|
-
return /* @__PURE__ */
|
|
946
|
+
/* @__PURE__ */ l.jsx("div", { role: "grid", className: "grid grid-cols-7 flex-1", children: m.map((n) => {
|
|
947
|
+
const g = Re(n, r);
|
|
948
|
+
return /* @__PURE__ */ l.jsx(
|
|
613
949
|
"div",
|
|
614
950
|
{
|
|
615
951
|
role: "gridcell",
|
|
616
|
-
"aria-label": `${
|
|
952
|
+
"aria-label": `${n.toLocaleDateString("default", { weekday: "long", month: "long", day: "numeric", year: "numeric" })}${g.length > 0 ? `, ${g.length} event${g.length > 1 ? "s" : ""}` : ""}`,
|
|
617
953
|
className: "border-r last:border-r-0 p-2 min-h-[400px] cursor-pointer hover:bg-accent/50",
|
|
618
|
-
onClick: () =>
|
|
619
|
-
onTouchStart: () =>
|
|
620
|
-
onTouchEnd:
|
|
621
|
-
children: /* @__PURE__ */
|
|
954
|
+
onClick: () => i?.(n),
|
|
955
|
+
onTouchStart: () => u(n),
|
|
956
|
+
onTouchEnd: v,
|
|
957
|
+
children: /* @__PURE__ */ l.jsx("div", { className: "space-y-2", children: g.map((s) => /* @__PURE__ */ l.jsxs(
|
|
622
958
|
"div",
|
|
623
959
|
{
|
|
624
960
|
role: "button",
|
|
625
|
-
|
|
626
|
-
|
|
961
|
+
title: s.title,
|
|
962
|
+
"aria-label": s.title,
|
|
963
|
+
className: H(
|
|
627
964
|
"text-xs sm:text-sm px-2 sm:px-3 py-1.5 sm:py-2 rounded cursor-pointer hover:opacity-80",
|
|
628
|
-
|
|
965
|
+
s.color?.startsWith("#") ? "text-white" : s.color || ge
|
|
629
966
|
),
|
|
630
|
-
style:
|
|
631
|
-
onClick: (
|
|
632
|
-
|
|
967
|
+
style: s.color && s.color.startsWith("#") ? { backgroundColor: s.color } : void 0,
|
|
968
|
+
onClick: (p) => {
|
|
969
|
+
p.stopPropagation(), c?.(s);
|
|
633
970
|
},
|
|
634
971
|
children: [
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
!
|
|
972
|
+
/* @__PURE__ */ l.jsx("div", { className: "font-medium truncate", children: s.title }),
|
|
973
|
+
!s.allDay && /* @__PURE__ */ l.jsx("div", { className: "text-xs opacity-90 mt-1", children: s.start.toLocaleTimeString("default", {
|
|
637
974
|
hour: "numeric",
|
|
638
975
|
minute: "2-digit"
|
|
639
976
|
}) })
|
|
640
977
|
]
|
|
641
978
|
},
|
|
642
|
-
|
|
979
|
+
s.id
|
|
643
980
|
)) })
|
|
644
981
|
},
|
|
645
|
-
|
|
982
|
+
n.toISOString()
|
|
646
983
|
);
|
|
647
984
|
}) })
|
|
648
985
|
] });
|
|
649
986
|
}
|
|
650
|
-
function
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
const
|
|
654
|
-
|
|
987
|
+
function _t({ date: e, events: r, onEventClick: a, onDateClick: c }) {
|
|
988
|
+
const i = Re(e, r), o = Array.from({ length: 24 }, (m, E) => E), u = M.useRef(null), v = (m) => {
|
|
989
|
+
c && (u.current = setTimeout(() => {
|
|
990
|
+
const E = new Date(e);
|
|
991
|
+
E.setHours(m, 0, 0, 0), c(E);
|
|
655
992
|
}, 500));
|
|
656
|
-
},
|
|
657
|
-
|
|
993
|
+
}, h = () => {
|
|
994
|
+
u.current && (clearTimeout(u.current), u.current = null);
|
|
658
995
|
};
|
|
659
|
-
return /* @__PURE__ */
|
|
660
|
-
const
|
|
661
|
-
return /* @__PURE__ */
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
996
|
+
return /* @__PURE__ */ l.jsx("div", { className: "flex flex-col h-full", children: /* @__PURE__ */ l.jsx("div", { role: "list", className: "flex-1 overflow-auto", children: o.map((m) => {
|
|
997
|
+
const E = i.filter((n) => n.allDay ? m === 0 : n.start.getHours() === m);
|
|
998
|
+
return /* @__PURE__ */ l.jsxs("div", { role: "listitem", className: "flex border-b min-h-[60px]", children: [
|
|
999
|
+
/* @__PURE__ */ l.jsx("div", { className: "w-20 p-2 text-sm text-muted-foreground border-r", children: m === 0 ? "12 AM" : m < 12 ? `${m} AM` : m === 12 ? "12 PM" : `${m - 12} PM` }),
|
|
1000
|
+
/* @__PURE__ */ l.jsx(
|
|
664
1001
|
"div",
|
|
665
1002
|
{
|
|
666
1003
|
className: "flex-1 p-2 space-y-2",
|
|
667
|
-
onTouchStart: () =>
|
|
668
|
-
onTouchEnd:
|
|
669
|
-
children:
|
|
1004
|
+
onTouchStart: () => v(m),
|
|
1005
|
+
onTouchEnd: h,
|
|
1006
|
+
children: E.map((n) => /* @__PURE__ */ l.jsxs(
|
|
670
1007
|
"div",
|
|
671
1008
|
{
|
|
672
|
-
|
|
673
|
-
|
|
1009
|
+
title: n.title,
|
|
1010
|
+
"aria-label": n.title,
|
|
1011
|
+
className: H(
|
|
674
1012
|
"px-2 sm:px-3 py-1.5 sm:py-2 rounded cursor-pointer hover:opacity-80",
|
|
675
|
-
|
|
1013
|
+
n.color?.startsWith("#") ? "text-white" : n.color || ge
|
|
676
1014
|
),
|
|
677
|
-
style:
|
|
678
|
-
onClick: () =>
|
|
1015
|
+
style: n.color && n.color.startsWith("#") ? { backgroundColor: n.color } : void 0,
|
|
1016
|
+
onClick: () => a?.(n),
|
|
679
1017
|
children: [
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
-
!
|
|
682
|
-
|
|
1018
|
+
/* @__PURE__ */ l.jsx("div", { className: "font-medium truncate", children: n.title }),
|
|
1019
|
+
!n.allDay && /* @__PURE__ */ l.jsxs("div", { className: "text-xs opacity-90 mt-1", children: [
|
|
1020
|
+
n.start.toLocaleTimeString("default", {
|
|
683
1021
|
hour: "numeric",
|
|
684
1022
|
minute: "2-digit"
|
|
685
1023
|
}),
|
|
686
|
-
|
|
1024
|
+
n.end && ` - ${n.end.toLocaleTimeString("default", {
|
|
687
1025
|
hour: "numeric",
|
|
688
1026
|
minute: "2-digit"
|
|
689
1027
|
})}`
|
|
690
1028
|
] })
|
|
691
1029
|
]
|
|
692
1030
|
},
|
|
693
|
-
|
|
1031
|
+
n.id
|
|
694
1032
|
))
|
|
695
1033
|
}
|
|
696
1034
|
)
|
|
697
|
-
] },
|
|
1035
|
+
] }, m);
|
|
698
1036
|
}) }) });
|
|
699
1037
|
}
|
|
700
|
-
function
|
|
701
|
-
const { onRefresh:
|
|
702
|
-
if (!
|
|
1038
|
+
function Tt(e) {
|
|
1039
|
+
const { onRefresh: r, threshold: a = 80, enabled: c = !0 } = e, i = G(null), [o, u] = Y(!1), [v, h] = Y(0), m = G(0), E = z((s) => {
|
|
1040
|
+
if (!c || o)
|
|
703
1041
|
return;
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
}, [
|
|
707
|
-
if (!
|
|
1042
|
+
const p = i.current;
|
|
1043
|
+
p && p.scrollTop === 0 && (m.current = s.touches[0].clientY);
|
|
1044
|
+
}, [c, o]), n = z((s) => {
|
|
1045
|
+
if (!c || o || !m.current)
|
|
708
1046
|
return;
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
}, [
|
|
712
|
-
if (!
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
1047
|
+
const D = s.touches[0].clientY - m.current;
|
|
1048
|
+
D > 0 && h(Math.min(D, a * 1.5));
|
|
1049
|
+
}, [c, o, a]), g = z(async () => {
|
|
1050
|
+
if (!c || o)
|
|
1051
|
+
return;
|
|
1052
|
+
const s = v;
|
|
1053
|
+
if (h(0), m.current = 0, s >= a) {
|
|
1054
|
+
u(!0);
|
|
1055
|
+
try {
|
|
1056
|
+
await r();
|
|
1057
|
+
} finally {
|
|
1058
|
+
u(!1);
|
|
720
1059
|
}
|
|
721
|
-
p(0), c.current = 0;
|
|
722
1060
|
}
|
|
723
|
-
}, [
|
|
1061
|
+
}, [c, o, v, a, r]);
|
|
724
1062
|
return ae(() => {
|
|
725
|
-
const
|
|
726
|
-
if (!(!
|
|
727
|
-
return
|
|
728
|
-
|
|
1063
|
+
const s = i.current;
|
|
1064
|
+
if (!(!s || !c))
|
|
1065
|
+
return s.addEventListener("touchstart", E, { passive: !0 }), s.addEventListener("touchmove", n, { passive: !0 }), s.addEventListener("touchend", g, { passive: !0 }), () => {
|
|
1066
|
+
s.removeEventListener("touchstart", E), s.removeEventListener("touchmove", n), s.removeEventListener("touchend", g);
|
|
729
1067
|
};
|
|
730
|
-
}, [
|
|
1068
|
+
}, [E, n, g, c]), { ref: i, isRefreshing: o, pullDistance: v };
|
|
731
1069
|
}
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
function
|
|
735
|
-
return "data" in
|
|
1070
|
+
const Nt = ue(null);
|
|
1071
|
+
Nt.displayName = "MobileContext";
|
|
1072
|
+
function Ot(e) {
|
|
1073
|
+
return "data" in e && e.data ? e.data : "staticData" in e && e.staticData ? {
|
|
736
1074
|
provider: "value",
|
|
737
|
-
items:
|
|
738
|
-
} :
|
|
1075
|
+
items: e.staticData
|
|
1076
|
+
} : e.objectName ? {
|
|
739
1077
|
provider: "object",
|
|
740
|
-
object:
|
|
1078
|
+
object: e.objectName
|
|
741
1079
|
} : null;
|
|
742
1080
|
}
|
|
743
|
-
function
|
|
744
|
-
if (
|
|
745
|
-
if (typeof
|
|
746
|
-
const
|
|
747
|
-
return { [
|
|
1081
|
+
function Rt(e) {
|
|
1082
|
+
if (e) {
|
|
1083
|
+
if (typeof e == "string") {
|
|
1084
|
+
const r = e.split(" "), a = r[0], c = r[1]?.toLowerCase() === "desc" ? "desc" : "asc";
|
|
1085
|
+
return { [a]: c };
|
|
748
1086
|
}
|
|
749
|
-
if (Array.isArray(
|
|
750
|
-
return
|
|
1087
|
+
if (Array.isArray(e))
|
|
1088
|
+
return e.reduce((r, a) => (a.field && a.order && (r[a.field] = a.order), r), {});
|
|
751
1089
|
}
|
|
752
1090
|
}
|
|
753
|
-
function
|
|
754
|
-
return "filter" in
|
|
755
|
-
startDateField:
|
|
756
|
-
endDateField:
|
|
757
|
-
titleField:
|
|
758
|
-
colorField:
|
|
759
|
-
allDayField:
|
|
1091
|
+
function Ct(e) {
|
|
1092
|
+
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 ? {
|
|
1093
|
+
startDateField: e.startDateField || e.dateField,
|
|
1094
|
+
endDateField: e.endDateField || e.endField,
|
|
1095
|
+
titleField: e.titleField || "name",
|
|
1096
|
+
colorField: e.colorField,
|
|
1097
|
+
allDayField: e.allDayField
|
|
760
1098
|
} : null;
|
|
761
1099
|
}
|
|
762
|
-
const
|
|
763
|
-
schema:
|
|
764
|
-
dataSource:
|
|
765
|
-
className:
|
|
766
|
-
onEventClick:
|
|
767
|
-
onRowClick:
|
|
768
|
-
onDateClick:
|
|
769
|
-
onNavigate:
|
|
770
|
-
onViewChange:
|
|
771
|
-
|
|
1100
|
+
const Ft = ({
|
|
1101
|
+
schema: e,
|
|
1102
|
+
dataSource: r,
|
|
1103
|
+
className: a,
|
|
1104
|
+
onEventClick: c,
|
|
1105
|
+
onRowClick: i,
|
|
1106
|
+
onDateClick: o,
|
|
1107
|
+
onNavigate: u,
|
|
1108
|
+
onViewChange: v,
|
|
1109
|
+
onEventDrop: h,
|
|
1110
|
+
locale: m,
|
|
1111
|
+
...E
|
|
772
1112
|
}) => {
|
|
773
|
-
const [
|
|
774
|
-
|
|
775
|
-
}, []), { ref:
|
|
776
|
-
onRefresh:
|
|
777
|
-
enabled: !!
|
|
778
|
-
}),
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
]),
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
]),
|
|
790
|
-
ae(() => {
|
|
791
|
-
let
|
|
1113
|
+
const [n, g] = Y([]), [s, p] = Y(!0), [D, F] = Y(null), [O, P] = Y(null), [$, y] = Y(/* @__PURE__ */ new Date()), [N, L] = Y("month"), [_, A] = Y(0), b = z(async () => {
|
|
1114
|
+
A((T) => T + 1);
|
|
1115
|
+
}, []), { ref: f, isRefreshing: j, pullDistance: d } = Tt({
|
|
1116
|
+
onRefresh: b,
|
|
1117
|
+
enabled: !!r && !!e.objectName
|
|
1118
|
+
}), w = X(() => Ot(e), [
|
|
1119
|
+
e.data,
|
|
1120
|
+
e.staticData,
|
|
1121
|
+
e.objectName
|
|
1122
|
+
]), C = X(() => Ct(e), [
|
|
1123
|
+
e.filter,
|
|
1124
|
+
e.calendar,
|
|
1125
|
+
e.dateField,
|
|
1126
|
+
e.endField,
|
|
1127
|
+
e.titleField,
|
|
1128
|
+
e.colorField
|
|
1129
|
+
]), V = w?.provider === "value", K = G(null);
|
|
1130
|
+
K.current = O, ae(() => {
|
|
1131
|
+
let T = !0;
|
|
792
1132
|
return (async () => {
|
|
793
1133
|
try {
|
|
794
|
-
if (!
|
|
795
|
-
if (
|
|
796
|
-
|
|
1134
|
+
if (!T) return;
|
|
1135
|
+
if (p(!0), V && w?.provider === "value") {
|
|
1136
|
+
T && (g(w.items), p(!1));
|
|
797
1137
|
return;
|
|
798
1138
|
}
|
|
799
|
-
if (
|
|
800
|
-
const
|
|
801
|
-
if (Array.isArray(
|
|
802
|
-
|
|
1139
|
+
if (e.data || E.data) {
|
|
1140
|
+
const t = e.data || E.data;
|
|
1141
|
+
if (Array.isArray(t)) {
|
|
1142
|
+
g(t), p(!1);
|
|
803
1143
|
return;
|
|
804
1144
|
}
|
|
805
1145
|
}
|
|
806
|
-
if (!
|
|
1146
|
+
if (!r || typeof r.find != "function")
|
|
807
1147
|
throw new Error("DataSource required for object/api providers");
|
|
808
|
-
if (
|
|
809
|
-
const
|
|
810
|
-
$filter:
|
|
811
|
-
$orderby:
|
|
1148
|
+
if (w?.provider === "object") {
|
|
1149
|
+
const t = w.object, x = ke(K.current?.fields), S = await r.find(t, {
|
|
1150
|
+
$filter: e.filter,
|
|
1151
|
+
$orderby: Rt(e.sort),
|
|
1152
|
+
...x.length > 0 ? { $expand: x } : {}
|
|
812
1153
|
});
|
|
813
|
-
let
|
|
814
|
-
|
|
815
|
-
} else
|
|
816
|
-
|
|
817
|
-
} catch (
|
|
818
|
-
console.error("[ObjectCalendar] Error fetching data:",
|
|
1154
|
+
let R = Ae(S);
|
|
1155
|
+
T && g(R);
|
|
1156
|
+
} else w?.provider === "api" && (console.warn("API provider not yet implemented for ObjectCalendar"), T && g([]));
|
|
1157
|
+
T && p(!1);
|
|
1158
|
+
} catch (t) {
|
|
1159
|
+
console.error("[ObjectCalendar] Error fetching data:", t), T && (F(t), p(!1));
|
|
819
1160
|
}
|
|
820
1161
|
})(), () => {
|
|
821
|
-
|
|
1162
|
+
T = !1;
|
|
822
1163
|
};
|
|
823
|
-
}, [
|
|
824
|
-
!
|
|
1164
|
+
}, [w, r, V, e.filter, e.sort, _]), ae(() => {
|
|
1165
|
+
!V && r && (async () => {
|
|
825
1166
|
try {
|
|
826
|
-
if (!
|
|
827
|
-
const
|
|
828
|
-
if (!
|
|
829
|
-
const
|
|
830
|
-
|
|
831
|
-
} catch (
|
|
832
|
-
console.error("Failed to fetch object schema:",
|
|
1167
|
+
if (!r) return;
|
|
1168
|
+
const I = w?.provider === "object" ? w.object : e.objectName;
|
|
1169
|
+
if (!I) return;
|
|
1170
|
+
const t = await r.getObjectSchema(I);
|
|
1171
|
+
P(t);
|
|
1172
|
+
} catch (I) {
|
|
1173
|
+
console.error("Failed to fetch object schema:", I);
|
|
833
1174
|
}
|
|
834
1175
|
})();
|
|
835
|
-
}, [
|
|
836
|
-
const
|
|
837
|
-
if (!
|
|
1176
|
+
}, [e.objectName, r, V, w]);
|
|
1177
|
+
const te = X(() => {
|
|
1178
|
+
if (!C || !n.length)
|
|
838
1179
|
return [];
|
|
839
|
-
const { startDateField:
|
|
840
|
-
return
|
|
841
|
-
const
|
|
1180
|
+
const { startDateField: T, endDateField: I, titleField: t, colorField: x } = C;
|
|
1181
|
+
return n.map((S, R) => {
|
|
1182
|
+
const W = S[T], q = I ? S[I] : null, k = S[t] || "Untitled", U = x ? S[x] : void 0;
|
|
842
1183
|
return {
|
|
843
|
-
id:
|
|
844
|
-
title:
|
|
845
|
-
start:
|
|
846
|
-
end:
|
|
847
|
-
color:
|
|
848
|
-
allDay: !
|
|
1184
|
+
id: S.id || S._id || `event-${R}`,
|
|
1185
|
+
title: k,
|
|
1186
|
+
start: W ? new Date(W) : /* @__PURE__ */ new Date(),
|
|
1187
|
+
end: q ? new Date(q) : void 0,
|
|
1188
|
+
color: U,
|
|
1189
|
+
allDay: !q,
|
|
849
1190
|
// If no end date, treat as all-day event
|
|
850
|
-
data:
|
|
1191
|
+
data: S
|
|
851
1192
|
};
|
|
852
|
-
}).filter((
|
|
853
|
-
}, [
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
1193
|
+
}).filter((S) => !isNaN(S.start.getTime()));
|
|
1194
|
+
}, [n, C]);
|
|
1195
|
+
z(() => {
|
|
1196
|
+
o?.(/* @__PURE__ */ new Date());
|
|
1197
|
+
}, [o]);
|
|
1198
|
+
const J = Le({
|
|
1199
|
+
navigation: e.navigation,
|
|
1200
|
+
objectName: e.objectName,
|
|
1201
|
+
onRowClick: i
|
|
859
1202
|
});
|
|
860
|
-
return
|
|
1203
|
+
return s ? /* @__PURE__ */ l.jsx("div", { className: a, children: /* @__PURE__ */ l.jsx("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ l.jsx("div", { className: "text-muted-foreground", children: "Loading calendar..." }) }) }) : D ? /* @__PURE__ */ l.jsx("div", { className: a, children: /* @__PURE__ */ l.jsx("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ l.jsxs("div", { className: "text-destructive", children: [
|
|
861
1204
|
"Error: ",
|
|
862
|
-
|
|
863
|
-
] }) }) }) :
|
|
864
|
-
|
|
1205
|
+
D.message
|
|
1206
|
+
] }) }) }) : C ? /* @__PURE__ */ l.jsxs("div", { ref: f, className: a, children: [
|
|
1207
|
+
d > 0 && /* @__PURE__ */ l.jsx(
|
|
865
1208
|
"div",
|
|
866
1209
|
{
|
|
867
1210
|
className: "flex items-center justify-center text-xs text-muted-foreground",
|
|
868
|
-
style: { height:
|
|
869
|
-
children:
|
|
1211
|
+
style: { height: d },
|
|
1212
|
+
children: j ? "Refreshing…" : "Pull to refresh"
|
|
870
1213
|
}
|
|
871
1214
|
),
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
|
|
1215
|
+
/* @__PURE__ */ l.jsx("div", { className: "border rounded-lg bg-background h-[calc(100vh-120px)] sm:h-[calc(100vh-160px)] md:h-[calc(100vh-200px)] min-h-[400px] sm:min-h-[600px]", children: /* @__PURE__ */ l.jsx(
|
|
1216
|
+
Te,
|
|
874
1217
|
{
|
|
875
|
-
events:
|
|
876
|
-
currentDate:
|
|
877
|
-
view:
|
|
878
|
-
|
|
879
|
-
|
|
1218
|
+
events: te,
|
|
1219
|
+
currentDate: $,
|
|
1220
|
+
view: e.defaultView || "month",
|
|
1221
|
+
locale: m,
|
|
1222
|
+
onEventClick: (T) => {
|
|
1223
|
+
J.handleClick(T.data), c?.(T.data);
|
|
880
1224
|
},
|
|
881
|
-
onDateClick:
|
|
882
|
-
onNavigate: (
|
|
883
|
-
|
|
1225
|
+
onDateClick: o,
|
|
1226
|
+
onNavigate: (T) => {
|
|
1227
|
+
y(T), u?.(T);
|
|
884
1228
|
},
|
|
885
|
-
onViewChange: (
|
|
886
|
-
|
|
1229
|
+
onViewChange: (T) => {
|
|
1230
|
+
L(T), v?.(T);
|
|
887
1231
|
},
|
|
888
|
-
onAddClick:
|
|
1232
|
+
onAddClick: void 0,
|
|
1233
|
+
onEventDrop: h ? (T, I, t) => {
|
|
1234
|
+
h(T.data, I, t);
|
|
1235
|
+
} : void 0
|
|
889
1236
|
}
|
|
890
1237
|
) }),
|
|
891
|
-
|
|
892
|
-
/* @__PURE__ */
|
|
893
|
-
/* @__PURE__ */
|
|
894
|
-
] },
|
|
895
|
-
] }) : /* @__PURE__ */
|
|
1238
|
+
J.isOverlay && /* @__PURE__ */ l.jsx(Je, { ...J, title: "Event Details", children: (T) => /* @__PURE__ */ l.jsx("div", { className: "space-y-3", children: Object.entries(T).map(([I, t]) => /* @__PURE__ */ l.jsxs("div", { className: "flex flex-col", children: [
|
|
1239
|
+
/* @__PURE__ */ l.jsx("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: I.replace(/_/g, " ") }),
|
|
1240
|
+
/* @__PURE__ */ l.jsx("span", { className: "text-sm", children: String(t ?? "—") })
|
|
1241
|
+
] }, I)) }) })
|
|
1242
|
+
] }) : /* @__PURE__ */ l.jsx("div", { className: a, children: /* @__PURE__ */ l.jsx("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ l.jsx("div", { className: "text-muted-foreground", children: "Calendar configuration required. Please specify startDateField and titleField." }) }) });
|
|
896
1243
|
};
|
|
897
|
-
|
|
1244
|
+
fe.register(
|
|
898
1245
|
"calendar-view",
|
|
899
|
-
({ schema:
|
|
900
|
-
const
|
|
901
|
-
const
|
|
1246
|
+
({ schema: e, className: r, onAction: a, ...c }) => {
|
|
1247
|
+
const i = oe.useMemo(() => !e.data || !Array.isArray(e.data) ? [] : e.data.map((u, v) => {
|
|
1248
|
+
const h = e.titleField || "title", m = e.startDateField || "start", E = e.endDateField || "end", n = e.colorField || "color", g = e.allDayField || "allDay";
|
|
902
1249
|
return {
|
|
903
|
-
id: u._id || u.id ||
|
|
904
|
-
title: u[
|
|
905
|
-
start: new Date(u[
|
|
906
|
-
end: u[
|
|
907
|
-
allDay: u[
|
|
908
|
-
color: u[
|
|
1250
|
+
id: u._id || u.id || v,
|
|
1251
|
+
title: u[h] || "Untitled Event",
|
|
1252
|
+
start: new Date(u[m]),
|
|
1253
|
+
end: u[E] ? new Date(u[E]) : void 0,
|
|
1254
|
+
allDay: u[g],
|
|
1255
|
+
color: u[n],
|
|
909
1256
|
data: u
|
|
910
1257
|
};
|
|
911
|
-
}), [
|
|
912
|
-
|
|
1258
|
+
}), [e.data, e.titleField, e.startDateField, e.endDateField, e.colorField, e.allDayField]), o = (u) => {
|
|
1259
|
+
a?.({
|
|
913
1260
|
type: "event-click",
|
|
914
1261
|
payload: u
|
|
915
1262
|
});
|
|
916
|
-
}, g = () => {
|
|
917
|
-
s?.({
|
|
918
|
-
type: "create",
|
|
919
|
-
payload: {}
|
|
920
|
-
});
|
|
921
1263
|
};
|
|
922
|
-
return /* @__PURE__ */
|
|
923
|
-
|
|
1264
|
+
return /* @__PURE__ */ l.jsx(
|
|
1265
|
+
Te,
|
|
924
1266
|
{
|
|
925
|
-
className:
|
|
926
|
-
events:
|
|
927
|
-
onEventClick:
|
|
928
|
-
|
|
929
|
-
...d
|
|
1267
|
+
className: r,
|
|
1268
|
+
events: i,
|
|
1269
|
+
onEventClick: o,
|
|
1270
|
+
...c
|
|
930
1271
|
}
|
|
931
1272
|
);
|
|
932
1273
|
},
|
|
@@ -1041,11 +1382,11 @@ ne.register(
|
|
|
1041
1382
|
}
|
|
1042
1383
|
}
|
|
1043
1384
|
);
|
|
1044
|
-
const
|
|
1045
|
-
const { dataSource:
|
|
1046
|
-
return /* @__PURE__ */
|
|
1385
|
+
const Ce = ({ schema: e, data: r, loading: a, ...c }) => {
|
|
1386
|
+
const { dataSource: i } = Pe() || {};
|
|
1387
|
+
return /* @__PURE__ */ l.jsx(Ft, { schema: e, dataSource: i, ...c });
|
|
1047
1388
|
};
|
|
1048
|
-
|
|
1389
|
+
fe.register("object-calendar", Ce, {
|
|
1049
1390
|
namespace: "plugin-calendar",
|
|
1050
1391
|
label: "Object Calendar",
|
|
1051
1392
|
category: "view",
|
|
@@ -1054,7 +1395,7 @@ ne.register("object-calendar", pe, {
|
|
|
1054
1395
|
{ name: "calendar", type: "object", label: "Calendar Config", description: "startDateField, endDateField, titleField, colorField" }
|
|
1055
1396
|
]
|
|
1056
1397
|
});
|
|
1057
|
-
|
|
1398
|
+
fe.register("calendar", Ce, {
|
|
1058
1399
|
namespace: "view",
|
|
1059
1400
|
label: "Calendar View",
|
|
1060
1401
|
category: "view",
|
|
@@ -1064,7 +1405,7 @@ ne.register("calendar", pe, {
|
|
|
1064
1405
|
]
|
|
1065
1406
|
});
|
|
1066
1407
|
export {
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1408
|
+
Te as CalendarView,
|
|
1409
|
+
Ft as ObjectCalendar,
|
|
1410
|
+
Ce as ObjectCalendarRenderer
|
|
1070
1411
|
};
|