@almadar/ui 5.9.0 → 5.9.1
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/avl/index.cjs +18 -11
- package/dist/avl/index.js +18 -11
- package/dist/components/index.cjs +18 -11
- package/dist/components/index.js +18 -11
- package/dist/components/molecules/TableView.d.ts +3 -1
- package/dist/providers/index.cjs +18 -11
- package/dist/providers/index.js +18 -11
- package/dist/runtime/index.cjs +18 -11
- package/dist/runtime/index.js +18 -11
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -32960,18 +32960,25 @@ function TableView({
|
|
|
32960
32960
|
return dnd.enabled ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
32961
32961
|
}
|
|
32962
32962
|
const lk = LOOKS[look];
|
|
32963
|
+
const hasActions = Boolean(itemActions && itemActions.length > 0);
|
|
32964
|
+
const gridTemplateColumns = [
|
|
32965
|
+
selectable ? "auto" : null,
|
|
32966
|
+
...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
|
|
32967
|
+
hasActions ? "auto" : null
|
|
32968
|
+
].filter(Boolean).join(" ");
|
|
32963
32969
|
const header = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
32964
32970
|
Box,
|
|
32965
32971
|
{
|
|
32966
32972
|
role: "row",
|
|
32973
|
+
style: { gridTemplateColumns },
|
|
32967
32974
|
className: cn(
|
|
32968
|
-
"
|
|
32969
|
-
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-
|
|
32975
|
+
"grid items-center gap-3 sticky top-0 z-10",
|
|
32976
|
+
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-border)]",
|
|
32970
32977
|
"text-[var(--color-text-muted)] uppercase text-xs font-semibold tracking-wide",
|
|
32971
32978
|
lk.headPad
|
|
32972
32979
|
),
|
|
32973
32980
|
children: [
|
|
32974
|
-
selectable && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "
|
|
32981
|
+
selectable && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { checked: allSelected, onChange: toggleAll, "aria-label": "Select all rows" }) }),
|
|
32975
32982
|
colDefs.map((col) => {
|
|
32976
32983
|
const active = sortColumn === (col.field ?? col.key);
|
|
32977
32984
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -32981,7 +32988,6 @@ function TableView({
|
|
|
32981
32988
|
onClick: () => handleSort(col),
|
|
32982
32989
|
className: cn(
|
|
32983
32990
|
"flex items-center gap-1 min-w-0",
|
|
32984
|
-
col.width ?? "flex-1",
|
|
32985
32991
|
alignClass[col.align ?? "left"],
|
|
32986
32992
|
col.sortable && sortEvent && "cursor-pointer select-none hover:text-foreground"
|
|
32987
32993
|
),
|
|
@@ -33001,7 +33007,7 @@ function TableView({
|
|
|
33001
33007
|
col.key
|
|
33002
33008
|
);
|
|
33003
33009
|
}),
|
|
33004
|
-
|
|
33010
|
+
hasActions && /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": true })
|
|
33005
33011
|
]
|
|
33006
33012
|
}
|
|
33007
33013
|
);
|
|
@@ -33013,16 +33019,18 @@ function TableView({
|
|
|
33013
33019
|
role: "row",
|
|
33014
33020
|
"data-entity-row": true,
|
|
33015
33021
|
"data-entity-id": id,
|
|
33022
|
+
style: !hasRenderProp ? { gridTemplateColumns } : void 0,
|
|
33016
33023
|
className: cn(
|
|
33017
|
-
"group
|
|
33024
|
+
"group items-center gap-3 transition-colors duration-fast",
|
|
33025
|
+
hasRenderProp ? "flex" : "grid",
|
|
33018
33026
|
lk.rowPad,
|
|
33019
|
-
lk.divider && "border-b border-[var(--color-
|
|
33027
|
+
lk.divider && "border-b border-[var(--color-border)]",
|
|
33020
33028
|
lk.striped && index % 2 === 1 && "bg-[var(--color-surface-subtle)]",
|
|
33021
33029
|
"hover:bg-[var(--color-surface-subtle)]",
|
|
33022
|
-
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-
|
|
33030
|
+
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-border)] [&>*:last-child]:border-r-0"
|
|
33023
33031
|
),
|
|
33024
33032
|
children: [
|
|
33025
|
-
selectable && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "
|
|
33033
|
+
selectable && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33026
33034
|
Checkbox,
|
|
33027
33035
|
{
|
|
33028
33036
|
checked: selected.has(id),
|
|
@@ -33034,7 +33042,6 @@ function TableView({
|
|
|
33034
33042
|
const raw = getNestedValue(row, col.field ?? col.key);
|
|
33035
33043
|
const cellBase = cn(
|
|
33036
33044
|
"flex items-center min-w-0",
|
|
33037
|
-
col.width ?? "flex-1",
|
|
33038
33045
|
alignClass[col.align ?? "left"],
|
|
33039
33046
|
weightClass[col.weight ?? "normal"],
|
|
33040
33047
|
col.className
|
|
@@ -33042,7 +33049,7 @@ function TableView({
|
|
|
33042
33049
|
if (col.format === "badge" && raw != null && raw !== "") {
|
|
33043
33050
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: statusVariant4(String(raw)), size: "sm", children: String(raw) }) }, col.key);
|
|
33044
33051
|
}
|
|
33045
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className:
|
|
33052
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
|
|
33046
33053
|
}),
|
|
33047
33054
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", className: "flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity", children: itemActions.map((action, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
33048
33055
|
Button,
|
package/dist/avl/index.js
CHANGED
|
@@ -32911,18 +32911,25 @@ function TableView({
|
|
|
32911
32911
|
return dnd.enabled ? /* @__PURE__ */ jsx(Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
32912
32912
|
}
|
|
32913
32913
|
const lk = LOOKS[look];
|
|
32914
|
+
const hasActions = Boolean(itemActions && itemActions.length > 0);
|
|
32915
|
+
const gridTemplateColumns = [
|
|
32916
|
+
selectable ? "auto" : null,
|
|
32917
|
+
...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
|
|
32918
|
+
hasActions ? "auto" : null
|
|
32919
|
+
].filter(Boolean).join(" ");
|
|
32914
32920
|
const header = /* @__PURE__ */ jsxs(
|
|
32915
32921
|
Box,
|
|
32916
32922
|
{
|
|
32917
32923
|
role: "row",
|
|
32924
|
+
style: { gridTemplateColumns },
|
|
32918
32925
|
className: cn(
|
|
32919
|
-
"
|
|
32920
|
-
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-
|
|
32926
|
+
"grid items-center gap-3 sticky top-0 z-10",
|
|
32927
|
+
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-border)]",
|
|
32921
32928
|
"text-[var(--color-text-muted)] uppercase text-xs font-semibold tracking-wide",
|
|
32922
32929
|
lk.headPad
|
|
32923
32930
|
),
|
|
32924
32931
|
children: [
|
|
32925
|
-
selectable && /* @__PURE__ */ jsx(Box, { className: "
|
|
32932
|
+
selectable && /* @__PURE__ */ jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsx(Checkbox, { checked: allSelected, onChange: toggleAll, "aria-label": "Select all rows" }) }),
|
|
32926
32933
|
colDefs.map((col) => {
|
|
32927
32934
|
const active = sortColumn === (col.field ?? col.key);
|
|
32928
32935
|
return /* @__PURE__ */ jsxs(
|
|
@@ -32932,7 +32939,6 @@ function TableView({
|
|
|
32932
32939
|
onClick: () => handleSort(col),
|
|
32933
32940
|
className: cn(
|
|
32934
32941
|
"flex items-center gap-1 min-w-0",
|
|
32935
|
-
col.width ?? "flex-1",
|
|
32936
32942
|
alignClass[col.align ?? "left"],
|
|
32937
32943
|
col.sortable && sortEvent && "cursor-pointer select-none hover:text-foreground"
|
|
32938
32944
|
),
|
|
@@ -32952,7 +32958,7 @@ function TableView({
|
|
|
32952
32958
|
col.key
|
|
32953
32959
|
);
|
|
32954
32960
|
}),
|
|
32955
|
-
|
|
32961
|
+
hasActions && /* @__PURE__ */ jsx(Box, { "aria-hidden": true })
|
|
32956
32962
|
]
|
|
32957
32963
|
}
|
|
32958
32964
|
);
|
|
@@ -32964,16 +32970,18 @@ function TableView({
|
|
|
32964
32970
|
role: "row",
|
|
32965
32971
|
"data-entity-row": true,
|
|
32966
32972
|
"data-entity-id": id,
|
|
32973
|
+
style: !hasRenderProp ? { gridTemplateColumns } : void 0,
|
|
32967
32974
|
className: cn(
|
|
32968
|
-
"group
|
|
32975
|
+
"group items-center gap-3 transition-colors duration-fast",
|
|
32976
|
+
hasRenderProp ? "flex" : "grid",
|
|
32969
32977
|
lk.rowPad,
|
|
32970
|
-
lk.divider && "border-b border-[var(--color-
|
|
32978
|
+
lk.divider && "border-b border-[var(--color-border)]",
|
|
32971
32979
|
lk.striped && index % 2 === 1 && "bg-[var(--color-surface-subtle)]",
|
|
32972
32980
|
"hover:bg-[var(--color-surface-subtle)]",
|
|
32973
|
-
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-
|
|
32981
|
+
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-border)] [&>*:last-child]:border-r-0"
|
|
32974
32982
|
),
|
|
32975
32983
|
children: [
|
|
32976
|
-
selectable && /* @__PURE__ */ jsx(Box, { className: "
|
|
32984
|
+
selectable && /* @__PURE__ */ jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsx(
|
|
32977
32985
|
Checkbox,
|
|
32978
32986
|
{
|
|
32979
32987
|
checked: selected.has(id),
|
|
@@ -32985,7 +32993,6 @@ function TableView({
|
|
|
32985
32993
|
const raw = getNestedValue(row, col.field ?? col.key);
|
|
32986
32994
|
const cellBase = cn(
|
|
32987
32995
|
"flex items-center min-w-0",
|
|
32988
|
-
col.width ?? "flex-1",
|
|
32989
32996
|
alignClass[col.align ?? "left"],
|
|
32990
32997
|
weightClass[col.weight ?? "normal"],
|
|
32991
32998
|
col.className
|
|
@@ -32993,7 +33000,7 @@ function TableView({
|
|
|
32993
33000
|
if (col.format === "badge" && raw != null && raw !== "") {
|
|
32994
33001
|
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx(Badge, { variant: statusVariant4(String(raw)), size: "sm", children: String(raw) }) }, col.key);
|
|
32995
33002
|
}
|
|
32996
|
-
return /* @__PURE__ */ jsx(Box, { role: "cell", className:
|
|
33003
|
+
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
|
|
32997
33004
|
}),
|
|
32998
33005
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity", children: itemActions.map((action, i) => /* @__PURE__ */ jsxs(
|
|
32999
33006
|
Button,
|
|
@@ -28419,18 +28419,25 @@ function TableView({
|
|
|
28419
28419
|
return dnd.enabled ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
28420
28420
|
}
|
|
28421
28421
|
const lk = LOOKS[look];
|
|
28422
|
+
const hasActions = Boolean(itemActions && itemActions.length > 0);
|
|
28423
|
+
const gridTemplateColumns = [
|
|
28424
|
+
selectable ? "auto" : null,
|
|
28425
|
+
...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
|
|
28426
|
+
hasActions ? "auto" : null
|
|
28427
|
+
].filter(Boolean).join(" ");
|
|
28422
28428
|
const header = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
28423
28429
|
exports.Box,
|
|
28424
28430
|
{
|
|
28425
28431
|
role: "row",
|
|
28432
|
+
style: { gridTemplateColumns },
|
|
28426
28433
|
className: cn(
|
|
28427
|
-
"
|
|
28428
|
-
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-
|
|
28434
|
+
"grid items-center gap-3 sticky top-0 z-10",
|
|
28435
|
+
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-border)]",
|
|
28429
28436
|
"text-[var(--color-text-muted)] uppercase text-xs font-semibold tracking-wide",
|
|
28430
28437
|
lk.headPad
|
|
28431
28438
|
),
|
|
28432
28439
|
children: [
|
|
28433
|
-
selectable && /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "
|
|
28440
|
+
selectable && /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Checkbox, { checked: allSelected, onChange: toggleAll, "aria-label": "Select all rows" }) }),
|
|
28434
28441
|
colDefs.map((col) => {
|
|
28435
28442
|
const active = sortColumn === (col.field ?? col.key);
|
|
28436
28443
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -28440,7 +28447,6 @@ function TableView({
|
|
|
28440
28447
|
onClick: () => handleSort(col),
|
|
28441
28448
|
className: cn(
|
|
28442
28449
|
"flex items-center gap-1 min-w-0",
|
|
28443
|
-
col.width ?? "flex-1",
|
|
28444
28450
|
alignClass[col.align ?? "left"],
|
|
28445
28451
|
col.sortable && sortEvent && "cursor-pointer select-none hover:text-foreground"
|
|
28446
28452
|
),
|
|
@@ -28460,7 +28466,7 @@ function TableView({
|
|
|
28460
28466
|
col.key
|
|
28461
28467
|
);
|
|
28462
28468
|
}),
|
|
28463
|
-
|
|
28469
|
+
hasActions && /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { "aria-hidden": true })
|
|
28464
28470
|
]
|
|
28465
28471
|
}
|
|
28466
28472
|
);
|
|
@@ -28472,16 +28478,18 @@ function TableView({
|
|
|
28472
28478
|
role: "row",
|
|
28473
28479
|
"data-entity-row": true,
|
|
28474
28480
|
"data-entity-id": id,
|
|
28481
|
+
style: !hasRenderProp ? { gridTemplateColumns } : void 0,
|
|
28475
28482
|
className: cn(
|
|
28476
|
-
"group
|
|
28483
|
+
"group items-center gap-3 transition-colors duration-fast",
|
|
28484
|
+
hasRenderProp ? "flex" : "grid",
|
|
28477
28485
|
lk.rowPad,
|
|
28478
|
-
lk.divider && "border-b border-[var(--color-
|
|
28486
|
+
lk.divider && "border-b border-[var(--color-border)]",
|
|
28479
28487
|
lk.striped && index % 2 === 1 && "bg-[var(--color-surface-subtle)]",
|
|
28480
28488
|
"hover:bg-[var(--color-surface-subtle)]",
|
|
28481
|
-
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-
|
|
28489
|
+
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-border)] [&>*:last-child]:border-r-0"
|
|
28482
28490
|
),
|
|
28483
28491
|
children: [
|
|
28484
|
-
selectable && /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "
|
|
28492
|
+
selectable && /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
28485
28493
|
exports.Checkbox,
|
|
28486
28494
|
{
|
|
28487
28495
|
checked: selected.has(id),
|
|
@@ -28493,7 +28501,6 @@ function TableView({
|
|
|
28493
28501
|
const raw = getNestedValue(row, col.field ?? col.key);
|
|
28494
28502
|
const cellBase = cn(
|
|
28495
28503
|
"flex items-center min-w-0",
|
|
28496
|
-
col.width ?? "flex-1",
|
|
28497
28504
|
alignClass[col.align ?? "left"],
|
|
28498
28505
|
weightClass[col.weight ?? "normal"],
|
|
28499
28506
|
col.className
|
|
@@ -28501,7 +28508,7 @@ function TableView({
|
|
|
28501
28508
|
if (col.format === "badge" && raw != null && raw !== "") {
|
|
28502
28509
|
return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Badge, { variant: statusVariant4(String(raw)), size: "sm", children: String(raw) }) }, col.key);
|
|
28503
28510
|
}
|
|
28504
|
-
return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { role: "cell", className:
|
|
28511
|
+
return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
|
|
28505
28512
|
}),
|
|
28506
28513
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(exports.HStack, { gap: "xs", className: "flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity", children: itemActions.map((action, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
28507
28514
|
exports.Button,
|
package/dist/components/index.js
CHANGED
|
@@ -28370,18 +28370,25 @@ function TableView({
|
|
|
28370
28370
|
return dnd.enabled ? /* @__PURE__ */ jsx(Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
28371
28371
|
}
|
|
28372
28372
|
const lk = LOOKS[look];
|
|
28373
|
+
const hasActions = Boolean(itemActions && itemActions.length > 0);
|
|
28374
|
+
const gridTemplateColumns = [
|
|
28375
|
+
selectable ? "auto" : null,
|
|
28376
|
+
...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
|
|
28377
|
+
hasActions ? "auto" : null
|
|
28378
|
+
].filter(Boolean).join(" ");
|
|
28373
28379
|
const header = /* @__PURE__ */ jsxs(
|
|
28374
28380
|
Box,
|
|
28375
28381
|
{
|
|
28376
28382
|
role: "row",
|
|
28383
|
+
style: { gridTemplateColumns },
|
|
28377
28384
|
className: cn(
|
|
28378
|
-
"
|
|
28379
|
-
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-
|
|
28385
|
+
"grid items-center gap-3 sticky top-0 z-10",
|
|
28386
|
+
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-border)]",
|
|
28380
28387
|
"text-[var(--color-text-muted)] uppercase text-xs font-semibold tracking-wide",
|
|
28381
28388
|
lk.headPad
|
|
28382
28389
|
),
|
|
28383
28390
|
children: [
|
|
28384
|
-
selectable && /* @__PURE__ */ jsx(Box, { className: "
|
|
28391
|
+
selectable && /* @__PURE__ */ jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsx(Checkbox, { checked: allSelected, onChange: toggleAll, "aria-label": "Select all rows" }) }),
|
|
28385
28392
|
colDefs.map((col) => {
|
|
28386
28393
|
const active = sortColumn === (col.field ?? col.key);
|
|
28387
28394
|
return /* @__PURE__ */ jsxs(
|
|
@@ -28391,7 +28398,6 @@ function TableView({
|
|
|
28391
28398
|
onClick: () => handleSort(col),
|
|
28392
28399
|
className: cn(
|
|
28393
28400
|
"flex items-center gap-1 min-w-0",
|
|
28394
|
-
col.width ?? "flex-1",
|
|
28395
28401
|
alignClass[col.align ?? "left"],
|
|
28396
28402
|
col.sortable && sortEvent && "cursor-pointer select-none hover:text-foreground"
|
|
28397
28403
|
),
|
|
@@ -28411,7 +28417,7 @@ function TableView({
|
|
|
28411
28417
|
col.key
|
|
28412
28418
|
);
|
|
28413
28419
|
}),
|
|
28414
|
-
|
|
28420
|
+
hasActions && /* @__PURE__ */ jsx(Box, { "aria-hidden": true })
|
|
28415
28421
|
]
|
|
28416
28422
|
}
|
|
28417
28423
|
);
|
|
@@ -28423,16 +28429,18 @@ function TableView({
|
|
|
28423
28429
|
role: "row",
|
|
28424
28430
|
"data-entity-row": true,
|
|
28425
28431
|
"data-entity-id": id,
|
|
28432
|
+
style: !hasRenderProp ? { gridTemplateColumns } : void 0,
|
|
28426
28433
|
className: cn(
|
|
28427
|
-
"group
|
|
28434
|
+
"group items-center gap-3 transition-colors duration-fast",
|
|
28435
|
+
hasRenderProp ? "flex" : "grid",
|
|
28428
28436
|
lk.rowPad,
|
|
28429
|
-
lk.divider && "border-b border-[var(--color-
|
|
28437
|
+
lk.divider && "border-b border-[var(--color-border)]",
|
|
28430
28438
|
lk.striped && index % 2 === 1 && "bg-[var(--color-surface-subtle)]",
|
|
28431
28439
|
"hover:bg-[var(--color-surface-subtle)]",
|
|
28432
|
-
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-
|
|
28440
|
+
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-border)] [&>*:last-child]:border-r-0"
|
|
28433
28441
|
),
|
|
28434
28442
|
children: [
|
|
28435
|
-
selectable && /* @__PURE__ */ jsx(Box, { className: "
|
|
28443
|
+
selectable && /* @__PURE__ */ jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsx(
|
|
28436
28444
|
Checkbox,
|
|
28437
28445
|
{
|
|
28438
28446
|
checked: selected.has(id),
|
|
@@ -28444,7 +28452,6 @@ function TableView({
|
|
|
28444
28452
|
const raw = getNestedValue(row, col.field ?? col.key);
|
|
28445
28453
|
const cellBase = cn(
|
|
28446
28454
|
"flex items-center min-w-0",
|
|
28447
|
-
col.width ?? "flex-1",
|
|
28448
28455
|
alignClass[col.align ?? "left"],
|
|
28449
28456
|
weightClass[col.weight ?? "normal"],
|
|
28450
28457
|
col.className
|
|
@@ -28452,7 +28459,7 @@ function TableView({
|
|
|
28452
28459
|
if (col.format === "badge" && raw != null && raw !== "") {
|
|
28453
28460
|
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx(Badge, { variant: statusVariant4(String(raw)), size: "sm", children: String(raw) }) }, col.key);
|
|
28454
28461
|
}
|
|
28455
|
-
return /* @__PURE__ */ jsx(Box, { role: "cell", className:
|
|
28462
|
+
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
|
|
28456
28463
|
}),
|
|
28457
28464
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity", children: itemActions.map((action, i) => /* @__PURE__ */ jsxs(
|
|
28458
28465
|
Button,
|
|
@@ -23,7 +23,9 @@ export interface TableViewColumn {
|
|
|
23
23
|
header?: string;
|
|
24
24
|
/** Accessibility / fallback label. */
|
|
25
25
|
label?: string;
|
|
26
|
-
/**
|
|
26
|
+
/** CSS grid track size for this column (e.g. "7rem", "minmax(10rem, 1.5fr)",
|
|
27
|
+
* "1fr"). Shared across header + body so columns align. Defaults to
|
|
28
|
+
* "minmax(0, 1fr)" (equal flexible share). */
|
|
27
29
|
width?: string;
|
|
28
30
|
/** Horizontal alignment of the column's cells. */
|
|
29
31
|
align?: 'left' | 'center' | 'right';
|
package/dist/providers/index.cjs
CHANGED
|
@@ -29372,18 +29372,25 @@ function TableView({
|
|
|
29372
29372
|
return dnd.enabled ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
29373
29373
|
}
|
|
29374
29374
|
const lk = LOOKS[look];
|
|
29375
|
+
const hasActions = Boolean(itemActions && itemActions.length > 0);
|
|
29376
|
+
const gridTemplateColumns = [
|
|
29377
|
+
selectable ? "auto" : null,
|
|
29378
|
+
...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
|
|
29379
|
+
hasActions ? "auto" : null
|
|
29380
|
+
].filter(Boolean).join(" ");
|
|
29375
29381
|
const header = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29376
29382
|
Box,
|
|
29377
29383
|
{
|
|
29378
29384
|
role: "row",
|
|
29385
|
+
style: { gridTemplateColumns },
|
|
29379
29386
|
className: cn(
|
|
29380
|
-
"
|
|
29381
|
-
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-
|
|
29387
|
+
"grid items-center gap-3 sticky top-0 z-10",
|
|
29388
|
+
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-border)]",
|
|
29382
29389
|
"text-[var(--color-text-muted)] uppercase text-xs font-semibold tracking-wide",
|
|
29383
29390
|
lk.headPad
|
|
29384
29391
|
),
|
|
29385
29392
|
children: [
|
|
29386
|
-
selectable && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "
|
|
29393
|
+
selectable && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { checked: allSelected, onChange: toggleAll, "aria-label": "Select all rows" }) }),
|
|
29387
29394
|
colDefs.map((col) => {
|
|
29388
29395
|
const active = sortColumn === (col.field ?? col.key);
|
|
29389
29396
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -29393,7 +29400,6 @@ function TableView({
|
|
|
29393
29400
|
onClick: () => handleSort(col),
|
|
29394
29401
|
className: cn(
|
|
29395
29402
|
"flex items-center gap-1 min-w-0",
|
|
29396
|
-
col.width ?? "flex-1",
|
|
29397
29403
|
alignClass[col.align ?? "left"],
|
|
29398
29404
|
col.sortable && sortEvent && "cursor-pointer select-none hover:text-foreground"
|
|
29399
29405
|
),
|
|
@@ -29413,7 +29419,7 @@ function TableView({
|
|
|
29413
29419
|
col.key
|
|
29414
29420
|
);
|
|
29415
29421
|
}),
|
|
29416
|
-
|
|
29422
|
+
hasActions && /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": true })
|
|
29417
29423
|
]
|
|
29418
29424
|
}
|
|
29419
29425
|
);
|
|
@@ -29425,16 +29431,18 @@ function TableView({
|
|
|
29425
29431
|
role: "row",
|
|
29426
29432
|
"data-entity-row": true,
|
|
29427
29433
|
"data-entity-id": id,
|
|
29434
|
+
style: !hasRenderProp ? { gridTemplateColumns } : void 0,
|
|
29428
29435
|
className: cn(
|
|
29429
|
-
"group
|
|
29436
|
+
"group items-center gap-3 transition-colors duration-fast",
|
|
29437
|
+
hasRenderProp ? "flex" : "grid",
|
|
29430
29438
|
lk.rowPad,
|
|
29431
|
-
lk.divider && "border-b border-[var(--color-
|
|
29439
|
+
lk.divider && "border-b border-[var(--color-border)]",
|
|
29432
29440
|
lk.striped && index % 2 === 1 && "bg-[var(--color-surface-subtle)]",
|
|
29433
29441
|
"hover:bg-[var(--color-surface-subtle)]",
|
|
29434
|
-
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-
|
|
29442
|
+
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-border)] [&>*:last-child]:border-r-0"
|
|
29435
29443
|
),
|
|
29436
29444
|
children: [
|
|
29437
|
-
selectable && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "
|
|
29445
|
+
selectable && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
29438
29446
|
Checkbox,
|
|
29439
29447
|
{
|
|
29440
29448
|
checked: selected.has(id),
|
|
@@ -29446,7 +29454,6 @@ function TableView({
|
|
|
29446
29454
|
const raw = getNestedValue(row, col.field ?? col.key);
|
|
29447
29455
|
const cellBase = cn(
|
|
29448
29456
|
"flex items-center min-w-0",
|
|
29449
|
-
col.width ?? "flex-1",
|
|
29450
29457
|
alignClass[col.align ?? "left"],
|
|
29451
29458
|
weightClass[col.weight ?? "normal"],
|
|
29452
29459
|
col.className
|
|
@@ -29454,7 +29461,7 @@ function TableView({
|
|
|
29454
29461
|
if (col.format === "badge" && raw != null && raw !== "") {
|
|
29455
29462
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: statusVariant4(String(raw)), size: "sm", children: String(raw) }) }, col.key);
|
|
29456
29463
|
}
|
|
29457
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className:
|
|
29464
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
|
|
29458
29465
|
}),
|
|
29459
29466
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", className: "flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity", children: itemActions.map((action, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29460
29467
|
Button,
|
package/dist/providers/index.js
CHANGED
|
@@ -29323,18 +29323,25 @@ function TableView({
|
|
|
29323
29323
|
return dnd.enabled ? /* @__PURE__ */ jsx(Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
29324
29324
|
}
|
|
29325
29325
|
const lk = LOOKS[look];
|
|
29326
|
+
const hasActions = Boolean(itemActions && itemActions.length > 0);
|
|
29327
|
+
const gridTemplateColumns = [
|
|
29328
|
+
selectable ? "auto" : null,
|
|
29329
|
+
...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
|
|
29330
|
+
hasActions ? "auto" : null
|
|
29331
|
+
].filter(Boolean).join(" ");
|
|
29326
29332
|
const header = /* @__PURE__ */ jsxs(
|
|
29327
29333
|
Box,
|
|
29328
29334
|
{
|
|
29329
29335
|
role: "row",
|
|
29336
|
+
style: { gridTemplateColumns },
|
|
29330
29337
|
className: cn(
|
|
29331
|
-
"
|
|
29332
|
-
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-
|
|
29338
|
+
"grid items-center gap-3 sticky top-0 z-10",
|
|
29339
|
+
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-border)]",
|
|
29333
29340
|
"text-[var(--color-text-muted)] uppercase text-xs font-semibold tracking-wide",
|
|
29334
29341
|
lk.headPad
|
|
29335
29342
|
),
|
|
29336
29343
|
children: [
|
|
29337
|
-
selectable && /* @__PURE__ */ jsx(Box, { className: "
|
|
29344
|
+
selectable && /* @__PURE__ */ jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsx(Checkbox, { checked: allSelected, onChange: toggleAll, "aria-label": "Select all rows" }) }),
|
|
29338
29345
|
colDefs.map((col) => {
|
|
29339
29346
|
const active = sortColumn === (col.field ?? col.key);
|
|
29340
29347
|
return /* @__PURE__ */ jsxs(
|
|
@@ -29344,7 +29351,6 @@ function TableView({
|
|
|
29344
29351
|
onClick: () => handleSort(col),
|
|
29345
29352
|
className: cn(
|
|
29346
29353
|
"flex items-center gap-1 min-w-0",
|
|
29347
|
-
col.width ?? "flex-1",
|
|
29348
29354
|
alignClass[col.align ?? "left"],
|
|
29349
29355
|
col.sortable && sortEvent && "cursor-pointer select-none hover:text-foreground"
|
|
29350
29356
|
),
|
|
@@ -29364,7 +29370,7 @@ function TableView({
|
|
|
29364
29370
|
col.key
|
|
29365
29371
|
);
|
|
29366
29372
|
}),
|
|
29367
|
-
|
|
29373
|
+
hasActions && /* @__PURE__ */ jsx(Box, { "aria-hidden": true })
|
|
29368
29374
|
]
|
|
29369
29375
|
}
|
|
29370
29376
|
);
|
|
@@ -29376,16 +29382,18 @@ function TableView({
|
|
|
29376
29382
|
role: "row",
|
|
29377
29383
|
"data-entity-row": true,
|
|
29378
29384
|
"data-entity-id": id,
|
|
29385
|
+
style: !hasRenderProp ? { gridTemplateColumns } : void 0,
|
|
29379
29386
|
className: cn(
|
|
29380
|
-
"group
|
|
29387
|
+
"group items-center gap-3 transition-colors duration-fast",
|
|
29388
|
+
hasRenderProp ? "flex" : "grid",
|
|
29381
29389
|
lk.rowPad,
|
|
29382
|
-
lk.divider && "border-b border-[var(--color-
|
|
29390
|
+
lk.divider && "border-b border-[var(--color-border)]",
|
|
29383
29391
|
lk.striped && index % 2 === 1 && "bg-[var(--color-surface-subtle)]",
|
|
29384
29392
|
"hover:bg-[var(--color-surface-subtle)]",
|
|
29385
|
-
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-
|
|
29393
|
+
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-border)] [&>*:last-child]:border-r-0"
|
|
29386
29394
|
),
|
|
29387
29395
|
children: [
|
|
29388
|
-
selectable && /* @__PURE__ */ jsx(Box, { className: "
|
|
29396
|
+
selectable && /* @__PURE__ */ jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsx(
|
|
29389
29397
|
Checkbox,
|
|
29390
29398
|
{
|
|
29391
29399
|
checked: selected.has(id),
|
|
@@ -29397,7 +29405,6 @@ function TableView({
|
|
|
29397
29405
|
const raw = getNestedValue(row, col.field ?? col.key);
|
|
29398
29406
|
const cellBase = cn(
|
|
29399
29407
|
"flex items-center min-w-0",
|
|
29400
|
-
col.width ?? "flex-1",
|
|
29401
29408
|
alignClass[col.align ?? "left"],
|
|
29402
29409
|
weightClass[col.weight ?? "normal"],
|
|
29403
29410
|
col.className
|
|
@@ -29405,7 +29412,7 @@ function TableView({
|
|
|
29405
29412
|
if (col.format === "badge" && raw != null && raw !== "") {
|
|
29406
29413
|
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx(Badge, { variant: statusVariant4(String(raw)), size: "sm", children: String(raw) }) }, col.key);
|
|
29407
29414
|
}
|
|
29408
|
-
return /* @__PURE__ */ jsx(Box, { role: "cell", className:
|
|
29415
|
+
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
|
|
29409
29416
|
}),
|
|
29410
29417
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity", children: itemActions.map((action, i) => /* @__PURE__ */ jsxs(
|
|
29411
29418
|
Button,
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -29077,18 +29077,25 @@ function TableView({
|
|
|
29077
29077
|
return dnd.enabled ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
29078
29078
|
}
|
|
29079
29079
|
const lk = LOOKS[look];
|
|
29080
|
+
const hasActions = Boolean(itemActions && itemActions.length > 0);
|
|
29081
|
+
const gridTemplateColumns = [
|
|
29082
|
+
selectable ? "auto" : null,
|
|
29083
|
+
...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
|
|
29084
|
+
hasActions ? "auto" : null
|
|
29085
|
+
].filter(Boolean).join(" ");
|
|
29080
29086
|
const header = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29081
29087
|
Box,
|
|
29082
29088
|
{
|
|
29083
29089
|
role: "row",
|
|
29090
|
+
style: { gridTemplateColumns },
|
|
29084
29091
|
className: cn(
|
|
29085
|
-
"
|
|
29086
|
-
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-
|
|
29092
|
+
"grid items-center gap-3 sticky top-0 z-10",
|
|
29093
|
+
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-border)]",
|
|
29087
29094
|
"text-[var(--color-text-muted)] uppercase text-xs font-semibold tracking-wide",
|
|
29088
29095
|
lk.headPad
|
|
29089
29096
|
),
|
|
29090
29097
|
children: [
|
|
29091
|
-
selectable && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "
|
|
29098
|
+
selectable && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { checked: allSelected, onChange: toggleAll, "aria-label": "Select all rows" }) }),
|
|
29092
29099
|
colDefs.map((col) => {
|
|
29093
29100
|
const active = sortColumn === (col.field ?? col.key);
|
|
29094
29101
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -29098,7 +29105,6 @@ function TableView({
|
|
|
29098
29105
|
onClick: () => handleSort(col),
|
|
29099
29106
|
className: cn(
|
|
29100
29107
|
"flex items-center gap-1 min-w-0",
|
|
29101
|
-
col.width ?? "flex-1",
|
|
29102
29108
|
alignClass[col.align ?? "left"],
|
|
29103
29109
|
col.sortable && sortEvent && "cursor-pointer select-none hover:text-foreground"
|
|
29104
29110
|
),
|
|
@@ -29118,7 +29124,7 @@ function TableView({
|
|
|
29118
29124
|
col.key
|
|
29119
29125
|
);
|
|
29120
29126
|
}),
|
|
29121
|
-
|
|
29127
|
+
hasActions && /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": true })
|
|
29122
29128
|
]
|
|
29123
29129
|
}
|
|
29124
29130
|
);
|
|
@@ -29130,16 +29136,18 @@ function TableView({
|
|
|
29130
29136
|
role: "row",
|
|
29131
29137
|
"data-entity-row": true,
|
|
29132
29138
|
"data-entity-id": id,
|
|
29139
|
+
style: !hasRenderProp ? { gridTemplateColumns } : void 0,
|
|
29133
29140
|
className: cn(
|
|
29134
|
-
"group
|
|
29141
|
+
"group items-center gap-3 transition-colors duration-fast",
|
|
29142
|
+
hasRenderProp ? "flex" : "grid",
|
|
29135
29143
|
lk.rowPad,
|
|
29136
|
-
lk.divider && "border-b border-[var(--color-
|
|
29144
|
+
lk.divider && "border-b border-[var(--color-border)]",
|
|
29137
29145
|
lk.striped && index % 2 === 1 && "bg-[var(--color-surface-subtle)]",
|
|
29138
29146
|
"hover:bg-[var(--color-surface-subtle)]",
|
|
29139
|
-
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-
|
|
29147
|
+
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-border)] [&>*:last-child]:border-r-0"
|
|
29140
29148
|
),
|
|
29141
29149
|
children: [
|
|
29142
|
-
selectable && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "
|
|
29150
|
+
selectable && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
29143
29151
|
Checkbox,
|
|
29144
29152
|
{
|
|
29145
29153
|
checked: selected.has(id),
|
|
@@ -29151,7 +29159,6 @@ function TableView({
|
|
|
29151
29159
|
const raw = getNestedValue(row, col.field ?? col.key);
|
|
29152
29160
|
const cellBase = cn(
|
|
29153
29161
|
"flex items-center min-w-0",
|
|
29154
|
-
col.width ?? "flex-1",
|
|
29155
29162
|
alignClass[col.align ?? "left"],
|
|
29156
29163
|
weightClass[col.weight ?? "normal"],
|
|
29157
29164
|
col.className
|
|
@@ -29159,7 +29166,7 @@ function TableView({
|
|
|
29159
29166
|
if (col.format === "badge" && raw != null && raw !== "") {
|
|
29160
29167
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: statusVariant4(String(raw)), size: "sm", children: String(raw) }) }, col.key);
|
|
29161
29168
|
}
|
|
29162
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className:
|
|
29169
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
|
|
29163
29170
|
}),
|
|
29164
29171
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", className: "flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity", children: itemActions.map((action, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29165
29172
|
Button,
|
package/dist/runtime/index.js
CHANGED
|
@@ -29028,18 +29028,25 @@ function TableView({
|
|
|
29028
29028
|
return dnd.enabled ? /* @__PURE__ */ jsx(Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
29029
29029
|
}
|
|
29030
29030
|
const lk = LOOKS[look];
|
|
29031
|
+
const hasActions = Boolean(itemActions && itemActions.length > 0);
|
|
29032
|
+
const gridTemplateColumns = [
|
|
29033
|
+
selectable ? "auto" : null,
|
|
29034
|
+
...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
|
|
29035
|
+
hasActions ? "auto" : null
|
|
29036
|
+
].filter(Boolean).join(" ");
|
|
29031
29037
|
const header = /* @__PURE__ */ jsxs(
|
|
29032
29038
|
Box,
|
|
29033
29039
|
{
|
|
29034
29040
|
role: "row",
|
|
29041
|
+
style: { gridTemplateColumns },
|
|
29035
29042
|
className: cn(
|
|
29036
|
-
"
|
|
29037
|
-
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-
|
|
29043
|
+
"grid items-center gap-3 sticky top-0 z-10",
|
|
29044
|
+
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-border)]",
|
|
29038
29045
|
"text-[var(--color-text-muted)] uppercase text-xs font-semibold tracking-wide",
|
|
29039
29046
|
lk.headPad
|
|
29040
29047
|
),
|
|
29041
29048
|
children: [
|
|
29042
|
-
selectable && /* @__PURE__ */ jsx(Box, { className: "
|
|
29049
|
+
selectable && /* @__PURE__ */ jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsx(Checkbox, { checked: allSelected, onChange: toggleAll, "aria-label": "Select all rows" }) }),
|
|
29043
29050
|
colDefs.map((col) => {
|
|
29044
29051
|
const active = sortColumn === (col.field ?? col.key);
|
|
29045
29052
|
return /* @__PURE__ */ jsxs(
|
|
@@ -29049,7 +29056,6 @@ function TableView({
|
|
|
29049
29056
|
onClick: () => handleSort(col),
|
|
29050
29057
|
className: cn(
|
|
29051
29058
|
"flex items-center gap-1 min-w-0",
|
|
29052
|
-
col.width ?? "flex-1",
|
|
29053
29059
|
alignClass[col.align ?? "left"],
|
|
29054
29060
|
col.sortable && sortEvent && "cursor-pointer select-none hover:text-foreground"
|
|
29055
29061
|
),
|
|
@@ -29069,7 +29075,7 @@ function TableView({
|
|
|
29069
29075
|
col.key
|
|
29070
29076
|
);
|
|
29071
29077
|
}),
|
|
29072
|
-
|
|
29078
|
+
hasActions && /* @__PURE__ */ jsx(Box, { "aria-hidden": true })
|
|
29073
29079
|
]
|
|
29074
29080
|
}
|
|
29075
29081
|
);
|
|
@@ -29081,16 +29087,18 @@ function TableView({
|
|
|
29081
29087
|
role: "row",
|
|
29082
29088
|
"data-entity-row": true,
|
|
29083
29089
|
"data-entity-id": id,
|
|
29090
|
+
style: !hasRenderProp ? { gridTemplateColumns } : void 0,
|
|
29084
29091
|
className: cn(
|
|
29085
|
-
"group
|
|
29092
|
+
"group items-center gap-3 transition-colors duration-fast",
|
|
29093
|
+
hasRenderProp ? "flex" : "grid",
|
|
29086
29094
|
lk.rowPad,
|
|
29087
|
-
lk.divider && "border-b border-[var(--color-
|
|
29095
|
+
lk.divider && "border-b border-[var(--color-border)]",
|
|
29088
29096
|
lk.striped && index % 2 === 1 && "bg-[var(--color-surface-subtle)]",
|
|
29089
29097
|
"hover:bg-[var(--color-surface-subtle)]",
|
|
29090
|
-
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-
|
|
29098
|
+
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-border)] [&>*:last-child]:border-r-0"
|
|
29091
29099
|
),
|
|
29092
29100
|
children: [
|
|
29093
|
-
selectable && /* @__PURE__ */ jsx(Box, { className: "
|
|
29101
|
+
selectable && /* @__PURE__ */ jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsx(
|
|
29094
29102
|
Checkbox,
|
|
29095
29103
|
{
|
|
29096
29104
|
checked: selected.has(id),
|
|
@@ -29102,7 +29110,6 @@ function TableView({
|
|
|
29102
29110
|
const raw = getNestedValue(row, col.field ?? col.key);
|
|
29103
29111
|
const cellBase = cn(
|
|
29104
29112
|
"flex items-center min-w-0",
|
|
29105
|
-
col.width ?? "flex-1",
|
|
29106
29113
|
alignClass[col.align ?? "left"],
|
|
29107
29114
|
weightClass[col.weight ?? "normal"],
|
|
29108
29115
|
col.className
|
|
@@ -29110,7 +29117,7 @@ function TableView({
|
|
|
29110
29117
|
if (col.format === "badge" && raw != null && raw !== "") {
|
|
29111
29118
|
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx(Badge, { variant: statusVariant4(String(raw)), size: "sm", children: String(raw) }) }, col.key);
|
|
29112
29119
|
}
|
|
29113
|
-
return /* @__PURE__ */ jsx(Box, { role: "cell", className:
|
|
29120
|
+
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
|
|
29114
29121
|
}),
|
|
29115
29122
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity", children: itemActions.map((action, i) => /* @__PURE__ */ jsxs(
|
|
29116
29123
|
Button,
|