@object-ui/plugin-calendar 0.5.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 +11 -6
- package/CHANGELOG.md +37 -0
- package/dist/index.js +640 -485
- package/dist/index.umd.cjs +2 -2
- package/dist/src/CalendarView.d.ts +3 -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.test.tsx +6 -6
- package/src/CalendarView.tsx +185 -23
- package/src/ObjectCalendar.msw.test.tsx +8 -4
- 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/src/index.tsx +11 -1
package/dist/index.js
CHANGED
|
@@ -1,372 +1,392 @@
|
|
|
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
|
-
),
|
|
56
|
+
), e.$$typeof) {
|
|
57
57
|
case M:
|
|
58
58
|
return "Portal";
|
|
59
|
-
case
|
|
60
|
-
return
|
|
61
|
-
case c:
|
|
62
|
-
return (t._context.displayName || "Context") + ".Consumer";
|
|
59
|
+
case F:
|
|
60
|
+
return e.displayName || "Context";
|
|
63
61
|
case k:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return
|
|
68
|
-
case
|
|
69
|
-
|
|
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;
|
|
66
|
+
case I:
|
|
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
|
|
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
|
|
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
|
|
212
|
-
),
|
|
213
|
-
|
|
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
|
+
), c(
|
|
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
|
|
241
|
-
return
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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
|
+
return b(
|
|
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
|
|
251
|
-
return
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
249
|
+
}, B.jsxs = function(e, f, y) {
|
|
250
|
+
var w = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
251
|
+
return b(
|
|
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:
|
|
271
|
+
currentDate: s = /* @__PURE__ */ new Date(),
|
|
272
|
+
locale: d = "default",
|
|
272
273
|
onEventClick: m,
|
|
273
|
-
onDateClick:
|
|
274
|
-
onViewChange:
|
|
275
|
-
onNavigate:
|
|
276
|
-
onAddClick:
|
|
277
|
-
|
|
274
|
+
onDateClick: i,
|
|
275
|
+
onViewChange: g,
|
|
276
|
+
onNavigate: u,
|
|
277
|
+
onAddClick: p,
|
|
278
|
+
onEventDrop: c,
|
|
279
|
+
className: b
|
|
278
280
|
}) {
|
|
279
|
-
const [
|
|
280
|
-
|
|
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(() => {
|
|
285
|
+
h(n);
|
|
284
286
|
}, [n]);
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
},
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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, {
|
|
299
308
|
month: "long",
|
|
300
309
|
year: "numeric"
|
|
301
310
|
});
|
|
302
|
-
if (
|
|
303
|
-
const
|
|
304
|
-
return
|
|
311
|
+
if (a === "week") {
|
|
312
|
+
const o = me(l), E = new Date(o);
|
|
313
|
+
return E.setDate(E.getDate() + 6), `${o.toLocaleDateString(d, {
|
|
305
314
|
month: "short",
|
|
306
315
|
day: "numeric"
|
|
307
|
-
})} - ${
|
|
316
|
+
})} - ${E.toLocaleDateString(d, {
|
|
308
317
|
month: "short",
|
|
309
318
|
day: "numeric",
|
|
310
319
|
year: "numeric"
|
|
311
320
|
})}`;
|
|
312
321
|
} else
|
|
313
|
-
return
|
|
322
|
+
return l.toLocaleDateString(d, {
|
|
314
323
|
weekday: "long",
|
|
315
324
|
month: "long",
|
|
316
325
|
day: "numeric",
|
|
317
326
|
year: "numeric"
|
|
318
327
|
});
|
|
319
|
-
},
|
|
320
|
-
|
|
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));
|
|
321
338
|
};
|
|
322
|
-
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: [
|
|
323
340
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-between p-4 border-b", children: [
|
|
324
341
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
325
342
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center bg-muted/50 rounded-lg p-1 gap-1", children: [
|
|
326
|
-
/* @__PURE__ */ r.jsx(
|
|
343
|
+
/* @__PURE__ */ r.jsx(G, { variant: "ghost", size: "sm", onClick: N, className: "h-8", "aria-label": "Go to today", children: "Today" }),
|
|
327
344
|
/* @__PURE__ */ r.jsx("div", { className: "h-4 w-px bg-border mx-1" }),
|
|
328
345
|
/* @__PURE__ */ r.jsx(
|
|
329
|
-
|
|
346
|
+
G,
|
|
330
347
|
{
|
|
331
348
|
variant: "ghost",
|
|
332
349
|
size: "icon",
|
|
333
|
-
|
|
350
|
+
"aria-label": "Previous period",
|
|
351
|
+
onClick: L,
|
|
334
352
|
className: "h-8 w-8",
|
|
335
|
-
children: /* @__PURE__ */ r.jsx(
|
|
353
|
+
children: /* @__PURE__ */ r.jsx(ve, { className: "h-4 w-4" })
|
|
336
354
|
}
|
|
337
355
|
),
|
|
338
356
|
/* @__PURE__ */ r.jsx(
|
|
339
|
-
|
|
357
|
+
G,
|
|
340
358
|
{
|
|
341
359
|
variant: "ghost",
|
|
342
360
|
size: "icon",
|
|
343
|
-
|
|
361
|
+
"aria-label": "Next period",
|
|
362
|
+
onClick: x,
|
|
344
363
|
className: "h-8 w-8",
|
|
345
|
-
children: /* @__PURE__ */ r.jsx(
|
|
364
|
+
children: /* @__PURE__ */ r.jsx(ye, { className: "h-4 w-4" })
|
|
346
365
|
}
|
|
347
366
|
)
|
|
348
367
|
] }),
|
|
349
|
-
/* @__PURE__ */ r.jsxs(
|
|
350
|
-
/* @__PURE__ */ r.jsx(
|
|
351
|
-
|
|
368
|
+
/* @__PURE__ */ r.jsxs(Ee, { children: [
|
|
369
|
+
/* @__PURE__ */ r.jsx(Te, { asChild: !0, children: /* @__PURE__ */ r.jsxs(
|
|
370
|
+
G,
|
|
352
371
|
{
|
|
353
372
|
variant: "ghost",
|
|
354
|
-
|
|
373
|
+
"aria-label": `Current date: ${F()}`,
|
|
374
|
+
className: V(
|
|
355
375
|
"text-xl font-semibold h-auto px-3 py-1 hover:bg-muted/50 transition-colors",
|
|
356
376
|
"flex items-center gap-2"
|
|
357
377
|
),
|
|
358
378
|
children: [
|
|
359
|
-
/* @__PURE__ */ r.jsx(
|
|
360
|
-
/* @__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() })
|
|
361
381
|
]
|
|
362
382
|
}
|
|
363
383
|
) }),
|
|
364
|
-
/* @__PURE__ */ r.jsx(
|
|
365
|
-
|
|
384
|
+
/* @__PURE__ */ r.jsx(Se, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ r.jsx(
|
|
385
|
+
Ne,
|
|
366
386
|
{
|
|
367
387
|
mode: "single",
|
|
368
|
-
selected:
|
|
369
|
-
onSelect:
|
|
388
|
+
selected: l,
|
|
389
|
+
onSelect: I,
|
|
370
390
|
initialFocus: !0,
|
|
371
391
|
fromYear: 2e3,
|
|
372
392
|
toYear: 2050
|
|
@@ -375,165 +395,209 @@ function de({
|
|
|
375
395
|
] })
|
|
376
396
|
] }),
|
|
377
397
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
378
|
-
/* @__PURE__ */ r.jsxs(
|
|
379
|
-
/* @__PURE__ */ r.jsx(
|
|
380
|
-
/* @__PURE__ */ r.jsxs(
|
|
381
|
-
/* @__PURE__ */ r.jsx(
|
|
382
|
-
/* @__PURE__ */ r.jsx(
|
|
383
|
-
/* @__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, {}) }),
|
|
400
|
+
/* @__PURE__ */ r.jsxs(_e, { children: [
|
|
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" })
|
|
384
404
|
] })
|
|
385
405
|
] }),
|
|
386
|
-
|
|
387
|
-
/* @__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" }),
|
|
388
408
|
"New"
|
|
389
409
|
] })
|
|
390
410
|
] })
|
|
391
411
|
] }),
|
|
392
|
-
/* @__PURE__ */ r.jsxs("div", { className: "flex-1 overflow-auto", children: [
|
|
393
|
-
|
|
394
|
-
|
|
412
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex-1 overflow-auto", onTouchStart: j, onTouchEnd: A, children: [
|
|
413
|
+
a === "month" && /* @__PURE__ */ r.jsx(
|
|
414
|
+
Le,
|
|
395
415
|
{
|
|
396
|
-
date:
|
|
397
|
-
events:
|
|
416
|
+
date: l,
|
|
417
|
+
events: t,
|
|
398
418
|
onEventClick: m,
|
|
399
|
-
onDateClick:
|
|
419
|
+
onDateClick: i,
|
|
420
|
+
onEventDrop: c
|
|
400
421
|
}
|
|
401
422
|
),
|
|
402
|
-
|
|
403
|
-
|
|
423
|
+
a === "week" && /* @__PURE__ */ r.jsx(
|
|
424
|
+
Ie,
|
|
404
425
|
{
|
|
405
|
-
date:
|
|
406
|
-
events:
|
|
426
|
+
date: l,
|
|
427
|
+
events: t,
|
|
428
|
+
locale: d,
|
|
407
429
|
onEventClick: m,
|
|
408
|
-
onDateClick:
|
|
430
|
+
onDateClick: i
|
|
409
431
|
}
|
|
410
432
|
),
|
|
411
|
-
|
|
412
|
-
|
|
433
|
+
a === "day" && /* @__PURE__ */ r.jsx(
|
|
434
|
+
$e,
|
|
413
435
|
{
|
|
414
|
-
date:
|
|
415
|
-
events:
|
|
416
|
-
onEventClick: m
|
|
436
|
+
date: l,
|
|
437
|
+
events: t,
|
|
438
|
+
onEventClick: m,
|
|
439
|
+
onDateClick: i
|
|
417
440
|
}
|
|
418
441
|
)
|
|
419
442
|
] })
|
|
420
443
|
] });
|
|
421
444
|
}
|
|
422
|
-
function
|
|
423
|
-
const n = new Date(
|
|
424
|
-
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;
|
|
425
448
|
}
|
|
426
|
-
function
|
|
427
|
-
const n =
|
|
428
|
-
for (let
|
|
429
|
-
const
|
|
430
|
-
|
|
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);
|
|
431
454
|
}
|
|
432
|
-
for (let
|
|
433
|
-
|
|
434
|
-
const
|
|
435
|
-
for (let
|
|
436
|
-
const
|
|
437
|
-
|
|
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);
|
|
438
461
|
}
|
|
439
|
-
return
|
|
462
|
+
return g;
|
|
440
463
|
}
|
|
441
|
-
function
|
|
442
|
-
return
|
|
464
|
+
function ge(t, n) {
|
|
465
|
+
return t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
|
|
443
466
|
}
|
|
444
|
-
function
|
|
445
|
-
return n.filter((
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
const
|
|
451
|
-
|
|
452
|
-
const
|
|
453
|
-
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;
|
|
454
477
|
});
|
|
455
478
|
}
|
|
456
|
-
function
|
|
457
|
-
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
|
+
};
|
|
458
502
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col h-full", children: [
|
|
459
|
-
/* @__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(
|
|
460
504
|
"div",
|
|
461
505
|
{
|
|
506
|
+
role: "columnheader",
|
|
462
507
|
className: "p-2 text-center text-sm font-medium text-muted-foreground border-r last:border-r-0",
|
|
463
|
-
children:
|
|
508
|
+
children: x
|
|
464
509
|
},
|
|
465
|
-
|
|
510
|
+
x
|
|
466
511
|
)) }),
|
|
467
|
-
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 flex-1 auto-rows-fr", children:
|
|
468
|
-
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);
|
|
469
514
|
return /* @__PURE__ */ r.jsxs(
|
|
470
515
|
"div",
|
|
471
516
|
{
|
|
472
|
-
|
|
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(
|
|
473
520
|
"border-b border-r last:border-r-0 p-2 min-h-[100px] cursor-pointer hover:bg-accent/50",
|
|
474
|
-
!
|
|
521
|
+
!F && "bg-muted/30 text-muted-foreground",
|
|
522
|
+
b === N && "ring-2 ring-primary"
|
|
475
523
|
),
|
|
476
|
-
onClick: () =>
|
|
524
|
+
onClick: () => d?.(x),
|
|
525
|
+
onDragOver: (j) => T(j, N),
|
|
526
|
+
onDragLeave: M,
|
|
527
|
+
onDrop: (j) => L(j, x),
|
|
477
528
|
children: [
|
|
478
529
|
/* @__PURE__ */ r.jsx(
|
|
479
530
|
"div",
|
|
480
531
|
{
|
|
481
|
-
className:
|
|
532
|
+
className: V(
|
|
482
533
|
"text-sm font-medium mb-1",
|
|
483
|
-
|
|
534
|
+
O && "inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground h-6 w-6"
|
|
484
535
|
),
|
|
485
|
-
|
|
536
|
+
...O ? { "aria-current": "date" } : {},
|
|
537
|
+
children: x.getDate()
|
|
486
538
|
}
|
|
487
539
|
),
|
|
488
540
|
/* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
|
|
489
|
-
|
|
541
|
+
k.slice(0, 3).map((j) => /* @__PURE__ */ r.jsx(
|
|
490
542
|
"div",
|
|
491
543
|
{
|
|
492
|
-
|
|
544
|
+
role: "button",
|
|
545
|
+
"aria-label": j.title,
|
|
546
|
+
draggable: !!m,
|
|
547
|
+
onDragStart: (A) => h(A, j),
|
|
548
|
+
onDragEnd: l,
|
|
549
|
+
className: V(
|
|
493
550
|
"text-xs px-2 py-1 rounded truncate cursor-pointer hover:opacity-80",
|
|
494
|
-
|
|
551
|
+
j.color || le,
|
|
552
|
+
p === j.id && "opacity-50"
|
|
495
553
|
),
|
|
496
|
-
style:
|
|
497
|
-
onClick: (
|
|
498
|
-
|
|
554
|
+
style: j.color && j.color.startsWith("#") ? { backgroundColor: j.color } : void 0,
|
|
555
|
+
onClick: (A) => {
|
|
556
|
+
A.stopPropagation(), s?.(j);
|
|
499
557
|
},
|
|
500
|
-
children:
|
|
558
|
+
children: j.title
|
|
501
559
|
},
|
|
502
|
-
|
|
560
|
+
j.id
|
|
503
561
|
)),
|
|
504
|
-
|
|
562
|
+
k.length > 3 && /* @__PURE__ */ r.jsxs("div", { className: "text-xs text-muted-foreground px-2", children: [
|
|
505
563
|
"+",
|
|
506
|
-
|
|
564
|
+
k.length - 3,
|
|
507
565
|
" more"
|
|
508
566
|
] })
|
|
509
567
|
] })
|
|
510
568
|
]
|
|
511
569
|
},
|
|
512
|
-
|
|
570
|
+
N
|
|
513
571
|
);
|
|
514
572
|
}) })
|
|
515
573
|
] });
|
|
516
574
|
}
|
|
517
|
-
function
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
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();
|
|
522
586
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col h-full", children: [
|
|
523
|
-
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 border-b", children:
|
|
524
|
-
const
|
|
587
|
+
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 border-b", children: c.map((a) => {
|
|
588
|
+
const h = ge(a, b);
|
|
525
589
|
return /* @__PURE__ */ r.jsxs(
|
|
526
590
|
"div",
|
|
527
591
|
{
|
|
528
592
|
className: "p-3 text-center border-r last:border-r-0",
|
|
529
593
|
children: [
|
|
530
|
-
/* @__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" }) }),
|
|
531
595
|
/* @__PURE__ */ r.jsx(
|
|
532
596
|
"div",
|
|
533
597
|
{
|
|
534
|
-
className:
|
|
598
|
+
className: V(
|
|
535
599
|
"text-lg font-semibold mt-1",
|
|
536
|
-
|
|
600
|
+
h && "inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground h-8 w-8"
|
|
537
601
|
),
|
|
538
602
|
children: a.getDate()
|
|
539
603
|
}
|
|
@@ -543,26 +607,32 @@ function Ae({ date: e, events: n, onEventClick: o, onDateClick: m }) {
|
|
|
543
607
|
a.toISOString()
|
|
544
608
|
);
|
|
545
609
|
}) }),
|
|
546
|
-
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 flex-1", children:
|
|
547
|
-
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);
|
|
548
612
|
return /* @__PURE__ */ r.jsx(
|
|
549
613
|
"div",
|
|
550
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" : ""}` : ""}`,
|
|
551
617
|
className: "border-r last:border-r-0 p-2 min-h-[400px] cursor-pointer hover:bg-accent/50",
|
|
552
618
|
onClick: () => m?.(a),
|
|
553
|
-
|
|
619
|
+
onTouchStart: () => g(a),
|
|
620
|
+
onTouchEnd: u,
|
|
621
|
+
children: /* @__PURE__ */ r.jsx("div", { className: "space-y-2", children: h.map((l) => /* @__PURE__ */ r.jsxs(
|
|
554
622
|
"div",
|
|
555
623
|
{
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
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
|
|
559
629
|
),
|
|
560
630
|
style: l.color && l.color.startsWith("#") ? { backgroundColor: l.color } : void 0,
|
|
561
|
-
onClick: (
|
|
562
|
-
|
|
631
|
+
onClick: (T) => {
|
|
632
|
+
T.stopPropagation(), d?.(l);
|
|
563
633
|
},
|
|
564
634
|
children: [
|
|
565
|
-
/* @__PURE__ */ r.jsx("div", { className: "font-medium", children: l.title }),
|
|
635
|
+
/* @__PURE__ */ r.jsx("div", { className: "font-medium truncate", children: l.title }),
|
|
566
636
|
!l.allDay && /* @__PURE__ */ r.jsx("div", { className: "text-xs opacity-90 mt-1", children: l.start.toLocaleTimeString("default", {
|
|
567
637
|
hour: "numeric",
|
|
568
638
|
minute: "2-digit"
|
|
@@ -577,210 +647,286 @@ function Ae({ date: e, events: n, onEventClick: o, onDateClick: m }) {
|
|
|
577
647
|
}) })
|
|
578
648
|
] });
|
|
579
649
|
}
|
|
580
|
-
function
|
|
581
|
-
const m =
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
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(
|
|
587
664
|
"div",
|
|
588
665
|
{
|
|
589
|
-
className:
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
)
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
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);
|
|
612
698
|
}) }) });
|
|
613
699
|
}
|
|
614
|
-
function
|
|
615
|
-
|
|
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 ? {
|
|
616
736
|
provider: "value",
|
|
617
|
-
items:
|
|
618
|
-
} :
|
|
737
|
+
items: t.staticData
|
|
738
|
+
} : t.objectName ? {
|
|
619
739
|
provider: "object",
|
|
620
|
-
object:
|
|
740
|
+
object: t.objectName
|
|
621
741
|
} : null;
|
|
622
742
|
}
|
|
623
|
-
function
|
|
624
|
-
if (
|
|
625
|
-
if (typeof
|
|
626
|
-
const n =
|
|
627
|
-
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 };
|
|
628
748
|
}
|
|
629
|
-
if (Array.isArray(
|
|
630
|
-
return
|
|
749
|
+
if (Array.isArray(t))
|
|
750
|
+
return t.reduce((n, s) => (s.field && s.order && (n[s.field] = s.order), n), {});
|
|
631
751
|
}
|
|
632
752
|
}
|
|
633
|
-
function
|
|
634
|
-
return "filter" in
|
|
635
|
-
startDateField:
|
|
636
|
-
endDateField:
|
|
637
|
-
titleField:
|
|
638
|
-
colorField:
|
|
639
|
-
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
|
|
640
760
|
} : null;
|
|
641
761
|
}
|
|
642
|
-
const
|
|
643
|
-
schema:
|
|
762
|
+
const qe = ({
|
|
763
|
+
schema: t,
|
|
644
764
|
dataSource: n,
|
|
645
|
-
className:
|
|
646
|
-
onEventClick:
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
765
|
+
className: s,
|
|
766
|
+
onEventClick: d,
|
|
767
|
+
onRowClick: m,
|
|
768
|
+
onDateClick: i,
|
|
769
|
+
onNavigate: g,
|
|
770
|
+
onViewChange: u,
|
|
771
|
+
...p
|
|
651
772
|
}) => {
|
|
652
|
-
const [
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
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;
|
|
666
792
|
return (async () => {
|
|
667
793
|
try {
|
|
668
|
-
if (!
|
|
669
|
-
if (
|
|
670
|
-
|
|
794
|
+
if (!D) return;
|
|
795
|
+
if (h(!0), W && v?.provider === "value") {
|
|
796
|
+
D && (b(v.items), h(!1));
|
|
671
797
|
return;
|
|
672
798
|
}
|
|
673
|
-
if (
|
|
674
|
-
const
|
|
675
|
-
if (Array.isArray(
|
|
676
|
-
|
|
799
|
+
if (t.data || p.data) {
|
|
800
|
+
const R = t.data || p.data;
|
|
801
|
+
if (Array.isArray(R)) {
|
|
802
|
+
b(R), h(!1);
|
|
677
803
|
return;
|
|
678
804
|
}
|
|
679
805
|
}
|
|
680
806
|
if (!n)
|
|
681
807
|
throw new Error("DataSource required for object/api providers");
|
|
682
|
-
if (
|
|
683
|
-
const
|
|
684
|
-
$filter:
|
|
685
|
-
$orderby:
|
|
808
|
+
if (v?.provider === "object") {
|
|
809
|
+
const R = v.object, _ = await n.find(R, {
|
|
810
|
+
$filter: t.filter,
|
|
811
|
+
$orderby: He(t.sort)
|
|
686
812
|
});
|
|
687
|
-
let
|
|
688
|
-
Array.isArray(
|
|
689
|
-
} else
|
|
690
|
-
|
|
691
|
-
} catch (
|
|
692
|
-
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));
|
|
693
819
|
}
|
|
694
820
|
})(), () => {
|
|
695
|
-
|
|
821
|
+
D = !1;
|
|
696
822
|
};
|
|
697
|
-
}, [
|
|
698
|
-
!
|
|
823
|
+
}, [v, n, W, t.filter, t.sort, O]), ae(() => {
|
|
824
|
+
!W && n && (async () => {
|
|
699
825
|
try {
|
|
700
826
|
if (!n) return;
|
|
701
|
-
const
|
|
702
|
-
if (!
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
} catch (
|
|
706
|
-
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);
|
|
707
833
|
}
|
|
708
834
|
})();
|
|
709
|
-
}, [
|
|
710
|
-
const
|
|
711
|
-
if (!
|
|
835
|
+
}, [t.objectName, n, W, v]);
|
|
836
|
+
const K = te(() => {
|
|
837
|
+
if (!Y || !c.length)
|
|
712
838
|
return [];
|
|
713
|
-
const { startDateField:
|
|
714
|
-
return
|
|
715
|
-
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;
|
|
716
842
|
return {
|
|
717
|
-
id:
|
|
718
|
-
title:
|
|
719
|
-
start:
|
|
720
|
-
end:
|
|
721
|
-
color:
|
|
722
|
-
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,
|
|
723
849
|
// If no end date, treat as all-day event
|
|
724
|
-
data:
|
|
850
|
+
data: e
|
|
725
851
|
};
|
|
726
|
-
}).filter((
|
|
727
|
-
}, [
|
|
728
|
-
|
|
729
|
-
}, [
|
|
730
|
-
|
|
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: [
|
|
731
861
|
"Error: ",
|
|
732
|
-
|
|
733
|
-
] }) }) }) :
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
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." }) }) });
|
|
750
896
|
};
|
|
751
|
-
|
|
897
|
+
ne.register(
|
|
752
898
|
"calendar-view",
|
|
753
|
-
({ schema:
|
|
754
|
-
const
|
|
755
|
-
const
|
|
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";
|
|
756
902
|
return {
|
|
757
|
-
id:
|
|
758
|
-
title:
|
|
759
|
-
start: new Date(
|
|
760
|
-
end: a
|
|
761
|
-
allDay:
|
|
762
|
-
color:
|
|
763
|
-
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
|
|
764
910
|
};
|
|
765
|
-
}), [
|
|
766
|
-
|
|
911
|
+
}), [t.data, t.titleField, t.startDateField, t.endDateField, t.colorField, t.allDayField]), i = (u) => {
|
|
912
|
+
t.onEventClick && s?.({
|
|
767
913
|
type: "event-click",
|
|
768
|
-
payload:
|
|
914
|
+
payload: u
|
|
769
915
|
});
|
|
770
|
-
},
|
|
771
|
-
|
|
916
|
+
}, g = () => {
|
|
917
|
+
s?.({
|
|
772
918
|
type: "create",
|
|
773
919
|
payload: {}
|
|
774
920
|
});
|
|
775
921
|
};
|
|
776
922
|
return /* @__PURE__ */ r.jsx(
|
|
777
|
-
|
|
923
|
+
fe,
|
|
778
924
|
{
|
|
779
925
|
className: n,
|
|
780
|
-
events:
|
|
781
|
-
onEventClick:
|
|
782
|
-
onAddClick:
|
|
783
|
-
...
|
|
926
|
+
events: m,
|
|
927
|
+
onEventClick: i,
|
|
928
|
+
onAddClick: g,
|
|
929
|
+
...d
|
|
784
930
|
}
|
|
785
931
|
);
|
|
786
932
|
},
|
|
@@ -895,21 +1041,30 @@ ce.register(
|
|
|
895
1041
|
}
|
|
896
1042
|
}
|
|
897
1043
|
);
|
|
898
|
-
const
|
|
899
|
-
const { dataSource: n } =
|
|
900
|
-
return /* @__PURE__ */ r.jsx(
|
|
1044
|
+
const pe = ({ schema: t }) => {
|
|
1045
|
+
const { dataSource: n } = be();
|
|
1046
|
+
return /* @__PURE__ */ r.jsx(qe, { schema: t, dataSource: n });
|
|
901
1047
|
};
|
|
902
|
-
|
|
1048
|
+
ne.register("object-calendar", pe, {
|
|
903
1049
|
namespace: "plugin-calendar",
|
|
904
1050
|
label: "Object Calendar",
|
|
905
|
-
category: "
|
|
1051
|
+
category: "view",
|
|
1052
|
+
inputs: [
|
|
1053
|
+
{ name: "objectName", type: "string", label: "Object Name", required: !0 },
|
|
1054
|
+
{ name: "calendar", type: "object", label: "Calendar Config", description: "startDateField, endDateField, titleField, colorField" }
|
|
1055
|
+
]
|
|
1056
|
+
});
|
|
1057
|
+
ne.register("calendar", pe, {
|
|
1058
|
+
namespace: "view",
|
|
1059
|
+
label: "Calendar View",
|
|
1060
|
+
category: "view",
|
|
906
1061
|
inputs: [
|
|
907
1062
|
{ name: "objectName", type: "string", label: "Object Name", required: !0 },
|
|
908
1063
|
{ name: "calendar", type: "object", label: "Calendar Config", description: "startDateField, endDateField, titleField, colorField" }
|
|
909
1064
|
]
|
|
910
1065
|
});
|
|
911
1066
|
export {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
1067
|
+
fe as CalendarView,
|
|
1068
|
+
qe as ObjectCalendar,
|
|
1069
|
+
pe as ObjectCalendarRenderer
|
|
915
1070
|
};
|