kingdot
Version:
A UI Components Library For Vue
1,569 lines (1,399 loc) • 58.1 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 = 245);
/******/ })
/************************************************************************/
/******/ ({
/***/ 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
}
}
/***/ }),
/***/ 10:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var src_mixin_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
/* harmony default export */ __webpack_exports__["a"] = ({
name: 'KdButton',
mixins: [src_mixin_lang_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]],
props: {
value: {
type: [Number, String]
},
type: {
type: String,
default: 'default'
},
disabled: {
type: Boolean,
default: false
},
icon: {
type: String,
default: ''
},
loading: {
type: Boolean,
default: false
},
size: {
type: String,
default: 'middle'
},
shape: {
type: String,
default: ''
},
hollow: {
type: Boolean,
default: false
},
split: {
type: Boolean,
default: false
},
nativeType: {
type: String,
default: 'button'
},
authid: {
type: String,
default: ''
},
clickDelay: {
type: Boolean,
default: false
},
delayTime: {
type: Number,
default: 3000
},
href: {
type: String,
default: null
},
target: {
type: String,
default: '_self'
}
},
data: function data() {
return {
isActive: false,
disabledStatus: this.disabled,
authAbled: true,
delayDisable: false,
link: null,
linkTarget: '_self',
isShow: true
};
},
computed: {
// 所有样式类
allClassList: function allClassList() {
var allClassAry = ['kd-btn', 'kd-btn-' + this.type, this.shape ? 'kd-btn-' + this.shape : '', this.size ? 'kd-btn-' + this.size : '', {
'kd-btn-active': this.isActive,
'kd-btn-split': this.split,
'kd-btn-disabled': this.disabledStatus || !this.authAbled,
'kd-btn-hollow': this.hollow,
'kd-btn-loading': this.loading
}];
return allClassAry;
},
enableStatus: function enableStatus() {
if (this.authid) {
return this.$KD && this.$KD.getEnabledStatus ? this.$KD.getEnabledStatus(this.authid) : true;
} else {
return true;
}
},
btnShowStatus: function btnShowStatus() {
return this.$KD && this.$KD.setBtnEnableType ? this.$KD.setBtnEnableType() === 'disabled' : true;
}
},
watch: {
disabled: {
immediate: true,
handler: function handler(v) {
this.checkAuth();
this.handleHerf();
this.disabledStatus = v;
}
},
authid: function authid() {
var _this = this;
this.$nextTick(function () {
_this.checkAuth();
});
},
href: {
immediate: true,
handler: function handler(v) {
this.link = v;
this.handleHerf();
}
},
target: {
immediate: true,
handler: function handler(v) {
this.linkTarget = v;
this.handleHerf();
}
}
},
mounted: function mounted() {
this.initActive();
},
methods: {
checkAuth: function checkAuth() {
if (!this.authid) return;
if (this.enableStatus) {
this.isShow = true;
this.authAbled = !this.disabled;
} else {
if (this.btnShowStatus) {
this.authAbled = false;
this.isShow = true;
} else {
this.isShow = false;
}
}
},
handleHerf: function handleHerf() {
if (!this.authAbled || this.disabled) {
this.link = null;
this.linkTarget = '_self';
this.disabledStatus = true;
} else {
this.linkTarget = this.target;
if (this.$KD && this.$KD.setButtonLink) {
this.link = this.$KD.setButtonLink(this.href);
}
}
},
initActive: function initActive() {
var _this2 = this;
var parent = this.$parent;
if (!parent) return;
if (parent.$options._componentTag === 'kd-button-group') {
if (parent.checkType === 'radio') {
if (parent.value === this.value) this.isActive = true;
} else if (parent.checkType === 'checkbox') {
parent.value.forEach(function (item) {
if (item === _this2.value) _this2.isActive = true;
});
}
if (parent.disabledStatus) this.disabledStatus = true;
}
},
// 点击事件
handleClick: function handleClick(e) {
var _this3 = this;
if (!this.authAbled || this.disabled || this.loading) {
return;
}
this.$emit('click', e);
if (this.clickDelay) {
this.disabledStatus = true;
window.setTimeout(function () {
_this3.disabledStatus = false;
}, this.delayTime);
}
var parent = this.$parent;
if (!parent) return;
if (parent.$options._componentTag === 'kd-button-group') {
this.$parent.emit(this.value, this.isActive);
}
},
active: function active() {
this.isActive = true;
},
showLoading: function showLoading() {
this.loading = true;
this.disabled = true;
},
hideLoading: function hideLoading() {
this.loading = false;
this.disabled = false;
}
},
render: function render(h, ctx) {
if (this.isShow) {
if (this.type !== 'text') {
return h(
'button',
{
'class': this.allClassList,
attrs: { type: this.nativeType
},
on: {
'click': this.handleClick
}
},
[this.loading ? h(
'span',
{
'class': ['kd-btn-loading-icon', { 'kd-icon-left': this.$slots.default }]
},
[h(
'svg',
{
attrs: { viewBox: '0 0 120 120' }
},
[h('circle', {
attrs: {
cx: '60',
cy: '60',
r: '57'
},
'class': 'kd-spin-circle' })]
)]
) : '', this.icon ? h('i', { 'class': this.icon }) : '', this.$slots.default ? h(
'span',
{ 'class': [{ 'kd-icon-right': this.icon && this.$slots.default[0].text }] },
[this.$slots.default]
) : '']
);
} else {
return h(
'a',
{
attrs: {
href: this.link,
target: this.linkTarget
},
'class': this.allClassList, on: {
'click': this.handleClick
}
},
[this.$slots.default]
);
}
}
}
});
/***/ }),
/***/ 11:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/Dropdown/dropdown-item.vue?vue&type=template&id=4dedb17a&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"dropdownItem",staticClass:"kd-dropdown-item",class:{'kd-dropdown-dividedline-item':_vm.dividedLine,'kd-dropdown-disabled-item':_vm.disabled},on:{"click":_vm.handleClick}},[_vm._t("default")],2)}
var staticRenderFns = []
// CONCATENATED MODULE: ./components/Dropdown/dropdown-item.vue?vue&type=template&id=4dedb17a&
// EXTERNAL MODULE: ./src/mixin/lang.js + 2 modules
var lang = __webpack_require__(4);
// EXTERNAL MODULE: ./src/mixin/bus.js
var bus = __webpack_require__(7);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/Dropdown/dropdown-item.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var dropdown_itemvue_type_script_lang_js_ = ({
name: 'KdDropdownItem',
mixins: [lang["a" /* default */]],
props: {
disabled: {
type: Boolean,
default: false
},
clickHide: {
type: Boolean,
default: true
},
dividedLine: {
type: Boolean,
default: false
},
value: {
type: [String, Number, Object],
default: ''
}
},
methods: {
handleClick: function handleClick(e) {
e.stopPropagation();
if (this.disabled) return;
bus["a" /* default */].$emit('item-click');
this.$emit('click', this.value);
}
}
});
// CONCATENATED MODULE: ./components/Dropdown/dropdown-item.vue?vue&type=script&lang=js&
/* harmony default export */ var Dropdown_dropdown_itemvue_type_script_lang_js_ = (dropdown_itemvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(0);
// CONCATENATED MODULE: ./components/Dropdown/dropdown-item.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
Dropdown_dropdown_itemvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var dropdown_item = __webpack_exports__["a"] = (component.exports);
/***/ }),
/***/ 12:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/Dropdown/dropdown-menu.vue?vue&type=template&id=6d53603a&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"kd-dropdown-menu"},[_vm._t("default")],2)}
var staticRenderFns = []
// CONCATENATED MODULE: ./components/Dropdown/dropdown-menu.vue?vue&type=template&id=6d53603a&
// 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/Dropdown/dropdown-menu.vue?vue&type=script&lang=js&
//
//
//
//
//
//
/* harmony default export */ var dropdown_menuvue_type_script_lang_js_ = ({
name: 'KdDropdownMenu',
mixins: [lang["a" /* default */]]
});
// CONCATENATED MODULE: ./components/Dropdown/dropdown-menu.vue?vue&type=script&lang=js&
/* harmony default export */ var Dropdown_dropdown_menuvue_type_script_lang_js_ = (dropdown_menuvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(0);
// CONCATENATED MODULE: ./components/Dropdown/dropdown-menu.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
Dropdown_dropdown_menuvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var dropdown_menu = __webpack_exports__["a"] = (component.exports);
/***/ }),
/***/ 16:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/Dropdown/dropdown.vue?vue&type=template&id=0e5e2a0c&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"dropdown",staticClass:"kd-dropdown"},[_c('kd-tooltip',{attrs:{"trigger":_vm.trigger,"placement":_vm.placement,"disabled":_vm.disabled,"showArrow":_vm.showArrow,"can-hover":"","width-limit":false,"hide-destroy":_vm.hideDestroy,"content-class":_vm.dropdownClass},model:{value:(_vm.isShowMenu),callback:function ($$v) {_vm.isShowMenu=$$v},expression:"isShowMenu"}},[(!_vm.splitButton)?_c('div',[_vm._t("default")],2):_c('kd-button-group',[_c('kd-button',{attrs:{"size":_vm.size,"type":"primary"},on:{"click":_vm.onClick}},[_vm._t("default")],2),_c('kd-button',{ref:"trigger",attrs:{"size":_vm.size,"type":"primary","split":"","icon":"kd-icon-arrow-down"}})],1),_c('template',{slot:"content"},[_vm._t("dropdown")],2)],2)],1)}
var staticRenderFns = []
// CONCATENATED MODULE: ./components/Dropdown/dropdown.vue?vue&type=template&id=0e5e2a0c&
// EXTERNAL MODULE: ./src/mixin/bus.js
var bus = __webpack_require__(7);
// 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/Dropdown/dropdown.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var dropdownvue_type_script_lang_js_ = ({
name: 'KdDropdown',
mixins: [lang["a" /* default */]],
props: {
trigger: {
type: String,
default: 'hover'
},
showArrow: {
type: Boolean,
default: true
},
splitButton: {
type: Boolean,
default: false
},
clickHide: {
type: Boolean,
default: true
},
placement: {
type: String,
default: 'bottom'
},
type: {
type: String,
default: 'default'
},
disabled: {
type: Boolean,
default: false
},
size: {
type: String,
default: ''
},
contentClass: {
type: String,
default: ''
},
hideDestroy: {
type: Boolean,
default: false
}
},
data: function data() {
return {
isShowMenu: false
};
},
computed: {
dropdownClass: function dropdownClass() {
return 'kd-dropdown-tooltip ' + this.contentClass;
}
},
watch: {
isShowMenu: function isShowMenu(v) {
this.$emit('menu-change', v);
}
},
mounted: function mounted() {
bus["a" /* default */].$on('item-click', this.itemClick);
},
beforeDestroy: function beforeDestroy() {
bus["a" /* default */].$off('item-click', this.itemClick);
},
methods: {
// 左侧菜单点击回调事件
onClick: function onClick(e) {
e.stopPropagation();
this.$emit('click', e);
},
// 菜单项点击事件
itemClick: function itemClick() {
if (this.clickHide) {
this.isShowMenu = false;
}
}
}
});
// CONCATENATED MODULE: ./components/Dropdown/dropdown.vue?vue&type=script&lang=js&
/* harmony default export */ var Dropdown_dropdownvue_type_script_lang_js_ = (dropdownvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(0);
// CONCATENATED MODULE: ./components/Dropdown/dropdown.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
Dropdown_dropdownvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var dropdown = __webpack_exports__["a"] = (component.exports);
/***/ }),
/***/ 2:
/***/ (function(module, exports) {
module.exports = require("vue");
/***/ }),
/***/ 245:
/***/ (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/Pagination/pagination.vue?vue&type=template&id=30802272&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.total>0)?_c('div',{staticClass:"kd-pagination"},[(!_vm.superMini && _vm.showTotal)?_c('div',{staticClass:"kd-pagination-total"},[_c('span',[_vm._v("共"+_vm._s(_vm.total)+"条")])]):_vm._e(),(_vm.showPageCount)?_c('div',{staticClass:"kd-pagination-total"},[_c('span',[_vm._v("共"+_vm._s(_vm.pageCount)+"页")])]):_vm._e(),(!_vm.superMini && _vm.showLimits)?_c('div',{staticClass:"kd-pagination-limits"},[_c('kd-dropdown',{attrs:{"size":"mini"}},[_c('kd-input',{attrs:{"size":"mini","readonly":"","width":98,"value":_vm.innerLimit + '条 / 页'},scopedSlots:_vm._u([{key:"suffix",fn:function(){return [_c('i',{class:['kd-pagination-limits-icon',_vm.limitsIcon]})]},proxy:true}],null,false,663330796)}),_c('kd-dropdown-menu',{attrs:{"slot":"dropdown"},slot:"dropdown"},_vm._l((_vm.limits),function(item){return _c('kd-dropdown-item',{key:item,on:{"click":function($event){return _vm.selectSize(item)}}},[_vm._v("\n "+_vm._s(item)+"\n ")])}),1)],1)],1):_vm._e(),_c('kd-button',{staticClass:"kd-pagination-btn",attrs:{"size":_vm.size,"disabled":_vm.innerCurrent === 1,"type":_vm.type},on:{"click":_vm.prev}},[(!_vm.prevText || _vm.prevText.includes('kd-icon'))?_c('i',{class:[
'kd-icon-caret-left',
_vm.prevText.includes('kd-icon') ? _vm.prevText : 'kd-pagination-left'
]}):_c('span',{staticClass:"kd-pagination-prev-text"},[_vm._v("\n "+_vm._s(_vm.prevText)+"\n ")])]),(!_vm.superMini && _vm.showPageNum)?_c('kd-button-group',{staticClass:"kd-pagination-btns",attrs:{"check-type":"radio"},model:{value:(_vm.innerCurrent),callback:function ($$v) {_vm.innerCurrent=$$v},expression:"innerCurrent"}},_vm._l((_vm.showPageArray),function(item){return _c('kd-button',{key:_vm.getKey(item.value),class:{
'kd-pagination-btn': true,
'kd-pagination-btn-active': _vm.type === 'none'
},attrs:{"value":item.value,"type":_vm.type,"size":_vm.size},on:{"click":function($event){return _vm.checkPage(item.value)}}},[_vm._v(_vm._s(item.label))])}),1):(_vm.showPageNum)?_c('div',{staticClass:"kd-pagination-btns"},[_c('kd-button',{key:"superMini",class:{
'kd-pagination-btn-mini': true,
'kd-pagination-btn': true,
'kd-pagination-btn-active': _vm.type === 'none'
},attrs:{"type":"text","size":_vm.size}},[_vm._v(_vm._s(_vm.innerCurrent))]),_vm._v("\n /\n "),_c('kd-button',{key:"superMiniCount",class:{
'kd-pagination-btn-mini': true,
'kd-pagination-btn': true
},attrs:{"type":"none","size":_vm.size}},[_vm._v(_vm._s(_vm.pageCount))])],1):_vm._e(),_c('kd-button',{staticClass:"kd-pagination-btn kd-pagination-btn-next",attrs:{"size":_vm.size,"icon":"","disabled":_vm.innerCurrent === _vm.pageCount,"type":_vm.type},on:{"click":_vm.next}},[(!_vm.nextText || _vm.nextText.includes('kd-icon'))?_c('i',{class:[
'kd-pagination-right',
_vm.nextText.includes('kd-icon') ? _vm.nextText : 'kd-icon-date-forward'
]}):_c('span',{staticClass:"kd-pagination-next-text"},[_vm._v("\n "+_vm._s(_vm.nextText)+"\n ")])]),(!_vm.superMini && _vm.showGoto)?_c('div',{staticClass:"kd-pagination-goto"},[_vm._v("\n 前往"),_c('input',{directives:[{name:"model",rawName:"v-model.number",value:(_vm.inputCurrent),expression:"inputCurrent",modifiers:{"number":true}}],staticClass:"kd-pagination-input",attrs:{"size":_vm.size},domProps:{"value":(_vm.inputCurrent)},on:{"keyup":[_vm.replaceValue,function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.jumpEnterAction($event)}],"input":function($event){if($event.target.composing){ return; }_vm.inputCurrent=_vm._n($event.target.value)},"blur":function($event){return _vm.$forceUpdate()}}}),_vm._v("页\n ")]):_vm._e()],1):_vm._e()}
var staticRenderFns = []
// CONCATENATED MODULE: ./components/Pagination/pagination.vue?vue&type=template&id=30802272&
// EXTERNAL MODULE: ./components/Dropdown/dropdown.vue + 4 modules
var dropdown = __webpack_require__(16);
// EXTERNAL MODULE: ./components/Dropdown/dropdown-menu.vue + 4 modules
var dropdown_menu = __webpack_require__(12);
// EXTERNAL MODULE: ./components/Dropdown/dropdown-item.vue + 4 modules
var dropdown_item = __webpack_require__(11);
// EXTERNAL MODULE: ./components/Input/input.vue + 4 modules
var input = __webpack_require__(6);
// EXTERNAL MODULE: ./components/Button/button.js
var Button_button = __webpack_require__(10);
// EXTERNAL MODULE: ./components/ButtonGroup/button-group.vue + 4 modules
var button_group = __webpack_require__(44);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/Pagination/pagination.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var markDic = {
left: 'left',
right: 'right'
};
var pageItem = function pageItem(value, keyStr) {
return !keyStr ? { value: value, label: value } : { value: keyStr, label: value };
};
/* harmony default export */ var paginationvue_type_script_lang_js_ = ({
name: 'KdPagination',
components: { KdDropdown: dropdown["a" /* default */], KdDropdownMenu: dropdown_menu["a" /* default */], KdDropdownItem: dropdown_item["a" /* default */], KdButtonGroup: button_group["a" /* default */], KdButton: Button_button["a" /* default */], KdInput: input["a" /* default */] },
props: {
limit: {
type: [Number, String],
default: 10
},
total: {
type: Number
},
showTotal: {
type: Boolean,
default: true
},
showPageCount: {
type: Boolean,
default: false
},
current: {
type: [Number, String],
default: 1
},
showGoto: {
type: Boolean,
default: true
},
noBorder: {
type: Boolean,
default: false
},
limits: {
type: Array,
default: function _default() {
return [10, 20, 50];
}
},
showLimits: {
type: Boolean,
default: true
},
counts: {
type: Number,
validator: function validator(value) {
return value > 4 && value < 22;
},
default: 7
},
superMini: {
type: Boolean,
default: false
},
prevText: {
type: String,
default: ''
},
nextText: {
type: String,
default: ''
},
showPageNum: {
type: Boolean,
default: true
},
limitsIcon: {
type: String,
default: 'kd-icon-caret-bottom'
}
},
data: function data() {
return {
ellipsis: '···',
pageCount: 0,
showPageArray: [],
innerCounts: Number(this.counts) < 5 ? 5 : Number(this.counts),
innerCurrent: Number(this.current),
type: this.noBorder ? 'none' : 'default',
size: this.noBorder ? 'mini' : 'default',
innerLimit: Number(this.limit),
markDic: markDic,
timer: null,
preValue: 0,
inputCurrent: Number(this.current)
};
},
watch: {
total: function total(newV, oldV) {
var _this = this;
if (Number(newV) !== oldV) {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
this.timer = setTimeout(function () {
_this.parseData();
_this.timer = null;
}, 100);
}
},
current: function current(newV, oldV) {
var _this2 = this;
if (Number(newV) !== oldV) {
this.innerCurrent = newV;
this.inputCurrent = newV;
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
this.timer = setTimeout(function () {
_this2.parseData();
_this2.timer = null;
}, 100);
this.preValue = this.innerCurrent;
}
},
limit: function limit(newV, oldV) {
var _this3 = this;
if (Number(newV) !== oldV) {
this.innerLimit = newV;
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
this.timer = setTimeout(function () {
_this3.parseData();
_this3.timer = null;
}, 100);
}
}
},
created: function created() {
this.innerCounts = this.counts < 5 ? 5 : this.counts;
// init
this.parseData();
this.preValue = this.innerCurrent;
},
methods: {
parseData: function parseData() {
this.emitEvent();
var _pageArrayData = [];
this.pageCount = Math.ceil(this.total / this.innerLimit);
// 显示页码数 大于 总页数
if (this.innerCounts >= this.pageCount) {
for (var i = 1; i < this.pageCount + 1; i++) {
_pageArrayData.push(pageItem(i));
}
} else if (this.total !== 0) {
// 前半部分全显,需要显示省略符'...',总页数
if (this.innerCurrent <= this.innerCounts - 2) {
for (var _i = 1; _i < this.innerCounts; _i++) {
_pageArrayData.push(pageItem(_i));
}
_pageArrayData.push(pageItem(this.ellipsis, this.markDic.right));
_pageArrayData.push(pageItem(this.pageCount));
} else if (this.pageCount - this.innerCurrent <= this.innerCounts - 3) {
// 1,省略符'...',后半部分全显
_pageArrayData.push(pageItem(1));
_pageArrayData.push(pageItem(this.ellipsis, this.markDic.left));
for (var _i2 = this.innerCounts - 1; _i2 > 0; _i2--) {
_pageArrayData.push(pageItem(this.pageCount - _i2 + 1));
}
} else {
// 1,省略符'...',中间部分,省略符'...',总页数
_pageArrayData.push(pageItem(1));
_pageArrayData.push(pageItem(this.ellipsis, this.markDic.left));
var num = this.innerCounts % 2 === 0 ? Math.ceil((this.innerCounts - 2) / 2) : Math.floor((this.innerCounts - 2) / 2);
var start = this.innerCurrent - num;
var endNum = this.innerCounts % 2 === 0 ? this.innerCounts - 1 : this.innerCounts - 2;
for (var _i3 = 0; _i3 < endNum; _i3++) {
_pageArrayData.push(pageItem(_i3 + start));
}
_pageArrayData.push(pageItem(this.ellipsis, this.markDic.right));
_pageArrayData.push(pageItem(this.pageCount));
}
}
// else {
// _pageArrayData.push(1);
// }
this.showPageArray = _pageArrayData;
},
// prev
prev: function prev() {
if (this.innerCurrent === 1) return;
this.innerCurrent--;
this.inputCurrent--;
this.parseData();
},
// next
next: function next() {
if (this.innerCurrent === this.pageCount) return;
this.innerCurrent++;
this.inputCurrent++;
this.parseData();
},
// jump
jumpEnterAction: function jumpEnterAction() {
var v = this.inputCurrent;
// if (!/^[0-9]{1,}$/.test(v)) {
// this.innerCurrent = 1;
// this.inputCurrent = 1;
// return;
// }
v = Math.floor(this.inputCurrent);
// 是否等于当前高亮值
if (v !== this.innerCurrent) {
if (v > 0 && v <= this.pageCount) {
this.innerCurrent = v;
} else {
this.innerCurrent = this.pageCount;
this.inputCurrent = this.pageCount;
}
this.parseData();
}
},
replaceValue: function replaceValue() {
var v = this.inputCurrent;
this.inputCurrent = v === 0 ? '' : v.toString().replace(/[^0-9]*/g, '');
},
// click page btn
checkPage: function checkPage(v) {
// click right ... or left ...
if (v === this.markDic.left) {
this.innerCurrent = this.preValue - 2;
} else if (v === this.markDic.right) {
this.innerCurrent = this.preValue + 2;
} else {
this.innerCurrent = v;
}
this.preValue = this.innerCurrent;
this.inputCurrent = this.innerCurrent;
this.parseData();
},
// change limit
selectSize: function selectSize(pageSize) {
if (this.innerLimit === pageSize) return;
this.innerLimit = pageSize;
// 当每页条数变动,页码自动变为1
this.innerCurrent = 1;
this.inputCurrent = 1;
this.parseData();
},
changePage: function changePage(i) {
this.checkPage(i);
},
// change event
emitEvent: function emitEvent() {
if (this.innerCurrent !== this.current || this.innerLimit !== this.limit) {
this.$emit('change', {
current: this.innerCurrent,
limit: this.innerLimit
});
}
},
getKey: function getKey(keyStr) {
if (keyStr === this.markDic.left || keyStr === this.markDic.right) {
return Math.random() + keyStr;
}
return keyStr;
}
}
});
// CONCATENATED MODULE: ./components/Pagination/pagination.vue?vue&type=script&lang=js&
/* harmony default export */ var Pagination_paginationvue_type_script_lang_js_ = (paginationvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(0);
// CONCATENATED MODULE: ./components/Pagination/pagination.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
Pagination_paginationvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var pagination = (component.exports);
// CONCATENATED MODULE: ./components/Pagination/index.js
pagination.install = function (Vue) {
Vue.component(pagination.name, pagination);
};
/* harmony default export */ var Pagination = __webpack_exports__["default"] = (pagination);
/***/ }),
/***/ 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);
}
}
});
/***/ }),
/***/ 44:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/ButtonGroup/button-group.vue?vue&type=template&id=7e6472ea&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"kdBtnGroup",staticClass:"kd-btn-group",class:_vm.checkStyle},[_vm._t("default")],2)}
var staticRenderFns = []
// CONCATENATED MODULE: ./components/ButtonGroup/button-group.vue?vue&type=template&id=7e6472ea&
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/ButtonGroup/button-group.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 button_groupvue_type_script_lang_js_ = ({
name: 'KdButtonGroup',
props: {
value: {
type: [String, Number, Array, Boolean]
},
checkType: {
type: String
},
disabled: {
type: Boolean
}
},
data: function data() {
return {
disabledStatus: false
};
},
computed: {
checkStyle: function checkStyle() {
return {
'kd-btn-group-radio': this.checkType === 'radio',
'kd-btn-group-checkbox': this.checkType === 'checkbox'
};
}
},
watch: {
value: {
immediate: true,
handler: function handler(v) {
this.init(v);
}
},
disabled: {
immediate: true,
handler: function handler(v) {
this.disabledStatus = v;
if (this.$children.length > 0) {
this.$children.forEach(function (child) {
child.disabledStatus = v;
});
}
}
}
},
methods: {
init: function init(v) {
var _this = this;
this.$nextTick(function () {
if (!_this.$slots.default) return;
if (_this.checkType === 'checkbox') {
_this.$slots.default.forEach(function (item) {
if (item.componentOptions) {
var some = v.some(function (value) {
return value === item.componentOptions.propsData.value;
});
if (some) {
item.componentInstance.active();
} else {
item.componentInstance.isActive = false;
}
}
});
} else if (_this.checkType === 'radio') {
_this.$slots.default.forEach(function (item) {
if (item.componentOptions) {
if (v === item.componentOptions.propsData.value) {
item.componentInstance.active();
} else {
item.componentInstance.isActive = false;
}
}
});
}
});
},
emit: function emit(v, active) {
if (this.disabled) return;
var value = '';
if (this.checkType === 'checkbox') {
if (active) {
value = this.value;
var index = value.findIndex(function (item) {
return item === v;
});
value.splice(index, 1);
} else {
value = [].concat(_toConsumableArray(this.value), [v]);
}
} else if (this.checkType === 'radio') {
value = v;
}
this.$emit('input', value);
}
}
});
// CONCATENATED MODULE: ./components/ButtonGroup/button-group.vue?vue&type=script&lang=js&
/* harmony default export */ var ButtonGroup_button_groupvue_type_script_lang_js_ = (button_groupvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(0);
// CONCATENATED MODULE: ./components/ButtonGroup/button-group.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
ButtonGroup_button_groupvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var button_group = __webpack_exports__["a"] = (component.exports);
/***/ }),
/***/ 6:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/Input/input.vue?vue&type=template&id=a7898d5a&
var render = function () {
var _obj;
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:[
_vm.type === 'textarea' ? 'kd-textarea' : 'kd-input',
'kd-input-' + _vm.size,
( _obj = {
'kd-input-disabled': _vm.disabled,
'kd-input-group': _vm.$slots.prepend || _vm.$slots.append,
'kd-with-prefix': _vm.$slots.prefix,
'kd-with-suffix': _vm.$slots.suffix || _vm.success || _vm.warning || _vm.error || _vm.clearable,
'kd-input-fluid': _vm.fluid
}, _obj['kd-input-status-' + (_vm.status === 'error' ? 'err' : _vm.status)] = _vm.success || _vm.warning || _vm.error, _obj['kd-textarea-show-count'] = _vm.showCount, _obj['kd-is-exceed'] = _vm.isExceed, _obj['kd-textarea-resize-vertical'] = _vm.type === 'textarea' && _vm.resize === 'vertical', _obj )
],style:({width: parseInt(_vm.width) + 'px'})},[(_vm.$slots.prepend)?_c('div',{staticClass:"kd-input-prepend"},[_vm._t("prepend")],2):_vm._e(),_c('div',{staticClass:"kd-input-wrapper"},[(_vm.$slots.prefix)?_c('div',{staticClass:"kd-input-prefix"},[_vm._t("prefix")],2):_vm._e(),((_vm.type)==='checkbox'&&(_vm.type !== 'textarea'))?_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.innerValue),expression:"innerValue"}],ref:"input",staticClass:"kd-input-inner",attrs:{"readonly":_vm.readonly,"disabled":_vm.disabled,"tabindex":_vm.tabindex,"maxlength":_vm.maxlength,"type":"checkbox"},domProps:{"checked":Array.isArray(_vm.innerValue)?_vm._i(_vm.innerValue,null)>-1:(_vm.innerValue)},on:{"focus":_vm.focusHandler,"change":[function($event){var $$a=_vm.innerValue,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.innerValue=$$a.concat([$$v]))}else{$$i>-1&&(_vm.innerValue=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{_vm.innerValue=$$c}},_vm.changeHandler],"blur":_vm.blurHandler,"keydown":_vm.keydownHandler,"keyup":_vm.keyupHandler}},'input',_vm.$attrs,false)):((_vm.type)==='radio'&&(_vm.type !== 'textarea'))?_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.innerValue),expression:"innerValue"}],ref:"input",staticClass:"kd-input-inner",attrs:{"readonly":_vm.readonly,"disabled":_vm.disabled,"tabindex":_vm.tabindex,"maxlength":_vm.maxlength,"type":"radio"},domProps:{"checked":_vm._q(_vm.innerValue,null)},on:{"focus":_vm.focusHandler,"change":[function($event){_vm.innerValue=null},_vm.changeHandler],"blur":_vm.blurHandler,"keydown":_vm.keydownHandler,"keyup":_vm.keyupHandler}},'input',_vm.$attrs,false)):(_vm.type !== 'textarea')?_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.innerValue),expression:"innerValue"}],ref:"input",staticClass:"kd-input-inner",attrs:{"readonly":_vm.readonly,"disabled":_vm.disabled,"tabindex":_vm.tabindex,"maxlength":_vm.maxlength,"type":_vm.type},domProps:{"value":(_vm.innerValue)},on:{"focus":_vm.focusHandler,"change":_vm.changeHandler,"blur":_vm.blurHandler,"keydown":_vm.keydownHandler,"keyup":_vm.keyupHandler,"input":function($event){if($event.target.composing){ return; }_vm.innerValue=$event.target.value}}},'input',_vm.$attrs,false)):_c('textarea',_vm._b({directives:[{name:"model",rawName:"