listpage-next 0.0.37 → 0.0.38
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/components/Menu/index.js +1 -1
- package/dist/components/Page/components/ListPage/index.d.ts +1 -0
- package/dist/components/Page/components/ListPage/index.js +3 -2
- package/dist/components/Page/components/PageContainer/index.d.ts +3 -1
- package/dist/components/Page/components/PageContainer/index.js +25 -2
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ export interface ListPageProps {
|
|
|
6
6
|
filterProps?: FilterFormProps;
|
|
7
7
|
toolbar?: React.ReactNode;
|
|
8
8
|
body?: React.ReactNode;
|
|
9
|
+
floats?: React.ReactNode[];
|
|
9
10
|
style?: React.CSSProperties;
|
|
10
11
|
}
|
|
11
12
|
export declare const ListPage: (props: ListPageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { Card } from "antd";
|
|
|
4
4
|
import { FilterForm } from "../../../FilterGroup/components/FilterForm/index.js";
|
|
5
5
|
import { BodySection, FilterSection, HeaderSection, ListPageContainer, Title, ToolbarSection } from "./styles.js";
|
|
6
6
|
const ListPage = (props)=>{
|
|
7
|
-
const { title, extra, filterProps, toolbar, body, style } = props;
|
|
7
|
+
const { title, extra, filterProps, toolbar, body, style, floats } = props;
|
|
8
8
|
const filter = useMemo(()=>{
|
|
9
9
|
if (props.filter) return props.filter;
|
|
10
10
|
if (filterProps) return /*#__PURE__*/ jsx(Card, {
|
|
@@ -38,7 +38,8 @@ const ListPage = (props)=>{
|
|
|
38
38
|
}),
|
|
39
39
|
/*#__PURE__*/ jsx(BodySection, {
|
|
40
40
|
children: body
|
|
41
|
-
})
|
|
41
|
+
}),
|
|
42
|
+
floats
|
|
42
43
|
]
|
|
43
44
|
});
|
|
44
45
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { SiderProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
export interface PageContainerProps {
|
|
3
4
|
sider?: React.ReactNode;
|
|
4
5
|
header?: React.ReactNode;
|
|
5
6
|
content?: React.ReactNode;
|
|
7
|
+
logo?: React.ReactNode;
|
|
6
8
|
siderProps?: SiderProps;
|
|
7
9
|
}
|
|
8
|
-
export declare const PageContainer: ({ sider, header, content, siderProps, }: PageContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const PageContainer: ({ logo, sider, header, content, siderProps, }: PageContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,12 +11,26 @@ const LayoutStyled = styled_components(Layout)`
|
|
|
11
11
|
const SiderStyled = styled_components(Sider)`
|
|
12
12
|
background-color: #fff;
|
|
13
13
|
border-right: 1px solid #e5e5e5;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
14
16
|
`;
|
|
15
17
|
const ContentStyled = styled_components(Content)`
|
|
16
18
|
background-color: #fff;
|
|
17
19
|
overflow: auto;
|
|
18
20
|
`;
|
|
19
|
-
const
|
|
21
|
+
const SiderContentWrapper = styled_components.div`
|
|
22
|
+
flex: 1;
|
|
23
|
+
overflow: auto;
|
|
24
|
+
`;
|
|
25
|
+
const SiderContent = styled_components.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
`;
|
|
30
|
+
const LogoContentWrapper = styled_components.div`
|
|
31
|
+
flex: 0;
|
|
32
|
+
`;
|
|
33
|
+
const PageContainer = ({ logo, sider, header, content, siderProps })=>{
|
|
20
34
|
const [collapsed, setCollapsed] = useState(false);
|
|
21
35
|
return /*#__PURE__*/ jsx(PageContextProvider, {
|
|
22
36
|
collapsed: collapsed,
|
|
@@ -37,7 +51,16 @@ const PageContainer = ({ sider, header, content, siderProps })=>{
|
|
|
37
51
|
onCollapse: (collapsed)=>{
|
|
38
52
|
setCollapsed(collapsed);
|
|
39
53
|
},
|
|
40
|
-
children:
|
|
54
|
+
children: /*#__PURE__*/ jsxs(SiderContent, {
|
|
55
|
+
children: [
|
|
56
|
+
logo && /*#__PURE__*/ jsx(LogoContentWrapper, {
|
|
57
|
+
children: logo
|
|
58
|
+
}),
|
|
59
|
+
/*#__PURE__*/ jsx(SiderContentWrapper, {
|
|
60
|
+
children: sider
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
})
|
|
41
64
|
}),
|
|
42
65
|
/*#__PURE__*/ jsxs(Layout, {
|
|
43
66
|
hasSider: false,
|