@v-c/select 0.0.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/LICENSE +21 -0
- package/dist/BaseSelect/Polite.cjs +37 -0
- package/dist/BaseSelect/Polite.d.ts +7 -0
- package/dist/BaseSelect/Polite.js +34 -0
- package/dist/BaseSelect/index.cjs +763 -0
- package/dist/BaseSelect/index.d.ts +133 -0
- package/dist/BaseSelect/index.js +759 -0
- package/dist/OptGroup.cjs +5 -0
- package/dist/OptGroup.d.ts +6 -0
- package/dist/OptGroup.js +4 -0
- package/dist/Option.cjs +5 -0
- package/dist/Option.d.ts +8 -0
- package/dist/Option.js +4 -0
- package/dist/OptionList.cjs +255 -0
- package/dist/OptionList.d.ts +17 -0
- package/dist/OptionList.js +249 -0
- package/dist/Select.cjs +833 -0
- package/dist/Select.d.ts +96 -0
- package/dist/Select.js +828 -0
- package/dist/SelectContext.cjs +11 -0
- package/dist/SelectContext.d.ts +32 -0
- package/dist/SelectContext.js +9 -0
- package/dist/SelectInput/Affix.cjs +16 -0
- package/dist/SelectInput/Affix.d.ts +2 -0
- package/dist/SelectInput/Affix.js +13 -0
- package/dist/SelectInput/Content/MultipleContent.cjs +142 -0
- package/dist/SelectInput/Content/MultipleContent.d.ts +3 -0
- package/dist/SelectInput/Content/MultipleContent.js +138 -0
- package/dist/SelectInput/Content/Placeholder.cjs +33 -0
- package/dist/SelectInput/Content/Placeholder.d.ts +5 -0
- package/dist/SelectInput/Content/Placeholder.js +30 -0
- package/dist/SelectInput/Content/SingleContent.cjs +80 -0
- package/dist/SelectInput/Content/SingleContent.d.ts +3 -0
- package/dist/SelectInput/Content/SingleContent.js +77 -0
- package/dist/SelectInput/Content/index.cjs +40 -0
- package/dist/SelectInput/Content/index.d.ts +6 -0
- package/dist/SelectInput/Content/index.js +36 -0
- package/dist/SelectInput/Input.cjs +176 -0
- package/dist/SelectInput/Input.d.ts +22 -0
- package/dist/SelectInput/Input.js +173 -0
- package/dist/SelectInput/context.cjs +11 -0
- package/dist/SelectInput/context.d.ts +5 -0
- package/dist/SelectInput/context.js +9 -0
- package/dist/SelectInput/index.cjs +330 -0
- package/dist/SelectInput/index.d.ts +44 -0
- package/dist/SelectInput/index.js +325 -0
- package/dist/SelectTrigger.cjs +189 -0
- package/dist/SelectTrigger.d.ts +26 -0
- package/dist/SelectTrigger.js +185 -0
- package/dist/TransBtn.cjs +69 -0
- package/dist/TransBtn.d.ts +22 -0
- package/dist/TransBtn.js +66 -0
- package/dist/_virtual/rolldown_runtime.cjs +21 -0
- package/dist/hooks/index.cjs +23 -0
- package/dist/hooks/index.d.ts +17 -0
- package/dist/hooks/index.js +12 -0
- package/dist/hooks/useAllowClear.cjs +17 -0
- package/dist/hooks/useAllowClear.d.ts +9 -0
- package/dist/hooks/useAllowClear.js +16 -0
- package/dist/hooks/useBaseProps.cjs +12 -0
- package/dist/hooks/useBaseProps.d.ts +10 -0
- package/dist/hooks/useBaseProps.js +9 -0
- package/dist/hooks/useCache.cjs +36 -0
- package/dist/hooks/useCache.d.ts +7 -0
- package/dist/hooks/useCache.js +34 -0
- package/dist/hooks/useComponents.cjs +15 -0
- package/dist/hooks/useComponents.d.ts +8 -0
- package/dist/hooks/useComponents.js +13 -0
- package/dist/hooks/useFilterOptions.cjs +39 -0
- package/dist/hooks/useFilterOptions.d.ts +3 -0
- package/dist/hooks/useFilterOptions.js +37 -0
- package/dist/hooks/useLock.cjs +26 -0
- package/dist/hooks/useLock.d.ts +1 -0
- package/dist/hooks/useLock.js +24 -0
- package/dist/hooks/useOpen.cjs +58 -0
- package/dist/hooks/useOpen.d.ts +19 -0
- package/dist/hooks/useOpen.js +56 -0
- package/dist/hooks/useOptions.cjs +38 -0
- package/dist/hooks/useOptions.d.ts +13 -0
- package/dist/hooks/useOptions.js +36 -0
- package/dist/hooks/useRefFunc.cjs +12 -0
- package/dist/hooks/useRefFunc.d.ts +6 -0
- package/dist/hooks/useRefFunc.js +10 -0
- package/dist/hooks/useSearchConfig.cjs +21 -0
- package/dist/hooks/useSearchConfig.d.ts +11 -0
- package/dist/hooks/useSearchConfig.js +19 -0
- package/dist/hooks/useSelectTriggerControl.cjs +18 -0
- package/dist/hooks/useSelectTriggerControl.d.ts +2 -0
- package/dist/hooks/useSelectTriggerControl.js +16 -0
- package/dist/index.cjs +16 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +8 -0
- package/dist/interface.cjs +0 -0
- package/dist/interface.d.ts +23 -0
- package/dist/interface.js +0 -0
- package/dist/utils/commonUtil.cjs +37 -0
- package/dist/utils/commonUtil.d.ts +12 -0
- package/dist/utils/commonUtil.js +30 -0
- package/dist/utils/keyUtil.cjs +36 -0
- package/dist/utils/keyUtil.d.ts +2 -0
- package/dist/utils/keyUtil.js +34 -0
- package/dist/utils/legacyUtil.cjs +32 -0
- package/dist/utils/legacyUtil.d.ts +3 -0
- package/dist/utils/legacyUtil.js +31 -0
- package/dist/utils/platformUtil.cjs +5 -0
- package/dist/utils/platformUtil.d.ts +1 -0
- package/dist/utils/platformUtil.js +5 -0
- package/dist/utils/valueUtil.cjs +79 -0
- package/dist/utils/valueUtil.d.ts +18 -0
- package/dist/utils/valueUtil.js +75 -0
- package/package.json +43 -0
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
2
|
+
const require_useBaseProps = require("../hooks/useBaseProps.cjs");
|
|
3
|
+
const require_valueUtil = require("../utils/valueUtil.cjs");
|
|
4
|
+
const require_useAllowClear = require("../hooks/useAllowClear.cjs");
|
|
5
|
+
const require_useComponents = require("../hooks/useComponents.cjs");
|
|
6
|
+
const require_useLock = require("../hooks/useLock.cjs");
|
|
7
|
+
const require_useOpen = require("../hooks/useOpen.cjs");
|
|
8
|
+
const require_useSelectTriggerControl = require("../hooks/useSelectTriggerControl.cjs");
|
|
9
|
+
const require_index = require("../SelectInput/index.cjs");
|
|
10
|
+
const require_SelectTrigger = require("../SelectTrigger.cjs");
|
|
11
|
+
const require_Polite = require("./Polite.cjs");
|
|
12
|
+
let vue = require("vue");
|
|
13
|
+
let __v_c_util = require("@v-c/util");
|
|
14
|
+
let __v_c_util_dist_KeyCode = require("@v-c/util/dist/KeyCode");
|
|
15
|
+
let __v_c_util_dist_omit = require("@v-c/util/dist/omit");
|
|
16
|
+
__v_c_util_dist_omit = require_rolldown_runtime.__toESM(__v_c_util_dist_omit);
|
|
17
|
+
let __v_c_util_dist_Dom_findDOMNode = require("@v-c/util/dist/Dom/findDOMNode");
|
|
18
|
+
function _isSlot(s) {
|
|
19
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
|
|
20
|
+
}
|
|
21
|
+
const isMultiple = (mode) => mode === "tags" || mode === "multiple";
|
|
22
|
+
var omitKeys = [
|
|
23
|
+
"id",
|
|
24
|
+
"prefixCls",
|
|
25
|
+
"className",
|
|
26
|
+
"styles",
|
|
27
|
+
"classNames",
|
|
28
|
+
"showSearch",
|
|
29
|
+
"tagRender",
|
|
30
|
+
"showScrollBar",
|
|
31
|
+
"direction",
|
|
32
|
+
"omitDomProps",
|
|
33
|
+
"displayValues",
|
|
34
|
+
"onDisplayValuesChange",
|
|
35
|
+
"emptyOptions",
|
|
36
|
+
"notFoundContent",
|
|
37
|
+
"onClear",
|
|
38
|
+
"maxCount",
|
|
39
|
+
"placeholder",
|
|
40
|
+
"mode",
|
|
41
|
+
"disabled",
|
|
42
|
+
"loading",
|
|
43
|
+
"getInputElement",
|
|
44
|
+
"getRawInputElement",
|
|
45
|
+
"open",
|
|
46
|
+
"defaultOpen",
|
|
47
|
+
"onPopupVisibleChange",
|
|
48
|
+
"activeValue",
|
|
49
|
+
"onActiveValueChange",
|
|
50
|
+
"activeDescendantId",
|
|
51
|
+
"searchValue",
|
|
52
|
+
"autoClearSearchValue",
|
|
53
|
+
"onSearch",
|
|
54
|
+
"onSearchSplit",
|
|
55
|
+
"tokenSeparators",
|
|
56
|
+
"allowClear",
|
|
57
|
+
"prefix",
|
|
58
|
+
"suffix",
|
|
59
|
+
"suffixIcon",
|
|
60
|
+
"clearIcon",
|
|
61
|
+
"OptionList",
|
|
62
|
+
"animation",
|
|
63
|
+
"transitionName",
|
|
64
|
+
"popupStyle",
|
|
65
|
+
"popupClassName",
|
|
66
|
+
"popupMatchSelectWidth",
|
|
67
|
+
"popupRender",
|
|
68
|
+
"popupAlign",
|
|
69
|
+
"placement",
|
|
70
|
+
"builtinPlacements",
|
|
71
|
+
"getPopupContainer",
|
|
72
|
+
"showAction",
|
|
73
|
+
"onFocus",
|
|
74
|
+
"onBlur",
|
|
75
|
+
"onKeyUp",
|
|
76
|
+
"onKeyDown",
|
|
77
|
+
"onMouseDown",
|
|
78
|
+
"components"
|
|
79
|
+
];
|
|
80
|
+
var defaults = {
|
|
81
|
+
showScrollBar: "optional",
|
|
82
|
+
notFoundContent: "Not Found",
|
|
83
|
+
showAction: []
|
|
84
|
+
};
|
|
85
|
+
const BaseSelect = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, attrs }) => {
|
|
86
|
+
const mode = (0, vue.computed)(() => props.mode);
|
|
87
|
+
const getInputElement = (0, vue.computed)(() => props.getInputElement);
|
|
88
|
+
const getRawInputElement = (0, vue.computed)(() => props.getRawInputElement);
|
|
89
|
+
const components = (0, vue.computed)(() => props.components);
|
|
90
|
+
const searchValue = (0, vue.computed)(() => props.searchValue);
|
|
91
|
+
const displayValues = (0, vue.computed)(() => props.displayValues);
|
|
92
|
+
const open = (0, vue.computed)(() => props.open);
|
|
93
|
+
const tokenSeparators = (0, vue.computed)(() => props.tokenSeparators);
|
|
94
|
+
const disabled = (0, vue.computed)(() => props.disabled);
|
|
95
|
+
const multiple = (0, vue.computed)(() => isMultiple(mode.value));
|
|
96
|
+
const containerRef = (0, vue.shallowRef)();
|
|
97
|
+
const triggerRef = (0, vue.shallowRef)();
|
|
98
|
+
const listRef = (0, vue.shallowRef)();
|
|
99
|
+
const focused = (0, vue.shallowRef)(false);
|
|
100
|
+
expose({
|
|
101
|
+
focus: (...args) => containerRef.value?.focus?.(...args),
|
|
102
|
+
blur: () => containerRef.value?.blur?.(),
|
|
103
|
+
scrollTo: (arg) => listRef.value?.scrollTo(arg),
|
|
104
|
+
nativeElement: (0, vue.computed)(() => (0, __v_c_util_dist_Dom_findDOMNode.getDOM)(containerRef))
|
|
105
|
+
});
|
|
106
|
+
const mergedComponents = require_useComponents.default(components, getInputElement, getRawInputElement);
|
|
107
|
+
const mergedSearchValue = (0, vue.computed)(() => {
|
|
108
|
+
if (mode.value !== "combobox") return searchValue.value;
|
|
109
|
+
const val = displayValues.value?.[0]?.value;
|
|
110
|
+
return typeof val === "string" || typeof val === "number" ? String(val) : "";
|
|
111
|
+
});
|
|
112
|
+
const emptyListContent = (0, vue.computed)(() => !props.notFoundContent && props.emptyOptions);
|
|
113
|
+
const [mergedOpen, triggerOpen] = require_useOpen.default(open, (openVal) => {
|
|
114
|
+
props.onPopupVisibleChange?.(openVal);
|
|
115
|
+
}, (nextOpen) => {
|
|
116
|
+
return props.disabled || emptyListContent.value ? false : nextOpen;
|
|
117
|
+
});
|
|
118
|
+
const tokenWithEnter = (0, vue.computed)(() => {
|
|
119
|
+
return (tokenSeparators.value || []).some((tokenSeparator) => ["\n", "\r\n"].includes(tokenSeparator));
|
|
120
|
+
});
|
|
121
|
+
const onInternalSearch = (searchText, fromTyping, isCompositing) => {
|
|
122
|
+
const { maxCount } = props;
|
|
123
|
+
if (multiple.value && require_valueUtil.isValidCount(maxCount) && displayValues.value.length >= maxCount) return;
|
|
124
|
+
let ret = true;
|
|
125
|
+
let newSearchText = searchText;
|
|
126
|
+
props?.onActiveValueChange?.(null);
|
|
127
|
+
const separatedList = require_valueUtil.getSeparatedContent(searchText, tokenSeparators.value, require_valueUtil.isValidCount(maxCount) ? maxCount - displayValues.value.length : void 0);
|
|
128
|
+
const patchLabels = isCompositing ? null : separatedList;
|
|
129
|
+
if (mode.value !== "combobox" && patchLabels) {
|
|
130
|
+
newSearchText = "";
|
|
131
|
+
props?.onSearchSplit?.(patchLabels);
|
|
132
|
+
triggerOpen(false);
|
|
133
|
+
ret = false;
|
|
134
|
+
}
|
|
135
|
+
if (props.onSearch && mergedSearchValue.value !== newSearchText) props?.onSearch?.(newSearchText, { source: fromTyping ? "typing" : "effect" });
|
|
136
|
+
if (searchText && fromTyping && ret) triggerOpen(true);
|
|
137
|
+
return ret;
|
|
138
|
+
};
|
|
139
|
+
const onInternalSearchSubmit = (searchText) => {
|
|
140
|
+
if (!searchText || !searchText.trim()) return;
|
|
141
|
+
props?.onSearch?.(searchText, { source: "submit" });
|
|
142
|
+
};
|
|
143
|
+
(0, vue.watch)(mergedOpen, () => {
|
|
144
|
+
if (!mergedOpen.value && !multiple.value && mode.value !== "combobox") onInternalSearch("", false, false);
|
|
145
|
+
}, { immediate: true });
|
|
146
|
+
(0, vue.watch)([disabled, mergedOpen], () => {
|
|
147
|
+
if (disabled.value) {
|
|
148
|
+
triggerOpen(false);
|
|
149
|
+
focused.value = false;
|
|
150
|
+
}
|
|
151
|
+
}, { immediate: true });
|
|
152
|
+
const [getClearLock, setClearLock] = require_useLock.default();
|
|
153
|
+
const keyLockRef = (0, vue.shallowRef)(false);
|
|
154
|
+
const onInternalKeyDown = (event) => {
|
|
155
|
+
const clearLock = getClearLock();
|
|
156
|
+
const { key } = event;
|
|
157
|
+
const isEnterKey = key === __v_c_util_dist_KeyCode.KeyCodeStr.Enter;
|
|
158
|
+
if (isEnterKey) {
|
|
159
|
+
if (mode.value !== "combobox") event.preventDefault();
|
|
160
|
+
if (!mergedOpen.value) triggerOpen(true);
|
|
161
|
+
}
|
|
162
|
+
setClearLock(!!mergedSearchValue.value);
|
|
163
|
+
if (key === __v_c_util_dist_KeyCode.KeyCodeStr.Backspace && !clearLock && multiple.value && !mergedSearchValue.value && displayValues.value.length) {
|
|
164
|
+
const cloneDisplayValues = [...displayValues.value];
|
|
165
|
+
let removedDisplayValue = null;
|
|
166
|
+
for (let i = cloneDisplayValues.length - 1; i >= 0; i -= 1) {
|
|
167
|
+
const current = cloneDisplayValues[i];
|
|
168
|
+
if (!current.disabled) {
|
|
169
|
+
cloneDisplayValues.splice(i, 1);
|
|
170
|
+
removedDisplayValue = current;
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (removedDisplayValue) props?.onDisplayValuesChange(cloneDisplayValues, {
|
|
175
|
+
type: "remove",
|
|
176
|
+
values: [removedDisplayValue]
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
if (mergedOpen.value && (!isEnterKey || !keyLockRef.value)) {
|
|
180
|
+
if (isEnterKey) keyLockRef.value = true;
|
|
181
|
+
listRef.value?.onKeyDown?.(event);
|
|
182
|
+
}
|
|
183
|
+
props?.onKeyDown?.(event);
|
|
184
|
+
};
|
|
185
|
+
const onInternalKeyUp = (event) => {
|
|
186
|
+
if (mergedOpen.value) listRef.value?.onKeyUp?.(event);
|
|
187
|
+
if (event.key === __v_c_util_dist_KeyCode.KeyCodeStr.Enter) keyLockRef.value = false;
|
|
188
|
+
props?.onKeyUp?.(event);
|
|
189
|
+
};
|
|
190
|
+
const onSelectorRemove = (val) => {
|
|
191
|
+
const newValues = displayValues.value.filter((i) => i !== val);
|
|
192
|
+
props?.onDisplayValuesChange(newValues, {
|
|
193
|
+
type: "remove",
|
|
194
|
+
values: [val]
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
const onInputBlur = () => {
|
|
198
|
+
keyLockRef.value = false;
|
|
199
|
+
};
|
|
200
|
+
const onInternalFocus = (event) => {
|
|
201
|
+
focused.value = true;
|
|
202
|
+
if (!disabled.value) {
|
|
203
|
+
if (props.showAction?.includes?.("focus")) triggerOpen(true);
|
|
204
|
+
props?.onFocus?.(event);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
const onInternalBlur = (event) => {
|
|
208
|
+
focused.value = false;
|
|
209
|
+
if (mergedSearchValue.value) {
|
|
210
|
+
if (mode.value === "tags") props?.onSearch?.(mergedSearchValue.value, { source: "submit" });
|
|
211
|
+
else if (mode.value === "multiple") props?.onSearch?.("", { source: "blur" });
|
|
212
|
+
}
|
|
213
|
+
if (!disabled.value) {
|
|
214
|
+
triggerOpen(false, { lazy: true });
|
|
215
|
+
props?.onBlur?.(event);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
const onInternalMouseDown = (event) => {
|
|
219
|
+
const { target } = event;
|
|
220
|
+
if ((triggerRef?.value?.getPopupElement?.())?.contains?.(target) && triggerOpen) triggerOpen(true, { ignoreNext: true });
|
|
221
|
+
props?.onMouseDown?.(event);
|
|
222
|
+
};
|
|
223
|
+
const forceState = (0, vue.shallowRef)({});
|
|
224
|
+
function onPopupMouseEnter() {
|
|
225
|
+
forceState.value = {};
|
|
226
|
+
}
|
|
227
|
+
require_useSelectTriggerControl.default(() => [(0, __v_c_util_dist_Dom_findDOMNode.getDOM)(containerRef), triggerRef.value?.getPopupElement?.()], mergedOpen, triggerOpen, (0, vue.computed)(() => !!mergedComponents.value.root));
|
|
228
|
+
require_useBaseProps.useBaseSelectProvider((0, vue.computed)(() => {
|
|
229
|
+
return {
|
|
230
|
+
...props,
|
|
231
|
+
open: mergedOpen.value,
|
|
232
|
+
triggerOpen: mergedOpen.value,
|
|
233
|
+
toggleOpen: triggerOpen,
|
|
234
|
+
multiple: multiple.value
|
|
235
|
+
};
|
|
236
|
+
}));
|
|
237
|
+
const onClearMouseDown = () => {
|
|
238
|
+
props?.onClear?.();
|
|
239
|
+
containerRef.value?.focus?.();
|
|
240
|
+
props?.onDisplayValuesChange([], {
|
|
241
|
+
type: "clear",
|
|
242
|
+
values: displayValues.value
|
|
243
|
+
});
|
|
244
|
+
onInternalSearch("", false, false);
|
|
245
|
+
};
|
|
246
|
+
const allowClearConfig = require_useAllowClear.useAllowClear((0, vue.computed)(() => props.prefixCls), displayValues, (0, vue.computed)(() => props.allowClear ?? false), (0, vue.computed)(() => props.clearIcon), (0, vue.computed)(() => disabled.value ?? false), mergedSearchValue, mode);
|
|
247
|
+
return () => {
|
|
248
|
+
const { OptionList, prefixCls, className, loading, showSearch, prefix, placeholder, activeValue, animation, transitionName, popupStyle, popupClassName, direction, popupMatchSelectWidth, popupRender, popupAlign, placement, builtinPlacements, getPopupContainer, emptyOptions } = props;
|
|
249
|
+
const mergedAllowClear = allowClearConfig.value.allowClear;
|
|
250
|
+
const clearNode = allowClearConfig.value.clearIcon;
|
|
251
|
+
const customizeInputElement = mode.value === "combobox" && typeof getInputElement.value === "function" && getInputElement.value() || null;
|
|
252
|
+
let onTriggerVisibleChange = null;
|
|
253
|
+
if (mergedComponents.value?.root) onTriggerVisibleChange = (newOpen) => {
|
|
254
|
+
triggerOpen(newOpen);
|
|
255
|
+
};
|
|
256
|
+
const mergedSuffixIconFn = () => {
|
|
257
|
+
const nextSuffix = props.suffix ?? props?.suffixIcon;
|
|
258
|
+
if (typeof nextSuffix === "function") return nextSuffix?.({
|
|
259
|
+
searchValue: mergedSearchValue.value,
|
|
260
|
+
open: mergedOpen.value,
|
|
261
|
+
focused: focused.value,
|
|
262
|
+
showSearch: props.showSearch,
|
|
263
|
+
loading: props.loading
|
|
264
|
+
});
|
|
265
|
+
return nextSuffix;
|
|
266
|
+
};
|
|
267
|
+
const mergedSuffixIcon = mergedSuffixIconFn();
|
|
268
|
+
const optionList = (0, vue.createVNode)(OptionList, { "ref": listRef }, null);
|
|
269
|
+
const mergedClassName = (0, __v_c_util.clsx)(prefixCls, className, {
|
|
270
|
+
[`${prefixCls}-focused`]: focused.value,
|
|
271
|
+
[`${prefixCls}-multiple`]: multiple.value,
|
|
272
|
+
[`${prefixCls}-single`]: !multiple.value,
|
|
273
|
+
[`${prefixCls}-allow-clear`]: mergedAllowClear,
|
|
274
|
+
[`${prefixCls}-show-arrow`]: mergedSuffixIcon !== void 0 && mergedSuffixIcon !== null,
|
|
275
|
+
[`${prefixCls}-disabled`]: disabled.value,
|
|
276
|
+
[`${prefixCls}-loading`]: loading,
|
|
277
|
+
[`${prefixCls}-open`]: mergedOpen.value,
|
|
278
|
+
[`${prefixCls}-customize-input`]: customizeInputElement,
|
|
279
|
+
[`${prefixCls}-show-search`]: showSearch
|
|
280
|
+
});
|
|
281
|
+
let renderNode = (0, vue.createVNode)(require_index.default, (0, vue.mergeProps)(attrs, (0, __v_c_util_dist_omit.default)(props, omitKeys), {
|
|
282
|
+
"ref": containerRef,
|
|
283
|
+
"prefixCls": prefixCls,
|
|
284
|
+
"className": mergedClassName,
|
|
285
|
+
"focused": focused.value,
|
|
286
|
+
"prefix": prefix,
|
|
287
|
+
"suffix": mergedSuffixIcon,
|
|
288
|
+
"clearIcon": clearNode,
|
|
289
|
+
"multiple": multiple.value,
|
|
290
|
+
"mode": mode.value,
|
|
291
|
+
"displayValues": displayValues.value,
|
|
292
|
+
"placeholder": placeholder,
|
|
293
|
+
"searchValue": mergedSearchValue.value,
|
|
294
|
+
"activeValue": activeValue,
|
|
295
|
+
"onSearch": onInternalSearch,
|
|
296
|
+
"onSearchSubmit": onInternalSearchSubmit,
|
|
297
|
+
"onInputBlur": onInputBlur,
|
|
298
|
+
"onFocus": onInternalFocus,
|
|
299
|
+
"onBlur": onInternalBlur,
|
|
300
|
+
"onClearMouseDown": onClearMouseDown,
|
|
301
|
+
"onKeyDown": onInternalKeyDown,
|
|
302
|
+
"onKeyUp": onInternalKeyUp,
|
|
303
|
+
"onSelectorRemove": onSelectorRemove,
|
|
304
|
+
"tokenWithEnter": tokenWithEnter.value,
|
|
305
|
+
"onMouseDown": onInternalMouseDown,
|
|
306
|
+
"components": mergedComponents.value
|
|
307
|
+
}), null);
|
|
308
|
+
const _renderNode = function() {
|
|
309
|
+
return renderNode;
|
|
310
|
+
}();
|
|
311
|
+
renderNode = (0, vue.createVNode)(require_SelectTrigger.default, {
|
|
312
|
+
"ref": triggerRef,
|
|
313
|
+
"disabled": disabled.value ?? false,
|
|
314
|
+
"prefixCls": prefixCls,
|
|
315
|
+
"visible": mergedOpen.value,
|
|
316
|
+
"popupElement": optionList,
|
|
317
|
+
"animation": animation,
|
|
318
|
+
"transitionName": transitionName,
|
|
319
|
+
"popupStyle": popupStyle,
|
|
320
|
+
"popupClassName": popupClassName,
|
|
321
|
+
"direction": direction,
|
|
322
|
+
"popupMatchSelectWidth": popupMatchSelectWidth,
|
|
323
|
+
"popupRender": popupRender,
|
|
324
|
+
"popupAlign": popupAlign,
|
|
325
|
+
"placement": placement,
|
|
326
|
+
"builtinPlacements": builtinPlacements,
|
|
327
|
+
"getPopupContainer": getPopupContainer,
|
|
328
|
+
"empty": emptyOptions,
|
|
329
|
+
"onPopupVisibleChange": onTriggerVisibleChange,
|
|
330
|
+
"onPopupMouseEnter": onPopupMouseEnter,
|
|
331
|
+
"onPopupMouseDown": onInternalMouseDown
|
|
332
|
+
}, _isSlot(renderNode) ? renderNode : { default: () => [_renderNode] });
|
|
333
|
+
return (0, vue.createVNode)(vue.Fragment, null, [(0, vue.createVNode)(require_Polite.default, {
|
|
334
|
+
"visible": focused.value && !mergedOpen.value,
|
|
335
|
+
"values": displayValues.value
|
|
336
|
+
}, null), renderNode]);
|
|
337
|
+
};
|
|
338
|
+
}, {
|
|
339
|
+
props: /* @__PURE__ */ (0, vue.mergeDefaults)({
|
|
340
|
+
className: {
|
|
341
|
+
type: String,
|
|
342
|
+
required: false,
|
|
343
|
+
default: void 0
|
|
344
|
+
},
|
|
345
|
+
style: {
|
|
346
|
+
type: Object,
|
|
347
|
+
required: false,
|
|
348
|
+
default: void 0
|
|
349
|
+
},
|
|
350
|
+
classNames: {
|
|
351
|
+
type: Object,
|
|
352
|
+
required: false,
|
|
353
|
+
default: void 0
|
|
354
|
+
},
|
|
355
|
+
styles: {
|
|
356
|
+
type: Object,
|
|
357
|
+
required: false,
|
|
358
|
+
default: void 0
|
|
359
|
+
},
|
|
360
|
+
showSearch: {
|
|
361
|
+
type: Boolean,
|
|
362
|
+
required: false,
|
|
363
|
+
default: void 0
|
|
364
|
+
},
|
|
365
|
+
tagRender: {
|
|
366
|
+
type: Function,
|
|
367
|
+
required: false,
|
|
368
|
+
default: void 0
|
|
369
|
+
},
|
|
370
|
+
direction: {
|
|
371
|
+
type: String,
|
|
372
|
+
required: false,
|
|
373
|
+
default: void 0
|
|
374
|
+
},
|
|
375
|
+
autoFocus: {
|
|
376
|
+
type: Boolean,
|
|
377
|
+
required: false,
|
|
378
|
+
default: void 0
|
|
379
|
+
},
|
|
380
|
+
placeholder: {
|
|
381
|
+
type: [
|
|
382
|
+
Object,
|
|
383
|
+
Function,
|
|
384
|
+
String,
|
|
385
|
+
Number,
|
|
386
|
+
null,
|
|
387
|
+
Boolean,
|
|
388
|
+
Array
|
|
389
|
+
],
|
|
390
|
+
required: false,
|
|
391
|
+
default: void 0
|
|
392
|
+
},
|
|
393
|
+
maxCount: {
|
|
394
|
+
type: Number,
|
|
395
|
+
required: false,
|
|
396
|
+
default: void 0
|
|
397
|
+
},
|
|
398
|
+
title: {
|
|
399
|
+
type: String,
|
|
400
|
+
required: false,
|
|
401
|
+
default: void 0
|
|
402
|
+
},
|
|
403
|
+
tabIndex: {
|
|
404
|
+
type: Number,
|
|
405
|
+
required: false,
|
|
406
|
+
default: void 0
|
|
407
|
+
},
|
|
408
|
+
notFoundContent: {
|
|
409
|
+
type: [
|
|
410
|
+
Object,
|
|
411
|
+
Function,
|
|
412
|
+
String,
|
|
413
|
+
Number,
|
|
414
|
+
null,
|
|
415
|
+
Boolean,
|
|
416
|
+
Array
|
|
417
|
+
],
|
|
418
|
+
required: false,
|
|
419
|
+
default: void 0
|
|
420
|
+
},
|
|
421
|
+
onClear: {
|
|
422
|
+
type: Function,
|
|
423
|
+
required: false,
|
|
424
|
+
default: void 0
|
|
425
|
+
},
|
|
426
|
+
maxLength: {
|
|
427
|
+
type: Number,
|
|
428
|
+
required: false,
|
|
429
|
+
default: void 0
|
|
430
|
+
},
|
|
431
|
+
showScrollBar: {
|
|
432
|
+
type: [Boolean, String],
|
|
433
|
+
required: false,
|
|
434
|
+
default: void 0
|
|
435
|
+
},
|
|
436
|
+
choiceTransitionName: {
|
|
437
|
+
type: String,
|
|
438
|
+
required: false,
|
|
439
|
+
default: void 0
|
|
440
|
+
},
|
|
441
|
+
mode: {
|
|
442
|
+
type: String,
|
|
443
|
+
required: false,
|
|
444
|
+
default: void 0
|
|
445
|
+
},
|
|
446
|
+
disabled: {
|
|
447
|
+
type: Boolean,
|
|
448
|
+
required: false,
|
|
449
|
+
default: void 0
|
|
450
|
+
},
|
|
451
|
+
loading: {
|
|
452
|
+
type: Boolean,
|
|
453
|
+
required: false,
|
|
454
|
+
default: void 0
|
|
455
|
+
},
|
|
456
|
+
open: {
|
|
457
|
+
type: Boolean,
|
|
458
|
+
required: false,
|
|
459
|
+
default: void 0
|
|
460
|
+
},
|
|
461
|
+
defaultOpen: {
|
|
462
|
+
type: Boolean,
|
|
463
|
+
required: false,
|
|
464
|
+
default: void 0
|
|
465
|
+
},
|
|
466
|
+
onPopupVisibleChange: {
|
|
467
|
+
type: Function,
|
|
468
|
+
required: false,
|
|
469
|
+
default: void 0
|
|
470
|
+
},
|
|
471
|
+
getInputElement: {
|
|
472
|
+
type: Function,
|
|
473
|
+
required: false,
|
|
474
|
+
default: void 0
|
|
475
|
+
},
|
|
476
|
+
getRawInputElement: {
|
|
477
|
+
type: Function,
|
|
478
|
+
required: false,
|
|
479
|
+
default: void 0
|
|
480
|
+
},
|
|
481
|
+
maxTagTextLength: {
|
|
482
|
+
type: Number,
|
|
483
|
+
required: false,
|
|
484
|
+
default: void 0
|
|
485
|
+
},
|
|
486
|
+
maxTagCount: {
|
|
487
|
+
type: [Number, String],
|
|
488
|
+
required: false,
|
|
489
|
+
default: void 0
|
|
490
|
+
},
|
|
491
|
+
maxTagPlaceholder: {
|
|
492
|
+
type: [
|
|
493
|
+
Object,
|
|
494
|
+
Function,
|
|
495
|
+
String,
|
|
496
|
+
Number,
|
|
497
|
+
null,
|
|
498
|
+
Boolean,
|
|
499
|
+
Array
|
|
500
|
+
],
|
|
501
|
+
required: false,
|
|
502
|
+
default: void 0
|
|
503
|
+
},
|
|
504
|
+
tokenSeparators: {
|
|
505
|
+
type: Array,
|
|
506
|
+
required: false,
|
|
507
|
+
default: void 0
|
|
508
|
+
},
|
|
509
|
+
allowClear: {
|
|
510
|
+
type: [Boolean, Object],
|
|
511
|
+
required: false,
|
|
512
|
+
default: void 0
|
|
513
|
+
},
|
|
514
|
+
prefix: {
|
|
515
|
+
type: [
|
|
516
|
+
Object,
|
|
517
|
+
Function,
|
|
518
|
+
String,
|
|
519
|
+
Number,
|
|
520
|
+
null,
|
|
521
|
+
Boolean,
|
|
522
|
+
Array
|
|
523
|
+
],
|
|
524
|
+
required: false,
|
|
525
|
+
default: void 0
|
|
526
|
+
},
|
|
527
|
+
suffixIcon: {
|
|
528
|
+
type: [
|
|
529
|
+
Object,
|
|
530
|
+
Function,
|
|
531
|
+
String,
|
|
532
|
+
Number,
|
|
533
|
+
null,
|
|
534
|
+
Boolean,
|
|
535
|
+
Array
|
|
536
|
+
],
|
|
537
|
+
required: false,
|
|
538
|
+
default: void 0
|
|
539
|
+
},
|
|
540
|
+
suffix: {
|
|
541
|
+
type: [
|
|
542
|
+
Object,
|
|
543
|
+
Function,
|
|
544
|
+
String,
|
|
545
|
+
Number,
|
|
546
|
+
null,
|
|
547
|
+
Boolean,
|
|
548
|
+
Array
|
|
549
|
+
],
|
|
550
|
+
required: false,
|
|
551
|
+
default: void 0
|
|
552
|
+
},
|
|
553
|
+
clearIcon: {
|
|
554
|
+
type: [
|
|
555
|
+
Object,
|
|
556
|
+
Function,
|
|
557
|
+
String,
|
|
558
|
+
Number,
|
|
559
|
+
null,
|
|
560
|
+
Boolean,
|
|
561
|
+
Array
|
|
562
|
+
],
|
|
563
|
+
required: false,
|
|
564
|
+
default: void 0
|
|
565
|
+
},
|
|
566
|
+
removeIcon: {
|
|
567
|
+
type: [
|
|
568
|
+
Object,
|
|
569
|
+
Function,
|
|
570
|
+
String,
|
|
571
|
+
Number,
|
|
572
|
+
null,
|
|
573
|
+
Boolean,
|
|
574
|
+
Array
|
|
575
|
+
],
|
|
576
|
+
required: false,
|
|
577
|
+
default: void 0
|
|
578
|
+
},
|
|
579
|
+
animation: {
|
|
580
|
+
type: String,
|
|
581
|
+
required: false,
|
|
582
|
+
default: void 0
|
|
583
|
+
},
|
|
584
|
+
transitionName: {
|
|
585
|
+
type: String,
|
|
586
|
+
required: false,
|
|
587
|
+
default: void 0
|
|
588
|
+
},
|
|
589
|
+
popupStyle: {
|
|
590
|
+
type: Object,
|
|
591
|
+
required: false,
|
|
592
|
+
default: void 0
|
|
593
|
+
},
|
|
594
|
+
popupClassName: {
|
|
595
|
+
type: String,
|
|
596
|
+
required: false,
|
|
597
|
+
default: void 0
|
|
598
|
+
},
|
|
599
|
+
popupMatchSelectWidth: {
|
|
600
|
+
type: [Boolean, Number],
|
|
601
|
+
required: false,
|
|
602
|
+
default: void 0
|
|
603
|
+
},
|
|
604
|
+
popupRender: {
|
|
605
|
+
type: Function,
|
|
606
|
+
required: false,
|
|
607
|
+
default: void 0
|
|
608
|
+
},
|
|
609
|
+
popupAlign: {
|
|
610
|
+
type: Object,
|
|
611
|
+
required: false,
|
|
612
|
+
default: void 0
|
|
613
|
+
},
|
|
614
|
+
placement: {
|
|
615
|
+
type: String,
|
|
616
|
+
required: false,
|
|
617
|
+
default: void 0
|
|
618
|
+
},
|
|
619
|
+
builtinPlacements: {
|
|
620
|
+
type: Object,
|
|
621
|
+
required: false,
|
|
622
|
+
default: void 0
|
|
623
|
+
},
|
|
624
|
+
getPopupContainer: {
|
|
625
|
+
type: Function,
|
|
626
|
+
required: false,
|
|
627
|
+
default: void 0
|
|
628
|
+
},
|
|
629
|
+
showAction: {
|
|
630
|
+
type: Array,
|
|
631
|
+
required: false,
|
|
632
|
+
default: void 0
|
|
633
|
+
},
|
|
634
|
+
onBlur: {
|
|
635
|
+
type: Function,
|
|
636
|
+
required: false,
|
|
637
|
+
default: void 0
|
|
638
|
+
},
|
|
639
|
+
onFocus: {
|
|
640
|
+
type: Function,
|
|
641
|
+
required: false,
|
|
642
|
+
default: void 0
|
|
643
|
+
},
|
|
644
|
+
onKeyUp: {
|
|
645
|
+
type: Function,
|
|
646
|
+
required: false,
|
|
647
|
+
default: void 0
|
|
648
|
+
},
|
|
649
|
+
onKeyDown: {
|
|
650
|
+
type: Function,
|
|
651
|
+
required: false,
|
|
652
|
+
default: void 0
|
|
653
|
+
},
|
|
654
|
+
onMouseDown: {
|
|
655
|
+
type: Function,
|
|
656
|
+
required: false,
|
|
657
|
+
default: void 0
|
|
658
|
+
},
|
|
659
|
+
onPopupScroll: {
|
|
660
|
+
type: Function,
|
|
661
|
+
required: false,
|
|
662
|
+
default: void 0
|
|
663
|
+
},
|
|
664
|
+
onInputKeyDown: {
|
|
665
|
+
type: Function,
|
|
666
|
+
required: false,
|
|
667
|
+
default: void 0
|
|
668
|
+
},
|
|
669
|
+
onMouseEnter: {
|
|
670
|
+
type: Function,
|
|
671
|
+
required: false,
|
|
672
|
+
default: void 0
|
|
673
|
+
},
|
|
674
|
+
onMouseLeave: {
|
|
675
|
+
type: Function,
|
|
676
|
+
required: false,
|
|
677
|
+
default: void 0
|
|
678
|
+
},
|
|
679
|
+
onClick: {
|
|
680
|
+
type: Function,
|
|
681
|
+
required: false,
|
|
682
|
+
default: void 0
|
|
683
|
+
},
|
|
684
|
+
components: {
|
|
685
|
+
type: Object,
|
|
686
|
+
required: false,
|
|
687
|
+
default: void 0
|
|
688
|
+
},
|
|
689
|
+
id: {
|
|
690
|
+
type: String,
|
|
691
|
+
required: true,
|
|
692
|
+
default: void 0
|
|
693
|
+
},
|
|
694
|
+
prefixCls: {
|
|
695
|
+
type: String,
|
|
696
|
+
required: true,
|
|
697
|
+
default: void 0
|
|
698
|
+
},
|
|
699
|
+
omitDomProps: {
|
|
700
|
+
type: Array,
|
|
701
|
+
required: false,
|
|
702
|
+
default: void 0
|
|
703
|
+
},
|
|
704
|
+
displayValues: {
|
|
705
|
+
type: Array,
|
|
706
|
+
required: true,
|
|
707
|
+
default: void 0
|
|
708
|
+
},
|
|
709
|
+
onDisplayValuesChange: {
|
|
710
|
+
type: Function,
|
|
711
|
+
required: true,
|
|
712
|
+
default: void 0
|
|
713
|
+
},
|
|
714
|
+
activeValue: {
|
|
715
|
+
type: String,
|
|
716
|
+
required: false,
|
|
717
|
+
default: void 0
|
|
718
|
+
},
|
|
719
|
+
activeDescendantId: {
|
|
720
|
+
type: String,
|
|
721
|
+
required: false,
|
|
722
|
+
default: void 0
|
|
723
|
+
},
|
|
724
|
+
onActiveValueChange: {
|
|
725
|
+
type: Function,
|
|
726
|
+
required: false,
|
|
727
|
+
default: void 0
|
|
728
|
+
},
|
|
729
|
+
searchValue: {
|
|
730
|
+
type: String,
|
|
731
|
+
required: true,
|
|
732
|
+
default: void 0
|
|
733
|
+
},
|
|
734
|
+
autoClearSearchValue: {
|
|
735
|
+
type: Boolean,
|
|
736
|
+
required: false,
|
|
737
|
+
default: void 0
|
|
738
|
+
},
|
|
739
|
+
onSearch: {
|
|
740
|
+
type: Function,
|
|
741
|
+
required: true,
|
|
742
|
+
default: void 0
|
|
743
|
+
},
|
|
744
|
+
onSearchSplit: {
|
|
745
|
+
type: Function,
|
|
746
|
+
required: false,
|
|
747
|
+
default: void 0
|
|
748
|
+
},
|
|
749
|
+
OptionList: {
|
|
750
|
+
required: true,
|
|
751
|
+
default: void 0
|
|
752
|
+
},
|
|
753
|
+
emptyOptions: {
|
|
754
|
+
type: Boolean,
|
|
755
|
+
required: true,
|
|
756
|
+
default: void 0
|
|
757
|
+
}
|
|
758
|
+
}, defaults),
|
|
759
|
+
name: "BaseSelect",
|
|
760
|
+
inheritAttrs: false
|
|
761
|
+
});
|
|
762
|
+
exports.BaseSelect = BaseSelect;
|
|
763
|
+
exports.isMultiple = isMultiple;
|