@campxdev/react-blueprint 1.2.7 → 1.2.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/react-blueprint",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "main": "./export.ts",
5
5
  "private": false,
6
6
  "dependencies": {
@@ -87,7 +87,9 @@ export const DropdownMenu = ({
87
87
  {menuItems.map((item, index) => (
88
88
  <Fragment key={index}>
89
89
  {item}
90
- <Divider flexItem sx={{ margin: '0 !important' }} />
90
+ {index < menuItems.length - 1 && (
91
+ <Divider flexItem sx={{ margin: '0 !important' }} />
92
+ )}
91
93
  </Fragment>
92
94
  ))}
93
95
  </Stack>
@@ -1,14 +1,17 @@
1
1
  import { useRef } from 'react';
2
2
  import { useDispatch, useSelector } from 'react-redux';
3
3
  import { v4 } from 'uuid';
4
- import { resetStateForUniqueId } from '../state/filters/filtersSlice';
4
+ import {
5
+ FilterState,
6
+ resetStateForUniqueId,
7
+ } from '../state/filters/filtersSlice';
5
8
  import { RootState } from '../state/store';
6
9
 
7
10
  export const usePageHeader = () => {
8
11
  const uuidRef = useRef(v4());
9
12
  const dispatch = useDispatch();
10
- const dataTableState = useSelector(
11
- (state: RootState) => state.filters[uuidRef.current] || {},
13
+ const filterState = useSelector(
14
+ (state: RootState) => state.filters[uuidRef.current] || ({} as FilterState),
12
15
  );
13
16
 
14
17
  const resetState = () => {
@@ -16,8 +19,8 @@ export const usePageHeader = () => {
16
19
  };
17
20
 
18
21
  return {
19
- columnVisibilityModel: dataTableState.columnVisibilityModel,
20
- density: dataTableState.density,
22
+ columnVisibilityModel: filterState.columnVisibilityModel,
23
+ density: filterState.density,
21
24
  uniqueId: uuidRef.current,
22
25
  resetState,
23
26
  };