@underverse-ui/underverse 0.2.97 → 0.2.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +37 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +37 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8308,9 +8308,10 @@ function useClientWidth(ref) {
|
|
|
8308
8308
|
var SIZE_CONFIG_BY_SIZE = {
|
|
8309
8309
|
sm: {
|
|
8310
8310
|
resourceColumnWidth: 200,
|
|
8311
|
-
rowHeight:
|
|
8311
|
+
rowHeight: 84,
|
|
8312
|
+
groupRowHeight: 36,
|
|
8312
8313
|
slotMinWidth: 52,
|
|
8313
|
-
eventHeight:
|
|
8314
|
+
eventHeight: 46,
|
|
8314
8315
|
laneGap: 3,
|
|
8315
8316
|
lanePaddingY: 5,
|
|
8316
8317
|
densityClass: "text-xs",
|
|
@@ -8324,9 +8325,10 @@ var SIZE_CONFIG_BY_SIZE = {
|
|
|
8324
8325
|
},
|
|
8325
8326
|
md: {
|
|
8326
8327
|
resourceColumnWidth: 240,
|
|
8327
|
-
rowHeight:
|
|
8328
|
+
rowHeight: 96,
|
|
8329
|
+
groupRowHeight: 40,
|
|
8328
8330
|
slotMinWidth: 64,
|
|
8329
|
-
eventHeight:
|
|
8331
|
+
eventHeight: 54,
|
|
8330
8332
|
laneGap: 4,
|
|
8331
8333
|
lanePaddingY: 6,
|
|
8332
8334
|
densityClass: "text-sm",
|
|
@@ -8340,9 +8342,10 @@ var SIZE_CONFIG_BY_SIZE = {
|
|
|
8340
8342
|
},
|
|
8341
8343
|
xl: {
|
|
8342
8344
|
resourceColumnWidth: 280,
|
|
8343
|
-
rowHeight:
|
|
8345
|
+
rowHeight: 112,
|
|
8346
|
+
groupRowHeight: 44,
|
|
8344
8347
|
slotMinWidth: 76,
|
|
8345
|
-
eventHeight:
|
|
8348
|
+
eventHeight: 62,
|
|
8346
8349
|
laneGap: 5,
|
|
8347
8350
|
lanePaddingY: 8,
|
|
8348
8351
|
densityClass: "text-base",
|
|
@@ -8916,10 +8919,11 @@ function CalendarTimeline({
|
|
|
8916
8919
|
const bodyClientWidth = useClientWidth(bodyRef);
|
|
8917
8920
|
const slotStarts = React28.useMemo(() => slots.map((s) => s.start), [slots]);
|
|
8918
8921
|
const slotWidth = React28.useMemo(() => {
|
|
8919
|
-
|
|
8920
|
-
if (
|
|
8921
|
-
if (
|
|
8922
|
-
|
|
8922
|
+
const baseSlotWidth = activeView === "month" ? effectiveSlotMinWidth * 3 : effectiveSlotMinWidth;
|
|
8923
|
+
if (activeView !== "week") return baseSlotWidth;
|
|
8924
|
+
if (bodyClientWidth <= 0) return baseSlotWidth;
|
|
8925
|
+
if (slots.length <= 0) return baseSlotWidth;
|
|
8926
|
+
return Math.max(baseSlotWidth, bodyClientWidth / slots.length);
|
|
8923
8927
|
}, [activeView, bodyClientWidth, effectiveSlotMinWidth, slots.length]);
|
|
8924
8928
|
const gridWidth = slots.length * slotWidth;
|
|
8925
8929
|
const normalizedEvents = React28.useMemo(() => {
|
|
@@ -8995,9 +8999,9 @@ function CalendarTimeline({
|
|
|
8995
8999
|
const rowHeightsArray = React28.useMemo(() => {
|
|
8996
9000
|
return rows.map((r) => {
|
|
8997
9001
|
if (r.kind === "resource") return getResourceRowHeight(r.resource.id);
|
|
8998
|
-
return
|
|
9002
|
+
return sizeConfig.groupRowHeight;
|
|
8999
9003
|
});
|
|
9000
|
-
}, [
|
|
9004
|
+
}, [getResourceRowHeight, rows, sizeConfig.groupRowHeight]);
|
|
9001
9005
|
const virtualResult = useVirtualVariableRows({
|
|
9002
9006
|
enabled: virt,
|
|
9003
9007
|
overscan,
|
|
@@ -9532,10 +9536,26 @@ function CalendarTimeline({
|
|
|
9532
9536
|
timeZone: resolvedTimeZone,
|
|
9533
9537
|
view: activeView
|
|
9534
9538
|
}) ?? defaultEventTime({ start: ev._start, end: ev._end, locale: resolvedLocale, timeZone: resolvedTimeZone, view: activeView });
|
|
9535
|
-
const node = renderEvent?.(ev, { left, width, lane
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
+
const node = renderEvent?.(ev, { left, width, lane, height: layout.eventHeight, timeText }) ?? (() => {
|
|
9540
|
+
const showTime = layout.eventHeight >= 24;
|
|
9541
|
+
const titleMaxLines = showTime ? layout.eventHeight >= 34 ? 2 : 1 : 1;
|
|
9542
|
+
const isPlainTitle = typeof ev.title === "string" || typeof ev.title === "number";
|
|
9543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "h-full px-2.5 flex items-center min-w-0 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "w-full grid grid-cols-[1fr_auto] gap-x-2 items-start min-w-0 overflow-hidden", children: [
|
|
9544
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9545
|
+
"div",
|
|
9546
|
+
{
|
|
9547
|
+
className: cn("text-xs font-semibold leading-snug min-w-0 overflow-hidden", isPlainTitle ? "break-words" : ""),
|
|
9548
|
+
style: isPlainTitle ? {
|
|
9549
|
+
display: "-webkit-box",
|
|
9550
|
+
WebkitBoxOrient: "vertical",
|
|
9551
|
+
WebkitLineClamp: titleMaxLines
|
|
9552
|
+
} : void 0,
|
|
9553
|
+
children: ev.title ?? null
|
|
9554
|
+
}
|
|
9555
|
+
),
|
|
9556
|
+
showTime ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "text-[11px] opacity-70 leading-snug whitespace-nowrap", children: timeText }) : null
|
|
9557
|
+
] }) });
|
|
9558
|
+
})();
|
|
9539
9559
|
const resource = resourceById.get(ev.resourceId);
|
|
9540
9560
|
const tooltipTitle = ev.title || ev.id;
|
|
9541
9561
|
const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col gap-0.5", children: [
|
|
@@ -9551,6 +9571,7 @@ function CalendarTimeline({
|
|
|
9551
9571
|
"shadow-sm hover:shadow-md hover:scale-[1.02] hover:z-10",
|
|
9552
9572
|
"transition-all duration-150 ease-out",
|
|
9553
9573
|
"backdrop-blur-sm",
|
|
9574
|
+
"overflow-hidden",
|
|
9554
9575
|
ev.className,
|
|
9555
9576
|
isPreview && "ring-2 ring-primary/50 ring-offset-1 ring-offset-background scale-[1.02] z-10"
|
|
9556
9577
|
),
|