@fe-free/core 3.0.23 → 3.0.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/CHANGELOG.md +14 -0
- package/package.json +2 -2
- package/src/crud/crud.tsx +35 -19
- package/src/crud/crud_delete.tsx +11 -5
- package/src/crud/table/index.tsx +1 -0
- package/src/crud/table/style.scss +22 -0
- package/src/form/form_list/form_list.tsx +8 -1
- package/src/form/index.tsx +8 -1
- package/src/index.ts +3 -0
- package/src/tree/file_tree.tsx +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fe-free/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.25",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"author": "",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"safe-stable-stringify": "^2.5.0",
|
|
42
42
|
"vanilla-jsoneditor": "^0.23.1",
|
|
43
43
|
"zustand": "^4.5.4",
|
|
44
|
-
"@fe-free/tool": "3.0.
|
|
44
|
+
"@fe-free/tool": "3.0.25"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@ant-design/pro-components": "2.8.9",
|
package/src/crud/crud.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EditOutlined, EyeOutlined } from '@ant-design/icons';
|
|
2
2
|
import type { ActionType } from '@ant-design/pro-components';
|
|
3
|
-
import { Button, message } from 'antd';
|
|
3
|
+
import { Button, message, Tooltip } from 'antd';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { isString } from 'lodash-es';
|
|
6
6
|
import { useCallback, useImperativeHandle, useMemo, useRef } from 'react';
|
|
@@ -122,9 +122,11 @@ function CRUD<DataSource extends Record<string, any> = any, Key extends string |
|
|
|
122
122
|
const disabled = readProps?.operateIsDisabled?.(record) || false;
|
|
123
123
|
if (disabled) {
|
|
124
124
|
btns.push(
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
<Tooltip title={readProps?.operateText || '查看'}>
|
|
126
|
+
<span key="read" className="cursor-not-allowed text-03">
|
|
127
|
+
{readProps?.operateText || <EyeOutlined />}
|
|
128
|
+
</span>
|
|
129
|
+
</Tooltip>,
|
|
128
130
|
);
|
|
129
131
|
} else {
|
|
130
132
|
btns.push(
|
|
@@ -133,7 +135,11 @@ function CRUD<DataSource extends Record<string, any> = any, Key extends string |
|
|
|
133
135
|
id={record[idField]}
|
|
134
136
|
record={record}
|
|
135
137
|
onSuccess={handleReload}
|
|
136
|
-
trigger={
|
|
138
|
+
trigger={
|
|
139
|
+
<Tooltip title={readProps?.operateText || '查看'}>
|
|
140
|
+
<a>{readProps?.operateText || <EyeOutlined />}</a>
|
|
141
|
+
</Tooltip>
|
|
142
|
+
}
|
|
137
143
|
action="read"
|
|
138
144
|
{...detailProps}
|
|
139
145
|
/>,
|
|
@@ -148,19 +154,23 @@ function CRUD<DataSource extends Record<string, any> = any, Key extends string |
|
|
|
148
154
|
const disabled = readProps?.operateIsDisabled?.(record) || false;
|
|
149
155
|
if (disabled) {
|
|
150
156
|
btns.push(
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
|
|
157
|
+
<Tooltip title={readProps?.operateText || '查看'}>
|
|
158
|
+
<span key="read" className="cursor-not-allowed text-03">
|
|
159
|
+
{readProps?.operateText || <EyeOutlined />}
|
|
160
|
+
</span>
|
|
161
|
+
</Tooltip>,
|
|
154
162
|
);
|
|
155
163
|
} else {
|
|
156
164
|
btns.push(
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
<Tooltip title={readProps?.operateText || '查看'}>
|
|
166
|
+
<Link
|
|
167
|
+
key="read_detail"
|
|
168
|
+
to={`./detail/${record[detailIdIndex || 'id']}`}
|
|
169
|
+
target={readProps?.target}
|
|
170
|
+
>
|
|
171
|
+
{readProps?.operateText || <EyeOutlined />}
|
|
172
|
+
</Link>
|
|
173
|
+
</Tooltip>,
|
|
164
174
|
);
|
|
165
175
|
}
|
|
166
176
|
}
|
|
@@ -173,9 +183,11 @@ function CRUD<DataSource extends Record<string, any> = any, Key extends string |
|
|
|
173
183
|
|
|
174
184
|
if (disabled) {
|
|
175
185
|
btns.push(
|
|
176
|
-
<
|
|
177
|
-
|
|
178
|
-
|
|
186
|
+
<Tooltip title={updateProps?.operateText || '编辑'}>
|
|
187
|
+
<span key="update" className="cursor-not-allowed text-03">
|
|
188
|
+
{updateProps?.operateText || <EditOutlined />}
|
|
189
|
+
</span>
|
|
190
|
+
</Tooltip>,
|
|
179
191
|
);
|
|
180
192
|
} else {
|
|
181
193
|
btns.push(
|
|
@@ -184,7 +196,11 @@ function CRUD<DataSource extends Record<string, any> = any, Key extends string |
|
|
|
184
196
|
id={record[idField]}
|
|
185
197
|
record={record}
|
|
186
198
|
onSuccess={handleReload}
|
|
187
|
-
trigger={
|
|
199
|
+
trigger={
|
|
200
|
+
<Tooltip title={updateProps?.operateText || '编辑'}>
|
|
201
|
+
<a>{updateProps?.operateText || <EditOutlined />}</a>
|
|
202
|
+
</Tooltip>
|
|
203
|
+
}
|
|
188
204
|
action="update"
|
|
189
205
|
{...detailProps}
|
|
190
206
|
/>,
|
package/src/crud/crud_delete.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeleteOutlined } from '@ant-design/icons';
|
|
2
|
-
import { Modal } from 'antd';
|
|
2
|
+
import { Modal, Tooltip } from 'antd';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
|
|
5
5
|
interface Params {
|
|
@@ -40,13 +40,19 @@ function OperateDelete(props: Params) {
|
|
|
40
40
|
const { doDelete } = useDelete({ name, desc, onDelete, operateText });
|
|
41
41
|
|
|
42
42
|
if (disabled) {
|
|
43
|
-
return
|
|
43
|
+
return (
|
|
44
|
+
<Tooltip title="删除">
|
|
45
|
+
<span className="cursor-not-allowed text-03">{operateText || <DeleteOutlined />}</span>
|
|
46
|
+
</Tooltip>
|
|
47
|
+
);
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
return (
|
|
47
|
-
<
|
|
48
|
-
{
|
|
49
|
-
|
|
51
|
+
<Tooltip title="删除">
|
|
52
|
+
<a style={{ color: 'red' }} onClick={doDelete}>
|
|
53
|
+
{operateText || <DeleteOutlined />}
|
|
54
|
+
</a>
|
|
55
|
+
</Tooltip>
|
|
50
56
|
);
|
|
51
57
|
}
|
|
52
58
|
|
package/src/crud/table/index.tsx
CHANGED
|
@@ -5,6 +5,22 @@
|
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
.ant-table-container {
|
|
9
|
+
border-inline-start-color: transparent !important;
|
|
10
|
+
|
|
11
|
+
.ant-table-thead {
|
|
12
|
+
& > tr > th:last-child {
|
|
13
|
+
border-inline-end-color: transparent !important;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ant-table-row {
|
|
18
|
+
& > td:last-child {
|
|
19
|
+
border-inline-end-color: transparent !important;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
8
24
|
.ant-pagination {
|
|
9
25
|
// gap: 8px;
|
|
10
26
|
|
|
@@ -19,6 +35,12 @@
|
|
|
19
35
|
|
|
20
36
|
.ant-pagination-item {
|
|
21
37
|
border: 1px solid #e2e7f0;
|
|
38
|
+
|
|
39
|
+
&.ant-pagination-item-active {
|
|
40
|
+
color: theme('colors.theme08');
|
|
41
|
+
background-color: theme('colors.theme03');
|
|
42
|
+
border-color: theme('colors.theme05');
|
|
43
|
+
}
|
|
22
44
|
}
|
|
23
45
|
}
|
|
24
46
|
}
|
|
@@ -198,4 +198,11 @@ function ProFormListBoolean(props: ProFormItemProps<ListBooleanProps>) {
|
|
|
198
198
|
);
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
export {
|
|
201
|
+
export {
|
|
202
|
+
ListBoolean,
|
|
203
|
+
ListNumber,
|
|
204
|
+
ListText,
|
|
205
|
+
ProFormListBoolean,
|
|
206
|
+
ProFormListNumber,
|
|
207
|
+
ProFormListText,
|
|
208
|
+
};
|
package/src/form/index.tsx
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {
|
|
2
|
+
ListBoolean,
|
|
3
|
+
ListNumber,
|
|
4
|
+
ListText,
|
|
5
|
+
ProFormListBoolean,
|
|
6
|
+
ProFormListNumber,
|
|
7
|
+
ProFormListText,
|
|
8
|
+
} from './form_list/form_list';
|
|
2
9
|
export { ProFormListHelper } from './form_list/form_list_helper';
|
|
3
10
|
export { ProFormListModalHelper } from './form_list/form_list_modal_helper';
|
|
4
11
|
export { ProFormEditor } from './pro_form_editor';
|
package/src/index.ts
CHANGED
|
@@ -24,6 +24,9 @@ export { EditorMention } from './editor_mention';
|
|
|
24
24
|
export type { EditorMentionProps } from './editor_mention';
|
|
25
25
|
export { FileCard } from './file';
|
|
26
26
|
export {
|
|
27
|
+
ListBoolean,
|
|
28
|
+
ListNumber,
|
|
29
|
+
ListText,
|
|
27
30
|
ProFormAvatarImageUpload,
|
|
28
31
|
ProFormEditor,
|
|
29
32
|
ProFormImageUpload,
|
package/src/tree/file_tree.tsx
CHANGED
|
@@ -188,7 +188,7 @@ function FileTree<D extends DataNode>(props: FileTreeProps<D>) {
|
|
|
188
188
|
return (
|
|
189
189
|
<Detail
|
|
190
190
|
action="create"
|
|
191
|
-
trigger={<PlusOutlined />}
|
|
191
|
+
trigger={<PlusOutlined className="text-base" />}
|
|
192
192
|
requestCreateByValues={requestCreateByValues}
|
|
193
193
|
/>
|
|
194
194
|
);
|