@jswork/antd-components 1.0.165 → 1.0.167

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.165",
3
+ "version": "1.0.167",
4
4
  "main": "dist/main.cjs.js",
5
5
  "module": "dist/main.esm.js",
6
6
  "types": "dist/main.d.ts",
@@ -2,11 +2,11 @@
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:20:16
5
+ * @LastEditTime: 2025-10-29 12:37:31
6
6
  */
7
- import React from 'react';
8
- import { AcSearch } from './search';
9
- import { FC } from 'react';
7
+ import React, { FC } from 'react';
8
+ import { AcSearch, AcSearchProps } from './search';
9
+ import { useSearchParams } from 'react-router-dom';
10
10
 
11
11
 
12
12
  declare global {
@@ -16,8 +16,8 @@ declare global {
16
16
  }
17
17
  }
18
18
 
19
- export type AcTableExtraSearchProps = AcSearch & {
20
- name?: string;
19
+ export type AcTableExtraSearchProps = AcSearchProps & {
20
+ name: string;
21
21
  lang?: string;
22
22
  queryKey?: string;
23
23
  }
@@ -39,12 +39,15 @@ const defaultProps = {
39
39
  export const AcTableExtraSearch: FC<AcTableExtraSearchProps> = (props) => {
40
40
  const { name, lang, queryKey, ...rest } = { ...defaultProps, ...props };
41
41
  const t = (key: string) => locales[lang!][key];
42
+ const [searchParams] = useSearchParams();
43
+ const defaultQuery = searchParams.get(queryKey) || '';
42
44
 
43
45
  return (
44
46
  <AcSearch
45
47
  size="small"
46
48
  enterButton
47
49
  allowClear
50
+ defaultValue={defaultQuery}
48
51
  placeholder={t('placeholder')}
49
52
  onSearch={(e) => {
50
53
  const q = e.target.value;