@zat-design/sisyphus-react 4.0.14 → 4.0.16

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.
Files changed (84) hide show
  1. package/es/ProAction/propsType.d.ts +0 -1
  2. package/es/ProDownload/propsType.d.ts +0 -1
  3. package/es/ProEditLabel/propsType.d.ts +0 -5
  4. package/es/ProEnum/hooks/useEnum.d.ts +5 -5
  5. package/es/ProEnum/propsType.d.ts +2 -9
  6. package/es/ProEnum/utils/index.d.ts +3 -3
  7. package/es/ProForm/components/FormFooter/propsType.d.ts +0 -5
  8. package/es/ProForm/components/combination/Container/propsType.d.ts +0 -4
  9. package/es/ProForm/components/combination/FormList/propsType.d.ts +0 -8
  10. package/es/ProForm/components/combination/Group/propsType.d.ts +0 -5
  11. package/es/ProForm/components/combination/Group/utils/index.d.ts +14 -14
  12. package/es/ProForm/components/combination/ProCascader/propsType.d.ts +0 -5
  13. package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +0 -4
  14. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +0 -6
  15. package/es/ProForm/components/combination/ProTimeLimit/index.js +1 -5
  16. package/es/ProForm/components/render/propsType.d.ts +10 -10
  17. package/es/ProForm/propsType.d.ts +0 -8
  18. package/es/ProForm/propsType.js +0 -4
  19. package/es/ProIcon/propsTypes.d.ts +0 -1
  20. package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +1 -3
  21. package/es/ProLayout/components/ProFooter/PropTypes.d.ts +0 -1
  22. package/es/ProLayout/components/ProHeader/PropTypes.d.ts +0 -4
  23. package/es/ProLayout/components/TabsManager/hooks/useTabsCache.js +1 -1
  24. package/es/ProLayout/components/TabsManager/propTypes.d.ts +0 -1
  25. package/es/ProLayout/components/TabsManager/propTypes.js +1 -2
  26. package/es/ProLayout/components/TabsManager/utils/index.d.ts +4 -1
  27. package/es/ProLayout/components/TabsManager/utils/index.js +7 -0
  28. package/es/ProLayout/propTypes.d.ts +0 -4
  29. package/es/ProLayout/propTypes.js +0 -2
  30. package/es/ProSelect/index.js +45 -7
  31. package/es/ProSelect/propsType.d.ts +0 -4
  32. package/es/ProTable/propsType.d.ts +0 -4
  33. package/es/ProTabs/components/Card/index.d.ts +2 -2
  34. package/es/ProTabs/propType.d.ts +0 -4
  35. package/es/ProThemeTools/propsType.d.ts +0 -2
  36. package/es/ProTooltip/propsType.d.ts +0 -1
  37. package/es/ProTree/components/ProTreeSelect/propsType.d.ts +0 -2
  38. package/es/ProTree/propsType.d.ts +0 -2
  39. package/es/ProTreeModal/propsType.d.ts +0 -2
  40. package/es/ProUpload/propsType.d.ts +0 -5
  41. package/es/index.d.ts +14 -14
  42. package/es/index.js +27 -1
  43. package/lib/ProAction/propsType.d.ts +0 -1
  44. package/lib/ProDownload/propsType.d.ts +0 -1
  45. package/lib/ProEditLabel/propsType.d.ts +0 -5
  46. package/lib/ProEnum/hooks/useEnum.d.ts +5 -5
  47. package/lib/ProEnum/propsType.d.ts +2 -9
  48. package/lib/ProEnum/utils/index.d.ts +3 -3
  49. package/lib/ProForm/components/FormFooter/propsType.d.ts +0 -5
  50. package/lib/ProForm/components/combination/Container/propsType.d.ts +0 -4
  51. package/lib/ProForm/components/combination/FormList/propsType.d.ts +0 -8
  52. package/lib/ProForm/components/combination/Group/propsType.d.ts +0 -5
  53. package/lib/ProForm/components/combination/Group/utils/index.d.ts +14 -14
  54. package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +0 -5
  55. package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +0 -4
  56. package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +0 -6
  57. package/lib/ProForm/components/combination/ProTimeLimit/index.js +1 -4
  58. package/lib/ProForm/components/render/propsType.d.ts +10 -10
  59. package/lib/ProForm/propsType.d.ts +0 -8
  60. package/lib/ProForm/propsType.js +0 -4
  61. package/lib/ProIcon/propsTypes.d.ts +0 -1
  62. package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +1 -3
  63. package/lib/ProLayout/components/ProFooter/PropTypes.d.ts +0 -1
  64. package/lib/ProLayout/components/ProHeader/PropTypes.d.ts +0 -4
  65. package/lib/ProLayout/components/TabsManager/hooks/useTabsCache.js +1 -1
  66. package/lib/ProLayout/components/TabsManager/propTypes.d.ts +0 -1
  67. package/lib/ProLayout/components/TabsManager/propTypes.js +1 -2
  68. package/lib/ProLayout/components/TabsManager/utils/index.d.ts +4 -1
  69. package/lib/ProLayout/components/TabsManager/utils/index.js +7 -0
  70. package/lib/ProLayout/propTypes.d.ts +0 -4
  71. package/lib/ProLayout/propTypes.js +0 -2
  72. package/lib/ProSelect/index.js +45 -7
  73. package/lib/ProSelect/propsType.d.ts +0 -4
  74. package/lib/ProTable/propsType.d.ts +0 -4
  75. package/lib/ProTabs/components/Card/index.d.ts +2 -2
  76. package/lib/ProTabs/propType.d.ts +0 -4
  77. package/lib/ProThemeTools/propsType.d.ts +0 -2
  78. package/lib/ProTooltip/propsType.d.ts +0 -1
  79. package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +0 -2
  80. package/lib/ProTree/propsType.d.ts +0 -2
  81. package/lib/ProTreeModal/propsType.d.ts +0 -2
  82. package/lib/ProUpload/propsType.d.ts +0 -5
  83. package/lib/index.d.ts +14 -14
  84. package/package.json +1 -1
