@underverse-ui/underverse 1.0.91 → 1.0.92
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/api-reference.json +1 -1
- package/dist/index.cjs +34 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +34 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/api-reference.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2064,6 +2064,8 @@ var DEFAULT_OVERLAY_SCROLLBAR_BEHAVIOR = {
|
|
|
2064
2064
|
autoHideDelay: 600,
|
|
2065
2065
|
dragScroll: true,
|
|
2066
2066
|
clickScroll: false,
|
|
2067
|
+
overflowX: "scroll",
|
|
2068
|
+
overflowY: "scroll",
|
|
2067
2069
|
exclude: DEFAULT_OVERLAY_SCROLLBAR_EXCLUDE
|
|
2068
2070
|
};
|
|
2069
2071
|
function resolveOverlayScrollbarBehavior(overrides = {}) {
|
|
@@ -2074,6 +2076,10 @@ function resolveOverlayScrollbarBehavior(overrides = {}) {
|
|
|
2074
2076
|
}
|
|
2075
2077
|
function buildOverlayScrollbarOptions(config) {
|
|
2076
2078
|
return {
|
|
2079
|
+
overflow: {
|
|
2080
|
+
x: config.overflowX,
|
|
2081
|
+
y: config.overflowY
|
|
2082
|
+
},
|
|
2077
2083
|
scrollbars: {
|
|
2078
2084
|
theme: config.theme,
|
|
2079
2085
|
visibility: config.visibility,
|
|
@@ -2218,6 +2224,8 @@ function OverlayScrollbarProvider({
|
|
|
2218
2224
|
autoHideDelay = DEFAULT_OVERLAY_SCROLLBAR_BEHAVIOR.autoHideDelay,
|
|
2219
2225
|
dragScroll = DEFAULT_OVERLAY_SCROLLBAR_BEHAVIOR.dragScroll,
|
|
2220
2226
|
clickScroll = DEFAULT_OVERLAY_SCROLLBAR_BEHAVIOR.clickScroll,
|
|
2227
|
+
overflowX = DEFAULT_OVERLAY_SCROLLBAR_BEHAVIOR.overflowX,
|
|
2228
|
+
overflowY = DEFAULT_OVERLAY_SCROLLBAR_BEHAVIOR.overflowY,
|
|
2221
2229
|
exclude = DEFAULT_OVERLAY_SCROLLBAR_BEHAVIOR.exclude,
|
|
2222
2230
|
selector,
|
|
2223
2231
|
children
|
|
@@ -2231,9 +2239,11 @@ function OverlayScrollbarProvider({
|
|
|
2231
2239
|
autoHideDelay,
|
|
2232
2240
|
dragScroll,
|
|
2233
2241
|
clickScroll,
|
|
2242
|
+
overflowX,
|
|
2243
|
+
overflowY,
|
|
2234
2244
|
exclude
|
|
2235
2245
|
}),
|
|
2236
|
-
[enabled, theme, visibility, autoHide, autoHideDelay, dragScroll, clickScroll, exclude]
|
|
2246
|
+
[enabled, theme, visibility, autoHide, autoHideDelay, dragScroll, clickScroll, overflowX, overflowY, exclude]
|
|
2237
2247
|
);
|
|
2238
2248
|
void selector;
|
|
2239
2249
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(OverlayScrollbarConfigContext.Provider, { value, children: children ?? null });
|
|
@@ -2247,6 +2257,8 @@ function useOverlayScrollbarTarget(targetRef, options = {}) {
|
|
|
2247
2257
|
const autoHideDelay = options.autoHideDelay ?? inherited.autoHideDelay;
|
|
2248
2258
|
const dragScroll = options.dragScroll ?? inherited.dragScroll;
|
|
2249
2259
|
const clickScroll = options.clickScroll ?? inherited.clickScroll;
|
|
2260
|
+
const overflowX = options.overflowX ?? inherited.overflowX;
|
|
2261
|
+
const overflowY = options.overflowY ?? inherited.overflowY;
|
|
2250
2262
|
const exclude = options.exclude ?? inherited.exclude;
|
|
2251
2263
|
const resolved = (0, import_react3.useMemo)(
|
|
2252
2264
|
() => resolveOverlayScrollbarBehavior({
|
|
@@ -2257,9 +2269,11 @@ function useOverlayScrollbarTarget(targetRef, options = {}) {
|
|
|
2257
2269
|
autoHideDelay,
|
|
2258
2270
|
dragScroll,
|
|
2259
2271
|
clickScroll,
|
|
2272
|
+
overflowX,
|
|
2273
|
+
overflowY,
|
|
2260
2274
|
exclude
|
|
2261
2275
|
}),
|
|
2262
|
-
[enabled, theme, visibility, autoHide, autoHideDelay, dragScroll, clickScroll, exclude]
|
|
2276
|
+
[enabled, theme, visibility, autoHide, autoHideDelay, dragScroll, clickScroll, overflowX, overflowY, exclude]
|
|
2263
2277
|
);
|
|
2264
2278
|
(0, import_react3.useEffect)(() => {
|
|
2265
2279
|
if (typeof window === "undefined") return;
|
|
@@ -2284,6 +2298,8 @@ function useOverlayScrollbarTarget(targetRef, options = {}) {
|
|
|
2284
2298
|
resolved.autoHideDelay,
|
|
2285
2299
|
resolved.dragScroll,
|
|
2286
2300
|
resolved.clickScroll,
|
|
2301
|
+
resolved.overflowX,
|
|
2302
|
+
resolved.overflowY,
|
|
2287
2303
|
resolved.exclude
|
|
2288
2304
|
]);
|
|
2289
2305
|
}
|
|
@@ -20962,7 +20978,7 @@ var LoadingBar = ({
|
|
|
20962
20978
|
// src/components/Table.tsx
|
|
20963
20979
|
var import_react28 = __toESM(require("react"), 1);
|
|
20964
20980
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
20965
|
-
var TABLE_BASE_CLASS = "w-full caption-bottom text-sm";
|
|
20981
|
+
var TABLE_BASE_CLASS = "w-full border-collapse caption-bottom text-sm";
|
|
20966
20982
|
var TABLE_CONTAINER_BASE_CLASS = [
|
|
20967
20983
|
"relative w-full overflow-auto",
|
|
20968
20984
|
"rounded-2xl md:rounded-3xl border border-border/50",
|
|
@@ -21397,6 +21413,7 @@ function DataTableHeader({
|
|
|
21397
21413
|
const prevCol = prevCell?.column;
|
|
21398
21414
|
const isAfterFixedLeft = prevCol?.fixed === "left";
|
|
21399
21415
|
const showBorderLeft = columnDividers && cellIndex > 0 && !isAfterFixedLeft && !col.fixed;
|
|
21416
|
+
const isLastCell = cellIndex === row.length - 1;
|
|
21400
21417
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
21401
21418
|
TableHead,
|
|
21402
21419
|
{
|
|
@@ -21436,7 +21453,8 @@ function DataTableHeader({
|
|
|
21436
21453
|
onAutoFitColumn?.(col.key);
|
|
21437
21454
|
},
|
|
21438
21455
|
className: cn(
|
|
21439
|
-
"absolute inset-y-0 right-0 z-10 w-3
|
|
21456
|
+
"absolute inset-y-0 right-0 z-10 w-3",
|
|
21457
|
+
!isLastCell && "-mr-1",
|
|
21440
21458
|
"cursor-col-resize select-none bg-transparent",
|
|
21441
21459
|
"after:absolute after:inset-y-2 after:right-0.8 after:w-px after:bg-border/0 after:transition-colors",
|
|
21442
21460
|
"hover:after:bg-primary/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary"
|
|
@@ -22207,6 +22225,7 @@ function DataTable({
|
|
|
22207
22225
|
storageKey,
|
|
22208
22226
|
stickyHeader = true,
|
|
22209
22227
|
maxHeight = 500,
|
|
22228
|
+
horizontalMode = "auto",
|
|
22210
22229
|
overflowHidden = true,
|
|
22211
22230
|
useOverlayScrollbar = false,
|
|
22212
22231
|
enableHeaderAutoFit = true,
|
|
@@ -22280,6 +22299,10 @@ function DataTable({
|
|
|
22280
22299
|
total
|
|
22281
22300
|
});
|
|
22282
22301
|
const { getStickyCellClass, getStickyColumnStyle, getStickyHeaderClass, getStickyHeaderCellStyle } = useStickyColumns(visibleColumns);
|
|
22302
|
+
const shouldForceHorizontalScroll = horizontalMode === "scroll";
|
|
22303
|
+
const shouldUseFixedLayout = horizontalMode !== "auto";
|
|
22304
|
+
const viewportOverflowXClass = horizontalMode === "fit" ? "overflow-x-hidden" : "overflow-x-auto";
|
|
22305
|
+
const overlayOverflowX = horizontalMode === "fit" ? "hidden" : "scroll";
|
|
22283
22306
|
const getRowKey = (row, idx) => {
|
|
22284
22307
|
if (!rowKey) return String(idx);
|
|
22285
22308
|
if (typeof rowKey === "function") return String(rowKey(row));
|
|
@@ -22287,7 +22310,10 @@ function DataTable({
|
|
|
22287
22310
|
};
|
|
22288
22311
|
const viewportRef = import_react38.default.useRef(null);
|
|
22289
22312
|
const tableRef = import_react38.default.useRef(null);
|
|
22290
|
-
useOverlayScrollbarTarget(viewportRef, {
|
|
22313
|
+
useOverlayScrollbarTarget(viewportRef, {
|
|
22314
|
+
enabled: useOverlayScrollbar,
|
|
22315
|
+
overflowX: overlayOverflowX
|
|
22316
|
+
});
|
|
22291
22317
|
const autoFitColumn = import_react38.default.useCallback((columnKey) => {
|
|
22292
22318
|
const tableElement = tableRef.current;
|
|
22293
22319
|
if (!tableElement) return;
|
|
@@ -22349,7 +22375,7 @@ function DataTable({
|
|
|
22349
22375
|
"div",
|
|
22350
22376
|
{
|
|
22351
22377
|
ref: viewportRef,
|
|
22352
|
-
className: cn("w-full
|
|
22378
|
+
className: cn("w-full", viewportOverflowXClass, stickyHeader && "overflow-y-auto"),
|
|
22353
22379
|
style: stickyHeader ? { maxHeight: typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight } : void 0,
|
|
22354
22380
|
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
22355
22381
|
Table,
|
|
@@ -22357,10 +22383,10 @@ function DataTable({
|
|
|
22357
22383
|
ref: tableRef,
|
|
22358
22384
|
disableContainer: true,
|
|
22359
22385
|
className: cn(
|
|
22360
|
-
"table-fixed",
|
|
22386
|
+
shouldUseFixedLayout ? "table-fixed" : "table-auto",
|
|
22361
22387
|
stickyHeader && ["[&_thead]:sticky", "[&_thead]:top-0", "[&_thead]:z-20", "[&_thead]:shadow-[0_1px_3px_rgba(0,0,0,0.1)]"]
|
|
22362
22388
|
),
|
|
22363
|
-
style: { minWidth: totalColumnsWidth > 0 ? `${totalColumnsWidth}px` : void 0 },
|
|
22389
|
+
style: { minWidth: shouldForceHorizontalScroll && totalColumnsWidth > 0 ? `${totalColumnsWidth}px` : void 0 },
|
|
22364
22390
|
children: [
|
|
22365
22391
|
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
22366
22392
|
DataTableHeader,
|