8c12d6ea7161f035dddaf7459a8c356c242f1b785ba3a5a15ab3a7cfa718835cd74f6b04d148341995063ec3b8ba30c984d316efd5356179c01af274c64261 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. import { defineComponent, getCurrentInstance, computed, reactive, toRefs, watch, provide, onBeforeUnmount, resolveComponent, resolveDirective, withDirectives, openBlock, createElementBlock, normalizeClass, toHandlerKey, createVNode, withCtx, createElementVNode, withModifiers, renderSlot, createCommentVNode, Fragment, renderList, normalizeStyle, createTextVNode, toDisplayString, createBlock, withKeys, vModelText, resolveDynamicComponent, mergeProps, normalizeProps, vShow } from 'vue';
  2. import { ElTooltip } from '../../tooltip/index.mjs';
  3. import { ElScrollbar } from '../../scrollbar/index.mjs';
  4. import { ElTag } from '../../tag/index.mjs';
  5. import { ElIcon } from '../../icon/index.mjs';
  6. import { useProps } from '../../select-v2/src/useProps.mjs';
  7. import Option from './option2.mjs';
  8. import ElSelectMenu from './select-dropdown.mjs';
  9. import { useSelect } from './useSelect.mjs';
  10. import { selectKey } from './token.mjs';
  11. import ElOptions from './options.mjs';
  12. import { selectProps } from './select.mjs';
  13. import OptionGroup from './option-group.mjs';
  14. import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
  15. import ClickOutside from '../../../directives/click-outside/index.mjs';
  16. import { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
  17. import { isArray, isObject } from '@vue/shared';
  18. import { useCalcInputWidth } from '../../../hooks/use-calc-input-width/index.mjs';
  19. import { flattedChildren } from '../../../utils/vue/vnode.mjs';
  20. const COMPONENT_NAME = "ElSelect";
  21. const _sfc_main = defineComponent({
  22. name: COMPONENT_NAME,
  23. componentName: COMPONENT_NAME,
  24. components: {
  25. ElSelectMenu,
  26. ElOption: Option,
  27. ElOptions,
  28. ElOptionGroup: OptionGroup,
  29. ElTag,
  30. ElScrollbar,
  31. ElTooltip,
  32. ElIcon
  33. },
  34. directives: { ClickOutside },
  35. props: selectProps,
  36. emits: [
  37. UPDATE_MODEL_EVENT,
  38. CHANGE_EVENT,
  39. "remove-tag",
  40. "clear",
  41. "visible-change",
  42. "focus",
  43. "blur",
  44. "popup-scroll"
  45. ],
  46. setup(props, { emit, slots }) {
  47. const instance = getCurrentInstance();
  48. instance.appContext.config.warnHandler = (...args) => {
  49. if (!args[0] || args[0].includes('Slot "default" invoked outside of the render function')) {
  50. return;
  51. }
  52. console.warn(...args);
  53. };
  54. const modelValue = computed(() => {
  55. const { modelValue: rawModelValue, multiple } = props;
  56. const fallback = multiple ? [] : void 0;
  57. if (isArray(rawModelValue)) {
  58. return multiple ? rawModelValue : fallback;
  59. }
  60. return multiple ? fallback : rawModelValue;
  61. });
  62. const _props = reactive({
  63. ...toRefs(props),
  64. modelValue
  65. });
  66. const API = useSelect(_props, emit);
  67. const { calculatorRef, inputStyle } = useCalcInputWidth();
  68. const { getLabel, getValue, getOptions, getDisabled } = useProps(props);
  69. const getOptionProps = (option) => ({
  70. label: getLabel(option),
  71. value: getValue(option),
  72. disabled: getDisabled(option)
  73. });
  74. const flatTreeSelectData = (data) => {
  75. return data.reduce((acc, item) => {
  76. acc.push(item);
  77. if (item.children && item.children.length > 0) {
  78. acc.push(...flatTreeSelectData(item.children));
  79. }
  80. return acc;
  81. }, []);
  82. };
  83. const manuallyRenderSlots = (vnodes) => {
  84. const children = flattedChildren(vnodes || []);
  85. children.forEach((item) => {
  86. var _a;
  87. if (isObject(item) && (item.type.name === "ElOption" || item.type.name === "ElTree")) {
  88. const _name = item.type.name;
  89. if (_name === "ElTree") {
  90. const treeData = ((_a = item.props) == null ? void 0 : _a.data) || [];
  91. const flatData = flatTreeSelectData(treeData);
  92. flatData.forEach((treeItem) => {
  93. treeItem.currentLabel = treeItem.label || (isObject(treeItem.value) ? "" : treeItem.value);
  94. API.onOptionCreate(treeItem);
  95. });
  96. } else if (_name === "ElOption") {
  97. const obj = { ...item.props };
  98. obj.currentLabel = obj.label || (isObject(obj.value) ? "" : obj.value);
  99. API.onOptionCreate(obj);
  100. }
  101. }
  102. });
  103. };
  104. watch(() => {
  105. var _a;
  106. const slotsContent = (_a = slots.default) == null ? void 0 : _a.call(slots);
  107. return slotsContent;
  108. }, (newSlot) => {
  109. if (props.persistent) {
  110. return;
  111. }
  112. manuallyRenderSlots(newSlot);
  113. }, {
  114. immediate: true
  115. });
  116. provide(selectKey, reactive({
  117. props: _props,
  118. states: API.states,
  119. selectRef: API.selectRef,
  120. optionsArray: API.optionsArray,
  121. setSelected: API.setSelected,
  122. handleOptionSelect: API.handleOptionSelect,
  123. onOptionCreate: API.onOptionCreate,
  124. onOptionDestroy: API.onOptionDestroy
  125. }));
  126. const selectedLabel = computed(() => {
  127. if (!props.multiple) {
  128. return API.states.selectedLabel;
  129. }
  130. return API.states.selected.map((i) => i.currentLabel);
  131. });
  132. onBeforeUnmount(() => {
  133. instance.appContext.config.warnHandler = void 0;
  134. });
  135. return {
  136. ...API,
  137. modelValue,
  138. selectedLabel,
  139. calculatorRef,
  140. inputStyle,
  141. getLabel,
  142. getValue,
  143. getOptions,
  144. getDisabled,
  145. getOptionProps
  146. };
  147. }
  148. });
  149. function _sfc_render(_ctx, _cache) {
  150. const _component_el_tag = resolveComponent("el-tag");
  151. const _component_el_tooltip = resolveComponent("el-tooltip");
  152. const _component_el_icon = resolveComponent("el-icon");
  153. const _component_el_option = resolveComponent("el-option");
  154. const _component_el_option_group = resolveComponent("el-option-group");
  155. const _component_el_options = resolveComponent("el-options");
  156. const _component_el_scrollbar = resolveComponent("el-scrollbar");
  157. const _component_el_select_menu = resolveComponent("el-select-menu");
  158. const _directive_click_outside = resolveDirective("click-outside");
  159. return withDirectives((openBlock(), createElementBlock("div", {
  160. ref: "selectRef",
  161. class: normalizeClass([_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]),
  162. [toHandlerKey(_ctx.mouseEnterEventName)]: ($event) => _ctx.states.inputHovering = true,
  163. onMouseleave: ($event) => _ctx.states.inputHovering = false
  164. }, [
  165. createVNode(_component_el_tooltip, {
  166. ref: "tooltipRef",
  167. visible: _ctx.dropdownMenuVisible,
  168. placement: _ctx.placement,
  169. teleported: _ctx.teleported,
  170. "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
  171. "popper-style": _ctx.popperStyle,
  172. "popper-options": _ctx.popperOptions,
  173. "fallback-placements": _ctx.fallbackPlacements,
  174. effect: _ctx.effect,
  175. pure: "",
  176. trigger: "click",
  177. transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
  178. "stop-popper-mouse-event": false,
  179. "gpu-acceleration": false,
  180. persistent: _ctx.persistent,
  181. "append-to": _ctx.appendTo,
  182. "show-arrow": _ctx.showArrow,
  183. offset: _ctx.offset,
  184. onBeforeShow: _ctx.handleMenuEnter,
  185. onHide: ($event) => _ctx.states.isBeforeHide = false
  186. }, {
  187. default: withCtx(() => {
  188. var _a;
  189. return [
  190. createElementVNode("div", {
  191. ref: "wrapperRef",
  192. class: normalizeClass([
  193. _ctx.nsSelect.e("wrapper"),
  194. _ctx.nsSelect.is("focused", _ctx.isFocused),
  195. _ctx.nsSelect.is("hovering", _ctx.states.inputHovering),
  196. _ctx.nsSelect.is("filterable", _ctx.filterable),
  197. _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
  198. ]),
  199. onClick: withModifiers(_ctx.toggleMenu, ["prevent"])
  200. }, [
  201. _ctx.$slots.prefix ? (openBlock(), createElementBlock("div", {
  202. key: 0,
  203. ref: "prefixRef",
  204. class: normalizeClass(_ctx.nsSelect.e("prefix"))
  205. }, [
  206. renderSlot(_ctx.$slots, "prefix")
  207. ], 2)) : createCommentVNode("v-if", true),
  208. createElementVNode("div", {
  209. ref: "selectionRef",
  210. class: normalizeClass([
  211. _ctx.nsSelect.e("selection"),
  212. _ctx.nsSelect.is("near", _ctx.multiple && !_ctx.$slots.prefix && !!_ctx.states.selected.length)
  213. ])
  214. }, [
  215. _ctx.multiple ? renderSlot(_ctx.$slots, "tag", {
  216. key: 0,
  217. data: _ctx.states.selected,
  218. deleteTag: _ctx.deleteTag,
  219. selectDisabled: _ctx.selectDisabled
  220. }, () => [
  221. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.showTagList, (item) => {
  222. return openBlock(), createElementBlock("div", {
  223. key: _ctx.getValueKey(item),
  224. class: normalizeClass(_ctx.nsSelect.e("selected-item"))
  225. }, [
  226. createVNode(_component_el_tag, {
  227. closable: !_ctx.selectDisabled && !item.isDisabled,
  228. size: _ctx.collapseTagSize,
  229. type: _ctx.tagType,
  230. effect: _ctx.tagEffect,
  231. "disable-transitions": "",
  232. style: normalizeStyle(_ctx.tagStyle),
  233. onClose: ($event) => _ctx.deleteTag($event, item)
  234. }, {
  235. default: withCtx(() => [
  236. createElementVNode("span", {
  237. class: normalizeClass(_ctx.nsSelect.e("tags-text"))
  238. }, [
  239. renderSlot(_ctx.$slots, "label", {
  240. index: item.index,
  241. label: item.currentLabel,
  242. value: item.value
  243. }, () => [
  244. createTextVNode(toDisplayString(item.currentLabel), 1)
  245. ])
  246. ], 2)
  247. ]),
  248. _: 2
  249. }, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
  250. ], 2);
  251. }), 128)),
  252. _ctx.collapseTags && _ctx.states.selected.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tooltip, {
  253. key: 0,
  254. ref: "tagTooltipRef",
  255. disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip,
  256. "fallback-placements": ["bottom", "top", "right", "left"],
  257. effect: _ctx.effect,
  258. placement: "bottom",
  259. "popper-class": _ctx.popperClass,
  260. "popper-style": _ctx.popperStyle,
  261. teleported: _ctx.teleported
  262. }, {
  263. default: withCtx(() => [
  264. createElementVNode("div", {
  265. ref: "collapseItemRef",
  266. class: normalizeClass(_ctx.nsSelect.e("selected-item"))
  267. }, [
  268. createVNode(_component_el_tag, {
  269. closable: false,
  270. size: _ctx.collapseTagSize,
  271. type: _ctx.tagType,
  272. effect: _ctx.tagEffect,
  273. "disable-transitions": "",
  274. style: normalizeStyle(_ctx.collapseTagStyle)
  275. }, {
  276. default: withCtx(() => [
  277. createElementVNode("span", {
  278. class: normalizeClass(_ctx.nsSelect.e("tags-text"))
  279. }, " + " + toDisplayString(_ctx.states.selected.length - _ctx.maxCollapseTags), 3)
  280. ]),
  281. _: 1
  282. }, 8, ["size", "type", "effect", "style"])
  283. ], 2)
  284. ]),
  285. content: withCtx(() => [
  286. createElementVNode("div", {
  287. ref: "tagMenuRef",
  288. class: normalizeClass(_ctx.nsSelect.e("selection"))
  289. }, [
  290. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.collapseTagList, (item) => {
  291. return openBlock(), createElementBlock("div", {
  292. key: _ctx.getValueKey(item),
  293. class: normalizeClass(_ctx.nsSelect.e("selected-item"))
  294. }, [
  295. createVNode(_component_el_tag, {
  296. class: "in-tooltip",
  297. closable: !_ctx.selectDisabled && !item.isDisabled,
  298. size: _ctx.collapseTagSize,
  299. type: _ctx.tagType,
  300. effect: _ctx.tagEffect,
  301. "disable-transitions": "",
  302. onClose: ($event) => _ctx.deleteTag($event, item)
  303. }, {
  304. default: withCtx(() => [
  305. createElementVNode("span", {
  306. class: normalizeClass(_ctx.nsSelect.e("tags-text"))
  307. }, [
  308. renderSlot(_ctx.$slots, "label", {
  309. index: item.index,
  310. label: item.currentLabel,
  311. value: item.value
  312. }, () => [
  313. createTextVNode(toDisplayString(item.currentLabel), 1)
  314. ])
  315. ], 2)
  316. ]),
  317. _: 2
  318. }, 1032, ["closable", "size", "type", "effect", "onClose"])
  319. ], 2);
  320. }), 128))
  321. ], 2)
  322. ]),
  323. _: 3
  324. }, 8, ["disabled", "effect", "popper-class", "popper-style", "teleported"])) : createCommentVNode("v-if", true)
  325. ]) : createCommentVNode("v-if", true),
  326. createElementVNode("div", {
  327. class: normalizeClass([
  328. _ctx.nsSelect.e("selected-item"),
  329. _ctx.nsSelect.e("input-wrapper"),
  330. _ctx.nsSelect.is("hidden", !_ctx.filterable)
  331. ])
  332. }, [
  333. withDirectives(createElementVNode("input", {
  334. id: _ctx.inputId,
  335. ref: "inputRef",
  336. "onUpdate:modelValue": ($event) => _ctx.states.inputValue = $event,
  337. type: "text",
  338. name: _ctx.name,
  339. class: normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
  340. disabled: _ctx.selectDisabled,
  341. autocomplete: _ctx.autocomplete,
  342. style: normalizeStyle(_ctx.inputStyle),
  343. tabindex: _ctx.tabindex,
  344. role: "combobox",
  345. readonly: !_ctx.filterable,
  346. spellcheck: "false",
  347. "aria-activedescendant": ((_a = _ctx.hoverOption) == null ? void 0 : _a.id) || "",
  348. "aria-controls": _ctx.contentId,
  349. "aria-expanded": _ctx.dropdownMenuVisible,
  350. "aria-label": _ctx.ariaLabel,
  351. "aria-autocomplete": "none",
  352. "aria-haspopup": "listbox",
  353. onKeydown: [
  354. withKeys(withModifiers(($event) => _ctx.navigateOptions("next"), ["stop", "prevent"]), ["down"]),
  355. withKeys(withModifiers(($event) => _ctx.navigateOptions("prev"), ["stop", "prevent"]), ["up"]),
  356. withKeys(withModifiers(_ctx.handleEsc, ["stop", "prevent"]), ["esc"]),
  357. withKeys(withModifiers(_ctx.selectOption, ["stop", "prevent"]), ["enter"]),
  358. withKeys(withModifiers(_ctx.deletePrevTag, ["stop"]), ["delete"])
  359. ],
  360. onCompositionstart: _ctx.handleCompositionStart,
  361. onCompositionupdate: _ctx.handleCompositionUpdate,
  362. onCompositionend: _ctx.handleCompositionEnd,
  363. onInput: _ctx.onInput,
  364. onClick: withModifiers(_ctx.toggleMenu, ["stop"])
  365. }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "tabindex", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [
  366. [vModelText, _ctx.states.inputValue]
  367. ]),
  368. _ctx.filterable ? (openBlock(), createElementBlock("span", {
  369. key: 0,
  370. ref: "calculatorRef",
  371. "aria-hidden": "true",
  372. class: normalizeClass(_ctx.nsSelect.e("input-calculator")),
  373. textContent: toDisplayString(_ctx.states.inputValue)
  374. }, null, 10, ["textContent"])) : createCommentVNode("v-if", true)
  375. ], 2),
  376. _ctx.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", {
  377. key: 1,
  378. class: normalizeClass([
  379. _ctx.nsSelect.e("selected-item"),
  380. _ctx.nsSelect.e("placeholder"),
  381. _ctx.nsSelect.is("transparent", !_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue)
  382. ])
  383. }, [
  384. _ctx.hasModelValue ? renderSlot(_ctx.$slots, "label", {
  385. key: 0,
  386. index: _ctx.getOption(_ctx.modelValue).index,
  387. label: _ctx.currentPlaceholder,
  388. value: _ctx.modelValue
  389. }, () => [
  390. createElementVNode("span", null, toDisplayString(_ctx.currentPlaceholder), 1)
  391. ]) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(_ctx.currentPlaceholder), 1))
  392. ], 2)) : createCommentVNode("v-if", true)
  393. ], 2),
  394. createElementVNode("div", {
  395. ref: "suffixRef",
  396. class: normalizeClass(_ctx.nsSelect.e("suffix"))
  397. }, [
  398. _ctx.iconComponent && !_ctx.showClearBtn ? (openBlock(), createBlock(_component_el_icon, {
  399. key: 0,
  400. class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon"), _ctx.iconReverse])
  401. }, {
  402. default: withCtx(() => [
  403. (openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
  404. ]),
  405. _: 1
  406. }, 8, ["class"])) : createCommentVNode("v-if", true),
  407. _ctx.showClearBtn && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
  408. key: 1,
  409. class: normalizeClass([
  410. _ctx.nsSelect.e("caret"),
  411. _ctx.nsSelect.e("icon"),
  412. _ctx.nsSelect.e("clear")
  413. ]),
  414. onClick: _ctx.handleClearClick
  415. }, {
  416. default: withCtx(() => [
  417. (openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
  418. ]),
  419. _: 1
  420. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
  421. _ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (openBlock(), createBlock(_component_el_icon, {
  422. key: 2,
  423. class: normalizeClass([
  424. _ctx.nsInput.e("icon"),
  425. _ctx.nsInput.e("validateIcon"),
  426. _ctx.nsInput.is("loading", _ctx.validateState === "validating")
  427. ])
  428. }, {
  429. default: withCtx(() => [
  430. (openBlock(), createBlock(resolveDynamicComponent(_ctx.validateIcon)))
  431. ]),
  432. _: 1
  433. }, 8, ["class"])) : createCommentVNode("v-if", true)
  434. ], 2)
  435. ], 10, ["onClick"])
  436. ];
  437. }),
  438. content: withCtx(() => [
  439. createVNode(_component_el_select_menu, { ref: "menuRef" }, {
  440. default: withCtx(() => [
  441. _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
  442. key: 0,
  443. class: normalizeClass(_ctx.nsSelect.be("dropdown", "header")),
  444. onClick: withModifiers(() => {
  445. }, ["stop"])
  446. }, [
  447. renderSlot(_ctx.$slots, "header")
  448. ], 10, ["onClick"])) : createCommentVNode("v-if", true),
  449. withDirectives(createVNode(_component_el_scrollbar, {
  450. id: _ctx.contentId,
  451. ref: "scrollbarRef",
  452. tag: "ul",
  453. "wrap-class": _ctx.nsSelect.be("dropdown", "wrap"),
  454. "view-class": _ctx.nsSelect.be("dropdown", "list"),
  455. class: normalizeClass([_ctx.nsSelect.is("empty", _ctx.filteredOptionsCount === 0)]),
  456. role: "listbox",
  457. "aria-label": _ctx.ariaLabel,
  458. "aria-orientation": "vertical",
  459. onScroll: _ctx.popupScroll
  460. }, {
  461. default: withCtx(() => [
  462. _ctx.showNewOption ? (openBlock(), createBlock(_component_el_option, {
  463. key: 0,
  464. value: _ctx.states.inputValue,
  465. created: true
  466. }, null, 8, ["value"])) : createCommentVNode("v-if", true),
  467. createVNode(_component_el_options, null, {
  468. default: withCtx(() => [
  469. renderSlot(_ctx.$slots, "default", {}, () => [
  470. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index) => {
  471. var _a;
  472. return openBlock(), createElementBlock(Fragment, { key: index }, [
  473. ((_a = _ctx.getOptions(option)) == null ? void 0 : _a.length) ? (openBlock(), createBlock(_component_el_option_group, {
  474. key: 0,
  475. label: _ctx.getLabel(option),
  476. disabled: _ctx.getDisabled(option)
  477. }, {
  478. default: withCtx(() => [
  479. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.getOptions(option), (item) => {
  480. return openBlock(), createBlock(_component_el_option, mergeProps({
  481. key: _ctx.getValue(item)
  482. }, _ctx.getOptionProps(item)), null, 16);
  483. }), 128))
  484. ]),
  485. _: 2
  486. }, 1032, ["label", "disabled"])) : (openBlock(), createBlock(_component_el_option, normalizeProps(mergeProps({ key: 1 }, _ctx.getOptionProps(option))), null, 16))
  487. ], 64);
  488. }), 128))
  489. ])
  490. ]),
  491. _: 3
  492. })
  493. ]),
  494. _: 3
  495. }, 8, ["id", "wrap-class", "view-class", "class", "aria-label", "onScroll"]), [
  496. [vShow, _ctx.states.options.size > 0 && !_ctx.loading]
  497. ]),
  498. _ctx.$slots.loading && _ctx.loading ? (openBlock(), createElementBlock("div", {
  499. key: 1,
  500. class: normalizeClass(_ctx.nsSelect.be("dropdown", "loading"))
  501. }, [
  502. renderSlot(_ctx.$slots, "loading")
  503. ], 2)) : _ctx.loading || _ctx.filteredOptionsCount === 0 ? (openBlock(), createElementBlock("div", {
  504. key: 2,
  505. class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
  506. }, [
  507. renderSlot(_ctx.$slots, "empty", {}, () => [
  508. createElementVNode("span", null, toDisplayString(_ctx.emptyText), 1)
  509. ])
  510. ], 2)) : createCommentVNode("v-if", true),
  511. _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
  512. key: 3,
  513. class: normalizeClass(_ctx.nsSelect.be("dropdown", "footer")),
  514. onClick: withModifiers(() => {
  515. }, ["stop"])
  516. }, [
  517. renderSlot(_ctx.$slots, "footer")
  518. ], 10, ["onClick"])) : createCommentVNode("v-if", true)
  519. ]),
  520. _: 3
  521. }, 512)
  522. ]),
  523. _: 3
  524. }, 8, ["visible", "placement", "teleported", "popper-class", "popper-style", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow", "onHide"])
  525. ], 16, ["onMouseleave"])), [
  526. [_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
  527. ]);
  528. }
  529. var Select = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "select.vue"]]);
  530. export { Select as default };
  531. //# sourceMappingURL=select2.mjs.map