@underverse-ui/underverse 2.0.2 → 2.0.3
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 +6 -0
- package/api-reference.json +1 -1
- package/dist/index.cjs +71 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +71 -49
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to `@underverse-ui/underverse` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- `DataTable` sortable headers now keep their titles visually centered while the sort control remains aligned to the trailing edge.
|
|
10
|
+
|
|
11
|
+
## [2.0.2] - 2026-07-28
|
|
12
|
+
|
|
7
13
|
### Added
|
|
8
14
|
|
|
9
15
|
- `CategoryTreeSelect` now supports `showTreeLines` to show or hide dashed hierarchy guide lines in recursive and virtualized trees.
|
package/api-reference.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -31163,60 +31163,82 @@ function DataTableHeader({
|
|
|
31163
31163
|
const sortByText = sortByLabel ?? gi18n.sortBy ?? "Sort by";
|
|
31164
31164
|
const sortLabel = `${sortByText} ${columnLabel}`;
|
|
31165
31165
|
const useEndIcon = (col.iconPosition ?? "end") === "end";
|
|
31166
|
-
const titleContent = /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
31167
|
-
|
|
31168
|
-
|
|
31169
|
-
|
|
31170
|
-
|
|
31171
|
-
|
|
31172
|
-
|
|
31173
|
-
|
|
31174
|
-
|
|
31166
|
+
const titleContent = /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
31167
|
+
"div",
|
|
31168
|
+
{
|
|
31169
|
+
"data-underverse-datatable-header-content": col.key,
|
|
31170
|
+
className: cn(
|
|
31171
|
+
"items-center gap-1",
|
|
31172
|
+
useEndIcon && isCenterAlign ? "grid flex-1 grid-cols-[1fr_auto_1fr]" : "flex",
|
|
31173
|
+
useEndIcon && !isCenterAlign && "flex-1 justify-between"
|
|
31174
|
+
),
|
|
31175
|
+
children: [
|
|
31176
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
31177
|
+
"span",
|
|
31175
31178
|
{
|
|
31176
|
-
type: "button",
|
|
31177
|
-
title: sortLabel,
|
|
31178
31179
|
className: cn(
|
|
31179
|
-
"
|
|
31180
|
-
|
|
31180
|
+
"font-medium whitespace-nowrap select-text",
|
|
31181
|
+
useEndIcon && isCenterAlign && "col-start-2",
|
|
31182
|
+
headerTitleClass
|
|
31181
31183
|
),
|
|
31182
|
-
|
|
31183
|
-
|
|
31184
|
-
|
|
31185
|
-
|
|
31186
|
-
|
|
31187
|
-
|
|
31188
|
-
|
|
31189
|
-
},
|
|
31190
|
-
|
|
31191
|
-
|
|
31192
|
-
|
|
31193
|
-
"
|
|
31194
|
-
|
|
31195
|
-
|
|
31196
|
-
|
|
31197
|
-
|
|
31198
|
-
|
|
31199
|
-
|
|
31200
|
-
|
|
31201
|
-
|
|
31202
|
-
|
|
31203
|
-
|
|
31204
|
-
|
|
31205
|
-
|
|
31206
|
-
|
|
31207
|
-
|
|
31208
|
-
|
|
31209
|
-
|
|
31210
|
-
|
|
31211
|
-
|
|
31212
|
-
|
|
31213
|
-
|
|
31214
|
-
|
|
31184
|
+
children: col.title
|
|
31185
|
+
}
|
|
31186
|
+
),
|
|
31187
|
+
col.sortable && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
31188
|
+
Tooltip,
|
|
31189
|
+
{
|
|
31190
|
+
placement: "top",
|
|
31191
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "text-xs font-medium", children: sortLabel }),
|
|
31192
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
31193
|
+
"button",
|
|
31194
|
+
{
|
|
31195
|
+
type: "button",
|
|
31196
|
+
title: sortLabel,
|
|
31197
|
+
className: cn(
|
|
31198
|
+
"p-1 rounded-lg transition-all duration-200 hover:bg-foreground/10",
|
|
31199
|
+
useEndIcon && isCenterAlign && "col-start-3 justify-self-end",
|
|
31200
|
+
sort?.key === col.key ? "opacity-100 bg-foreground/10" : "opacity-60 hover:opacity-100"
|
|
31201
|
+
),
|
|
31202
|
+
onClick: () => {
|
|
31203
|
+
setCurPage(1);
|
|
31204
|
+
setSort((current) => {
|
|
31205
|
+
if (!current || current.key !== col.key) return { key: col.key, order: "asc" };
|
|
31206
|
+
if (current.order === "asc") return { key: col.key, order: "desc" };
|
|
31207
|
+
return null;
|
|
31208
|
+
});
|
|
31209
|
+
},
|
|
31210
|
+
"aria-label": sortLabel,
|
|
31211
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("svg", { viewBox: "0 0 20 20", fill: "none", className: cn("inline-block", sortIconClass), children: [
|
|
31212
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
31213
|
+
"path",
|
|
31214
|
+
{
|
|
31215
|
+
d: "M5 7.5l5-5 5 5",
|
|
31216
|
+
stroke: "currentColor",
|
|
31217
|
+
strokeWidth: "1.5",
|
|
31218
|
+
strokeLinecap: "round",
|
|
31219
|
+
strokeLinejoin: "round",
|
|
31220
|
+
opacity: sort?.key === col.key && sort.order === "asc" ? 1 : 0.4
|
|
31221
|
+
}
|
|
31222
|
+
),
|
|
31223
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
31224
|
+
"path",
|
|
31225
|
+
{
|
|
31226
|
+
d: "M5 12.5l5 5 5-5",
|
|
31227
|
+
stroke: "currentColor",
|
|
31228
|
+
strokeWidth: "1.5",
|
|
31229
|
+
strokeLinecap: "round",
|
|
31230
|
+
strokeLinejoin: "round",
|
|
31231
|
+
opacity: sort?.key === col.key && sort.order === "desc" ? 1 : 0.4
|
|
31232
|
+
}
|
|
31233
|
+
)
|
|
31234
|
+
] })
|
|
31235
|
+
}
|
|
31236
|
+
)
|
|
31215
31237
|
}
|
|
31216
31238
|
)
|
|
31217
|
-
|
|
31218
|
-
|
|
31219
|
-
|
|
31239
|
+
]
|
|
31240
|
+
}
|
|
31241
|
+
);
|
|
31220
31242
|
const filterContent = col.filter ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
31221
31243
|
Popover,
|
|
31222
31244
|
{
|