@jswork/antd-components 1.0.129 → 1.0.131
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 +4 -9
- package/dist/main.d.ts +4 -9
- package/dist/main.esm.js +1 -1
- package/dist/main.esm.js.map +1 -1
- package/package.json +5 -2
- package/src/lib/button.tsx +13 -37
- package/src/lib/table.tsx +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jswork/antd-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.131",
|
|
4
4
|
"main": "dist/main.cjs.js",
|
|
5
5
|
"module": "dist/main.esm.js",
|
|
6
6
|
"types": "dist/main.d.ts",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
"release": "release-it"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"
|
|
20
|
+
"antd": "*",
|
|
21
|
+
"@ant-design/icons": "*",
|
|
22
|
+
"react-router-dom": "*"
|
|
21
23
|
},
|
|
22
24
|
"devDependencies": {
|
|
23
25
|
"@ant-design/icons": "^6.1.0",
|
|
@@ -36,6 +38,7 @@
|
|
|
36
38
|
"postcss": "^8.5.3",
|
|
37
39
|
"react": "^18.2.0",
|
|
38
40
|
"react-dom": "^18.2.0",
|
|
41
|
+
"react-router-dom": "^7.9.4",
|
|
39
42
|
"tsup": "8.3.5",
|
|
40
43
|
"typescript": "^5.2.2"
|
|
41
44
|
},
|
package/src/lib/button.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: aric 1290657123@qq.com
|
|
3
3
|
* @Date: 2025-10-18 07:09:31
|
|
4
4
|
* @LastEditors: aric 1290657123@qq.com
|
|
5
|
-
* @LastEditTime: 2025-10-
|
|
5
|
+
* @LastEditTime: 2025-10-24 19:46:58
|
|
6
6
|
*/
|
|
7
7
|
import React, { FC } from 'react';
|
|
8
8
|
import { Button, ButtonProps } from 'antd';
|
|
@@ -61,73 +61,49 @@ type AcButtonProps = ButtonProps & {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export const BtnCreate: FC<AcButtonProps> = ({ lang = 'zh-CN', ...props }) => {
|
|
64
|
-
return <Button size="small" icon={<PlusOutlined />} {...props}
|
|
65
|
-
{t(lang, 'create')}
|
|
66
|
-
</Button>;
|
|
64
|
+
return <Button size="small" icon={<PlusOutlined />} children={t(lang, 'create')} {...props} />;
|
|
67
65
|
};
|
|
68
66
|
|
|
69
67
|
export const BtnEdit: FC<AcButtonProps> = ({ lang = 'zh-CN', ...props }) => {
|
|
70
|
-
return <Button size="small" icon={<EditOutlined />} {...props}
|
|
71
|
-
{t(lang, 'edit')}
|
|
72
|
-
</Button>;
|
|
68
|
+
return <Button size="small" icon={<EditOutlined />} children={t(lang, 'edit')} {...props} />;
|
|
73
69
|
};
|
|
74
70
|
|
|
75
71
|
export const BtnDelete: FC<AcButtonProps> = ({ lang = 'zh-CN', ...props }) => {
|
|
76
|
-
return <Button size="small" icon={<CloseOutlined />} {...props}
|
|
77
|
-
{t(lang, 'del')}
|
|
78
|
-
</Button>;
|
|
72
|
+
return <Button size="small" icon={<CloseOutlined />} children={t(lang, 'del')} {...props} />;
|
|
79
73
|
};
|
|
80
74
|
|
|
81
75
|
export const BtnView: FC<AcButtonProps> = ({ lang = 'zh-CN', ...props }) => {
|
|
82
|
-
return <Button size="small" icon={<EyeOutlined />} {...props}
|
|
83
|
-
{t(lang, 'view')}
|
|
84
|
-
</Button>;
|
|
76
|
+
return <Button size="small" icon={<EyeOutlined />} children={t(lang, 'view')} {...props} />;
|
|
85
77
|
};
|
|
86
78
|
|
|
87
79
|
export const BtnSave: FC<AcButtonProps> = ({ lang = 'zh-CN', ...props }) => {
|
|
88
|
-
return <Button size="small" icon={<SaveOutlined />} {...props}
|
|
89
|
-
{t(lang, 'save')}
|
|
90
|
-
</Button>;
|
|
80
|
+
return <Button size="small" icon={<SaveOutlined />} children={t(lang, 'save')} {...props} />;
|
|
91
81
|
};
|
|
92
82
|
|
|
93
83
|
export const BtnExport: FC<AcButtonProps> = ({ lang = 'zh-CN', ...props }) => {
|
|
94
|
-
return <Button size="small" icon={<DownloadOutlined />} {...props}
|
|
95
|
-
{t(lang, 'export')}
|
|
96
|
-
</Button>;
|
|
84
|
+
return <Button size="small" icon={<DownloadOutlined />} children={t(lang, 'export')} {...props} />;
|
|
97
85
|
};
|
|
98
86
|
|
|
99
87
|
export const BtnImport: FC<AcButtonProps> = ({ lang = 'zh-CN', ...props }) => {
|
|
100
|
-
return <Button size="small" icon={<ImportOutlined />} {...props}
|
|
101
|
-
{t(lang, 'imp')}
|
|
102
|
-
</Button>;
|
|
88
|
+
return <Button size="small" icon={<ImportOutlined />} children={t(lang, 'imp')} {...props} />;
|
|
103
89
|
};
|
|
104
90
|
|
|
105
91
|
export const BtnRefresh: FC<AcButtonProps> = ({ lang = 'zh-CN', ...props }) => {
|
|
106
|
-
return <Button size="small" icon={<ReloadOutlined />} {...props}
|
|
107
|
-
{t(lang, 'refresh')}
|
|
108
|
-
</Button>;
|
|
92
|
+
return <Button size="small" icon={<ReloadOutlined />} children={t(lang, 'refresh')} {...props} />;
|
|
109
93
|
};
|
|
110
94
|
|
|
111
95
|
export const BtnBack: FC<AcButtonProps> = ({ lang = 'zh-CN', ...props }) => {
|
|
112
|
-
return <Button size="small" icon={<BackwardOutlined />} {...props}
|
|
113
|
-
{t(lang, 'back')}
|
|
114
|
-
</Button>;
|
|
96
|
+
return <Button size="small" icon={<BackwardOutlined />} children={t(lang, 'back')} {...props} />;
|
|
115
97
|
};
|
|
116
98
|
|
|
117
99
|
export const BtnSubmit: FC<AcButtonProps> = ({ lang = 'zh-CN', ...props }) => {
|
|
118
|
-
return <Button size="small" icon={<CheckOutlined />} {...props}
|
|
119
|
-
{t(lang, 'submit')}
|
|
120
|
-
</Button>;
|
|
100
|
+
return <Button size="small" icon={<CheckOutlined />} children={t(lang, 'submit')} {...props} />;
|
|
121
101
|
};
|
|
122
102
|
|
|
123
103
|
export const BtnCancel: FC<AcButtonProps> = ({ lang = 'zh-CN', ...props }) => {
|
|
124
|
-
return <Button size="small" icon={<RedoOutlined />} {...props}
|
|
125
|
-
{t(lang, 'cancel')}
|
|
126
|
-
</Button>;
|
|
104
|
+
return <Button size="small" icon={<RedoOutlined />} children={t(lang, 'cancel')} {...props} />;
|
|
127
105
|
};
|
|
128
106
|
|
|
129
107
|
export const BtnSync: FC<AcButtonProps> = ({ lang = 'zh-CN', ...props }) => {
|
|
130
|
-
return <Button size="small" icon={<SyncOutlined />} {...props}
|
|
131
|
-
{t(lang, 'sync')}
|
|
132
|
-
</Button>;
|
|
108
|
+
return <Button size="small" icon={<SyncOutlined />} children={t(lang, 'sync')} {...props} />;
|
|
133
109
|
};
|
package/src/lib/table.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-24
|
|
5
|
+
* @LastEditTime: 2025-10-24 13:03:12
|
|
6
6
|
*/
|
|
7
7
|
import type { EventMittNamespace } from '@jswork/event-mitt';
|
|
8
8
|
import { ReactHarmonyEvents } from '@jswork/harmony-events';
|
|
@@ -13,10 +13,12 @@ import React from 'react';
|
|
|
13
13
|
import nx from '@jswork/next';
|
|
14
14
|
import '@jswork/next-create-fetcher';
|
|
15
15
|
|
|
16
|
+
type NavigateFunction = import('react-router-dom').NavigateFunction;
|
|
17
|
+
|
|
16
18
|
declare global {
|
|
17
19
|
interface NxStatic {
|
|
18
20
|
$event: any;
|
|
19
|
-
$nav:
|
|
21
|
+
$nav: NavigateFunction;
|
|
20
22
|
$api: Record<string, any>;
|
|
21
23
|
}
|
|
22
24
|
}
|