@fe-free/core 2.1.5 → 2.1.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @fe-free/core
2
2
 
3
+ ## 2.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: page layout
8
+ - @fe-free/tool@2.1.6
9
+
3
10
  ## 2.1.5
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fe-free/core",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "",
5
5
  "main": "./src/index.ts",
6
6
  "author": "",
@@ -39,7 +39,7 @@
39
39
  "remark-gfm": "^4.0.1",
40
40
  "vanilla-jsoneditor": "^0.23.1",
41
41
  "zustand": "^4.5.4",
42
- "@fe-free/tool": "2.1.5"
42
+ "@fe-free/tool": "2.1.6"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@ant-design/pro-components": "^2.8.7",
package/src/index.ts CHANGED
@@ -27,6 +27,7 @@ export {
27
27
  proFormSelectSearchProps,
28
28
  } from './form';
29
29
  export { Markdown } from './markdown';
30
+ export { PageLayout } from './page_layout';
30
31
  export { Table } from './table';
31
32
  export type { TableProps } from './table';
32
33
  export { useLocalforageState } from './use_localforage_state';
@@ -0,0 +1,36 @@
1
+ import cn from 'classnames';
2
+
3
+ interface PageLayoutProps {
4
+ direction?: 'horizontal' | 'vertical';
5
+ start?: React.ReactNode;
6
+ children?: React.ReactNode;
7
+ end?: React.ReactNode;
8
+ className?: string;
9
+ }
10
+
11
+ function PageLayout({
12
+ direction = 'horizontal',
13
+ start,
14
+ children,
15
+ end,
16
+ className,
17
+ }: PageLayoutProps) {
18
+ return (
19
+ <div
20
+ className={cn(
21
+ 'flex w-full h-full',
22
+ {
23
+ 'flex-row': direction === 'horizontal',
24
+ 'flex-col': direction === 'vertical',
25
+ },
26
+ className,
27
+ )}
28
+ >
29
+ <div className="flex-none">{start}</div>
30
+ <div className="flex-1 overflow-auto">{children}</div>
31
+ <div className="flex-none">{end}</div>
32
+ </div>
33
+ );
34
+ }
35
+
36
+ export { PageLayout };