@@ -43,4 +43,3 @@ export interface ProActionType {
43
43
  /** 自定义错误弹窗内容视图渲染 */
44
44
  contextRender?: (data: any) => string | ReactNode;
45
45
  }
46
- export type ProActionProps = ProActionType;
@@ -69,4 +69,3 @@ export interface ProDownloadType extends ButtonProps {
69
69
  children?: string | ReactNode;
70
70
  [key: string]: any;
71
71
  }
72
- export type IProDownloadProps = ProDownloadType;
@@ -161,8 +161,3 @@ export interface ProEditLabelType extends Partial<PopconfirmProps> {
161
161
  */
162
162
  [key: string]: any;
163
163
  }
164
- export type ContainerProps = ContainerType;
165
- export type StateProps = StateType;
166
- export type PopupProps = PopupType;
167
- export type LabelProps = LabelType;
168
- export type PopupConfirmProps = ProEditLabelType;
@@ -1,23 +1,23 @@
1
- import { DataOption } from '../propsType';
1
+ import { DataOptionType } from '../propsType';
2
2
  /**
3
3
  * input code output [DataOption[],getEnumLabel]
4
4
  * @param code
5
5
  * const [options,fn] = useEnum("code")
6
6
  */
7
- declare function useEnum(code: string): [DataOption[], (val: string, showCodeName?: boolean) => string];
7
+ declare function useEnum(code: string): [DataOptionType[], (val: string, showCodeName?: boolean) => string];
8
8
  /**
9
9
  * input codes output { code1:DataOption[],code2:DataOption[] }
10
10
  * @param codes
11
11
  * const dicsMap = useEnum(["code1","code2"])
12
12
  */
13
- declare function useEnum(codes: string[]): Record<string, DataOption[]>;
13
+ declare function useEnum(codes: string[]): Record<string, DataOptionType[]>;
14
14
  /**
15
15
  * input code、value output label
16
16
  * @param code
17
17
  * @param value
18
18
  * @param compose 展示 value-label
19
19
  */
20
- declare function useEnum(code: string, value?: string, compose?: boolean): [string, DataOption];
20
+ declare function useEnum(code: string, value?: string, compose?: boolean): [string, DataOptionType];
21
21
  /**
22
22
  * input code、values array output [labels array, options array]
23
23
  * @param code
@@ -25,5 +25,5 @@ declare function useEnum(code: string, value?: string, compose?: boolean): [stri
25
25
  * @param compose 展示 value-label
26
26
  * @returns [标签数组, 选项数组]
27
27
  */
28
- declare function useEnum(code: string, values: (string | number)[], compose?: boolean): [string[], DataOption[]];
28
+ declare function useEnum(code: string, values: (string | number)[], compose?: boolean): [string[], DataOptionType[]];
29
29
  export default useEnum;
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
2
2
  import { RadioProps, CheckboxProps } from 'antd';
3
3
  import { Service, Options } from 'ahooks/lib/useRequest/src/types';
4
4
  import type { ProFormOtherType } from '../ProForm/propsType';
5
- import type { PropSelectProps } from '../ProSelect/propsType';
5
+ import type { PropSelectType } from '../ProSelect/propsType';
6
6
  /**
7
7
  * @description 数据选项类型
8
8
  */
@@ -272,7 +272,7 @@ export type PropProSelectsMapType = {
272
272
  * @default "ProSelect"
273
273
  */
274
274
  type?: 'ProSelect';
275
- } & PropSelectProps;
275
+ } & PropSelectType;
276
276
  /**
277
277
  * @description Radio类型映射
278
278
  */
