@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 CHANGED
@@ -32219,17 +32219,20 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoa
32219
32219
  ? [...new Array(loaderRow)].map((_, i) => ({ id: i }))
32220
32220
  : data;
32221
32221
  const { filteredColumns, addFilterColumn, removeFilterColumn, resetColumns } = useTableColumn();
32222
- const columnWithCustomFilter = columns.map((col) => {
32223
- // @ts-ignore;
32222
+ const columnWithCustomFilter = React.useMemo(() => columns.map((col) => {
32224
32223
  const colId = col.id || col?.accessorKey;
32225
- if (colId && tableCustomFilter.hasOwnProperty(colId)) {
32226
- col.filterFn = tableCustomFilter[colId];
32227
- }
32228
- col.cell = isLoading
32224
+ const filterFn = colId && tableCustomFilter.hasOwnProperty(colId)
32225
+ ? tableCustomFilter[colId]
32226
+ : undefined;
32227
+ const cell = isLoading
32229
32228
  ? () => (jsxRuntimeExports$1.jsx(Skeleton, { containerClassName: styles$4.flex1, highlightColor: "var(--background-base)", baseColor: "var(--background-base-hover)" }))
32230
32229
  : col.cell;
32231
- return col;
32232
- });
32230
+ return {
32231
+ ...col,
32232
+ cell,
32233
+ filterFn,
32234
+ };
32235
+ }), [isLoading, columns, tableCustomFilter]);
32233
32236
  React.useEffect(() => {
32234
32237
  if (onStateChange) {
32235
32238
  onStateChange(tableState);