@antdv-next1/pro-field 1.0.1 → 1.0.2

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
@@ -340,10 +340,7 @@ const ProField = /* @__PURE__ */ defineComponent((props, { expose }) => {
340
340
  type: Function,
341
341
  required: false
342
342
  },
343
- fieldProps: {
344
- type: Object,
345
- required: false
346
- },
343
+ fieldProps: { required: false },
347
344
  light: {
348
345
  type: Boolean,
349
346
  required: false,
@@ -16,15 +16,15 @@ type FieldCodeProps = ProFieldFC<{
16
16
  } | HTMLAttributes>;
17
17
  declare const FieldCode: _$vue.DefineSetupFnComponent<FieldCodeProps, {}, CustomSlotsType<{
18
18
  default?: () => VueNode;
19
- }>, _$_antdv_next1_pro_provider0.BaseProFieldFC<(InputProps & {
19
+ }>, _$_antdv_next1_pro_provider0.BaseProFieldFC<HTMLAttributes | (InputProps & {
20
20
  style?: CSSProperties;
21
21
  }) | (TextAreaProps & {
22
22
  style?: CSSProperties;
23
- }) | HTMLAttributes> & _$_antdv_next1_pro_provider0.ProRenderFieldPropsType<(InputProps & {
23
+ })> & _$_antdv_next1_pro_provider0.ProRenderFieldPropsType<HTMLAttributes | (InputProps & {
24
24
  style?: CSSProperties;
25
25
  }) | (TextAreaProps & {
26
26
  style?: CSSProperties;
27
- }) | HTMLAttributes> & {
27
+ })> & {
28
28
  text: string;
29
29
  language?: "json" | "text";
30
30
  } & {
@@ -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;
@@ -9,6 +9,7 @@ const FieldSegmented = /* @__PURE__ */ defineComponent((props, { expose }) => {
9
9
  expose({ fetchData: (keyWord) => fetchData(keyWord) });
10
10
  return () => {
11
11
  const { mode, render, formItemRender, options: propsOptions, fieldProps, emptyText = "-", ...rest } = props;
12
+ console.log("FieldSegmented:props", props, options);
12
13
  if (loading.value) return createVNode(Spin, { "size": "small" }, null);
13
14
  if (mode === "read") {
14
15
  const optionsValueEnum = options.value?.length ? options.value?.reduce((pre, cur) => {
@@ -31,6 +31,8 @@ declare function useFieldFetchData(props: Omit<FieldSelectProps, 'fieldProps'> &
31
31
  proFieldKey?: Key;
32
32
  defaultKeyWords?: string;
33
33
  fieldProps?: any;
34
+ options?: any;
35
+ treeData?: any;
34
36
  }): [Ref<boolean>, Ref<SelectOptionType | undefined>, (keyWord?: string) => void, () => void];
35
37
  declare const FieldSelect: _$vue.DefineSetupFnComponent<{
36
38
  text?: VueNode; /** 值的枚举,如果存在枚举,Search 中会生成 select */
@@ -69,7 +69,7 @@ function useFieldFetchData(props) {
69
69
  return [];
70
70
  }, { value: computed(() => {
71
71
  if (!fieldProps) return void 0;
72
- const data = fieldProps?.options || fieldProps?.treeData;
72
+ const data = props.options || props.treeData || fieldProps?.options || fieldProps?.treeData;
73
73
  if (!data) return void 0;
74
74
  const { children, label, value } = fieldProps?.fieldNames || {};
75
75
  const traverseFieldKey = (_options, type) => {