@jswork/antd-components 1.0.206 → 1.0.207
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/main.cjs.js +1 -1
- package/dist/main.d.mts +2 -1
- package/dist/main.d.ts +2 -1
- package/dist/main.esm.js +1 -1
- package/dist/main.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/table-links.tsx +6 -4
package/package.json
CHANGED
package/src/lib/table-links.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: aric 1290657123@qq.com
|
|
3
3
|
* @Date: 2025-10-03 07:11:26
|
|
4
4
|
* @LastEditors: aric 1290657123@qq.com
|
|
5
|
-
* @LastEditTime: 2025-10-31
|
|
5
|
+
* @LastEditTime: 2025-10-31 15:09:46
|
|
6
6
|
*/
|
|
7
7
|
import nx from '@jswork/next';
|
|
8
8
|
import { Space } from 'antd';
|
|
@@ -32,7 +32,8 @@ export type AcTableLinksProps = {
|
|
|
32
32
|
name: string;
|
|
33
33
|
model?: any;
|
|
34
34
|
lang?: string;
|
|
35
|
-
|
|
35
|
+
extraBefore?: React.ReactNode;
|
|
36
|
+
extraAfter?: React.ReactNode;
|
|
36
37
|
as?: React.ComponentType<any>;
|
|
37
38
|
asProps?: any;
|
|
38
39
|
actions?: string[];
|
|
@@ -50,7 +51,7 @@ const defaultProps = {
|
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
export const AcTableLinks: FC<AcTableLinksProps> = (props) => {
|
|
53
|
-
const { name, as, lang, actions, model, asProps,
|
|
54
|
+
const { name, as, lang, actions, model, asProps, extraBefore, extraAfter } = { ...defaultProps, ...props };
|
|
54
55
|
const t = (key: string) => locales[lang][key];
|
|
55
56
|
const AsComponent = as || Space;
|
|
56
57
|
const handleEdit = () => nx.$event?.emit?.(`${name}:edit`, model);
|
|
@@ -69,8 +70,9 @@ export const AcTableLinks: FC<AcTableLinksProps> = (props) => {
|
|
|
69
70
|
};
|
|
70
71
|
return (
|
|
71
72
|
<AsComponent {...asProps}>
|
|
73
|
+
{extraBefore}
|
|
72
74
|
{actions.map((action) => items[action])}
|
|
73
|
-
{
|
|
75
|
+
{extraAfter}
|
|
74
76
|
</AsComponent>
|
|
75
77
|
);
|
|
76
78
|
};
|