@underverse-ui/underverse 2.0.40 → 2.0.42

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.
Files changed (37) hide show
  1. package/api-reference.json +1 -1
  2. package/dist/{DatePicker-3IHOADO5.js → DatePicker-VRS4SBIH.js} +4 -4
  3. package/dist/{EmojiPicker-5MEENOF7.js → EmojiPicker-NKY2LOGI.js} +5 -5
  4. package/dist/{chunk-ZCW2WBNT.js → chunk-7YU3O5JK.js} +9 -9
  5. package/dist/{chunk-GY6P6WZB.js → chunk-CJ6RPCJN.js} +3 -3
  6. package/dist/{chunk-THBABGVM.js → chunk-IW6FSDIT.js} +2 -2
  7. package/dist/{chunk-AKV7ZQJL.js → chunk-PNUDVGMI.js} +2 -2
  8. package/dist/{chunk-4MX7S6TM.js → chunk-PSWS64LA.js} +13 -5
  9. package/dist/chunk-PSWS64LA.js.map +1 -0
  10. package/dist/{chunk-LBOTY2AI.js → chunk-TVCZXO6G.js} +4 -4
  11. package/dist/{chunk-KBCOCHKM.js → chunk-VYTIGF3V.js} +4 -4
  12. package/dist/{chunk-BSN2YFRJ.js → chunk-WZH3Y3BL.js} +2 -2
  13. package/dist/{chunk-2K443MQP.js → chunk-YNALZEN6.js} +13 -7
  14. package/dist/chunk-YNALZEN6.js.map +1 -0
  15. package/dist/index.cjs +139 -103
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +27 -1
  18. package/dist/index.d.ts +27 -1
  19. package/dist/index.js +126 -104
  20. package/dist/index.js.map +1 -1
  21. package/dist/{menu-bar-F6FGQVWO.js → menu-bar-67LDC7IR.js} +6 -6
  22. package/dist/ueditor.cjs +22 -8
  23. package/dist/ueditor.cjs.map +1 -1
  24. package/dist/ueditor.js +6 -6
  25. package/package.json +1 -1
  26. package/dist/chunk-2K443MQP.js.map +0 -1
  27. package/dist/chunk-4MX7S6TM.js.map +0 -1
  28. /package/dist/{DatePicker-3IHOADO5.js.map → DatePicker-VRS4SBIH.js.map} +0 -0
  29. /package/dist/{EmojiPicker-5MEENOF7.js.map → EmojiPicker-NKY2LOGI.js.map} +0 -0
  30. /package/dist/{chunk-ZCW2WBNT.js.map → chunk-7YU3O5JK.js.map} +0 -0
  31. /package/dist/{chunk-GY6P6WZB.js.map → chunk-CJ6RPCJN.js.map} +0 -0
  32. /package/dist/{chunk-THBABGVM.js.map → chunk-IW6FSDIT.js.map} +0 -0
  33. /package/dist/{chunk-AKV7ZQJL.js.map → chunk-PNUDVGMI.js.map} +0 -0
  34. /package/dist/{chunk-LBOTY2AI.js.map → chunk-TVCZXO6G.js.map} +0 -0
  35. /package/dist/{chunk-KBCOCHKM.js.map → chunk-VYTIGF3V.js.map} +0 -0
  36. /package/dist/{chunk-BSN2YFRJ.js.map → chunk-WZH3Y3BL.js.map} +0 -0
  37. /package/dist/{menu-bar-F6FGQVWO.js.map → menu-bar-67LDC7IR.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -1034,6 +1034,8 @@ interface DatePickerProps {
1034
1034
  id?: string;
1035
1035
  value?: Date;
1036
1036
  onChange: (date: Date | undefined) => void;
1037
+ /** Custom date display formatter function */
1038
+ formatDate?: (date: Date) => string;
1037
1039
  placeholder?: string;
1038
1040
  className?: string;
1039
1041
  disabled?: boolean;
@@ -1066,6 +1068,8 @@ interface DateRangePickerProps {
1066
1068
  startDate?: Date;
1067
1069
  endDate?: Date | null;
1068
1070
  onChange: (start: Date | undefined, end: Date | null | undefined) => void;
1071
+ /** Custom date display formatter function applied to both start and end date */
1072
+ formatDate?: (date: Date) => string;
1069
1073
  placeholder?: string;
1070
1074
  className?: string;
1071
1075
  label?: string;
@@ -1144,6 +1148,8 @@ interface LunarDatePickerProps {
1144
1148
  id?: string;
1145
1149
  value?: LunarPickerValue;
1146
1150
  onChange: (date: LunarPickerValue | undefined) => void;
1151
+ /** Custom date display formatter function */
1152
+ formatDate?: (date: LunarPickerValue) => string;
1147
1153
  placeholder?: string;
1148
1154
  className?: string;
1149
1155
  disabled?: boolean;
@@ -1171,6 +1177,8 @@ interface LunarDateRangePickerProps {
1171
1177
  startDate?: LunarPickerValue;
1172
1178
  endDate?: LunarPickerValue | null;
1173
1179
  onChange: (start: LunarPickerValue | undefined, end: LunarPickerValue | null | undefined) => void;
1180
+ /** Custom date display formatter function applied to both start and end date */
1181
+ formatDate?: (date: LunarPickerValue) => string;
1174
1182
  placeholder?: string;
1175
1183
  className?: string;
1176
1184
  label?: string;
@@ -3019,6 +3027,8 @@ interface DataTableProps<T> {
3019
3027
  /** Double-click leaf headers to auto-fit column width based on visible content. Default: true */
3020
3028
  enableHeaderAutoFit?: boolean;
3021
3029
  labels?: DataTableLabels;
3030
+ /** Optional override for sort button label prefix across all sortable column headers */
3031
+ sortByLabel?: string;
3022
3032
  borderMode?: BorderMode;
3023
3033
  /** Resolve the document element that should receive table dropdown portals. */
3024
3034
  getPortalContainer?: () => HTMLElement | null;
@@ -3026,7 +3036,7 @@ interface DataTableProps<T> {
3026
3036
  paginationVariant?: "default" | "classic";
3027
3037
  }
3028
3038
 
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;
3039
+ 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
3040
 
3031
3041
  /** Public props for the `Table` component. */
3032
3042
  interface TableProps extends React__default.HTMLAttributes<HTMLTableElement> {
@@ -3686,6 +3696,8 @@ declare const underverseMessages: {
3686
3696
  alignLeft: string;
3687
3697
  alignCenter: string;
3688
3698
  alignRight: string;
3699
+ sortBy: string;
3700
+ filterBy: string;
3689
3701
  };
3690
3702
  ValidationInput: {
3691
3703
  required: string;
@@ -4158,6 +4170,8 @@ declare const underverseMessages: {
4158
4170
  alignLeft: string;
4159
4171
  alignCenter: string;
4160
4172
  alignRight: string;
4173
+ sortBy: string;
4174
+ filterBy: string;
4161
4175
  };
4162
4176
  ValidationInput: {
4163
4177
  required: string;
@@ -4630,6 +4644,8 @@ declare const underverseMessages: {
4630
4644
  alignLeft: string;
4631
4645
  alignCenter: string;
4632
4646
  alignRight: string;
4647
+ sortBy: string;
4648
+ filterBy: string;
4633
4649
  };
4634
4650
  ValidationInput: {
4635
4651
  required: string;
@@ -5102,6 +5118,8 @@ declare const underverseMessages: {
5102
5118
  alignLeft: string;
5103
5119
  alignCenter: string;
5104
5120
  alignRight: string;
5121
+ sortBy: string;
5122
+ filterBy: string;
5105
5123
  };
5106
5124
  ValidationInput: {
5107
5125
  required: string;
@@ -5577,6 +5595,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
5577
5595
  alignLeft: string;
5578
5596
  alignCenter: string;
5579
5597
  alignRight: string;
5598
+ sortBy: string;
5599
+ filterBy: string;
5580
5600
  };
5581
5601
  ValidationInput: {
5582
5602
  required: string;
@@ -6048,6 +6068,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
6048
6068
  alignLeft: string;
6049
6069
  alignCenter: string;
6050
6070
  alignRight: string;
6071
+ sortBy: string;
6072
+ filterBy: string;
6051
6073
  };
6052
6074
  ValidationInput: {
6053
6075
  required: string;
@@ -6519,6 +6541,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
6519
6541
  alignLeft: string;
6520
6542
  alignCenter: string;
6521
6543
  alignRight: string;
6544
+ sortBy: string;
6545
+ filterBy: string;
6522
6546
  };
6523
6547
  ValidationInput: {
6524
6548
  required: string;
@@ -6990,6 +7014,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
6990
7014
  alignLeft: string;
6991
7015
  alignCenter: string;
6992
7016
  alignRight: string;
7017
+ sortBy: string;
7018
+ filterBy: string;
6993
7019
  };
6994
7020
  ValidationInput: {
6995
7021
  required: string;
package/dist/index.d.ts CHANGED
@@ -1034,6 +1034,8 @@ interface DatePickerProps {
1034
1034
  id?: string;
1035
1035
  value?: Date;
1036
1036
  onChange: (date: Date | undefined) => void;
1037
+ /** Custom date display formatter function */
1038
+ formatDate?: (date: Date) => string;
1037
1039
  placeholder?: string;
1038
1040
  className?: string;
1039
1041
  disabled?: boolean;
@@ -1066,6 +1068,8 @@ interface DateRangePickerProps {
1066
1068
  startDate?: Date;
1067
1069
  endDate?: Date | null;
1068
1070
  onChange: (start: Date | undefined, end: Date | null | undefined) => void;
1071
+ /** Custom date display formatter function applied to both start and end date */
1072
+ formatDate?: (date: Date) => string;
1069
1073
  placeholder?: string;
1070
1074
  className?: string;
1071
1075
  label?: string;
@@ -1144,6 +1148,8 @@ interface LunarDatePickerProps {
1144
1148
  id?: string;
1145
1149
  value?: LunarPickerValue;
1146
1150
  onChange: (date: LunarPickerValue | undefined) => void;
1151
+ /** Custom date display formatter function */
1152
+ formatDate?: (date: LunarPickerValue) => string;
1147
1153
  placeholder?: string;
1148
1154
  className?: string;
1149
1155
  disabled?: boolean;
@@ -1171,6 +1177,8 @@ interface LunarDateRangePickerProps {
1171
1177
  startDate?: LunarPickerValue;
1172
1178
  endDate?: LunarPickerValue | null;
1173
1179
  onChange: (start: LunarPickerValue | undefined, end: LunarPickerValue | null | undefined) => void;
1180
+ /** Custom date display formatter function applied to both start and end date */
1181
+ formatDate?: (date: LunarPickerValue) => string;
1174
1182
  placeholder?: string;
1175
1183
  className?: string;
1176
1184
  label?: string;
@@ -3019,6 +3027,8 @@ interface DataTableProps<T> {
3019
3027
  /** Double-click leaf headers to auto-fit column width based on visible content. Default: true */
3020
3028
  enableHeaderAutoFit?: boolean;
3021
3029
  labels?: DataTableLabels;
3030
+ /** Optional override for sort button label prefix across all sortable column headers */
3031
+ sortByLabel?: string;
3022
3032
  borderMode?: BorderMode;
3023
3033
  /** Resolve the document element that should receive table dropdown portals. */
3024
3034
  getPortalContainer?: () => HTMLElement | null;
@@ -3026,7 +3036,7 @@ interface DataTableProps<T> {
3026
3036
  paginationVariant?: "default" | "classic";
3027
3037
  }
3028
3038
 
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;
3039
+ 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
3040
 
3031
3041
  /** Public props for the `Table` component. */
3032
3042
  interface TableProps extends React__default.HTMLAttributes<HTMLTableElement> {
@@ -3686,6 +3696,8 @@ declare const underverseMessages: {
3686
3696
  alignLeft: string;
3687
3697
  alignCenter: string;
3688
3698
  alignRight: string;
3699
+ sortBy: string;
3700
+ filterBy: string;
3689
3701
  };
3690
3702
  ValidationInput: {
3691
3703
  required: string;
@@ -4158,6 +4170,8 @@ declare const underverseMessages: {
4158
4170
  alignLeft: string;
4159
4171
  alignCenter: string;
4160
4172
  alignRight: string;
4173
+ sortBy: string;
4174
+ filterBy: string;
4161
4175
  };
4162
4176
  ValidationInput: {
4163
4177
  required: string;
@@ -4630,6 +4644,8 @@ declare const underverseMessages: {
4630
4644
  alignLeft: string;
4631
4645
  alignCenter: string;
4632
4646
  alignRight: string;
4647
+ sortBy: string;
4648
+ filterBy: string;
4633
4649
  };
4634
4650
  ValidationInput: {
4635
4651
  required: string;
@@ -5102,6 +5118,8 @@ declare const underverseMessages: {
5102
5118
  alignLeft: string;
5103
5119
  alignCenter: string;
5104
5120
  alignRight: string;
5121
+ sortBy: string;
5122
+ filterBy: string;
5105
5123
  };
5106
5124
  ValidationInput: {
5107
5125
  required: string;
@@ -5577,6 +5595,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
5577
5595
  alignLeft: string;
5578
5596
  alignCenter: string;
5579
5597
  alignRight: string;
5598
+ sortBy: string;
5599
+ filterBy: string;
5580
5600
  };
5581
5601
  ValidationInput: {
5582
5602
  required: string;
@@ -6048,6 +6068,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
6048
6068
  alignLeft: string;
6049
6069
  alignCenter: string;
6050
6070
  alignRight: string;
6071
+ sortBy: string;
6072
+ filterBy: string;
6051
6073
  };
6052
6074
  ValidationInput: {
6053
6075
  required: string;
@@ -6519,6 +6541,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
6519
6541
  alignLeft: string;
6520
6542
  alignCenter: string;
6521
6543
  alignRight: string;
6544
+ sortBy: string;
6545
+ filterBy: string;
6522
6546
  };
6523
6547
  ValidationInput: {
6524
6548
  required: string;
@@ -6990,6 +7014,8 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
6990
7014
  alignLeft: string;
6991
7015
  alignCenter: string;
6992
7016
  alignRight: string;
7017
+ sortBy: string;
7018
+ filterBy: string;
6993
7019
  };
6994
7020
  ValidationInput: {
6995
7021
  required: string;
package/dist/index.js CHANGED
@@ -4,35 +4,35 @@ import {
4
4
  extractImageSrcsFromHtml,
5
5
  normalizeImageUrl,
6
6
  prepareUEditorContentForSave
7
- } from "./chunk-ZCW2WBNT.js";
7
+ } from "./chunk-7YU3O5JK.js";
8
8
  import {
9
9
  EmojiPicker_default
10
- } from "./chunk-KBCOCHKM.js";
10
+ } from "./chunk-VYTIGF3V.js";
11
11
  import {
12
12
  getEmojiImageUrl,
13
13
  getEmojiUnifiedCode,
14
14
  setEmojiBaseUrl
15
- } from "./chunk-BSN2YFRJ.js";
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-2K443MQP.js";
22
+ } from "./chunk-YNALZEN6.js";
23
23
  import {
24
24
  Modal_default
25
- } from "./chunk-GY6P6WZB.js";
25
+ } from "./chunk-CJ6RPCJN.js";
26
26
  import {
27
27
  DropdownMenuItem,
28
28
  DropdownMenuSeparator,
29
29
  DropdownMenu_default,
30
30
  SelectDropdown
31
- } from "./chunk-LBOTY2AI.js";
31
+ } from "./chunk-TVCZXO6G.js";
32
32
  import {
33
33
  Tooltip,
34
34
  useHydrated
35
- } from "./chunk-THBABGVM.js";
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-AKV7ZQJL.js";
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-4MX7S6TM.js";
71
+ } from "./chunk-PSWS64LA.js";
72
72
  import {
73
73
  __export,
74
74
  __require
@@ -6058,6 +6058,7 @@ var LunarDatePicker = ({
6058
6058
  id,
6059
6059
  value,
6060
6060
  onChange,
6061
+ formatDate,
6061
6062
  placeholder,
6062
6063
  className,
6063
6064
  disabled = false,
@@ -6271,6 +6272,9 @@ var LunarDatePicker = ({
6271
6272
  };
6272
6273
  const formatDateDisplay = (date) => {
6273
6274
  if (!date) return "";
6275
+ if (formatDate) {
6276
+ return formatDate(date);
6277
+ }
6274
6278
  const formatStr = date.is_leap_month ? t("lunarLeapFormat") : t("lunarFormat");
6275
6279
  return formatStr.replace("{day}", String(date.day)).replace("{month}", String(date.month)).replace("{year}", String(date.year));
6276
6280
  };
@@ -6740,6 +6744,7 @@ var LunarDateRangePicker = ({
6740
6744
  startDate,
6741
6745
  endDate,
6742
6746
  onChange,
6747
+ formatDate,
6743
6748
  placeholder = "Select lunar date range...",
6744
6749
  className,
6745
6750
  label,
@@ -7183,6 +7188,9 @@ var LunarDateRangePicker = ({
7183
7188
  ] })
7184
7189
  ] });
7185
7190
  const displayFormat = (date) => {
7191
+ if (formatDate) {
7192
+ return formatDate(date);
7193
+ }
7186
7194
  const formatStr = date.is_leap_month ? t("lunarLeapFormat") : t("lunarFormat");
7187
7195
  return formatStr.replace("{day}", String(date.day)).replace("{month}", String(date.month)).replace("{year}", String(date.year));
7188
7196
  };
@@ -20289,9 +20297,55 @@ function DataTableHeader({
20289
20297
  const isRightAlign = resolvedHeaderAlign === "right";
20290
20298
  const isCenterAlign = resolvedHeaderAlign === "center";
20291
20299
  const columnLabel = getColumnLabel(col.title) || col.key;
20292
- const sortByText = sortByLabel ?? gi18n.sortBy ?? "Sort by";
20293
- const sortLabel = `${sortByText} ${columnLabel}`;
20300
+ const sortByText = sortByLabel ?? gi18n.sortBy ?? (t("sortBy") !== "sortBy" ? t("sortBy") : void 0);
20301
+ const sortLabel = sortByText ? `${sortByText} ${columnLabel}` : columnLabel;
20302
+ const hasSortTooltip = Boolean(sortByText);
20294
20303
  const useEndIcon = (col.iconPosition ?? "end") === "end";
20304
+ const sortButton = /* @__PURE__ */ jsx57(
20305
+ "button",
20306
+ {
20307
+ type: "button",
20308
+ className: cn(
20309
+ "p-1 rounded-lg transition-all duration-200 hover:bg-foreground/10",
20310
+ useEndIcon && isCenterAlign && "col-start-3 justify-self-end",
20311
+ sort?.key === col.key ? "opacity-100 bg-foreground/10" : "opacity-60 hover:opacity-100"
20312
+ ),
20313
+ onClick: () => {
20314
+ setCurPage(1);
20315
+ setSort((current) => {
20316
+ if (!current || current.key !== col.key) return { key: col.key, order: "asc" };
20317
+ if (current.order === "asc") return { key: col.key, order: "desc" };
20318
+ return null;
20319
+ });
20320
+ },
20321
+ "aria-label": sortLabel,
20322
+ title: hasSortTooltip ? sortLabel : void 0,
20323
+ children: /* @__PURE__ */ jsxs49("svg", { viewBox: "0 0 20 20", fill: "none", className: cn("inline-block", sortIconClass), children: [
20324
+ /* @__PURE__ */ jsx57(
20325
+ "path",
20326
+ {
20327
+ d: "M5 7.5l5-5 5 5",
20328
+ stroke: "currentColor",
20329
+ strokeWidth: "1.5",
20330
+ strokeLinecap: "round",
20331
+ strokeLinejoin: "round",
20332
+ opacity: sort?.key === col.key && sort.order === "asc" ? 1 : 0.4
20333
+ }
20334
+ ),
20335
+ /* @__PURE__ */ jsx57(
20336
+ "path",
20337
+ {
20338
+ d: "M5 12.5l5 5 5-5",
20339
+ stroke: "currentColor",
20340
+ strokeWidth: "1.5",
20341
+ strokeLinecap: "round",
20342
+ strokeLinejoin: "round",
20343
+ opacity: sort?.key === col.key && sort.order === "desc" ? 1 : 0.4
20344
+ }
20345
+ )
20346
+ ] })
20347
+ }
20348
+ );
20295
20349
  const titleContent = /* @__PURE__ */ jsxs49(
20296
20350
  "div",
20297
20351
  {
@@ -20313,85 +20367,46 @@ function DataTableHeader({
20313
20367
  children: col.title
20314
20368
  }
20315
20369
  ),
20316
- col.sortable && /* @__PURE__ */ jsx57(
20370
+ col.sortable && (hasSortTooltip ? /* @__PURE__ */ jsx57(
20317
20371
  Tooltip,
20318
20372
  {
20319
20373
  placement: "top",
20320
20374
  content: /* @__PURE__ */ jsx57("span", { className: "text-xs font-medium", children: sortLabel }),
20321
- children: /* @__PURE__ */ jsx57(
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
- )
20375
+ children: sortButton
20365
20376
  }
20366
- )
20377
+ ) : sortButton)
20367
20378
  ]
20368
20379
  }
20369
20380
  );
20381
+ const filterText = gi18n.filterByColumn ? gi18n.filterByColumn(columnLabel) : t("filterByColumn") !== "filterByColumn" ? t("filterByColumn").replace("{column}", columnLabel) : t("filterBy") !== "filterBy" ? `${t("filterBy")} ${columnLabel}` : void 0;
20382
+ const filterLabel = filterText ?? columnLabel;
20383
+ const hasFilterTooltip = Boolean(filterText);
20384
+ const filterButton = /* @__PURE__ */ jsx57(
20385
+ "button",
20386
+ {
20387
+ type: "button",
20388
+ title: hasFilterTooltip ? filterLabel : void 0,
20389
+ className: cn(
20390
+ "p-1.5 rounded-lg transition-all duration-200 hover:bg-foreground/10",
20391
+ filters[col.key] ? "bg-foreground/10 opacity-100" : "opacity-60 hover:opacity-100"
20392
+ ),
20393
+ "aria-label": filterLabel,
20394
+ children: /* @__PURE__ */ jsx57(FilterIcon, { className: "w-4 h-4" })
20395
+ }
20396
+ );
20370
20397
  const filterContent = col.filter ? /* @__PURE__ */ jsx57(
20371
20398
  Popover,
20372
20399
  {
20373
20400
  getPortalContainer,
20374
20401
  placement: "bottom-start",
20375
- trigger: /* @__PURE__ */ jsx57("span", { className: "inline-flex", children: /* @__PURE__ */ jsx57(
20402
+ trigger: /* @__PURE__ */ jsx57("span", { className: "inline-flex", children: hasFilterTooltip ? /* @__PURE__ */ jsx57(
20376
20403
  Tooltip,
20377
20404
  {
20378
20405
  placement: "top",
20379
- content: /* @__PURE__ */ jsx57("span", { className: "text-xs font-medium", children: gi18n.filterByColumn ? gi18n.filterByColumn(columnLabel) : `Filter by ${columnLabel}` }),
20380
- children: /* @__PURE__ */ jsx57(
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
- )
20406
+ content: /* @__PURE__ */ jsx57("span", { className: "text-xs font-medium", children: filterLabel }),
20407
+ children: filterButton
20393
20408
  }
20394
- ) }),
20409
+ ) : filterButton }),
20395
20410
  children: /* @__PURE__ */ jsxs49("div", { className: "p-3 w-64 space-y-3", children: [
20396
20411
  /* @__PURE__ */ jsxs49("div", { className: "flex items-center justify-between", children: [
20397
20412
  /* @__PURE__ */ jsx57("div", { className: "text-sm font-medium", children: col.title }),
@@ -20480,36 +20495,42 @@ function DataTableHeader({
20480
20495
  ),
20481
20496
  children: [
20482
20497
  renderHeaderContent(col, isLeaf),
20483
- isLeaf && enableHeaderAutoFit && /* @__PURE__ */ jsx57(
20484
- Tooltip,
20485
- {
20486
- placement: "top",
20487
- content: /* @__PURE__ */ jsx57("span", { className: "text-xs font-medium", children: "Double click to auto-fit" }),
20488
- children: /* @__PURE__ */ jsx57(
20489
- "button",
20490
- {
20491
- type: "button",
20492
- "aria-label": gi18n.autoFitColumn ? gi18n.autoFitColumn(String(col.title)) : `Auto fit ${String(col.title)}`,
20493
- onClick: (event) => {
20494
- event.preventDefault();
20495
- event.stopPropagation();
20496
- },
20497
- onDoubleClick: (event) => {
20498
- event.preventDefault();
20499
- event.stopPropagation();
20500
- onAutoFitColumn?.(col.key);
20501
- },
20502
- className: cn(
20503
- "absolute inset-y-0 right-0 z-10 w-3",
20504
- !isLastCell && "-mr-1",
20505
- "cursor-col-resize select-none bg-transparent",
20506
- "after:absolute after:inset-y-2 after:right-0.8 after:w-px after:bg-border/0 after:transition-colors",
20507
- "hover:after:bg-primary/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary"
20508
- )
20509
- }
20510
- )
20511
- }
20512
- )
20498
+ isLeaf && enableHeaderAutoFit && (() => {
20499
+ const autoFitTooltipText = t("doubleClickToAutoFit") !== "doubleClickToAutoFit" ? t("doubleClickToAutoFit") : void 0;
20500
+ 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)}`;
20501
+ const autoFitButton = /* @__PURE__ */ jsx57(
20502
+ "button",
20503
+ {
20504
+ type: "button",
20505
+ "aria-label": autoFitAriaLabel,
20506
+ title: autoFitTooltipText,
20507
+ onClick: (event) => {
20508
+ event.preventDefault();
20509
+ event.stopPropagation();
20510
+ },
20511
+ onDoubleClick: (event) => {
20512
+ event.preventDefault();
20513
+ event.stopPropagation();
20514
+ onAutoFitColumn?.(col.key);
20515
+ },
20516
+ className: cn(
20517
+ "absolute inset-y-0 right-0 z-10 w-3",
20518
+ !isLastCell && "-mr-1",
20519
+ "cursor-col-resize select-none bg-transparent",
20520
+ "after:absolute after:inset-y-2 after:right-0.8 after:w-px after:bg-border/0 after:transition-colors",
20521
+ "hover:after:bg-primary/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary"
20522
+ )
20523
+ }
20524
+ );
20525
+ return autoFitTooltipText ? /* @__PURE__ */ jsx57(
20526
+ Tooltip,
20527
+ {
20528
+ placement: "top",
20529
+ content: /* @__PURE__ */ jsx57("span", { className: "text-xs font-medium", children: autoFitTooltipText }),
20530
+ children: autoFitButton
20531
+ }
20532
+ ) : autoFitButton;
20533
+ })()
20513
20534
  ]
20514
20535
  },
20515
20536
  col.key
@@ -21380,6 +21401,7 @@ function DataTable({
21380
21401
  paginationRange,
21381
21402
  enableHeaderAutoFit = true,
21382
21403
  labels,
21404
+ sortByLabel,
21383
21405
  columnColorGroups,
21384
21406
  borderMode,
21385
21407
  getPortalContainer,
@@ -21589,7 +21611,7 @@ function DataTable({
21589
21611
  enableHeaderAutoFit,
21590
21612
  getStickyHeaderClass,
21591
21613
  getStickyHeaderCellStyle,
21592
- sortByLabel: labels?.sortBy,
21614
+ sortByLabel: sortByLabel ?? labels?.sortBy,
21593
21615
  t,
21594
21616
  columnColorGroups,
21595
21617
  getPortalContainer