@@ -307,11 +307,4 @@ export interface TagPropsMapType {
307
307
  * @description ProEnum组件属性类型
308
308
  */
309
309
  export type ProEnumType = Omit<ProEnumBaseType, 'type'> & (PropProSelectsMapType | PropRadioPropsMapType | CheckboxPropsMapType | TagPropsMapType);
310
- export type DataOption = DataOptionType;
311
- export type ProEnum = ProEnumBaseType;
312
- export type PropProSelectsMap = PropProSelectsMapType;
313
- export type PropRadioPropsMap = PropRadioPropsMapType;
314
- export type CheckboxPropsMap = CheckboxPropsMapType;
315
- export type TagPropsMap = TagPropsMapType;
316
- export type ProEnumProps = ProEnumBaseType;
317
310
  export {};
@@ -1,8 +1,8 @@
1
- import { DataOption } from '../propsType';
1
+ import { DataOptionType } from '../propsType';
2
2
  type StorageType = 'localStorage' | 'sessionStorage' | 'indexedDB';
3
3
  export declare const baseCacheKey = "zat-design-pro-component-cacheKey";
4
4
  interface EnumRes {
5
- data: Record<string, DataOption[]>;
5
+ data: Record<string, DataOptionType[]>;
6
6
  [key: string]: any;
7
7
  }
8
8
  /**
@@ -33,7 +33,7 @@ export declare function removeEnumData(storage: StorageType, cacheKey: string):
33
33
  * @param code
34
34
  * @returns
35
35
  */
36
- export declare function hasEnumList(storage: StorageType, cacheKey: any, code: string): false | import("../propsType").DataOptionType[];
36
+ export declare function hasEnumList(storage: StorageType, cacheKey: any, code: string): false | DataOptionType[];
37
37
  /**
38
38
  * 判断是否是对象
39
39
  * @param obj
@@ -20,8 +20,3 @@ export interface FooterRenderType {
20
20
  form: FormInstance | ModifiedFormInstanceType<any>;
21
21
  children?: React.ReactNode;
22
22
  }
23
- /**
24
- * 兼容旧命名导出
25
- */
26
- export type FooterButtonProps = FooterButtonType;
27
- export type FooterRenderProps = FooterRenderType;
@@ -11,7 +11,3 @@ export interface ContainerType {
11
11
  diffConfig?: DiffConfigType;
12
12
  clearNotShow?: boolean;
13
13
  }
14
- /**
15
- * 兼容旧命名导出
16
- */
17
- export type ContainerProps = ContainerType;
@@ -66,12 +66,4 @@ export type TypeWithRef = FormListType & React.RefAttributes<FormListRefType>;
66
66
  export interface FormListRefType {
67
67
  operation: FormListOperation;
68
68
  }
69
- /**
70
- * 兼容旧命名导出
71
- */
72
- export type ActionProps = ActionType;
73
- export type ToolbarActionProps = ToolbarActionType;
74
- export type FormListProps = FormListType;
75
- export type PropsWithRef = TypeWithRef;
76
- export type FormListRef = FormListRefType;
77
69
  export {};
@@ -97,8 +97,3 @@ export interface FlexibleGroupColumnType<Values = any> extends Omit<GroupColumnT
97
97
  /** 字段属性,支持函数化 */
98
98
  fieldProps?: any | ReactiveFunction<Values, any>;
99
99
  }
100
- /**
101
- * 兼容旧命名导出
102
- */
103
- export type GroupProps = GroupType;
104
- export type GroupColumnProps<Values = any> = GroupColumnType<Values>;
@@ -75,25 +75,24 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
75
75
  confirm?: boolean | import("antd").ModalFuncProps | import("../../../render/propsType").FunctionArgs<any, boolean | import("antd").ModalFuncProps>;
76
76
  show?: boolean | ReactiveFunction<any, boolean>;
77
77
  component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
78
- children?: React.ReactNode | ((form: FormInstance<any>) => React.ReactNode);
79
- style?: React.CSSProperties;
80
- className?: string;
81
- rootClassName?: string;
82
78
  trim?: boolean;
83
79
  normalize?: (value: any, prevValue: any, allValues: import("@rc-component/form/lib/interface").Store) => any;
84
- hidden?: boolean;
85
- layout?: import("antd/es/form/Form").FormItemLayout;
86
- help?: React.ReactNode;
80
+ children?: React.ReactNode | ((form: FormInstance<any>) => React.ReactNode);
87
81
  vertical?: boolean;
88
- preserve?: boolean;
89
82
  id?: string;
83
+ className?: string;
84
+ hidden?: boolean;
85
+ style?: React.CSSProperties;
90
86
  onReset?: () => void;
91
87
  prefixCls?: string;
