@wzyjs/uis 0.3.36 → 0.3.38

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.
@@ -5,13 +5,13 @@ import { useCacheState, useControllableValue } from '@wzyjs/hooks/web';
5
5
  import { Select } from 'antd';
6
6
  import { getChangeItem, getChangeOption, getCurrentValue, getOptionMapByValue, getOptions, isOptionValue, } from './utils';
7
7
  export const FetchSelect = (props) => {
8
- const { query, queryInput, fieldNames, optionMap, optionListMap, placeholder = '请选择', allowClear = true, selectFirst = false, clearIfNotInOptions = false, clearWhenOptionsEmpty = false, cacheKey, value, onChange, ...selectProps } = props;
8
+ const { query, queryInput, queryOptions, fieldNames, optionMap, optionListMap, placeholder = '请选择', allowClear = true, selectFirst = false, clearIfNotInOptions = false, clearWhenOptionsEmpty = false, cacheKey, value, onChange, ...selectProps } = props;
9
9
  const isMultipleMode = selectProps.mode === 'multiple' || selectProps.mode === 'tags';
10
10
  const [selectedValue, setSelectedValue] = useControllableValue(props, {
11
11
  trigger: 'onValueChange',
12
12
  defaultValue: value,
13
13
  });
14
- const { data, isLoading } = query.useQuery(queryInput);
14
+ const { data, isLoading } = query.useQuery(queryInput, queryOptions);
15
15
  const currentValue = useMemo(() => {
16
16
  return getCurrentValue(selectedValue, isMultipleMode);
17
17
  }, [isMultipleMode, selectedValue]);
@@ -19,6 +19,7 @@ export type FetchSelectChangeItem<TItem> = TItem | undefined;
19
19
  export interface FetchSelectProps<TItem extends Record<string, any> = Record<string, any>> extends Omit<SelectProps, 'options' | 'loading' | 'onChange'> {
20
20
  query: QueryLike<TItem>;
21
21
  queryInput?: Record<string, any>;
22
+ queryOptions?: Record<string, any>;
22
23
  fieldNames?: {
23
24
  label: keyof TItem & string;
24
25
  value: keyof TItem & string;
@@ -1,6 +1,6 @@
1
1
  import type { PropsWithChildren, ReactNode } from 'react';
2
2
  interface PageBaseProps extends PropsWithChildren {
3
- title: ReactNode;
3
+ title?: ReactNode;
4
4
  }
5
5
  export declare const PageBase: (props: PageBaseProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wzyjs/uis",
3
- "version": "0.3.36",
3
+ "version": "0.3.38",
4
4
  "description": "description",
5
5
  "author": "wzy",
6
6
  "type": "module",
@@ -36,8 +36,8 @@
36
36
  "@ant-design/pro-form": "^2.32.0",
37
37
  "@ant-design/pro-provider": "^2.16.2",
38
38
  "@hello-pangea/dnd": "^18.0.1",
39
- "@wzyjs/hooks": "0.3.36",
40
- "@wzyjs/utils": "0.3.36",
39
+ "@wzyjs/hooks": "0.3.38",
40
+ "@wzyjs/utils": "0.3.38",
41
41
  "@xyflow/react": "^12.5.3",
42
42
  "echarts": "^5.4.3",
43
43
  "echarts-for-react": "^3.0.2",
@@ -70,7 +70,7 @@
70
70
  "postcss-cli": "^11.0.1",
71
71
  "tailwindcss": "^3.4.18"
72
72
  },
73
- "gitHead": "7db0faf741993d729a9e1c0742f480f364816222",
73
+ "gitHead": "e88061e1c33e2905e50909fab454baf1e86d0d6d",
74
74
  "publishConfig": {
75
75
  "access": "public"
76
76
  }