@antdv-vue/pro-utils 0.0.0-stage → 2.1.1
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/CHANGELOG.md +123 -0
- package/README.md +80 -2
- package/dist/autoFocusToFirstChild/index.d.ts +9 -0
- package/dist/autoFocusToFirstChild/index.js +36 -0
- package/dist/childrenToArray/index.d.ts +7 -0
- package/dist/childrenToArray/index.js +8 -0
- package/dist/components/CopyToClipboard/copy/index.d.ts +10 -0
- package/dist/components/CopyToClipboard/copy/index.js +84 -0
- package/dist/components/CopyToClipboard/copy/toggle-selection.d.ts +4 -0
- package/dist/components/CopyToClipboard/copy/toggle-selection.js +27 -0
- package/dist/components/CopyToClipboard/index.d.ts +14 -0
- package/dist/components/CopyToClipboard/index.js +13 -0
- package/dist/components/Draggable/Draggable.d.ts +62 -0
- package/dist/components/Draggable/Draggable.js +162 -0
- package/dist/components/Draggable/DraggableCore.d.ts +40 -0
- package/dist/components/Draggable/DraggableCore.js +149 -0
- package/dist/components/Draggable/index.d.ts +4 -0
- package/dist/components/Draggable/index.js +3 -0
- package/dist/components/Draggable/types.d.ts +30 -0
- package/dist/components/Draggable/types.js +1 -0
- package/dist/components/Draggable/utils/domFns.d.ts +36 -0
- package/dist/components/Draggable/utils/domFns.js +165 -0
- package/dist/components/Draggable/utils/getPrefix.d.ts +6 -0
- package/dist/components/Draggable/utils/getPrefix.js +31 -0
- package/dist/components/Draggable/utils/positionFns.d.ts +13 -0
- package/dist/components/Draggable/utils/positionFns.js +96 -0
- package/dist/components/Draggable/utils/shims.d.ts +7 -0
- package/dist/components/Draggable/utils/shims.js +19 -0
- package/dist/components/DropdownFooter/index.d.ts +20 -0
- package/dist/components/DropdownFooter/index.js +80 -0
- package/dist/components/DropdownFooter/style/index.d.ts +8 -0
- package/dist/components/DropdownFooter/style/index.js +18 -0
- package/dist/components/ErrorBoundary/index.d.ts +25 -0
- package/dist/components/ErrorBoundary/index.js +65 -0
- package/dist/components/FieldLabel/index.d.ts +31 -0
- package/dist/components/FieldLabel/index.js +212 -0
- package/dist/components/FieldLabel/style/index.d.ts +8 -0
- package/dist/components/FieldLabel/style/index.js +146 -0
- package/dist/components/FilterDropdown/index.d.ts +38 -0
- package/dist/components/FilterDropdown/index.js +91 -0
- package/dist/components/FilterDropdown/style/index.d.ts +8 -0
- package/dist/components/FilterDropdown/style/index.js +21 -0
- package/dist/components/FormItem/FormItemInput.d.ts +34 -0
- package/dist/components/FormItem/FormItemInput.js +163 -0
- package/dist/components/FormItem/ItemHolder.d.ts +58 -0
- package/dist/components/FormItem/ItemHolder.js +289 -0
- package/dist/components/FormItem/index.d.ts +64 -0
- package/dist/components/FormItem/index.js +591 -0
- package/dist/components/FormList/Field.d.ts +29 -0
- package/dist/components/FormList/Field.js +106 -0
- package/dist/components/FormList/FieldContext.d.ts +15 -0
- package/dist/components/FormList/FieldContext.js +11 -0
- package/dist/components/FormList/InternalField.d.ts +51 -0
- package/dist/components/FormList/InternalField.js +149 -0
- package/dist/components/FormList/ListContext.d.ts +12 -0
- package/dist/components/FormList/ListContext.js +11 -0
- package/dist/components/FormList/index.d.ts +36 -0
- package/dist/components/FormList/index.js +145 -0
- package/dist/components/FormList/interface.d.ts +9 -0
- package/dist/components/FormList/interface.js +1 -0
- package/dist/components/FormList/namePathType.d.ts +9 -0
- package/dist/components/FormList/namePathType.js +1 -0
- package/dist/components/FormList/utils/index.d.ts +15 -0
- package/dist/components/FormList/utils/index.js +37 -0
- package/dist/components/InlineErrorFormItem/InlineErrorFormItemPopover.d.ts +21 -0
- package/dist/components/InlineErrorFormItem/InlineErrorFormItemPopover.js +95 -0
- package/dist/components/InlineErrorFormItem/index.d.ts +14 -0
- package/dist/components/InlineErrorFormItem/index.js +44 -0
- package/dist/components/InlineErrorFormItem/style/index.d.ts +8 -0
- package/dist/components/InlineErrorFormItem/style/index.js +46 -0
- package/dist/components/LabelIconTip/index.d.ts +16 -0
- package/dist/components/LabelIconTip/index.js +79 -0
- package/dist/components/LabelIconTip/style/index.d.ts +8 -0
- package/dist/components/LabelIconTip/style/index.js +38 -0
- package/dist/components/ProFormContext/index.d.ts +51 -0
- package/dist/components/ProFormContext/index.js +11 -0
- package/dist/conversionMomentValue/index.d.ts +48 -0
- package/dist/conversionMomentValue/index.js +103 -0
- package/dist/dateArrayFormatter/index.d.ts +14 -0
- package/dist/dateArrayFormatter/index.js +38 -0
- package/dist/deepMerge/index.d.ts +4 -0
- package/dist/deepMerge/index.js +17 -0
- package/dist/genCopyable/index.d.ts +27 -0
- package/dist/genCopyable/index.js +82 -0
- package/dist/getFieldPropsOrFormItemProps/index.d.ts +18 -0
- package/dist/getFieldPropsOrFormItemProps/index.js +15 -0
- package/dist/getSlot/index.d.ts +8 -0
- package/dist/getSlot/index.js +11 -0
- package/dist/hooks/index.d.ts +9 -0
- package/dist/hooks/index.js +9 -0
- package/dist/hooks/useDebounceFn/index.d.ts +12 -0
- package/dist/hooks/useDebounceFn/index.js +34 -0
- package/dist/hooks/useDebounceValue/index.d.ts +12 -0
- package/dist/hooks/useDebounceValue/index.js +21 -0
- package/dist/hooks/useDocumentTitle/index.d.ts +10 -0
- package/dist/hooks/useDocumentTitle/index.js +12 -0
- package/dist/hooks/useEffect/index.d.ts +6 -0
- package/dist/hooks/useEffect/index.js +17 -0
- package/dist/hooks/useFetchData/index.d.ts +12 -0
- package/dist/hooks/useFetchData/index.js +35 -0
- package/dist/hooks/useLayoutEffect/index.d.ts +6 -0
- package/dist/hooks/useLayoutEffect/index.js +21 -0
- package/dist/hooks/useMemo/index.d.ts +6 -0
- package/dist/hooks/useMemo/index.js +13 -0
- package/dist/hooks/useState/index.d.ts +6 -0
- package/dist/hooks/useState/index.js +11 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +58 -0
- package/dist/isBrowser/index.d.ts +4 -0
- package/dist/isBrowser/index.js +8 -0
- package/dist/isDropdownValueType/index.d.ts +4 -0
- package/dist/isDropdownValueType/index.js +8 -0
- package/dist/isImg/index.d.ts +5 -0
- package/dist/isImg/index.js +7 -0
- package/dist/isNil/index.d.ts +4 -0
- package/dist/isNil/index.js +6 -0
- package/dist/isUrl/index.d.ts +9 -0
- package/dist/isUrl/index.js +17 -0
- package/dist/merge/index.d.ts +9 -0
- package/dist/merge/index.js +20 -0
- package/dist/nanoid/index.d.ts +9 -0
- package/dist/nanoid/index.js +25 -0
- package/dist/normalizeProps/index.d.ts +6 -0
- package/dist/normalizeProps/index.js +6 -0
- package/dist/omitBoolean/index.d.ts +9 -0
- package/dist/omitBoolean/index.js +11 -0
- package/dist/omitUndefined/index.d.ts +5 -0
- package/dist/omitUndefined/index.js +11 -0
- package/dist/omitUndefinedAndEmptyArr/index.d.ts +4 -0
- package/dist/omitUndefinedAndEmptyArr/index.js +12 -0
- package/dist/parseValueToDay/index.d.ts +7 -0
- package/dist/parseValueToDay/index.js +21 -0
- package/dist/pickProFormItemProps/index.d.ts +34 -0
- package/dist/pickProFormItemProps/index.js +42 -0
- package/dist/pickProProps/index.d.ts +4 -0
- package/dist/pickProProps/index.js +14 -0
- package/dist/pro-utils.esm.js +3672 -0
- package/dist/proFieldParsingText/index.d.ts +25 -0
- package/dist/proFieldParsingText/index.js +100 -0
- package/dist/runFunction/index.d.ts +5 -0
- package/dist/runFunction/index.js +8 -0
- package/dist/stringify/index.d.ts +7 -0
- package/dist/stringify/index.js +10 -0
- package/dist/transformBooleanProps/index.d.ts +4 -0
- package/dist/transformBooleanProps/index.js +9 -0
- package/dist/transformKeySubmitValue/index.d.ts +24 -0
- package/dist/transformKeySubmitValue/index.js +200 -0
- package/dist/transformVueNodeType/index.d.ts +14 -0
- package/dist/transformVueNodeType/index.js +14 -0
- package/dist/typing.d.ts +562 -0
- package/dist/typing.js +1 -0
- package/dist/useEditableArray/components/CancelEditableAction.d.ts +47 -0
- package/dist/useEditableArray/components/CancelEditableAction.js +90 -0
- package/dist/useEditableArray/components/DeleteEditableAction.d.ts +33 -0
- package/dist/useEditableArray/components/DeleteEditableAction.js +63 -0
- package/dist/useEditableArray/components/SaveEditableAction.d.ts +33 -0
- package/dist/useEditableArray/components/SaveEditableAction.js +79 -0
- package/dist/useEditableArray/index.d.ts +66 -0
- package/dist/useEditableArray/index.js +584 -0
- package/dist/useEditableArray/typing.d.ts +130 -0
- package/dist/useEditableArray/typing.js +1 -0
- package/dist/useEditableMap/index.d.ts +32 -0
- package/dist/useEditableMap/index.js +147 -0
- package/dist/useMediaQuery/index.d.ts +44 -0
- package/dist/useMediaQuery/index.js +99 -0
- package/dist/useMediaQuery/query.d.ts +6 -0
- package/dist/useMediaQuery/query.js +17 -0
- package/dist/useMountMergeState/index.d.ts +11 -0
- package/dist/useMountMergeState/index.js +26 -0
- package/dist/usePrevious/index.d.ts +6 -0
- package/dist/usePrevious/index.js +11 -0
- package/dist/useRefFunction/index.d.ts +4 -0
- package/dist/useRefFunction/index.js +11 -0
- package/package.json +69 -3
package/dist/typing.d.ts
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
import { UseEditableUtilType } from "./useEditableArray/index.js";
|
|
2
|
+
import { CSSProperties, VNode } from "vue";
|
|
3
|
+
import { AutoCompleteProps, AvatarProps, CascaderProps, CheckboxProps, ColorPickerProps, DatePickerProps, DividerProps, FormInstance, FormItemProps, ImageProps, InputNumberProps, InputOTPProps, InputProps, PopoverProps, ProgressProps, RadioProps, RangePickerProps, RateProps, SegmentedProps, SelectProps, SliderProps, SpaceProps, SwitchProps, TextAreaProps, TimeRangePickerProps, TreeSelectProps } from "antdv-next";
|
|
4
|
+
import { ProSchemaValueEnumType } from "@antdv-vue/pro-provider";
|
|
5
|
+
import { FormItemTooltipType } from "antdv-next/dist/form/FormItemLabel";
|
|
6
|
+
import { Key, VueNode } from "@v-c/util/dist/type";
|
|
7
|
+
import { VueNode as VueNode$2 } from "antdv-next/dist/_util/type";
|
|
8
|
+
import { NamePath } from "antdv-next/dist/form/types";
|
|
9
|
+
import { PasswordProps } from "antdv-next/dist/input/Password";
|
|
10
|
+
|
|
11
|
+
//#region src/typing.d.ts
|
|
12
|
+
type WithFalse<T> = T | false;
|
|
13
|
+
interface ProFormBaseGroupProps {
|
|
14
|
+
/**
|
|
15
|
+
* @name title 分组的标题
|
|
16
|
+
*/
|
|
17
|
+
title?: VueNode;
|
|
18
|
+
/**
|
|
19
|
+
* @name tooltip 标题旁边的?号提示展示的信息
|
|
20
|
+
*
|
|
21
|
+
* @example 自定义提示信息
|
|
22
|
+
* <ProForm.Group title="标题" tooltip="自定义提示信息">
|
|
23
|
+
* @example 自定义Icon
|
|
24
|
+
* <ProForm.Group title="标题" tooltip={{icon:<Info/>,title:自定义提示信息}}>
|
|
25
|
+
*/
|
|
26
|
+
tooltip?: FormItemTooltipType | string;
|
|
27
|
+
/**
|
|
28
|
+
* @name extra 额外的内容配置,在标题的另外一边
|
|
29
|
+
*
|
|
30
|
+
* @example 额外的内容配置
|
|
31
|
+
* <ProForm.Group title="标题" extra={<ProFormSwitch name="open"/>} />
|
|
32
|
+
*/
|
|
33
|
+
extra?: VueNode;
|
|
34
|
+
/**
|
|
35
|
+
* @name size 组件之前的间隔
|
|
36
|
+
*/
|
|
37
|
+
size?: SpaceProps['size'];
|
|
38
|
+
/**
|
|
39
|
+
* @name style 自定义样式
|
|
40
|
+
*/
|
|
41
|
+
style?: CSSProperties;
|
|
42
|
+
/**
|
|
43
|
+
* @name titleStyle 自定义 title 样式
|
|
44
|
+
* @example 增加背景颜色
|
|
45
|
+
* <ProForm.Group titleStyle={{ backgroundColor: '#f0f0f0' }} />
|
|
46
|
+
*/
|
|
47
|
+
titleStyle?: CSSProperties;
|
|
48
|
+
/**
|
|
49
|
+
* @name titleRender 自定义title
|
|
50
|
+
* @example 自定义标题
|
|
51
|
+
* <ProForm.Group title={(_,props)=><span>自定义标题</span>}>
|
|
52
|
+
*/
|
|
53
|
+
titleRender?: (title: VueNode, props: ProFormBaseGroupProps) => VueNode;
|
|
54
|
+
/** @name align 子项的对齐方式 */
|
|
55
|
+
align?: SpaceProps['align'];
|
|
56
|
+
spaceProps?: SpaceProps & {
|
|
57
|
+
class?: string;
|
|
58
|
+
style?: CSSProperties;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* @name orientation 子项的排列方式
|
|
62
|
+
*/
|
|
63
|
+
orientation?: SpaceProps['orientation'];
|
|
64
|
+
/**
|
|
65
|
+
* @name labelLayout 布局方式,键值对模式和两行模式
|
|
66
|
+
* @default inline
|
|
67
|
+
*/
|
|
68
|
+
labelLayout?: 'inline' | 'twoLine';
|
|
69
|
+
/**
|
|
70
|
+
* @name collapsed 是否折叠
|
|
71
|
+
*/
|
|
72
|
+
collapsed?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* @name collapsible 是否可折叠
|
|
75
|
+
*/
|
|
76
|
+
collapsible?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* @name defaultCollapsed 默认的折叠状态
|
|
79
|
+
*/
|
|
80
|
+
defaultCollapsed?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* @name onCollapse 折叠修改的事件
|
|
83
|
+
*/
|
|
84
|
+
onCollapse?: (collapsed: boolean) => void;
|
|
85
|
+
/**
|
|
86
|
+
* @name autoFocus 自定选中一个input,只能有一个生效
|
|
87
|
+
*/
|
|
88
|
+
autoFocus?: boolean;
|
|
89
|
+
}
|
|
90
|
+
type Value = string | number | undefined | null;
|
|
91
|
+
type ValuePair = Value[];
|
|
92
|
+
/**
|
|
93
|
+
* ProFieldValueTypeWithFieldProps
|
|
94
|
+
* 字段值类型与 ProFieldProps 的映射关系
|
|
95
|
+
*/
|
|
96
|
+
interface ProFieldValueTypeWithFieldProps {
|
|
97
|
+
/** 文本输入框 */
|
|
98
|
+
text: InputProps;
|
|
99
|
+
/** 密码输入框 */
|
|
100
|
+
password: PasswordProps;
|
|
101
|
+
/** 金额 */
|
|
102
|
+
money: InputNumberProps & {
|
|
103
|
+
numberFormatOptions?: {
|
|
104
|
+
localeMatcher?: string;
|
|
105
|
+
style?: string;
|
|
106
|
+
currency?: string;
|
|
107
|
+
currencyDisplay?: string;
|
|
108
|
+
currencySign?: string;
|
|
109
|
+
useGrouping?: boolean;
|
|
110
|
+
minimumIntegerDigits?: number;
|
|
111
|
+
minimumFractionDigits?: number;
|
|
112
|
+
maximumFractionDigits?: number;
|
|
113
|
+
minimumSignificantDigits?: number;
|
|
114
|
+
maximumSignificantDigits?: number;
|
|
115
|
+
};
|
|
116
|
+
numberPopoverRender?: ((props: InputNumberProps, defaultText: string) => VueNode) | boolean;
|
|
117
|
+
customSymbol?: string;
|
|
118
|
+
moneySymbol?: boolean;
|
|
119
|
+
open?: boolean;
|
|
120
|
+
};
|
|
121
|
+
/** 索引 */
|
|
122
|
+
index: Record<string, any>;
|
|
123
|
+
/** 索引带边框 */
|
|
124
|
+
indexBorder: Record<string, any>;
|
|
125
|
+
/** 下拉选择 */
|
|
126
|
+
option: Record<string, any>;
|
|
127
|
+
/** 多行文本 */
|
|
128
|
+
textarea: TextAreaProps;
|
|
129
|
+
/** 日期选择器 */
|
|
130
|
+
date: DatePickerProps;
|
|
131
|
+
/** 周选择器 */
|
|
132
|
+
dateWeek: DatePickerProps;
|
|
133
|
+
/** 月选择器 */
|
|
134
|
+
dateMonth: DatePickerProps;
|
|
135
|
+
/** 季度选择器 */
|
|
136
|
+
dateQuarter: DatePickerProps;
|
|
137
|
+
/** 年选择器 */
|
|
138
|
+
dateYear: DatePickerProps;
|
|
139
|
+
/** 日期时间选择器 */
|
|
140
|
+
dateTime: DatePickerProps;
|
|
141
|
+
/** 相对时间 */
|
|
142
|
+
fromNow: DatePickerProps;
|
|
143
|
+
/** 日期范围选择器 */
|
|
144
|
+
dateRange: RangePickerProps;
|
|
145
|
+
/** 日期时间范围选择器 */
|
|
146
|
+
dateTimeRange: RangePickerProps;
|
|
147
|
+
/** 周范围选择器 */
|
|
148
|
+
dateWeekRange: RangePickerProps;
|
|
149
|
+
/** 月范围选择器 */
|
|
150
|
+
dateMonthRange: RangePickerProps;
|
|
151
|
+
/** 季范围选择器 */
|
|
152
|
+
dateQuarterRange: RangePickerProps;
|
|
153
|
+
/** 年范围选择器 */
|
|
154
|
+
dateYearRange: RangePickerProps;
|
|
155
|
+
/** 时间选择器 */
|
|
156
|
+
time: TimeRangePickerProps;
|
|
157
|
+
/** 时间范围选择器 */
|
|
158
|
+
timeRange: TimeRangePickerProps;
|
|
159
|
+
/** 下拉选择器 */
|
|
160
|
+
select: SelectProps;
|
|
161
|
+
/** 复选框 */
|
|
162
|
+
checkbox: CheckboxProps;
|
|
163
|
+
/** 评分 */
|
|
164
|
+
rate: RateProps;
|
|
165
|
+
slider: SliderProps;
|
|
166
|
+
/** 单选框 */
|
|
167
|
+
radio: RadioProps;
|
|
168
|
+
/** 单选框按钮 */
|
|
169
|
+
radioButton: RadioProps;
|
|
170
|
+
/** 进度条 */
|
|
171
|
+
progress: ProgressProps | InputNumberProps;
|
|
172
|
+
/** 百分比输入框 */
|
|
173
|
+
percent: InputNumberProps;
|
|
174
|
+
/** 数字输入框 */
|
|
175
|
+
digit: InputNumberProps & {
|
|
176
|
+
intlProps: Intl.NumberFormatOptions;
|
|
177
|
+
};
|
|
178
|
+
/** 数字范围输入框 */
|
|
179
|
+
digitRange: Omit<InputNumberProps, 'placeholder' | 'value' | 'defaultValue' | 'onChange'> & {
|
|
180
|
+
id?: string;
|
|
181
|
+
placeholder?: string[];
|
|
182
|
+
value?: ValuePair;
|
|
183
|
+
defaultValue?: ValuePair;
|
|
184
|
+
onChange?: (value?: ValuePair) => void;
|
|
185
|
+
intlProps?: Intl.NumberFormatOptions;
|
|
186
|
+
};
|
|
187
|
+
/** 秒数输入框 */
|
|
188
|
+
second: InputNumberProps;
|
|
189
|
+
/** 代码输入框 */
|
|
190
|
+
code: InputProps | TextAreaProps;
|
|
191
|
+
/** JSON 代码输入框 */
|
|
192
|
+
jsonCode: InputProps | TextAreaProps;
|
|
193
|
+
/** 头像 */
|
|
194
|
+
avatar: AvatarProps;
|
|
195
|
+
/** 开关 */
|
|
196
|
+
switch: SwitchProps;
|
|
197
|
+
/** 图片 */
|
|
198
|
+
image: ImageProps | InputProps;
|
|
199
|
+
/** 级联选择 */
|
|
200
|
+
cascader: CascaderProps<any>;
|
|
201
|
+
/** 树形选择 */
|
|
202
|
+
treeSelect: TreeSelectProps;
|
|
203
|
+
/** 颜色选择器 */
|
|
204
|
+
color: ColorPickerProps & {
|
|
205
|
+
value?: string;
|
|
206
|
+
popoverProps?: PopoverProps;
|
|
207
|
+
mode?: 'read' | 'edit';
|
|
208
|
+
onChange?: (color: string) => void;
|
|
209
|
+
colors?: string[];
|
|
210
|
+
};
|
|
211
|
+
/** 分段器 */
|
|
212
|
+
segmented: SegmentedProps;
|
|
213
|
+
/** 分组 */
|
|
214
|
+
group: ProFormBaseGroupProps;
|
|
215
|
+
/** 表单列表 */
|
|
216
|
+
formList: Record<string, any>;
|
|
217
|
+
/** 表单集合 */
|
|
218
|
+
formSet: Record<string, any>;
|
|
219
|
+
/** 分割线 */
|
|
220
|
+
divider: DividerProps;
|
|
221
|
+
/** 显示/隐藏 */
|
|
222
|
+
dependency: FormItemProps;
|
|
223
|
+
/** 自动完成 */
|
|
224
|
+
autoComplete: AutoCompleteProps;
|
|
225
|
+
/** 一次性输入 */
|
|
226
|
+
otp: InputOTPProps;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* @param textarea 文本框
|
|
230
|
+
* @param password 密码框
|
|
231
|
+
* @param money 金额 option 操作 需要返回一个数组
|
|
232
|
+
* @param date 日期 YYYY-MM-DD
|
|
233
|
+
* @param dateWeek 周选择器
|
|
234
|
+
* @param dateMonth 月选择器
|
|
235
|
+
* @param dateQuarter 季度选择器
|
|
236
|
+
* @param dateYear 年选择器
|
|
237
|
+
* @param dateRange 日期范围 YYYY-MM-DD[]
|
|
238
|
+
* @param dateTime 日期和时间 YYYY-MM-DD HH:mm:ss
|
|
239
|
+
* @param dateTimeRange 范围日期和时间 YYYY-MM-DD HH:mm:ss[]
|
|
240
|
+
* @param time 时间 HH:mm:ss
|
|
241
|
+
* @param timeRange 时间区间 HH:mm:ss[]
|
|
242
|
+
* @param index 序列
|
|
243
|
+
* @param indexBorder 序列
|
|
244
|
+
* @param progress 进度条
|
|
245
|
+
* @param percent 百分比
|
|
246
|
+
* @param digit 数值
|
|
247
|
+
* @param second 秒速
|
|
248
|
+
* @param fromNow 相对于当前时间
|
|
249
|
+
* @param avatar 头像
|
|
250
|
+
* @param code 代码块
|
|
251
|
+
* @param image 图片设置
|
|
252
|
+
* @param jsonCode Json 的代码块,格式化了一下
|
|
253
|
+
* @param color 颜色选择器
|
|
254
|
+
* @param autoComplete 自动完成
|
|
255
|
+
* @param opt 一次性输入
|
|
256
|
+
*/
|
|
257
|
+
type ProFieldValueType = Extract<keyof ProFieldValueTypeWithFieldProps, any>;
|
|
258
|
+
/**
|
|
259
|
+
* 这是一个泛型类型定义,用于定义 FieldPropsTypeBase 类型。该类型包含了以下类型参数:
|
|
260
|
+
* Entity:表示表单项的数据实体类型,默认为 Record<string, any>。
|
|
261
|
+
* ComponentsType:表示表单项对应的组件类型,默认为 'text'。
|
|
262
|
+
* ExtraProps:表示表单项组件的额外属性类型,默认为 Record<string, any>。
|
|
263
|
+
* FieldPropsType:表示表单项组件的属性类型,默认为 Record<string, any>。
|
|
264
|
+
*
|
|
265
|
+
* 该类型定义了一种联合类型,可以是一个函数类型,也可以是一个对象类型。具体来说:
|
|
266
|
+
* 如果是一个函数类型,它接收两个参数 form 和 config,并返回一个对象类型,该对象类型可以是 FieldPropsType 或 Record<string, any>。
|
|
267
|
+
* 其中,form 是 antd 的 FormInstance 类型,config 是 ProSchema 和其它额外属性的联合类型,并包含了一些表单项相关的信息。
|
|
268
|
+
* 如果不是一个函数类型,它可以是 FieldPropsType 或 Record<string, any> 中的任意一个。
|
|
269
|
+
* 该类型的作用是定义一个通用的表单项属性类型,使得在不同的表单项组件中,可以共用这个属性类型,提高了代码的重用性。
|
|
270
|
+
*/
|
|
271
|
+
type FieldPropsTypeBase<Entity = Record<string, any>, ComponentsType = 'text', ExtraProps = Record<string, any>, FieldPropsType = ProFieldValueTypeWithFieldProps['text']> = ((form: FormInstance | undefined, config: ProSchema<Entity, ExtraProps> & {
|
|
272
|
+
type: ComponentsType;
|
|
273
|
+
isEditable?: boolean;
|
|
274
|
+
rowKey?: string;
|
|
275
|
+
rowIndex: number;
|
|
276
|
+
entity: Entity;
|
|
277
|
+
}) => FieldPropsType | Record<string, any>) | FieldPropsType | Record<string, any>;
|
|
278
|
+
/**
|
|
279
|
+
* 这段代码定义了一个泛型类型 ProFieldValueObject<Type>,它的泛型参数 Type 必须是 'progress'、'money'、'percent'、'image' 中的一个。
|
|
280
|
+
* 当 Type 为 'progress'、'money'、'percent'、'image' 中的一种时,这个类型将被定义为一个对象,包含以下属性:
|
|
281
|
+
*
|
|
282
|
+
* - type: Type 类型值,即 'progress'、'money'、'percent'、'image' 中的一种;
|
|
283
|
+
* - status: 字符串类型,表示状态,可选值为 'normal'、'active'、'success'、'exception' 或 undefined;
|
|
284
|
+
* - locale: 字符串类型,表示地区;
|
|
285
|
+
* - showSymbol: 布尔类型或函数类型,表示是否显示符号;
|
|
286
|
+
* - showColor: 布尔类型,表示是否显示颜色;
|
|
287
|
+
* - precision: 数字类型,表示精度;
|
|
288
|
+
* - moneySymbol: 布尔类型,表示是否显示货币符号;
|
|
289
|
+
* - request: ProFieldRequestData 类型,表示请求数据;
|
|
290
|
+
* - width: 数字类型,表示宽度。
|
|
291
|
+
*
|
|
292
|
+
* 如果 Type 不是 'progress'、'money'、'percent'、'image' 中的一种,那么 ProFieldValueObject<Type> 的类型为 never。
|
|
293
|
+
*/
|
|
294
|
+
type ProFieldValueObject<Type> = Type extends 'progress' | 'money' | 'percent' | 'image' ? {
|
|
295
|
+
type: Type;
|
|
296
|
+
status?: 'normal' | 'active' | 'success' | 'exception' | undefined;
|
|
297
|
+
locale?: string; /** Percent */
|
|
298
|
+
showSymbol?: ((value: any) => boolean) | boolean;
|
|
299
|
+
showColor?: boolean;
|
|
300
|
+
precision?: number;
|
|
301
|
+
moneySymbol?: boolean;
|
|
302
|
+
request?: ProFieldRequestData; /** Image */
|
|
303
|
+
width?: number;
|
|
304
|
+
} : never;
|
|
305
|
+
/**
|
|
306
|
+
* 这段代码定义了一个泛型类型 ValueTypeWithFieldPropsBase,它包含了以下属性:
|
|
307
|
+
* - Entity:泛型类型,表示数据实体对象的类型;
|
|
308
|
+
* - ComponentsType:泛型类型,表示组件的类型;
|
|
309
|
+
* - ExtraProps:泛型类型,表示额外的属性;
|
|
310
|
+
* - ValueType:泛型类型,表示字段的值类型,默认为字符串类型。
|
|
311
|
+
*
|
|
312
|
+
* 该类型的主要作用是用于定义 ProTable 组件的列属性 ProColumns 中的字段属性,包括字段的类型(valueType)和自定义属性(fieldProps)。其中:
|
|
313
|
+
* - valueType 属性可以是字符串类型,也可以是 ProFieldValueType 枚举类型,也可以是一个对象类型 ProFieldValueObject,或者是一个返回值为这些类型之一的函数。它表示字段的类型,如文本、数字、日期等;
|
|
314
|
+
* - fieldProps 属性是一个泛型类型 FieldPropsTypeBase,它表示该字段对应的组件的属性,用于定制组件的展示形式、校验规则、事件等等。根据字段类型的不同,其属性值也会有所不同。
|
|
315
|
+
*/
|
|
316
|
+
interface ValueTypeWithFieldPropsBase<Entity = Record<string, any>, ComponentsType = 'form', ExtraProps = Record<string, any>, ValueType = 'text'> {
|
|
317
|
+
valueType?: ValueType | ProFieldValueType | ProFieldValueObject<ValueType | ProFieldValueType> | ((entity: Entity, type: ComponentsType) => ValueType | ProFieldValueType | ProFieldValueObject<ValueType | ProFieldValueType>);
|
|
318
|
+
fieldProps?: FieldPropsTypeBase<Entity, ComponentsType, ExtraProps, ValueType extends ProFieldValueType ? ProFieldValueTypeWithFieldProps[ValueType] : ProFieldValueTypeWithFieldProps['text']>;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* 这段代码定义了一个泛型类型 ValueTypeWithFieldProps,它有四个类型参数。
|
|
322
|
+
* 这个类型的作用是用来描述在一个数据表格中某个字段的值(value)以及可能需要传递给这个字段的其他属性(fieldProps),以便在 UI 上正确地展示这个字段。
|
|
323
|
+
* 具体来说,这个类型有一个属性 valueType,表示字段的值的类型,可以是 'text'、'money'、'percent'、'image'、ProFieldValueType 中的一个,也可以是一个函数。
|
|
324
|
+
*
|
|
325
|
+
* 它的参数是该行数据和组件类型(例如 'table' 或 'form'),返回值为上述值中的一种。
|
|
326
|
+
*
|
|
327
|
+
* 此外,这个类型还有一个属性 fieldProps,表示需要传递给该字段的其他属性,它的类型是一个泛型 FieldPropsTypeBase。这个泛型有四个类型参数,
|
|
328
|
+
* 分别是:
|
|
329
|
+
* - Entity 表示该字段所在行的数据类型;
|
|
330
|
+
* - ComponentsType 表示该字段所在的组件类型;
|
|
331
|
+
* - ExtraProps 表示传递给该字段的其他属性的类型;
|
|
332
|
+
* - ValueType 表示该字段的值的类型,可以是 'text'、'money'、'percent'、'image'、ProFieldValueType 中的一种。
|
|
333
|
+
* 最终,fieldProps 属性的类型会根据 valueType 的不同,来选择特定的类型进行限制,以确保传递给该字段的其他属性符合它的值的类型。
|
|
334
|
+
*/
|
|
335
|
+
type ValueTypeWithFieldProps<Entity, ComponentsType, ExtraProps, ValueType = 'text'> = ValueTypeWithFieldPropsBase<Entity, ComponentsType, ExtraProps, ValueType>;
|
|
336
|
+
interface PageInfo {
|
|
337
|
+
pageSize: number;
|
|
338
|
+
total: number;
|
|
339
|
+
current: number;
|
|
340
|
+
}
|
|
341
|
+
interface RequestOptionsType {
|
|
342
|
+
/**
|
|
343
|
+
* 选项的文本内容,可以是一个 Vue 组件。
|
|
344
|
+
*/
|
|
345
|
+
label?: VueNode;
|
|
346
|
+
/**
|
|
347
|
+
* 选项的值,可以是一个字符串或数字类型。
|
|
348
|
+
*/
|
|
349
|
+
value?: string | number | boolean;
|
|
350
|
+
/** 渲染的节点类型 */
|
|
351
|
+
optionType?: 'optGroup' | 'option';
|
|
352
|
+
/**
|
|
353
|
+
* 当节点类型为 optGroup 时,可以使用该属性来定义其包含的子选项,每个子选项也可以使用 RequestOptionsType 类型来定义。
|
|
354
|
+
*/
|
|
355
|
+
options?: Omit<RequestOptionsType, 'children' | 'optionType'>[];
|
|
356
|
+
/** 其他自定义属性。 */
|
|
357
|
+
[key: string]: any;
|
|
358
|
+
}
|
|
359
|
+
type ProFieldRequestData<U = any> = (params: U, props: any) => Promise<RequestOptionsType[]>;
|
|
360
|
+
/**
|
|
361
|
+
* 支持 Map 和 Record<string,any>
|
|
362
|
+
*
|
|
363
|
+
* @name ProSchemaValueEnumMap ValueEnum 的类型
|
|
364
|
+
*/
|
|
365
|
+
type ProSchemaValueEnumMap = Map<string | number | boolean, ProSchemaValueEnumType | VueNode>;
|
|
366
|
+
type ProSchemaValueEnumObj = Record<string, ProSchemaValueEnumType | VueNode>;
|
|
367
|
+
type ProFieldValueEnumType = ProSchemaValueEnumMap | ProSchemaValueEnumObj;
|
|
368
|
+
/**
|
|
369
|
+
* ProFieldValueObjectType 对象,用于描述值为 'progress' | 'money' | 'percent' | 'image' 类型的 ProField 的属性。
|
|
370
|
+
* @property {('progress' | 'money' | 'percent' | 'image')} type - 值的类型。
|
|
371
|
+
* @property {('normal' | 'active' | 'success' | 'exception' | undefined)} [status] - 状态。
|
|
372
|
+
* @property {string} [locale] - 本地化语言。
|
|
373
|
+
* @property {((value: any) => boolean) | boolean} [showSymbol] - 是否显示符号。
|
|
374
|
+
* @property {boolean} [showColor] - 是否显示颜色。
|
|
375
|
+
* @property {number} [precision] - 精度。
|
|
376
|
+
* @property {boolean} [moneySymbol] - 是否显示货币符号。
|
|
377
|
+
* @property {ProFieldRequestData} [request] - 远程请求数据。
|
|
378
|
+
* @property {number} [width] - 图片的宽度。
|
|
379
|
+
*/
|
|
380
|
+
interface ProFieldValueObjectType {
|
|
381
|
+
/**
|
|
382
|
+
* 类型
|
|
383
|
+
* - 'progress': 进度条
|
|
384
|
+
* - 'money': 金钱格式
|
|
385
|
+
* - 'percent': 百分比
|
|
386
|
+
* - 'image': 图片
|
|
387
|
+
*/
|
|
388
|
+
type: 'progress' | 'money' | 'percent' | 'image';
|
|
389
|
+
/**
|
|
390
|
+
* 状态
|
|
391
|
+
* - 'normal': 正常
|
|
392
|
+
* - 'active': 活动中
|
|
393
|
+
* - 'success': 成功
|
|
394
|
+
* - 'exception': 异常
|
|
395
|
+
*/
|
|
396
|
+
status?: 'normal' | 'active' | 'success' | 'exception';
|
|
397
|
+
/** 本地化信息 */
|
|
398
|
+
locale?: string;
|
|
399
|
+
/**
|
|
400
|
+
* 百分比相关
|
|
401
|
+
* - showSymbol?: 是否显示百分号,默认为 true
|
|
402
|
+
* - showColor?: 是否显示颜色条,默认为 false
|
|
403
|
+
* - precision?: 保留几位小数,默认为 2
|
|
404
|
+
*/
|
|
405
|
+
showSymbol?: ((value: any) => boolean) | boolean;
|
|
406
|
+
showColor?: boolean;
|
|
407
|
+
precision?: number;
|
|
408
|
+
/**
|
|
409
|
+
* 金钱相关
|
|
410
|
+
* - moneySymbol?: 是否显示货币符号,默认为 true
|
|
411
|
+
*/
|
|
412
|
+
moneySymbol?: boolean;
|
|
413
|
+
/** 数据请求 */
|
|
414
|
+
request?: ProFieldRequestData;
|
|
415
|
+
/**
|
|
416
|
+
* width?: 图片宽度,默认为 80
|
|
417
|
+
*/
|
|
418
|
+
width?: number;
|
|
419
|
+
}
|
|
420
|
+
type ProFieldTextType = VueNode | VueNode[] | Record<string, any> | Record<string, any>[];
|
|
421
|
+
type SearchTransformKeyFn = (value: any, namePath: string[], allValues: any) => any;
|
|
422
|
+
type SearchConvertKeyFn = (value: any, field: NamePath) => string | boolean | Record<string, any>;
|
|
423
|
+
type ProTableEditableFnType<T> = (value: any, record: T, index: number) => boolean;
|
|
424
|
+
/** 支持的变形,还未完全支持完毕 */
|
|
425
|
+
type ProSchemaComponentTypes = 'form' | 'listy' | 'descriptions' | 'table' | 'cardList' | undefined;
|
|
426
|
+
/** 操作类型 */
|
|
427
|
+
type ProCoreActionType<T extends Record<string, any>, U> = {
|
|
428
|
+
/** @name reload 刷新 */reload?: (resetPageIndex?: boolean) => Promise<void>; /** @name reloadAndRest 刷新并清空,只清空页面,不包括表单 */
|
|
429
|
+
reloadAndRest?: () => Promise<void>; /** @name reset 重置任何输入项,包括表单 */
|
|
430
|
+
reset?: () => Promise<void>; /** @name clearSelected 清空选择 */
|
|
431
|
+
clearSelected?: () => Promise<void>; /** @name pageInfo 页面的信息都在里面 */
|
|
432
|
+
pageInfo?: PageInfo;
|
|
433
|
+
} & Omit<Partial<UseEditableUtilType<U>>, 'newLineRecord' | 'editableKeys' | 'actionRender' | 'setEditableRowKeys'> & T;
|
|
434
|
+
type ProSchemaFieldProps<T> = Record<string, any> | T | Partial<InputProps>;
|
|
435
|
+
/** 各个组件公共支持的 render */
|
|
436
|
+
type ProSchema<Entity = Record<string, any>, ExtraProps = unknown, ComponentsType extends ProSchemaComponentTypes = 'form', ValueType = 'text', ExtraFormItemProps = unknown> = {
|
|
437
|
+
/** @name 确定这个列的唯一值,一般用于 dataIndex 重复的情况 */key?: Key;
|
|
438
|
+
/**
|
|
439
|
+
* 支持一个数字,[a,b] 会转化为 obj.a.b
|
|
440
|
+
*
|
|
441
|
+
* @name dataIndex 与实体映射的key
|
|
442
|
+
*/
|
|
443
|
+
dataIndex?: unknown;
|
|
444
|
+
/**
|
|
445
|
+
* 支持 VueNode 和 方法
|
|
446
|
+
*
|
|
447
|
+
* @name title 标题
|
|
448
|
+
*/
|
|
449
|
+
title?: ((schema: ProSchema<Entity, ExtraProps, ComponentsType, ValueType, ExtraFormItemProps>, type: ComponentsType, dom: VueNode) => VueNode$2) | VueNode$2; /** @name tooltip 展示一个 icon,hover 是展示一些提示信息 */
|
|
450
|
+
tooltip?: FormItemTooltipType | string;
|
|
451
|
+
/**
|
|
452
|
+
* 支持 object 和Map,Map 是支持其他基础类型作为 key
|
|
453
|
+
*
|
|
454
|
+
* @name valueEnum 映射值的类型
|
|
455
|
+
*/
|
|
456
|
+
valueEnum?: ((row: Entity) => ProSchemaValueEnumObj | ProSchemaValueEnumMap) | ProSchemaValueEnumObj | ProSchemaValueEnumMap;
|
|
457
|
+
/**
|
|
458
|
+
* @name formItemProps 自定义的 formItemProps
|
|
459
|
+
*/
|
|
460
|
+
formItemProps?: (FormItemProps & {
|
|
461
|
+
style?: CSSProperties;
|
|
462
|
+
class?: string;
|
|
463
|
+
} & ExtraFormItemProps) | ((form: FormInstance, config: ProSchema<Entity, ExtraProps, ComponentsType, ValueType, ExtraFormItemProps> & {
|
|
464
|
+
type: ComponentsType;
|
|
465
|
+
isEditable?: boolean;
|
|
466
|
+
rowKey?: string;
|
|
467
|
+
rowIndex: number;
|
|
468
|
+
entity: Entity;
|
|
469
|
+
}) => FormItemProps & {
|
|
470
|
+
style?: CSSProperties;
|
|
471
|
+
class?: string;
|
|
472
|
+
} & ExtraFormItemProps);
|
|
473
|
+
/**
|
|
474
|
+
* 修改的数据是会被 valueType 消费
|
|
475
|
+
*
|
|
476
|
+
* @name renderText 自定义 render 内容
|
|
477
|
+
*/
|
|
478
|
+
renderText?: <T extends Record<string, any>>(text: VueNode, record: Entity, index: number, action?: ProCoreActionType<T, Entity>) => VueNode$2;
|
|
479
|
+
/**
|
|
480
|
+
* Render 方法只管理的只读模式,编辑模式需要使用 renderFormItem
|
|
481
|
+
*
|
|
482
|
+
* @name render 自定义只读模式的dom
|
|
483
|
+
*/
|
|
484
|
+
render?: <T extends Record<string, any>>(dom: VueNode, entity: Entity, index: number, action: ProCoreActionType<T, Entity> | undefined, schema: ProSchema<Entity, ExtraProps, ComponentsType, ValueType, ExtraFormItemProps> & {
|
|
485
|
+
isEditable?: boolean;
|
|
486
|
+
type: ComponentsType;
|
|
487
|
+
}) => VueNode;
|
|
488
|
+
/**
|
|
489
|
+
* 返回一个 VueNode,会自动包裹 value 和 onChange
|
|
490
|
+
*
|
|
491
|
+
* @name formItemRender 自定义编辑模式
|
|
492
|
+
*/
|
|
493
|
+
formItemRender?: (schema: ProSchema<Entity, ExtraProps, ComponentsType, ValueType, ExtraFormItemProps> & {
|
|
494
|
+
isEditable?: boolean;
|
|
495
|
+
index?: number;
|
|
496
|
+
type: ComponentsType;
|
|
497
|
+
originProps?: any;
|
|
498
|
+
}, config: {
|
|
499
|
+
onSelect?: (value: any) => void;
|
|
500
|
+
onChange?: <T = any>(value: T) => void;
|
|
501
|
+
value?: any;
|
|
502
|
+
type: ComponentsType;
|
|
503
|
+
recordKey?: Key | Key[];
|
|
504
|
+
record?: Entity;
|
|
505
|
+
isEditable?: boolean;
|
|
506
|
+
defaultRender: (newItem: ProSchema<Entity, ExtraProps, ComponentsType, ValueType>) => VNode | null;
|
|
507
|
+
}, form: FormInstance | undefined, action?: Omit<UseEditableUtilType<Entity>, 'newLineRecord' | 'editableKeys' | 'actionRender' | 'setEditableRowKeys'>) => VueNode;
|
|
508
|
+
/**
|
|
509
|
+
* @name editable 可编辑表格是否可编辑
|
|
510
|
+
*
|
|
511
|
+
* @example 不允许编辑
|
|
512
|
+
* editable=false
|
|
513
|
+
*
|
|
514
|
+
* @example 如果id=1不允许编辑
|
|
515
|
+
* editable={(value,row,Slider.tsx)=> row.id !==1 }
|
|
516
|
+
*/
|
|
517
|
+
editable?: false | ProTableEditableFnType<Entity>; /** @name request 从服务器请求枚举 */
|
|
518
|
+
request?: ProFieldRequestData; /** @name debounceTime request防抖动时间 默认10 单位ms */
|
|
519
|
+
debounceTime?: number; /** @name params 从服务器请求的参数,改变了会触发 reload */
|
|
520
|
+
params?: ((record: Entity, column: ProSchema<Entity, ExtraProps>) => Record<string, any>) | Record<string, any>; /** @name dependencies 依赖字段的name,暂时只在拥有 request 的项目中生效,会自动注入到 params 中 */
|
|
521
|
+
dependencies?: NamePath<string | number | boolean>[];
|
|
522
|
+
/**
|
|
523
|
+
* @name ignoreFormItem 忽略 FormItem,必须要和 renderFormItem 组件一起使用
|
|
524
|
+
*/
|
|
525
|
+
ignoreFormItem?: boolean; /** @name hideInDescriptions 在 descriptions 隐藏 */
|
|
526
|
+
hideInDescriptions?: boolean; /** @name hideInForm 在 Form 中隐藏 */
|
|
527
|
+
hideInForm?: boolean; /** @name hideInTable 在 table 中隐藏 */
|
|
528
|
+
hideInTable?: boolean; /** @name proFieldProps 设置到 ProField 上面的 Props,内部属性 */
|
|
529
|
+
proFieldProps?: CommomProFieldProps & Record<string, any>;
|
|
530
|
+
} & ExtraProps & ValueTypeWithFieldProps<Entity, ComponentsType, ExtraProps, ValueType>;
|
|
531
|
+
interface CommomProFieldProps {
|
|
532
|
+
/**
|
|
533
|
+
* 是否启用轻量模式
|
|
534
|
+
*/
|
|
535
|
+
light?: boolean;
|
|
536
|
+
/**
|
|
537
|
+
* 空文本占位符
|
|
538
|
+
*/
|
|
539
|
+
emptyText?: VueNode;
|
|
540
|
+
/**
|
|
541
|
+
* 标签名称
|
|
542
|
+
*/
|
|
543
|
+
label?: VueNode;
|
|
544
|
+
/**
|
|
545
|
+
* 渲染模式
|
|
546
|
+
*/
|
|
547
|
+
mode?: 'read' | 'edit';
|
|
548
|
+
/**
|
|
549
|
+
* 设置 useSwr 的 key
|
|
550
|
+
*/
|
|
551
|
+
proFieldKey?: string;
|
|
552
|
+
/**
|
|
553
|
+
* 自定义渲染函数
|
|
554
|
+
*/
|
|
555
|
+
render?: any;
|
|
556
|
+
/**
|
|
557
|
+
* 是否只读
|
|
558
|
+
*/
|
|
559
|
+
readonly?: boolean;
|
|
560
|
+
}
|
|
561
|
+
//#endregion
|
|
562
|
+
export { CommomProFieldProps, type Key, PageInfo, ProCoreActionType, ProFieldRequestData, ProFieldTextType, ProFieldValueEnumType, ProFieldValueObject, ProFieldValueObjectType, ProFieldValueType, ProFieldValueTypeWithFieldProps, ProFormBaseGroupProps, ProSchema, ProSchemaComponentTypes, ProSchemaFieldProps, ProSchemaValueEnumMap, ProSchemaValueEnumObj, ProTableEditableFnType, RequestOptionsType, SearchConvertKeyFn, SearchTransformKeyFn, Value, ValuePair, ValueTypeWithFieldProps, type VueNode, WithFalse };
|
package/dist/typing.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ActionRenderConfig, RecordKey } from "../typing.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
import { Key } from "@v-c/util/dist/type";
|
|
4
|
+
|
|
5
|
+
//#region src/useEditableArray/components/CancelEditableAction.d.ts
|
|
6
|
+
interface CancelEditableActionProps<T> {
|
|
7
|
+
editableKeys?: ActionRenderConfig<T>['editableKeys'];
|
|
8
|
+
editorType?: ActionRenderConfig<T>['editorType'];
|
|
9
|
+
recordKey?: ActionRenderConfig<T>['recordKey'];
|
|
10
|
+
formRecordKey?: ActionRenderConfig<T>['formRecordKey'];
|
|
11
|
+
preEditRow?: ActionRenderConfig<T>['preEditRow'];
|
|
12
|
+
preEditRows?: ActionRenderConfig<T>['preEditRows'];
|
|
13
|
+
'onUpdate:preEditRow'?: ActionRenderConfig<T>['onUpdate:preEditRow'];
|
|
14
|
+
index?: ActionRenderConfig<T>['index'];
|
|
15
|
+
cancelEditable?: ActionRenderConfig<T>['cancelEditable'];
|
|
16
|
+
finishEditable?: ActionRenderConfig<T>['finishEditable'];
|
|
17
|
+
onSave?: ActionRenderConfig<T>['onSave'];
|
|
18
|
+
onCancel?: ActionRenderConfig<T>['onCancel'];
|
|
19
|
+
onDelete?: ActionRenderConfig<T>['onDelete'];
|
|
20
|
+
deletePopconfirmMessage: ActionRenderConfig<T>['deletePopconfirmMessage'];
|
|
21
|
+
setEditableRowKeys?: ActionRenderConfig<T>['setEditableRowKeys'];
|
|
22
|
+
newLineConfig?: ActionRenderConfig<T>['newLineConfig'];
|
|
23
|
+
tableName?: ActionRenderConfig<T>['tableName'];
|
|
24
|
+
row?: T;
|
|
25
|
+
}
|
|
26
|
+
declare function recordKeyToString(rowKey?: RecordKey): Key | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Normalize antd Form `NamePath` segments.
|
|
29
|
+
*
|
|
30
|
+
* - Preserve `0` (number) and other falsy-but-valid segments
|
|
31
|
+
* - Flatten nested arrays (e.g. `name={['a','b']}`)
|
|
32
|
+
* - Convert number segments to string to align with `spellNamePath` behavior
|
|
33
|
+
*/
|
|
34
|
+
declare function normalizeNamePath(...segments: any[]): (string | number)[];
|
|
35
|
+
/**
|
|
36
|
+
* 保存按钮的dom
|
|
37
|
+
*/
|
|
38
|
+
declare const CancelEditableAction: new <T extends Record<string, any>>(props: CancelEditableActionProps<T> & {} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps) => _$vue.CreateComponentPublicInstanceWithMixins<CancelEditableActionProps<T> & {}, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, _$vue.PublicProps, {}, false, {}, {}, {}, {}, string, {}, any, _$vue.ComponentProvideOptions, {
|
|
39
|
+
P: {};
|
|
40
|
+
B: {};
|
|
41
|
+
D: {};
|
|
42
|
+
C: {};
|
|
43
|
+
M: {};
|
|
44
|
+
Defaults: {};
|
|
45
|
+
}, CancelEditableActionProps<T> & {}, {}, {}, {}, {}, {}>;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { CancelEditableActionProps, CancelEditableAction as default, normalizeNamePath, recordKeyToString };
|