@nethru/ui 1.0.82 → 2.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.
Files changed (140) hide show
  1. package/base/AddableFormList.js +56 -0
  2. package/base/Alert.js +27 -0
  3. package/base/Checkbox.js +20 -0
  4. package/base/CircularProgressButton.js +36 -0
  5. package/base/ColumnedSection.js +44 -0
  6. package/base/DropdownButton.js +74 -0
  7. package/base/MainHeader.js +56 -0
  8. package/base/MenuItem.js +92 -0
  9. package/base/PropertyTable.js +69 -0
  10. package/base/SearchTextField.js +44 -0
  11. package/base/SearchableSelect.js +64 -0
  12. package/base/Select.js +33 -0
  13. package/{dist → base}/Slider.js +12 -13
  14. package/base/Snackbar.js +33 -0
  15. package/base/Switch.js +20 -0
  16. package/base/assets/icons.js +390 -0
  17. package/base/assets/images.js +1 -0
  18. package/{dist → base}/colors/blue.js +3 -1
  19. package/{dist → base}/colors/blueGrey.js +1 -1
  20. package/base/datagrid/DataGrid.js +57 -0
  21. package/base/datagrid/Footer.js +51 -0
  22. package/base/datagrid/Pagination.js +24 -0
  23. package/base/dialog/AlertDialog.js +21 -0
  24. package/base/dialog/ConfirmDialog.js +29 -0
  25. package/base/dialog/Dialog.js +56 -0
  26. package/base/dialog/SimpleDialog.js +33 -0
  27. package/{dist → base}/error/Error.js +1 -2
  28. package/base/frame/AppBar.js +54 -0
  29. package/base/frame/Brand.js +36 -0
  30. package/base/frame/Frame.js +49 -0
  31. package/{dist → base/frame}/sidebar/MenuToggler.js +14 -3
  32. package/{dist → base/frame}/sidebar/PrimaryMenu.js +15 -20
  33. package/base/frame/sidebar/SecondaryMenu.js +41 -0
  34. package/{dist → base/frame}/sidebar/Sidebar.js +21 -10
  35. package/base/frame/sidebar/SidebarContext.js +74 -0
  36. package/base/frame/sidebar/css/primary.module.css +69 -0
  37. package/base/frame/sidebar/css/sidebar.module.css +63 -0
  38. package/base/index.js +33 -0
  39. package/{dist → base}/samples/menu.sample.json +2 -2
  40. package/base/styles/borderRadius.js +7 -0
  41. package/base/styles/createTheme.js +90 -0
  42. package/base/styles/globalStyles.js +47 -0
  43. package/base/styles/mui/alert.js +40 -0
  44. package/base/styles/mui/appBar.js +17 -0
  45. package/base/styles/mui/autocomplete.js +46 -0
  46. package/base/styles/mui/avatar.js +14 -0
  47. package/base/styles/mui/button.js +276 -0
  48. package/base/styles/mui/buttonBase.js +10 -0
  49. package/base/styles/mui/checkbox.js +37 -0
  50. package/base/styles/mui/chip.js +83 -0
  51. package/base/styles/mui/cssBaseline.js +12 -0
  52. package/base/styles/mui/dataGrid.js +101 -0
  53. package/base/styles/mui/dialog.js +13 -0
  54. package/base/styles/mui/dialogActions.js +8 -0
  55. package/base/styles/mui/dialogContent.js +10 -0
  56. package/base/styles/mui/dialogTitle.js +11 -0
  57. package/base/styles/mui/formControl.js +8 -0
  58. package/base/styles/mui/formControlLabel.js +9 -0
  59. package/base/styles/mui/formHelperText.js +10 -0
  60. package/base/styles/mui/grid.js +15 -0
  61. package/base/styles/mui/icon.js +12 -0
  62. package/base/styles/mui/iconButton.js +79 -0
  63. package/base/styles/mui/inputLabel.js +13 -0
  64. package/base/styles/mui/list.js +11 -0
  65. package/base/styles/mui/menuItem.js +83 -0
  66. package/base/styles/mui/outlinedInput.js +53 -0
  67. package/base/styles/mui/paginationItem.js +25 -0
  68. package/base/styles/mui/paper.js +8 -0
  69. package/base/styles/mui/popover.js +11 -0
  70. package/base/styles/mui/select.js +11 -0
  71. package/base/styles/mui/slider.js +15 -0
  72. package/base/styles/mui/snackbar.js +24 -0
  73. package/base/styles/mui/switch.js +33 -0
  74. package/base/styles/mui/tab.js +23 -0
  75. package/base/styles/mui/tablePagination.js +8 -0
  76. package/base/styles/mui/tabs.js +20 -0
  77. package/base/styles/mui/textField.js +11 -0
  78. package/base/styles/mui/toggleButton.js +96 -0
  79. package/base/styles/mui/tooltip.js +22 -0
  80. package/base/styles/palette.js +40 -0
  81. package/base/styles/shadow.js +8 -0
  82. package/base/styles/typography.js +131 -0
  83. package/package.json +6 -5
  84. package/dist/Accordion.js +0 -45
  85. package/dist/AccordionDetails.js +0 -19
  86. package/dist/AccordionSummary.js +0 -35
  87. package/dist/AlertDialog.js +0 -55
  88. package/dist/AppBar.js +0 -68
  89. package/dist/AppendableFormList.js +0 -56
  90. package/dist/AvatarDropdown.js +0 -80
  91. package/dist/Button.js +0 -61
  92. package/dist/Checkbox.js +0 -27
  93. package/dist/CircularProgress.js +0 -33
  94. package/dist/ColumnedSection.js +0 -64
  95. package/dist/ConfirmDialog.js +0 -65
  96. package/dist/DataGrid.js +0 -150
  97. package/dist/Dialog.js +0 -42
  98. package/dist/DropdownButton.js +0 -59
  99. package/dist/FormLabel.js +0 -23
  100. package/dist/Frame.js +0 -47
  101. package/dist/GroupSelect.js +0 -67
  102. package/dist/ListItem.js +0 -21
  103. package/dist/ListItemDivider.js +0 -15
  104. package/dist/ListItemGrid.js +0 -12
  105. package/dist/ListItemText.js +0 -44
  106. package/dist/MainHeader.js +0 -59
  107. package/dist/PropertyTable.js +0 -141
  108. package/dist/ReferenceChipList.js +0 -59
  109. package/dist/SearchTextField.js +0 -24
  110. package/dist/SearchableSelect.js +0 -41
  111. package/dist/Section.js +0 -22
  112. package/dist/Select.js +0 -48
  113. package/dist/ShadowedSection.js +0 -36
  114. package/dist/Snackbar.js +0 -51
  115. package/dist/StatusChip.js +0 -34
  116. package/dist/Switch.js +0 -37
  117. package/dist/TabbedSection.js +0 -37
  118. package/dist/Tabs.js +0 -38
  119. package/dist/TextField.js +0 -25
  120. package/dist/index.js +0 -44
  121. package/dist/samples/global.sample.css +0 -59
  122. package/dist/sidebar/MenuTree.js +0 -95
  123. package/dist/sidebar/MenuTreeGroup.js +0 -65
  124. package/dist/sidebar/SecondaryMenu.js +0 -36
  125. package/dist/sidebar/SidebarContext.js +0 -122
  126. package/dist/sidebar/css/primary.module.css +0 -80
  127. package/dist/sidebar/css/sidebar.module.css +0 -50
  128. package/dist/variables.js +0 -6
  129. /package/{dist → base}/colors/green.js +0 -0
  130. /package/{dist → base}/colors/grey.js +0 -0
  131. /package/{dist → base}/colors/index.js +0 -0
  132. /package/{dist → base}/colors/lime.js +0 -0
  133. /package/{dist → base}/colors/orange.js +0 -0
  134. /package/{dist → base}/colors/purple.js +0 -0
  135. /package/{dist → base}/colors/red.js +0 -0
  136. /package/{dist → base}/colors/yellow.js +0 -0
  137. /package/{dist → base}/editor/Editor.js +0 -0
  138. /package/{dist → base}/editor/nScript.js +0 -0
  139. /package/{dist → base}/editor/nScriptKeywords.js +0 -0
  140. /package/{dist → base}/error/HttpError.js +0 -0
