select.js 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200
  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. ],
  878. 2
  879. ),
  880. _c(
  881. "transition",
  882. {
  883. attrs: { name: "el-zoom-in-top" },
  884. on: {
  885. "before-enter": _vm.handleMenuEnter,
  886. "after-leave": _vm.doDestroy
  887. }
  888. },
  889. [
  890. _c(
  891. "el-select-menu",
  892. {
  893. directives: [
  894. {
  895. name: "show",
  896. rawName: "v-show",
  897. value: _vm.visible && _vm.emptyText !== false,
  898. expression: "visible && emptyText !== false"
  899. }
  900. ],
  901. ref: "popper",
  902. attrs: { "append-to-body": _vm.popperAppendToBody }
  903. },
  904. [
  905. _c(
  906. "el-scrollbar",
  907. {
  908. directives: [
  909. {
  910. name: "show",
  911. rawName: "v-show",
  912. value: _vm.options.length > 0 && !_vm.loading,
  913. expression: "options.length > 0 && !loading"
  914. }
  915. ],
  916. ref: "scrollbar",
  917. class: {
  918. "is-empty":
  919. !_vm.allowCreate &&
  920. _vm.query &&
  921. _vm.filteredOptionsCount === 0
  922. },
  923. attrs: {
  924. tag: "ul",
  925. "wrap-class": "el-select-dropdown__wrap",
  926. "view-class": "el-select-dropdown__list"
  927. }
  928. },
  929. [
  930. _vm.showNewOption
  931. ? _c("el-option", {
  932. attrs: { value: _vm.query, created: "" }
  933. })
  934. : _vm._e(),
  935. _vm._t("default")
  936. ],
  937. 2
  938. ),
  939. _vm.emptyText &&
  940. (!_vm.allowCreate ||
  941. _vm.loading ||
  942. (_vm.allowCreate && _vm.options.length === 0))
  943. ? [
  944. _vm.$slots.empty
  945. ? _vm._t("empty")
  946. : _c("p", { staticClass: "el-select-dropdown__empty" }, [
  947. _vm._v(
  948. "\n " +
  949. _vm._s(_vm.emptyText) +
  950. "\n "
  951. )
  952. ])
  953. ]
  954. : _vm._e()
  955. ],
  956. 2
  957. )
  958. ],
  959. 1
  960. )
  961. ],
  962. 1
  963. )
  964. }
  965. var staticRenderFns = []
  966. render._withStripped = true
  967. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=template&id=0e4aade6&
  968. // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
  969. var emitter_ = __webpack_require__(4);
  970. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  971. // EXTERNAL MODULE: external "element-ui/lib/mixins/focus"
  972. var focus_ = __webpack_require__(22);
  973. var focus_default = /*#__PURE__*/__webpack_require__.n(focus_);
  974. // EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
  975. var locale_ = __webpack_require__(6);
  976. var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
  977. // EXTERNAL MODULE: external "element-ui/lib/input"
  978. var input_ = __webpack_require__(10);
  979. var input_default = /*#__PURE__*/__webpack_require__.n(input_);
  980. // 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&
  981. var select_dropdownvue_type_template_id_06828748_render = function() {
  982. var _vm = this
  983. var _h = _vm.$createElement
  984. var _c = _vm._self._c || _h
  985. return _c(
  986. "div",
  987. {
  988. staticClass: "el-select-dropdown el-popper",
  989. class: [{ "is-multiple": _vm.$parent.multiple }, _vm.popperClass],
  990. style: { minWidth: _vm.minWidth }
  991. },
  992. [_vm._t("default")],
  993. 2
  994. )
  995. }
  996. var select_dropdownvue_type_template_id_06828748_staticRenderFns = []
  997. select_dropdownvue_type_template_id_06828748_render._withStripped = true
  998. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=template&id=06828748&
  999. // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
  1000. var vue_popper_ = __webpack_require__(5);
  1001. var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
  1002. // 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&
  1003. //
  1004. //
  1005. //
  1006. //
  1007. //
  1008. //
  1009. //
  1010. //
  1011. //
  1012. /* harmony default export */ var select_dropdownvue_type_script_lang_js_ = ({
  1013. name: 'ElSelectDropdown',
  1014. componentName: 'ElSelectDropdown',
  1015. mixins: [vue_popper_default.a],
  1016. props: {
  1017. placement: {
  1018. default: 'bottom-start'
  1019. },
  1020. boundariesPadding: {
  1021. default: 0
  1022. },
  1023. popperOptions: {
  1024. default: function _default() {
  1025. return {
  1026. gpuAcceleration: false
  1027. };
  1028. }
  1029. },
  1030. visibleArrow: {
  1031. default: true
  1032. },
  1033. appendToBody: {
  1034. type: Boolean,
  1035. default: true
  1036. }
  1037. },
  1038. data: function data() {
  1039. return {
  1040. minWidth: ''
  1041. };
  1042. },
  1043. computed: {
  1044. popperClass: function popperClass() {
  1045. return this.$parent.popperClass;
  1046. }
  1047. },
  1048. watch: {
  1049. '$parent.inputWidth': function $parentInputWidth() {
  1050. this.minWidth = this.$parent.$el.getBoundingClientRect().width + 'px';
  1051. }
  1052. },
  1053. mounted: function mounted() {
  1054. var _this = this;
  1055. this.referenceElm = this.$parent.$refs.reference.$el;
  1056. this.$parent.popperElm = this.popperElm = this.$el;
  1057. this.$on('updatePopper', function () {
  1058. if (_this.$parent.visible) _this.updatePopper();
  1059. });
  1060. this.$on('destroyPopper', this.destroyPopper);
  1061. }
  1062. });
  1063. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=script&lang=js&
  1064. /* harmony default export */ var src_select_dropdownvue_type_script_lang_js_ = (select_dropdownvue_type_script_lang_js_);
  1065. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  1066. var componentNormalizer = __webpack_require__(0);
  1067. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue
  1068. /* normalize component */
  1069. var component = Object(componentNormalizer["a" /* default */])(
  1070. src_select_dropdownvue_type_script_lang_js_,
  1071. select_dropdownvue_type_template_id_06828748_render,
  1072. select_dropdownvue_type_template_id_06828748_staticRenderFns,
  1073. false,
  1074. null,
  1075. null,
  1076. null
  1077. )
  1078. /* hot reload */
  1079. if (false) { var api; }
  1080. component.options.__file = "packages/select/src/select-dropdown.vue"
  1081. /* harmony default export */ var select_dropdown = (component.exports);
  1082. // EXTERNAL MODULE: ./packages/select/src/option.vue + 4 modules
  1083. var src_option = __webpack_require__(34);
  1084. // EXTERNAL MODULE: external "element-ui/lib/tag"
  1085. var tag_ = __webpack_require__(38);
  1086. var tag_default = /*#__PURE__*/__webpack_require__.n(tag_);
  1087. // EXTERNAL MODULE: external "element-ui/lib/scrollbar"
  1088. var scrollbar_ = __webpack_require__(14);
  1089. var scrollbar_default = /*#__PURE__*/__webpack_require__.n(scrollbar_);
  1090. // EXTERNAL MODULE: external "throttle-debounce/debounce"
  1091. var debounce_ = __webpack_require__(17);
  1092. var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);
  1093. // EXTERNAL MODULE: external "element-ui/lib/utils/clickoutside"
  1094. var clickoutside_ = __webpack_require__(12);
  1095. var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
  1096. // EXTERNAL MODULE: external "element-ui/lib/utils/resize-event"
  1097. var resize_event_ = __webpack_require__(16);
  1098. // EXTERNAL MODULE: external "element-ui/lib/locale"
  1099. var lib_locale_ = __webpack_require__(19);
  1100. // EXTERNAL MODULE: external "element-ui/lib/utils/scroll-into-view"
  1101. var scroll_into_view_ = __webpack_require__(31);
  1102. var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view_);
  1103. // EXTERNAL MODULE: external "element-ui/lib/utils/util"
  1104. var util_ = __webpack_require__(3);
  1105. // CONCATENATED MODULE: ./packages/select/src/navigation-mixin.js
  1106. /* harmony default export */ var navigation_mixin = ({
  1107. data: function data() {
  1108. return {
  1109. hoverOption: -1
  1110. };
  1111. },
  1112. computed: {
  1113. optionsAllDisabled: function optionsAllDisabled() {
  1114. return this.options.filter(function (option) {
  1115. return option.visible;
  1116. }).every(function (option) {
  1117. return option.disabled;
  1118. });
  1119. }
  1120. },
  1121. watch: {
  1122. hoverIndex: function hoverIndex(val) {
  1123. var _this = this;
  1124. if (typeof val === 'number' && val > -1) {
  1125. this.hoverOption = this.options[val] || {};
  1126. }
  1127. this.options.forEach(function (option) {
  1128. option.hover = _this.hoverOption === option;
  1129. });
  1130. }
  1131. },
  1132. methods: {
  1133. navigateOptions: function navigateOptions(direction) {
  1134. var _this2 = this;
  1135. if (!this.visible) {
  1136. this.visible = true;
  1137. return;
  1138. }
  1139. if (this.options.length === 0 || this.filteredOptionsCount === 0) return;
  1140. if (!this.optionsAllDisabled) {
  1141. if (direction === 'next') {
  1142. this.hoverIndex++;
  1143. if (this.hoverIndex === this.options.length) {
  1144. this.hoverIndex = 0;
  1145. }
  1146. } else if (direction === 'prev') {
  1147. this.hoverIndex--;
  1148. if (this.hoverIndex < 0) {
  1149. this.hoverIndex = this.options.length - 1;
  1150. }
  1151. }
  1152. var option = this.options[this.hoverIndex];
  1153. if (option.disabled === true || option.groupDisabled === true || !option.visible) {
  1154. this.navigateOptions(direction);
  1155. }
  1156. this.$nextTick(function () {
  1157. return _this2.scrollToOption(_this2.hoverOption);
  1158. });
  1159. }
  1160. }
  1161. }
  1162. });
  1163. // EXTERNAL MODULE: external "element-ui/lib/utils/shared"
  1164. var shared_ = __webpack_require__(21);
  1165. // 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&
  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. /* harmony default export */ var selectvue_type_script_lang_js_ = ({
  1302. mixins: [emitter_default.a, locale_default.a, focus_default()('reference'), navigation_mixin],
  1303. name: 'ElSelect',
  1304. componentName: 'ElSelect',
  1305. inject: {
  1306. elForm: {
  1307. default: ''
  1308. },
  1309. elFormItem: {
  1310. default: ''
  1311. }
  1312. },
  1313. provide: function provide() {
  1314. return {
  1315. 'select': this
  1316. };
  1317. },
  1318. computed: {
  1319. _elFormItemSize: function _elFormItemSize() {
  1320. return (this.elFormItem || {}).elFormItemSize;
  1321. },
  1322. readonly: function readonly() {
  1323. return !this.filterable || this.multiple || !Object(util_["isIE"])() && !Object(util_["isEdge"])() && !this.visible;
  1324. },
  1325. showClose: function showClose() {
  1326. var hasValue = this.multiple ? Array.isArray(this.value) && this.value.length > 0 : this.value !== undefined && this.value !== null && this.value !== '';
  1327. var criteria = this.clearable && !this.selectDisabled && this.inputHovering && hasValue;
  1328. return criteria;
  1329. },
  1330. iconClass: function iconClass() {
  1331. return this.remote && this.filterable ? '' : this.visible ? 'arrow-up is-reverse' : 'arrow-up';
  1332. },
  1333. debounce: function debounce() {
  1334. return this.remote ? 300 : 0;
  1335. },
  1336. emptyText: function emptyText() {
  1337. if (this.loading) {
  1338. return this.loadingText || this.t('el.select.loading');
  1339. } else {
  1340. if (this.remote && this.query === '' && this.options.length === 0) return false;
  1341. if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
  1342. return this.noMatchText || this.t('el.select.noMatch');
  1343. }
  1344. if (this.options.length === 0) {
  1345. return this.noDataText || this.t('el.select.noData');
  1346. }
  1347. }
  1348. return null;
  1349. },
  1350. showNewOption: function showNewOption() {
  1351. var _this = this;
  1352. var hasExistingOption = this.options.filter(function (option) {
  1353. return !option.created;
  1354. }).some(function (option) {
  1355. return option.currentLabel === _this.query;
  1356. });
  1357. return this.filterable && this.allowCreate && this.query !== '' && !hasExistingOption;
  1358. },
  1359. selectSize: function selectSize() {
  1360. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  1361. },
  1362. selectDisabled: function selectDisabled() {
  1363. return this.disabled || (this.elForm || {}).disabled;
  1364. },
  1365. collapseTagSize: function collapseTagSize() {
  1366. return ['small', 'mini'].indexOf(this.selectSize) > -1 ? 'mini' : 'small';
  1367. }
  1368. },
  1369. components: {
  1370. ElInput: input_default.a,
  1371. ElSelectMenu: select_dropdown,
  1372. ElOption: src_option["a" /* default */],
  1373. ElTag: tag_default.a,
  1374. ElScrollbar: scrollbar_default.a
  1375. },
  1376. directives: { Clickoutside: clickoutside_default.a },
  1377. props: {
  1378. name: String,
  1379. id: String,
  1380. value: {
  1381. required: true
  1382. },
  1383. autocomplete: {
  1384. type: String,
  1385. default: 'off'
  1386. },
  1387. /** @Deprecated in next major version */
  1388. autoComplete: {
  1389. type: String,
  1390. validator: function validator(val) {
  1391. false && false;
  1392. return true;
  1393. }
  1394. },
  1395. automaticDropdown: Boolean,
  1396. size: String,
  1397. disabled: Boolean,
  1398. clearable: Boolean,
  1399. filterable: Boolean,
  1400. allowCreate: Boolean,
  1401. loading: Boolean,
  1402. popperClass: String,
  1403. remote: Boolean,
  1404. loadingText: String,
  1405. noMatchText: String,
  1406. noDataText: String,
  1407. remoteMethod: Function,
  1408. filterMethod: Function,
  1409. multiple: Boolean,
  1410. multipleLimit: {
  1411. type: Number,
  1412. default: 0
  1413. },
  1414. placeholder: {
  1415. type: String,
  1416. default: function _default() {
  1417. return Object(lib_locale_["t"])('el.select.placeholder');
  1418. }
  1419. },
  1420. defaultFirstOption: Boolean,
  1421. reserveKeyword: Boolean,
  1422. valueKey: {
  1423. type: String,
  1424. default: 'value'
  1425. },
  1426. collapseTags: Boolean,
  1427. popperAppendToBody: {
  1428. type: Boolean,
  1429. default: true
  1430. }
  1431. },
  1432. data: function data() {
  1433. return {
  1434. options: [],
  1435. cachedOptions: [],
  1436. createdLabel: null,
  1437. createdSelected: false,
  1438. selected: this.multiple ? [] : {},
  1439. inputLength: 20,
  1440. inputWidth: 0,
  1441. initialInputHeight: 0,
  1442. cachedPlaceHolder: '',
  1443. optionsCount: 0,
  1444. filteredOptionsCount: 0,
  1445. visible: false,
  1446. softFocus: false,
  1447. selectedLabel: '',
  1448. hoverIndex: -1,
  1449. query: '',
  1450. previousQuery: null,
  1451. inputHovering: false,
  1452. currentPlaceholder: '',
  1453. menuVisibleOnFocus: false,
  1454. isOnComposition: false,
  1455. isSilentBlur: false
  1456. };
  1457. },
  1458. watch: {
  1459. selectDisabled: function selectDisabled() {
  1460. var _this2 = this;
  1461. this.$nextTick(function () {
  1462. _this2.resetInputHeight();
  1463. });
  1464. },
  1465. placeholder: function placeholder(val) {
  1466. this.cachedPlaceHolder = this.currentPlaceholder = val;
  1467. },
  1468. value: function value(val, oldVal) {
  1469. if (this.multiple) {
  1470. this.resetInputHeight();
  1471. if (val && val.length > 0 || this.$refs.input && this.query !== '') {
  1472. this.currentPlaceholder = '';
  1473. } else {
  1474. this.currentPlaceholder = this.cachedPlaceHolder;
  1475. }
  1476. if (this.filterable && !this.reserveKeyword) {
  1477. this.query = '';
  1478. this.handleQueryChange(this.query);
  1479. }
  1480. }
  1481. this.setSelected();
  1482. if (this.filterable && !this.multiple) {
  1483. this.inputLength = 20;
  1484. }
  1485. if (!Object(util_["valueEquals"])(val, oldVal)) {
  1486. this.dispatch('ElFormItem', 'el.form.change', val);
  1487. }
  1488. },
  1489. visible: function visible(val) {
  1490. var _this3 = this;
  1491. if (!val) {
  1492. this.broadcast('ElSelectDropdown', 'destroyPopper');
  1493. if (this.$refs.input) {
  1494. this.$refs.input.blur();
  1495. }
  1496. this.query = '';
  1497. this.previousQuery = null;
  1498. this.selectedLabel = '';
  1499. this.inputLength = 20;
  1500. this.menuVisibleOnFocus = false;
  1501. this.resetHoverIndex();
  1502. this.$nextTick(function () {
  1503. if (_this3.$refs.input && _this3.$refs.input.value === '' && _this3.selected.length === 0) {
  1504. _this3.currentPlaceholder = _this3.cachedPlaceHolder;
  1505. }
  1506. });
  1507. if (!this.multiple) {
  1508. if (this.selected) {
  1509. if (this.filterable && this.allowCreate && this.createdSelected && this.createdLabel) {
  1510. this.selectedLabel = this.createdLabel;
  1511. } else {
  1512. this.selectedLabel = this.selected.currentLabel;
  1513. }
  1514. if (this.filterable) this.query = this.selectedLabel;
  1515. }
  1516. if (this.filterable) {
  1517. this.currentPlaceholder = this.cachedPlaceHolder;
  1518. }
  1519. }
  1520. } else {
  1521. this.broadcast('ElSelectDropdown', 'updatePopper');
  1522. if (this.filterable) {
  1523. this.query = this.remote ? '' : this.selectedLabel;
  1524. this.handleQueryChange(this.query);
  1525. if (this.multiple) {
  1526. this.$refs.input.focus();
  1527. } else {
  1528. if (!this.remote) {
  1529. this.broadcast('ElOption', 'queryChange', '');
  1530. this.broadcast('ElOptionGroup', 'queryChange');
  1531. }
  1532. if (this.selectedLabel) {
  1533. this.currentPlaceholder = this.selectedLabel;
  1534. this.selectedLabel = '';
  1535. }
  1536. }
  1537. }
  1538. }
  1539. this.$emit('visible-change', val);
  1540. },
  1541. options: function options() {
  1542. var _this4 = this;
  1543. if (this.$isServer) return;
  1544. this.$nextTick(function () {
  1545. _this4.broadcast('ElSelectDropdown', 'updatePopper');
  1546. });
  1547. if (this.multiple) {
  1548. this.resetInputHeight();
  1549. }
  1550. var inputs = this.$el.querySelectorAll('input');
  1551. if ([].indexOf.call(inputs, document.activeElement) === -1) {
  1552. this.setSelected();
  1553. }
  1554. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  1555. this.checkDefaultFirstOption();
  1556. }
  1557. }
  1558. },
  1559. methods: {
  1560. handleComposition: function handleComposition(event) {
  1561. var _this5 = this;
  1562. var text = event.target.value;
  1563. if (event.type === 'compositionend') {
  1564. this.isOnComposition = false;
  1565. this.$nextTick(function (_) {
  1566. return _this5.handleQueryChange(text);
  1567. });
  1568. } else {
  1569. var lastCharacter = text[text.length - 1] || '';
  1570. this.isOnComposition = !Object(shared_["isKorean"])(lastCharacter);
  1571. }
  1572. },
  1573. handleQueryChange: function handleQueryChange(val) {
  1574. var _this6 = this;
  1575. if (this.previousQuery === val || this.isOnComposition) return;
  1576. if (this.previousQuery === null && (typeof this.filterMethod === 'function' || typeof this.remoteMethod === 'function')) {
  1577. this.previousQuery = val;
  1578. return;
  1579. }
  1580. this.previousQuery = val;
  1581. this.$nextTick(function () {
  1582. if (_this6.visible) _this6.broadcast('ElSelectDropdown', 'updatePopper');
  1583. });
  1584. this.hoverIndex = -1;
  1585. if (this.multiple && this.filterable) {
  1586. this.$nextTick(function () {
  1587. var length = _this6.$refs.input.value.length * 15 + 20;
  1588. _this6.inputLength = _this6.collapseTags ? Math.min(50, length) : length;
  1589. _this6.managePlaceholder();
  1590. _this6.resetInputHeight();
  1591. });
  1592. }
  1593. if (this.remote && typeof this.remoteMethod === 'function') {
  1594. this.hoverIndex = -1;
  1595. this.remoteMethod(val);
  1596. } else if (typeof this.filterMethod === 'function') {
  1597. this.filterMethod(val);
  1598. this.broadcast('ElOptionGroup', 'queryChange');
  1599. } else {
  1600. this.filteredOptionsCount = this.optionsCount;
  1601. this.broadcast('ElOption', 'queryChange', val);
  1602. this.broadcast('ElOptionGroup', 'queryChange');
  1603. }
  1604. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  1605. this.checkDefaultFirstOption();
  1606. }
  1607. },
  1608. scrollToOption: function scrollToOption(option) {
  1609. var target = Array.isArray(option) && option[0] ? option[0].$el : option.$el;
  1610. if (this.$refs.popper && target) {
  1611. var menu = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
  1612. scroll_into_view_default()(menu, target);
  1613. }
  1614. this.$refs.scrollbar && this.$refs.scrollbar.handleScroll();
  1615. },
  1616. handleMenuEnter: function handleMenuEnter() {
  1617. var _this7 = this;
  1618. this.$nextTick(function () {
  1619. return _this7.scrollToOption(_this7.selected);
  1620. });
  1621. },
  1622. emitChange: function emitChange(val) {
  1623. if (!Object(util_["valueEquals"])(this.value, val)) {
  1624. this.$emit('change', val);
  1625. }
  1626. },
  1627. getOption: function getOption(value) {
  1628. var option = void 0;
  1629. var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
  1630. var isNull = Object.prototype.toString.call(value).toLowerCase() === '[object null]';
  1631. var isUndefined = Object.prototype.toString.call(value).toLowerCase() === '[object undefined]';
  1632. for (var i = this.cachedOptions.length - 1; i >= 0; i--) {
  1633. var cachedOption = this.cachedOptions[i];
  1634. var isEqual = isObject ? Object(util_["getValueByPath"])(cachedOption.value, this.valueKey) === Object(util_["getValueByPath"])(value, this.valueKey) : cachedOption.value === value;
  1635. if (isEqual) {
  1636. option = cachedOption;
  1637. break;
  1638. }
  1639. }
  1640. if (option) return option;
  1641. var label = !isObject && !isNull && !isUndefined ? value : '';
  1642. var newOption = {
  1643. value: value,
  1644. currentLabel: label
  1645. };
  1646. if (this.multiple) {
  1647. newOption.hitState = false;
  1648. }
  1649. return newOption;
  1650. },
  1651. setSelected: function setSelected() {
  1652. var _this8 = this;
  1653. if (!this.multiple) {
  1654. var option = this.getOption(this.value);
  1655. if (option.created) {
  1656. this.createdLabel = option.currentLabel;
  1657. this.createdSelected = true;
  1658. } else {
  1659. this.createdSelected = false;
  1660. }
  1661. this.selectedLabel = option.currentLabel;
  1662. this.selected = option;
  1663. if (this.filterable) this.query = this.selectedLabel;
  1664. return;
  1665. }
  1666. var result = [];
  1667. if (Array.isArray(this.value)) {
  1668. this.value.forEach(function (value) {
  1669. result.push(_this8.getOption(value));
  1670. });
  1671. }
  1672. this.selected = result;
  1673. this.$nextTick(function () {
  1674. _this8.resetInputHeight();
  1675. });
  1676. },
  1677. handleFocus: function handleFocus(event) {
  1678. if (!this.softFocus) {
  1679. if (this.automaticDropdown || this.filterable) {
  1680. this.visible = true;
  1681. if (this.filterable) {
  1682. this.menuVisibleOnFocus = true;
  1683. }
  1684. }
  1685. this.$emit('focus', event);
  1686. } else {
  1687. this.softFocus = false;
  1688. }
  1689. },
  1690. blur: function blur() {
  1691. this.visible = false;
  1692. this.$refs.reference.blur();
  1693. },
  1694. handleBlur: function handleBlur(event) {
  1695. var _this9 = this;
  1696. setTimeout(function () {
  1697. if (_this9.isSilentBlur) {
  1698. _this9.isSilentBlur = false;
  1699. } else {
  1700. _this9.$emit('blur', event);
  1701. }
  1702. }, 50);
  1703. this.softFocus = false;
  1704. },
  1705. handleClearClick: function handleClearClick(event) {
  1706. this.deleteSelected(event);
  1707. },
  1708. doDestroy: function doDestroy() {
  1709. this.$refs.popper && this.$refs.popper.doDestroy();
  1710. },
  1711. handleClose: function handleClose() {
  1712. this.visible = false;
  1713. },
  1714. toggleLastOptionHitState: function toggleLastOptionHitState(hit) {
  1715. if (!Array.isArray(this.selected)) return;
  1716. var option = this.selected[this.selected.length - 1];
  1717. if (!option) return;
  1718. if (hit === true || hit === false) {
  1719. option.hitState = hit;
  1720. return hit;
  1721. }
  1722. option.hitState = !option.hitState;
  1723. return option.hitState;
  1724. },
  1725. deletePrevTag: function deletePrevTag(e) {
  1726. if (e.target.value.length <= 0 && !this.toggleLastOptionHitState()) {
  1727. var value = this.value.slice();
  1728. value.pop();
  1729. this.$emit('input', value);
  1730. this.emitChange(value);
  1731. }
  1732. },
  1733. managePlaceholder: function managePlaceholder() {
  1734. if (this.currentPlaceholder !== '') {
  1735. this.currentPlaceholder = this.$refs.input.value ? '' : this.cachedPlaceHolder;
  1736. }
  1737. },
  1738. resetInputState: function resetInputState(e) {
  1739. if (e.keyCode !== 8) this.toggleLastOptionHitState(false);
  1740. this.inputLength = this.$refs.input.value.length * 15 + 20;
  1741. this.resetInputHeight();
  1742. },
  1743. resetInputHeight: function resetInputHeight() {
  1744. var _this10 = this;
  1745. if (this.collapseTags && !this.filterable) return;
  1746. this.$nextTick(function () {
  1747. if (!_this10.$refs.reference) return;
  1748. var inputChildNodes = _this10.$refs.reference.$el.childNodes;
  1749. var input = [].filter.call(inputChildNodes, function (item) {
  1750. return item.tagName === 'INPUT';
  1751. })[0];
  1752. var tags = _this10.$refs.tags;
  1753. var sizeInMap = _this10.initialInputHeight || 40;
  1754. input.style.height = _this10.selected.length === 0 ? sizeInMap + 'px' : Math.max(tags ? tags.clientHeight + (tags.clientHeight > sizeInMap ? 6 : 0) : 0, sizeInMap) + 'px';
  1755. if (_this10.visible && _this10.emptyText !== false) {
  1756. _this10.broadcast('ElSelectDropdown', 'updatePopper');
  1757. }
  1758. });
  1759. },
  1760. resetHoverIndex: function resetHoverIndex() {
  1761. var _this11 = this;
  1762. setTimeout(function () {
  1763. if (!_this11.multiple) {
  1764. _this11.hoverIndex = _this11.options.indexOf(_this11.selected);
  1765. } else {
  1766. if (_this11.selected.length > 0) {
  1767. _this11.hoverIndex = Math.min.apply(null, _this11.selected.map(function (item) {
  1768. return _this11.options.indexOf(item);
  1769. }));
  1770. } else {
  1771. _this11.hoverIndex = -1;
  1772. }
  1773. }
  1774. }, 300);
  1775. },
  1776. handleOptionSelect: function handleOptionSelect(option, byClick) {
  1777. var _this12 = this;
  1778. if (this.multiple) {
  1779. var value = (this.value || []).slice();
  1780. var optionIndex = this.getValueIndex(value, option.value);
  1781. if (optionIndex > -1) {
  1782. value.splice(optionIndex, 1);
  1783. } else if (this.multipleLimit <= 0 || value.length < this.multipleLimit) {
  1784. value.push(option.value);
  1785. }
  1786. this.$emit('input', value);
  1787. this.emitChange(value);
  1788. if (option.created) {
  1789. this.query = '';
  1790. this.handleQueryChange('');
  1791. this.inputLength = 20;
  1792. }
  1793. if (this.filterable) this.$refs.input.focus();
  1794. } else {
  1795. this.$emit('input', option.value);
  1796. this.emitChange(option.value);
  1797. this.visible = false;
  1798. }
  1799. this.isSilentBlur = byClick;
  1800. this.setSoftFocus();
  1801. if (this.visible) return;
  1802. this.$nextTick(function () {
  1803. _this12.scrollToOption(option);
  1804. });
  1805. },
  1806. setSoftFocus: function setSoftFocus() {
  1807. this.softFocus = true;
  1808. var input = this.$refs.input || this.$refs.reference;
  1809. if (input) {
  1810. input.focus();
  1811. }
  1812. },
  1813. getValueIndex: function getValueIndex() {
  1814. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  1815. var value = arguments[1];
  1816. var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
  1817. if (!isObject) {
  1818. return arr.indexOf(value);
  1819. } else {
  1820. var valueKey = this.valueKey;
  1821. var index = -1;
  1822. arr.some(function (item, i) {
  1823. if (Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(value, valueKey)) {
  1824. index = i;
  1825. return true;
  1826. }
  1827. return false;
  1828. });
  1829. return index;
  1830. }
  1831. },
  1832. toggleMenu: function toggleMenu() {
  1833. if (!this.selectDisabled) {
  1834. if (this.menuVisibleOnFocus) {
  1835. this.menuVisibleOnFocus = false;
  1836. } else {
  1837. this.visible = !this.visible;
  1838. }
  1839. if (this.visible) {
  1840. (this.$refs.input || this.$refs.reference).focus();
  1841. }
  1842. }
  1843. },
  1844. selectOption: function selectOption() {
  1845. if (!this.visible) {
  1846. this.toggleMenu();
  1847. } else {
  1848. if (this.options[this.hoverIndex]) {
  1849. this.handleOptionSelect(this.options[this.hoverIndex]);
  1850. }
  1851. }
  1852. },
  1853. deleteSelected: function deleteSelected(event) {
  1854. event.stopPropagation();
  1855. var value = this.multiple ? [] : '';
  1856. this.$emit('input', value);
  1857. this.emitChange(value);
  1858. this.visible = false;
  1859. this.$emit('clear');
  1860. },
  1861. deleteTag: function deleteTag(event, tag) {
  1862. var index = this.selected.indexOf(tag);
  1863. if (index > -1 && !this.selectDisabled) {
  1864. var value = this.value.slice();
  1865. value.splice(index, 1);
  1866. this.$emit('input', value);
  1867. this.emitChange(value);
  1868. this.$emit('remove-tag', tag.value);
  1869. }
  1870. event.stopPropagation();
  1871. },
  1872. onInputChange: function onInputChange() {
  1873. if (this.filterable && this.query !== this.selectedLabel) {
  1874. this.query = this.selectedLabel;
  1875. this.handleQueryChange(this.query);
  1876. }
  1877. },
  1878. onOptionDestroy: function onOptionDestroy(index) {
  1879. if (index > -1) {
  1880. this.optionsCount--;
  1881. this.filteredOptionsCount--;
  1882. this.options.splice(index, 1);
  1883. }
  1884. },
  1885. resetInputWidth: function resetInputWidth() {
  1886. this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
  1887. },
  1888. handleResize: function handleResize() {
  1889. this.resetInputWidth();
  1890. if (this.multiple) this.resetInputHeight();
  1891. },
  1892. checkDefaultFirstOption: function checkDefaultFirstOption() {
  1893. this.hoverIndex = -1;
  1894. // highlight the created option
  1895. var hasCreated = false;
  1896. for (var i = this.options.length - 1; i >= 0; i--) {
  1897. if (this.options[i].created) {
  1898. hasCreated = true;
  1899. this.hoverIndex = i;
  1900. break;
  1901. }
  1902. }
  1903. if (hasCreated) return;
  1904. for (var _i = 0; _i !== this.options.length; ++_i) {
  1905. var option = this.options[_i];
  1906. if (this.query) {
  1907. // highlight first options that passes the filter
  1908. if (!option.disabled && !option.groupDisabled && option.visible) {
  1909. this.hoverIndex = _i;
  1910. break;
  1911. }
  1912. } else {
  1913. // highlight currently selected option
  1914. if (option.itemSelected) {
  1915. this.hoverIndex = _i;
  1916. break;
  1917. }
  1918. }
  1919. }
  1920. },
  1921. getValueKey: function getValueKey(item) {
  1922. if (Object.prototype.toString.call(item.value).toLowerCase() !== '[object object]') {
  1923. return item.value;
  1924. } else {
  1925. return Object(util_["getValueByPath"])(item.value, this.valueKey);
  1926. }
  1927. }
  1928. },
  1929. created: function created() {
  1930. var _this13 = this;
  1931. this.cachedPlaceHolder = this.currentPlaceholder = this.placeholder;
  1932. if (this.multiple && !Array.isArray(this.value)) {
  1933. this.$emit('input', []);
  1934. }
  1935. if (!this.multiple && Array.isArray(this.value)) {
  1936. this.$emit('input', '');
  1937. }
  1938. this.debouncedOnInputChange = debounce_default()(this.debounce, function () {
  1939. _this13.onInputChange();
  1940. });
  1941. this.debouncedQueryChange = debounce_default()(this.debounce, function (e) {
  1942. _this13.handleQueryChange(e.target.value);
  1943. });
  1944. this.$on('handleOptionClick', this.handleOptionSelect);
  1945. this.$on('setSelected', this.setSelected);
  1946. },
  1947. mounted: function mounted() {
  1948. var _this14 = this;
  1949. if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
  1950. this.currentPlaceholder = '';
  1951. }
  1952. Object(resize_event_["addResizeListener"])(this.$el, this.handleResize);
  1953. var reference = this.$refs.reference;
  1954. if (reference && reference.$el) {
  1955. var sizeMap = {
  1956. medium: 36,
  1957. small: 32,
  1958. mini: 28
  1959. };
  1960. var input = reference.$el.querySelector('input');
  1961. this.initialInputHeight = input.getBoundingClientRect().height || sizeMap[this.selectSize];
  1962. }
  1963. if (this.remote && this.multiple) {
  1964. this.resetInputHeight();
  1965. }
  1966. this.$nextTick(function () {
  1967. if (reference && reference.$el) {
  1968. _this14.inputWidth = reference.$el.getBoundingClientRect().width;
  1969. }
  1970. });
  1971. this.setSelected();
  1972. },
  1973. beforeDestroy: function beforeDestroy() {
  1974. if (this.$el && this.handleResize) Object(resize_event_["removeResizeListener"])(this.$el, this.handleResize);
  1975. }
  1976. });
  1977. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=script&lang=js&
  1978. /* harmony default export */ var src_selectvue_type_script_lang_js_ = (selectvue_type_script_lang_js_);
  1979. // CONCATENATED MODULE: ./packages/select/src/select.vue
  1980. /* normalize component */
  1981. var select_component = Object(componentNormalizer["a" /* default */])(
  1982. src_selectvue_type_script_lang_js_,
  1983. render,
  1984. staticRenderFns,
  1985. false,
  1986. null,
  1987. null,
  1988. null
  1989. )
  1990. /* hot reload */
  1991. if (false) { var select_api; }
  1992. select_component.options.__file = "packages/select/src/select.vue"
  1993. /* harmony default export */ var src_select = (select_component.exports);
  1994. // CONCATENATED MODULE: ./packages/select/index.js
  1995. /* istanbul ignore next */
  1996. src_select.install = function (Vue) {
  1997. Vue.component(src_select.name, src_select);
  1998. };
  1999. /* harmony default export */ var packages_select = __webpack_exports__["default"] = (src_select);
  2000. /***/ })
  2001. /******/ ]);