@jswork/antd-components 1.0.166 → 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.166",
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,10 +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:23:07
5
+ * @LastEditTime: 2025-10-29 12:37:31
6
6
  */
7
7
  import React, { FC } from 'react';
8
8
  import { AcSearch, AcSearchProps } from './search';
9
+ import { useSearchParams } from 'react-router-dom';
9
10
 
10
11
 
11
12
  declare global {
@@ -38,12 +39,15 @@ const defaultProps = {
38
39
  export const AcTableExtraSearch: FC<AcTableExtraSearchProps> = (props) => {
39
40
  const { name, lang, queryKey, ...rest } = { ...defaultProps, ...props };
40
41
  const t = (key: string) => locales[lang!][key];
42
+ const [searchParams] = useSearchParams();
43
+ const defaultQuery = searchParams.get(queryKey) || '';
41
44
 
42
45
  return (
43
46
  <AcSearch
44
47
  size="small"
45
48
  enterButton
46
49
  allowClear
50
+ defaultValue={defaultQuery}
47
51
  placeholder={t('placeholder')}
48
52
  onSearch={(e) => {
49
53
  const q = e.target.value;