@campxdev/react-blueprint 1.2.17 → 1.2.19
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/.storybook/preview.tsx +1 -1
- package/export.ts +1 -1
- package/package.json +14 -14
- package/src/App.tsx +82 -47
- package/src/components/Assets/Icons/IconComponents/ColumnsIcon.tsx +31 -0
- package/src/components/Assets/Icons/IconComponents/Comfortable.tsx +4 -4
- package/src/components/Assets/Icons/IconComponents/CompactIcon.tsx +6 -6
- package/src/components/Assets/Icons/IconComponents/CompletedStateIcon.tsx +3 -3
- package/src/components/Assets/Icons/IconComponents/FilterIcon.tsx +27 -60
- package/src/components/Assets/Icons/IconComponents/InfoFilledIcon.tsx +6 -18
- package/src/components/Assets/Icons/IconComponents/SearchIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/StandardIcon.tsx +5 -5
- package/src/components/Assets/Icons/IconComponents/ViewsIcon.tsx +35 -0
- package/src/components/Assets/Icons/Icons.tsx +4 -2
- package/src/components/Charts/TreeMap/TreeMap.tsx +1 -6
- package/src/components/DataDisplay/EditableDataTable/EditableDataTable.tsx +48 -1
- package/src/components/Layout/PageHeader/PageHeader.tsx +160 -44
- package/src/components/Layout/PageHeader/components/Anchors.tsx +84 -0
- package/src/components/Layout/PageHeader/components/DensitySelector/DensitySelector.tsx +96 -0
- package/src/components/{Navigation/TableColumnFilters/TableColumnFilters.tsx → Layout/PageHeader/components/TableColumnsSelector/TableColumnsSelector.tsx} +20 -19
- package/src/components/Layout/export.ts +2 -0
- package/src/components/Navigation/Breadcrumbs/Breadcrumbs.tsx +16 -7
- package/src/components/Navigation/Stepper/Stepper.tsx +3 -1
- package/src/components/Navigation/Stepper/StepperComponents.tsx +20 -6
- package/src/components/Navigation/export.ts +1 -2
- package/src/hooks/usePageHeader.ts +5 -4
- package/src/index.tsx +1 -1
- package/src/redux/export.ts +2 -0
- package/src/{state/filters/filtersSlice.ts → redux/slices/pageHeaderSlice.ts} +8 -14
- package/src/{state → redux}/store.ts +2 -2
- package/src/stories/Assets/Icons.stories.tsx +13 -4
- package/src/stories/Navigation/ColumnFilters.stories.tsx +6 -6
- package/src/stories/Navigation/{TableDensityFilter.stories.tsx → DensitySelector.stories.tsx} +6 -9
- package/src/themes/colorTokens/colorPalette.tsx +2 -0
- package/src/themes/colorTokens/darkColorTokens.tsx +1 -0
- package/src/themes/colorTokens/lightColorTokens.ts +1 -0
- package/src/themes/commonTheme.ts +15 -2
- package/tsconfig.json +1 -1
- package/types/theme.d.ts +1 -0
- package/src/components/Assets/Icons/IconComponents/FilterViewIcon.tsx +0 -32
- package/src/components/Navigation/TableDensityFilter/TableDensityFilter.tsx +0 -115
- package/src/state/export.ts +0 -2
|
@@ -1,51 +1,167 @@
|
|
|
1
|
-
import { Box,
|
|
2
|
-
import {
|
|
1
|
+
import { Box, Divider, InputAdornment, Stack, useTheme } from '@mui/material';
|
|
2
|
+
import { GridColDef } from '@mui/x-data-grid';
|
|
3
|
+
import { motion } from 'framer-motion';
|
|
4
|
+
import { ReactNode, useState } from 'react';
|
|
5
|
+
import {
|
|
6
|
+
DensitySelector,
|
|
7
|
+
Icons,
|
|
8
|
+
TableColumnsSelector,
|
|
9
|
+
TextField,
|
|
10
|
+
Typography,
|
|
11
|
+
} from '../../export';
|
|
12
|
+
import {
|
|
13
|
+
ColumnsAnchor,
|
|
14
|
+
FiltersAnchor,
|
|
15
|
+
SearchAnchor,
|
|
16
|
+
} from './components/Anchors';
|
|
3
17
|
|
|
4
|
-
interface BreadCrumbsLink {
|
|
5
|
-
name: string | ReactNode;
|
|
6
|
-
to: string;
|
|
7
|
-
}
|
|
8
18
|
interface PageHeaderProps {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
uniqueId: string;
|
|
20
|
+
viewsSlot?: ReactNode;
|
|
21
|
+
actions?: ReactNode[];
|
|
22
|
+
columns?: GridColDef[];
|
|
12
23
|
}
|
|
13
24
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
display: 'flex',
|
|
17
|
-
alignItems: 'center',
|
|
18
|
-
justifyContent: 'space-between',
|
|
19
|
-
margin: '0',
|
|
20
|
-
flexWrap: 'wrap',
|
|
21
|
-
'& .actions': {
|
|
22
|
-
display: 'flex',
|
|
23
|
-
gap: '1rem',
|
|
24
|
-
alignItems: 'center',
|
|
25
|
-
marginLeft: 'auto',
|
|
26
|
-
'& .MuiButton-root': {
|
|
27
|
-
height: '40px',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
}));
|
|
31
|
-
|
|
32
|
-
export default function PageHeader({ title, actions, links }: PageHeaderProps) {
|
|
25
|
+
const ViewTab = ({ title }: { title: string }) => {
|
|
26
|
+
const theme = useTheme();
|
|
33
27
|
return (
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
<Stack>
|
|
29
|
+
<Stack direction="row" gap={1} alignItems="center" padding="8px">
|
|
30
|
+
<Icons.ViewsIcon />
|
|
31
|
+
<Typography variant="subtitle3">{title}</Typography>
|
|
32
|
+
</Stack>
|
|
33
|
+
<Divider
|
|
34
|
+
style={{
|
|
35
|
+
background: theme.palette.tertiary.main,
|
|
36
|
+
height: '4px',
|
|
37
|
+
width: '92px',
|
|
38
|
+
borderRadius: '48px',
|
|
39
|
+
}}
|
|
40
|
+
/>
|
|
41
|
+
</Stack>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const motionDivVariants = {
|
|
46
|
+
collapsed: { height: '48px' },
|
|
47
|
+
expanded: { height: '102px' },
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const motionTextFieldVariants = {
|
|
51
|
+
collapsed: { width: '40px' },
|
|
52
|
+
expanded: { width: '300px' },
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const PageHeader = ({
|
|
56
|
+
uniqueId,
|
|
57
|
+
actions,
|
|
58
|
+
columns,
|
|
59
|
+
viewsSlot = <Box></Box>,
|
|
60
|
+
}: PageHeaderProps) => {
|
|
61
|
+
const [expanded, setExpanded] = useState(false);
|
|
62
|
+
const [expandedSearch, setExpandedSearch] = useState(false);
|
|
63
|
+
const theme = useTheme();
|
|
64
|
+
|
|
65
|
+
const handleSearchClick = () => {
|
|
66
|
+
setExpandedSearch(true);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const handleSearchBlur = () => {
|
|
70
|
+
setExpandedSearch(false);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<motion.div
|
|
75
|
+
style={{
|
|
76
|
+
display: 'flex',
|
|
77
|
+
flexDirection: 'column',
|
|
78
|
+
gap: '10px',
|
|
79
|
+
margin: '8px 0px',
|
|
80
|
+
padding: '0px 16px',
|
|
81
|
+
height: '48px',
|
|
82
|
+
}}
|
|
83
|
+
variants={motionDivVariants}
|
|
84
|
+
animate={expanded ? 'expanded' : 'collapsed'}
|
|
85
|
+
transition={{ duration: 0.3, ease: 'easeInOut' }}
|
|
86
|
+
>
|
|
87
|
+
<Stack
|
|
88
|
+
direction="row"
|
|
89
|
+
width="100%"
|
|
90
|
+
alignItems="center"
|
|
91
|
+
justifyContent="space-between"
|
|
92
|
+
>
|
|
93
|
+
{columns ? <ViewTab title="Default View" /> : viewsSlot}
|
|
94
|
+
<Stack direction="row" alignItems="center" gap={1}>
|
|
95
|
+
{columns && (
|
|
96
|
+
<FiltersAnchor
|
|
97
|
+
handleClick={() => {
|
|
98
|
+
setExpanded(!expanded);
|
|
99
|
+
}}
|
|
100
|
+
showDot={false}
|
|
101
|
+
/>
|
|
102
|
+
)}
|
|
103
|
+
{columns && (
|
|
104
|
+
<ColumnsAnchor
|
|
105
|
+
handleClick={() => {
|
|
106
|
+
setExpanded(!expanded);
|
|
107
|
+
}}
|
|
108
|
+
showDot={false}
|
|
109
|
+
/>
|
|
110
|
+
)}
|
|
111
|
+
<motion.div
|
|
112
|
+
variants={motionTextFieldVariants}
|
|
113
|
+
animate={expandedSearch ? 'expanded' : 'collapsed'}
|
|
114
|
+
transition={{ duration: 0.3 }}
|
|
115
|
+
>
|
|
116
|
+
{!expandedSearch && (
|
|
117
|
+
<SearchAnchor handleClick={handleSearchClick} showDot={false} />
|
|
44
118
|
)}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
119
|
+
{expandedSearch && (
|
|
120
|
+
<TextField
|
|
121
|
+
containerProps={{
|
|
122
|
+
margin: '0px',
|
|
123
|
+
}}
|
|
124
|
+
size="small"
|
|
125
|
+
placeholder="Search by name"
|
|
126
|
+
// onChange={(e) => { setInput(e.target.value); }}
|
|
127
|
+
InputProps={{
|
|
128
|
+
startAdornment: (
|
|
129
|
+
<InputAdornment position="start">
|
|
130
|
+
<Icons.SearchIcon />
|
|
131
|
+
</InputAdornment>
|
|
132
|
+
),
|
|
133
|
+
}}
|
|
134
|
+
onBlur={handleSearchBlur}
|
|
135
|
+
autoFocus
|
|
136
|
+
/>
|
|
137
|
+
)}
|
|
138
|
+
</motion.div>
|
|
139
|
+
{columns && <DensitySelector uniqueId={uniqueId} />}
|
|
140
|
+
{actions?.map((action, index) => action)}
|
|
141
|
+
</Stack>
|
|
142
|
+
</Stack>
|
|
143
|
+
{expanded && (
|
|
144
|
+
<Divider
|
|
145
|
+
style={{
|
|
146
|
+
background: theme.palette.border.primary,
|
|
147
|
+
}}
|
|
148
|
+
/>
|
|
149
|
+
)}
|
|
150
|
+
{expanded && (
|
|
151
|
+
<Stack direction="row" width="100%" alignItems="center" gap={2}>
|
|
152
|
+
{columns && (
|
|
153
|
+
<TableColumnsSelector columns={columns} uniqueId={uniqueId} />
|
|
154
|
+
)}
|
|
155
|
+
<Divider
|
|
156
|
+
orientation="vertical"
|
|
157
|
+
style={{
|
|
158
|
+
height: '20px',
|
|
159
|
+
background: theme.palette.border.primary,
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
162
|
+
<Stack direction="row"></Stack>
|
|
163
|
+
</Stack>
|
|
164
|
+
)}
|
|
165
|
+
</motion.div>
|
|
50
166
|
);
|
|
51
|
-
}
|
|
167
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Badge, Box, IconButton, styled } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { DropDownIcon, Icons } from '../../../export';
|
|
4
|
+
|
|
5
|
+
const AnchorContainer = styled(Box)(({ theme }) => ({
|
|
6
|
+
height: '40px',
|
|
7
|
+
width: '40px',
|
|
8
|
+
backgroundColor: theme.palette.secondary.main,
|
|
9
|
+
borderRadius: '5px',
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
export const DensityAnchor = ({
|
|
16
|
+
handleClick,
|
|
17
|
+
icon,
|
|
18
|
+
}: {
|
|
19
|
+
handleClick: (e: any) => void;
|
|
20
|
+
icon: ReactNode;
|
|
21
|
+
}) => {
|
|
22
|
+
return (
|
|
23
|
+
<DropDownIcon
|
|
24
|
+
icon={{
|
|
25
|
+
icon: <AnchorContainer>{icon}</AnchorContainer>,
|
|
26
|
+
}}
|
|
27
|
+
handleClick={handleClick}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const ColumnsAnchor = ({
|
|
33
|
+
handleClick,
|
|
34
|
+
showDot = false,
|
|
35
|
+
}: {
|
|
36
|
+
handleClick: (e: any) => void;
|
|
37
|
+
showDot: boolean;
|
|
38
|
+
}) => {
|
|
39
|
+
return (
|
|
40
|
+
<Badge overlap="circular" variant={showDot ? 'dot' : 'standard'}>
|
|
41
|
+
<IconButton onClick={handleClick}>
|
|
42
|
+
<AnchorContainer>
|
|
43
|
+
<Icons.ColumnsIcon />
|
|
44
|
+
</AnchorContainer>
|
|
45
|
+
</IconButton>
|
|
46
|
+
</Badge>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const FiltersAnchor = ({
|
|
51
|
+
handleClick,
|
|
52
|
+
showDot,
|
|
53
|
+
}: {
|
|
54
|
+
handleClick: (e: any) => void;
|
|
55
|
+
showDot: boolean;
|
|
56
|
+
}) => {
|
|
57
|
+
return (
|
|
58
|
+
<Badge overlap="circular" variant={showDot ? 'dot' : 'standard'}>
|
|
59
|
+
<IconButton onClick={handleClick}>
|
|
60
|
+
<AnchorContainer>
|
|
61
|
+
<Icons.FilterIcon />
|
|
62
|
+
</AnchorContainer>
|
|
63
|
+
</IconButton>
|
|
64
|
+
</Badge>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const SearchAnchor = ({
|
|
69
|
+
handleClick,
|
|
70
|
+
showDot,
|
|
71
|
+
}: {
|
|
72
|
+
handleClick: (e: any) => void;
|
|
73
|
+
showDot: boolean;
|
|
74
|
+
}) => {
|
|
75
|
+
return (
|
|
76
|
+
<Badge overlap="circular" variant={showDot ? 'dot' : 'standard'}>
|
|
77
|
+
<IconButton onClick={handleClick}>
|
|
78
|
+
<AnchorContainer>
|
|
79
|
+
<Icons.SearchIcon />
|
|
80
|
+
</AnchorContainer>
|
|
81
|
+
</IconButton>
|
|
82
|
+
</Badge>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { MenuListProps, MenuProps, Stack, useTheme } from '@mui/material';
|
|
2
|
+
import { GridDensity } from '@mui/x-data-grid';
|
|
3
|
+
import { capitalize } from 'lodash';
|
|
4
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
5
|
+
import { RootState, setDensity } from '../../../../../redux/export';
|
|
6
|
+
import { Button, DropdownMenu, Icons, Typography } from '../../../../export';
|
|
7
|
+
import { DensityAnchor } from '../Anchors';
|
|
8
|
+
|
|
9
|
+
export type DensitySelectorProps = {
|
|
10
|
+
menuProps?: Omit<MenuProps, 'open'>;
|
|
11
|
+
menuListProps?: MenuListProps;
|
|
12
|
+
uniqueId: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const DensitySelector = ({
|
|
16
|
+
uniqueId,
|
|
17
|
+
...props
|
|
18
|
+
}: DensitySelectorProps) => {
|
|
19
|
+
const dispatch = useDispatch();
|
|
20
|
+
const density = useSelector(
|
|
21
|
+
(state: RootState) =>
|
|
22
|
+
state.pageHeaderSlice[uniqueId]?.density || 'standard',
|
|
23
|
+
);
|
|
24
|
+
const gridDensity: GridDensity[] = ['compact', 'standard', 'comfortable'];
|
|
25
|
+
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
|
|
28
|
+
const getIcon = (type: GridDensity, size: number) => {
|
|
29
|
+
switch (type) {
|
|
30
|
+
case 'standard':
|
|
31
|
+
return <Icons.StandardIcon size={size} />;
|
|
32
|
+
case 'compact':
|
|
33
|
+
return <Icons.CompactIcon size={size} />;
|
|
34
|
+
case 'comfortable':
|
|
35
|
+
return <Icons.ComfortableIcon size={size} />;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const handleMenuClick = (value: GridDensity, close: () => void) => {
|
|
40
|
+
dispatch(
|
|
41
|
+
setDensity({
|
|
42
|
+
uniqueId: uniqueId,
|
|
43
|
+
density: value,
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
close();
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<DropdownMenu
|
|
51
|
+
menuListProps={{
|
|
52
|
+
sx: {
|
|
53
|
+
width: '220px',
|
|
54
|
+
padding: '12px',
|
|
55
|
+
maxHeight: '350px',
|
|
56
|
+
},
|
|
57
|
+
...props.menuListProps,
|
|
58
|
+
}}
|
|
59
|
+
anchor={({ open }: { open: (e: any) => void }) => (
|
|
60
|
+
<DensityAnchor handleClick={open} icon={getIcon(density, 16)} />
|
|
61
|
+
)}
|
|
62
|
+
menuProps={{
|
|
63
|
+
...props.menuProps,
|
|
64
|
+
}}
|
|
65
|
+
menuHeader={
|
|
66
|
+
<Typography color={theme.palette.text.secondary} variant="label1">
|
|
67
|
+
Row Density
|
|
68
|
+
</Typography>
|
|
69
|
+
}
|
|
70
|
+
menuListContainerSx={{
|
|
71
|
+
margin: '10px 2px 0px 0px',
|
|
72
|
+
gap: 1,
|
|
73
|
+
}}
|
|
74
|
+
menu={({ close }) =>
|
|
75
|
+
gridDensity.map((item) => (
|
|
76
|
+
<Button
|
|
77
|
+
onClick={() => handleMenuClick(item, close)}
|
|
78
|
+
variant="text"
|
|
79
|
+
fullWidth
|
|
80
|
+
>
|
|
81
|
+
<Stack
|
|
82
|
+
direction="row"
|
|
83
|
+
justifyContent="flex-start"
|
|
84
|
+
alignItems="center"
|
|
85
|
+
gap={2}
|
|
86
|
+
width="100%"
|
|
87
|
+
>
|
|
88
|
+
{getIcon(item, 20)}
|
|
89
|
+
<Typography variant="label2">{capitalize(item)}</Typography>
|
|
90
|
+
</Stack>
|
|
91
|
+
</Button>
|
|
92
|
+
))
|
|
93
|
+
}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
@@ -2,32 +2,36 @@ import { KeyboardArrowDown } from '@mui/icons-material';
|
|
|
2
2
|
import { MenuListProps, MenuProps, Typography, useTheme } from '@mui/material';
|
|
3
3
|
import { GridColDef, GridColumnVisibilityModel } from '@mui/x-data-grid';
|
|
4
4
|
import { useState } from 'react';
|
|
5
|
-
import { useDispatch } from 'react-redux';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
6
|
+
import {
|
|
7
|
+
RootState,
|
|
8
|
+
setColumnVisibilityModel,
|
|
9
|
+
} from '../../../../../redux/export';
|
|
10
|
+
import { Button, Icons, SearchBar, SingleCheckBox } from '../../../../export';
|
|
11
|
+
import { DropdownMenu } from '../../../../Navigation/export';
|
|
9
12
|
|
|
10
|
-
export type
|
|
13
|
+
export type TableColumnsSelectorProps = {
|
|
11
14
|
columns: GridColDef[];
|
|
12
15
|
menuProps?: Omit<MenuProps, 'open'>;
|
|
13
16
|
menuListProps?: MenuListProps;
|
|
14
17
|
uniqueId: string;
|
|
15
18
|
};
|
|
16
19
|
|
|
17
|
-
export const
|
|
20
|
+
export const TableColumnsSelector = ({
|
|
18
21
|
columns,
|
|
19
22
|
uniqueId,
|
|
20
23
|
...props
|
|
21
|
-
}:
|
|
24
|
+
}: TableColumnsSelectorProps) => {
|
|
22
25
|
const dispatch = useDispatch();
|
|
23
26
|
|
|
24
|
-
const
|
|
25
|
-
|
|
27
|
+
const columnVisibilityModel = useSelector(
|
|
28
|
+
(state: RootState) =>
|
|
29
|
+
state.pageHeaderSlice[uniqueId]?.columnVisibilityModel ||
|
|
26
30
|
columns.reduce((acc, column) => {
|
|
27
31
|
acc[column.field] = true;
|
|
28
32
|
return acc;
|
|
29
33
|
}, {} as GridColumnVisibilityModel),
|
|
30
|
-
|
|
34
|
+
);
|
|
31
35
|
|
|
32
36
|
const [search, setSearch] = useState<string>('');
|
|
33
37
|
|
|
@@ -42,15 +46,12 @@ export const TableColumnFilters = ({
|
|
|
42
46
|
...columnVisibilityModel,
|
|
43
47
|
[column.field]: !checked,
|
|
44
48
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}),
|
|
52
|
-
);
|
|
53
|
-
}
|
|
49
|
+
dispatch(
|
|
50
|
+
setColumnVisibilityModel({
|
|
51
|
+
uniqueId: uniqueId,
|
|
52
|
+
columnVisibilityModel: newColumnVisibilityModel,
|
|
53
|
+
}),
|
|
54
|
+
);
|
|
54
55
|
};
|
|
55
56
|
return (
|
|
56
57
|
<>
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
Stack,
|
|
5
5
|
styled,
|
|
6
6
|
} from '@mui/material';
|
|
7
|
+
import _ from 'lodash';
|
|
7
8
|
import { Link } from 'react-router-dom';
|
|
8
9
|
import { Typography } from '../../export';
|
|
9
10
|
|
|
@@ -36,26 +37,34 @@ export const Breadcrumbs = ({ pathTrimCount, ...rest }: BreadcrumbsProps) => {
|
|
|
36
37
|
currentPathArray.splice(0, pathTrimCount + 1);
|
|
37
38
|
|
|
38
39
|
return (
|
|
39
|
-
<
|
|
40
|
+
<BreadcrumbContainer>
|
|
40
41
|
<MuiBreadcrumbs {...rest}>
|
|
41
42
|
{currentPathArray?.map((item, index) => {
|
|
42
43
|
basePath = basePath + `/${item}`;
|
|
43
44
|
return index === currentPathArray.length - 1 ? (
|
|
44
45
|
<Typography variant="subtitle2">
|
|
45
|
-
{decodeURIComponent(item).split(specialCharacter)[0]}
|
|
46
|
+
{_.startCase(decodeURIComponent(item).split(specialCharacter)[0])}
|
|
46
47
|
</Typography>
|
|
47
48
|
) : (
|
|
48
|
-
<
|
|
49
|
-
{decodeURIComponent(item).split(specialCharacter)[0]}
|
|
50
|
-
</
|
|
49
|
+
<BreadcrumbLink key={index} to={basePath}>
|
|
50
|
+
{_.startCase(decodeURIComponent(item).split(specialCharacter)[0])}
|
|
51
|
+
</BreadcrumbLink>
|
|
51
52
|
);
|
|
52
53
|
})}
|
|
53
54
|
</MuiBreadcrumbs>
|
|
54
|
-
</
|
|
55
|
+
</BreadcrumbContainer>
|
|
55
56
|
);
|
|
56
57
|
};
|
|
57
58
|
|
|
58
|
-
const
|
|
59
|
+
const BreadcrumbContainer = styled(Stack)(({ theme }) => ({
|
|
60
|
+
flexDirection: 'row',
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
width: '100%',
|
|
63
|
+
justifyContent: 'flex-start',
|
|
64
|
+
height: '52px',
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
const BreadcrumbLink = styled(Link)(({ theme }) => ({
|
|
59
68
|
textDecoration: 'none',
|
|
60
69
|
transition: 'color 0.3s ease-in-out',
|
|
61
70
|
color: theme.palette.text.tertiary,
|
|
@@ -49,7 +49,9 @@ export const Stepper = ({
|
|
|
49
49
|
activeStep={index < activeStep}
|
|
50
50
|
isLastStep={index === steps?.length - 1}
|
|
51
51
|
>
|
|
52
|
-
<Typography variant="label2">
|
|
52
|
+
<Typography fontSize={'12px'} variant="label2">
|
|
53
|
+
{item?.description}
|
|
54
|
+
</Typography>
|
|
53
55
|
</StyledStepContent>
|
|
54
56
|
</Step>
|
|
55
57
|
))}
|
|
@@ -17,15 +17,17 @@ interface StepContentProps {
|
|
|
17
17
|
|
|
18
18
|
export const StyledStepContent = styled(StepContent)<StepContentProps>(
|
|
19
19
|
({ theme, isVertical, activeStep, isLastStep }) => ({
|
|
20
|
+
...(isVertical && {
|
|
21
|
+
marginLeft: '11px',
|
|
22
|
+
}),
|
|
20
23
|
...(isVertical &&
|
|
21
24
|
activeStep &&
|
|
22
25
|
!isLastStep && {
|
|
23
|
-
borderLeft: `
|
|
26
|
+
borderLeft: `1px solid ${theme.palette.primary.light}`,
|
|
24
27
|
}),
|
|
25
28
|
...(!isVertical && {
|
|
26
29
|
borderLeft: 'none',
|
|
27
|
-
|
|
28
|
-
margin: '20px 0px 0px 20px',
|
|
30
|
+
marginLeft: '20px',
|
|
29
31
|
}),
|
|
30
32
|
}),
|
|
31
33
|
);
|
|
@@ -39,15 +41,28 @@ export const Connector = styled(StepConnector)<ConnectorProps>(
|
|
|
39
41
|
[`&.${stepConnectorClasses.active}`]: {
|
|
40
42
|
[`& .${stepConnectorClasses.line}`]: {
|
|
41
43
|
[isVertical ? 'borderLeft' : 'border']:
|
|
42
|
-
`
|
|
44
|
+
`1px solid ${theme.palette.primary.light}`,
|
|
43
45
|
},
|
|
44
46
|
},
|
|
45
47
|
[`&.${stepConnectorClasses.completed}`]: {
|
|
46
48
|
[`& .${stepConnectorClasses.line}`]: {
|
|
47
49
|
[isVertical ? 'borderLeft' : 'border']:
|
|
48
|
-
`
|
|
50
|
+
`1px solid ${theme.palette.primary.light}`,
|
|
49
51
|
},
|
|
50
52
|
},
|
|
53
|
+
...(isVertical
|
|
54
|
+
? {
|
|
55
|
+
top: '0px',
|
|
56
|
+
marginLeft: '11px',
|
|
57
|
+
[`& .${stepConnectorClasses.line}`]: {
|
|
58
|
+
minHeight: '28px',
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
: {
|
|
62
|
+
left: 'calc(-50% + 8px)',
|
|
63
|
+
right: 'calc(50% + 7px)',
|
|
64
|
+
top: '7.5px',
|
|
65
|
+
}),
|
|
51
66
|
}),
|
|
52
67
|
);
|
|
53
68
|
|
|
@@ -65,7 +80,6 @@ export function StepIcon(props: StepIconProps) {
|
|
|
65
80
|
|
|
66
81
|
const StepIconRoot = styled('div')<{}>(({ theme }) => ({
|
|
67
82
|
width: 20,
|
|
68
|
-
height: 20,
|
|
69
83
|
display: 'flex',
|
|
70
84
|
justifyContent: 'center',
|
|
71
85
|
alignItems: 'center',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from '../Layout/PageHeader/components/TableColumnsSelector/TableColumnsSelector';
|
|
1
2
|
export * from './Breadcrumbs/Breadcrumbs';
|
|
2
3
|
export * from './ConfirmDialog/ConfirmDialog';
|
|
3
4
|
export * from './Dialog/Dialog';
|
|
@@ -10,7 +11,5 @@ export * from './ManageFilters/ManageFilters';
|
|
|
10
11
|
export * from './PreviewFiles/PreviewFiles';
|
|
11
12
|
export * from './Sidebar/Sidebar';
|
|
12
13
|
export * from './Stepper/Stepper';
|
|
13
|
-
export * from './TableColumnFilters/TableColumnFilters';
|
|
14
|
-
export * from './TableDensityFilter/TableDensityFilter';
|
|
15
14
|
export * from './TabsContainer/TabsContainer';
|
|
16
15
|
export * from './UploadDialog/UploadDialog';
|
|
@@ -2,16 +2,17 @@ import { useRef } from 'react';
|
|
|
2
2
|
import { useDispatch, useSelector } from 'react-redux';
|
|
3
3
|
import { v4 } from 'uuid';
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
PageHeaderState,
|
|
6
6
|
resetStateForUniqueId,
|
|
7
|
-
} from '../
|
|
8
|
-
import { RootState } from '../
|
|
7
|
+
} from '../redux/slices/pageHeaderSlice';
|
|
8
|
+
import { RootState } from '../redux/store';
|
|
9
9
|
|
|
10
10
|
export const usePageHeader = () => {
|
|
11
11
|
const uuidRef = useRef(v4());
|
|
12
12
|
const dispatch = useDispatch();
|
|
13
13
|
const filterState = useSelector(
|
|
14
|
-
(state: RootState) =>
|
|
14
|
+
(state: RootState) =>
|
|
15
|
+
state.pageHeaderSlice[uuidRef.current] || ({} as PageHeaderState),
|
|
15
16
|
);
|
|
16
17
|
|
|
17
18
|
const resetState = () => {
|
package/src/index.tsx
CHANGED
|
@@ -4,8 +4,8 @@ import App from './App';
|
|
|
4
4
|
|
|
5
5
|
import { Provider } from 'react-redux';
|
|
6
6
|
import './index.css';
|
|
7
|
+
import { store } from './redux/store';
|
|
7
8
|
import reportWebVitals from './reportWebVitals';
|
|
8
|
-
import { store } from './state/store';
|
|
9
9
|
import { MuiThemeProvider } from './themes/MuiThemeProvider';
|
|
10
10
|
|
|
11
11
|
const root = ReactDOM.createRoot(
|