@applica-software-guru/react-admin 1.0.41 → 1.0.43
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/bitbucket-pipelines.yml +2 -0
- package/dist/ApplicaAdmin.d.ts.map +1 -1
- package/dist/components/@extended/AnimateButton.d.ts +1 -1
- package/dist/components/@extended/AnimateButton.d.ts.map +1 -1
- package/dist/components/@extended/Avatar.d.ts.map +1 -1
- package/dist/components/@extended/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/@extended/IconButton.d.ts.map +1 -1
- package/dist/components/@extended/LoadingButton.d.ts.map +1 -1
- package/dist/components/@extended/Tooltip.d.ts.map +1 -1
- package/dist/components/@extended/Transitions.d.ts.map +1 -1
- package/dist/components/@extended/progress/CircularWithLabel.d.ts.map +1 -1
- package/dist/components/@extended/progress/CircularWithPath.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/DrawerContent/Navigation/NavCollapse.d.ts +1 -1
- package/dist/components/Layout/Drawer/DrawerContent/Navigation/NavCollapse.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/DrawerContent/Navigation/NavGroup.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/DrawerContent/Navigation/NavItem.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/DrawerHeader/DrawerHeaderStyled.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/DrawerHeader/index.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/MiniDrawerStyled.d.ts.map +1 -1
- package/dist/components/Layout/Drawer/index.d.ts.map +1 -1
- package/dist/components/Layout/Footer.d.ts.map +1 -1
- package/dist/components/Layout/Header/AppBarStyled.d.ts.map +1 -1
- package/dist/components/Layout/Header/HeaderContent/Notification.d.ts.map +1 -1
- package/dist/components/Layout/Header/HeaderContent/NotificationItem.d.ts.map +1 -1
- package/dist/components/Layout/Header/HeaderContent/Profile.d.ts.map +1 -1
- package/dist/components/Layout/Header/HeaderContent/index.d.ts.map +1 -1
- package/dist/components/Layout/Header/index.d.ts.map +1 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/MenuPopover/styles.d.ts.map +1 -1
- package/dist/components/Notification.d.ts.map +1 -1
- package/dist/components/ScrollX.d.ts.map +1 -1
- package/dist/components/ra-buttons/EditInDialogButton.d.ts.map +1 -1
- package/dist/components/ra-fields/CoverField.d.ts.map +1 -1
- package/dist/components/ra-fields/DateAgoField.d.ts.map +1 -1
- package/dist/components/ra-fields/ReadonlyField.d.ts.map +1 -1
- package/dist/components/ra-forms/CardForm.d.ts.map +1 -1
- package/dist/components/ra-forms/LongForm/useFormRootPath.d.ts.map +1 -1
- package/dist/components/ra-forms/TabbedForm.d.ts.map +1 -1
- package/dist/components/ra-inputs/ReferenceManyInput.d.ts.map +1 -1
- package/dist/components/ra-lists/Empty.d.ts.map +1 -1
- package/dist/components/ra-lists/NotificationList/NotificationList.d.ts.map +1 -1
- package/dist/components/ra-lists/NotificationList/button/MarkAsReadedButton.d.ts.map +1 -1
- package/dist/components/ra-lists/NotificationList/field/NotificationField.d.ts.map +1 -1
- package/dist/contexts/MenuConfigContext.d.ts.map +1 -1
- package/dist/contexts/MenuPropTypes.d.ts.map +1 -1
- package/dist/dev/useCliErrorCatcher.d.ts +1 -1
- package/dist/hooks/useMenu.d.ts.map +1 -1
- package/dist/i18n/useI18nCatcher.d.ts +1 -1
- package/dist/i18n/useI18nLanguages.d.ts +1 -1
- package/dist/i18n/useI18nLanguages.d.ts.map +1 -1
- package/dist/i18n/useI18nProvider.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +2 -1
- package/dist/react-admin.cjs.js.map +1 -0
- package/dist/react-admin.es.js +300 -784
- package/dist/react-admin.es.js.map +1 -0
- package/dist/react-admin.umd.js +2 -1
- package/dist/react-admin.umd.js.map +1 -0
- package/dist/themes/overrides/OutlinedInput.d.ts.map +1 -1
- package/dist/themes/palette.d.ts.map +1 -1
- package/dist/themes/theme/theme1.d.ts.map +1 -1
- package/dist/themes/theme/theme2.d.ts.map +1 -1
- package/dist/themes/theme/theme3.d.ts.map +1 -1
- package/dist/themes/theme/theme4.d.ts.map +1 -1
- package/dist/themes/theme/theme5.d.ts.map +1 -1
- package/dist/themes/theme/theme6.d.ts.map +1 -1
- package/dist/themes/theme/theme7.d.ts.map +1 -1
- package/dist/themes/theme/theme8.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/lang.d.ts +1 -1
- package/dist/utils/lang.d.ts.map +1 -1
- package/dist/utils/time.d.ts +2 -1
- package/dist/utils/time.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/Admin.jsx +8 -8
- package/src/AdminContext.jsx +9 -9
- package/src/ApplicaAdmin.jsx +30 -35
- package/src/components/@extended/AnimateButton.jsx +25 -33
- package/src/components/@extended/Avatar.jsx +35 -42
- package/src/components/@extended/Breadcrumbs.jsx +62 -96
- package/src/components/@extended/Dot.jsx +14 -14
- package/src/components/@extended/IconButton.jsx +55 -65
- package/src/components/@extended/LoadingButton.jsx +84 -86
- package/src/components/@extended/Tooltip.jsx +24 -27
- package/src/components/@extended/Transitions.jsx +98 -107
- package/src/components/@extended/index.jsx +10 -10
- package/src/components/@extended/progress/CircularWithLabel.jsx +7 -9
- package/src/components/@extended/progress/CircularWithPath.jsx +9 -18
- package/src/components/@extended/progress/LinearWithIcon.jsx +5 -5
- package/src/components/@extended/progress/LinearWithLabel.jsx +5 -5
- package/src/components/@extended/progress/index.jsx +5 -5
- package/src/components/Layout/Drawer/DrawerContent/Navigation/NavCollapse.jsx +112 -131
- package/src/components/Layout/Drawer/DrawerContent/Navigation/NavGroup.jsx +67 -88
- package/src/components/Layout/Drawer/DrawerContent/Navigation/NavItem.jsx +63 -79
- package/src/components/Layout/Drawer/DrawerContent/Navigation/index.jsx +28 -28
- package/src/components/Layout/Drawer/DrawerContent/index.jsx +7 -7
- package/src/components/Layout/Drawer/DrawerHeader/DrawerHeaderStyled.jsx +13 -15
- package/src/components/Layout/Drawer/DrawerHeader/index.jsx +17 -22
- package/src/components/Layout/Drawer/HorizontalBar.jsx +17 -17
- package/src/components/Layout/Drawer/MiniDrawerStyled.jsx +27 -29
- package/src/components/Layout/Drawer/index.jsx +21 -24
- package/src/components/Layout/Footer.jsx +7 -12
- package/src/components/Layout/Header/AppBarStyled.jsx +26 -28
- package/src/components/Layout/Header/HeaderContent/MobileSection.jsx +27 -27
- package/src/components/Layout/Header/HeaderContent/Notification.jsx +34 -55
- package/src/components/Layout/Header/HeaderContent/NotificationItem.jsx +24 -36
- package/src/components/Layout/Header/HeaderContent/Profile.jsx +48 -73
- package/src/components/Layout/Header/HeaderContent/index.jsx +16 -18
- package/src/components/Layout/Header/index.jsx +25 -43
- package/src/components/Layout/index.jsx +36 -52
- package/src/components/Loadable.jsx +4 -4
- package/src/components/Loader.jsx +7 -7
- package/src/components/Logo.jsx +14 -14
- package/src/components/MainIcon.jsx +6 -6
- package/src/components/MenuPopover/MenuPopover.jsx +15 -15
- package/src/components/MenuPopover/getPosition.jsx +40 -40
- package/src/components/MenuPopover/index.jsx +3 -3
- package/src/components/MenuPopover/styles.jsx +20 -20
- package/src/components/Notification.jsx +7 -7
- package/src/components/ScrollTop.jsx +13 -13
- package/src/components/ScrollX.jsx +4 -4
- package/src/components/SmallIcon.jsx +6 -6
- package/src/components/ra-buttons/EditInDialogButton.jsx +39 -45
- package/src/components/ra-buttons/ImpersonateUserButton.jsx +20 -20
- package/src/components/ra-buttons/index.jsx +4 -4
- package/src/components/ra-fields/ActionsField.jsx +12 -12
- package/src/components/ra-fields/CoverField.jsx +20 -26
- package/src/components/ra-fields/DateAgoField.jsx +17 -20
- package/src/components/ra-fields/DateField.jsx +14 -14
- package/src/components/ra-fields/EmailField.jsx +14 -14
- package/src/components/ra-fields/FileField.jsx +23 -23
- package/src/components/ra-fields/FunctionField.jsx +5 -5
- package/src/components/ra-fields/ImageField.jsx +11 -11
- package/src/components/ra-fields/ReadonlyField.jsx +40 -42
- package/src/components/ra-fields/ReferenceManyField.jsx +21 -21
- package/src/components/ra-fields/SizeField.jsx +15 -15
- package/src/components/ra-fields/TextField.jsx +14 -14
- package/src/components/ra-fields/index.jsx +15 -15
- package/src/components/ra-forms/CardForm.jsx +34 -40
- package/src/components/ra-forms/LongForm/useFormRootPath.ts +8 -13
- package/src/components/ra-forms/TabbedForm.jsx +10 -10
- package/src/components/ra-forms/Toolbar.jsx +15 -15
- package/src/components/ra-forms/index.jsx +9 -9
- package/src/components/ra-inputs/AutocompleteArrayInput.jsx +7 -7
- package/src/components/ra-inputs/AutocompleteInput.jsx +9 -9
- package/src/components/ra-inputs/BooleanInput.jsx +19 -19
- package/src/components/ra-inputs/DateInput.jsx +13 -13
- package/src/components/ra-inputs/FileInput.jsx +33 -33
- package/src/components/ra-inputs/ImageInput.jsx +19 -19
- package/src/components/ra-inputs/NumberInput.jsx +13 -13
- package/src/components/ra-inputs/RecordInput.jsx +39 -39
- package/src/components/ra-inputs/ReferenceArrayInput.jsx +10 -10
- package/src/components/ra-inputs/ReferenceInput.jsx +10 -10
- package/src/components/ra-inputs/ReferenceManyInput.jsx +13 -24
- package/src/components/ra-inputs/SearchInput.jsx +6 -6
- package/src/components/ra-inputs/SelectArrayInput.jsx +19 -19
- package/src/components/ra-inputs/TimeInput.jsx +21 -21
- package/src/components/ra-lists/Empty.jsx +32 -37
- package/src/components/ra-lists/List.jsx +9 -9
- package/src/components/ra-lists/NotificationList/NotificationList.jsx +14 -16
- package/src/components/ra-lists/NotificationList/button/MarkAsReadedButton.jsx +21 -25
- package/src/components/ra-lists/NotificationList/button/MarkAsUnreadedButton.jsx +19 -19
- package/src/components/ra-lists/NotificationList/button/index.jsx +2 -2
- package/src/components/ra-lists/NotificationList/field/NotificationField.jsx +20 -31
- package/src/components/ra-lists/NotificationList/field/index.jsx +1 -1
- package/src/components/ra-lists/NotificationList/index.jsx +2 -2
- package/src/components/ra-lists/index.jsx +5 -5
- package/src/components/third-party/SimpleBar.jsx +10 -10
- package/src/components/third-party/index.jsx +2 -2
- package/src/contexts/MenuConfigContext.jsx +35 -35
- package/src/contexts/MenuPropTypes.jsx +7 -7
- package/src/contexts/index.jsx +5 -5
- package/src/dev/index.jsx +2 -2
- package/src/dev/useCliErrorCatcher.jsx +32 -32
- package/src/hooks/index.jsx +8 -16
- package/src/hooks/useAppConfig.jsx +4 -4
- package/src/hooks/useBreadcrumbs.jsx +37 -37
- package/src/hooks/useLocalStorage.jsx +16 -16
- package/src/hooks/useMenu.jsx +83 -88
- package/src/hooks/useMenuConfig.jsx +4 -4
- package/src/hooks/useResourceTitle.jsx +13 -13
- package/src/hooks/useThemeConfig.jsx +4 -4
- package/src/i18n/createI18nProvider.jsx +7 -7
- package/src/i18n/index.jsx +4 -4
- package/src/i18n/useI18nCatcher.jsx +26 -26
- package/src/i18n/useI18nLanguages.jsx +12 -16
- package/src/i18n/useI18nProvider.jsx +3 -4
- package/src/themes/getColors.jsx +8 -8
- package/src/themes/getShadow.jsx +17 -17
- package/src/themes/index.jsx +29 -29
- package/src/themes/overrides/Accordion.jsx +9 -9
- package/src/themes/overrides/AccordionDetails.jsx +5 -5
- package/src/themes/overrides/AccordionSummary.jsx +11 -11
- package/src/themes/overrides/Alert.jsx +21 -21
- package/src/themes/overrides/AlertTitle.jsx +5 -5
- package/src/themes/overrides/Autocomplete.jsx +9 -9
- package/src/themes/overrides/Badge.jsx +12 -12
- package/src/themes/overrides/Button.jsx +62 -62
- package/src/themes/overrides/ButtonBase.jsx +4 -4
- package/src/themes/overrides/ButtonGroup.jsx +4 -4
- package/src/themes/overrides/CardContent.jsx +6 -6
- package/src/themes/overrides/Checkbox.jsx +31 -31
- package/src/themes/overrides/Chip.jsx +22 -22
- package/src/themes/overrides/Dialog.jsx +7 -7
- package/src/themes/overrides/DialogContentText.jsx +5 -5
- package/src/themes/overrides/DialogTitle.jsx +5 -5
- package/src/themes/overrides/Fab.jsx +21 -21
- package/src/themes/overrides/IconButton.jsx +8 -8
- package/src/themes/overrides/InputBase.jsx +3 -3
- package/src/themes/overrides/InputLabel.jsx +8 -8
- package/src/themes/overrides/LinearProgress.jsx +6 -6
- package/src/themes/overrides/Link.jsx +4 -4
- package/src/themes/overrides/ListItemButton.jsx +7 -7
- package/src/themes/overrides/ListItemIcon.jsx +5 -5
- package/src/themes/overrides/LoadingButton.jsx +6 -6
- package/src/themes/overrides/OutlinedInput.jsx +20 -21
- package/src/themes/overrides/Pagination.jsx +4 -4
- package/src/themes/overrides/PaginationItem.jsx +55 -55
- package/src/themes/overrides/Popover.jsx +5 -5
- package/src/themes/overrides/Radio.jsx +30 -30
- package/src/themes/overrides/Slider.jsx +20 -20
- package/src/themes/overrides/Switch.jsx +26 -26
- package/src/themes/overrides/Tab.jsx +7 -7
- package/src/themes/overrides/TableBody.jsx +11 -11
- package/src/themes/overrides/TableCell.jsx +12 -12
- package/src/themes/overrides/TableFooter.jsx +5 -5
- package/src/themes/overrides/TableHead.jsx +5 -5
- package/src/themes/overrides/TablePagination.jsx +6 -6
- package/src/themes/overrides/TableRow.jsx +10 -10
- package/src/themes/overrides/Tabs.jsx +5 -5
- package/src/themes/overrides/ToggleButton.jsx +7 -7
- package/src/themes/overrides/Tooltip.jsx +5 -5
- package/src/themes/overrides/TreeItem.jsx +7 -7
- package/src/themes/overrides/Typography.jsx +5 -5
- package/src/themes/overrides/index.jsx +47 -47
- package/src/themes/palette.jsx +22 -34
- package/src/themes/shadows.jsx +4 -4
- package/src/themes/theme/default.jsx +17 -17
- package/src/themes/theme/index.jsx +23 -23
- package/src/themes/theme/theme1.jsx +24 -46
- package/src/themes/theme/theme2.jsx +24 -46
- package/src/themes/theme/theme3.jsx +24 -46
- package/src/themes/theme/theme4.jsx +24 -46
- package/src/themes/theme/theme5.jsx +24 -46
- package/src/themes/theme/theme6.jsx +24 -46
- package/src/themes/theme/theme7.jsx +24 -46
- package/src/themes/theme/theme8.jsx +24 -46
- package/src/themes/typography.jsx +16 -16
- package/src/utils/{lang.js → lang.ts} +4 -4
- package/src/utils/time.ts +14 -0
- package/vite.config.js +11 -10
- package/src/utils/time.js +0 -13
- /package/src/utils/{index.js → index.ts} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ApartmentOutlined, HomeFilled, HomeOutlined } from '@ant-design/icons'
|
|
2
|
-
import { Divider, Grid, Typography } from '@mui/material'
|
|
3
|
-
import { Link, useLocation } from 'react-router-dom'
|
|
4
|
-
import { useEffect, useState } from 'react'
|
|
1
|
+
import { ApartmentOutlined, HomeFilled, HomeOutlined } from '@ant-design/icons';
|
|
2
|
+
import { Divider, Grid, Typography } from '@mui/material';
|
|
3
|
+
import { Link, useLocation } from 'react-router-dom';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
5
|
|
|
6
|
-
import MainCard from '../MainCard'
|
|
7
|
-
import { MenuPropTypes } from '../../contexts'
|
|
8
|
-
import MuiBreadcrumbs from '@mui/material/Breadcrumbs'
|
|
9
|
-
import PropTypes from 'prop-types'
|
|
10
|
-
import { useTheme } from '@mui/material/styles'
|
|
6
|
+
import MainCard from '../MainCard';
|
|
7
|
+
import { MenuPropTypes } from '../../contexts';
|
|
8
|
+
import MuiBreadcrumbs from '@mui/material/Breadcrumbs';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import { useTheme } from '@mui/material/styles';
|
|
11
11
|
|
|
12
12
|
const renderBreadcrumb = ({ id, title, icon, url, last }) => {
|
|
13
|
-
const Icon = icon ? icon : ApartmentOutlined
|
|
13
|
+
const Icon = icon ? icon : ApartmentOutlined;
|
|
14
14
|
return (
|
|
15
15
|
<Typography
|
|
16
16
|
key={id}
|
|
@@ -18,15 +18,15 @@ const renderBreadcrumb = ({ id, title, icon, url, last }) => {
|
|
|
18
18
|
to={url}
|
|
19
19
|
variant={last ? 'subtitle1' : 'h6'}
|
|
20
20
|
sx={{
|
|
21
|
-
textDecoration: 'none'
|
|
21
|
+
textDecoration: 'none'
|
|
22
22
|
}}
|
|
23
23
|
color="textSecondary"
|
|
24
24
|
>
|
|
25
25
|
{icon && <Icon style={{ marginRight: 8 }} />}
|
|
26
26
|
{title}
|
|
27
27
|
</Typography>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
30
|
|
|
31
31
|
const Breadcrumbs = ({
|
|
32
32
|
home,
|
|
@@ -45,65 +45,61 @@ const Breadcrumbs = ({
|
|
|
45
45
|
mode,
|
|
46
46
|
...others
|
|
47
47
|
}) => {
|
|
48
|
-
const theme = useTheme()
|
|
49
|
-
const location = useLocation()
|
|
50
|
-
const [main, setMain] = useState()
|
|
51
|
-
const [item, setItem] = useState()
|
|
48
|
+
const theme = useTheme();
|
|
49
|
+
const location = useLocation();
|
|
50
|
+
const [main, setMain] = useState();
|
|
51
|
+
const [item, setItem] = useState();
|
|
52
52
|
|
|
53
|
-
let currentPath = location.pathname
|
|
53
|
+
let currentPath = location.pathname;
|
|
54
54
|
|
|
55
55
|
const iconSX = {
|
|
56
56
|
marginRight: theme.spacing(0.75),
|
|
57
57
|
marginTop: `-${theme.spacing(0.25)}`,
|
|
58
58
|
width: '1rem',
|
|
59
59
|
height: '1rem',
|
|
60
|
-
color: theme.palette.secondary.main
|
|
61
|
-
}
|
|
60
|
+
color: theme.palette.secondary.main
|
|
61
|
+
};
|
|
62
62
|
|
|
63
63
|
// set active item state
|
|
64
64
|
const getCollapse = (menu) => {
|
|
65
65
|
if (menu.children) {
|
|
66
66
|
menu.children.filter((collapse) => {
|
|
67
67
|
if (collapse.type && collapse.type === 'collapse') {
|
|
68
|
-
getCollapse(collapse)
|
|
68
|
+
getCollapse(collapse);
|
|
69
69
|
if (collapse.url === currentPath) {
|
|
70
|
-
setMain(collapse)
|
|
71
|
-
setItem(collapse)
|
|
70
|
+
setMain(collapse);
|
|
71
|
+
setItem(collapse);
|
|
72
72
|
}
|
|
73
73
|
} else if (collapse.type && collapse.type === 'item') {
|
|
74
74
|
if (currentPath.includes(collapse.url)) {
|
|
75
|
-
setMain(menu)
|
|
76
|
-
setItem(collapse)
|
|
75
|
+
setMain(menu);
|
|
76
|
+
setItem(collapse);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
return false
|
|
80
|
-
})
|
|
79
|
+
return false;
|
|
80
|
+
});
|
|
81
81
|
}
|
|
82
|
-
}
|
|
82
|
+
};
|
|
83
83
|
|
|
84
84
|
useEffect(() => {
|
|
85
85
|
navigation?.items?.map((menu) => {
|
|
86
86
|
if (menu.type && menu.type === 'group') {
|
|
87
|
-
getCollapse(menu)
|
|
87
|
+
getCollapse(menu);
|
|
88
88
|
}
|
|
89
|
-
return false
|
|
90
|
-
})
|
|
91
|
-
})
|
|
89
|
+
return false;
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
92
|
|
|
93
93
|
// item separator
|
|
94
|
-
const SeparatorIcon = separator
|
|
95
|
-
const separatorIcon = separator ?
|
|
96
|
-
<SeparatorIcon style={{ fontSize: '0.75rem', marginTop: 2 }} />
|
|
97
|
-
) : (
|
|
98
|
-
'/'
|
|
99
|
-
)
|
|
94
|
+
const SeparatorIcon = separator;
|
|
95
|
+
const separatorIcon = separator ? <SeparatorIcon style={{ fontSize: '0.75rem', marginTop: 2 }} /> : '/';
|
|
100
96
|
|
|
101
|
-
let mainContent
|
|
102
|
-
let itemContent
|
|
103
|
-
let breadcrumbContent = <Typography
|
|
104
|
-
let itemTitle = ''
|
|
105
|
-
let CollapseIcon
|
|
106
|
-
let ItemIcon
|
|
97
|
+
let mainContent;
|
|
98
|
+
let itemContent;
|
|
99
|
+
let breadcrumbContent = <Typography />;
|
|
100
|
+
let itemTitle = '';
|
|
101
|
+
let CollapseIcon;
|
|
102
|
+
let ItemIcon;
|
|
107
103
|
if (mode === 'breadcrumbs') {
|
|
108
104
|
return (
|
|
109
105
|
<MainCard
|
|
@@ -126,19 +122,9 @@ const Breadcrumbs = ({
|
|
|
126
122
|
</Grid>
|
|
127
123
|
)}
|
|
128
124
|
<Grid item>
|
|
129
|
-
<MuiBreadcrumbs
|
|
130
|
-
aria-label="breadcrumb"
|
|
131
|
-
maxItems={maxItems || 8}
|
|
132
|
-
separator={separatorIcon}
|
|
133
|
-
>
|
|
125
|
+
<MuiBreadcrumbs aria-label="breadcrumb" maxItems={maxItems || 8} separator={separatorIcon}>
|
|
134
126
|
{home !== false && (
|
|
135
|
-
<Typography
|
|
136
|
-
component={Link}
|
|
137
|
-
to="/"
|
|
138
|
-
color="textSecondary"
|
|
139
|
-
variant="h6"
|
|
140
|
-
sx={{ textDecoration: 'none' }}
|
|
141
|
-
>
|
|
127
|
+
<Typography component={Link} to="/" color="textSecondary" variant="h6" sx={{ textDecoration: 'none' }}>
|
|
142
128
|
{icons && <HomeOutlined style={iconSX} />}
|
|
143
129
|
{icon && !icons && <HomeFilled style={{ ...iconSX, marginRight: 0 }} />}
|
|
144
130
|
{(!icon || icons) && home}
|
|
@@ -155,11 +141,11 @@ const Breadcrumbs = ({
|
|
|
155
141
|
</Grid>
|
|
156
142
|
{card === false && divider !== false && <Divider sx={{ mt: 2 }} />}
|
|
157
143
|
</MainCard>
|
|
158
|
-
)
|
|
144
|
+
);
|
|
159
145
|
}
|
|
160
146
|
// collapse item
|
|
161
147
|
if (main && main.type === 'collapse' && main.breadcrumbs === true) {
|
|
162
|
-
CollapseIcon = main.icon ? main.icon : ApartmentOutlined
|
|
148
|
+
CollapseIcon = main.icon ? main.icon : ApartmentOutlined;
|
|
163
149
|
mainContent = (
|
|
164
150
|
<Typography
|
|
165
151
|
component={Link}
|
|
@@ -171,7 +157,7 @@ const Breadcrumbs = ({
|
|
|
171
157
|
{icons && <CollapseIcon style={iconSX} />}
|
|
172
158
|
{main.title}
|
|
173
159
|
</Typography>
|
|
174
|
-
)
|
|
160
|
+
);
|
|
175
161
|
breadcrumbContent = (
|
|
176
162
|
<MainCard
|
|
177
163
|
border={card}
|
|
@@ -188,19 +174,9 @@ const Breadcrumbs = ({
|
|
|
188
174
|
spacing={1}
|
|
189
175
|
>
|
|
190
176
|
<Grid item>
|
|
191
|
-
<MuiBreadcrumbs
|
|
192
|
-
aria-label="breadcrumb"
|
|
193
|
-
maxItems={maxItems || 8}
|
|
194
|
-
separator={separatorIcon}
|
|
195
|
-
>
|
|
177
|
+
<MuiBreadcrumbs aria-label="breadcrumb" maxItems={maxItems || 8} separator={separatorIcon}>
|
|
196
178
|
{home !== false && (
|
|
197
|
-
<Typography
|
|
198
|
-
component={Link}
|
|
199
|
-
to="/"
|
|
200
|
-
color="textSecondary"
|
|
201
|
-
variant="h6"
|
|
202
|
-
sx={{ textDecoration: 'none' }}
|
|
203
|
-
>
|
|
179
|
+
<Typography component={Link} to="/" color="textSecondary" variant="h6" sx={{ textDecoration: 'none' }}>
|
|
204
180
|
{icons && <HomeOutlined style={iconSX} />}
|
|
205
181
|
{icon && !icons && <HomeFilled style={{ ...iconSX, marginRight: 0 }} />}
|
|
206
182
|
{(!icon || icons) && home}
|
|
@@ -217,14 +193,14 @@ const Breadcrumbs = ({
|
|
|
217
193
|
</Grid>
|
|
218
194
|
{card === false && divider !== false && <Divider sx={{ mt: 2 }} />}
|
|
219
195
|
</MainCard>
|
|
220
|
-
)
|
|
196
|
+
);
|
|
221
197
|
}
|
|
222
198
|
|
|
223
199
|
// items
|
|
224
200
|
if (item && item.type === 'item') {
|
|
225
|
-
itemTitle = item.title
|
|
201
|
+
itemTitle = item.title;
|
|
226
202
|
|
|
227
|
-
ItemIcon = item.icon ? item.icon : ApartmentOutlined
|
|
203
|
+
ItemIcon = item.icon ? item.icon : ApartmentOutlined;
|
|
228
204
|
itemContent = (
|
|
229
205
|
<Typography
|
|
230
206
|
variant="subtitle1"
|
|
@@ -232,13 +208,13 @@ const Breadcrumbs = ({
|
|
|
232
208
|
component={Link}
|
|
233
209
|
to={item.url}
|
|
234
210
|
sx={{
|
|
235
|
-
textDecoration: 'none'
|
|
211
|
+
textDecoration: 'none'
|
|
236
212
|
}}
|
|
237
213
|
>
|
|
238
214
|
{icons && <ItemIcon style={iconSX} />}
|
|
239
215
|
{itemTitle}
|
|
240
216
|
</Typography>
|
|
241
|
-
)
|
|
217
|
+
);
|
|
242
218
|
|
|
243
219
|
// main
|
|
244
220
|
if (item.breadcrumbs !== false) {
|
|
@@ -263,19 +239,9 @@ const Breadcrumbs = ({
|
|
|
263
239
|
</Grid>
|
|
264
240
|
)}
|
|
265
241
|
<Grid item>
|
|
266
|
-
<MuiBreadcrumbs
|
|
267
|
-
aria-label="breadcrumb"
|
|
268
|
-
maxItems={maxItems || 8}
|
|
269
|
-
separator={separatorIcon}
|
|
270
|
-
>
|
|
242
|
+
<MuiBreadcrumbs aria-label="breadcrumb" maxItems={maxItems || 8} separator={separatorIcon}>
|
|
271
243
|
{home !== false && (
|
|
272
|
-
<Typography
|
|
273
|
-
component={Link}
|
|
274
|
-
to="/"
|
|
275
|
-
color="textSecondary"
|
|
276
|
-
variant="h6"
|
|
277
|
-
sx={{ textDecoration: 'none' }}
|
|
278
|
-
>
|
|
244
|
+
<Typography component={Link} to="/" color="textSecondary" variant="h6" sx={{ textDecoration: 'none' }}>
|
|
279
245
|
{icons && <HomeOutlined style={iconSX} />}
|
|
280
246
|
{icon && !icons && <HomeFilled style={{ ...iconSX, marginRight: 0 }} />}
|
|
281
247
|
{(!icon || icons) && home}
|
|
@@ -293,16 +259,16 @@ const Breadcrumbs = ({
|
|
|
293
259
|
</Grid>
|
|
294
260
|
{card === false && divider !== false && <Divider sx={{ mt: 2 }} />}
|
|
295
261
|
</MainCard>
|
|
296
|
-
)
|
|
262
|
+
);
|
|
297
263
|
}
|
|
298
264
|
}
|
|
299
265
|
|
|
300
|
-
return breadcrumbContent
|
|
301
|
-
}
|
|
266
|
+
return breadcrumbContent;
|
|
267
|
+
};
|
|
302
268
|
Breadcrumbs.defaultProps = {
|
|
303
269
|
home: 'Home',
|
|
304
|
-
mode: 'navigation'
|
|
305
|
-
}
|
|
270
|
+
mode: 'navigation'
|
|
271
|
+
};
|
|
306
272
|
|
|
307
273
|
Breadcrumbs.propTypes = {
|
|
308
274
|
home: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
@@ -318,7 +284,7 @@ Breadcrumbs.propTypes = {
|
|
|
318
284
|
titleBottom: PropTypes.bool,
|
|
319
285
|
sx: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
320
286
|
breadcrumbs: PropTypes.arrayOf(MenuPropTypes),
|
|
321
|
-
mode: PropTypes.oneOf(['navigation', 'breadcrumbs'])
|
|
322
|
-
}
|
|
287
|
+
mode: PropTypes.oneOf(['navigation', 'breadcrumbs'])
|
|
288
|
+
};
|
|
323
289
|
|
|
324
|
-
export default Breadcrumbs
|
|
290
|
+
export default Breadcrumbs;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Box } from '@mui/material'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import getColors from '../../themes/getColors'
|
|
4
|
-
import { useTheme } from '@mui/material/styles'
|
|
1
|
+
import { Box } from '@mui/material';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import getColors from '../../themes/getColors';
|
|
4
|
+
import { useTheme } from '@mui/material/styles';
|
|
5
5
|
|
|
6
6
|
const Dot = ({ color, size, variant, sx }) => {
|
|
7
|
-
const theme = useTheme()
|
|
8
|
-
const colors = getColors(theme, color || 'primary')
|
|
9
|
-
const { main } = colors
|
|
7
|
+
const theme = useTheme();
|
|
8
|
+
const colors = getColors(theme, color || 'primary');
|
|
9
|
+
const { main } = colors;
|
|
10
10
|
|
|
11
11
|
return (
|
|
12
12
|
<Box
|
|
@@ -17,19 +17,19 @@ const Dot = ({ color, size, variant, sx }) => {
|
|
|
17
17
|
borderRadius: '50%',
|
|
18
18
|
bgcolor: variant === 'outlined' ? '' : main,
|
|
19
19
|
...(variant === 'outlined' && {
|
|
20
|
-
border: `1px solid ${main}
|
|
20
|
+
border: `1px solid ${main}`
|
|
21
21
|
}),
|
|
22
|
-
...sx
|
|
22
|
+
...sx
|
|
23
23
|
}}
|
|
24
24
|
/>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
27
|
|
|
28
28
|
Dot.propTypes = {
|
|
29
29
|
color: PropTypes.string,
|
|
30
30
|
size: PropTypes.number,
|
|
31
31
|
variant: PropTypes.string,
|
|
32
|
-
sx: PropTypes.oneOfType([PropTypes.object, PropTypes.string])
|
|
33
|
-
}
|
|
32
|
+
sx: PropTypes.oneOfType([PropTypes.object, PropTypes.string])
|
|
33
|
+
};
|
|
34
34
|
|
|
35
|
-
export default Dot
|
|
35
|
+
export default Dot;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { alpha, styled, useTheme } from '@mui/material/styles'
|
|
1
|
+
import { alpha, styled, useTheme } from '@mui/material/styles';
|
|
2
2
|
|
|
3
|
-
import MuiIconButton from '@mui/material/IconButton'
|
|
4
|
-
import PropTypes from 'prop-types'
|
|
5
|
-
import { forwardRef } from 'react'
|
|
6
|
-
import getColors from '../../themes/getColors'
|
|
7
|
-
import getShadow from '../../themes/getShadow'
|
|
3
|
+
import MuiIconButton from '@mui/material/IconButton';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import getColors from '../../themes/getColors';
|
|
7
|
+
import getShadow from '../../themes/getShadow';
|
|
8
8
|
|
|
9
9
|
function getColorStyle({ variant, theme, color }) {
|
|
10
|
-
const colors = getColors(theme, color)
|
|
11
|
-
const { lighter, light, dark, main, contrastText } = colors
|
|
10
|
+
const colors = getColors(theme, color);
|
|
11
|
+
const { lighter, light, dark, main, contrastText } = colors;
|
|
12
12
|
|
|
13
|
-
const buttonShadow = `${color}Button
|
|
14
|
-
const shadows = getShadow(theme, buttonShadow)
|
|
13
|
+
const buttonShadow = `${color}Button`;
|
|
14
|
+
const shadows = getShadow(theme, buttonShadow);
|
|
15
15
|
|
|
16
16
|
const commonShadow = {
|
|
17
17
|
'&::after': {
|
|
18
|
-
boxShadow: `0 0 6px 6px ${alpha(main, 0.9)}
|
|
18
|
+
boxShadow: `0 0 6px 6px ${alpha(main, 0.9)}`
|
|
19
19
|
},
|
|
20
20
|
'&:active::after': {
|
|
21
|
-
boxShadow: `0 0 0 0 ${alpha(main, 0.9)}
|
|
21
|
+
boxShadow: `0 0 0 0 ${alpha(main, 0.9)}`
|
|
22
22
|
},
|
|
23
23
|
'&:focus-visible': {
|
|
24
24
|
outline: `2px solid ${dark}`,
|
|
25
|
-
outlineOffset: 2
|
|
26
|
-
}
|
|
27
|
-
}
|
|
25
|
+
outlineOffset: 2
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
28
|
|
|
29
29
|
switch (variant) {
|
|
30
30
|
case 'contained':
|
|
@@ -32,19 +32,19 @@ function getColorStyle({ variant, theme, color }) {
|
|
|
32
32
|
color: contrastText,
|
|
33
33
|
backgroundColor: main,
|
|
34
34
|
'&:hover': {
|
|
35
|
-
backgroundColor: dark
|
|
35
|
+
backgroundColor: dark
|
|
36
36
|
},
|
|
37
|
-
...commonShadow
|
|
38
|
-
}
|
|
37
|
+
...commonShadow
|
|
38
|
+
};
|
|
39
39
|
case 'light':
|
|
40
40
|
return {
|
|
41
41
|
color: main,
|
|
42
42
|
backgroundColor: lighter,
|
|
43
43
|
'&:hover': {
|
|
44
|
-
backgroundColor: light
|
|
44
|
+
backgroundColor: light
|
|
45
45
|
},
|
|
46
|
-
...commonShadow
|
|
47
|
-
}
|
|
46
|
+
...commonShadow
|
|
47
|
+
};
|
|
48
48
|
case 'shadow':
|
|
49
49
|
return {
|
|
50
50
|
boxShadow: shadows,
|
|
@@ -52,44 +52,44 @@ function getColorStyle({ variant, theme, color }) {
|
|
|
52
52
|
backgroundColor: main,
|
|
53
53
|
'&:hover': {
|
|
54
54
|
boxShadow: 'none',
|
|
55
|
-
backgroundColor: dark
|
|
55
|
+
backgroundColor: dark
|
|
56
56
|
},
|
|
57
|
-
...commonShadow
|
|
58
|
-
}
|
|
57
|
+
...commonShadow
|
|
58
|
+
};
|
|
59
59
|
case 'outlined':
|
|
60
60
|
return {
|
|
61
61
|
'&:hover': {
|
|
62
62
|
backgroundColor: 'transparent',
|
|
63
63
|
color: dark,
|
|
64
|
-
borderColor: dark
|
|
64
|
+
borderColor: dark
|
|
65
65
|
},
|
|
66
|
-
...commonShadow
|
|
67
|
-
}
|
|
66
|
+
...commonShadow
|
|
67
|
+
};
|
|
68
68
|
case 'dashed':
|
|
69
69
|
return {
|
|
70
70
|
backgroundColor: lighter,
|
|
71
71
|
'&:hover': {
|
|
72
72
|
color: dark,
|
|
73
|
-
borderColor: dark
|
|
73
|
+
borderColor: dark
|
|
74
74
|
},
|
|
75
|
-
...commonShadow
|
|
76
|
-
}
|
|
75
|
+
...commonShadow
|
|
76
|
+
};
|
|
77
77
|
case 'text':
|
|
78
78
|
default:
|
|
79
79
|
return {
|
|
80
80
|
'&:hover': {
|
|
81
81
|
color: dark,
|
|
82
|
-
backgroundColor: lighter
|
|
82
|
+
backgroundColor: lighter
|
|
83
83
|
},
|
|
84
|
-
...commonShadow
|
|
85
|
-
}
|
|
84
|
+
...commonShadow
|
|
85
|
+
};
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
// ==============================|| STYLED - ICON BUTTON ||============================== //
|
|
90
90
|
|
|
91
91
|
const IconButtonStyle = styled(MuiIconButton, {
|
|
92
|
-
shouldForwardProp: (prop) => prop !== 'variant' && prop !== 'shape'
|
|
92
|
+
shouldForwardProp: (prop) => prop !== 'variant' && prop !== 'shape'
|
|
93
93
|
})(({ theme, variant, shape, color }) => ({
|
|
94
94
|
position: 'relative',
|
|
95
95
|
'::after': {
|
|
@@ -102,7 +102,7 @@ const IconButtonStyle = styled(MuiIconButton, {
|
|
|
102
102
|
height: '100%',
|
|
103
103
|
borderRadius: shape === 'rounded' ? '50%' : 4,
|
|
104
104
|
opacity: 0,
|
|
105
|
-
transition: 'all 0.5s'
|
|
105
|
+
transition: 'all 0.5s'
|
|
106
106
|
},
|
|
107
107
|
|
|
108
108
|
':active::after': {
|
|
@@ -111,56 +111,46 @@ const IconButtonStyle = styled(MuiIconButton, {
|
|
|
111
111
|
left: 0,
|
|
112
112
|
top: 0,
|
|
113
113
|
opacity: 1,
|
|
114
|
-
transition: '0s'
|
|
114
|
+
transition: '0s'
|
|
115
115
|
},
|
|
116
116
|
...(shape === 'rounded' && {
|
|
117
|
-
borderRadius: '50%'
|
|
117
|
+
borderRadius: '50%'
|
|
118
118
|
}),
|
|
119
119
|
...(variant === 'outlined' && {
|
|
120
120
|
border: '1px solid',
|
|
121
|
-
borderColor: 'inherit'
|
|
121
|
+
borderColor: 'inherit'
|
|
122
122
|
}),
|
|
123
123
|
...(variant === 'dashed' && {
|
|
124
124
|
border: '1px dashed',
|
|
125
|
-
borderColor: 'inherit'
|
|
125
|
+
borderColor: 'inherit'
|
|
126
126
|
}),
|
|
127
127
|
...(variant !== 'text' && {
|
|
128
128
|
'&.Mui-disabled': {
|
|
129
|
-
backgroundColor: theme.palette.grey[200]
|
|
130
|
-
}
|
|
129
|
+
backgroundColor: theme.palette.grey[200]
|
|
130
|
+
}
|
|
131
131
|
}),
|
|
132
|
-
...getColorStyle({ variant, theme, color })
|
|
133
|
-
}))
|
|
132
|
+
...getColorStyle({ variant, theme, color })
|
|
133
|
+
}));
|
|
134
134
|
|
|
135
135
|
// ==============================|| EXTENDED - ICON BUTTON ||============================== //
|
|
136
136
|
|
|
137
|
-
const IconButton = forwardRef(
|
|
138
|
-
|
|
139
|
-
const theme = useTheme()
|
|
137
|
+
const IconButton = forwardRef(({ variant = 'text', shape = 'square', children, color = 'primary', ...others }, ref) => {
|
|
138
|
+
const theme = useTheme();
|
|
140
139
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
theme={theme}
|
|
148
|
-
color={color}
|
|
149
|
-
{...others}
|
|
150
|
-
>
|
|
151
|
-
{children}
|
|
152
|
-
</IconButtonStyle>
|
|
153
|
-
)
|
|
154
|
-
},
|
|
155
|
-
)
|
|
140
|
+
return (
|
|
141
|
+
<IconButtonStyle ref={ref} disableRipple variant={variant} shape={shape} theme={theme} color={color} {...others}>
|
|
142
|
+
{children}
|
|
143
|
+
</IconButtonStyle>
|
|
144
|
+
);
|
|
145
|
+
});
|
|
156
146
|
|
|
157
147
|
IconButton.propTypes = {
|
|
158
148
|
variant: PropTypes.string,
|
|
159
149
|
shape: PropTypes.string,
|
|
160
150
|
children: PropTypes.node,
|
|
161
|
-
color: PropTypes.string
|
|
162
|
-
}
|
|
151
|
+
color: PropTypes.string
|
|
152
|
+
};
|
|
163
153
|
|
|
164
|
-
IconButton.displayName = 'IconButton'
|
|
154
|
+
IconButton.displayName = 'IconButton';
|
|
165
155
|
|
|
166
|
-
export default IconButton
|
|
156
|
+
export default IconButton;
|