select.js 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216
  1. module.exports =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // define getter function for harmony exports
  38. /******/ __webpack_require__.d = function(exports, name, getter) {
  39. /******/ if(!__webpack_require__.o(exports, name)) {
  40. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41. /******/ }
  42. /******/ };
  43. /******/
  44. /******/ // define __esModule on exports
  45. /******/ __webpack_require__.r = function(exports) {
  46. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48. /******/ }
  49. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  50. /******/ };
  51. /******/
  52. /******/ // create a fake namespace object
  53. /******/ // mode & 1: value is a module id, require it
  54. /******/ // mode & 2: merge all properties of value into the ns
  55. /******/ // mode & 4: return value when already ns object
  56. /******/ // mode & 8|1: behave like require
  57. /******/ __webpack_require__.t = function(value, mode) {
  58. /******/ if(mode & 1) value = __webpack_require__(value);
  59. /******/ if(mode & 8) return value;
  60. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61. /******/ var ns = Object.create(null);
  62. /******/ __webpack_require__.r(ns);
  63. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65. /******/ return ns;
  66. /******/ };
  67. /******/
  68. /******/ // getDefaultExport function for compatibility with non-harmony modules
  69. /******/ __webpack_require__.n = function(module) {
  70. /******/ var getter = module && module.__esModule ?
  71. /******/ function getDefault() { return module['default']; } :
  72. /******/ function getModuleExports() { return module; };
  73. /******/ __webpack_require__.d(getter, 'a', getter);
  74. /******/ return getter;
  75. /******/ };
  76. /******/
  77. /******/ // Object.prototype.hasOwnProperty.call
  78. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79. /******/
  80. /******/ // __webpack_public_path__
  81. /******/ __webpack_require__.p = "/dist/";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = 61);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ([
  89. /* 0 */
  90. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91. "use strict";
  92. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
  93. /* globals __VUE_SSR_CONTEXT__ */
  94. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  95. // This module is a runtime utility for cleaner component module output and will
  96. // be included in the final webpack user bundle.
  97. function normalizeComponent (
  98. scriptExports,
  99. render,
  100. staticRenderFns,
  101. functionalTemplate,
  102. injectStyles,
  103. scopeId,
  104. moduleIdentifier, /* server only */
  105. shadowMode /* vue-cli only */
  106. ) {
  107. // Vue.extend constructor export interop
  108. var options = typeof scriptExports === 'function'
  109. ? scriptExports.options
  110. : scriptExports
  111. // render functions
  112. if (render) {
  113. options.render = render
  114. options.staticRenderFns = staticRenderFns
  115. options._compiled = true
  116. }
  117. // functional template
  118. if (functionalTemplate) {
  119. options.functional = true
  120. }
  121. // scopedId
  122. if (scopeId) {
  123. options._scopeId = 'data-v-' + scopeId
  124. }
  125. var hook
  126. if (moduleIdentifier) { // server build
  127. hook = function (context) {
  128. // 2.3 injection
  129. context =
  130. context || // cached call
  131. (this.$vnode && this.$vnode.ssrContext) || // stateful
  132. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  133. // 2.2 with runInNewContext: true
  134. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  135. context = __VUE_SSR_CONTEXT__
  136. }
  137. // inject component styles
  138. if (injectStyles) {
  139. injectStyles.call(this, context)
  140. }
  141. // register component module identifier for async chunk inferrence
  142. if (context && context._registeredComponents) {
  143. context._registeredComponents.add(moduleIdentifier)
  144. }
  145. }
  146. // used by ssr in case component is cached and beforeCreate
  147. // never gets called
  148. options._ssrRegister = hook
  149. } else if (injectStyles) {
  150. hook = shadowMode
  151. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  152. : injectStyles
  153. }
  154. if (hook) {
  155. if (options.functional) {
  156. // for template-only hot-reload because in that case the render fn doesn't
  157. // go through the normalizer
  158. options._injectStyles = hook
  159. // register for functioal component in vue file
  160. var originalRender = options.render
  161. options.render = function renderWithStyleInjection (h, context) {
  162. hook.call(context)
  163. return originalRender(h, context)
  164. }
  165. } else {
  166. // inject component registration as beforeCreate hook
  167. var existing = options.beforeCreate
  168. options.beforeCreate = existing
  169. ? [].concat(existing, hook)
  170. : [hook]
  171. }
  172. }
  173. return {
  174. exports: scriptExports,
  175. options: options
  176. }
  177. }
  178. /***/ }),
  179. /* 1 */,
  180. /* 2 */,
  181. /* 3 */
  182. /***/ (function(module, exports) {
  183. module.exports = require("element-ui/lib/utils/util");
  184. /***/ }),
  185. /* 4 */
  186. /***/ (function(module, exports) {
  187. module.exports = require("element-ui/lib/mixins/emitter");
  188. /***/ }),
  189. /* 5 */
  190. /***/ (function(module, exports) {
  191. module.exports = require("element-ui/lib/utils/vue-popper");
  192. /***/ }),
  193. /* 6 */
  194. /***/ (function(module, exports) {
  195. module.exports = require("element-ui/lib/mixins/locale");
  196. /***/ }),
  197. /* 7 */,
  198. /* 8 */,
  199. /* 9 */,
  200. /* 10 */
  201. /***/ (function(module, exports) {
  202. module.exports = require("element-ui/lib/input");
  203. /***/ }),
  204. /* 11 */,
  205. /* 12 */
  206. /***/ (function(module, exports) {
  207. module.exports = require("element-ui/lib/utils/clickoutside");
  208. /***/ }),
  209. /* 13 */,
  210. /* 14 */
  211. /***/ (function(module, exports) {
  212. module.exports = require("element-ui/lib/scrollbar");
  213. /***/ }),
  214. /* 15 */,
  215. /* 16 */
  216. /***/ (function(module, exports) {
  217. module.exports = require("element-ui/lib/utils/resize-event");
  218. /***/ }),
  219. /* 17 */
  220. /***/ (function(module, exports) {
  221. module.exports = require("throttle-debounce/debounce");
  222. /***/ }),
  223. /* 18 */,
  224. /* 19 */
  225. /***/ (function(module, exports) {
  226. module.exports = require("element-ui/lib/locale");
  227. /***/ }),
  228. /* 20 */,
  229. /* 21 */
  230. /***/ (function(module, exports) {
  231. module.exports = require("element-ui/lib/utils/shared");
  232. /***/ }),
  233. /* 22 */
  234. /***/ (function(module, exports) {
  235. module.exports = require("element-ui/lib/mixins/focus");
  236. /***/ }),
  237. /* 23 */,
  238. /* 24 */,
  239. /* 25 */,
  240. /* 26 */,
  241. /* 27 */,
  242. /* 28 */,
  243. /* 29 */,
  244. /* 30 */,
  245. /* 31 */
  246. /***/ (function(module, exports) {
  247. module.exports = require("element-ui/lib/utils/scroll-into-view");
  248. /***/ }),
  249. /* 32 */,
  250. /* 33 */,
  251. /* 34 */
  252. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  253. "use strict";
  254. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/option.vue?vue&type=template&id=7a44c642&
  255. var render = function() {
  256. var _vm = this
  257. var _h = _vm.$createElement
  258. var _c = _vm._self._c || _h
  259. return _c(
  260. "li",
  261. {
  262. directives: [
  263. {
  264. name: "show",
  265. rawName: "v-show",
  266. value: _vm.visible,
  267. expression: "visible"
  268. }
  269. ],
  270. staticClass: "el-select-dropdown__item",
  271. class: {
  272. selected: _vm.itemSelected,
  273. "is-disabled": _vm.disabled || _vm.groupDisabled || _vm.limitReached,
  274. hover: _vm.hover
  275. },
  276. on: {
  277. mouseenter: _vm.hoverItem,
  278. click: function($event) {
  279. $event.stopPropagation()
  280. return _vm.selectOptionClick($event)
  281. }
  282. }
  283. },
  284. [_vm._t("default", [_c("span", [_vm._v(_vm._s(_vm.currentLabel))])])],
  285. 2
  286. )
  287. }
  288. var staticRenderFns = []
  289. render._withStripped = true
  290. // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=template&id=7a44c642&
  291. // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
  292. var emitter_ = __webpack_require__(4);
  293. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  294. // EXTERNAL MODULE: external "element-ui/lib/utils/util"
  295. var util_ = __webpack_require__(3);
  296. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/option.vue?vue&type=script&lang=js&
  297. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  298. //
  299. //
  300. //
  301. //
  302. //
  303. //
  304. //
  305. //
  306. //
  307. //
  308. //
  309. //
  310. //
  311. //
  312. //
  313. //
  314. //
  315. /* harmony default export */ var optionvue_type_script_lang_js_ = ({
  316. mixins: [emitter_default.a],
  317. name: 'ElOption',
  318. componentName: 'ElOption',
  319. inject: ['select'],
  320. props: {
  321. value: {
  322. required: true
  323. },
  324. label: [String, Number],
  325. created: Boolean,
  326. disabled: {
  327. type: Boolean,
  328. default: false
  329. }
  330. },
  331. data: function data() {
  332. return {
  333. index: -1,
  334. groupDisabled: false,
  335. visible: true,
  336. hitState: false,
  337. hover: false
  338. };
  339. },
  340. computed: {
  341. isObject: function isObject() {
  342. return Object.prototype.toString.call(this.value).toLowerCase() === '[object object]';
  343. },
  344. currentLabel: function currentLabel() {
  345. return this.label || (this.isObject ? '' : this.value);
  346. },
  347. currentValue: function currentValue() {
  348. return this.value || this.label || '';
  349. },
  350. itemSelected: function itemSelected() {
  351. if (!this.select.multiple) {
  352. return this.isEqual(this.value, this.select.value);
  353. } else {
  354. return this.contains(this.select.value, this.value);
  355. }
  356. },
  357. limitReached: function limitReached() {
  358. if (this.select.multiple) {
  359. return !this.itemSelected && (this.select.value || []).length >= this.select.multipleLimit && this.select.multipleLimit > 0;
  360. } else {
  361. return false;
  362. }
  363. }
  364. },
  365. watch: {
  366. currentLabel: function currentLabel() {
  367. if (!this.created && !this.select.remote) this.dispatch('ElSelect', 'setSelected');
  368. },
  369. value: function value(val, oldVal) {
  370. var _select = this.select,
  371. remote = _select.remote,
  372. valueKey = _select.valueKey;
  373. if (!this.created && !remote) {
  374. if (valueKey && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && (typeof oldVal === 'undefined' ? 'undefined' : _typeof(oldVal)) === 'object' && val[valueKey] === oldVal[valueKey]) {
  375. return;
  376. }
  377. this.dispatch('ElSelect', 'setSelected');
  378. }
  379. }
  380. },
  381. methods: {
  382. isEqual: function isEqual(a, b) {
  383. if (!this.isObject) {
  384. return a === b;
  385. } else {
  386. var valueKey = this.select.valueKey;
  387. return Object(util_["getValueByPath"])(a, valueKey) === Object(util_["getValueByPath"])(b, valueKey);
  388. }
  389. },
  390. contains: function contains() {
  391. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  392. var target = arguments[1];
  393. if (!this.isObject) {
  394. return arr && arr.indexOf(target) > -1;
  395. } else {
  396. var valueKey = this.select.valueKey;
  397. return arr && arr.some(function (item) {
  398. return Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(target, valueKey);
  399. });
  400. }
  401. },
  402. handleGroupDisabled: function handleGroupDisabled(val) {
  403. this.groupDisabled = val;
  404. },
  405. hoverItem: function hoverItem() {
  406. if (!this.disabled && !this.groupDisabled) {
  407. this.select.hoverIndex = this.select.options.indexOf(this);
  408. }
  409. },
  410. selectOptionClick: function selectOptionClick() {
  411. if (this.disabled !== true && this.groupDisabled !== true) {
  412. this.dispatch('ElSelect', 'handleOptionClick', [this, true]);
  413. }
  414. },
  415. queryChange: function queryChange(query) {
  416. this.visible = new RegExp(Object(util_["escapeRegexpString"])(query), 'i').test(this.currentLabel) || this.created;
  417. if (!this.visible) {
  418. this.select.filteredOptionsCount--;
  419. }
  420. }
  421. },
  422. created: function created() {
  423. this.select.options.push(this);
  424. this.select.cachedOptions.push(this);
  425. this.select.optionsCount++;
  426. this.select.filteredOptionsCount++;
  427. this.$on('queryChange', this.queryChange);
  428. this.$on('handleGroupDisabled', this.handleGroupDisabled);
  429. },
  430. beforeDestroy: function beforeDestroy() {
  431. var _select2 = this.select,
  432. selected = _select2.selected,
  433. multiple = _select2.multiple;
  434. var selectedOptions = multiple ? selected : [selected];
  435. var index = this.select.cachedOptions.indexOf(this);
  436. var selectedIndex = selectedOptions.indexOf(this);
  437. // if option is not selected, remove it from cache
  438. if (index > -1 && selectedIndex < 0) {
  439. this.select.cachedOptions.splice(index, 1);
  440. }
  441. this.select.onOptionDestroy(this.select.options.indexOf(this));
  442. }
  443. });
  444. // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=script&lang=js&
  445. /* harmony default export */ var src_optionvue_type_script_lang_js_ = (optionvue_type_script_lang_js_);
  446. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  447. var componentNormalizer = __webpack_require__(0);
  448. // CONCATENATED MODULE: ./packages/select/src/option.vue
  449. /* normalize component */
  450. var component = Object(componentNormalizer["a" /* default */])(
  451. src_optionvue_type_script_lang_js_,
  452. render,
  453. staticRenderFns,
  454. false,
  455. null,
  456. null,
  457. null
  458. )
  459. /* hot reload */
  460. if (false) { var api; }
  461. component.options.__file = "packages/select/src/option.vue"
  462. /* harmony default export */ var src_option = __webpack_exports__["a"] = (component.exports);
  463. /***/ }),
  464. /* 35 */,
  465. /* 36 */,
  466. /* 37 */,
  467. /* 38 */
  468. /***/ (function(module, exports) {
  469. module.exports = require("element-ui/lib/tag");
  470. /***/ }),
  471. /* 39 */,
  472. /* 40 */,
  473. /* 41 */,
  474. /* 42 */,
  475. /* 43 */,
  476. /* 44 */,
  477. /* 45 */,
  478. /* 46 */,
  479. /* 47 */,
  480. /* 48 */,
  481. /* 49 */,
  482. /* 50 */,
  483. /* 51 */,
  484. /* 52 */,
  485. /* 53 */,
  486. /* 54 */,
  487. /* 55 */,
  488. /* 56 */,
  489. /* 57 */,
  490. /* 58 */,
  491. /* 59 */,
  492. /* 60 */,
  493. /* 61 */
  494. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  495. "use strict";
  496. __webpack_require__.r(__webpack_exports__);
  497. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select.vue?vue&type=template&id=0e4aade6&
  498. var render = function() {
  499. var _vm = this
  500. var _h = _vm.$createElement
  501. var _c = _vm._self._c || _h
  502. return _c(
  503. "div",
  504. {
  505. directives: [
  506. {
  507. name: "clickoutside",
  508. rawName: "v-clickoutside",
  509. value: _vm.handleClose,
  510. expression: "handleClose"
  511. }
  512. ],
  513. staticClass: "el-select",
  514. class: [_vm.selectSize ? "el-select--" + _vm.selectSize : ""],
  515. on: {
  516. click: function($event) {
  517. $event.stopPropagation()
  518. return _vm.toggleMenu($event)
  519. }
  520. }
  521. },
  522. [
  523. _vm.multiple
  524. ? _c(
  525. "div",
  526. {
  527. ref: "tags",
  528. staticClass: "el-select__tags",
  529. style: { "max-width": _vm.inputWidth - 32 + "px", width: "100%" }
  530. },
  531. [
  532. _vm.collapseTags && _vm.selected.length
  533. ? _c(
  534. "span",
  535. [
  536. _c(
  537. "el-tag",
  538. {
  539. attrs: {
  540. closable: !_vm.selectDisabled,
  541. size: _vm.collapseTagSize,
  542. hit: _vm.selected[0].hitState,
  543. type: "info",
  544. "disable-transitions": ""
  545. },
  546. on: {
  547. close: function($event) {
  548. _vm.deleteTag($event, _vm.selected[0])
  549. }
  550. }
  551. },
  552. [
  553. _c("span", { staticClass: "el-select__tags-text" }, [
  554. _vm._v(_vm._s(_vm.selected[0].currentLabel))
  555. ])
  556. ]
  557. ),
  558. _vm.selected.length > 1
  559. ? _c(
  560. "el-tag",
  561. {
  562. attrs: {
  563. closable: false,
  564. size: _vm.collapseTagSize,
  565. type: "info",
  566. "disable-transitions": ""
  567. }
  568. },
  569. [
  570. _c(
  571. "span",
  572. { staticClass: "el-select__tags-text" },
  573. [_vm._v("+ " + _vm._s(_vm.selected.length - 1))]
  574. )
  575. ]
  576. )
  577. : _vm._e()
  578. ],
  579. 1
  580. )
  581. : _vm._e(),
  582. !_vm.collapseTags
  583. ? _c(
  584. "transition-group",
  585. { on: { "after-leave": _vm.resetInputHeight } },
  586. _vm._l(_vm.selected, function(item) {
  587. return _c(
  588. "el-tag",
  589. {
  590. key: _vm.getValueKey(item),
  591. attrs: {
  592. closable: !_vm.selectDisabled,
  593. size: _vm.collapseTagSize,
  594. hit: item.hitState,
  595. type: "info",
  596. "disable-transitions": ""
  597. },
  598. on: {
  599. close: function($event) {
  600. _vm.deleteTag($event, item)
  601. }
  602. }
  603. },
  604. [
  605. _c("span", { staticClass: "el-select__tags-text" }, [
  606. _vm._v(_vm._s(item.currentLabel))
  607. ])
  608. ]
  609. )
  610. }),
  611. 1
  612. )
  613. : _vm._e(),
  614. _vm.filterable
  615. ? _c("input", {
  616. directives: [
  617. {
  618. name: "model",
  619. rawName: "v-model",
  620. value: _vm.query,
  621. expression: "query"
  622. }
  623. ],
  624. ref: "input",
  625. staticClass: "el-select__input",
  626. class: [_vm.selectSize ? "is-" + _vm.selectSize : ""],
  627. style: {
  628. "flex-grow": "1",
  629. width: _vm.inputLength / (_vm.inputWidth - 32) + "%",
  630. "max-width": _vm.inputWidth - 42 + "px"
  631. },
  632. attrs: {
  633. type: "text",
  634. disabled: _vm.selectDisabled,
  635. autocomplete: _vm.autoComplete || _vm.autocomplete
  636. },
  637. domProps: { value: _vm.query },
  638. on: {
  639. focus: _vm.handleFocus,
  640. blur: function($event) {
  641. _vm.softFocus = false
  642. },
  643. keyup: _vm.managePlaceholder,
  644. keydown: [
  645. _vm.resetInputState,
  646. function($event) {
  647. if (
  648. !("button" in $event) &&
  649. _vm._k($event.keyCode, "down", 40, $event.key, [
  650. "Down",
  651. "ArrowDown"
  652. ])
  653. ) {
  654. return null
  655. }
  656. $event.preventDefault()
  657. _vm.navigateOptions("next")
  658. },
  659. function($event) {
  660. if (
  661. !("button" in $event) &&
  662. _vm._k($event.keyCode, "up", 38, $event.key, [
  663. "Up",
  664. "ArrowUp"
  665. ])
  666. ) {
  667. return null
  668. }
  669. $event.preventDefault()
  670. _vm.navigateOptions("prev")
  671. },
  672. function($event) {
  673. if (
  674. !("button" in $event) &&
  675. _vm._k(
  676. $event.keyCode,
  677. "enter",
  678. 13,
  679. $event.key,
  680. "Enter"
  681. )
  682. ) {
  683. return null
  684. }
  685. $event.preventDefault()
  686. return _vm.selectOption($event)
  687. },
  688. function($event) {
  689. if (
  690. !("button" in $event) &&
  691. _vm._k($event.keyCode, "esc", 27, $event.key, [
  692. "Esc",
  693. "Escape"
  694. ])
  695. ) {
  696. return null
  697. }
  698. $event.stopPropagation()
  699. $event.preventDefault()
  700. _vm.visible = false
  701. },
  702. function($event) {
  703. if (
  704. !("button" in $event) &&
  705. _vm._k(
  706. $event.keyCode,
  707. "delete",
  708. [8, 46],
  709. $event.key,
  710. ["Backspace", "Delete", "Del"]
  711. )
  712. ) {
  713. return null
  714. }
  715. return _vm.deletePrevTag($event)
  716. },
  717. function($event) {
  718. if (
  719. !("button" in $event) &&
  720. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  721. ) {
  722. return null
  723. }
  724. _vm.visible = false
  725. }
  726. ],
  727. compositionstart: _vm.handleComposition,
  728. compositionupdate: _vm.handleComposition,
  729. compositionend: _vm.handleComposition,
  730. input: [
  731. function($event) {
  732. if ($event.target.composing) {
  733. return
  734. }
  735. _vm.query = $event.target.value
  736. },
  737. _vm.debouncedQueryChange
  738. ]
  739. }
  740. })
  741. : _vm._e()
  742. ],
  743. 1
  744. )
  745. : _vm._e(),
  746. _c(
  747. "el-input",
  748. {
  749. ref: "reference",
  750. class: { "is-focus": _vm.visible },
  751. attrs: {
  752. type: "text",
  753. placeholder: _vm.currentPlaceholder,
  754. name: _vm.name,
  755. id: _vm.id,
  756. autocomplete: _vm.autoComplete || _vm.autocomplete,
  757. size: _vm.selectSize,
  758. disabled: _vm.selectDisabled,
  759. readonly: _vm.readonly,
  760. "validate-event": false,
  761. tabindex: _vm.multiple && _vm.filterable ? "-1" : null
  762. },
  763. on: { focus: _vm.handleFocus, blur: _vm.handleBlur },
  764. nativeOn: {
  765. keyup: function($event) {
  766. return _vm.debouncedOnInputChange($event)
  767. },
  768. keydown: [
  769. function($event) {
  770. if (
  771. !("button" in $event) &&
  772. _vm._k($event.keyCode, "down", 40, $event.key, [
  773. "Down",
  774. "ArrowDown"
  775. ])
  776. ) {
  777. return null
  778. }
  779. $event.stopPropagation()
  780. $event.preventDefault()
  781. _vm.navigateOptions("next")
  782. },
  783. function($event) {
  784. if (
  785. !("button" in $event) &&
  786. _vm._k($event.keyCode, "up", 38, $event.key, [
  787. "Up",
  788. "ArrowUp"
  789. ])
  790. ) {
  791. return null
  792. }
  793. $event.stopPropagation()
  794. $event.preventDefault()
  795. _vm.navigateOptions("prev")
  796. },
  797. function($event) {
  798. if (
  799. !("button" in $event) &&
  800. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  801. ) {
  802. return null
  803. }
  804. $event.preventDefault()
  805. return _vm.selectOption($event)
  806. },
  807. function($event) {
  808. if (
  809. !("button" in $event) &&
  810. _vm._k($event.keyCode, "esc", 27, $event.key, [
  811. "Esc",
  812. "Escape"
  813. ])
  814. ) {
  815. return null
  816. }
  817. $event.stopPropagation()
  818. $event.preventDefault()
  819. _vm.visible = false
  820. },
  821. function($event) {
  822. if (
  823. !("button" in $event) &&
  824. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  825. ) {
  826. return null
  827. }
  828. _vm.visible = false
  829. }
  830. ],
  831. paste: function($event) {
  832. return _vm.debouncedOnInputChange($event)
  833. },
  834. mouseenter: function($event) {
  835. _vm.inputHovering = true
  836. },
  837. mouseleave: function($event) {
  838. _vm.inputHovering = false
  839. }
  840. },
  841. model: {
  842. value: _vm.selectedLabel,
  843. callback: function($$v) {
  844. _vm.selectedLabel = $$v
  845. },
  846. expression: "selectedLabel"
  847. }
  848. },
  849. [
  850. _vm.$slots.prefix
  851. ? _c("template", { slot: "prefix" }, [_vm._t("prefix")], 2)
  852. : _vm._e(),
  853. _c("template", { slot: "suffix" }, [
  854. _c("i", {
  855. directives: [
  856. {
  857. name: "show",
  858. rawName: "v-show",
  859. value: !_vm.showClose,
  860. expression: "!showClose"
  861. }
  862. ],
  863. class: [
  864. "el-select__caret",
  865. "el-input__icon",
  866. "el-icon-" + _vm.iconClass
  867. ]
  868. }),
  869. _vm.showClose
  870. ? _c("i", {
  871. staticClass:
  872. "el-select__caret el-input__icon el-icon-circle-close",
  873. on: { click: _vm.handleClearClick }
  874. })
  875. : _vm._e()
  876. ]),
  877. _c("template", { slot: "append" }, [_vm._t("append")], 2)
  878. ],
  879. 2
  880. ),
  881. _c(
  882. "transition",
  883. {
  884. attrs: { name: "el-zoom-in-top" },
  885. on: {
  886. "before-enter": _vm.handleMenuEnter,
  887. "after-leave": _vm.doDestroy
  888. }
  889. },
  890. [
  891. _c(
  892. "el-select-menu",
  893. {
  894. directives: [
  895. {
  896. name: "show",
  897. rawName: "v-show",
  898. value: _vm.visible && _vm.emptyText !== false,
  899. expression: "visible && emptyText !== false"
  900. }
  901. ],
  902. ref: "popper",
  903. attrs: { "append-to-body": _vm.popperAppendToBody }
  904. },
  905. [
  906. _c(
  907. "el-scrollbar",
  908. {
  909. directives: [
  910. {
  911. name: "show",
  912. rawName: "v-show",
  913. value: _vm.options.length > 0 && !_vm.loading,
  914. expression: "options.length > 0 && !loading"
  915. }
  916. ],
  917. ref: "scrollbar",
  918. class: {
  919. "is-empty":
  920. !_vm.allowCreate &&
  921. _vm.query &&
  922. _vm.filteredOptionsCount === 0
  923. },
  924. attrs: {
  925. tag: "ul",
  926. "wrap-class": "el-select-dropdown__wrap",
  927. "view-class": "el-select-dropdown__list"
  928. }
  929. },
  930. [
  931. _vm.showNewOption
  932. ? _c("el-option", {
  933. attrs: { value: _vm.query, created: "" }
  934. })
  935. : _vm._e(),
  936. _vm._t("default")
  937. ],
  938. 2
  939. ),
  940. _vm.emptyText &&
  941. (!_vm.allowCreate ||
  942. _vm.loading ||
  943. (_vm.allowCreate && _vm.options.length === 0))
  944. ? [
  945. _vm.$slots.empty
  946. ? _vm._t("empty")
  947. : _c("p", { staticClass: "el-select-dropdown__empty" }, [
  948. _vm._v(_vm._s(_vm.emptyText))
  949. ])
  950. ]
  951. : _vm._e()
  952. ],
  953. 2
  954. )
  955. ],
  956. 1
  957. )
  958. ],
  959. 1
  960. )
  961. }
  962. var staticRenderFns = []
  963. render._withStripped = true
  964. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=template&id=0e4aade6&
  965. // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
  966. var emitter_ = __webpack_require__(4);
  967. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  968. // EXTERNAL MODULE: external "element-ui/lib/mixins/focus"
  969. var focus_ = __webpack_require__(22);
  970. var focus_default = /*#__PURE__*/__webpack_require__.n(focus_);
  971. // EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
  972. var locale_ = __webpack_require__(6);
  973. var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
  974. // EXTERNAL MODULE: external "element-ui/lib/input"
  975. var input_ = __webpack_require__(10);
  976. var input_default = /*#__PURE__*/__webpack_require__.n(input_);
  977. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select-dropdown.vue?vue&type=template&id=06828748&
  978. var select_dropdownvue_type_template_id_06828748_render = function() {
  979. var _vm = this
  980. var _h = _vm.$createElement
  981. var _c = _vm._self._c || _h
  982. return _c(
  983. "div",
  984. {
  985. staticClass: "el-select-dropdown el-popper",
  986. class: [{ "is-multiple": _vm.$parent.multiple }, _vm.popperClass],
  987. style: { minWidth: _vm.minWidth }
  988. },
  989. [_vm._t("default")],
  990. 2
  991. )
  992. }
  993. var select_dropdownvue_type_template_id_06828748_staticRenderFns = []
  994. select_dropdownvue_type_template_id_06828748_render._withStripped = true
  995. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=template&id=06828748&
  996. // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
  997. var vue_popper_ = __webpack_require__(5);
  998. var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
  999. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select-dropdown.vue?vue&type=script&lang=js&
  1000. //
  1001. //
  1002. //
  1003. //
  1004. //
  1005. //
  1006. //
  1007. //
  1008. //
  1009. /* harmony default export */ var select_dropdownvue_type_script_lang_js_ = ({
  1010. name: 'ElSelectDropdown',
  1011. componentName: 'ElSelectDropdown',
  1012. mixins: [vue_popper_default.a],
  1013. props: {
  1014. placement: {
  1015. default: 'bottom-start'
  1016. },
  1017. boundariesPadding: {
  1018. default: 0
  1019. },
  1020. popperOptions: {
  1021. default: function _default() {
  1022. return {
  1023. gpuAcceleration: false
  1024. };
  1025. }
  1026. },
  1027. visibleArrow: {
  1028. default: true
  1029. },
  1030. appendToBody: {
  1031. type: Boolean,
  1032. default: true
  1033. }
  1034. },
  1035. data: function data() {
  1036. return {
  1037. minWidth: ''
  1038. };
  1039. },
  1040. computed: {
  1041. popperClass: function popperClass() {
  1042. return this.$parent.popperClass;
  1043. }
  1044. },
  1045. watch: {
  1046. '$parent.inputWidth': function $parentInputWidth() {
  1047. this.minWidth = this.$parent.$el.getBoundingClientRect().width + 'px';
  1048. }
  1049. },
  1050. mounted: function mounted() {
  1051. var _this = this;
  1052. this.referenceElm = this.$parent.$refs.reference.$el;
  1053. this.$parent.popperElm = this.popperElm = this.$el;
  1054. this.$on('updatePopper', function () {
  1055. if (_this.$parent.visible) _this.updatePopper();
  1056. });
  1057. this.$on('destroyPopper', this.destroyPopper);
  1058. }
  1059. });
  1060. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=script&lang=js&
  1061. /* harmony default export */ var src_select_dropdownvue_type_script_lang_js_ = (select_dropdownvue_type_script_lang_js_);
  1062. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  1063. var componentNormalizer = __webpack_require__(0);
  1064. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue
  1065. /* normalize component */
  1066. var component = Object(componentNormalizer["a" /* default */])(
  1067. src_select_dropdownvue_type_script_lang_js_,
  1068. select_dropdownvue_type_template_id_06828748_render,
  1069. select_dropdownvue_type_template_id_06828748_staticRenderFns,
  1070. false,
  1071. null,
  1072. null,
  1073. null
  1074. )
  1075. /* hot reload */
  1076. if (false) { var api; }
  1077. component.options.__file = "packages/select/src/select-dropdown.vue"
  1078. /* harmony default export */ var select_dropdown = (component.exports);
  1079. // EXTERNAL MODULE: ./packages/select/src/option.vue + 4 modules
  1080. var src_option = __webpack_require__(34);
  1081. // EXTERNAL MODULE: external "element-ui/lib/tag"
  1082. var tag_ = __webpack_require__(38);
  1083. var tag_default = /*#__PURE__*/__webpack_require__.n(tag_);
  1084. // EXTERNAL MODULE: external "element-ui/lib/scrollbar"
  1085. var scrollbar_ = __webpack_require__(14);
  1086. var scrollbar_default = /*#__PURE__*/__webpack_require__.n(scrollbar_);
  1087. // EXTERNAL MODULE: external "throttle-debounce/debounce"
  1088. var debounce_ = __webpack_require__(17);
  1089. var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);
  1090. // EXTERNAL MODULE: external "element-ui/lib/utils/clickoutside"
  1091. var clickoutside_ = __webpack_require__(12);
  1092. var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
  1093. // EXTERNAL MODULE: external "element-ui/lib/utils/resize-event"
  1094. var resize_event_ = __webpack_require__(16);
  1095. // EXTERNAL MODULE: external "element-ui/lib/locale"
  1096. var lib_locale_ = __webpack_require__(19);
  1097. // EXTERNAL MODULE: external "element-ui/lib/utils/scroll-into-view"
  1098. var scroll_into_view_ = __webpack_require__(31);
  1099. var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view_);
  1100. // EXTERNAL MODULE: external "element-ui/lib/utils/util"
  1101. var util_ = __webpack_require__(3);
  1102. // CONCATENATED MODULE: ./packages/select/src/navigation-mixin.js
  1103. /* harmony default export */ var navigation_mixin = ({
  1104. data: function data() {
  1105. return {
  1106. hoverOption: -1
  1107. };
  1108. },
  1109. computed: {
  1110. optionsAllDisabled: function optionsAllDisabled() {
  1111. return this.options.filter(function (option) {
  1112. return option.visible;
  1113. }).every(function (option) {
  1114. return option.disabled;
  1115. });
  1116. }
  1117. },
  1118. watch: {
  1119. hoverIndex: function hoverIndex(val) {
  1120. var _this = this;
  1121. if (typeof val === 'number' && val > -1) {
  1122. this.hoverOption = this.options[val] || {};
  1123. }
  1124. this.options.forEach(function (option) {
  1125. option.hover = _this.hoverOption === option;
  1126. });
  1127. }
  1128. },
  1129. methods: {
  1130. navigateOptions: function navigateOptions(direction) {
  1131. var _this2 = this;
  1132. if (!this.visible) {
  1133. this.visible = true;
  1134. return;
  1135. }
  1136. if (this.options.length === 0 || this.filteredOptionsCount === 0) return;
  1137. if (!this.optionsAllDisabled) {
  1138. if (direction === 'next') {
  1139. this.hoverIndex++;
  1140. if (this.hoverIndex === this.options.length) {
  1141. this.hoverIndex = 0;
  1142. }
  1143. } else if (direction === 'prev') {
  1144. this.hoverIndex--;
  1145. if (this.hoverIndex < 0) {
  1146. this.hoverIndex = this.options.length - 1;
  1147. }
  1148. }
  1149. var option = this.options[this.hoverIndex];
  1150. if (option.disabled === true || option.groupDisabled === true || !option.visible) {
  1151. this.navigateOptions(direction);
  1152. }
  1153. this.$nextTick(function () {
  1154. return _this2.scrollToOption(_this2.hoverOption);
  1155. });
  1156. }
  1157. }
  1158. }
  1159. });
  1160. // EXTERNAL MODULE: external "element-ui/lib/utils/shared"
  1161. var shared_ = __webpack_require__(21);
  1162. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select.vue?vue&type=script&lang=js&
  1163. //
  1164. //
  1165. //
  1166. //
  1167. //
  1168. //
  1169. //
  1170. //
  1171. //
  1172. //
  1173. //
  1174. //
  1175. //
  1176. //
  1177. //
  1178. //
  1179. //
  1180. //
  1181. //
  1182. //
  1183. //
  1184. //
  1185. //
  1186. //
  1187. //
  1188. //
  1189. //
  1190. //
  1191. //
  1192. //
  1193. //
  1194. //
  1195. //
  1196. //
  1197. //
  1198. //
  1199. //
  1200. //
  1201. //
  1202. //
  1203. //
  1204. //
  1205. //
  1206. //
  1207. //
  1208. //
  1209. //
  1210. //
  1211. //
  1212. //
  1213. //
  1214. //
  1215. //
  1216. //
  1217. //
  1218. //
  1219. //
  1220. //
  1221. //
  1222. //
  1223. //
  1224. //
  1225. //
  1226. //
  1227. //
  1228. //
  1229. //
  1230. //
  1231. //
  1232. //
  1233. //
  1234. //
  1235. //
  1236. //
  1237. //
  1238. //
  1239. //
  1240. //
  1241. //
  1242. //
  1243. //
  1244. //
  1245. //
  1246. //
  1247. //
  1248. //
  1249. //
  1250. //
  1251. //
  1252. //
  1253. //
  1254. //
  1255. //
  1256. //
  1257. //
  1258. //
  1259. //
  1260. //
  1261. //
  1262. //
  1263. //
  1264. //
  1265. //
  1266. //
  1267. //
  1268. //
  1269. //
  1270. //
  1271. //
  1272. //
  1273. //
  1274. //
  1275. //
  1276. //
  1277. //
  1278. //
  1279. //
  1280. //
  1281. //
  1282. //
  1283. //
  1284. //
  1285. //
  1286. //
  1287. //
  1288. //
  1289. //
  1290. //
  1291. //
  1292. //
  1293. //
  1294. //
  1295. //
  1296. //
  1297. //
  1298. //
  1299. //
  1300. //
  1301. //
  1302. //
  1303. //
  1304. //
  1305. //
  1306. //
  1307. //
  1308. //
  1309. //
  1310. /* harmony default export */ var selectvue_type_script_lang_js_ = ({
  1311. mixins: [emitter_default.a, locale_default.a, focus_default()("reference"), navigation_mixin],
  1312. name: "ElSelect",
  1313. componentName: "ElSelect",
  1314. inject: {
  1315. elForm: {
  1316. default: ""
  1317. },
  1318. elFormItem: {
  1319. default: ""
  1320. }
  1321. },
  1322. provide: function provide() {
  1323. return {
  1324. select: this
  1325. };
  1326. },
  1327. computed: {
  1328. _elFormItemSize: function _elFormItemSize() {
  1329. return (this.elFormItem || {}).elFormItemSize;
  1330. },
  1331. readonly: function readonly() {
  1332. return !this.filterable || this.multiple || !Object(util_["isIE"])() && !Object(util_["isEdge"])() && !this.visible;
  1333. },
  1334. showClose: function showClose() {
  1335. var hasValue = this.multiple ? Array.isArray(this.value) && this.value.length > 0 : this.value !== undefined && this.value !== null && this.value !== "";
  1336. var criteria = this.clearable && !this.selectDisabled && this.inputHovering && hasValue;
  1337. return criteria;
  1338. },
  1339. iconClass: function iconClass() {
  1340. return this.remote && this.filterable ? "" : this.visible ? "arrow-up is-reverse" : "arrow-up";
  1341. },
  1342. debounce: function debounce() {
  1343. return this.remote ? 300 : 0;
  1344. },
  1345. emptyText: function emptyText() {
  1346. if (this.loading) {
  1347. return this.loadingText || this.t("el.select.loading");
  1348. } else {
  1349. if (this.remote && this.query === "" && this.options.length === 0) return false;
  1350. if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
  1351. return this.noMatchText || this.t("el.select.noMatch");
  1352. }
  1353. if (this.options.length === 0) {
  1354. return this.noDataText || this.t("el.select.noData");
  1355. }
  1356. }
  1357. return null;
  1358. },
  1359. showNewOption: function showNewOption() {
  1360. var _this = this;
  1361. var hasExistingOption = this.options.filter(function (option) {
  1362. return !option.created;
  1363. }).some(function (option) {
  1364. return option.currentLabel === _this.query;
  1365. });
  1366. return this.filterable && this.allowCreate && this.query !== "" && !hasExistingOption;
  1367. },
  1368. selectSize: function selectSize() {
  1369. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  1370. },
  1371. selectDisabled: function selectDisabled() {
  1372. return this.disabled || (this.elForm || {}).disabled;
  1373. },
  1374. collapseTagSize: function collapseTagSize() {
  1375. return ["small", "mini"].indexOf(this.selectSize) > -1 ? "mini" : "small";
  1376. }
  1377. },
  1378. components: {
  1379. ElInput: input_default.a,
  1380. ElSelectMenu: select_dropdown,
  1381. ElOption: src_option["a" /* default */],
  1382. ElTag: tag_default.a,
  1383. ElScrollbar: scrollbar_default.a
  1384. },
  1385. directives: { Clickoutside: clickoutside_default.a },
  1386. props: {
  1387. name: String,
  1388. id: String,
  1389. value: {
  1390. required: true
  1391. },
  1392. autocomplete: {
  1393. type: String,
  1394. default: "off"
  1395. },
  1396. /** @Deprecated in next major version */
  1397. autoComplete: {
  1398. type: String,
  1399. validator: function validator(val) {
  1400. false && false;
  1401. return true;
  1402. }
  1403. },
  1404. automaticDropdown: Boolean,
  1405. size: String,
  1406. disabled: Boolean,
  1407. clearable: Boolean,
  1408. filterable: Boolean,
  1409. allowCreate: Boolean,
  1410. loading: Boolean,
  1411. popperClass: String,
  1412. remote: Boolean,
  1413. loadingText: String,
  1414. noMatchText: String,
  1415. noDataText: String,
  1416. remoteMethod: Function,
  1417. filterMethod: Function,
  1418. multiple: Boolean,
  1419. multipleLimit: {
  1420. type: Number,
  1421. default: 0
  1422. },
  1423. placeholder: {
  1424. type: String,
  1425. default: function _default() {
  1426. return Object(lib_locale_["t"])("el.select.placeholder");
  1427. }
  1428. },
  1429. defaultFirstOption: Boolean,
  1430. reserveKeyword: Boolean,
  1431. valueKey: {
  1432. type: String,
  1433. default: "value"
  1434. },
  1435. collapseTags: Boolean,
  1436. popperAppendToBody: {
  1437. type: Boolean,
  1438. default: true
  1439. }
  1440. },
  1441. data: function data() {
  1442. return {
  1443. options: [],
  1444. cachedOptions: [],
  1445. createdLabel: null,
  1446. createdSelected: false,
  1447. selected: this.multiple ? [] : {},
  1448. inputLength: 20,
  1449. inputWidth: 0,
  1450. initialInputHeight: 0,
  1451. cachedPlaceHolder: "",
  1452. optionsCount: 0,
  1453. filteredOptionsCount: 0,
  1454. visible: false,
  1455. softFocus: false,
  1456. selectedLabel: "",
  1457. hoverIndex: -1,
  1458. query: "",
  1459. previousQuery: null,
  1460. inputHovering: false,
  1461. currentPlaceholder: "",
  1462. menuVisibleOnFocus: false,
  1463. isOnComposition: false,
  1464. isSilentBlur: false
  1465. };
  1466. },
  1467. watch: {
  1468. selectDisabled: function selectDisabled() {
  1469. var _this2 = this;
  1470. this.$nextTick(function () {
  1471. _this2.resetInputHeight();
  1472. });
  1473. },
  1474. placeholder: function placeholder(val) {
  1475. this.cachedPlaceHolder = this.currentPlaceholder = val;
  1476. },
  1477. value: {
  1478. handler: function handler(val, oldVal) {
  1479. if (this.multiple) {
  1480. this.resetInputHeight();
  1481. if (val && val.length > 0 || this.$refs.input && this.query !== "") {
  1482. this.currentPlaceholder = "";
  1483. } else {
  1484. this.currentPlaceholder = this.cachedPlaceHolder;
  1485. }
  1486. if (this.filterable && !this.reserveKeyword) {
  1487. this.query = "";
  1488. this.handleQueryChange(this.query);
  1489. }
  1490. }
  1491. this.setSelected();
  1492. if (this.filterable && !this.multiple) {
  1493. this.inputLength = 20;
  1494. }
  1495. if (!Object(util_["valueEquals"])(val, oldVal)) {
  1496. this.dispatch("ElFormItem", "el.form.change", val);
  1497. }
  1498. },
  1499. deep: true
  1500. },
  1501. visible: function visible(val) {
  1502. var _this3 = this;
  1503. if (!val) {
  1504. this.broadcast("ElSelectDropdown", "destroyPopper");
  1505. if (this.$refs.input) {
  1506. this.$refs.input.blur();
  1507. }
  1508. this.query = "";
  1509. this.previousQuery = null;
  1510. this.selectedLabel = "";
  1511. this.inputLength = 20;
  1512. this.menuVisibleOnFocus = false;
  1513. this.resetHoverIndex();
  1514. this.$nextTick(function () {
  1515. if (_this3.$refs.input && _this3.$refs.input.value === "" && _this3.selected.length === 0) {
  1516. _this3.currentPlaceholder = _this3.cachedPlaceHolder;
  1517. }
  1518. });
  1519. if (!this.multiple) {
  1520. if (this.selected) {
  1521. if (this.filterable && this.allowCreate && this.createdSelected && this.createdLabel) {
  1522. this.selectedLabel = this.createdLabel;
  1523. } else {
  1524. this.selectedLabel = this.selected.currentLabel;
  1525. }
  1526. if (this.filterable) this.query = this.selectedLabel;
  1527. }
  1528. if (this.filterable) {
  1529. this.currentPlaceholder = this.cachedPlaceHolder;
  1530. }
  1531. }
  1532. } else {
  1533. this.broadcast("ElSelectDropdown", "updatePopper");
  1534. if (this.filterable) {
  1535. this.query = this.remote ? "" : this.selectedLabel;
  1536. this.handleQueryChange(this.query);
  1537. if (this.multiple) {
  1538. this.$refs.input.focus();
  1539. } else {
  1540. if (!this.remote) {
  1541. this.broadcast("ElOption", "queryChange", "");
  1542. this.broadcast("ElOptionGroup", "queryChange");
  1543. }
  1544. if (this.selectedLabel) {
  1545. this.currentPlaceholder = this.selectedLabel;
  1546. this.selectedLabel = "";
  1547. }
  1548. }
  1549. }
  1550. }
  1551. this.$emit("visible-change", val);
  1552. },
  1553. options: function options() {
  1554. var _this4 = this;
  1555. if (this.$isServer) return;
  1556. this.$nextTick(function () {
  1557. _this4.broadcast("ElSelectDropdown", "updatePopper");
  1558. });
  1559. if (this.multiple) {
  1560. this.resetInputHeight();
  1561. }
  1562. var inputs = this.$el.querySelectorAll("input");
  1563. if ([].indexOf.call(inputs, document.activeElement) === -1) {
  1564. this.setSelected();
  1565. }
  1566. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  1567. this.checkDefaultFirstOption();
  1568. }
  1569. }
  1570. },
  1571. methods: {
  1572. handleComposition: function handleComposition(event) {
  1573. var _this5 = this;
  1574. var text = event.target.value;
  1575. if (event.type === "compositionend") {
  1576. this.isOnComposition = false;
  1577. this.$nextTick(function (_) {
  1578. return _this5.handleQueryChange(text);
  1579. });
  1580. } else {
  1581. var lastCharacter = text[text.length - 1] || "";
  1582. this.isOnComposition = !Object(shared_["isKorean"])(lastCharacter);
  1583. }
  1584. },
  1585. handleQueryChange: function handleQueryChange(val) {
  1586. var _this6 = this;
  1587. if (this.previousQuery === val || this.isOnComposition) return;
  1588. if (this.previousQuery === null && (typeof this.filterMethod === "function" || typeof this.remoteMethod === "function")) {
  1589. this.previousQuery = val;
  1590. return;
  1591. }
  1592. this.previousQuery = val;
  1593. this.$nextTick(function () {
  1594. if (_this6.visible) _this6.broadcast("ElSelectDropdown", "updatePopper");
  1595. });
  1596. this.hoverIndex = -1;
  1597. if (this.multiple && this.filterable) {
  1598. this.$nextTick(function () {
  1599. var length = _this6.$refs.input.value.length * 15 + 20;
  1600. _this6.inputLength = _this6.collapseTags ? Math.min(50, length) : length;
  1601. _this6.managePlaceholder();
  1602. _this6.resetInputHeight();
  1603. });
  1604. }
  1605. if (this.remote && typeof this.remoteMethod === "function") {
  1606. this.hoverIndex = -1;
  1607. this.remoteMethod(val);
  1608. } else if (typeof this.filterMethod === "function") {
  1609. this.filterMethod(val);
  1610. this.broadcast("ElOptionGroup", "queryChange");
  1611. } else {
  1612. this.filteredOptionsCount = this.optionsCount;
  1613. this.broadcast("ElOption", "queryChange", val);
  1614. this.broadcast("ElOptionGroup", "queryChange");
  1615. }
  1616. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  1617. this.checkDefaultFirstOption();
  1618. }
  1619. },
  1620. scrollToOption: function scrollToOption(option) {
  1621. var target = Array.isArray(option) && option[0] ? option[0].$el : option.$el;
  1622. if (this.$refs.popper && target) {
  1623. var menu = this.$refs.popper.$el.querySelector(".el-select-dropdown__wrap");
  1624. scroll_into_view_default()(menu, target);
  1625. }
  1626. this.$refs.scrollbar && this.$refs.scrollbar.handleScroll();
  1627. },
  1628. handleMenuEnter: function handleMenuEnter() {
  1629. var _this7 = this;
  1630. this.$nextTick(function () {
  1631. return _this7.scrollToOption(_this7.selected);
  1632. });
  1633. },
  1634. emitChange: function emitChange(val) {
  1635. if (!Object(util_["valueEquals"])(this.value, val)) {
  1636. this.$emit("change", val);
  1637. }
  1638. },
  1639. getOption: function getOption(value) {
  1640. var option = void 0;
  1641. var isObject = Object.prototype.toString.call(value).toLowerCase() === "[object object]";
  1642. var isNull = Object.prototype.toString.call(value).toLowerCase() === "[object null]";
  1643. var isUndefined = Object.prototype.toString.call(value).toLowerCase() === "[object undefined]";
  1644. for (var i = this.cachedOptions.length - 1; i >= 0; i--) {
  1645. var cachedOption = this.cachedOptions[i];
  1646. var isEqual = isObject ? Object(util_["getValueByPath"])(cachedOption.value, this.valueKey) === Object(util_["getValueByPath"])(value, this.valueKey) : cachedOption.value === value;
  1647. if (isEqual) {
  1648. option = cachedOption;
  1649. break;
  1650. }
  1651. }
  1652. if (option) return option;
  1653. var label = !isObject && !isNull && !isUndefined ? value : "";
  1654. var newOption = {
  1655. value: value,
  1656. currentLabel: label
  1657. };
  1658. if (this.multiple) {
  1659. newOption.hitState = false;
  1660. }
  1661. return newOption;
  1662. },
  1663. setSelected: function setSelected() {
  1664. var _this8 = this;
  1665. if (!this.multiple) {
  1666. var option = this.getOption(this.value);
  1667. if (option.created) {
  1668. this.createdLabel = option.currentLabel;
  1669. this.createdSelected = true;
  1670. } else {
  1671. this.createdSelected = false;
  1672. }
  1673. this.selectedLabel = option.currentLabel;
  1674. this.selected = option;
  1675. if (this.filterable) this.query = this.selectedLabel;
  1676. return;
  1677. }
  1678. var result = [];
  1679. if (Array.isArray(this.value)) {
  1680. this.value.forEach(function (value) {
  1681. result.push(_this8.getOption(value));
  1682. });
  1683. }
  1684. this.selected = result;
  1685. this.$nextTick(function () {
  1686. _this8.resetInputHeight();
  1687. });
  1688. },
  1689. handleFocus: function handleFocus(event) {
  1690. if (!this.softFocus) {
  1691. if (this.automaticDropdown || this.filterable) {
  1692. this.visible = true;
  1693. if (this.filterable) {
  1694. this.menuVisibleOnFocus = true;
  1695. }
  1696. }
  1697. this.$emit("focus", event);
  1698. } else {
  1699. this.softFocus = false;
  1700. }
  1701. },
  1702. blur: function blur() {
  1703. this.visible = false;
  1704. this.$refs.reference.blur();
  1705. },
  1706. handleBlur: function handleBlur(event) {
  1707. var _this9 = this;
  1708. setTimeout(function () {
  1709. if (_this9.isSilentBlur) {
  1710. _this9.isSilentBlur = false;
  1711. } else {
  1712. _this9.$emit("blur", event);
  1713. }
  1714. }, 50);
  1715. this.softFocus = false;
  1716. },
  1717. handleClearClick: function handleClearClick(event) {
  1718. this.deleteSelected(event);
  1719. },
  1720. doDestroy: function doDestroy() {
  1721. this.$refs.popper && this.$refs.popper.doDestroy();
  1722. },
  1723. handleClose: function handleClose() {
  1724. this.visible = false;
  1725. },
  1726. toggleLastOptionHitState: function toggleLastOptionHitState(hit) {
  1727. if (!Array.isArray(this.selected)) return;
  1728. var option = this.selected[this.selected.length - 1];
  1729. if (!option) return;
  1730. if (hit === true || hit === false) {
  1731. option.hitState = hit;
  1732. return hit;
  1733. }
  1734. option.hitState = !option.hitState;
  1735. return option.hitState;
  1736. },
  1737. deletePrevTag: function deletePrevTag(e) {
  1738. if (e.target.value.length <= 0 && !this.toggleLastOptionHitState()) {
  1739. var value = this.value.slice();
  1740. value.pop();
  1741. this.$emit("input", value);
  1742. this.emitChange(value);
  1743. }
  1744. },
  1745. managePlaceholder: function managePlaceholder() {
  1746. if (this.currentPlaceholder !== "") {
  1747. this.currentPlaceholder = this.$refs.input.value ? "" : this.cachedPlaceHolder;
  1748. }
  1749. },
  1750. resetInputState: function resetInputState(e) {
  1751. if (e.keyCode !== 8) this.toggleLastOptionHitState(false);
  1752. this.inputLength = this.$refs.input.value.length * 15 + 20;
  1753. this.resetInputHeight();
  1754. },
  1755. resetInputHeight: function resetInputHeight() {
  1756. var _this10 = this;
  1757. if (this.collapseTags && !this.filterable) return;
  1758. this.$nextTick(function () {
  1759. if (!_this10.$refs.reference) return;
  1760. var inputChildNodes = _this10.$refs.reference.$el.childNodes;
  1761. var input = [].filter.call(inputChildNodes, function (item) {
  1762. return item.tagName === "INPUT";
  1763. })[0];
  1764. var tags = _this10.$refs.tags;
  1765. var sizeInMap = _this10.initialInputHeight || 40;
  1766. input.style.height = _this10.selected.length === 0 ? sizeInMap + "px" : Math.max(tags ? tags.clientHeight + (tags.clientHeight > sizeInMap ? 6 : 0) : 0, sizeInMap) + "px";
  1767. if (_this10.visible && _this10.emptyText !== false) {
  1768. _this10.broadcast("ElSelectDropdown", "updatePopper");
  1769. }
  1770. });
  1771. },
  1772. resetHoverIndex: function resetHoverIndex() {
  1773. var _this11 = this;
  1774. setTimeout(function () {
  1775. if (!_this11.multiple) {
  1776. _this11.hoverIndex = _this11.options.indexOf(_this11.selected);
  1777. } else {
  1778. if (_this11.selected.length > 0) {
  1779. _this11.hoverIndex = Math.min.apply(null, _this11.selected.map(function (item) {
  1780. return _this11.options.indexOf(item);
  1781. }));
  1782. } else {
  1783. _this11.hoverIndex = -1;
  1784. }
  1785. }
  1786. }, 300);
  1787. },
  1788. handleOptionSelect: function handleOptionSelect(option, byClick) {
  1789. var _this12 = this;
  1790. if (this.multiple) {
  1791. var value = (this.value || []).slice();
  1792. var optionIndex = this.getValueIndex(value, option.value);
  1793. if (optionIndex > -1) {
  1794. value.splice(optionIndex, 1);
  1795. } else if (this.multipleLimit <= 0 || value.length < this.multipleLimit) {
  1796. value.push(option.value);
  1797. }
  1798. this.$emit("input", value);
  1799. this.emitChange(value);
  1800. if (option.created) {
  1801. this.query = "";
  1802. this.handleQueryChange("");
  1803. this.inputLength = 20;
  1804. }
  1805. if (this.filterable) this.$refs.input.focus();
  1806. } else {
  1807. this.$emit("input", option.value);
  1808. this.emitChange(option.value);
  1809. this.visible = false;
  1810. }
  1811. this.isSilentBlur = byClick;
  1812. this.setSoftFocus();
  1813. if (this.visible) return;
  1814. this.$nextTick(function () {
  1815. _this12.scrollToOption(option);
  1816. });
  1817. },
  1818. setSoftFocus: function setSoftFocus() {
  1819. this.softFocus = true;
  1820. var input = this.$refs.input || this.$refs.reference;
  1821. if (input) {
  1822. input.focus();
  1823. }
  1824. },
  1825. getValueIndex: function getValueIndex() {
  1826. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  1827. var value = arguments[1];
  1828. var isObject = Object.prototype.toString.call(value).toLowerCase() === "[object object]";
  1829. if (!isObject) {
  1830. return arr.indexOf(value);
  1831. } else {
  1832. var valueKey = this.valueKey;
  1833. var index = -1;
  1834. arr.some(function (item, i) {
  1835. if (Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(value, valueKey)) {
  1836. index = i;
  1837. return true;
  1838. }
  1839. return false;
  1840. });
  1841. return index;
  1842. }
  1843. },
  1844. toggleMenu: function toggleMenu() {
  1845. if (!this.selectDisabled) {
  1846. if (this.menuVisibleOnFocus) {
  1847. this.menuVisibleOnFocus = false;
  1848. } else {
  1849. this.visible = !this.visible;
  1850. }
  1851. if (this.visible) {
  1852. (this.$refs.input || this.$refs.reference).focus();
  1853. }
  1854. }
  1855. },
  1856. selectOption: function selectOption() {
  1857. if (!this.visible) {
  1858. this.toggleMenu();
  1859. } else {
  1860. if (this.options[this.hoverIndex]) {
  1861. this.handleOptionSelect(this.options[this.hoverIndex]);
  1862. }
  1863. }
  1864. },
  1865. deleteSelected: function deleteSelected(event) {
  1866. event.stopPropagation();
  1867. var value = this.multiple ? [] : "";
  1868. this.$emit("input", value);
  1869. this.emitChange(value);
  1870. this.visible = false;
  1871. this.$emit("clear");
  1872. },
  1873. deleteTag: function deleteTag(event, tag) {
  1874. var index = this.selected.indexOf(tag);
  1875. if (index > -1 && !this.selectDisabled) {
  1876. var value = this.value.slice();
  1877. value.splice(index, 1);
  1878. this.$emit("input", value);
  1879. this.emitChange(value);
  1880. this.$emit("remove-tag", tag.value);
  1881. }
  1882. event.stopPropagation();
  1883. },
  1884. onInputChange: function onInputChange() {
  1885. if (this.filterable && this.query !== this.selectedLabel) {
  1886. this.query = this.selectedLabel;
  1887. this.handleQueryChange(this.query);
  1888. }
  1889. },
  1890. onOptionDestroy: function onOptionDestroy(index) {
  1891. if (index > -1) {
  1892. this.optionsCount--;
  1893. this.filteredOptionsCount--;
  1894. this.options.splice(index, 1);
  1895. }
  1896. },
  1897. resetInputWidth: function resetInputWidth() {
  1898. this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
  1899. },
  1900. handleResize: function handleResize() {
  1901. this.resetInputWidth();
  1902. if (this.multiple) this.resetInputHeight();
  1903. },
  1904. checkDefaultFirstOption: function checkDefaultFirstOption() {
  1905. this.hoverIndex = -1;
  1906. // highlight the created option
  1907. var hasCreated = false;
  1908. for (var i = this.options.length - 1; i >= 0; i--) {
  1909. if (this.options[i].created) {
  1910. hasCreated = true;
  1911. this.hoverIndex = i;
  1912. break;
  1913. }
  1914. }
  1915. if (hasCreated) return;
  1916. for (var _i = 0; _i !== this.options.length; ++_i) {
  1917. var option = this.options[_i];
  1918. if (this.query) {
  1919. // highlight first options that passes the filter
  1920. if (!option.disabled && !option.groupDisabled && option.visible) {
  1921. this.hoverIndex = _i;
  1922. break;
  1923. }
  1924. } else {
  1925. // highlight currently selected option
  1926. if (option.itemSelected) {
  1927. this.hoverIndex = _i;
  1928. break;
  1929. }
  1930. }
  1931. }
  1932. },
  1933. getValueKey: function getValueKey(item) {
  1934. if (Object.prototype.toString.call(item.value).toLowerCase() !== "[object object]") {
  1935. return item.value;
  1936. } else {
  1937. return Object(util_["getValueByPath"])(item.value, this.valueKey);
  1938. }
  1939. }
  1940. },
  1941. created: function created() {
  1942. var _this13 = this;
  1943. this.cachedPlaceHolder = this.currentPlaceholder = this.placeholder;
  1944. if (this.multiple && !Array.isArray(this.value)) {
  1945. this.$emit("input", []);
  1946. }
  1947. if (!this.multiple && Array.isArray(this.value)) {
  1948. this.$emit("input", "");
  1949. }
  1950. this.debouncedOnInputChange = debounce_default()(this.debounce, function () {
  1951. _this13.onInputChange();
  1952. });
  1953. this.debouncedQueryChange = debounce_default()(this.debounce, function (e) {
  1954. _this13.handleQueryChange(e.target.value);
  1955. });
  1956. this.$on("handleOptionClick", this.handleOptionSelect);
  1957. this.$on("setSelected", this.setSelected);
  1958. },
  1959. mounted: function mounted() {
  1960. var _this14 = this;
  1961. if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
  1962. this.currentPlaceholder = "";
  1963. }
  1964. Object(resize_event_["addResizeListener"])(this.$el, this.handleResize);
  1965. var reference = this.$refs.reference;
  1966. if (reference && reference.$el) {
  1967. var sizeMap = {
  1968. medium: 36,
  1969. small: 32,
  1970. mini: 28
  1971. };
  1972. var input = reference.$el.querySelector("input");
  1973. this.initialInputHeight = input.getBoundingClientRect().height || sizeMap[this.selectSize];
  1974. }
  1975. if (this.remote && this.multiple) {
  1976. this.resetInputHeight();
  1977. }
  1978. this.$nextTick(function () {
  1979. if (reference && reference.$el) {
  1980. _this14.inputWidth = reference.$el.getBoundingClientRect().width;
  1981. }
  1982. });
  1983. this.setSelected();
  1984. },
  1985. beforeDestroy: function beforeDestroy() {
  1986. if (this.$el && this.handleResize) Object(resize_event_["removeResizeListener"])(this.$el, this.handleResize);
  1987. }
  1988. });
  1989. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=script&lang=js&
  1990. /* harmony default export */ var src_selectvue_type_script_lang_js_ = (selectvue_type_script_lang_js_);
  1991. // CONCATENATED MODULE: ./packages/select/src/select.vue
  1992. /* normalize component */
  1993. var select_component = Object(componentNormalizer["a" /* default */])(
  1994. src_selectvue_type_script_lang_js_,
  1995. render,
  1996. staticRenderFns,
  1997. false,
  1998. null,
  1999. null,
  2000. null
  2001. )
  2002. /* hot reload */
  2003. if (false) { var select_api; }
  2004. select_component.options.__file = "packages/select/src/select.vue"
  2005. /* harmony default export */ var src_select = (select_component.exports);
  2006. // CONCATENATED MODULE: ./packages/select/index.js
  2007. /* istanbul ignore next */
  2008. src_select.install = function (Vue) {
  2009. Vue.component(src_select.name, src_select);
  2010. };
  2011. /* harmony default export */ var packages_select = __webpack_exports__["default"] = (src_select);
  2012. /***/ })
  2013. /******/ ]);