@jswork/antd-components 1.0.162 → 1.0.164

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.162",
3
+ "version": "1.0.164",
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.zheng 1290657123@qq.com
3
3
  * @Date: 2025-10-29 10:54:41
4
4
  * @LastEditors: aric.zheng 1290657123@qq.com
5
- * @LastEditTime: 2025-10-29 11:05:07
5
+ * @LastEditTime: 2025-10-29 11:11:33
6
6
  */
7
7
  import React from 'react';
8
8
  import { AcSearch } from './search';
@@ -17,15 +17,35 @@ declare global {
17
17
  }
18
18
 
19
19
  export type AcTableExtraSearchProps = AcSearch & {
20
- name: string,
21
- queryKey?: 'keywords'
20
+ name: string;
21
+ lang?: string;
22
+ queryKey?: string;
22
23
  }
23
24
 
25
+ const locales = {
26
+ 'zh-CN': {
27
+ placeholder: '请输入关键字搜索',
28
+ },
29
+ 'en-US': {
30
+ placeholder: 'Please enter keywords to search',
31
+ },
32
+ };
33
+
34
+ const defaultProps = {
35
+ lang: 'zh-CN',
36
+ queryKey: 'keywords',
37
+ };
38
+
24
39
  export const AcTableExtraSearch: FC<AcTableExtraSearchProps> = (props) => {
25
- const { name, queryKey = 'keywords', ...rest } = props;
40
+ const { name, lang, queryKey, ...rest } = { ...defaultProps, ...props };
41
+ const t = (key: string) => locales[lang!][key];
42
+
26
43
  return (
27
44
  <AcSearch
28
- name={name}
45
+ size="small"
46
+ enterButton
47
+ allowClear
48
+ placeholder={t('placeholder')}
29
49
  onSearch={(e) => {
30
50
  const q = e.target.value;
31
51
  nx.$event.emit(`${name}:load`, { [queryKey]: q });