8d6675f93c3de5e508840f9e8d12c880922d0b4f1a8bade0f4656eb9f83b425f25bb0bbb6b877613702490f38e2eb179146ffbbc4fbb4b91970dc8e7f728c2 25 KB

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