@jswork/antd-components 1.0.148 → 1.0.149

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.148",
3
+ "version": "1.0.149",
4
4
  "main": "dist/main.cjs.js",
5
5
  "module": "dist/main.esm.js",
6
6
  "types": "dist/main.d.ts",
@@ -2,12 +2,12 @@
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-24 21:04:29
5
+ * @LastEditTime: 2025-10-26 14:48:21
6
6
  */
7
- import { Button, Space, SpaceProps } from 'antd';
7
+ import { Space, SpaceProps } from 'antd';
8
8
  import React, { FC } from 'react';
9
- import { PlusOutlined, ReloadOutlined } from '@ant-design/icons';
10
9
  import nx from '@jswork/next';
10
+ import { BtnBack, BtnCreate, BtnRefresh } from './button';
11
11
 
12
12
  declare global {
13
13
  interface NxStatic {
@@ -23,17 +23,6 @@ export type AcTableExtrasProps = SpaceProps & {
23
23
  actions?: string []
24
24
  }
25
25
 
26
- const locales = {
27
- 'zh-CN': {
28
- reset: '刷新',
29
- add: '添加',
30
- },
31
- 'en-US': {
32
- reset: 'Refresh',
33
- add: 'Create',
34
- },
35
- };
36
-
37
26
  const defaultExtras = {
38
27
  lang: 'zh-CN',
39
28
  actions: ['reset', 'add'],
@@ -41,17 +30,14 @@ const defaultExtras = {
41
30
 
42
31
  export const AcTableExtras: FC<AcTableExtrasProps> = (props) => {
43
32
  const { name, lang, as, asProps, actions } = { ...defaultExtras, ...props };
44
- const t = (key: string) => locales[lang][key];
45
33
  const handleRefresh = () => nx.$event?.emit?.(`${name}:reset`);
46
34
  const handleAdd = () => nx.$event?.emit?.(`${name}:add`);
35
+ const handleBack = () => history.back();
47
36
  const AsComponent = as || Space;
48
37
  const items = {
49
- reset: <Button key="reset" size="small" icon={<ReloadOutlined />} onClick={handleRefresh}>
50
- {t('reset')}
51
- </Button>,
52
- add: <Button key="add" size="small" icon={<PlusOutlined />} onClick={handleAdd}>
53
- {t('add')}
54
- </Button>,
38
+ reset: <BtnRefresh lang={lang} onClick={handleRefresh} />,
39
+ add: <BtnCreate lang={lang} onClick={handleAdd} />,
40
+ back: <BtnBack lang={lang} onClick={handleBack} />,
55
41
  };
56
42
 
57
43
  return (