@sustaina/shared-ui 1.6.4 → 1.7.0
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.d.mts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +24 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -931,17 +931,24 @@ var DataTable = ({
|
|
|
931
931
|
return /* @__PURE__ */ jsx(TableRow, { children: headerGroup.headers.map((header) => {
|
|
932
932
|
const { classes, style } = getColumnPinningStyles(header.column);
|
|
933
933
|
const useColumnSizing = header.column.columnDef?.meta?.useColumnSizing ?? columnResizing?.enabled ?? false;
|
|
934
|
+
const tableHeadCellProps = typeof components?.tableHeadCellProps === "function" ? components?.tableHeadCellProps({ header, table }) : components?.tableHeadCellProps;
|
|
934
935
|
return /* @__PURE__ */ jsxs(
|
|
935
936
|
TableHead,
|
|
936
937
|
{
|
|
937
938
|
colSpan: header.colSpan,
|
|
939
|
+
...tableHeadCellProps,
|
|
938
940
|
...header.column.columnDef?.meta?.headerProps,
|
|
939
|
-
className: cn(
|
|
941
|
+
className: cn(
|
|
942
|
+
classes,
|
|
943
|
+
tableHeadCellProps?.className,
|
|
944
|
+
header.column.columnDef?.meta?.headerProps?.className
|
|
945
|
+
),
|
|
940
946
|
style: {
|
|
941
947
|
...style,
|
|
942
948
|
width: useColumnSizing ? header.column.getSize() : void 0,
|
|
943
949
|
minWidth: useColumnSizing ? header.column.columnDef.minSize : void 0,
|
|
944
950
|
maxWidth: useColumnSizing ? header.column.columnDef.maxSize : void 0,
|
|
951
|
+
...tableHeadCellProps?.style,
|
|
945
952
|
...header.column.columnDef?.meta?.headerProps?.style
|
|
946
953
|
},
|
|
947
954
|
children: [
|
|
@@ -956,14 +963,17 @@ var DataTable = ({
|
|
|
956
963
|
isSomeColumnsFilterable && /* @__PURE__ */ jsx(TableRow, { children: filterableColumns.map((column) => {
|
|
957
964
|
const { classes, style } = getColumnPinningStyles(column);
|
|
958
965
|
const useColumnSizing = column.columnDef.meta?.useColumnSizing ?? columnResizing?.enabled ?? false;
|
|
966
|
+
const tableFilterCellProps = typeof components?.tableFilterCellProps === "function" ? components?.tableFilterCellProps({ column, table }) : components?.tableFilterCellProps;
|
|
959
967
|
return /* @__PURE__ */ jsx(
|
|
960
968
|
TableCell,
|
|
961
969
|
{
|
|
962
|
-
...
|
|
970
|
+
...tableFilterCellProps,
|
|
971
|
+
...column.columnDef?.meta?.filterCellProps,
|
|
963
972
|
className: cn(
|
|
964
973
|
"bg-white border-b",
|
|
965
974
|
classes,
|
|
966
|
-
|
|
975
|
+
tableFilterCellProps?.className,
|
|
976
|
+
column.columnDef?.meta?.filterCellProps?.className
|
|
967
977
|
),
|
|
968
978
|
style: {
|
|
969
979
|
// TODO: should we separate styles for filter or use same columns styles
|
|
@@ -971,7 +981,8 @@ var DataTable = ({
|
|
|
971
981
|
width: useColumnSizing ? column.getSize() : void 0,
|
|
972
982
|
minWidth: useColumnSizing ? column.columnDef.minSize : void 0,
|
|
973
983
|
maxWidth: useColumnSizing ? column.columnDef.maxSize : void 0,
|
|
974
|
-
...
|
|
984
|
+
...tableFilterCellProps?.style,
|
|
985
|
+
...column.columnDef?.meta?.filterCellProps?.style
|
|
975
986
|
},
|
|
976
987
|
children: column.getCanFilter() && column.columnDef.meta?.renderColumnFilter?.({
|
|
977
988
|
column,
|
|
@@ -1003,9 +1014,11 @@ var DataTable = ({
|
|
|
1003
1014
|
row.getVisibleCells().map((cell) => {
|
|
1004
1015
|
const { classes, style } = getColumnPinningStyles(cell.column);
|
|
1005
1016
|
const useColumnSizing = cell.column.columnDef.meta?.useColumnSizing ?? columnResizing?.enabled ?? false;
|
|
1017
|
+
const tableDataCellProps = typeof components?.tableDataCellProps === "function" ? components?.tableDataCellProps({ row, cell, table }) : components?.tableDataCellProps;
|
|
1006
1018
|
return /* @__PURE__ */ jsx(
|
|
1007
1019
|
TableCell,
|
|
1008
1020
|
{
|
|
1021
|
+
...tableDataCellProps,
|
|
1009
1022
|
...cell.column.columnDef?.meta?.cellProps,
|
|
1010
1023
|
className: cn(
|
|
1011
1024
|
{
|
|
@@ -1013,6 +1026,7 @@ var DataTable = ({
|
|
|
1013
1026
|
"bg-white group-hover:bg-[#eff5f1]": !row.getIsSelected()
|
|
1014
1027
|
},
|
|
1015
1028
|
classes,
|
|
1029
|
+
tableDataCellProps?.className,
|
|
1016
1030
|
cell.column.columnDef?.meta?.cellProps?.className
|
|
1017
1031
|
),
|
|
1018
1032
|
style: {
|
|
@@ -1020,6 +1034,7 @@ var DataTable = ({
|
|
|
1020
1034
|
width: useColumnSizing ? cell.column.getSize() : void 0,
|
|
1021
1035
|
minWidth: useColumnSizing ? cell.column.columnDef.minSize : void 0,
|
|
1022
1036
|
maxWidth: useColumnSizing ? cell.column.columnDef.maxSize : void 0,
|
|
1037
|
+
...tableDataCellProps?.style,
|
|
1023
1038
|
...cell.column.columnDef?.meta?.cellProps?.style
|
|
1024
1039
|
},
|
|
1025
1040
|
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
@@ -1957,7 +1972,7 @@ var Navbar = ({
|
|
|
1957
1972
|
isValidElement(title) ? title : /* @__PURE__ */ jsx("h1", { className: "text-white text-xl font-bold", children: title }),
|
|
1958
1973
|
isValidElement(subTitle) ? subTitle : /* @__PURE__ */ jsx("h1", { className: "text-white text-sm font-semibold", children: subTitle })
|
|
1959
1974
|
] }),
|
|
1960
|
-
tooltipTitle && /* @__PURE__ */ jsxs(Tooltip2, {
|
|
1975
|
+
tooltipTitle && /* @__PURE__ */ jsxs(Tooltip2, { children: [
|
|
1961
1976
|
/* @__PURE__ */ jsx(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsx("button", { className: "text-white hover:opacity-80", children: /* @__PURE__ */ jsx(InfoIcon_default, { className: "w-4" }) }) }),
|
|
1962
1977
|
/* @__PURE__ */ jsxs(
|
|
1963
1978
|
TooltipContent2,
|
|
@@ -5215,7 +5230,8 @@ function DialogAlert({
|
|
|
5215
5230
|
onCancel,
|
|
5216
5231
|
showCancel = true,
|
|
5217
5232
|
align = "center",
|
|
5218
|
-
outlet
|
|
5233
|
+
outlet,
|
|
5234
|
+
persistent = false
|
|
5219
5235
|
}) {
|
|
5220
5236
|
const alignClass = align === "start" ? "justify-start" : align === "end" ? "justify-end" : "justify-center";
|
|
5221
5237
|
const handleCancel = useCallback(() => {
|
|
@@ -5225,7 +5241,8 @@ function DialogAlert({
|
|
|
5225
5241
|
const handleConfirm = useCallback(() => {
|
|
5226
5242
|
onConfirm?.();
|
|
5227
5243
|
}, [onConfirm]);
|
|
5228
|
-
return /* @__PURE__ */ jsx(Dialog2, { open, onOpenChange
|
|
5244
|
+
return /* @__PURE__ */ jsx(Dialog2, { open, onOpenChange: persistent ? () => {
|
|
5245
|
+
} : onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent2, { className: "max-w-md", showCloseButton: !persistent, children: [
|
|
5229
5246
|
/* @__PURE__ */ jsxs(DialogHeader2, { children: [
|
|
5230
5247
|
title && /* @__PURE__ */ jsx(DialogTitle2, { className: variantClass(variant), children: title }),
|
|
5231
5248
|
description && /* @__PURE__ */ jsx(DialogDescription2, { children: description })
|