@antdv-next1/pro-field 1.0.0
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/LICENSE +21 -0
- package/dist/FieldHOC/index.d.ts +16 -0
- package/dist/FieldHOC/index.js +51 -0
- package/dist/ProField.d.ts +18 -0
- package/dist/ProField.js +417 -0
- package/dist/ProPureField.d.ts +10 -0
- package/dist/ProPureField.js +222 -0
- package/dist/ValueTypeToComponent.d.ts +6 -0
- package/dist/ValueTypeToComponent.js +442 -0
- package/dist/components/Cascader/index.d.ts +40 -0
- package/dist/components/Cascader/index.js +202 -0
- package/dist/components/Checkbox/index.d.ts +37 -0
- package/dist/components/Checkbox/index.js +149 -0
- package/dist/components/Checkbox/style/index.d.ts +11 -0
- package/dist/components/Checkbox/style/index.js +26 -0
- package/dist/components/Code/index.d.ts +34 -0
- package/dist/components/Code/index.js +125 -0
- package/dist/components/ColorPicker/index.d.ts +22 -0
- package/dist/components/ColorPicker/index.js +278 -0
- package/dist/components/DatePicker/index.d.ts +27 -0
- package/dist/components/DatePicker/index.js +171 -0
- package/dist/components/Digit/index.d.ts +27 -0
- package/dist/components/Digit/index.js +159 -0
- package/dist/components/DigitRange/index.d.ts +48 -0
- package/dist/components/DigitRange/index.js +197 -0
- package/dist/components/FromNow/index.d.ts +23 -0
- package/dist/components/FromNow/index.js +123 -0
- package/dist/components/Image/index.d.ts +23 -0
- package/dist/components/Image/index.js +119 -0
- package/dist/components/IndexColumn/index.d.ts +13 -0
- package/dist/components/IndexColumn/index.js +30 -0
- package/dist/components/IndexColumn/style/index.d.ts +11 -0
- package/dist/components/IndexColumn/style/index.js +29 -0
- package/dist/components/Money/InputNumberPopover.d.ts +120 -0
- package/dist/components/Money/InputNumberPopover.js +345 -0
- package/dist/components/Money/index.d.ts +303 -0
- package/dist/components/Money/index.js +274 -0
- package/dist/components/Options/index.d.ts +18 -0
- package/dist/components/Options/index.js +120 -0
- package/dist/components/Password/index.d.ts +33 -0
- package/dist/components/Password/index.js +137 -0
- package/dist/components/Percent/index.d.ts +45 -0
- package/dist/components/Percent/index.js +171 -0
- package/dist/components/Percent/util.d.ts +10 -0
- package/dist/components/Percent/util.js +22 -0
- package/dist/components/Progress/index.d.ts +22 -0
- package/dist/components/Progress/index.js +124 -0
- package/dist/components/Radio/index.d.ts +36 -0
- package/dist/components/Radio/index.js +138 -0
- package/dist/components/Radio/style/index.d.ts +11 -0
- package/dist/components/Radio/style/index.js +21 -0
- package/dist/components/RangePicker/DatePicker.d.ts +29 -0
- package/dist/components/RangePicker/DatePicker.js +189 -0
- package/dist/components/RangePicker/TimePicker.d.ts +25 -0
- package/dist/components/RangePicker/TimePicker.js +177 -0
- package/dist/components/RangePicker/index.d.ts +3 -0
- package/dist/components/RangePicker/index.js +3 -0
- package/dist/components/Rate/index.d.ts +19 -0
- package/dist/components/Rate/index.js +98 -0
- package/dist/components/Second/index.d.ts +28 -0
- package/dist/components/Second/index.js +151 -0
- package/dist/components/Segmented/index.d.ts +36 -0
- package/dist/components/Segmented/index.js +138 -0
- package/dist/components/Select/Highlight/index.d.ts +14 -0
- package/dist/components/Select/Highlight/index.js +46 -0
- package/dist/components/Select/Highlight/style/index.d.ts +12 -0
- package/dist/components/Select/Highlight/style/index.js +24 -0
- package/dist/components/Select/LightSelect/index.d.ts +45 -0
- package/dist/components/Select/LightSelect/index.js +621 -0
- package/dist/components/Select/LightSelect/style/index.d.ts +11 -0
- package/dist/components/Select/LightSelect/style/index.js +28 -0
- package/dist/components/Select/SearchSelect/index.d.ts +78 -0
- package/dist/components/Select/SearchSelect/index.js +273 -0
- package/dist/components/Select/index.d.ts +67 -0
- package/dist/components/Select/index.js +357 -0
- package/dist/components/Slider/index.d.ts +18 -0
- package/dist/components/Slider/index.js +99 -0
- package/dist/components/Status/index.d.ts +31 -0
- package/dist/components/Status/index.js +71 -0
- package/dist/components/Switch/index.d.ts +31 -0
- package/dist/components/Switch/index.js +132 -0
- package/dist/components/Text/index.d.ts +37 -0
- package/dist/components/Text/index.js +146 -0
- package/dist/components/TextArea/index.d.ts +25 -0
- package/dist/components/TextArea/index.js +117 -0
- package/dist/components/TextArea/readonly/index.d.ts +17 -0
- package/dist/components/TextArea/readonly/index.js +20 -0
- package/dist/components/TextArea/readonly/style/index.d.ts +11 -0
- package/dist/components/TextArea/readonly/style/index.js +20 -0
- package/dist/components/TimePicker/index.d.ts +23 -0
- package/dist/components/TimePicker/index.js +153 -0
- package/dist/components/TreeSelect/index.d.ts +45 -0
- package/dist/components/TreeSelect/index.js +762 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +33 -0
- package/dist/pro-field.esm.js +72945 -0
- package/dist/pro-field.js +214 -0
- package/dist/typing.d.ts +28 -0
- package/dist/typing.js +1 -0
- package/dist/utils/useFieldExpose.d.ts +7 -0
- package/dist/utils/useFieldExpose.js +9 -0
- package/package.json +63 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
|
+
import { RequestOptionsType, VueNode } from "@antdv-next1/pro-utils";
|
|
3
|
+
import { SelectProps } from "antdv-next";
|
|
4
|
+
import { LabeledValue } from "antdv-next/dist/select/index";
|
|
5
|
+
|
|
6
|
+
//#region src/components/Select/SearchSelect/index.d.ts
|
|
7
|
+
type KeyLabel = Partial<LabeledValue> & RequestOptionsType;
|
|
8
|
+
/** 用户扩展数据后的值类型 */
|
|
9
|
+
type DataValueType<T> = KeyLabel & T;
|
|
10
|
+
/** 可能单选,可能多选 */
|
|
11
|
+
type DataValuesType<T> = DataValueType<T> | DataValueType<T>[];
|
|
12
|
+
interface SearchSelectProps<T = Record<string, any>> extends Omit<SelectProps, 'options' | 'searchValue'> {
|
|
13
|
+
/** 防抖动时间 默认10 单位ms */
|
|
14
|
+
debounceTime?: number;
|
|
15
|
+
/** 自定义搜索方法, 返回搜索结果的 Promise */
|
|
16
|
+
request?: (params: {
|
|
17
|
+
query: string;
|
|
18
|
+
}) => Promise<DataValueType<T>[]>;
|
|
19
|
+
/** 自定义选项渲染 */
|
|
20
|
+
optionItemRender?: (item: DataValueType<T>) => VueNode;
|
|
21
|
+
/** 指定组件中的值 */
|
|
22
|
+
value?: KeyLabel | KeyLabel[];
|
|
23
|
+
/** 指定默认选中的条目 */
|
|
24
|
+
defaultValue?: KeyLabel | KeyLabel[];
|
|
25
|
+
options?: RequestOptionsType[];
|
|
26
|
+
/**
|
|
27
|
+
* Placeholder 输入提示
|
|
28
|
+
*
|
|
29
|
+
* @default 请输入关键字搜索
|
|
30
|
+
*/
|
|
31
|
+
placeholder?: VueNode;
|
|
32
|
+
/**
|
|
33
|
+
* 是否在输入框聚焦时触发搜索
|
|
34
|
+
*
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
searchOnFocus?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 选择完一个之后是否清空搜索项重新搜索
|
|
40
|
+
*
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
resetAfterSelect?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 自定义前缀
|
|
46
|
+
*
|
|
47
|
+
* @ignore
|
|
48
|
+
*/
|
|
49
|
+
prefixCls?: string;
|
|
50
|
+
/** 刷新数据 */
|
|
51
|
+
fetchData: (keyWord?: string) => void;
|
|
52
|
+
/** 清空数据 */
|
|
53
|
+
resetData: () => void;
|
|
54
|
+
/**
|
|
55
|
+
* 当搜索关键词发生变化时是否请求远程数据
|
|
56
|
+
*
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
59
|
+
fetchDataOnSearch?: boolean;
|
|
60
|
+
/** 默认搜索关键词 */
|
|
61
|
+
defaultSearchValue?: string;
|
|
62
|
+
/**
|
|
63
|
+
* 在选择时保留选项的原始标签文本
|
|
64
|
+
* 当设置为 true 时,选中后回填的内容将使用选项的原始 label,而不是经过 optionItemRender 处理后的内容
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
preserveOriginalLabel?: boolean;
|
|
68
|
+
}
|
|
69
|
+
declare const SearchSelect: new <T extends Record<string, any>>(props: SearchSelectProps<T> & {} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps) => _$vue.CreateComponentPublicInstanceWithMixins<SearchSelectProps<T> & {}, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, _$vue.PublicProps, {}, false, {}, {}, {}, {}, string, {}, any, _$vue.ComponentProvideOptions, {
|
|
70
|
+
P: {};
|
|
71
|
+
B: {};
|
|
72
|
+
D: {};
|
|
73
|
+
C: {};
|
|
74
|
+
M: {};
|
|
75
|
+
Defaults: {};
|
|
76
|
+
}, SearchSelectProps<T> & {}, {}, {}, {}, {}, {}>;
|
|
77
|
+
//#endregion
|
|
78
|
+
export { DataValueType, DataValuesType, KeyLabel, SearchSelectProps, SearchSelect as default };
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { computed, createVNode, defineComponent, isVNode, mergeProps, ref } from "vue";
|
|
2
|
+
import { nanoid, useEffect, useState } from "@antdv-next1/pro-utils";
|
|
3
|
+
import { Select } from "antdv-next";
|
|
4
|
+
import { classNames } from "@v-c/util";
|
|
5
|
+
import { useConfig as useConfig$1 } from "antdv-next/dist/config-provider/context";
|
|
6
|
+
//#region src/components/Select/SearchSelect/index.tsx
|
|
7
|
+
/** 用户扩展数据后的值类型 */
|
|
8
|
+
/** 可能单选,可能多选 */
|
|
9
|
+
const SearchSelect = /* @__PURE__ */ defineComponent((props, { attrs, expose }) => {
|
|
10
|
+
const config = useConfig$1();
|
|
11
|
+
const prefixCls = computed(() => props.prefixCls || config.value.getPrefixCls("pro"));
|
|
12
|
+
const baseClassName = computed(() => `${prefixCls.value}-filed-search-select`);
|
|
13
|
+
const [searchValue, setSearchValue] = useState((typeof props.showSearch !== "boolean" ? props.showSearch?.searchValue : void 0) ?? props.defaultSearchValue);
|
|
14
|
+
const selectRef = ref(null);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (props.autoFocus) selectRef.value?.focus();
|
|
17
|
+
}, [() => props.autoFocus]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (typeof props.showSearch !== "boolean") setSearchValue(props.showSearch?.searchValue);
|
|
20
|
+
}, [() => props.showSearch]);
|
|
21
|
+
const getOriginalLabel = (item, fallbackValue) => {
|
|
22
|
+
if (item && typeof item.label === "string" && item.label) return item.label;
|
|
23
|
+
if (item && item.text && typeof item.text === "string") return item.text;
|
|
24
|
+
if (item && item.label) return String(item.label);
|
|
25
|
+
if (item && item.text) return String(item.text);
|
|
26
|
+
if (fallbackValue && fallbackValue.label) {
|
|
27
|
+
const labelValue = fallbackValue.label;
|
|
28
|
+
if ((isVNode(labelValue) || labelValue && typeof labelValue === "object" && "props" in labelValue) && labelValue.props && labelValue.props.label) return String(labelValue.props.label);
|
|
29
|
+
if (typeof labelValue === "string") return labelValue;
|
|
30
|
+
return String(labelValue);
|
|
31
|
+
}
|
|
32
|
+
return "";
|
|
33
|
+
};
|
|
34
|
+
const getMergeValue = (value, option) => {
|
|
35
|
+
if (Array.isArray(value) && Array.isArray(option) && value.length > 0) return value.map((item, index) => {
|
|
36
|
+
const dataItem = (option?.[index])?.["data-item"] || {};
|
|
37
|
+
const originalLabel = getOriginalLabel(dataItem, item);
|
|
38
|
+
return {
|
|
39
|
+
...dataItem,
|
|
40
|
+
...item,
|
|
41
|
+
label: originalLabel || item.label
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
return [];
|
|
45
|
+
};
|
|
46
|
+
const genOptions = (mapOptions) => mapOptions.map((item, index) => {
|
|
47
|
+
const { class: itemClassName, optionType, ...resetItem } = item;
|
|
48
|
+
const label = item[props.fieldNames?.label || "label"] ?? item.text;
|
|
49
|
+
const value = item[props.fieldNames?.value || "value"];
|
|
50
|
+
const itemOptions = item[props.fieldNames?.options || "options"] ?? [];
|
|
51
|
+
if (optionType === "optGroup" || item.options) return {
|
|
52
|
+
label,
|
|
53
|
+
...resetItem,
|
|
54
|
+
data_title: label,
|
|
55
|
+
title: label,
|
|
56
|
+
key: value ?? `${label?.toString()}-${index}-${nanoid()}`,
|
|
57
|
+
children: genOptions(itemOptions)
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
title: label,
|
|
61
|
+
...resetItem,
|
|
62
|
+
data_title: label,
|
|
63
|
+
value: value ?? index,
|
|
64
|
+
key: value ?? `${label?.toString()}-${index}-${nanoid()}`,
|
|
65
|
+
"data-item": item,
|
|
66
|
+
class: `${baseClassName.value}-option ${itemClassName || ""}`.trim(),
|
|
67
|
+
label: props.optionItemRender?.(item) || label
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
expose({
|
|
71
|
+
focus: () => selectRef.value?.focus(),
|
|
72
|
+
blur: () => selectRef.value?.blur(),
|
|
73
|
+
scrollTo: (arg) => selectRef.value?.scrollTo(arg)
|
|
74
|
+
});
|
|
75
|
+
return () => {
|
|
76
|
+
const { request, autoFocus, debounceTime, optionItemRender, mode, onFocus, onChange, searchOnFocus = false, resetAfterSelect = false, fetchDataOnSearch = true, optionLabelProp = "label", disabled, options, fetchData, resetData, prefixCls: customizePrefixCls, onClear, showSearch, fieldNames, defaultSearchValue, preserveOriginalLabel: _preserveOriginalLabel = false, ...restProps } = props;
|
|
77
|
+
return createVNode(Select, mergeProps({ "ref": selectRef }, attrs, restProps, {
|
|
78
|
+
"class": classNames(baseClassName.value, attrs.class, { [`${baseClassName.value}-disabled`]: disabled }),
|
|
79
|
+
"disabled": disabled,
|
|
80
|
+
"mode": mode,
|
|
81
|
+
"showSearch": showSearch && typeof showSearch !== "boolean" ? {
|
|
82
|
+
...showSearch,
|
|
83
|
+
searchValue: searchValue.value,
|
|
84
|
+
onSearch: (value) => {
|
|
85
|
+
if (fetchDataOnSearch) fetchData?.(value);
|
|
86
|
+
showSearch?.onSearch?.(value);
|
|
87
|
+
setSearchValue(value);
|
|
88
|
+
},
|
|
89
|
+
filterOption: showSearch?.filterOption === false ? false : (inputValue, option) => {
|
|
90
|
+
const effectiveSearchValue = searchValue.value === "" ? "" : inputValue || searchValue.value;
|
|
91
|
+
if (!effectiveSearchValue) return true;
|
|
92
|
+
if (showSearch?.filterOption && typeof showSearch.filterOption === "function") return showSearch.filterOption(effectiveSearchValue, {
|
|
93
|
+
...option,
|
|
94
|
+
label: option?.data_title
|
|
95
|
+
});
|
|
96
|
+
return !!(option?.data_title?.toString().toLowerCase().includes(effectiveSearchValue.toLowerCase()) || option[typeof showSearch !== "boolean" && showSearch.optionFilterProp || "label"]?.toString().toLowerCase().includes(effectiveSearchValue.toLowerCase()));
|
|
97
|
+
}
|
|
98
|
+
} : showSearch,
|
|
99
|
+
"optionLabelProp": optionLabelProp,
|
|
100
|
+
"onClear": () => {
|
|
101
|
+
onClear?.();
|
|
102
|
+
fetchData?.(void 0);
|
|
103
|
+
if (showSearch) {
|
|
104
|
+
if (typeof showSearch !== "boolean") showSearch.onSearch?.("");
|
|
105
|
+
setSearchValue(void 0);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"onChange": (value, optionList, ...rest) => {
|
|
109
|
+
if (showSearch && typeof showSearch !== "boolean" && showSearch?.autoClearSearchValue) {
|
|
110
|
+
fetchData?.(void 0);
|
|
111
|
+
showSearch.onSearch?.("");
|
|
112
|
+
setSearchValue(void 0);
|
|
113
|
+
}
|
|
114
|
+
if (!props.labelInValue) {
|
|
115
|
+
onChange?.(value, optionList, ...rest);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (mode !== "multiple" && !Array.isArray(optionList)) {
|
|
119
|
+
let foundDataItem = optionList && optionList["data-item"];
|
|
120
|
+
if (!foundDataItem && value && options) {
|
|
121
|
+
const optionValue = value[props.fieldNames?.value || "value"] ?? value.value;
|
|
122
|
+
const findDataItem = (opts) => {
|
|
123
|
+
for (const opt of opts) {
|
|
124
|
+
if ((opt[props.fieldNames?.value || "value"] ?? opt.value) === optionValue) return opt;
|
|
125
|
+
if (opt[props.fieldNames?.options || "options"] || opt.options) {
|
|
126
|
+
const found = findDataItem(opt[props.fieldNames?.options || "options"] || opt.options || []);
|
|
127
|
+
if (found) return found;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
};
|
|
132
|
+
foundDataItem = findDataItem(options);
|
|
133
|
+
}
|
|
134
|
+
if (!value || !foundDataItem) {
|
|
135
|
+
const originalLabel = getOriginalLabel(foundDataItem, value);
|
|
136
|
+
const changedValue = value ? {
|
|
137
|
+
...value,
|
|
138
|
+
label: originalLabel
|
|
139
|
+
} : value;
|
|
140
|
+
onChange?.(changedValue, optionList, ...rest);
|
|
141
|
+
} else {
|
|
142
|
+
const originalLabel = getOriginalLabel(foundDataItem, value);
|
|
143
|
+
onChange?.({
|
|
144
|
+
...value,
|
|
145
|
+
...foundDataItem,
|
|
146
|
+
label: originalLabel
|
|
147
|
+
}, optionList, ...rest);
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const mergeValue = getMergeValue(value, optionList);
|
|
152
|
+
onChange?.(mergeValue, optionList, ...rest);
|
|
153
|
+
if (resetAfterSelect) resetData?.();
|
|
154
|
+
},
|
|
155
|
+
"onFocus": (e) => {
|
|
156
|
+
if (searchOnFocus) {
|
|
157
|
+
fetchData?.(void 0);
|
|
158
|
+
if (showSearch) {
|
|
159
|
+
if (typeof showSearch !== "boolean") showSearch.onSearch?.("");
|
|
160
|
+
setSearchValue("");
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
onFocus?.(e);
|
|
164
|
+
},
|
|
165
|
+
"options": genOptions(options || [])
|
|
166
|
+
}), null);
|
|
167
|
+
};
|
|
168
|
+
}, {
|
|
169
|
+
name: "SearchSelect",
|
|
170
|
+
inheritAttrs: false,
|
|
171
|
+
props: [
|
|
172
|
+
"allowClear",
|
|
173
|
+
"animation",
|
|
174
|
+
"autoClearSearchValue",
|
|
175
|
+
"autoFocus",
|
|
176
|
+
"bordered",
|
|
177
|
+
"builtinPlacements",
|
|
178
|
+
"choiceTransitionName",
|
|
179
|
+
"classes",
|
|
180
|
+
"clearIcon",
|
|
181
|
+
"components",
|
|
182
|
+
"debounceTime",
|
|
183
|
+
"defaultActiveFirstOption",
|
|
184
|
+
"defaultOpen",
|
|
185
|
+
"defaultSearchValue",
|
|
186
|
+
"direction",
|
|
187
|
+
"disabled",
|
|
188
|
+
"dropdownClassName",
|
|
189
|
+
"dropdownMatchSelectWidth",
|
|
190
|
+
"dropdownRender",
|
|
191
|
+
"dropdownStyle",
|
|
192
|
+
"fetchData",
|
|
193
|
+
"fetchDataOnSearch",
|
|
194
|
+
"fieldNames",
|
|
195
|
+
"filterOption",
|
|
196
|
+
"filterSort",
|
|
197
|
+
"getPopupContainer",
|
|
198
|
+
"id",
|
|
199
|
+
"labelInValue",
|
|
200
|
+
"labelRender",
|
|
201
|
+
"listHeight",
|
|
202
|
+
"listItemHeight",
|
|
203
|
+
"loading",
|
|
204
|
+
"maxCount",
|
|
205
|
+
"maxLength",
|
|
206
|
+
"maxTagCount",
|
|
207
|
+
"maxTagPlaceholder",
|
|
208
|
+
"maxTagTextLength",
|
|
209
|
+
"menuItemSelectedIcon",
|
|
210
|
+
"mode",
|
|
211
|
+
"notFoundContent",
|
|
212
|
+
"onActive",
|
|
213
|
+
"onBlur",
|
|
214
|
+
"onChange",
|
|
215
|
+
"onClear",
|
|
216
|
+
"onClick",
|
|
217
|
+
"onDeselect",
|
|
218
|
+
"onDropdownVisibleChange",
|
|
219
|
+
"onFocus",
|
|
220
|
+
"onInputKeydown",
|
|
221
|
+
"onKeydown",
|
|
222
|
+
"onKeyup",
|
|
223
|
+
"onMousedown",
|
|
224
|
+
"onMouseenter",
|
|
225
|
+
"onMouseleave",
|
|
226
|
+
"onOpenChange",
|
|
227
|
+
"onPopupScroll",
|
|
228
|
+
"onSearch",
|
|
229
|
+
"onSelect",
|
|
230
|
+
"onUpdate:value",
|
|
231
|
+
"open",
|
|
232
|
+
"optionFilterProp",
|
|
233
|
+
"optionItemRender",
|
|
234
|
+
"optionLabelProp",
|
|
235
|
+
"optionRender",
|
|
236
|
+
"options",
|
|
237
|
+
"placeholder",
|
|
238
|
+
"placement",
|
|
239
|
+
"popupAlign",
|
|
240
|
+
"popupClassName",
|
|
241
|
+
"popupMatchSelectWidth",
|
|
242
|
+
"popupRender",
|
|
243
|
+
"popupStyle",
|
|
244
|
+
"prefix",
|
|
245
|
+
"prefixCls",
|
|
246
|
+
"preserveOriginalLabel",
|
|
247
|
+
"removeIcon",
|
|
248
|
+
"request",
|
|
249
|
+
"resetAfterSelect",
|
|
250
|
+
"resetData",
|
|
251
|
+
"rootClass",
|
|
252
|
+
"searchOnFocus",
|
|
253
|
+
"showAction",
|
|
254
|
+
"showArrow",
|
|
255
|
+
"showScrollBar",
|
|
256
|
+
"showSearch",
|
|
257
|
+
"size",
|
|
258
|
+
"status",
|
|
259
|
+
"styles",
|
|
260
|
+
"suffix",
|
|
261
|
+
"suffixIcon",
|
|
262
|
+
"tabIndex",
|
|
263
|
+
"tagRender",
|
|
264
|
+
"title",
|
|
265
|
+
"tokenSeparators",
|
|
266
|
+
"transitionName",
|
|
267
|
+
"value",
|
|
268
|
+
"variant",
|
|
269
|
+
"virtual"
|
|
270
|
+
]
|
|
271
|
+
});
|
|
272
|
+
//#endregion
|
|
273
|
+
export { SearchSelect as default };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ProFieldLightProps } from "../../typing.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
import { CSSProperties, Ref } from "vue";
|
|
4
|
+
import * as _$_antdv_next1_pro_provider0 from "@antdv-next1/pro-provider";
|
|
5
|
+
import { Key, ProFieldRequestData, ProFieldValueEnumType, RequestOptionsType, VueNode } from "@antdv-next1/pro-utils";
|
|
6
|
+
import { SelectProps } from "antdv-next";
|
|
7
|
+
import { CustomSlotsType } from "@v-c/util/dist/type";
|
|
8
|
+
|
|
9
|
+
//#region src/components/Select/index.d.ts
|
|
10
|
+
type SelectOptionType = Partial<RequestOptionsType>[];
|
|
11
|
+
type FieldSelectProps = {
|
|
12
|
+
text?: VueNode; /** 值的枚举,如果存在枚举,Search 中会生成 select */
|
|
13
|
+
valueEnum?: ProFieldValueEnumType; /** 防抖动时间 默认10 单位ms */
|
|
14
|
+
debounceTime?: number; /** 从服务器读取选项 */
|
|
15
|
+
request?: ProFieldRequestData; /** 重新触发的时机 */
|
|
16
|
+
params?: any; /** 组件的全局设置 */
|
|
17
|
+
fieldProps?: SelectProps & {
|
|
18
|
+
style?: CSSProperties;
|
|
19
|
+
};
|
|
20
|
+
variant?: 'outlined' | 'filled' | 'borderless';
|
|
21
|
+
id?: string; /** 默认搜素条件 */
|
|
22
|
+
defaultKeyWords?: string;
|
|
23
|
+
} & ProFieldLightProps;
|
|
24
|
+
/**
|
|
25
|
+
* 把 value 的枚举转化为数组
|
|
26
|
+
*
|
|
27
|
+
* @param valueEnumParams
|
|
28
|
+
*/
|
|
29
|
+
declare function proFieldParsingValueEnumToArray(valueEnumParams: ProFieldValueEnumType): SelectOptionType;
|
|
30
|
+
declare function useFieldFetchData(props: Omit<FieldSelectProps, 'fieldProps'> & {
|
|
31
|
+
proFieldKey?: Key;
|
|
32
|
+
defaultKeyWords?: string;
|
|
33
|
+
fieldProps?: any;
|
|
34
|
+
}): [Ref<boolean>, Ref<SelectOptionType | undefined>, (keyWord?: string) => void, () => void];
|
|
35
|
+
declare const FieldSelect: _$vue.DefineSetupFnComponent<{
|
|
36
|
+
text?: VueNode; /** 值的枚举,如果存在枚举,Search 中会生成 select */
|
|
37
|
+
valueEnum?: ProFieldValueEnumType; /** 防抖动时间 默认10 单位ms */
|
|
38
|
+
debounceTime?: number; /** 从服务器读取选项 */
|
|
39
|
+
request?: ProFieldRequestData; /** 重新触发的时机 */
|
|
40
|
+
params?: any; /** 组件的全局设置 */
|
|
41
|
+
fieldProps?: SelectProps & {
|
|
42
|
+
style?: CSSProperties;
|
|
43
|
+
};
|
|
44
|
+
variant?: "outlined" | "filled" | "borderless";
|
|
45
|
+
id?: string; /** 默认搜素条件 */
|
|
46
|
+
defaultKeyWords?: string;
|
|
47
|
+
} & ProFieldLightProps & _$_antdv_next1_pro_provider0.BaseProFieldFC<SelectProps> & _$_antdv_next1_pro_provider0.ProRenderFieldPropsType<SelectProps> & Pick<SelectProps, "fieldNames"> & {
|
|
48
|
+
id?: string;
|
|
49
|
+
}, {}, CustomSlotsType<{
|
|
50
|
+
default?: () => VueNode;
|
|
51
|
+
}>, {
|
|
52
|
+
text?: VueNode; /** 值的枚举,如果存在枚举,Search 中会生成 select */
|
|
53
|
+
valueEnum?: ProFieldValueEnumType; /** 防抖动时间 默认10 单位ms */
|
|
54
|
+
debounceTime?: number; /** 从服务器读取选项 */
|
|
55
|
+
request?: ProFieldRequestData; /** 重新触发的时机 */
|
|
56
|
+
params?: any; /** 组件的全局设置 */
|
|
57
|
+
fieldProps?: SelectProps & {
|
|
58
|
+
style?: CSSProperties;
|
|
59
|
+
};
|
|
60
|
+
variant?: "outlined" | "filled" | "borderless";
|
|
61
|
+
id?: string; /** 默认搜素条件 */
|
|
62
|
+
defaultKeyWords?: string;
|
|
63
|
+
} & ProFieldLightProps & _$_antdv_next1_pro_provider0.BaseProFieldFC<SelectProps> & _$_antdv_next1_pro_provider0.ProRenderFieldPropsType<SelectProps> & Pick<SelectProps, "fieldNames"> & {
|
|
64
|
+
id?: string;
|
|
65
|
+
} & {}, _$vue.PublicProps>;
|
|
66
|
+
//#endregion
|
|
67
|
+
export { FieldSelectProps, FieldSelect as default, proFieldParsingValueEnumToArray, useFieldFetchData };
|