92
- htmlFor?: string;
88
+ rootClassName?: string;
89
+ status?: "" | "success" | "error" | "warning" | "validating";
93
90
  trigger?: string;
94
- status?: "" | "warning" | "error" | "success" | "validating";
95
- isView?: boolean;
96
91
  colon?: boolean;
92
+ isView?: boolean;
93
+ desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
94
+ getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
95
+ htmlFor?: string;
97
96
  labelAlign?: import("antd/es/form/interface").FormLabelAlign;
98
97
  labelCol?: import("antd").ColProps;
99
98
  getValueFromEvent?: (...args: import("@rc-component/form/lib/interface").EventArgs) => any;
@@ -101,18 +100,20 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
101
100
  validateTrigger?: string | false | string[];
102
101
  validateDebounce?: number;
103
102
  valuePropName?: string;
104
- getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
105
103
  messageVariables?: Record<string, string>;
106
104
  initialValue?: any;
107
105
  onMetaChange?: (meta: import("@rc-component/form/lib/Field").MetaEvent) => void;
106
+ preserve?: boolean;
108
107
  isListField?: boolean;
109
108
  isList?: boolean;
110
109
  noStyle?: boolean;
111
110
  hasFeedback?: boolean | {
112
111
  icons: import("antd/es/form/FormItem").FeedbackIcons;
113
112
  };
114
- validateStatus?: "" | "warning" | "error" | "success" | "validating";
113
+ validateStatus?: "" | "success" | "error" | "warning" | "validating";
114
+ layout?: import("antd/es/form/Form").FormItemLayout;
115
115
  wrapperCol?: import("antd").ColProps;
116
+ help?: React.ReactNode;
116
117
  fieldId?: string;
117
118
  valueType?: import("../../../render/propsType").ProFormValueType;
118
119
  switchValue?: [any, any];
@@ -126,7 +127,6 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
126
127
  toISOString?: boolean;
127
128
  toCSTString?: boolean;
128
129
  clearNotShow?: boolean;
129
- desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
130
130
  name: any;
131
131
  dependencies: any[];
132
132
  tooltip: string | {
@@ -46,8 +46,3 @@ export interface ProCascaderType {
46
46
  scrollFollowParent?: boolean;
47
47
  desensitization?: [number, number];
48
48
  }
49
- /**
50
- * 兼容旧命名导出
51
- */
52
- export type fieldNamesProps = FieldNamesType;
53
- export type ProCascaderProps = ProCascaderType;
@@ -83,7 +83,3 @@ export interface ProNumberRangeType {
83
83
  otherProps?: ProFormOtherType;
84
84
  id?: string;
85
85
  }
86
- /**
87
- * 兼容旧命名导出
88
- */
89
- export type ProNumberRangeProps = ProNumberRangeType;
@@ -31,9 +31,3 @@ export type ProLimitType = ProTimeLimitType | (ProRangeLimitType & {
31
31
  });
32
32
  declare const LimitPick: React.FC<ProLimitType>;
33
33
  export default LimitPick;
34
- /**
35
- * 兼容旧命名导出
36
- */
37
- export type ProTimeLimitProps = ProTimeLimitType;
38
- export type ProLimitProps = ProLimitType;
39
- export type Props = ProRangeLimitType;
@@ -177,8 +177,4 @@ var LimitPick = props => {
177
177
  foreverDate: foreverDate
178
178
  }, rest));
179
179
  };
180
- export default LimitPick;
181
-
182
- /**
183
- * 兼容旧命名导出
184
- */
180
+ export default LimitPick;
@@ -18,16 +18,16 @@ import type { Props as TextAreaProps } from '../base/TextArea';
18
18
  import type { ProCascaderType } from '../combination/ProCascader/propsType';
19
19
  import type { ProModalSelectType } from '../combination/ProModalSelect/propsType';
20
20
  import type { ProNumberRangeType } from '../combination/ProNumberRange/propsType';
21
- import type { ProLimitProps } from '../combination/ProTimeLimit';
21
+ import type { ProLimitType } from '../combination/ProTimeLimit';
22
22
  import type { ProRangeLimitType } from '../combination/ProRangeLimit/propsType';
23
- import type { CheckboxPropsMap, ProEnum, PropProSelectsMap, PropRadioPropsMap } from '../../../ProEnum/propsType';
24
- import type { PropSelectProps as ProSelectProps } from '../../../ProSelect/propsType';
23
+ import type { CheckboxPropsMapType, ProEnumType, PropProSelectsMapType, PropRadioPropsMapType } from '../../../ProEnum/propsType';
24
+ import type { PropSelectType as ProSelectProps } from '../../../ProSelect/propsType';
25
25
  import type { ProEditTableType } from '../../../ProEditTable/propsType';
26
26
  import type { ProTreeModalType } from '../../../ProTreeModal/propsType';
27
27
  import type { ProUploadType } from '../../../ProUpload/propsType';
