useSelect.mjs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. import { reactive, ref, computed, watch, watchEffect, nextTick, onMounted } from 'vue';
  2. import { castArray, isEqual, get, debounce, findLastIndex } from 'lodash-unified';
  3. import { isIOS, isClient, useResizeObserver } from '@vueuse/core';
  4. import { useLocale } from '../../../hooks/use-locale/index.mjs';
  5. import { useId } from '../../../hooks/use-id/index.mjs';
  6. import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
  7. import { useComposition } from '../../../hooks/use-composition/index.mjs';
  8. import { useFocusController } from '../../../hooks/use-focus-controller/index.mjs';
  9. import { debugWarn } from '../../../utils/error.mjs';
  10. import { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
  11. import { useEmptyValues } from '../../../hooks/use-empty-values/index.mjs';
  12. import { isArray, isFunction, isPlainObject, isObject } from '@vue/shared';
  13. import { ValidateComponentsMap } from '../../../utils/vue/icon.mjs';
  14. import { useFormSize } from '../../form/src/hooks/use-form-common-props.mjs';
  15. import { isUndefined, isNumber } from '../../../utils/types.mjs';
  16. import { EVENT_CODE } from '../../../constants/aria.mjs';
  17. import { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
  18. import { scrollIntoView } from '../../../utils/dom/scroll.mjs';
  19. const useSelect = (props, emit) => {
  20. const { t } = useLocale();
  21. const contentId = useId();
  22. const nsSelect = useNamespace("select");
  23. const nsInput = useNamespace("input");
  24. const states = reactive({
  25. inputValue: "",
  26. options: /* @__PURE__ */ new Map(),
  27. cachedOptions: /* @__PURE__ */ new Map(),
  28. optionValues: [],
  29. selected: [],
  30. selectionWidth: 0,
  31. collapseItemWidth: 0,
  32. selectedLabel: "",
  33. hoveringIndex: -1,
  34. previousQuery: null,
  35. inputHovering: false,
  36. menuVisibleOnFocus: false,
  37. isBeforeHide: false
  38. });
  39. const selectRef = ref();
  40. const selectionRef = ref();
  41. const tooltipRef = ref();
  42. const tagTooltipRef = ref();
  43. const inputRef = ref();
  44. const prefixRef = ref();
  45. const suffixRef = ref();
  46. const menuRef = ref();
  47. const tagMenuRef = ref();
  48. const collapseItemRef = ref();
  49. const scrollbarRef = ref();
  50. const {
  51. isComposing,
  52. handleCompositionStart,
  53. handleCompositionUpdate,
  54. handleCompositionEnd
  55. } = useComposition({
  56. afterComposition: (e) => onInput(e)
  57. });
  58. const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
  59. beforeFocus() {
  60. return selectDisabled.value;
  61. },
  62. afterFocus() {
  63. if (props.automaticDropdown && !expanded.value) {
  64. expanded.value = true;
  65. states.menuVisibleOnFocus = true;
  66. }
  67. },
  68. beforeBlur(event) {
  69. var _a, _b;
  70. return ((_a = tooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event)) || ((_b = tagTooltipRef.value) == null ? void 0 : _b.isFocusInsideContent(event));
  71. },
  72. afterBlur() {
  73. var _a;
  74. expanded.value = false;
  75. states.menuVisibleOnFocus = false;
  76. if (props.validateEvent) {
  77. (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err));
  78. }
  79. }
  80. });
  81. const expanded = ref(false);
  82. const hoverOption = ref();
  83. const { form, formItem } = useFormItem();
  84. const { inputId } = useFormItemInputId(props, {
  85. formItemContext: formItem
  86. });
  87. const { valueOnClear, isEmptyValue } = useEmptyValues(props);
  88. const selectDisabled = computed(() => props.disabled || (form == null ? void 0 : form.disabled));
  89. const hasModelValue = computed(() => {
  90. return isArray(props.modelValue) ? props.modelValue.length > 0 : !isEmptyValue(props.modelValue);
  91. });
  92. const needStatusIcon = computed(() => {
  93. var _a;
  94. return (_a = form == null ? void 0 : form.statusIcon) != null ? _a : false;
  95. });
  96. const showClose = computed(() => {
  97. return props.clearable && !selectDisabled.value && states.inputHovering && hasModelValue.value;
  98. });
  99. const iconComponent = computed(() => props.remote && props.filterable && !props.remoteShowSuffix ? "" : props.suffixIcon);
  100. const iconReverse = computed(() => nsSelect.is("reverse", !!(iconComponent.value && expanded.value)));
  101. const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
  102. const validateIcon = computed(() => validateState.value && ValidateComponentsMap[validateState.value]);
  103. const debounce$1 = computed(() => props.remote ? 300 : 0);
  104. const isRemoteSearchEmpty = computed(() => props.remote && !states.inputValue && states.options.size === 0);
  105. const emptyText = computed(() => {
  106. if (props.loading) {
  107. return props.loadingText || t("el.select.loading");
  108. } else {
  109. if (props.filterable && states.inputValue && states.options.size > 0 && filteredOptionsCount.value === 0) {
  110. return props.noMatchText || t("el.select.noMatch");
  111. }
  112. if (states.options.size === 0) {
  113. return props.noDataText || t("el.select.noData");
  114. }
  115. }
  116. return null;
  117. });
  118. const filteredOptionsCount = computed(() => optionsArray.value.filter((option) => option.visible).length);
  119. const optionsArray = computed(() => {
  120. const list = Array.from(states.options.values());
  121. const newList = [];
  122. states.optionValues.forEach((item) => {
  123. const index = list.findIndex((i) => i.value === item);
  124. if (index > -1) {
  125. newList.push(list[index]);
  126. }
  127. });
  128. return newList.length >= list.length ? newList : list;
  129. });
  130. const cachedOptionsArray = computed(() => Array.from(states.cachedOptions.values()));
  131. const showNewOption = computed(() => {
  132. const hasExistingOption = optionsArray.value.filter((option) => {
  133. return !option.created;
  134. }).some((option) => {
  135. return option.currentLabel === states.inputValue;
  136. });
  137. return props.filterable && props.allowCreate && states.inputValue !== "" && !hasExistingOption;
  138. });
  139. const updateOptions = () => {
  140. if (props.filterable && isFunction(props.filterMethod))
  141. return;
  142. if (props.filterable && props.remote && isFunction(props.remoteMethod))
  143. return;
  144. optionsArray.value.forEach((option) => {
  145. var _a;
  146. (_a = option.updateOption) == null ? void 0 : _a.call(option, states.inputValue);
  147. });
  148. };
  149. const selectSize = useFormSize();
  150. const collapseTagSize = computed(() => ["small"].includes(selectSize.value) ? "small" : "default");
  151. const dropdownMenuVisible = computed({
  152. get() {
  153. return expanded.value && !isRemoteSearchEmpty.value;
  154. },
  155. set(val) {
  156. expanded.value = val;
  157. }
  158. });
  159. const shouldShowPlaceholder = computed(() => {
  160. if (props.multiple && !isUndefined(props.modelValue)) {
  161. return castArray(props.modelValue).length === 0 && !states.inputValue;
  162. }
  163. const value = isArray(props.modelValue) ? props.modelValue[0] : props.modelValue;
  164. return props.filterable || isUndefined(value) ? !states.inputValue : true;
  165. });
  166. const currentPlaceholder = computed(() => {
  167. var _a;
  168. const _placeholder = (_a = props.placeholder) != null ? _a : t("el.select.placeholder");
  169. return props.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
  170. });
  171. const mouseEnterEventName = computed(() => isIOS ? null : "mouseenter");
  172. watch(() => props.modelValue, (val, oldVal) => {
  173. if (props.multiple) {
  174. if (props.filterable && !props.reserveKeyword) {
  175. states.inputValue = "";
  176. handleQueryChange("");
  177. }
  178. }
  179. setSelected();
  180. if (!isEqual(val, oldVal) && props.validateEvent) {
  181. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
  182. }
  183. }, {
  184. flush: "post",
  185. deep: true
  186. });
  187. watch(() => expanded.value, (val) => {
  188. if (val) {
  189. handleQueryChange(states.inputValue);
  190. } else {
  191. states.inputValue = "";
  192. states.previousQuery = null;
  193. states.isBeforeHide = true;
  194. }
  195. emit("visible-change", val);
  196. });
  197. watch(() => states.options.entries(), () => {
  198. if (!isClient)
  199. return;
  200. setSelected();
  201. if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptionsCount.value) {
  202. checkDefaultFirstOption();
  203. }
  204. }, {
  205. flush: "post"
  206. });
  207. watch([() => states.hoveringIndex, optionsArray], ([val]) => {
  208. if (isNumber(val) && val > -1) {
  209. hoverOption.value = optionsArray.value[val] || {};
  210. } else {
  211. hoverOption.value = {};
  212. }
  213. optionsArray.value.forEach((option) => {
  214. option.hover = hoverOption.value === option;
  215. });
  216. });
  217. watchEffect(() => {
  218. if (states.isBeforeHide)
  219. return;
  220. updateOptions();
  221. });
  222. const handleQueryChange = (val) => {
  223. if (states.previousQuery === val || isComposing.value) {
  224. return;
  225. }
  226. states.previousQuery = val;
  227. if (props.filterable && isFunction(props.filterMethod)) {
  228. props.filterMethod(val);
  229. } else if (props.filterable && props.remote && isFunction(props.remoteMethod)) {
  230. props.remoteMethod(val);
  231. }
  232. if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptionsCount.value) {
  233. nextTick(checkDefaultFirstOption);
  234. } else {
  235. nextTick(updateHoveringIndex);
  236. }
  237. };
  238. const checkDefaultFirstOption = () => {
  239. const optionsInDropdown = optionsArray.value.filter((n) => n.visible && !n.disabled && !n.states.groupDisabled);
  240. const userCreatedOption = optionsInDropdown.find((n) => n.created);
  241. const firstOriginOption = optionsInDropdown[0];
  242. const valueList = optionsArray.value.map((item) => item.value);
  243. states.hoveringIndex = getValueIndex(valueList, userCreatedOption || firstOriginOption);
  244. };
  245. const setSelected = () => {
  246. if (!props.multiple) {
  247. const value = isArray(props.modelValue) ? props.modelValue[0] : props.modelValue;
  248. const option = getOption(value);
  249. states.selectedLabel = option.currentLabel;
  250. states.selected = [option];
  251. return;
  252. } else {
  253. states.selectedLabel = "";
  254. }
  255. const result = [];
  256. if (!isUndefined(props.modelValue)) {
  257. castArray(props.modelValue).forEach((value) => {
  258. result.push(getOption(value));
  259. });
  260. }
  261. states.selected = result;
  262. };
  263. const getOption = (value) => {
  264. let option;
  265. const isObjectValue = isPlainObject(value);
  266. for (let i = states.cachedOptions.size - 1; i >= 0; i--) {
  267. const cachedOption = cachedOptionsArray.value[i];
  268. const isEqualValue = isObjectValue ? get(cachedOption.value, props.valueKey) === get(value, props.valueKey) : cachedOption.value === value;
  269. if (isEqualValue) {
  270. option = {
  271. value,
  272. currentLabel: cachedOption.currentLabel,
  273. get isDisabled() {
  274. return cachedOption.isDisabled;
  275. }
  276. };
  277. break;
  278. }
  279. }
  280. if (option)
  281. return option;
  282. const label = isObjectValue ? value.label : value != null ? value : "";
  283. const newOption = {
  284. value,
  285. currentLabel: label
  286. };
  287. return newOption;
  288. };
  289. const updateHoveringIndex = () => {
  290. states.hoveringIndex = optionsArray.value.findIndex((item) => states.selected.some((selected) => getValueKey(selected) === getValueKey(item)));
  291. };
  292. const resetSelectionWidth = () => {
  293. states.selectionWidth = Number.parseFloat(window.getComputedStyle(selectionRef.value).width);
  294. };
  295. const resetCollapseItemWidth = () => {
  296. states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
  297. };
  298. const updateTooltip = () => {
  299. var _a, _b;
  300. (_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  301. };
  302. const updateTagTooltip = () => {
  303. var _a, _b;
  304. (_b = (_a = tagTooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  305. };
  306. const onInputChange = () => {
  307. if (states.inputValue.length > 0 && !expanded.value) {
  308. expanded.value = true;
  309. }
  310. handleQueryChange(states.inputValue);
  311. };
  312. const onInput = (event) => {
  313. states.inputValue = event.target.value;
  314. if (props.remote) {
  315. debouncedOnInputChange();
  316. } else {
  317. return onInputChange();
  318. }
  319. };
  320. const debouncedOnInputChange = debounce(() => {
  321. onInputChange();
  322. }, debounce$1.value);
  323. const emitChange = (val) => {
  324. if (!isEqual(props.modelValue, val)) {
  325. emit(CHANGE_EVENT, val);
  326. }
  327. };
  328. const getLastNotDisabledIndex = (value) => findLastIndex(value, (it) => {
  329. const option = states.cachedOptions.get(it);
  330. return option && !option.disabled && !option.states.groupDisabled;
  331. });
  332. const deletePrevTag = (e) => {
  333. if (!props.multiple)
  334. return;
  335. if (e.code === EVENT_CODE.delete)
  336. return;
  337. if (e.target.value.length <= 0) {
  338. const value = castArray(props.modelValue).slice();
  339. const lastNotDisabledIndex = getLastNotDisabledIndex(value);
  340. if (lastNotDisabledIndex < 0)
  341. return;
  342. const removeTagValue = value[lastNotDisabledIndex];
  343. value.splice(lastNotDisabledIndex, 1);
  344. emit(UPDATE_MODEL_EVENT, value);
  345. emitChange(value);
  346. emit("remove-tag", removeTagValue);
  347. }
  348. };
  349. const deleteTag = (event, tag) => {
  350. const index = states.selected.indexOf(tag);
  351. if (index > -1 && !selectDisabled.value) {
  352. const value = castArray(props.modelValue).slice();
  353. value.splice(index, 1);
  354. emit(UPDATE_MODEL_EVENT, value);
  355. emitChange(value);
  356. emit("remove-tag", tag.value);
  357. }
  358. event.stopPropagation();
  359. focus();
  360. };
  361. const deleteSelected = (event) => {
  362. event.stopPropagation();
  363. const value = props.multiple ? [] : valueOnClear.value;
  364. if (props.multiple) {
  365. for (const item of states.selected) {
  366. if (item.isDisabled)
  367. value.push(item.value);
  368. }
  369. }
  370. emit(UPDATE_MODEL_EVENT, value);
  371. emitChange(value);
  372. states.hoveringIndex = -1;
  373. expanded.value = false;
  374. emit("clear");
  375. focus();
  376. };
  377. const handleOptionSelect = (option) => {
  378. var _a;
  379. if (props.multiple) {
  380. const value = castArray((_a = props.modelValue) != null ? _a : []).slice();
  381. const optionIndex = getValueIndex(value, option);
  382. if (optionIndex > -1) {
  383. value.splice(optionIndex, 1);
  384. } else if (props.multipleLimit <= 0 || value.length < props.multipleLimit) {
  385. value.push(option.value);
  386. }
  387. emit(UPDATE_MODEL_EVENT, value);
  388. emitChange(value);
  389. if (option.created) {
  390. handleQueryChange("");
  391. }
  392. if (props.filterable && !props.reserveKeyword) {
  393. states.inputValue = "";
  394. }
  395. } else {
  396. emit(UPDATE_MODEL_EVENT, option.value);
  397. emitChange(option.value);
  398. expanded.value = false;
  399. }
  400. focus();
  401. if (expanded.value)
  402. return;
  403. nextTick(() => {
  404. scrollToOption(option);
  405. });
  406. };
  407. const getValueIndex = (arr, option) => {
  408. if (isUndefined(option))
  409. return -1;
  410. if (!isObject(option.value))
  411. return arr.indexOf(option.value);
  412. return arr.findIndex((item) => {
  413. return isEqual(get(item, props.valueKey), getValueKey(option));
  414. });
  415. };
  416. const scrollToOption = (option) => {
  417. var _a, _b, _c, _d, _e;
  418. const targetOption = isArray(option) ? option[0] : option;
  419. let target = null;
  420. if (targetOption == null ? void 0 : targetOption.value) {
  421. const options = optionsArray.value.filter((item) => item.value === targetOption.value);
  422. if (options.length > 0) {
  423. target = options[0].$el;
  424. }
  425. }
  426. if (tooltipRef.value && target) {
  427. const menu = (_d = (_c = (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef) == null ? void 0 : _c.querySelector) == null ? void 0 : _d.call(_c, `.${nsSelect.be("dropdown", "wrap")}`);
  428. if (menu) {
  429. scrollIntoView(menu, target);
  430. }
  431. }
  432. (_e = scrollbarRef.value) == null ? void 0 : _e.handleScroll();
  433. };
  434. const onOptionCreate = (vm) => {
  435. states.options.set(vm.value, vm);
  436. states.cachedOptions.set(vm.value, vm);
  437. };
  438. const onOptionDestroy = (key, vm) => {
  439. if (states.options.get(key) === vm) {
  440. states.options.delete(key);
  441. }
  442. };
  443. const popperRef = computed(() => {
  444. var _a, _b;
  445. return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
  446. });
  447. const handleMenuEnter = () => {
  448. states.isBeforeHide = false;
  449. nextTick(() => {
  450. var _a;
  451. (_a = scrollbarRef.value) == null ? void 0 : _a.update();
  452. scrollToOption(states.selected);
  453. });
  454. };
  455. const focus = () => {
  456. var _a;
  457. (_a = inputRef.value) == null ? void 0 : _a.focus();
  458. };
  459. const blur = () => {
  460. var _a;
  461. if (expanded.value) {
  462. expanded.value = false;
  463. nextTick(() => {
  464. var _a2;
  465. return (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
  466. });
  467. return;
  468. }
  469. (_a = inputRef.value) == null ? void 0 : _a.blur();
  470. };
  471. const handleClearClick = (event) => {
  472. deleteSelected(event);
  473. };
  474. const handleClickOutside = (event) => {
  475. expanded.value = false;
  476. if (isFocused.value) {
  477. const _event = new FocusEvent("focus", event);
  478. nextTick(() => handleBlur(_event));
  479. }
  480. };
  481. const handleEsc = () => {
  482. if (states.inputValue.length > 0) {
  483. states.inputValue = "";
  484. } else {
  485. expanded.value = false;
  486. }
  487. };
  488. const toggleMenu = () => {
  489. if (selectDisabled.value)
  490. return;
  491. if (isIOS)
  492. states.inputHovering = true;
  493. if (states.menuVisibleOnFocus) {
  494. states.menuVisibleOnFocus = false;
  495. } else {
  496. expanded.value = !expanded.value;
  497. }
  498. };
  499. const selectOption = () => {
  500. if (!expanded.value) {
  501. toggleMenu();
  502. } else {
  503. const option = optionsArray.value[states.hoveringIndex];
  504. if (option && !option.isDisabled) {
  505. handleOptionSelect(option);
  506. }
  507. }
  508. };
  509. const getValueKey = (item) => {
  510. return isObject(item.value) ? get(item.value, props.valueKey) : item.value;
  511. };
  512. const optionsAllDisabled = computed(() => optionsArray.value.filter((option) => option.visible).every((option) => option.isDisabled));
  513. const showTagList = computed(() => {
  514. if (!props.multiple) {
  515. return [];
  516. }
  517. return props.collapseTags ? states.selected.slice(0, props.maxCollapseTags) : states.selected;
  518. });
  519. const collapseTagList = computed(() => {
  520. if (!props.multiple) {
  521. return [];
  522. }
  523. return props.collapseTags ? states.selected.slice(props.maxCollapseTags) : [];
  524. });
  525. const navigateOptions = (direction) => {
  526. if (!expanded.value) {
  527. expanded.value = true;
  528. return;
  529. }
  530. if (states.options.size === 0 || filteredOptionsCount.value === 0 || isComposing.value)
  531. return;
  532. if (!optionsAllDisabled.value) {
  533. if (direction === "next") {
  534. states.hoveringIndex++;
  535. if (states.hoveringIndex === states.options.size) {
  536. states.hoveringIndex = 0;
  537. }
  538. } else if (direction === "prev") {
  539. states.hoveringIndex--;
  540. if (states.hoveringIndex < 0) {
  541. states.hoveringIndex = states.options.size - 1;
  542. }
  543. }
  544. const option = optionsArray.value[states.hoveringIndex];
  545. if (option.isDisabled || !option.visible) {
  546. navigateOptions(direction);
  547. }
  548. nextTick(() => scrollToOption(hoverOption.value));
  549. }
  550. };
  551. const getGapWidth = () => {
  552. if (!selectionRef.value)
  553. return 0;
  554. const style = window.getComputedStyle(selectionRef.value);
  555. return Number.parseFloat(style.gap || "6px");
  556. };
  557. const tagStyle = computed(() => {
  558. const gapWidth = getGapWidth();
  559. const maxWidth = collapseItemRef.value && props.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth : states.selectionWidth;
  560. return { maxWidth: `${maxWidth}px` };
  561. });
  562. const collapseTagStyle = computed(() => {
  563. return { maxWidth: `${states.selectionWidth}px` };
  564. });
  565. const popupScroll = (data) => {
  566. emit("popup-scroll", data);
  567. };
  568. useResizeObserver(selectionRef, resetSelectionWidth);
  569. useResizeObserver(menuRef, updateTooltip);
  570. useResizeObserver(wrapperRef, updateTooltip);
  571. useResizeObserver(tagMenuRef, updateTagTooltip);
  572. useResizeObserver(collapseItemRef, resetCollapseItemWidth);
  573. onMounted(() => {
  574. setSelected();
  575. });
  576. return {
  577. inputId,
  578. contentId,
  579. nsSelect,
  580. nsInput,
  581. states,
  582. isFocused,
  583. expanded,
  584. optionsArray,
  585. hoverOption,
  586. selectSize,
  587. filteredOptionsCount,
  588. updateTooltip,
  589. updateTagTooltip,
  590. debouncedOnInputChange,
  591. onInput,
  592. deletePrevTag,
  593. deleteTag,
  594. deleteSelected,
  595. handleOptionSelect,
  596. scrollToOption,
  597. hasModelValue,
  598. shouldShowPlaceholder,
  599. currentPlaceholder,
  600. mouseEnterEventName,
  601. needStatusIcon,
  602. showClose,
  603. iconComponent,
  604. iconReverse,
  605. validateState,
  606. validateIcon,
  607. showNewOption,
  608. updateOptions,
  609. collapseTagSize,
  610. setSelected,
  611. selectDisabled,
  612. emptyText,
  613. handleCompositionStart,
  614. handleCompositionUpdate,
  615. handleCompositionEnd,
  616. onOptionCreate,
  617. onOptionDestroy,
  618. handleMenuEnter,
  619. focus,
  620. blur,
  621. handleClearClick,
  622. handleClickOutside,
  623. handleEsc,
  624. toggleMenu,
  625. selectOption,
  626. getValueKey,
  627. navigateOptions,
  628. dropdownMenuVisible,
  629. showTagList,
  630. collapseTagList,
  631. popupScroll,
  632. tagStyle,
  633. collapseTagStyle,
  634. popperRef,
  635. inputRef,
  636. tooltipRef,
  637. tagTooltipRef,
  638. prefixRef,
  639. suffixRef,
  640. selectRef,
  641. wrapperRef,
  642. selectionRef,
  643. scrollbarRef,
  644. menuRef,
  645. tagMenuRef,
  646. collapseItemRef
  647. };
  648. };
  649. export { useSelect };
  650. //# sourceMappingURL=useSelect.mjs.map