@underverse-ui/underverse 2.0.1 → 2.0.2
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/CHANGELOG.md +10 -0
- package/api-reference.json +1 -1
- package/dist/index.cjs +40 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +40 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All notable changes to `@underverse-ui/underverse` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `CategoryTreeSelect` now supports `showTreeLines` to show or hide dashed hierarchy guide lines in recursive and virtualized trees.
|
|
10
|
+
- `DataTable` columns now support `headerAlign` for per-column header alignment.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- `DataTable` headers now default to centered alignment.
|
|
15
|
+
- `DataTable` body cells now default to left alignment, with per-column overrides through `align`.
|
|
16
|
+
|
|
7
17
|
## [2.0.0] - 2026-07-26
|
|
8
18
|
|
|
9
19
|
### Highlights
|
package/api-reference.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -26270,9 +26270,8 @@ var defaultLabels = {
|
|
|
26270
26270
|
searchPlaceholder: "Search...",
|
|
26271
26271
|
noResultsText: "No results found"
|
|
26272
26272
|
};
|
|
26273
|
-
var TREE_NODE_BASE_PADDING_REM = 0
|
|
26274
|
-
var TREE_NODE_INDENT_REM =
|
|
26275
|
-
var TREE_BRANCH_OFFSET_CLASS = "ml-1.5 pl-1.5";
|
|
26273
|
+
var TREE_NODE_BASE_PADDING_REM = 0;
|
|
26274
|
+
var TREE_NODE_INDENT_REM = 0.75;
|
|
26276
26275
|
var TREE_NODE_GAP_CLASS = "gap-1.5";
|
|
26277
26276
|
var TREE_EXPANDER_PLACEHOLDER_CLASS = "w-5";
|
|
26278
26277
|
var CATEGORY_TREE_DROPDOWN_MAX_HEIGHT = 320;
|
|
@@ -26402,7 +26401,7 @@ function CategoryTreeSelect(props) {
|
|
|
26402
26401
|
useOverlayScrollbar = false,
|
|
26403
26402
|
leafOnlySelect = false,
|
|
26404
26403
|
virtualized = false,
|
|
26405
|
-
estimatedItemHeight =
|
|
26404
|
+
estimatedItemHeight = 36,
|
|
26406
26405
|
overscan = 8,
|
|
26407
26406
|
maxInitialOptions,
|
|
26408
26407
|
searchMode = "auto",
|
|
@@ -26412,6 +26411,7 @@ function CategoryTreeSelect(props) {
|
|
|
26412
26411
|
showSearchPromptWhenEmptyQuery = false,
|
|
26413
26412
|
baseIndent = TREE_NODE_BASE_PADDING_REM,
|
|
26414
26413
|
indentSize = TREE_NODE_INDENT_REM,
|
|
26414
|
+
showTreeLines = true,
|
|
26415
26415
|
renderItemActions,
|
|
26416
26416
|
singleSelect = false,
|
|
26417
26417
|
borderMode
|
|
@@ -26699,7 +26699,7 @@ function CategoryTreeSelect(props) {
|
|
|
26699
26699
|
{
|
|
26700
26700
|
ref: virtualItem ? treeVirtualizer.measureElement : void 0,
|
|
26701
26701
|
"data-index": virtualItem?.index,
|
|
26702
|
-
className: cn("min-w-0 [content-visibility:auto] [contain-intrinsic-size:
|
|
26702
|
+
className: cn("min-w-0 [content-visibility:auto] [contain-intrinsic-size:36px]", !virtualItem && "animate-in fade-in-50 duration-200"),
|
|
26703
26703
|
style: { animationDelay: virtualItem ? void 0 : `${level * 30}ms`, ...rowStyle },
|
|
26704
26704
|
children: [
|
|
26705
26705
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
@@ -26711,7 +26711,7 @@ function CategoryTreeSelect(props) {
|
|
|
26711
26711
|
"aria-selected": viewOnly ? void 0 : isSelected,
|
|
26712
26712
|
onClick: () => !viewOnly && handleSelect(category.id, category),
|
|
26713
26713
|
className: cn(
|
|
26714
|
-
"relative flex min-w-0 items-center
|
|
26714
|
+
"relative flex min-h-9 min-w-0 items-center rounded-3xl transition-all duration-200",
|
|
26715
26715
|
TREE_NODE_GAP_CLASS,
|
|
26716
26716
|
!viewOnly && (isSelectable ? "cursor-pointer" : "cursor-default"),
|
|
26717
26717
|
isSelectable && !isSelected && "hover:bg-accent/50",
|
|
@@ -26721,6 +26721,16 @@ function CategoryTreeSelect(props) {
|
|
|
26721
26721
|
),
|
|
26722
26722
|
style: { paddingLeft: `${level * indentSize + baseIndent}rem` },
|
|
26723
26723
|
children: [
|
|
26724
|
+
virtualItem && showTreeLines && Array.from({ length: level }, (_, ancestorLevel) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
26725
|
+
"span",
|
|
26726
|
+
{
|
|
26727
|
+
"data-tree-line": true,
|
|
26728
|
+
"aria-hidden": "true",
|
|
26729
|
+
className: "pointer-events-none absolute inset-y-0 w-px border-l border-dashed border-border/50",
|
|
26730
|
+
style: { left: `${ancestorLevel * indentSize + baseIndent + 0.5}rem` }
|
|
26731
|
+
},
|
|
26732
|
+
ancestorLevel
|
|
26733
|
+
)),
|
|
26724
26734
|
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
26725
26735
|
"button",
|
|
26726
26736
|
{
|
|
@@ -26769,16 +26779,23 @@ function CategoryTreeSelect(props) {
|
|
|
26769
26779
|
]
|
|
26770
26780
|
}
|
|
26771
26781
|
),
|
|
26772
|
-
!virtualItem && hasChildren && isExpanded && /* @__PURE__ */ (0, import_jsx_runtime54.
|
|
26782
|
+
!virtualItem && hasChildren && isExpanded && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
26773
26783
|
"div",
|
|
26774
26784
|
{
|
|
26775
26785
|
role: "group",
|
|
26776
|
-
className:
|
|
26777
|
-
|
|
26778
|
-
|
|
26779
|
-
|
|
26780
|
-
|
|
26781
|
-
|
|
26786
|
+
className: "relative animate-in fade-in-50 slide-in-from-top-2 duration-200",
|
|
26787
|
+
children: [
|
|
26788
|
+
showTreeLines && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
26789
|
+
"span",
|
|
26790
|
+
{
|
|
26791
|
+
"data-tree-line": true,
|
|
26792
|
+
"aria-hidden": "true",
|
|
26793
|
+
className: "pointer-events-none absolute inset-y-0 w-px border-l border-dashed border-border/50",
|
|
26794
|
+
style: { left: `${level * indentSize + baseIndent + 0.5}rem` }
|
|
26795
|
+
}
|
|
26796
|
+
),
|
|
26797
|
+
children.map((child) => renderCategoryRow(child, level + 1))
|
|
26798
|
+
]
|
|
26782
26799
|
}
|
|
26783
26800
|
)
|
|
26784
26801
|
]
|
|
@@ -30925,6 +30942,7 @@ function DataTableBodyRows({
|
|
|
30925
30942
|
style: getStickyColumnStyle(col),
|
|
30926
30943
|
className: cn(
|
|
30927
30944
|
cellPadding,
|
|
30945
|
+
(!col.align || col.align === "left") && "text-left",
|
|
30928
30946
|
col.align === "right" && "text-right",
|
|
30929
30947
|
col.align === "center" && "text-center",
|
|
30930
30948
|
showBorderLeft && "border-l border-border/60",
|
|
@@ -31130,16 +31148,17 @@ function DataTableHeader({
|
|
|
31130
31148
|
className: cn(
|
|
31131
31149
|
"flex items-center gap-1",
|
|
31132
31150
|
headerMinHeightClass,
|
|
31133
|
-
col.
|
|
31134
|
-
col.
|
|
31135
|
-
|
|
31151
|
+
(col.headerAlign ?? headerAlign) === "right" && "justify-end",
|
|
31152
|
+
(col.headerAlign ?? headerAlign) === "center" && "justify-center",
|
|
31153
|
+
(col.headerAlign ?? headerAlign) === "left" && "justify-start"
|
|
31136
31154
|
),
|
|
31137
31155
|
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: cn("font-medium whitespace-nowrap select-text", headerTitleClass), children: col.title })
|
|
31138
31156
|
}
|
|
31139
31157
|
);
|
|
31140
31158
|
}
|
|
31141
|
-
const
|
|
31142
|
-
const
|
|
31159
|
+
const resolvedHeaderAlign = col.headerAlign ?? headerAlign;
|
|
31160
|
+
const isRightAlign = resolvedHeaderAlign === "right";
|
|
31161
|
+
const isCenterAlign = resolvedHeaderAlign === "center";
|
|
31143
31162
|
const columnLabel = getColumnLabel(col.title) || col.key;
|
|
31144
31163
|
const sortByText = sortByLabel ?? gi18n.sortBy ?? "Sort by";
|
|
31145
31164
|
const sortLabel = `${sortByText} ${columnLabel}`;
|
|
@@ -31301,8 +31320,8 @@ function DataTableHeader({
|
|
|
31301
31320
|
},
|
|
31302
31321
|
className: cn(
|
|
31303
31322
|
"relative",
|
|
31304
|
-
(col.
|
|
31305
|
-
(col.
|
|
31323
|
+
(col.headerAlign ?? headerAlign) === "right" && "text-right",
|
|
31324
|
+
(col.headerAlign ?? headerAlign) === "center" && "text-center",
|
|
31306
31325
|
showBorderLeft && "border-l border-border/60",
|
|
31307
31326
|
getStickyHeaderClass(col)
|
|
31308
31327
|
),
|
|
@@ -31824,7 +31843,7 @@ function useDataTableState({
|
|
|
31824
31843
|
const allLeafColumns = import_react40.default.useMemo(() => getLeafColumns(columns), [columns]);
|
|
31825
31844
|
const defaultVisibleLeafKeys = import_react40.default.useMemo(() => allLeafColumns.filter((column) => column.visible !== false).map((column) => column.key), [allLeafColumns]);
|
|
31826
31845
|
const knownLeafKeysRef = import_react40.default.useRef(new Set(defaultVisibleLeafKeys));
|
|
31827
|
-
const [headerAlign, setHeaderAlign] = import_react40.default.useState("
|
|
31846
|
+
const [headerAlign, setHeaderAlign] = import_react40.default.useState("center");
|
|
31828
31847
|
const [visibleCols, setVisibleCols] = import_react40.default.useState(defaultVisibleLeafKeys);
|
|
31829
31848
|
const [filters, setFilters] = import_react40.default.useState({});
|
|
31830
31849
|
const [sort, setSort] = import_react40.default.useState(null);
|