@object-ui/plugin-calendar 0.5.0 → 2.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/dist/index.js CHANGED
@@ -1,26 +1,26 @@
1
- import * as H from "react";
2
- import se, { useState as O, useMemo as Z, useEffect as ne, useCallback as pe } from "react";
3
- import { ComponentRegistry as ce } from "@object-ui/core";
4
- import { useSchemaContext as ge } from "@object-ui/react";
5
- import { ChevronLeftIcon as xe, ChevronRightIcon as be, CalendarIcon as De, PlusIcon as ye } from "lucide-react";
6
- import { Button as V, Popover as ve, PopoverTrigger as he, cn as F, PopoverContent as je, Calendar as we, Select as Ee, SelectTrigger as Ne, SelectValue as Se, SelectContent as Fe, SelectItem as K } from "@object-ui/components";
7
- var q = { exports: {} }, L = {};
8
- var le;
9
- function _e() {
10
- if (le) return L;
11
- le = 1;
1
+ import * as z from "react";
2
+ import ce, { useState as A, useMemo as Z, useEffect as le, useCallback as ge } from "react";
3
+ import { ComponentRegistry as ee } from "@object-ui/core";
4
+ import { useSchemaContext as xe } from "@object-ui/react";
5
+ import { ChevronLeftIcon as be, ChevronRightIcon as De, CalendarIcon as ye, PlusIcon as ve } from "lucide-react";
6
+ import { Button as V, Popover as he, PopoverTrigger as je, cn as S, PopoverContent as we, Calendar as Ee, Select as Ne, SelectTrigger as Fe, SelectValue as Se, SelectContent as _e, SelectItem as K } from "@object-ui/components";
7
+ var H = { exports: {} }, L = {};
8
+ var oe;
9
+ function ke() {
10
+ if (oe) return L;
11
+ oe = 1;
12
12
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), n = /* @__PURE__ */ Symbol.for("react.fragment");
13
- function o(m, u, s) {
14
- var f = null;
15
- if (s !== void 0 && (f = "" + s), u.key !== void 0 && (f = "" + u.key), "key" in u) {
13
+ function o(f, u, s) {
14
+ var m = null;
15
+ if (s !== void 0 && (m = "" + s), u.key !== void 0 && (m = "" + u.key), "key" in u) {
16
16
  s = {};
17
17
  for (var a in u)
18
18
  a !== "key" && (s[a] = u[a]);
19
19
  } else s = u;
20
20
  return u = s.ref, {
21
21
  $$typeof: e,
22
- type: m,
23
- key: f,
22
+ type: f,
23
+ key: m,
24
24
  ref: u !== void 0 ? u : null,
25
25
  props: s
26
26
  };
@@ -28,9 +28,9 @@ function _e() {
28
28
  return L.Fragment = n, L.jsx = o, L.jsxs = o, L;
29
29
  }
30
30
  var Y = {};
31
- var oe;
32
- function ke() {
33
- return oe || (oe = 1, process.env.NODE_ENV !== "production" && (function() {
31
+ var ie;
32
+ function Ce() {
33
+ return ie || (ie = 1, process.env.NODE_ENV !== "production" && (function() {
34
34
  function e(t) {
35
35
  if (t == null) return null;
36
36
  if (typeof t == "function")
@@ -41,26 +41,26 @@ function ke() {
41
41
  return "Fragment";
42
42
  case $:
43
43
  return "Profiler";
44
- case I:
44
+ case M:
45
45
  return "StrictMode";
46
- case C:
46
+ case k:
47
47
  return "Suspense";
48
48
  case J:
49
49
  return "SuspenseList";
50
- case S:
50
+ case F:
51
51
  return "Activity";
52
52
  }
53
53
  if (typeof t == "object")
54
54
  switch (typeof t.tag == "number" && console.error(
55
55
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
56
56
  ), t.$$typeof) {
57
- case M:
57
+ case P:
58
58
  return "Portal";
59
- case h:
59
+ case l:
60
60
  return t.displayName || "Context";
61
- case c:
61
+ case I:
62
62
  return (t._context.displayName || "Context") + ".Consumer";
63
- case k:
63
+ case N:
64
64
  var i = t.render;
65
65
  return t = t.displayName, t || (t = i.displayName || i.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
66
66
  case G:
@@ -94,7 +94,7 @@ function ke() {
94
94
  ), n(t);
95
95
  }
96
96
  }
97
- function m(t) {
97
+ function f(t) {
98
98
  if (t === _) return "<>";
99
99
  if (typeof t == "object" && t !== null && t.$$typeof === g)
100
100
  return "<...>";
@@ -106,13 +106,13 @@ function ke() {
106
106
  }
107
107
  }
108
108
  function u() {
109
- var t = j.A;
109
+ var t = w.A;
110
110
  return t === null ? null : t.getOwner();
111
111
  }
112
112
  function s() {
113
113
  return Error("react-stack-top-frame");
114
114
  }
115
- function f(t) {
115
+ function m(t) {
116
116
  if (v.call(t, "key")) {
117
117
  var i = Object.getOwnPropertyDescriptor(t, "key").get;
118
118
  if (i && i.isReactWarning) return !1;
@@ -121,7 +121,7 @@ function ke() {
121
121
  }
122
122
  function a(t, i) {
123
123
  function x() {
124
- R || (R = !0, console.error(
124
+ T || (T = !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
  i
127
127
  ));
@@ -137,10 +137,10 @@ function ke() {
137
137
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
138
138
  )), t = this.props.ref, t !== void 0 ? t : null;
139
139
  }
140
- function l(t, i, x, D, z, B) {
140
+ function c(t, i, x, D, q, B) {
141
141
  var y = x.ref;
142
142
  return t = {
143
- $$typeof: P,
143
+ $$typeof: O,
144
144
  type: t,
145
145
  key: i,
146
146
  props: x,
@@ -162,7 +162,7 @@ function ke() {
162
162
  configurable: !1,
163
163
  enumerable: !1,
164
164
  writable: !0,
165
- value: z
165
+ value: q
166
166
  }), Object.defineProperty(t, "_debugTask", {
167
167
  configurable: !1,
168
168
  enumerable: !1,
@@ -170,25 +170,25 @@ function ke() {
170
170
  value: B
171
171
  }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
172
172
  }
173
- function w(t, i, x, D, z, B) {
173
+ function b(t, i, x, D, q, B) {
174
174
  var y = i.children;
175
175
  if (y !== void 0)
176
176
  if (D)
177
177
  if (X(y)) {
178
178
  for (D = 0; D < y.length; D++)
179
- p(y[D]);
179
+ h(y[D]);
180
180
  Object.freeze && Object.freeze(y);
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 p(y);
185
+ else h(y);
186
186
  if (v.call(i, "key")) {
187
187
  y = e(t);
188
- var A = Object.keys(i).filter(function(me) {
189
- return me !== "key";
188
+ var R = Object.keys(i).filter(function(pe) {
189
+ return pe !== "key";
190
190
  });
191
- D = 0 < A.length ? "{key: someKey, " + A.join(": ..., ") + ": ...}" : "{key: someKey}", ae[y + D] || (A = 0 < A.length ? "{" + A.join(": ..., ") + ": ...}" : "{}", console.error(
191
+ D = 0 < R.length ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}", ne[y + D] || (R = 0 < R.length ? "{" + R.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} />
@@ -197,11 +197,11 @@ React keys must be passed directly to JSX without using spread:
197
197
  <%s key={someKey} {...props} />`,
198
198
  D,
199
199
  y,
200
- A,
200
+ R,
201
201
  y
202
- ), ae[y + D] = !0);
202
+ ), ne[y + D] = !0);
203
203
  }
204
- if (y = null, x !== void 0 && (o(x), y = "" + x), f(i) && (o(i.key), y = "" + i.key), "key" in i) {
204
+ if (y = null, x !== void 0 && (o(x), y = "" + x), m(i) && (o(i.key), y = "" + i.key), "key" in i) {
205
205
  x = {};
206
206
  for (var Q in i)
207
207
  Q !== "key" && (x[Q] = i[Q]);
@@ -209,130 +209,131 @@ React keys must be passed directly to JSX without using spread:
209
209
  return y && a(
210
210
  x,
211
211
  typeof t == "function" ? t.displayName || t.name || "Unknown" : t
212
- ), l(
212
+ ), c(
213
213
  t,
214
214
  y,
215
215
  x,
216
216
  u(),
217
- z,
217
+ q,
218
218
  B
219
219
  );
220
220
  }
221
- function p(t) {
222
- b(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === g && (t._payload.status === "fulfilled" ? b(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
221
+ function h(t) {
222
+ p(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === g && (t._payload.status === "fulfilled" ? p(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
223
223
  }
224
- function b(t) {
225
- return typeof t == "object" && t !== null && t.$$typeof === P;
224
+ function p(t) {
225
+ return typeof t == "object" && t !== null && t.$$typeof === O;
226
226
  }
227
- var N = se, P = /* @__PURE__ */ Symbol.for("react.transitional.element"), M = /* @__PURE__ */ Symbol.for("react.portal"), _ = /* @__PURE__ */ Symbol.for("react.fragment"), I = /* @__PURE__ */ Symbol.for("react.strict_mode"), $ = /* @__PURE__ */ Symbol.for("react.profiler"), c = /* @__PURE__ */ Symbol.for("react.consumer"), h = /* @__PURE__ */ Symbol.for("react.context"), k = /* @__PURE__ */ Symbol.for("react.forward_ref"), C = /* @__PURE__ */ Symbol.for("react.suspense"), J = /* @__PURE__ */ Symbol.for("react.suspense_list"), G = /* @__PURE__ */ Symbol.for("react.memo"), g = /* @__PURE__ */ Symbol.for("react.lazy"), S = /* @__PURE__ */ Symbol.for("react.activity"), E = /* @__PURE__ */ Symbol.for("react.client.reference"), j = N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, v = Object.prototype.hasOwnProperty, X = Array.isArray, T = console.createTask ? console.createTask : function() {
227
+ var j = ce, O = /* @__PURE__ */ Symbol.for("react.transitional.element"), P = /* @__PURE__ */ Symbol.for("react.portal"), _ = /* @__PURE__ */ Symbol.for("react.fragment"), M = /* @__PURE__ */ Symbol.for("react.strict_mode"), $ = /* @__PURE__ */ Symbol.for("react.profiler"), I = /* @__PURE__ */ Symbol.for("react.consumer"), l = /* @__PURE__ */ Symbol.for("react.context"), N = /* @__PURE__ */ Symbol.for("react.forward_ref"), k = /* @__PURE__ */ Symbol.for("react.suspense"), J = /* @__PURE__ */ Symbol.for("react.suspense_list"), G = /* @__PURE__ */ Symbol.for("react.memo"), g = /* @__PURE__ */ Symbol.for("react.lazy"), F = /* @__PURE__ */ Symbol.for("react.activity"), E = /* @__PURE__ */ Symbol.for("react.client.reference"), w = j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, v = Object.prototype.hasOwnProperty, X = Array.isArray, C = console.createTask ? console.createTask : function() {
228
228
  return null;
229
229
  };
230
- N = {
230
+ j = {
231
231
  react_stack_bottom_frame: function(t) {
232
232
  return t();
233
233
  }
234
234
  };
235
- var R, W = {}, U = N.react_stack_bottom_frame.bind(
236
- N,
235
+ var T, W = {}, U = j.react_stack_bottom_frame.bind(
236
+ j,
237
237
  s
238
- )(), re = T(m(s)), ae = {};
238
+ )(), ae = C(f(s)), ne = {};
239
239
  Y.Fragment = _, Y.jsx = function(t, i, x) {
240
- var D = 1e4 > j.recentlyCreatedOwnerStacks++;
241
- return w(
240
+ var D = 1e4 > w.recentlyCreatedOwnerStacks++;
241
+ return b(
242
242
  t,
243
243
  i,
244
244
  x,
245
245
  !1,
246
246
  D ? Error("react-stack-top-frame") : U,
247
- D ? T(m(t)) : re
247
+ D ? C(f(t)) : ae
248
248
  );
249
249
  }, Y.jsxs = function(t, i, x) {
250
- var D = 1e4 > j.recentlyCreatedOwnerStacks++;
251
- return w(
250
+ var D = 1e4 > w.recentlyCreatedOwnerStacks++;
251
+ return b(
252
252
  t,
253
253
  i,
254
254
  x,
255
255
  !0,
256
256
  D ? Error("react-stack-top-frame") : U,
257
- D ? T(m(t)) : re
257
+ D ? C(f(t)) : ae
258
258
  );
259
259
  };
260
260
  })()), Y;
261
261
  }
262
- var ie;
263
- function Ce() {
264
- return ie || (ie = 1, process.env.NODE_ENV === "production" ? q.exports = _e() : q.exports = ke()), q.exports;
262
+ var se;
263
+ function Te() {
264
+ return se || (se = 1, process.env.NODE_ENV === "production" ? H.exports = ke() : H.exports = Ce()), H.exports;
265
265
  }
266
- var r = Ce();
267
- const ee = "bg-blue-500 text-white";
266
+ var r = Te();
267
+ const te = "bg-blue-500 text-white";
268
268
  function de({
269
269
  events: e = [],
270
270
  view: n = "month",
271
271
  currentDate: o = /* @__PURE__ */ new Date(),
272
- onEventClick: m,
273
- onDateClick: u,
274
- onViewChange: s,
275
- onNavigate: f,
276
- onAddClick: a,
277
- className: d
272
+ locale: f = "default",
273
+ onEventClick: u,
274
+ onDateClick: s,
275
+ onViewChange: m,
276
+ onNavigate: a,
277
+ onAddClick: d,
278
+ className: c
278
279
  }) {
279
- const [l, w] = H.useState(n), [p, b] = H.useState(o);
280
- H.useEffect(() => {
281
- b(o);
282
- }, [o]), H.useEffect(() => {
283
- w(n);
280
+ const [b, h] = z.useState(n), [p, j] = z.useState(o);
281
+ z.useEffect(() => {
282
+ j(o);
283
+ }, [o]), z.useEffect(() => {
284
+ h(n);
284
285
  }, [n]);
285
- const N = () => {
286
- const c = new Date(p);
287
- l === "month" ? c.setMonth(c.getMonth() - 1) : l === "week" ? c.setDate(c.getDate() - 7) : c.setDate(c.getDate() - 1), b(c), f?.(c);
286
+ const O = () => {
287
+ const l = new Date(p);
288
+ b === "month" ? l.setMonth(l.getMonth() - 1) : b === "week" ? l.setDate(l.getDate() - 7) : l.setDate(l.getDate() - 1), j(l), a?.(l);
288
289
  }, P = () => {
289
- const c = new Date(p);
290
- l === "month" ? c.setMonth(c.getMonth() + 1) : l === "week" ? c.setDate(c.getDate() + 7) : c.setDate(c.getDate() + 1), b(c), f?.(c);
291
- }, M = () => {
292
- const c = /* @__PURE__ */ new Date();
293
- b(c), f?.(c);
294
- }, _ = (c) => {
295
- w(c), s?.(c);
296
- }, I = () => {
297
- if (l === "month")
298
- return p.toLocaleDateString("default", {
290
+ const l = new Date(p);
291
+ b === "month" ? l.setMonth(l.getMonth() + 1) : b === "week" ? l.setDate(l.getDate() + 7) : l.setDate(l.getDate() + 1), j(l), a?.(l);
292
+ }, _ = () => {
293
+ const l = /* @__PURE__ */ new Date();
294
+ j(l), a?.(l);
295
+ }, M = (l) => {
296
+ h(l), m?.(l);
297
+ }, $ = () => {
298
+ if (b === "month")
299
+ return p.toLocaleDateString(f, {
299
300
  month: "long",
300
301
  year: "numeric"
301
302
  });
302
- if (l === "week") {
303
- const c = ue(p), h = new Date(c);
304
- return h.setDate(h.getDate() + 6), `${c.toLocaleDateString("default", {
303
+ if (b === "week") {
304
+ const l = ue(p), N = new Date(l);
305
+ return N.setDate(N.getDate() + 6), `${l.toLocaleDateString(f, {
305
306
  month: "short",
306
307
  day: "numeric"
307
- })} - ${h.toLocaleDateString("default", {
308
+ })} - ${N.toLocaleDateString(f, {
308
309
  month: "short",
309
310
  day: "numeric",
310
311
  year: "numeric"
311
312
  })}`;
312
313
  } else
313
- return p.toLocaleDateString("default", {
314
+ return p.toLocaleDateString(f, {
314
315
  weekday: "long",
315
316
  month: "long",
316
317
  day: "numeric",
317
318
  year: "numeric"
318
319
  });
319
- }, $ = (c) => {
320
- c && (b(c), f?.(c));
320
+ }, I = (l) => {
321
+ l && (j(l), a?.(l));
321
322
  };
322
- return /* @__PURE__ */ r.jsxs("div", { className: F("flex flex-col h-full bg-background", d), children: [
323
+ return /* @__PURE__ */ r.jsxs("div", { className: S("flex flex-col h-full bg-background", c), children: [
323
324
  /* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-between p-4 border-b", children: [
324
325
  /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-4", children: [
325
326
  /* @__PURE__ */ r.jsxs("div", { className: "flex items-center bg-muted/50 rounded-lg p-1 gap-1", children: [
326
- /* @__PURE__ */ r.jsx(V, { variant: "ghost", size: "sm", onClick: M, className: "h-8", children: "Today" }),
327
+ /* @__PURE__ */ r.jsx(V, { variant: "ghost", size: "sm", onClick: _, className: "h-8", children: "Today" }),
327
328
  /* @__PURE__ */ r.jsx("div", { className: "h-4 w-px bg-border mx-1" }),
328
329
  /* @__PURE__ */ r.jsx(
329
330
  V,
330
331
  {
331
332
  variant: "ghost",
332
333
  size: "icon",
333
- onClick: N,
334
+ onClick: O,
334
335
  className: "h-8 w-8",
335
- children: /* @__PURE__ */ r.jsx(xe, { className: "h-4 w-4" })
336
+ children: /* @__PURE__ */ r.jsx(be, { className: "h-4 w-4" })
336
337
  }
337
338
  ),
338
339
  /* @__PURE__ */ r.jsx(
@@ -342,31 +343,31 @@ function de({
342
343
  size: "icon",
343
344
  onClick: P,
344
345
  className: "h-8 w-8",
345
- children: /* @__PURE__ */ r.jsx(be, { className: "h-4 w-4" })
346
+ children: /* @__PURE__ */ r.jsx(De, { className: "h-4 w-4" })
346
347
  }
347
348
  )
348
349
  ] }),
349
- /* @__PURE__ */ r.jsxs(ve, { children: [
350
- /* @__PURE__ */ r.jsx(he, { asChild: !0, children: /* @__PURE__ */ r.jsxs(
350
+ /* @__PURE__ */ r.jsxs(he, { children: [
351
+ /* @__PURE__ */ r.jsx(je, { asChild: !0, children: /* @__PURE__ */ r.jsxs(
351
352
  V,
352
353
  {
353
354
  variant: "ghost",
354
- className: F(
355
+ className: S(
355
356
  "text-xl font-semibold h-auto px-3 py-1 hover:bg-muted/50 transition-colors",
356
357
  "flex items-center gap-2"
357
358
  ),
358
359
  children: [
359
- /* @__PURE__ */ r.jsx(De, { className: "h-5 w-5 text-muted-foreground" }),
360
- /* @__PURE__ */ r.jsx("span", { children: I() })
360
+ /* @__PURE__ */ r.jsx(ye, { className: "h-5 w-5 text-muted-foreground" }),
361
+ /* @__PURE__ */ r.jsx("span", { children: $() })
361
362
  ]
362
363
  }
363
364
  ) }),
364
- /* @__PURE__ */ r.jsx(je, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ r.jsx(
365
- we,
365
+ /* @__PURE__ */ r.jsx(we, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ r.jsx(
366
+ Ee,
366
367
  {
367
368
  mode: "single",
368
369
  selected: p,
369
- onSelect: $,
370
+ onSelect: I,
370
371
  initialFocus: !0,
371
372
  fromYear: 2e3,
372
373
  toYear: 2050
@@ -375,88 +376,88 @@ function de({
375
376
  ] })
376
377
  ] }),
377
378
  /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
378
- /* @__PURE__ */ r.jsxs(Ee, { value: l, onValueChange: _, children: [
379
- /* @__PURE__ */ r.jsx(Ne, { className: "w-32 bg-background", children: /* @__PURE__ */ r.jsx(Se, {}) }),
380
- /* @__PURE__ */ r.jsxs(Fe, { children: [
379
+ /* @__PURE__ */ r.jsxs(Ne, { value: b, onValueChange: M, children: [
380
+ /* @__PURE__ */ r.jsx(Fe, { className: "w-32 bg-background", children: /* @__PURE__ */ r.jsx(Se, {}) }),
381
+ /* @__PURE__ */ r.jsxs(_e, { children: [
381
382
  /* @__PURE__ */ r.jsx(K, { value: "day", children: "Day" }),
382
383
  /* @__PURE__ */ r.jsx(K, { value: "week", children: "Week" }),
383
384
  /* @__PURE__ */ r.jsx(K, { value: "month", children: "Month" })
384
385
  ] })
385
386
  ] }),
386
- a && /* @__PURE__ */ r.jsxs(V, { onClick: a, size: "sm", className: "gap-1", children: [
387
- /* @__PURE__ */ r.jsx(ye, { className: "h-4 w-4" }),
387
+ d && /* @__PURE__ */ r.jsxs(V, { onClick: d, size: "sm", className: "gap-1", children: [
388
+ /* @__PURE__ */ r.jsx(ve, { className: "h-4 w-4" }),
388
389
  "New"
389
390
  ] })
390
391
  ] })
391
392
  ] }),
392
393
  /* @__PURE__ */ r.jsxs("div", { className: "flex-1 overflow-auto", children: [
393
- l === "month" && /* @__PURE__ */ r.jsx(
394
- Re,
394
+ b === "month" && /* @__PURE__ */ r.jsx(
395
+ Ae,
395
396
  {
396
397
  date: p,
397
398
  events: e,
398
- onEventClick: m,
399
- onDateClick: u
399
+ onEventClick: u,
400
+ onDateClick: s
400
401
  }
401
402
  ),
402
- l === "week" && /* @__PURE__ */ r.jsx(
403
- Ae,
403
+ b === "week" && /* @__PURE__ */ r.jsx(
404
+ Oe,
404
405
  {
405
406
  date: p,
406
407
  events: e,
407
- onEventClick: m,
408
- onDateClick: u
408
+ onEventClick: u,
409
+ onDateClick: s
409
410
  }
410
411
  ),
411
- l === "day" && /* @__PURE__ */ r.jsx(
412
- Oe,
412
+ b === "day" && /* @__PURE__ */ r.jsx(
413
+ Pe,
413
414
  {
414
415
  date: p,
415
416
  events: e,
416
- onEventClick: m
417
+ onEventClick: u
417
418
  }
418
419
  )
419
420
  ] })
420
421
  ] });
421
422
  }
422
423
  function ue(e) {
423
- const n = new Date(e), o = n.getDay(), m = n.getDate() - o;
424
- return n.setDate(m), n;
424
+ const n = new Date(e), o = n.getDay(), f = n.getDate() - o;
425
+ return n.setDate(f), n;
425
426
  }
426
- function Te(e) {
427
- const n = e.getFullYear(), o = e.getMonth(), m = new Date(n, o, 1), u = new Date(n, o + 1, 0), s = m.getDay(), f = [];
427
+ function Re(e) {
428
+ const n = e.getFullYear(), o = e.getMonth(), f = new Date(n, o, 1), u = new Date(n, o + 1, 0), s = f.getDay(), m = [];
428
429
  for (let d = s - 1; d >= 0; d--) {
429
- const l = new Date(m.getTime());
430
- l.setDate(l.getDate() - (d + 1)), f.push(l);
430
+ const c = new Date(f.getTime());
431
+ c.setDate(c.getDate() - (d + 1)), m.push(c);
431
432
  }
432
433
  for (let d = 1; d <= u.getDate(); d++)
433
- f.push(new Date(n, o, d));
434
- const a = 42 - f.length;
434
+ m.push(new Date(n, o, d));
435
+ const a = 42 - m.length;
435
436
  for (let d = 1; d <= a; d++) {
436
- const l = new Date(u.getTime());
437
- l.setDate(l.getDate() + d), f.push(l);
437
+ const c = new Date(u.getTime());
438
+ c.setDate(c.getDate() + d), m.push(c);
438
439
  }
439
- return f;
440
+ return m;
440
441
  }
441
442
  function fe(e, n) {
442
443
  return e.getFullYear() === n.getFullYear() && e.getMonth() === n.getMonth() && e.getDate() === n.getDate();
443
444
  }
444
- function te(e, n) {
445
+ function re(e, n) {
445
446
  return n.filter((o) => {
446
- const m = new Date(o.start), u = o.end ? new Date(o.end) : new Date(m), s = new Date(e);
447
+ const f = new Date(o.start), u = o.end ? new Date(o.end) : new Date(f), s = new Date(e);
447
448
  s.setHours(0, 0, 0, 0);
448
- const f = new Date(e);
449
- f.setHours(23, 59, 59, 999);
450
- const a = new Date(m);
449
+ const m = new Date(e);
450
+ m.setHours(23, 59, 59, 999);
451
+ const a = new Date(f);
451
452
  a.setHours(0, 0, 0, 0);
452
453
  const d = new Date(u);
453
- return d.setHours(23, 59, 59, 999), s <= d && f >= a;
454
+ return d.setHours(23, 59, 59, 999), s <= d && m >= a;
454
455
  });
455
456
  }
456
- function Re({ date: e, events: n, onEventClick: o, onDateClick: m }) {
457
- const u = Te(e), s = /* @__PURE__ */ new Date(), f = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
457
+ function Ae({ date: e, events: n, onEventClick: o, onDateClick: f }) {
458
+ const u = Re(e), s = /* @__PURE__ */ new Date(), m = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
458
459
  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: f.map((a) => /* @__PURE__ */ r.jsx(
460
+ /* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 border-b", children: m.map((a) => /* @__PURE__ */ r.jsx(
460
461
  "div",
461
462
  {
462
463
  className: "p-2 text-center text-sm font-medium text-muted-foreground border-r last:border-r-0",
@@ -465,45 +466,45 @@ function Re({ date: e, events: n, onEventClick: o, onDateClick: m }) {
465
466
  a
466
467
  )) }),
467
468
  /* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 flex-1 auto-rows-fr", children: u.map((a, d) => {
468
- const l = te(a, n), w = a.getMonth() === e.getMonth(), p = fe(a, s);
469
+ const c = re(a, n), b = a.getMonth() === e.getMonth(), h = fe(a, s);
469
470
  return /* @__PURE__ */ r.jsxs(
470
471
  "div",
471
472
  {
472
- className: F(
473
+ className: S(
473
474
  "border-b border-r last:border-r-0 p-2 min-h-[100px] cursor-pointer hover:bg-accent/50",
474
- !w && "bg-muted/30 text-muted-foreground"
475
+ !b && "bg-muted/30 text-muted-foreground"
475
476
  ),
476
- onClick: () => m?.(a),
477
+ onClick: () => f?.(a),
477
478
  children: [
478
479
  /* @__PURE__ */ r.jsx(
479
480
  "div",
480
481
  {
481
- className: F(
482
+ className: S(
482
483
  "text-sm font-medium mb-1",
483
- p && "inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground h-6 w-6"
484
+ h && "inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground h-6 w-6"
484
485
  ),
485
486
  children: a.getDate()
486
487
  }
487
488
  ),
488
489
  /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
489
- l.slice(0, 3).map((b) => /* @__PURE__ */ r.jsx(
490
+ c.slice(0, 3).map((p) => /* @__PURE__ */ r.jsx(
490
491
  "div",
491
492
  {
492
- className: F(
493
+ className: S(
493
494
  "text-xs px-2 py-1 rounded truncate cursor-pointer hover:opacity-80",
494
- b.color || ee
495
+ p.color || te
495
496
  ),
496
- style: b.color && b.color.startsWith("#") ? { backgroundColor: b.color } : void 0,
497
- onClick: (N) => {
498
- N.stopPropagation(), o?.(b);
497
+ style: p.color && p.color.startsWith("#") ? { backgroundColor: p.color } : void 0,
498
+ onClick: (j) => {
499
+ j.stopPropagation(), o?.(p);
499
500
  },
500
- children: b.title
501
+ children: p.title
501
502
  },
502
- b.id
503
+ p.id
503
504
  )),
504
- l.length > 3 && /* @__PURE__ */ r.jsxs("div", { className: "text-xs text-muted-foreground px-2", children: [
505
+ c.length > 3 && /* @__PURE__ */ r.jsxs("div", { className: "text-xs text-muted-foreground px-2", children: [
505
506
  "+",
506
- l.length - 3,
507
+ c.length - 3,
507
508
  " more"
508
509
  ] })
509
510
  ] })
@@ -514,24 +515,24 @@ function Re({ date: e, events: n, onEventClick: o, onDateClick: m }) {
514
515
  }) })
515
516
  ] });
516
517
  }
517
- function Ae({ date: e, events: n, onEventClick: o, onDateClick: m }) {
518
+ function Oe({ date: e, events: n, onEventClick: o, onDateClick: f }) {
518
519
  const u = ue(e), s = Array.from({ length: 7 }, (a, d) => {
519
- const l = new Date(u);
520
- return l.setDate(l.getDate() + d), l;
521
- }), f = /* @__PURE__ */ new Date();
520
+ const c = new Date(u);
521
+ return c.setDate(c.getDate() + d), c;
522
+ }), m = /* @__PURE__ */ new Date();
522
523
  return /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col h-full", children: [
523
524
  /* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 border-b", children: s.map((a) => {
524
- const d = fe(a, f);
525
+ const d = fe(a, m);
525
526
  return /* @__PURE__ */ r.jsxs(
526
527
  "div",
527
528
  {
528
529
  className: "p-3 text-center border-r last:border-r-0",
529
530
  children: [
530
- /* @__PURE__ */ r.jsx("div", { className: "text-sm font-medium text-muted-foreground", children: a.toLocaleDateString("default", { weekday: "short" }) }),
531
+ /* @__PURE__ */ r.jsx("div", { className: "text-sm font-medium text-muted-foreground", children: a.toLocaleDateString(locale, { weekday: "short" }) }),
531
532
  /* @__PURE__ */ r.jsx(
532
533
  "div",
533
534
  {
534
- className: F(
535
+ className: S(
535
536
  "text-lg font-semibold mt-1",
536
537
  d && "inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground h-8 w-8"
537
538
  ),
@@ -544,32 +545,32 @@ function Ae({ date: e, events: n, onEventClick: o, onDateClick: m }) {
544
545
  );
545
546
  }) }),
546
547
  /* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 flex-1", children: s.map((a) => {
547
- const d = te(a, n);
548
+ const d = re(a, n);
548
549
  return /* @__PURE__ */ r.jsx(
549
550
  "div",
550
551
  {
551
552
  className: "border-r last:border-r-0 p-2 min-h-[400px] cursor-pointer hover:bg-accent/50",
552
- onClick: () => m?.(a),
553
- children: /* @__PURE__ */ r.jsx("div", { className: "space-y-2", children: d.map((l) => /* @__PURE__ */ r.jsxs(
553
+ onClick: () => f?.(a),
554
+ children: /* @__PURE__ */ r.jsx("div", { className: "space-y-2", children: d.map((c) => /* @__PURE__ */ r.jsxs(
554
555
  "div",
555
556
  {
556
- className: F(
557
+ className: S(
557
558
  "text-sm px-3 py-2 rounded cursor-pointer hover:opacity-80",
558
- l.color || ee
559
+ c.color || te
559
560
  ),
560
- style: l.color && l.color.startsWith("#") ? { backgroundColor: l.color } : void 0,
561
- onClick: (w) => {
562
- w.stopPropagation(), o?.(l);
561
+ style: c.color && c.color.startsWith("#") ? { backgroundColor: c.color } : void 0,
562
+ onClick: (b) => {
563
+ b.stopPropagation(), o?.(c);
563
564
  },
564
565
  children: [
565
- /* @__PURE__ */ r.jsx("div", { className: "font-medium", children: l.title }),
566
- !l.allDay && /* @__PURE__ */ r.jsx("div", { className: "text-xs opacity-90 mt-1", children: l.start.toLocaleTimeString("default", {
566
+ /* @__PURE__ */ r.jsx("div", { className: "font-medium", children: c.title }),
567
+ !c.allDay && /* @__PURE__ */ r.jsx("div", { className: "text-xs opacity-90 mt-1", children: c.start.toLocaleTimeString("default", {
567
568
  hour: "numeric",
568
569
  minute: "2-digit"
569
570
  }) })
570
571
  ]
571
572
  },
572
- l.id
573
+ c.id
573
574
  )) })
574
575
  },
575
576
  a.toISOString()
@@ -577,18 +578,18 @@ function Ae({ date: e, events: n, onEventClick: o, onDateClick: m }) {
577
578
  }) })
578
579
  ] });
579
580
  }
580
- function Oe({ date: e, events: n, onEventClick: o }) {
581
- const m = te(e, n), u = Array.from({ length: 24 }, (s, f) => f);
581
+ function Pe({ date: e, events: n, onEventClick: o }) {
582
+ const f = re(e, n), u = Array.from({ length: 24 }, (s, m) => m);
582
583
  return /* @__PURE__ */ r.jsx("div", { className: "flex flex-col h-full", children: /* @__PURE__ */ r.jsx("div", { className: "flex-1 overflow-auto", children: u.map((s) => {
583
- const f = m.filter((a) => a.allDay ? s === 0 : a.start.getHours() === s);
584
+ const m = f.filter((a) => a.allDay ? s === 0 : a.start.getHours() === s);
584
585
  return /* @__PURE__ */ r.jsxs("div", { className: "flex border-b min-h-[60px]", children: [
585
586
  /* @__PURE__ */ r.jsx("div", { className: "w-20 p-2 text-sm text-muted-foreground border-r", children: s === 0 ? "12 AM" : s < 12 ? `${s} AM` : s === 12 ? "12 PM" : `${s - 12} PM` }),
586
- /* @__PURE__ */ r.jsx("div", { className: "flex-1 p-2 space-y-2", children: f.map((a) => /* @__PURE__ */ r.jsxs(
587
+ /* @__PURE__ */ r.jsx("div", { className: "flex-1 p-2 space-y-2", children: m.map((a) => /* @__PURE__ */ r.jsxs(
587
588
  "div",
588
589
  {
589
- className: F(
590
+ className: S(
590
591
  "px-3 py-2 rounded cursor-pointer hover:opacity-80",
591
- a.color || ee
592
+ a.color || te
592
593
  ),
593
594
  style: a.color && a.color.startsWith("#") ? { backgroundColor: a.color } : void 0,
594
595
  onClick: () => o?.(a),
@@ -611,7 +612,7 @@ function Oe({ date: e, events: n, onEventClick: o }) {
611
612
  ] }, s);
612
613
  }) }) });
613
614
  }
614
- function Pe(e) {
615
+ function Me(e) {
615
616
  return "data" in e && e.data ? e.data : "staticData" in e && e.staticData ? {
616
617
  provider: "value",
617
618
  items: e.staticData
@@ -620,17 +621,17 @@ function Pe(e) {
620
621
  object: e.objectName
621
622
  } : null;
622
623
  }
623
- function Me(e) {
624
+ function Ie(e) {
624
625
  if (e) {
625
626
  if (typeof e == "string") {
626
- const n = e.split(" "), o = n[0], m = n[1]?.toLowerCase() === "desc" ? "desc" : "asc";
627
- return { [o]: m };
627
+ const n = e.split(" "), o = n[0], f = n[1]?.toLowerCase() === "desc" ? "desc" : "asc";
628
+ return { [o]: f };
628
629
  }
629
630
  if (Array.isArray(e))
630
631
  return e.reduce((n, o) => (o.field && o.order && (n[o.field] = o.order), n), {});
631
632
  }
632
633
  }
633
- function Ie(e) {
634
+ function Ve(e) {
634
635
  return "filter" in e && e.filter && typeof e.filter == "object" && "calendar" in e.filter ? e.filter.calendar : e.calendar ? e.calendar : e.startDateField || e.dateField ? {
635
636
  startDateField: e.startDateField || e.dateField,
636
637
  endDateField: e.endDateField || e.endField,
@@ -639,127 +640,127 @@ function Ie(e) {
639
640
  allDayField: e.allDayField
640
641
  } : null;
641
642
  }
642
- const Ve = ({
643
+ const Le = ({
643
644
  schema: e,
644
645
  dataSource: n,
645
646
  className: o,
646
- onEventClick: m,
647
+ onEventClick: f,
647
648
  onDateClick: u,
648
649
  onNavigate: s,
649
- onViewChange: f,
650
+ onViewChange: m,
650
651
  ...a
651
652
  }) => {
652
- const [d, l] = O([]), [w, p] = O(!0), [b, N] = O(null), [P, M] = O(null), [_, I] = O(/* @__PURE__ */ new Date()), [$, c] = O("month"), h = Z(() => Pe(e), [
653
+ const [d, c] = A([]), [b, h] = A(!0), [p, j] = A(null), [O, P] = A(null), [_, M] = A(/* @__PURE__ */ new Date()), [$, I] = A("month"), l = Z(() => Me(e), [
653
654
  e.data,
654
655
  e.staticData,
655
656
  e.objectName
656
- ]), k = Z(() => Ie(e), [
657
+ ]), N = Z(() => Ve(e), [
657
658
  e.filter,
658
659
  e.calendar,
659
660
  e.dateField,
660
661
  e.endField,
661
662
  e.titleField,
662
663
  e.colorField
663
- ]), C = h?.provider === "value";
664
- ne(() => {
664
+ ]), k = l?.provider === "value";
665
+ le(() => {
665
666
  let g = !0;
666
667
  return (async () => {
667
668
  try {
668
669
  if (!g) return;
669
- if (p(!0), C && h?.provider === "value") {
670
- g && (l(h.items), p(!1));
670
+ if (h(!0), k && l?.provider === "value") {
671
+ g && (c(l.items), h(!1));
671
672
  return;
672
673
  }
673
674
  if (e.data || a.data) {
674
675
  const E = e.data || a.data;
675
676
  if (Array.isArray(E)) {
676
- l(E), p(!1);
677
+ c(E), h(!1);
677
678
  return;
678
679
  }
679
680
  }
680
681
  if (!n)
681
682
  throw new Error("DataSource required for object/api providers");
682
- if (h?.provider === "object") {
683
- const E = h.object, j = await n.find(E, {
683
+ if (l?.provider === "object") {
684
+ const E = l.object, w = await n.find(E, {
684
685
  $filter: e.filter,
685
- $orderby: Me(e.sort)
686
+ $orderby: Ie(e.sort)
686
687
  });
687
688
  let v = [];
688
- Array.isArray(j) ? v = j : j && typeof j == "object" && (Array.isArray(j.data) ? v = j.data : Array.isArray(j.value) && (v = j.value)), g && l(v);
689
- } else h?.provider === "api" && (console.warn("API provider not yet implemented for ObjectCalendar"), g && l([]));
690
- g && p(!1);
689
+ Array.isArray(w) ? v = w : w && typeof w == "object" && (Array.isArray(w.data) ? v = w.data : Array.isArray(w.value) && (v = w.value)), g && c(v);
690
+ } else l?.provider === "api" && (console.warn("API provider not yet implemented for ObjectCalendar"), g && c([]));
691
+ g && h(!1);
691
692
  } catch (E) {
692
- console.error("[ObjectCalendar] Error fetching data:", E), g && (N(E), p(!1));
693
+ console.error("[ObjectCalendar] Error fetching data:", E), g && (j(E), h(!1));
693
694
  }
694
695
  })(), () => {
695
696
  g = !1;
696
697
  };
697
- }, [h, n, C, e.filter, e.sort]), ne(() => {
698
- !C && n && (async () => {
698
+ }, [l, n, k, e.filter, e.sort]), le(() => {
699
+ !k && n && (async () => {
699
700
  try {
700
701
  if (!n) return;
701
- const S = h?.provider === "object" ? h.object : e.objectName;
702
- if (!S) return;
703
- const E = await n.getObjectSchema(S);
704
- M(E);
705
- } catch (S) {
706
- console.error("Failed to fetch object schema:", S);
702
+ const F = l?.provider === "object" ? l.object : e.objectName;
703
+ if (!F) return;
704
+ const E = await n.getObjectSchema(F);
705
+ P(E);
706
+ } catch (F) {
707
+ console.error("Failed to fetch object schema:", F);
707
708
  }
708
709
  })();
709
- }, [e.objectName, n, C, h]);
710
+ }, [e.objectName, n, k, l]);
710
711
  const J = Z(() => {
711
- if (!k || !d.length)
712
+ if (!N || !d.length)
712
713
  return [];
713
- const { startDateField: g, endDateField: S, titleField: E, colorField: j } = k;
714
+ const { startDateField: g, endDateField: F, titleField: E, colorField: w } = N;
714
715
  return d.map((v, X) => {
715
- const T = v[g], R = S ? v[S] : null, W = v[E] || "Untitled", U = j ? v[j] : void 0;
716
+ const C = v[g], T = F ? v[F] : null, W = v[E] || "Untitled", U = w ? v[w] : void 0;
716
717
  return {
717
718
  id: v.id || v._id || `event-${X}`,
718
719
  title: W,
719
- start: T ? new Date(T) : /* @__PURE__ */ new Date(),
720
- end: R ? new Date(R) : void 0,
720
+ start: C ? new Date(C) : /* @__PURE__ */ new Date(),
721
+ end: T ? new Date(T) : void 0,
721
722
  color: U,
722
- allDay: !R,
723
+ allDay: !T,
723
724
  // If no end date, treat as all-day event
724
725
  data: v
725
726
  };
726
727
  }).filter((v) => !isNaN(v.start.getTime()));
727
- }, [d, k]), G = pe(() => {
728
+ }, [d, N]), G = ge(() => {
728
729
  u?.(/* @__PURE__ */ new Date());
729
730
  }, [u]);
730
- return w ? /* @__PURE__ */ r.jsx("div", { className: o, 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..." }) }) }) : b ? /* @__PURE__ */ r.jsx("div", { className: o, children: /* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ r.jsxs("div", { className: "text-destructive", children: [
731
+ return b ? /* @__PURE__ */ r.jsx("div", { className: o, 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..." }) }) }) : p ? /* @__PURE__ */ r.jsx("div", { className: o, children: /* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ r.jsxs("div", { className: "text-destructive", children: [
731
732
  "Error: ",
732
- b.message
733
- ] }) }) }) : k ? /* @__PURE__ */ r.jsx("div", { className: o, children: /* @__PURE__ */ r.jsx("div", { className: "border rounded-lg bg-background h-[calc(100vh-200px)] min-h-[600px]", children: /* @__PURE__ */ r.jsx(
733
+ p.message
734
+ ] }) }) }) : N ? /* @__PURE__ */ r.jsx("div", { className: o, children: /* @__PURE__ */ r.jsx("div", { className: "border rounded-lg bg-background h-[calc(100vh-200px)] min-h-[600px]", children: /* @__PURE__ */ r.jsx(
734
735
  de,
735
736
  {
736
737
  events: J,
737
738
  currentDate: _,
738
739
  view: e.defaultView || "month",
739
- onEventClick: (g) => m?.(g.data),
740
+ onEventClick: (g) => f?.(g.data),
740
741
  onDateClick: u,
741
742
  onNavigate: (g) => {
742
- I(g), s?.(g);
743
+ M(g), s?.(g);
743
744
  },
744
745
  onViewChange: (g) => {
745
- c(g), f?.(g);
746
+ I(g), m?.(g);
746
747
  },
747
748
  onAddClick: G
748
749
  }
749
750
  ) }) }) : /* @__PURE__ */ r.jsx("div", { className: o, 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
751
  };
751
- ce.register(
752
+ ee.register(
752
753
  "calendar-view",
753
- ({ schema: e, className: n, onAction: o, ...m }) => {
754
- const u = se.useMemo(() => !e.data || !Array.isArray(e.data) ? [] : e.data.map((a, d) => {
755
- const l = e.titleField || "title", w = e.startDateField || "start", p = e.endDateField || "end", b = e.colorField || "color", N = e.allDayField || "allDay";
754
+ ({ schema: e, className: n, onAction: o, ...f }) => {
755
+ const u = ce.useMemo(() => !e.data || !Array.isArray(e.data) ? [] : e.data.map((a, d) => {
756
+ const c = e.titleField || "title", b = e.startDateField || "start", h = e.endDateField || "end", p = e.colorField || "color", j = e.allDayField || "allDay";
756
757
  return {
757
758
  id: a._id || a.id || d,
758
- title: a[l] || "Untitled Event",
759
- start: new Date(a[w]),
760
- end: a[p] ? new Date(a[p]) : void 0,
761
- allDay: a[N],
762
- color: a[b],
759
+ title: a[c] || "Untitled Event",
760
+ start: new Date(a[b]),
761
+ end: a[h] ? new Date(a[h]) : void 0,
762
+ allDay: a[j],
763
+ color: a[p],
763
764
  data: a
764
765
  };
765
766
  }), [e.data, e.titleField, e.startDateField, e.endDateField, e.colorField, e.allDayField]), s = (a) => {
@@ -767,7 +768,7 @@ ce.register(
767
768
  type: "event-click",
768
769
  payload: a
769
770
  });
770
- }, f = () => {
771
+ }, m = () => {
771
772
  o?.({
772
773
  type: "create",
773
774
  payload: {}
@@ -779,8 +780,8 @@ ce.register(
779
780
  className: n,
780
781
  events: u,
781
782
  onEventClick: s,
782
- onAddClick: f,
783
- ...m
783
+ onAddClick: m,
784
+ ...f
784
785
  }
785
786
  );
786
787
  },
@@ -895,14 +896,23 @@ ce.register(
895
896
  }
896
897
  }
897
898
  );
898
- const Le = ({ schema: e }) => {
899
- const { dataSource: n } = ge();
900
- return /* @__PURE__ */ r.jsx(Ve, { schema: e, dataSource: n });
899
+ const me = ({ schema: e }) => {
900
+ const { dataSource: n } = xe();
901
+ return /* @__PURE__ */ r.jsx(Le, { schema: e, dataSource: n });
901
902
  };
902
- ce.register("object-calendar", Le, {
903
+ ee.register("object-calendar", me, {
903
904
  namespace: "plugin-calendar",
904
905
  label: "Object Calendar",
905
- category: "plugin",
906
+ category: "view",
907
+ inputs: [
908
+ { name: "objectName", type: "string", label: "Object Name", required: !0 },
909
+ { name: "calendar", type: "object", label: "Calendar Config", description: "startDateField, endDateField, titleField, colorField" }
910
+ ]
911
+ });
912
+ ee.register("calendar", me, {
913
+ namespace: "view",
914
+ label: "Calendar View",
915
+ category: "view",
906
916
  inputs: [
907
917
  { name: "objectName", type: "string", label: "Object Name", required: !0 },
908
918
  { name: "calendar", type: "object", label: "Calendar Config", description: "startDateField, endDateField, titleField, colorField" }
@@ -910,6 +920,6 @@ ce.register("object-calendar", Le, {
910
920
  });
911
921
  export {
912
922
  de as CalendarView,
913
- Ve as ObjectCalendar,
914
- Le as ObjectCalendarRenderer
923
+ Le as ObjectCalendar,
924
+ me as ObjectCalendarRenderer
915
925
  };