28
- import type { ProTreeProps } from '../../../ProTree/propsType';
28
+ import type { ProTreeType } from '../../../ProTree/propsType';
29
29
  import type { GroupType as GroupCopyProps } from '../combination/Group/propsType';
30
- import type { ProCollapseProps } from '../../../ProLayout/components/ProCollapse/PropTypes';
30
+ import type { ProCollapseType } from '../../../ProLayout/components/ProCollapse/PropTypes';
31
31
  import type { DistributiveOmit, DiffConfigType } from '../../propsType';
32
32
  import type { DiffOriginalParams } from '../../utils/diffOriginal';
33
33
  import { NamePathsDependencyType } from '../../utils/processDependencies';
@@ -63,8 +63,8 @@ type TransformToFormField<T extends ControlProps, Values> = DistributiveOmit<T,
63
63
  /** ProForm disable时,是否完全受控 */
64
64
  disabledStrictly?: boolean;
65
65
  };
66
- type ProEnumFormType<Values> = TransformToFormField<ProEnum, Values> | TransformToFormField<ProEnum & PropProSelectsMap, Values> | TransformToFormField<ProEnum & PropRadioPropsMap, Values> | TransformToFormField<ProEnum & CheckboxPropsMap, Values>;
67
- type ProEnumTableType<Values> = TransformToTableField<ProEnum, Values> | TransformToTableField<ProEnum & PropProSelectsMap, Values> | TransformToTableField<ProEnum & PropRadioPropsMap, Values> | TransformToTableField<ProEnum & CheckboxPropsMap, Values>;
66
+ type ProEnumFormType<Values> = TransformToFormField<ProEnumType, Values> | TransformToFormField<ProEnumType & PropProSelectsMapType, Values> | TransformToFormField<ProEnumType & PropRadioPropsMapType, Values> | TransformToFormField<ProEnumType & CheckboxPropsMapType, Values>;
67
+ type ProEnumTableType<Values> = TransformToTableField<ProEnumType, Values> | TransformToTableField<ProEnumType & PropProSelectsMapType, Values> | TransformToTableField<ProEnumType & PropRadioPropsMapType, Values> | TransformToTableField<ProEnumType & CheckboxPropsMapType, Values>;
68
68
  type ProEnumFieldType<Values, TT> = TT extends 'ProForm' ? ProEnumFormType<Values> | ReactiveFunction<Values, ProEnumFormType<Values>> : ProEnumTableType<Values> | ((text: any, values: Values, index: number) => ProEnumTableType<Values>);
