@bsol-oss/react-datatable5 12.0.0-beta.20 → 12.0.0-beta.21
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.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Row, RowData, OnChangeFn, Updater, FilterFn, ColumnDef, RowSelectionSta
|
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default, { ReactNode, Dispatch, SetStateAction } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
-
import { ImageProps, TableRootProps, TableHeaderProps as TableHeaderProps$1, TableRowProps,
|
|
6
|
+
import { ImageProps, GridProps, TableRootProps, TableHeaderProps as TableHeaderProps$1, TableRowProps, CardBodyProps, FlexProps, TextProps, BoxProps } from '@chakra-ui/react';
|
|
7
7
|
import { IconType } from 'react-icons';
|
|
8
8
|
import * as react_i18next from 'react-i18next';
|
|
9
9
|
import { UseTranslationResponse } from 'react-i18next';
|
|
@@ -308,8 +308,9 @@ interface TableControlsProps {
|
|
|
308
308
|
extraItems?: ReactNode;
|
|
309
309
|
loading?: boolean;
|
|
310
310
|
hasError?: boolean;
|
|
311
|
+
gridProps?: GridProps;
|
|
311
312
|
}
|
|
312
|
-
declare const TableControls: ({ fitTableWidth, fitTableHeight, children, showGlobalFilter, showFilter, showFilterName, showFilterTags, showReload, showPagination, showPageSizeControl, showPageCountText, showView, filterOptions, extraItems, loading, hasError, }: TableControlsProps) => react_jsx_runtime.JSX.Element;
|
|
313
|
+
declare const TableControls: ({ fitTableWidth, fitTableHeight, children, showGlobalFilter, showFilter, showFilterName, showFilterTags, showReload, showPagination, showPageSizeControl, showPageCountText, showView, filterOptions, extraItems, loading, hasError, gridProps, }: TableControlsProps) => react_jsx_runtime.JSX.Element;
|
|
313
314
|
|
|
314
315
|
interface TableProps extends TableRootProps {
|
|
315
316
|
showLoading?: boolean;
|
|
@@ -342,14 +343,10 @@ interface TableRowSelectorProps<TData> {
|
|
|
342
343
|
declare const TableBody: ({ showSelector, alwaysShowSelector, canResize, }: TableBodyProps) => react_jsx_runtime.JSX.Element;
|
|
343
344
|
|
|
344
345
|
interface TableFooterProps {
|
|
345
|
-
pinnedBgColor?: {
|
|
346
|
-
light: string;
|
|
347
|
-
dark: string;
|
|
348
|
-
};
|
|
349
346
|
showSelector?: boolean;
|
|
350
347
|
alwaysShowSelector?: boolean;
|
|
351
348
|
}
|
|
352
|
-
declare const TableFooter: ({
|
|
349
|
+
declare const TableFooter: ({ showSelector, alwaysShowSelector, }: TableFooterProps) => react_jsx_runtime.JSX.Element;
|
|
353
350
|
|
|
354
351
|
interface TableHeaderProps {
|
|
355
352
|
canResize?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -2457,7 +2457,7 @@ function ColumnCard({ columnId }) {
|
|
|
2457
2457
|
onDrop: () => setDragging(false), // NEW
|
|
2458
2458
|
});
|
|
2459
2459
|
}, [columnId, table]);
|
|
2460
|
-
return (jsxRuntime.jsxs(react.Grid, { ref: ref, templateColumns: "auto 1fr", gap: "0.5rem", alignItems: "center", style: dragging ? { opacity: 0.4 } : {}, children: [jsxRuntime.jsx(react.Flex, { alignItems: "center", padding: "0", cursor: "grab", children: jsxRuntime.jsx(fa6.FaGripLinesVertical, { color: "
|
|
2460
|
+
return (jsxRuntime.jsxs(react.Grid, { ref: ref, templateColumns: "auto 1fr", gap: "0.5rem", alignItems: "center", style: dragging ? { opacity: 0.4 } : {}, children: [jsxRuntime.jsx(react.Flex, { alignItems: "center", padding: "0", cursor: "grab", children: jsxRuntime.jsx(fa6.FaGripLinesVertical, { color: "colorPalette.400" }) }), jsxRuntime.jsx(react.Flex, { justifyContent: "space-between", alignItems: "center", children: jsxRuntime.jsx(CheckboxCard, { variant: "surface", label: displayName, checked: column.getIsVisible(), onChange: column.getToggleVisibilityHandler() }) })] }));
|
|
2461
2461
|
}
|
|
2462
2462
|
function CardContainer({ location, children }) {
|
|
2463
2463
|
const ref = React.useRef(null);
|
|
@@ -2589,7 +2589,7 @@ const RecordDisplay = ({ object, boxProps, translate, prefix = "", }) => {
|
|
|
2589
2589
|
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: "null" });
|
|
2590
2590
|
}
|
|
2591
2591
|
return (jsxRuntime.jsx(react.Grid, { rowGap: 1, padding: 1, overflow: "auto", ...boxProps, children: Object.entries(object).map(([field, value]) => {
|
|
2592
|
-
return (jsxRuntime.jsxs(react.Grid, { columnGap: 2, gridTemplateColumns: "auto 1fr", children: [jsxRuntime.jsx(react.Text, { color: "
|
|
2592
|
+
return (jsxRuntime.jsxs(react.Grid, { columnGap: 2, gridTemplateColumns: "auto 1fr", children: [jsxRuntime.jsx(react.Text, { color: "colorPalette.400", children: getColumn({ field }) }), typeof value === "object" ? (jsxRuntime.jsx(RecordDisplay, { object: value, prefix: `${prefix}${field}.`, translate: translate })) : (jsxRuntime.jsx(react.Text, { children: JSON.stringify(value) }))] }, field));
|
|
2593
2593
|
}) }));
|
|
2594
2594
|
};
|
|
2595
2595
|
|
|
@@ -2639,7 +2639,7 @@ const CellRenderer = ({ cell }) => {
|
|
|
2639
2639
|
paddingY: 2,
|
|
2640
2640
|
}, object: value })] }, cell.id));
|
|
2641
2641
|
}
|
|
2642
|
-
return (jsxRuntime.jsxs(react.Box, { gridColumn, gridRow, children: [jsxRuntime.jsx(react.Box, { color:
|
|
2642
|
+
return (jsxRuntime.jsxs(react.Box, { gridColumn, gridRow, children: [jsxRuntime.jsx(react.Box, { color: "colorPalette.400", children: getLabel({ columnId: cell.column.id }) }), jsxRuntime.jsx(react.Box, { wordBreak: "break-word", textOverflow: "ellipsis", overflow: "hidden", children: `${formatValue(cell.getValue())}` })] }, cell.id));
|
|
2643
2643
|
};
|
|
2644
2644
|
const DataDisplay = ({ variant = "" }) => {
|
|
2645
2645
|
const { table, translate } = useDataTableContext();
|
|
@@ -2995,13 +2995,11 @@ const TableFilterTags = () => {
|
|
|
2995
2995
|
}) }));
|
|
2996
2996
|
};
|
|
2997
2997
|
|
|
2998
|
-
const TableControls = ({ fitTableWidth = false, fitTableHeight = false, children = jsxRuntime.jsx(jsxRuntime.Fragment, {}), showGlobalFilter = false, showFilter = false, showFilterName = false, showFilterTags = false, showReload = false, showPagination = true, showPageSizeControl = true, showPageCountText = true, showView = true, filterOptions = [], extraItems = jsxRuntime.jsx(jsxRuntime.Fragment, {}), loading = false, hasError = false, }) => {
|
|
2998
|
+
const TableControls = ({ fitTableWidth = false, fitTableHeight = false, children = jsxRuntime.jsx(jsxRuntime.Fragment, {}), showGlobalFilter = false, showFilter = false, showFilterName = false, showFilterTags = false, showReload = false, showPagination = true, showPageSizeControl = true, showPageCountText = true, showView = true, filterOptions = [], extraItems = jsxRuntime.jsx(jsxRuntime.Fragment, {}), loading = false, hasError = false, gridProps = {}, }) => {
|
|
2999
2999
|
const { translate } = useDataTableContext();
|
|
3000
|
-
return (jsxRuntime.jsxs(react.Grid, { templateRows: "auto 1fr", width: fitTableWidth ? "fit-content" : "100%", height: fitTableHeight ? "fit-content" : "100%", gap: "0.5rem", children: [jsxRuntime.jsxs(react.Flex, { flexFlow: "column", gap: 2, children: [jsxRuntime.jsxs(react.Flex, { justifyContent: "space-between", children: [jsxRuntime.jsx(react.Box, { children: showView && jsxRuntime.jsx(ViewDialog, { icon: jsxRuntime.jsx(md.MdOutlineViewColumn, {}) }) }), jsxRuntime.jsxs(react.Flex, { gap: "0.5rem", alignItems: "center", justifySelf: "end", children: [loading && jsxRuntime.jsx(react.Spinner, { size: "sm" }), hasError && (jsxRuntime.jsx(Tooltip, { content: translate.t("has_error"), children: jsxRuntime.jsx(react.Icon, { as: bs.BsExclamationCircleFill, color: "red.400" }) })), showGlobalFilter && jsxRuntime.jsx(GlobalFilter, {}), showFilter && jsxRuntime.jsx(FilterDialog, {}), showReload && jsxRuntime.jsx(ReloadButton, {}), extraItems] })] }), filterOptions.length > 0 && (jsxRuntime.jsx(react.Flex, { flexFlow: "column", gap: "0.5rem", children: filterOptions.map((column) => {
|
|
3000
|
+
return (jsxRuntime.jsxs(react.Grid, { templateRows: "auto 1fr", width: fitTableWidth ? "fit-content" : "100%", height: fitTableHeight ? "fit-content" : "100%", gap: "0.5rem", ...gridProps, children: [jsxRuntime.jsxs(react.Flex, { flexFlow: "column", gap: 2, children: [jsxRuntime.jsxs(react.Flex, { justifyContent: "space-between", children: [jsxRuntime.jsx(react.Box, { children: showView && jsxRuntime.jsx(ViewDialog, { icon: jsxRuntime.jsx(md.MdOutlineViewColumn, {}) }) }), jsxRuntime.jsxs(react.Flex, { gap: "0.5rem", alignItems: "center", justifySelf: "end", children: [loading && jsxRuntime.jsx(react.Spinner, { size: "sm" }), hasError && (jsxRuntime.jsx(Tooltip, { content: translate.t("has_error"), children: jsxRuntime.jsx(react.Icon, { as: bs.BsExclamationCircleFill, color: "red.400" }) })), showGlobalFilter && jsxRuntime.jsx(GlobalFilter, {}), showFilter && jsxRuntime.jsx(FilterDialog, {}), showReload && jsxRuntime.jsx(ReloadButton, {}), extraItems] })] }), filterOptions.length > 0 && (jsxRuntime.jsx(react.Flex, { flexFlow: "column", gap: "0.5rem", children: filterOptions.map((column) => {
|
|
3001
3001
|
return (jsxRuntime.jsxs(react.Flex, { alignItems: "center", flexFlow: "wrap", gap: "0.5rem", children: [showFilterName && jsxRuntime.jsxs(react.Text, { children: [column, ":"] }), jsxRuntime.jsx(FilterOptions, { column: column })] }, column));
|
|
3002
|
-
}) })), showFilterTags && (jsxRuntime.jsx(react.Flex, { children: jsxRuntime.jsx(TableFilterTags, {}) }))] }), jsxRuntime.jsx(react.Grid, { overflow: "auto",
|
|
3003
|
-
backgroundColor: "gray.900",
|
|
3004
|
-
}, children: children }), (showPageSizeControl || showPageCountText || showPagination) && (jsxRuntime.jsxs(react.Flex, { justifyContent: "space-between", children: [jsxRuntime.jsxs(react.Flex, { gap: "1rem", alignItems: "center", children: [showPageSizeControl && jsxRuntime.jsx(PageSizeControl, {}), showPageCountText && (jsxRuntime.jsxs(react.Flex, { children: [jsxRuntime.jsx(react.Text, { paddingRight: "0.5rem", children: translate.t("rowcount.total") }), jsxRuntime.jsx(RowCountText, {})] }))] }), jsxRuntime.jsx(react.Box, { justifySelf: "end", children: showPagination && jsxRuntime.jsx(Pagination, {}) })] }))] }));
|
|
3002
|
+
}) })), showFilterTags && (jsxRuntime.jsx(react.Flex, { children: jsxRuntime.jsx(TableFilterTags, {}) }))] }), jsxRuntime.jsx(react.Grid, { overflow: "auto", bg: { base: "colorPalette.50", _dark: "colorPalette.950" }, children: children }), (showPageSizeControl || showPageCountText || showPagination) && (jsxRuntime.jsxs(react.Flex, { justifyContent: "space-between", children: [jsxRuntime.jsxs(react.Flex, { gap: "1rem", alignItems: "center", children: [showPageSizeControl && jsxRuntime.jsx(PageSizeControl, {}), showPageCountText && (jsxRuntime.jsxs(react.Flex, { children: [jsxRuntime.jsx(react.Text, { paddingRight: "0.5rem", children: translate.t("rowcount.total") }), jsxRuntime.jsx(RowCountText, {})] }))] }), jsxRuntime.jsx(react.Box, { justifySelf: "end", children: showPagination && jsxRuntime.jsx(Pagination, {}) })] }))] }));
|
|
3005
3003
|
};
|
|
3006
3004
|
|
|
3007
3005
|
const EmptyState = React__namespace.forwardRef(function EmptyState(props, ref) {
|
|
@@ -3015,7 +3013,7 @@ const Table = ({ children, emptyComponent = EmptyResult, canResize = true, ...pr
|
|
|
3015
3013
|
if (table.getRowModel().rows.length <= 0) {
|
|
3016
3014
|
return emptyComponent;
|
|
3017
3015
|
}
|
|
3018
|
-
return (jsxRuntime.jsx(react.Table.Root, { stickyHeader: true, variant: "outline", width: canResize ? table.getCenterTotalSize() : undefined, display: "grid", alignContent: "start", overflowY: "auto", ...props, children: children }));
|
|
3016
|
+
return (jsxRuntime.jsx(react.Table.Root, { stickyHeader: true, variant: "outline", width: canResize ? table.getCenterTotalSize() : undefined, display: "grid", alignContent: "start", overflowY: "auto", bg: { base: "colorPalette.50", _dark: "colorPalette.950" }, ...props, children: children }));
|
|
3019
3017
|
};
|
|
3020
3018
|
|
|
3021
3019
|
const Checkbox = React__namespace.forwardRef(function Checkbox(props, ref) {
|
|
@@ -3079,7 +3077,7 @@ const TableRowSelector = ({ index, row, }) => {
|
|
|
3079
3077
|
onCheckedChange: row.getToggleSelectedHandler() }) }));
|
|
3080
3078
|
};
|
|
3081
3079
|
|
|
3082
|
-
const TableFooter = ({
|
|
3080
|
+
const TableFooter = ({ showSelector = false, alwaysShowSelector = true, }) => {
|
|
3083
3081
|
const table = useDataTableContext().table;
|
|
3084
3082
|
const SELECTION_BOX_WIDTH = 20;
|
|
3085
3083
|
const [hoveredCheckBox, setHoveredCheckBox] = React.useState(false);
|
|
@@ -3098,41 +3096,11 @@ const TableFooter = ({ pinnedBgColor = { light: "gray.50", dark: "gray.700" }, s
|
|
|
3098
3096
|
}
|
|
3099
3097
|
return false;
|
|
3100
3098
|
};
|
|
3101
|
-
|
|
3102
|
-
const thProps = header.column.getIsPinned()
|
|
3103
|
-
? {
|
|
3104
|
-
left: showSelector
|
|
3105
|
-
? `${header.getStart("left") + SELECTION_BOX_WIDTH + table.getDensityValue() * 2}px`
|
|
3106
|
-
: `${header.getStart("left") + table.getDensityValue() * 2}px`,
|
|
3107
|
-
background: pinnedBgColor.light,
|
|
3108
|
-
position: "sticky",
|
|
3109
|
-
zIndex: 1,
|
|
3110
|
-
_dark: {
|
|
3111
|
-
backgroundColor: pinnedBgColor.dark,
|
|
3112
|
-
},
|
|
3113
|
-
}
|
|
3114
|
-
: {};
|
|
3115
|
-
return thProps;
|
|
3116
|
-
};
|
|
3117
|
-
return (jsxRuntime.jsx(react.Table.Footer, { children: table.getFooterGroups().map((footerGroup) => (jsxRuntime.jsxs(react.Table.Row, { display: "flex", children: [showSelector && (jsxRuntime.jsxs(react.Table.Header
|
|
3118
|
-
// styling resize and pinning start
|
|
3119
|
-
, {
|
|
3120
|
-
// styling resize and pinning start
|
|
3121
|
-
padding: `${table.getDensityValue()}px`, ...(table.getIsSomeColumnsPinned("left")
|
|
3122
|
-
? {
|
|
3123
|
-
left: `0px`,
|
|
3124
|
-
backgroundColor: pinnedBgColor.light,
|
|
3125
|
-
position: "sticky",
|
|
3126
|
-
zIndex: 1,
|
|
3127
|
-
_dark: { backgroundColor: pinnedBgColor.dark },
|
|
3128
|
-
}
|
|
3129
|
-
: {}),
|
|
3130
|
-
// styling resize and pinning end
|
|
3131
|
-
onMouseEnter: () => handleRowHover(true), onMouseLeave: () => handleRowHover(false), display: "grid", children: [isCheckBoxVisible() && (jsxRuntime.jsx(react.Box, { margin: "0rem", display: "grid", justifyItems: "center", alignItems: "center", children: jsxRuntime.jsx(Checkbox, { width: `${SELECTION_BOX_WIDTH}px`, height: `${SELECTION_BOX_WIDTH}px`, isChecked: table.getIsAllRowsSelected(),
|
|
3099
|
+
return (jsxRuntime.jsx(react.Table.Footer, { children: table.getFooterGroups().map((footerGroup) => (jsxRuntime.jsxs(react.Table.Row, { display: "flex", children: [showSelector && (jsxRuntime.jsxs(react.Table.Header, { padding: `${table.getDensityValue()}px`, onMouseEnter: () => handleRowHover(true), onMouseLeave: () => handleRowHover(false), display: "grid", children: [isCheckBoxVisible() && (jsxRuntime.jsx(react.Box, { margin: "0rem", display: "grid", justifyItems: "center", alignItems: "center", children: jsxRuntime.jsx(Checkbox, { width: `${SELECTION_BOX_WIDTH}px`, height: `${SELECTION_BOX_WIDTH}px`, isChecked: table.getIsAllRowsSelected(),
|
|
3132
3100
|
// indeterminate: table.getIsSomeRowsSelected(),
|
|
3133
3101
|
onChange: table.getToggleAllRowsSelectedHandler() }) })), !isCheckBoxVisible() && (jsxRuntime.jsx(react.Box, { as: "span", margin: "0rem", display: "grid", justifyItems: "center", alignItems: "center", width: `${SELECTION_BOX_WIDTH}px`, height: `${SELECTION_BOX_WIDTH}px` }))] })), footerGroup.headers.map((header) => (jsxRuntime.jsx(react.Table.Cell, { padding: "0", columnSpan: `${header.colSpan}`,
|
|
3134
3102
|
// styling resize and pinning start
|
|
3135
|
-
maxWidth: `${header.getSize()}px`, width: `${header.getSize()}px`, display: "grid",
|
|
3103
|
+
maxWidth: `${header.getSize()}px`, width: `${header.getSize()}px`, display: "grid", children: jsxRuntime.jsx(react.MenuRoot, { children: jsxRuntime.jsx(react.MenuTrigger, { asChild: true, children: jsxRuntime.jsx(react.Box, { padding: `${table.getDensityValue()}px`, display: "flex", alignItems: "center", justifyContent: "start", borderRadius: "0rem", children: jsxRuntime.jsxs(react.Flex, { gap: "0.5rem", alignItems: "center", children: [header.isPlaceholder
|
|
3136
3104
|
? null
|
|
3137
3105
|
: reactTable.flexRender(header.column.columnDef.footer, header.getContext()), jsxRuntime.jsx(react.Box, { children: header.column.getCanSort() && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [header.column.getIsSorted() === false && (
|
|
3138
3106
|
// <UpDownIcon />
|
|
@@ -3158,7 +3126,7 @@ const TableHeader = ({ canResize = true, showSelector = false, isSticky = true,
|
|
|
3158
3126
|
position: "sticky",
|
|
3159
3127
|
top: 0,
|
|
3160
3128
|
};
|
|
3161
|
-
return (jsxRuntime.jsx(react.Table.Header, { ...(isSticky ? stickyProps : {}), ...tableHeaderProps, children: table.getHeaderGroups().map((headerGroup) => (jsxRuntime.jsxs(react.Table.Row, { display: "flex", ...tableRowProps, children: [showSelector && (jsxRuntime.jsx(react.Table.ColumnHeader, { padding: `${table.getDensityValue()}px`, display: "grid", color: {
|
|
3129
|
+
return (jsxRuntime.jsx(react.Table.Header, { ...(isSticky ? stickyProps : {}), bgColor: "transparent", ...tableHeaderProps, children: table.getHeaderGroups().map((headerGroup) => (jsxRuntime.jsxs(react.Table.Row, { display: "flex", bgColor: "transparent", ...tableRowProps, children: [showSelector && (jsxRuntime.jsx(react.Table.ColumnHeader, { padding: `${table.getDensityValue()}px`, display: "grid", color: {
|
|
3162
3130
|
base: "colorPalette.900",
|
|
3163
3131
|
_dark: "colorPalette.100",
|
|
3164
3132
|
},
|
|
@@ -3176,10 +3144,20 @@ const TableHeader = ({ canResize = true, showSelector = false, isSticky = true,
|
|
|
3176
3144
|
base: "colorPalette.800",
|
|
3177
3145
|
_dark: "colorPalette.200",
|
|
3178
3146
|
},
|
|
3179
|
-
bg: { base: "colorPalette.100", _dark: "colorPalette.900" }, ...getThProps(header), children: [jsxRuntime.jsxs(MenuRoot, { children: [jsxRuntime.jsx(MenuTrigger, { asChild: true, children: jsxRuntime.jsx(react.Flex, { padding: `${table.getDensityValue()}px`, alignItems: "center", justifyContent: "start", borderRadius: "0rem", overflow: "auto",
|
|
3180
|
-
|
|
3181
|
-
_dark:
|
|
3182
|
-
|
|
3147
|
+
bg: { base: "colorPalette.100", _dark: "colorPalette.900" }, ...getThProps(header), children: [jsxRuntime.jsxs(MenuRoot, { children: [jsxRuntime.jsx(MenuTrigger, { asChild: true, children: jsxRuntime.jsx(react.Flex, { padding: `${table.getDensityValue()}px`, alignItems: "center", justifyContent: "start", borderRadius: "0rem", overflow: "auto", color: {
|
|
3148
|
+
base: "colorPalette.800",
|
|
3149
|
+
_dark: "colorPalette.200",
|
|
3150
|
+
_hover: {
|
|
3151
|
+
base: "colorPalette.700",
|
|
3152
|
+
_dark: "colorPalette.300",
|
|
3153
|
+
},
|
|
3154
|
+
},
|
|
3155
|
+
bg: {
|
|
3156
|
+
base: "colorPalette.100",
|
|
3157
|
+
_dark: "colorPalette.900",
|
|
3158
|
+
_hover: {
|
|
3159
|
+
base: "colorPalette.200",
|
|
3160
|
+
_dark: "colorPalette.800",
|
|
3183
3161
|
},
|
|
3184
3162
|
}, children: jsxRuntime.jsxs(react.Flex, { gap: "0.5rem", alignItems: "center", children: [header.isPlaceholder
|
|
3185
3163
|
? null
|
|
@@ -3207,10 +3185,12 @@ const TableHeader = ({ canResize = true, showSelector = false, isSticky = true,
|
|
|
3207
3185
|
});
|
|
3208
3186
|
}, children: [jsxRuntime.jsx(gr.GrDescend, {}), "Sort Descending"] }) }), header.column.getIsSorted() && (jsxRuntime.jsx(MenuItem, { asChild: true, value: "sort-descend", children: jsxRuntime.jsxs(Button, { variant: "ghost", onClick: () => {
|
|
3209
3187
|
header.column.clearSorting();
|
|
3210
|
-
}, children: [jsxRuntime.jsx(md.MdClear, {}), "Clear Sorting"] }) }))] }))] })] }), canResize && (jsxRuntime.jsx(react.Box, { borderRight: "0.2rem solid", borderRightColor: header.column.getIsResizing()
|
|
3188
|
+
}, children: [jsxRuntime.jsx(md.MdClear, {}), "Clear Sorting"] }) }))] }))] })] }), canResize && (jsxRuntime.jsx(react.Box, { borderRight: "0.2rem solid", borderRightColor: header.column.getIsResizing()
|
|
3189
|
+
? "colorPalette.700"
|
|
3190
|
+
: "transparent", position: "relative", right: "0.1rem", width: "2px", height: "100%", userSelect: "none", style: { touchAction: "none" }, _hover: {
|
|
3211
3191
|
borderRightColor: header.column.getIsResizing()
|
|
3212
|
-
? "
|
|
3213
|
-
: "
|
|
3192
|
+
? "colorPalette.700"
|
|
3193
|
+
: "colorPalette.400",
|
|
3214
3194
|
}, ...resizeProps }))] }, `chakra-table-header-${header.id}`));
|
|
3215
3195
|
})] }, `chakra-table-headergroup-${headerGroup.id}`))) }));
|
|
3216
3196
|
};
|
|
@@ -3851,7 +3831,7 @@ const EnumPicker = ({ column, isMultiple = false, schema, prefix, }) => {
|
|
|
3851
3831
|
}
|
|
3852
3832
|
const newSet = new Set([...(watchEnums ?? []), item]);
|
|
3853
3833
|
setValue(colLabel, [...newSet]);
|
|
3854
|
-
}, ...(selected ? { color: "
|
|
3834
|
+
}, ...(selected ? { color: "colorPalette.400/50" } : {}), children: !!renderDisplay === true
|
|
3855
3835
|
? renderDisplay(item)
|
|
3856
3836
|
: translate.t(removeIndex(`${colLabel}.${item}`)) }, `${colLabel}-${item}`));
|
|
3857
3837
|
}) }), isDirty && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: dataList.length <= 0 && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: translate.t(removeIndex(`${colLabel}.empty_search_result`)) })) }))] })] }) })] }), errors[`${column}`] && (jsxRuntime.jsx(react.Text, { color: "red.400", children: translate.t(removeIndex(`${colLabel}.field_required`)) }))] }));
|
|
@@ -4206,7 +4186,7 @@ const FileDropzone = ({ children = undefined, gridProps = {}, onDrop = () => { }
|
|
|
4206
4186
|
const filesArray = [...event.target.files];
|
|
4207
4187
|
onDrop({ files: filesArray });
|
|
4208
4188
|
};
|
|
4209
|
-
return (jsxRuntime.jsxs(react.Grid, { ...getColor(isDraggedOver), ref: ref, cursor: "pointer", onClick: handleClick, borderStyle: "dashed", borderColor: "
|
|
4189
|
+
return (jsxRuntime.jsxs(react.Grid, { ...getColor(isDraggedOver), ref: ref, cursor: "pointer", onClick: handleClick, borderStyle: "dashed", borderColor: "colorPalette.400", alignContent: "center", justifyContent: "center", borderWidth: 1, borderRadius: 4, ...gridProps, children: [children, !!children === false && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(react.Flex, { children: placeholder }), jsxRuntime.jsx(react.Input, { type: "file", multiple: true, style: { display: "none" }, ref: fileInput, onChange: handleChange })] }))] }));
|
|
4210
4190
|
};
|
|
4211
4191
|
|
|
4212
4192
|
const FilePicker = ({ column, schema, prefix }) => {
|
|
@@ -4377,7 +4357,7 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
|
|
|
4377
4357
|
item[column_ref],
|
|
4378
4358
|
]);
|
|
4379
4359
|
setValue(colLabel, [...newSet]);
|
|
4380
|
-
}, opacity: 0.7, _hover: { opacity: 1 }, ...(selected ? { color: "
|
|
4360
|
+
}, opacity: 0.7, _hover: { opacity: 1 }, ...(selected ? { color: "colorPalette.400/50" } : {}), children: !!renderDisplay === true
|
|
4381
4361
|
? renderDisplay(item)
|
|
4382
4362
|
: item[display_column] }, item[column_ref]));
|
|
4383
4363
|
}) }), isDirty && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: dataList.length <= 0 && (jsxRuntime.jsx(react.Text, { children: translate.t(removeIndex(`${colLabel}.empty_search_result`)) })) }))] }), jsxRuntime.jsx(PaginationRoot, { justifySelf: "center", count: count, pageSize: 10, defaultPage: 1, page: page + 1, onPageChange: (e) => setPage(e.page - 1), children: jsxRuntime.jsxs(react.HStack, { gap: "4", children: [jsxRuntime.jsx(PaginationPrevTrigger, {}), count > 0 && jsxRuntime.jsx(PaginationPageText, {}), jsxRuntime.jsx(PaginationNextTrigger, {})] }) })] }))] }) })] }), errors[`${colLabel}`] && (jsxRuntime.jsx(react.Text, { color: "red.400", children: translate.t(removeIndex(`${colLabel}.field_required`)) }))] }));
|
package/dist/index.mjs
CHANGED
|
@@ -2437,7 +2437,7 @@ function ColumnCard({ columnId }) {
|
|
|
2437
2437
|
onDrop: () => setDragging(false), // NEW
|
|
2438
2438
|
});
|
|
2439
2439
|
}, [columnId, table]);
|
|
2440
|
-
return (jsxs(Grid, { ref: ref, templateColumns: "auto 1fr", gap: "0.5rem", alignItems: "center", style: dragging ? { opacity: 0.4 } : {}, children: [jsx(Flex, { alignItems: "center", padding: "0", cursor: "grab", children: jsx(FaGripLinesVertical, { color: "
|
|
2440
|
+
return (jsxs(Grid, { ref: ref, templateColumns: "auto 1fr", gap: "0.5rem", alignItems: "center", style: dragging ? { opacity: 0.4 } : {}, children: [jsx(Flex, { alignItems: "center", padding: "0", cursor: "grab", children: jsx(FaGripLinesVertical, { color: "colorPalette.400" }) }), jsx(Flex, { justifyContent: "space-between", alignItems: "center", children: jsx(CheckboxCard, { variant: "surface", label: displayName, checked: column.getIsVisible(), onChange: column.getToggleVisibilityHandler() }) })] }));
|
|
2441
2441
|
}
|
|
2442
2442
|
function CardContainer({ location, children }) {
|
|
2443
2443
|
const ref = useRef(null);
|
|
@@ -2569,7 +2569,7 @@ const RecordDisplay = ({ object, boxProps, translate, prefix = "", }) => {
|
|
|
2569
2569
|
return jsx(Fragment, { children: "null" });
|
|
2570
2570
|
}
|
|
2571
2571
|
return (jsx(Grid, { rowGap: 1, padding: 1, overflow: "auto", ...boxProps, children: Object.entries(object).map(([field, value]) => {
|
|
2572
|
-
return (jsxs(Grid, { columnGap: 2, gridTemplateColumns: "auto 1fr", children: [jsx(Text, { color: "
|
|
2572
|
+
return (jsxs(Grid, { columnGap: 2, gridTemplateColumns: "auto 1fr", children: [jsx(Text, { color: "colorPalette.400", children: getColumn({ field }) }), typeof value === "object" ? (jsx(RecordDisplay, { object: value, prefix: `${prefix}${field}.`, translate: translate })) : (jsx(Text, { children: JSON.stringify(value) }))] }, field));
|
|
2573
2573
|
}) }));
|
|
2574
2574
|
};
|
|
2575
2575
|
|
|
@@ -2619,7 +2619,7 @@ const CellRenderer = ({ cell }) => {
|
|
|
2619
2619
|
paddingY: 2,
|
|
2620
2620
|
}, object: value })] }, cell.id));
|
|
2621
2621
|
}
|
|
2622
|
-
return (jsxs(Box, { gridColumn, gridRow, children: [jsx(Box, { color:
|
|
2622
|
+
return (jsxs(Box, { gridColumn, gridRow, children: [jsx(Box, { color: "colorPalette.400", children: getLabel({ columnId: cell.column.id }) }), jsx(Box, { wordBreak: "break-word", textOverflow: "ellipsis", overflow: "hidden", children: `${formatValue(cell.getValue())}` })] }, cell.id));
|
|
2623
2623
|
};
|
|
2624
2624
|
const DataDisplay = ({ variant = "" }) => {
|
|
2625
2625
|
const { table, translate } = useDataTableContext();
|
|
@@ -2975,13 +2975,11 @@ const TableFilterTags = () => {
|
|
|
2975
2975
|
}) }));
|
|
2976
2976
|
};
|
|
2977
2977
|
|
|
2978
|
-
const TableControls = ({ fitTableWidth = false, fitTableHeight = false, children = jsx(Fragment, {}), showGlobalFilter = false, showFilter = false, showFilterName = false, showFilterTags = false, showReload = false, showPagination = true, showPageSizeControl = true, showPageCountText = true, showView = true, filterOptions = [], extraItems = jsx(Fragment, {}), loading = false, hasError = false, }) => {
|
|
2978
|
+
const TableControls = ({ fitTableWidth = false, fitTableHeight = false, children = jsx(Fragment, {}), showGlobalFilter = false, showFilter = false, showFilterName = false, showFilterTags = false, showReload = false, showPagination = true, showPageSizeControl = true, showPageCountText = true, showView = true, filterOptions = [], extraItems = jsx(Fragment, {}), loading = false, hasError = false, gridProps = {}, }) => {
|
|
2979
2979
|
const { translate } = useDataTableContext();
|
|
2980
|
-
return (jsxs(Grid, { templateRows: "auto 1fr", width: fitTableWidth ? "fit-content" : "100%", height: fitTableHeight ? "fit-content" : "100%", gap: "0.5rem", children: [jsxs(Flex, { flexFlow: "column", gap: 2, children: [jsxs(Flex, { justifyContent: "space-between", children: [jsx(Box, { children: showView && jsx(ViewDialog, { icon: jsx(MdOutlineViewColumn, {}) }) }), jsxs(Flex, { gap: "0.5rem", alignItems: "center", justifySelf: "end", children: [loading && jsx(Spinner, { size: "sm" }), hasError && (jsx(Tooltip, { content: translate.t("has_error"), children: jsx(Icon, { as: BsExclamationCircleFill, color: "red.400" }) })), showGlobalFilter && jsx(GlobalFilter, {}), showFilter && jsx(FilterDialog, {}), showReload && jsx(ReloadButton, {}), extraItems] })] }), filterOptions.length > 0 && (jsx(Flex, { flexFlow: "column", gap: "0.5rem", children: filterOptions.map((column) => {
|
|
2980
|
+
return (jsxs(Grid, { templateRows: "auto 1fr", width: fitTableWidth ? "fit-content" : "100%", height: fitTableHeight ? "fit-content" : "100%", gap: "0.5rem", ...gridProps, children: [jsxs(Flex, { flexFlow: "column", gap: 2, children: [jsxs(Flex, { justifyContent: "space-between", children: [jsx(Box, { children: showView && jsx(ViewDialog, { icon: jsx(MdOutlineViewColumn, {}) }) }), jsxs(Flex, { gap: "0.5rem", alignItems: "center", justifySelf: "end", children: [loading && jsx(Spinner, { size: "sm" }), hasError && (jsx(Tooltip, { content: translate.t("has_error"), children: jsx(Icon, { as: BsExclamationCircleFill, color: "red.400" }) })), showGlobalFilter && jsx(GlobalFilter, {}), showFilter && jsx(FilterDialog, {}), showReload && jsx(ReloadButton, {}), extraItems] })] }), filterOptions.length > 0 && (jsx(Flex, { flexFlow: "column", gap: "0.5rem", children: filterOptions.map((column) => {
|
|
2981
2981
|
return (jsxs(Flex, { alignItems: "center", flexFlow: "wrap", gap: "0.5rem", children: [showFilterName && jsxs(Text, { children: [column, ":"] }), jsx(FilterOptions, { column: column })] }, column));
|
|
2982
|
-
}) })), showFilterTags && (jsx(Flex, { children: jsx(TableFilterTags, {}) }))] }), jsx(Grid, { overflow: "auto",
|
|
2983
|
-
backgroundColor: "gray.900",
|
|
2984
|
-
}, children: children }), (showPageSizeControl || showPageCountText || showPagination) && (jsxs(Flex, { justifyContent: "space-between", children: [jsxs(Flex, { gap: "1rem", alignItems: "center", children: [showPageSizeControl && jsx(PageSizeControl, {}), showPageCountText && (jsxs(Flex, { children: [jsx(Text, { paddingRight: "0.5rem", children: translate.t("rowcount.total") }), jsx(RowCountText, {})] }))] }), jsx(Box, { justifySelf: "end", children: showPagination && jsx(Pagination, {}) })] }))] }));
|
|
2982
|
+
}) })), showFilterTags && (jsx(Flex, { children: jsx(TableFilterTags, {}) }))] }), jsx(Grid, { overflow: "auto", bg: { base: "colorPalette.50", _dark: "colorPalette.950" }, children: children }), (showPageSizeControl || showPageCountText || showPagination) && (jsxs(Flex, { justifyContent: "space-between", children: [jsxs(Flex, { gap: "1rem", alignItems: "center", children: [showPageSizeControl && jsx(PageSizeControl, {}), showPageCountText && (jsxs(Flex, { children: [jsx(Text, { paddingRight: "0.5rem", children: translate.t("rowcount.total") }), jsx(RowCountText, {})] }))] }), jsx(Box, { justifySelf: "end", children: showPagination && jsx(Pagination, {}) })] }))] }));
|
|
2985
2983
|
};
|
|
2986
2984
|
|
|
2987
2985
|
const EmptyState = React.forwardRef(function EmptyState(props, ref) {
|
|
@@ -2995,7 +2993,7 @@ const Table = ({ children, emptyComponent = EmptyResult, canResize = true, ...pr
|
|
|
2995
2993
|
if (table.getRowModel().rows.length <= 0) {
|
|
2996
2994
|
return emptyComponent;
|
|
2997
2995
|
}
|
|
2998
|
-
return (jsx(Table$1.Root, { stickyHeader: true, variant: "outline", width: canResize ? table.getCenterTotalSize() : undefined, display: "grid", alignContent: "start", overflowY: "auto", ...props, children: children }));
|
|
2996
|
+
return (jsx(Table$1.Root, { stickyHeader: true, variant: "outline", width: canResize ? table.getCenterTotalSize() : undefined, display: "grid", alignContent: "start", overflowY: "auto", bg: { base: "colorPalette.50", _dark: "colorPalette.950" }, ...props, children: children }));
|
|
2999
2997
|
};
|
|
3000
2998
|
|
|
3001
2999
|
const Checkbox = React.forwardRef(function Checkbox(props, ref) {
|
|
@@ -3059,7 +3057,7 @@ const TableRowSelector = ({ index, row, }) => {
|
|
|
3059
3057
|
onCheckedChange: row.getToggleSelectedHandler() }) }));
|
|
3060
3058
|
};
|
|
3061
3059
|
|
|
3062
|
-
const TableFooter = ({
|
|
3060
|
+
const TableFooter = ({ showSelector = false, alwaysShowSelector = true, }) => {
|
|
3063
3061
|
const table = useDataTableContext().table;
|
|
3064
3062
|
const SELECTION_BOX_WIDTH = 20;
|
|
3065
3063
|
const [hoveredCheckBox, setHoveredCheckBox] = useState(false);
|
|
@@ -3078,41 +3076,11 @@ const TableFooter = ({ pinnedBgColor = { light: "gray.50", dark: "gray.700" }, s
|
|
|
3078
3076
|
}
|
|
3079
3077
|
return false;
|
|
3080
3078
|
};
|
|
3081
|
-
|
|
3082
|
-
const thProps = header.column.getIsPinned()
|
|
3083
|
-
? {
|
|
3084
|
-
left: showSelector
|
|
3085
|
-
? `${header.getStart("left") + SELECTION_BOX_WIDTH + table.getDensityValue() * 2}px`
|
|
3086
|
-
: `${header.getStart("left") + table.getDensityValue() * 2}px`,
|
|
3087
|
-
background: pinnedBgColor.light,
|
|
3088
|
-
position: "sticky",
|
|
3089
|
-
zIndex: 1,
|
|
3090
|
-
_dark: {
|
|
3091
|
-
backgroundColor: pinnedBgColor.dark,
|
|
3092
|
-
},
|
|
3093
|
-
}
|
|
3094
|
-
: {};
|
|
3095
|
-
return thProps;
|
|
3096
|
-
};
|
|
3097
|
-
return (jsx(Table$1.Footer, { children: table.getFooterGroups().map((footerGroup) => (jsxs(Table$1.Row, { display: "flex", children: [showSelector && (jsxs(Table$1.Header
|
|
3098
|
-
// styling resize and pinning start
|
|
3099
|
-
, {
|
|
3100
|
-
// styling resize and pinning start
|
|
3101
|
-
padding: `${table.getDensityValue()}px`, ...(table.getIsSomeColumnsPinned("left")
|
|
3102
|
-
? {
|
|
3103
|
-
left: `0px`,
|
|
3104
|
-
backgroundColor: pinnedBgColor.light,
|
|
3105
|
-
position: "sticky",
|
|
3106
|
-
zIndex: 1,
|
|
3107
|
-
_dark: { backgroundColor: pinnedBgColor.dark },
|
|
3108
|
-
}
|
|
3109
|
-
: {}),
|
|
3110
|
-
// styling resize and pinning end
|
|
3111
|
-
onMouseEnter: () => handleRowHover(true), onMouseLeave: () => handleRowHover(false), display: "grid", children: [isCheckBoxVisible() && (jsx(Box, { margin: "0rem", display: "grid", justifyItems: "center", alignItems: "center", children: jsx(Checkbox, { width: `${SELECTION_BOX_WIDTH}px`, height: `${SELECTION_BOX_WIDTH}px`, isChecked: table.getIsAllRowsSelected(),
|
|
3079
|
+
return (jsx(Table$1.Footer, { children: table.getFooterGroups().map((footerGroup) => (jsxs(Table$1.Row, { display: "flex", children: [showSelector && (jsxs(Table$1.Header, { padding: `${table.getDensityValue()}px`, onMouseEnter: () => handleRowHover(true), onMouseLeave: () => handleRowHover(false), display: "grid", children: [isCheckBoxVisible() && (jsx(Box, { margin: "0rem", display: "grid", justifyItems: "center", alignItems: "center", children: jsx(Checkbox, { width: `${SELECTION_BOX_WIDTH}px`, height: `${SELECTION_BOX_WIDTH}px`, isChecked: table.getIsAllRowsSelected(),
|
|
3112
3080
|
// indeterminate: table.getIsSomeRowsSelected(),
|
|
3113
3081
|
onChange: table.getToggleAllRowsSelectedHandler() }) })), !isCheckBoxVisible() && (jsx(Box, { as: "span", margin: "0rem", display: "grid", justifyItems: "center", alignItems: "center", width: `${SELECTION_BOX_WIDTH}px`, height: `${SELECTION_BOX_WIDTH}px` }))] })), footerGroup.headers.map((header) => (jsx(Table$1.Cell, { padding: "0", columnSpan: `${header.colSpan}`,
|
|
3114
3082
|
// styling resize and pinning start
|
|
3115
|
-
maxWidth: `${header.getSize()}px`, width: `${header.getSize()}px`, display: "grid",
|
|
3083
|
+
maxWidth: `${header.getSize()}px`, width: `${header.getSize()}px`, display: "grid", children: jsx(MenuRoot$1, { children: jsx(MenuTrigger$1, { asChild: true, children: jsx(Box, { padding: `${table.getDensityValue()}px`, display: "flex", alignItems: "center", justifyContent: "start", borderRadius: "0rem", children: jsxs(Flex, { gap: "0.5rem", alignItems: "center", children: [header.isPlaceholder
|
|
3116
3084
|
? null
|
|
3117
3085
|
: flexRender(header.column.columnDef.footer, header.getContext()), jsx(Box, { children: header.column.getCanSort() && (jsxs(Fragment, { children: [header.column.getIsSorted() === false && (
|
|
3118
3086
|
// <UpDownIcon />
|
|
@@ -3138,7 +3106,7 @@ const TableHeader = ({ canResize = true, showSelector = false, isSticky = true,
|
|
|
3138
3106
|
position: "sticky",
|
|
3139
3107
|
top: 0,
|
|
3140
3108
|
};
|
|
3141
|
-
return (jsx(Table$1.Header, { ...(isSticky ? stickyProps : {}), ...tableHeaderProps, children: table.getHeaderGroups().map((headerGroup) => (jsxs(Table$1.Row, { display: "flex", ...tableRowProps, children: [showSelector && (jsx(Table$1.ColumnHeader, { padding: `${table.getDensityValue()}px`, display: "grid", color: {
|
|
3109
|
+
return (jsx(Table$1.Header, { ...(isSticky ? stickyProps : {}), bgColor: "transparent", ...tableHeaderProps, children: table.getHeaderGroups().map((headerGroup) => (jsxs(Table$1.Row, { display: "flex", bgColor: "transparent", ...tableRowProps, children: [showSelector && (jsx(Table$1.ColumnHeader, { padding: `${table.getDensityValue()}px`, display: "grid", color: {
|
|
3142
3110
|
base: "colorPalette.900",
|
|
3143
3111
|
_dark: "colorPalette.100",
|
|
3144
3112
|
},
|
|
@@ -3156,10 +3124,20 @@ const TableHeader = ({ canResize = true, showSelector = false, isSticky = true,
|
|
|
3156
3124
|
base: "colorPalette.800",
|
|
3157
3125
|
_dark: "colorPalette.200",
|
|
3158
3126
|
},
|
|
3159
|
-
bg: { base: "colorPalette.100", _dark: "colorPalette.900" }, ...getThProps(header), children: [jsxs(MenuRoot, { children: [jsx(MenuTrigger, { asChild: true, children: jsx(Flex, { padding: `${table.getDensityValue()}px`, alignItems: "center", justifyContent: "start", borderRadius: "0rem", overflow: "auto",
|
|
3160
|
-
|
|
3161
|
-
_dark:
|
|
3162
|
-
|
|
3127
|
+
bg: { base: "colorPalette.100", _dark: "colorPalette.900" }, ...getThProps(header), children: [jsxs(MenuRoot, { children: [jsx(MenuTrigger, { asChild: true, children: jsx(Flex, { padding: `${table.getDensityValue()}px`, alignItems: "center", justifyContent: "start", borderRadius: "0rem", overflow: "auto", color: {
|
|
3128
|
+
base: "colorPalette.800",
|
|
3129
|
+
_dark: "colorPalette.200",
|
|
3130
|
+
_hover: {
|
|
3131
|
+
base: "colorPalette.700",
|
|
3132
|
+
_dark: "colorPalette.300",
|
|
3133
|
+
},
|
|
3134
|
+
},
|
|
3135
|
+
bg: {
|
|
3136
|
+
base: "colorPalette.100",
|
|
3137
|
+
_dark: "colorPalette.900",
|
|
3138
|
+
_hover: {
|
|
3139
|
+
base: "colorPalette.200",
|
|
3140
|
+
_dark: "colorPalette.800",
|
|
3163
3141
|
},
|
|
3164
3142
|
}, children: jsxs(Flex, { gap: "0.5rem", alignItems: "center", children: [header.isPlaceholder
|
|
3165
3143
|
? null
|
|
@@ -3187,10 +3165,12 @@ const TableHeader = ({ canResize = true, showSelector = false, isSticky = true,
|
|
|
3187
3165
|
});
|
|
3188
3166
|
}, children: [jsx(GrDescend, {}), "Sort Descending"] }) }), header.column.getIsSorted() && (jsx(MenuItem, { asChild: true, value: "sort-descend", children: jsxs(Button, { variant: "ghost", onClick: () => {
|
|
3189
3167
|
header.column.clearSorting();
|
|
3190
|
-
}, children: [jsx(MdClear, {}), "Clear Sorting"] }) }))] }))] })] }), canResize && (jsx(Box, { borderRight: "0.2rem solid", borderRightColor: header.column.getIsResizing()
|
|
3168
|
+
}, children: [jsx(MdClear, {}), "Clear Sorting"] }) }))] }))] })] }), canResize && (jsx(Box, { borderRight: "0.2rem solid", borderRightColor: header.column.getIsResizing()
|
|
3169
|
+
? "colorPalette.700"
|
|
3170
|
+
: "transparent", position: "relative", right: "0.1rem", width: "2px", height: "100%", userSelect: "none", style: { touchAction: "none" }, _hover: {
|
|
3191
3171
|
borderRightColor: header.column.getIsResizing()
|
|
3192
|
-
? "
|
|
3193
|
-
: "
|
|
3172
|
+
? "colorPalette.700"
|
|
3173
|
+
: "colorPalette.400",
|
|
3194
3174
|
}, ...resizeProps }))] }, `chakra-table-header-${header.id}`));
|
|
3195
3175
|
})] }, `chakra-table-headergroup-${headerGroup.id}`))) }));
|
|
3196
3176
|
};
|
|
@@ -3831,7 +3811,7 @@ const EnumPicker = ({ column, isMultiple = false, schema, prefix, }) => {
|
|
|
3831
3811
|
}
|
|
3832
3812
|
const newSet = new Set([...(watchEnums ?? []), item]);
|
|
3833
3813
|
setValue(colLabel, [...newSet]);
|
|
3834
|
-
}, ...(selected ? { color: "
|
|
3814
|
+
}, ...(selected ? { color: "colorPalette.400/50" } : {}), children: !!renderDisplay === true
|
|
3835
3815
|
? renderDisplay(item)
|
|
3836
3816
|
: translate.t(removeIndex(`${colLabel}.${item}`)) }, `${colLabel}-${item}`));
|
|
3837
3817
|
}) }), isDirty && (jsx(Fragment, { children: dataList.length <= 0 && (jsx(Fragment, { children: translate.t(removeIndex(`${colLabel}.empty_search_result`)) })) }))] })] }) })] }), errors[`${column}`] && (jsx(Text, { color: "red.400", children: translate.t(removeIndex(`${colLabel}.field_required`)) }))] }));
|
|
@@ -4186,7 +4166,7 @@ const FileDropzone = ({ children = undefined, gridProps = {}, onDrop = () => { }
|
|
|
4186
4166
|
const filesArray = [...event.target.files];
|
|
4187
4167
|
onDrop({ files: filesArray });
|
|
4188
4168
|
};
|
|
4189
|
-
return (jsxs(Grid, { ...getColor(isDraggedOver), ref: ref, cursor: "pointer", onClick: handleClick, borderStyle: "dashed", borderColor: "
|
|
4169
|
+
return (jsxs(Grid, { ...getColor(isDraggedOver), ref: ref, cursor: "pointer", onClick: handleClick, borderStyle: "dashed", borderColor: "colorPalette.400", alignContent: "center", justifyContent: "center", borderWidth: 1, borderRadius: 4, ...gridProps, children: [children, !!children === false && (jsxs(Fragment, { children: [jsx(Flex, { children: placeholder }), jsx(Input, { type: "file", multiple: true, style: { display: "none" }, ref: fileInput, onChange: handleChange })] }))] }));
|
|
4190
4170
|
};
|
|
4191
4171
|
|
|
4192
4172
|
const FilePicker = ({ column, schema, prefix }) => {
|
|
@@ -4357,7 +4337,7 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
|
|
|
4357
4337
|
item[column_ref],
|
|
4358
4338
|
]);
|
|
4359
4339
|
setValue(colLabel, [...newSet]);
|
|
4360
|
-
}, opacity: 0.7, _hover: { opacity: 1 }, ...(selected ? { color: "
|
|
4340
|
+
}, opacity: 0.7, _hover: { opacity: 1 }, ...(selected ? { color: "colorPalette.400/50" } : {}), children: !!renderDisplay === true
|
|
4361
4341
|
? renderDisplay(item)
|
|
4362
4342
|
: item[display_column] }, item[column_ref]));
|
|
4363
4343
|
}) }), isDirty && (jsx(Fragment, { children: dataList.length <= 0 && (jsx(Text, { children: translate.t(removeIndex(`${colLabel}.empty_search_result`)) })) }))] }), jsx(PaginationRoot, { justifySelf: "center", count: count, pageSize: 10, defaultPage: 1, page: page + 1, onPageChange: (e) => setPage(e.page - 1), children: jsxs(HStack, { gap: "4", children: [jsx(PaginationPrevTrigger, {}), count > 0 && jsx(PaginationPageText, {}), jsx(PaginationNextTrigger, {})] }) })] }))] }) })] }), errors[`${colLabel}`] && (jsx(Text, { color: "red.400", children: translate.t(removeIndex(`${colLabel}.field_required`)) }))] }));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GridProps } from "@chakra-ui/react";
|
|
1
2
|
import { ReactNode } from "react";
|
|
2
3
|
export interface TableControlsProps {
|
|
3
4
|
totalText?: string;
|
|
@@ -17,5 +18,6 @@ export interface TableControlsProps {
|
|
|
17
18
|
extraItems?: ReactNode;
|
|
18
19
|
loading?: boolean;
|
|
19
20
|
hasError?: boolean;
|
|
21
|
+
gridProps?: GridProps;
|
|
20
22
|
}
|
|
21
|
-
export declare const TableControls: ({ fitTableWidth, fitTableHeight, children, showGlobalFilter, showFilter, showFilterName, showFilterTags, showReload, showPagination, showPageSizeControl, showPageCountText, showView, filterOptions, extraItems, loading, hasError, }: TableControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const TableControls: ({ fitTableWidth, fitTableHeight, children, showGlobalFilter, showFilter, showFilterName, showFilterTags, showReload, showPagination, showPageSizeControl, showPageCountText, showView, filterOptions, extraItems, loading, hasError, gridProps, }: TableControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
export interface TableFooterProps {
|
|
2
|
-
pinnedBgColor?: {
|
|
3
|
-
light: string;
|
|
4
|
-
dark: string;
|
|
5
|
-
};
|
|
6
2
|
showSelector?: boolean;
|
|
7
3
|
alwaysShowSelector?: boolean;
|
|
8
4
|
}
|
|
9
|
-
export declare const TableFooter: ({
|
|
5
|
+
export declare const TableFooter: ({ showSelector, alwaysShowSelector, }: TableFooterProps) => import("react/jsx-runtime").JSX.Element;
|