mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-05-07 23:27:48 +08:00
1423 lines
36 KiB
JavaScript
1423 lines
36 KiB
JavaScript
![]() |
module.exports =
|
||
|
/******/ (function(modules) { // webpackBootstrap
|
||
|
/******/ // The module cache
|
||
|
/******/ var installedModules = {};
|
||
|
|
||
|
/******/ // The require function
|
||
|
/******/ function __webpack_require__(moduleId) {
|
||
|
|
||
|
/******/ // Check if module is in cache
|
||
|
/******/ if(installedModules[moduleId])
|
||
|
/******/ return installedModules[moduleId].exports;
|
||
|
|
||
|
/******/ // Create a new module (and put it into the cache)
|
||
|
/******/ var module = installedModules[moduleId] = {
|
||
|
/******/ exports: {},
|
||
|
/******/ id: moduleId,
|
||
|
/******/ loaded: false
|
||
|
/******/ };
|
||
|
|
||
|
/******/ // Execute the module function
|
||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||
|
|
||
|
/******/ // Flag the module as loaded
|
||
|
/******/ module.loaded = true;
|
||
|
|
||
|
/******/ // Return the exports of the module
|
||
|
/******/ return module.exports;
|
||
|
/******/ }
|
||
|
|
||
|
|
||
|
/******/ // expose the modules object (__webpack_modules__)
|
||
|
/******/ __webpack_require__.m = modules;
|
||
|
|
||
|
/******/ // expose the module cache
|
||
|
/******/ __webpack_require__.c = installedModules;
|
||
|
|
||
|
/******/ // __webpack_public_path__
|
||
|
/******/ __webpack_require__.p = "/dist/";
|
||
|
|
||
|
/******/ // Load entry module and return exports
|
||
|
/******/ return __webpack_require__(0);
|
||
|
/******/ })
|
||
|
/************************************************************************/
|
||
|
/******/ ({
|
||
|
|
||
|
/***/ 0:
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
module.exports = __webpack_require__(260);
|
||
|
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 3:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = function normalizeComponent (
|
||
|
rawScriptExports,
|
||
|
compiledTemplate,
|
||
|
scopeId,
|
||
|
cssModules
|
||
|
) {
|
||
|
var esModule
|
||
|
var scriptExports = rawScriptExports = rawScriptExports || {}
|
||
|
|
||
|
// ES6 modules interop
|
||
|
var type = typeof rawScriptExports.default
|
||
|
if (type === 'object' || type === 'function') {
|
||
|
esModule = rawScriptExports
|
||
|
scriptExports = rawScriptExports.default
|
||
|
}
|
||
|
|
||
|
// Vue.extend constructor export interop
|
||
|
var options = typeof scriptExports === 'function'
|
||
|
? scriptExports.options
|
||
|
: scriptExports
|
||
|
|
||
|
// render functions
|
||
|
if (compiledTemplate) {
|
||
|
options.render = compiledTemplate.render
|
||
|
options.staticRenderFns = compiledTemplate.staticRenderFns
|
||
|
}
|
||
|
|
||
|
// scopedId
|
||
|
if (scopeId) {
|
||
|
options._scopeId = scopeId
|
||
|
}
|
||
|
|
||
|
// inject cssModules
|
||
|
if (cssModules) {
|
||
|
var computed = options.computed || (options.computed = {})
|
||
|
Object.keys(cssModules).forEach(function (key) {
|
||
|
var module = cssModules[key]
|
||
|
computed[key] = function () { return module }
|
||
|
})
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
esModule: esModule,
|
||
|
exports: scriptExports,
|
||
|
options: options
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 9:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = require("element-ui/lib/input");
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 10:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = require("element-ui/lib/utils/clickoutside");
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 13:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = require("element-ui/lib/utils/vue-popper");
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 14:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = require("element-ui/lib/mixins/emitter");
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 15:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = require("element-ui/lib/scrollbar");
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 46:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = require("throttle-debounce/debounce");
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 47:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = require("element-ui/lib/utils/resize-event");
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 60:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = require("element-ui/lib/mixins/locale");
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 61:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = require("element-ui/lib/locale");
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 117:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = require("element-ui/lib/utils/dom");
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 211:
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var Component = __webpack_require__(3)(
|
||
|
/* script */
|
||
|
__webpack_require__(212),
|
||
|
/* template */
|
||
|
__webpack_require__(213),
|
||
|
/* scopeId */
|
||
|
null,
|
||
|
/* cssModules */
|
||
|
null
|
||
|
)
|
||
|
|
||
|
module.exports = Component.exports
|
||
|
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 212:
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
|
||
|
var _emitter = __webpack_require__(14);
|
||
|
|
||
|
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
|
||
|
exports.default = {
|
||
|
mixins: [_emitter2.default],
|
||
|
|
||
|
name: 'ElOption',
|
||
|
|
||
|
componentName: 'ElOption',
|
||
|
|
||
|
props: {
|
||
|
value: {
|
||
|
required: true
|
||
|
},
|
||
|
label: [String, Number],
|
||
|
created: Boolean,
|
||
|
disabled: {
|
||
|
type: Boolean,
|
||
|
default: false
|
||
|
}
|
||
|
},
|
||
|
|
||
|
data: function data() {
|
||
|
return {
|
||
|
index: -1,
|
||
|
groupDisabled: false,
|
||
|
visible: true,
|
||
|
hitState: false
|
||
|
};
|
||
|
},
|
||
|
|
||
|
|
||
|
computed: {
|
||
|
currentLabel: function currentLabel() {
|
||
|
return this.label || (typeof this.value === 'string' || typeof this.value === 'number' ? this.value : '');
|
||
|
},
|
||
|
currentValue: function currentValue() {
|
||
|
return this.value || this.label || '';
|
||
|
},
|
||
|
parent: function parent() {
|
||
|
var result = this.$parent;
|
||
|
while (!result.isSelect) {
|
||
|
result = result.$parent;
|
||
|
}
|
||
|
return result;
|
||
|
},
|
||
|
itemSelected: function itemSelected() {
|
||
|
if (!this.parent.multiple) {
|
||
|
return this.value === this.parent.value;
|
||
|
} else {
|
||
|
return this.parent.value.indexOf(this.value) > -1;
|
||
|
}
|
||
|
},
|
||
|
limitReached: function limitReached() {
|
||
|
if (this.parent.multiple) {
|
||
|
return !this.itemSelected && this.parent.value.length >= this.parent.multipleLimit && this.parent.multipleLimit > 0;
|
||
|
} else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
|
||
|
watch: {
|
||
|
currentLabel: function currentLabel() {
|
||
|
if (!this.created && !this.parent.remote) this.dispatch('ElSelect', 'setSelected');
|
||
|
},
|
||
|
value: function value() {
|
||
|
if (!this.created && !this.parent.remote) this.dispatch('ElSelect', 'setSelected');
|
||
|
}
|
||
|
},
|
||
|
|
||
|
methods: {
|
||
|
handleGroupDisabled: function handleGroupDisabled(val) {
|
||
|
this.groupDisabled = val;
|
||
|
},
|
||
|
hoverItem: function hoverItem() {
|
||
|
if (!this.disabled && !this.groupDisabled) {
|
||
|
this.parent.hoverIndex = this.parent.options.indexOf(this);
|
||
|
}
|
||
|
},
|
||
|
selectOptionClick: function selectOptionClick() {
|
||
|
if (this.disabled !== true && this.groupDisabled !== true) {
|
||
|
this.dispatch('ElSelect', 'handleOptionClick', this);
|
||
|
}
|
||
|
},
|
||
|
queryChange: function queryChange(query) {
|
||
|
// query 里如果有正则中的特殊字符,需要先将这些字符转义
|
||
|
var parsedQuery = String(query).replace(/(\^|\(|\)|\[|\]|\$|\*|\+|\.|\?|\\|\{|\}|\|)/g, '\\$1');
|
||
|
this.visible = new RegExp(parsedQuery, 'i').test(this.currentLabel) || this.created;
|
||
|
if (!this.visible) {
|
||
|
this.parent.filteredOptionsCount--;
|
||
|
}
|
||
|
},
|
||
|
resetIndex: function resetIndex() {
|
||
|
var _this = this;
|
||
|
|
||
|
this.$nextTick(function () {
|
||
|
_this.index = _this.parent.options.indexOf(_this);
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
|
||
|
created: function created() {
|
||
|
this.parent.options.push(this);
|
||
|
this.parent.cachedOptions.push(this);
|
||
|
this.parent.optionsCount++;
|
||
|
this.parent.filteredOptionsCount++;
|
||
|
this.index = this.parent.options.indexOf(this);
|
||
|
|
||
|
this.$on('queryChange', this.queryChange);
|
||
|
this.$on('handleGroupDisabled', this.handleGroupDisabled);
|
||
|
this.$on('resetIndex', this.resetIndex);
|
||
|
},
|
||
|
beforeDestroy: function beforeDestroy() {
|
||
|
this.dispatch('ElSelect', 'onOptionDestroy', this);
|
||
|
}
|
||
|
}; //
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 213:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
|
return _c('li', {
|
||
|
directives: [{
|
||
|
name: "show",
|
||
|
rawName: "v-show",
|
||
|
value: (_vm.visible),
|
||
|
expression: "visible"
|
||
|
}],
|
||
|
staticClass: "el-select-dropdown__item",
|
||
|
class: {
|
||
|
'selected': _vm.itemSelected,
|
||
|
'is-disabled': _vm.disabled || _vm.groupDisabled || _vm.limitReached,
|
||
|
'hover': _vm.parent.hoverIndex === _vm.index
|
||
|
},
|
||
|
on: {
|
||
|
"mouseenter": _vm.hoverItem,
|
||
|
"click": function($event) {
|
||
|
$event.stopPropagation();
|
||
|
_vm.selectOptionClick($event)
|
||
|
}
|
||
|
}
|
||
|
}, [_vm._t("default", [_c('span', [_vm._v(_vm._s(_vm.currentLabel))])])], 2)
|
||
|
},staticRenderFns: []}
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 260:
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
|
||
|
var _select = __webpack_require__(261);
|
||
|
|
||
|
var _select2 = _interopRequireDefault(_select);
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
|
||
|
/* istanbul ignore next */
|
||
|
_select2.default.install = function (Vue) {
|
||
|
Vue.component(_select2.default.name, _select2.default);
|
||
|
};
|
||
|
|
||
|
exports.default = _select2.default;
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 261:
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var Component = __webpack_require__(3)(
|
||
|
/* script */
|
||
|
__webpack_require__(262),
|
||
|
/* template */
|
||
|
__webpack_require__(267),
|
||
|
/* scopeId */
|
||
|
null,
|
||
|
/* cssModules */
|
||
|
null
|
||
|
)
|
||
|
|
||
|
module.exports = Component.exports
|
||
|
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 262:
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
|
||
|
var _emitter = __webpack_require__(14);
|
||
|
|
||
|
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
|
||
|
var _locale = __webpack_require__(60);
|
||
|
|
||
|
var _locale2 = _interopRequireDefault(_locale);
|
||
|
|
||
|
var _input = __webpack_require__(9);
|
||
|
|
||
|
var _input2 = _interopRequireDefault(_input);
|
||
|
|
||
|
var _selectDropdown = __webpack_require__(263);
|
||
|
|
||
|
var _selectDropdown2 = _interopRequireDefault(_selectDropdown);
|
||
|
|
||
|
var _option = __webpack_require__(211);
|
||
|
|
||
|
var _option2 = _interopRequireDefault(_option);
|
||
|
|
||
|
var _tag = __webpack_require__(266);
|
||
|
|
||
|
var _tag2 = _interopRequireDefault(_tag);
|
||
|
|
||
|
var _scrollbar = __webpack_require__(15);
|
||
|
|
||
|
var _scrollbar2 = _interopRequireDefault(_scrollbar);
|
||
|
|
||
|
var _debounce = __webpack_require__(46);
|
||
|
|
||
|
var _debounce2 = _interopRequireDefault(_debounce);
|
||
|
|
||
|
var _clickoutside = __webpack_require__(10);
|
||
|
|
||
|
var _clickoutside2 = _interopRequireDefault(_clickoutside);
|
||
|
|
||
|
var _dom = __webpack_require__(117);
|
||
|
|
||
|
var _resizeEvent = __webpack_require__(47);
|
||
|
|
||
|
var _locale3 = __webpack_require__(61);
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
|
||
|
var sizeMap = {
|
||
|
'large': 42,
|
||
|
'small': 30,
|
||
|
'mini': 22
|
||
|
};
|
||
|
|
||
|
exports.default = {
|
||
|
mixins: [_emitter2.default, _locale2.default],
|
||
|
|
||
|
name: 'ElSelect',
|
||
|
|
||
|
componentName: 'ElSelect',
|
||
|
|
||
|
computed: {
|
||
|
iconClass: function iconClass() {
|
||
|
var criteria = this.clearable && !this.disabled && this.inputHovering && !this.multiple && this.value !== undefined && this.value !== '';
|
||
|
return criteria ? 'circle-close is-show-close' : this.remote && this.filterable ? '' : 'caret-top';
|
||
|
},
|
||
|
debounce: function debounce() {
|
||
|
return this.remote ? 300 : 0;
|
||
|
},
|
||
|
emptyText: function emptyText() {
|
||
|
if (this.loading) {
|
||
|
return this.loadingText || this.t('el.select.loading');
|
||
|
} else {
|
||
|
if (this.remote && this.query === '' && this.options.length === 0) return false;
|
||
|
if (this.filterable && this.options.length > 0 && this.filteredOptionsCount === 0) {
|
||
|
return this.noMatchText || this.t('el.select.noMatch');
|
||
|
}
|
||
|
if (this.options.length === 0) {
|
||
|
return this.noDataText || this.t('el.select.noData');
|
||
|
}
|
||
|
}
|
||
|
return null;
|
||
|
},
|
||
|
showNewOption: function showNewOption() {
|
||
|
var _this = this;
|
||
|
|
||
|
var hasExistingOption = this.options.filter(function (option) {
|
||
|
return !option.created;
|
||
|
}).some(function (option) {
|
||
|
return option.currentLabel === _this.query;
|
||
|
});
|
||
|
return this.filterable && this.allowCreate && this.query !== '' && !hasExistingOption;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
components: {
|
||
|
ElInput: _input2.default,
|
||
|
ElSelectMenu: _selectDropdown2.default,
|
||
|
ElOption: _option2.default,
|
||
|
ElTag: _tag2.default,
|
||
|
ElScrollbar: _scrollbar2.default
|
||
|
},
|
||
|
|
||
|
directives: { Clickoutside: _clickoutside2.default },
|
||
|
|
||
|
props: {
|
||
|
name: String,
|
||
|
value: {},
|
||
|
size: String,
|
||
|
disabled: Boolean,
|
||
|
clearable: Boolean,
|
||
|
filterable: Boolean,
|
||
|
allowCreate: Boolean,
|
||
|
loading: Boolean,
|
||
|
popperClass: String,
|
||
|
remote: Boolean,
|
||
|
loadingText: String,
|
||
|
noMatchText: String,
|
||
|
noDataText: String,
|
||
|
remoteMethod: Function,
|
||
|
filterMethod: Function,
|
||
|
multiple: Boolean,
|
||
|
multipleLimit: {
|
||
|
type: Number,
|
||
|
default: 0
|
||
|
},
|
||
|
placeholder: {
|
||
|
type: String,
|
||
|
default: function _default() {
|
||
|
return (0, _locale3.t)('el.select.placeholder');
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
|
||
|
data: function data() {
|
||
|
return {
|
||
|
options: [],
|
||
|
cachedOptions: [],
|
||
|
createdLabel: null,
|
||
|
createdSelected: false,
|
||
|
selected: this.multiple ? [] : {},
|
||
|
isSelect: true,
|
||
|
inputLength: 20,
|
||
|
inputWidth: 0,
|
||
|
cachedPlaceHolder: '',
|
||
|
optionsCount: 0,
|
||
|
filteredOptionsCount: 0,
|
||
|
dropdownUl: null,
|
||
|
visible: false,
|
||
|
selectedLabel: '',
|
||
|
hoverIndex: -1,
|
||
|
query: '',
|
||
|
bottomOverflow: 0,
|
||
|
topOverflow: 0,
|
||
|
optionsAllDisabled: false,
|
||
|
inputHovering: false,
|
||
|
currentPlaceholder: ''
|
||
|
};
|
||
|
},
|
||
|
|
||
|
|
||
|
watch: {
|
||
|
placeholder: function placeholder(val) {
|
||
|
this.cachedPlaceHolder = this.currentPlaceholder = val;
|
||
|
},
|
||
|
value: function value(val) {
|
||
|
if (this.multiple) {
|
||
|
this.resetInputHeight();
|
||
|
if (val.length > 0 || this.$refs.input && this.query !== '') {
|
||
|
this.currentPlaceholder = '';
|
||
|
} else {
|
||
|
this.currentPlaceholder = this.cachedPlaceHolder;
|
||
|
}
|
||
|
}
|
||
|
this.setSelected();
|
||
|
if (this.filterable && !this.multiple) {
|
||
|
this.inputLength = 20;
|
||
|
}
|
||
|
this.$emit('change', val);
|
||
|
this.dispatch('ElFormItem', 'el.form.change', val);
|
||
|
},
|
||
|
query: function query(val) {
|
||
|
var _this2 = this;
|
||
|
|
||
|
this.$nextTick(function () {
|
||
|
if (_this2.visible) _this2.broadcast('ElSelectDropdown', 'updatePopper');
|
||
|
});
|
||
|
this.hoverIndex = -1;
|
||
|
if (this.multiple && this.filterable) {
|
||
|
this.inputLength = this.$refs.input.value.length * 15 + 20;
|
||
|
this.managePlaceholder();
|
||
|
this.resetInputHeight();
|
||
|
}
|
||
|
if (this.remote && typeof this.remoteMethod === 'function') {
|
||
|
this.hoverIndex = -1;
|
||
|
this.remoteMethod(val);
|
||
|
this.broadcast('ElOption', 'resetIndex');
|
||
|
} else if (typeof this.filterMethod === 'function') {
|
||
|
this.filterMethod(val);
|
||
|
this.broadcast('ElOptionGroup', 'queryChange');
|
||
|
} else {
|
||
|
this.filteredOptionsCount = this.optionsCount;
|
||
|
this.broadcast('ElOption', 'queryChange', val);
|
||
|
this.broadcast('ElOptionGroup', 'queryChange');
|
||
|
}
|
||
|
},
|
||
|
visible: function visible(val) {
|
||
|
var _this3 = this;
|
||
|
|
||
|
if (!val) {
|
||
|
this.$refs.reference.$el.querySelector('input').blur();
|
||
|
this.handleIconHide();
|
||
|
this.broadcast('ElSelectDropdown', 'destroyPopper');
|
||
|
if (this.$refs.input) {
|
||
|
this.$refs.input.blur();
|
||
|
}
|
||
|
this.query = '';
|
||
|
this.selectedLabel = '';
|
||
|
this.inputLength = 20;
|
||
|
this.resetHoverIndex();
|
||
|
this.$nextTick(function () {
|
||
|
if (_this3.$refs.input && _this3.$refs.input.value === '' && _this3.selected.length === 0) {
|
||
|
_this3.currentPlaceholder = _this3.cachedPlaceHolder;
|
||
|
}
|
||
|
});
|
||
|
if (!this.multiple) {
|
||
|
this.getOverflows();
|
||
|
if (this.selected) {
|
||
|
if (this.filterable && this.allowCreate && this.createdSelected && this.createdOption) {
|
||
|
this.selectedLabel = this.createdLabel;
|
||
|
} else {
|
||
|
this.selectedLabel = this.selected.currentLabel;
|
||
|
}
|
||
|
if (this.filterable) this.query = this.selectedLabel;
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
this.handleIconShow();
|
||
|
this.broadcast('ElSelectDropdown', 'updatePopper');
|
||
|
if (this.filterable) {
|
||
|
this.query = this.selectedLabel;
|
||
|
if (this.multiple) {
|
||
|
this.$refs.input.focus();
|
||
|
} else {
|
||
|
if (!this.remote) {
|
||
|
this.broadcast('ElOption', 'queryChange', '');
|
||
|
this.broadcast('ElOptionGroup', 'queryChange');
|
||
|
}
|
||
|
this.broadcast('ElInput', 'inputSelect');
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
this.$emit('visible-change', val);
|
||
|
},
|
||
|
options: function options(val) {
|
||
|
if (this.$isServer) return;
|
||
|
this.optionsAllDisabled = val.length === val.filter(function (item) {
|
||
|
return item.disabled === true;
|
||
|
}).length;
|
||
|
if (this.multiple) {
|
||
|
this.resetInputHeight();
|
||
|
}
|
||
|
var inputs = this.$el.querySelectorAll('input');
|
||
|
if ([].indexOf.call(inputs, document.activeElement) === -1) {
|
||
|
this.setSelected();
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
|
||
|
methods: {
|
||
|
handleIconHide: function handleIconHide() {
|
||
|
var icon = this.$el.querySelector('.el-input__icon');
|
||
|
if (icon) {
|
||
|
(0, _dom.removeClass)(icon, 'is-reverse');
|
||
|
}
|
||
|
},
|
||
|
handleIconShow: function handleIconShow() {
|
||
|
var icon = this.$el.querySelector('.el-input__icon');
|
||
|
if (icon && !(0, _dom.hasClass)(icon, 'el-icon-circle-close')) {
|
||
|
(0, _dom.addClass)(icon, 'is-reverse');
|
||
|
}
|
||
|
},
|
||
|
handleMenuEnter: function handleMenuEnter() {
|
||
|
if (!this.dropdownUl) {
|
||
|
this.dropdownUl = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
|
||
|
this.getOverflows();
|
||
|
}
|
||
|
if (!this.multiple && this.dropdownUl) {
|
||
|
this.resetMenuScroll();
|
||
|
}
|
||
|
},
|
||
|
getOverflows: function getOverflows() {
|
||
|
if (this.dropdownUl && this.selected && this.selected.$el) {
|
||
|
var selectedRect = this.selected.$el.getBoundingClientRect();
|
||
|
var popperRect = this.$refs.popper.$el.getBoundingClientRect();
|
||
|
this.bottomOverflow = selectedRect.bottom - popperRect.bottom;
|
||
|
this.topOverflow = selectedRect.top - popperRect.top;
|
||
|
}
|
||
|
},
|
||
|
resetMenuScroll: function resetMenuScroll() {
|
||
|
if (this.bottomOverflow > 0) {
|
||
|
this.dropdownUl.scrollTop += this.bottomOverflow;
|
||
|
} else if (this.topOverflow < 0) {
|
||
|
this.dropdownUl.scrollTop += this.topOverflow;
|
||
|
}
|
||
|
},
|
||
|
getOption: function getOption(value) {
|
||
|
var option = void 0;
|
||
|
for (var i = this.cachedOptions.length - 1; i >= 0; i--) {
|
||
|
var cachedOption = this.cachedOptions[i];
|
||
|
if (cachedOption.value === value) {
|
||
|
option = cachedOption;
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
if (option) return option;
|
||
|
var label = typeof value === 'string' || typeof value === 'number' ? value : '';
|
||
|
var newOption = {
|
||
|
value: value,
|
||
|
currentLabel: label
|
||
|
};
|
||
|
if (this.multiple) {
|
||
|
newOption.hitState = false;
|
||
|
}
|
||
|
return newOption;
|
||
|
},
|
||
|
setSelected: function setSelected() {
|
||
|
var _this4 = this;
|
||
|
|
||
|
if (!this.multiple) {
|
||
|
var option = this.getOption(this.value);
|
||
|
if (option.created) {
|
||
|
this.createdLabel = option.currentLabel;
|
||
|
this.createdSelected = true;
|
||
|
} else {
|
||
|
this.createdSelected = false;
|
||
|
}
|
||
|
this.selectedLabel = option.currentLabel;
|
||
|
this.selected = option;
|
||
|
if (this.filterable) this.query = this.selectedLabel;
|
||
|
return;
|
||
|
}
|
||
|
var result = [];
|
||
|
if (Array.isArray(this.value)) {
|
||
|
this.value.forEach(function (value) {
|
||
|
result.push(_this4.getOption(value));
|
||
|
});
|
||
|
}
|
||
|
this.selected = result;
|
||
|
this.$nextTick(function () {
|
||
|
_this4.resetInputHeight();
|
||
|
});
|
||
|
},
|
||
|
handleFocus: function handleFocus() {
|
||
|
this.visible = true;
|
||
|
},
|
||
|
handleIconClick: function handleIconClick(event) {
|
||
|
if (this.iconClass.indexOf('circle-close') > -1) {
|
||
|
this.deleteSelected(event);
|
||
|
} else {
|
||
|
this.toggleMenu();
|
||
|
}
|
||
|
},
|
||
|
handleMouseDown: function handleMouseDown(event) {
|
||
|
if (event.target.tagName !== 'INPUT') return;
|
||
|
if (this.visible) {
|
||
|
this.handleClose();
|
||
|
event.preventDefault();
|
||
|
}
|
||
|
},
|
||
|
doDestroy: function doDestroy() {
|
||
|
this.$refs.popper && this.$refs.popper.doDestroy();
|
||
|
},
|
||
|
handleClose: function handleClose() {
|
||
|
this.visible = false;
|
||
|
},
|
||
|
toggleLastOptionHitState: function toggleLastOptionHitState(hit) {
|
||
|
if (!Array.isArray(this.selected)) return;
|
||
|
var option = this.selected[this.selected.length - 1];
|
||
|
if (!option) return;
|
||
|
|
||
|
if (hit === true || hit === false) {
|
||
|
option.hitState = hit;
|
||
|
return hit;
|
||
|
}
|
||
|
|
||
|
option.hitState = !option.hitState;
|
||
|
return option.hitState;
|
||
|
},
|
||
|
deletePrevTag: function deletePrevTag(e) {
|
||
|
if (e.target.value.length <= 0 && !this.toggleLastOptionHitState()) {
|
||
|
this.value.pop();
|
||
|
}
|
||
|
},
|
||
|
managePlaceholder: function managePlaceholder() {
|
||
|
if (this.currentPlaceholder !== '') {
|
||
|
this.currentPlaceholder = this.$refs.input.value ? '' : this.cachedPlaceHolder;
|
||
|
}
|
||
|
},
|
||
|
resetInputState: function resetInputState(e) {
|
||
|
if (e.keyCode !== 8) this.toggleLastOptionHitState(false);
|
||
|
this.inputLength = this.$refs.input.value.length * 15 + 20;
|
||
|
this.resetInputHeight();
|
||
|
},
|
||
|
resetInputHeight: function resetInputHeight() {
|
||
|
var _this5 = this;
|
||
|
|
||
|
this.$nextTick(function () {
|
||
|
if (!_this5.$refs.reference) return;
|
||
|
var inputChildNodes = _this5.$refs.reference.$el.childNodes;
|
||
|
var input = [].filter.call(inputChildNodes, function (item) {
|
||
|
return item.tagName === 'INPUT';
|
||
|
})[0];
|
||
|
input.style.height = Math.max(_this5.$refs.tags.clientHeight + 6, sizeMap[_this5.size] || 36) + 'px';
|
||
|
if (_this5.visible && _this5.emptyText !== false) {
|
||
|
_this5.broadcast('ElSelectDropdown', 'updatePopper');
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
resetHoverIndex: function resetHoverIndex() {
|
||
|
var _this6 = this;
|
||
|
|
||
|
setTimeout(function () {
|
||
|
if (!_this6.multiple) {
|
||
|
_this6.hoverIndex = _this6.options.indexOf(_this6.selected);
|
||
|
} else {
|
||
|
if (_this6.selected.length > 0) {
|
||
|
_this6.hoverIndex = Math.min.apply(null, _this6.selected.map(function (item) {
|
||
|
return _this6.options.indexOf(item);
|
||
|
}));
|
||
|
} else {
|
||
|
_this6.hoverIndex = -1;
|
||
|
}
|
||
|
}
|
||
|
}, 300);
|
||
|
},
|
||
|
handleOptionSelect: function handleOptionSelect(option) {
|
||
|
if (!this.multiple) {
|
||
|
this.$emit('input', option.value);
|
||
|
this.visible = false;
|
||
|
} else {
|
||
|
var optionIndex = -1;
|
||
|
this.value.forEach(function (item, index) {
|
||
|
if (item === option.value) {
|
||
|
optionIndex = index;
|
||
|
}
|
||
|
});
|
||
|
if (optionIndex > -1) {
|
||
|
this.value.splice(optionIndex, 1);
|
||
|
} else if (this.multipleLimit <= 0 || this.value.length < this.multipleLimit) {
|
||
|
this.value.push(option.value);
|
||
|
}
|
||
|
if (option.created) {
|
||
|
this.query = '';
|
||
|
this.inputLength = 20;
|
||
|
}
|
||
|
if (this.filterable) this.$refs.input.focus();
|
||
|
}
|
||
|
},
|
||
|
toggleMenu: function toggleMenu() {
|
||
|
if (this.filterable && this.query === '' && this.visible) {
|
||
|
return;
|
||
|
}
|
||
|
if (!this.disabled) {
|
||
|
this.visible = !this.visible;
|
||
|
}
|
||
|
},
|
||
|
navigateOptions: function navigateOptions(direction) {
|
||
|
if (!this.visible) {
|
||
|
this.visible = true;
|
||
|
return;
|
||
|
}
|
||
|
if (this.options.length === 0 || this.filteredOptionsCount === 0) return;
|
||
|
if (!this.optionsAllDisabled) {
|
||
|
if (direction === 'next') {
|
||
|
this.hoverIndex++;
|
||
|
if (this.hoverIndex === this.options.length) {
|
||
|
this.hoverIndex = 0;
|
||
|
}
|
||
|
this.resetScrollTop();
|
||
|
if (this.options[this.hoverIndex].disabled === true || this.options[this.hoverIndex].groupDisabled === true || !this.options[this.hoverIndex].visible) {
|
||
|
this.navigateOptions('next');
|
||
|
}
|
||
|
}
|
||
|
if (direction === 'prev') {
|
||
|
this.hoverIndex--;
|
||
|
if (this.hoverIndex < 0) {
|
||
|
this.hoverIndex = this.options.length - 1;
|
||
|
}
|
||
|
this.resetScrollTop();
|
||
|
if (this.options[this.hoverIndex].disabled === true || this.options[this.hoverIndex].groupDisabled === true || !this.options[this.hoverIndex].visible) {
|
||
|
this.navigateOptions('prev');
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
resetScrollTop: function resetScrollTop() {
|
||
|
var bottomOverflowDistance = this.options[this.hoverIndex].$el.getBoundingClientRect().bottom - this.$refs.popper.$el.getBoundingClientRect().bottom;
|
||
|
var topOverflowDistance = this.options[this.hoverIndex].$el.getBoundingClientRect().top - this.$refs.popper.$el.getBoundingClientRect().top;
|
||
|
if (bottomOverflowDistance > 0) {
|
||
|
this.dropdownUl.scrollTop += bottomOverflowDistance;
|
||
|
}
|
||
|
if (topOverflowDistance < 0) {
|
||
|
this.dropdownUl.scrollTop += topOverflowDistance;
|
||
|
}
|
||
|
},
|
||
|
selectOption: function selectOption() {
|
||
|
if (this.options[this.hoverIndex]) {
|
||
|
this.handleOptionSelect(this.options[this.hoverIndex]);
|
||
|
}
|
||
|
},
|
||
|
deleteSelected: function deleteSelected(event) {
|
||
|
event.stopPropagation();
|
||
|
this.$emit('input', '');
|
||
|
this.visible = false;
|
||
|
},
|
||
|
deleteTag: function deleteTag(event, tag) {
|
||
|
var index = this.selected.indexOf(tag);
|
||
|
if (index > -1 && !this.disabled) {
|
||
|
this.value.splice(index, 1);
|
||
|
this.$emit('remove-tag', tag);
|
||
|
}
|
||
|
event.stopPropagation();
|
||
|
},
|
||
|
onInputChange: function onInputChange() {
|
||
|
if (this.filterable) {
|
||
|
this.query = this.selectedLabel;
|
||
|
}
|
||
|
},
|
||
|
onOptionDestroy: function onOptionDestroy(option) {
|
||
|
this.optionsCount--;
|
||
|
this.filteredOptionsCount--;
|
||
|
var index = this.options.indexOf(option);
|
||
|
if (index > -1) {
|
||
|
this.options.splice(index, 1);
|
||
|
}
|
||
|
this.broadcast('ElOption', 'resetIndex');
|
||
|
},
|
||
|
resetInputWidth: function resetInputWidth() {
|
||
|
this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
|
||
|
},
|
||
|
handleResize: function handleResize() {
|
||
|
this.resetInputWidth();
|
||
|
if (this.multiple) this.resetInputHeight();
|
||
|
}
|
||
|
},
|
||
|
|
||
|
created: function created() {
|
||
|
var _this7 = this;
|
||
|
|
||
|
this.cachedPlaceHolder = this.currentPlaceholder = this.placeholder;
|
||
|
if (this.multiple && !Array.isArray(this.value)) {
|
||
|
this.$emit('input', []);
|
||
|
}
|
||
|
if (!this.multiple && Array.isArray(this.value)) {
|
||
|
this.$emit('input', '');
|
||
|
}
|
||
|
this.setSelected();
|
||
|
|
||
|
this.debouncedOnInputChange = (0, _debounce2.default)(this.debounce, function () {
|
||
|
_this7.onInputChange();
|
||
|
});
|
||
|
|
||
|
this.$on('handleOptionClick', this.handleOptionSelect);
|
||
|
this.$on('onOptionDestroy', this.onOptionDestroy);
|
||
|
this.$on('setSelected', this.setSelected);
|
||
|
},
|
||
|
mounted: function mounted() {
|
||
|
var _this8 = this;
|
||
|
|
||
|
if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
|
||
|
this.currentPlaceholder = '';
|
||
|
}
|
||
|
(0, _resizeEvent.addResizeListener)(this.$el, this.handleResize);
|
||
|
if (this.remote && this.multiple) {
|
||
|
this.resetInputHeight();
|
||
|
}
|
||
|
this.$nextTick(function () {
|
||
|
if (_this8.$refs.reference && _this8.$refs.reference.$el) {
|
||
|
_this8.inputWidth = _this8.$refs.reference.$el.getBoundingClientRect().width;
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
beforeDestroy: function beforeDestroy() {
|
||
|
if (this.$el && this.handleResize) (0, _resizeEvent.removeResizeListener)(this.$el, this.handleResize);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 263:
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var Component = __webpack_require__(3)(
|
||
|
/* script */
|
||
|
__webpack_require__(264),
|
||
|
/* template */
|
||
|
__webpack_require__(265),
|
||
|
/* scopeId */
|
||
|
null,
|
||
|
/* cssModules */
|
||
|
null
|
||
|
)
|
||
|
|
||
|
module.exports = Component.exports
|
||
|
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 264:
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
|
||
|
var _vuePopper = __webpack_require__(13);
|
||
|
|
||
|
var _vuePopper2 = _interopRequireDefault(_vuePopper);
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
|
||
|
exports.default = {
|
||
|
name: 'ElSelectDropdown',
|
||
|
|
||
|
componentName: 'ElSelectDropdown',
|
||
|
|
||
|
mixins: [_vuePopper2.default],
|
||
|
|
||
|
props: {
|
||
|
placement: {
|
||
|
default: 'bottom-start'
|
||
|
},
|
||
|
|
||
|
boundariesPadding: {
|
||
|
default: 0
|
||
|
},
|
||
|
|
||
|
popperOptions: {
|
||
|
default: function _default() {
|
||
|
return {
|
||
|
forceAbsolute: true,
|
||
|
gpuAcceleration: false
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
|
||
|
data: function data() {
|
||
|
return {
|
||
|
minWidth: ''
|
||
|
};
|
||
|
},
|
||
|
|
||
|
|
||
|
computed: {
|
||
|
popperClass: function popperClass() {
|
||
|
return this.$parent.popperClass;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
watch: {
|
||
|
'$parent.inputWidth': function $parentInputWidth() {
|
||
|
this.minWidth = this.$parent.$el.getBoundingClientRect().width + 'px';
|
||
|
}
|
||
|
},
|
||
|
|
||
|
mounted: function mounted() {
|
||
|
this.referenceElm = this.$parent.$refs.reference.$el;
|
||
|
this.$parent.popperElm = this.popperElm = this.$el;
|
||
|
this.$on('updatePopper', this.updatePopper);
|
||
|
this.$on('destroyPopper', this.destroyPopper);
|
||
|
}
|
||
|
}; //
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
//
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 265:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
|
return _c('div', {
|
||
|
staticClass: "el-select-dropdown",
|
||
|
class: [{
|
||
|
'is-multiple': _vm.$parent.multiple
|
||
|
}, _vm.popperClass],
|
||
|
style: ({
|
||
|
minWidth: _vm.minWidth
|
||
|
})
|
||
|
}, [_vm._t("default")], 2)
|
||
|
},staticRenderFns: []}
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 266:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = require("element-ui/lib/tag");
|
||
|
|
||
|
/***/ },
|
||
|
|
||
|
/***/ 267:
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
|
return _c('div', {
|
||
|
directives: [{
|
||
|
name: "clickoutside",
|
||
|
rawName: "v-clickoutside",
|
||
|
value: (_vm.handleClose),
|
||
|
expression: "handleClose"
|
||
|
}],
|
||
|
staticClass: "el-select"
|
||
|
}, [(_vm.multiple) ? _c('div', {
|
||
|
ref: "tags",
|
||
|
staticClass: "el-select__tags",
|
||
|
style: ({
|
||
|
'max-width': _vm.inputWidth - 32 + 'px'
|
||
|
}),
|
||
|
on: {
|
||
|
"click": function($event) {
|
||
|
$event.stopPropagation();
|
||
|
_vm.toggleMenu($event)
|
||
|
}
|
||
|
}
|
||
|
}, [_c('transition-group', {
|
||
|
on: {
|
||
|
"after-leave": _vm.resetInputHeight
|
||
|
}
|
||
|
}, _vm._l((_vm.selected), function(item) {
|
||
|
return _c('el-tag', {
|
||
|
key: item.value,
|
||
|
attrs: {
|
||
|
"closable": "",
|
||
|
"hit": item.hitState,
|
||
|
"type": "primary",
|
||
|
"close-transition": ""
|
||
|
},
|
||
|
on: {
|
||
|
"close": function($event) {
|
||
|
_vm.deleteTag($event, item)
|
||
|
}
|
||
|
}
|
||
|
}, [_c('span', {
|
||
|
staticClass: "el-select__tags-text"
|
||
|
}, [_vm._v(_vm._s(item.currentLabel))])])
|
||
|
})), (_vm.filterable) ? _c('input', {
|
||
|
directives: [{
|
||
|
name: "model",
|
||
|
rawName: "v-model",
|
||
|
value: (_vm.query),
|
||
|
expression: "query"
|
||
|
}],
|
||
|
ref: "input",
|
||
|
staticClass: "el-select__input",
|
||
|
class: ("is-" + _vm.size),
|
||
|
style: ({
|
||
|
width: _vm.inputLength + 'px',
|
||
|
'max-width': _vm.inputWidth - 42 + 'px'
|
||
|
}),
|
||
|
attrs: {
|
||
|
"type": "text",
|
||
|
"disabled": _vm.disabled,
|
||
|
"debounce": _vm.remote ? 300 : 0
|
||
|
},
|
||
|
domProps: {
|
||
|
"value": _vm._s(_vm.query)
|
||
|
},
|
||
|
on: {
|
||
|
"focus": function($event) {
|
||
|
_vm.visible = true
|
||
|
},
|
||
|
"keyup": _vm.managePlaceholder,
|
||
|
"keydown": [_vm.resetInputState, function($event) {
|
||
|
if (_vm._k($event.keyCode, "down", 40)) { return; }
|
||
|
$event.preventDefault();
|
||
|
_vm.navigateOptions('next')
|
||
|
}, function($event) {
|
||
|
if (_vm._k($event.keyCode, "up", 38)) { return; }
|
||
|
$event.preventDefault();
|
||
|
_vm.navigateOptions('prev')
|
||
|
}, function($event) {
|
||
|
if (_vm._k($event.keyCode, "enter", 13)) { return; }
|
||
|
$event.preventDefault();
|
||
|
_vm.selectOption($event)
|
||
|
}, function($event) {
|
||
|
if (_vm._k($event.keyCode, "esc", 27)) { return; }
|
||
|
$event.preventDefault();
|
||
|
_vm.visible = false
|
||
|
}, function($event) {
|
||
|
if (_vm._k($event.keyCode, "delete", [8, 46])) { return; }
|
||
|
_vm.deletePrevTag($event)
|
||
|
}],
|
||
|
"input": function($event) {
|
||
|
if ($event.target.composing) { return; }
|
||
|
_vm.query = $event.target.value
|
||
|
}
|
||
|
}
|
||
|
}) : _vm._e()], 1) : _vm._e(), _c('el-input', {
|
||
|
directives: [{
|
||
|
name: "model",
|
||
|
rawName: "v-model",
|
||
|
value: (_vm.selectedLabel),
|
||
|
expression: "selectedLabel"
|
||
|
}],
|
||
|
ref: "reference",
|
||
|
attrs: {
|
||
|
"type": "text",
|
||
|
"placeholder": _vm.currentPlaceholder,
|
||
|
"name": _vm.name,
|
||
|
"size": _vm.size,
|
||
|
"disabled": _vm.disabled,
|
||
|
"readonly": !_vm.filterable || _vm.multiple,
|
||
|
"validate-event": false,
|
||
|
"icon": _vm.iconClass
|
||
|
},
|
||
|
domProps: {
|
||
|
"value": (_vm.selectedLabel)
|
||
|
},
|
||
|
on: {
|
||
|
"focus": _vm.handleFocus,
|
||
|
"click": _vm.handleIconClick,
|
||
|
"input": function($event) {
|
||
|
_vm.selectedLabel = $event
|
||
|
}
|
||
|
},
|
||
|
nativeOn: {
|
||
|
"mousedown": function($event) {
|
||
|
_vm.handleMouseDown($event)
|
||
|
},
|
||
|
"keyup": function($event) {
|
||
|
_vm.debouncedOnInputChange($event)
|
||
|
},
|
||
|
"keydown": [function($event) {
|
||
|
if (_vm._k($event.keyCode, "down", 40)) { return; }
|
||
|
$event.preventDefault();
|
||
|
_vm.navigateOptions('next')
|
||
|
}, function($event) {
|
||
|
if (_vm._k($event.keyCode, "up", 38)) { return; }
|
||
|
$event.preventDefault();
|
||
|
_vm.navigateOptions('prev')
|
||
|
}, function($event) {
|
||
|
if (_vm._k($event.keyCode, "enter", 13)) { return; }
|
||
|
$event.preventDefault();
|
||
|
_vm.selectOption($event)
|
||
|
}, function($event) {
|
||
|
if (_vm._k($event.keyCode, "esc", 27)) { return; }
|
||
|
$event.preventDefault();
|
||
|
_vm.visible = false
|
||
|
}, function($event) {
|
||
|
if (_vm._k($event.keyCode, "tab", 9)) { return; }
|
||
|
_vm.visible = false
|
||
|
}],
|
||
|
"paste": function($event) {
|
||
|
_vm.debouncedOnInputChange($event)
|
||
|
},
|
||
|
"mouseenter": function($event) {
|
||
|
_vm.inputHovering = true
|
||
|
},
|
||
|
"mouseleave": function($event) {
|
||
|
_vm.inputHovering = false
|
||
|
}
|
||
|
}
|
||
|
}), _c('transition', {
|
||
|
attrs: {
|
||
|
"name": "el-zoom-in-top"
|
||
|
},
|
||
|
on: {
|
||
|
"after-leave": _vm.doDestroy,
|
||
|
"after-enter": _vm.handleMenuEnter
|
||
|
}
|
||
|
}, [_c('el-select-menu', {
|
||
|
directives: [{
|
||
|
name: "show",
|
||
|
rawName: "v-show",
|
||
|
value: (_vm.visible && _vm.emptyText !== false),
|
||
|
expression: "visible && emptyText !== false"
|
||
|
}],
|
||
|
ref: "popper"
|
||
|
}, [_c('el-scrollbar', {
|
||
|
directives: [{
|
||
|
name: "show",
|
||
|
rawName: "v-show",
|
||
|
value: (_vm.options.length > 0 && !_vm.loading),
|
||
|
expression: "options.length > 0 && !loading"
|
||
|
}],
|
||
|
class: {
|
||
|
'is-empty': !_vm.allowCreate && _vm.filteredOptionsCount === 0
|
||
|
},
|
||
|
attrs: {
|
||
|
"tag": "ul",
|
||
|
"wrap-class": "el-select-dropdown__wrap",
|
||
|
"view-class": "el-select-dropdown__list"
|
||
|
}
|
||
|
}, [(_vm.showNewOption) ? _c('el-option', {
|
||
|
attrs: {
|
||
|
"value": _vm.query,
|
||
|
"created": ""
|
||
|
}
|
||
|
}) : _vm._e(), _vm._t("default")], 2), (_vm.emptyText && !_vm.allowCreate) ? _c('p', {
|
||
|
staticClass: "el-select-dropdown__empty"
|
||
|
}, [_vm._v(_vm._s(_vm.emptyText))]) : _vm._e()], 1)], 1)], 1)
|
||
|
},staticRenderFns: []}
|
||
|
|
||
|
/***/ }
|
||
|
|
||
|
/******/ });
|