@@ -1,56 +0,0 @@
1
- import React from "react";
2
- import { Button, IconButton, Stack, Tooltip, Typography } from "@mui/material";
3
- import AddIcon from "@mui/icons-material/Add";
4
- import DeleteIcon from "@mui/icons-material/Delete";
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
- import { Fragment as _Fragment } from "react/jsx-runtime";
8
- export default function AppendableFormList({
9
- gap = 1,
10
- forms,
11
- renderForm,
12
- addOns,
13
- onAppend,
14
- onRemove,
15
- readOnly
16
- }) {
17
- return /*#__PURE__*/_jsxs(Stack, {
18
- gap: gap,
19
- children: [/*#__PURE__*/_jsxs(_Fragment, {
20
- children: [forms.map((form, index) => /*#__PURE__*/_jsxs(Stack, {
21
- direction: "row",
22
- alignItems: "end",
23
- gap: 2,
24
- children: [renderForm(form, index), !readOnly && /*#__PURE__*/_jsx(Tooltip, {
25
- title: "\uC0AD\uC81C",
26
- children: /*#__PURE__*/_jsx(IconButton, {
27
- onClick: _ => onRemove(index),
28
- size: "small",
29
- sx: {
30
- ml: '-10px',
31
- mb: '-5px'
32
- },
33
- children: /*#__PURE__*/_jsx(DeleteIcon, {
34
- fontSize: "small"
35
- })
36
- })
37
- })]
38
- }, index)), forms.length === 0 && /*#__PURE__*/_jsx(Typography, {
39
- variant: "body2",
40
- sx: {
41
- color: '#999'
42
- },
43
- children: "\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"
44
- })]
45
- }), !readOnly && /*#__PURE__*/_jsxs(Stack, {
46
- direction: "row",
47
- gap: 1,
48
- children: [/*#__PURE__*/_jsx(Button, {
49
- variant: "text",
50
- startIcon: /*#__PURE__*/_jsx(AddIcon, {}),
51
- onClick: onAppend,
52
- children: "\uCD94\uAC00"
53
- }), addOns]
54
- })]
55
- });
56
- }
@@ -1,80 +0,0 @@
1
- import { useMemo, useState } from 'react';
2
- import { Avatar, Box, IconButton } from '@mui/material';
3
- import Menu from '@mui/material/Menu';
4
- import MenuItem from '@mui/material/MenuItem';
5
- import ListItemIcon from '@mui/material/ListItemIcon';
6
- import Divider from '@mui/material/Divider';
7
- import LogoutRoundedIcon from '@mui/icons-material/LogoutRounded';
8
- import { red } from '@mui/material/colors';
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- import { jsxs as _jsxs } from "react/jsx-runtime";
11
- export default function AvatarDropdown({
12
- name,
13
- color,
14
- bgcolor,
15
- children,
16
- onProfileClick,
17
- onLogoutClick,
18
- ...props
19
- }) {
20
- const [anchorEl, setAnchorEl] = useState(null);
21
- const open = Boolean(anchorEl);
22
- const firstLetter = useMemo(() => {
23
- return name && name.length > 0 ? name[0].toUpperCase() : "?";
24
- }, [name]);
25
- const handleClick = event => setAnchorEl(event.currentTarget);
26
- const handleClose = () => setAnchorEl(null);
27
- const styles = {
28
- color: color ? color : '#fff',
29
- bgcolor: bgcolor ? bgcolor : red[900],
30
- width: 32,
31
- height: 32,
32
- fontSize: 16
33
- };
34
- return /*#__PURE__*/_jsxs(Box, {
35
- ...props,
36
- children: [/*#__PURE__*/_jsx(IconButton, {
37
- onClick: handleClick,
38
- size: "small",
39
- sx: {
40
- ml: 2
41
- },
42
- children: /*#__PURE__*/_jsx(Avatar, {
43
- sx: styles,
44
- children: firstLetter
45
- })
46
- }), /*#__PURE__*/_jsxs(Menu, {
47
- anchorEl: anchorEl,
48
- open: open,
49
- onClose: handleClose,
50
- onClick: handleClose,
51
- sx: {
52
- '.MuiButtonBase-root.MuiMenuItem-root': {
53
- fontSize: 14
54
- }
55
- },
56
- children: [/*#__PURE__*/_jsxs(MenuItem, {
57
- onClick: onProfileClick,
58
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
59
- children: /*#__PURE__*/_jsx(Avatar, {
60
- sx: {
61
- ...styles,
62
- mr: 1,
63
- fontSize: 13,
64
- width: 22,
65
- height: 22
66
- },
67
- children: firstLetter
68
- })
69
- }), name]
70
- }), /*#__PURE__*/_jsx(Divider, {}), children, children && /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsxs(MenuItem, {
71
- onClick: onLogoutClick,
72
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
73
- children: /*#__PURE__*/_jsx(LogoutRoundedIcon, {
74
- fontSize: "small"
75
- })
76
- }), "\uB85C\uADF8\uC544\uC6C3"]
77
- })]
78
- })]
79
- });
80
- }
package/dist/Button.js DELETED
@@ -1,61 +0,0 @@
1
- import { useMemo } from "react";
2
- import MuiButton from "@mui/material/Button";
3
- import { Box, CircularProgress, IconButton } from "@mui/material";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- import { jsxs as _jsxs } from "react/jsx-runtime";
6
- export default function Button({
7
- label,
8
- icon,
9
- iconPlacement = 'start',
10
- iconSize = '20px',
11
- iconProps = {},
12
- progressProps = {},
13
- loading = false,
14
- ...props
15
- }) {
16
- const iconComponent = useMemo(() => {
17
- return icon ? /*#__PURE__*/_jsx(Box, {
18
- component: icon,
19
- sx: {
20
- '&.MuiSvgIcon-root': {
21
- fontSize: `${iconSize}!important`
22
- }
23
- },
24
- ...iconProps
25
- }) : null;
26
- }, [icon, iconSize, iconProps]);
27
- const startIcon = useMemo(() => {
28
- return iconPlacement === 'start' ? iconComponent : null;
29
- }, [iconComponent, iconPlacement]);
30
- const endIcon = useMemo(() => {
31
- return iconPlacement === 'end' ? iconComponent : null;
32
- }, [iconComponent, iconPlacement]);
33
- return /*#__PURE__*/_jsxs(Box, {
34
- sx: {
35
- position: 'relative',
36
- width: 'fit-content'
37
- },
38
- children: [label ? /*#__PURE__*/_jsx(MuiButton, {
39
- startIcon: startIcon,
40
- endIcon: endIcon,
41
- disabled: loading,
42
- ...props,
43
- children: label
44
- }) : /*#__PURE__*/_jsx(IconButton, {
45
- disabled: loading,
46
- ...props,
47
- children: iconComponent
48
- }), loading && /*#__PURE__*/_jsx(CircularProgress, {
49
- size: 24,
50
- thickness: 6,
51
- sx: {
52
- position: 'absolute',
53
- top: '50%',
54
- left: '50%',
55
- marginTop: '-12px',
56
- marginLeft: '-12px'
57
- },
58
- ...progressProps
59
- })]
60
- });
61
- }
package/dist/Checkbox.js DELETED
@@ -1,27 +0,0 @@
1
- import { useMemo } from "react";
2
- import MuiCheckbox from "@mui/material/Checkbox";
3
- import { FormControlLabel } from "@mui/material";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- export default function Checkbox({
6
- label,
7
- size = 'medium',
8
- sx,
9
- ...props
10
- }) {
11
- const styles = useMemo(() => ({
12
- '& .MuiFormControlLabel-label': {
13
- fontSize: size === 'small' ? '14px' : '16px'
14
- }
15
- }), [size]);
16
- return /*#__PURE__*/_jsx(FormControlLabel, {
17
- label: label,
18
- control: /*#__PURE__*/_jsx(MuiCheckbox, {
19
- size: size,
20
- ...props
21
- }),
22
- sx: {
23
- ...styles,
24
- ...sx
25
- }
26
- });
27
- }
@@ -1,33 +0,0 @@
1
- import { Box, Typography } from "@mui/material";
2
- import MuiCircularProgress from "@mui/material/CircularProgress";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- import { jsxs as _jsxs } from "react/jsx-runtime";
5
- export default function CircularProgress(props) {
6
- return /*#__PURE__*/_jsxs(Box, {
7
- sx: {
8
- position: 'relative',
9
- display: 'inline-flex'
10
- },
11
- children: [/*#__PURE__*/_jsx(MuiCircularProgress, {
12
- variant: "determinate",
13
- ...props
14
- }), /*#__PURE__*/_jsx(Box, {
15
- sx: {
16
- top: 0,
17
- left: 0,
18
- bottom: 0,
19
- right: 0,
20
- position: 'absolute',
21
- display: 'flex',
22
- alignItems: 'center',
23
- justifyContent: 'center'
24
- },
25
- children: /*#__PURE__*/_jsx(Typography, {
26
- variant: "caption",
27
- component: "div",
28
- color: "text.secondary",
29
- children: `${Math.round(props.value)}%`
30
- })
31
- })]
32
- });
33
- }
@@ -1,64 +0,0 @@
1
- import { List, Stack } from "@mui/material";
2
- import ListItem from "./ListItem";
3
- import ListItemGrid from "./ListItemGrid";
4
- import { useMemo } from "react";
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
- export default function ColumnedSection({
8
- columns,
9
- labels = [],
10
- contents = [],
11
- horizontalGap = 1,
12
- verticalGap = 0.5,
13
- sx
14
- }) {
15
- const width = useMemo(() => {
16
- return `${100 / columns}%`;
17
- }, [columns]);
18
- const styles = useMemo(() => {
19
- return {
20
- width: width,
21
- bgcolor: '#f8f9fa',
22
- p: '10px 20px',
23
- borderRadius: '7px'
24
- };
25
- }, [width]);
26
- return /*#__PURE__*/_jsx(List, {
27
- children: /*#__PURE__*/_jsxs(ListItem, {
28
- grid: true,
29
- children: [labels.length > 0 && /*#__PURE__*/_jsx(ListItemGrid, {
30
- xs: 12,
31
- children: /*#__PURE__*/_jsx(Stack, {
32
- direction: "row",
33
- gap: horizontalGap,
34
- children: labels.map((label, index) => /*#__PURE__*/_jsx(Stack, {
35
- gap: verticalGap,
36
- sx: {
37
- width: width
38
- },
39
- children: /*#__PURE__*/_jsx(Stack, {
40
- direction: "row",
41
- alignItems: "baseline",
42
- spacing: 1,
43
- children: label
44
- })
45
- }, index))
46
- })
47
- }), /*#__PURE__*/_jsx(ListItemGrid, {
48
- xs: 12,
49
- children: /*#__PURE__*/_jsx(Stack, {
50
- direction: "row",
51
- gap: horizontalGap,
52
- children: contents.map((content, index) => /*#__PURE__*/_jsx(Stack, {
53
- gap: verticalGap,
54
- sx: {
55
- ...styles,
56
- ...sx
57
- },
58
- children: content
59
- }, index))
60
- })
61
- })]
62
- })
63
- });
64
- }
@@ -1,65 +0,0 @@
1
- import { Box, 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
- fullWidth: true,
19
- contentFontSize: 15,
20
- open: open,
21
- onClose: onCancel,
22
- children: [/*#__PURE__*/_jsx(DialogContent, {
23
- sx: {
24
- pt: 4
25
- },
26
- children: /*#__PURE__*/_jsxs(Stack, {
27
- direction: "row",
28
- alignItems: "center",
29
- gap: 2,
30
- children: [/*#__PURE__*/_jsx(CampaignIcon, {
31
- sx: {
32
- color: '#777',
33
- '&': {
34
- fontSize: 50
35
- }
36
- }
37
- }), /*#__PURE__*/_jsx(DialogContentText, {
38
- component: "div",
39
- children: /*#__PURE__*/_jsx(Box, {
40
- component: "div",
41
- sx: {
42
- whiteSpace: 'pre-wrap'
43
- },
44
- children: content.replace(/(\\n)/g, '\n')
45
- })
46
- })]
47
- })
48
- }), /*#__PURE__*/_jsxs(DialogActions, {
49
- sx: {
50
- mr: 1.5,
51
- mb: 1
52
- },
53
- children: [/*#__PURE__*/_jsx(Button, {
54
- variant: "contained",
55
- onClick: onConfirm,
56
- autoFocus: true,
57
- children: confirmText
58
- }), /*#__PURE__*/_jsx(Button, {
59
- variant: "outlined",
60
- onClick: onCancel,
61
- children: cancelText
62
- })]
63
- })]
64
- });
65
- }
package/dist/DataGrid.js DELETED
@@ -1,150 +0,0 @@
1
- import { useState } from "react";
2
- import { DataGridPro as MuiDataGridPro, GRID_CHECKBOX_SELECTION_COL_DEF, GridCell, GridToolbarQuickFilter, koKR } from "@mui/x-data-grid-pro";
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
- slotProps,
58
- initialState,
59
- hideToolbar = false,
60
- localText,
61
- sx,
62
- ...props
63
- }) {
64
- const getTogglableColumns = columns => columns.filter(column => column.field !== 'id').map(column => column.field);
65
- const [columnVisibilityModel, setColumnVisibilityModel] = useState({
66
- id: false
67
- });
68
- const CustomToolbar = function () {
69
- return /*#__PURE__*/_jsxs(Stack, {
70
- direction: "row",
71
- justifyContent: "space-between",
72
- children: [/*#__PURE__*/_jsx(Box, {
73
- children: customToolbar
74
- }), /*#__PURE__*/_jsx(Box, {
75
- children: /*#__PURE__*/_jsx(GridToolbarQuickFilter, {})
76
- })]
77
- });
78
- };
79
- const CustomGridCell = function (params) {
80
- if (props && props.checkboxSelection && params.column.field === GRID_CHECKBOX_SELECTION_COL_DEF.field) return /*#__PURE__*/_jsx(GridCell, {
81
- ...params
82
- });
83
- let children;
84
- const func = customGridCellMap[params.column.field];
85
- if (func) children = func(params);
86
- if (!children) children = /*#__PURE__*/_jsx(Box, {
87
- sx: {
88
- mt: 2,
89
- mb: 2
90
- },
91
- children: params.formattedValue
92
- });
93
- return /*#__PURE__*/_jsx(GridCell, {
94
- ...params,
95
- children: children
96
- });
97
- };
98
- return /*#__PURE__*/_jsx(MuiDataGridPro, {
99
- columns: columns,
100
- rows: rows,
101
- autoHeight: true,
102
- pagination: true,
103
- disableColumnMenu: true,
104
- disableColumnReorder: true,
105
- disableRowSelectionOnClick: true,
106
- getRowClassName: params => params.indexRelativeToCurrentPage % 2 === 0 ? '' : 'odd',
107
- columnVisibilityModel: columnVisibilityModel,
108
- onColumnVisibilityModelChange: model => setColumnVisibilityModel(model),
109
- getRowHeight: () => 'auto',
110
- localeText: {
111
- ...koKR.components.MuiDataGrid.defaultProps.localeText,
112
- noRowsLabel: '항목이 없습니다.',
113
- ...localText
114
- },
115
- slots: {
116
- toolbar: hideToolbar ? null : CustomToolbar,
117
- cell: customGridCellMap ? CustomGridCell : undefined,
118
- ...slots
119
- },
120
- slotProps: {
121
- columnsPanel: {
122
- getTogglableColumns
123
- },
124
- toolbar: {
125
- showQuickFilter: true
126
- },
127
- ...slotProps
128
- },
129
- initialState: {
130
- filter: {
131
- filterModel: {
132
- items: [],
133
- quickFilterExcludeHiddenColumns: true
134
- }
135
- },
136
- pagination: {
137
- paginationModel: {
138
- pageSize: 25,
139
- page: 0
140
- }
141
- },
142
- ...initialState
143
- },
144
- sx: {
145
- ...sx,
146
- ...styles
147
- },
148
- ...props
149
- });
150
- }
package/dist/Dialog.js DELETED
@@ -1,42 +0,0 @@
1
- import { Slide, 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 ZoomTransition = /*#__PURE__*/forwardRef(function (props, ref) {
6
- return /*#__PURE__*/_jsx(Zoom, {
7
- ref: ref,
8
- ...props
9
- });
10
- });
11
- const SlideTransition = /*#__PURE__*/forwardRef(function (props, ref) {
12
- return /*#__PURE__*/_jsx(Slide, {
13
- direction: "down",
14
- ref: ref,
15
- ...props
16
- });
17
- });
18
- export default function Dialog({
19
- center = true,
20
- contentFontSize = 16,
21
- children,
22
- sx,
23
- ...props
24
- }) {
25
- const styles = {
26
- '& .MuiDialog-container': {
27
- alignItems: center ? 'center' : 'flex-start'
28
- },
29
- '.MuiTypography-root.MuiDialogContentText-root': {
30
- fontSize: contentFontSize
31
- }
32
- };
33
- return /*#__PURE__*/_jsx(MuiDialog, {
34
- TransitionComponent: center ? ZoomTransition : SlideTransition,
35
- sx: {
36
- ...styles,
37
- ...sx
38
- },
39
- ...props,
40
- children: children
41
- });
42
- }
@@ -1,59 +0,0 @@
1
- import * as React from "react";
2
- import { Divider, Menu, MenuItem } from "@mui/material";
3
- import Button from "./Button";
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 DropdownButton({
8
- label,
9
- icon,
10
- iconPlacement = 'start',
11
- iconSize = '20px',
12
- iconProps = {},
13
- options = [],
14
- onClick,
15
- onSelect,
16
- menuProps = {},
17
- ...props
18
- }) {
19
- const [anchor, setAnchor] = React.useState(null);
20
- const handleClick = event => {
21
- setAnchor(event.currentTarget);
22
- if (onClick) onClick(event);
23
- };
24
- const handleSelect = id => {
25
- setAnchor(null);
26
- if (onSelect) onSelect(id);
27
- };
28
- return /*#__PURE__*/_jsxs(_Fragment, {
29
- children: [/*#__PURE__*/_jsx(Button, {
30
- label: label,
31
- icon: icon,
32
- iconPlacement: iconPlacement,
33
- iconSize: iconSize,
34
- iconProps: iconProps,
35
- onClick: handleClick,
36
- ...props
37
- }), options.length > 0 && /*#__PURE__*/_jsx(Menu, {
38
- anchorEl: anchor,
39
- open: Boolean(anchor),
40
- onClose: _ => setAnchor(null),
41
- sx: {
42
- ...styles,
43
- ...menuProps.sx
44
- },
45
- ...menuProps,
46
- children: options.map(option => {
47
- return option.type === 'divider' ? /*#__PURE__*/_jsx(Divider, {}) : /*#__PURE__*/_jsx(MenuItem, {
48
- onClick: _ => handleSelect(option.id),
49
- children: option.label
50
- }, option.id);
51
- })
52
- })]
53
- });
54
- }
55
- const styles = {
56
- '.MuiButtonBase-root.MuiMenuItem-root': {
57
- fontSize: 14
58
- }
59
- };
package/dist/FormLabel.js DELETED
@@ -1,23 +0,0 @@
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
- sx,
8
- ...props
9
- }) {
10
- const styles = {
11
- color: value ? 'rgba(0, 0, 0, 0.87)' : 'rgba(0, 0, 0, 0.6)',
12
- fontSize: value ? 16 : 14,
13
- fontWeight: value ? 600 : 400
14
- };
15
- return /*#__PURE__*/_jsx(MuiFormLabel, {
16
- sx: {
17
- ...sx,
18
- ...styles
19
- },
20
- ...props,
21
- children: children
22
- });
23
- }