@payglocal_ui/flux-ui 0.2.4 → 0.2.6
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/dist/index.cjs +195 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -3
- package/dist/index.d.ts +57 -3
- package/dist/index.js +206 -112
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/data-table.tsx +194 -31
- package/src/dropdown-menu.tsx +13 -4
- package/src/index.ts +2 -1
- package/src/select.tsx +20 -3
package/dist/index.cjs
CHANGED
|
@@ -3099,7 +3099,9 @@ var DropdownMenuSubTrigger = React27.forwardRef(({ className, inset, children, .
|
|
|
3099
3099
|
{
|
|
3100
3100
|
ref,
|
|
3101
3101
|
className: cn(
|
|
3102
|
-
|
|
3102
|
+
// Matches DropdownMenuItem: a submenu row sits in the same list as the
|
|
3103
|
+
// plain rows, so it cannot be a different size from them.
|
|
3104
|
+
"flex cursor-default select-none items-center gap-2 rounded-lg px-2.5 py-1.5 text-[13px] outline-none",
|
|
3103
3105
|
"focus:bg-muted data-[state=open]:bg-muted",
|
|
3104
3106
|
inset && "pl-8",
|
|
3105
3107
|
className
|
|
@@ -3144,7 +3146,10 @@ var DropdownMenuItem = React27.forwardRef(({ className, inset, ...props }, ref)
|
|
|
3144
3146
|
{
|
|
3145
3147
|
ref,
|
|
3146
3148
|
className: cn(
|
|
3147
|
-
|
|
3149
|
+
// 13px / tighter padding: a menu drops out of a toolbar button or a
|
|
3150
|
+
// compact table control, and at 15px with 10px vertical padding it read
|
|
3151
|
+
// as a larger, separate UI than the control that opened it.
|
|
3152
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-lg px-2.5 py-1.5 text-[13px] outline-none transition-colors",
|
|
3148
3153
|
"focus:bg-muted focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
3149
3154
|
inset && "pl-8",
|
|
3150
3155
|
className
|
|
@@ -3158,7 +3163,9 @@ var DropdownMenuCheckboxItem = React27.forwardRef(({ className, children, checke
|
|
|
3158
3163
|
{
|
|
3159
3164
|
ref,
|
|
3160
3165
|
className: cn(
|
|
3161
|
-
|
|
3166
|
+
// Matches DropdownMenuItem. `pl-8` stays: that gutter is the check /
|
|
3167
|
+
// dot indicator's, not padding.
|
|
3168
|
+
"relative flex cursor-default select-none items-center rounded-lg py-1.5 pl-8 pr-2.5 text-[13px] outline-none transition-colors",
|
|
3162
3169
|
"focus:bg-muted focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
3163
3170
|
className
|
|
3164
3171
|
),
|
|
@@ -3176,7 +3183,9 @@ var DropdownMenuRadioItem = React27.forwardRef(({ className, children, ...props
|
|
|
3176
3183
|
{
|
|
3177
3184
|
ref,
|
|
3178
3185
|
className: cn(
|
|
3179
|
-
|
|
3186
|
+
// Matches DropdownMenuItem. `pl-8` stays: that gutter is the check /
|
|
3187
|
+
// dot indicator's, not padding.
|
|
3188
|
+
"relative flex cursor-default select-none items-center rounded-lg py-1.5 pl-8 pr-2.5 text-[13px] outline-none transition-colors",
|
|
3180
3189
|
"focus:bg-muted focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
3181
3190
|
className
|
|
3182
3191
|
),
|
|
@@ -3211,12 +3220,17 @@ var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
|
3211
3220
|
var Select = SelectPrimitive.Root;
|
|
3212
3221
|
var SelectGroup = SelectPrimitive.Group;
|
|
3213
3222
|
var SelectValue = SelectPrimitive.Value;
|
|
3214
|
-
var
|
|
3223
|
+
var selectTriggerSizes = {
|
|
3224
|
+
md: "h-11 min-h-11 gap-2.5 px-4 py-2 text-[15px]",
|
|
3225
|
+
sm: "h-7 min-h-7 w-auto gap-1 px-2 py-0 text-[12px]"
|
|
3226
|
+
};
|
|
3227
|
+
var SelectTrigger = React28.forwardRef(({ className, children, size = "md", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3215
3228
|
SelectPrimitive.Trigger,
|
|
3216
3229
|
{
|
|
3217
3230
|
ref,
|
|
3218
3231
|
className: cn(
|
|
3219
|
-
"flex
|
|
3232
|
+
"flex w-full items-center justify-between rounded-lg border border-border bg-card text-foreground shadow-sm outline-none",
|
|
3233
|
+
selectTriggerSizes[size],
|
|
3220
3234
|
"ring-ring/50 focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
3221
3235
|
"[&>span]:line-clamp-1",
|
|
3222
3236
|
className
|
|
@@ -3863,7 +3877,9 @@ function DataTable({
|
|
|
3863
3877
|
headerStyle = "surface",
|
|
3864
3878
|
footerSummary = "range",
|
|
3865
3879
|
footerCountLabels = { singular: "item", plural: "items" },
|
|
3866
|
-
snug = false
|
|
3880
|
+
snug = false,
|
|
3881
|
+
expandable,
|
|
3882
|
+
footerLeading
|
|
3867
3883
|
}) {
|
|
3868
3884
|
const isControlled = controlledPage !== void 0;
|
|
3869
3885
|
const [internalPage, setInternalPage] = (0, import_react8.useState)(1);
|
|
@@ -3871,6 +3887,19 @@ function DataTable({
|
|
|
3871
3887
|
const setPage = isControlled ? (p) => onPageChange?.(p) : (p) => setInternalPage(p);
|
|
3872
3888
|
const hasAction = rowAction != null || rowCta != null;
|
|
3873
3889
|
const hasSpacer = tableLayout === "content";
|
|
3890
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react8.useState)([]);
|
|
3891
|
+
const isExpandControlled = expandable?.expandedKeys !== void 0;
|
|
3892
|
+
const expandedKeys = isExpandControlled ? expandable.expandedKeys : internalExpanded;
|
|
3893
|
+
const hasExpand = expandable != null;
|
|
3894
|
+
const totalColSpan = columns.length + (hasExpand ? 1 : 0) + (hasSpacer ? 1 : 0) + (hasAction ? 1 : 0);
|
|
3895
|
+
const rowExpanded = (row, index) => hasExpand && (expandable.isExpandable?.(row, index) ?? true) && expandedKeys.includes(rowKeys[index]);
|
|
3896
|
+
const toggleExpanded = (key, row, index) => {
|
|
3897
|
+
const isOpen = expandedKeys.includes(key);
|
|
3898
|
+
const next = isOpen ? expandedKeys.filter((k) => k !== key) : [...expandedKeys, key];
|
|
3899
|
+
if (isExpandControlled) expandable.onExpandedChange?.(next);
|
|
3900
|
+
else setInternalExpanded(next);
|
|
3901
|
+
if (!isOpen) expandable.onExpand?.(row, index);
|
|
3902
|
+
};
|
|
3874
3903
|
const total = totalRows ?? data.length;
|
|
3875
3904
|
const totalPages = Math.ceil(total / pageSize);
|
|
3876
3905
|
const paginated = isControlled ? data : data.slice((page - 1) * pageSize, page * pageSize);
|
|
@@ -3881,6 +3910,7 @@ function DataTable({
|
|
|
3881
3910
|
seenKeys.set(base, seen + 1);
|
|
3882
3911
|
return seen === 0 ? base : `${base}__${seen}`;
|
|
3883
3912
|
});
|
|
3913
|
+
const isEmpty = !isLoading && paginated.length === 0;
|
|
3884
3914
|
const comfortable = density === "comfortable";
|
|
3885
3915
|
const compact = density === "compact";
|
|
3886
3916
|
const compactCellPad = compact ? snug ? "pl-1.5 pr-2.5 py-2.5" : "px-3 py-2.5" : "px-4 py-3.5";
|
|
@@ -3888,6 +3918,9 @@ function DataTable({
|
|
|
3888
3918
|
const headPad = comfortable ? "px-5 py-4" : compactCellPad;
|
|
3889
3919
|
const footerPad = comfortable ? "px-5 py-4" : compact ? "px-4 py-2.5" : "px-4 py-3.5";
|
|
3890
3920
|
const headText = comfortable ? "text-[12px] font-medium text-muted-foreground tracking-normal" : compact ? "text-[11px] font-semibold text-muted-foreground" : "text-[11px] font-semibold text-foreground/75 dark:text-foreground/85";
|
|
3921
|
+
const cellPadLeft = comfortable ? 20 : compact ? snug ? 6 : 12 : 16;
|
|
3922
|
+
const expandIndent = 40 + cellPadLeft;
|
|
3923
|
+
const expandGuideLeft = cellPadLeft + 10;
|
|
3891
3924
|
const actionGutter = comfortable ? 20 : compact ? 12 : 16;
|
|
3892
3925
|
const ROW_CLICK_IGNORE = 'button, a, input, select, textarea, label, [role="button"], [role="link"], [role="checkbox"], [role="menuitem"], [role="menu"], [role="dialog"], [data-row-click-ignore]';
|
|
3893
3926
|
const isRowClickTarget = (target, rowEl) => {
|
|
@@ -3925,7 +3958,8 @@ function DataTable({
|
|
|
3925
3958
|
width: "100%"
|
|
3926
3959
|
},
|
|
3927
3960
|
children: [
|
|
3928
|
-
tableLayout === "fixed" && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("colgroup", { children: [
|
|
3961
|
+
tableLayout === "fixed" && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("colgroup", { children: [
|
|
3962
|
+
hasExpand ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("col", { style: { width: 40 } }) : null,
|
|
3929
3963
|
columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3930
3964
|
"col",
|
|
3931
3965
|
{
|
|
@@ -3955,6 +3989,7 @@ function DataTable({
|
|
|
3955
3989
|
headerStyle === "surface" ? "border-border" : "border-border/70"
|
|
3956
3990
|
),
|
|
3957
3991
|
children: [
|
|
3992
|
+
hasExpand ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("th", { className: cn(headPad, "w-10 p-0"), "aria-hidden": true }) : null,
|
|
3958
3993
|
columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3959
3994
|
"th",
|
|
3960
3995
|
{
|
|
@@ -3963,7 +3998,8 @@ function DataTable({
|
|
|
3963
3998
|
headText,
|
|
3964
3999
|
"whitespace-nowrap align-middle",
|
|
3965
4000
|
col.align === "right" ? "text-right" : col.align === "center" ? "text-center" : "text-left",
|
|
3966
|
-
|
|
4001
|
+
// Width hints live in `cellClassName`; see `isEmpty`.
|
|
4002
|
+
!isEmpty && col.cellClassName
|
|
3967
4003
|
),
|
|
3968
4004
|
children: col.header
|
|
3969
4005
|
},
|
|
@@ -3979,89 +4015,144 @@ function DataTable({
|
|
|
3979
4015
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tbody", { children: isLoading ? Array.from({ length: skeletonRows }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3980
4016
|
TableRowSkeleton,
|
|
3981
4017
|
{
|
|
3982
|
-
cols: columns.length,
|
|
4018
|
+
cols: columns.length + (hasExpand ? 1 : 0),
|
|
3983
4019
|
density,
|
|
3984
4020
|
snug
|
|
3985
4021
|
},
|
|
3986
4022
|
i
|
|
3987
|
-
)) : paginated.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("td", { colSpan:
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
e
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
"
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
) : compact ? cn(
|
|
4023
|
-
"text-[13px] leading-tight",
|
|
4024
|
-
!col.wrap && "whitespace-nowrap",
|
|
4025
|
-
"overflow-hidden"
|
|
4026
|
-
) : "whitespace-nowrap overflow-hidden",
|
|
4027
|
-
col.align === "right" ? "text-right" : col.align === "center" ? "text-center" : "text-left",
|
|
4028
|
-
col.cellClassName
|
|
4029
|
-
),
|
|
4030
|
-
children: col.render(row, i)
|
|
4031
|
-
},
|
|
4032
|
-
col.key
|
|
4033
|
-
)),
|
|
4034
|
-
hasSpacer ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("td", { className: "p-0", "aria-hidden": true }) : null,
|
|
4035
|
-
hasAction ? (
|
|
4036
|
-
// Zero-width sticky cell pinned to the right edge of the
|
|
4037
|
-
// viewport. Its children are positioned absolutely so they
|
|
4038
|
-
// float over the row (out of the 0-width cell) — the action
|
|
4039
|
-
// stays in view while scrolling and nothing trails the last
|
|
4040
|
-
// data column. Everything is revealed on hover only.
|
|
4041
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("td", { className: "sticky right-0 z-[1] w-0 p-0 align-middle", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4042
|
-
"span",
|
|
4023
|
+
)) : paginated.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("td", { colSpan: totalColSpan, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(EmptyState, { title: emptyTitle, description: emptyDescription }) }) }) : paginated.flatMap((row, i) => [
|
|
4024
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
4025
|
+
"tr",
|
|
4026
|
+
{
|
|
4027
|
+
className: cn(
|
|
4028
|
+
"group transition-colors duration-150 border-b border-border/60 last:border-b-0",
|
|
4029
|
+
comfortable && "min-h-[56px]",
|
|
4030
|
+
compact && "min-h-[44px]",
|
|
4031
|
+
"hover:bg-muted/40 dark:hover:bg-muted/25",
|
|
4032
|
+
hasAction && "hover:shadow-[0_1px_0_rgba(0,0,0,0.04)] dark:hover:shadow-none",
|
|
4033
|
+
// Clickable rows read as clickable, and show a focus ring
|
|
4034
|
+
// when reached by keyboard. `focus-visible` only, so a
|
|
4035
|
+
// mouse click does not leave a ring behind on the row.
|
|
4036
|
+
onRowClick && "cursor-pointer focus-visible:outline-none focus-visible:bg-muted/40 dark:focus-visible:bg-muted/25",
|
|
4037
|
+
// An open row takes its panel's background and drops the
|
|
4038
|
+
// divider beneath it, so the row and its detail read as one
|
|
4039
|
+
// block. Hover is pinned to the same value, or moving the
|
|
4040
|
+
// mouse over an open row would make it flicker away from
|
|
4041
|
+
// the panel it belongs to.
|
|
4042
|
+
rowExpanded(row, i) && "border-b-0 bg-muted/40 hover:bg-muted/40 dark:bg-muted/25 dark:hover:bg-muted/25"
|
|
4043
|
+
),
|
|
4044
|
+
tabIndex: onRowClick ? 0 : void 0,
|
|
4045
|
+
onClick: onRowClick ? (e) => {
|
|
4046
|
+
if (!isRowClickTarget(e.target, e.currentTarget)) return;
|
|
4047
|
+
onRowClick(row, i);
|
|
4048
|
+
} : void 0,
|
|
4049
|
+
onKeyDown: onRowClick ? (e) => {
|
|
4050
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
4051
|
+
if (e.target !== e.currentTarget) return;
|
|
4052
|
+
e.preventDefault();
|
|
4053
|
+
onRowClick(row, i);
|
|
4054
|
+
} : void 0,
|
|
4055
|
+
children: [
|
|
4056
|
+
hasExpand ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("td", { className: cn(cellPad, "w-10 align-middle"), children: expandable.isExpandable?.(row, i) ?? true ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4057
|
+
"button",
|
|
4043
4058
|
{
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4059
|
+
type: "button",
|
|
4060
|
+
"aria-expanded": rowExpanded(row, i),
|
|
4061
|
+
"aria-label": expandable.toggleLabel ?? "Toggle row details",
|
|
4062
|
+
onClick: () => toggleExpanded(rowKeys[i], row, i),
|
|
4063
|
+
className: "inline-flex h-5 w-5 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
4064
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4065
|
+
import_lucide_react25.ChevronDown,
|
|
4048
4066
|
{
|
|
4049
|
-
type: "button",
|
|
4050
|
-
onClick: () => rowCta?.onClick?.(row),
|
|
4051
4067
|
className: cn(
|
|
4052
|
-
"
|
|
4053
|
-
|
|
4054
|
-
)
|
|
4055
|
-
children: rowCta?.label
|
|
4068
|
+
"h-3.5 w-3.5 transition-transform duration-150",
|
|
4069
|
+
rowExpanded(row, i) && "rotate-180"
|
|
4070
|
+
)
|
|
4056
4071
|
}
|
|
4057
4072
|
)
|
|
4058
4073
|
}
|
|
4059
|
-
) })
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4074
|
+
) : null }) : null,
|
|
4075
|
+
columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4076
|
+
"td",
|
|
4077
|
+
{
|
|
4078
|
+
className: cn(
|
|
4079
|
+
cellPad,
|
|
4080
|
+
"align-middle",
|
|
4081
|
+
comfortable ? cn(
|
|
4082
|
+
"text-[13px] leading-snug",
|
|
4083
|
+
!col.wrap && "whitespace-nowrap"
|
|
4084
|
+
) : compact ? cn(
|
|
4085
|
+
"text-[13px] leading-tight",
|
|
4086
|
+
!col.wrap && "whitespace-nowrap",
|
|
4087
|
+
"overflow-hidden"
|
|
4088
|
+
) : "whitespace-nowrap overflow-hidden",
|
|
4089
|
+
col.align === "right" ? "text-right" : col.align === "center" ? "text-center" : "text-left",
|
|
4090
|
+
col.cellClassName
|
|
4091
|
+
),
|
|
4092
|
+
children: col.render(row, i)
|
|
4093
|
+
},
|
|
4094
|
+
col.key
|
|
4095
|
+
)),
|
|
4096
|
+
hasSpacer ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("td", { className: "p-0", "aria-hidden": true }) : null,
|
|
4097
|
+
hasAction ? (
|
|
4098
|
+
// Zero-width sticky cell pinned to the right edge of the
|
|
4099
|
+
// viewport. Its children are positioned absolutely so they
|
|
4100
|
+
// float over the row (out of the 0-width cell) — the action
|
|
4101
|
+
// stays in view while scrolling and nothing trails the last
|
|
4102
|
+
// data column. Everything is revealed on hover only.
|
|
4103
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("td", { className: "sticky right-0 z-[1] w-0 p-0 align-middle", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4104
|
+
"span",
|
|
4105
|
+
{
|
|
4106
|
+
className: "absolute top-1/2 -translate-y-1/2 z-[1] inline-flex items-center opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",
|
|
4107
|
+
style: { right: actionGutter },
|
|
4108
|
+
children: rowAction != null ? typeof rowAction === "function" ? rowAction(row, i) : rowAction : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4109
|
+
"button",
|
|
4110
|
+
{
|
|
4111
|
+
type: "button",
|
|
4112
|
+
onClick: () => rowCta?.onClick?.(row),
|
|
4113
|
+
className: cn(
|
|
4114
|
+
"inline-flex items-center font-medium text-foreground bg-card rounded-lg border border-border hover:border-muted-foreground/50 whitespace-nowrap shadow-sm",
|
|
4115
|
+
compact ? "px-2.5 py-1 text-[11px]" : "px-3 py-1.5 text-[12px]"
|
|
4116
|
+
),
|
|
4117
|
+
children: rowCta?.label
|
|
4118
|
+
}
|
|
4119
|
+
)
|
|
4120
|
+
}
|
|
4121
|
+
) })
|
|
4122
|
+
) : null
|
|
4123
|
+
]
|
|
4124
|
+
},
|
|
4125
|
+
rowKeys[i]
|
|
4126
|
+
),
|
|
4127
|
+
// The panel spans every column, including the toggle, spacer and
|
|
4128
|
+
// action cells, so it reads as one band under its row rather
|
|
4129
|
+
// than as a cell inside the grid.
|
|
4130
|
+
rowExpanded(row, i) ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4131
|
+
"tr",
|
|
4132
|
+
{
|
|
4133
|
+
className: "border-b border-border/60 bg-muted/40 last:border-b-0 dark:bg-muted/25",
|
|
4134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("td", { colSpan: totalColSpan, className: "p-0 align-top", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
4135
|
+
"div",
|
|
4136
|
+
{
|
|
4137
|
+
className: "relative",
|
|
4138
|
+
style: { paddingLeft: expandIndent, paddingRight: cellPadLeft },
|
|
4139
|
+
children: [
|
|
4140
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4141
|
+
"span",
|
|
4142
|
+
{
|
|
4143
|
+
"aria-hidden": true,
|
|
4144
|
+
className: "absolute top-0 bottom-4 w-px bg-border",
|
|
4145
|
+
style: { left: expandGuideLeft }
|
|
4146
|
+
}
|
|
4147
|
+
),
|
|
4148
|
+
expandable.render(row, i)
|
|
4149
|
+
]
|
|
4150
|
+
}
|
|
4151
|
+
) })
|
|
4152
|
+
},
|
|
4153
|
+
`${rowKeys[i]}__panel`
|
|
4154
|
+
) : null
|
|
4155
|
+
]) })
|
|
4065
4156
|
]
|
|
4066
4157
|
}
|
|
4067
4158
|
)
|
|
@@ -4073,27 +4164,30 @@ function DataTable({
|
|
|
4073
4164
|
className: cn(
|
|
4074
4165
|
"flex items-center gap-4 flex-wrap border-t border-border",
|
|
4075
4166
|
footerPad,
|
|
4076
|
-
footerSummary === "count" && totalPages <= 1 ? "justify-start" : "justify-between"
|
|
4167
|
+
footerSummary === "count" && totalPages <= 1 && !footerLeading ? "justify-start" : "justify-between"
|
|
4077
4168
|
),
|
|
4078
4169
|
children: [
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
" ",
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
" ",
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
"
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4170
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
4171
|
+
footerLeading,
|
|
4172
|
+
footerSummary === "count" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "text-[12px] text-muted-foreground tabular-nums", children: [
|
|
4173
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "font-medium text-foreground", children: total }),
|
|
4174
|
+
" ",
|
|
4175
|
+
total === 1 ? footerCountLabels.singular : footerCountLabels.plural
|
|
4176
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "text-[12px] text-muted-foreground tabular-nums", children: [
|
|
4177
|
+
"Showing",
|
|
4178
|
+
" ",
|
|
4179
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "text-foreground font-medium", children: [
|
|
4180
|
+
Math.min((page - 1) * pageSize + 1, total),
|
|
4181
|
+
"\u2013",
|
|
4182
|
+
Math.min(page * pageSize, total)
|
|
4183
|
+
] }),
|
|
4184
|
+
" ",
|
|
4185
|
+
"of",
|
|
4186
|
+
" ",
|
|
4187
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-foreground font-medium", children: total.toLocaleString() }),
|
|
4188
|
+
" ",
|
|
4189
|
+
total !== 1 ? "results" : "result"
|
|
4190
|
+
] })
|
|
4097
4191
|
] }),
|
|
4098
4192
|
(footerSummary === "range" || footerSummary === "count") && totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
4099
4193
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|