@antdv-next1/pro-field 1.0.5 → 1.0.6

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/ProField.js CHANGED
@@ -301,19 +301,7 @@ const ProField = /* @__PURE__ */ defineComponent((props, { expose }) => {
301
301
  }, {
302
302
  props: {
303
303
  valueType: { required: false },
304
- text: {
305
- type: [
306
- Object,
307
- Function,
308
- String,
309
- Number,
310
- null,
311
- Boolean,
312
- Array
313
- ],
314
- required: false,
315
- default: void 0
316
- },
304
+ text: { required: false },
317
305
  placeholder: {
318
306
  type: [String, Array],
319
307
  required: false
@@ -379,10 +367,7 @@ const ProField = /* @__PURE__ */ defineComponent((props, { expose }) => {
379
367
  type: String,
380
368
  required: false
381
369
  },
382
- request: {
383
- type: Function,
384
- required: false
385
- },
370
+ request: { required: false },
386
371
  emptyText: {
387
372
  type: [
388
373
  Object,
@@ -107,19 +107,7 @@ const ProPureField = /* @__PURE__ */ defineComponent((props, { attrs, expose })
107
107
  }, {
108
108
  props: {
109
109
  valueType: { required: false },
110
- text: {
111
- type: [
112
- Object,
113
- Function,
114
- String,
115
- Number,
116
- null,
117
- Boolean,
118
- Array
119
- ],
120
- required: false,
121
- default: void 0
122
- },
110
+ text: { required: false },
123
111
  placeholder: {
124
112
  type: [String, Array],
125
113
  required: false
@@ -146,10 +134,7 @@ const ProPureField = /* @__PURE__ */ defineComponent((props, { attrs, expose })
146
134
  type: Function,
147
135
  required: false
148
136
  },
149
- fieldProps: {
150
- type: Object,
151
- required: false
152
- },
137
+ fieldProps: { required: false },
153
138
  light: {
154
139
  type: Boolean,
155
140
  required: false,
@@ -188,10 +173,7 @@ const ProPureField = /* @__PURE__ */ defineComponent((props, { attrs, expose })
188
173
  type: String,
189
174
  required: false
190
175
  },
191
- request: {
192
- type: Function,
193
- required: false
194
- },
176
+ request: { required: false },
195
177
  emptyText: {
196
178
  type: [
197
179
  Object,
@@ -35,6 +35,6 @@ declare const FieldCascader: _$vue.DefineSetupFnComponent<FieldCascaderProps, {}
35
35
  variant?: "outlined" | "borderless" | "filled";
36
36
  } & {
37
37
  id?: string;
38
- } & Omit<FieldSelectProps, "text" | "fieldProps" | "light" | "label" | "id" | "variant" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
38
+ } & Omit<FieldSelectProps, "text" | "fieldProps" | "light" | "label" | "id" | "variant" | "labelTrigger" | "lightLabel" | "plain"> & {}, _$vue.PublicProps>;
39
39
  //#endregion
40
40
  export { FieldCascaderProps, FieldCascaderRef, FieldCascader as default };
@@ -184,10 +184,7 @@ const FieldCascader = /* @__PURE__ */ defineComponent((props, { expose }) => {
184
184
  type: Number,
185
185
  required: false
186
186
  },
187
- request: {
188
- type: Function,
189
- required: false
190
- },
187
+ request: { required: false },
191
188
  params: { required: false },
192
189
  defaultKeyWords: {
193
190
  type: String,
@@ -32,6 +32,6 @@ declare const FieldCheckbox: _$vue.DefineSetupFnComponent<FieldCheckBoxProps, {}
32
32
  options?: CheckboxGroupProps["options"];
33
33
  } & {
34
34
  id?: string;
35
- } & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
35
+ } & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "labelTrigger" | "lightLabel" | "plain"> & {}, _$vue.PublicProps>;
36
36
  //#endregion
37
37
  export { FieldCheckBoxProps, FieldCheckboxRef, FieldCheckbox as default };
@@ -131,10 +131,7 @@ const FieldCheckbox = /* @__PURE__ */ defineComponent((props, { expose, attrs })
131
131
  type: Number,
132
132
  required: false
133
133
  },
134
- request: {
135
- type: Function,
136
- required: false
137
- },
134
+ request: { required: false },
138
135
  params: { required: false },
139
136
  defaultKeyWords: {
140
137
  type: String,
@@ -17,6 +17,6 @@ declare const FieldColorPicker: _$vue.DefineSetupFnComponent<FieldColorPickerPro
17
17
  mode?: "read" | "edit" | "update";
18
18
  } & {
19
19
  id?: string;
20
- } & Partial<Omit<_$antdv_next_dist_color_picker_ColorPicker0.InternalColorPickerProps, "value" | "mode">> & {}, _$vue.PublicProps>;
20
+ } & Partial<Omit<_$antdv_next_dist_color_picker_ColorPicker0.InternalColorPickerProps, "mode" | "value">> & {}, _$vue.PublicProps>;
21
21
  //#endregion
22
22
  export { FieldColorPickerProps, FieldColorPicker as default };
@@ -22,14 +22,14 @@ type FieldDigitRangeProps = ProFieldFC<{
22
22
  }>;
23
23
  declare const FieldDigitRange: _$vue.DefineSetupFnComponent<FieldDigitRangeProps, {}, CustomSlotsType<{
24
24
  default?: () => VueNode;
25
- }>, _$_antdv_next1_pro_provider0.BaseProFieldFC<Omit<InputNumberProps, "value" | "onChange" | "defaultValue" | "placeholder"> & {
25
+ }>, _$_antdv_next1_pro_provider0.BaseProFieldFC<Omit<InputNumberProps, "placeholder" | "value" | "onChange" | "defaultValue"> & {
26
26
  id?: string;
27
27
  placeholder?: string[];
28
28
  value?: ValuePair;
29
29
  onChange?: (value?: ValuePair) => void;
30
30
  defaultValue?: ValuePair;
31
31
  intlProps?: Intl.NumberFormatOptions;
32
- }> & _$_antdv_next1_pro_provider0.ProRenderFieldPropsType<Omit<InputNumberProps, "value" | "onChange" | "defaultValue" | "placeholder"> & {
32
+ }> & _$_antdv_next1_pro_provider0.ProRenderFieldPropsType<Omit<InputNumberProps, "placeholder" | "value" | "onChange" | "defaultValue"> & {
33
33
  id?: string;
34
34
  placeholder?: string[];
35
35
  value?: ValuePair;
@@ -12,7 +12,7 @@ type FieldImageProps = ProFieldFC<{
12
12
  }, ImageProps | InputProps>;
13
13
  declare const FieldImage: _$vue.DefineSetupFnComponent<FieldImageProps, {}, CustomSlotsType<{
14
14
  default?: () => VueNode;
15
- }>, _$_antdv_next1_pro_provider0.BaseProFieldFC<ImageProps | InputProps> & _$_antdv_next1_pro_provider0.ProRenderFieldPropsType<ImageProps | InputProps> & {
15
+ }>, _$_antdv_next1_pro_provider0.BaseProFieldFC<InputProps | ImageProps> & _$_antdv_next1_pro_provider0.ProRenderFieldPropsType<InputProps | ImageProps> & {
16
16
  text: string;
17
17
  width?: number;
18
18
  placeholder?: string;
@@ -31,6 +31,6 @@ declare const FieldRadio: _$vue.DefineSetupFnComponent<FieldRadioProps, {}, Cust
31
31
  radioType?: RadioGroupProps["optionType"];
32
32
  } & {
33
33
  id?: string;
34
- } & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
34
+ } & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "labelTrigger" | "lightLabel" | "plain"> & {}, _$vue.PublicProps>;
35
35
  //#endregion
36
36
  export { FieldRadioProps, FieldRadio as default };
@@ -121,10 +121,7 @@ const FieldRadio = /* @__PURE__ */ defineComponent((props, { expose, attrs }) =>
121
121
  type: Number,
122
122
  required: false
123
123
  },
124
- request: {
125
- type: Function,
126
- required: false
127
- },
124
+ request: { required: false },
128
125
  params: { required: false },
129
126
  defaultKeyWords: {
130
127
  type: String,
@@ -31,6 +31,6 @@ declare const FieldSegmented: _$vue.DefineSetupFnComponent<FieldSegmentedProps,
31
31
  emptyText?: VueNode$1;
32
32
  } & {
33
33
  id?: string;
34
- } & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
34
+ } & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "labelTrigger" | "lightLabel" | "plain"> & {}, _$vue.PublicProps>;
35
35
  //#endregion
36
36
  export { FieldSegmentedProps, FieldSegmented as default };
@@ -121,10 +121,7 @@ const FieldSegmented = /* @__PURE__ */ defineComponent((props, { expose }) => {
121
121
  type: Number,
122
122
  required: false
123
123
  },
124
- request: {
125
- type: Function,
126
- required: false
127
- },
124
+ request: { required: false },
128
125
  params: { required: false },
129
126
  defaultKeyWords: {
130
127
  type: String,
@@ -3,7 +3,7 @@ import LightSelect from "./LightSelect/index.js";
3
3
  import SearchSelect from "./SearchSelect/index.js";
4
4
  import { Fragment, computed, createVNode, defineComponent, mergeProps, ref, shallowRef } from "vue";
5
5
  import { useIntl } from "@antdv-next1/pro-provider";
6
- import { nanoid, objectToMap, proFieldParsingText, useDebounceValue, useEffect, useMemo, useMountMergeState, useRefFunction, useState } from "@antdv-next1/pro-utils";
6
+ import { nanoid, objectToMap, proFieldParsingText, stringify, useDebounceValue, useEffect, useMemo, useMountMergeState, useRefFunction, useState } from "@antdv-next1/pro-utils";
7
7
  import { Spin, useConfig } from "antdv-next";
8
8
  import { unit } from "@antdv-next/cssinjs";
9
9
  import useSWRV from "swrv";
@@ -95,15 +95,19 @@ function useFieldFetchData(props) {
95
95
  }, [() => valueEnum]);
96
96
  const swrKey = useDebounceValue([
97
97
  proFieldKeyRef.value,
98
- props.params,
98
+ stringify(props.params),
99
99
  keyWords.value
100
- ], debounceTime ?? fieldProps?.debounceTime ?? 0, [() => props.params, keyWords]);
100
+ ], debounceTime ?? fieldProps?.debounceTime ?? 0, [
101
+ () => props.params,
102
+ keyWords,
103
+ proFieldKeyRef
104
+ ]);
101
105
  const { data, mutate: setLocaleData, isValidating } = useSWRV(() => {
102
106
  if (!request) return null;
103
- return swrKey.value;
104
- }, ([, params, kw]) => request?.({
105
- ...params,
106
- keyWords: kw
107
+ return swrKey.value.join("-");
108
+ }, () => request?.({
109
+ ...props.params,
110
+ keyWords: keyWords.value
107
111
  }, props), {
108
112
  shouldRetryOnError: false,
109
113
  revalidateOnFocus: false
@@ -261,30 +265,18 @@ const FieldSelect = /* @__PURE__ */ defineComponent((props, { attrs, expose }) =
261
265
  }, {
262
266
  props: {
263
267
  text: {
264
- type: [
265
- Object,
266
- Function,
267
- String,
268
- Number,
269
- null,
270
- Boolean,
271
- Array
272
- ],
273
- required: false,
274
- default: void 0
268
+ type: void 0,
269
+ required: false
275
270
  },
276
271
  valueEnum: {
277
- type: [Map, Object],
272
+ type: void 0,
278
273
  required: false
279
274
  },
280
275
  debounceTime: {
281
276
  type: Number,
282
277
  required: false
283
278
  },
284
- request: {
285
- type: Function,
286
- required: false
287
- },
279
+ request: { required: false },
288
280
  params: { required: false },
289
281
  fieldProps: {
290
282
  type: Object,
@@ -40,6 +40,6 @@ declare const FieldTreeSelect: _$vue.DefineSetupFnComponent<FieldTreeSelectProps
40
40
  fetchDataOnSearch?: boolean;
41
41
  } & {
42
42
  id?: string;
43
- } & TreeSelectProps<any, _$_v_c_tree_select0.DataNode> & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "lightLabel" | "labelTrigger" | "plain"> & {}, _$vue.PublicProps>;
43
+ } & TreeSelectProps<any, _$_v_c_tree_select0.DataNode> & Omit<FieldSelectProps, "fieldProps" | "light" | "label" | "id" | "variant" | "labelTrigger" | "lightLabel" | "plain"> & {}, _$vue.PublicProps>;
44
44
  //#endregion
45
45
  export { FieldTreeSelectProps, FieldTreeSelect as default };
@@ -745,10 +745,7 @@ const FieldTreeSelect = /* @__PURE__ */ defineComponent((props, { expose, attrs
745
745
  type: Number,
746
746
  required: false
747
747
  },
748
- request: {
749
- type: Function,
750
- required: false
751
- },
748
+ request: { required: false },
752
749
  params: { required: false },
753
750
  defaultKeyWords: {
754
751
  type: String,