@fe-free/core 4.1.43 → 4.1.44
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fe-free/core",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.44",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"author": "",
|
|
@@ -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/icons": "4.1.
|
|
56
|
-
"@fe-free/tool": "4.1.
|
|
55
|
+
"@fe-free/icons": "4.1.44",
|
|
56
|
+
"@fe-free/tool": "4.1.44"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"i18n-extract": "rm -rf ./src/locales/zh-CN && npx i18next-cli extract"
|
package/src/crud/helper.tsx
CHANGED
|
@@ -15,11 +15,17 @@ function OperateBtn({
|
|
|
15
15
|
}) {
|
|
16
16
|
if (disabled) {
|
|
17
17
|
if (operateText) {
|
|
18
|
-
return
|
|
18
|
+
return (
|
|
19
|
+
<span className="fec-crud-of-list-operate-btn cursor-not-allowed text-03">
|
|
20
|
+
{operateText}
|
|
21
|
+
</span>
|
|
22
|
+
);
|
|
19
23
|
} else {
|
|
20
24
|
return (
|
|
21
25
|
<Tooltip title={title}>
|
|
22
|
-
<span className="cursor-not-allowed text-lg text-03">
|
|
26
|
+
<span className="fec-crud-of-list-operate-btn cursor-not-allowed text-lg text-03">
|
|
27
|
+
{icon}
|
|
28
|
+
</span>
|
|
23
29
|
</Tooltip>
|
|
24
30
|
);
|
|
25
31
|
}
|
|
@@ -27,7 +33,7 @@ function OperateBtn({
|
|
|
27
33
|
|
|
28
34
|
if (operateText) {
|
|
29
35
|
return (
|
|
30
|
-
<span className="cursor-pointer text-primary" onClick={onClick}>
|
|
36
|
+
<span className="fec-crud-of-list-operate-btn cursor-pointer text-primary" onClick={onClick}>
|
|
31
37
|
{operateText}
|
|
32
38
|
</span>
|
|
33
39
|
);
|
|
@@ -35,7 +41,10 @@ function OperateBtn({
|
|
|
35
41
|
|
|
36
42
|
return (
|
|
37
43
|
<Tooltip title={title}>
|
|
38
|
-
<span
|
|
44
|
+
<span
|
|
45
|
+
className="fec-crud-of-list-operate-btn cursor-pointer text-lg text-primary"
|
|
46
|
+
onClick={onClick}
|
|
47
|
+
>
|
|
39
48
|
{icon}
|
|
40
49
|
</span>
|
|
41
50
|
</Tooltip>
|
|
@@ -54,6 +54,7 @@ export const Basic: Story = {
|
|
|
54
54
|
ref={ref}
|
|
55
55
|
actions={[]}
|
|
56
56
|
tableProps={{
|
|
57
|
+
rowKey: 'id',
|
|
57
58
|
columns,
|
|
58
59
|
request: fakeRequest,
|
|
59
60
|
}}
|
|
@@ -88,6 +89,42 @@ export const WithSearch: Story = {
|
|
|
88
89
|
<CRUDOfList
|
|
89
90
|
actions={['delete']}
|
|
90
91
|
tableProps={{
|
|
92
|
+
rowKey: 'id',
|
|
93
|
+
columns,
|
|
94
|
+
request: fakeRequest,
|
|
95
|
+
}}
|
|
96
|
+
requestDeleteByRecord={fakeDeleteByRecord}
|
|
97
|
+
deleteProps={{
|
|
98
|
+
nameIndex: 'name',
|
|
99
|
+
}}
|
|
100
|
+
detailForm={() => (
|
|
101
|
+
<>
|
|
102
|
+
<ProFormText name="name" label="名字" required rules={[{ required: true }]} />
|
|
103
|
+
</>
|
|
104
|
+
)}
|
|
105
|
+
requestCreateByValues={fakeCreate}
|
|
106
|
+
/>
|
|
107
|
+
);
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export const WithToolbarSticky: Story = {
|
|
112
|
+
render: () => {
|
|
113
|
+
const columns = [
|
|
114
|
+
{
|
|
115
|
+
title: '名字(省略)',
|
|
116
|
+
dataIndex: 'name',
|
|
117
|
+
search: true,
|
|
118
|
+
ellipsis: true,
|
|
119
|
+
},
|
|
120
|
+
];
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<CRUDOfList
|
|
124
|
+
toolbarSticky
|
|
125
|
+
actions={['delete']}
|
|
126
|
+
tableProps={{
|
|
127
|
+
rowKey: 'id',
|
|
91
128
|
columns,
|
|
92
129
|
request: fakeRequest,
|
|
93
130
|
}}
|
|
@@ -121,6 +158,7 @@ export const WithCreateDelete: Story = {
|
|
|
121
158
|
<CRUDOfList
|
|
122
159
|
actions={['create', 'delete']}
|
|
123
160
|
tableProps={{
|
|
161
|
+
rowKey: 'id',
|
|
124
162
|
columns,
|
|
125
163
|
request: fakeRequest,
|
|
126
164
|
}}
|
|
@@ -153,6 +191,7 @@ export const NoSearch: Story = {
|
|
|
153
191
|
<CRUDOfList
|
|
154
192
|
actions={['create', 'delete']}
|
|
155
193
|
tableProps={{
|
|
194
|
+
rowKey: 'id',
|
|
156
195
|
columns,
|
|
157
196
|
request: fakeRequest,
|
|
158
197
|
}}
|
|
@@ -12,7 +12,7 @@ interface CRUDOfListProps<
|
|
|
12
12
|
DataSource extends Record<string, any> = any,
|
|
13
13
|
Key extends string | number = string,
|
|
14
14
|
> extends CRUDProps<DataSource, Key> {
|
|
15
|
-
|
|
15
|
+
toolbarSticky?: boolean;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function useTips(props) {
|
|
@@ -104,6 +104,7 @@ function CRUDOfList(props: CRUDOfListProps) {
|
|
|
104
104
|
{
|
|
105
105
|
// 先这样实现
|
|
106
106
|
'fec-crud-of-list-no-toolbar': !searchDataIndex && !props.actions.includes('create'),
|
|
107
|
+
'fec-crud-of-list-toolbar-sticky': props.toolbarSticky,
|
|
107
108
|
},
|
|
108
109
|
props.className,
|
|
109
110
|
)}
|
|
@@ -34,4 +34,31 @@
|
|
|
34
34
|
padding-block: 0;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
|
|
38
|
+
&.fec-crud-of-list-toolbar-sticky {
|
|
39
|
+
.ant-pro-table-list-toolbar {
|
|
40
|
+
position: sticky;
|
|
41
|
+
top: 0;
|
|
42
|
+
z-index: 10;
|
|
43
|
+
background-color: #fff;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.fec-crud-of-list-operate-btn {
|
|
48
|
+
font-size: 14px !important;
|
|
49
|
+
line-height: var(--ant-line-height) !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ant-table-bordered {
|
|
53
|
+
.ant-table-container {
|
|
54
|
+
border-top: none !important;
|
|
55
|
+
border-left: none !important;
|
|
56
|
+
|
|
57
|
+
.ant-table-row {
|
|
58
|
+
.ant-table-cell {
|
|
59
|
+
border-inline-end: none !important;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
37
64
|
}
|