prometeo-design-system 9.2.0 → 9.3.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/Calendar.es.js +712 -672
- package/dist/DesktopModal.es.js +2 -2
- package/dist/DialogModal.es.js +1 -1
- package/dist/Input.es.js +67 -61
- package/dist/Modal.es.js +2 -2
- package/dist/Select.es.js +838 -794
- package/dist/components/Calendar/TimeGridView.d.ts +3 -1
- package/dist/components/Select/DefaultGroupHeader.d.ts +2 -0
- package/dist/components/Select/DefaultOption.d.ts +2 -2
- package/dist/components/Select/MultiDisplay.d.ts +2 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/SelectDropdown.d.ts +3 -2
- package/dist/components/Select/SelectTrigger.d.ts +2 -1
- package/dist/components/Select/types.d.ts +26 -0
- package/dist/exports/Select.d.ts +1 -1
- package/dist/prometeo-design-system.es.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/{useModalControl-B2d5BuHI.js → useModalControl-BAUI_Hwx.js} +2 -2
- package/package.json +1 -1
- package/src/styles/utility-variants.css +0 -1
package/dist/Calendar.es.js
CHANGED
|
@@ -1,164 +1,164 @@
|
|
|
1
1
|
import { j as r } from "./jsx-runtime-CqQglQKg.js";
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { c as
|
|
2
|
+
import { useCallback as X, useRef as ee, useEffect as le, useState as he, useMemo as ae } from "react";
|
|
3
|
+
import { c as K } from "./cn-B6yFEsav.js";
|
|
4
4
|
import st from "./Button.es.js";
|
|
5
|
-
import
|
|
5
|
+
import Le from "./IconButton.es.js";
|
|
6
6
|
import { SegmentedButton as at } from "./SegmentedButton.es.js";
|
|
7
7
|
import { ArrowBack as ot } from "./Icon-ArrowBack.es.js";
|
|
8
8
|
import { ArrowForward as lt } from "./Icon-ArrowForward.es.js";
|
|
9
|
-
const it = 864e5,
|
|
10
|
-
function
|
|
9
|
+
const it = 864e5, $e = 1440, ct = /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{1,2}):(\d{2})(?::(\d{2}))?)?$/;
|
|
10
|
+
function re(e) {
|
|
11
11
|
if (e instanceof Date) return new Date(e.getTime());
|
|
12
12
|
if (typeof e == "number") return new Date(e);
|
|
13
13
|
const t = ct.exec(e.trim());
|
|
14
14
|
if (t) {
|
|
15
|
-
const [, n, s, a,
|
|
15
|
+
const [, n, s, a, u, f, b] = t;
|
|
16
16
|
return new Date(
|
|
17
17
|
Number(n),
|
|
18
18
|
Number(s) - 1,
|
|
19
19
|
Number(a),
|
|
20
|
-
Number(
|
|
20
|
+
Number(u ?? 0),
|
|
21
21
|
Number(f ?? 0),
|
|
22
|
-
Number(
|
|
22
|
+
Number(b ?? 0)
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
25
|
return new Date(e);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function de(e) {
|
|
28
28
|
return !Number.isNaN(e.getTime());
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Y(e) {
|
|
31
31
|
const t = new Date(e);
|
|
32
32
|
return t.setHours(0, 0, 0, 0), t;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function q(e) {
|
|
35
35
|
const t = new Date(e);
|
|
36
36
|
return t.setHours(23, 59, 59, 999), t;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function J(e, t) {
|
|
39
39
|
const n = new Date(e);
|
|
40
40
|
return n.setDate(n.getDate() + t), n;
|
|
41
41
|
}
|
|
42
42
|
function ut(e, t) {
|
|
43
43
|
return new Date(e.getTime() + t * 6e4);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Ve(e) {
|
|
46
46
|
return new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
47
47
|
}
|
|
48
48
|
function dt(e, t) {
|
|
49
49
|
const n = new Date(e), s = n.getDate();
|
|
50
|
-
return n.setDate(1), n.setMonth(n.getMonth() + t), n.setDate(Math.min(s,
|
|
50
|
+
return n.setDate(1), n.setMonth(n.getMonth() + t), n.setDate(Math.min(s, Ve(n))), n;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
const n =
|
|
54
|
-
return
|
|
52
|
+
function ge(e, t = 1) {
|
|
53
|
+
const n = Y(e), s = (n.getDay() - t + 7) % 7;
|
|
54
|
+
return J(n, -s);
|
|
55
55
|
}
|
|
56
56
|
function mt(e) {
|
|
57
|
-
const t =
|
|
57
|
+
const t = Y(e);
|
|
58
58
|
return t.setDate(1), t;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Me(e, t) {
|
|
61
61
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Be(e, t) {
|
|
64
64
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function xe(e) {
|
|
67
|
+
return Me(e, /* @__PURE__ */ new Date());
|
|
68
68
|
}
|
|
69
69
|
function ft(e) {
|
|
70
70
|
const t = e.getDay();
|
|
71
71
|
return t === 0 || t === 6;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function ie(e) {
|
|
74
74
|
return e.getHours() * 60 + e.getMinutes();
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function we(e, t) {
|
|
77
77
|
const n = /^(\d{1,2}):(\d{2})$/.exec(e.trim());
|
|
78
78
|
if (!n) return t;
|
|
79
79
|
const s = Number(n[1]) * 60 + Number(n[2]);
|
|
80
|
-
return Number.isFinite(s) ? Math.max(0, Math.min(
|
|
80
|
+
return Number.isFinite(s) ? Math.max(0, Math.min($e, s)) : t;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
const n =
|
|
82
|
+
function oe(e, t) {
|
|
83
|
+
const n = Y(e);
|
|
84
84
|
return n.setMinutes(t), n;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
const n = mt(e), s =
|
|
86
|
+
function Oe(e, t = 1) {
|
|
87
|
+
const n = mt(e), s = ge(n, t), a = Math.round(
|
|
88
88
|
(n.getTime() - s.getTime()) / it
|
|
89
|
-
),
|
|
89
|
+
), u = Math.ceil((a + Ve(e)) / 7);
|
|
90
90
|
return Array.from(
|
|
91
|
-
{ length:
|
|
92
|
-
(f,
|
|
91
|
+
{ length: u },
|
|
92
|
+
(f, b) => Array.from({ length: 7 }, (T, y) => J(s, b * 7 + y))
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
function pt(e, t = 1) {
|
|
96
|
-
const n =
|
|
97
|
-
return Array.from({ length: 7 }, (s, a) =>
|
|
96
|
+
const n = ge(e, t);
|
|
97
|
+
return Array.from({ length: 7 }, (s, a) => J(n, a));
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Ie(e, t, n = 1, s) {
|
|
100
100
|
switch (t) {
|
|
101
101
|
case "month": {
|
|
102
|
-
const a =
|
|
103
|
-
return { start: a[0][0], end:
|
|
102
|
+
const a = Oe(e, n), u = a[a.length - 1];
|
|
103
|
+
return { start: a[0][0], end: q(u[6]) };
|
|
104
104
|
}
|
|
105
105
|
case "day":
|
|
106
|
-
return { start:
|
|
106
|
+
return { start: Y(e), end: q(e) };
|
|
107
107
|
case "agenda": {
|
|
108
108
|
if (s && s > 0) {
|
|
109
|
-
const
|
|
110
|
-
return { start:
|
|
109
|
+
const u = Y(e);
|
|
110
|
+
return { start: u, end: q(J(u, s - 1)) };
|
|
111
111
|
}
|
|
112
|
-
const a =
|
|
113
|
-
return { start: a, end:
|
|
112
|
+
const a = ge(e, n);
|
|
113
|
+
return { start: a, end: q(J(a, 6)) };
|
|
114
114
|
}
|
|
115
115
|
case "week": {
|
|
116
|
-
const a =
|
|
117
|
-
return { start: a, end:
|
|
116
|
+
const a = ge(e, n);
|
|
117
|
+
return { start: a, end: q(J(a, 6)) };
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
function ht(e, t, n) {
|
|
122
|
-
const { start: s } =
|
|
123
|
-
return Array.from({ length: a }, (
|
|
122
|
+
const { start: s } = Ie(e, "agenda", t, n), a = n && n > 0 ? n : 7;
|
|
123
|
+
return Array.from({ length: a }, (u, f) => J(s, f));
|
|
124
124
|
}
|
|
125
125
|
function Ae(e, t, n, s) {
|
|
126
126
|
switch (t) {
|
|
127
127
|
case "month":
|
|
128
128
|
return dt(e, n);
|
|
129
129
|
case "week":
|
|
130
|
-
return
|
|
130
|
+
return J(e, 7 * n);
|
|
131
131
|
case "day":
|
|
132
|
-
return
|
|
132
|
+
return J(e, n);
|
|
133
133
|
case "agenda":
|
|
134
|
-
return
|
|
134
|
+
return J(e, (s && s > 0 ? s : 7) * n);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
const _e = /* @__PURE__ */ new Map();
|
|
138
|
-
function
|
|
138
|
+
function ce(e, t) {
|
|
139
139
|
const n = `${e}|${JSON.stringify(t)}`, s = _e.get(n);
|
|
140
140
|
if (s) return s;
|
|
141
141
|
const a = new Intl.DateTimeFormat(e, t);
|
|
142
142
|
return _e.set(n, a), a;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function ne(e) {
|
|
145
145
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
147
|
+
function me(e, t) {
|
|
148
|
+
return ce(t, {
|
|
149
149
|
hour: "2-digit",
|
|
150
150
|
minute: "2-digit",
|
|
151
151
|
hour12: !1
|
|
152
152
|
}).format(e);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
return
|
|
154
|
+
function Se(e, t, n = "short") {
|
|
155
|
+
return ce(t, { weekday: n }).format(e).replace(".", "");
|
|
156
156
|
}
|
|
157
157
|
function Re(e, t) {
|
|
158
|
-
return
|
|
158
|
+
return ce(t, { day: "numeric", month: "short" }).format(e).replace(".", "");
|
|
159
159
|
}
|
|
160
160
|
function gt(e, t) {
|
|
161
|
-
return
|
|
161
|
+
return ce(t, {
|
|
162
162
|
weekday: "long",
|
|
163
163
|
day: "numeric",
|
|
164
164
|
month: "long"
|
|
@@ -166,20 +166,20 @@ function gt(e, t) {
|
|
|
166
166
|
}
|
|
167
167
|
function xt(e, t, n, s = 1, a) {
|
|
168
168
|
if (t === "month")
|
|
169
|
-
return
|
|
170
|
-
|
|
169
|
+
return ne(
|
|
170
|
+
ce(n, { month: "long", year: "numeric" }).format(e)
|
|
171
171
|
);
|
|
172
172
|
if (t === "day")
|
|
173
|
-
return
|
|
174
|
-
const { start:
|
|
175
|
-
if (
|
|
176
|
-
const
|
|
177
|
-
return
|
|
178
|
-
`${
|
|
173
|
+
return ne(gt(e, n));
|
|
174
|
+
const { start: u, end: f } = Ie(e, t, s, a), b = f.getFullYear();
|
|
175
|
+
if (Be(u, f)) {
|
|
176
|
+
const T = ce(n, { month: "long" }).format(u);
|
|
177
|
+
return ne(
|
|
178
|
+
`${u.getDate()} – ${f.getDate()} de ${T} ${b}`
|
|
179
179
|
);
|
|
180
180
|
}
|
|
181
|
-
return
|
|
182
|
-
`${Re(
|
|
181
|
+
return ne(
|
|
182
|
+
`${Re(u, n)} – ${Re(f, n)} ${b}`
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
185
|
const yt = [
|
|
@@ -199,76 +199,76 @@ const vt = {
|
|
|
199
199
|
block: "absolute flex flex-col gap-0.5 overflow-hidden rounded-md border py-1 pr-1.5 pl-2 text-left",
|
|
200
200
|
row: "relative flex w-full items-start gap-2 overflow-hidden rounded-md border py-2 pr-3 pl-4 text-left"
|
|
201
201
|
};
|
|
202
|
-
function
|
|
202
|
+
function te({
|
|
203
203
|
resolved: e,
|
|
204
204
|
shape: t,
|
|
205
205
|
day: n,
|
|
206
206
|
view: s,
|
|
207
207
|
locale: a,
|
|
208
|
-
style:
|
|
208
|
+
style: u,
|
|
209
209
|
className: f,
|
|
210
|
-
onEventClick:
|
|
211
|
-
renderEvent:
|
|
210
|
+
onEventClick: b,
|
|
211
|
+
renderEvent: T,
|
|
212
212
|
clippedStart: y = !1,
|
|
213
213
|
clippedEnd: g = !1,
|
|
214
|
-
onMoveStart:
|
|
214
|
+
onMoveStart: h,
|
|
215
215
|
onResizeStart: S,
|
|
216
|
-
isDragging:
|
|
217
|
-
isGhost:
|
|
216
|
+
isDragging: F = !1,
|
|
217
|
+
isGhost: k = !1
|
|
218
218
|
}) {
|
|
219
|
-
const { event:
|
|
220
|
-
|
|
221
|
-
},
|
|
222
|
-
d &&
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
!
|
|
226
|
-
/* @__PURE__ */ r.jsx("span", { className: "truncate pyrion-fonts-label-small text-neutral-primary-default", children:
|
|
219
|
+
const { event: v, start: L, end: C, allDay: P } = e, N = v.disabled === !0, z = !!b && !N, R = C.getTime() < Date.now(), $ = bt(v.color), p = !$ && v.color ? v.color : void 0, i = me(L, a), c = me(C, a), m = P ? "Todo el día" : t === "chip" ? i : `${y ? "…" : ""}${i} – ${c}${g ? "…" : ""}`, d = !!h && !N && !k, D = !!S && !N && !k && t === "block", x = (j) => {
|
|
220
|
+
j.stopPropagation(), z && b?.(v, j);
|
|
221
|
+
}, l = (j) => {
|
|
222
|
+
d && h?.(e, j);
|
|
223
|
+
}, E = T ? T(v, { view: s, day: n, shape: t, isPast: R }) : t === "chip" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
224
|
+
v.tag && /* @__PURE__ */ r.jsx("span", { className: "pyrion-calendar-event-accent shrink-0 rounded-sm px-1 pyrion-fonts-label-small text-neutral-onsemantic-default", children: v.tag }),
|
|
225
|
+
!P && /* @__PURE__ */ r.jsx("span", { className: "pyrion-calendar-event-tint shrink-0 pyrion-fonts-body-xsmall tabular-nums", children: i }),
|
|
226
|
+
/* @__PURE__ */ r.jsx("span", { className: "truncate pyrion-fonts-label-small text-neutral-primary-default", children: v.title })
|
|
227
227
|
] }) : t === "row" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
228
228
|
/* @__PURE__ */ r.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
229
229
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
230
|
-
|
|
231
|
-
/* @__PURE__ */ r.jsx("span", { className: "truncate pyrion-fonts-label-large text-neutral-primary-default", children:
|
|
230
|
+
v.tag && /* @__PURE__ */ r.jsx("span", { className: "pyrion-calendar-event-accent shrink-0 rounded-sm px-1 pyrion-fonts-label-small text-neutral-onsemantic-default", children: v.tag }),
|
|
231
|
+
/* @__PURE__ */ r.jsx("span", { className: "truncate pyrion-fonts-label-large text-neutral-primary-default", children: v.title })
|
|
232
232
|
] }),
|
|
233
|
-
|
|
233
|
+
v.description && /* @__PURE__ */ r.jsx("p", { className: "mt-0.5 line-clamp-2 pyrion-fonts-body-small text-neutral-tertiary-default", children: v.description })
|
|
234
234
|
] }),
|
|
235
235
|
/* @__PURE__ */ r.jsx("span", { className: "pyrion-calendar-event-tint shrink-0 pyrion-fonts-body-small tabular-nums", children: m })
|
|
236
236
|
] }) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
237
237
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
238
|
-
|
|
238
|
+
v.tag && /* @__PURE__ */ r.jsx("span", { className: "pyrion-calendar-event-accent shrink-0 rounded-sm px-1 pyrion-fonts-label-small text-neutral-onsemantic-default", children: v.tag }),
|
|
239
239
|
/* @__PURE__ */ r.jsx("span", { className: "pyrion-calendar-event-tint truncate pyrion-fonts-body-xsmall tabular-nums", children: m })
|
|
240
240
|
] }),
|
|
241
|
-
/* @__PURE__ */ r.jsx("span", { className: "line-clamp-2 pyrion-fonts-label-medium text-neutral-primary-default", children:
|
|
242
|
-
|
|
241
|
+
/* @__PURE__ */ r.jsx("span", { className: "line-clamp-2 pyrion-fonts-label-medium text-neutral-primary-default", children: v.title }),
|
|
242
|
+
v.description && /* @__PURE__ */ r.jsx("span", { className: "line-clamp-1 pyrion-fonts-body-xsmall text-neutral-tertiary-default", children: v.description })
|
|
243
243
|
] });
|
|
244
244
|
return /* @__PURE__ */ r.jsxs(
|
|
245
245
|
"button",
|
|
246
246
|
{
|
|
247
247
|
type: "button",
|
|
248
|
-
tabIndex:
|
|
249
|
-
disabled:
|
|
250
|
-
"aria-label": `${
|
|
251
|
-
"data-color": $ ?
|
|
248
|
+
tabIndex: z ? 0 : -1,
|
|
249
|
+
disabled: N,
|
|
250
|
+
"aria-label": `${v.title}, ${m}`,
|
|
251
|
+
"data-color": $ ? v.color : void 0,
|
|
252
252
|
"data-shape": t,
|
|
253
|
-
"data-disabled":
|
|
254
|
-
"data-interactive":
|
|
255
|
-
"data-ghost":
|
|
256
|
-
className:
|
|
253
|
+
"data-disabled": N || void 0,
|
|
254
|
+
"data-interactive": z || void 0,
|
|
255
|
+
"data-ghost": k || void 0,
|
|
256
|
+
className: K(
|
|
257
257
|
"pyrion-calendar-event",
|
|
258
258
|
vt[t],
|
|
259
|
-
|
|
259
|
+
z ? "cursor-pointer" : "cursor-default",
|
|
260
260
|
d && "cursor-grab touch-none active:cursor-grabbing",
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
F && "opacity-40",
|
|
262
|
+
k && "pyrion-calendar-event-ghost pointer-events-none",
|
|
263
263
|
"focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[color:var(--border-brand-onneutral-default)]",
|
|
264
264
|
f
|
|
265
265
|
),
|
|
266
|
-
style:
|
|
267
|
-
...
|
|
268
|
-
"--pyrion-calendar-event-color":
|
|
269
|
-
} :
|
|
266
|
+
style: p ? {
|
|
267
|
+
...u,
|
|
268
|
+
"--pyrion-calendar-event-color": p
|
|
269
|
+
} : u,
|
|
270
270
|
onClick: x,
|
|
271
|
-
onPointerDown:
|
|
271
|
+
onPointerDown: l,
|
|
272
272
|
children: [
|
|
273
273
|
t !== "chip" && /* @__PURE__ */ r.jsx(
|
|
274
274
|
"span",
|
|
@@ -277,13 +277,13 @@ function Z({
|
|
|
277
277
|
className: "pyrion-calendar-event-accent absolute inset-y-0 left-0 w-[3px]"
|
|
278
278
|
}
|
|
279
279
|
),
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
E,
|
|
281
|
+
D && /* @__PURE__ */ r.jsx(
|
|
282
282
|
"span",
|
|
283
283
|
{
|
|
284
284
|
"aria-hidden": "true",
|
|
285
|
-
onPointerDown: (
|
|
286
|
-
|
|
285
|
+
onPointerDown: (j) => {
|
|
286
|
+
j.stopPropagation(), S?.(e, j);
|
|
287
287
|
},
|
|
288
288
|
className: "pyrion-calendar-resize-handle absolute inset-x-0 bottom-0 h-2 cursor-ns-resize touch-none"
|
|
289
289
|
}
|
|
@@ -292,21 +292,21 @@ function Z({
|
|
|
292
292
|
}
|
|
293
293
|
);
|
|
294
294
|
}
|
|
295
|
-
|
|
295
|
+
te.displayName = "CalendarEventItem";
|
|
296
296
|
function wt(e, t) {
|
|
297
297
|
const n = [];
|
|
298
298
|
for (const s of e) {
|
|
299
299
|
if (s?.start === void 0 || s.start === null || s.start === "")
|
|
300
300
|
continue;
|
|
301
|
-
const a =
|
|
302
|
-
if (!
|
|
301
|
+
const a = re(s.start);
|
|
302
|
+
if (!de(a)) continue;
|
|
303
303
|
if (s.allDay === !0) {
|
|
304
|
-
const
|
|
305
|
-
n.push({ event: s, start:
|
|
304
|
+
const T = s.end === void 0 ? null : re(s.end), y = T && de(T) && T.getTime() > a.getTime() ? q(T) : q(a);
|
|
305
|
+
n.push({ event: s, start: Y(a), end: y, allDay: !0 });
|
|
306
306
|
continue;
|
|
307
307
|
}
|
|
308
|
-
const f = s.end === void 0 ? null :
|
|
309
|
-
n.push({ event: s, start: a, end:
|
|
308
|
+
const f = s.end === void 0 ? null : re(s.end), b = f && de(f) && f.getTime() > a.getTime() ? f : ut(a, t);
|
|
309
|
+
n.push({ event: s, start: a, end: b, allDay: !1 });
|
|
310
310
|
}
|
|
311
311
|
return n;
|
|
312
312
|
}
|
|
@@ -315,81 +315,81 @@ function Tt(e, t) {
|
|
|
315
315
|
const n = e.start.getTime() - t.start.getTime();
|
|
316
316
|
return n !== 0 ? n : t.end.getTime() - e.end.getTime();
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
const n =
|
|
318
|
+
function ke(e, t) {
|
|
319
|
+
const n = Y(t).getTime(), s = q(t).getTime();
|
|
320
320
|
return e.filter(
|
|
321
321
|
(a) => a.start.getTime() <= s && a.end.getTime() >= n
|
|
322
322
|
).sort(Tt);
|
|
323
323
|
}
|
|
324
324
|
function Dt(e, t, n, s) {
|
|
325
|
-
const a = [],
|
|
325
|
+
const a = [], u = [];
|
|
326
326
|
for (const f of e) {
|
|
327
327
|
if (f.allDay) {
|
|
328
328
|
a.push(f);
|
|
329
329
|
continue;
|
|
330
330
|
}
|
|
331
|
-
|
|
331
|
+
He(f, t, n, s) ? u.push(f) : a.push(f);
|
|
332
332
|
}
|
|
333
|
-
return { topRow: a, timed:
|
|
333
|
+
return { topRow: a, timed: u };
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
const
|
|
337
|
-
if (e.start.getTime() > f || e.end.getTime() <
|
|
335
|
+
function He(e, t, n, s) {
|
|
336
|
+
const u = Y(t).getTime(), f = q(t).getTime();
|
|
337
|
+
if (e.start.getTime() > f || e.end.getTime() < u)
|
|
338
338
|
return null;
|
|
339
|
-
const
|
|
340
|
-
return S <= n && g <= n ||
|
|
341
|
-
startMinutes:
|
|
339
|
+
const b = e.start.getTime() < u, T = e.end.getTime() > f, y = b ? 0 : ie(e.start), g = T ? $e : ie(e.end), h = Math.max(y, n), S = Math.min(Math.max(g, y), s);
|
|
340
|
+
return S <= n && g <= n || h >= s ? null : {
|
|
341
|
+
startMinutes: h,
|
|
342
342
|
endMinutes: S,
|
|
343
|
-
clippedStart:
|
|
344
|
-
clippedEnd:
|
|
343
|
+
clippedStart: b || y < n,
|
|
344
|
+
clippedEnd: T || g > s
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
347
|
function Nt(e, t, n, s) {
|
|
348
|
-
const a = Math.max(1, s - n),
|
|
348
|
+
const a = Math.max(1, s - n), u = [];
|
|
349
349
|
for (const g of e) {
|
|
350
|
-
const
|
|
351
|
-
|
|
350
|
+
const h = He(g, t, n, s);
|
|
351
|
+
h && u.push({ item: g, segment: h });
|
|
352
352
|
}
|
|
353
|
-
|
|
354
|
-
const S = g.segment.startMinutes -
|
|
355
|
-
return S !== 0 ? S :
|
|
353
|
+
u.sort((g, h) => {
|
|
354
|
+
const S = g.segment.startMinutes - h.segment.startMinutes;
|
|
355
|
+
return S !== 0 ? S : h.segment.endMinutes - g.segment.endMinutes;
|
|
356
356
|
});
|
|
357
357
|
const f = [];
|
|
358
|
-
let
|
|
358
|
+
let b = [], T = -1;
|
|
359
359
|
const y = () => {
|
|
360
|
-
if (
|
|
361
|
-
const g = [],
|
|
362
|
-
|
|
363
|
-
let L = g.findIndex((
|
|
364
|
-
L === -1 ? (L = g.length, g.push(
|
|
360
|
+
if (b.length === 0) return;
|
|
361
|
+
const g = [], h = /* @__PURE__ */ new Map();
|
|
362
|
+
b.forEach((k, v) => {
|
|
363
|
+
let L = g.findIndex((C) => C <= k.segment.startMinutes);
|
|
364
|
+
L === -1 ? (L = g.length, g.push(k.segment.endMinutes)) : g[L] = k.segment.endMinutes, h.set(v, L);
|
|
365
365
|
});
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
const L =
|
|
366
|
+
const F = 100 / Math.max(1, g.length);
|
|
367
|
+
b.forEach((k, v) => {
|
|
368
|
+
const L = h.get(v) ?? 0, { segment: C } = k, P = (C.endMinutes - C.startMinutes) / a * 100;
|
|
369
369
|
f.push({
|
|
370
|
-
resolved:
|
|
371
|
-
top: (
|
|
372
|
-
height: Math.max(
|
|
373
|
-
left: L *
|
|
374
|
-
width:
|
|
375
|
-
clippedStart:
|
|
376
|
-
clippedEnd:
|
|
370
|
+
resolved: k.item,
|
|
371
|
+
top: (C.startMinutes - n) / a * 100,
|
|
372
|
+
height: Math.max(P, 1.2),
|
|
373
|
+
left: L * F,
|
|
374
|
+
width: F,
|
|
375
|
+
clippedStart: C.clippedStart,
|
|
376
|
+
clippedEnd: C.clippedEnd
|
|
377
377
|
});
|
|
378
|
-
}),
|
|
378
|
+
}), b = [];
|
|
379
379
|
};
|
|
380
|
-
for (const g of
|
|
381
|
-
|
|
380
|
+
for (const g of u)
|
|
381
|
+
b.length > 0 && g.segment.startMinutes >= T && (y(), T = -1), b.push(g), T = Math.max(T, g.segment.endMinutes);
|
|
382
382
|
return y(), f;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function Xe({
|
|
385
385
|
days: e,
|
|
386
386
|
events: t,
|
|
387
387
|
locale: n,
|
|
388
388
|
isLoading: s,
|
|
389
389
|
emptyState: a,
|
|
390
|
-
onDayClick:
|
|
390
|
+
onDayClick: u,
|
|
391
391
|
onEventClick: f,
|
|
392
|
-
renderEvent:
|
|
392
|
+
renderEvent: b
|
|
393
393
|
}) {
|
|
394
394
|
if (s)
|
|
395
395
|
return /* @__PURE__ */ r.jsx("div", { className: "flex flex-col gap-2 p-2", children: Array.from({ length: 5 }, (y, g) => /* @__PURE__ */ r.jsx(
|
|
@@ -399,34 +399,34 @@ function He({
|
|
|
399
399
|
},
|
|
400
400
|
g
|
|
401
401
|
)) });
|
|
402
|
-
const
|
|
403
|
-
return
|
|
404
|
-
const
|
|
402
|
+
const T = e.map((y) => ({ day: y, dayEvents: ke(t, y) })).filter((y) => y.dayEvents.length > 0);
|
|
403
|
+
return T.length === 0 ? /* @__PURE__ */ r.jsx("div", { className: "flex h-full min-h-40 items-center justify-center p-6 text-center pyrion-fonts-body-medium text-neutral-tertiary-default", children: a ?? "No hay eventos en este período." }) : /* @__PURE__ */ r.jsx("div", { className: "flex h-full min-h-0 flex-col overflow-y-auto pyrion-scrollbar-thin", children: T.map(({ day: y, dayEvents: g }) => {
|
|
404
|
+
const h = xe(y);
|
|
405
405
|
return /* @__PURE__ */ r.jsxs("section", { className: "flex flex-col", children: [
|
|
406
406
|
/* @__PURE__ */ r.jsxs(
|
|
407
407
|
"header",
|
|
408
408
|
{
|
|
409
|
-
...
|
|
409
|
+
...u ? {
|
|
410
410
|
role: "button",
|
|
411
411
|
tabIndex: 0,
|
|
412
|
-
onClick: (S) =>
|
|
412
|
+
onClick: (S) => u(y, S)
|
|
413
413
|
} : {},
|
|
414
|
-
className:
|
|
414
|
+
className: K(
|
|
415
415
|
"sticky top-0 z-1 flex items-center gap-2 border-b border-neutral-default-default bg-neutral-primary-default px-3 py-2",
|
|
416
|
-
|
|
416
|
+
u && "cursor-pointer hover:bg-neutral-primary-hover"
|
|
417
417
|
),
|
|
418
418
|
children: [
|
|
419
419
|
/* @__PURE__ */ r.jsx(
|
|
420
420
|
"span",
|
|
421
421
|
{
|
|
422
|
-
className:
|
|
422
|
+
className: K(
|
|
423
423
|
"flex h-7 min-w-7 items-center justify-center rounded-full px-1 pyrion-fonts-label-large tabular-nums",
|
|
424
|
-
|
|
424
|
+
h ? "bg-brand-primary-default text-neutral-onbrandprimary-default" : "text-neutral-primary-default"
|
|
425
425
|
),
|
|
426
426
|
children: y.getDate()
|
|
427
427
|
}
|
|
428
428
|
),
|
|
429
|
-
/* @__PURE__ */ r.jsx("span", { className: "pyrion-fonts-label-large text-neutral-primary-default", children:
|
|
429
|
+
/* @__PURE__ */ r.jsx("span", { className: "pyrion-fonts-label-large text-neutral-primary-default", children: ne(Se(y, n, "long")) }),
|
|
430
430
|
/* @__PURE__ */ r.jsxs("span", { className: "ml-auto pyrion-fonts-body-small text-neutral-tertiary-default", children: [
|
|
431
431
|
g.length,
|
|
432
432
|
" ",
|
|
@@ -436,7 +436,7 @@ function He({
|
|
|
436
436
|
}
|
|
437
437
|
),
|
|
438
438
|
/* @__PURE__ */ r.jsx("div", { className: "flex flex-col gap-1 p-2", children: g.map((S) => /* @__PURE__ */ r.jsx(
|
|
439
|
-
|
|
439
|
+
te,
|
|
440
440
|
{
|
|
441
441
|
resolved: S,
|
|
442
442
|
shape: "row",
|
|
@@ -444,14 +444,14 @@ function He({
|
|
|
444
444
|
view: "agenda",
|
|
445
445
|
locale: n,
|
|
446
446
|
onEventClick: f,
|
|
447
|
-
renderEvent:
|
|
447
|
+
renderEvent: b
|
|
448
448
|
},
|
|
449
449
|
`${S.event.id}-${y.getTime()}`
|
|
450
450
|
)) })
|
|
451
451
|
] }, y.getTime());
|
|
452
452
|
}) });
|
|
453
453
|
}
|
|
454
|
-
|
|
454
|
+
Xe.displayName = "AgendaView";
|
|
455
455
|
const Ee = {
|
|
456
456
|
month: "Mes",
|
|
457
457
|
week: "Semana",
|
|
@@ -464,10 +464,10 @@ function Ue({
|
|
|
464
464
|
views: n,
|
|
465
465
|
onViewChange: s,
|
|
466
466
|
onPrev: a,
|
|
467
|
-
onNext:
|
|
467
|
+
onNext: u,
|
|
468
468
|
onToday: f,
|
|
469
|
-
actionSlot:
|
|
470
|
-
className:
|
|
469
|
+
actionSlot: b,
|
|
470
|
+
className: T
|
|
471
471
|
}) {
|
|
472
472
|
const y = n.map((g) => ({
|
|
473
473
|
label: Ee[g],
|
|
@@ -476,9 +476,9 @@ function Ue({
|
|
|
476
476
|
return /* @__PURE__ */ r.jsxs(
|
|
477
477
|
"div",
|
|
478
478
|
{
|
|
479
|
-
className:
|
|
479
|
+
className: K(
|
|
480
480
|
"flex flex-wrap items-center justify-between gap-2 pb-2",
|
|
481
|
-
|
|
481
|
+
T
|
|
482
482
|
),
|
|
483
483
|
children: [
|
|
484
484
|
y.length > 1 ? /* @__PURE__ */ r.jsx(
|
|
@@ -489,12 +489,12 @@ function Ue({
|
|
|
489
489
|
color: "brand",
|
|
490
490
|
options: y,
|
|
491
491
|
value: t,
|
|
492
|
-
onChange: (g,
|
|
492
|
+
onChange: (g, h) => s(h)
|
|
493
493
|
}
|
|
494
494
|
) : /* @__PURE__ */ r.jsx("span", { className: "pyrion-fonts-label-large text-neutral-tertiary-default", children: Ee[t] }),
|
|
495
495
|
/* @__PURE__ */ r.jsxs("div", { className: "order-last flex w-full items-center justify-between gap-1 sm:order-none sm:w-auto sm:justify-center", children: [
|
|
496
496
|
/* @__PURE__ */ r.jsx(
|
|
497
|
-
|
|
497
|
+
Le,
|
|
498
498
|
{
|
|
499
499
|
icon: ot,
|
|
500
500
|
size: "small",
|
|
@@ -513,14 +513,14 @@ function Ue({
|
|
|
513
513
|
}
|
|
514
514
|
),
|
|
515
515
|
/* @__PURE__ */ r.jsx(
|
|
516
|
-
|
|
516
|
+
Le,
|
|
517
517
|
{
|
|
518
518
|
icon: lt,
|
|
519
519
|
size: "small",
|
|
520
520
|
variant: "text",
|
|
521
521
|
color: "neutral",
|
|
522
522
|
"aria-label": "Período siguiente",
|
|
523
|
-
onClick:
|
|
523
|
+
onClick: u
|
|
524
524
|
}
|
|
525
525
|
)
|
|
526
526
|
] }),
|
|
@@ -535,14 +535,14 @@ function Ue({
|
|
|
535
535
|
onClick: f
|
|
536
536
|
}
|
|
537
537
|
),
|
|
538
|
-
|
|
538
|
+
b
|
|
539
539
|
] })
|
|
540
540
|
]
|
|
541
541
|
}
|
|
542
542
|
);
|
|
543
543
|
}
|
|
544
544
|
Ue.displayName = "CalendarToolbar";
|
|
545
|
-
const
|
|
545
|
+
const Te = "data-pyrion-calendar-day";
|
|
546
546
|
function jt() {
|
|
547
547
|
return /* @__PURE__ */ r.jsx("div", { className: "h-5 w-full animate-pulse rounded-md bg-neutral-tertiary-default" });
|
|
548
548
|
}
|
|
@@ -552,51 +552,51 @@ function We({
|
|
|
552
552
|
events: n,
|
|
553
553
|
locale: s,
|
|
554
554
|
maxEventsPerDay: a,
|
|
555
|
-
isLoading:
|
|
555
|
+
isLoading: u,
|
|
556
556
|
onDayClick: f,
|
|
557
|
-
onEventClick:
|
|
558
|
-
onShowMore:
|
|
557
|
+
onEventClick: b,
|
|
558
|
+
onShowMore: T,
|
|
559
559
|
renderEvent: y,
|
|
560
560
|
renderDayAction: g,
|
|
561
|
-
drag:
|
|
561
|
+
drag: h,
|
|
562
562
|
editable: S,
|
|
563
|
-
selectable:
|
|
563
|
+
selectable: F
|
|
564
564
|
}) {
|
|
565
|
-
const
|
|
566
|
-
f && (
|
|
567
|
-
}, L =
|
|
568
|
-
($,
|
|
569
|
-
const
|
|
570
|
-
if (!
|
|
571
|
-
const m = Number(
|
|
565
|
+
const k = t[0] ?? [], v = ($) => (p) => {
|
|
566
|
+
f && (p.key !== "Enter" && p.key !== " " || (p.preventDefault(), f($, p)));
|
|
567
|
+
}, L = X(
|
|
568
|
+
($, p) => {
|
|
569
|
+
const c = document.elementFromPoint($, p)?.closest(`[${Te}]`);
|
|
570
|
+
if (!c) return null;
|
|
571
|
+
const m = Number(c.getAttribute(Te));
|
|
572
572
|
return Number.isFinite(m) ? { day: new Date(m), minutes: null } : null;
|
|
573
573
|
},
|
|
574
574
|
[]
|
|
575
|
-
),
|
|
575
|
+
), C = ($, p) => h.startDrag({
|
|
576
576
|
kind: "move",
|
|
577
|
-
pointerEvent:
|
|
577
|
+
pointerEvent: p,
|
|
578
578
|
resolve: L,
|
|
579
579
|
resolved: $
|
|
580
|
-
}),
|
|
581
|
-
if (!
|
|
582
|
-
const
|
|
583
|
-
|
|
580
|
+
}), P = ($) => {
|
|
581
|
+
if (!F) return;
|
|
582
|
+
const p = L($.clientX, $.clientY);
|
|
583
|
+
p && h.startDrag({
|
|
584
584
|
kind: "select",
|
|
585
585
|
pointerEvent: $,
|
|
586
586
|
resolve: L,
|
|
587
|
-
origin:
|
|
587
|
+
origin: p
|
|
588
588
|
});
|
|
589
|
-
}, { preview:
|
|
590
|
-
if (!
|
|
591
|
-
const
|
|
592
|
-
return
|
|
589
|
+
}, { preview: N } = h, z = N && N.eventId !== null ? n.find(($) => $.event.id === N.eventId) : void 0, R = ($) => {
|
|
590
|
+
if (!N || N.eventId !== null) return !1;
|
|
591
|
+
const p = Y($).getTime();
|
|
592
|
+
return p >= Y(N.start).getTime() && p <= Y(N.end).getTime();
|
|
593
593
|
};
|
|
594
594
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
595
|
-
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 border-b border-neutral-default-default", children:
|
|
595
|
+
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7 border-b border-neutral-default-default", children: k.map(($) => /* @__PURE__ */ r.jsx(
|
|
596
596
|
"div",
|
|
597
597
|
{
|
|
598
598
|
className: "px-2 py-1.5 text-center pyrion-fonts-label-small text-neutral-tertiary-default",
|
|
599
|
-
children:
|
|
599
|
+
children: ne(Se($, s))
|
|
600
600
|
},
|
|
601
601
|
$.getTime()
|
|
602
602
|
)) }),
|
|
@@ -605,97 +605,106 @@ function We({
|
|
|
605
605
|
{
|
|
606
606
|
className: "grid min-h-0 flex-1 border-l border-t border-neutral-default-default",
|
|
607
607
|
style: { gridTemplateRows: `repeat(${t.length}, minmax(0, 1fr))` },
|
|
608
|
-
children: t.map(($) => /* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7", children: $.map((
|
|
609
|
-
const
|
|
608
|
+
children: t.map(($) => /* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-7", children: $.map((p, i) => {
|
|
609
|
+
const c = !Be(p, e), m = ke(n, p), d = m.slice(0, a), D = m.length - d.length, x = xe(p);
|
|
610
610
|
return /* @__PURE__ */ r.jsxs(
|
|
611
611
|
"div",
|
|
612
612
|
{
|
|
613
|
-
[
|
|
613
|
+
[Te]: String(p.getTime()),
|
|
614
614
|
...f ? {
|
|
615
615
|
role: "button",
|
|
616
616
|
tabIndex: 0,
|
|
617
|
-
onClick: (
|
|
618
|
-
onKeyDown: p
|
|
617
|
+
onClick: (l) => f(p, l),
|
|
618
|
+
onKeyDown: v(p)
|
|
619
619
|
} : {},
|
|
620
|
-
onPointerDown:
|
|
621
|
-
"aria-label":
|
|
622
|
-
className:
|
|
620
|
+
onPointerDown: F ? P : void 0,
|
|
621
|
+
"aria-label": p.toLocaleDateString(s),
|
|
622
|
+
className: K(
|
|
623
623
|
"group flex min-h-24 flex-col gap-1 overflow-hidden border-r border-b border-neutral-default-default p-1",
|
|
624
624
|
"focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[color:var(--border-brand-onneutral-default)]",
|
|
625
|
-
(
|
|
625
|
+
(c || ft(p)) && "pyrion-calendar-muted-surface",
|
|
626
626
|
f && "cursor-pointer hover:bg-neutral-default-hover",
|
|
627
|
-
|
|
628
|
-
|
|
627
|
+
F && "touch-none",
|
|
628
|
+
R(p) && "pyrion-calendar-selection-cell"
|
|
629
629
|
),
|
|
630
630
|
children: [
|
|
631
631
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-between gap-1", children: [
|
|
632
632
|
/* @__PURE__ */ r.jsx(
|
|
633
633
|
"span",
|
|
634
634
|
{
|
|
635
|
-
className:
|
|
635
|
+
className: K(
|
|
636
636
|
"flex h-6 min-w-6 items-center justify-center rounded-full px-1 pyrion-fonts-label-medium tabular-nums",
|
|
637
637
|
x && "bg-brand-primary-default text-neutral-onbrandprimary-default",
|
|
638
|
-
!x &&
|
|
639
|
-
!x && !
|
|
638
|
+
!x && c && "text-disabled-default",
|
|
639
|
+
!x && !c && "text-neutral-secondary-default"
|
|
640
640
|
),
|
|
641
|
-
children:
|
|
641
|
+
children: p.getDate()
|
|
642
642
|
}
|
|
643
643
|
),
|
|
644
|
-
g && /* @__PURE__ */ r.jsx(
|
|
644
|
+
g && /* @__PURE__ */ r.jsx(
|
|
645
|
+
"span",
|
|
646
|
+
{
|
|
647
|
+
className: "opacity-100",
|
|
648
|
+
onClick: (l) => l.stopPropagation(),
|
|
649
|
+
onKeyDown: (l) => l.stopPropagation(),
|
|
650
|
+
onPointerDown: (l) => l.stopPropagation(),
|
|
651
|
+
children: g(p)
|
|
652
|
+
}
|
|
653
|
+
)
|
|
645
654
|
] }),
|
|
646
655
|
/* @__PURE__ */ r.jsxs("div", { className: "flex min-h-0 flex-col gap-0.5 overflow-hidden", children: [
|
|
647
|
-
|
|
648
|
-
{ length:
|
|
649
|
-
(
|
|
650
|
-
) : d.map((
|
|
651
|
-
|
|
656
|
+
u ? Array.from(
|
|
657
|
+
{ length: i % 3 === 0 ? 2 : 1 },
|
|
658
|
+
(l, E) => /* @__PURE__ */ r.jsx(jt, {}, E)
|
|
659
|
+
) : d.map((l) => /* @__PURE__ */ r.jsx(
|
|
660
|
+
te,
|
|
652
661
|
{
|
|
653
|
-
resolved:
|
|
662
|
+
resolved: l,
|
|
654
663
|
shape: "chip",
|
|
655
|
-
day:
|
|
664
|
+
day: p,
|
|
656
665
|
view: "month",
|
|
657
666
|
locale: s,
|
|
658
|
-
onEventClick:
|
|
667
|
+
onEventClick: b,
|
|
659
668
|
renderEvent: y,
|
|
660
|
-
onMoveStart: S ?
|
|
661
|
-
isDragging:
|
|
669
|
+
onMoveStart: S ? C : void 0,
|
|
670
|
+
isDragging: h.draggingId === l.event.id
|
|
662
671
|
},
|
|
663
|
-
`${
|
|
672
|
+
`${l.event.id}-${p.getTime()}`
|
|
664
673
|
)),
|
|
665
|
-
|
|
666
|
-
|
|
674
|
+
z && N && Y(N.start).getTime() === Y(p).getTime() && /* @__PURE__ */ r.jsx(
|
|
675
|
+
te,
|
|
667
676
|
{
|
|
668
677
|
resolved: {
|
|
669
|
-
...
|
|
670
|
-
start:
|
|
671
|
-
end:
|
|
672
|
-
allDay:
|
|
678
|
+
...z,
|
|
679
|
+
start: N.start,
|
|
680
|
+
end: N.end,
|
|
681
|
+
allDay: N.allDay
|
|
673
682
|
},
|
|
674
683
|
shape: "chip",
|
|
675
|
-
day:
|
|
684
|
+
day: p,
|
|
676
685
|
view: "month",
|
|
677
686
|
locale: s,
|
|
678
687
|
isGhost: !0
|
|
679
688
|
}
|
|
680
689
|
),
|
|
681
|
-
!
|
|
690
|
+
!u && D > 0 && /* @__PURE__ */ r.jsxs(
|
|
682
691
|
"button",
|
|
683
692
|
{
|
|
684
693
|
type: "button",
|
|
685
694
|
className: "rounded-sm px-1 text-left pyrion-fonts-label-small text-brand-onneutral-default hover:text-brand-onneutral-hover",
|
|
686
|
-
onClick: (
|
|
687
|
-
if (
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
m.map((
|
|
695
|
+
onClick: (l) => {
|
|
696
|
+
if (l.stopPropagation(), T) {
|
|
697
|
+
T(
|
|
698
|
+
p,
|
|
699
|
+
m.map((E) => E.event)
|
|
691
700
|
);
|
|
692
701
|
return;
|
|
693
702
|
}
|
|
694
|
-
f?.(
|
|
703
|
+
f?.(p, l);
|
|
695
704
|
},
|
|
696
705
|
children: [
|
|
697
706
|
"+",
|
|
698
|
-
|
|
707
|
+
D,
|
|
699
708
|
" más"
|
|
700
709
|
]
|
|
701
710
|
}
|
|
@@ -703,7 +712,7 @@ function We({
|
|
|
703
712
|
] })
|
|
704
713
|
]
|
|
705
714
|
},
|
|
706
|
-
|
|
715
|
+
p.getTime()
|
|
707
716
|
);
|
|
708
717
|
}) }, $[0].getTime()))
|
|
709
718
|
}
|
|
@@ -711,121 +720,123 @@ function We({
|
|
|
711
720
|
] });
|
|
712
721
|
}
|
|
713
722
|
We.displayName = "MonthView";
|
|
714
|
-
const
|
|
723
|
+
const De = 56, Ne = "data-pyrion-calendar-column", je = "data-pyrion-calendar-allday";
|
|
715
724
|
function Ge({
|
|
716
725
|
view: e,
|
|
717
726
|
days: t,
|
|
718
727
|
events: n,
|
|
719
728
|
locale: s,
|
|
720
729
|
minMinutes: a,
|
|
721
|
-
maxMinutes:
|
|
730
|
+
maxMinutes: u,
|
|
722
731
|
slotDuration: f,
|
|
723
|
-
slotHeight:
|
|
724
|
-
scrollToMinutes:
|
|
732
|
+
slotHeight: b,
|
|
733
|
+
scrollToMinutes: T,
|
|
725
734
|
nowIndicator: y,
|
|
726
735
|
isLoading: g,
|
|
727
|
-
onDayClick:
|
|
736
|
+
onDayClick: h,
|
|
728
737
|
onSlotClick: S,
|
|
729
|
-
onEventClick:
|
|
730
|
-
renderEvent:
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
738
|
+
onEventClick: F,
|
|
739
|
+
renderEvent: k,
|
|
740
|
+
maxAllDayEvents: v,
|
|
741
|
+
onShowMore: L,
|
|
742
|
+
drag: C,
|
|
743
|
+
editable: P,
|
|
744
|
+
selectable: N
|
|
734
745
|
}) {
|
|
735
|
-
const
|
|
736
|
-
|
|
746
|
+
const z = ee(null), R = Math.max(1, u - a), p = Math.ceil(R / f) * b, i = b * 60 / f;
|
|
747
|
+
le(() => {
|
|
737
748
|
const o = Math.max(
|
|
738
749
|
0,
|
|
739
|
-
(
|
|
750
|
+
(T - a) / R * p
|
|
740
751
|
);
|
|
741
752
|
if (o === 0) return;
|
|
742
|
-
const
|
|
743
|
-
if (!
|
|
753
|
+
const w = z.current;
|
|
754
|
+
if (!w) return;
|
|
744
755
|
let M = !1;
|
|
745
756
|
const O = new ResizeObserver(() => {
|
|
746
|
-
M || (
|
|
757
|
+
M || (w.scrollTop = o, Math.abs(w.scrollTop - o) < 1 && (M = !0, O.disconnect()));
|
|
747
758
|
});
|
|
748
|
-
if (
|
|
749
|
-
return O.observe(
|
|
750
|
-
}, [
|
|
751
|
-
const
|
|
752
|
-
for (let o =
|
|
753
|
-
|
|
754
|
-
const
|
|
755
|
-
const
|
|
756
|
-
|
|
759
|
+
if (w.scrollTop = o, !(Math.abs(w.scrollTop - o) < 1))
|
|
760
|
+
return O.observe(w), () => O.disconnect();
|
|
761
|
+
}, [T, a, R, p]);
|
|
762
|
+
const c = [], m = Math.ceil(a / 60) * 60;
|
|
763
|
+
for (let o = m; o < u; o += 60)
|
|
764
|
+
c.push(o);
|
|
765
|
+
const d = t.map((o) => {
|
|
766
|
+
const w = ke(n, o), { topRow: M, timed: O } = Dt(
|
|
767
|
+
w,
|
|
757
768
|
o,
|
|
758
769
|
a,
|
|
759
|
-
|
|
770
|
+
u
|
|
760
771
|
);
|
|
761
772
|
return {
|
|
762
773
|
day: o,
|
|
763
774
|
topRow: M,
|
|
764
|
-
positioned: Nt(O, o, a,
|
|
775
|
+
positioned: Nt(O, o, a, u)
|
|
765
776
|
};
|
|
766
|
-
}),
|
|
777
|
+
}), D = d.some((o) => o.topRow.length > 0), x = (o) => (w) => {
|
|
767
778
|
if (!S) return;
|
|
768
|
-
const M =
|
|
779
|
+
const M = w.currentTarget.getBoundingClientRect();
|
|
769
780
|
if (M.height === 0) return;
|
|
770
|
-
const O = (
|
|
771
|
-
S(
|
|
772
|
-
},
|
|
773
|
-
(o,
|
|
774
|
-
const M = document.elementFromPoint(o,
|
|
781
|
+
const O = (w.clientY - M.top) / M.height, G = a + O * R, U = Math.floor((G - a) / f) * f + a;
|
|
782
|
+
S(oe(o, U), w);
|
|
783
|
+
}, l = y ? ie(/* @__PURE__ */ new Date()) : null, E = l !== null && l >= a && l <= u, j = X(
|
|
784
|
+
(o, w) => {
|
|
785
|
+
const M = document.elementFromPoint(o, w);
|
|
775
786
|
if (!M) return null;
|
|
776
|
-
const O = M.closest(`[${
|
|
787
|
+
const O = M.closest(`[${je}]`);
|
|
777
788
|
if (O) {
|
|
778
|
-
const
|
|
779
|
-
return Number.isFinite(
|
|
789
|
+
const H = Number(O.getAttribute(je));
|
|
790
|
+
return Number.isFinite(H) ? { day: new Date(H), minutes: null } : null;
|
|
780
791
|
}
|
|
781
|
-
const
|
|
782
|
-
if (!
|
|
783
|
-
const
|
|
784
|
-
if (!Number.isFinite(
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
787
|
-
const
|
|
792
|
+
const G = M.closest(`[${Ne}]`);
|
|
793
|
+
if (!G) return null;
|
|
794
|
+
const U = Number(G.getAttribute(Ne));
|
|
795
|
+
if (!Number.isFinite(U)) return null;
|
|
796
|
+
const _ = G.getBoundingClientRect();
|
|
797
|
+
if (_.height === 0) return null;
|
|
798
|
+
const fe = Math.min(
|
|
788
799
|
1,
|
|
789
|
-
Math.max(0, (
|
|
800
|
+
Math.max(0, (w - _.top) / _.height)
|
|
790
801
|
);
|
|
791
802
|
return {
|
|
792
|
-
day: new Date(
|
|
793
|
-
minutes: a +
|
|
803
|
+
day: new Date(U),
|
|
804
|
+
minutes: a + fe * R
|
|
794
805
|
};
|
|
795
806
|
},
|
|
796
|
-
[a,
|
|
797
|
-
),
|
|
807
|
+
[a, R]
|
|
808
|
+
), A = (o, w) => C.startDrag({
|
|
798
809
|
kind: "move",
|
|
799
|
-
pointerEvent:
|
|
800
|
-
resolve:
|
|
810
|
+
pointerEvent: w,
|
|
811
|
+
resolve: j,
|
|
801
812
|
resolved: o,
|
|
802
|
-
scrollContainer:
|
|
803
|
-
}),
|
|
813
|
+
scrollContainer: z.current
|
|
814
|
+
}), V = (o, w) => C.startDrag({
|
|
804
815
|
kind: "resize",
|
|
805
|
-
pointerEvent:
|
|
806
|
-
resolve:
|
|
816
|
+
pointerEvent: w,
|
|
817
|
+
resolve: j,
|
|
807
818
|
resolved: o,
|
|
808
|
-
scrollContainer:
|
|
809
|
-
}),
|
|
810
|
-
if (!
|
|
811
|
-
const
|
|
812
|
-
|
|
819
|
+
scrollContainer: z.current
|
|
820
|
+
}), B = (o) => {
|
|
821
|
+
if (!N) return;
|
|
822
|
+
const w = j(o.clientX, o.clientY);
|
|
823
|
+
w && C.startDrag({
|
|
813
824
|
kind: "select",
|
|
814
825
|
pointerEvent: o,
|
|
815
|
-
resolve:
|
|
816
|
-
origin:
|
|
817
|
-
scrollContainer:
|
|
826
|
+
resolve: j,
|
|
827
|
+
origin: w,
|
|
828
|
+
scrollContainer: z.current
|
|
818
829
|
});
|
|
819
|
-
}, { preview:
|
|
820
|
-
const o = Math.max(
|
|
821
|
-
|
|
822
|
-
|
|
830
|
+
}, { preview: I } = C, W = I && !I.allDay ? (() => {
|
|
831
|
+
const o = Math.max(ie(I.start), a), w = Math.min(
|
|
832
|
+
I.end.getTime() > I.start.getTime() && Me(I.start, I.end) ? ie(I.end) : u,
|
|
833
|
+
u
|
|
823
834
|
);
|
|
824
835
|
return {
|
|
825
|
-
top: (o - a) /
|
|
826
|
-
height: Math.max((
|
|
836
|
+
top: (o - a) / R * 100,
|
|
837
|
+
height: Math.max((w - o) / R * 100, 1.2)
|
|
827
838
|
};
|
|
828
|
-
})() : null,
|
|
839
|
+
})() : null, Z = I && I.eventId !== null ? n.find((o) => o.event.id === I.eventId) : void 0;
|
|
829
840
|
return (
|
|
830
841
|
/*
|
|
831
842
|
* Encabezado y cuerpo comparten el MISMO contenedor scrolleable a propósito:
|
|
@@ -837,36 +848,36 @@ function Ge({
|
|
|
837
848
|
/* @__PURE__ */ r.jsxs(
|
|
838
849
|
"div",
|
|
839
850
|
{
|
|
840
|
-
ref:
|
|
851
|
+
ref: z,
|
|
841
852
|
className: "isolate h-full min-h-0 flex-1 overflow-y-auto pyrion-scrollbar-thin",
|
|
842
853
|
children: [
|
|
843
854
|
/* @__PURE__ */ r.jsxs("div", { className: "sticky top-0 z-10 bg-neutral-primary-default", children: [
|
|
844
855
|
/* @__PURE__ */ r.jsxs("div", { className: "flex border-b border-neutral-default-default", children: [
|
|
845
|
-
/* @__PURE__ */ r.jsx("div", { className: "shrink-0", style: { width:
|
|
856
|
+
/* @__PURE__ */ r.jsx("div", { className: "shrink-0", style: { width: De } }),
|
|
846
857
|
t.map((o) => {
|
|
847
|
-
const
|
|
858
|
+
const w = xe(o);
|
|
848
859
|
return /* @__PURE__ */ r.jsxs(
|
|
849
860
|
"div",
|
|
850
861
|
{
|
|
851
|
-
...
|
|
862
|
+
...h ? {
|
|
852
863
|
role: "button",
|
|
853
864
|
tabIndex: 0,
|
|
854
|
-
onClick: (M) =>
|
|
865
|
+
onClick: (M) => h(o, M)
|
|
855
866
|
} : {},
|
|
856
|
-
className:
|
|
867
|
+
className: K(
|
|
857
868
|
"flex min-w-0 flex-1 flex-col items-center gap-0.5 border-l border-neutral-default-default py-2",
|
|
858
|
-
|
|
869
|
+
h && "cursor-pointer hover:bg-neutral-default-hover"
|
|
859
870
|
),
|
|
860
871
|
children: [
|
|
861
|
-
/* @__PURE__ */ r.jsx("span", { className: "pyrion-fonts-label-small text-neutral-tertiary-default", children:
|
|
862
|
-
|
|
872
|
+
/* @__PURE__ */ r.jsx("span", { className: "pyrion-fonts-label-small text-neutral-tertiary-default", children: ne(
|
|
873
|
+
Se(o, s, e === "day" ? "long" : "short")
|
|
863
874
|
) }),
|
|
864
875
|
/* @__PURE__ */ r.jsx(
|
|
865
876
|
"span",
|
|
866
877
|
{
|
|
867
|
-
className:
|
|
878
|
+
className: K(
|
|
868
879
|
"flex h-7 min-w-7 items-center justify-center rounded-full px-1 pyrion-fonts-label-large tabular-nums",
|
|
869
|
-
|
|
880
|
+
w ? "bg-brand-primary-default text-neutral-onbrandprimary-default" : "text-neutral-primary-default"
|
|
870
881
|
),
|
|
871
882
|
children: o.getDate()
|
|
872
883
|
}
|
|
@@ -877,66 +888,93 @@ function Ge({
|
|
|
877
888
|
);
|
|
878
889
|
})
|
|
879
890
|
] }),
|
|
880
|
-
|
|
891
|
+
D && /* @__PURE__ */ r.jsxs("div", { className: "flex border-b border-neutral-default-default", children: [
|
|
881
892
|
/* @__PURE__ */ r.jsx(
|
|
882
893
|
"div",
|
|
883
894
|
{
|
|
884
895
|
className: "shrink-0 px-2 py-1 text-right pyrion-fonts-label-small text-neutral-tertiary-default",
|
|
885
|
-
style: { width:
|
|
896
|
+
style: { width: De },
|
|
886
897
|
children: "Todo el día"
|
|
887
898
|
}
|
|
888
899
|
),
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
D?.allDay && W && D.start.getTime() <= o.getTime() && D.end.getTime() >= o.getTime() && /* @__PURE__ */ r.jsx(
|
|
911
|
-
Z,
|
|
912
|
-
{
|
|
913
|
-
resolved: {
|
|
914
|
-
...W,
|
|
915
|
-
start: D.start,
|
|
916
|
-
end: D.end,
|
|
917
|
-
allDay: !0
|
|
900
|
+
d.map(({ day: o, topRow: w }) => {
|
|
901
|
+
const O = !!(L || h) ? w.slice(0, v) : w, G = w.length - O.length;
|
|
902
|
+
return /* @__PURE__ */ r.jsxs(
|
|
903
|
+
"div",
|
|
904
|
+
{
|
|
905
|
+
[je]: String(o.getTime()),
|
|
906
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5 border-l border-neutral-default-default p-1",
|
|
907
|
+
children: [
|
|
908
|
+
O.map((U) => /* @__PURE__ */ r.jsx(
|
|
909
|
+
te,
|
|
910
|
+
{
|
|
911
|
+
resolved: U,
|
|
912
|
+
shape: "chip",
|
|
913
|
+
day: o,
|
|
914
|
+
view: e,
|
|
915
|
+
locale: s,
|
|
916
|
+
className: "shrink-0",
|
|
917
|
+
onEventClick: F,
|
|
918
|
+
renderEvent: k,
|
|
919
|
+
onMoveStart: P ? A : void 0,
|
|
920
|
+
isDragging: C.draggingId === U.event.id
|
|
918
921
|
},
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
922
|
+
`${U.event.id}-allday`
|
|
923
|
+
)),
|
|
924
|
+
I?.allDay && Z && I.start.getTime() <= o.getTime() && I.end.getTime() >= o.getTime() && /* @__PURE__ */ r.jsx(
|
|
925
|
+
te,
|
|
926
|
+
{
|
|
927
|
+
resolved: {
|
|
928
|
+
...Z,
|
|
929
|
+
start: I.start,
|
|
930
|
+
end: I.end,
|
|
931
|
+
allDay: !0
|
|
932
|
+
},
|
|
933
|
+
shape: "chip",
|
|
934
|
+
day: o,
|
|
935
|
+
view: e,
|
|
936
|
+
locale: s,
|
|
937
|
+
isGhost: !0
|
|
938
|
+
}
|
|
939
|
+
),
|
|
940
|
+
G > 0 && /* @__PURE__ */ r.jsxs(
|
|
941
|
+
"button",
|
|
942
|
+
{
|
|
943
|
+
type: "button",
|
|
944
|
+
"aria-label": `Ver ${G} eventos más del ${o.toLocaleDateString(s)}`,
|
|
945
|
+
className: "shrink-0 rounded-sm px-1 text-left pyrion-fonts-label-small text-brand-onneutral-default hover:text-brand-onneutral-hover active:text-brand-onneutral-pressed",
|
|
946
|
+
onClick: (U) => {
|
|
947
|
+
if (U.stopPropagation(), L) {
|
|
948
|
+
L(
|
|
949
|
+
o,
|
|
950
|
+
w.map((_) => _.event)
|
|
951
|
+
);
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
h?.(o, U);
|
|
955
|
+
},
|
|
956
|
+
children: [
|
|
957
|
+
"+",
|
|
958
|
+
G,
|
|
959
|
+
" más"
|
|
960
|
+
]
|
|
961
|
+
}
|
|
962
|
+
)
|
|
963
|
+
]
|
|
964
|
+
},
|
|
965
|
+
o.getTime()
|
|
966
|
+
);
|
|
967
|
+
})
|
|
930
968
|
] })
|
|
931
969
|
] }),
|
|
932
|
-
/* @__PURE__ */ r.jsxs("div", { className: "flex", style: { height:
|
|
970
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex", style: { height: p }, children: [
|
|
933
971
|
/* @__PURE__ */ r.jsx(
|
|
934
972
|
"div",
|
|
935
973
|
{
|
|
936
974
|
className: "relative shrink-0",
|
|
937
|
-
style: { width:
|
|
975
|
+
style: { width: De },
|
|
938
976
|
"aria-hidden": "true",
|
|
939
|
-
children:
|
|
977
|
+
children: c.map((o) => (
|
|
940
978
|
// La etiqueta va debajo de su línea, no centrada sobre ella: así
|
|
941
979
|
// la hora que queda pegada al borde del scroll no se corta.
|
|
942
980
|
/* @__PURE__ */ r.jsx(
|
|
@@ -944,29 +982,29 @@ function Ge({
|
|
|
944
982
|
{
|
|
945
983
|
className: "absolute right-2 mt-0.5 pyrion-fonts-body-xsmall tabular-nums text-neutral-tertiary-default",
|
|
946
984
|
style: {
|
|
947
|
-
top: `${(o - a) /
|
|
985
|
+
top: `${(o - a) / R * 100}%`
|
|
948
986
|
},
|
|
949
|
-
children:
|
|
987
|
+
children: me(oe(t[0], o), s)
|
|
950
988
|
},
|
|
951
989
|
o
|
|
952
990
|
)
|
|
953
991
|
))
|
|
954
992
|
}
|
|
955
993
|
),
|
|
956
|
-
|
|
994
|
+
d.map(({ day: o, positioned: w }) => /* @__PURE__ */ r.jsxs(
|
|
957
995
|
"div",
|
|
958
996
|
{
|
|
959
|
-
[
|
|
960
|
-
onClick:
|
|
961
|
-
onPointerDown:
|
|
962
|
-
className:
|
|
997
|
+
[Ne]: String(o.getTime()),
|
|
998
|
+
onClick: x(o),
|
|
999
|
+
onPointerDown: N ? B : void 0,
|
|
1000
|
+
className: K(
|
|
963
1001
|
"pyrion-calendar-slots relative min-w-0 flex-1 border-l border-neutral-default-default",
|
|
964
1002
|
S && "cursor-pointer",
|
|
965
|
-
|
|
1003
|
+
N && "touch-none"
|
|
966
1004
|
),
|
|
967
1005
|
style: {
|
|
968
|
-
"--pyrion-calendar-slot-height": `${
|
|
969
|
-
"--pyrion-calendar-hour-height": `${
|
|
1006
|
+
"--pyrion-calendar-slot-height": `${b}px`,
|
|
1007
|
+
"--pyrion-calendar-hour-height": `${i}px`
|
|
970
1008
|
},
|
|
971
1009
|
children: [
|
|
972
1010
|
g ? [0.1, 0.35, 0.6].map((M) => /* @__PURE__ */ r.jsx(
|
|
@@ -976,21 +1014,21 @@ function Ge({
|
|
|
976
1014
|
style: { top: `${M * 100}%`, height: "8%" }
|
|
977
1015
|
},
|
|
978
1016
|
M
|
|
979
|
-
)) :
|
|
980
|
-
|
|
1017
|
+
)) : w.map((M) => /* @__PURE__ */ r.jsx(
|
|
1018
|
+
te,
|
|
981
1019
|
{
|
|
982
1020
|
resolved: M.resolved,
|
|
983
1021
|
shape: "block",
|
|
984
1022
|
day: o,
|
|
985
1023
|
view: e,
|
|
986
1024
|
locale: s,
|
|
987
|
-
onEventClick:
|
|
988
|
-
renderEvent:
|
|
1025
|
+
onEventClick: F,
|
|
1026
|
+
renderEvent: k,
|
|
989
1027
|
clippedStart: M.clippedStart,
|
|
990
1028
|
clippedEnd: M.clippedEnd,
|
|
991
|
-
onMoveStart:
|
|
992
|
-
onResizeStart:
|
|
993
|
-
isDragging:
|
|
1029
|
+
onMoveStart: P ? A : void 0,
|
|
1030
|
+
onResizeStart: P ? V : void 0,
|
|
1031
|
+
isDragging: C.draggingId === M.resolved.event.id,
|
|
994
1032
|
style: {
|
|
995
1033
|
top: `${M.top}%`,
|
|
996
1034
|
height: `${M.height}%`,
|
|
@@ -1000,13 +1038,13 @@ function Ge({
|
|
|
1000
1038
|
},
|
|
1001
1039
|
`${M.resolved.event.id}-${o.getTime()}`
|
|
1002
1040
|
)),
|
|
1003
|
-
|
|
1004
|
-
|
|
1041
|
+
W && I && Me(I.start, o) && (Z ? /* @__PURE__ */ r.jsx(
|
|
1042
|
+
te,
|
|
1005
1043
|
{
|
|
1006
1044
|
resolved: {
|
|
1007
|
-
...
|
|
1008
|
-
start:
|
|
1009
|
-
end:
|
|
1045
|
+
...Z,
|
|
1046
|
+
start: I.start,
|
|
1047
|
+
end: I.end,
|
|
1010
1048
|
allDay: !1
|
|
1011
1049
|
},
|
|
1012
1050
|
shape: "block",
|
|
@@ -1015,8 +1053,8 @@ function Ge({
|
|
|
1015
1053
|
locale: s,
|
|
1016
1054
|
isGhost: !0,
|
|
1017
1055
|
style: {
|
|
1018
|
-
top: `${
|
|
1019
|
-
height: `${
|
|
1056
|
+
top: `${W.top}%`,
|
|
1057
|
+
height: `${W.height}%`,
|
|
1020
1058
|
left: "2px",
|
|
1021
1059
|
right: "2px",
|
|
1022
1060
|
zIndex: 20
|
|
@@ -1027,24 +1065,24 @@ function Ge({
|
|
|
1027
1065
|
{
|
|
1028
1066
|
className: "pyrion-calendar-selection pointer-events-none absolute inset-x-0.5 flex items-start justify-center rounded-md px-1 py-0.5",
|
|
1029
1067
|
style: {
|
|
1030
|
-
top: `${
|
|
1031
|
-
height: `${
|
|
1068
|
+
top: `${W.top}%`,
|
|
1069
|
+
height: `${W.height}%`,
|
|
1032
1070
|
zIndex: 20
|
|
1033
1071
|
},
|
|
1034
1072
|
children: /* @__PURE__ */ r.jsxs("span", { className: "pyrion-fonts-label-small tabular-nums text-neutral-primary-default", children: [
|
|
1035
|
-
|
|
1073
|
+
me(I.start, s),
|
|
1036
1074
|
" –",
|
|
1037
1075
|
" ",
|
|
1038
|
-
|
|
1076
|
+
me(I.end, s)
|
|
1039
1077
|
] })
|
|
1040
1078
|
}
|
|
1041
1079
|
)),
|
|
1042
|
-
|
|
1080
|
+
E && xe(o) && /* @__PURE__ */ r.jsx(
|
|
1043
1081
|
"div",
|
|
1044
1082
|
{
|
|
1045
1083
|
className: "pyrion-calendar-now-line pointer-events-none absolute inset-x-0 h-px",
|
|
1046
1084
|
style: {
|
|
1047
|
-
top: `${(
|
|
1085
|
+
top: `${(l - a) / R * 100}%`
|
|
1048
1086
|
}
|
|
1049
1087
|
}
|
|
1050
1088
|
)
|
|
@@ -1066,94 +1104,94 @@ function St({
|
|
|
1066
1104
|
selectable: n,
|
|
1067
1105
|
snapMinutes: s,
|
|
1068
1106
|
onEventDrop: a,
|
|
1069
|
-
onEventResize:
|
|
1107
|
+
onEventResize: u,
|
|
1070
1108
|
onRangeSelect: f
|
|
1071
1109
|
}) {
|
|
1072
|
-
const [
|
|
1110
|
+
const [b, T] = he(null), [y, g] = he(
|
|
1073
1111
|
() => /* @__PURE__ */ new Map()
|
|
1074
|
-
),
|
|
1075
|
-
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1078
|
-
g((
|
|
1079
|
-
if (
|
|
1080
|
-
const
|
|
1112
|
+
), h = ee(null), S = ee(null), F = ee({ onEventDrop: a, onEventResize: u, onRangeSelect: f });
|
|
1113
|
+
F.current = { onEventDrop: a, onEventResize: u, onRangeSelect: f };
|
|
1114
|
+
const k = ee(s);
|
|
1115
|
+
k.current = s, le(() => {
|
|
1116
|
+
g((i) => {
|
|
1117
|
+
if (i.size === 0) return i;
|
|
1118
|
+
const c = new Map(i);
|
|
1081
1119
|
let m = !1;
|
|
1082
1120
|
for (const d of e) {
|
|
1083
|
-
const
|
|
1084
|
-
if (!
|
|
1085
|
-
const x =
|
|
1086
|
-
if (
|
|
1121
|
+
const D = c.get(d.id);
|
|
1122
|
+
if (!D) continue;
|
|
1123
|
+
const x = re(d.start);
|
|
1124
|
+
if (de(x) && !(Math.abs(x.getTime() - D.start.getTime()) >= 6e4)) {
|
|
1087
1125
|
if (d.end !== void 0) {
|
|
1088
|
-
const
|
|
1089
|
-
if (
|
|
1126
|
+
const l = re(d.end);
|
|
1127
|
+
if (de(l) && Math.abs(l.getTime() - D.end.getTime()) >= 6e4)
|
|
1090
1128
|
continue;
|
|
1091
1129
|
}
|
|
1092
|
-
|
|
1130
|
+
c.delete(d.id), m = !0;
|
|
1093
1131
|
}
|
|
1094
1132
|
}
|
|
1095
|
-
return m ?
|
|
1133
|
+
return m ? c : i;
|
|
1096
1134
|
});
|
|
1097
1135
|
}, [e]);
|
|
1098
|
-
const
|
|
1136
|
+
const v = X(() => {
|
|
1099
1137
|
S.current !== null && (window.clearInterval(S.current), S.current = null);
|
|
1100
|
-
}, []), L = (
|
|
1101
|
-
(
|
|
1102
|
-
const d =
|
|
1103
|
-
if (!d) return
|
|
1104
|
-
const
|
|
1105
|
-
if (
|
|
1106
|
-
const
|
|
1107
|
-
if (!
|
|
1108
|
-
if (
|
|
1109
|
-
const
|
|
1110
|
-
return { start:
|
|
1138
|
+
}, []), L = (i) => Math.round(i / k.current) * k.current, C = X(
|
|
1139
|
+
(i, c, m) => {
|
|
1140
|
+
const d = i.resolve(c, m);
|
|
1141
|
+
if (!d) return i.proposal;
|
|
1142
|
+
const D = k.current;
|
|
1143
|
+
if (i.kind === "select") {
|
|
1144
|
+
const j = i.origin;
|
|
1145
|
+
if (!j) return null;
|
|
1146
|
+
if (j.minutes === null || d.minutes === null) {
|
|
1147
|
+
const W = Y(j.day), Z = Y(d.day), [o, w] = W.getTime() <= Z.getTime() ? [W, Z] : [Z, W];
|
|
1148
|
+
return { start: o, end: q(w), allDay: !0 };
|
|
1111
1149
|
}
|
|
1112
|
-
const
|
|
1150
|
+
const A = Math.min(j.minutes, d.minutes), V = Math.max(j.minutes, d.minutes), B = L(A), I = Math.max(L(V), B + D);
|
|
1113
1151
|
return {
|
|
1114
|
-
start:
|
|
1115
|
-
end:
|
|
1152
|
+
start: oe(j.day, B),
|
|
1153
|
+
end: oe(j.day, I),
|
|
1116
1154
|
allDay: !1
|
|
1117
1155
|
};
|
|
1118
1156
|
}
|
|
1119
|
-
const x =
|
|
1157
|
+
const x = i.resolved;
|
|
1120
1158
|
if (!x) return null;
|
|
1121
|
-
if (
|
|
1122
|
-
if (d.minutes === null) return
|
|
1123
|
-
const
|
|
1159
|
+
if (i.kind === "resize") {
|
|
1160
|
+
if (d.minutes === null) return i.proposal;
|
|
1161
|
+
const j = oe(d.day, L(d.minutes)), A = x.start.getTime() + D * 6e4;
|
|
1124
1162
|
return {
|
|
1125
1163
|
start: x.start,
|
|
1126
|
-
end: new Date(Math.max(
|
|
1164
|
+
end: new Date(Math.max(j.getTime(), A)),
|
|
1127
1165
|
allDay: !1
|
|
1128
1166
|
};
|
|
1129
1167
|
}
|
|
1130
1168
|
if (d.minutes === null) {
|
|
1131
|
-
const
|
|
1132
|
-
(
|
|
1133
|
-
),
|
|
1169
|
+
const j = Math.round(
|
|
1170
|
+
(Y(d.day).getTime() - Y(x.start).getTime()) / 864e5
|
|
1171
|
+
), A = J(x.start, j);
|
|
1134
1172
|
return {
|
|
1135
|
-
start:
|
|
1136
|
-
end: new Date(
|
|
1173
|
+
start: A,
|
|
1174
|
+
end: new Date(A.getTime() + i.durationMs),
|
|
1137
1175
|
allDay: x.allDay
|
|
1138
1176
|
};
|
|
1139
1177
|
}
|
|
1140
|
-
const
|
|
1178
|
+
const l = Math.max(
|
|
1141
1179
|
0,
|
|
1142
|
-
L(d.minutes -
|
|
1143
|
-
),
|
|
1180
|
+
L(d.minutes - i.grabOffsetMinutes)
|
|
1181
|
+
), E = oe(d.day, l);
|
|
1144
1182
|
return {
|
|
1145
|
-
start:
|
|
1146
|
-
end: new Date(
|
|
1183
|
+
start: E,
|
|
1184
|
+
end: new Date(E.getTime() + i.durationMs),
|
|
1147
1185
|
allDay: !1
|
|
1148
1186
|
};
|
|
1149
1187
|
},
|
|
1150
1188
|
[]
|
|
1151
|
-
),
|
|
1152
|
-
(
|
|
1153
|
-
const m =
|
|
1189
|
+
), P = X(
|
|
1190
|
+
(i, c) => {
|
|
1191
|
+
const m = h.current;
|
|
1154
1192
|
if (!m || !m.armed) return;
|
|
1155
|
-
const d =
|
|
1156
|
-
d && (m.proposal = d,
|
|
1193
|
+
const d = C(m, i, c);
|
|
1194
|
+
d && (m.proposal = d, T({
|
|
1157
1195
|
kind: m.kind,
|
|
1158
1196
|
eventId: m.resolved?.event.id ?? null,
|
|
1159
1197
|
start: d.start,
|
|
@@ -1161,171 +1199,171 @@ function St({
|
|
|
1161
1199
|
allDay: d.allDay
|
|
1162
1200
|
}));
|
|
1163
1201
|
},
|
|
1164
|
-
[
|
|
1165
|
-
),
|
|
1166
|
-
const
|
|
1167
|
-
|
|
1168
|
-
}, [
|
|
1169
|
-
(
|
|
1170
|
-
const
|
|
1171
|
-
if (!
|
|
1172
|
-
if (
|
|
1173
|
-
|
|
1174
|
-
start:
|
|
1175
|
-
end:
|
|
1176
|
-
allDay:
|
|
1202
|
+
[C]
|
|
1203
|
+
), N = X(() => {
|
|
1204
|
+
const i = h.current;
|
|
1205
|
+
i?.longPressTimer !== null && i?.longPressTimer !== void 0 && window.clearTimeout(i.longPressTimer), h.current = null, v(), T(null);
|
|
1206
|
+
}, [v]), z = X(
|
|
1207
|
+
(i) => {
|
|
1208
|
+
const c = i.proposal;
|
|
1209
|
+
if (!c) return;
|
|
1210
|
+
if (i.kind === "select") {
|
|
1211
|
+
F.current.onRangeSelect?.({
|
|
1212
|
+
start: c.start,
|
|
1213
|
+
end: c.end,
|
|
1214
|
+
allDay: c.allDay
|
|
1177
1215
|
});
|
|
1178
1216
|
return;
|
|
1179
1217
|
}
|
|
1180
|
-
const m =
|
|
1181
|
-
if (!m ||
|
|
1182
|
-
const
|
|
1218
|
+
const m = i.resolved;
|
|
1219
|
+
if (!m || c.start.getTime() === m.start.getTime() && c.end.getTime() === m.end.getTime() && c.allDay === m.allDay) return;
|
|
1220
|
+
const D = m.event.id, x = {
|
|
1183
1221
|
start: m.start,
|
|
1184
1222
|
end: m.end,
|
|
1185
1223
|
allDay: m.allDay
|
|
1186
1224
|
};
|
|
1187
1225
|
g(
|
|
1188
|
-
(
|
|
1226
|
+
(V) => new Map(V).set(D, c)
|
|
1189
1227
|
);
|
|
1190
|
-
const
|
|
1191
|
-
if (!
|
|
1192
|
-
const
|
|
1193
|
-
return
|
|
1194
|
-
}),
|
|
1228
|
+
const l = () => g((V) => {
|
|
1229
|
+
if (!V.has(D)) return V;
|
|
1230
|
+
const B = new Map(V);
|
|
1231
|
+
return B.delete(D), B;
|
|
1232
|
+
}), E = i.kind === "resize" ? F.current.onEventResize : F.current.onEventDrop, j = {
|
|
1195
1233
|
event: m.event,
|
|
1196
|
-
start:
|
|
1197
|
-
end:
|
|
1198
|
-
allDay:
|
|
1234
|
+
start: c.start,
|
|
1235
|
+
end: c.end,
|
|
1236
|
+
allDay: c.allDay,
|
|
1199
1237
|
previous: x
|
|
1200
1238
|
};
|
|
1201
|
-
let
|
|
1239
|
+
let A;
|
|
1202
1240
|
try {
|
|
1203
|
-
|
|
1241
|
+
A = E?.(j);
|
|
1204
1242
|
} catch {
|
|
1205
|
-
|
|
1243
|
+
l();
|
|
1206
1244
|
return;
|
|
1207
1245
|
}
|
|
1208
|
-
if (
|
|
1209
|
-
|
|
1246
|
+
if (A === !1) {
|
|
1247
|
+
l();
|
|
1210
1248
|
return;
|
|
1211
1249
|
}
|
|
1212
|
-
|
|
1250
|
+
A instanceof Promise && A.then((V) => V === !1 && l()).catch(l);
|
|
1213
1251
|
},
|
|
1214
1252
|
[]
|
|
1215
1253
|
);
|
|
1216
|
-
|
|
1217
|
-
const
|
|
1218
|
-
const
|
|
1219
|
-
if (!
|
|
1220
|
-
|
|
1221
|
-
const
|
|
1222
|
-
if (!
|
|
1223
|
-
|
|
1254
|
+
le(() => {
|
|
1255
|
+
const i = (x) => {
|
|
1256
|
+
const l = h.current;
|
|
1257
|
+
if (!l || x.pointerId !== l.pointerId) return;
|
|
1258
|
+
l.lastX = x.clientX, l.lastY = x.clientY;
|
|
1259
|
+
const E = Math.abs(x.clientX - l.startX), j = Math.abs(x.clientY - l.startY), A = Math.max(E, j);
|
|
1260
|
+
if (!l.armed) {
|
|
1261
|
+
l.needsLongPress && A > $t && N();
|
|
1224
1262
|
return;
|
|
1225
1263
|
}
|
|
1226
|
-
if (!
|
|
1227
|
-
if (
|
|
1228
|
-
|
|
1264
|
+
if (!l.moved) {
|
|
1265
|
+
if (A < Mt) return;
|
|
1266
|
+
l.moved = !0;
|
|
1229
1267
|
}
|
|
1230
|
-
x.preventDefault(),
|
|
1231
|
-
},
|
|
1232
|
-
const x = (
|
|
1233
|
-
|
|
1268
|
+
x.preventDefault(), P(x.clientX, x.clientY);
|
|
1269
|
+
}, c = () => {
|
|
1270
|
+
const x = (l) => {
|
|
1271
|
+
l.stopPropagation(), l.preventDefault(), window.removeEventListener("click", x, !0);
|
|
1234
1272
|
};
|
|
1235
1273
|
window.addEventListener("click", x, !0), window.setTimeout(() => window.removeEventListener("click", x, !0), 0);
|
|
1236
1274
|
}, m = (x) => {
|
|
1237
|
-
const
|
|
1238
|
-
!
|
|
1239
|
-
}, d = () =>
|
|
1240
|
-
x.key === "Escape" &&
|
|
1275
|
+
const l = h.current;
|
|
1276
|
+
!l || x.pointerId !== l.pointerId || (l.armed && l.moved && (z(l), c()), N());
|
|
1277
|
+
}, d = () => N(), D = (x) => {
|
|
1278
|
+
x.key === "Escape" && h.current && (h.current.proposal = null, N());
|
|
1241
1279
|
};
|
|
1242
|
-
return window.addEventListener("pointermove",
|
|
1243
|
-
window.removeEventListener("pointermove",
|
|
1280
|
+
return window.addEventListener("pointermove", i, { passive: !1 }), window.addEventListener("pointerup", m), window.addEventListener("pointercancel", d), window.addEventListener("keydown", D), () => {
|
|
1281
|
+
window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", m), window.removeEventListener("pointercancel", d), window.removeEventListener("keydown", D);
|
|
1244
1282
|
};
|
|
1245
|
-
}, [
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
const
|
|
1249
|
-
if (!
|
|
1250
|
-
const m =
|
|
1283
|
+
}, [z, N, P]), le(() => v, [v]);
|
|
1284
|
+
const R = X(() => {
|
|
1285
|
+
v(), S.current = window.setInterval(() => {
|
|
1286
|
+
const i = h.current, c = i?.scrollContainer;
|
|
1287
|
+
if (!i || !c || !i.armed) return;
|
|
1288
|
+
const m = c.getBoundingClientRect();
|
|
1251
1289
|
let d = 0;
|
|
1252
|
-
if (
|
|
1253
|
-
const
|
|
1254
|
-
|
|
1290
|
+
if (i.lastY < m.top + Ye ? d = -Fe : i.lastY > m.bottom - Ye && (d = Fe), d === 0) return;
|
|
1291
|
+
const D = c.scrollTop;
|
|
1292
|
+
c.scrollTop = D + d, c.scrollTop !== D && P(i.lastX, i.lastY);
|
|
1255
1293
|
}, 16);
|
|
1256
|
-
}, [
|
|
1294
|
+
}, [v, P]), $ = X(
|
|
1257
1295
|
({
|
|
1258
|
-
kind:
|
|
1259
|
-
pointerEvent:
|
|
1296
|
+
kind: i,
|
|
1297
|
+
pointerEvent: c,
|
|
1260
1298
|
resolve: m,
|
|
1261
1299
|
resolved: d,
|
|
1262
|
-
origin:
|
|
1300
|
+
origin: D,
|
|
1263
1301
|
scrollContainer: x
|
|
1264
1302
|
}) => {
|
|
1265
|
-
if (
|
|
1266
|
-
const
|
|
1267
|
-
if (
|
|
1268
|
-
const
|
|
1269
|
-
kind:
|
|
1303
|
+
if (c.button !== void 0 && c.button !== 0) return;
|
|
1304
|
+
const l = h.current;
|
|
1305
|
+
if (l && l.pointerId === c.pointerId || i === "select" && !n || i !== "select" && !t || i !== "select" && !d || d?.event.disabled) return;
|
|
1306
|
+
const E = c.pointerType === "touch", j = m(c.clientX, c.clientY), A = j?.minutes, V = {
|
|
1307
|
+
kind: i,
|
|
1270
1308
|
resolve: m,
|
|
1271
1309
|
scrollContainer: x ?? null,
|
|
1272
|
-
pointerId:
|
|
1273
|
-
startX:
|
|
1274
|
-
startY:
|
|
1275
|
-
lastX:
|
|
1276
|
-
lastY:
|
|
1310
|
+
pointerId: c.pointerId,
|
|
1311
|
+
startX: c.clientX,
|
|
1312
|
+
startY: c.clientY,
|
|
1313
|
+
lastX: c.clientX,
|
|
1314
|
+
lastY: c.clientY,
|
|
1277
1315
|
moved: !1,
|
|
1278
|
-
needsLongPress:
|
|
1316
|
+
needsLongPress: E,
|
|
1279
1317
|
longPressTimer: null,
|
|
1280
|
-
armed: !
|
|
1318
|
+
armed: !E,
|
|
1281
1319
|
resolved: d,
|
|
1282
1320
|
durationMs: d ? d.end.getTime() - d.start.getTime() : 0,
|
|
1283
|
-
grabOffsetMinutes: d &&
|
|
1284
|
-
origin:
|
|
1321
|
+
grabOffsetMinutes: d && A !== null && A !== void 0 ? A - ie(d.start) : 0,
|
|
1322
|
+
origin: D ?? j ?? void 0,
|
|
1285
1323
|
proposal: null
|
|
1286
1324
|
};
|
|
1287
|
-
if (
|
|
1288
|
-
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1325
|
+
if (h.current = V, E) {
|
|
1326
|
+
V.longPressTimer = window.setTimeout(() => {
|
|
1327
|
+
const B = h.current;
|
|
1328
|
+
B && (B.armed = !0, B.moved = !0, B.longPressTimer = null, P(B.lastX, B.lastY), R());
|
|
1291
1329
|
}, It);
|
|
1292
1330
|
return;
|
|
1293
1331
|
}
|
|
1294
|
-
|
|
1332
|
+
R();
|
|
1295
1333
|
},
|
|
1296
|
-
[t, n,
|
|
1297
|
-
),
|
|
1298
|
-
(
|
|
1299
|
-
const m = y.get(
|
|
1334
|
+
[t, n, R, P]
|
|
1335
|
+
), p = X(
|
|
1336
|
+
(i) => y.size === 0 ? i : i.map((c) => {
|
|
1337
|
+
const m = y.get(c.event.id);
|
|
1300
1338
|
return m ? {
|
|
1301
|
-
...
|
|
1339
|
+
...c,
|
|
1302
1340
|
start: m.start,
|
|
1303
1341
|
end: m.end,
|
|
1304
1342
|
allDay: m.allDay
|
|
1305
|
-
} :
|
|
1343
|
+
} : c;
|
|
1306
1344
|
}),
|
|
1307
1345
|
[y]
|
|
1308
1346
|
);
|
|
1309
|
-
return
|
|
1347
|
+
return ae(
|
|
1310
1348
|
() => ({
|
|
1311
|
-
preview:
|
|
1312
|
-
draggingId:
|
|
1313
|
-
applyOverrides:
|
|
1349
|
+
preview: b,
|
|
1350
|
+
draggingId: b?.eventId ?? null,
|
|
1351
|
+
applyOverrides: p,
|
|
1314
1352
|
startDrag: $,
|
|
1315
|
-
isDragging:
|
|
1353
|
+
isDragging: b !== null
|
|
1316
1354
|
}),
|
|
1317
|
-
[
|
|
1355
|
+
[b, p, $]
|
|
1318
1356
|
);
|
|
1319
1357
|
}
|
|
1320
1358
|
const kt = 250;
|
|
1321
1359
|
function ze(e, t) {
|
|
1322
|
-
const n =
|
|
1323
|
-
return
|
|
1360
|
+
const n = ee(null), s = ee(null);
|
|
1361
|
+
return le(
|
|
1324
1362
|
() => () => {
|
|
1325
1363
|
n.current !== null && window.clearTimeout(n.current);
|
|
1326
1364
|
},
|
|
1327
1365
|
[]
|
|
1328
|
-
),
|
|
1366
|
+
), ae(() => {
|
|
1329
1367
|
if (!(!e && !t))
|
|
1330
1368
|
return t ? (...a) => {
|
|
1331
1369
|
if (n.current !== null) {
|
|
@@ -1334,8 +1372,8 @@ function ze(e, t) {
|
|
|
1334
1372
|
}
|
|
1335
1373
|
s.current = a, n.current = window.setTimeout(() => {
|
|
1336
1374
|
n.current = null;
|
|
1337
|
-
const
|
|
1338
|
-
s.current = null,
|
|
1375
|
+
const u = s.current;
|
|
1376
|
+
s.current = null, u && e?.(...u);
|
|
1339
1377
|
}, kt);
|
|
1340
1378
|
} : e;
|
|
1341
1379
|
}, [e, t]);
|
|
@@ -1346,176 +1384,178 @@ const Ct = [
|
|
|
1346
1384
|
"day",
|
|
1347
1385
|
"agenda"
|
|
1348
1386
|
];
|
|
1349
|
-
function
|
|
1387
|
+
function Pt({
|
|
1350
1388
|
events: e = [],
|
|
1351
1389
|
view: t,
|
|
1352
1390
|
defaultView: n = "month",
|
|
1353
1391
|
onViewChange: s,
|
|
1354
1392
|
views: a = Ct,
|
|
1355
|
-
date:
|
|
1393
|
+
date: u,
|
|
1356
1394
|
defaultDate: f,
|
|
1357
|
-
onDateChange:
|
|
1358
|
-
onRangeChange:
|
|
1395
|
+
onDateChange: b,
|
|
1396
|
+
onRangeChange: T,
|
|
1359
1397
|
onEventClick: y,
|
|
1360
1398
|
onDayClick: g,
|
|
1361
|
-
onDayDoubleClick:
|
|
1399
|
+
onDayDoubleClick: h,
|
|
1362
1400
|
onSlotClick: S,
|
|
1363
|
-
onSlotDoubleClick:
|
|
1364
|
-
onShowMore:
|
|
1365
|
-
renderEvent:
|
|
1401
|
+
onSlotDoubleClick: F,
|
|
1402
|
+
onShowMore: k,
|
|
1403
|
+
renderEvent: v,
|
|
1366
1404
|
renderDayAction: L,
|
|
1367
|
-
actionSlot:
|
|
1368
|
-
weekStartsOn:
|
|
1369
|
-
locale:
|
|
1370
|
-
minTime:
|
|
1371
|
-
maxTime:
|
|
1405
|
+
actionSlot: C,
|
|
1406
|
+
weekStartsOn: P = 1,
|
|
1407
|
+
locale: N = "es-AR",
|
|
1408
|
+
minTime: z = "00:00",
|
|
1409
|
+
maxTime: R = "24:00",
|
|
1372
1410
|
slotDuration: $ = 60,
|
|
1373
|
-
slotHeight:
|
|
1374
|
-
scrollToTime:
|
|
1375
|
-
nowIndicator:
|
|
1411
|
+
slotHeight: p = 48,
|
|
1412
|
+
scrollToTime: i = "07:00",
|
|
1413
|
+
nowIndicator: c = !0,
|
|
1376
1414
|
defaultEventDuration: m = 30,
|
|
1377
1415
|
maxEventsPerDay: d = 3,
|
|
1378
|
-
agendaDays:
|
|
1416
|
+
agendaDays: D,
|
|
1379
1417
|
editable: x = !1,
|
|
1380
|
-
selectable:
|
|
1381
|
-
dragSnapMinutes:
|
|
1382
|
-
onEventDrop:
|
|
1383
|
-
onEventResize:
|
|
1384
|
-
onRangeSelect:
|
|
1385
|
-
showToolbar:
|
|
1386
|
-
isLoading:
|
|
1387
|
-
emptyState:
|
|
1388
|
-
className:
|
|
1389
|
-
toolbarClassName:
|
|
1390
|
-
"aria-label":
|
|
1418
|
+
selectable: l = !1,
|
|
1419
|
+
dragSnapMinutes: E = 15,
|
|
1420
|
+
onEventDrop: j,
|
|
1421
|
+
onEventResize: A,
|
|
1422
|
+
onRangeSelect: V,
|
|
1423
|
+
showToolbar: B = !0,
|
|
1424
|
+
isLoading: I = !1,
|
|
1425
|
+
emptyState: W,
|
|
1426
|
+
className: Z,
|
|
1427
|
+
toolbarClassName: o,
|
|
1428
|
+
"aria-label": w = "Calendario"
|
|
1391
1429
|
}) {
|
|
1392
|
-
const [
|
|
1393
|
-
() =>
|
|
1394
|
-
),
|
|
1395
|
-
() => new Date(
|
|
1396
|
-
[
|
|
1397
|
-
),
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
), Je =
|
|
1430
|
+
const [M, O] = he(n), [G, U] = he(
|
|
1431
|
+
() => Y(f !== void 0 ? re(f) : /* @__PURE__ */ new Date())
|
|
1432
|
+
), _ = t ?? M, fe = (u !== void 0 ? Y(re(u)) : G).getTime(), H = ae(
|
|
1433
|
+
() => new Date(fe),
|
|
1434
|
+
[fe]
|
|
1435
|
+
), ye = we(z, 0), Ke = Math.max(
|
|
1436
|
+
ye + $,
|
|
1437
|
+
we(R, $e)
|
|
1438
|
+
), Je = we(i, ye), Ce = ae(
|
|
1401
1439
|
() => wt(e, m),
|
|
1402
1440
|
[e, m]
|
|
1403
|
-
),
|
|
1441
|
+
), pe = St({
|
|
1404
1442
|
events: e,
|
|
1405
1443
|
editable: x,
|
|
1406
|
-
selectable:
|
|
1407
|
-
snapMinutes:
|
|
1408
|
-
onEventDrop:
|
|
1409
|
-
onEventResize:
|
|
1410
|
-
onRangeSelect:
|
|
1411
|
-
}),
|
|
1412
|
-
() =>
|
|
1413
|
-
[
|
|
1414
|
-
),
|
|
1415
|
-
() =>
|
|
1416
|
-
[
|
|
1417
|
-
),
|
|
1418
|
-
|
|
1419
|
-
const
|
|
1420
|
-
|
|
1421
|
-
}, [
|
|
1422
|
-
const
|
|
1423
|
-
(
|
|
1424
|
-
|
|
1444
|
+
selectable: l,
|
|
1445
|
+
snapMinutes: E,
|
|
1446
|
+
onEventDrop: j,
|
|
1447
|
+
onEventResize: A,
|
|
1448
|
+
onRangeSelect: V
|
|
1449
|
+
}), be = ae(
|
|
1450
|
+
() => pe.applyOverrides(Ce),
|
|
1451
|
+
[pe, Ce]
|
|
1452
|
+
), ue = ae(
|
|
1453
|
+
() => Ie(H, _, P, D),
|
|
1454
|
+
[H, _, P, D]
|
|
1455
|
+
), Pe = ee("");
|
|
1456
|
+
le(() => {
|
|
1457
|
+
const Q = `${_}|${ue.start.getTime()}|${ue.end.getTime()}`;
|
|
1458
|
+
Pe.current !== Q && (Pe.current = Q, T?.({ start: ue.start, end: ue.end, view: _ }));
|
|
1459
|
+
}, [ue, _, T]);
|
|
1460
|
+
const se = X(
|
|
1461
|
+
(Q) => {
|
|
1462
|
+
u === void 0 && U(Q), b?.(Q);
|
|
1425
1463
|
},
|
|
1426
|
-
[
|
|
1427
|
-
), Ze =
|
|
1428
|
-
(
|
|
1429
|
-
t === void 0 &&
|
|
1464
|
+
[u, b]
|
|
1465
|
+
), Ze = X(
|
|
1466
|
+
(Q) => {
|
|
1467
|
+
t === void 0 && O(Q), s?.(Q);
|
|
1430
1468
|
},
|
|
1431
1469
|
[t, s]
|
|
1432
|
-
), qe =
|
|
1433
|
-
|
|
1434
|
-
}, [
|
|
1435
|
-
|
|
1436
|
-
}, [
|
|
1437
|
-
|
|
1438
|
-
}, [
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
),
|
|
1470
|
+
), qe = X(() => {
|
|
1471
|
+
se(Ae(H, _, -1, D));
|
|
1472
|
+
}, [se, H, _, D]), Qe = X(() => {
|
|
1473
|
+
se(Ae(H, _, 1, D));
|
|
1474
|
+
}, [se, H, _, D]), et = X(() => {
|
|
1475
|
+
se(Y(/* @__PURE__ */ new Date()));
|
|
1476
|
+
}, [se]), tt = xt(
|
|
1477
|
+
H,
|
|
1478
|
+
_,
|
|
1479
|
+
N,
|
|
1480
|
+
P,
|
|
1481
|
+
D
|
|
1482
|
+
), ve = ze(g, h), nt = ze(S, F), rt = _ === "month" ? /* @__PURE__ */ r.jsx(
|
|
1445
1483
|
We,
|
|
1446
1484
|
{
|
|
1447
|
-
date:
|
|
1448
|
-
weeks:
|
|
1449
|
-
events:
|
|
1450
|
-
locale:
|
|
1485
|
+
date: H,
|
|
1486
|
+
weeks: Oe(H, P),
|
|
1487
|
+
events: be,
|
|
1488
|
+
locale: N,
|
|
1451
1489
|
maxEventsPerDay: d,
|
|
1452
|
-
isLoading:
|
|
1453
|
-
onDayClick:
|
|
1490
|
+
isLoading: I,
|
|
1491
|
+
onDayClick: ve,
|
|
1454
1492
|
onEventClick: y,
|
|
1455
|
-
onShowMore:
|
|
1456
|
-
renderEvent:
|
|
1493
|
+
onShowMore: k,
|
|
1494
|
+
renderEvent: v,
|
|
1457
1495
|
renderDayAction: L,
|
|
1458
|
-
drag:
|
|
1496
|
+
drag: pe,
|
|
1459
1497
|
editable: x,
|
|
1460
|
-
selectable:
|
|
1498
|
+
selectable: l
|
|
1461
1499
|
}
|
|
1462
|
-
) :
|
|
1463
|
-
|
|
1500
|
+
) : _ === "agenda" ? /* @__PURE__ */ r.jsx(
|
|
1501
|
+
Xe,
|
|
1464
1502
|
{
|
|
1465
|
-
days: ht(
|
|
1466
|
-
events:
|
|
1467
|
-
locale:
|
|
1468
|
-
isLoading:
|
|
1469
|
-
emptyState:
|
|
1470
|
-
onDayClick:
|
|
1503
|
+
days: ht(H, P, D),
|
|
1504
|
+
events: be,
|
|
1505
|
+
locale: N,
|
|
1506
|
+
isLoading: I,
|
|
1507
|
+
emptyState: W,
|
|
1508
|
+
onDayClick: ve,
|
|
1471
1509
|
onEventClick: y,
|
|
1472
|
-
renderEvent:
|
|
1510
|
+
renderEvent: v
|
|
1473
1511
|
}
|
|
1474
1512
|
) : /* @__PURE__ */ r.jsx(
|
|
1475
1513
|
Ge,
|
|
1476
1514
|
{
|
|
1477
|
-
view:
|
|
1478
|
-
days:
|
|
1479
|
-
events:
|
|
1480
|
-
locale:
|
|
1481
|
-
minMinutes:
|
|
1515
|
+
view: _,
|
|
1516
|
+
days: _ === "week" ? pt(H, P) : [H],
|
|
1517
|
+
events: be,
|
|
1518
|
+
locale: N,
|
|
1519
|
+
minMinutes: ye,
|
|
1482
1520
|
maxMinutes: Ke,
|
|
1483
1521
|
slotDuration: $,
|
|
1484
|
-
slotHeight:
|
|
1522
|
+
slotHeight: p,
|
|
1485
1523
|
scrollToMinutes: Je,
|
|
1486
|
-
nowIndicator:
|
|
1487
|
-
isLoading:
|
|
1488
|
-
onDayClick:
|
|
1524
|
+
nowIndicator: c,
|
|
1525
|
+
isLoading: I,
|
|
1526
|
+
onDayClick: ve,
|
|
1489
1527
|
onSlotClick: nt,
|
|
1490
1528
|
onEventClick: y,
|
|
1491
|
-
renderEvent:
|
|
1492
|
-
|
|
1529
|
+
renderEvent: v,
|
|
1530
|
+
maxAllDayEvents: d,
|
|
1531
|
+
onShowMore: k,
|
|
1532
|
+
drag: pe,
|
|
1493
1533
|
editable: x,
|
|
1494
|
-
selectable:
|
|
1534
|
+
selectable: l
|
|
1495
1535
|
}
|
|
1496
1536
|
);
|
|
1497
1537
|
return /* @__PURE__ */ r.jsxs(
|
|
1498
1538
|
"div",
|
|
1499
1539
|
{
|
|
1500
1540
|
role: "group",
|
|
1501
|
-
"aria-label":
|
|
1502
|
-
className:
|
|
1541
|
+
"aria-label": w,
|
|
1542
|
+
className: K(
|
|
1503
1543
|
"pyrion-calendar flex h-full min-h-96 w-full flex-col overflow-hidden rounded-md border border-neutral-default-default bg-neutral-primary-default",
|
|
1504
|
-
|
|
1544
|
+
Z
|
|
1505
1545
|
),
|
|
1506
1546
|
children: [
|
|
1507
|
-
|
|
1547
|
+
B && /* @__PURE__ */ r.jsx(
|
|
1508
1548
|
Ue,
|
|
1509
1549
|
{
|
|
1510
1550
|
title: tt,
|
|
1511
|
-
view:
|
|
1551
|
+
view: _,
|
|
1512
1552
|
views: a,
|
|
1513
1553
|
onViewChange: Ze,
|
|
1514
1554
|
onPrev: qe,
|
|
1515
1555
|
onNext: Qe,
|
|
1516
1556
|
onToday: et,
|
|
1517
|
-
actionSlot:
|
|
1518
|
-
className:
|
|
1557
|
+
actionSlot: C,
|
|
1558
|
+
className: K("px-3 pt-3", o)
|
|
1519
1559
|
}
|
|
1520
1560
|
),
|
|
1521
1561
|
/* @__PURE__ */ r.jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: rt })
|
|
@@ -1523,8 +1563,8 @@ function Lt({
|
|
|
1523
1563
|
}
|
|
1524
1564
|
);
|
|
1525
1565
|
}
|
|
1526
|
-
|
|
1566
|
+
Pt.displayName = "Calendar";
|
|
1527
1567
|
export {
|
|
1528
|
-
|
|
1529
|
-
|
|
1568
|
+
Pt as Calendar,
|
|
1569
|
+
Pt as default
|
|
1530
1570
|
};
|