@object-ui/plugin-calendar 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +22 -0
- package/dist/index.js +633 -488
- package/dist/index.umd.cjs +2 -2
- package/dist/src/CalendarView.d.ts +2 -1
- package/dist/src/CalendarView.d.ts.map +1 -1
- package/dist/src/ObjectCalendar.d.ts +1 -0
- package/dist/src/ObjectCalendar.d.ts.map +1 -1
- package/dist/src/ObjectCalendar.stories.d.ts +23 -0
- package/dist/src/ObjectCalendar.stories.d.ts.map +1 -0
- package/package.json +11 -10
- package/src/CalendarView.tsx +178 -18
- package/src/ObjectCalendar.stories.tsx +82 -0
- package/src/ObjectCalendar.tsx +54 -4
- package/src/__tests__/accessibility.test.tsx +290 -0
- package/src/__tests__/performance-benchmark.test.tsx +227 -0
- package/src/__tests__/view-states.test.tsx +377 -0
package/dist/index.js
CHANGED
|
@@ -1,372 +1,391 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import { ComponentRegistry as
|
|
4
|
-
import { useSchemaContext as
|
|
5
|
-
import { ChevronLeftIcon as
|
|
6
|
-
import { Button as
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
for (var
|
|
18
|
-
|
|
19
|
-
} else
|
|
20
|
-
return
|
|
21
|
-
$$typeof:
|
|
22
|
-
type:
|
|
23
|
-
key:
|
|
24
|
-
ref:
|
|
25
|
-
props:
|
|
1
|
+
import * as P from "react";
|
|
2
|
+
import ue, { useRef as se, useState as $, useCallback as Q, useEffect as ae, createContext as xe, useMemo as te } from "react";
|
|
3
|
+
import { ComponentRegistry as ne } from "@object-ui/core";
|
|
4
|
+
import { useNavigationOverlay as De, useSchemaContext as be } from "@object-ui/react";
|
|
5
|
+
import { ChevronLeftIcon as ve, ChevronRightIcon as ye, CalendarIcon as je, PlusIcon as we } from "lucide-react";
|
|
6
|
+
import { Button as G, Popover as Ee, PopoverTrigger as Te, cn as V, PopoverContent as Se, Calendar as Ne, Select as Re, SelectTrigger as Fe, SelectValue as Ce, SelectContent as _e, SelectItem as re, NavigationOverlay as ke } from "@object-ui/components";
|
|
7
|
+
var Z = { exports: {} }, X = {};
|
|
8
|
+
var ie;
|
|
9
|
+
function Oe() {
|
|
10
|
+
if (ie) return X;
|
|
11
|
+
ie = 1;
|
|
12
|
+
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), n = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
13
|
+
function s(d, m, i) {
|
|
14
|
+
var g = null;
|
|
15
|
+
if (i !== void 0 && (g = "" + i), m.key !== void 0 && (g = "" + m.key), "key" in m) {
|
|
16
|
+
i = {};
|
|
17
|
+
for (var u in m)
|
|
18
|
+
u !== "key" && (i[u] = m[u]);
|
|
19
|
+
} else i = m;
|
|
20
|
+
return m = i.ref, {
|
|
21
|
+
$$typeof: t,
|
|
22
|
+
type: d,
|
|
23
|
+
key: g,
|
|
24
|
+
ref: m !== void 0 ? m : null,
|
|
25
|
+
props: i
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return X.Fragment = n, X.jsx = s, X.jsxs = s, X;
|
|
29
29
|
}
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
function
|
|
33
|
-
return
|
|
34
|
-
function e
|
|
35
|
-
if (
|
|
36
|
-
if (typeof
|
|
37
|
-
return
|
|
38
|
-
if (typeof
|
|
39
|
-
switch (
|
|
40
|
-
case
|
|
30
|
+
var B = {};
|
|
31
|
+
var ce;
|
|
32
|
+
function Ae() {
|
|
33
|
+
return ce || (ce = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
34
|
+
function t(e) {
|
|
35
|
+
if (e == null) return null;
|
|
36
|
+
if (typeof e == "function")
|
|
37
|
+
return e.$$typeof === v ? null : e.displayName || e.name || null;
|
|
38
|
+
if (typeof e == "string") return e;
|
|
39
|
+
switch (e) {
|
|
40
|
+
case L:
|
|
41
41
|
return "Fragment";
|
|
42
|
-
case
|
|
42
|
+
case N:
|
|
43
43
|
return "Profiler";
|
|
44
|
-
case
|
|
44
|
+
case x:
|
|
45
45
|
return "StrictMode";
|
|
46
|
-
case
|
|
46
|
+
case j:
|
|
47
47
|
return "Suspense";
|
|
48
|
-
case
|
|
48
|
+
case A:
|
|
49
49
|
return "SuspenseList";
|
|
50
|
-
case
|
|
50
|
+
case E:
|
|
51
51
|
return "Activity";
|
|
52
52
|
}
|
|
53
|
-
if (typeof
|
|
54
|
-
switch (typeof
|
|
53
|
+
if (typeof e == "object")
|
|
54
|
+
switch (typeof e.tag == "number" && console.error(
|
|
55
55
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
56
|
-
),
|
|
57
|
-
case
|
|
56
|
+
), e.$$typeof) {
|
|
57
|
+
case M:
|
|
58
58
|
return "Portal";
|
|
59
|
-
case
|
|
60
|
-
return
|
|
59
|
+
case F:
|
|
60
|
+
return e.displayName || "Context";
|
|
61
|
+
case k:
|
|
62
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
63
|
+
case O:
|
|
64
|
+
var f = e.render;
|
|
65
|
+
return e = e.displayName, e || (e = f.displayName || f.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
61
66
|
case I:
|
|
62
|
-
return
|
|
63
|
-
case
|
|
64
|
-
|
|
65
|
-
return t = t.displayName, t || (t = i.displayName || i.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
66
|
-
case G:
|
|
67
|
-
return i = t.displayName || null, i !== null ? i : e(t.type) || "Memo";
|
|
68
|
-
case g:
|
|
69
|
-
i = t._payload, t = t._init;
|
|
67
|
+
return f = e.displayName || null, f !== null ? f : t(e.type) || "Memo";
|
|
68
|
+
case o:
|
|
69
|
+
f = e._payload, e = e._init;
|
|
70
70
|
try {
|
|
71
|
-
return e(
|
|
71
|
+
return t(e(f));
|
|
72
72
|
} catch {
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
|
-
function n(
|
|
78
|
-
return "" +
|
|
77
|
+
function n(e) {
|
|
78
|
+
return "" + e;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function s(e) {
|
|
81
81
|
try {
|
|
82
|
-
n(
|
|
83
|
-
var
|
|
82
|
+
n(e);
|
|
83
|
+
var f = !1;
|
|
84
84
|
} catch {
|
|
85
|
-
|
|
85
|
+
f = !0;
|
|
86
86
|
}
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
var
|
|
90
|
-
return
|
|
91
|
-
|
|
87
|
+
if (f) {
|
|
88
|
+
f = console;
|
|
89
|
+
var y = f.error, w = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
90
|
+
return y.call(
|
|
91
|
+
f,
|
|
92
92
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
93
|
-
|
|
94
|
-
), n(
|
|
93
|
+
w
|
|
94
|
+
), n(e);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
if (
|
|
99
|
-
if (typeof
|
|
97
|
+
function d(e) {
|
|
98
|
+
if (e === L) return "<>";
|
|
99
|
+
if (typeof e == "object" && e !== null && e.$$typeof === o)
|
|
100
100
|
return "<...>";
|
|
101
101
|
try {
|
|
102
|
-
var
|
|
103
|
-
return
|
|
102
|
+
var f = t(e);
|
|
103
|
+
return f ? "<" + f + ">" : "<...>";
|
|
104
104
|
} catch {
|
|
105
105
|
return "<...>";
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
var
|
|
110
|
-
return
|
|
108
|
+
function m() {
|
|
109
|
+
var e = Y.A;
|
|
110
|
+
return e === null ? null : e.getOwner();
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function i() {
|
|
113
113
|
return Error("react-stack-top-frame");
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
if (
|
|
117
|
-
var
|
|
118
|
-
if (
|
|
115
|
+
function g(e) {
|
|
116
|
+
if (W.call(e, "key")) {
|
|
117
|
+
var f = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
118
|
+
if (f && f.isReactWarning) return !1;
|
|
119
119
|
}
|
|
120
|
-
return
|
|
120
|
+
return e.key !== void 0;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
function
|
|
124
|
-
|
|
122
|
+
function u(e, f) {
|
|
123
|
+
function y() {
|
|
124
|
+
H || (H = !0, console.error(
|
|
125
125
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
126
|
-
|
|
126
|
+
f
|
|
127
127
|
));
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
get:
|
|
129
|
+
y.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
130
|
+
get: y,
|
|
131
131
|
configurable: !0
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
var
|
|
136
|
-
return
|
|
134
|
+
function p() {
|
|
135
|
+
var e = t(this.type);
|
|
136
|
+
return D[e] || (D[e] = !0, console.error(
|
|
137
137
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
138
|
-
)),
|
|
138
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
139
139
|
}
|
|
140
|
-
function c(
|
|
141
|
-
var
|
|
142
|
-
return
|
|
143
|
-
$$typeof:
|
|
144
|
-
type:
|
|
145
|
-
key:
|
|
146
|
-
props:
|
|
147
|
-
_owner:
|
|
148
|
-
}, (
|
|
140
|
+
function c(e, f, y, w, U, J) {
|
|
141
|
+
var S = y.ref;
|
|
142
|
+
return e = {
|
|
143
|
+
$$typeof: T,
|
|
144
|
+
type: e,
|
|
145
|
+
key: f,
|
|
146
|
+
props: y,
|
|
147
|
+
_owner: w
|
|
148
|
+
}, (S !== void 0 ? S : null) !== null ? Object.defineProperty(e, "ref", {
|
|
149
149
|
enumerable: !1,
|
|
150
|
-
get:
|
|
151
|
-
}) : Object.defineProperty(
|
|
150
|
+
get: p
|
|
151
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
152
152
|
configurable: !1,
|
|
153
153
|
enumerable: !1,
|
|
154
154
|
writable: !0,
|
|
155
155
|
value: 0
|
|
156
|
-
}), Object.defineProperty(
|
|
156
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
157
157
|
configurable: !1,
|
|
158
158
|
enumerable: !1,
|
|
159
159
|
writable: !0,
|
|
160
160
|
value: null
|
|
161
|
-
}), Object.defineProperty(
|
|
161
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
162
162
|
configurable: !1,
|
|
163
163
|
enumerable: !1,
|
|
164
164
|
writable: !0,
|
|
165
|
-
value:
|
|
166
|
-
}), Object.defineProperty(
|
|
165
|
+
value: U
|
|
166
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
167
167
|
configurable: !1,
|
|
168
168
|
enumerable: !1,
|
|
169
169
|
writable: !0,
|
|
170
|
-
value:
|
|
171
|
-
}), Object.freeze && (Object.freeze(
|
|
170
|
+
value: J
|
|
171
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
172
172
|
}
|
|
173
|
-
function b(
|
|
174
|
-
var
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
if (
|
|
178
|
-
for (
|
|
179
|
-
|
|
180
|
-
Object.freeze && Object.freeze(
|
|
173
|
+
function b(e, f, y, w, U, J) {
|
|
174
|
+
var S = f.children;
|
|
175
|
+
if (S !== void 0)
|
|
176
|
+
if (w)
|
|
177
|
+
if (K(S)) {
|
|
178
|
+
for (w = 0; w < S.length; w++)
|
|
179
|
+
a(S[w]);
|
|
180
|
+
Object.freeze && Object.freeze(S);
|
|
181
181
|
} else
|
|
182
182
|
console.error(
|
|
183
183
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
184
184
|
);
|
|
185
|
-
else
|
|
186
|
-
if (
|
|
187
|
-
|
|
188
|
-
var
|
|
189
|
-
return
|
|
185
|
+
else a(S);
|
|
186
|
+
if (W.call(f, "key")) {
|
|
187
|
+
S = t(e);
|
|
188
|
+
var q = Object.keys(f).filter(function(he) {
|
|
189
|
+
return he !== "key";
|
|
190
190
|
});
|
|
191
|
-
|
|
191
|
+
w = 0 < q.length ? "{key: someKey, " + q.join(": ..., ") + ": ...}" : "{key: someKey}", _[S + w] || (q = 0 < q.length ? "{" + q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
192
192
|
`A props object containing a "key" prop is being spread into JSX:
|
|
193
193
|
let props = %s;
|
|
194
194
|
<%s {...props} />
|
|
195
195
|
React keys must be passed directly to JSX without using spread:
|
|
196
196
|
let props = %s;
|
|
197
197
|
<%s key={someKey} {...props} />`,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
),
|
|
198
|
+
w,
|
|
199
|
+
S,
|
|
200
|
+
q,
|
|
201
|
+
S
|
|
202
|
+
), _[S + w] = !0);
|
|
203
203
|
}
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
for (var
|
|
207
|
-
|
|
208
|
-
} else
|
|
209
|
-
return
|
|
210
|
-
|
|
211
|
-
typeof
|
|
204
|
+
if (S = null, y !== void 0 && (s(y), S = "" + y), g(f) && (s(f.key), S = "" + f.key), "key" in f) {
|
|
205
|
+
y = {};
|
|
206
|
+
for (var ee in f)
|
|
207
|
+
ee !== "key" && (y[ee] = f[ee]);
|
|
208
|
+
} else y = f;
|
|
209
|
+
return S && u(
|
|
210
|
+
y,
|
|
211
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
212
212
|
), c(
|
|
213
|
-
|
|
213
|
+
e,
|
|
214
|
+
S,
|
|
214
215
|
y,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
B
|
|
216
|
+
m(),
|
|
217
|
+
U,
|
|
218
|
+
J
|
|
219
219
|
);
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
|
|
221
|
+
function a(e) {
|
|
222
|
+
h(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === o && (e._payload.status === "fulfilled" ? h(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
return typeof
|
|
224
|
+
function h(e) {
|
|
225
|
+
return typeof e == "object" && e !== null && e.$$typeof === T;
|
|
226
226
|
}
|
|
227
|
-
var
|
|
227
|
+
var l = ue, T = /* @__PURE__ */ Symbol.for("react.transitional.element"), M = /* @__PURE__ */ Symbol.for("react.portal"), L = /* @__PURE__ */ Symbol.for("react.fragment"), x = /* @__PURE__ */ Symbol.for("react.strict_mode"), N = /* @__PURE__ */ Symbol.for("react.profiler"), k = /* @__PURE__ */ Symbol.for("react.consumer"), F = /* @__PURE__ */ Symbol.for("react.context"), O = /* @__PURE__ */ Symbol.for("react.forward_ref"), j = /* @__PURE__ */ Symbol.for("react.suspense"), A = /* @__PURE__ */ Symbol.for("react.suspense_list"), I = /* @__PURE__ */ Symbol.for("react.memo"), o = /* @__PURE__ */ Symbol.for("react.lazy"), E = /* @__PURE__ */ Symbol.for("react.activity"), v = /* @__PURE__ */ Symbol.for("react.client.reference"), Y = l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, K = Array.isArray, z = console.createTask ? console.createTask : function() {
|
|
228
228
|
return null;
|
|
229
229
|
};
|
|
230
|
-
|
|
231
|
-
react_stack_bottom_frame: function(
|
|
232
|
-
return
|
|
230
|
+
l = {
|
|
231
|
+
react_stack_bottom_frame: function(e) {
|
|
232
|
+
return e();
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
|
-
var
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
)(),
|
|
239
|
-
|
|
240
|
-
var
|
|
235
|
+
var H, D = {}, C = l.react_stack_bottom_frame.bind(
|
|
236
|
+
l,
|
|
237
|
+
i
|
|
238
|
+
)(), R = z(d(i)), _ = {};
|
|
239
|
+
B.Fragment = L, B.jsx = function(e, f, y) {
|
|
240
|
+
var w = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
241
241
|
return b(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
e,
|
|
243
|
+
f,
|
|
244
|
+
y,
|
|
245
245
|
!1,
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
w ? Error("react-stack-top-frame") : C,
|
|
247
|
+
w ? z(d(e)) : R
|
|
248
248
|
);
|
|
249
|
-
},
|
|
250
|
-
var
|
|
249
|
+
}, B.jsxs = function(e, f, y) {
|
|
250
|
+
var w = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
251
251
|
return b(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
e,
|
|
253
|
+
f,
|
|
254
|
+
y,
|
|
255
255
|
!0,
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
w ? Error("react-stack-top-frame") : C,
|
|
257
|
+
w ? z(d(e)) : R
|
|
258
258
|
);
|
|
259
259
|
};
|
|
260
|
-
})()),
|
|
260
|
+
})()), B;
|
|
261
261
|
}
|
|
262
|
-
var
|
|
263
|
-
function
|
|
264
|
-
return
|
|
262
|
+
var de;
|
|
263
|
+
function Pe() {
|
|
264
|
+
return de || (de = 1, process.env.NODE_ENV === "production" ? Z.exports = Oe() : Z.exports = Ae()), Z.exports;
|
|
265
265
|
}
|
|
266
|
-
var r =
|
|
267
|
-
const
|
|
268
|
-
function
|
|
269
|
-
events:
|
|
266
|
+
var r = Pe();
|
|
267
|
+
const le = "bg-blue-500 text-white";
|
|
268
|
+
function fe({
|
|
269
|
+
events: t = [],
|
|
270
270
|
view: n = "month",
|
|
271
|
-
currentDate:
|
|
272
|
-
locale:
|
|
273
|
-
onEventClick:
|
|
274
|
-
onDateClick:
|
|
275
|
-
onViewChange:
|
|
276
|
-
onNavigate:
|
|
277
|
-
onAddClick:
|
|
278
|
-
|
|
271
|
+
currentDate: s = /* @__PURE__ */ new Date(),
|
|
272
|
+
locale: d = "default",
|
|
273
|
+
onEventClick: m,
|
|
274
|
+
onDateClick: i,
|
|
275
|
+
onViewChange: g,
|
|
276
|
+
onNavigate: u,
|
|
277
|
+
onAddClick: p,
|
|
278
|
+
onEventDrop: c,
|
|
279
|
+
className: b
|
|
279
280
|
}) {
|
|
280
|
-
const [
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}, [
|
|
281
|
+
const [a, h] = P.useState(n), [l, T] = P.useState(s);
|
|
282
|
+
P.useEffect(() => {
|
|
283
|
+
T(s);
|
|
284
|
+
}, [s]), P.useEffect(() => {
|
|
284
285
|
h(n);
|
|
285
286
|
}, [n]);
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
},
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
287
|
+
const M = P.useRef(g);
|
|
288
|
+
M.current = g, P.useEffect(() => {
|
|
289
|
+
const o = window.matchMedia("(max-width: 639px)"), E = (v) => {
|
|
290
|
+
v.matches && (h("day"), M.current?.("day"));
|
|
291
|
+
};
|
|
292
|
+
return E(o), o.addEventListener("change", E), () => o.removeEventListener("change", E);
|
|
293
|
+
}, []);
|
|
294
|
+
const L = () => {
|
|
295
|
+
const o = new Date(l);
|
|
296
|
+
a === "month" ? o.setMonth(o.getMonth() - 1) : a === "week" ? o.setDate(o.getDate() - 7) : o.setDate(o.getDate() - 1), T(o), u?.(o);
|
|
297
|
+
}, x = () => {
|
|
298
|
+
const o = new Date(l);
|
|
299
|
+
a === "month" ? o.setMonth(o.getMonth() + 1) : a === "week" ? o.setDate(o.getDate() + 7) : o.setDate(o.getDate() + 1), T(o), u?.(o);
|
|
300
|
+
}, N = () => {
|
|
301
|
+
const o = /* @__PURE__ */ new Date();
|
|
302
|
+
T(o), u?.(o);
|
|
303
|
+
}, k = (o) => {
|
|
304
|
+
h(o), g?.(o);
|
|
305
|
+
}, F = () => {
|
|
306
|
+
if (a === "month")
|
|
307
|
+
return l.toLocaleDateString(d, {
|
|
300
308
|
month: "long",
|
|
301
309
|
year: "numeric"
|
|
302
310
|
});
|
|
303
|
-
if (
|
|
304
|
-
const
|
|
305
|
-
return
|
|
311
|
+
if (a === "week") {
|
|
312
|
+
const o = me(l), E = new Date(o);
|
|
313
|
+
return E.setDate(E.getDate() + 6), `${o.toLocaleDateString(d, {
|
|
306
314
|
month: "short",
|
|
307
315
|
day: "numeric"
|
|
308
|
-
})} - ${
|
|
316
|
+
})} - ${E.toLocaleDateString(d, {
|
|
309
317
|
month: "short",
|
|
310
318
|
day: "numeric",
|
|
311
319
|
year: "numeric"
|
|
312
320
|
})}`;
|
|
313
321
|
} else
|
|
314
|
-
return
|
|
322
|
+
return l.toLocaleDateString(d, {
|
|
315
323
|
weekday: "long",
|
|
316
324
|
month: "long",
|
|
317
325
|
day: "numeric",
|
|
318
326
|
year: "numeric"
|
|
319
327
|
});
|
|
320
|
-
},
|
|
321
|
-
|
|
328
|
+
}, O = P.useRef(0), j = (o) => {
|
|
329
|
+
O.current = o.touches[0].clientX;
|
|
330
|
+
}, A = (o) => {
|
|
331
|
+
const E = O.current - o.changedTouches[0].clientX;
|
|
332
|
+
if (Math.abs(E) > 50) {
|
|
333
|
+
const v = new Date(l);
|
|
334
|
+
a === "day" ? v.setDate(v.getDate() + (E > 0 ? 1 : -1)) : a === "week" ? v.setDate(v.getDate() + (E > 0 ? 7 : -7)) : v.setMonth(v.getMonth() + (E > 0 ? 1 : -1)), T(v), u?.(v);
|
|
335
|
+
}
|
|
336
|
+
}, I = (o) => {
|
|
337
|
+
o && (T(o), u?.(o));
|
|
322
338
|
};
|
|
323
|
-
return /* @__PURE__ */ r.jsxs("div", { className:
|
|
339
|
+
return /* @__PURE__ */ r.jsxs("div", { role: "region", "aria-label": "Calendar", className: V("flex flex-col h-full bg-background", b), children: [
|
|
324
340
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-between p-4 border-b", children: [
|
|
325
341
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
326
342
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center bg-muted/50 rounded-lg p-1 gap-1", children: [
|
|
327
|
-
/* @__PURE__ */ r.jsx(
|
|
343
|
+
/* @__PURE__ */ r.jsx(G, { variant: "ghost", size: "sm", onClick: N, className: "h-8", "aria-label": "Go to today", children: "Today" }),
|
|
328
344
|
/* @__PURE__ */ r.jsx("div", { className: "h-4 w-px bg-border mx-1" }),
|
|
329
345
|
/* @__PURE__ */ r.jsx(
|
|
330
|
-
|
|
346
|
+
G,
|
|
331
347
|
{
|
|
332
348
|
variant: "ghost",
|
|
333
349
|
size: "icon",
|
|
334
|
-
|
|
350
|
+
"aria-label": "Previous period",
|
|
351
|
+
onClick: L,
|
|
335
352
|
className: "h-8 w-8",
|
|
336
|
-
children: /* @__PURE__ */ r.jsx(
|
|
353
|
+
children: /* @__PURE__ */ r.jsx(ve, { className: "h-4 w-4" })
|
|
337
354
|
}
|
|
338
355
|
),
|
|
339
356
|
/* @__PURE__ */ r.jsx(
|
|
340
|
-
|
|
357
|
+
G,
|
|
341
358
|
{
|
|
342
359
|
variant: "ghost",
|
|
343
360
|
size: "icon",
|
|
344
|
-
|
|
361
|
+
"aria-label": "Next period",
|
|
362
|
+
onClick: x,
|
|
345
363
|
className: "h-8 w-8",
|
|
346
|
-
children: /* @__PURE__ */ r.jsx(
|
|
364
|
+
children: /* @__PURE__ */ r.jsx(ye, { className: "h-4 w-4" })
|
|
347
365
|
}
|
|
348
366
|
)
|
|
349
367
|
] }),
|
|
350
|
-
/* @__PURE__ */ r.jsxs(
|
|
351
|
-
/* @__PURE__ */ r.jsx(
|
|
352
|
-
|
|
368
|
+
/* @__PURE__ */ r.jsxs(Ee, { children: [
|
|
369
|
+
/* @__PURE__ */ r.jsx(Te, { asChild: !0, children: /* @__PURE__ */ r.jsxs(
|
|
370
|
+
G,
|
|
353
371
|
{
|
|
354
372
|
variant: "ghost",
|
|
355
|
-
|
|
373
|
+
"aria-label": `Current date: ${F()}`,
|
|
374
|
+
className: V(
|
|
356
375
|
"text-xl font-semibold h-auto px-3 py-1 hover:bg-muted/50 transition-colors",
|
|
357
376
|
"flex items-center gap-2"
|
|
358
377
|
),
|
|
359
378
|
children: [
|
|
360
|
-
/* @__PURE__ */ r.jsx(
|
|
361
|
-
/* @__PURE__ */ r.jsx("span", { children:
|
|
379
|
+
/* @__PURE__ */ r.jsx(je, { className: "h-5 w-5 text-muted-foreground" }),
|
|
380
|
+
/* @__PURE__ */ r.jsx("span", { children: F() })
|
|
362
381
|
]
|
|
363
382
|
}
|
|
364
383
|
) }),
|
|
365
|
-
/* @__PURE__ */ r.jsx(
|
|
366
|
-
|
|
384
|
+
/* @__PURE__ */ r.jsx(Se, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ r.jsx(
|
|
385
|
+
Ne,
|
|
367
386
|
{
|
|
368
387
|
mode: "single",
|
|
369
|
-
selected:
|
|
388
|
+
selected: l,
|
|
370
389
|
onSelect: I,
|
|
371
390
|
initialFocus: !0,
|
|
372
391
|
fromYear: 2e3,
|
|
@@ -376,165 +395,209 @@ function de({
|
|
|
376
395
|
] })
|
|
377
396
|
] }),
|
|
378
397
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
379
|
-
/* @__PURE__ */ r.jsxs(
|
|
380
|
-
/* @__PURE__ */ r.jsx(Fe, { className: "w-32 bg-background", children: /* @__PURE__ */ r.jsx(
|
|
398
|
+
/* @__PURE__ */ r.jsxs(Re, { value: a, onValueChange: k, children: [
|
|
399
|
+
/* @__PURE__ */ r.jsx(Fe, { className: "w-32 bg-background", children: /* @__PURE__ */ r.jsx(Ce, {}) }),
|
|
381
400
|
/* @__PURE__ */ r.jsxs(_e, { children: [
|
|
382
|
-
/* @__PURE__ */ r.jsx(
|
|
383
|
-
/* @__PURE__ */ r.jsx(
|
|
384
|
-
/* @__PURE__ */ r.jsx(
|
|
401
|
+
/* @__PURE__ */ r.jsx(re, { value: "day", children: "Day" }),
|
|
402
|
+
/* @__PURE__ */ r.jsx(re, { value: "week", children: "Week" }),
|
|
403
|
+
/* @__PURE__ */ r.jsx(re, { value: "month", children: "Month" })
|
|
385
404
|
] })
|
|
386
405
|
] }),
|
|
387
|
-
|
|
388
|
-
/* @__PURE__ */ r.jsx(
|
|
406
|
+
p && /* @__PURE__ */ r.jsxs(G, { onClick: p, size: "sm", className: "gap-1", children: [
|
|
407
|
+
/* @__PURE__ */ r.jsx(we, { className: "h-4 w-4" }),
|
|
389
408
|
"New"
|
|
390
409
|
] })
|
|
391
410
|
] })
|
|
392
411
|
] }),
|
|
393
|
-
/* @__PURE__ */ r.jsxs("div", { className: "flex-1 overflow-auto", children: [
|
|
394
|
-
|
|
395
|
-
|
|
412
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex-1 overflow-auto", onTouchStart: j, onTouchEnd: A, children: [
|
|
413
|
+
a === "month" && /* @__PURE__ */ r.jsx(
|
|
414
|
+
Le,
|
|
396
415
|
{
|
|
397
|
-
date:
|
|
398
|
-
events:
|
|
399
|
-
onEventClick:
|
|
400
|
-
onDateClick:
|
|
416
|
+
date: l,
|
|
417
|
+
events: t,
|
|
418
|
+
onEventClick: m,
|
|
419
|
+
onDateClick: i,
|
|
420
|
+
onEventDrop: c
|
|
401
421
|
}
|
|
402
422
|
),
|
|
403
|
-
|
|
404
|
-
|
|
423
|
+
a === "week" && /* @__PURE__ */ r.jsx(
|
|
424
|
+
Ie,
|
|
405
425
|
{
|
|
406
|
-
date:
|
|
407
|
-
events:
|
|
408
|
-
|
|
409
|
-
|
|
426
|
+
date: l,
|
|
427
|
+
events: t,
|
|
428
|
+
locale: d,
|
|
429
|
+
onEventClick: m,
|
|
430
|
+
onDateClick: i
|
|
410
431
|
}
|
|
411
432
|
),
|
|
412
|
-
|
|
413
|
-
|
|
433
|
+
a === "day" && /* @__PURE__ */ r.jsx(
|
|
434
|
+
$e,
|
|
414
435
|
{
|
|
415
|
-
date:
|
|
416
|
-
events:
|
|
417
|
-
onEventClick:
|
|
436
|
+
date: l,
|
|
437
|
+
events: t,
|
|
438
|
+
onEventClick: m,
|
|
439
|
+
onDateClick: i
|
|
418
440
|
}
|
|
419
441
|
)
|
|
420
442
|
] })
|
|
421
443
|
] });
|
|
422
444
|
}
|
|
423
|
-
function
|
|
424
|
-
const n = new Date(
|
|
425
|
-
return n.setDate(
|
|
445
|
+
function me(t) {
|
|
446
|
+
const n = new Date(t), s = n.getDay(), d = n.getDate() - s;
|
|
447
|
+
return n.setDate(d), n;
|
|
426
448
|
}
|
|
427
|
-
function
|
|
428
|
-
const n =
|
|
429
|
-
for (let
|
|
430
|
-
const c = new Date(
|
|
431
|
-
c.setDate(c.getDate() - (
|
|
449
|
+
function Me(t) {
|
|
450
|
+
const n = t.getFullYear(), s = t.getMonth(), d = new Date(n, s, 1), m = new Date(n, s + 1, 0), i = d.getDay(), g = [];
|
|
451
|
+
for (let p = i - 1; p >= 0; p--) {
|
|
452
|
+
const c = new Date(d.getTime());
|
|
453
|
+
c.setDate(c.getDate() - (p + 1)), g.push(c);
|
|
432
454
|
}
|
|
433
|
-
for (let
|
|
434
|
-
|
|
435
|
-
const
|
|
436
|
-
for (let
|
|
437
|
-
const c = new Date(
|
|
438
|
-
c.setDate(c.getDate() +
|
|
455
|
+
for (let p = 1; p <= m.getDate(); p++)
|
|
456
|
+
g.push(new Date(n, s, p));
|
|
457
|
+
const u = 42 - g.length;
|
|
458
|
+
for (let p = 1; p <= u; p++) {
|
|
459
|
+
const c = new Date(m.getTime());
|
|
460
|
+
c.setDate(c.getDate() + p), g.push(c);
|
|
439
461
|
}
|
|
440
|
-
return
|
|
462
|
+
return g;
|
|
441
463
|
}
|
|
442
|
-
function
|
|
443
|
-
return
|
|
464
|
+
function ge(t, n) {
|
|
465
|
+
return t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
|
|
444
466
|
}
|
|
445
|
-
function
|
|
446
|
-
return n.filter((
|
|
447
|
-
const
|
|
448
|
-
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
return
|
|
467
|
+
function oe(t, n) {
|
|
468
|
+
return n.filter((s) => {
|
|
469
|
+
const d = new Date(s.start), m = s.end ? new Date(s.end) : new Date(d), i = new Date(t);
|
|
470
|
+
i.setHours(0, 0, 0, 0);
|
|
471
|
+
const g = new Date(t);
|
|
472
|
+
g.setHours(23, 59, 59, 999);
|
|
473
|
+
const u = new Date(d);
|
|
474
|
+
u.setHours(0, 0, 0, 0);
|
|
475
|
+
const p = new Date(m);
|
|
476
|
+
return p.setHours(23, 59, 59, 999), i <= p && g >= u;
|
|
455
477
|
});
|
|
456
478
|
}
|
|
457
|
-
function
|
|
458
|
-
const
|
|
479
|
+
function Le({ date: t, events: n, onEventClick: s, onDateClick: d, onEventDrop: m }) {
|
|
480
|
+
const i = Me(t), g = /* @__PURE__ */ new Date(), u = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], [p, c] = P.useState(null), [b, a] = P.useState(null), h = (x, N) => {
|
|
481
|
+
c(N.id), x.dataTransfer.effectAllowed = "move", x.dataTransfer.setData("text/plain", String(N.id));
|
|
482
|
+
}, l = () => {
|
|
483
|
+
c(null), a(null);
|
|
484
|
+
}, T = (x, N) => {
|
|
485
|
+
x.preventDefault(), x.dataTransfer.dropEffect = "move", a(N);
|
|
486
|
+
}, M = (x) => {
|
|
487
|
+
x.currentTarget.contains(x.relatedTarget) || a(null);
|
|
488
|
+
}, L = (x, N) => {
|
|
489
|
+
if (x.preventDefault(), a(null), c(null), !m) return;
|
|
490
|
+
const k = x.dataTransfer.getData("text/plain"), F = n.find((v) => String(v.id) === k);
|
|
491
|
+
if (!F) return;
|
|
492
|
+
const O = new Date(F.start), j = new Date(O);
|
|
493
|
+
j.setHours(0, 0, 0, 0);
|
|
494
|
+
const A = new Date(N);
|
|
495
|
+
A.setHours(0, 0, 0, 0);
|
|
496
|
+
const I = A.getTime() - j.getTime();
|
|
497
|
+
if (I === 0) return;
|
|
498
|
+
const o = new Date(O.getTime() + I);
|
|
499
|
+
let E;
|
|
500
|
+
F.end && (E = new Date(new Date(F.end).getTime() + I)), m(F, o, E);
|
|
501
|
+
};
|
|
459
502
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col h-full", children: [
|
|
460
|
-
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 border-b", children:
|
|
503
|
+
/* @__PURE__ */ r.jsx("div", { role: "row", className: "grid grid-cols-7 border-b", children: u.map((x) => /* @__PURE__ */ r.jsx(
|
|
461
504
|
"div",
|
|
462
505
|
{
|
|
506
|
+
role: "columnheader",
|
|
463
507
|
className: "p-2 text-center text-sm font-medium text-muted-foreground border-r last:border-r-0",
|
|
464
|
-
children:
|
|
508
|
+
children: x
|
|
465
509
|
},
|
|
466
|
-
|
|
510
|
+
x
|
|
467
511
|
)) }),
|
|
468
|
-
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 flex-1 auto-rows-fr", children:
|
|
469
|
-
const
|
|
512
|
+
/* @__PURE__ */ r.jsx("div", { role: "grid", "aria-label": "Calendar grid", className: "grid grid-cols-7 flex-1 auto-rows-fr", children: i.map((x, N) => {
|
|
513
|
+
const k = oe(x, n), F = x.getMonth() === t.getMonth(), O = ge(x, g);
|
|
470
514
|
return /* @__PURE__ */ r.jsxs(
|
|
471
515
|
"div",
|
|
472
516
|
{
|
|
473
|
-
|
|
517
|
+
role: "gridcell",
|
|
518
|
+
"aria-label": `${x.toLocaleDateString("default", { weekday: "long", month: "long", day: "numeric", year: "numeric" })}${k.length > 0 ? `, ${k.length} event${k.length > 1 ? "s" : ""}` : ""}`,
|
|
519
|
+
className: V(
|
|
474
520
|
"border-b border-r last:border-r-0 p-2 min-h-[100px] cursor-pointer hover:bg-accent/50",
|
|
475
|
-
!
|
|
521
|
+
!F && "bg-muted/30 text-muted-foreground",
|
|
522
|
+
b === N && "ring-2 ring-primary"
|
|
476
523
|
),
|
|
477
|
-
onClick: () =>
|
|
524
|
+
onClick: () => d?.(x),
|
|
525
|
+
onDragOver: (j) => T(j, N),
|
|
526
|
+
onDragLeave: M,
|
|
527
|
+
onDrop: (j) => L(j, x),
|
|
478
528
|
children: [
|
|
479
529
|
/* @__PURE__ */ r.jsx(
|
|
480
530
|
"div",
|
|
481
531
|
{
|
|
482
|
-
className:
|
|
532
|
+
className: V(
|
|
483
533
|
"text-sm font-medium mb-1",
|
|
484
|
-
|
|
534
|
+
O && "inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground h-6 w-6"
|
|
485
535
|
),
|
|
486
|
-
|
|
536
|
+
...O ? { "aria-current": "date" } : {},
|
|
537
|
+
children: x.getDate()
|
|
487
538
|
}
|
|
488
539
|
),
|
|
489
540
|
/* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
|
|
490
|
-
|
|
541
|
+
k.slice(0, 3).map((j) => /* @__PURE__ */ r.jsx(
|
|
491
542
|
"div",
|
|
492
543
|
{
|
|
493
|
-
|
|
544
|
+
role: "button",
|
|
545
|
+
"aria-label": j.title,
|
|
546
|
+
draggable: !!m,
|
|
547
|
+
onDragStart: (A) => h(A, j),
|
|
548
|
+
onDragEnd: l,
|
|
549
|
+
className: V(
|
|
494
550
|
"text-xs px-2 py-1 rounded truncate cursor-pointer hover:opacity-80",
|
|
495
|
-
|
|
551
|
+
j.color || le,
|
|
552
|
+
p === j.id && "opacity-50"
|
|
496
553
|
),
|
|
497
|
-
style:
|
|
498
|
-
onClick: (
|
|
499
|
-
|
|
554
|
+
style: j.color && j.color.startsWith("#") ? { backgroundColor: j.color } : void 0,
|
|
555
|
+
onClick: (A) => {
|
|
556
|
+
A.stopPropagation(), s?.(j);
|
|
500
557
|
},
|
|
501
|
-
children:
|
|
558
|
+
children: j.title
|
|
502
559
|
},
|
|
503
|
-
|
|
560
|
+
j.id
|
|
504
561
|
)),
|
|
505
|
-
|
|
562
|
+
k.length > 3 && /* @__PURE__ */ r.jsxs("div", { className: "text-xs text-muted-foreground px-2", children: [
|
|
506
563
|
"+",
|
|
507
|
-
|
|
564
|
+
k.length - 3,
|
|
508
565
|
" more"
|
|
509
566
|
] })
|
|
510
567
|
] })
|
|
511
568
|
]
|
|
512
569
|
},
|
|
513
|
-
|
|
570
|
+
N
|
|
514
571
|
);
|
|
515
572
|
}) })
|
|
516
573
|
] });
|
|
517
574
|
}
|
|
518
|
-
function
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
575
|
+
function Ie({ date: t, events: n, locale: s = "default", onEventClick: d, onDateClick: m }) {
|
|
576
|
+
const i = P.useRef(null), g = (a) => {
|
|
577
|
+
m && (i.current = setTimeout(() => {
|
|
578
|
+
m(a);
|
|
579
|
+
}, 500));
|
|
580
|
+
}, u = () => {
|
|
581
|
+
i.current && (clearTimeout(i.current), i.current = null);
|
|
582
|
+
}, p = me(t), c = Array.from({ length: 7 }, (a, h) => {
|
|
583
|
+
const l = new Date(p);
|
|
584
|
+
return l.setDate(l.getDate() + h), l;
|
|
585
|
+
}), b = /* @__PURE__ */ new Date();
|
|
523
586
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col h-full", children: [
|
|
524
|
-
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 border-b", children:
|
|
525
|
-
const
|
|
587
|
+
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 border-b", children: c.map((a) => {
|
|
588
|
+
const h = ge(a, b);
|
|
526
589
|
return /* @__PURE__ */ r.jsxs(
|
|
527
590
|
"div",
|
|
528
591
|
{
|
|
529
592
|
className: "p-3 text-center border-r last:border-r-0",
|
|
530
593
|
children: [
|
|
531
|
-
/* @__PURE__ */ r.jsx("div", { className: "text-sm font-medium text-muted-foreground", children: a.toLocaleDateString(
|
|
594
|
+
/* @__PURE__ */ r.jsx("div", { className: "text-sm font-medium text-muted-foreground", children: a.toLocaleDateString(s, { weekday: "short" }) }),
|
|
532
595
|
/* @__PURE__ */ r.jsx(
|
|
533
596
|
"div",
|
|
534
597
|
{
|
|
535
|
-
className:
|
|
598
|
+
className: V(
|
|
536
599
|
"text-lg font-semibold mt-1",
|
|
537
|
-
|
|
600
|
+
h && "inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground h-8 w-8"
|
|
538
601
|
),
|
|
539
602
|
children: a.getDate()
|
|
540
603
|
}
|
|
@@ -544,33 +607,39 @@ function Oe({ date: e, events: n, onEventClick: o, onDateClick: f }) {
|
|
|
544
607
|
a.toISOString()
|
|
545
608
|
);
|
|
546
609
|
}) }),
|
|
547
|
-
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 flex-1", children:
|
|
548
|
-
const
|
|
610
|
+
/* @__PURE__ */ r.jsx("div", { role: "grid", className: "grid grid-cols-7 flex-1", children: c.map((a) => {
|
|
611
|
+
const h = oe(a, n);
|
|
549
612
|
return /* @__PURE__ */ r.jsx(
|
|
550
613
|
"div",
|
|
551
614
|
{
|
|
615
|
+
role: "gridcell",
|
|
616
|
+
"aria-label": `${a.toLocaleDateString("default", { weekday: "long", month: "long", day: "numeric", year: "numeric" })}${h.length > 0 ? `, ${h.length} event${h.length > 1 ? "s" : ""}` : ""}`,
|
|
552
617
|
className: "border-r last:border-r-0 p-2 min-h-[400px] cursor-pointer hover:bg-accent/50",
|
|
553
|
-
onClick: () =>
|
|
554
|
-
|
|
618
|
+
onClick: () => m?.(a),
|
|
619
|
+
onTouchStart: () => g(a),
|
|
620
|
+
onTouchEnd: u,
|
|
621
|
+
children: /* @__PURE__ */ r.jsx("div", { className: "space-y-2", children: h.map((l) => /* @__PURE__ */ r.jsxs(
|
|
555
622
|
"div",
|
|
556
623
|
{
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
624
|
+
role: "button",
|
|
625
|
+
"aria-label": l.title,
|
|
626
|
+
className: V(
|
|
627
|
+
"text-xs sm:text-sm px-2 sm:px-3 py-1.5 sm:py-2 rounded cursor-pointer hover:opacity-80",
|
|
628
|
+
l.color || le
|
|
560
629
|
),
|
|
561
|
-
style:
|
|
562
|
-
onClick: (
|
|
563
|
-
|
|
630
|
+
style: l.color && l.color.startsWith("#") ? { backgroundColor: l.color } : void 0,
|
|
631
|
+
onClick: (T) => {
|
|
632
|
+
T.stopPropagation(), d?.(l);
|
|
564
633
|
},
|
|
565
634
|
children: [
|
|
566
|
-
/* @__PURE__ */ r.jsx("div", { className: "font-medium", children:
|
|
567
|
-
!
|
|
635
|
+
/* @__PURE__ */ r.jsx("div", { className: "font-medium truncate", children: l.title }),
|
|
636
|
+
!l.allDay && /* @__PURE__ */ r.jsx("div", { className: "text-xs opacity-90 mt-1", children: l.start.toLocaleTimeString("default", {
|
|
568
637
|
hour: "numeric",
|
|
569
638
|
minute: "2-digit"
|
|
570
639
|
}) })
|
|
571
640
|
]
|
|
572
641
|
},
|
|
573
|
-
|
|
642
|
+
l.id
|
|
574
643
|
)) })
|
|
575
644
|
},
|
|
576
645
|
a.toISOString()
|
|
@@ -578,210 +647,286 @@ function Oe({ date: e, events: n, onEventClick: o, onDateClick: f }) {
|
|
|
578
647
|
}) })
|
|
579
648
|
] });
|
|
580
649
|
}
|
|
581
|
-
function
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
650
|
+
function $e({ date: t, events: n, onEventClick: s, onDateClick: d }) {
|
|
651
|
+
const m = oe(t, n), i = Array.from({ length: 24 }, (c, b) => b), g = P.useRef(null), u = (c) => {
|
|
652
|
+
d && (g.current = setTimeout(() => {
|
|
653
|
+
const b = new Date(t);
|
|
654
|
+
b.setHours(c, 0, 0, 0), d(b);
|
|
655
|
+
}, 500));
|
|
656
|
+
}, p = () => {
|
|
657
|
+
g.current && (clearTimeout(g.current), g.current = null);
|
|
658
|
+
};
|
|
659
|
+
return /* @__PURE__ */ r.jsx("div", { className: "flex flex-col h-full", children: /* @__PURE__ */ r.jsx("div", { role: "list", className: "flex-1 overflow-auto", children: i.map((c) => {
|
|
660
|
+
const b = m.filter((a) => a.allDay ? c === 0 : a.start.getHours() === c);
|
|
661
|
+
return /* @__PURE__ */ r.jsxs("div", { role: "listitem", className: "flex border-b min-h-[60px]", children: [
|
|
662
|
+
/* @__PURE__ */ r.jsx("div", { className: "w-20 p-2 text-sm text-muted-foreground border-r", children: c === 0 ? "12 AM" : c < 12 ? `${c} AM` : c === 12 ? "12 PM" : `${c - 12} PM` }),
|
|
663
|
+
/* @__PURE__ */ r.jsx(
|
|
588
664
|
"div",
|
|
589
665
|
{
|
|
590
|
-
className:
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
)
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
666
|
+
className: "flex-1 p-2 space-y-2",
|
|
667
|
+
onTouchStart: () => u(c),
|
|
668
|
+
onTouchEnd: p,
|
|
669
|
+
children: b.map((a) => /* @__PURE__ */ r.jsxs(
|
|
670
|
+
"div",
|
|
671
|
+
{
|
|
672
|
+
"aria-label": a.title,
|
|
673
|
+
className: V(
|
|
674
|
+
"px-2 sm:px-3 py-1.5 sm:py-2 rounded cursor-pointer hover:opacity-80",
|
|
675
|
+
a.color || le
|
|
676
|
+
),
|
|
677
|
+
style: a.color && a.color.startsWith("#") ? { backgroundColor: a.color } : void 0,
|
|
678
|
+
onClick: () => s?.(a),
|
|
679
|
+
children: [
|
|
680
|
+
/* @__PURE__ */ r.jsx("div", { className: "font-medium truncate", children: a.title }),
|
|
681
|
+
!a.allDay && /* @__PURE__ */ r.jsxs("div", { className: "text-xs opacity-90 mt-1", children: [
|
|
682
|
+
a.start.toLocaleTimeString("default", {
|
|
683
|
+
hour: "numeric",
|
|
684
|
+
minute: "2-digit"
|
|
685
|
+
}),
|
|
686
|
+
a.end && ` - ${a.end.toLocaleTimeString("default", {
|
|
687
|
+
hour: "numeric",
|
|
688
|
+
minute: "2-digit"
|
|
689
|
+
})}`
|
|
690
|
+
] })
|
|
691
|
+
]
|
|
692
|
+
},
|
|
693
|
+
a.id
|
|
694
|
+
))
|
|
695
|
+
}
|
|
696
|
+
)
|
|
697
|
+
] }, c);
|
|
613
698
|
}) }) });
|
|
614
699
|
}
|
|
615
|
-
function
|
|
616
|
-
|
|
700
|
+
function Ye(t) {
|
|
701
|
+
const { onRefresh: n, threshold: s = 80, enabled: d = !0 } = t, m = se(null), [i, g] = $(!1), [u, p] = $(0), c = se(0), b = Q((l) => {
|
|
702
|
+
if (!d || i)
|
|
703
|
+
return;
|
|
704
|
+
const T = m.current;
|
|
705
|
+
T && T.scrollTop === 0 && (c.current = l.touches[0].clientY);
|
|
706
|
+
}, [d, i]), a = Q((l) => {
|
|
707
|
+
if (!d || i || !c.current)
|
|
708
|
+
return;
|
|
709
|
+
const M = l.touches[0].clientY - c.current;
|
|
710
|
+
M > 0 && p(Math.min(M, s * 1.5));
|
|
711
|
+
}, [d, i, s]), h = Q(async () => {
|
|
712
|
+
if (!(!d || i)) {
|
|
713
|
+
if (u >= s) {
|
|
714
|
+
g(!0);
|
|
715
|
+
try {
|
|
716
|
+
await n();
|
|
717
|
+
} finally {
|
|
718
|
+
g(!1);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
p(0), c.current = 0;
|
|
722
|
+
}
|
|
723
|
+
}, [d, i, u, s, n]);
|
|
724
|
+
return ae(() => {
|
|
725
|
+
const l = m.current;
|
|
726
|
+
if (!(!l || !d))
|
|
727
|
+
return l.addEventListener("touchstart", b, { passive: !0 }), l.addEventListener("touchmove", a, { passive: !0 }), l.addEventListener("touchend", h, { passive: !0 }), () => {
|
|
728
|
+
l.removeEventListener("touchstart", b), l.removeEventListener("touchmove", a), l.removeEventListener("touchend", h);
|
|
729
|
+
};
|
|
730
|
+
}, [b, a, h, d]), { ref: m, isRefreshing: i, pullDistance: u };
|
|
731
|
+
}
|
|
732
|
+
const Ve = xe(null);
|
|
733
|
+
Ve.displayName = "MobileContext";
|
|
734
|
+
function We(t) {
|
|
735
|
+
return "data" in t && t.data ? t.data : "staticData" in t && t.staticData ? {
|
|
617
736
|
provider: "value",
|
|
618
|
-
items:
|
|
619
|
-
} :
|
|
737
|
+
items: t.staticData
|
|
738
|
+
} : t.objectName ? {
|
|
620
739
|
provider: "object",
|
|
621
|
-
object:
|
|
740
|
+
object: t.objectName
|
|
622
741
|
} : null;
|
|
623
742
|
}
|
|
624
|
-
function
|
|
625
|
-
if (
|
|
626
|
-
if (typeof
|
|
627
|
-
const n =
|
|
628
|
-
return { [
|
|
743
|
+
function He(t) {
|
|
744
|
+
if (t) {
|
|
745
|
+
if (typeof t == "string") {
|
|
746
|
+
const n = t.split(" "), s = n[0], d = n[1]?.toLowerCase() === "desc" ? "desc" : "asc";
|
|
747
|
+
return { [s]: d };
|
|
629
748
|
}
|
|
630
|
-
if (Array.isArray(
|
|
631
|
-
return
|
|
749
|
+
if (Array.isArray(t))
|
|
750
|
+
return t.reduce((n, s) => (s.field && s.order && (n[s.field] = s.order), n), {});
|
|
632
751
|
}
|
|
633
752
|
}
|
|
634
|
-
function
|
|
635
|
-
return "filter" in
|
|
636
|
-
startDateField:
|
|
637
|
-
endDateField:
|
|
638
|
-
titleField:
|
|
639
|
-
colorField:
|
|
640
|
-
allDayField:
|
|
753
|
+
function Ue(t) {
|
|
754
|
+
return "filter" in t && t.filter && typeof t.filter == "object" && "calendar" in t.filter ? t.filter.calendar : t.calendar ? t.calendar : t.startDateField || t.dateField ? {
|
|
755
|
+
startDateField: t.startDateField || t.dateField,
|
|
756
|
+
endDateField: t.endDateField || t.endField,
|
|
757
|
+
titleField: t.titleField || "name",
|
|
758
|
+
colorField: t.colorField,
|
|
759
|
+
allDayField: t.allDayField
|
|
641
760
|
} : null;
|
|
642
761
|
}
|
|
643
|
-
const
|
|
644
|
-
schema:
|
|
762
|
+
const qe = ({
|
|
763
|
+
schema: t,
|
|
645
764
|
dataSource: n,
|
|
646
|
-
className:
|
|
647
|
-
onEventClick:
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
765
|
+
className: s,
|
|
766
|
+
onEventClick: d,
|
|
767
|
+
onRowClick: m,
|
|
768
|
+
onDateClick: i,
|
|
769
|
+
onNavigate: g,
|
|
770
|
+
onViewChange: u,
|
|
771
|
+
...p
|
|
652
772
|
}) => {
|
|
653
|
-
const [
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
773
|
+
const [c, b] = $([]), [a, h] = $(!0), [l, T] = $(null), [M, L] = $(null), [x, N] = $(/* @__PURE__ */ new Date()), [k, F] = $("month"), [O, j] = $(0), A = Q(async () => {
|
|
774
|
+
j((D) => D + 1);
|
|
775
|
+
}, []), { ref: I, isRefreshing: o, pullDistance: E } = Ye({
|
|
776
|
+
onRefresh: A,
|
|
777
|
+
enabled: !!n && !!t.objectName
|
|
778
|
+
}), v = te(() => We(t), [
|
|
779
|
+
t.data,
|
|
780
|
+
t.staticData,
|
|
781
|
+
t.objectName
|
|
782
|
+
]), Y = te(() => Ue(t), [
|
|
783
|
+
t.filter,
|
|
784
|
+
t.calendar,
|
|
785
|
+
t.dateField,
|
|
786
|
+
t.endField,
|
|
787
|
+
t.titleField,
|
|
788
|
+
t.colorField
|
|
789
|
+
]), W = v?.provider === "value";
|
|
790
|
+
ae(() => {
|
|
791
|
+
let D = !0;
|
|
667
792
|
return (async () => {
|
|
668
793
|
try {
|
|
669
|
-
if (!
|
|
670
|
-
if (h(!0),
|
|
671
|
-
|
|
794
|
+
if (!D) return;
|
|
795
|
+
if (h(!0), W && v?.provider === "value") {
|
|
796
|
+
D && (b(v.items), h(!1));
|
|
672
797
|
return;
|
|
673
798
|
}
|
|
674
|
-
if (
|
|
675
|
-
const
|
|
676
|
-
if (Array.isArray(
|
|
677
|
-
|
|
799
|
+
if (t.data || p.data) {
|
|
800
|
+
const R = t.data || p.data;
|
|
801
|
+
if (Array.isArray(R)) {
|
|
802
|
+
b(R), h(!1);
|
|
678
803
|
return;
|
|
679
804
|
}
|
|
680
805
|
}
|
|
681
806
|
if (!n)
|
|
682
807
|
throw new Error("DataSource required for object/api providers");
|
|
683
|
-
if (
|
|
684
|
-
const
|
|
685
|
-
$filter:
|
|
686
|
-
$orderby:
|
|
808
|
+
if (v?.provider === "object") {
|
|
809
|
+
const R = v.object, _ = await n.find(R, {
|
|
810
|
+
$filter: t.filter,
|
|
811
|
+
$orderby: He(t.sort)
|
|
687
812
|
});
|
|
688
|
-
let
|
|
689
|
-
Array.isArray(
|
|
690
|
-
} else
|
|
691
|
-
|
|
692
|
-
} catch (
|
|
693
|
-
console.error("[ObjectCalendar] Error fetching data:",
|
|
813
|
+
let e = [];
|
|
814
|
+
Array.isArray(_) ? e = _ : _ && typeof _ == "object" && (Array.isArray(_.data) ? e = _.data : Array.isArray(_.value) && (e = _.value)), D && b(e);
|
|
815
|
+
} else v?.provider === "api" && (console.warn("API provider not yet implemented for ObjectCalendar"), D && b([]));
|
|
816
|
+
D && h(!1);
|
|
817
|
+
} catch (R) {
|
|
818
|
+
console.error("[ObjectCalendar] Error fetching data:", R), D && (T(R), h(!1));
|
|
694
819
|
}
|
|
695
820
|
})(), () => {
|
|
696
|
-
|
|
821
|
+
D = !1;
|
|
697
822
|
};
|
|
698
|
-
}, [
|
|
699
|
-
!
|
|
823
|
+
}, [v, n, W, t.filter, t.sort, O]), ae(() => {
|
|
824
|
+
!W && n && (async () => {
|
|
700
825
|
try {
|
|
701
826
|
if (!n) return;
|
|
702
|
-
const
|
|
703
|
-
if (!
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
} catch (
|
|
707
|
-
console.error("Failed to fetch object schema:",
|
|
827
|
+
const C = v?.provider === "object" ? v.object : t.objectName;
|
|
828
|
+
if (!C) return;
|
|
829
|
+
const R = await n.getObjectSchema(C);
|
|
830
|
+
L(R);
|
|
831
|
+
} catch (C) {
|
|
832
|
+
console.error("Failed to fetch object schema:", C);
|
|
708
833
|
}
|
|
709
834
|
})();
|
|
710
|
-
}, [
|
|
711
|
-
const
|
|
712
|
-
if (!
|
|
835
|
+
}, [t.objectName, n, W, v]);
|
|
836
|
+
const K = te(() => {
|
|
837
|
+
if (!Y || !c.length)
|
|
713
838
|
return [];
|
|
714
|
-
const { startDateField:
|
|
715
|
-
return
|
|
716
|
-
const
|
|
839
|
+
const { startDateField: D, endDateField: C, titleField: R, colorField: _ } = Y;
|
|
840
|
+
return c.map((e, f) => {
|
|
841
|
+
const y = e[D], w = C ? e[C] : null, U = e[R] || "Untitled", J = _ ? e[_] : void 0;
|
|
717
842
|
return {
|
|
718
|
-
id:
|
|
719
|
-
title:
|
|
720
|
-
start:
|
|
721
|
-
end:
|
|
722
|
-
color:
|
|
723
|
-
allDay: !
|
|
843
|
+
id: e.id || e._id || `event-${f}`,
|
|
844
|
+
title: U,
|
|
845
|
+
start: y ? new Date(y) : /* @__PURE__ */ new Date(),
|
|
846
|
+
end: w ? new Date(w) : void 0,
|
|
847
|
+
color: J,
|
|
848
|
+
allDay: !w,
|
|
724
849
|
// If no end date, treat as all-day event
|
|
725
|
-
data:
|
|
850
|
+
data: e
|
|
726
851
|
};
|
|
727
|
-
}).filter((
|
|
728
|
-
}, [
|
|
729
|
-
|
|
730
|
-
}, [
|
|
731
|
-
|
|
852
|
+
}).filter((e) => !isNaN(e.start.getTime()));
|
|
853
|
+
}, [c, Y]), z = Q(() => {
|
|
854
|
+
i?.(/* @__PURE__ */ new Date());
|
|
855
|
+
}, [i]), H = De({
|
|
856
|
+
navigation: t.navigation,
|
|
857
|
+
objectName: t.objectName,
|
|
858
|
+
onRowClick: m
|
|
859
|
+
});
|
|
860
|
+
return a ? /* @__PURE__ */ r.jsx("div", { className: s, children: /* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ r.jsx("div", { className: "text-muted-foreground", children: "Loading calendar..." }) }) }) : l ? /* @__PURE__ */ r.jsx("div", { className: s, children: /* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ r.jsxs("div", { className: "text-destructive", children: [
|
|
732
861
|
"Error: ",
|
|
733
|
-
|
|
734
|
-
] }) }) }) :
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
862
|
+
l.message
|
|
863
|
+
] }) }) }) : Y ? /* @__PURE__ */ r.jsxs("div", { ref: I, className: s, children: [
|
|
864
|
+
E > 0 && /* @__PURE__ */ r.jsx(
|
|
865
|
+
"div",
|
|
866
|
+
{
|
|
867
|
+
className: "flex items-center justify-center text-xs text-muted-foreground",
|
|
868
|
+
style: { height: E },
|
|
869
|
+
children: o ? "Refreshing…" : "Pull to refresh"
|
|
870
|
+
}
|
|
871
|
+
),
|
|
872
|
+
/* @__PURE__ */ r.jsx("div", { className: "border rounded-lg bg-background h-[calc(100vh-120px)] sm:h-[calc(100vh-160px)] md:h-[calc(100vh-200px)] min-h-[400px] sm:min-h-[600px]", children: /* @__PURE__ */ r.jsx(
|
|
873
|
+
fe,
|
|
874
|
+
{
|
|
875
|
+
events: K,
|
|
876
|
+
currentDate: x,
|
|
877
|
+
view: t.defaultView || "month",
|
|
878
|
+
onEventClick: (D) => {
|
|
879
|
+
H.handleClick(D.data), d?.(D.data);
|
|
880
|
+
},
|
|
881
|
+
onDateClick: i,
|
|
882
|
+
onNavigate: (D) => {
|
|
883
|
+
N(D), g?.(D);
|
|
884
|
+
},
|
|
885
|
+
onViewChange: (D) => {
|
|
886
|
+
F(D), u?.(D);
|
|
887
|
+
},
|
|
888
|
+
onAddClick: z
|
|
889
|
+
}
|
|
890
|
+
) }),
|
|
891
|
+
H.isOverlay && /* @__PURE__ */ r.jsx(ke, { ...H, title: "Event Details", children: (D) => /* @__PURE__ */ r.jsx("div", { className: "space-y-3", children: Object.entries(D).map(([C, R]) => /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col", children: [
|
|
892
|
+
/* @__PURE__ */ r.jsx("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: C.replace(/_/g, " ") }),
|
|
893
|
+
/* @__PURE__ */ r.jsx("span", { className: "text-sm", children: String(R ?? "—") })
|
|
894
|
+
] }, C)) }) })
|
|
895
|
+
] }) : /* @__PURE__ */ r.jsx("div", { className: s, children: /* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ r.jsx("div", { className: "text-muted-foreground", children: "Calendar configuration required. Please specify startDateField and titleField." }) }) });
|
|
751
896
|
};
|
|
752
|
-
|
|
897
|
+
ne.register(
|
|
753
898
|
"calendar-view",
|
|
754
|
-
({ schema:
|
|
755
|
-
const
|
|
756
|
-
const c =
|
|
899
|
+
({ schema: t, className: n, onAction: s, ...d }) => {
|
|
900
|
+
const m = ue.useMemo(() => !t.data || !Array.isArray(t.data) ? [] : t.data.map((u, p) => {
|
|
901
|
+
const c = t.titleField || "title", b = t.startDateField || "start", a = t.endDateField || "end", h = t.colorField || "color", l = t.allDayField || "allDay";
|
|
757
902
|
return {
|
|
758
|
-
id:
|
|
759
|
-
title:
|
|
760
|
-
start: new Date(
|
|
761
|
-
end: a
|
|
762
|
-
allDay:
|
|
763
|
-
color:
|
|
764
|
-
data:
|
|
903
|
+
id: u._id || u.id || p,
|
|
904
|
+
title: u[c] || "Untitled Event",
|
|
905
|
+
start: new Date(u[b]),
|
|
906
|
+
end: u[a] ? new Date(u[a]) : void 0,
|
|
907
|
+
allDay: u[l],
|
|
908
|
+
color: u[h],
|
|
909
|
+
data: u
|
|
765
910
|
};
|
|
766
|
-
}), [
|
|
767
|
-
|
|
911
|
+
}), [t.data, t.titleField, t.startDateField, t.endDateField, t.colorField, t.allDayField]), i = (u) => {
|
|
912
|
+
t.onEventClick && s?.({
|
|
768
913
|
type: "event-click",
|
|
769
|
-
payload:
|
|
914
|
+
payload: u
|
|
770
915
|
});
|
|
771
|
-
},
|
|
772
|
-
|
|
916
|
+
}, g = () => {
|
|
917
|
+
s?.({
|
|
773
918
|
type: "create",
|
|
774
919
|
payload: {}
|
|
775
920
|
});
|
|
776
921
|
};
|
|
777
922
|
return /* @__PURE__ */ r.jsx(
|
|
778
|
-
|
|
923
|
+
fe,
|
|
779
924
|
{
|
|
780
925
|
className: n,
|
|
781
|
-
events:
|
|
782
|
-
onEventClick:
|
|
783
|
-
onAddClick:
|
|
784
|
-
...
|
|
926
|
+
events: m,
|
|
927
|
+
onEventClick: i,
|
|
928
|
+
onAddClick: g,
|
|
929
|
+
...d
|
|
785
930
|
}
|
|
786
931
|
);
|
|
787
932
|
},
|
|
@@ -896,11 +1041,11 @@ ee.register(
|
|
|
896
1041
|
}
|
|
897
1042
|
}
|
|
898
1043
|
);
|
|
899
|
-
const
|
|
900
|
-
const { dataSource: n } =
|
|
901
|
-
return /* @__PURE__ */ r.jsx(
|
|
1044
|
+
const pe = ({ schema: t }) => {
|
|
1045
|
+
const { dataSource: n } = be();
|
|
1046
|
+
return /* @__PURE__ */ r.jsx(qe, { schema: t, dataSource: n });
|
|
902
1047
|
};
|
|
903
|
-
|
|
1048
|
+
ne.register("object-calendar", pe, {
|
|
904
1049
|
namespace: "plugin-calendar",
|
|
905
1050
|
label: "Object Calendar",
|
|
906
1051
|
category: "view",
|
|
@@ -909,7 +1054,7 @@ ee.register("object-calendar", me, {
|
|
|
909
1054
|
{ name: "calendar", type: "object", label: "Calendar Config", description: "startDateField, endDateField, titleField, colorField" }
|
|
910
1055
|
]
|
|
911
1056
|
});
|
|
912
|
-
|
|
1057
|
+
ne.register("calendar", pe, {
|
|
913
1058
|
namespace: "view",
|
|
914
1059
|
label: "Calendar View",
|
|
915
1060
|
category: "view",
|
|
@@ -919,7 +1064,7 @@ ee.register("calendar", me, {
|
|
|
919
1064
|
]
|
|
920
1065
|
});
|
|
921
1066
|
export {
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1067
|
+
fe as CalendarView,
|
|
1068
|
+
qe as ObjectCalendar,
|
|
1069
|
+
pe as ObjectCalendarRenderer
|
|
925
1070
|
};
|