@fe-free/core 6.0.5 → 6.0.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 +8 -0
- package/package.json +6 -6
- package/src/page_layout/index.tsx +4 -3
- package/src/page_layout/page_layout.stories.tsx +71 -24
- package/src/tailwind.css +13 -10
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fe-free/core",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.6",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "./src/index.ts",
|
|
6
|
-
"author": "",
|
|
7
5
|
"license": "ISC",
|
|
6
|
+
"author": "",
|
|
7
|
+
"main": "./src/index.ts",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public",
|
|
10
10
|
"registry": "https://registry.npmjs.org/"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@ant-design/x-markdown": "^2.1.3",
|
|
14
13
|
"@ant-design/x": "^2.1.3",
|
|
14
|
+
"@ant-design/x-markdown": "^2.1.3",
|
|
15
15
|
"@codemirror/lang-html": "^6.4.9",
|
|
16
16
|
"@codemirror/lang-javascript": "^6.2.4",
|
|
17
17
|
"@codemirror/lang-json": "^6.0.1",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"i18next-icu": "^2.4.1",
|
|
53
53
|
"react": "^19.2.0",
|
|
54
54
|
"react-i18next": "^16.4.0",
|
|
55
|
-
"@fe-free/
|
|
56
|
-
"@fe-free/
|
|
55
|
+
"@fe-free/icons": "6.0.6",
|
|
56
|
+
"@fe-free/tool": "6.0.6"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"i18n-extract": "rm -rf ./src/locales/zh-CN && npx i18next-cli extract"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { Fragment, useMemo } from 'react';
|
|
3
3
|
import { useSearchParams } from 'react-router-dom';
|
|
4
|
+
|
|
4
5
|
import type { TabsProps } from '../tabs';
|
|
5
6
|
import { Tabs } from '../tabs';
|
|
6
7
|
|
|
@@ -53,7 +54,7 @@ function PageLayout({
|
|
|
53
54
|
className={classNames(
|
|
54
55
|
{
|
|
55
56
|
'flex-none': !equalParts,
|
|
56
|
-
'min-w-0 flex-1
|
|
57
|
+
'min-w-0 flex-1 shrink-0 overflow-auto': equalParts,
|
|
57
58
|
},
|
|
58
59
|
startClassName,
|
|
59
60
|
)}
|
|
@@ -66,7 +67,7 @@ function PageLayout({
|
|
|
66
67
|
className={classNames(
|
|
67
68
|
'flex-1 overflow-auto',
|
|
68
69
|
{
|
|
69
|
-
'min-w-0
|
|
70
|
+
'min-w-0 shrink-0': equalParts,
|
|
70
71
|
},
|
|
71
72
|
childrenClassName,
|
|
72
73
|
)}
|
|
@@ -79,7 +80,7 @@ function PageLayout({
|
|
|
79
80
|
className={classNames(
|
|
80
81
|
{
|
|
81
82
|
'flex-none': !equalParts,
|
|
82
|
-
'min-w-0 flex-1
|
|
83
|
+
'min-w-0 flex-1 shrink-0 overflow-auto': equalParts,
|
|
83
84
|
},
|
|
84
85
|
endClassName,
|
|
85
86
|
)}
|
|
@@ -11,39 +11,86 @@ export default meta;
|
|
|
11
11
|
type Story = StoryObj<typeof PageLayout>;
|
|
12
12
|
|
|
13
13
|
export const Default: Story = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
render: () => {
|
|
15
|
+
return (
|
|
16
|
+
<div className="flex flex-col gap-4">
|
|
17
|
+
<div className="h-[200px] w-[500px]">
|
|
18
|
+
<PageLayout
|
|
19
|
+
start={<div className="h-full w-[100px] bg-red-500">start</div>}
|
|
20
|
+
end={<div className="h-full w-[100px] bg-green-500">end</div>}
|
|
21
|
+
>
|
|
22
|
+
<div className="h-full bg-blue-500">children</div>
|
|
23
|
+
</PageLayout>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div className="h-[200px] w-[500px]">
|
|
27
|
+
<PageLayout
|
|
28
|
+
start={<div className="h-full w-[100px] bg-red-500">start</div>}
|
|
29
|
+
end={<div className="h-full w-[100px] bg-green-500">end</div>}
|
|
30
|
+
>
|
|
31
|
+
<div className="h-full w-[2000px] bg-blue-500">children</div>
|
|
32
|
+
</PageLayout>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
18
36
|
},
|
|
19
37
|
};
|
|
20
38
|
|
|
21
39
|
export const DirectionVertical: Story = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
render: () => {
|
|
41
|
+
return (
|
|
42
|
+
<div className="flex gap-4">
|
|
43
|
+
<div className="h-[500px] w-[200px]">
|
|
44
|
+
<PageLayout
|
|
45
|
+
direction="vertical"
|
|
46
|
+
start={<div className="h-[100px] w-full bg-red-500">start</div>}
|
|
47
|
+
end={<div className="h-[100px] w-full bg-green-500">end</div>}
|
|
48
|
+
>
|
|
49
|
+
<div className="h-full bg-blue-500">children</div>
|
|
50
|
+
</PageLayout>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div className="h-[500px] w-[200px]">
|
|
54
|
+
<PageLayout
|
|
55
|
+
direction="vertical"
|
|
56
|
+
start={<div className="h-[100px] w-full bg-red-500">start</div>}
|
|
57
|
+
end={<div className="h-[100px] w-full bg-green-500">end</div>}
|
|
58
|
+
>
|
|
59
|
+
<div className="h-[2000px] w-full bg-blue-500">children</div>
|
|
60
|
+
</PageLayout>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
27
64
|
},
|
|
28
65
|
};
|
|
29
66
|
|
|
30
67
|
export const EqualParts: Story = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
68
|
+
render: () => {
|
|
69
|
+
return (
|
|
70
|
+
<div className="h-[200px] w-[500px]">
|
|
71
|
+
<PageLayout equalParts={true} className="bg-gray-200">
|
|
72
|
+
<div className="h-full bg-blue-500">children</div>
|
|
73
|
+
<div className="h-full w-[600px] bg-green-500">end</div>
|
|
74
|
+
</PageLayout>
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
37
77
|
},
|
|
38
78
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
79
|
+
|
|
80
|
+
export const ClassNamePadding: Story = {
|
|
81
|
+
render: () => {
|
|
82
|
+
return (
|
|
83
|
+
<div className="h-[200px] w-[500px]">
|
|
84
|
+
<PageLayout
|
|
85
|
+
startClassName="p-4 bg-red-200"
|
|
86
|
+
childrenClassName="p-4 bg-blue-200"
|
|
87
|
+
endClassName="p-4 bg-green-200"
|
|
88
|
+
start={<div className="h-full w-[100px] bg-red-500">start</div>}
|
|
89
|
+
end={<div className="h-full w-[100px] bg-green-500">end</div>}
|
|
90
|
+
>
|
|
91
|
+
<div className="h-full bg-blue-500">children</div>
|
|
92
|
+
</PageLayout>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
48
95
|
},
|
|
49
96
|
};
|
package/src/tailwind.css
CHANGED
|
@@ -38,17 +38,20 @@
|
|
|
38
38
|
-webkit-font-smoothing: antialiased;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
/* 仅 PC 端显示自定义滚动条 */
|
|
42
|
+
@media (width >= 768px) {
|
|
43
|
+
::-webkit-scrollbar {
|
|
44
|
+
width: 8px;
|
|
45
|
+
height: 8px;
|
|
46
|
+
}
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
::-webkit-scrollbar-thumb {
|
|
49
|
+
background: #ccc;
|
|
50
|
+
border-radius: 2px;
|
|
51
|
+
}
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
::-webkit-scrollbar-track {
|
|
54
|
+
background: transparent;
|
|
55
|
+
}
|
|
53
56
|
}
|
|
54
57
|
}
|