@redsift/table 12.5.3-alpha.5 → 12.5.3-alpha.6
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/_internal/StatefulDataGrid2.js +13 -4
- package/_internal/StatefulDataGrid2.js.map +1 -1
- package/index.d.ts +111 -1
- package/index.js +233 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -705,9 +705,21 @@ const DENSITY_MODEL_KEY = 'densityModel';
|
|
|
705
705
|
const COLUMN_ORDER_MODEL_KEY = 'columnOrderModel';
|
|
706
706
|
const ROW_GROUPING_MODEL_KEY = 'rowGroupingModel';
|
|
707
707
|
const AGGREGATION_MODEL_KEY = 'aggregationModel';
|
|
708
|
+
/** Storage category key for the pivot column/row/value configuration. Consumer interop — use with `buildStorageKey`. */
|
|
708
709
|
const PIVOT_MODEL_KEY = 'pivotModel';
|
|
710
|
+
/** Storage category key for whether pivoting is active. Consumer interop — use with `buildStorageKey`. */
|
|
709
711
|
const PIVOT_ACTIVE_KEY = 'pivotActive';
|
|
710
712
|
const CATEGORIES = [PAGINATION_MODEL_KEY, FILTER_MODEL_KEY, SORT_MODEL_KEY, VISIBILITY_MODEL_KEY, DIMENSION_MODEL_KEY, FILTER_SEARCH_KEY, PINNED_COLUMNS, DENSITY_MODEL_KEY, COLUMN_ORDER_MODEL_KEY, ROW_GROUPING_MODEL_KEY, AGGREGATION_MODEL_KEY, PIVOT_MODEL_KEY, PIVOT_ACTIVE_KEY];
|
|
713
|
+
/**
|
|
714
|
+
* Build the localStorage key for a specific grid state category.
|
|
715
|
+
* Consumers can use this to read or clear individual state entries directly.
|
|
716
|
+
*
|
|
717
|
+
* @example
|
|
718
|
+
* ```ts
|
|
719
|
+
* const key = buildStorageKey({ id: pathname, version: 2, category: PIVOT_ACTIVE_KEY });
|
|
720
|
+
* localStorage.removeItem(key);
|
|
721
|
+
* ```
|
|
722
|
+
*/
|
|
711
723
|
const buildStorageKey = _ref => {
|
|
712
724
|
let {
|
|
713
725
|
id,
|
|
@@ -2274,10 +2286,7 @@ const getPivotActiveFromString = searchString => {
|
|
|
2274
2286
|
};
|
|
2275
2287
|
const getSearchParamsFromPivotActive = active => {
|
|
2276
2288
|
const searchParams = new URLSearchParams();
|
|
2277
|
-
|
|
2278
|
-
if (active) {
|
|
2279
|
-
searchParams.set('_pivotActive', 'true');
|
|
2280
|
-
}
|
|
2289
|
+
searchParams.set('_pivotActive', String(active));
|
|
2281
2290
|
return searchParams;
|
|
2282
2291
|
};
|
|
2283
2292
|
const getPivotActive = (search, localStoragePivotActive, setLocalStoragePivotActive, initialState, isNewVersion) => {
|