kingdot
Version:
A UI Components Library For Vue
1,010 lines (941 loc) • 32.7 kB
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] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = 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;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/dist/";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 219);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
/* globals __VUE_SSR_CONTEXT__ */
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.
function normalizeComponent (
scriptExports,
render,
staticRenderFns,
functionalTemplate,
injectStyles,
scopeId,
moduleIdentifier, /* server only */
shadowMode /* vue-cli only */
) {
// Vue.extend constructor export interop
var options = typeof scriptExports === 'function'
? scriptExports.options
: scriptExports
// render functions
if (render) {
options.render = render
options.staticRenderFns = staticRenderFns
options._compiled = true
}
// functional template
if (functionalTemplate) {
options.functional = true
}
// scopedId
if (scopeId) {
options._scopeId = 'data-v-' + scopeId
}
var hook
if (moduleIdentifier) { // server build
hook = function (context) {
// 2.3 injection
context =
context || // cached call
(this.$vnode && this.$vnode.ssrContext) || // stateful
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__
}
// inject component styles
if (injectStyles) {
injectStyles.call(this, context)
}
// register component module identifier for async chunk inferrence
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier)
}
}
// used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook
} else if (injectStyles) {
hook = shadowMode
? function () {
injectStyles.call(
this,
(options.functional ? this.parent : this).$root.$options.shadowRoot
)
}
: injectStyles
}
if (hook) {
if (options.functional) {
// for template-only hot-reload because in that case the render fn doesn't
// go through the normalizer
options._injectStyles = hook
// register for functional component in vue file
var originalRender = options.render
options.render = function renderWithStyleInjection (h, context) {
hook.call(context)
return originalRender(h, context)
}
} else {
// inject component registration as beforeCreate hook
var existing = options.beforeCreate
options.beforeCreate = existing
? [].concat(existing, hook)
: [hook]
}
}
return {
exports: scriptExports,
options: options
}
}
/***/ }),
/***/ 219:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/Select/select.vue?vue&type=template&id=d21a2442&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"kdSelect",staticClass:"kd-select",class:[{
'kd-select-disabled':_vm.disabled,
'kd-select-clear-hover': _vm.clearAll && !_vm.disabled,
'kd-select-active': _vm.clickOption,
'kd-select-fluid': _vm.fluid
}],style:({'width': _vm.inputWidth})},[_c('kd-tooltip',{ref:"kdDropdownTooltip",attrs:{"trigger":"click","placement":"bottom","disabled":_vm.disabled,"hide-destroy":_vm.hideDestroy,"width-limit":false,"content-class":_vm.tooltipClass},model:{value:(_vm.dropdownMenu),callback:function ($$v) {_vm.dropdownMenu=$$v},expression:"dropdownMenu"}},[_c('div',{ref:"kdSelectInput",staticClass:"kd-select-input",class:[{ 'kd-select-multiple':_vm.multiple },'kd-select-' + _vm.size],on:{"click":_vm.selectClick}},[_c('i',{staticClass:"kd-icon-arrow-down kd-select-arrow-icon",class:{'kd-select-arrow-icon-rotate':_vm.dropdownMenu}}),(!_vm.disabled)?_c('i',{staticClass:"kd-icon-close kd-select-clear-icon",on:{"click":function($event){$event.stopPropagation();return _vm.clear($event)}}}):_vm._e(),(_vm.multiple)?_c('div',{staticClass:"kd-select-tags"},[(_vm.collapseTags && _vm.tagList.length)?_c('span',{staticClass:"kd-select-tags-content"},[_c('span',{staticClass:"kd-select-tags-item"},[_c('span',{staticClass:"kd-select-tag-label",attrs:{"title":_vm.tagList[0].label}},[_vm._v(_vm._s(_vm.tagList[0].label))]),(!_vm.disabled)?_c('span',{staticClass:"kd-select-tag-close kd-icon-close",on:{"click":function($event){$event.stopPropagation();return _vm.deleteTag(_vm.tagList[0])}}}):_vm._e()]),(_vm.tagList.length > 1)?_c('span',{staticClass:"kd-select-tags-item"},[_c('span',{staticClass:"kd-select-tag-label"},[_vm._v("+ "+_vm._s(_vm.tagList.length - 1))])]):_vm._e()]):_c('span',{staticClass:"kd-select-tags-content"},_vm._l((_vm.tagList),function(item){return _c('span',{key:item.value,staticClass:"kd-select-tags-item"},[_c('span',{staticClass:"kd-select-tag-label",attrs:{"title":item.label}},[_vm._v(_vm._s(item.label))]),(!_vm.disabled)?_c('span',{staticClass:"kd-select-tag-close kd-icon-close",on:{"click":function($event){$event.stopPropagation();return _vm.deleteTag(item)}}}):_vm._e()])}),0),(_vm.multiple)?_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.multipleSerach),expression:"multipleSerach"}],ref:"input",staticClass:"kd-select-input-wrap kd-select-input-inner",class:{'kd-select-input-disabled':_vm.disabled },attrs:{"readonly":!_vm.filterable,"type":"text","disabled":_vm.disabled,"placeholder":_vm.inputPlaceholder},domProps:{"value":(_vm.multipleSerach)},on:{"blur":_vm.handleBlur,"focus":_vm.multipleInputFocus,"input":[function($event){if($event.target.composing){ return; }_vm.multipleSerach=$event.target.value},_vm.handleInput]}}):_vm._e()]):_vm._e(),(!_vm.multiple)?_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.inputLabel),expression:"inputLabel"}],ref:"input",staticClass:"kd-select-input-inner",class:{'kd-select-input-disabled':_vm.disabled },attrs:{"readonly":!_vm.filterable || !_vm.dropdownMenu,"type":"text","disabled":_vm.disabled,"placeholder":_vm.inputPlaceholder},domProps:{"value":(_vm.inputLabel)},on:{"input":[function($event){if($event.target.composing){ return; }_vm.inputLabel=$event.target.value},_vm.handleInput],"focus":_vm.handleFocus,"blur":_vm.handleBlur}}):_vm._e()]),_c('template',{slot:"content"},[_c('kd-select-dropdown',{attrs:{"multiple":_vm.multiple,"default-width":_vm.defaultWidth,"filter-data":_vm.filterData,"lazy":_vm.lazy,"lazy-load-count":_vm.lazyLoadCount,"optimize-scroll":_vm.optimizeScroll,"dropdownMenu":_vm.dropdownMenu},on:{"setValue":_vm.setValue,"updateLabel":_vm.updateLabel},model:{value:(_vm.value),callback:function ($$v) {_vm.value=$$v},expression:"value"}},[_vm._t("default")],2)],1)],2)],1)}
var staticRenderFns = []
// CONCATENATED MODULE: ./components/Select/select.vue?vue&type=template&id=d21a2442&
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/Select/select-dropdown.vue?vue&type=template&id=394d1ba6&
var select_dropdownvue_type_template_id_394d1ba6_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"kdDropdown",class:{
'kd-select-dropdown': true,
'kd-select-optimize': _vm.optimizeScroll
},style:({
width:_vm.defaultWidth,
'max-height': "290px"
}),on:{"scroll":_vm.scroll}},[(_vm.optimizeScroll)?_c('div',{staticClass:"kd-select-phantom",style:({ 'max-height': '290px' })}):_vm._e(),_c('ul',{ref:"kdDropdownContent",class:{
'kd-select-lists': _vm.optimizeScroll
},style:({ transform: _vm.getTransform })},[_vm._t("default",[_c('li',{staticClass:"kd-select-no-data"},[_vm._v("无数据")])])],2),(_vm.$children.length && _vm.allHide)?_c('ul',[_c('li',{staticClass:"kd-select-no-data"},[_vm._v("无数据")])]):_vm._e()])}
var select_dropdownvue_type_template_id_394d1ba6_staticRenderFns = []
// CONCATENATED MODULE: ./components/Select/select-dropdown.vue?vue&type=template&id=394d1ba6&
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/Select/select-dropdown.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var select_dropdownvue_type_script_lang_js_ = ({
name: 'KdSelectDropdown',
props: {
// eslint-disable-next-line vue/require-prop-type-constructor
value: '',
isDropdown: {
type: Boolean,
default: false
},
multiple: {
type: Boolean,
default: false
},
defaultWidth: {
type: String,
default: ''
},
filterData: {
type: Object
},
lazy: {
type: Boolean,
default: false
},
lazyLoadCount: {
type: [String, Number],
default: 10
},
optimizeScroll: {
type: Boolean,
default: false
},
dropdownMenu: {}
},
data: function data() {
return {
optionIndex: 0,
loadCount: 30,
//optimizeScroll = true scroll优化模式
//可视区域高度
screenHeight: null,
//每个option高度
itemSize: 32,
//option list总高度
listHeight: null,
//其实索引
start: 0,
//结束索引
end: null,
//scroll偏移量
startOffset: 0,
scrollInitFlag: true,
// 兼容: 搜索结果为空的时候展示空数据
allHide: false
};
},
computed: {
//可显示列表的数目
visibleCount: function visibleCount() {
return Math.ceil(this.screenHeight / this.itemSize);
},
//偏移量对应的style
getTransform: function getTransform() {
return 'translate3d(0,' + this.startOffset + 'px,0)';
},
getShowIndex: function getShowIndex() {
return {
start: this.start,
end: this.end
};
}
},
watch: {
'filterData': function filterData(v) {
var count = 0;
this.$children.forEach(function (item) {
if (item.$options._componentTag === 'kd-option') {
item.isShow(v);
if (item.isShow(v)) {
count++;
};
}
if (item.$options._componentTag === 'kd-option-group') {
// only one level options in group
item.$children.forEach(function (c) {
if (c.$options._componentTag === 'kd-option') {
c.isShow(v);
if (c.isShow(v)) {
count++;
};
}
});
var hideGroup = item.$children.every(function (c) {
if (c.$options._componentTag === 'kd-option') {
return !c.isShow(v);
}
return false;
});
item.isGroup = !hideGroup;
}
});
// fix: 重新计算搜索后的弹层高度
this.listHeight = this.itemSize * count;
this.screenHeight = this.listHeight >= 290 ? 290 : this.listHeight;
// fix: 全部不显示时候
var allHide = this.$children.every(function (item) {
if (item.$options._componentTag === 'kd-option') {
return !item.isShow(v);
}
if (item.$options._componentTag === 'kd-option-group') {
var hideGroup = item.$children.every(function (c) {
if (c.$options._componentTag === 'kd-option') {
return !c.isShow(v);
}
return true;
});
return hideGroup;
}
});
this.allHide = allHide;
// console.log('xxxx', allHide);
},
dropdownMenu: function dropdownMenu(val) {
if (!val) {
//关闭dropdown后重置偏移量
this.startOffset = 0;
this.scrollInitFlag = true;
}
}
},
mounted: function mounted() {},
updated: function updated() {
if (this.dropdownMenu && this.scrollInitFlag) {
// this.screenHeight = this.$el.clientHeight;
this.listHeight = this.itemSize * this.$children.length;
this.screenHeight = this.listHeight >= 290 ? 290 : this.listHeight;
this.start = 0;
this.end = this.start + this.visibleCount;
this.scrollInitFlag = false;
}
},
methods: {
setValue: function setValue(v) {
this.$emit('setValue', v);
},
getOptionIndex: function getOptionIndex() {
this.optionIndex += 1;
return this.optionIndex;
},
updateLabel: function updateLabel(v) {
this.$emit('updateLabel', v);
},
scroll: function scroll(event) {
//懒加载模式
if (this.lazy) {
var scrollTop = this.$refs.kdDropdown.scrollTop;
var contentHeight = this.$refs.kdDropdownContent.offsetHeight;
if (contentHeight - scrollTop <= 390) {
this.loadCount += parseInt(this.lazyLoadCount);
}
}
//scroll优化模式
if (this.optimizeScroll) {
var _scrollTop = event.target.scrollTop;
//此时的开始索引
this.start = Math.floor(_scrollTop / this.itemSize);
//此时的结束索引
this.end = this.start + this.visibleCount;
//此时的偏移量
this.startOffset = _scrollTop - _scrollTop % this.itemSize;
// console.log(this.start, this.end);
}
}
}
});
// CONCATENATED MODULE: ./components/Select/select-dropdown.vue?vue&type=script&lang=js&
/* harmony default export */ var Select_select_dropdownvue_type_script_lang_js_ = (select_dropdownvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(0);
// CONCATENATED MODULE: ./components/Select/select-dropdown.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
Select_select_dropdownvue_type_script_lang_js_,
select_dropdownvue_type_template_id_394d1ba6_render,
select_dropdownvue_type_template_id_394d1ba6_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var select_dropdown = (component.exports);
// EXTERNAL MODULE: ./src/mixin/lang.js + 2 modules
var lang = __webpack_require__(4);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/Select/select.vue?vue&type=script&lang=js&
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var selectvue_type_script_lang_js_ = ({
name: 'KdSelect',
components: {
KdSelectDropdown: select_dropdown
},
mixins: [lang["a" /* default */]],
props: {
width: {
type: String,
default: ''
},
// eslint-disable-next-line vue/require-prop-type-constructor
value: null,
placeholder: {
type: String,
default: ''
},
filterable: {
type: Boolean,
default: false
},
filterMethod: {
type: Function
},
disabled: {
type: Boolean,
default: false
},
multiple: {
type: Boolean,
default: false
},
ellipsisTags: {
type: Boolean,
default: false
},
clearAll: {
type: Boolean,
default: false
},
remoteMethod: {
type: Function
},
size: {
type: String,
default: ''
},
contentClass: {
type: String,
default: ''
},
hideDestroy: {
type: Boolean,
default: false
},
lazy: {
type: Boolean,
default: false
},
lazyLoadCount: {
type: [String, Number],
default: 10
},
optimizeScroll: {
type: Boolean,
default: false
},
collapseTags: {
type: Boolean,
default: false
},
fluid: {
type: Boolean,
default: false
}
},
data: function data() {
return {
isFocus: false,
inputLabel: '',
tagList: [],
inputPlaceholder: '',
clickOption: false,
dropdownMenu: false,
isDropdown: false,
searchTime: 200,
serachTimeout: {},
multipleSerach: '',
init: true,
options: [],
selected: [],
scope: {},
defaultWidth: '',
filterData: {}
};
},
computed: {
tooltipClass: function tooltipClass() {
return 'kd-dropdown-tooltip';
},
inputWidth: function inputWidth() {
var width = this.width;
if (width.indexOf('px') > -1 || width.indexOf('%') > -1) {
return width;
} else {
return width + 'px';
}
}
},
watch: {
value: {
immediate: true,
handler: function handler(v) {
var _this = this;
var val = v;
if (this.multiple && !Array.isArray(v)) {
val = [];
console.error('select value should be Array while is multiple!');
}
this.selected = val;
this.$nextTick(function () {
_this.initData(val);
});
}
},
placeholder: {
immediate: true,
handler: function handler(v) {
if (this.multiple) {
this.inputPlaceholder = this.value.length > 0 ? '' : v;
} else {
this.inputPlaceholder = v;
}
}
},
dropdownMenu: {
handler: function handler(v, old) {
this.defaultWidth = this.$refs.kdSelect.clientWidth + 'px';
if (v) {
if (this.filterable && this.inputLabel && !this.multiple) {
this.inputPlaceholder = this.inputLabel;
this.inputLabel = '';
}
} else {
if (this.multiple) {
this.multipleSerach = '';
} else if (this.filterable) {
if (this.value !== null && this.value !== '' && this.value !== undefined) {
this.inputLabel = this.inputPlaceholder;
}
this.inputPlaceholder = this.placeholder;
}
}
this.optionFilter('');
}
}
},
mounted: function mounted() {
this.defaultWidth = this.$refs.kdSelect.clientWidth + 'px';
},
methods: {
initData: function initData(v) {
var _this2 = this;
var defSlot = this.$slots.default || [];
if (this.multiple) {
var tagList = [];
// 多选初始化添加tags
v.forEach(function (vItem) {
defSlot.forEach(function (item) {
var options = item.componentOptions;
if (options) {
var value = options.propsData.value;
if (value === vItem) {
var label = options.propsData.label || item.componentInstance && _this2.labelFomat(item.componentInstance.labelText);
tagList.push({
value: value,
label: label
});
}
}
});
});
this.selected = v;
this.tagList = tagList;
this.inputPlaceholder = v.length > 0 ? '' : this.placeholder;
} else {
// 获取label
this.inputLabel = '';
defSlot.forEach(function (item) {
if (item.componentOptions) {
if (item.componentOptions.tag === 'kd-option') {
_this2.initLabel(item, v);
} else {
// 如果是group在遍历一遍
item.componentOptions.children.forEach(function (item) {
_this2.initLabel(item, v);
});
}
}
});
this.inputPlaceholder = this.inputLabel || this.placeholder;
this.dropdownMenu = false;
}
},
handleInput: function handleInput() {
if (!this.multiple) {
this.optionFilter(this.inputLabel);
} else {
this.optionFilter(this.multipleSerach);
}
},
initLabel: function initLabel(item, v) {
var options = item.componentOptions;
var value = options.propsData.value;
var label = options.propsData.label || item.componentInstance && this.labelFomat(item.componentInstance.labelText);
if (value === v) {
this.inputLabel = label;
}
},
labelFomat: function labelFomat(label) {
if (!label) return '';
return label.replace(/\n/g, '').trim();
},
optionFilter: function optionFilter(v) {
var _this3 = this;
clearTimeout(this.serachTimeout);
this.serachTimeout = setTimeout(function () {
// 远程搜索
if (typeof _this3.remoteMethod === 'function') {
_this3.remoteMethod(v);
} else {
_this3.filterData = { value: v, method: _this3.filterMethod };
}
}, this.searchTime);
},
selectClick: function selectClick(e) {
if (this.disabled) return;
if (typeof this.remoteMethod === 'function') return;
if (this.filterable || this.remoteMethod) {
this.$refs.input.focus();
}
},
setValue: function setValue(_ref) {
var scope = _ref.scope,
active = _ref.active;
if (scope.value === this.value) {
this.dropdownMenu = false;
return;
}
if (this.multiple) {
if (active) {
this.deleteTag(scope);
} else {
this.tagList.push(scope);
this.$emit('input', [].concat(_toConsumableArray(this.selected), [scope.value]));
}
this.inputPlaceholder = this.tagList.length > 0 ? '' : this.placeholder;
this.$refs.kdDropdownTooltip.updatePopper();
this.$refs.input.focus();
} else {
this.inputPlaceholder = scope.label;
this.dropdownMenu = false;
this.$emit('input', scope.value);
}
this.$emit('change', scope);
},
updateLabel: function updateLabel(v) {
if (this.multiple) {
this.tagList.push(v);
} else {
this.inputLabel = v.label;
}
},
deleteTag: function deleteTag(scope) {
var _this4 = this;
this.selected.forEach(function (item, index) {
if (item === scope.value) {
_this4.selected.splice(index, 1);
}
});
this.tagList.forEach(function (item, index) {
if (item.value === scope.value) {
_this4.tagList.splice(index, 1);
}
});
this.$emit('remove-tag', scope);
this.$emit('input', this.selected);
this.$refs.kdDropdownTooltip.updatePopper();
this.inputFocus();
this.$emit('change', scope);
},
inputFocus: function inputFocus() {
this.$refs.input.focus();
},
clear: function clear() {
var val = this.multiple ? [] : '';
this.$emit('input', val);
this.$emit('clear');
this.$emit('change', val);
},
handleFocus: function handleFocus() {
this.$emit('focus');
},
handleBlur: function handleBlur() {
this.$emit('blur');
},
multipleInputFocus: function multipleInputFocus() {
this.$emit('focus');
}
}
});
// CONCATENATED MODULE: ./components/Select/select.vue?vue&type=script&lang=js&
/* harmony default export */ var Select_selectvue_type_script_lang_js_ = (selectvue_type_script_lang_js_);
// CONCATENATED MODULE: ./components/Select/select.vue
/* normalize component */
var select_component = Object(componentNormalizer["a" /* default */])(
Select_selectvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Select_select = (select_component.exports);
// CONCATENATED MODULE: ./components/Select/index.js
Select_select.install = function (Vue) {
Vue.component(Select_select.name, Select_select);
};
/* harmony default export */ var Select = __webpack_exports__["default"] = (Select_select);
/***/ }),
/***/ 4:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./src/lang/zh-CN/index.js
/* harmony default export */ var zh_CN = ({
button: {
confirm: '确定'
}
});
// CONCATENATED MODULE: ./src/lang/index.js
var defaultComponentWords = zh_CN;
var currentComponentWords = defaultComponentWords;
var lang_translate = function translate(path) {
if (i18nHandler) {
// 支持vue-i18n 改写组件语言
return i18nHandler.apply(this, arguments) || '';
}
var currentLang = currentComponentWords;
var array = path.split('.');
return currentLang[array[0]][array[1]];
};
var i18nHandler = void 0;
var i18n = function i18n(fn) {
i18nHandler = fn;
};
var use = function use(wordsMap) {
currentComponentWords = wordsMap || defaultComponentWords;
};
// CONCATENATED MODULE: ./src/mixin/lang.js
/* harmony default export */ var lang = __webpack_exports__["a"] = ({
methods: {
translate: function translate() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return lang_translate.apply(this, args);
}
}
});
/***/ })
/******/ })["default"];