@nethru/ui 1.0.81 → 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/base/colors/blue.js +15 -0
  19. package/base/colors/blueGrey.js +6 -0
  20. package/base/colors/green.js +13 -0
  21. package/base/colors/grey.js +18 -0
  22. package/base/colors/index.js +9 -0
  23. package/base/colors/lime.js +13 -0
  24. package/base/colors/orange.js +13 -0
  25. package/base/colors/purple.js +13 -0
  26. package/base/colors/red.js +13 -0
  27. package/base/colors/yellow.js +13 -0
  28. package/base/datagrid/DataGrid.js +57 -0
  29. package/base/datagrid/Footer.js +51 -0
  30. package/base/datagrid/Pagination.js +24 -0
  31. package/base/dialog/AlertDialog.js +21 -0
  32. package/base/dialog/ConfirmDialog.js +29 -0
  33. package/base/dialog/Dialog.js +56 -0
  34. package/base/dialog/SimpleDialog.js +33 -0
  35. package/{dist → base}/error/Error.js +1 -2
  36. package/base/frame/AppBar.js +54 -0
  37. package/base/frame/Brand.js +36 -0
  38. package/base/frame/Frame.js +49 -0
  39. package/{dist → base/frame}/sidebar/MenuToggler.js +14 -3
  40. package/{dist → base/frame}/sidebar/PrimaryMenu.js +15 -20
  41. package/base/frame/sidebar/SecondaryMenu.js +41 -0
  42. package/{dist → base/frame}/sidebar/Sidebar.js +21 -10
  43. package/base/frame/sidebar/SidebarContext.js +74 -0
  44. package/base/frame/sidebar/css/primary.module.css +69 -0
  45. package/base/frame/sidebar/css/sidebar.module.css +63 -0
  46. package/base/index.js +33 -0
  47. package/{dist → base}/samples/menu.sample.json +2 -2
  48. package/base/styles/borderRadius.js +7 -0
  49. package/base/styles/createTheme.js +90 -0
  50. package/base/styles/globalStyles.js +47 -0
  51. package/base/styles/mui/alert.js +40 -0
  52. package/base/styles/mui/appBar.js +17 -0
  53. package/base/styles/mui/autocomplete.js +46 -0
  54. package/base/styles/mui/avatar.js +14 -0
  55. package/base/styles/mui/button.js +276 -0
  56. package/base/styles/mui/buttonBase.js +10 -0
  57. package/base/styles/mui/checkbox.js +37 -0
  58. package/base/styles/mui/chip.js +83 -0
  59. package/base/styles/mui/cssBaseline.js +12 -0
  60. package/base/styles/mui/dataGrid.js +101 -0
  61. package/base/styles/mui/dialog.js +13 -0
  62. package/base/styles/mui/dialogActions.js +8 -0
  63. package/base/styles/mui/dialogContent.js +10 -0
  64. package/base/styles/mui/dialogTitle.js +11 -0
  65. package/base/styles/mui/formControl.js +8 -0
  66. package/base/styles/mui/formControlLabel.js +9 -0
  67. package/base/styles/mui/formHelperText.js +10 -0
  68. package/base/styles/mui/grid.js +15 -0
  69. package/base/styles/mui/icon.js +12 -0
  70. package/base/styles/mui/iconButton.js +79 -0
  71. package/base/styles/mui/inputLabel.js +13 -0
  72. package/base/styles/mui/list.js +11 -0
  73. package/base/styles/mui/menuItem.js +83 -0
  74. package/base/styles/mui/outlinedInput.js +53 -0
  75. package/base/styles/mui/paginationItem.js +25 -0
  76. package/base/styles/mui/paper.js +8 -0
  77. package/base/styles/mui/popover.js +11 -0
  78. package/base/styles/mui/select.js +11 -0
  79. package/base/styles/mui/slider.js +15 -0
  80. package/base/styles/mui/snackbar.js +24 -0
  81. package/base/styles/mui/switch.js +33 -0
  82. package/base/styles/mui/tab.js +23 -0
  83. package/base/styles/mui/tablePagination.js +8 -0
  84. package/base/styles/mui/tabs.js +20 -0
  85. package/base/styles/mui/textField.js +11 -0
  86. package/base/styles/mui/toggleButton.js +96 -0
  87. package/base/styles/mui/tooltip.js +22 -0
  88. package/base/styles/palette.js +40 -0
  89. package/base/styles/shadow.js +8 -0
  90. package/base/styles/typography.js +131 -0
  91. package/package.json +14 -10
  92. package/dist/Accordion.js +0 -45
  93. package/dist/AccordionDetails.js +0 -19
  94. package/dist/AccordionSummary.js +0 -35
  95. package/dist/AlertDialog.js +0 -55
  96. package/dist/AppBar.js +0 -68
  97. package/dist/AppendableFormList.js +0 -56
  98. package/dist/AvatarDropdown.js +0 -80
  99. package/dist/Button.js +0 -61
  100. package/dist/Checkbox.js +0 -27
  101. package/dist/CircularProgress.js +0 -33
  102. package/dist/ColumnedSection.js +0 -64
  103. package/dist/ConfirmDialog.js +0 -65
  104. package/dist/DataGrid.js +0 -150
  105. package/dist/Dialog.js +0 -42
  106. package/dist/DropdownButton.js +0 -59
  107. package/dist/FormLabel.js +0 -23
  108. package/dist/Frame.js +0 -47
  109. package/dist/GroupSelect.js +0 -67
  110. package/dist/ListItem.js +0 -21
  111. package/dist/ListItemDivider.js +0 -15
  112. package/dist/ListItemGrid.js +0 -12
  113. package/dist/ListItemText.js +0 -44
  114. package/dist/MainHeader.js +0 -59
  115. package/dist/PropertyTable.js +0 -141
  116. package/dist/ReferenceChipList.js +0 -59
  117. package/dist/SearchTextField.js +0 -24
  118. package/dist/SearchableSelect.js +0 -41
  119. package/dist/Section.js +0 -22
  120. package/dist/Select.js +0 -48
  121. package/dist/ShadowedSection.js +0 -36
  122. package/dist/Snackbar.js +0 -51
  123. package/dist/StatusChip.js +0 -34
  124. package/dist/Switch.js +0 -37
  125. package/dist/TabbedSection.js +0 -37
  126. package/dist/Tabs.js +0 -38
  127. package/dist/TextField.js +0 -25
  128. package/dist/index.js +0 -42
  129. package/dist/samples/global.sample.css +0 -59
  130. package/dist/sidebar/MenuTree.js +0 -95
  131. package/dist/sidebar/MenuTreeGroup.js +0 -65
  132. package/dist/sidebar/SecondaryMenu.js +0 -36
  133. package/dist/sidebar/SidebarContext.js +0 -122
  134. package/dist/sidebar/css/primary.module.css +0 -80
  135. package/dist/sidebar/css/sidebar.module.css +0 -50
  136. package/dist/variables.js +0 -6
  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,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
