@underverse-ui/underverse 2.0.40 → 2.0.41
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/{DatePicker-3IHOADO5.js → DatePicker-BYYBKHWH.js} +4 -4
- package/dist/{EmojiPicker-5MEENOF7.js → EmojiPicker-NKY2LOGI.js} +5 -5
- package/dist/{chunk-2K443MQP.js → chunk-C2EHPHWH.js} +3 -3
- package/dist/{chunk-GY6P6WZB.js → chunk-CJ6RPCJN.js} +3 -3
- package/dist/{chunk-ZCW2WBNT.js → chunk-GKUKLOSO.js} +9 -9
- package/dist/{chunk-THBABGVM.js → chunk-IW6FSDIT.js} +2 -2
- package/dist/{chunk-AKV7ZQJL.js → chunk-PNUDVGMI.js} +2 -2
- package/dist/{chunk-4MX7S6TM.js → chunk-PSWS64LA.js} +13 -5
- package/dist/chunk-PSWS64LA.js.map +1 -0
- package/dist/{chunk-LBOTY2AI.js → chunk-TVCZXO6G.js} +4 -4
- package/dist/{chunk-KBCOCHKM.js → chunk-VYTIGF3V.js} +4 -4
- package/dist/{chunk-BSN2YFRJ.js → chunk-WZH3Y3BL.js} +2 -2
- package/dist/index.cjs +121 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +118 -104
- package/dist/index.js.map +1 -1
- package/dist/{menu-bar-F6FGQVWO.js → menu-bar-67LDC7IR.js} +6 -6
- package/dist/ueditor.cjs +12 -4
- package/dist/ueditor.cjs.map +1 -1
- package/dist/ueditor.js +6 -6
- package/package.json +1 -1
- package/dist/chunk-4MX7S6TM.js.map +0 -1
- /package/dist/{DatePicker-3IHOADO5.js.map → DatePicker-BYYBKHWH.js.map} +0 -0
- /package/dist/{EmojiPicker-5MEENOF7.js.map → EmojiPicker-NKY2LOGI.js.map} +0 -0
- /package/dist/{chunk-2K443MQP.js.map → chunk-C2EHPHWH.js.map} +0 -0
- /package/dist/{chunk-GY6P6WZB.js.map → chunk-CJ6RPCJN.js.map} +0 -0
- /package/dist/{chunk-ZCW2WBNT.js.map → chunk-GKUKLOSO.js.map} +0 -0
- /package/dist/{chunk-THBABGVM.js.map → chunk-IW6FSDIT.js.map} +0 -0
- /package/dist/{chunk-AKV7ZQJL.js.map → chunk-PNUDVGMI.js.map} +0 -0
- /package/dist/{chunk-LBOTY2AI.js.map → chunk-TVCZXO6G.js.map} +0 -0
- /package/dist/{chunk-KBCOCHKM.js.map → chunk-VYTIGF3V.js.map} +0 -0
- /package/dist/{chunk-BSN2YFRJ.js.map → chunk-WZH3Y3BL.js.map} +0 -0
- /package/dist/{menu-bar-F6FGQVWO.js.map → menu-bar-67LDC7IR.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -3019,6 +3019,8 @@ interface DataTableProps<T> {
|
|
|
3019
3019
|
/** Double-click leaf headers to auto-fit column width based on visible content. Default: true */
|
|
3020
3020
|
enableHeaderAutoFit?: boolean;
|
|
3021
3021
|
labels?: DataTableLabels;
|
|
3022
|
+
/** Optional override for sort button label prefix across all sortable column headers */
|
|
3023
|
+
sortByLabel?: string;
|
|
3022
3024
|
borderMode?: BorderMode;
|
|
3023
3025
|
/** Resolve the document element that should receive table dropdown portals. */
|
|
3024
3026
|
getPortalContainer?: () => HTMLElement | null;
|
|
@@ -3026,7 +3028,7 @@ interface DataTableProps<T> {
|
|
|
3026
3028
|
paginationVariant?: "default" | "classic";
|
|
3027
3029
|
}
|
|
3028
3030
|
|
|
3029
|
-
declare function DataTable<T extends Record<string, any>>({ columns, data, rowKey, loading, total, page, pageSize, pageSizeOptions, onQueryChange, caption, toolbar, showToolbar, size, enableColumnVisibilityToggle, enableDensityToggle, enableHeaderAlignToggle, uppercaseHeader, striped, columnDividers, className, storageKey, stickyHeader, maxHeight, horizontalMode, overflowHidden, useOverlayScrollbar, virtualizedRows, estimatedRowHeight, overscan, paginationAlign, paginationRange, enableHeaderAutoFit, labels, columnColorGroups, borderMode, getPortalContainer, paginationVariant, }: DataTableProps<T>): React__default.JSX.Element;
|
|
3031
|
+
declare function DataTable<T extends Record<string, any>>({ columns, data, rowKey, loading, total, page, pageSize, pageSizeOptions, onQueryChange, caption, toolbar, showToolbar, size, enableColumnVisibilityToggle, enableDensityToggle, enableHeaderAlignToggle, uppercaseHeader, striped, columnDividers, className, storageKey, stickyHeader, maxHeight, horizontalMode, overflowHidden, useOverlayScrollbar, virtualizedRows, estimatedRowHeight, overscan, paginationAlign, paginationRange, enableHeaderAutoFit, labels, sortByLabel, columnColorGroups, borderMode, getPortalContainer, paginationVariant, }: DataTableProps<T>): React__default.JSX.Element;
|
|
3030
3032
|
|
|
3031
3033
|
/** Public props for the `Table` component. */
|
|
3032
3034
|
interface TableProps extends React__default.HTMLAttributes<HTMLTableElement> {
|
|
@@ -3686,6 +3688,8 @@ declare const underverseMessages: {
|
|
|
3686
3688
|
alignLeft: string;
|
|
3687
3689
|
alignCenter: string;
|
|
3688
3690
|
alignRight: string;
|
|
3691
|
+
sortBy: string;
|
|
3692
|
+
filterBy: string;
|
|
3689
3693
|
};
|
|
3690
3694
|
ValidationInput: {
|
|
3691
3695
|
required: string;
|
|
@@ -4158,6 +4162,8 @@ declare const underverseMessages: {
|
|
|
4158
4162
|
alignLeft: string;
|
|
4159
4163
|
alignCenter: string;
|
|
4160
4164
|
alignRight: string;
|
|
4165
|
+
sortBy: string;
|
|
4166
|
+
filterBy: string;
|
|
4161
4167
|
};
|
|
4162
4168
|
ValidationInput: {
|
|
4163
4169
|
required: string;
|
|
@@ -4630,6 +4636,8 @@ declare const underverseMessages: {
|
|
|
4630
4636
|
alignLeft: string;
|
|
4631
4637
|
alignCenter: string;
|
|
4632
4638
|
alignRight: string;
|
|
4639
|
+
sortBy: string;
|
|
4640
|
+
filterBy: string;
|
|
4633
4641
|
};
|
|
4634
4642
|
ValidationInput: {
|
|
4635
4643
|
required: string;
|
|
@@ -5102,6 +5110,8 @@ declare const underverseMessages: {
|
|
|
5102
5110
|
alignLeft: string;
|
|
5103
5111
|
alignCenter: string;
|
|
5104
5112
|
alignRight: string;
|
|
5113
|
+
sortBy: string;
|
|
5114
|
+
filterBy: string;
|
|
5105
5115
|
};
|
|
5106
5116
|
ValidationInput: {
|
|
5107
5117
|
required: string;
|
|
@@ -5577,6 +5587,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
|
|
|
5577
5587
|
alignLeft: string;
|
|
5578
5588
|
alignCenter: string;
|
|
5579
5589
|
alignRight: string;
|
|
5590
|
+
sortBy: string;
|
|
5591
|
+
filterBy: string;
|
|
5580
5592
|
};
|
|
5581
5593
|
ValidationInput: {
|
|
5582
5594
|
required: string;
|
|
@@ -6048,6 +6060,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
|
|
|
6048
6060
|
alignLeft: string;
|
|
6049
6061
|
alignCenter: string;
|
|
6050
6062
|
alignRight: string;
|
|
6063
|
+
sortBy: string;
|
|
6064
|
+
filterBy: string;
|
|
6051
6065
|
};
|
|
6052
6066
|
ValidationInput: {
|
|
6053
6067
|
required: string;
|
|
@@ -6519,6 +6533,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
|
|
|
6519
6533
|
alignLeft: string;
|
|
6520
6534
|
alignCenter: string;
|
|
6521
6535
|
alignRight: string;
|
|
6536
|
+
sortBy: string;
|
|
6537
|
+
filterBy: string;
|
|
6522
6538
|
};
|
|
6523
6539
|
ValidationInput: {
|
|
6524
6540
|
required: string;
|
|
@@ -6990,6 +7006,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
|
|
|
6990
7006
|
alignLeft: string;
|
|
6991
7007
|
alignCenter: string;
|
|
6992
7008
|
alignRight: string;
|
|
7009
|
+
sortBy: string;
|
|
7010
|
+
filterBy: string;
|
|
6993
7011
|
};
|
|
6994
7012
|
ValidationInput: {
|
|
6995
7013
|
required: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -3019,6 +3019,8 @@ interface DataTableProps<T> {
|
|
|
3019
3019
|
/** Double-click leaf headers to auto-fit column width based on visible content. Default: true */
|
|
3020
3020
|
enableHeaderAutoFit?: boolean;
|
|
3021
3021
|
labels?: DataTableLabels;
|
|
3022
|
+
/** Optional override for sort button label prefix across all sortable column headers */
|
|
3023
|
+
sortByLabel?: string;
|
|
3022
3024
|
borderMode?: BorderMode;
|
|
3023
3025
|
/** Resolve the document element that should receive table dropdown portals. */
|
|
3024
3026
|
getPortalContainer?: () => HTMLElement | null;
|
|
@@ -3026,7 +3028,7 @@ interface DataTableProps<T> {
|
|
|
3026
3028
|
paginationVariant?: "default" | "classic";
|
|
3027
3029
|
}
|
|
3028
3030
|
|
|
3029
|
-
declare function DataTable<T extends Record<string, any>>({ columns, data, rowKey, loading, total, page, pageSize, pageSizeOptions, onQueryChange, caption, toolbar, showToolbar, size, enableColumnVisibilityToggle, enableDensityToggle, enableHeaderAlignToggle, uppercaseHeader, striped, columnDividers, className, storageKey, stickyHeader, maxHeight, horizontalMode, overflowHidden, useOverlayScrollbar, virtualizedRows, estimatedRowHeight, overscan, paginationAlign, paginationRange, enableHeaderAutoFit, labels, columnColorGroups, borderMode, getPortalContainer, paginationVariant, }: DataTableProps<T>): React__default.JSX.Element;
|
|
3031
|
+
declare function DataTable<T extends Record<string, any>>({ columns, data, rowKey, loading, total, page, pageSize, pageSizeOptions, onQueryChange, caption, toolbar, showToolbar, size, enableColumnVisibilityToggle, enableDensityToggle, enableHeaderAlignToggle, uppercaseHeader, striped, columnDividers, className, storageKey, stickyHeader, maxHeight, horizontalMode, overflowHidden, useOverlayScrollbar, virtualizedRows, estimatedRowHeight, overscan, paginationAlign, paginationRange, enableHeaderAutoFit, labels, sortByLabel, columnColorGroups, borderMode, getPortalContainer, paginationVariant, }: DataTableProps<T>): React__default.JSX.Element;
|
|
3030
3032
|
|
|
3031
3033
|
/** Public props for the `Table` component. */
|
|
3032
3034
|
interface TableProps extends React__default.HTMLAttributes<HTMLTableElement> {
|
|
@@ -3686,6 +3688,8 @@ declare const underverseMessages: {
|
|
|
3686
3688
|
alignLeft: string;
|
|
3687
3689
|
alignCenter: string;
|
|
3688
3690
|
alignRight: string;
|
|
3691
|
+
sortBy: string;
|
|
3692
|
+
filterBy: string;
|
|
3689
3693
|
};
|
|
3690
3694
|
ValidationInput: {
|
|
3691
3695
|
required: string;
|
|
@@ -4158,6 +4162,8 @@ declare const underverseMessages: {
|
|
|
4158
4162
|
alignLeft: string;
|
|
4159
4163
|
alignCenter: string;
|
|
4160
4164
|
alignRight: string;
|
|
4165
|
+
sortBy: string;
|
|
4166
|
+
filterBy: string;
|
|
4161
4167
|
};
|
|
4162
4168
|
ValidationInput: {
|
|
4163
4169
|
required: string;
|
|
@@ -4630,6 +4636,8 @@ declare const underverseMessages: {
|
|
|
4630
4636
|
alignLeft: string;
|
|
4631
4637
|
alignCenter: string;
|
|
4632
4638
|
alignRight: string;
|
|
4639
|
+
sortBy: string;
|
|
4640
|
+
filterBy: string;
|
|
4633
4641
|
};
|
|
4634
4642
|
ValidationInput: {
|
|
4635
4643
|
required: string;
|
|
@@ -5102,6 +5110,8 @@ declare const underverseMessages: {
|
|
|
5102
5110
|
alignLeft: string;
|
|
5103
5111
|
alignCenter: string;
|
|
5104
5112
|
alignRight: string;
|
|
5113
|
+
sortBy: string;
|
|
5114
|
+
filterBy: string;
|
|
5105
5115
|
};
|
|
5106
5116
|
ValidationInput: {
|
|
5107
5117
|
required: string;
|
|
@@ -5577,6 +5587,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
|
|
|
5577
5587
|
alignLeft: string;
|
|
5578
5588
|
alignCenter: string;
|
|
5579
5589
|
alignRight: string;
|
|
5590
|
+
sortBy: string;
|
|
5591
|
+
filterBy: string;
|
|
5580
5592
|
};
|
|
5581
5593
|
ValidationInput: {
|
|
5582
5594
|
required: string;
|
|
@@ -6048,6 +6060,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
|
|
|
6048
6060
|
alignLeft: string;
|
|
6049
6061
|
alignCenter: string;
|
|
6050
6062
|
alignRight: string;
|
|
6063
|
+
sortBy: string;
|
|
6064
|
+
filterBy: string;
|
|
6051
6065
|
};
|
|
6052
6066
|
ValidationInput: {
|
|
6053
6067
|
required: string;
|
|
@@ -6519,6 +6533,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
|
|
|
6519
6533
|
alignLeft: string;
|
|
6520
6534
|
alignCenter: string;
|
|
6521
6535
|
alignRight: string;
|
|
6536
|
+
sortBy: string;
|
|
6537
|
+
filterBy: string;
|
|
6522
6538
|
};
|
|
6523
6539
|
ValidationInput: {
|
|
6524
6540
|
required: string;
|
|
@@ -6990,6 +7006,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
|
|
|
6990
7006
|
alignLeft: string;
|
|
6991
7007
|
alignCenter: string;
|
|
6992
7008
|
alignRight: string;
|
|
7009
|
+
sortBy: string;
|
|
7010
|
+
filterBy: string;
|
|
6993
7011
|
};
|
|
6994
7012
|
ValidationInput: {
|
|
6995
7013
|
required: string;
|
package/dist/index.js
CHANGED
|
@@ -4,35 +4,35 @@ import {
|
|
|
4
4
|
extractImageSrcsFromHtml,
|
|
5
5
|
normalizeImageUrl,
|
|
6
6
|
prepareUEditorContentForSave
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GKUKLOSO.js";
|
|
8
8
|
import {
|
|
9
9
|
EmojiPicker_default
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VYTIGF3V.js";
|
|
11
11
|
import {
|
|
12
12
|
getEmojiImageUrl,
|
|
13
13
|
getEmojiUnifiedCode,
|
|
14
14
|
setEmojiBaseUrl
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WZH3Y3BL.js";
|
|
16
16
|
import "./chunk-4TYW5K4J.js";
|
|
17
17
|
import {
|
|
18
18
|
CompactDatePicker,
|
|
19
19
|
DatePicker,
|
|
20
20
|
DateRangePicker,
|
|
21
21
|
date_exports
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-C2EHPHWH.js";
|
|
23
23
|
import {
|
|
24
24
|
Modal_default
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-CJ6RPCJN.js";
|
|
26
26
|
import {
|
|
27
27
|
DropdownMenuItem,
|
|
28
28
|
DropdownMenuSeparator,
|
|
29
29
|
DropdownMenu_default,
|
|
30
30
|
SelectDropdown
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-TVCZXO6G.js";
|
|
32
32
|
import {
|
|
33
33
|
Tooltip,
|
|
34
34
|
useHydrated
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-IW6FSDIT.js";
|
|
36
36
|
import {
|
|
37
37
|
Popover,
|
|
38
38
|
UnderverseConfigProvider,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
shadcnAnimationStyles,
|
|
44
44
|
useShadCNAnimations,
|
|
45
45
|
useUnderverseUIConfig
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-PNUDVGMI.js";
|
|
47
47
|
import {
|
|
48
48
|
ForceInternalTranslationsProvider,
|
|
49
49
|
NextIntlAdapter,
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
useUnderverseLocale,
|
|
69
69
|
useUnderverseTranslations,
|
|
70
70
|
vi_default
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-PSWS64LA.js";
|
|
72
72
|
import {
|
|
73
73
|
__export,
|
|
74
74
|
__require
|
|
@@ -20289,9 +20289,55 @@ function DataTableHeader({
|
|
|
20289
20289
|
const isRightAlign = resolvedHeaderAlign === "right";
|
|
20290
20290
|
const isCenterAlign = resolvedHeaderAlign === "center";
|
|
20291
20291
|
const columnLabel = getColumnLabel(col.title) || col.key;
|
|
20292
|
-
const sortByText = sortByLabel ?? gi18n.sortBy ?? "
|
|
20293
|
-
const sortLabel = `${sortByText} ${columnLabel}
|
|
20292
|
+
const sortByText = sortByLabel ?? gi18n.sortBy ?? (t("sortBy") !== "sortBy" ? t("sortBy") : void 0);
|
|
20293
|
+
const sortLabel = sortByText ? `${sortByText} ${columnLabel}` : columnLabel;
|
|
20294
|
+
const hasSortTooltip = Boolean(sortByText);
|
|
20294
20295
|
const useEndIcon = (col.iconPosition ?? "end") === "end";
|
|
20296
|
+
const sortButton = /* @__PURE__ */ jsx57(
|
|
20297
|
+
"button",
|
|
20298
|
+
{
|
|
20299
|
+
type: "button",
|
|
20300
|
+
className: cn(
|
|
20301
|
+
"p-1 rounded-lg transition-all duration-200 hover:bg-foreground/10",
|
|
20302
|
+
useEndIcon && isCenterAlign && "col-start-3 justify-self-end",
|
|
20303
|
+
sort?.key === col.key ? "opacity-100 bg-foreground/10" : "opacity-60 hover:opacity-100"
|
|
20304
|
+
),
|
|
20305
|
+
onClick: () => {
|
|
20306
|
+
setCurPage(1);
|
|
20307
|
+
setSort((current) => {
|
|
20308
|
+
if (!current || current.key !== col.key) return { key: col.key, order: "asc" };
|
|
20309
|
+
if (current.order === "asc") return { key: col.key, order: "desc" };
|
|
20310
|
+
return null;
|
|
20311
|
+
});
|
|
20312
|
+
},
|
|
20313
|
+
"aria-label": sortLabel,
|
|
20314
|
+
title: hasSortTooltip ? sortLabel : void 0,
|
|
20315
|
+
children: /* @__PURE__ */ jsxs49("svg", { viewBox: "0 0 20 20", fill: "none", className: cn("inline-block", sortIconClass), children: [
|
|
20316
|
+
/* @__PURE__ */ jsx57(
|
|
20317
|
+
"path",
|
|
20318
|
+
{
|
|
20319
|
+
d: "M5 7.5l5-5 5 5",
|
|
20320
|
+
stroke: "currentColor",
|
|
20321
|
+
strokeWidth: "1.5",
|
|
20322
|
+
strokeLinecap: "round",
|
|
20323
|
+
strokeLinejoin: "round",
|
|
20324
|
+
opacity: sort?.key === col.key && sort.order === "asc" ? 1 : 0.4
|
|
20325
|
+
}
|
|
20326
|
+
),
|
|
20327
|
+
/* @__PURE__ */ jsx57(
|
|
20328
|
+
"path",
|
|
20329
|
+
{
|
|
20330
|
+
d: "M5 12.5l5 5 5-5",
|
|
20331
|
+
stroke: "currentColor",
|
|
20332
|
+
strokeWidth: "1.5",
|
|
20333
|
+
strokeLinecap: "round",
|
|
20334
|
+
strokeLinejoin: "round",
|
|
20335
|
+
opacity: sort?.key === col.key && sort.order === "desc" ? 1 : 0.4
|
|
20336
|
+
}
|
|
20337
|
+
)
|
|
20338
|
+
] })
|
|
20339
|
+
}
|
|
20340
|
+
);
|
|
20295
20341
|
const titleContent = /* @__PURE__ */ jsxs49(
|
|
20296
20342
|
"div",
|
|
20297
20343
|
{
|
|
@@ -20313,85 +20359,46 @@ function DataTableHeader({
|
|
|
20313
20359
|
children: col.title
|
|
20314
20360
|
}
|
|
20315
20361
|
),
|
|
20316
|
-
col.sortable && /* @__PURE__ */ jsx57(
|
|
20362
|
+
col.sortable && (hasSortTooltip ? /* @__PURE__ */ jsx57(
|
|
20317
20363
|
Tooltip,
|
|
20318
20364
|
{
|
|
20319
20365
|
placement: "top",
|
|
20320
20366
|
content: /* @__PURE__ */ jsx57("span", { className: "text-xs font-medium", children: sortLabel }),
|
|
20321
|
-
children:
|
|
20322
|
-
"button",
|
|
20323
|
-
{
|
|
20324
|
-
type: "button",
|
|
20325
|
-
className: cn(
|
|
20326
|
-
"p-1 rounded-lg transition-all duration-200 hover:bg-foreground/10",
|
|
20327
|
-
useEndIcon && isCenterAlign && "col-start-3 justify-self-end",
|
|
20328
|
-
sort?.key === col.key ? "opacity-100 bg-foreground/10" : "opacity-60 hover:opacity-100"
|
|
20329
|
-
),
|
|
20330
|
-
onClick: () => {
|
|
20331
|
-
setCurPage(1);
|
|
20332
|
-
setSort((current) => {
|
|
20333
|
-
if (!current || current.key !== col.key) return { key: col.key, order: "asc" };
|
|
20334
|
-
if (current.order === "asc") return { key: col.key, order: "desc" };
|
|
20335
|
-
return null;
|
|
20336
|
-
});
|
|
20337
|
-
},
|
|
20338
|
-
"aria-label": sortLabel,
|
|
20339
|
-
children: /* @__PURE__ */ jsxs49("svg", { viewBox: "0 0 20 20", fill: "none", className: cn("inline-block", sortIconClass), children: [
|
|
20340
|
-
/* @__PURE__ */ jsx57(
|
|
20341
|
-
"path",
|
|
20342
|
-
{
|
|
20343
|
-
d: "M5 7.5l5-5 5 5",
|
|
20344
|
-
stroke: "currentColor",
|
|
20345
|
-
strokeWidth: "1.5",
|
|
20346
|
-
strokeLinecap: "round",
|
|
20347
|
-
strokeLinejoin: "round",
|
|
20348
|
-
opacity: sort?.key === col.key && sort.order === "asc" ? 1 : 0.4
|
|
20349
|
-
}
|
|
20350
|
-
),
|
|
20351
|
-
/* @__PURE__ */ jsx57(
|
|
20352
|
-
"path",
|
|
20353
|
-
{
|
|
20354
|
-
d: "M5 12.5l5 5 5-5",
|
|
20355
|
-
stroke: "currentColor",
|
|
20356
|
-
strokeWidth: "1.5",
|
|
20357
|
-
strokeLinecap: "round",
|
|
20358
|
-
strokeLinejoin: "round",
|
|
20359
|
-
opacity: sort?.key === col.key && sort.order === "desc" ? 1 : 0.4
|
|
20360
|
-
}
|
|
20361
|
-
)
|
|
20362
|
-
] })
|
|
20363
|
-
}
|
|
20364
|
-
)
|
|
20367
|
+
children: sortButton
|
|
20365
20368
|
}
|
|
20366
|
-
)
|
|
20369
|
+
) : sortButton)
|
|
20367
20370
|
]
|
|
20368
20371
|
}
|
|
20369
20372
|
);
|
|
20373
|
+
const filterText = gi18n.filterByColumn ? gi18n.filterByColumn(columnLabel) : t("filterByColumn") !== "filterByColumn" ? t("filterByColumn").replace("{column}", columnLabel) : t("filterBy") !== "filterBy" ? `${t("filterBy")} ${columnLabel}` : void 0;
|
|
20374
|
+
const filterLabel = filterText ?? columnLabel;
|
|
20375
|
+
const hasFilterTooltip = Boolean(filterText);
|
|
20376
|
+
const filterButton = /* @__PURE__ */ jsx57(
|
|
20377
|
+
"button",
|
|
20378
|
+
{
|
|
20379
|
+
type: "button",
|
|
20380
|
+
title: hasFilterTooltip ? filterLabel : void 0,
|
|
20381
|
+
className: cn(
|
|
20382
|
+
"p-1.5 rounded-lg transition-all duration-200 hover:bg-foreground/10",
|
|
20383
|
+
filters[col.key] ? "bg-foreground/10 opacity-100" : "opacity-60 hover:opacity-100"
|
|
20384
|
+
),
|
|
20385
|
+
"aria-label": filterLabel,
|
|
20386
|
+
children: /* @__PURE__ */ jsx57(FilterIcon, { className: "w-4 h-4" })
|
|
20387
|
+
}
|
|
20388
|
+
);
|
|
20370
20389
|
const filterContent = col.filter ? /* @__PURE__ */ jsx57(
|
|
20371
20390
|
Popover,
|
|
20372
20391
|
{
|
|
20373
20392
|
getPortalContainer,
|
|
20374
20393
|
placement: "bottom-start",
|
|
20375
|
-
trigger: /* @__PURE__ */ jsx57("span", { className: "inline-flex", children: /* @__PURE__ */ jsx57(
|
|
20394
|
+
trigger: /* @__PURE__ */ jsx57("span", { className: "inline-flex", children: hasFilterTooltip ? /* @__PURE__ */ jsx57(
|
|
20376
20395
|
Tooltip,
|
|
20377
20396
|
{
|
|
20378
20397
|
placement: "top",
|
|
20379
|
-
content: /* @__PURE__ */ jsx57("span", { className: "text-xs font-medium", children:
|
|
20380
|
-
children:
|
|
20381
|
-
"button",
|
|
20382
|
-
{
|
|
20383
|
-
type: "button",
|
|
20384
|
-
title: gi18n.filterByColumn ? gi18n.filterByColumn(columnLabel) : `Filter by ${columnLabel}`,
|
|
20385
|
-
className: cn(
|
|
20386
|
-
"p-1.5 rounded-lg transition-all duration-200 hover:bg-foreground/10",
|
|
20387
|
-
filters[col.key] ? "bg-foreground/10 opacity-100" : "opacity-60 hover:opacity-100"
|
|
20388
|
-
),
|
|
20389
|
-
"aria-label": gi18n.filterByColumn ? gi18n.filterByColumn(columnLabel) : `Filter by ${columnLabel}`,
|
|
20390
|
-
children: /* @__PURE__ */ jsx57(FilterIcon, { className: "w-4 h-4" })
|
|
20391
|
-
}
|
|
20392
|
-
)
|
|
20398
|
+
content: /* @__PURE__ */ jsx57("span", { className: "text-xs font-medium", children: filterLabel }),
|
|
20399
|
+
children: filterButton
|
|
20393
20400
|
}
|
|
20394
|
-
) }),
|
|
20401
|
+
) : filterButton }),
|
|
20395
20402
|
children: /* @__PURE__ */ jsxs49("div", { className: "p-3 w-64 space-y-3", children: [
|
|
20396
20403
|
/* @__PURE__ */ jsxs49("div", { className: "flex items-center justify-between", children: [
|
|
20397
20404
|
/* @__PURE__ */ jsx57("div", { className: "text-sm font-medium", children: col.title }),
|
|
@@ -20480,36 +20487,42 @@ function DataTableHeader({
|
|
|
20480
20487
|
),
|
|
20481
20488
|
children: [
|
|
20482
20489
|
renderHeaderContent(col, isLeaf),
|
|
20483
|
-
isLeaf && enableHeaderAutoFit &&
|
|
20484
|
-
|
|
20485
|
-
{
|
|
20486
|
-
|
|
20487
|
-
|
|
20488
|
-
|
|
20489
|
-
"button",
|
|
20490
|
-
|
|
20491
|
-
|
|
20492
|
-
|
|
20493
|
-
|
|
20494
|
-
|
|
20495
|
-
|
|
20496
|
-
|
|
20497
|
-
|
|
20498
|
-
|
|
20499
|
-
|
|
20500
|
-
|
|
20501
|
-
|
|
20502
|
-
|
|
20503
|
-
|
|
20504
|
-
|
|
20505
|
-
|
|
20506
|
-
|
|
20507
|
-
|
|
20508
|
-
|
|
20509
|
-
|
|
20510
|
-
|
|
20511
|
-
|
|
20512
|
-
|
|
20490
|
+
isLeaf && enableHeaderAutoFit && (() => {
|
|
20491
|
+
const autoFitTooltipText = t("doubleClickToAutoFit") !== "doubleClickToAutoFit" ? t("doubleClickToAutoFit") : void 0;
|
|
20492
|
+
const autoFitAriaLabel = gi18n.autoFitColumn ? gi18n.autoFitColumn(String(col.title)) : t("autoFitColumn") !== "autoFitColumn" ? t("autoFitColumn").replace("{column}", String(col.title)) : autoFitTooltipText ? `${autoFitTooltipText} ${String(col.title)}` : `Auto fit ${String(col.title)}`;
|
|
20493
|
+
const autoFitButton = /* @__PURE__ */ jsx57(
|
|
20494
|
+
"button",
|
|
20495
|
+
{
|
|
20496
|
+
type: "button",
|
|
20497
|
+
"aria-label": autoFitAriaLabel,
|
|
20498
|
+
title: autoFitTooltipText,
|
|
20499
|
+
onClick: (event) => {
|
|
20500
|
+
event.preventDefault();
|
|
20501
|
+
event.stopPropagation();
|
|
20502
|
+
},
|
|
20503
|
+
onDoubleClick: (event) => {
|
|
20504
|
+
event.preventDefault();
|
|
20505
|
+
event.stopPropagation();
|
|
20506
|
+
onAutoFitColumn?.(col.key);
|
|
20507
|
+
},
|
|
20508
|
+
className: cn(
|
|
20509
|
+
"absolute inset-y-0 right-0 z-10 w-3",
|
|
20510
|
+
!isLastCell && "-mr-1",
|
|
20511
|
+
"cursor-col-resize select-none bg-transparent",
|
|
20512
|
+
"after:absolute after:inset-y-2 after:right-0.8 after:w-px after:bg-border/0 after:transition-colors",
|
|
20513
|
+
"hover:after:bg-primary/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary"
|
|
20514
|
+
)
|
|
20515
|
+
}
|
|
20516
|
+
);
|
|
20517
|
+
return autoFitTooltipText ? /* @__PURE__ */ jsx57(
|
|
20518
|
+
Tooltip,
|
|
20519
|
+
{
|
|
20520
|
+
placement: "top",
|
|
20521
|
+
content: /* @__PURE__ */ jsx57("span", { className: "text-xs font-medium", children: autoFitTooltipText }),
|
|
20522
|
+
children: autoFitButton
|
|
20523
|
+
}
|
|
20524
|
+
) : autoFitButton;
|
|
20525
|
+
})()
|
|
20513
20526
|
]
|
|
20514
20527
|
},
|
|
20515
20528
|
col.key
|
|
@@ -21380,6 +21393,7 @@ function DataTable({
|
|
|
21380
21393
|
paginationRange,
|
|
21381
21394
|
enableHeaderAutoFit = true,
|
|
21382
21395
|
labels,
|
|
21396
|
+
sortByLabel,
|
|
21383
21397
|
columnColorGroups,
|
|
21384
21398
|
borderMode,
|
|
21385
21399
|
getPortalContainer,
|
|
@@ -21589,7 +21603,7 @@ function DataTable({
|
|
|
21589
21603
|
enableHeaderAutoFit,
|
|
21590
21604
|
getStickyHeaderClass,
|
|
21591
21605
|
getStickyHeaderCellStyle,
|
|
21592
|
-
sortByLabel: labels?.sortBy,
|
|
21606
|
+
sortByLabel: sortByLabel ?? labels?.sortBy,
|
|
21593
21607
|
t,
|
|
21594
21608
|
columnColorGroups,
|
|
21595
21609
|
getPortalContainer
|