69
69
  type TransformToTableField<T extends ControlProps, Values> = Omit<T, 'onChange' | 'value' | 'onBlur' | 'role'> & {
70
70
  value?: T['value'];
@@ -133,7 +133,7 @@ export type ColumnTypeMap<Values = any, T = 'ProForm'> = {
133
133
  fieldProps?: FieldType<ProRangeLimitType, Values, T>;
134
134
  } | {
135
135
  type?: 'ProTimeLimit';
136
- fieldProps?: FieldType<ProLimitProps, Values, T>;
136
+ fieldProps?: FieldType<ProLimitType, Values, T>;
137
137
  } | {
138
138
  type?: 'ProEnum';
139
139
  fieldProps?: ProEnumFieldType<Values, T>;
@@ -151,13 +151,13 @@ export type ColumnTypeMap<Values = any, T = 'ProForm'> = {
151
151
  fieldProps?: FieldType<ProUploadType, Values, T>;
152
152
  } | {
153
153
  type?: 'ProTree';
154
- fieldProps?: FieldType<ProTreeProps, Values, T>;
154
+ fieldProps?: FieldType<ProTreeType, Values, T>;
155
155
  } | {
156
156
  type?: 'Group';
157
157
  fieldProps?: GroupCopyProps | ReactiveFunction<Values, GroupCopyProps>;
158
158
  } | {
159
159
  type?: 'ProCollapse';
160
- fieldProps?: ProCollapseProps | ReactiveFunction<Values, ProCollapseProps>;
160
+ fieldProps?: ProCollapseType | ReactiveFunction<Values, ProCollapseType>;
161
161
  } | {
162
162
  type?: 'Container';
163
163
  fieldProps?: any;
@@ -128,12 +128,4 @@ export interface ProFormInstanceType<T = any> extends React.ForwardRefExoticComp
128
128
  useFormInstances: any;
129
129
  [key: string]: any;
130
130
  }
131
- /**
132
- * 兼容旧命名导出
133
- */
134
- export type FooterButtonProps = FooterButtonType;
135
- export type ProFormOtherProps = ProFormOtherType;
136
- export type DiffConfigProps = DiffConfigType;
137
- export type Transform = TransformType;
138
131
  export type { ProFormColumnType } from './components/render/propsType';
139
- export type { ProColumnProps } from './components/render/propsType';
@@ -4,8 +4,4 @@ export var otherKeys = ['isView', 'viewEmpty', 'label', 'valueType', 'viewType',
4
4
  * ProForm 组件接口类型
5
5
  * 用于定义 ProForm 组件及其静态方法的类型
6
6
  * 注意:此接口的具体实现方法类型在组件文件中定义,这里只提供基础结构
7
- */
8
-
9
- /**
10
- * 兼容旧命名导出
11
7
  */
@@ -178,5 +178,4 @@ export interface ProIconType {
178
178
  */
179
179
  buttonIcon?: boolean;
180
180
  }
181
- export type ProIconProps = ProIconType;
182
181
  export {};
@@ -38,7 +38,7 @@ export interface ProCollapseType {
38
38
  * @description 折叠头部多个标题
39
39
  * @default []
40
40
  */
41
- titleList?: TitleListProps[];
41
+ titleList?: TitleListType[];
42
42
  /**
43
43
  * @description id用于锚点定位
44
44
  * @default -
@@ -96,5 +96,3 @@ export interface ProCollapseType {
96
96
  collapsePanelProps?: CollapsePanelProps;
97
97
  [key: string]: any;
98
98
  }
99
- export type ProCollapseProps = ProCollapseType;
100
- export type TitleListProps = TitleListType;
@@ -25,4 +25,3 @@ export interface ProFooterType {
25
25
  contentDom?: string;
26
26
  [key: string]: any;
27
27
  }
28
- export type ProFooterProps = ProFooterType;
@@ -204,7 +204,3 @@ export interface ProHeaderType {
204
204
  onBack?: () => void;
205
205
  [key: string]: any;
206
206
  }
207
- export type ProHeaderProps = ProHeaderType;
208
- export type BreadcrumbColumnsProps = BreadcrumbColumnType;
209
- export type SubDescribeColumnsProps = SubDescribeColumnType;
210
- export type DescribeColumnsProps = DescribeColumnType;
@@ -11,7 +11,7 @@ class SimpleTabsCache {
11
11
  constructor(keyPrefix, strategy) {
12
12
  _defineProperty(this, "cacheKey", void 0);
13
13
  _defineProperty(this, "storage", void 0);
14
- this.cacheKey = `${keyPrefix}_tabs_cache`;
14
+ this.cacheKey = keyPrefix;
15
15
  this.storage = strategy === 'localStorage' ? localStorage : sessionStorage;
16
16
  }
17
17
 
@@ -70,7 +70,6 @@ export interface TabsCacheManager {
70
70
  clear: () => void;
71
71
  }
72
72
  export declare const DEFAULT_TABS_CONFIG: {
73
- max: number;
74
73
  storage: "localStorage";
75
74
  cacheKey: string;
76
75
  };
@@ -10,7 +10,6 @@
10
10
 
11
11
  // 默认配置
12
12
  export var DEFAULT_TABS_CONFIG = {
13
- max: 20,
14
13
  storage: 'localStorage',
15
- cacheKey: 'pro_layout_tabs'
14
+ cacheKey: 'pro-layout-tabs'
16
15
  };
@@ -17,8 +17,11 @@ export declare const shouldOpenExternal: (menuItem: MenusType, target?: string)
17
17
  export declare const handleExternalOpen: (menuItem: MenusType) => void;
18
18
  /**
19
19
  * 检查是否超出最大标签页限制
20
+ * @param currentTabs 当前标签页列表
21
+ * @param maxTabs 最大标签页数量,如果为 undefined 或 null,表示无限制
22
+ * @returns 如果超出限制返回 true,否则返回 false
20
23
  */
21
- export declare const checkTabLimit: (currentTabs: TabItem[], maxTabs: number) => boolean;
24
+ export declare const checkTabLimit: (currentTabs: TabItem[], maxTabs?: number | null) => boolean;
22
25
  /**
23
26
  * 移除最旧的标签页(根据访问时间或创建时间)
24
27
  */
@@ -50,8 +50,15 @@ export var handleExternalOpen = menuItem => {
50
50
 
51
51
  /**
52
52
  * 检查是否超出最大标签页限制
53
+ * @param currentTabs 当前标签页列表
54
+ * @param maxTabs 最大标签页数量,如果为 undefined 或 null,表示无限制
55
+ * @returns 如果超出限制返回 true,否则返回 false
53
56
  */
54
57
  export var checkTabLimit = (currentTabs, maxTabs) => {
58
+ // 如果 maxTabs 为 undefined 或 null,表示无限制
59
+ if (maxTabs === undefined || maxTabs === null) {
60
+ return false;
61
+ }
55
62
  return currentTabs.length >= maxTabs;
56
63
  };
57
64
 
@@ -235,8 +235,6 @@ export interface ProLayoutStatesType {
235
235
  */
236
236
  [key: string]: any;
237
237
  }
238
- export type MenusProps = MenusType;
239
- export type DataSourceProps = DataSourceType;
240
238
  export interface TabItem {
241
239
  /**
242
240
  * @description 标签唯一标识
@@ -373,8 +371,6 @@ export interface ProLayoutNormalProps extends ProLayoutBaseProps {
373
371
  tabs?: never;
374
372
  }
375
373
  export type ProLayoutType = ProLayoutTabsProps | ProLayoutNormalProps;
376
- export type ProLayoutProps = ProLayoutType;
377
- export type ProLayoutStates = ProLayoutStatesType;
378
374
  export declare const isTabsMode: (props: ProLayoutType) => props is ProLayoutTabsProps;
379
375
  export declare const validateTabsProps: (mode?: ProLayoutMode, tabs?: TabsConfig) => void;
380
376
  export {};
@@ -6,8 +6,6 @@
6
6
  * @description 是否带有菜单界面的配置
7
7
  */
8
8
 
9
- // 为了向后兼容,保留旧的类型名称但使用新的类型定义
10
-
11
9
  /**
12
10
  * @description 添加标签页的业务参数
13
11
  */
@@ -23,7 +23,22 @@ import { ProForm } from '..';
23
23
  import locale from "../locale";
24
24
  import { getSelectList } from "./utils";
25
25
  import { jsx as _jsx } from "react/jsx-runtime";
26
- var Option = Select.Option;
26
+ var Option = Select.Option,
27
+ OptGroup = Select.OptGroup;
28
+
29
+ /** 将 selectList(扁平或分组)转为扁平选项列表,用于查找、回显、defaultOne */
30
+ function flattenOptions(list) {
31
+ if (!Array.isArray(list) || !list.length) return [];
32
+ var out = [];
33
+ list.forEach(item => {
34
+ if (Array.isArray(item.options)) {
35
+ out.push(...item.options);
36
+ } else {
37
+ out.push(item);
38
+ }
39
+ });
40
+ return out;
41
+ }
27
42
  export var ProSelect = (props, ref) => {
28
43
  var _selectProps$showCode, _useRequest$options3, _locale$ProSelect;
29
44
  var _ref = useProConfig('ProSelect') || {},
@@ -123,16 +138,17 @@ export var ProSelect = (props, ref) => {
123
138
  }
124
139
  }));
125
140
  var cacheList = useRequest !== null && useRequest !== void 0 && (_useRequest$options3 = useRequest.options) !== null && _useRequest$options3 !== void 0 && _useRequest$options3.cacheKey ? successTransformDataHandle(fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data) : [];
141
+ var flatOptions = flattenOptions(selectList);
126
142
  var getValueObject = input => {
127
143
  if (Array.isArray(input) && input.length) {
128
144
  var resArr = [];
129
145
  input.forEach(i => {
130
- var res = selectList.find(item => item[code] === i);
146
+ var res = flatOptions.find(item => item[code] === i);
131
147
  if (res) resArr.push(res);
132
148
  });
133
149
  return resArr;
134
150
  }
135
- return selectList.find(item => item[code] === input);
151
+ return flatOptions.find(item => item[code] === input);
136
152
  };
137
153
  useImperativeHandle(ref, () => ({
138
154
  getValueObject,
@@ -178,11 +194,11 @@ export var ProSelect = (props, ref) => {
178
194
  }
179
195
  }, [defaultOne, value, isDefaultOne, selectList, code, onChange]);
180
196
  var transToLabel = value => {
181
- if (!Array.isArray(selectList) || !selectList.length) {
197
+ if (!flatOptions.length) {
182
198
  return viewEmpty;
183
199
  }
184
200
  var labelList = value.map(v => {
185
- var option = selectList.find(item => {
201
+ var option = flatOptions.find(item => {
186
202
  if (labelInValue) {
187
203
  return item[code] === v[code];
188
204
  }
@@ -194,7 +210,7 @@ export var ProSelect = (props, ref) => {
194
210
  return '-';
195
211
  });
196
212
  var record = value.map(v => {
197
- return selectList.find(item => {
213
+ return flatOptions.find(item => {
198
214
  if (labelInValue) {
199
215
  return item[code] === v[code];
200
216
  }
@@ -293,7 +309,7 @@ export var ProSelect = (props, ref) => {
293
309
  }
294
310
  // 只有当 dataSource 只有一个值时才默认回填(只返回值,不进行状态更新)
295
311
  if (defaultOne && !value && !isDefaultOne && (selectList === null || selectList === void 0 ? void 0 : selectList.length) === 1) {
296
- var option = selectList === null || selectList === void 0 ? void 0 : selectList[0];
312
+ var option = flatOptions[0];
297
313
  // selectList 可能是异步回来的值
298
314
  if (option) {
299
315
  return option === null || option === void 0 ? void 0 : option[code];
@@ -327,6 +343,7 @@ export var ProSelect = (props, ref) => {
327
343
  showSearch: true,
328
344
  filterOption: isFunction(_onSearch) ? false : (input, option) => {
329
345
  var _option$children;
346
+ if ((option === null || option === void 0 ? void 0 : option.value) == null) return false;
330
347
  var value = isString(option === null || option === void 0 ? void 0 : option.children) ? option === null || option === void 0 ? void 0 : option.children : option === null || option === void 0 || (_option$children = option.children) === null || _option$children === void 0 || (_option$children = _option$children.props) === null || _option$children === void 0 ? void 0 : _option$children.title;
331
348
  return value.toLowerCase().includes(input.toLowerCase());
332
349
  },
@@ -342,6 +359,27 @@ export var ProSelect = (props, ref) => {
342
359
  var itemValue = item[code];
343
360
  var itemKey = itemValue != null ? `${itemValue}-${index}` : `option-${index}`;
344
361
  var optionValue = itemValue != null ? itemValue : undefined;
362
+ var groupOpts = item.options;
363
+ if (Array.isArray(groupOpts)) {
364
+ var _item$label;
365
+ return /*#__PURE__*/_jsx(OptGroup, {
366
+ label: item[label],
367
+ children: groupOpts.map(opt => /*#__PURE__*/_jsx(Option, {
368
+ label: opt[label],
369
+ value: opt[code],
370
+ record: opt,
371
+ disabled: !!opt.disabled,
372
+ children: /*#__PURE__*/_jsx(TooltipOption, {
373
+ title: OptionRender ? OptionRender(opt) : selectProps.showCodeName ? `${opt[code]}-${opt[label]}` : opt[label],
374
+ children: OptionRender ? /*#__PURE__*/_jsx("span", {
375
+ children: OptionRender(opt)
376
+ }) : /*#__PURE__*/_jsx("span", {
377
+ children: selectProps.showCodeName ? `${opt[code]}-${opt[label]}` : opt[label]
378
+ })
379
+ })
380
+ }, opt[code]))
381
+ }, (_item$label = item[label]) !== null && _item$label !== void 0 ? _item$label : `group-${index}`);
382
+ }
345
383
  return /*#__PURE__*/_jsx(Option, {
346
384
  label: item[label],
347
385
  value: optionValue,
@@ -158,7 +158,3 @@ export interface ResponseDataType {
158
158
  */
159
159
  code?: number;
160
160
  }
161
- export type DataOption = DataOptionType;
162
- export type PropSelectProps = PropSelectType;
163
- export type ProSelectAction = ProSelectActionType;
164
- export type ResponseData = ResponseDataType;
@@ -754,8 +754,4 @@ export interface ProTableUseAntdTableType<I, R> {
754
754
  allSelected: boolean;
755
755
  [key: string]: any;
756
756
  }
757
- export type ProTableProps<T = any> = ProTableType<T>;
758
- export type ProTableColumn = ProTableColumnType;
759
- export type ProTableSummaryProps = ProTableSummaryType;
760
- export type UseAntdTableState<I, R> = ProTableUseAntdTableType<I, R>;
761
757
  export {};
@@ -1,3 +1,3 @@
1
- import { CardProps } from '../../propType';
2
- declare const Card: (props: CardProps) => import("react/jsx-runtime").JSX.Element;
1
+ import { CardType } from '../../propType';
2
+ declare const Card: (props: CardType) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Card;
@@ -92,7 +92,3 @@ export interface ProTabsType extends Omit<TabsProps, 'items' | 'onChange'> {
92
92
  size?: 'small' | 'middle' | 'large';
93
93
  [key: string]: any;
94
94
  }
95
- export type ProTabsProps = ProTabsType;
96
- export type ProTabsItemsProps = ProTabsItemType;
97
- export type ProTabsAction = ProTabsActionType;
98
- export type CardProps = CardType;
@@ -168,5 +168,3 @@ export interface LocalThemeConfigType {
168
168
  */
169
169
  zauiBaseFontSize?: string;
170
170
  }
171
- export type ProThemeToolsProps = ProThemeToolsType;
172
- export type LocalThemeConfigPropsType = LocalThemeConfigType;
@@ -55,4 +55,3 @@ export type ProTooltipTriggerNodeType = HTMLElement & {
55
55
  /** 父节点元素 */
56
56
  parentNode: HTMLElement;
57
57
  };
58
- export type ProTooltipProps = ProTooltipType;
@@ -437,5 +437,3 @@ export interface ProTreeSelectResponseDataType {
437
437
  */
438
438
  code?: number;
439
439
  }
440
- export type PropTreeSelectProps = ProTreeSelectType;
441
- export type ProSelectAction = ProTreeSelectActionType;