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