@codebit-programando-solucoes/codebit-web-antd 1.1.24 → 1.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +58 -49
- package/dist/index.css +1 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1027,7 +1027,7 @@ var __webpack_exports__ = {};
|
|
|
1027
1027
|
menuDescription: "menuDescription-d6BFBO",
|
|
1028
1028
|
menuSpacer: "menuSpacer-RIB3II",
|
|
1029
1029
|
versionMenu: "versionMenu-NM4uyG",
|
|
1030
|
-
|
|
1030
|
+
bottomMenu: "bottomMenu-VtOktS",
|
|
1031
1031
|
header: "header-vgc67L",
|
|
1032
1032
|
mobile: "mobile-mKGxb5",
|
|
1033
1033
|
headerSpace: "headerSpace-Fd_iha",
|
|
@@ -1036,7 +1036,7 @@ var __webpack_exports__ = {};
|
|
|
1036
1036
|
const { Header, Sider, Content } = external_antd_namespaceObject.Layout;
|
|
1037
1037
|
const { Text } = external_antd_namespaceObject.Typography;
|
|
1038
1038
|
function LoggedMainContainer({ children }) {
|
|
1039
|
-
const [collapsed, setCollapsed] = (0, external_react_.useState)(
|
|
1039
|
+
const [collapsed, setCollapsed] = (0, external_react_.useState)(true);
|
|
1040
1040
|
const [isMobile, setIsMobile] = (0, external_react_.useState)(false);
|
|
1041
1041
|
const [drawerVisible, setDrawerVisible] = (0, external_react_.useState)(false);
|
|
1042
1042
|
const [secondarySidebarDrawerVisible, setSecondarySidebarDrawerVisible] = (0, external_react_.useState)(false);
|
|
@@ -1051,7 +1051,7 @@ var __webpack_exports__ = {};
|
|
|
1051
1051
|
const systemTheme = isDarkMode ? 'dark' : 'light';
|
|
1052
1052
|
const filteredMenuItems = (0, external_react_.useMemo)(()=>menuItems(user).filter((item)=>{
|
|
1053
1053
|
if (!item.roles) return true;
|
|
1054
|
-
if (!user
|
|
1054
|
+
if (!user?.roles) return false;
|
|
1055
1055
|
if (item.roles) return item.roles.some((role)=>user.roles.includes(role));
|
|
1056
1056
|
return false;
|
|
1057
1057
|
}), [
|
|
@@ -1105,16 +1105,16 @@ var __webpack_exports__ = {};
|
|
|
1105
1105
|
disabled: true,
|
|
1106
1106
|
items: [
|
|
1107
1107
|
{
|
|
1108
|
-
icon: collapsed ? `${t('LoggedMainContainer.version')}: ${version}
|
|
1108
|
+
icon: collapsed ? version : `${t('LoggedMainContainer.version')}: ${version}`,
|
|
1109
1109
|
title: ''
|
|
1110
1110
|
}
|
|
1111
1111
|
]
|
|
1112
1112
|
}),
|
|
1113
1113
|
/*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Menu, {
|
|
1114
1114
|
theme: systemTheme,
|
|
1115
|
-
mode: '
|
|
1115
|
+
mode: 'inline',
|
|
1116
1116
|
onClick: handleLogout,
|
|
1117
|
-
className: LoggedMainContainer_module.
|
|
1117
|
+
className: LoggedMainContainer_module.bottomMenu,
|
|
1118
1118
|
items: [
|
|
1119
1119
|
{
|
|
1120
1120
|
key: 'logout',
|
|
@@ -1126,51 +1126,60 @@ var __webpack_exports__ = {};
|
|
|
1126
1126
|
})
|
|
1127
1127
|
]
|
|
1128
1128
|
});
|
|
1129
|
+
console.debug('secondarySidebar', secondarySidebar);
|
|
1130
|
+
const renderMenuContent = ()=>{
|
|
1131
|
+
if (isMobile) return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Drawer, {
|
|
1132
|
+
placement: 'left',
|
|
1133
|
+
onClose: ()=>setDrawerVisible(false),
|
|
1134
|
+
open: drawerVisible,
|
|
1135
|
+
width: 250,
|
|
1136
|
+
className: LoggedMainContainer_module.drawer,
|
|
1137
|
+
classNames: {
|
|
1138
|
+
body: LoggedMainContainer_module.drawerBody
|
|
1139
|
+
},
|
|
1140
|
+
children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Flex, {
|
|
1141
|
+
vertical: true,
|
|
1142
|
+
className: LoggedMainContainer_module.drawerFlex,
|
|
1143
|
+
children: menuContent
|
|
1144
|
+
})
|
|
1145
|
+
});
|
|
1146
|
+
return /*#__PURE__*/ (0, jsx_runtime.jsx)(Sider, {
|
|
1147
|
+
theme: systemTheme,
|
|
1148
|
+
trigger: null,
|
|
1149
|
+
collapsible: true,
|
|
1150
|
+
collapsed: collapsed,
|
|
1151
|
+
breakpoint: 'lg',
|
|
1152
|
+
collapsedWidth: 80,
|
|
1153
|
+
className: LoggedMainContainer_module.sider,
|
|
1154
|
+
children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Layout, {
|
|
1155
|
+
className: LoggedMainContainer_module.siderLayout,
|
|
1156
|
+
children: menuContent
|
|
1157
|
+
})
|
|
1158
|
+
});
|
|
1159
|
+
};
|
|
1160
|
+
const renderSecondarySidebar = ()=>{
|
|
1161
|
+
if (!secondarySidebar) return null;
|
|
1162
|
+
if (isMobile) return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Drawer, {
|
|
1163
|
+
placement: 'right',
|
|
1164
|
+
onClose: ()=>setSecondarySidebarDrawerVisible(false),
|
|
1165
|
+
open: secondarySidebarDrawerVisible,
|
|
1166
|
+
width: 280,
|
|
1167
|
+
className: LoggedMainContainer_module.drawer,
|
|
1168
|
+
title: null,
|
|
1169
|
+
closeIcon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.CloseOutlined, {}),
|
|
1170
|
+
children: secondarySidebar(user)
|
|
1171
|
+
});
|
|
1172
|
+
return /*#__PURE__*/ (0, jsx_runtime.jsx)(Sider, {
|
|
1173
|
+
theme: systemTheme,
|
|
1174
|
+
width: secondarySidebarWidth,
|
|
1175
|
+
children: secondarySidebar(user)
|
|
1176
|
+
});
|
|
1177
|
+
};
|
|
1129
1178
|
return /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Layout, {
|
|
1130
1179
|
className: LoggedMainContainer_module.layout,
|
|
1131
1180
|
children: [
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
onClose: ()=>setDrawerVisible(false),
|
|
1135
|
-
open: drawerVisible,
|
|
1136
|
-
width: 250,
|
|
1137
|
-
className: LoggedMainContainer_module.drawer,
|
|
1138
|
-
classNames: {
|
|
1139
|
-
body: LoggedMainContainer_module.drawerBody
|
|
1140
|
-
},
|
|
1141
|
-
children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Flex, {
|
|
1142
|
-
vertical: true,
|
|
1143
|
-
className: LoggedMainContainer_module.drawerFlex,
|
|
1144
|
-
children: menuContent
|
|
1145
|
-
})
|
|
1146
|
-
}) : /*#__PURE__*/ (0, jsx_runtime.jsx)(Sider, {
|
|
1147
|
-
theme: systemTheme,
|
|
1148
|
-
trigger: null,
|
|
1149
|
-
collapsible: true,
|
|
1150
|
-
collapsed: !collapsed,
|
|
1151
|
-
breakpoint: 'lg',
|
|
1152
|
-
collapsedWidth: 80,
|
|
1153
|
-
className: LoggedMainContainer_module.sider,
|
|
1154
|
-
children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Layout, {
|
|
1155
|
-
className: LoggedMainContainer_module.siderLayout,
|
|
1156
|
-
children: menuContent
|
|
1157
|
-
})
|
|
1158
|
-
}),
|
|
1159
|
-
secondarySidebar && !isMobile ? /*#__PURE__*/ (0, jsx_runtime.jsx)(Sider, {
|
|
1160
|
-
theme: systemTheme,
|
|
1161
|
-
width: secondarySidebarWidth,
|
|
1162
|
-
className: `${LoggedMainContainer_module.secondarySidebar} ${isDarkMode ? LoggedMainContainer_module.secondarySidebarDark : ''}`,
|
|
1163
|
-
children: secondarySidebar(user)
|
|
1164
|
-
}) : /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Drawer, {
|
|
1165
|
-
placement: 'right',
|
|
1166
|
-
onClose: ()=>setSecondarySidebarDrawerVisible(false),
|
|
1167
|
-
open: secondarySidebarDrawerVisible,
|
|
1168
|
-
width: 280,
|
|
1169
|
-
className: LoggedMainContainer_module.drawer,
|
|
1170
|
-
title: null,
|
|
1171
|
-
closeIcon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.CloseOutlined, {}),
|
|
1172
|
-
children: secondarySidebar(user)
|
|
1173
|
-
}),
|
|
1181
|
+
renderMenuContent(),
|
|
1182
|
+
renderSecondarySidebar(),
|
|
1174
1183
|
/*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Layout, {
|
|
1175
1184
|
children: [
|
|
1176
1185
|
/*#__PURE__*/ (0, jsx_runtime.jsxs)(Header, {
|
|
@@ -1193,7 +1202,7 @@ var __webpack_exports__ = {};
|
|
|
1193
1202
|
children: [
|
|
1194
1203
|
secondarySidebar && isMobile && /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
|
|
1195
1204
|
type: 'text',
|
|
1196
|
-
icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.
|
|
1205
|
+
icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.WechatOutlined, {}),
|
|
1197
1206
|
onClick: ()=>setSecondarySidebarDrawerVisible(true)
|
|
1198
1207
|
}),
|
|
1199
1208
|
!isMobile && /*#__PURE__*/ (0, jsx_runtime.jsx)(Text, {
|
package/dist/index.css
CHANGED
|
@@ -151,13 +151,9 @@ html.dark-theme {
|
|
|
151
151
|
display: flex;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
.
|
|
154
|
+
.bottomMenu-VtOktS {
|
|
155
155
|
border-top: 1px solid var(--antd-color-split);
|
|
156
156
|
background: none;
|
|
157
|
-
justify-content: center;
|
|
158
|
-
align-items: center;
|
|
159
|
-
margin-top: auto;
|
|
160
|
-
display: flex;
|
|
161
157
|
}
|
|
162
158
|
|
|
163
159
|
.header-vgc67L {
|