dishui 0.0.67 → 0.0.68
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.js +5 -0
- package/dist/components/Demo/index.js +76 -80
- package/dist/components/Demo/index.js.map +1 -1
- package/dist/components/pro/Calendar/Calendar.js +576 -0
- package/dist/components/pro/Calendar/Calendar.js.map +1 -0
- package/dist/components/pro/Calendar/hooks/useCalendarDrag.js +104 -0
- package/dist/components/pro/Calendar/hooks/useCalendarDrag.js.map +1 -0
- package/dist/components/pro/Calendar/hooks/useCalendarState.js +187 -0
- package/dist/components/pro/Calendar/hooks/useCalendarState.js.map +1 -0
- package/dist/components/pro/Calendar/utils.js +193 -0
- package/dist/components/pro/Calendar/utils.js.map +1 -0
- package/dist/components/pro/Gantt/Gantt.js +868 -0
- package/dist/components/pro/Gantt/Gantt.js.map +1 -0
- package/dist/components/pro/Gantt/hooks/useGanttDrag.js +99 -0
- package/dist/components/pro/Gantt/hooks/useGanttDrag.js.map +1 -0
- package/dist/components/pro/Gantt/hooks/useGanttState.js +95 -0
- package/dist/components/pro/Gantt/hooks/useGanttState.js.map +1 -0
- package/dist/components/pro/Gantt/utils.js +236 -0
- package/dist/components/pro/Gantt/utils.js.map +1 -0
- package/dist/dishui.css +1 -1
- package/dist/gantt.js +5 -0
- package/dist/hooks/useCopyToClipboard.d.ts +2 -1
- package/dist/hooks/useCopyToClipboard.js +17 -9
- package/dist/hooks/useCopyToClipboard.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -1
- package/dist/utils/i18n.js +40 -0
- package/dist/utils/i18n.js.map +1 -1
- package/package.json +12 -1
- package/dist/pages/components/Gantt/index.d.ts +0 -3
- package/dist/pages/components/Gantt/index.en.d.ts +0 -3
- package/dist/pages/components/Gantt/index.zh.d.ts +0 -3
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
import { DEFAULT_COLOR_OPTIONS as e, TIME_GRID_HEIGHT as t, TIME_SLOTS as n, formatDate as r, getHolidayEntry as i, isHoliday as a, isToday as o, isWeekend as s, timeToMinutes as c } from "./utils.js";
|
|
2
|
+
import { useCalendarState as l } from "./hooks/useCalendarState.js";
|
|
3
|
+
import { useCalendarDrag as u } from "./hooks/useCalendarDrag.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { forwardRef as d, useEffect as f, useImperativeHandle as p, useRef as m, useState as h } from "react";
|
|
6
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/pro/Calendar/Calendar.tsx
|
|
8
|
+
var v = d((d, h) => {
|
|
9
|
+
let { entries: v, holidays: b, defaultView: x = "month", defaultDate: S, readOnly: C = !1, locale: w = "en", labels: T, height: E, width: D, onEntryAdd: O, onEntryUpdate: k, onEntryDelete: A, onEntryDrop: j, onEntryClick: M, onDateClick: N, onViewChange: P, holidayColor: F, todayColor: I, weekendColor: L, className: R, style: z, colorOptions: B = e } = d, V = l({
|
|
10
|
+
entries: v,
|
|
11
|
+
holidays: b,
|
|
12
|
+
defaultView: x,
|
|
13
|
+
defaultDate: S,
|
|
14
|
+
locale: w,
|
|
15
|
+
labels: T,
|
|
16
|
+
colorOptions: B,
|
|
17
|
+
readOnly: C,
|
|
18
|
+
onEntryAdd: O,
|
|
19
|
+
onEntryUpdate: k,
|
|
20
|
+
onEntryDelete: A,
|
|
21
|
+
onViewChange: P
|
|
22
|
+
}), H = u({
|
|
23
|
+
readOnly: C,
|
|
24
|
+
onEntryDrop: j,
|
|
25
|
+
onEntryUpdate: (e) => {
|
|
26
|
+
V.updateEntry(e), k?.(e);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
p(h, () => ({
|
|
30
|
+
goToToday: V.goToToday,
|
|
31
|
+
goToDate: V.goToDate,
|
|
32
|
+
setView: V.setViewMode,
|
|
33
|
+
getEntries: () => V.entries
|
|
34
|
+
}));
|
|
35
|
+
let U = m(null);
|
|
36
|
+
f(() => {
|
|
37
|
+
V.modalState.open ? U.current?.showModal() : U.current?.close();
|
|
38
|
+
}, [V.modalState.open]);
|
|
39
|
+
let W = () => /* @__PURE__ */ _("div", {
|
|
40
|
+
className: "flex items-center gap-2 p-2 border-b border-base-300 flex-wrap",
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ _("div", {
|
|
43
|
+
className: "flex items-center gap-1",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ g("button", {
|
|
46
|
+
type: "button",
|
|
47
|
+
className: "btn btn-ghost btn-xs btn-square",
|
|
48
|
+
onClick: V.goPrev,
|
|
49
|
+
"aria-label": "Previous",
|
|
50
|
+
children: /* @__PURE__ */ g("svg", {
|
|
51
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
52
|
+
viewBox: "0 0 20 20",
|
|
53
|
+
fill: "currentColor",
|
|
54
|
+
className: "w-4 h-4",
|
|
55
|
+
children: /* @__PURE__ */ g("path", {
|
|
56
|
+
fillRule: "evenodd",
|
|
57
|
+
d: "M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z",
|
|
58
|
+
clipRule: "evenodd"
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ g("button", {
|
|
63
|
+
type: "button",
|
|
64
|
+
className: "btn btn-ghost btn-xs btn-square",
|
|
65
|
+
onClick: V.goNext,
|
|
66
|
+
"aria-label": "Next",
|
|
67
|
+
children: /* @__PURE__ */ g("svg", {
|
|
68
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
69
|
+
viewBox: "0 0 20 20",
|
|
70
|
+
fill: "currentColor",
|
|
71
|
+
className: "w-4 h-4",
|
|
72
|
+
children: /* @__PURE__ */ g("path", {
|
|
73
|
+
fillRule: "evenodd",
|
|
74
|
+
d: "M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",
|
|
75
|
+
clipRule: "evenodd"
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ g("button", {
|
|
80
|
+
type: "button",
|
|
81
|
+
className: "btn btn-ghost btn-xs",
|
|
82
|
+
onClick: V.goToToday,
|
|
83
|
+
children: V.labels.today
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ g("h2", {
|
|
88
|
+
className: "text-sm font-semibold flex-1 text-center min-w-0 truncate",
|
|
89
|
+
children: V.title
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ g("div", {
|
|
92
|
+
className: "join",
|
|
93
|
+
children: [
|
|
94
|
+
"month",
|
|
95
|
+
"week",
|
|
96
|
+
"day"
|
|
97
|
+
].map((e) => /* @__PURE__ */ g("button", {
|
|
98
|
+
type: "button",
|
|
99
|
+
className: `btn btn-xs join-item ${V.viewMode === e ? "btn-active" : ""}`,
|
|
100
|
+
onClick: () => V.setViewMode(e),
|
|
101
|
+
children: e === "month" ? V.labels.month : e === "week" ? V.labels.week : V.labels.day
|
|
102
|
+
}, e))
|
|
103
|
+
}),
|
|
104
|
+
!C && /* @__PURE__ */ _("button", {
|
|
105
|
+
type: "button",
|
|
106
|
+
className: "btn btn-primary btn-xs",
|
|
107
|
+
onClick: () => V.openAddModal(),
|
|
108
|
+
children: ["+ ", V.labels.addEntry]
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
}), G = () => {
|
|
112
|
+
let e = V.currentDateObj.getMonth();
|
|
113
|
+
return /* @__PURE__ */ _("div", {
|
|
114
|
+
className: "flex flex-col flex-1 min-h-0 overflow-hidden",
|
|
115
|
+
children: [/* @__PURE__ */ g("div", {
|
|
116
|
+
className: "cal-weekday-header",
|
|
117
|
+
children: V.labels.weekDays.map((e, t) => /* @__PURE__ */ g("div", {
|
|
118
|
+
className: "cal-weekday-header-cell",
|
|
119
|
+
children: e
|
|
120
|
+
}, t))
|
|
121
|
+
}), /* @__PURE__ */ g("div", {
|
|
122
|
+
className: "cal-month-grid overflow-auto cal-scroll",
|
|
123
|
+
children: V.monthDates.map((t, n) => {
|
|
124
|
+
let c = r(t), l = t.getMonth() === e, u = o(t), d = s(t), f = a(c, b), p = i(c, b), m = V.getEntriesForDate(c), h = H.isDropTarget(c), v = [
|
|
125
|
+
"cal-month-cell",
|
|
126
|
+
!l && "cal-month-cell--outside",
|
|
127
|
+
u && "cal-month-cell--today",
|
|
128
|
+
d && !f && "cal-month-cell--weekend",
|
|
129
|
+
f && "cal-month-cell--holiday",
|
|
130
|
+
h && "cal-month-cell--drop-target"
|
|
131
|
+
].filter(Boolean).join(" ");
|
|
132
|
+
return /* @__PURE__ */ _("div", {
|
|
133
|
+
className: v,
|
|
134
|
+
style: {
|
|
135
|
+
...u && I ? { backgroundColor: I + "33" } : {},
|
|
136
|
+
...f && F ? { backgroundColor: F + "33" } : {},
|
|
137
|
+
...d && !f && L ? { backgroundColor: L + "22" } : {}
|
|
138
|
+
},
|
|
139
|
+
onClick: (e) => {
|
|
140
|
+
e.target.closest(".cal-entry-pill") || (N?.(c), C || V.openAddModal(c));
|
|
141
|
+
},
|
|
142
|
+
onDragOver: (e) => H.handleDragOver(e, c),
|
|
143
|
+
onDragLeave: H.handleDragLeave,
|
|
144
|
+
onDrop: (e) => H.handleDrop(e, c),
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ _("div", {
|
|
147
|
+
className: "flex items-center gap-1 mb-0.5",
|
|
148
|
+
children: [/* @__PURE__ */ g("span", {
|
|
149
|
+
className: `text-xs font-medium leading-none ${u ? "bg-primary text-primary-content rounded-full w-5 h-5 flex items-center justify-center" : ""}`,
|
|
150
|
+
children: t.getDate()
|
|
151
|
+
}), p && !p.isWorkday && /* @__PURE__ */ g("span", {
|
|
152
|
+
className: "cal-holiday-tag",
|
|
153
|
+
children: p.name
|
|
154
|
+
})]
|
|
155
|
+
}),
|
|
156
|
+
m.slice(0, 3).map((e) => /* @__PURE__ */ _("div", {
|
|
157
|
+
className: `cal-entry-pill ${H.draggingEntryId === e.id ? "cal-entry-pill--dragging" : ""}`,
|
|
158
|
+
style: {
|
|
159
|
+
backgroundColor: (e.color || "#3b82f6") + "22",
|
|
160
|
+
color: e.color || "#3b82f6"
|
|
161
|
+
},
|
|
162
|
+
draggable: !C,
|
|
163
|
+
onDragStart: (t) => H.handleDragStart(t, e),
|
|
164
|
+
onDragEnd: H.handleDragEnd,
|
|
165
|
+
onClick: (t) => {
|
|
166
|
+
t.stopPropagation(), M?.(e), C || V.openEditModal(e);
|
|
167
|
+
},
|
|
168
|
+
title: e.title,
|
|
169
|
+
children: [/* @__PURE__ */ g("span", {
|
|
170
|
+
className: "cal-entry-dot",
|
|
171
|
+
style: { backgroundColor: e.color || "#3b82f6" }
|
|
172
|
+
}), /* @__PURE__ */ g("span", {
|
|
173
|
+
className: "truncate",
|
|
174
|
+
children: e.title
|
|
175
|
+
})]
|
|
176
|
+
}, e.id)),
|
|
177
|
+
m.length > 3 && /* @__PURE__ */ _("div", {
|
|
178
|
+
className: "text-[0.6rem] opacity-50 pl-1",
|
|
179
|
+
children: [
|
|
180
|
+
"+",
|
|
181
|
+
m.length - 3,
|
|
182
|
+
" more"
|
|
183
|
+
]
|
|
184
|
+
})
|
|
185
|
+
]
|
|
186
|
+
}, n);
|
|
187
|
+
})
|
|
188
|
+
})]
|
|
189
|
+
});
|
|
190
|
+
}, K = () => {
|
|
191
|
+
let e = V.viewMode === "week" ? V.weekDates : [V.currentDateObj], l = (e) => V.getEntriesForDate(e).filter((e) => !e.allDay && e.startTime), u = (e) => V.getEntriesForDate(e).filter((e) => e.allDay || !e.startTime), d = /* @__PURE__ */ new Date(), f = (d.getHours() * 60 + d.getMinutes()) / 30 * 28;
|
|
192
|
+
return /* @__PURE__ */ _("div", {
|
|
193
|
+
className: "flex flex-col flex-1 min-h-0 overflow-hidden",
|
|
194
|
+
children: [
|
|
195
|
+
/* @__PURE__ */ _("div", {
|
|
196
|
+
className: "cal-column-header",
|
|
197
|
+
children: [/* @__PURE__ */ g("div", { className: "cal-column-header-gutter" }), /* @__PURE__ */ g("div", {
|
|
198
|
+
className: "cal-column-header-cells",
|
|
199
|
+
children: e.map((e, t) => {
|
|
200
|
+
let n = r(e), a = o(e), c = s(e), l = i(n, b);
|
|
201
|
+
return /* @__PURE__ */ _("div", {
|
|
202
|
+
className: `cal-column-header-cell ${a ? "cal-column-header-cell--today" : ""} ${c ? "cal-column-header-cell--weekend" : ""}`,
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ g("div", {
|
|
205
|
+
className: "font-medium",
|
|
206
|
+
children: V.labels.weekDays[e.getDay()]
|
|
207
|
+
}),
|
|
208
|
+
/* @__PURE__ */ g("div", {
|
|
209
|
+
className: `text-lg font-bold ${a ? "bg-primary text-primary-content rounded-full w-7 h-7 flex items-center justify-center mx-auto" : ""}`,
|
|
210
|
+
children: e.getDate()
|
|
211
|
+
}),
|
|
212
|
+
l && !l.isWorkday && /* @__PURE__ */ g("span", {
|
|
213
|
+
className: "cal-holiday-tag",
|
|
214
|
+
children: l.name
|
|
215
|
+
})
|
|
216
|
+
]
|
|
217
|
+
}, t);
|
|
218
|
+
})
|
|
219
|
+
})]
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ _("div", {
|
|
222
|
+
className: "cal-allday-section",
|
|
223
|
+
children: [/* @__PURE__ */ g("div", {
|
|
224
|
+
className: "cal-allday-gutter",
|
|
225
|
+
children: V.labels.allDay
|
|
226
|
+
}), /* @__PURE__ */ g("div", {
|
|
227
|
+
className: "cal-allday-cells",
|
|
228
|
+
children: e.map((e, t) => {
|
|
229
|
+
let n = r(e), i = u(n), o = H.isDropTarget(n) && !H.dropTarget?.time, c = s(e), l = a(n, b), d = [
|
|
230
|
+
"cal-allday-cell",
|
|
231
|
+
c && !l && "cal-allday-cell--weekend",
|
|
232
|
+
l && "cal-allday-cell--holiday",
|
|
233
|
+
o && "cal-allday-cell--drop-target"
|
|
234
|
+
].filter(Boolean).join(" ");
|
|
235
|
+
return /* @__PURE__ */ g("div", {
|
|
236
|
+
className: d,
|
|
237
|
+
onDragOver: (e) => H.handleDragOver(e, n),
|
|
238
|
+
onDragLeave: H.handleDragLeave,
|
|
239
|
+
onDrop: (e) => H.handleDrop(e, n),
|
|
240
|
+
children: i.map((e) => /* @__PURE__ */ _("div", {
|
|
241
|
+
className: `cal-entry-pill ${H.draggingEntryId === e.id ? "cal-entry-pill--dragging" : ""}`,
|
|
242
|
+
style: {
|
|
243
|
+
backgroundColor: (e.color || "#3b82f6") + "22",
|
|
244
|
+
color: e.color || "#3b82f6"
|
|
245
|
+
},
|
|
246
|
+
draggable: !C,
|
|
247
|
+
onDragStart: (t) => H.handleDragStart(t, e),
|
|
248
|
+
onDragEnd: H.handleDragEnd,
|
|
249
|
+
onClick: (t) => {
|
|
250
|
+
t.stopPropagation(), M?.(e), C || V.openEditModal(e);
|
|
251
|
+
},
|
|
252
|
+
children: [/* @__PURE__ */ g("span", {
|
|
253
|
+
className: "cal-entry-dot",
|
|
254
|
+
style: { backgroundColor: e.color || "#3b82f6" }
|
|
255
|
+
}), /* @__PURE__ */ g("span", {
|
|
256
|
+
className: "truncate",
|
|
257
|
+
children: e.title
|
|
258
|
+
})]
|
|
259
|
+
}, e.id))
|
|
260
|
+
}, t);
|
|
261
|
+
})
|
|
262
|
+
})]
|
|
263
|
+
}),
|
|
264
|
+
/* @__PURE__ */ _("div", {
|
|
265
|
+
className: "cal-time-grid",
|
|
266
|
+
children: [/* @__PURE__ */ g("div", {
|
|
267
|
+
className: "cal-time-gutter cal-scroll overflow-y-auto",
|
|
268
|
+
children: /* @__PURE__ */ g("div", {
|
|
269
|
+
style: { height: t },
|
|
270
|
+
children: n.map((e, t) => /* @__PURE__ */ g("div", {
|
|
271
|
+
className: "cal-time-gutter-label",
|
|
272
|
+
children: t % 2 == 0 ? e : ""
|
|
273
|
+
}, t))
|
|
274
|
+
})
|
|
275
|
+
}), /* @__PURE__ */ g("div", {
|
|
276
|
+
className: "cal-time-columns cal-scroll",
|
|
277
|
+
children: e.map((e, i) => {
|
|
278
|
+
let u = r(e), d = l(u), p = o(e), m = s(e), h = a(u, b), v = [
|
|
279
|
+
"cal-time-column",
|
|
280
|
+
p && "cal-time-column--today",
|
|
281
|
+
m && !h && "cal-time-column--weekend",
|
|
282
|
+
h && "cal-time-column--holiday"
|
|
283
|
+
].filter(Boolean).join(" ");
|
|
284
|
+
return /* @__PURE__ */ _("div", {
|
|
285
|
+
className: v,
|
|
286
|
+
style: { height: t },
|
|
287
|
+
children: [
|
|
288
|
+
n.map((e, t) => {
|
|
289
|
+
let n = H.isDropTarget(u, e);
|
|
290
|
+
return /* @__PURE__ */ g("div", {
|
|
291
|
+
className: `cal-time-slot ${n ? "cal-time-slot--drop-target" : ""}`,
|
|
292
|
+
onDragOver: (t) => H.handleDragOver(t, u, e),
|
|
293
|
+
onDragLeave: H.handleDragLeave,
|
|
294
|
+
onDrop: (t) => H.handleDrop(t, u, e),
|
|
295
|
+
onClick: () => {
|
|
296
|
+
N?.(u), C || V.openAddModal(u, e);
|
|
297
|
+
}
|
|
298
|
+
}, t);
|
|
299
|
+
}),
|
|
300
|
+
d.map((e) => {
|
|
301
|
+
let t = c(e.startTime), n = e.endTime ? c(e.endTime) : t + 60, r = t / 30 * 28, i = Math.max((n - t) / 30 * 28, 14), a = H.draggingEntryId === e.id;
|
|
302
|
+
return /* @__PURE__ */ _("div", {
|
|
303
|
+
className: `cal-time-entry ${a ? "cal-time-entry--dragging" : ""}`,
|
|
304
|
+
style: {
|
|
305
|
+
top: r,
|
|
306
|
+
height: i,
|
|
307
|
+
backgroundColor: (e.color || "#3b82f6") + "33",
|
|
308
|
+
borderLeft: `3px solid ${e.color || "#3b82f6"}`,
|
|
309
|
+
color: e.color || "#3b82f6"
|
|
310
|
+
},
|
|
311
|
+
draggable: !C,
|
|
312
|
+
onDragStart: (t) => H.handleDragStart(t, e),
|
|
313
|
+
onDragEnd: H.handleDragEnd,
|
|
314
|
+
onClick: (t) => {
|
|
315
|
+
t.stopPropagation(), M?.(e), C || V.openEditModal(e);
|
|
316
|
+
},
|
|
317
|
+
children: [
|
|
318
|
+
/* @__PURE__ */ g("span", {
|
|
319
|
+
className: "cal-time-entry-title",
|
|
320
|
+
children: e.title
|
|
321
|
+
}),
|
|
322
|
+
/* @__PURE__ */ _("span", {
|
|
323
|
+
className: "cal-time-entry-time",
|
|
324
|
+
children: [e.startTime, e.endTime ? ` - ${e.endTime}` : ""]
|
|
325
|
+
}),
|
|
326
|
+
!C && /* @__PURE__ */ g("div", {
|
|
327
|
+
className: "cal-time-entry-resize",
|
|
328
|
+
draggable: !0,
|
|
329
|
+
onDragStart: (t) => H.handleResizeStart(t, e),
|
|
330
|
+
onDragEnd: H.handleDragEnd
|
|
331
|
+
})
|
|
332
|
+
]
|
|
333
|
+
}, e.id);
|
|
334
|
+
}),
|
|
335
|
+
p && /* @__PURE__ */ g("div", {
|
|
336
|
+
className: "cal-now-line",
|
|
337
|
+
style: { top: f }
|
|
338
|
+
})
|
|
339
|
+
]
|
|
340
|
+
}, i);
|
|
341
|
+
})
|
|
342
|
+
})]
|
|
343
|
+
})
|
|
344
|
+
]
|
|
345
|
+
});
|
|
346
|
+
}, q = () => /* @__PURE__ */ _("dialog", {
|
|
347
|
+
ref: U,
|
|
348
|
+
className: "modal cal-modal",
|
|
349
|
+
onClose: V.closeModal,
|
|
350
|
+
children: [/* @__PURE__ */ g("div", {
|
|
351
|
+
className: "modal-box",
|
|
352
|
+
children: /* @__PURE__ */ g(y, {
|
|
353
|
+
mode: V.modalState.mode,
|
|
354
|
+
entry: V.modalState.entry,
|
|
355
|
+
labels: V.labels,
|
|
356
|
+
colorOptions: B,
|
|
357
|
+
onSave: V.saveModal,
|
|
358
|
+
onDelete: V.modalState.mode === "edit" ? V.deleteModalEntry : void 0,
|
|
359
|
+
onCancel: V.closeModal
|
|
360
|
+
}, `${V.modalState.mode}-${V.modalState.entry.id || ""}-${V.modalState.entry.date || ""}-${V.modalState.entry.startTime || ""}-${V.modalState.open}`)
|
|
361
|
+
}), /* @__PURE__ */ g("form", {
|
|
362
|
+
method: "dialog",
|
|
363
|
+
className: "modal-backdrop",
|
|
364
|
+
children: /* @__PURE__ */ g("button", {
|
|
365
|
+
type: "button",
|
|
366
|
+
onClick: V.closeModal,
|
|
367
|
+
children: "close"
|
|
368
|
+
})
|
|
369
|
+
})]
|
|
370
|
+
}), J = {
|
|
371
|
+
height: E || "100%",
|
|
372
|
+
width: D || "100%",
|
|
373
|
+
...z
|
|
374
|
+
};
|
|
375
|
+
return /* @__PURE__ */ _("div", {
|
|
376
|
+
className: `cal-root flex flex-col bg-base-100 border border-base-300 rounded-lg overflow-hidden ${R || ""}`,
|
|
377
|
+
style: J,
|
|
378
|
+
children: [
|
|
379
|
+
W(),
|
|
380
|
+
V.viewMode === "month" && G(),
|
|
381
|
+
(V.viewMode === "week" || V.viewMode === "day") && K(),
|
|
382
|
+
q()
|
|
383
|
+
]
|
|
384
|
+
});
|
|
385
|
+
});
|
|
386
|
+
v.displayName = "Calendar";
|
|
387
|
+
function y({ mode: e, entry: t, labels: n, colorOptions: r, onSave: i, onDelete: a, onCancel: o }) {
|
|
388
|
+
let [s, c] = h(() => ({
|
|
389
|
+
title: t.title || "",
|
|
390
|
+
date: t.date || "",
|
|
391
|
+
startTime: t.startTime || "",
|
|
392
|
+
endTime: t.endTime || "",
|
|
393
|
+
description: t.description || "",
|
|
394
|
+
color: t.color || r[0] || "#3b82f6",
|
|
395
|
+
allDay: t.allDay ?? !t.startTime
|
|
396
|
+
})), [l, u] = h(!1), d = (e) => {
|
|
397
|
+
e.preventDefault(), s.title?.trim() && i(s);
|
|
398
|
+
}, f = (e, t) => {
|
|
399
|
+
c((n) => ({
|
|
400
|
+
...n,
|
|
401
|
+
[e]: t
|
|
402
|
+
}));
|
|
403
|
+
};
|
|
404
|
+
return /* @__PURE__ */ _("form", {
|
|
405
|
+
onSubmit: d,
|
|
406
|
+
className: "flex flex-col gap-3",
|
|
407
|
+
children: [
|
|
408
|
+
/* @__PURE__ */ g("h3", {
|
|
409
|
+
className: "font-bold text-lg",
|
|
410
|
+
children: e === "add" ? n.addEntry : n.editEntry
|
|
411
|
+
}),
|
|
412
|
+
/* @__PURE__ */ _("div", {
|
|
413
|
+
className: "form-control",
|
|
414
|
+
children: [/* @__PURE__ */ g("label", {
|
|
415
|
+
className: "label py-1",
|
|
416
|
+
children: /* @__PURE__ */ g("span", {
|
|
417
|
+
className: "label-text text-xs",
|
|
418
|
+
children: n.title
|
|
419
|
+
})
|
|
420
|
+
}), /* @__PURE__ */ g("input", {
|
|
421
|
+
type: "text",
|
|
422
|
+
className: "input input-bordered input-sm w-full",
|
|
423
|
+
placeholder: n.title,
|
|
424
|
+
value: s.title || "",
|
|
425
|
+
onChange: (e) => f("title", e.target.value),
|
|
426
|
+
autoFocus: !0,
|
|
427
|
+
required: !0
|
|
428
|
+
})]
|
|
429
|
+
}),
|
|
430
|
+
/* @__PURE__ */ _("div", {
|
|
431
|
+
className: "form-control",
|
|
432
|
+
children: [/* @__PURE__ */ g("label", {
|
|
433
|
+
className: "label py-1",
|
|
434
|
+
children: /* @__PURE__ */ g("span", {
|
|
435
|
+
className: "label-text text-xs",
|
|
436
|
+
children: n.date
|
|
437
|
+
})
|
|
438
|
+
}), /* @__PURE__ */ g("input", {
|
|
439
|
+
type: "date",
|
|
440
|
+
className: "input input-bordered input-sm w-full",
|
|
441
|
+
value: s.date || "",
|
|
442
|
+
onChange: (e) => f("date", e.target.value),
|
|
443
|
+
required: !0
|
|
444
|
+
})]
|
|
445
|
+
}),
|
|
446
|
+
/* @__PURE__ */ g("div", {
|
|
447
|
+
className: "form-control",
|
|
448
|
+
children: /* @__PURE__ */ _("label", {
|
|
449
|
+
className: "label cursor-pointer justify-start gap-2 py-1",
|
|
450
|
+
children: [/* @__PURE__ */ g("input", {
|
|
451
|
+
type: "checkbox",
|
|
452
|
+
className: "checkbox checkbox-sm checkbox-primary",
|
|
453
|
+
checked: s.allDay ?? !0,
|
|
454
|
+
onChange: (e) => f("allDay", e.target.checked)
|
|
455
|
+
}), /* @__PURE__ */ g("span", {
|
|
456
|
+
className: "label-text text-xs",
|
|
457
|
+
children: n.allDay
|
|
458
|
+
})]
|
|
459
|
+
})
|
|
460
|
+
}),
|
|
461
|
+
!s.allDay && /* @__PURE__ */ _("div", {
|
|
462
|
+
className: "flex gap-2",
|
|
463
|
+
children: [/* @__PURE__ */ _("div", {
|
|
464
|
+
className: "form-control flex-1",
|
|
465
|
+
children: [/* @__PURE__ */ g("label", {
|
|
466
|
+
className: "label py-1",
|
|
467
|
+
children: /* @__PURE__ */ g("span", {
|
|
468
|
+
className: "label-text text-xs",
|
|
469
|
+
children: n.startTime
|
|
470
|
+
})
|
|
471
|
+
}), /* @__PURE__ */ g("input", {
|
|
472
|
+
type: "time",
|
|
473
|
+
className: "input input-bordered input-sm w-full",
|
|
474
|
+
value: s.startTime || "",
|
|
475
|
+
onChange: (e) => f("startTime", e.target.value)
|
|
476
|
+
})]
|
|
477
|
+
}), /* @__PURE__ */ _("div", {
|
|
478
|
+
className: "form-control flex-1",
|
|
479
|
+
children: [/* @__PURE__ */ g("label", {
|
|
480
|
+
className: "label py-1",
|
|
481
|
+
children: /* @__PURE__ */ g("span", {
|
|
482
|
+
className: "label-text text-xs",
|
|
483
|
+
children: n.endTime
|
|
484
|
+
})
|
|
485
|
+
}), /* @__PURE__ */ g("input", {
|
|
486
|
+
type: "time",
|
|
487
|
+
className: "input input-bordered input-sm w-full",
|
|
488
|
+
value: s.endTime || "",
|
|
489
|
+
onChange: (e) => f("endTime", e.target.value)
|
|
490
|
+
})]
|
|
491
|
+
})]
|
|
492
|
+
}),
|
|
493
|
+
/* @__PURE__ */ _("div", {
|
|
494
|
+
className: "form-control",
|
|
495
|
+
children: [/* @__PURE__ */ g("label", {
|
|
496
|
+
className: "label py-1",
|
|
497
|
+
children: /* @__PURE__ */ g("span", {
|
|
498
|
+
className: "label-text text-xs",
|
|
499
|
+
children: n.description
|
|
500
|
+
})
|
|
501
|
+
}), /* @__PURE__ */ g("textarea", {
|
|
502
|
+
className: "textarea textarea-bordered textarea-sm w-full",
|
|
503
|
+
rows: 2,
|
|
504
|
+
placeholder: n.description,
|
|
505
|
+
value: s.description || "",
|
|
506
|
+
onChange: (e) => f("description", e.target.value)
|
|
507
|
+
})]
|
|
508
|
+
}),
|
|
509
|
+
/* @__PURE__ */ _("div", {
|
|
510
|
+
className: "form-control",
|
|
511
|
+
children: [/* @__PURE__ */ g("label", {
|
|
512
|
+
className: "label py-1",
|
|
513
|
+
children: /* @__PURE__ */ g("span", {
|
|
514
|
+
className: "label-text text-xs",
|
|
515
|
+
children: n.color
|
|
516
|
+
})
|
|
517
|
+
}), /* @__PURE__ */ g("div", {
|
|
518
|
+
className: "flex gap-2 flex-wrap",
|
|
519
|
+
children: r.map((e) => /* @__PURE__ */ g("button", {
|
|
520
|
+
type: "button",
|
|
521
|
+
className: `cal-color-swatch ${s.color === e ? "cal-color-swatch--selected" : ""}`,
|
|
522
|
+
style: { backgroundColor: e },
|
|
523
|
+
onClick: () => f("color", e),
|
|
524
|
+
"aria-label": e
|
|
525
|
+
}, e))
|
|
526
|
+
})]
|
|
527
|
+
}),
|
|
528
|
+
/* @__PURE__ */ _("div", {
|
|
529
|
+
className: "flex justify-between items-center pt-2",
|
|
530
|
+
children: [/* @__PURE__ */ _("div", { children: [a && !l && /* @__PURE__ */ g("button", {
|
|
531
|
+
type: "button",
|
|
532
|
+
className: "btn btn-error btn-sm btn-outline",
|
|
533
|
+
onClick: () => u(!0),
|
|
534
|
+
children: n.deleteEntry
|
|
535
|
+
}), a && l && /* @__PURE__ */ _("div", {
|
|
536
|
+
className: "flex items-center gap-2",
|
|
537
|
+
children: [
|
|
538
|
+
/* @__PURE__ */ g("span", {
|
|
539
|
+
className: "text-xs text-error",
|
|
540
|
+
children: n.confirmDelete
|
|
541
|
+
}),
|
|
542
|
+
/* @__PURE__ */ g("button", {
|
|
543
|
+
type: "button",
|
|
544
|
+
className: "btn btn-error btn-xs",
|
|
545
|
+
onClick: a,
|
|
546
|
+
children: n.deleteEntry
|
|
547
|
+
}),
|
|
548
|
+
/* @__PURE__ */ g("button", {
|
|
549
|
+
type: "button",
|
|
550
|
+
className: "btn btn-ghost btn-xs",
|
|
551
|
+
onClick: () => u(!1),
|
|
552
|
+
children: n.cancel
|
|
553
|
+
})
|
|
554
|
+
]
|
|
555
|
+
})] }), /* @__PURE__ */ _("div", {
|
|
556
|
+
className: "flex gap-2",
|
|
557
|
+
children: [/* @__PURE__ */ g("button", {
|
|
558
|
+
type: "button",
|
|
559
|
+
className: "btn btn-ghost btn-sm",
|
|
560
|
+
onClick: o,
|
|
561
|
+
children: n.cancel
|
|
562
|
+
}), /* @__PURE__ */ g("button", {
|
|
563
|
+
type: "submit",
|
|
564
|
+
className: "btn btn-primary btn-sm",
|
|
565
|
+
disabled: !s.title?.trim(),
|
|
566
|
+
children: n.save
|
|
567
|
+
})]
|
|
568
|
+
})]
|
|
569
|
+
})
|
|
570
|
+
]
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
//#endregion
|
|
574
|
+
export { v as default };
|
|
575
|
+
|
|
576
|
+
//# sourceMappingURL=Calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.js","names":[],"sources":["../../../../src/components/pro/Calendar/Calendar.tsx"],"sourcesContent":["/**\n * DishUI Calendar Component\n *\n * A full-featured calendar with month/week/day views, drag-and-drop,\n * holiday support, and entry management.\n */\n\nimport React, {\n forwardRef,\n useImperativeHandle,\n useRef,\n useState,\n useEffect,\n} from \"react\";\nimport type {\n CalendarProps,\n CalendarHandle,\n CalendarEntry,\n CalendarViewMode,\n} from \"./types\";\nimport { useCalendarState } from \"./hooks/useCalendarState\";\nimport { useCalendarDrag } from \"./hooks/useCalendarDrag\";\nimport {\n formatDate,\n isToday,\n isWeekend,\n isHoliday,\n getHolidayEntry,\n timeToMinutes,\n TIME_SLOTS,\n SLOT_HEIGHT,\n TIME_GRID_HEIGHT,\n DEFAULT_COLOR_OPTIONS,\n} from \"./utils\";\nimport \"./styles.css\";\n\n// ─── Component ────────────────────────────────────────────────────\n\nconst Calendar = forwardRef<CalendarHandle, CalendarProps>((props, ref) => {\n const {\n entries: externalEntries,\n holidays,\n defaultView = \"month\",\n defaultDate,\n readOnly = false,\n locale = \"en\",\n labels: userLabels,\n height,\n width,\n onEntryAdd,\n onEntryUpdate,\n onEntryDelete,\n onEntryDrop,\n onEntryClick,\n onDateClick,\n onViewChange,\n holidayColor,\n todayColor,\n weekendColor,\n className,\n style,\n colorOptions = DEFAULT_COLOR_OPTIONS,\n } = props;\n\n // ─── State Hook ─────────────────────────────────────────────────\n\n const state = useCalendarState({\n entries: externalEntries,\n holidays,\n defaultView,\n defaultDate,\n locale,\n labels: userLabels,\n colorOptions,\n readOnly,\n onEntryAdd,\n onEntryUpdate,\n onEntryDelete,\n onViewChange,\n });\n\n // ─── Drag Hook ──────────────────────────────────────────────────\n\n const drag = useCalendarDrag({\n readOnly,\n onEntryDrop,\n onEntryUpdate: (entry) => {\n state.updateEntry(entry);\n onEntryUpdate?.(entry);\n },\n });\n\n // ─── Imperative Handle ──────────────────────────────────────────\n\n useImperativeHandle(ref, () => ({\n goToToday: state.goToToday,\n goToDate: state.goToDate,\n setView: state.setViewMode,\n getEntries: () => state.entries,\n }));\n\n // ─── Modal Refs ─────────────────────────────────────────────────\n\n const modalRef = useRef<HTMLDialogElement>(null);\n\n useEffect(() => {\n if (state.modalState.open) {\n modalRef.current?.showModal();\n } else {\n modalRef.current?.close();\n }\n }, [state.modalState.open]);\n\n // ─── Render Header ──────────────────────────────────────────────\n\n const renderHeader = () => (\n <div className=\"flex items-center gap-2 p-2 border-b border-base-300 flex-wrap\">\n {/* Navigation */}\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n className=\"btn btn-ghost btn-xs btn-square\"\n onClick={state.goPrev}\n aria-label=\"Previous\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </button>\n <button\n type=\"button\"\n className=\"btn btn-ghost btn-xs btn-square\"\n onClick={state.goNext}\n aria-label=\"Next\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n className=\"w-4 h-4\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </button>\n <button\n type=\"button\"\n className=\"btn btn-ghost btn-xs\"\n onClick={state.goToToday}\n >\n {state.labels.today}\n </button>\n </div>\n\n {/* Title */}\n <h2 className=\"text-sm font-semibold flex-1 text-center min-w-0 truncate\">\n {state.title}\n </h2>\n\n {/* View Toggle */}\n <div className=\"join\">\n {([\"month\", \"week\", \"day\"] as CalendarViewMode[]).map((v) => (\n <button\n key={v}\n type=\"button\"\n className={`btn btn-xs join-item ${state.viewMode === v ? \"btn-active\" : \"\"}`}\n onClick={() => state.setViewMode(v)}\n >\n {v === \"month\"\n ? state.labels.month\n : v === \"week\"\n ? state.labels.week\n : state.labels.day}\n </button>\n ))}\n </div>\n\n {/* Add Button */}\n {!readOnly && (\n <button\n type=\"button\"\n className=\"btn btn-primary btn-xs\"\n onClick={() => state.openAddModal()}\n >\n + {state.labels.addEntry}\n </button>\n )}\n </div>\n );\n\n // ─── Render Month View ──────────────────────────────────────────\n\n const renderMonthView = () => {\n const currentMonth = state.currentDateObj.getMonth();\n\n return (\n <div className=\"flex flex-col flex-1 min-h-0 overflow-hidden\">\n {/* Weekday headers */}\n <div className=\"cal-weekday-header\">\n {state.labels.weekDays!.map((day, i) => (\n <div key={i} className=\"cal-weekday-header-cell\">\n {day}\n </div>\n ))}\n </div>\n\n {/* Month grid */}\n <div className=\"cal-month-grid overflow-auto cal-scroll\">\n {state.monthDates.map((date, idx) => {\n const dateStr = formatDate(date);\n const isCurrentMonth = date.getMonth() === currentMonth;\n const isTodayCell = isToday(date);\n const isWknd = isWeekend(date);\n const isHol = isHoliday(dateStr, holidays);\n const holEntry = getHolidayEntry(dateStr, holidays);\n const dayEntries = state.getEntriesForDate(dateStr);\n const isTarget = drag.isDropTarget(dateStr);\n\n const cellClasses = [\n \"cal-month-cell\",\n !isCurrentMonth && \"cal-month-cell--outside\",\n isTodayCell && \"cal-month-cell--today\",\n isWknd && !isHol && \"cal-month-cell--weekend\",\n isHol && \"cal-month-cell--holiday\",\n isTarget && \"cal-month-cell--drop-target\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div\n key={idx}\n className={cellClasses}\n style={{\n ...(isTodayCell && todayColor\n ? { backgroundColor: todayColor + \"33\" }\n : {}),\n ...(isHol && holidayColor\n ? { backgroundColor: holidayColor + \"33\" }\n : {}),\n ...(isWknd && !isHol && weekendColor\n ? { backgroundColor: weekendColor + \"22\" }\n : {}),\n }}\n onClick={(e) => {\n // Only fire if not clicking on an entry\n if ((e.target as HTMLElement).closest(\".cal-entry-pill\"))\n return;\n onDateClick?.(dateStr);\n if (!readOnly) {\n state.openAddModal(dateStr);\n }\n }}\n onDragOver={(e) => drag.handleDragOver(e, dateStr)}\n onDragLeave={drag.handleDragLeave}\n onDrop={(e) => drag.handleDrop(e, dateStr)}\n >\n {/* Date number */}\n <div className=\"flex items-center gap-1 mb-0.5\">\n <span\n className={`text-xs font-medium leading-none ${\n isTodayCell\n ? \"bg-primary text-primary-content rounded-full w-5 h-5 flex items-center justify-center\"\n : \"\"\n }`}\n >\n {date.getDate()}\n </span>\n {holEntry && !holEntry.isWorkday && (\n <span className=\"cal-holiday-tag\">{holEntry.name}</span>\n )}\n </div>\n\n {/* Entry pills */}\n {dayEntries.slice(0, 3).map((entry) => (\n <div\n key={entry.id}\n className={`cal-entry-pill ${drag.draggingEntryId === entry.id ? \"cal-entry-pill--dragging\" : \"\"}`}\n style={{\n backgroundColor: (entry.color || \"#3b82f6\") + \"22\",\n color: entry.color || \"#3b82f6\",\n }}\n draggable={!readOnly}\n onDragStart={(e) => drag.handleDragStart(e, entry)}\n onDragEnd={drag.handleDragEnd}\n onClick={(e) => {\n e.stopPropagation();\n onEntryClick?.(entry);\n if (!readOnly) {\n state.openEditModal(entry);\n }\n }}\n title={entry.title}\n >\n <span\n className=\"cal-entry-dot\"\n style={{ backgroundColor: entry.color || \"#3b82f6\" }}\n />\n <span className=\"truncate\">{entry.title}</span>\n </div>\n ))}\n {dayEntries.length > 3 && (\n <div className=\"text-[0.6rem] opacity-50 pl-1\">\n +{dayEntries.length - 3} more\n </div>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n };\n\n // ─── Render Week/Day View ───────────────────────────────────────\n\n const renderTimeView = () => {\n const dates =\n state.viewMode === \"week\" ? state.weekDates : [state.currentDateObj];\n\n // Separate all-day entries from timed entries\n const getTimedEntries = (dateStr: string) =>\n state.getEntriesForDate(dateStr).filter((e) => !e.allDay && e.startTime);\n const getAllDayEntries = (dateStr: string) =>\n state.getEntriesForDate(dateStr).filter((e) => e.allDay || !e.startTime);\n\n // Now indicator position\n const now = new Date();\n const nowMinutes = now.getHours() * 60 + now.getMinutes();\n const nowTop = (nowMinutes / 30) * SLOT_HEIGHT;\n\n return (\n <div className=\"flex flex-col flex-1 min-h-0 overflow-hidden\">\n {/* Column headers */}\n <div className=\"cal-column-header\">\n <div className=\"cal-column-header-gutter\" />\n <div className=\"cal-column-header-cells\">\n {dates.map((date, i) => {\n const dateStr = formatDate(date);\n const isTodayCol = isToday(date);\n const isWknd = isWeekend(date);\n const holEntry = getHolidayEntry(dateStr, holidays);\n\n return (\n <div\n key={i}\n className={`cal-column-header-cell ${isTodayCol ? \"cal-column-header-cell--today\" : \"\"} ${isWknd ? \"cal-column-header-cell--weekend\" : \"\"}`}\n >\n <div className=\"font-medium\">\n {state.labels.weekDays![date.getDay()]}\n </div>\n <div\n className={`text-lg font-bold ${isTodayCol ? \"bg-primary text-primary-content rounded-full w-7 h-7 flex items-center justify-center mx-auto\" : \"\"}`}\n >\n {date.getDate()}\n </div>\n {holEntry && !holEntry.isWorkday && (\n <span className=\"cal-holiday-tag\">{holEntry.name}</span>\n )}\n </div>\n );\n })}\n </div>\n </div>\n\n {/* All-day section */}\n <div className=\"cal-allday-section\">\n <div className=\"cal-allday-gutter\">{state.labels.allDay}</div>\n <div className=\"cal-allday-cells\">\n {dates.map((date, i) => {\n const dateStr = formatDate(date);\n const allDayEntries = getAllDayEntries(dateStr);\n const isTarget =\n drag.isDropTarget(dateStr) && !drag.dropTarget?.time;\n const isWkndAllDay = isWeekend(date);\n const isHolAllDay = isHoliday(dateStr, holidays);\n\n const allDayClasses = [\n \"cal-allday-cell\",\n isWkndAllDay && !isHolAllDay && \"cal-allday-cell--weekend\",\n isHolAllDay && \"cal-allday-cell--holiday\",\n isTarget && \"cal-allday-cell--drop-target\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div\n key={i}\n className={allDayClasses}\n onDragOver={(e) => drag.handleDragOver(e, dateStr)}\n onDragLeave={drag.handleDragLeave}\n onDrop={(e) => drag.handleDrop(e, dateStr)}\n >\n {allDayEntries.map((entry) => (\n <div\n key={entry.id}\n className={`cal-entry-pill ${drag.draggingEntryId === entry.id ? \"cal-entry-pill--dragging\" : \"\"}`}\n style={{\n backgroundColor: (entry.color || \"#3b82f6\") + \"22\",\n color: entry.color || \"#3b82f6\",\n }}\n draggable={!readOnly}\n onDragStart={(e) => drag.handleDragStart(e, entry)}\n onDragEnd={drag.handleDragEnd}\n onClick={(e) => {\n e.stopPropagation();\n onEntryClick?.(entry);\n if (!readOnly) state.openEditModal(entry);\n }}\n >\n <span\n className=\"cal-entry-dot\"\n style={{ backgroundColor: entry.color || \"#3b82f6\" }}\n />\n <span className=\"truncate\">{entry.title}</span>\n </div>\n ))}\n </div>\n );\n })}\n </div>\n </div>\n\n {/* Time grid */}\n <div className=\"cal-time-grid\">\n {/* Time gutter */}\n <div className=\"cal-time-gutter cal-scroll overflow-y-auto\">\n <div style={{ height: TIME_GRID_HEIGHT }}>\n {TIME_SLOTS.map((slot, i) => (\n <div key={i} className=\"cal-time-gutter-label\">\n {i % 2 === 0 ? slot : \"\"}\n </div>\n ))}\n </div>\n </div>\n\n {/* Time columns */}\n <div className=\"cal-time-columns cal-scroll\">\n {dates.map((date, colIdx) => {\n const dateStr = formatDate(date);\n const timedEntries = getTimedEntries(dateStr);\n const isTodayCol = isToday(date);\n const isWkndCol = isWeekend(date);\n const isHolCol = isHoliday(dateStr, holidays);\n\n const columnClasses = [\n \"cal-time-column\",\n isTodayCol && \"cal-time-column--today\",\n isWkndCol && !isHolCol && \"cal-time-column--weekend\",\n isHolCol && \"cal-time-column--holiday\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div\n key={colIdx}\n className={columnClasses}\n style={{ height: TIME_GRID_HEIGHT }}\n >\n {/* Time slots (drop targets) */}\n {TIME_SLOTS.map((slot, slotIdx) => {\n const isTarget = drag.isDropTarget(dateStr, slot);\n return (\n <div\n key={slotIdx}\n className={`cal-time-slot ${isTarget ? \"cal-time-slot--drop-target\" : \"\"}`}\n onDragOver={(e) =>\n drag.handleDragOver(e, dateStr, slot)\n }\n onDragLeave={drag.handleDragLeave}\n onDrop={(e) => drag.handleDrop(e, dateStr, slot)}\n onClick={() => {\n onDateClick?.(dateStr);\n if (!readOnly) state.openAddModal(dateStr, slot);\n }}\n />\n );\n })}\n\n {/* Timed entries */}\n {timedEntries.map((entry) => {\n const startMin = timeToMinutes(entry.startTime);\n const endMin = entry.endTime\n ? timeToMinutes(entry.endTime)\n : startMin + 60;\n const top = (startMin / 30) * SLOT_HEIGHT;\n const height = Math.max(\n ((endMin - startMin) / 30) * SLOT_HEIGHT,\n SLOT_HEIGHT / 2,\n );\n const isDraggingThis = drag.draggingEntryId === entry.id;\n\n return (\n <div\n key={entry.id}\n className={`cal-time-entry ${isDraggingThis ? \"cal-time-entry--dragging\" : \"\"}`}\n style={{\n top,\n height,\n backgroundColor: (entry.color || \"#3b82f6\") + \"33\",\n borderLeft: `3px solid ${entry.color || \"#3b82f6\"}`,\n color: entry.color || \"#3b82f6\",\n }}\n draggable={!readOnly}\n onDragStart={(e) => drag.handleDragStart(e, entry)}\n onDragEnd={drag.handleDragEnd}\n onClick={(e) => {\n e.stopPropagation();\n onEntryClick?.(entry);\n if (!readOnly) state.openEditModal(entry);\n }}\n >\n <span className=\"cal-time-entry-title\">\n {entry.title}\n </span>\n <span className=\"cal-time-entry-time\">\n {entry.startTime}\n {entry.endTime ? ` - ${entry.endTime}` : \"\"}\n </span>\n\n {/* Resize handle */}\n {!readOnly && (\n <div\n className=\"cal-time-entry-resize\"\n draggable\n onDragStart={(e) =>\n drag.handleResizeStart(e, entry)\n }\n onDragEnd={drag.handleDragEnd}\n />\n )}\n </div>\n );\n })}\n\n {/* Now indicator */}\n {isTodayCol && (\n <div className=\"cal-now-line\" style={{ top: nowTop }} />\n )}\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n };\n\n // ─── Entry Form Modal ───────────────────────────────────────────\n\n const renderModal = () => {\n return (\n <dialog\n ref={modalRef}\n className=\"modal cal-modal\"\n onClose={state.closeModal}\n >\n <div className=\"modal-box\">\n <EntryForm\n key={`${state.modalState.mode}-${state.modalState.entry.id || \"\"}-${state.modalState.entry.date || \"\"}-${state.modalState.entry.startTime || \"\"}-${state.modalState.open}`}\n mode={state.modalState.mode}\n entry={state.modalState.entry}\n labels={state.labels}\n colorOptions={colorOptions}\n onSave={state.saveModal}\n onDelete={\n state.modalState.mode === \"edit\"\n ? state.deleteModalEntry\n : undefined\n }\n onCancel={state.closeModal}\n />\n </div>\n <form method=\"dialog\" className=\"modal-backdrop\">\n <button type=\"button\" onClick={state.closeModal}>\n close\n </button>\n </form>\n </dialog>\n );\n };\n\n // ─── Main Render ────────────────────────────────────────────────\n\n const containerStyle: React.CSSProperties = {\n height: height || \"100%\",\n width: width || \"100%\",\n ...style,\n };\n\n return (\n <div\n className={`cal-root flex flex-col bg-base-100 border border-base-300 rounded-lg overflow-hidden ${className || \"\"}`}\n style={containerStyle}\n >\n {renderHeader()}\n {state.viewMode === \"month\" && renderMonthView()}\n {(state.viewMode === \"week\" || state.viewMode === \"day\") &&\n renderTimeView()}\n {renderModal()}\n </div>\n );\n});\n\nCalendar.displayName = \"Calendar\";\nexport default Calendar;\n\n// ─── Entry Form Sub-component ─────────────────────────────────────\n\ninterface EntryFormProps {\n mode: \"add\" | \"edit\";\n entry: Partial<CalendarEntry>;\n labels: Required<import(\"./types\").CalendarLabels>;\n colorOptions: string[];\n onSave: (entry: Partial<CalendarEntry>) => void;\n onDelete?: () => void;\n onCancel: () => void;\n}\n\nfunction EntryForm({\n mode,\n entry,\n labels,\n colorOptions,\n onSave,\n onDelete,\n onCancel,\n}: EntryFormProps) {\n const [formData, setFormData] = useState<Partial<CalendarEntry>>(() => ({\n title: entry.title || \"\",\n date: entry.date || \"\",\n startTime: entry.startTime || \"\",\n endTime: entry.endTime || \"\",\n description: entry.description || \"\",\n color: entry.color || colorOptions[0] || \"#3b82f6\",\n allDay: entry.allDay ?? (entry.startTime ? false : true),\n }));\n\n const [confirmingDelete, setConfirmingDelete] = useState(false);\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n if (!formData.title?.trim()) return;\n onSave(formData);\n };\n\n const handleFieldChange = (\n field: keyof CalendarEntry,\n value: string | boolean,\n ) => {\n setFormData((prev) => ({ ...prev, [field]: value }));\n };\n\n return (\n <form onSubmit={handleSubmit} className=\"flex flex-col gap-3\">\n <h3 className=\"font-bold text-lg\">\n {mode === \"add\" ? labels.addEntry : labels.editEntry}\n </h3>\n\n {/* Title */}\n <div className=\"form-control\">\n <label className=\"label py-1\">\n <span className=\"label-text text-xs\">{labels.title}</span>\n </label>\n <input\n type=\"text\"\n className=\"input input-bordered input-sm w-full\"\n placeholder={labels.title}\n value={formData.title || \"\"}\n onChange={(e) => handleFieldChange(\"title\", e.target.value)}\n autoFocus\n required\n />\n </div>\n\n {/* Date */}\n <div className=\"form-control\">\n <label className=\"label py-1\">\n <span className=\"label-text text-xs\">{labels.date}</span>\n </label>\n <input\n type=\"date\"\n className=\"input input-bordered input-sm w-full\"\n value={formData.date || \"\"}\n onChange={(e) => handleFieldChange(\"date\", e.target.value)}\n required\n />\n </div>\n\n {/* All Day Toggle */}\n <div className=\"form-control\">\n <label className=\"label cursor-pointer justify-start gap-2 py-1\">\n <input\n type=\"checkbox\"\n className=\"checkbox checkbox-sm checkbox-primary\"\n checked={formData.allDay ?? true}\n onChange={(e) => handleFieldChange(\"allDay\", e.target.checked)}\n />\n <span className=\"label-text text-xs\">{labels.allDay}</span>\n </label>\n </div>\n\n {/* Time fields (only when not all-day) */}\n {!formData.allDay && (\n <div className=\"flex gap-2\">\n <div className=\"form-control flex-1\">\n <label className=\"label py-1\">\n <span className=\"label-text text-xs\">{labels.startTime}</span>\n </label>\n <input\n type=\"time\"\n className=\"input input-bordered input-sm w-full\"\n value={formData.startTime || \"\"}\n onChange={(e) => handleFieldChange(\"startTime\", e.target.value)}\n />\n </div>\n <div className=\"form-control flex-1\">\n <label className=\"label py-1\">\n <span className=\"label-text text-xs\">{labels.endTime}</span>\n </label>\n <input\n type=\"time\"\n className=\"input input-bordered input-sm w-full\"\n value={formData.endTime || \"\"}\n onChange={(e) => handleFieldChange(\"endTime\", e.target.value)}\n />\n </div>\n </div>\n )}\n\n {/* Description */}\n <div className=\"form-control\">\n <label className=\"label py-1\">\n <span className=\"label-text text-xs\">{labels.description}</span>\n </label>\n <textarea\n className=\"textarea textarea-bordered textarea-sm w-full\"\n rows={2}\n placeholder={labels.description}\n value={formData.description || \"\"}\n onChange={(e) => handleFieldChange(\"description\", e.target.value)}\n />\n </div>\n\n {/* Color picker */}\n <div className=\"form-control\">\n <label className=\"label py-1\">\n <span className=\"label-text text-xs\">{labels.color}</span>\n </label>\n <div className=\"flex gap-2 flex-wrap\">\n {colorOptions.map((color) => (\n <button\n key={color}\n type=\"button\"\n className={`cal-color-swatch ${formData.color === color ? \"cal-color-swatch--selected\" : \"\"}`}\n style={{ backgroundColor: color }}\n onClick={() => handleFieldChange(\"color\", color)}\n aria-label={color}\n />\n ))}\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex justify-between items-center pt-2\">\n <div>\n {onDelete && !confirmingDelete && (\n <button\n type=\"button\"\n className=\"btn btn-error btn-sm btn-outline\"\n onClick={() => setConfirmingDelete(true)}\n >\n {labels.deleteEntry}\n </button>\n )}\n {onDelete && confirmingDelete && (\n <div className=\"flex items-center gap-2\">\n <span className=\"text-xs text-error\">{labels.confirmDelete}</span>\n <button\n type=\"button\"\n className=\"btn btn-error btn-xs\"\n onClick={onDelete}\n >\n {labels.deleteEntry}\n </button>\n <button\n type=\"button\"\n className=\"btn btn-ghost btn-xs\"\n onClick={() => setConfirmingDelete(false)}\n >\n {labels.cancel}\n </button>\n </div>\n )}\n </div>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n className=\"btn btn-ghost btn-sm\"\n onClick={onCancel}\n >\n {labels.cancel}\n </button>\n <button\n type=\"submit\"\n className=\"btn btn-primary btn-sm\"\n disabled={!formData.title?.trim()}\n >\n {labels.save}\n </button>\n </div>\n </div>\n </form>\n );\n}\n"],"mappings":";;;;;;;AAsCA,IAAM,IAAW,GAA2C,GAAO,MAAQ;CACzE,IAAM,EACJ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