@raystack/apsara 0.17.0 → 0.17.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/index.cjs +11 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/dist/table/datatable.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -32199,17 +32199,20 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoa
|
|
|
32199
32199
|
? [...new Array(loaderRow)].map((_, i) => ({ id: i }))
|
|
32200
32200
|
: data;
|
|
32201
32201
|
const { filteredColumns, addFilterColumn, removeFilterColumn, resetColumns } = useTableColumn();
|
|
32202
|
-
const columnWithCustomFilter = columns.map((col) => {
|
|
32203
|
-
// @ts-ignore;
|
|
32202
|
+
const columnWithCustomFilter = useMemo(() => columns.map((col) => {
|
|
32204
32203
|
const colId = col.id || col?.accessorKey;
|
|
32205
|
-
|
|
32206
|
-
|
|
32207
|
-
|
|
32208
|
-
|
|
32204
|
+
const filterFn = colId && tableCustomFilter.hasOwnProperty(colId)
|
|
32205
|
+
? tableCustomFilter[colId]
|
|
32206
|
+
: undefined;
|
|
32207
|
+
const cell = isLoading
|
|
32209
32208
|
? () => (jsxRuntimeExports$1.jsx(Skeleton, { containerClassName: styles$4.flex1, highlightColor: "var(--background-base)", baseColor: "var(--background-base-hover)" }))
|
|
32210
32209
|
: col.cell;
|
|
32211
|
-
return
|
|
32212
|
-
|
|
32210
|
+
return {
|
|
32211
|
+
...col,
|
|
32212
|
+
cell,
|
|
32213
|
+
filterFn,
|
|
32214
|
+
};
|
|
32215
|
+
}), [isLoading, columns, tableCustomFilter]);
|
|
32213
32216
|
useEffect(() => {
|
|
32214
32217
|
if (onStateChange) {
|
|
32215
32218
|
onStateChange(tableState);
|