@nethru/ui 1.0.0
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/README.md +28 -0
- package/dist/Accordion.js +41 -0
- package/dist/AccordionDetails.js +15 -0
- package/dist/AccordionSummary.js +25 -0
- package/dist/AlertDialog.js +48 -0
- package/dist/AppBar.js +64 -0
- package/dist/Checkbox.js +17 -0
- package/dist/ConfirmDialog.js +54 -0
- package/dist/DataGrid.js +129 -0
- package/dist/Dialog.js +26 -0
- package/dist/FormLabel.js +18 -0
- package/dist/Frame.js +43 -0
- package/dist/GroupSelect.js +65 -0
- package/dist/ListItem.js +19 -0
- package/dist/ListItemDivider.js +13 -0
- package/dist/ListItemGrid.js +12 -0
- package/dist/ListItemText.js +35 -0
- package/dist/MainHeader.js +56 -0
- package/dist/SearchTextField.js +22 -0
- package/dist/Section.js +17 -0
- package/dist/Select.js +40 -0
- package/dist/Slider.js +31 -0
- package/dist/Snackbar.js +44 -0
- package/dist/StatusChip.js +19 -0
- package/dist/Switch.js +32 -0
- package/dist/TextField.js +23 -0
- package/dist/error/Error.js +63 -0
- package/dist/error/HttpError.js +33 -0
- package/dist/index.js +29 -0
- package/dist/samples/global.sample.css +48 -0
- package/dist/samples/menu.sample.json +303 -0
- package/dist/sidebar/MenuToggler.js +18 -0
- package/dist/sidebar/MenuTree.js +95 -0
- package/dist/sidebar/MenuTreeGroup.js +65 -0
- package/dist/sidebar/PrimaryMenu.js +47 -0
- package/dist/sidebar/SecondaryMenu.js +36 -0
- package/dist/sidebar/Sidebar.js +52 -0
- package/dist/sidebar/SidebarContext.js +118 -0
- package/dist/sidebar/css/primary.module.css +80 -0
- package/dist/sidebar/css/sidebar.module.css +50 -0
- package/dist/variables.js +6 -0
- package/package.json +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# <center>Nethru UI</center>
|
|
2
|
+
* * *
|
|
3
|
+
Nethru UI is a wrapper library of [MUI](https://mui.com) components that features our implementation of Google's Material Design system.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Installation
|
|
7
|
+
* * *
|
|
8
|
+
Install the package in your project directory with:
|
|
9
|
+
```
|
|
10
|
+
npm install @nethru/ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Documentation
|
|
16
|
+
* * *
|
|
17
|
+
Visit https://nethru.atlassian.net/wiki/spaces/combuff/overview to view the full documentation.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Examples
|
|
21
|
+
* * *
|
|
22
|
+
Visit https://nethru.atlassian.net/wiki/spaces/combuff/overview to view several examples.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Changelog
|
|
26
|
+
* * *
|
|
27
|
+
The [changelog](https://nethru.atlassian.net/wiki/spaces/combuff/overview) is regularly updated to reflect what's changed in each new release.
|
|
28
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import MuiAccordion from "@mui/material/Accordion";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
const styles = {
|
|
4
|
+
border: '1px solid #eaeaea',
|
|
5
|
+
boxShadow: 'none',
|
|
6
|
+
'.MuiAccordionDetails-root': {
|
|
7
|
+
pt: 0,
|
|
8
|
+
pl: 8,
|
|
9
|
+
pr: 8
|
|
10
|
+
},
|
|
11
|
+
'.MuiFormLabel-root.MuiInputLabel-root': {
|
|
12
|
+
fontSize: '14px'
|
|
13
|
+
},
|
|
14
|
+
'.MuiInputBase-input.MuiInput-input': {
|
|
15
|
+
color: '#555',
|
|
16
|
+
fontSize: '15px'
|
|
17
|
+
},
|
|
18
|
+
'.MuiTabs-root.MuiTabs-vertical': {
|
|
19
|
+
mt: 2
|
|
20
|
+
},
|
|
21
|
+
'.MuiTabs-root.MuiTabs-vertical .MuiButtonBase-root.MuiTab-root': {
|
|
22
|
+
fontSize: '14px',
|
|
23
|
+
minWidth: '32px',
|
|
24
|
+
maxWidth: '32px'
|
|
25
|
+
},
|
|
26
|
+
'.MuiButtonBase-root.MuiToggleButton-root': {
|
|
27
|
+
pt: '1px',
|
|
28
|
+
pb: '1px',
|
|
29
|
+
fontSize: '12px'
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export default function Accordion({
|
|
33
|
+
children,
|
|
34
|
+
...props
|
|
35
|
+
}) {
|
|
36
|
+
return /*#__PURE__*/_jsx(MuiAccordion, {
|
|
37
|
+
sx: styles,
|
|
38
|
+
...props,
|
|
39
|
+
children: children
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import MuiAccordionDetails from "@mui/material/AccordionDetails";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
const styles = {
|
|
4
|
+
mb: 2
|
|
5
|
+
};
|
|
6
|
+
export default function AccordionDetails({
|
|
7
|
+
children,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return /*#__PURE__*/_jsx(MuiAccordionDetails, {
|
|
11
|
+
sx: styles,
|
|
12
|
+
...props,
|
|
13
|
+
children: children
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import MuiAccordionSummary from "@mui/material/AccordionSummary";
|
|
2
|
+
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
3
|
+
import { Typography } from "@mui/material";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export default function AccordionSummary({
|
|
8
|
+
title,
|
|
9
|
+
children,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
13
|
+
children: [title && /*#__PURE__*/_jsx(MuiAccordionSummary, {
|
|
14
|
+
expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
|
|
15
|
+
...props,
|
|
16
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
17
|
+
children: title
|
|
18
|
+
})
|
|
19
|
+
}), !title && /*#__PURE__*/_jsx(MuiAccordionSummary, {
|
|
20
|
+
expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
|
|
21
|
+
...props,
|
|
22
|
+
children: children
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Button, Stack } from "@mui/material";
|
|
2
|
+
import DialogContent from "@mui/material/DialogContent";
|
|
3
|
+
import DialogContentText from "@mui/material/DialogContentText";
|
|
4
|
+
import DialogActions from "@mui/material/DialogActions";
|
|
5
|
+
import Dialog from "./Dialog";
|
|
6
|
+
import CampaignIcon from "@mui/icons-material/Campaign";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export default function AlertDialog({
|
|
10
|
+
open,
|
|
11
|
+
onClose,
|
|
12
|
+
content,
|
|
13
|
+
closeText = '확인'
|
|
14
|
+
}) {
|
|
15
|
+
return /*#__PURE__*/_jsxs(Dialog, {
|
|
16
|
+
contentFontSize: 15,
|
|
17
|
+
open: open,
|
|
18
|
+
onClose: onClose,
|
|
19
|
+
children: [/*#__PURE__*/_jsx(DialogContent, {
|
|
20
|
+
children: /*#__PURE__*/_jsxs(Stack, {
|
|
21
|
+
direction: "row",
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
gap: 2,
|
|
24
|
+
children: [/*#__PURE__*/_jsx(CampaignIcon, {
|
|
25
|
+
sx: {
|
|
26
|
+
color: '#777',
|
|
27
|
+
'&': {
|
|
28
|
+
fontSize: 50
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}), /*#__PURE__*/_jsx(DialogContentText, {
|
|
32
|
+
children: content
|
|
33
|
+
})]
|
|
34
|
+
})
|
|
35
|
+
}), /*#__PURE__*/_jsx(DialogActions, {
|
|
36
|
+
sx: {
|
|
37
|
+
mt: 0,
|
|
38
|
+
mb: 1,
|
|
39
|
+
justifyContent: 'center'
|
|
40
|
+
},
|
|
41
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
42
|
+
variant: "contained",
|
|
43
|
+
onClick: onClose,
|
|
44
|
+
children: closeText
|
|
45
|
+
})
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
}
|
package/dist/AppBar.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Box, Divider, Stack, Toolbar, Typography } from "@mui/material";
|
|
2
|
+
import MuiAppBar from "@mui/material/AppBar";
|
|
3
|
+
import { grey } from "@mui/material/colors";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export default function AppBar({
|
|
7
|
+
title,
|
|
8
|
+
logoUri,
|
|
9
|
+
onLogoClick,
|
|
10
|
+
children
|
|
11
|
+
}) {
|
|
12
|
+
const appbarStyles = {
|
|
13
|
+
boxShadow: 'none',
|
|
14
|
+
borderBottom: `1px solid ${grey[300]}`,
|
|
15
|
+
'@media (min-width: 600px)': {
|
|
16
|
+
'.MuiToolbar-root': {
|
|
17
|
+
paddingLeft: '16px',
|
|
18
|
+
paddingRight: '16px'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const logoStyles = {
|
|
23
|
+
width: 37,
|
|
24
|
+
height: 32,
|
|
25
|
+
cursor: onLogoClick ? 'pointer' : 'default'
|
|
26
|
+
};
|
|
27
|
+
const dividerStyles = {
|
|
28
|
+
borderColor: grey[200],
|
|
29
|
+
mt: 2,
|
|
30
|
+
mb: 2,
|
|
31
|
+
ml: 2,
|
|
32
|
+
mr: 1
|
|
33
|
+
};
|
|
34
|
+
return /*#__PURE__*/_jsx(MuiAppBar, {
|
|
35
|
+
color: "transparent",
|
|
36
|
+
sx: appbarStyles,
|
|
37
|
+
children: /*#__PURE__*/_jsxs(Toolbar, {
|
|
38
|
+
children: [/*#__PURE__*/_jsxs(Stack, {
|
|
39
|
+
spacing: 1,
|
|
40
|
+
direction: "row",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
43
|
+
component: "img",
|
|
44
|
+
src: logoUri,
|
|
45
|
+
alt: "logo",
|
|
46
|
+
onClick: onLogoClick,
|
|
47
|
+
sx: logoStyles
|
|
48
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
49
|
+
noWrap: true,
|
|
50
|
+
sx: {
|
|
51
|
+
color: 'text.secondary',
|
|
52
|
+
cursor: 'default'
|
|
53
|
+
},
|
|
54
|
+
children: title
|
|
55
|
+
})]
|
|
56
|
+
}), /*#__PURE__*/_jsx(Divider, {
|
|
57
|
+
orientation: "vertical",
|
|
58
|
+
variant: "middle",
|
|
59
|
+
sx: dividerStyles,
|
|
60
|
+
flexItem: true
|
|
61
|
+
}), children]
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
package/dist/Checkbox.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import MuiCheckbox from "@mui/material/Checkbox";
|
|
2
|
+
import { FormControlLabel } from "@mui/material";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export default function Checkbox({
|
|
5
|
+
label,
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
8
|
+
return /*#__PURE__*/_jsx(FormControlLabel, {
|
|
9
|
+
label: label,
|
|
10
|
+
control: /*#__PURE__*/_jsx(MuiCheckbox, {
|
|
11
|
+
...props
|
|
12
|
+
}),
|
|
13
|
+
sx: {
|
|
14
|
+
mr: 5
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Button, Stack } from "@mui/material";
|
|
2
|
+
import DialogContent from "@mui/material/DialogContent";
|
|
3
|
+
import DialogContentText from "@mui/material/DialogContentText";
|
|
4
|
+
import DialogActions from "@mui/material/DialogActions";
|
|
5
|
+
import Dialog from "./Dialog";
|
|
6
|
+
import CampaignIcon from "@mui/icons-material/Campaign";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export default function ConfirmDialog({
|
|
10
|
+
open,
|
|
11
|
+
onConfirm,
|
|
12
|
+
onCancel,
|
|
13
|
+
content,
|
|
14
|
+
confirmText = '예',
|
|
15
|
+
cancelText = '아니오'
|
|
16
|
+
}) {
|
|
17
|
+
return /*#__PURE__*/_jsxs(Dialog, {
|
|
18
|
+
contentFontSize: 15,
|
|
19
|
+
open: open,
|
|
20
|
+
onClose: onCancel,
|
|
21
|
+
children: [/*#__PURE__*/_jsx(DialogContent, {
|
|
22
|
+
children: /*#__PURE__*/_jsxs(Stack, {
|
|
23
|
+
direction: "row",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
gap: 2,
|
|
26
|
+
children: [/*#__PURE__*/_jsx(CampaignIcon, {
|
|
27
|
+
sx: {
|
|
28
|
+
color: '#777',
|
|
29
|
+
'&': {
|
|
30
|
+
fontSize: 50
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}), /*#__PURE__*/_jsx(DialogContentText, {
|
|
34
|
+
children: content
|
|
35
|
+
})]
|
|
36
|
+
})
|
|
37
|
+
}), /*#__PURE__*/_jsxs(DialogActions, {
|
|
38
|
+
sx: {
|
|
39
|
+
mt: 0,
|
|
40
|
+
mb: 1
|
|
41
|
+
},
|
|
42
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
43
|
+
variant: "contained",
|
|
44
|
+
onClick: onConfirm,
|
|
45
|
+
autoFocus: true,
|
|
46
|
+
children: confirmText
|
|
47
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
48
|
+
variant: "outlined",
|
|
49
|
+
onClick: onCancel,
|
|
50
|
+
children: cancelText
|
|
51
|
+
})]
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
}
|
package/dist/DataGrid.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { DataGrid as MuiDataGrid, GridCell, GridToolbarQuickFilter, koKR } from "@mui/x-data-grid";
|
|
3
|
+
import { Box, Stack } from "@mui/material";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const styles = {
|
|
8
|
+
borderLeft: '0px',
|
|
9
|
+
borderRight: '0px',
|
|
10
|
+
'&.MuiDataGrid-root': {
|
|
11
|
+
borderTop: 'none',
|
|
12
|
+
borderBottom: 'none'
|
|
13
|
+
},
|
|
14
|
+
'.MuiDataGrid-columnSeparator': {
|
|
15
|
+
visibility: 'hidden !important'
|
|
16
|
+
},
|
|
17
|
+
'.MuiDataGrid-columnHeaders': {
|
|
18
|
+
//borderBottom: 'none !important'
|
|
19
|
+
},
|
|
20
|
+
'.MuiDataGrid-columnHeader.borderTop': {
|
|
21
|
+
borderTop: '1px solid rgba(224, 224, 224, 1)'
|
|
22
|
+
},
|
|
23
|
+
'&.MuiDataGrid-root .MuiDataGrid-columnHeader:focus, &.MuiDataGrid-root .MuiDataGrid-cell:focus': {
|
|
24
|
+
outline: 'none !important'
|
|
25
|
+
},
|
|
26
|
+
'&.MuiDataGrid-root .MuiDataGrid-columnHeader:focus-within, &.MuiDataGrid-root .MuiDataGrid-cell:focus-within': {
|
|
27
|
+
outline: 'none !important'
|
|
28
|
+
},
|
|
29
|
+
'.MuiDataGrid-row.odd': {
|
|
30
|
+
backgroundColor: 'rgba(0, 0, 0, 0.01)'
|
|
31
|
+
},
|
|
32
|
+
'.MuiDataGrid-row.odd:hover': {
|
|
33
|
+
backgroundColor: 'rgba(0, 0, 0, 0.04)'
|
|
34
|
+
},
|
|
35
|
+
'.MuiDataGrid-cell:hover': {
|
|
36
|
+
backgroundColor: 'rgba(0, 0, 0, 0.01)'
|
|
37
|
+
},
|
|
38
|
+
'.MuiDataGrid-row .MuiDataGrid-cell.actions > *, .MuiDataGrid-row .MuiDataGrid-cell .actions > *': {
|
|
39
|
+
visibility: 'hidden'
|
|
40
|
+
},
|
|
41
|
+
'.MuiDataGrid-row:hover .MuiDataGrid-cell.actions > *, .MuiDataGrid-row:hover .MuiDataGrid-cell .actions > *': {
|
|
42
|
+
visibility: 'visible'
|
|
43
|
+
},
|
|
44
|
+
'.MuiDataGrid-cell .aggr strong': {
|
|
45
|
+
fontSize: '15px'
|
|
46
|
+
},
|
|
47
|
+
'.MuiDataGrid-cell .aggr small': {
|
|
48
|
+
fontSize: '12px'
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export default function DataGrid({
|
|
52
|
+
columns,
|
|
53
|
+
rows,
|
|
54
|
+
customToolbar = /*#__PURE__*/_jsx(_Fragment, {}),
|
|
55
|
+
customGridCellMap = {},
|
|
56
|
+
slots = {},
|
|
57
|
+
hideToolbar = false,
|
|
58
|
+
...props
|
|
59
|
+
}) {
|
|
60
|
+
const getTogglableColumns = columns => columns.filter(column => column.field !== 'id').map(column => column.field);
|
|
61
|
+
const [columnVisibilityModel, setColumnVisibilityModel] = useState({
|
|
62
|
+
id: false
|
|
63
|
+
});
|
|
64
|
+
const CustomToolbar = function () {
|
|
65
|
+
return /*#__PURE__*/_jsxs(Stack, {
|
|
66
|
+
direction: "row",
|
|
67
|
+
justifyContent: "space-between",
|
|
68
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
69
|
+
children: customToolbar
|
|
70
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
71
|
+
children: /*#__PURE__*/_jsx(GridToolbarQuickFilter, {})
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
const CustomGridCell = function (params) {
|
|
76
|
+
let children;
|
|
77
|
+
const func = customGridCellMap[params.column.field];
|
|
78
|
+
if (func) children = func(params);
|
|
79
|
+
if (!children) children = /*#__PURE__*/_jsx(Box, {
|
|
80
|
+
sx: {
|
|
81
|
+
mt: 2,
|
|
82
|
+
mb: 2
|
|
83
|
+
},
|
|
84
|
+
children: params.value
|
|
85
|
+
});
|
|
86
|
+
return /*#__PURE__*/_jsx(GridCell, {
|
|
87
|
+
...params,
|
|
88
|
+
children: children
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
return /*#__PURE__*/_jsx(MuiDataGrid, {
|
|
92
|
+
autoHeight: true,
|
|
93
|
+
columns: columns,
|
|
94
|
+
rows: rows,
|
|
95
|
+
disableColumnMenu: true,
|
|
96
|
+
disableRowSelectionOnClick: true,
|
|
97
|
+
getRowClassName: params => params.indexRelativeToCurrentPage % 2 === 0 ? '' : 'odd',
|
|
98
|
+
columnVisibilityModel: columnVisibilityModel,
|
|
99
|
+
onColumnVisibilityModelChange: model => setColumnVisibilityModel(model),
|
|
100
|
+
getRowHeight: () => 'auto',
|
|
101
|
+
localeText: {
|
|
102
|
+
...koKR.components.MuiDataGrid.defaultProps.localeText,
|
|
103
|
+
noRowsLabel: '항목이 없습니다.'
|
|
104
|
+
},
|
|
105
|
+
slots: {
|
|
106
|
+
toolbar: hideToolbar ? null : CustomToolbar,
|
|
107
|
+
cell: CustomGridCell,
|
|
108
|
+
...slots
|
|
109
|
+
},
|
|
110
|
+
slotProps: {
|
|
111
|
+
columnsPanel: {
|
|
112
|
+
getTogglableColumns
|
|
113
|
+
},
|
|
114
|
+
toolbar: {
|
|
115
|
+
showQuickFilter: true
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
initialState: {
|
|
119
|
+
filter: {
|
|
120
|
+
filterModel: {
|
|
121
|
+
items: [],
|
|
122
|
+
quickFilterExcludeHiddenColumns: true
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
sx: styles,
|
|
127
|
+
...props
|
|
128
|
+
});
|
|
129
|
+
}
|
package/dist/Dialog.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Zoom } from "@mui/material";
|
|
2
|
+
import MuiDialog from "@mui/material/Dialog";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
const Transition = /*#__PURE__*/forwardRef(function Transition(props, ref) {
|
|
6
|
+
return /*#__PURE__*/_jsx(Zoom, {
|
|
7
|
+
ref: ref,
|
|
8
|
+
...props
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
export default function Dialog({
|
|
12
|
+
contentFontSize = 16,
|
|
13
|
+
children,
|
|
14
|
+
...props
|
|
15
|
+
}) {
|
|
16
|
+
return /*#__PURE__*/_jsx(MuiDialog, {
|
|
17
|
+
TransitionComponent: Transition,
|
|
18
|
+
sx: {
|
|
19
|
+
'.MuiTypography-root.MuiDialogContentText-root': {
|
|
20
|
+
fontSize: contentFontSize
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
...props,
|
|
24
|
+
children: children
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import MuiFormLabel from "@mui/material/FormLabel";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export default function FormLabel({
|
|
5
|
+
value = false,
|
|
6
|
+
children,
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
9
|
+
const styles = {
|
|
10
|
+
color: value ? 'rgba(0, 0, 0, 0.87)' : 'rgba(0, 0, 0, 0.6)',
|
|
11
|
+
fontSize: value ? 16 : 14
|
|
12
|
+
};
|
|
13
|
+
return /*#__PURE__*/_jsx(MuiFormLabel, {
|
|
14
|
+
sx: styles,
|
|
15
|
+
...props,
|
|
16
|
+
children: children
|
|
17
|
+
});
|
|
18
|
+
}
|
package/dist/Frame.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Outlet } from 'react-router-dom';
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import { SidebarContextProvider } from './sidebar/SidebarContext';
|
|
4
|
+
import Sidebar from "./sidebar/Sidebar";
|
|
5
|
+
import { variables } from './variables';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
+
export default function Frame({
|
|
10
|
+
appBar,
|
|
11
|
+
footer,
|
|
12
|
+
menu,
|
|
13
|
+
menuIcons = {}
|
|
14
|
+
}) {
|
|
15
|
+
const containerStyles = {
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexGrow: 1,
|
|
18
|
+
overflow: 'auto',
|
|
19
|
+
marginTop: `${variables.gnbHeight}px`,
|
|
20
|
+
backgroundColor: variables.bodyBackgroundColor
|
|
21
|
+
};
|
|
22
|
+
const contentStyles = {
|
|
23
|
+
flexGrow: 1,
|
|
24
|
+
overflow: 'auto',
|
|
25
|
+
padding: '20px 40px'
|
|
26
|
+
};
|
|
27
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
28
|
+
children: [appBar, /*#__PURE__*/_jsxs(Box, {
|
|
29
|
+
sx: containerStyles,
|
|
30
|
+
children: [/*#__PURE__*/_jsx(SidebarContextProvider, {
|
|
31
|
+
menu: menu,
|
|
32
|
+
icons: menuIcons,
|
|
33
|
+
children: /*#__PURE__*/_jsx(Sidebar, {})
|
|
34
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
35
|
+
component: "section",
|
|
36
|
+
sx: contentStyles,
|
|
37
|
+
children: [/*#__PURE__*/_jsx("main", {
|
|
38
|
+
children: /*#__PURE__*/_jsx(Outlet, {})
|
|
39
|
+
}), footer]
|
|
40
|
+
})]
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Autocomplete, TextField } from "@mui/material";
|
|
2
|
+
import Paper from "@mui/material/Paper";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export default function GroupSelect({
|
|
5
|
+
id,
|
|
6
|
+
options,
|
|
7
|
+
groupKey,
|
|
8
|
+
value,
|
|
9
|
+
onSelect,
|
|
10
|
+
placeholder,
|
|
11
|
+
disableClearable = false,
|
|
12
|
+
sx,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
const styles = {
|
|
16
|
+
...sx,
|
|
17
|
+
'.MuiInputLabel-root, .MuiInputBase-input': {
|
|
18
|
+
fontSize: '0.875rem'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const paperStyles = {
|
|
22
|
+
'& .MuiAutocomplete-groupLabel': {
|
|
23
|
+
fontSize: '0.8rem',
|
|
24
|
+
paddingTop: 0,
|
|
25
|
+
paddingBottom: 0
|
|
26
|
+
},
|
|
27
|
+
'& .MuiAutocomplete-option': {
|
|
28
|
+
color: '#333',
|
|
29
|
+
fontSize: '0.875rem',
|
|
30
|
+
paddingTop: '3px',
|
|
31
|
+
paddingBottom: '3px'
|
|
32
|
+
},
|
|
33
|
+
'& .MuiAutocomplete-noOptions': {
|
|
34
|
+
fontSize: '0.8rem'
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const handleSelect = (event, value, reason) => {
|
|
38
|
+
if (reason !== 'selectOption') return;
|
|
39
|
+
if (onSelect) onSelect(id, value);
|
|
40
|
+
};
|
|
41
|
+
function CustomPaper(props) {
|
|
42
|
+
return /*#__PURE__*/_jsx(Paper, {
|
|
43
|
+
...props,
|
|
44
|
+
sx: paperStyles
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return /*#__PURE__*/_jsx(Autocomplete, {
|
|
48
|
+
id: id,
|
|
49
|
+
size: "small",
|
|
50
|
+
options: options,
|
|
51
|
+
groupBy: option => option[groupKey],
|
|
52
|
+
value: value,
|
|
53
|
+
onChange: handleSelect,
|
|
54
|
+
blurOnSelect: true,
|
|
55
|
+
disableClearable: disableClearable,
|
|
56
|
+
noOptionsText: "\uC77C\uCE58\uD558\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
57
|
+
PaperComponent: CustomPaper,
|
|
58
|
+
renderInput: params => /*#__PURE__*/_jsx(TextField, {
|
|
59
|
+
...params,
|
|
60
|
+
label: placeholder
|
|
61
|
+
}),
|
|
62
|
+
sx: styles,
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
package/dist/ListItem.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import MuiListItem from "@mui/material/ListItem";
|
|
2
|
+
import { Grid } from "@mui/material";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
export default function ListItem({
|
|
6
|
+
grid,
|
|
7
|
+
spacing = 10,
|
|
8
|
+
children,
|
|
9
|
+
...props
|
|
10
|
+
}) {
|
|
11
|
+
return /*#__PURE__*/_jsxs(MuiListItem, {
|
|
12
|
+
...props,
|
|
13
|
+
children: [grid && /*#__PURE__*/_jsx(Grid, {
|
|
14
|
+
container: true,
|
|
15
|
+
columnSpacing: spacing,
|
|
16
|
+
children: children
|
|
17
|
+
}), !grid && children]
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Box, Stack, Tooltip } from "@mui/material";
|
|
2
|
+
import MuiListItemText from "@mui/material/ListItemText";
|
|
3
|
+
import HelpIcon from "@mui/icons-material/Help";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export default function ListItemText({
|
|
8
|
+
primary,
|
|
9
|
+
secondary,
|
|
10
|
+
tooltip,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
const [hover, setHover] = useState(false);
|
|
14
|
+
return /*#__PURE__*/_jsx(MuiListItemText, {
|
|
15
|
+
primary: primary,
|
|
16
|
+
secondary: /*#__PURE__*/_jsxs(Stack, {
|
|
17
|
+
direction: "row",
|
|
18
|
+
spacing: 0.5,
|
|
19
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
20
|
+
children: secondary
|
|
21
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
22
|
+
title: tooltip,
|
|
23
|
+
children: /*#__PURE__*/_jsx(HelpIcon, {
|
|
24
|
+
sx: {
|
|
25
|
+
fontSize: 18,
|
|
26
|
+
visibility: tooltip && hover ? 'visible' : 'hidden'
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
})]
|
|
30
|
+
}),
|
|
31
|
+
onMouseEnter: _ => setHover(true),
|
|
32
|
+
onMouseLeave: _ => setHover(false),
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
}
|