- }
package/dist/Frame.js DELETED
@@ -1,47 +0,0 @@
1
- import { Box } from '@mui/material';
2
- import { SidebarContextProvider } from './sidebar/SidebarContext';
3
- import { variables } from './variables';
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- import { jsxs as _jsxs } from "react/jsx-runtime";
6
- import { Fragment as _Fragment } from "react/jsx-runtime";
7
- export default function Frame({
8
- appBar,
9
- sideBar,
10
- children,
11
- footer,
12
- menu,
13
- menuIcons = {},
14
- mainRef,
15
- onScroll
16
- }) {
17
- const containerStyles = {
18
- display: 'flex',
19
- flexGrow: 1,
20
- overflow: 'auto',
21
- marginTop: `${variables.gnbHeight}px`,
22
- backgroundColor: variables.bodyBackgroundColor
23
- };
24
- const contentStyles = {
25
- flexGrow: 1,
26
- overflow: 'auto',
27
- padding: '20px 40px'
28
- };
29
- return /*#__PURE__*/_jsxs(_Fragment, {
30
- children: [appBar, /*#__PURE__*/_jsxs(Box, {
31
- sx: containerStyles,
32
- children: [/*#__PURE__*/_jsx(SidebarContextProvider, {
33
- menu: menu,
34
- icons: menuIcons,
35
- children: sideBar
36
- }), /*#__PURE__*/_jsxs(Box, {
37
- ref: mainRef,
38
- component: "section",
39
- sx: contentStyles,
40
- onScroll: onScroll,
41
- children: [/*#__PURE__*/_jsx("main", {
42
- children: children
43
- }), footer]
44
- })]
45
- })]
46
- });
47
- }
@@ -1,67 +0,0 @@
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
- '.MuiInputLabel-root, .MuiInputBase-input': {
17
- fontSize: '0.875rem'
18
- }
19
- };
20
- const paperStyles = {
21
- '& .MuiAutocomplete-groupLabel': {
22
- fontSize: '0.8rem',
23
- paddingTop: 0,
24
- paddingBottom: 0
25
- },
26
- '& .MuiAutocomplete-option': {
27
- color: '#333',
28
- fontSize: '0.875rem',
29
- paddingTop: '3px',
30
- paddingBottom: '3px'
31
- },
32
- '& .MuiAutocomplete-noOptions': {
33
- fontSize: '0.8rem'
34
- }
35
- };
36
- const handleSelect = (event, value, reason) => {
37
- if (reason !== 'selectOption') return;
38
- if (onSelect) onSelect(id, value);
39
- };
40
- function CustomPaper(props) {
41
- return /*#__PURE__*/_jsx(Paper, {
42
- ...props,
43
- sx: paperStyles
44
- });
45
- }
46
- return /*#__PURE__*/_jsx(Autocomplete, {
47
- id: id,
48
- size: "small",
49
- options: options,
50
- groupBy: option => option[groupKey],
51
- value: value,
52
- onChange: handleSelect,
53
- blurOnSelect: true,
54
- disableClearable: disableClearable,
55
- noOptionsText: "\uC77C\uCE58\uD558\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
56
- PaperComponent: CustomPaper,
57
- renderInput: params => /*#__PURE__*/_jsx(TextField, {
58
- ...params,
59
- label: placeholder
60
- }),
61
- sx: {
62
- ...sx,
63
- ...styles
64
- },
65
- ...props
66
- });
67
- }
package/dist/ListItem.js DELETED
@@ -1,21 +0,0 @@
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
- verticalAlign = 'flex-start',
9
- children,
10
- ...props
11
- }) {
12
- return /*#__PURE__*/_jsxs(MuiListItem, {
13
- ...props,
14
- children: [grid && /*#__PURE__*/_jsx(Grid, {
15
- container: true,
16
- columnSpacing: spacing,
17
- alignItems: verticalAlign,
18
- children: children
19
- }), !grid && children]
20
- });
21
- }
@@ -1,15 +0,0 @@
1
- import { Divider } from "@mui/material";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- export default function ListItemDivider({
4
- sx,
5
- ...props
6
- }) {
7
- return /*#__PURE__*/_jsx(Divider, {
8
- sx: {
9
- ...sx,
10
- mt: 3,
11
- mb: 2
12
- },
13
- ...props
14
- });
15
- }
@@ -1,12 +0,0 @@
1
- import { Grid } from "@mui/material";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- export default function ListItemGrid({
4
- children,
5
- ...props
6
- }) {
7
- return /*#__PURE__*/_jsx(Grid, {
8
- item: true,
9
- ...props,
10
- children: children
11
- });
12
- }
@@ -1,44 +0,0 @@
1
- import { useState } from "react";
2
- import { Box, Stack, Tooltip, Typography } from "@mui/material";
3
- import MuiListItemText from "@mui/material/ListItemText";
4
- import HelpIcon from "@mui/icons-material/Help";
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: typeof primary === 'string' ? /*#__PURE__*/_jsx(Typography, {
16
- fontSize: 17,
17
- fontWeight: 600,
18
- children: primary
19
- }) : /*#__PURE__*/_jsx(Box, {
20
- children: primary
21
- }),
22
- secondary: /*#__PURE__*/_jsxs(Stack, {
23
- direction: "row",
24
- spacing: 0.5,
25
- children: [/*#__PURE__*/_jsx(Box, {
26
- color: "rgba(0, 0, 0, 0.6)",
27
- fontSize: 14,
28
- children: secondary
29
- }), /*#__PURE__*/_jsx(Tooltip, {
30
- title: tooltip,
31
- children: /*#__PURE__*/_jsx(HelpIcon, {
32
- sx: {
33
- fontSize: 18,
34
- visibility: tooltip && hover ? 'visible' : 'hidden'
35
- }
36
- })
37
- })]
38
- }),
39
- disableTypography: true,
40
- onMouseEnter: _ => setHover(true),
41
- onMouseLeave: _ => setHover(false),
42
- ...props
43
- });
44
- }
@@ -1,59 +0,0 @@
1
- import { Button, Stack, Typography } from "@mui/material";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Fragment as _Fragment } from "react/jsx-runtime";
4
- import { jsxs as _jsxs } from "react/jsx-runtime";
5
- export default function MainHeader({
6
- title,
7
- editable = false,
8
- edit = false,
9
- onEditClick,
10
- onConfirmClick,
11
- onCancelClick,
12
- editButtonText = '편집',
13
- confirmButtonText = '저장',
14
- cancelButtonText = '취소',
15
- confirmButtonDisabled = false,
16
- rightSlot
17
- }) {
18
- return /*#__PURE__*/_jsx(_Fragment, {
19
- children: /*#__PURE__*/_jsxs(Stack, {
20
- direction: "row",
21
- justifyContent: "space-between",
22
- sx: {
23
- mb: 2.5
24
- },
25
- children: [/*#__PURE__*/_jsx(Typography, {
26
- variant: "h5",
27
- children: title
28
- }), rightSlot && /*#__PURE__*/_jsx(_Fragment, {
29
- children: rightSlot
30
- }), !rightSlot && editable && /*#__PURE__*/_jsxs(Stack, {
31
- direction: "row",
32
- spacing: 1,
33
- justifyContent: "flex-end",
34
- children: [!edit && /*#__PURE__*/_jsx(_Fragment, {
35
- children: /*#__PURE__*/_jsx(Button, {
36
- variant: "contained",
37
- onClick: onEditClick,
38
- children: editButtonText
39
- })
40
- }), edit && /*#__PURE__*/_jsxs(_Fragment, {
41
- children: [/*#__PURE__*/_jsx(Button, {
42
- variant: "contained",
43
- type: "submit",
44
- onClick: onConfirmClick,
45
- disabled: confirmButtonDisabled,
46
- sx: {
47
- width: 120
48
- },
49
- children: confirmButtonText
50
- }), /*#__PURE__*/_jsx(Button, {
51
- variant: "outlined",
52
- onClick: onCancelClick,
53
- children: cancelButtonText
54
- })]
55
- })]
56
- })]
57
- })
58
- });
59
- }