@trsys-tech/matrix-library 1.1.6 → 1.1.7
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/README.md +18 -10
- package/dist/components/data-table/DataTable.d.ts +8 -0
- package/dist/components/data-table/DataTable.d.ts.map +1 -0
- package/dist/components/data-table/DataTable.types.d.ts +176 -0
- package/dist/components/data-table/DataTable.types.d.ts.map +1 -0
- package/dist/components/data-table/DataTableActions.d.ts +42 -0
- package/dist/components/data-table/DataTableActions.d.ts.map +1 -0
- package/dist/components/data-table/DataTableAlignment.d.ts +9 -0
- package/dist/components/data-table/DataTableAlignment.d.ts.map +1 -0
- package/dist/components/data-table/DataTableColumnHeader.d.ts +11 -0
- package/dist/components/data-table/DataTableColumnHeader.d.ts.map +1 -0
- package/dist/components/data-table/DataTableColumnMenu.d.ts +9 -0
- package/dist/components/data-table/DataTableColumnMenu.d.ts.map +1 -0
- package/dist/components/data-table/DataTableContent.d.ts +7 -0
- package/dist/components/data-table/DataTableContent.d.ts.map +1 -0
- package/dist/components/data-table/DataTableContext.d.ts +37 -0
- package/dist/components/data-table/DataTableContext.d.ts.map +1 -0
- package/dist/components/data-table/DataTableHeader.d.ts +22 -0
- package/dist/components/data-table/DataTableHeader.d.ts.map +1 -0
- package/dist/components/data-table/DataTablePagination.d.ts +8 -0
- package/dist/components/data-table/DataTablePagination.d.ts.map +1 -0
- package/dist/components/data-table/DataTableRowView.d.ts +40 -0
- package/dist/components/data-table/DataTableRowView.d.ts.map +1 -0
- package/dist/components/data-table/dataTableColumnDrag.d.ts +13 -0
- package/dist/components/data-table/dataTableColumnDrag.d.ts.map +1 -0
- package/dist/components/data-table/dataTableEditing.d.ts +11 -0
- package/dist/components/data-table/dataTableEditing.d.ts.map +1 -0
- package/dist/components/data-table/dataTableFeatures.d.ts +25 -0
- package/dist/components/data-table/dataTableFeatures.d.ts.map +1 -0
- package/dist/components/data-table/dataTableModel.d.ts +23 -0
- package/dist/components/data-table/dataTableModel.d.ts.map +1 -0
- package/dist/components/data-table/dataTablePrint.d.ts +3 -0
- package/dist/components/data-table/dataTablePrint.d.ts.map +1 -0
- package/dist/components/data-table/dataTableStyles.d.ts +2 -0
- package/dist/components/data-table/dataTableStyles.d.ts.map +1 -0
- package/dist/components/data-table/useDataTableApi.d.ts +34 -0
- package/dist/components/data-table/useDataTableApi.d.ts.map +1 -0
- package/dist/components/data-table/useDataTableColumnDrag.d.ts +16 -0
- package/dist/components/data-table/useDataTableColumnDrag.d.ts.map +1 -0
- package/dist/components/data-table/useDataTableInstance.d.ts +96 -0
- package/dist/components/data-table/useDataTableInstance.d.ts.map +1 -0
- package/dist/components/data-table/useDataTableMotion.d.ts +4 -0
- package/dist/components/data-table/useDataTableMotion.d.ts.map +1 -0
- package/dist/components/resource-scheduler/ResourceScheduler.d.ts +96 -0
- package/dist/components/resource-scheduler/ResourceScheduler.d.ts.map +1 -0
- package/dist/datatable.es.js +40 -0
- package/dist/datatable.es.js.map +1 -0
- package/dist/datatableactions.es.js +193 -0
- package/dist/datatableactions.es.js.map +1 -0
- package/dist/datatablealignment.es.js +11 -0
- package/dist/datatablealignment.es.js.map +1 -0
- package/dist/datatablecolumndrag.es.js +34 -0
- package/dist/datatablecolumndrag.es.js.map +1 -0
- package/dist/datatablecolumnheader.es.js +81 -0
- package/dist/datatablecolumnheader.es.js.map +1 -0
- package/dist/datatablecolumnmenu.es.js +191 -0
- package/dist/datatablecolumnmenu.es.js.map +1 -0
- package/dist/datatablecontent.es.js +376 -0
- package/dist/datatablecontent.es.js.map +1 -0
- package/dist/datatablecontext.es.js +14 -0
- package/dist/datatablecontext.es.js.map +1 -0
- package/dist/datatablefeatures.es.js +24 -0
- package/dist/datatablefeatures.es.js.map +1 -0
- package/dist/datatableheader.es.js +126 -0
- package/dist/datatableheader.es.js.map +1 -0
- package/dist/datatablemodel.es.js +126 -0
- package/dist/datatablemodel.es.js.map +1 -0
- package/dist/datatablepagination.es.js +43 -0
- package/dist/datatablepagination.es.js.map +1 -0
- package/dist/datatableprint.es.js +65 -0
- package/dist/datatableprint.es.js.map +1 -0
- package/dist/datatablerowview.es.js +201 -0
- package/dist/datatablerowview.es.js.map +1 -0
- package/dist/datatablestyles.es.js +5 -0
- package/dist/datatablestyles.es.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +173 -154
- package/dist/index.es.js.map +1 -1
- package/dist/resourcescheduler.es.js +450 -0
- package/dist/resourcescheduler.es.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/usedatatableapi.es.js +117 -0
- package/dist/usedatatableapi.es.js.map +1 -0
- package/dist/usedatatablecolumndrag.es.js +40 -0
- package/dist/usedatatablecolumndrag.es.js.map +1 -0
- package/dist/usedatatableinstance.es.js +178 -0
- package/dist/usedatatableinstance.es.js.map +1 -0
- package/dist/usedatatablemotion.es.js +99 -0
- package/dist/usedatatablemotion.es.js.map +1 -0
- package/package.json +33 -12
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
import { jsxs as K, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as xe, useState as q, useEffect as ee, useRef as Z, useId as pe, useMemo as ce, createElement as ye } from "react";
|
|
3
|
+
import { DragDropProvider as he, DragOverlay as be, PointerSensor as ie, useDroppable as De, useDraggable as ve } from "@dnd-kit/react";
|
|
4
|
+
import { cn as B } from "./utils.es.js";
|
|
5
|
+
import { toDateOnlyString as G, toCalendarDate as Y } from "./datevalue.es.js";
|
|
6
|
+
const we = [
|
|
7
|
+
ie.configure({
|
|
8
|
+
preventActivation: (a, m) => a.pointerType !== "touch" || !!ie.defaults.preventActivation?.(a, m)
|
|
9
|
+
})
|
|
10
|
+
], Ie = ({
|
|
11
|
+
today: a,
|
|
12
|
+
days: m,
|
|
13
|
+
dayKeys: g,
|
|
14
|
+
formatter: f,
|
|
15
|
+
resourceHeading: l,
|
|
16
|
+
resourceColumnWidth: y,
|
|
17
|
+
dayColumnWidth: T,
|
|
18
|
+
slotProps: i
|
|
19
|
+
}) => /* @__PURE__ */ K("div", { role: "row", className: "mtx-flex", children: [
|
|
20
|
+
/* @__PURE__ */ p(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
role: "columnheader",
|
|
24
|
+
className: "mtx-sticky mtx-left-0 mtx-z-20 mtx-flex mtx-shrink-0 mtx-items-center mtx-border-b mtx-border-r mtx-border-gray-200 mtx-bg-gray-0 mtx-px-4 mtx-py-2",
|
|
25
|
+
style: { width: y },
|
|
26
|
+
children: l
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
m.map((b, s) => /* @__PURE__ */ ye(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
...i?.day,
|
|
33
|
+
key: g[s],
|
|
34
|
+
role: "columnheader",
|
|
35
|
+
"data-date": g[s],
|
|
36
|
+
"data-today": g[s] === a || void 0,
|
|
37
|
+
"aria-current": g[s] === a ? "date" : void 0,
|
|
38
|
+
className: B(
|
|
39
|
+
"mtx-flex mtx-flex-1 mtx-items-center mtx-justify-center mtx-border-b mtx-border-r mtx-border-gray-200 mtx-px-2 mtx-py-2",
|
|
40
|
+
g[s] === a && "mtx-bg-primary-50",
|
|
41
|
+
i?.day?.className
|
|
42
|
+
),
|
|
43
|
+
style: { minWidth: T, ...i?.day?.style }
|
|
44
|
+
},
|
|
45
|
+
f(b)
|
|
46
|
+
))
|
|
47
|
+
] }), ke = ({
|
|
48
|
+
item: a,
|
|
49
|
+
index: m,
|
|
50
|
+
count: g,
|
|
51
|
+
resourceId: f,
|
|
52
|
+
day: l,
|
|
53
|
+
cardWidth: y,
|
|
54
|
+
stackOffset: T,
|
|
55
|
+
slotProps: i,
|
|
56
|
+
interaction: b
|
|
57
|
+
}) => {
|
|
58
|
+
const { disabled: s, instructionsId: D, activeMove: h, draggedItemRef: v, cardRefs: w, setActiveMove: N, handleKeyDown: J } = b, [X, H] = q(!1), { ref: u } = ve({
|
|
59
|
+
id: a.id,
|
|
60
|
+
disabled: s || a.draggable === !1 || !!h?.keyboard,
|
|
61
|
+
data: { resourceId: f, day: l }
|
|
62
|
+
}), S = Z(null);
|
|
63
|
+
ee(() => () => S.current?.remove(), []);
|
|
64
|
+
const L = h?.itemId === a.id;
|
|
65
|
+
return /* @__PURE__ */ p(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
...i?.card,
|
|
69
|
+
ref: (o) => {
|
|
70
|
+
u(o), o ? w.current.set(a.id, o) : w.current.delete(a.id);
|
|
71
|
+
},
|
|
72
|
+
"data-item-id": a.id,
|
|
73
|
+
"data-moving": L || void 0,
|
|
74
|
+
role: "group",
|
|
75
|
+
"aria-label": a.label ?? String(a.id),
|
|
76
|
+
"aria-describedby": D,
|
|
77
|
+
tabIndex: s || a.draggable === !1 ? void 0 : 0,
|
|
78
|
+
draggable: !s && a.draggable !== !1,
|
|
79
|
+
className: B(
|
|
80
|
+
"mtx-relative focus-visible:mtx-outline-none focus-visible:mtx-ring-2 focus-visible:mtx-ring-primary-300",
|
|
81
|
+
!s && a.draggable !== !1 && "mtx-cursor-grab active:mtx-cursor-grabbing",
|
|
82
|
+
i?.card?.className
|
|
83
|
+
),
|
|
84
|
+
style: {
|
|
85
|
+
gridArea: "1 / 1",
|
|
86
|
+
marginLeft: m * T,
|
|
87
|
+
width: y,
|
|
88
|
+
touchAction: "manipulation",
|
|
89
|
+
...i?.card?.style,
|
|
90
|
+
zIndex: X || L ? g : m
|
|
91
|
+
},
|
|
92
|
+
onFocus: (o) => {
|
|
93
|
+
H(!0), i?.card?.onFocus?.(o);
|
|
94
|
+
},
|
|
95
|
+
onBlur: (o) => {
|
|
96
|
+
o.currentTarget.contains(o.relatedTarget) || H(!1), i?.card?.onBlur?.(o);
|
|
97
|
+
},
|
|
98
|
+
onDragStart: (o) => {
|
|
99
|
+
if (i?.card?.onDragStart?.(o), o.defaultPrevented || s || a.draggable === !1) {
|
|
100
|
+
o.preventDefault();
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
v.current = a.id, o.dataTransfer.effectAllowed = "move", o.dataTransfer.setData("text/plain", String(a.id)), S.current?.remove();
|
|
104
|
+
const $ = o.currentTarget, A = $.getBoundingClientRect(), d = $.cloneNode(!0);
|
|
105
|
+
d.setAttribute("aria-hidden", "true"), d.removeAttribute("id"), d.querySelectorAll("[id]").forEach((O) => O.removeAttribute("id")), Object.assign(d.style, { position: "fixed", top: "0", left: "-10000px", margin: "0", width: `${A.width}px` }), $.ownerDocument.body.appendChild(d), S.current = d, o.dataTransfer.setDragImage(d, o.clientX - A.left, o.clientY - A.top), N({ itemId: a.id, keyboard: !1, target: { resourceId: f, day: l } });
|
|
106
|
+
},
|
|
107
|
+
onDragEnd: (o) => {
|
|
108
|
+
S.current?.remove(), S.current = null, v.current = null, N(null), i?.card?.onDragEnd?.(o);
|
|
109
|
+
},
|
|
110
|
+
onKeyDown: (o) => {
|
|
111
|
+
i?.card?.onKeyDown?.(o), o.defaultPrevented || J(o, a);
|
|
112
|
+
},
|
|
113
|
+
children: a.content
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}, Te = ({
|
|
117
|
+
resource: a,
|
|
118
|
+
today: m,
|
|
119
|
+
renderCellButton: g,
|
|
120
|
+
showCellButton: f,
|
|
121
|
+
day: l,
|
|
122
|
+
cellItems: y,
|
|
123
|
+
dayColumnWidth: T,
|
|
124
|
+
rowMinHeight: i,
|
|
125
|
+
cardWidth: b,
|
|
126
|
+
stackOffset: s,
|
|
127
|
+
slotProps: D,
|
|
128
|
+
interaction: h
|
|
129
|
+
}) => {
|
|
130
|
+
const { disabled: v, activeMove: w, draggedItemRef: N, items: J, setActiveMove: X, handleMove: H } = h, u = a.id, { ref: S, isDropTarget: L } = De({
|
|
131
|
+
id: JSON.stringify([typeof u, u, l]),
|
|
132
|
+
data: { resourceId: u, day: l },
|
|
133
|
+
disabled: v,
|
|
134
|
+
accept: (d) => d.data.resourceId === u
|
|
135
|
+
}), o = { resource: a, date: l, items: y }, $ = !v && g && (typeof f == "function" ? f(o) : f) ? g(o) : null, A = !v && (L || !w?.touch && w?.target.resourceId === u && w.target.day === l);
|
|
136
|
+
return /* @__PURE__ */ K(
|
|
137
|
+
"div",
|
|
138
|
+
{
|
|
139
|
+
...D?.cell,
|
|
140
|
+
ref: S,
|
|
141
|
+
role: "cell",
|
|
142
|
+
"data-resource-id": u,
|
|
143
|
+
"data-date": l,
|
|
144
|
+
"data-today": l === m || void 0,
|
|
145
|
+
"data-drop-target": A || void 0,
|
|
146
|
+
className: B(
|
|
147
|
+
"mtx-group/cell mtx-relative mtx-isolate mtx-flex-1 mtx-border-b mtx-border-r mtx-border-gray-200 mtx-p-1.5",
|
|
148
|
+
l === m && "mtx-bg-gray-50",
|
|
149
|
+
A && "mtx-bg-primary-50 mtx-ring-2 mtx-ring-inset mtx-ring-primary-300",
|
|
150
|
+
D?.cell?.className
|
|
151
|
+
),
|
|
152
|
+
style: { minWidth: T, minHeight: i, ...D?.cell?.style },
|
|
153
|
+
onDragOver: (d) => {
|
|
154
|
+
D?.cell?.onDragOver?.(d), !(d.defaultPrevented || v || N.current === null || J.find((O) => O.id === N.current)?.resourceId !== u) && (d.preventDefault(), d.dataTransfer.dropEffect = "move", X({ itemId: N.current, keyboard: !1, target: { resourceId: u, day: l } }));
|
|
155
|
+
},
|
|
156
|
+
onDrop: (d) => {
|
|
157
|
+
D?.cell?.onDrop?.(d), !(d.defaultPrevented || v || N.current === null) && (d.preventDefault(), H(N.current, { resourceId: u, day: l }));
|
|
158
|
+
},
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ p("div", { className: "mtx-overflow-x-auto", children: /* @__PURE__ */ p(
|
|
161
|
+
"div",
|
|
162
|
+
{
|
|
163
|
+
className: "mtx-grid mtx-items-start",
|
|
164
|
+
style: {
|
|
165
|
+
gridTemplateColumns: "minmax(0, 1fr)",
|
|
166
|
+
minWidth: y.length ? b + (y.length - 1) * s : void 0
|
|
167
|
+
},
|
|
168
|
+
children: y.map((d, O) => /* @__PURE__ */ p(
|
|
169
|
+
ke,
|
|
170
|
+
{
|
|
171
|
+
item: d,
|
|
172
|
+
index: O,
|
|
173
|
+
count: y.length,
|
|
174
|
+
resourceId: u,
|
|
175
|
+
day: l,
|
|
176
|
+
cardWidth: b,
|
|
177
|
+
stackOffset: s,
|
|
178
|
+
slotProps: D,
|
|
179
|
+
interaction: h
|
|
180
|
+
},
|
|
181
|
+
`${typeof d.id}:${d.id}`
|
|
182
|
+
))
|
|
183
|
+
}
|
|
184
|
+
) }),
|
|
185
|
+
$ != null && /* @__PURE__ */ p("div", { className: "mtx-pointer-events-none mtx-absolute mtx-bottom-1.5 mtx-right-1.5 mtx-z-10 mtx-opacity-0 group-hover/cell:mtx-pointer-events-auto group-hover/cell:mtx-opacity-100 group-focus-within/cell:mtx-pointer-events-auto group-focus-within/cell:mtx-opacity-100 [@media(hover:none)]:mtx-pointer-events-auto [@media(hover:none)]:mtx-opacity-100", children: $ })
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
}, Ne = ({
|
|
190
|
+
today: a,
|
|
191
|
+
renderCellButton: m,
|
|
192
|
+
showCellButton: g,
|
|
193
|
+
resource: f,
|
|
194
|
+
dayKeys: l,
|
|
195
|
+
groupedItems: y,
|
|
196
|
+
resourceColumnWidth: T,
|
|
197
|
+
dayColumnWidth: i,
|
|
198
|
+
rowMinHeight: b,
|
|
199
|
+
cardWidth: s,
|
|
200
|
+
stackOffset: D,
|
|
201
|
+
slotProps: h,
|
|
202
|
+
interaction: v
|
|
203
|
+
}) => /* @__PURE__ */ K("div", { role: "row", className: "mtx-flex", children: [
|
|
204
|
+
/* @__PURE__ */ p(
|
|
205
|
+
"div",
|
|
206
|
+
{
|
|
207
|
+
...h?.resource,
|
|
208
|
+
role: "rowheader",
|
|
209
|
+
className: B(
|
|
210
|
+
"mtx-sticky mtx-left-0 mtx-z-20 mtx-flex mtx-shrink-0 mtx-items-center mtx-border-b mtx-border-r mtx-border-gray-200 mtx-bg-gray-0 mtx-px-4 mtx-font-semibold",
|
|
211
|
+
h?.resource?.className
|
|
212
|
+
),
|
|
213
|
+
style: { width: T, ...h?.resource?.style },
|
|
214
|
+
children: f.label
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
l.map((w) => /* @__PURE__ */ p(
|
|
218
|
+
Te,
|
|
219
|
+
{
|
|
220
|
+
resource: f,
|
|
221
|
+
today: a,
|
|
222
|
+
renderCellButton: m,
|
|
223
|
+
showCellButton: g,
|
|
224
|
+
day: w,
|
|
225
|
+
cellItems: y.get(f.id)?.get(w) ?? [],
|
|
226
|
+
dayColumnWidth: i,
|
|
227
|
+
rowMinHeight: b,
|
|
228
|
+
cardWidth: s,
|
|
229
|
+
stackOffset: D,
|
|
230
|
+
slotProps: h,
|
|
231
|
+
interaction: v
|
|
232
|
+
},
|
|
233
|
+
w
|
|
234
|
+
))
|
|
235
|
+
] }), Q = (a) => {
|
|
236
|
+
if (a instanceof Date || /^\d{4}-\d{2}-\d{2}$/.test(a)) return Y(a);
|
|
237
|
+
if (!/^\d{4}-\d{2}-\d{2}T/.test(a) || !Y(a.slice(0, 10))) return;
|
|
238
|
+
const m = new Date(a);
|
|
239
|
+
return Number.isNaN(m.getTime()) ? void 0 : m;
|
|
240
|
+
}, R = (a) => G(Q(a)), Se = xe(
|
|
241
|
+
({
|
|
242
|
+
resources: a,
|
|
243
|
+
from: m,
|
|
244
|
+
to: g,
|
|
245
|
+
items: f,
|
|
246
|
+
defaultItems: l = [],
|
|
247
|
+
onItemsChange: y,
|
|
248
|
+
onItemDrop: T,
|
|
249
|
+
disabled: i = !1,
|
|
250
|
+
resourceColumnWidth: b = 164,
|
|
251
|
+
dayColumnWidth: s = 268,
|
|
252
|
+
rowMinHeight: D = 124,
|
|
253
|
+
cardWidth: h = 192,
|
|
254
|
+
stackOffset: v = 32,
|
|
255
|
+
locale: w = "en-US",
|
|
256
|
+
formatter: N,
|
|
257
|
+
resourceHeading: J = "Resource",
|
|
258
|
+
renderCellButton: X,
|
|
259
|
+
showCellButton: H = !0,
|
|
260
|
+
slotProps: u,
|
|
261
|
+
className: S,
|
|
262
|
+
style: L,
|
|
263
|
+
...o
|
|
264
|
+
}, $) => {
|
|
265
|
+
const [A, d] = q(() => G(/* @__PURE__ */ new Date()));
|
|
266
|
+
ee(() => {
|
|
267
|
+
let e;
|
|
268
|
+
const t = () => {
|
|
269
|
+
const r = /* @__PURE__ */ new Date();
|
|
270
|
+
d(G(r));
|
|
271
|
+
const n = new Date(r);
|
|
272
|
+
n.setHours(24, 0, 0, 0), e = setTimeout(t, n.getTime() - r.getTime());
|
|
273
|
+
};
|
|
274
|
+
return t(), () => clearTimeout(e);
|
|
275
|
+
}, []);
|
|
276
|
+
const [O, se] = q(l), I = f ?? O, [M, U] = q(null), [le, F] = q(""), te = Z(null), V = Z(/* @__PURE__ */ new Map()), _ = Z(null), [C, ue] = q([]);
|
|
277
|
+
ee(() => {
|
|
278
|
+
const e = _.current;
|
|
279
|
+
if (!e) return;
|
|
280
|
+
const t = I.find((r) => r.id === e.itemId);
|
|
281
|
+
t && t.resourceId === e.target.resourceId && R(t.date) === e.target.day && (V.current.get(t.id)?.focus(), _.current = null);
|
|
282
|
+
}, [I, C]);
|
|
283
|
+
const re = pe(), ae = R(m), oe = R(g), W = ce(() => {
|
|
284
|
+
const e = Y(ae), t = Y(oe);
|
|
285
|
+
if (!e || !t || e > t) return [];
|
|
286
|
+
const r = [];
|
|
287
|
+
for (const n = new Date(e); n <= t; n.setDate(n.getDate() + 1)) r.push(new Date(n));
|
|
288
|
+
return r;
|
|
289
|
+
}, [ae, oe]), j = W.map((e) => G(e)), me = N ?? new Intl.DateTimeFormat(w, { weekday: "short", month: "short", day: "numeric" }).format, ne = ce(() => {
|
|
290
|
+
const e = /* @__PURE__ */ new Map();
|
|
291
|
+
for (const r of I) {
|
|
292
|
+
const n = R(r.date);
|
|
293
|
+
if (!n) continue;
|
|
294
|
+
let c = e.get(r.resourceId);
|
|
295
|
+
c || (c = /* @__PURE__ */ new Map(), e.set(r.resourceId, c));
|
|
296
|
+
const x = c.get(n) ?? [];
|
|
297
|
+
x.push(r), c.set(n, x);
|
|
298
|
+
}
|
|
299
|
+
const t = new Map(
|
|
300
|
+
C.map((r, n) => {
|
|
301
|
+
const c = I.find((k) => k.id === r.itemId), x = c?.resourceId === r.target.resourceId && R(c.date) === r.target.day;
|
|
302
|
+
return [r.itemId, x ? n + 1 : 0];
|
|
303
|
+
})
|
|
304
|
+
);
|
|
305
|
+
for (const r of e.values())
|
|
306
|
+
for (const n of r.values())
|
|
307
|
+
n.sort(
|
|
308
|
+
(c, x) => Q(c.date).getTime() - Q(x.date).getTime() || (t.get(c.id) ?? 0) - (t.get(x.id) ?? 0)
|
|
309
|
+
);
|
|
310
|
+
return e;
|
|
311
|
+
}, [I, C]), P = (e, t) => {
|
|
312
|
+
const r = I.find((E) => E.id === e);
|
|
313
|
+
if (U(null), te.current = null, i || !r || r.draggable === !1 || !a.some((E) => E.id === t.resourceId) || !j.includes(t.day) || r.resourceId !== t.resourceId || !T && R(r.date) === t.day) return;
|
|
314
|
+
const n = Q(r.date);
|
|
315
|
+
if (!n) return;
|
|
316
|
+
const c = Y(t.day);
|
|
317
|
+
c.setHours(n.getHours(), n.getMinutes(), n.getSeconds(), n.getMilliseconds());
|
|
318
|
+
let x = c;
|
|
319
|
+
typeof r.date == "string" && (r.date.includes("T") ? /(?:Z|[+-]\d{2}:?\d{2})$/i.test(r.date) ? x = c.toISOString() : x = t.day + r.date.slice(10) : x = t.day);
|
|
320
|
+
const k = { ...r, resourceId: t.resourceId, date: x };
|
|
321
|
+
if (M?.keyboard && (_.current = { itemId: e, target: t }), ue((E) => [...E.filter((de) => de.itemId !== e && I.some((ge) => ge.id === de.itemId)), { itemId: e, target: t }]), T) {
|
|
322
|
+
T({ previousItem: r, item: k }), F(`Move requested for ${k.label ?? k.id} to ${t.day}.`);
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
const z = I.map((E) => E.id === e ? k : E);
|
|
326
|
+
f === void 0 && se(z), y?.(z, { previousItem: r, item: k }), F(`Move requested for ${k.label ?? k.id} to ${t.day}, resource ${t.resourceId}.`);
|
|
327
|
+
}, fe = {
|
|
328
|
+
items: I,
|
|
329
|
+
disabled: i,
|
|
330
|
+
instructionsId: re,
|
|
331
|
+
activeMove: M,
|
|
332
|
+
draggedItemRef: te,
|
|
333
|
+
cardRefs: V,
|
|
334
|
+
setActiveMove: U,
|
|
335
|
+
handleMove: P,
|
|
336
|
+
handleKeyDown: (e, t) => {
|
|
337
|
+
if (!(e.target !== e.currentTarget || i || t.draggable === !1)) {
|
|
338
|
+
if (!M) {
|
|
339
|
+
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
340
|
+
const c = (ne.get(t.resourceId)?.get(R(t.date)) ?? []).filter((z) => z.draggable !== !1), x = c.findIndex((z) => z.id === t.id), k = c[(x + (e.key === "ArrowDown" ? 1 : -1) + c.length) % c.length];
|
|
341
|
+
k && (e.preventDefault(), V.current.get(k.id)?.focus());
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
if (e.key !== " " && e.key !== "Enter") return;
|
|
345
|
+
e.preventDefault();
|
|
346
|
+
const r = R(t.date);
|
|
347
|
+
U({ itemId: t.id, keyboard: !0, target: { resourceId: t.resourceId, day: r } }), F(`Picked up ${t.label ?? t.id}. Use arrow keys to choose a cell, Enter to drop, Escape to cancel.`);
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
if (!(!M.keyboard || M.itemId !== t.id)) {
|
|
351
|
+
if (e.key === "Escape")
|
|
352
|
+
e.preventDefault(), U(null), F("Move cancelled.");
|
|
353
|
+
else if (e.key === "Enter" || e.key === " ")
|
|
354
|
+
e.preventDefault(), P(t.id, M.target);
|
|
355
|
+
else if (["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(e.key)) {
|
|
356
|
+
e.preventDefault();
|
|
357
|
+
const r = j.indexOf(M.target.day), n = Math.max(0, Math.min(j.length - 1, r + (e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0))), c = { resourceId: t.resourceId, day: j[n] };
|
|
358
|
+
U({ ...M, target: c }), F(`Target ${c.day}, resource ${c.resourceId}.`);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
return /* @__PURE__ */ K(
|
|
365
|
+
he,
|
|
366
|
+
{
|
|
367
|
+
sensors: we,
|
|
368
|
+
onBeforeDragStart: (e) => {
|
|
369
|
+
const t = e.operation.source, r = I.find((n) => n.id === t?.id);
|
|
370
|
+
(i || M || !r || r.draggable === !1) && e.preventDefault();
|
|
371
|
+
},
|
|
372
|
+
onDragStart: (e) => {
|
|
373
|
+
const t = e.operation.source, r = I.find((n) => n.id === t?.id);
|
|
374
|
+
r && (U({ itemId: r.id, keyboard: !1, touch: !0, target: { resourceId: r.resourceId, day: R(r.date) } }), F(`Picked up ${r.label ?? r.id}. Drag to another day and release to drop.`));
|
|
375
|
+
},
|
|
376
|
+
onDragEnd: (e) => {
|
|
377
|
+
const { source: t, target: r } = e.operation;
|
|
378
|
+
if (U(null), e.canceled || !t || !r) {
|
|
379
|
+
F("Move cancelled.");
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
P(t.id, r.data);
|
|
383
|
+
},
|
|
384
|
+
children: [
|
|
385
|
+
/* @__PURE__ */ K(
|
|
386
|
+
"div",
|
|
387
|
+
{
|
|
388
|
+
...o,
|
|
389
|
+
ref: $,
|
|
390
|
+
className: B("mtx-relative mtx-overflow-auto mtx-border mtx-border-gray-200 mtx-bg-gray-0 mtx-text-sm mtx-text-text-500", S),
|
|
391
|
+
style: L,
|
|
392
|
+
children: [
|
|
393
|
+
/* @__PURE__ */ p("p", { id: re, className: "mtx-sr-only", children: "On touch devices, press and hold a card, then drag to another day and release. Use Tab or Up/Down to select a card. Press Space or Enter to pick it up, Left/Right to move, Enter to drop, or Escape to cancel." }),
|
|
394
|
+
/* @__PURE__ */ p("div", { "aria-live": "polite", className: "mtx-sr-only", children: le }),
|
|
395
|
+
/* @__PURE__ */ K("div", { role: "table", "aria-label": "Resource scheduler", style: { minWidth: b + s * W.length }, children: [
|
|
396
|
+
/* @__PURE__ */ p(
|
|
397
|
+
Ie,
|
|
398
|
+
{
|
|
399
|
+
today: A,
|
|
400
|
+
days: W,
|
|
401
|
+
dayKeys: j,
|
|
402
|
+
formatter: me,
|
|
403
|
+
resourceHeading: J,
|
|
404
|
+
resourceColumnWidth: b,
|
|
405
|
+
dayColumnWidth: s,
|
|
406
|
+
slotProps: u
|
|
407
|
+
}
|
|
408
|
+
),
|
|
409
|
+
a.map((e) => /* @__PURE__ */ p(
|
|
410
|
+
Ne,
|
|
411
|
+
{
|
|
412
|
+
today: A,
|
|
413
|
+
renderCellButton: X,
|
|
414
|
+
showCellButton: H,
|
|
415
|
+
resource: e,
|
|
416
|
+
dayKeys: j,
|
|
417
|
+
groupedItems: ne,
|
|
418
|
+
resourceColumnWidth: b,
|
|
419
|
+
dayColumnWidth: s,
|
|
420
|
+
rowMinHeight: D,
|
|
421
|
+
cardWidth: h,
|
|
422
|
+
stackOffset: v,
|
|
423
|
+
slotProps: u,
|
|
424
|
+
interaction: fe
|
|
425
|
+
},
|
|
426
|
+
`${typeof e.id}:${e.id}`
|
|
427
|
+
))
|
|
428
|
+
] })
|
|
429
|
+
]
|
|
430
|
+
}
|
|
431
|
+
),
|
|
432
|
+
/* @__PURE__ */ p(be, { dropAnimation: null, children: (e) => /* @__PURE__ */ p(
|
|
433
|
+
"div",
|
|
434
|
+
{
|
|
435
|
+
"aria-hidden": "true",
|
|
436
|
+
className: B("mtx-pointer-events-none mtx-text-sm mtx-text-text-500", u?.card?.className),
|
|
437
|
+
style: { width: h, ...u?.card?.style, margin: 0 },
|
|
438
|
+
children: I.find((t) => t.id === e.id)?.content
|
|
439
|
+
}
|
|
440
|
+
) })
|
|
441
|
+
]
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
);
|
|
446
|
+
Se.displayName = "ResourceScheduler";
|
|
447
|
+
export {
|
|
448
|
+
Se as ResourceScheduler
|
|
449
|
+
};
|
|
450
|
+
//# sourceMappingURL=resourcescheduler.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourcescheduler.es.js","sources":["../src/components/resource-scheduler/ResourceScheduler.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { forwardRef, useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport { DragDropProvider, DragOverlay, PointerSensor, useDraggable, useDroppable } from \"@dnd-kit/react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { toCalendarDate, toDateOnlyString, type DateValue } from \"../date-picker/dateValue\";\n\ntype ResourceSchedulerResource = {\n id: string | number;\n label: React.ReactNode;\n};\n\ntype ResourceSchedulerItem = {\n id: string | number;\n resourceId: ResourceSchedulerResource[\"id\"];\n /** Date, YYYY-MM-DD, or ISO date-time string. Items use the local calendar day and retain their time when moved. */\n date: DateValue;\n /** Arbitrary card content; the calendar does not style the card itself. */\n content: React.ReactNode;\n /** Accessible name for moving this card. Defaults to its id. */\n label?: string;\n draggable?: boolean;\n};\n\ntype ResourceSchedulerMove = {\n previousItem: ResourceSchedulerItem;\n item: ResourceSchedulerItem;\n};\n\ntype ResourceSchedulerCellContext = {\n resource: ResourceSchedulerResource;\n /** Local calendar date in YYYY-MM-DD format. */\n date: string;\n items: readonly ResourceSchedulerItem[];\n};\n\ntype ResourceSchedulerProps = Omit<React.ComponentPropsWithoutRef<\"div\">, \"children\" | \"defaultValue\"> & {\n resources: readonly ResourceSchedulerResource[];\n /** Inclusive local-calendar boundaries, accepting Date, YYYY-MM-DD, or ISO date-time strings. */\n from: DateValue;\n to: DateValue;\n /** Controlled items; update this prop in onItemsChange to accept a move. */\n items?: readonly ResourceSchedulerItem[];\n defaultItems?: readonly ResourceSchedulerItem[];\n onItemsChange?: (items: ResourceSchedulerItem[], move: ResourceSchedulerMove) => void;\n /** Overrides automatic day moves. Choose the time and update controlled items in this callback. */\n onItemDrop?: (move: ResourceSchedulerMove) => void;\n disabled?: boolean;\n resourceColumnWidth?: number;\n dayColumnWidth?: number;\n rowMinHeight?: number;\n cardWidth?: number;\n /** Horizontal distance between overlapping cards in the same day cell. */\n stackOffset?: number;\n locale?: string;\n /** Render a day heading. Defaults to the locale's short weekday, month and day. */\n formatter?: (date: Date) => React.ReactNode;\n resourceHeading?: React.ReactNode;\n /** Custom action shown at the bottom right on cell hover or keyboard focus. Return null to omit it. */\n renderCellButton?: (cell: ResourceSchedulerCellContext) => React.ReactNode;\n /** Enable the custom action globally or for selected cells. Defaults to true; disabled schedulers hide it. */\n showCellButton?: boolean | ((cell: ResourceSchedulerCellContext) => boolean);\n slotProps?: {\n resource?: React.ComponentPropsWithoutRef<\"div\">;\n day?: React.ComponentPropsWithoutRef<\"div\">;\n cell?: React.ComponentPropsWithoutRef<\"div\">;\n card?: React.ComponentPropsWithoutRef<\"div\">;\n };\n};\n\ntype ItemId = ResourceSchedulerItem[\"id\"];\ntype MoveTarget = { resourceId: ResourceSchedulerResource[\"id\"]; day: string };\ntype ActiveMove = { itemId: ItemId; keyboard: boolean; touch?: boolean; target: MoveTarget };\n\n// Native dragging handles desktop input; dnd-kit supplies long-press touch dragging.\n// Its default touch activation waits 250 ms and cancels after 5 px of movement.\nconst touchSensors = [\n PointerSensor.configure({\n preventActivation: (event, source) => event.pointerType !== \"touch\" || !!PointerSensor.defaults.preventActivation?.(event, source),\n }),\n];\n\ntype ResourceSchedulerInteraction = {\n items: readonly ResourceSchedulerItem[];\n disabled: boolean;\n instructionsId: string;\n activeMove: ActiveMove | null;\n draggedItemRef: React.MutableRefObject<ItemId | null>;\n cardRefs: React.MutableRefObject<Map<ItemId, HTMLDivElement>>;\n setActiveMove: React.Dispatch<React.SetStateAction<ActiveMove | null>>;\n handleMove: (itemId: ItemId, target: MoveTarget) => void;\n handleKeyDown: (event: React.KeyboardEvent<HTMLDivElement>, item: ResourceSchedulerItem) => void;\n};\n\ntype ResourceSchedulerHeaderProps = {\n today: string;\n days: readonly Date[];\n dayKeys: readonly string[];\n formatter: NonNullable<ResourceSchedulerProps[\"formatter\"]>;\n resourceHeading: React.ReactNode;\n resourceColumnWidth: number;\n dayColumnWidth: number;\n slotProps: ResourceSchedulerProps[\"slotProps\"];\n};\n\nconst ResourceSchedulerHeader = ({\n today,\n days,\n dayKeys,\n formatter,\n resourceHeading,\n resourceColumnWidth,\n dayColumnWidth,\n slotProps,\n}: ResourceSchedulerHeaderProps) => (\n <div role=\"row\" className=\"mtx-flex\">\n <div\n role=\"columnheader\"\n className=\"mtx-sticky mtx-left-0 mtx-z-20 mtx-flex mtx-shrink-0 mtx-items-center mtx-border-b mtx-border-r mtx-border-gray-200 mtx-bg-gray-0 mtx-px-4 mtx-py-2\"\n style={{ width: resourceColumnWidth }}\n >\n {resourceHeading}\n </div>\n {days.map((day, index) => (\n <div\n {...slotProps?.day}\n key={dayKeys[index]}\n role=\"columnheader\"\n data-date={dayKeys[index]}\n data-today={dayKeys[index] === today || undefined}\n aria-current={dayKeys[index] === today ? \"date\" : undefined}\n className={cn(\n \"mtx-flex mtx-flex-1 mtx-items-center mtx-justify-center mtx-border-b mtx-border-r mtx-border-gray-200 mtx-px-2 mtx-py-2\",\n dayKeys[index] === today && \"mtx-bg-primary-50\",\n slotProps?.day?.className,\n )}\n style={{ minWidth: dayColumnWidth, ...slotProps?.day?.style }}\n >\n {formatter(day)}\n </div>\n ))}\n </div>\n);\n\ntype ResourceSchedulerCardProps = {\n item: ResourceSchedulerItem;\n index: number;\n count: number;\n resourceId: ResourceSchedulerResource[\"id\"];\n day: string;\n cardWidth: number;\n stackOffset: number;\n slotProps: ResourceSchedulerProps[\"slotProps\"];\n interaction: ResourceSchedulerInteraction;\n};\n\nconst ResourceSchedulerCard = ({\n item,\n index,\n count,\n resourceId,\n day,\n cardWidth,\n stackOffset,\n slotProps,\n interaction,\n}: ResourceSchedulerCardProps) => {\n const { disabled, instructionsId, activeMove, draggedItemRef, cardRefs, setActiveMove, handleKeyDown } = interaction;\n const [focused, setFocused] = useState(false);\n const { ref: draggableRef } = useDraggable({\n id: item.id,\n disabled: disabled || item.draggable === false || !!activeMove?.keyboard,\n data: { resourceId, day },\n });\n const dragImageRef = useRef<HTMLDivElement | null>(null);\n useEffect(() => () => dragImageRef.current?.remove(), []);\n const isMoving = activeMove?.itemId === item.id;\n return (\n <div\n {...slotProps?.card}\n ref={node => {\n draggableRef(node);\n if (node) cardRefs.current.set(item.id, node);\n else cardRefs.current.delete(item.id);\n }}\n data-item-id={item.id}\n data-moving={isMoving || undefined}\n role=\"group\"\n aria-label={item.label ?? String(item.id)}\n aria-describedby={instructionsId}\n tabIndex={disabled || item.draggable === false ? undefined : 0}\n draggable={!disabled && item.draggable !== false}\n className={cn(\n \"mtx-relative focus-visible:mtx-outline-none focus-visible:mtx-ring-2 focus-visible:mtx-ring-primary-300\",\n !disabled && item.draggable !== false && \"mtx-cursor-grab active:mtx-cursor-grabbing\",\n slotProps?.card?.className,\n )}\n style={{\n gridArea: \"1 / 1\",\n marginLeft: index * stackOffset,\n width: cardWidth,\n touchAction: \"manipulation\",\n ...slotProps?.card?.style,\n zIndex: focused || isMoving ? count : index,\n }}\n onFocus={event => {\n setFocused(true);\n slotProps?.card?.onFocus?.(event);\n }}\n onBlur={event => {\n if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);\n slotProps?.card?.onBlur?.(event);\n }}\n onDragStart={event => {\n slotProps?.card?.onDragStart?.(event);\n if (event.defaultPrevented || disabled || item.draggable === false) {\n event.preventDefault();\n return;\n }\n draggedItemRef.current = item.id;\n event.dataTransfer.effectAllowed = \"move\";\n event.dataTransfer.setData(\"text/plain\", String(item.id));\n // Isolate the preview from overlapping siblings in the browser's drag snapshot.\n dragImageRef.current?.remove();\n const card = event.currentTarget;\n const bounds = card.getBoundingClientRect();\n const preview = card.cloneNode(true) as HTMLDivElement;\n preview.setAttribute(\"aria-hidden\", \"true\");\n preview.removeAttribute(\"id\");\n preview.querySelectorAll(\"[id]\").forEach(node => node.removeAttribute(\"id\"));\n Object.assign(preview.style, { position: \"fixed\", top: \"0\", left: \"-10000px\", margin: \"0\", width: `${bounds.width}px` });\n card.ownerDocument.body.appendChild(preview);\n dragImageRef.current = preview;\n event.dataTransfer.setDragImage(preview, event.clientX - bounds.left, event.clientY - bounds.top);\n setActiveMove({ itemId: item.id, keyboard: false, target: { resourceId, day } });\n }}\n onDragEnd={event => {\n dragImageRef.current?.remove();\n dragImageRef.current = null;\n draggedItemRef.current = null;\n setActiveMove(null);\n slotProps?.card?.onDragEnd?.(event);\n }}\n onKeyDown={event => {\n slotProps?.card?.onKeyDown?.(event);\n if (!event.defaultPrevented) handleKeyDown(event, item);\n }}\n >\n {item.content}\n </div>\n );\n};\n\ntype ResourceSchedulerCellProps = {\n resource: ResourceSchedulerResource;\n today: string;\n renderCellButton: ResourceSchedulerProps[\"renderCellButton\"];\n showCellButton: ResourceSchedulerProps[\"showCellButton\"];\n day: string;\n cellItems: readonly ResourceSchedulerItem[];\n dayColumnWidth: number;\n rowMinHeight: number;\n cardWidth: number;\n stackOffset: number;\n slotProps: ResourceSchedulerProps[\"slotProps\"];\n interaction: ResourceSchedulerInteraction;\n};\n\nconst ResourceSchedulerCell = ({\n resource,\n today,\n renderCellButton,\n showCellButton,\n day,\n cellItems,\n dayColumnWidth,\n rowMinHeight,\n cardWidth,\n stackOffset,\n slotProps,\n interaction,\n}: ResourceSchedulerCellProps) => {\n const { disabled, activeMove, draggedItemRef, items, setActiveMove, handleMove } = interaction;\n const resourceId = resource.id;\n const { ref: droppableRef, isDropTarget } = useDroppable({\n id: JSON.stringify([typeof resourceId, resourceId, day]),\n data: { resourceId, day },\n disabled,\n accept: source => source.data.resourceId === resourceId,\n });\n const cell = { resource, date: day, items: cellItems };\n const button =\n !disabled && renderCellButton && (typeof showCellButton === \"function\" ? showCellButton(cell) : showCellButton) ? renderCellButton(cell) : null;\n const isTarget =\n !disabled && (isDropTarget || (!activeMove?.touch && activeMove?.target.resourceId === resourceId && activeMove.target.day === day));\n return (\n <div\n {...slotProps?.cell}\n ref={droppableRef}\n role=\"cell\"\n data-resource-id={resourceId}\n data-date={day}\n data-today={day === today || undefined}\n data-drop-target={isTarget || undefined}\n className={cn(\n \"mtx-group/cell mtx-relative mtx-isolate mtx-flex-1 mtx-border-b mtx-border-r mtx-border-gray-200 mtx-p-1.5\",\n day === today && \"mtx-bg-gray-50\",\n isTarget && \"mtx-bg-primary-50 mtx-ring-2 mtx-ring-inset mtx-ring-primary-300\",\n slotProps?.cell?.className,\n )}\n style={{ minWidth: dayColumnWidth, minHeight: rowMinHeight, ...slotProps?.cell?.style }}\n onDragOver={event => {\n slotProps?.cell?.onDragOver?.(event);\n if (\n event.defaultPrevented ||\n disabled ||\n draggedItemRef.current === null ||\n items.find(item => item.id === draggedItemRef.current)?.resourceId !== resourceId\n )\n return;\n event.preventDefault();\n event.dataTransfer.dropEffect = \"move\";\n setActiveMove({ itemId: draggedItemRef.current, keyboard: false, target: { resourceId, day } });\n }}\n onDrop={event => {\n slotProps?.cell?.onDrop?.(event);\n if (event.defaultPrevented || disabled || draggedItemRef.current === null) return;\n event.preventDefault();\n handleMove(draggedItemRef.current, { resourceId, day });\n }}\n >\n <div className=\"mtx-overflow-x-auto\">\n <div\n className=\"mtx-grid mtx-items-start\"\n style={{\n gridTemplateColumns: \"minmax(0, 1fr)\",\n minWidth: cellItems.length ? cardWidth + (cellItems.length - 1) * stackOffset : undefined,\n }}\n >\n {cellItems.map((item, index) => (\n <ResourceSchedulerCard\n key={`${typeof item.id}:${item.id}`}\n item={item}\n index={index}\n count={cellItems.length}\n resourceId={resourceId}\n day={day}\n cardWidth={cardWidth}\n stackOffset={stackOffset}\n slotProps={slotProps}\n interaction={interaction}\n />\n ))}\n </div>\n </div>\n {button != null && (\n <div className=\"mtx-pointer-events-none mtx-absolute mtx-bottom-1.5 mtx-right-1.5 mtx-z-10 mtx-opacity-0 group-hover/cell:mtx-pointer-events-auto group-hover/cell:mtx-opacity-100 group-focus-within/cell:mtx-pointer-events-auto group-focus-within/cell:mtx-opacity-100 [@media(hover:none)]:mtx-pointer-events-auto [@media(hover:none)]:mtx-opacity-100\">\n {button}\n </div>\n )}\n </div>\n );\n};\n\ntype ResourceSchedulerRowProps = {\n today: string;\n renderCellButton: ResourceSchedulerProps[\"renderCellButton\"];\n showCellButton: ResourceSchedulerProps[\"showCellButton\"];\n resource: ResourceSchedulerResource;\n dayKeys: readonly string[];\n groupedItems: Map<ResourceSchedulerResource[\"id\"], Map<string, ResourceSchedulerItem[]>>;\n resourceColumnWidth: number;\n dayColumnWidth: number;\n rowMinHeight: number;\n cardWidth: number;\n stackOffset: number;\n slotProps: ResourceSchedulerProps[\"slotProps\"];\n interaction: ResourceSchedulerInteraction;\n};\n\nconst ResourceSchedulerRow = ({\n today,\n renderCellButton,\n showCellButton,\n resource,\n dayKeys,\n groupedItems,\n resourceColumnWidth,\n dayColumnWidth,\n rowMinHeight,\n cardWidth,\n stackOffset,\n slotProps,\n interaction,\n}: ResourceSchedulerRowProps) => (\n <div role=\"row\" className=\"mtx-flex\">\n <div\n {...slotProps?.resource}\n role=\"rowheader\"\n className={cn(\n \"mtx-sticky mtx-left-0 mtx-z-20 mtx-flex mtx-shrink-0 mtx-items-center mtx-border-b mtx-border-r mtx-border-gray-200 mtx-bg-gray-0 mtx-px-4 mtx-font-semibold\",\n slotProps?.resource?.className,\n )}\n style={{ width: resourceColumnWidth, ...slotProps?.resource?.style }}\n >\n {resource.label}\n </div>\n {dayKeys.map(day => (\n <ResourceSchedulerCell\n key={day}\n resource={resource}\n today={today}\n renderCellButton={renderCellButton}\n showCellButton={showCellButton}\n day={day}\n cellItems={groupedItems.get(resource.id)?.get(day) ?? []}\n dayColumnWidth={dayColumnWidth}\n rowMinHeight={rowMinHeight}\n cardWidth={cardWidth}\n stackOffset={stackOffset}\n slotProps={slotProps}\n interaction={interaction}\n />\n ))}\n </div>\n);\n\nconst toSchedulerDate = (value: DateValue): Date | undefined => {\n if (value instanceof Date || /^\\d{4}-\\d{2}-\\d{2}$/.test(value)) return toCalendarDate(value);\n if (!/^\\d{4}-\\d{2}-\\d{2}T/.test(value) || !toCalendarDate(value.slice(0, 10))) return undefined;\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? undefined : date;\n};\n\nconst getDay = (date: DateValue) => toDateOnlyString(toSchedulerDate(date));\n\n/** Resource-by-day calendar with consumer-rendered cards and controlled or local moves. */\nconst ResourceScheduler = forwardRef<HTMLDivElement, ResourceSchedulerProps>(\n (\n {\n resources,\n from,\n to,\n items: controlledItems,\n defaultItems = [],\n onItemsChange,\n onItemDrop,\n disabled = false,\n resourceColumnWidth = 164,\n dayColumnWidth = 268,\n rowMinHeight = 124,\n cardWidth = 192,\n stackOffset = 32,\n locale = \"en-US\",\n formatter: customFormatter,\n resourceHeading = \"Resource\",\n renderCellButton,\n showCellButton = true,\n slotProps,\n className,\n style,\n ...props\n },\n ref,\n ) => {\n const [today, setToday] = useState(() => toDateOnlyString(new Date())!);\n useEffect(() => {\n let timer: ReturnType<typeof setTimeout>;\n const updateToday = () => {\n const now = new Date();\n setToday(toDateOnlyString(now)!);\n const midnight = new Date(now);\n midnight.setHours(24, 0, 0, 0);\n timer = setTimeout(updateToday, midnight.getTime() - now.getTime());\n };\n updateToday();\n return () => clearTimeout(timer);\n }, []);\n const [localItems, setLocalItems] = useState(defaultItems);\n const items = controlledItems ?? localItems;\n const [activeMove, setActiveMove] = useState<ActiveMove | null>(null);\n const [announcement, setAnnouncement] = useState(\"\");\n const draggedItemRef = useRef<ItemId | null>(null);\n const cardRefs = useRef(new Map<ItemId, HTMLDivElement>());\n const pendingFocus = useRef<{ itemId: ItemId; target: MoveTarget } | null>(null);\n const [moveOrder, setMoveOrder] = useState<readonly { itemId: ItemId; target: MoveTarget }[]>([]);\n useEffect(() => {\n const pending = pendingFocus.current;\n if (!pending) return;\n const item = items.find(item => item.id === pending.itemId);\n if (item && item.resourceId === pending.target.resourceId && getDay(item.date) === pending.target.day) {\n cardRefs.current.get(item.id)?.focus();\n pendingFocus.current = null;\n }\n }, [items, moveOrder]);\n const instructionsId = useId();\n const fromDay = getDay(from);\n const toDay = getDay(to);\n const days = useMemo(() => {\n const start = toCalendarDate(fromDay);\n const end = toCalendarDate(toDay);\n if (!start || !end || start > end) return [];\n const result: Date[] = [];\n for (const day = new Date(start); day <= end; day.setDate(day.getDate() + 1)) result.push(new Date(day));\n return result;\n }, [fromDay, toDay]);\n const dayKeys = days.map(day => toDateOnlyString(day)!);\n const formatter = customFormatter ?? new Intl.DateTimeFormat(locale, { weekday: \"short\", month: \"short\", day: \"numeric\" }).format;\n const groupedItems = useMemo(() => {\n const grouped = new Map<ResourceSchedulerResource[\"id\"], Map<string, ResourceSchedulerItem[]>>();\n for (const item of items) {\n const day = getDay(item.date);\n if (!day) continue;\n let resource = grouped.get(item.resourceId);\n if (!resource) {\n resource = new Map();\n grouped.set(item.resourceId, resource);\n }\n const cell = resource.get(day) ?? [];\n cell.push(item);\n resource.set(day, cell);\n }\n const priorities = new Map(\n moveOrder.map((move, index) => {\n const item = items.find(item => item.id === move.itemId);\n const accepted = item?.resourceId === move.target.resourceId && getDay(item.date) === move.target.day;\n return [move.itemId, accepted ? index + 1 : 0] as const;\n }),\n );\n for (const resource of grouped.values()) {\n for (const cell of resource.values()) {\n // Earlier times stay underneath later times; the latest move wins equal-time ties.\n cell.sort(\n (a, b) =>\n toSchedulerDate(a.date)!.getTime() - toSchedulerDate(b.date)!.getTime() || (priorities.get(a.id) ?? 0) - (priorities.get(b.id) ?? 0),\n );\n }\n }\n return grouped;\n }, [items, moveOrder]);\n\n const handleMove = (itemId: ItemId, target: MoveTarget) => {\n const previousItem = items.find(item => item.id === itemId);\n setActiveMove(null);\n draggedItemRef.current = null;\n if (disabled || !previousItem || previousItem.draggable === false || !resources.some(resource => resource.id === target.resourceId)) return;\n if (!dayKeys.includes(target.day) || previousItem.resourceId !== target.resourceId) return;\n if (!onItemDrop && getDay(previousItem.date) === target.day) return;\n const original = toSchedulerDate(previousItem.date);\n if (!original) return;\n const date = toCalendarDate(target.day)!;\n date.setHours(original.getHours(), original.getMinutes(), original.getSeconds(), original.getMilliseconds());\n let nextDate: DateValue = date;\n if (typeof previousItem.date === \"string\") {\n if (!previousItem.date.includes(\"T\")) nextDate = target.day;\n else if (/(?:Z|[+-]\\d{2}:?\\d{2})$/i.test(previousItem.date)) nextDate = date.toISOString();\n else nextDate = target.day + previousItem.date.slice(10);\n }\n const item = { ...previousItem, resourceId: target.resourceId, date: nextDate };\n if (activeMove?.keyboard) pendingFocus.current = { itemId, target };\n setMoveOrder(current => [...current.filter(move => move.itemId !== itemId && items.some(item => item.id === move.itemId)), { itemId, target }]);\n if (onItemDrop) {\n onItemDrop({ previousItem, item });\n setAnnouncement(`Move requested for ${item.label ?? item.id} to ${target.day}.`);\n return;\n }\n const nextItems = items.map(current => (current.id === itemId ? item : current));\n if (controlledItems === undefined) setLocalItems(nextItems);\n onItemsChange?.(nextItems, { previousItem, item });\n setAnnouncement(`Move requested for ${item.label ?? item.id} to ${target.day}, resource ${target.resourceId}.`);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>, item: ResourceSchedulerItem) => {\n // Leave keyboard events from interactive card content to the consumer.\n if (event.target !== event.currentTarget || disabled || item.draggable === false) return;\n if (!activeMove) {\n if (event.key === \"ArrowUp\" || event.key === \"ArrowDown\") {\n const cell = groupedItems.get(item.resourceId)?.get(getDay(item.date)!) ?? [];\n const selectable = cell.filter(current => current.draggable !== false);\n const index = selectable.findIndex(current => current.id === item.id);\n const next = selectable[(index + (event.key === \"ArrowDown\" ? 1 : -1) + selectable.length) % selectable.length];\n if (next) {\n event.preventDefault();\n cardRefs.current.get(next.id)?.focus();\n }\n return;\n }\n if (event.key !== \" \" && event.key !== \"Enter\") return;\n event.preventDefault();\n const day = getDay(item.date)!;\n setActiveMove({ itemId: item.id, keyboard: true, target: { resourceId: item.resourceId, day } });\n setAnnouncement(`Picked up ${item.label ?? item.id}. Use arrow keys to choose a cell, Enter to drop, Escape to cancel.`);\n return;\n }\n if (!activeMove.keyboard || activeMove.itemId !== item.id) return;\n if (event.key === \"Escape\") {\n event.preventDefault();\n setActiveMove(null);\n setAnnouncement(\"Move cancelled.\");\n } else if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n handleMove(item.id, activeMove.target);\n } else if ([\"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\"].includes(event.key)) {\n event.preventDefault();\n const dayIndex = dayKeys.indexOf(activeMove.target.day);\n const nextDay = Math.max(0, Math.min(dayKeys.length - 1, dayIndex + (event.key === \"ArrowRight\" ? 1 : event.key === \"ArrowLeft\" ? -1 : 0)));\n const target = { resourceId: item.resourceId, day: dayKeys[nextDay] };\n setActiveMove({ ...activeMove, target });\n setAnnouncement(`Target ${target.day}, resource ${target.resourceId}.`);\n }\n };\n\n const interaction: ResourceSchedulerInteraction = {\n items,\n disabled,\n instructionsId,\n activeMove,\n draggedItemRef,\n cardRefs,\n setActiveMove,\n handleMove,\n handleKeyDown,\n };\n\n return (\n <DragDropProvider<MoveTarget>\n sensors={touchSensors}\n onBeforeDragStart={event => {\n const source = event.operation.source;\n const item = items.find(item => item.id === source?.id);\n if (disabled || activeMove || !item || item.draggable === false) event.preventDefault();\n }}\n onDragStart={event => {\n const source = event.operation.source;\n const item = items.find(item => item.id === source?.id);\n if (!item) return;\n setActiveMove({ itemId: item.id, keyboard: false, touch: true, target: { resourceId: item.resourceId, day: getDay(item.date)! } });\n setAnnouncement(`Picked up ${item.label ?? item.id}. Drag to another day and release to drop.`);\n }}\n onDragEnd={event => {\n const { source, target } = event.operation;\n setActiveMove(null);\n if (event.canceled || !source || !target) {\n setAnnouncement(\"Move cancelled.\");\n return;\n }\n handleMove(source.id, target.data);\n }}\n >\n <div\n {...props}\n ref={ref}\n className={cn(\"mtx-relative mtx-overflow-auto mtx-border mtx-border-gray-200 mtx-bg-gray-0 mtx-text-sm mtx-text-text-500\", className)}\n style={style}\n >\n <p id={instructionsId} className=\"mtx-sr-only\">\n On touch devices, press and hold a card, then drag to another day and release. Use Tab or Up/Down to select a card. Press Space or Enter\n to pick it up, Left/Right to move, Enter to drop, or Escape to cancel.\n </p>\n <div aria-live=\"polite\" className=\"mtx-sr-only\">\n {announcement}\n </div>\n <div role=\"table\" aria-label=\"Resource scheduler\" style={{ minWidth: resourceColumnWidth + dayColumnWidth * days.length }}>\n <ResourceSchedulerHeader\n today={today}\n days={days}\n dayKeys={dayKeys}\n formatter={formatter}\n resourceHeading={resourceHeading}\n resourceColumnWidth={resourceColumnWidth}\n dayColumnWidth={dayColumnWidth}\n slotProps={slotProps}\n />\n {resources.map(resource => (\n <ResourceSchedulerRow\n today={today}\n renderCellButton={renderCellButton}\n showCellButton={showCellButton}\n key={`${typeof resource.id}:${resource.id}`}\n resource={resource}\n dayKeys={dayKeys}\n groupedItems={groupedItems}\n resourceColumnWidth={resourceColumnWidth}\n dayColumnWidth={dayColumnWidth}\n rowMinHeight={rowMinHeight}\n cardWidth={cardWidth}\n stackOffset={stackOffset}\n slotProps={slotProps}\n interaction={interaction}\n />\n ))}\n </div>\n </div>\n <DragOverlay dropAnimation={null}>\n {source => (\n <div\n aria-hidden=\"true\"\n className={cn(\"mtx-pointer-events-none mtx-text-sm mtx-text-text-500\", slotProps?.card?.className)}\n style={{ width: cardWidth, ...slotProps?.card?.style, margin: 0 }}\n >\n {items.find(item => item.id === source.id)?.content}\n </div>\n )}\n </DragOverlay>\n </DragDropProvider>\n );\n },\n);\n\nResourceScheduler.displayName = \"ResourceScheduler\";\n\nexport {\n ResourceScheduler,\n type ResourceSchedulerProps,\n type ResourceSchedulerResource,\n type ResourceSchedulerItem,\n type ResourceSchedulerMove,\n type ResourceSchedulerCellContext,\n};\n"],"names":["touchSensors","PointerSensor","event","source","ResourceSchedulerHeader","today","days","dayKeys","formatter","resourceHeading","resourceColumnWidth","dayColumnWidth","slotProps","jsxs","jsx","day","index","createElement","cn","ResourceSchedulerCard","item","count","resourceId","cardWidth","stackOffset","interaction","disabled","instructionsId","activeMove","draggedItemRef","cardRefs","setActiveMove","handleKeyDown","focused","setFocused","useState","draggableRef","useDraggable","dragImageRef","useRef","useEffect","isMoving","node","card","bounds","preview","ResourceSchedulerCell","resource","renderCellButton","showCellButton","cellItems","rowMinHeight","items","handleMove","droppableRef","isDropTarget","useDroppable","cell","button","isTarget","ResourceSchedulerRow","groupedItems","toSchedulerDate","value","toCalendarDate","date","getDay","toDateOnlyString","ResourceScheduler","forwardRef","resources","from","to","controlledItems","defaultItems","onItemsChange","onItemDrop","locale","customFormatter","className","style","props","ref","setToday","timer","updateToday","now","midnight","localItems","setLocalItems","announcement","setAnnouncement","pendingFocus","moveOrder","setMoveOrder","pending","useId","fromDay","toDay","useMemo","start","end","result","grouped","priorities","move","accepted","a","b","itemId","target","previousItem","original","nextDate","current","nextItems","selectable","next","dayIndex","nextDay","DragDropProvider","DragOverlay"],"mappings":";;;;;AA6EA,MAAMA,KAAe;AAAA,EACnBC,GAAc,UAAU;AAAA,IACtB,mBAAmB,CAACC,GAAOC,MAAWD,EAAM,gBAAgB,WAAW,CAAC,CAACD,GAAc,SAAS,oBAAoBC,GAAOC,CAAM;AAAA,EAAA,CAClI;AACH,GAyBMC,KAA0B,CAAC;AAAA,EAC/B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AACF,MACE,gBAAAC,EAAC,OAAA,EAAI,MAAK,OAAM,WAAU,YACxB,UAAA;AAAA,EAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAU;AAAA,MACV,OAAO,EAAE,OAAOJ,EA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