ab-ui-library 1.25.0 → 1.25.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.
@@ -1,2 +1,2 @@
1
1
  import type { Table } from '@tanstack/react-table';
2
- export declare const useTableColumnSettings: <T>(table: Table<T>, tableName: string) => void;
2
+ export declare const useTableColumnSettings: <T>(table: Table<T>, tableName: string, shouldPersistToStorage: boolean) => void;
@@ -1,6 +1,6 @@
1
1
  import { useRef, useEffect } from 'react';
2
2
 
3
- var useTableColumnSettings = function useTableColumnSettings(table, tableName) {
3
+ var useTableColumnSettings = function useTableColumnSettings(table, tableName, shouldPersistToStorage) {
4
4
  var prevSettings = useRef(null);
5
5
  var state = table.getState();
6
6
  useEffect(function () {
@@ -10,7 +10,7 @@ var useTableColumnSettings = function useTableColumnSettings(table, tableName) {
10
10
  columnSizing: state.columnSizing
11
11
  };
12
12
  var serialized = JSON.stringify(settings);
13
- if (prevSettings.current !== serialized) {
13
+ if (prevSettings.current !== serialized && shouldPersistToStorage) {
14
14
  localStorage.setItem(tableName, serialized);
15
15
  prevSettings.current = serialized;
16
16
  }
@@ -208,7 +208,7 @@ function useTableControl(_ref) {
208
208
  enableRowSelection: true,
209
209
  enableColumnResizing: true
210
210
  });
211
- useTableColumnSettings(table, tableName);
211
+ useTableColumnSettings(table, tableName, shouldPersistToStorage);
212
212
  var sensors = useSensors(useSensor(MouseSensor, {
213
213
  activationConstraint: {
214
214
  distance: 8
@@ -252,7 +252,7 @@ function useTableControl(_ref) {
252
252
  columnOrder: columnOrder,
253
253
  columnSizing: columnSizing
254
254
  };
255
- if (shouldPersistToStorage && tableName) {
255
+ if (shouldPersistToStorage && tableSettings.tableName) {
256
256
  var serialized = JSON.stringify(settings);
257
257
  localStorage.setItem(tableName, serialized);
258
258
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ab-ui-library",
3
- "version": "1.25.0",
3
+ "version": "1.25.1",
4
4
  "description": "UI library for AM",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",