@memobit/libs 3.1.6 → 3.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/components/EventCalendar/EventCalendar.Month.js +150 -88
- package/dist/components/EventCalendar/EventCalendar.Week.js +103 -78
- package/dist/components/EventCalendar/EventCalendar.css +1 -1
- package/dist/components/EventCalendar/EventCalendar.helpers.js +75 -54
- package/dist/components/EventCalendar/EventCalendar2.js +39 -38
- package/dist/components/MiniSort/MiniSort2.js +30 -25
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/index.d.ts +18 -2
- package/dist/version.js +1 -1
- package/dist/version.json +4 -4
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getIsoWeek as
|
|
2
|
-
import { bucketEventsByDay as
|
|
3
|
-
import { EventCalendarChip as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { jsx as
|
|
6
|
-
var
|
|
1
|
+
import { getIsoWeek as ae, getMonthMatrix as re, isSameDay as oe, isToday as ce, isWeekend as le } from "../../helpers/Datetime.js";
|
|
2
|
+
import { bucketEventsByDay as se, isMultiDayEvent as ie, layoutWeekSpans as de, startOfDay as g } from "./EventCalendar.helpers.js";
|
|
3
|
+
import { EventCalendarChip as z } from "./EventCalendar.Chip.js";
|
|
4
|
+
import { useCallback as M, useEffect as ue, useMemo as d, useState as T } from "react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
var C = [
|
|
7
7
|
"Sun",
|
|
8
8
|
"Mon",
|
|
9
9
|
"Tue",
|
|
@@ -12,107 +12,169 @@ var p = [
|
|
|
12
12
|
"Fri",
|
|
13
13
|
"Sat"
|
|
14
14
|
];
|
|
15
|
-
function
|
|
16
|
-
const [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
function ge({ date: u, dragEnabled: f, draggingId: w, emptyLabel: x, events: m, firstDayOfWeek: v, maxEventsPerDay: E, onDayClick: S, onDragEnd: $, onDragStart: L, onDrop: G, onEventClick: P, onOpenDay: _, onRangeSelect: h, renderEvent: j, showWeekNumbers: B }) {
|
|
16
|
+
const [H, A] = T(null), [J, D] = T(null), [r, b] = T(null);
|
|
17
|
+
ue(() => {
|
|
18
|
+
if (!r) return;
|
|
19
|
+
const e = () => {
|
|
20
|
+
if (r.anchor.getTime() !== r.focus.getTime()) {
|
|
21
|
+
const [a, i] = [r.anchor, r.focus].sort((l, N) => l.getTime() - N.getTime());
|
|
22
|
+
h?.({
|
|
23
|
+
start: a,
|
|
24
|
+
end: i
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
b(null);
|
|
28
|
+
};
|
|
29
|
+
return window.addEventListener("pointerup", e), window.addEventListener("pointercancel", e), () => {
|
|
30
|
+
window.removeEventListener("pointerup", e), window.removeEventListener("pointercancel", e);
|
|
31
|
+
};
|
|
32
|
+
}, [h, r]);
|
|
33
|
+
const Q = M((e, a) => {
|
|
34
|
+
!h || e.button !== 0 || e.target.closest(".event-calendar__chip, button") || b({
|
|
35
|
+
anchor: g(a),
|
|
36
|
+
focus: g(a)
|
|
37
|
+
});
|
|
38
|
+
}, [h]), U = M((e) => {
|
|
39
|
+
b((a) => a && {
|
|
40
|
+
...a,
|
|
41
|
+
focus: g(e)
|
|
42
|
+
});
|
|
43
|
+
}, []), V = M((e) => {
|
|
44
|
+
if (!r) return !1;
|
|
45
|
+
const a = g(e).getTime(), i = Math.min(r.anchor.getTime(), r.focus.getTime()), l = Math.max(r.anchor.getTime(), r.focus.getTime());
|
|
46
|
+
return a >= i && a <= l;
|
|
47
|
+
}, [r]), y = d(() => re(u.getFullYear(), u.getMonth(), v), [u, v]), F = d(() => y.flat(), [y]), I = d(() => se(m, F), [m, F]), X = d(() => new Map(I.map((e) => [e.date.toDateString(), e])), [I]), Z = d(() => v === 1 ? [...C.slice(1), C[0]] : C, [v]), O = u.getMonth(), R = m.length > 0, ee = /* @__PURE__ */ new Date(), ne = (e, a) => {
|
|
48
|
+
e.preventDefault(), D(null), G(a, !0);
|
|
49
|
+
}, te = (e, a) => {
|
|
50
|
+
!f || w === null || (e.preventDefault(), e.dataTransfer.dropEffect = "move", D(a));
|
|
20
51
|
};
|
|
21
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ s("div", {
|
|
22
53
|
className: "event-calendar__month",
|
|
23
54
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ s("div", {
|
|
25
56
|
className: "event-calendar__weekdays",
|
|
26
|
-
children: [
|
|
57
|
+
children: [B && /* @__PURE__ */ o("div", {
|
|
27
58
|
className: "event-calendar__week-number event-calendar__week-number--head",
|
|
28
59
|
children: "Wk"
|
|
29
|
-
}),
|
|
60
|
+
}), Z.map((e) => /* @__PURE__ */ o("div", {
|
|
30
61
|
className: "event-calendar__weekday",
|
|
31
|
-
children:
|
|
32
|
-
},
|
|
62
|
+
children: e
|
|
63
|
+
}, e))]
|
|
33
64
|
}),
|
|
34
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ o("div", {
|
|
35
66
|
className: "event-calendar__weeks",
|
|
36
|
-
children:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
className: "event-calendar__week-
|
|
40
|
-
children:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
className:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
event
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
67
|
+
children: y.map((e, a) => {
|
|
68
|
+
const i = e.some((n) => oe(n, ee)), l = de(m, e), N = l.reduce((n, c) => Math.max(n, c.lane + 1), 0);
|
|
69
|
+
return /* @__PURE__ */ s("div", {
|
|
70
|
+
className: ["event-calendar__week", i ? "event-calendar__week--current" : ""].filter(Boolean).join(" "),
|
|
71
|
+
children: [B && /* @__PURE__ */ o("div", {
|
|
72
|
+
className: "event-calendar__week-number",
|
|
73
|
+
children: ae(e[0])
|
|
74
|
+
}), /* @__PURE__ */ s("div", {
|
|
75
|
+
className: "event-calendar__week-days",
|
|
76
|
+
style: { "--event-calendar-span-lanes": N },
|
|
77
|
+
children: [l.length > 0 && /* @__PURE__ */ o("div", {
|
|
78
|
+
className: "event-calendar__week-spans",
|
|
79
|
+
children: l.map((n) => /* @__PURE__ */ o(z, {
|
|
80
|
+
className: [
|
|
81
|
+
"event-calendar__chip--span",
|
|
82
|
+
n.isStart ? "" : "event-calendar__chip--span-continues-before",
|
|
83
|
+
n.isEnd ? "" : "event-calendar__chip--span-continues-after"
|
|
84
|
+
].filter(Boolean).join(" "),
|
|
85
|
+
dragEnabled: f,
|
|
86
|
+
event: n.event,
|
|
87
|
+
isDragging: w === n.event.id,
|
|
88
|
+
onClick: P,
|
|
89
|
+
onDragEnd: $,
|
|
90
|
+
onDragStart: L,
|
|
91
|
+
renderEvent: j,
|
|
92
|
+
style: {
|
|
93
|
+
left: `${n.startIndex / e.length * 100}%`,
|
|
94
|
+
width: `${(n.endIndex - n.startIndex + 1) / e.length * 100}%`,
|
|
95
|
+
top: `calc(${n.lane} * var(--event-calendar-span-row))`
|
|
96
|
+
}
|
|
97
|
+
}, `${n.event.id}-span-${a}`))
|
|
98
|
+
}), e.map((n) => {
|
|
99
|
+
const c = n.toDateString(), k = X.get(c), p = k ? [...k.allDay.filter((t) => !ie(t)), ...k.timed] : [], W = H === c, Y = n.getDate() === 1 ? `${n.toLocaleDateString(void 0, { month: "short" })} ${n.getDate()}` : String(n.getDate()), K = W ? p : p.slice(0, E), q = p.length - K.length;
|
|
100
|
+
return /* @__PURE__ */ s("div", {
|
|
101
|
+
className: [
|
|
102
|
+
"event-calendar__day",
|
|
103
|
+
n.getMonth() === O ? "" : "event-calendar__day--outside",
|
|
104
|
+
ce(n) ? "event-calendar__day--today" : "",
|
|
105
|
+
le(n) ? "event-calendar__day--weekend" : "",
|
|
106
|
+
J === c ? "event-calendar__day--drop-target" : "",
|
|
107
|
+
V(n) ? "event-calendar__day--selecting" : "",
|
|
108
|
+
S ? "event-calendar__day--clickable" : ""
|
|
109
|
+
].filter(Boolean).join(" "),
|
|
110
|
+
onClick: () => S?.(n),
|
|
111
|
+
onDragLeave: () => D((t) => t === c ? null : t),
|
|
112
|
+
onDragOver: (t) => te(t, c),
|
|
113
|
+
onDrop: (t) => ne(t, n),
|
|
114
|
+
onPointerDown: (t) => Q(t, n),
|
|
115
|
+
onPointerEnter: () => U(n),
|
|
116
|
+
children: [_ ? /* @__PURE__ */ o("button", {
|
|
117
|
+
className: "event-calendar__day-number event-calendar__day-number--button",
|
|
118
|
+
onClick: (t) => {
|
|
119
|
+
t.stopPropagation(), _(n);
|
|
87
120
|
},
|
|
88
121
|
type: "button",
|
|
122
|
+
children: Y
|
|
123
|
+
}) : /* @__PURE__ */ o("div", {
|
|
124
|
+
className: "event-calendar__day-number",
|
|
125
|
+
children: Y
|
|
126
|
+
}), /* @__PURE__ */ s("div", {
|
|
127
|
+
className: "event-calendar__day-events",
|
|
89
128
|
children: [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
129
|
+
K.map((t) => /* @__PURE__ */ o(z, {
|
|
130
|
+
dragEnabled: f,
|
|
131
|
+
event: t,
|
|
132
|
+
isDragging: w === t.id,
|
|
133
|
+
onClick: P,
|
|
134
|
+
onDragEnd: $,
|
|
135
|
+
onDragStart: L,
|
|
136
|
+
renderEvent: j,
|
|
137
|
+
showTime: !0
|
|
138
|
+
}, `${t.id}-${c}`)),
|
|
139
|
+
q > 0 && /* @__PURE__ */ s("button", {
|
|
140
|
+
className: "event-calendar__more",
|
|
141
|
+
onClick: (t) => {
|
|
142
|
+
if (t.stopPropagation(), _) {
|
|
143
|
+
_(n);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
A(c);
|
|
147
|
+
},
|
|
148
|
+
type: "button",
|
|
149
|
+
children: [
|
|
150
|
+
"+",
|
|
151
|
+
q,
|
|
152
|
+
" more"
|
|
153
|
+
]
|
|
154
|
+
}),
|
|
155
|
+
W && p.length > E && /* @__PURE__ */ o("button", {
|
|
156
|
+
className: "event-calendar__more",
|
|
157
|
+
onClick: (t) => {
|
|
158
|
+
t.stopPropagation(), A(null);
|
|
159
|
+
},
|
|
160
|
+
type: "button",
|
|
161
|
+
children: "Show less"
|
|
162
|
+
})
|
|
93
163
|
]
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
className: "event-calendar__more",
|
|
97
|
-
onClick: (e) => {
|
|
98
|
-
e.stopPropagation(), w(null);
|
|
99
|
-
},
|
|
100
|
-
type: "button",
|
|
101
|
-
children: "Show less"
|
|
102
|
-
})
|
|
103
|
-
]
|
|
164
|
+
})]
|
|
165
|
+
}, c);
|
|
104
166
|
})]
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
}
|
|
167
|
+
})]
|
|
168
|
+
}, a);
|
|
169
|
+
})
|
|
108
170
|
}),
|
|
109
|
-
!
|
|
171
|
+
!R && x && /* @__PURE__ */ o("div", {
|
|
110
172
|
className: "event-calendar__empty",
|
|
111
|
-
children:
|
|
173
|
+
children: x
|
|
112
174
|
})
|
|
113
175
|
]
|
|
114
176
|
});
|
|
115
177
|
}
|
|
116
178
|
export {
|
|
117
|
-
|
|
179
|
+
ge as EventCalendarMonth
|
|
118
180
|
};
|
|
@@ -1,117 +1,142 @@
|
|
|
1
|
-
import { isToday as
|
|
2
|
-
import { bucketEventsByDay as
|
|
3
|
-
import { EventCalendarChip as
|
|
4
|
-
import { useEffect as
|
|
5
|
-
import { jsx as
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
const [
|
|
9
|
-
const e =
|
|
10
|
-
return e.length > 0 ? Math.min(...e) :
|
|
11
|
-
}, [
|
|
12
|
-
|
|
13
|
-
if (!
|
|
14
|
-
const e = Math.max(A -
|
|
15
|
-
|
|
1
|
+
import { isToday as R, isWeekend as q } from "../../helpers/Datetime.js";
|
|
2
|
+
import { bucketEventsByDay as z, formatHourLabel as G, getWeekDays as I, isActiveHour as W, isMultiDayEvent as J, layoutDayEvents as K, layoutWeekSpans as P, startOfDay as Q } from "./EventCalendar.helpers.js";
|
|
3
|
+
import { EventCalendarChip as x } from "./EventCalendar.Chip.js";
|
|
4
|
+
import { useEffect as V, useMemo as v, useRef as X, useState as Y } from "react";
|
|
5
|
+
import { jsx as n, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
var Z = 8;
|
|
7
|
+
function ne({ activeHours: _, date: j, dayEndHour: g, dayStartHour: r, defaultDurationMinutes: U, dragEnabled: m, draggingId: h, events: p, firstDayOfWeek: L, hourHeight: i, onDayClick: B, onDragEnd: y, onDragStart: u, onDrop: M, onEventClick: D, renderEvent: w }) {
|
|
8
|
+
const [O, d] = Y(null), N = X(null), l = v(() => I(j, L), [j, L]), o = v(() => z(p, l), [p, l]), k = v(() => Array.from({ length: Math.max(g - r, 1) }, (e, t) => r + t), [r, g]), F = o.some((e) => e.allDay.length > 0), $ = v(() => P(p, l), [p, l]), b = $.reduce((e, t) => Math.max(e, t.lane + 1), 0), S = k.length * i, A = v(() => {
|
|
9
|
+
const e = o.flatMap((t) => t.timed.map((a) => a.start.getHours()));
|
|
10
|
+
return e.length > 0 ? Math.min(...e) : _?.start ?? Z;
|
|
11
|
+
}, [_, o]);
|
|
12
|
+
V(() => {
|
|
13
|
+
if (!N.current) return;
|
|
14
|
+
const e = Math.max(A - r - 1, 0);
|
|
15
|
+
N.current.scrollTop = e * i;
|
|
16
16
|
}, [
|
|
17
|
-
|
|
17
|
+
r,
|
|
18
18
|
A,
|
|
19
|
-
|
|
19
|
+
i
|
|
20
20
|
]);
|
|
21
21
|
const C = (e, t) => {
|
|
22
|
-
const a =
|
|
22
|
+
const a = Q(e);
|
|
23
23
|
return a.setHours(t, 0, 0, 0), a;
|
|
24
|
-
},
|
|
25
|
-
!
|
|
24
|
+
}, T = (e, t) => {
|
|
25
|
+
!m || h === null || (e.preventDefault(), e.dataTransfer.dropEffect = "move", d(t));
|
|
26
26
|
};
|
|
27
27
|
return /* @__PURE__ */ s("div", {
|
|
28
28
|
className: "event-calendar__week-view",
|
|
29
29
|
children: [
|
|
30
30
|
/* @__PURE__ */ s("div", {
|
|
31
31
|
className: "event-calendar__week-head",
|
|
32
|
-
children: [/* @__PURE__ */
|
|
32
|
+
children: [/* @__PURE__ */ n("div", { className: "event-calendar__gutter-spacer" }), l.map((e) => /* @__PURE__ */ s("div", {
|
|
33
33
|
className: [
|
|
34
34
|
"event-calendar__week-day-head",
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
R(e) ? "event-calendar__week-day-head--today" : "",
|
|
36
|
+
q(e) ? "event-calendar__week-day-head--weekend" : ""
|
|
37
37
|
].filter(Boolean).join(" "),
|
|
38
|
-
children: [/* @__PURE__ */
|
|
38
|
+
children: [/* @__PURE__ */ n("span", {
|
|
39
39
|
className: "event-calendar__week-day-name",
|
|
40
40
|
children: e.toLocaleDateString(void 0, { weekday: "short" })
|
|
41
|
-
}), /* @__PURE__ */
|
|
41
|
+
}), /* @__PURE__ */ n("span", {
|
|
42
42
|
className: "event-calendar__week-day-number",
|
|
43
43
|
children: e.getDate()
|
|
44
44
|
})]
|
|
45
45
|
}, e.toDateString()))]
|
|
46
46
|
}),
|
|
47
|
-
|
|
47
|
+
F && /* @__PURE__ */ s("div", {
|
|
48
48
|
className: "event-calendar__all-day",
|
|
49
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ n("div", {
|
|
50
50
|
className: "event-calendar__gutter-label",
|
|
51
51
|
children: "All day"
|
|
52
|
-
}),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
}), /* @__PURE__ */ s("div", {
|
|
53
|
+
className: "event-calendar__all-day-cells",
|
|
54
|
+
style: { "--event-calendar-span-lanes": b },
|
|
55
|
+
children: [$.length > 0 && /* @__PURE__ */ n("div", {
|
|
56
|
+
className: "event-calendar__week-spans",
|
|
57
|
+
children: $.map((e) => /* @__PURE__ */ n(x, {
|
|
58
|
+
className: [
|
|
59
|
+
"event-calendar__chip--span",
|
|
60
|
+
e.isStart ? "" : "event-calendar__chip--span-continues-before",
|
|
61
|
+
e.isEnd ? "" : "event-calendar__chip--span-continues-after"
|
|
62
|
+
].filter(Boolean).join(" "),
|
|
63
|
+
dragEnabled: m,
|
|
64
|
+
event: e.event,
|
|
65
|
+
isDragging: h === e.event.id,
|
|
66
|
+
onClick: D,
|
|
67
|
+
onDragEnd: y,
|
|
68
|
+
onDragStart: u,
|
|
69
|
+
renderEvent: w,
|
|
70
|
+
style: {
|
|
71
|
+
left: `${e.startIndex / l.length * 100}%`,
|
|
72
|
+
width: `${(e.endIndex - e.startIndex + 1) / l.length * 100}%`,
|
|
73
|
+
top: `calc(${e.lane} * var(--event-calendar-span-row))`
|
|
74
|
+
}
|
|
75
|
+
}, `${e.event.id}-span`))
|
|
76
|
+
}), o.map((e) => {
|
|
77
|
+
const t = `allday-${e.date.toDateString()}`;
|
|
78
|
+
return /* @__PURE__ */ n("div", {
|
|
79
|
+
className: ["event-calendar__all-day-cell", O === t ? "event-calendar__all-day-cell--drop-target" : ""].filter(Boolean).join(" "),
|
|
80
|
+
onDragLeave: () => d((a) => a === t ? null : a),
|
|
81
|
+
onDragOver: (a) => T(a, t),
|
|
82
|
+
onDrop: (a) => {
|
|
83
|
+
a.preventDefault(), d(null), M(e.date, !0);
|
|
84
|
+
},
|
|
85
|
+
children: e.allDay.filter((a) => !J(a)).map((a) => /* @__PURE__ */ n(x, {
|
|
86
|
+
dragEnabled: m,
|
|
87
|
+
event: a,
|
|
88
|
+
isDragging: h === a.id,
|
|
89
|
+
onClick: D,
|
|
90
|
+
onDragEnd: y,
|
|
91
|
+
onDragStart: u,
|
|
92
|
+
renderEvent: w
|
|
93
|
+
}, `${a.id}-${t}`))
|
|
94
|
+
}, t);
|
|
95
|
+
})]
|
|
71
96
|
})]
|
|
72
97
|
}),
|
|
73
98
|
/* @__PURE__ */ s("div", {
|
|
74
99
|
className: "event-calendar__week-body",
|
|
75
|
-
ref:
|
|
76
|
-
children: [/* @__PURE__ */
|
|
100
|
+
ref: N,
|
|
101
|
+
children: [/* @__PURE__ */ n("div", {
|
|
77
102
|
className: "event-calendar__gutter",
|
|
78
|
-
style: { height:
|
|
79
|
-
children:
|
|
80
|
-
className: ["event-calendar__gutter-hour",
|
|
81
|
-
style: { height:
|
|
82
|
-
children: /* @__PURE__ */
|
|
103
|
+
style: { height: S },
|
|
104
|
+
children: k.map((e) => /* @__PURE__ */ n("div", {
|
|
105
|
+
className: ["event-calendar__gutter-hour", W(e, _) ? "" : "event-calendar__gutter-hour--inactive"].filter(Boolean).join(" "),
|
|
106
|
+
style: { height: i },
|
|
107
|
+
children: /* @__PURE__ */ n("span", { children: G(e) })
|
|
83
108
|
}, e))
|
|
84
|
-
}),
|
|
85
|
-
const t =
|
|
109
|
+
}), o.map((e) => {
|
|
110
|
+
const t = K(e.timed, r, g, U);
|
|
86
111
|
return /* @__PURE__ */ s("div", {
|
|
87
|
-
className: ["event-calendar__week-column",
|
|
88
|
-
style: { height:
|
|
89
|
-
children: [
|
|
90
|
-
const
|
|
91
|
-
return /* @__PURE__ */
|
|
112
|
+
className: ["event-calendar__week-column", R(e.date) ? "event-calendar__week-column--today" : ""].filter(Boolean).join(" "),
|
|
113
|
+
style: { height: S },
|
|
114
|
+
children: [k.map((a) => {
|
|
115
|
+
const f = `${e.date.toDateString()}-${a}`;
|
|
116
|
+
return /* @__PURE__ */ n("div", {
|
|
92
117
|
className: [
|
|
93
118
|
"event-calendar__slot",
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
119
|
+
W(a, _) ? "" : "event-calendar__slot--inactive",
|
|
120
|
+
O === f ? "event-calendar__slot--drop-target" : "",
|
|
121
|
+
B ? "event-calendar__slot--clickable" : ""
|
|
97
122
|
].filter(Boolean).join(" "),
|
|
98
|
-
onClick: () =>
|
|
99
|
-
onDragLeave: () =>
|
|
100
|
-
onDragOver: (
|
|
101
|
-
onDrop: (
|
|
102
|
-
|
|
123
|
+
onClick: () => B?.(C(e.date, a)),
|
|
124
|
+
onDragLeave: () => d((c) => c === f ? null : c),
|
|
125
|
+
onDragOver: (c) => T(c, f),
|
|
126
|
+
onDrop: (c) => {
|
|
127
|
+
c.preventDefault(), d(null), M(C(e.date, a), !1);
|
|
103
128
|
},
|
|
104
|
-
style: { height:
|
|
105
|
-
},
|
|
106
|
-
}), t.map((a) => /* @__PURE__ */
|
|
129
|
+
style: { height: i }
|
|
130
|
+
}, f);
|
|
131
|
+
}), t.map((a) => /* @__PURE__ */ n(x, {
|
|
107
132
|
className: "event-calendar__chip--positioned",
|
|
108
|
-
dragEnabled:
|
|
133
|
+
dragEnabled: m,
|
|
109
134
|
event: a.event,
|
|
110
|
-
isDragging:
|
|
111
|
-
onClick:
|
|
112
|
-
onDragEnd:
|
|
113
|
-
onDragStart:
|
|
114
|
-
renderEvent:
|
|
135
|
+
isDragging: h === a.event.id,
|
|
136
|
+
onClick: D,
|
|
137
|
+
onDragEnd: y,
|
|
138
|
+
onDragStart: u,
|
|
139
|
+
renderEvent: w,
|
|
115
140
|
showTime: !0,
|
|
116
141
|
style: {
|
|
117
142
|
top: `${a.top}%`,
|
|
@@ -127,5 +152,5 @@ function H({ activeHours: d, date: y, dayEndHour: m, dayStartHour: n, defaultDur
|
|
|
127
152
|
});
|
|
128
153
|
}
|
|
129
154
|
export {
|
|
130
|
-
|
|
155
|
+
ne as EventCalendarWeek
|
|
131
156
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.event-calendar{gap:var(--spacing-12);width:100%;color:var(--body-color);--event-calendar-chip-color:var(--body-accent-color);flex-direction:column;display:flex}.event-calendar__header{align-items:center;gap:var(--spacing-12);flex-wrap:wrap;display:flex}.event-calendar__header .toggle-buttons{align-self:center;height:auto}.event-calendar__nav{align-items:center;gap:var(--spacing-4);display:flex}.event-calendar__title{font-size:var(--font-size-lg);font-weight:var(--font-weight-semibold);color:var(--body-title-color);flex:auto;margin:0}.event-calendar__header-extra{align-items:center;gap:var(--spacing-8);display:flex}.event-calendar__viewport{touch-action:pan-y}.event-calendar__month{border:1px solid var(--card-border-color);border-radius:var(--radius);background-color:var(--card-background-color);flex-direction:column;display:flex;overflow:hidden}.event-calendar__weekdays,.event-calendar__week{display:flex}.event-calendar__weekdays{background-color:var(--card-background-accent-color);border-bottom:1px solid var(--card-border-color)}.event-calendar__week-number{width:var(--spacing-32);border-right:1px solid var(--card-border-color);background-color:var(--card-background-accent-color);font-size:var(--font-size-xxs);font-variant-numeric:tabular-nums;font-weight:var(--font-weight-semibold);color:var(--body-sub-title-color);opacity:.7;flex:none;justify-content:center;align-items:center;display:flex}.event-calendar__week-number--head{text-transform:uppercase;letter-spacing:.04em}.event-calendar__week--current .event-calendar__week-number{background-color:color-mix(in srgb, var(--body-accent-color) 22%, var(--card-background-accent-color));color:var(--body-color-accent);opacity:1}.event-calendar__weekday{min-width:0;padding:var(--spacing-8);text-align:center;font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);text-transform:uppercase;letter-spacing:.04em;color:var(--body-color-muted);flex:1 1 0}.event-calendar__weeks{flex-direction:column;display:flex}.event-calendar__week{border-bottom:1px solid var(--card-border-color);flex:auto}.event-calendar__week:last-child{border-bottom:none}.event-calendar__week--current{box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--body-accent-color) 45%, transparent)}.event-calendar__day{gap:var(--spacing-4);min-width:0;min-height:var(--spacing-100);padding:var(--spacing-6);border-right:1px solid var(--card-border-color);transition:background-color var(--transition-fast);flex-direction:column;flex:1 1 0;display:flex}.event-calendar__day:last-child{border-right:none}.event-calendar__day--weekend{background-color:var(--card-background-accent-color)}.event-calendar__day--outside{background-color:color-mix(in srgb, var(--card-border-color) 22%, var(--card-background-color))}.event-calendar__day--outside .event-calendar__day-number{opacity:.5}.event-calendar__day--outside.event-calendar__day--weekend{background-color:color-mix(in srgb, var(--card-border-color) 30%, var(--card-background-accent-color))}.event-calendar__day--clickable:hover{cursor:pointer;background-color:color-mix(in srgb, var(--body-accent-color) 8%, transparent)}.event-calendar__day--drop-target{background-color:color-mix(in srgb, var(--body-accent-color) 18%, transparent);box-shadow:inset 0 0 0 2px var(--body-accent-color)}.event-calendar__day-number{font-size:var(--font-size-xs);font-weight:var(--font-weight-medium);color:var(--body-color-muted);background:0 0;border:none;align-self:flex-start;padding:0}.event-calendar__day-number--button{min-width:var(--spacing-20);height:var(--spacing-20);border-radius:var(--radius-full);cursor:pointer}.event-calendar__day-number--button:hover{background-color:color-mix(in srgb, var(--body-accent-color) 20%, transparent);color:var(--body-color-accent)}.event-calendar__day--today .event-calendar__day-number{min-width:var(--spacing-20);height:var(--spacing-20);padding:0 var(--spacing-4);border-radius:var(--radius-full);background-color:var(--body-accent-color);color:var(--card-background-color);font-weight:var(--font-weight-bold);justify-content:center;align-self:flex-start;align-items:center;display:inline-flex}.event-calendar__day-events{gap:var(--spacing-2);flex-direction:column;min-width:0;display:flex}.event-calendar__more{padding:var(--spacing-1) var(--spacing-4);border-radius:var(--radius-sm);color:var(--body-color-muted);font-size:var(--font-size-xxs);font-weight:var(--font-weight-medium);cursor:pointer;background:0 0;border:none;align-self:flex-start}.event-calendar__more:hover{color:var(--body-accent-color);background-color:color-mix(in srgb, var(--body-accent-color) 12%, transparent)}.event-calendar__empty{padding:var(--spacing-16);text-align:center;color:var(--body-color-muted);font-size:var(--font-size-sm);border-top:1px solid var(--card-border-color)}.event-calendar__week-view{border:1px solid var(--card-border-color);border-radius:var(--radius);background-color:var(--card-background-color);flex-direction:column;display:flex;overflow:hidden}.event-calendar__week-head{background-color:var(--card-background-accent-color);border-bottom:1px solid var(--card-border-color);display:flex}.event-calendar__gutter-spacer,.event-calendar__gutter-label,.event-calendar__gutter{flex:0 0 var(--spacing-60);width:var(--spacing-60);border-right:1px solid var(--card-border-color)}.event-calendar__gutter-label{padding:var(--spacing-4) var(--spacing-6);font-size:var(--font-size-xxs);color:var(--body-color-muted);justify-content:flex-end;align-items:center;display:flex}.event-calendar__week-day-head{align-items:center;gap:var(--spacing-2);min-width:0;padding:var(--spacing-8) var(--spacing-4);border-right:1px solid var(--card-border-color);flex-direction:column;flex:1 1 0;display:flex}.event-calendar__week-day-head:last-child{border-right:none}.event-calendar__week-day-head--weekend{background-color:color-mix(in srgb, var(--body-color-muted) 8%, transparent)}.event-calendar__week-day-name{font-size:var(--font-size-xxs);text-transform:uppercase;letter-spacing:.04em;color:var(--body-color-muted)}.event-calendar__week-day-number{font-size:var(--font-size-md);font-weight:var(--font-weight-semibold);color:var(--body-color)}.event-calendar__week-day-head--today .event-calendar__week-day-number{min-width:var(--spacing-24);height:var(--spacing-24);border-radius:var(--radius-full);background-color:var(--body-accent-color);color:var(--card-background-color);justify-content:center;align-items:center;display:inline-flex}.event-calendar__all-day{border-bottom:1px solid var(--card-border-color);display:flex}.event-calendar__all-day-cell{gap:var(--spacing-2);min-width:0;padding:var(--spacing-4);border-right:1px solid var(--card-border-color);flex-direction:column;flex:1 1 0;display:flex}.event-calendar__all-day-cell:last-child{border-right:none}.event-calendar__all-day-cell--drop-target{background-color:color-mix(in srgb, var(--body-accent-color) 18%, transparent)}.event-calendar__week-body{max-height:var(--spacing-400);display:flex;overflow-y:auto}.event-calendar__gutter{flex-direction:column;display:flex}.event-calendar__gutter-hour{padding-right:var(--spacing-6);font-size:var(--font-size-xxs);color:var(--body-color-muted);justify-content:flex-end;align-items:flex-start;display:flex}.event-calendar__gutter-hour span{transform:translateY(-50%)}.event-calendar__gutter-hour:first-child span{transform:none}.event-calendar__gutter-hour--inactive{opacity:.5}.event-calendar__week-column{border-right:1px solid var(--card-border-color);flex:1 1 0;min-width:0;position:relative}.event-calendar__week-column:last-child{border-right:none}.event-calendar__week-column--today{background-color:color-mix(in srgb, var(--body-accent-color) 6%, transparent)}.event-calendar__slot{border-bottom:1px solid color-mix(in srgb, var(--card-border-color) 60%, transparent);transition:background-color var(--transition-fast)}.event-calendar__slot--inactive{background-color:color-mix(in srgb, var(--body-background) 60%, transparent)}.event-calendar__slot--clickable:hover{cursor:pointer;background-color:color-mix(in srgb, var(--body-accent-color) 10%, transparent)}.event-calendar__slot--drop-target{background-color:color-mix(in srgb, var(--body-accent-color) 22%, transparent)}.event-calendar__chip{align-items:baseline;gap:var(--spacing-4);min-width:0;padding:var(--spacing-1) var(--spacing-6);border-radius:var(--radius-sm);border-left:3px solid var(--event-calendar-chip-color);background-color:color-mix(in srgb, var(--event-calendar-chip-color) 18%, var(--card-background-color));color:var(--body-color);font-size:var(--font-size-xs);transition:background-color var(--transition-fast), opacity var(--transition-fast);line-height:1.5;display:flex;overflow:hidden}.event-calendar__chip--positioned{flex-direction:column;align-items:flex-start;gap:0;position:absolute}.event-calendar__chip--clickable:hover{cursor:pointer;background-color:color-mix(in srgb, var(--event-calendar-chip-color) 30%, var(--card-background-color))}.event-calendar__chip--draggable{cursor:grab}.event-calendar__chip--dragging{opacity:.4}.event-calendar__chip--accent{--event-calendar-chip-color:var(--body-accent-color)}.event-calendar__chip--success{--event-calendar-chip-color:var(--button-success-background-color)}.event-calendar__chip--warning{--event-calendar-chip-color:var(--button-warning-background-color)}.event-calendar__chip--danger{--event-calendar-chip-color:var(--button-danger-background-color)}.event-calendar__chip--muted{--event-calendar-chip-color:var(--body-color-muted)}.event-calendar__chip--ghost{--event-calendar-chip-color:var(--body-color-muted);border:1px dashed var(--event-calendar-chip-color);color:var(--body-color-muted);background-color:#0000;border-left-style:solid;border-left-width:3px}.event-calendar__chip--done{--event-calendar-chip-color:var(--body-color-muted);opacity:.6}.event-calendar__chip--done .event-calendar__chip-title{text-decoration:line-through}.event-calendar__chip-leading{flex:none;align-self:center;align-items:center;line-height:1;display:inline-flex}.event-calendar__chip-leading .icon{width:var(--spacing-12);height:var(--spacing-12)}.event-calendar__chip-time{font-variant-numeric:tabular-nums;font-size:var(--font-size-xxs);color:var(--body-color-muted);flex:none}.event-calendar__chip-title{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}@media (width<=767px){.event-calendar__header{gap:var(--spacing-8)}.event-calendar__nav{flex:auto}.event-calendar__header .toggle-buttons{flex:none;margin-left:auto}.event-calendar__title{font-size:var(--font-size-md);flex:100%;order:-1}.event-calendar__header-extra{flex:100%;order:1}.event-calendar__week-number{width:var(--spacing-20)}.event-calendar__day{min-height:var(--spacing-64);padding:var(--spacing-4)}.event-calendar__weekday{padding:var(--spacing-4);font-size:var(--font-size-xxs)}.event-calendar__chip{padding:0 var(--spacing-4)}.event-calendar__chip-time{display:none}:is(.event-calendar__month .event-calendar__chip:has(.event-calendar__chip-leading),.event-calendar__week-view .event-calendar__chip:has(.event-calendar__chip-leading)){padding:var(--spacing-2);justify-content:center;align-items:center;gap:0}:is(.event-calendar__month .event-calendar__chip:has(.event-calendar__chip-leading) .event-calendar__chip-title,.event-calendar__week-view .event-calendar__chip:has(.event-calendar__chip-leading) .event-calendar__chip-title){display:none}.event-calendar__gutter-spacer,.event-calendar__gutter-label,.event-calendar__gutter{flex-basis:var(--spacing-40);width:var(--spacing-40)}}
|
|
1
|
+
.event-calendar{--event-calendar-span-row:calc(var(--spacing-20) + var(--spacing-2));gap:var(--spacing-12);width:100%;color:var(--body-color);--event-calendar-chip-color:var(--body-accent-color);flex-direction:column;display:flex}.event-calendar__header{align-items:center;gap:var(--spacing-12);flex-wrap:wrap;display:flex}.event-calendar__header .toggle-buttons{align-self:center;height:auto}.event-calendar__nav{align-items:center;gap:var(--spacing-4);display:flex}.event-calendar__title{font-size:var(--font-size-lg);font-weight:var(--font-weight-semibold);color:var(--body-title-color);flex:auto;margin:0}.event-calendar__header-extra{align-items:center;gap:var(--spacing-8);display:flex}.event-calendar__viewport{touch-action:pan-y}.event-calendar__month{border:1px solid var(--card-border-color);border-radius:var(--radius);background-color:var(--card-background-color);flex-direction:column;display:flex;overflow:hidden}.event-calendar__weekdays,.event-calendar__week{display:flex}.event-calendar__week-days{flex:auto;min-width:0;display:flex;position:relative}.event-calendar__all-day-cells{position:relative}.event-calendar__all-day-cells>.event-calendar__week-spans{top:var(--spacing-4)}.event-calendar__all-day-cells{min-width:0;padding-top:calc(var(--event-calendar-span-lanes,0) * var(--event-calendar-span-row));flex:auto;display:flex}.event-calendar__week-spans{top:var(--spacing-24);pointer-events:none;z-index:1;position:absolute;left:0;right:0}.event-calendar__chip--span{margin:0 var(--spacing-2);pointer-events:auto;width:auto;position:absolute}.event-calendar__chip--span.event-calendar__chip--span-continues-before{border-left-width:0;border-top-left-radius:0;border-bottom-left-radius:0;margin-left:0}.event-calendar__chip--span.event-calendar__chip--span-continues-after{border-top-right-radius:0;border-bottom-right-radius:0;margin-right:0}.event-calendar__weekdays{background-color:var(--card-background-accent-color);border-bottom:1px solid var(--card-border-color)}.event-calendar__week-number{width:var(--spacing-32);border-right:1px solid var(--card-border-color);background-color:var(--card-background-accent-color);font-size:var(--font-size-xxs);font-variant-numeric:tabular-nums;font-weight:var(--font-weight-semibold);color:var(--body-sub-title-color);opacity:.7;flex:none;justify-content:center;align-items:center;display:flex}.event-calendar__week-number--head{text-transform:uppercase;letter-spacing:.04em}.event-calendar__week--current .event-calendar__week-number{background-color:color-mix(in srgb, var(--body-accent-color) 22%, var(--card-background-accent-color));color:var(--body-color-accent);opacity:1}.event-calendar__weekday{min-width:0;padding:var(--spacing-8);text-align:center;font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);text-transform:uppercase;letter-spacing:.04em;color:var(--body-color-muted);flex:1 1 0}.event-calendar__weeks{flex-direction:column;display:flex}.event-calendar__week{border-bottom:1px solid var(--card-border-color);flex:auto}.event-calendar__week:last-child{border-bottom:none}.event-calendar__week--current{box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--body-accent-color) 45%, transparent)}.event-calendar__day{gap:var(--spacing-4);min-width:0;min-height:var(--spacing-100);padding:var(--spacing-6);border-right:1px solid var(--card-border-color);transition:background-color var(--transition-fast);flex-direction:column;flex:1 1 0;display:flex}.event-calendar__day:last-child{border-right:none}.event-calendar__day--weekend{background-color:var(--card-background-accent-color)}.event-calendar__day--outside{background-color:color-mix(in srgb, var(--card-border-color) 22%, var(--card-background-color))}.event-calendar__day--outside .event-calendar__day-number{opacity:.5}.event-calendar__day--outside.event-calendar__day--weekend{background-color:color-mix(in srgb, var(--card-border-color) 30%, var(--card-background-accent-color))}.event-calendar__day--clickable:hover{cursor:pointer;background-color:color-mix(in srgb, var(--body-accent-color) 8%, transparent)}.event-calendar__day--drop-target{background-color:color-mix(in srgb, var(--body-accent-color) 18%, transparent);box-shadow:inset 0 0 0 2px var(--body-accent-color)}.event-calendar__day--selecting{background-color:color-mix(in srgb, var(--body-accent-color) 14%, transparent)}.event-calendar__week-days{-webkit-user-select:none;user-select:none}.event-calendar__day-number{font-size:var(--font-size-xs);font-weight:var(--font-weight-medium);color:var(--body-color-muted);background:0 0;border:none;align-self:flex-start;padding:0}.event-calendar__day-number--button{min-width:var(--spacing-20);height:var(--spacing-20);border-radius:var(--radius-full);cursor:pointer}.event-calendar__day-number--button:hover{background-color:color-mix(in srgb, var(--body-accent-color) 20%, transparent);color:var(--body-color-accent)}.event-calendar__day--today .event-calendar__day-number{min-width:var(--spacing-20);height:var(--spacing-20);padding:0 var(--spacing-4);border-radius:var(--radius-full);background-color:var(--body-accent-color);color:var(--card-background-color);font-weight:var(--font-weight-bold);justify-content:center;align-self:flex-start;align-items:center;display:inline-flex}.event-calendar__day-events{margin-top:calc(var(--event-calendar-span-lanes,0) * var(--event-calendar-span-row));gap:var(--spacing-2);flex-direction:column;min-width:0;display:flex}.event-calendar__more{padding:var(--spacing-1) var(--spacing-4);border-radius:var(--radius-sm);color:var(--body-color-muted);font-size:var(--font-size-xxs);font-weight:var(--font-weight-medium);cursor:pointer;background:0 0;border:none;align-self:flex-start}.event-calendar__more:hover{color:var(--body-accent-color);background-color:color-mix(in srgb, var(--body-accent-color) 12%, transparent)}.event-calendar__empty{padding:var(--spacing-16);text-align:center;color:var(--body-color-muted);font-size:var(--font-size-sm);border-top:1px solid var(--card-border-color)}.event-calendar__week-view{border:1px solid var(--card-border-color);border-radius:var(--radius);background-color:var(--card-background-color);flex-direction:column;display:flex;overflow:hidden}.event-calendar__week-head{background-color:var(--card-background-accent-color);border-bottom:1px solid var(--card-border-color);display:flex}.event-calendar__gutter-spacer,.event-calendar__gutter-label,.event-calendar__gutter{flex:0 0 var(--spacing-60);width:var(--spacing-60);border-right:1px solid var(--card-border-color)}.event-calendar__gutter-label{padding:var(--spacing-4) var(--spacing-6);font-size:var(--font-size-xxs);color:var(--body-color-muted);justify-content:flex-end;align-items:center;display:flex}.event-calendar__week-day-head{align-items:center;gap:var(--spacing-2);min-width:0;padding:var(--spacing-8) var(--spacing-4);border-right:1px solid var(--card-border-color);flex-direction:column;flex:1 1 0;display:flex}.event-calendar__week-day-head:last-child{border-right:none}.event-calendar__week-day-head--weekend{background-color:color-mix(in srgb, var(--body-color-muted) 8%, transparent)}.event-calendar__week-day-name{font-size:var(--font-size-xxs);text-transform:uppercase;letter-spacing:.04em;color:var(--body-color-muted)}.event-calendar__week-day-number{font-size:var(--font-size-md);font-weight:var(--font-weight-semibold);color:var(--body-color)}.event-calendar__week-day-head--today .event-calendar__week-day-number{min-width:var(--spacing-24);height:var(--spacing-24);border-radius:var(--radius-full);background-color:var(--body-accent-color);color:var(--card-background-color);justify-content:center;align-items:center;display:inline-flex}.event-calendar__all-day{border-bottom:1px solid var(--card-border-color);display:flex}.event-calendar__all-day-cell{gap:var(--spacing-2);min-width:0;padding:var(--spacing-4);border-right:1px solid var(--card-border-color);flex-direction:column;flex:1 1 0;display:flex}.event-calendar__all-day-cell:last-child{border-right:none}.event-calendar__all-day-cell--drop-target{background-color:color-mix(in srgb, var(--body-accent-color) 18%, transparent)}.event-calendar__week-body{max-height:var(--spacing-400);display:flex;overflow-y:auto}.event-calendar__gutter{flex-direction:column;display:flex}.event-calendar__gutter-hour{padding-right:var(--spacing-6);font-size:var(--font-size-xxs);color:var(--body-color-muted);justify-content:flex-end;align-items:flex-start;display:flex}.event-calendar__gutter-hour span{transform:translateY(-50%)}.event-calendar__gutter-hour:first-child span{transform:none}.event-calendar__gutter-hour--inactive{opacity:.5}.event-calendar__week-column{border-right:1px solid var(--card-border-color);flex:1 1 0;min-width:0;position:relative}.event-calendar__week-column:last-child{border-right:none}.event-calendar__week-column--today{background-color:color-mix(in srgb, var(--body-accent-color) 6%, transparent)}.event-calendar__slot{border-bottom:1px solid color-mix(in srgb, var(--card-border-color) 60%, transparent);transition:background-color var(--transition-fast)}.event-calendar__slot--inactive{background-color:color-mix(in srgb, var(--body-background) 60%, transparent)}.event-calendar__slot--clickable:hover{cursor:pointer;background-color:color-mix(in srgb, var(--body-accent-color) 10%, transparent)}.event-calendar__slot--drop-target{background-color:color-mix(in srgb, var(--body-accent-color) 22%, transparent)}.event-calendar__chip{align-items:baseline;gap:var(--spacing-4);min-width:0;padding:var(--spacing-1) var(--spacing-6);border-radius:var(--radius-sm);border-left:3px solid var(--event-calendar-chip-color);background-color:color-mix(in srgb, var(--event-calendar-chip-color) 18%, var(--card-background-color));color:var(--body-color);font-size:var(--font-size-xs);transition:background-color var(--transition-fast), opacity var(--transition-fast);line-height:1.5;display:flex;overflow:hidden}.event-calendar__chip--positioned{flex-direction:column;align-items:flex-start;gap:0;position:absolute}.event-calendar__chip--clickable:hover{cursor:pointer;background-color:color-mix(in srgb, var(--event-calendar-chip-color) 30%, var(--card-background-color))}.event-calendar__chip--draggable{cursor:grab}.event-calendar__chip--dragging{opacity:.4}.event-calendar__chip--accent{--event-calendar-chip-color:var(--body-accent-color)}.event-calendar__chip--success{--event-calendar-chip-color:var(--button-success-background-color)}.event-calendar__chip--warning{--event-calendar-chip-color:var(--button-warning-background-color)}.event-calendar__chip--danger{--event-calendar-chip-color:var(--button-danger-background-color)}.event-calendar__chip--muted{--event-calendar-chip-color:var(--body-color-muted)}.event-calendar__chip--ghost{--event-calendar-chip-color:var(--body-color-muted);border:1px dashed var(--event-calendar-chip-color);color:var(--body-color-muted);background-color:#0000;border-left-style:solid;border-left-width:3px}.event-calendar__chip--done{--event-calendar-chip-color:var(--body-color-muted);opacity:.6}.event-calendar__chip--done .event-calendar__chip-title{text-decoration:line-through}.event-calendar__chip-leading{flex:none;align-self:center;align-items:center;line-height:1;display:inline-flex}.event-calendar__chip-leading .icon{width:var(--spacing-12);height:var(--spacing-12)}.event-calendar__chip-time{font-variant-numeric:tabular-nums;font-size:var(--font-size-xxs);color:var(--body-color-muted);flex:none}.event-calendar__chip-title{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}@media (width<=767px){.event-calendar__header{gap:var(--spacing-8)}.event-calendar__nav{flex:auto}.event-calendar__header .toggle-buttons{flex:none;margin-left:auto}.event-calendar__title{font-size:var(--font-size-md);flex:100%;order:-1}.event-calendar__header-extra{flex:100%;order:1}.event-calendar__week-number{width:var(--spacing-20)}.event-calendar__day{min-height:var(--spacing-64);padding:var(--spacing-4)}.event-calendar__weekday{padding:var(--spacing-4);font-size:var(--font-size-xxs)}.event-calendar__chip{padding:0 var(--spacing-4)}.event-calendar__chip-time{display:none}:is(.event-calendar__month .event-calendar__chip:has(.event-calendar__chip-leading),.event-calendar__week-view .event-calendar__chip:has(.event-calendar__chip-leading)){padding:var(--spacing-2);justify-content:center;align-items:center;gap:0}:is(.event-calendar__month .event-calendar__chip:has(.event-calendar__chip-leading) .event-calendar__chip-title,.event-calendar__week-view .event-calendar__chip:has(.event-calendar__chip-leading) .event-calendar__chip-title){display:none}.event-calendar__gutter-spacer,.event-calendar__gutter-label,.event-calendar__gutter{flex-basis:var(--spacing-40);width:var(--spacing-40)}}
|
|
@@ -1,72 +1,93 @@
|
|
|
1
|
-
import { addDays as
|
|
2
|
-
var
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
},
|
|
6
|
-
const
|
|
7
|
-
return Array.from({ length: 7 }, (o, i) =>
|
|
8
|
-
},
|
|
1
|
+
import { addDays as D, isSameDay as w } from "../../helpers/Datetime.js";
|
|
2
|
+
var g = (t) => new Date(t.getFullYear(), t.getMonth(), t.getDate()), T = (t, r) => {
|
|
3
|
+
const a = (t.getDay() - r + 7) % 7;
|
|
4
|
+
return D(g(t), -a);
|
|
5
|
+
}, B = (t, r) => {
|
|
6
|
+
const a = T(t, r);
|
|
7
|
+
return Array.from({ length: 7 }, (o, i) => D(a, i));
|
|
8
|
+
}, S = (t) => t.getHours() * 60 + t.getMinutes(), v = (t, r) => t.end ?? new Date(t.start.getTime() + r * 6e4), O = (t, r) => r.map((a) => {
|
|
9
9
|
const o = [], i = [];
|
|
10
|
-
return t.forEach((
|
|
11
|
-
if (
|
|
12
|
-
const
|
|
13
|
-
|
|
10
|
+
return t.forEach((s) => {
|
|
11
|
+
if (s.allDay) {
|
|
12
|
+
const l = g(s.start), e = g(s.end ?? s.start);
|
|
13
|
+
a >= l && a <= e && o.push(s);
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
}), i.sort((
|
|
18
|
-
date:
|
|
16
|
+
w(s.start, a) && i.push(s);
|
|
17
|
+
}), i.sort((s, l) => s.start.getTime() - l.start.getTime()), {
|
|
18
|
+
date: a,
|
|
19
19
|
allDay: o,
|
|
20
20
|
timed: i
|
|
21
21
|
};
|
|
22
|
-
}),
|
|
22
|
+
}), W = (t, r, a, o) => {
|
|
23
23
|
if (t.length === 0) return [];
|
|
24
|
-
const i = r * 60,
|
|
25
|
-
const
|
|
24
|
+
const i = r * 60, s = a * 60, l = Math.max(s - i, 1), e = t.map((n) => {
|
|
25
|
+
const d = S(n.start);
|
|
26
26
|
return {
|
|
27
|
-
event:
|
|
28
|
-
start:
|
|
29
|
-
end: Math.max(
|
|
27
|
+
event: n,
|
|
28
|
+
start: d,
|
|
29
|
+
end: Math.max(S(v(n, o)), d + 15)
|
|
30
30
|
};
|
|
31
|
-
}),
|
|
32
|
-
let
|
|
31
|
+
}), u = [];
|
|
32
|
+
let h = [], m = -1;
|
|
33
33
|
const p = () => {
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
let
|
|
38
|
-
|
|
34
|
+
if (h.length === 0) return;
|
|
35
|
+
const n = [], d = /* @__PURE__ */ new Map();
|
|
36
|
+
h.forEach((c) => {
|
|
37
|
+
let f = n.findIndex((M) => M <= c.start);
|
|
38
|
+
f === -1 && (f = n.length), n[f] = c.end, d.set(c.event, f);
|
|
39
39
|
});
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
event:
|
|
45
|
-
top: Math.max(
|
|
46
|
-
height: Math.min(Math.max(
|
|
47
|
-
left:
|
|
48
|
-
width: 1 /
|
|
40
|
+
const E = n.length;
|
|
41
|
+
h.forEach((c) => {
|
|
42
|
+
const f = d.get(c.event) ?? 0, M = (c.start - i) / l * 100, y = (c.end - c.start) / l * 100;
|
|
43
|
+
u.push({
|
|
44
|
+
event: c.event,
|
|
45
|
+
top: Math.max(M, 0),
|
|
46
|
+
height: Math.min(Math.max(y, 1.5), 100 - Math.max(M, 0)),
|
|
47
|
+
left: f / E * 100,
|
|
48
|
+
width: 1 / E * 100
|
|
49
49
|
});
|
|
50
|
-
}),
|
|
50
|
+
}), h = [], m = -1;
|
|
51
51
|
};
|
|
52
|
-
return [...
|
|
53
|
-
|
|
54
|
-
}), p(),
|
|
55
|
-
}, $ = (t, r,
|
|
56
|
-
if (!
|
|
57
|
-
const o =
|
|
52
|
+
return [...e].sort((n, d) => n.start - d.start || n.end - d.end).forEach((n) => {
|
|
53
|
+
h.length > 0 && n.start >= m && p(), h.push(n), m = Math.max(m, n.end);
|
|
54
|
+
}), p(), u;
|
|
55
|
+
}, $ = (t, r, a) => {
|
|
56
|
+
if (!a) return new Date(r);
|
|
57
|
+
const o = g(r);
|
|
58
58
|
return o.setHours(t.start.getHours(), t.start.getMinutes(), 0, 0), o;
|
|
59
|
-
},
|
|
59
|
+
}, k = (t, r) => !r || t >= r.start && t < r.end, C = (t) => `${t.toString().padStart(2, "0")}:00`, F = (t) => `${t.getHours().toString().padStart(2, "0")}:${t.getMinutes().toString().padStart(2, "0")}`, I = (t) => !!(t.allDay && t.end && g(t.end) > g(t.start)), H = 864e5, x = (t, r) => Math.round((r.getTime() - t.getTime()) / H), Y = (t, r) => {
|
|
60
|
+
if (r.length === 0) return [];
|
|
61
|
+
const a = g(r[0]), o = g(r[r.length - 1]), i = r.length - 1, s = t.filter(I).map((e) => ({
|
|
62
|
+
event: e,
|
|
63
|
+
start: g(e.start),
|
|
64
|
+
end: g(e.end ?? e.start)
|
|
65
|
+
})).filter(({ end: e, start: u }) => e >= a && u <= o).sort((e, u) => e.start.getTime() - u.start.getTime() || u.end.getTime() - e.end.getTime()), l = [];
|
|
66
|
+
return s.map(({ end: e, event: u, start: h }) => {
|
|
67
|
+
const m = Math.max(x(a, h), 0), p = Math.min(x(a, e), i);
|
|
68
|
+
let n = l.findIndex((d) => d < m);
|
|
69
|
+
return n === -1 && (n = l.length), l[n] = p, {
|
|
70
|
+
event: u,
|
|
71
|
+
startIndex: m,
|
|
72
|
+
endIndex: p,
|
|
73
|
+
lane: n,
|
|
74
|
+
isStart: h >= a,
|
|
75
|
+
isEnd: e <= o
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
};
|
|
60
79
|
export {
|
|
61
|
-
|
|
80
|
+
O as bucketEventsByDay,
|
|
62
81
|
$ as buildDroppedStart,
|
|
63
|
-
|
|
64
|
-
|
|
82
|
+
F as formatEventTime,
|
|
83
|
+
C as formatHourLabel,
|
|
65
84
|
v as getEventEnd,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
85
|
+
B as getWeekDays,
|
|
86
|
+
k as isActiveHour,
|
|
87
|
+
I as isMultiDayEvent,
|
|
88
|
+
W as layoutDayEvents,
|
|
89
|
+
Y as layoutWeekSpans,
|
|
90
|
+
S as minutesFromMidnight,
|
|
91
|
+
g as startOfDay,
|
|
92
|
+
T as startOfWeek
|
|
72
93
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import './EventCalendar.css';
|
|
2
2
|
import { Button as N } from "../Button/Button2.js";
|
|
3
|
-
import { addDays as
|
|
4
|
-
import { useSwipe as
|
|
5
|
-
import { buildDroppedStart as
|
|
6
|
-
import { DayAgenda as
|
|
7
|
-
import { ToggleButtons as
|
|
8
|
-
import { EventCalendarMonth as
|
|
9
|
-
import { EventCalendarWeek as
|
|
3
|
+
import { addDays as H, addMonths as ee } from "../../helpers/Datetime.js";
|
|
4
|
+
import { useSwipe as te } from "../../hooks/useSwipe.js";
|
|
5
|
+
import { buildDroppedStart as ae, getWeekDays as ne, startOfDay as T } from "./EventCalendar.helpers.js";
|
|
6
|
+
import { DayAgenda as re } from "../DayAgenda/DayAgenda2.js";
|
|
7
|
+
import { ToggleButtons as le } from "../ToggleButtons/ToggleButtons2.js";
|
|
8
|
+
import { EventCalendarMonth as oe } from "./EventCalendar.Month.js";
|
|
9
|
+
import { EventCalendarWeek as ie } from "./EventCalendar.Week.js";
|
|
10
10
|
/* empty css */
|
|
11
|
-
import { useCallback as s, useMemo as
|
|
11
|
+
import { useCallback as s, useMemo as se, useState as f } from "react";
|
|
12
12
|
import { jsx as n, jsxs as F } from "react/jsx-runtime";
|
|
13
|
-
var
|
|
13
|
+
var ce = [{
|
|
14
14
|
key: "month",
|
|
15
15
|
label: "Month",
|
|
16
16
|
icon: "calendar-month"
|
|
@@ -18,27 +18,27 @@ var se = [{
|
|
|
18
18
|
key: "week",
|
|
19
19
|
label: "Week",
|
|
20
20
|
icon: "calendar-week"
|
|
21
|
-
}],
|
|
21
|
+
}], de = (r) => r.toLocaleDateString(void 0, {
|
|
22
22
|
month: "long",
|
|
23
23
|
year: "numeric"
|
|
24
|
-
}), d = (r) => r.toLocaleDateString(void 0, { month: "short" }),
|
|
25
|
-
const l =
|
|
24
|
+
}), d = (r) => r.toLocaleDateString(void 0, { month: "short" }), me = (r, D) => {
|
|
25
|
+
const l = ne(r, D), t = l[0], a = l[l.length - 1];
|
|
26
26
|
return t.getFullYear() !== a.getFullYear() ? `${t.getDate()} ${d(t)} ${t.getFullYear()} – ${a.getDate()} ${d(a)} ${a.getFullYear()}` : t.getMonth() !== a.getMonth() ? `${t.getDate()} ${d(t)} – ${a.getDate()} ${d(a)} ${a.getFullYear()}` : `${t.getDate()} – ${a.getDate()} ${d(a)} ${a.getFullYear()}`;
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
const [
|
|
30
|
-
$ && $(e), l ||
|
|
31
|
-
}, [l, $]),
|
|
32
|
-
w && w(e), h ||
|
|
28
|
+
function Me({ activeHours: r, className: D, date: l, dayAgenda: t = !1, dayEndHour: a = 24, dayStartHour: y = 0, defaultDurationMinutes: C = 30, emptyLabel: Y, events: b, firstDayOfWeek: v = 0, headerExtra: z, hourHeight: V = 44, maxEventsPerDay: W = 3, onDateChange: $, onDayClick: _, onEventClick: m, onEventDrop: g, onRangeSelect: x, onViewChange: w, renderEvent: B, showHeader: L = !0, showWeekNumbers: P = !1, swipeNavigation: A = !0, view: h }) {
|
|
29
|
+
const [E, O] = f(() => T(l ?? /* @__PURE__ */ new Date())), [R, q] = f(h ?? "month"), [c, S] = f(null), [I, u] = f(null), o = l ?? E, i = h ?? R, G = !!g, M = s((e) => {
|
|
30
|
+
$ && $(e), l || O(e);
|
|
31
|
+
}, [l, $]), J = s((e) => {
|
|
32
|
+
w && w(e), h || q(e);
|
|
33
33
|
}, [w, h]), p = s((e) => {
|
|
34
|
-
M(i === "month" ?
|
|
34
|
+
M(i === "month" ? ee(o, e) : H(o, e * 7));
|
|
35
35
|
}, [
|
|
36
36
|
o,
|
|
37
37
|
i,
|
|
38
38
|
M
|
|
39
|
-
]),
|
|
40
|
-
!c || !g || (g(c,
|
|
41
|
-
}, [c, g]), k = s((e) => u(T(e)), []),
|
|
39
|
+
]), K = s((e, Z) => {
|
|
40
|
+
!c || !g || (g(c, ae(c, e, Z)), S(null));
|
|
41
|
+
}, [c, g]), k = s((e) => u(T(e)), []), Q = s((e) => {
|
|
42
42
|
if (t) {
|
|
43
43
|
k(e.start);
|
|
44
44
|
return;
|
|
@@ -48,33 +48,34 @@ function Se({ activeHours: r, className: D, date: l, dayAgenda: t = !1, dayEndHo
|
|
|
48
48
|
t,
|
|
49
49
|
m,
|
|
50
50
|
k
|
|
51
|
-
]),
|
|
52
|
-
enabled:
|
|
51
|
+
]), U = te({
|
|
52
|
+
enabled: A,
|
|
53
53
|
onSwipeLeft: () => p(1),
|
|
54
54
|
onSwipeRight: () => p(-1)
|
|
55
|
-
}),
|
|
55
|
+
}), X = se(() => i === "month" ? de(o) : me(o, v), [
|
|
56
56
|
o,
|
|
57
57
|
i,
|
|
58
58
|
v
|
|
59
59
|
]), j = {
|
|
60
60
|
activeHours: r,
|
|
61
61
|
date: o,
|
|
62
|
-
dragEnabled:
|
|
62
|
+
dragEnabled: G,
|
|
63
63
|
draggingId: c?.id ?? null,
|
|
64
64
|
events: b,
|
|
65
65
|
firstDayOfWeek: v,
|
|
66
66
|
onDayClick: _,
|
|
67
67
|
onDragEnd: () => S(null),
|
|
68
68
|
onDragStart: (e) => S(e),
|
|
69
|
-
onDrop:
|
|
70
|
-
|
|
69
|
+
onDrop: K,
|
|
70
|
+
onRangeSelect: x,
|
|
71
|
+
onEventClick: t || m ? Q : void 0,
|
|
71
72
|
renderEvent: B,
|
|
72
|
-
showWeekNumbers:
|
|
73
|
+
showWeekNumbers: P
|
|
73
74
|
};
|
|
74
75
|
return /* @__PURE__ */ F("div", {
|
|
75
76
|
className: ["event-calendar", D ?? ""].filter(Boolean).join(" "),
|
|
76
77
|
children: [
|
|
77
|
-
|
|
78
|
+
L && /* @__PURE__ */ F("div", {
|
|
78
79
|
className: "event-calendar__header",
|
|
79
80
|
children: [
|
|
80
81
|
/* @__PURE__ */ F("div", {
|
|
@@ -103,29 +104,29 @@ function Se({ activeHours: r, className: D, date: l, dayAgenda: t = !1, dayEndHo
|
|
|
103
104
|
}),
|
|
104
105
|
/* @__PURE__ */ n("h2", {
|
|
105
106
|
className: "event-calendar__title",
|
|
106
|
-
children:
|
|
107
|
+
children: X
|
|
107
108
|
}),
|
|
108
109
|
z && /* @__PURE__ */ n("div", {
|
|
109
110
|
className: "event-calendar__header-extra",
|
|
110
111
|
children: z
|
|
111
112
|
}),
|
|
112
|
-
/* @__PURE__ */ n(
|
|
113
|
-
onToggleChange: (e) =>
|
|
113
|
+
/* @__PURE__ */ n(le, {
|
|
114
|
+
onToggleChange: (e) => J(e),
|
|
114
115
|
size: "small",
|
|
115
116
|
state: i,
|
|
116
|
-
states:
|
|
117
|
+
states: ce
|
|
117
118
|
})
|
|
118
119
|
]
|
|
119
120
|
}),
|
|
120
121
|
/* @__PURE__ */ n("div", {
|
|
121
122
|
className: "event-calendar__viewport",
|
|
122
|
-
...
|
|
123
|
-
children: i === "month" ? /* @__PURE__ */ n(
|
|
123
|
+
...U,
|
|
124
|
+
children: i === "month" ? /* @__PURE__ */ n(oe, {
|
|
124
125
|
...j,
|
|
125
126
|
emptyLabel: Y,
|
|
126
127
|
maxEventsPerDay: W,
|
|
127
128
|
onOpenDay: t ? k : void 0
|
|
128
|
-
}) : /* @__PURE__ */ n(
|
|
129
|
+
}) : /* @__PURE__ */ n(ie, {
|
|
129
130
|
...j,
|
|
130
131
|
dayEndHour: a,
|
|
131
132
|
dayStartHour: y,
|
|
@@ -133,7 +134,7 @@ function Se({ activeHours: r, className: D, date: l, dayAgenda: t = !1, dayEndHo
|
|
|
133
134
|
hourHeight: V
|
|
134
135
|
})
|
|
135
136
|
}),
|
|
136
|
-
I && /* @__PURE__ */ n(
|
|
137
|
+
I && /* @__PURE__ */ n(re, {
|
|
137
138
|
activeHours: r,
|
|
138
139
|
date: I,
|
|
139
140
|
onDateChange: u,
|
|
@@ -151,5 +152,5 @@ function Se({ activeHours: r, className: D, date: l, dayAgenda: t = !1, dayEndHo
|
|
|
151
152
|
});
|
|
152
153
|
}
|
|
153
154
|
export {
|
|
154
|
-
|
|
155
|
+
Me as EventCalendar
|
|
155
156
|
};
|
|
@@ -1,52 +1,57 @@
|
|
|
1
1
|
import './MiniSort.css';
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { Tooltip as
|
|
2
|
+
import { Icon as u } from "../Icon/Icon2.js";
|
|
3
|
+
import { Button as f } from "../Button/Button2.js";
|
|
4
|
+
import { Tooltip as p } from "../Tooltip/Tooltip2.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import "react";
|
|
7
|
-
import { jsx as
|
|
8
|
-
var
|
|
7
|
+
import { jsx as s, jsxs as z } from "react/jsx-runtime";
|
|
8
|
+
var B = ({ items: o, sortKey: i, sortDirection: n, onSort: v, align: _ = "left", showDirectionToggle: l = !1, className: $ = "" }) => o.length === 0 ? null : /* @__PURE__ */ z("div", {
|
|
9
9
|
className: [
|
|
10
10
|
"mini-sort",
|
|
11
|
-
`mini-sort--align-${
|
|
12
|
-
|
|
11
|
+
`mini-sort--align-${_}`,
|
|
12
|
+
$
|
|
13
13
|
].filter(Boolean).join(" "),
|
|
14
|
-
children: [
|
|
15
|
-
const c = a.direction ?? "asc",
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
title: `Sort by ${
|
|
18
|
-
children: /* @__PURE__ */
|
|
19
|
-
className: `mini-sort__button${
|
|
14
|
+
children: [o.map((a, x) => {
|
|
15
|
+
const c = a.direction ?? "asc", t = i === a.value, r = !l && o.filter((m) => m.value === a.value).length === 1, e = l || r ? t : t && n === c, d = typeof a.label == "string" || typeof a.label == "number" ? String(a.label) : a.value, b = (m) => m === "asc" ? "ascending" : "descending", N = l ? t ? n : c : r && e ? n === "asc" ? "desc" : "asc" : c;
|
|
16
|
+
return /* @__PURE__ */ s(p, {
|
|
17
|
+
title: l ? `Sort by ${d}` : r && e ? `Sorted by ${d} ${b(n)} — click to reverse` : `Sort by ${d} ${b(c)}`,
|
|
18
|
+
children: /* @__PURE__ */ s(f, {
|
|
19
|
+
className: `mini-sort__button${e ? " is-active" : ""}`,
|
|
20
20
|
disabled: a.disabled,
|
|
21
|
-
icon: a.icon ? /* @__PURE__ */
|
|
21
|
+
icon: a.icon ? /* @__PURE__ */ s(u, {
|
|
22
22
|
className: "mini-sort__icon",
|
|
23
23
|
name: a.icon,
|
|
24
24
|
size: "sm",
|
|
25
|
-
variant:
|
|
25
|
+
variant: e ? "accent" : "muted"
|
|
26
|
+
}) : void 0,
|
|
27
|
+
sufixIcon: r && e ? /* @__PURE__ */ s(u, {
|
|
28
|
+
className: "mini-sort__icon",
|
|
29
|
+
name: n === "asc" ? "arrow-up" : "arrow-down",
|
|
30
|
+
size: "sm"
|
|
26
31
|
}) : void 0,
|
|
27
32
|
size: "small",
|
|
28
33
|
variant: "ghost",
|
|
29
|
-
onClick: () =>
|
|
34
|
+
onClick: () => v(a.value, N),
|
|
30
35
|
children: a.label ?? a.value
|
|
31
36
|
})
|
|
32
|
-
}, `${a.value}-${
|
|
33
|
-
}),
|
|
34
|
-
title: `Direction: ${
|
|
35
|
-
children: /* @__PURE__ */
|
|
37
|
+
}, `${a.value}-${x}`);
|
|
38
|
+
}), l && /* @__PURE__ */ s(p, {
|
|
39
|
+
title: `Direction: ${n === "asc" ? "ascending" : "descending"}`,
|
|
40
|
+
children: /* @__PURE__ */ s(f, {
|
|
36
41
|
className: "mini-sort__button mini-sort__direction",
|
|
37
|
-
disabled:
|
|
38
|
-
icon: /* @__PURE__ */
|
|
42
|
+
disabled: i === null,
|
|
43
|
+
icon: /* @__PURE__ */ s(u, {
|
|
39
44
|
className: "mini-sort__icon",
|
|
40
|
-
name:
|
|
45
|
+
name: n === "asc" ? "arrow-up" : "arrow-down",
|
|
41
46
|
size: "sm",
|
|
42
47
|
variant: "accent"
|
|
43
48
|
}),
|
|
44
49
|
size: "small",
|
|
45
50
|
variant: "ghost",
|
|
46
|
-
onClick: () =>
|
|
51
|
+
onClick: () => i !== null && v(i, n === "asc" ? "desc" : "asc")
|
|
47
52
|
})
|
|
48
53
|
})]
|
|
49
54
|
});
|
|
50
55
|
export {
|
|
51
|
-
|
|
56
|
+
B as MiniSort
|
|
52
57
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1430,7 +1430,7 @@ declare interface ErrorBoundaryState {
|
|
|
1430
1430
|
error: Error | null;
|
|
1431
1431
|
}
|
|
1432
1432
|
|
|
1433
|
-
export declare function EventCalendar<T>({ activeHours, className, date, dayAgenda, dayEndHour, dayStartHour, defaultDurationMinutes, emptyLabel, events, firstDayOfWeek, headerExtra, hourHeight, maxEventsPerDay, onDateChange, onDayClick, onEventClick, onEventDrop, onViewChange, renderEvent, showHeader, showWeekNumbers, swipeNavigation, view, }: EventCalendarProps<T>): JSX.Element;
|
|
1433
|
+
export declare function EventCalendar<T>({ activeHours, className, date, dayAgenda, dayEndHour, dayStartHour, defaultDurationMinutes, emptyLabel, events, firstDayOfWeek, headerExtra, hourHeight, maxEventsPerDay, onDateChange, onDayClick, onEventClick, onEventDrop, onRangeSelect, onViewChange, renderEvent, showHeader, showWeekNumbers, swipeNavigation, view, }: EventCalendarProps<T>): JSX.Element;
|
|
1434
1434
|
|
|
1435
1435
|
export declare interface EventCalendarProps<T = unknown> {
|
|
1436
1436
|
events: CalendarEvent<T>[];
|
|
@@ -1452,6 +1452,18 @@ export declare interface EventCalendarProps<T = unknown> {
|
|
|
1452
1452
|
onEventClick?: (event: CalendarEvent<T>) => void;
|
|
1453
1453
|
/** Fires on the empty part of a day cell (month) or an hour slot (week). */
|
|
1454
1454
|
onDayClick?: (date: Date) => void;
|
|
1455
|
+
/**
|
|
1456
|
+
* Dragging across the month grid selects a run of days and fires this on release, with
|
|
1457
|
+
* `start` always the earlier end whichever way the drag went. It is how a period gets
|
|
1458
|
+
* created by pointing at it rather than typing two dates into a form.
|
|
1459
|
+
*
|
|
1460
|
+
* A press that never leaves its day is a click, not a selection, and goes to
|
|
1461
|
+
* `onDayClick` instead — so the two can both be set without competing.
|
|
1462
|
+
*/
|
|
1463
|
+
onRangeSelect?: (range: {
|
|
1464
|
+
start: Date;
|
|
1465
|
+
end: Date;
|
|
1466
|
+
}) => void;
|
|
1455
1467
|
/**
|
|
1456
1468
|
* Enables drag-to-reschedule. `nextStart` keeps the original time of day in month
|
|
1457
1469
|
* view, and snaps to the dropped hour slot in week view.
|
|
@@ -2303,7 +2315,11 @@ export declare interface MiniSortItem {
|
|
|
2303
2315
|
value: string;
|
|
2304
2316
|
label?: default_2.ReactNode;
|
|
2305
2317
|
icon?: IconName;
|
|
2306
|
-
/**
|
|
2318
|
+
/**
|
|
2319
|
+
* Starting direction for this item when `showDirectionToggle` is false. Clicking the already-active
|
|
2320
|
+
* item reverses it — unless another item sorts the same `value` (e.g. a "Newest"/"Oldest" pair),
|
|
2321
|
+
* in which case each item keeps its own fixed direction.
|
|
2322
|
+
*/
|
|
2307
2323
|
direction?: MiniSortDirection;
|
|
2308
2324
|
disabled?: boolean;
|
|
2309
2325
|
}
|
package/dist/version.js
CHANGED
package/dist/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memobit/libs",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "React component library powering the Memobit apps — 100+ components, helpers and hooks. Icons ship as @memobit/icons and themes as @memobit/themes. TypeScript-first, ESM-only, React 19.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|