@jswork/antd-components 1.0.205 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/antd-components",
3
- "version": "1.0.205",
3
+ "version": "1.0.207",
4
4
  "main": "dist/main.cjs.js",
5
5
  "module": "dist/main.esm.js",
6
6
  "types": "dist/main.d.ts",
@@ -2,7 +2,7 @@
2
2
  * @Author: aric 1290657123@qq.com
3
3
  * @Date: 2025-10-24 20:40:55
4
4
  * @LastEditors: aric 1290657123@qq.com
5
- * @LastEditTime: 2025-10-31 14:01:13
5
+ * @LastEditTime: 2025-10-31 14:07:56
6
6
  */
7
7
  import { Space, SpaceProps } from 'antd';
8
8
  import React, { FC, Fragment } from 'react';
@@ -27,7 +27,7 @@ export type AcCardExtrasProps = SpaceProps & {
27
27
 
28
28
  const defaultExtras = {
29
29
  lang: 'zh-CN',
30
- actions: ['refresh', 'add'],
30
+ actions: ['refetch', 'add'],
31
31
  };
32
32
 
33
33
  export const AcCardExtras: FC<AcCardExtrasProps> = (props) => {
@@ -38,7 +38,7 @@ export const AcCardExtras: FC<AcCardExtrasProps> = (props) => {
38
38
  const handleBack = () => history.back();
39
39
  const AsComponent = as || Space;
40
40
  const items = {
41
- refresh: <BtnRefresh lang={lang} onClick={handleRefresh} />,
41
+ refetch: <BtnRefresh lang={lang} onClick={handleRefresh} />,
42
42
  reset: <BtnRefresh lang={lang} onClick={handleReset} />,
43
43
  add: <BtnCreate lang={lang} onClick={handleAdd} />,
44
44
  back: <BtnBack lang={lang} onClick={handleBack} />,
@@ -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 08:33:59
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
- extra?: React.ReactNode;
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, extra } = { ...defaultProps, ...props };
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
- {extra}
75
+ {extraAfter}
74
76
  </AsComponent>
75
77
  );
76
78
  };