@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
@@ -1,65 +0,0 @@
1
- import { getMenuGroupStates, useSidebarContext } from './SidebarContext';
2
- import Accordion from '@mui/material/Accordion';
3
- import AccordionSummary from '@mui/material/AccordionSummary';
4
- import AccordionDetails from '@mui/material/AccordionDetails';
5
- import Typography from '@mui/material/Typography';
6
- import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
7
- import { variables } from '../variables';
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- import { jsxs as _jsxs } from "react/jsx-runtime";
10
- export default function MenuTreeGroup({
11
- id,
12
- title,
13
- children
14
- }) {
15
- const styles = {
16
- backgroundColor: variables.bodyBackgroundColor,
17
- boxShadow: 'none',
18
- '&:before': {
19
- display: 'none'
20
- },
21
- '&.Mui-expanded': {
22
- margin: 0
23
- },
24
- '.MuiSvgIcon-root': {
25
- width: '0.9em',
26
- height: '0.9em'
27
- },
28
- '.MuiAccordionSummary-root.Mui-expanded': {
29
- minHeight: '48px'
30
- },
31
- '.MuiAccordionSummary-content.Mui-expanded': {
32
- margin: 0
33
- },
34
- '.MuiAccordionDetails-root': {
35
- padding: '0 16px 0 8px'
36
- }
37
- };
38
- const {
39
- states,
40
- dispatch
41
- } = useSidebarContext();
42
- const expanded = getMenuGroupStates(states, id);
43
- const handleChange = (event, expanded) => {
44
- dispatch({
45
- type: "menuGroupExpanded",
46
- id,
47
- expanded
48
- });
49
- };
50
- return /*#__PURE__*/_jsxs(Accordion, {
51
- expanded: expanded,
52
- onChange: handleChange,
53
- square: true,
54
- sx: styles,
55
- children: [/*#__PURE__*/_jsx(AccordionSummary, {
56
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
57
- children: /*#__PURE__*/_jsx(Typography, {
58
- variant: "body2",
59
- children: title
60
- })
61
- }), /*#__PURE__*/_jsx(AccordionDetails, {
62
- children: children
63
- })]
64
- });
65
- }
@@ -1,36 +0,0 @@
1
- import { Divider, Stack } from '@mui/material';
2
- import MenuTreeGroup from './MenuTreeGroup';
3
- import MenuTree from './MenuTree';
4
- import styles from './css/sidebar.module.css';
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- export default function SecondaryMenu({
7
- sections,
8
- closed
9
- }) {
10
- return /*#__PURE__*/_jsx(Stack, {
11
- className: `${styles.secondary} ${closed ? styles.closed : styles.opened}`,
12
- children: sections.map((section, index) => {
13
- let jsx = [];
14
- jsx.push(index > 0 ? /*#__PURE__*/_jsx(Divider, {
15
- sx: {
16
- ml: 2,
17
- mr: 2
18
- }
19
- }, `${section.id}_${index}`) : null);
20
- jsx.push(section.name ? /*#__PURE__*/_jsx(MenuTreeGroup, {
21
- id: section.id,
22
- title: section.name,
23
- children: /*#__PURE__*/_jsx(MenuTree, {
24
- id: section.id,
25
- data: section.menu
26
- })
27
- }, section.id) : /*#__PURE__*/_jsx("div", {
28
- children: /*#__PURE__*/_jsx(MenuTree, {
29
- id: section.id,
30
- data: section.menu
31
- })
32
- }, section.id));
33
- return jsx;
34
- })
35
- });
36
- }
@@ -1,122 +0,0 @@
1
- import { createContext, useContext, useReducer } from "react";
2
- import { produce } from "immer";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- const SidebarContext = /*#__PURE__*/createContext();
5
- export function SidebarContextProvider({
6
- menu,
7
- icons,
8
- children
9
- }) {
10
- const [states, dispatch] = useReducer(reducer, initialStates);
11
- return /*#__PURE__*/_jsx(SidebarContext.Provider, {
12
- value: {
13
- menu,
14
- icons,
15
- states,
16
- dispatch
17
- },
18
- children: children
19
- });
20
- }
21
- export function useSidebarContext() {
22
- return useContext(SidebarContext);
23
- }
24
- export function getMenuGroupStates(states, id) {
25
- return states.menuGroupsExpanded[id] !== undefined ? states.menuGroupsExpanded[id] : true;
26
- }
27
- export function getMenuTreeStates(states, id) {
28
- return states.menuTrees[id] || emptyState();
29
- }
30
- function reducer(states, action) {
31
- const {
32
- id,
33
- type
34
- } = action;
35
- switch (type) {
36
- case 'secondaryMenuToggled':
37
- return produce(states, draft => {
38
- draft.menuClosed = !states.menuClosed;
39
- });
40
- case 'menuGroupExpanded':
41
- return produce(states, draft => {
42
- draft.menuGroupsExpanded[id] = action.expanded;
43
- });
44
- case 'treeItemSelected':
45
- return produce(states, draft => {
46
- for (const key in draft.menuTrees) {
47
- draft.menuTrees[key].selected = [];
48
- }
49
- if (!(id in draft.menuTrees)) draft.menuTrees[id] = emptyState();
50
- draft.menuTrees[id].selected = action.ids;
51
- });
52
- case 'treeItemExpanded':
53
- return produce(states, draft => {
54
- if (!(id in draft.menuTrees)) draft.menuTrees[id] = emptyState();
55
- draft.menuTrees[id].expanded = [...action.ids];
56
- });
57
- case 'updateActiveItems':
58
- return produce(states, draft => {
59
- updateActiveItems(draft, action.menu, action.href);
60
- });
61
- default:
62
- throw new Error(`Undefined Sidebar Action Type: ${JSON.stringify(action)}`);
63
- }
64
- }
65
- function emptyState() {
66
- return {
67
- selected: [],
68
- expanded: []
69
- };
70
- }
71
- const initialStates = {
72
- activePrimaryItem: undefined,
73
- activeSecondaryItem: undefined,
74
- menuClosed: false,
75
- menuGroupsExpanded: {},
76
- menuTrees: {}
77
- };
78
- function updateActiveItems(draft, menu, href) {
79
- draft.activePrimaryItem = undefined;
80
- draft.activeSecondaryItem = undefined;
81
- for (let item of menu) {
82
- if (item.href === href) {
83
- draft.activePrimaryItem = item.id;
84
- return;
85
- }
86
- if (updateActiveSection(item.sections)) {
87
- draft.activePrimaryItem = item.id;
88
- return;
89
- }
90
- }
91
- function updateActiveSection(sections) {
92
- if (!sections) return;
93
- for (let section of sections) {
94
- if (startsWith(section.href)) {
95
- draft.activeSecondaryItem = section.id;
96
- return true;
97
- }
98
- if (updateActiveSubmenuItems(section.id, section.menu)) {
99
- draft.menuGroupsExpanded[section.id] = true;
100
- return true;
101
- }
102
- }
103
- }
104
- function updateActiveSubmenuItems(id, submenu) {
105
- if (!submenu) return;
106
- for (let item of submenu) {
107
- if (startsWith(item.href)) {
108
- if (!(id in draft.menuTrees)) draft.menuTrees[id] = emptyState();
109
- draft.activeSecondaryItem = item.id;
110
- return true;
111
- }
112
- if (updateActiveSubmenuItems(id, item.submenu)) {
113
- draft.menuTrees[id].expanded.push(item.id);
114
- return true;
115
- }
116
- }
117
- }
118
- function startsWith(hrefs) {
119
- const menuHrefs = hrefs instanceof Array ? hrefs : [hrefs];
120
- return menuHrefs.some(menuHref => href.startsWith(menuHref));
121
- }
122
- }
@@ -1,80 +0,0 @@
1
- .container {
2
- display: flex;
3
- flex-direction: column;
4
- position: absolute;
5
- width: var(--primary-menu-width);
6
- height: 100%;
7
- border-right: 1px solid #dee2e6;
8
- z-index: 30;
9
- transition-property: width background-color;
10
- transition-duration: .2s;
11
- }
12
- .container:hover {
13
- width: 240px;
14
- background-color: #fff;
15
- box-shadow: 1px 1px 12px #dadce0;
16
- }
17
- .container a {
18
- text-decoration: none;
19
- cursor: pointer;
20
- }
21
- .container a:first-child {
22
- padding-top: 10px;
23
- }
24
- .container a:last-child {
25
- padding-bottom: 10px;
26
- }
27
-
28
- .nav-item {
29
- position: relative;
30
- display: flex;
31
- height: 48px;
32
- align-items: center;
33
- color: #495057;
34
- }
35
- .nav-item:hover {
36
- /*border-radius: 0 48px 48px 0;*/
37
- background-color: #e9ecef;
38
- }
39
- .nav-item.active {
40
- /*color: #fff;*/
41
- /*border-left: 5px solid #0d6efd;*/
42
- }
43
- .container:hover .nav-item.active {
44
- /*border-radius: 0 48px 48px 0;*/
45
- /*background-color: #0d6efd !important;*/
46
- }
47
-
48
- .highlight {
49
- position: absolute;
50
- left: 0px;
51
- width: 5px;
52
- height: 36px;
53
- z-index: 100;
54
- /*border-radius: 50%;*/
55
- background-color: #0d6efd;
56
- transition-property: height;
57
- transition-duration: .2s;
58
- }
59
- .container:hover .highlight {
60
- height: 48px;
61
- /*display: none;*/
62
- }
63
-
64
- .icon {
65
- margin: 4px 15px 0px 16px;
66
- }
67
- .icon > svg {
68
- width: 24px;
69
- height: 24px;
70
- }
71
-
72
- .text {
73
- font-size: .9rem;
74
- display: none;
75
- white-space: nowrap;
76
- overflow-x: hidden;
77
- }
78
- .container:hover .text {
79
- display: block;
80
- }
@@ -1,50 +0,0 @@
1
- .container {
2
- display: flex;
3
- position: relative;
4
- background-color: var(--body-background-color);
5
- transition: width .2s;
6
- }
7
- .container.opened {
8
- width: calc(var(--primary-menu-width) + var(--secondary-menu-width));
9
- }
10
- .container.closed {
11
- width: var(--primary-menu-width);
12
- }
13
-
14
-
15
- .secondary {
16
- position: absolute;
17
- left: var(--primary-menu-width);
18
- height: 100%;
19
- z-index: 0;
20
- white-space: nowrap;
21
- overflow-x: hidden;
22
- }
23
- .secondary.opened {
24
- width: var(--secondary-menu-width);
25
- }
26
- .secondary.closed {
27
- width: 0px;
28
- overflow: hidden;
29
- }
30
-
31
- .toggler {
32
- position: absolute;
33
- bottom: 12px;
34
- width: 24px;
35
- height: 32px;
36
- padding-top: 2px;
37
- z-index: 15;
38
- cursor: pointer;
39
- transition: left .2s;
40
- }
41
- .toggler.opened {
42
- left: 264px;
43
- }
44
- .toggler.closed {
45
- left: var(--primary-menu-width);
46
- background-color: #f1f3f4;
47
- border: unset;
48
- border-radius: 0 50% 50% 0/0 50% 50% 0;
49
- box-shadow: 1px 1px 1px 1px #e8eaed;
50
- }
package/dist/variables.js DELETED
@@ -1,6 +0,0 @@
1
- export const variables = {
2
- bodyBackgroundColor: '#f8f9fa',
3
- gnbHeight: 64,
4
- primaryMenuWidth: 56,
5
- secondaryMenuWidth: 256
6
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes