@underverse-ui/underverse 1.0.188 → 1.0.190
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 +10 -8
- 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 +10 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2715,6 +2715,8 @@ type DataTableColumn<T> = {
|
|
|
2715
2715
|
render?: (value: any, record: T, index: number) => React__default.ReactNode;
|
|
2716
2716
|
width?: number | string;
|
|
2717
2717
|
align?: "left" | "center" | "right";
|
|
2718
|
+
/** Vị trí của icon sort/filter: "inline" (ngay sát text) hoặc "end" (cuối dòng). Mặc định là "end". */
|
|
2719
|
+
iconPosition?: "inline" | "end";
|
|
2718
2720
|
visible?: boolean;
|
|
2719
2721
|
/** Cố định cột bên trái hoặc phải khi cuộn ngang */
|
|
2720
2722
|
fixed?: "left" | "right";
|
package/dist/index.d.ts
CHANGED
|
@@ -2715,6 +2715,8 @@ type DataTableColumn<T> = {
|
|
|
2715
2715
|
render?: (value: any, record: T, index: number) => React__default.ReactNode;
|
|
2716
2716
|
width?: number | string;
|
|
2717
2717
|
align?: "left" | "center" | "right";
|
|
2718
|
+
/** Vị trí của icon sort/filter: "inline" (ngay sát text) hoặc "end" (cuối dòng). Mặc định là "end". */
|
|
2719
|
+
iconPosition?: "inline" | "end";
|
|
2718
2720
|
visible?: boolean;
|
|
2719
2721
|
/** Cố định cột bên trái hoặc phải khi cuộn ngang */
|
|
2720
2722
|
fixed?: "left" | "right";
|
package/dist/index.js
CHANGED
|
@@ -25680,7 +25680,8 @@ function DataTableHeader({
|
|
|
25680
25680
|
const columnLabel = getColumnLabel(col.title) || col.key;
|
|
25681
25681
|
const sortByText = sortByLabel ?? gi18n.sortBy ?? "Sort by";
|
|
25682
25682
|
const sortLabel = `${sortByText} ${columnLabel}`;
|
|
25683
|
-
const
|
|
25683
|
+
const useEndIcon = (col.iconPosition ?? "end") === "end";
|
|
25684
|
+
const titleContent = /* @__PURE__ */ jsxs55("div", { className: cn("flex items-center gap-1", useEndIcon && "flex-1 justify-between"), children: [
|
|
25684
25685
|
/* @__PURE__ */ jsx68("span", { className: cn("font-medium whitespace-nowrap select-text", headerTitleClass), children: col.title }),
|
|
25685
25686
|
col.sortable && /* @__PURE__ */ jsx68(
|
|
25686
25687
|
Tooltip,
|
|
@@ -25693,8 +25694,8 @@ function DataTableHeader({
|
|
|
25693
25694
|
type: "button",
|
|
25694
25695
|
title: sortLabel,
|
|
25695
25696
|
className: cn(
|
|
25696
|
-
"p-1 rounded-lg transition-all duration-200 hover:bg-
|
|
25697
|
-
sort?.key === col.key ? "opacity-100 bg-
|
|
25697
|
+
"p-1 rounded-lg transition-all duration-200 hover:bg-foreground/10",
|
|
25698
|
+
sort?.key === col.key ? "opacity-100 bg-foreground/10" : "opacity-60 hover:opacity-100"
|
|
25698
25699
|
),
|
|
25699
25700
|
onClick: () => {
|
|
25700
25701
|
setCurPage(1);
|
|
@@ -25709,7 +25710,7 @@ function DataTableHeader({
|
|
|
25709
25710
|
/* @__PURE__ */ jsx68(
|
|
25710
25711
|
"path",
|
|
25711
25712
|
{
|
|
25712
|
-
d: "
|
|
25713
|
+
d: "M5 7.5l5-5 5 5",
|
|
25713
25714
|
stroke: "currentColor",
|
|
25714
25715
|
strokeWidth: "1.5",
|
|
25715
25716
|
strokeLinecap: "round",
|
|
@@ -25720,7 +25721,7 @@ function DataTableHeader({
|
|
|
25720
25721
|
/* @__PURE__ */ jsx68(
|
|
25721
25722
|
"path",
|
|
25722
25723
|
{
|
|
25723
|
-
d: "
|
|
25724
|
+
d: "M5 12.5l5 5 5-5",
|
|
25724
25725
|
stroke: "currentColor",
|
|
25725
25726
|
strokeWidth: "1.5",
|
|
25726
25727
|
strokeLinecap: "round",
|
|
@@ -25749,8 +25750,8 @@ function DataTableHeader({
|
|
|
25749
25750
|
type: "button",
|
|
25750
25751
|
title: gi18n.filterByColumn ? gi18n.filterByColumn(columnLabel) : `Filter by ${columnLabel}`,
|
|
25751
25752
|
className: cn(
|
|
25752
|
-
"p-1.5 rounded-lg transition-all duration-200 hover:bg-
|
|
25753
|
-
filters[col.key] ? "bg-
|
|
25753
|
+
"p-1.5 rounded-lg transition-all duration-200 hover:bg-foreground/10",
|
|
25754
|
+
filters[col.key] ? "bg-foreground/10 opacity-100" : "opacity-60 hover:opacity-100"
|
|
25754
25755
|
),
|
|
25755
25756
|
"aria-label": gi18n.filterByColumn ? gi18n.filterByColumn(columnLabel) : `Filter by ${columnLabel}`,
|
|
25756
25757
|
children: /* @__PURE__ */ jsx68(FilterIcon, { className: "w-4 h-4" })
|
|
@@ -25785,7 +25786,8 @@ function DataTableHeader({
|
|
|
25785
25786
|
headerMinHeightClass,
|
|
25786
25787
|
isRightAlign && "justify-end",
|
|
25787
25788
|
isCenterAlign && "justify-center",
|
|
25788
|
-
!isRightAlign && !isCenterAlign && "justify-start"
|
|
25789
|
+
!isRightAlign && !isCenterAlign && "justify-start",
|
|
25790
|
+
useEndIcon && "w-full"
|
|
25789
25791
|
),
|
|
25790
25792
|
children: isRightAlign ? /* @__PURE__ */ jsxs55(Fragment25, { children: [
|
|
25791
25793
|
filterContent,
|