@nethru/ui 1.0.82 → 2.0.1

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 (141) 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 +53 -0
  39. package/{dist → base}/samples/menu.sample.json +2 -2
  40. package/base/styles/borderRadius.js +7 -0
  41. package/base/styles/button.js +199 -0
  42. package/base/styles/createTheme.js +90 -0
  43. package/base/styles/globalStyles.js +47 -0
  44. package/base/styles/mui/alert.js +40 -0
  45. package/base/styles/mui/appBar.js +17 -0
  46. package/base/styles/mui/autocomplete.js +46 -0
  47. package/base/styles/mui/avatar.js +14 -0
  48. package/base/styles/mui/button.js +276 -0
  49. package/base/styles/mui/buttonBase.js +10 -0
  50. package/base/styles/mui/checkbox.js +37 -0
  51. package/base/styles/mui/chip.js +83 -0
  52. package/base/styles/mui/cssBaseline.js +12 -0
  53. package/base/styles/mui/dataGrid.js +101 -0
  54. package/base/styles/mui/dialog.js +13 -0
  55. package/base/styles/mui/dialogActions.js +8 -0
  56. package/base/styles/mui/dialogContent.js +10 -0
  57. package/base/styles/mui/dialogTitle.js +11 -0
  58. package/base/styles/mui/formControl.js +8 -0
  59. package/base/styles/mui/formControlLabel.js +9 -0
  60. package/base/styles/mui/formHelperText.js +10 -0
  61. package/base/styles/mui/grid.js +15 -0
  62. package/base/styles/mui/icon.js +12 -0
  63. package/base/styles/mui/iconButton.js +79 -0
  64. package/base/styles/mui/inputLabel.js +13 -0
  65. package/base/styles/mui/list.js +11 -0
  66. package/base/styles/mui/menuItem.js +83 -0
  67. package/base/styles/mui/outlinedInput.js +53 -0
  68. package/base/styles/mui/paginationItem.js +25 -0
  69. package/base/styles/mui/paper.js +8 -0
  70. package/base/styles/mui/popover.js +11 -0
  71. package/base/styles/mui/select.js +11 -0
  72. package/base/styles/mui/slider.js +15 -0
  73. package/base/styles/mui/snackbar.js +24 -0
  74. package/base/styles/mui/switch.js +33 -0
  75. package/base/styles/mui/tab.js +23 -0
  76. package/base/styles/mui/tablePagination.js +8 -0
  77. package/base/styles/mui/tabs.js +20 -0
  78. package/base/styles/mui/textField.js +11 -0
  79. package/base/styles/mui/toggleButton.js +96 -0
  80. package/base/styles/mui/tooltip.js +22 -0
  81. package/base/styles/palette.js +40 -0
  82. package/base/styles/shadow.js +8 -0
  83. package/base/styles/typography.js +131 -0
  84. package/package.json +6 -5
  85. package/dist/AlertDialog.js +0 -55
  86. package/dist/AppBar.js +0 -68
  87. package/dist/Checkbox.js +0 -27
  88. package/dist/ColumnedSection.js +0 -64
  89. package/dist/ConfirmDialog.js +0 -65
  90. package/dist/DataGrid.js +0 -150
  91. package/dist/Dialog.js +0 -42
  92. package/dist/DropdownButton.js +0 -59
  93. package/dist/Frame.js +0 -47
  94. package/dist/MainHeader.js +0 -59
  95. package/dist/PropertyTable.js +0 -141
  96. package/dist/SearchTextField.js +0 -24
  97. package/dist/SearchableSelect.js +0 -41
  98. package/dist/Select.js +0 -48
  99. package/dist/Snackbar.js +0 -51
  100. package/dist/Switch.js +0 -37
  101. package/dist/index.js +0 -44
  102. package/dist/samples/global.sample.css +0 -59
  103. package/dist/sidebar/MenuTree.js +0 -95
  104. package/dist/sidebar/MenuTreeGroup.js +0 -65
  105. package/dist/sidebar/SecondaryMenu.js +0 -36
  106. package/dist/sidebar/SidebarContext.js +0 -122
  107. package/dist/sidebar/css/primary.module.css +0 -80
  108. package/dist/sidebar/css/sidebar.module.css +0 -50
  109. package/dist/variables.js +0 -6
  110. /package/{dist → base}/colors/green.js +0 -0
  111. /package/{dist → base}/colors/grey.js +0 -0
  112. /package/{dist → base}/colors/index.js +0 -0
  113. /package/{dist → base}/colors/lime.js +0 -0
  114. /package/{dist → base}/colors/orange.js +0 -0
  115. /package/{dist → base}/colors/purple.js +0 -0
  116. /package/{dist → base}/colors/red.js +0 -0
  117. /package/{dist → base}/colors/yellow.js +0 -0
  118. /package/{dist → base/deprecated}/Accordion.js +0 -0
  119. /package/{dist → base/deprecated}/AccordionDetails.js +0 -0
  120. /package/{dist → base/deprecated}/AccordionSummary.js +0 -0
  121. /package/{dist → base/deprecated}/AppendableFormList.js +0 -0
  122. /package/{dist → base/deprecated}/AvatarDropdown.js +0 -0
  123. /package/{dist → base/deprecated}/Button.js +0 -0
  124. /package/{dist → base/deprecated}/CircularProgress.js +0 -0
  125. /package/{dist → base/deprecated}/FormLabel.js +0 -0
  126. /package/{dist → base/deprecated}/GroupSelect.js +0 -0
  127. /package/{dist → base/deprecated}/ListItem.js +0 -0
  128. /package/{dist → base/deprecated}/ListItemDivider.js +0 -0
  129. /package/{dist → base/deprecated}/ListItemGrid.js +0 -0
  130. /package/{dist → base/deprecated}/ListItemText.js +0 -0
  131. /package/{dist → base/deprecated}/ReferenceChipList.js +0 -0
  132. /package/{dist → base/deprecated}/Section.js +0 -0
  133. /package/{dist → base/deprecated}/ShadowedSection.js +0 -0
  134. /package/{dist → base/deprecated}/StatusChip.js +0 -0
  135. /package/{dist → base/deprecated}/TabbedSection.js +0 -0
  136. /package/{dist → base/deprecated}/Tabs.js +0 -0
  137. /package/{dist → base/deprecated}/TextField.js +0 -0
  138. /package/{dist → base}/editor/Editor.js +0 -0
  139. /package/{dist → base}/editor/nScript.js +0 -0
  140. /package/{dist → base}/editor/nScriptKeywords.js +0 -0
  141. /package/{dist → base}/error/HttpError.js +0 -0
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,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
- }
@@ -1,141 +0,0 @@
1
- import { forwardRef, useMemo, useState } from "react";
2
- import { Box, Typography } from "@mui/material";
3
- import MenuItem from "@mui/material/MenuItem";
4
- import Select from "./Select";
5
- import { DataGridPro, useGridApiContext } from "@mui/x-data-grid-pro";
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- import { jsxs as _jsxs } from "react/jsx-runtime";
8
- const PropertyTable = /*#__PURE__*/forwardRef(({
9
- columns,
10
- rows,
11
- onUpdate,
12
- readOnly,
13
- error = false,
14
- helperText,
15
- sx,
16
- outerSx,
17
- ...props
18
- }, ref) => {
19
- const styles = useMemo(() => {
20
- const result = {
21
- '&.MuiDataGrid-root': {
22
- borderBottom: error ? '2px solid #d32f2f' : 'none'
23
- },
24
- '.MuiDataGrid-columnHeaders': {
25
- backgroundColor: '#f8f9fa'
26
- },
27
- '.MuiDataGrid-columnSeparator': {
28
- // visibility: 'hidden !important'
29
- },
30
- '&.MuiDataGrid-root .MuiDataGrid-columnHeader:focus': {
31
- outline: 'none !important'
32
- },
33
- '.MuiDataGrid-cell.fixed': {
34
- fontWeight: 'bold'
35
- },
36
- '.MuiDataGrid-cell.dimmed': {
37
- color: '#666'
38
- },
39
- '& .Mui-error': {
40
- backgroundColor: 'rgb(126,10,15, 0.1)',
41
- color: '#750f0f'
42
- }
43
- };
44
- if (readOnly) {
45
- result['&.MuiDataGrid-root .MuiDataGrid-cell:focus'] = {
46
- outline: 'none !important'
47
- };
48
- }
49
- return result;
50
- }, [readOnly, error]);
51
- const helperTextStyles = useMemo(() => {
52
- return {
53
- color: error ? '#d32f2f' : '#555',
54
- fontSize: 12,
55
- ml: '14px',
56
- mt: '3px'
57
- };
58
- }, [error]);
59
- const arrangedColumns = useMemo(() => {
60
- return columns.map(column => {
61
- const newColumn = {
62
- ...column
63
- };
64
- if (readOnly) newColumn.editable = false;
65
- if (column.dimmed) newColumn.cellClassName = 'dimmed';else if (column.fixed) {
66
- newColumn.cellClassName = params => {
67
- return !params.row.deletable ? 'fixed' : '';
68
- };
69
- }
70
- if (column.type === 'singleSelect' && column.valueOptions) {
71
- newColumn.renderEditCell = params => /*#__PURE__*/_jsx(SingleSelect, {
72
- options: column.valueOptions,
73
- ...params
74
- });
75
- }
76
- return newColumn;
77
- });
78
- }, [columns, readOnly]);
79
- const [updatedRows, setUpdatedRows] = useState(rows);
80
- const processRowUpdate = row => {
81
- const newRows = updatedRows.filter(r => r.id !== row.id);
82
- newRows.push(row);
83
- setUpdatedRows(newRows);
84
- if (onUpdate) onUpdate(row, newRows);
85
- return row;
86
- };
87
- return /*#__PURE__*/_jsxs(Box, {
88
- ref: ref,
89
- sx: outerSx,
90
- children: [/*#__PURE__*/_jsx(DataGridPro, {
91
- columns: arrangedColumns,
92
- rows: rows,
93
- columnHeaderHeight: 35,
94
- rowHeight: 30,
95
- isCellEditable: params => {
96
- return params.row.deletable || !params.colDef.fixed;
97
- },
98
- processRowUpdate: processRowUpdate,
99
- onProcessRowUpdateError: error => console.log(error),
100
- disableColumnMenu: true,
101
- disableRowSelectionOnClick: readOnly,
102
- hideFooter: true,
103
- sx: {
104
- ...styles,
105
- ...sx
106
- },
107
- ...props
108
- }), helperText && /*#__PURE__*/_jsx(Typography, {
109
- sx: helperTextStyles,
110
- children: helperText
111
- })]
112
- });
113
- });
114
- const SingleSelect = /*#__PURE__*/forwardRef((props, ref) => {
115
- const {
116
- id,
117
- value,
118
- field,
119
- options
120
- } = props;
121
- const apiRef = useGridApiContext();
122
- const handleChange = (event, data) => {
123
- apiRef.current.setEditCellValue({
124
- id,
125
- field,
126
- value: data.props.value
127
- });
128
- };
129
- return /*#__PURE__*/_jsx(Select, {
130
- fontSize: 14,
131
- ref: ref,
132
- value: value,
133
- onChange: handleChange,
134
- fullWidth: true,
135
- children: options.map(option => /*#__PURE__*/_jsx(MenuItem, {
136
- value: option.value,
137
- children: option.label
138
- }, option.value))
139
- });
140
- });
141
- export default PropertyTable;
@@ -1,24 +0,0 @@
1
- import { InputAdornment } from "@mui/material";
2
- import SearchIcon from "@mui/icons-material/Search";
3
- import TextField from "@mui/material/TextField";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- export default function SearchTextField({
6
- InputProps,
7
- ...props
8
- }) {
9
- return /*#__PURE__*/_jsx(TextField, {
10
- variant: "standard",
11
- placeholder: "\uAC80\uC0C9",
12
- size: "small",
13
- InputProps: {
14
- startAdornment: /*#__PURE__*/_jsx(InputAdornment, {
15
- position: "start",
16
- children: /*#__PURE__*/_jsx(SearchIcon, {
17
- fontSize: "small"
18
- })
19
- }),
20
- ...InputProps
21
- },
22
- ...props
23
- });
24
- }
@@ -1,41 +0,0 @@
1
- import { Autocomplete, Box, Divider, Typography } from "@mui/material";
2
- import { TextField } from "@nethru/ui";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- import { Fragment as _Fragment } from "react/jsx-runtime";
5
- export default function SearchableSelect({
6
- label,
7
- options,
8
- textFieldProps,
9
- ...props
10
- }) {
11
- return /*#__PURE__*/_jsx(Autocomplete, {
12
- autoHighlight: true,
13
- disableClearable: true,
14
- options: options,
15
- renderInput: params => /*#__PURE__*/_jsx(TextField, {
16
- variant: "standard",
17
- label: label,
18
- ...params,
19
- ...textFieldProps
20
- }),
21
- renderOption: (props, option) => /*#__PURE__*/_jsx(_Fragment, {
22
- children: option.type === 'divider' ? /*#__PURE__*/_jsx(Divider, {
23
- ...props,
24
- sx: {
25
- mb: 0.5
26
- }
27
- }) : /*#__PURE__*/_jsx(Box, {
28
- component: "li",
29
- ...props,
30
- children: option.label
31
- })
32
- }),
33
- getOptionDisabled: option => option.type === 'divider',
34
- isOptionEqualToValue: (option, value) => option.id === value.id,
35
- noOptionsText: /*#__PURE__*/_jsx(Typography, {
36
- variant: "subtitle2",
37
- children: "\uC77C\uCE58\uD558\uB294 \uD56D\uBAA9 \uC5C6\uC74C"
38
- }),
39
- ...props
40
- });
41
- }
package/dist/Select.js DELETED
@@ -1,48 +0,0 @@
1
- import MuiSelect from "@mui/material/Select";
2
- import { FormControl, InputLabel } from "@mui/material";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- import { jsxs as _jsxs } from "react/jsx-runtime";
5
- import { Fragment as _Fragment } from "react/jsx-runtime";
6
- export default function Select({
7
- variant,
8
- label,
9
- name,
10
- fontSize,
11
- fullWidth = false,
12
- inputProps,
13
- MenuProps,
14
- children,
15
- ...props
16
- }) {
17
- return /*#__PURE__*/_jsx(_Fragment, {
18
- children: /*#__PURE__*/_jsxs(FormControl, {
19
- variant: variant,
20
- fullWidth: fullWidth,
21
- sx: {
22
- '.MuiSelect-select.MuiInputBase-input': {
23
- fontSize: fontSize ? fontSize : 15
24
- }
25
- },
26
- children: [label && /*#__PURE__*/_jsx(InputLabel, {
27
- children: label
28
- }), /*#__PURE__*/_jsx(MuiSelect, {
29
- inputProps: {
30
- name: name,
31
- ...inputProps
32
- },
33
- MenuProps: {
34
- PaperProps: {
35
- sx: {
36
- '& .MuiMenuItem-root': {
37
- fontSize: fontSize ? fontSize : 15
38
- }
39
- }
40
- },
41
- ...MenuProps
42
- },
43
- ...props,
44
- children: children
45
- })]
46
- })
47
- });
48
- }
package/dist/Snackbar.js DELETED
@@ -1,51 +0,0 @@
1
- import { Alert, Box, Slide } from "@mui/material";
2
- import MuiSnackbar from "@mui/material/Snackbar";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- import { Fragment as _Fragment } from "react/jsx-runtime";
5
- import { jsxs as _jsxs } from "react/jsx-runtime";
6
- export default function Snackbar({
7
- content,
8
- severity = 'info',
9
- maxWidth = '25%',
10
- autoHideDuration = 3000,
11
- anchorOrigin = {
12
- vertical: 'top',
13
- horizontal: 'right'
14
- },
15
- children,
16
- sx,
17
- ...props
18
- }) {
19
- const styles = {
20
- maxWidth: maxWidth,
21
- boxShadow: '0 0.3rem 0.3rem rgba(0, 0, 0, 0.03)'
22
- };
23
- return /*#__PURE__*/_jsxs(_Fragment, {
24
- children: [!children && /*#__PURE__*/_jsx(MuiSnackbar, {
25
- autoHideDuration: autoHideDuration,
26
- anchorOrigin: anchorOrigin,
27
- TransitionComponent: transition,
28
- sx: {
29
- ...sx,
30
- ...styles
31
- },
32
- ...props,
33
- children: /*#__PURE__*/_jsx(Alert, {
34
- severity: severity,
35
- children: /*#__PURE__*/_jsx(Box, {
36
- whiteSpace: "pre",
37
- children: content
38
- })
39
- })
40
- }), children && /*#__PURE__*/_jsx(MuiSnackbar, {
41
- ...props,
42
- children: children
43
- })]
44
- });
45
- }
46
- function transition(props) {
47
- return /*#__PURE__*/_jsx(Slide, {
48
- ...props,
49
- direction: "down"
50
- });
51
- }
package/dist/Switch.js DELETED
@@ -1,37 +0,0 @@
1
- import { FormControlLabel, Stack } from "@mui/material";
2
- import MuiSwitch from "@mui/material/Switch";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- import { Fragment as _Fragment } from "react/jsx-runtime";
5
- import { jsxs as _jsxs } from "react/jsx-runtime";
6
- export default function Switch({
7
- label,
8
- labelPlacement = 'top',
9
- ...props
10
- }) {
11
- return /*#__PURE__*/_jsxs(_Fragment, {
12
- children: [label && /*#__PURE__*/_jsx(Stack, {
13
- direction: "row",
14
- alignItems: "center",
15
- sx: {
16
- '.MuiFormControlLabel-label': {
17
- color: '#666',
18
- fontSize: 11
19
- },
20
- '.MuiFormControlLabel-root': {
21
- ml: labelPlacement === 'start' ? '0px' : '-10px',
22
- mr: 0
23
- }
24
- },
25
- children: /*#__PURE__*/_jsx(FormControlLabel, {
26
- control: /*#__PURE__*/_jsx(MuiSwitch, {
27
- color: "primary",
28
- ...props
29
- }),
30
- label: label,
31
- labelPlacement: labelPlacement
32
- })
33
- }), !label && /*#__PURE__*/_jsx(MuiSwitch, {
34
- ...props
35
- })]
36
- });
37
- }
package/dist/index.js DELETED
@@ -1,44 +0,0 @@
1
- import * as colors from './colors';
2
- export { colors };
3
- export { default as Accordion } from "./Accordion";
4
- export { default as AccordionDetails } from "./AccordionDetails";
5
- export { default as AccordionSummary } from "./AccordionSummary";
6
- export { default as AlertDialog } from "./AlertDialog";
7
- export { default as AppBar } from "./AppBar";
8
- export { default as AppendableFormList } from "./AppendableFormList";
9
- export { default as AvatarDropdown } from "./AvatarDropdown";
10
- export { default as Button } from "./Button";
11
- export { default as Checkbox } from "./Checkbox";
12
- export { default as CircularProgress } from "./CircularProgress";
13
- export { default as ColumnedSection } from "./ColumnedSection";
14
- export { default as ConfirmDialog } from "./ConfirmDialog";
15
- export { default as DataGrid } from "./DataGrid";
16
- export { default as Dialog } from "./Dialog";
17
- export { default as DropdownButton } from "./DropdownButton";
18
- export { default as Editor } from "./editor/Editor";
19
- export { default as FormLabel } from "./FormLabel";
20
- export { default as Frame } from "./Frame";
21
- export { default as GroupSelect } from "./GroupSelect";
22
- export { default as ListItem } from "./ListItem";
23
- export { default as ListItemDivider } from "./ListItemDivider";
24
- export { default as ListItemGrid } from "./ListItemGrid";
25
- export { default as ListItemText } from "./ListItemText";
26
- export { default as MainHeader } from "./MainHeader";
27
- export { default as PropertyTable } from "./PropertyTable";
28
- export { default as ReferenceChipList } from "./ReferenceChipList";
29
- export { default as SearchableSelect } from "./SearchableSelect";
30
- export { default as SearchTextField } from "./SearchTextField";
31
- export { default as Section } from "./Section";
32
- export { default as Select } from "./Select";
33
- export { default as ShadowedSection } from "./ShadowedSection";
34
- export { default as Slider } from "./Slider";
35
- export { default as Snackbar } from "./Snackbar";
36
- export { default as StatusChip } from "./StatusChip";
37
- export { default as Switch } from "./Switch";
38
- export { default as TabbedSection } from "./TabbedSection";
39
- export { default as Tabs } from "./Tabs";
40
- export { default as TextField } from "./TextField";
41
- export { default as Sidebar } from "./sidebar/Sidebar";
42
- export * from './sidebar/SidebarContext';
43
- export { default as Error } from "./error/Error";
44
- export { default as HttpError } from "./error/HttpError";
@@ -1,59 +0,0 @@
1
- /* variable */
2
- :root {
3
- --body-background-color: #f8f9fa;
4
- --gnb-height: 64px;
5
- --primary-menu-width: 56px;
6
- --secondary-menu-width: 256px;
7
- }
8
-
9
-
10
- /* global */
11
- html, body {
12
- margin: 0;
13
- height: 100%;
14
- }
15
-
16
- #root {
17
- display: flex;
18
- flex-direction: column;
19
- height: 100%;
20
- }
21
-
22
-
23
- /* margin */
24
- .ml-auto {
25
- margin-left: auto;
26
- }
27
- .mr-auto {
28
- margin-right: auto;
29
- }
30
- .mt-auto {
31
- margin-top: auto;
32
- }
33
- .mt-bottom {
34
- margin-bottom: auto;
35
- }
36
-
37
-
38
- /* Highchart */
39
- .highcharts-tooltip-box {
40
- fill-opacity: 0;
41
- }
42
-
43
- .highcharts-tooltip > span {
44
- background: #fff;
45
- border: 1px solid #ccc;
46
- border-radius: 3px;
47
- padding: 8px;
48
- }
49
-
50
-
51
- /* CodeMirror */
52
- .cm-theme-light {
53
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
54
- font-size: 14px;
55
- }
56
-
57
- .cm-editor, .cm-editor.cm-focused {
58
- outline: 1px solid #eaeaea;
59
- }
@@ -1,95 +0,0 @@
1
- import { useNavigate } from "react-router-dom";
2
- import { getMenuTreeStates, useSidebarContext } from "./SidebarContext";
3
- import { TreeItem, TreeView } from "@mui/x-tree-view";
4
- import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
5
- import ArrowRightIcon from '@mui/icons-material/ArrowRight';
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- const HAS_CHILDREN = "has-children";
8
- export default function MenuTree({
9
- id,
10
- data
11
- }) {
12
- const styles = {
13
- paddingRight: '18px',
14
- '.MuiTreeItem-content': {
15
- padding: '7px 8px'
16
- },
17
- '.MuiTreeItem-content.Mui-selected': {
18
- backgroundColor: 'rgba(25, 118, 210, 0.2)'
19
- },
20
- '.MuiTreeItem-content .MuiTreeItem-label': {
21
- fontSize: '0.9rem'
22
- },
23
- 'li.has-children > .MuiTreeItem-content': {
24
- backgroundColor: 'transparent'
25
- }
26
- };
27
- const navigate = useNavigate();
28
- const {
29
- states,
30
- dispatch
31
- } = useSidebarContext();
32
- const {
33
- expanded
34
- } = getMenuTreeStates(states, id);
35
- const handleSelect = (event, ids) => {
36
- dispatch({
37
- type: "treeItemSelected",
38
- id,
39
- ids,
40
- hasChildren: hasChildren(event.target)
41
- });
42
- const node = getNode(ids);
43
- if (node && node.href) navigate(node.href instanceof Array ? node.href[0] : node.href);
44
- };
45
- const handleToggle = (event, ids) => {
46
- dispatch({
47
- type: "treeItemExpanded",
48
- id,
49
- ids
50
- });
51
- };
52
- return /*#__PURE__*/_jsx(TreeView, {
53
- defaultCollapseIcon: /*#__PURE__*/_jsx(ArrowDropDownIcon, {}),
54
- defaultExpandIcon: /*#__PURE__*/_jsx(ArrowRightIcon, {}),
55
- sx: styles,
56
- selected: states.activeSecondaryItem || '',
57
- expanded: expanded,
58
- onNodeSelect: handleSelect,
59
- onNodeToggle: handleToggle,
60
- children: render(data)
61
- });
62
- function render(nodes) {
63
- return nodes ? nodes.map(node => /*#__PURE__*/_jsx(TreeItem, {
64
- nodeId: node.id,
65
- label: node.name,
66
- className: node.submenu.length > 0 ? HAS_CHILDREN : "",
67
- children: render(node.submenu)
68
- }, node.id)) : null;
69
- }
70
- function hasChildren(element) {
71
- const target = findTreeItemRoot(element);
72
- return target ? hasClass(target, HAS_CHILDREN) : false;
73
- }
74
- function findTreeItemRoot(element) {
75
- while (element) {
76
- if (hasClass(element, "MuiTreeItem-root")) break;
77
- element = element.parentElement;
78
- }
79
- return element;
80
- }
81
- function hasClass(element, className) {
82
- return [...element.classList].includes(className);
83
- }
84
- function getNode(id, nodes) {
85
- nodes = nodes || data;
86
- for (let node of nodes) {
87
- if (node.id === id) return node;
88
- if (node.submenu.length > 0) {
89
- const child = getNode(id, node.submenu);
90
- if (child) return child;
91
- }
92
- }
93
- return null;
94
- }
95
- }