UNPKG

element-ui

Version:

A Component Library for Vue.js.

1,996 lines (1,696 loc) 1.21 MB
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 = 45); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/date-util"); /***/ }), /* 1 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/dom"); /***/ }), /* 2 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/util"); /***/ }), /* 3 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/mixins/emitter"); /***/ }), /* 4 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/mixins/locale"); /***/ }), /* 5 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/vue-popper"); /***/ }), /* 6 */ /***/ (function(module, exports) { module.exports = require("vue"); /***/ }), /* 7 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/merge"); /***/ }), /* 8 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/input"); /***/ }), /* 9 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/mixins/migrating"); /***/ }), /* 10 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/clickoutside"); /***/ }), /* 11 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/popup"); /***/ }), /* 12 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/locale"); /***/ }), /* 13 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/button"); /***/ }), /* 14 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/resize-event"); /***/ }), /* 15 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/types"); /***/ }), /* 16 */ /***/ (function(module, exports) { module.exports = require("throttle-debounce/debounce"); /***/ }), /* 17 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/checkbox"); /***/ }), /* 18 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/scrollbar"); /***/ }), /* 19 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/shared"); /***/ }), /* 20 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/date"); /***/ }), /* 21 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/transitions/collapse-transition"); /***/ }), /* 22 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/vdom"); /***/ }), /* 23 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/mixins/focus"); /***/ }), /* 24 */ /***/ (function(module, exports) { module.exports = require("babel-helper-vue-jsx-merge-props"); /***/ }), /* 25 */ /***/ (function(module, exports) { module.exports = require("throttle-debounce/throttle"); /***/ }), /* 26 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/tooltip"); /***/ }), /* 27 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/scroll-into-view"); /***/ }), /* 28 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/button-group"); /***/ }), /* 29 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/tag"); /***/ }), /* 30 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/scrollbar-width"); /***/ }), /* 31 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/checkbox-group"); /***/ }), /* 32 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/after-leave"); /***/ }), /* 33 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/progress"); /***/ }), /* 34 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/aria-utils"); /***/ }), /* 35 */ /***/ (function(module, exports) { module.exports = require("throttle-debounce"); /***/ }), /* 36 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/select"); /***/ }), /* 37 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/option"); /***/ }), /* 38 */ /***/ (function(module, exports) { module.exports = require("normalize-wheel"); /***/ }), /* 39 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/aria-dialog"); /***/ }), /* 40 */ /***/ (function(module, exports) { module.exports = require("async-validator"); /***/ }), /* 41 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/input-number"); /***/ }), /* 42 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/cascader-panel"); /***/ }), /* 43 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/radio"); /***/ }), /* 44 */ /***/ (function(module, exports) { module.exports = require("element-ui/lib/popover"); /***/ }), /* 45 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(46); /***/ }), /* 46 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __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!./packages/pagination/src/pager.vue?vue&type=template&id=7274f267& var pagervue_type_template_id_7274f267_render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "ul", { staticClass: "el-pager", on: { click: _vm.onPagerClick } }, [ _vm.pageCount > 0 ? _c( "li", { staticClass: "number", class: { active: _vm.currentPage === 1, disabled: _vm.disabled } }, [_vm._v("1")] ) : _vm._e(), _vm.showPrevMore ? _c("li", { staticClass: "el-icon more btn-quickprev", class: [_vm.quickprevIconClass, { disabled: _vm.disabled }], on: { mouseenter: function($event) { _vm.onMouseenter("left") }, mouseleave: function($event) { _vm.quickprevIconClass = "el-icon-more" } } }) : _vm._e(), _vm._l(_vm.pagers, function(pager) { return _c( "li", { key: pager, staticClass: "number", class: { active: _vm.currentPage === pager, disabled: _vm.disabled } }, [_vm._v(_vm._s(pager))] ) }), _vm.showNextMore ? _c("li", { staticClass: "el-icon more btn-quicknext", class: [_vm.quicknextIconClass, { disabled: _vm.disabled }], on: { mouseenter: function($event) { _vm.onMouseenter("right") }, mouseleave: function($event) { _vm.quicknextIconClass = "el-icon-more" } } }) : _vm._e(), _vm.pageCount > 1 ? _c( "li", { staticClass: "number", class: { active: _vm.currentPage === _vm.pageCount, disabled: _vm.disabled } }, [_vm._v(_vm._s(_vm.pageCount))] ) : _vm._e() ], 2 ) } var staticRenderFns = [] pagervue_type_template_id_7274f267_render._withStripped = true // CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=template&id=7274f267& // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pagination/src/pager.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var pagervue_type_script_lang_js_ = ({ name: 'ElPager', props: { currentPage: Number, pageCount: Number, pagerCount: Number, disabled: Boolean }, watch: { showPrevMore: function showPrevMore(val) { if (!val) this.quickprevIconClass = 'el-icon-more'; }, showNextMore: function showNextMore(val) { if (!val) this.quicknextIconClass = 'el-icon-more'; } }, methods: { onPagerClick: function onPagerClick(event) { var target = event.target; if (target.tagName === 'UL' || this.disabled) { return; } var newPage = Number(event.target.textContent); var pageCount = this.pageCount; var currentPage = this.currentPage; var pagerCountOffset = this.pagerCount - 2; if (target.className.indexOf('more') !== -1) { if (target.className.indexOf('quickprev') !== -1) { newPage = currentPage - pagerCountOffset; } else if (target.className.indexOf('quicknext') !== -1) { newPage = currentPage + pagerCountOffset; } } /* istanbul ignore if */ if (!isNaN(newPage)) { if (newPage < 1) { newPage = 1; } if (newPage > pageCount) { newPage = pageCount; } } if (newPage !== currentPage) { this.$emit('change', newPage); } }, onMouseenter: function onMouseenter(direction) { if (this.disabled) return; if (direction === 'left') { this.quickprevIconClass = 'el-icon-d-arrow-left'; } else { this.quicknextIconClass = 'el-icon-d-arrow-right'; } } }, computed: { pagers: function pagers() { var pagerCount = this.pagerCount; var halfPagerCount = (pagerCount - 1) / 2; var currentPage = Number(this.currentPage); var pageCount = Number(this.pageCount); var showPrevMore = false; var showNextMore = false; if (pageCount > pagerCount) { if (currentPage > pagerCount - halfPagerCount) { showPrevMore = true; } if (currentPage < pageCount - halfPagerCount) { showNextMore = true; } } var array = []; if (showPrevMore && !showNextMore) { var startPage = pageCount - (pagerCount - 2); for (var i = startPage; i < pageCount; i++) { array.push(i); } } else if (!showPrevMore && showNextMore) { for (var _i = 2; _i < pagerCount; _i++) { array.push(_i); } } else if (showPrevMore && showNextMore) { var offset = Math.floor(pagerCount / 2) - 1; for (var _i2 = currentPage - offset; _i2 <= currentPage + offset; _i2++) { array.push(_i2); } } else { for (var _i3 = 2; _i3 < pageCount; _i3++) { array.push(_i3); } } this.showPrevMore = showPrevMore; this.showNextMore = showNextMore; return array; } }, data: function data() { return { current: null, showPrevMore: false, showNextMore: false, quicknextIconClass: 'el-icon-more', quickprevIconClass: 'el-icon-more' }; } }); // CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=script&lang=js& /* harmony default export */ var src_pagervue_type_script_lang_js_ = (pagervue_type_script_lang_js_); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js /* 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, 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 functioal 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 } } // CONCATENATED MODULE: ./packages/pagination/src/pager.vue /* normalize component */ var component = normalizeComponent( src_pagervue_type_script_lang_js_, pagervue_type_template_id_7274f267_render, staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "packages/pagination/src/pager.vue" /* harmony default export */ var pager = (component.exports); // EXTERNAL MODULE: external "element-ui/lib/select" var select_ = __webpack_require__(36); var select_default = /*#__PURE__*/__webpack_require__.n(select_); // EXTERNAL MODULE: external "element-ui/lib/option" var option_ = __webpack_require__(37); var option_default = /*#__PURE__*/__webpack_require__.n(option_); // EXTERNAL MODULE: external "element-ui/lib/input" var input_ = __webpack_require__(8); var input_default = /*#__PURE__*/__webpack_require__.n(input_); // EXTERNAL MODULE: external "element-ui/lib/mixins/locale" var locale_ = __webpack_require__(4); var locale_default = /*#__PURE__*/__webpack_require__.n(locale_); // EXTERNAL MODULE: external "element-ui/lib/utils/util" var util_ = __webpack_require__(2); // CONCATENATED MODULE: ./packages/pagination/src/pagination.js /* harmony default export */ var pagination = ({ name: 'ElPagination', props: { pageSize: { type: Number, default: 10 }, small: Boolean, total: Number, pageCount: Number, pagerCount: { type: Number, validator: function validator(value) { return (value | 0) === value && value > 4 && value < 22 && value % 2 === 1; }, default: 7 }, currentPage: { type: Number, default: 1 }, layout: { default: 'prev, pager, next, jumper, ->, total' }, pageSizes: { type: Array, default: function _default() { return [10, 20, 30, 40, 50, 100]; } }, popperClass: String, prevText: String, nextText: String, background: Boolean, disabled: Boolean, hideOnSinglePage: Boolean }, data: function data() { return { internalCurrentPage: 1, internalPageSize: 0, lastEmittedPage: -1, userChangePageSize: false }; }, render: function render(h) { var layout = this.layout; if (!layout) return null; if (this.hideOnSinglePage && (!this.internalPageCount || this.internalPageCount === 1)) return null; var template = h('div', { 'class': ['el-pagination', { 'is-background': this.background, 'el-pagination--small': this.small }] }); var TEMPLATE_MAP = { prev: h('prev'), jumper: h('jumper'), pager: h('pager', { attrs: { currentPage: this.internalCurrentPage, pageCount: this.internalPageCount, pagerCount: this.pagerCount, disabled: this.disabled }, on: { 'change': this.handleCurrentChange } }), next: h('next'), sizes: h('sizes', { attrs: { pageSizes: this.pageSizes } }), slot: h('slot', [this.$slots.default ? this.$slots.default : '']), total: h('total') }; var components = layout.split(',').map(function (item) { return item.trim(); }); var rightWrapper = h('div', { 'class': 'el-pagination__rightwrapper' }); var haveRightWrapper = false; template.children = template.children || []; rightWrapper.children = rightWrapper.children || []; components.forEach(function (compo) { if (compo === '->') { haveRightWrapper = true; return; } if (!haveRightWrapper) { template.children.push(TEMPLATE_MAP[compo]); } else { rightWrapper.children.push(TEMPLATE_MAP[compo]); } }); if (haveRightWrapper) { template.children.unshift(rightWrapper); } return template; }, components: { Prev: { render: function render(h) { return h( 'button', { attrs: { type: 'button', disabled: this.$parent.disabled || this.$parent.internalCurrentPage <= 1 }, 'class': 'btn-prev', on: { 'click': this.$parent.prev } }, [this.$parent.prevText ? h('span', [this.$parent.prevText]) : h('i', { 'class': 'el-icon el-icon-arrow-left' })] ); } }, Next: { render: function render(h) { return h( 'button', { attrs: { type: 'button', disabled: this.$parent.disabled || this.$parent.internalCurrentPage === this.$parent.internalPageCount || this.$parent.internalPageCount === 0 }, 'class': 'btn-next', on: { 'click': this.$parent.next } }, [this.$parent.nextText ? h('span', [this.$parent.nextText]) : h('i', { 'class': 'el-icon el-icon-arrow-right' })] ); } }, Sizes: { mixins: [locale_default.a], props: { pageSizes: Array }, watch: { pageSizes: { immediate: true, handler: function handler(newVal, oldVal) { if (Object(util_["valueEquals"])(newVal, oldVal)) return; if (Array.isArray(newVal)) { this.$parent.internalPageSize = newVal.indexOf(this.$parent.pageSize) > -1 ? this.$parent.pageSize : this.pageSizes[0]; } } } }, render: function render(h) { var _this = this; return h( 'span', { 'class': 'el-pagination__sizes' }, [h( 'el-select', { attrs: { value: this.$parent.internalPageSize, popperClass: this.$parent.popperClass || '', size: 'mini', disabled: this.$parent.disabled }, on: { 'input': this.handleChange } }, [this.pageSizes.map(function (item) { return h('el-option', { attrs: { value: item, label: item + _this.t('el.pagination.pagesize') } }); })] )] ); }, components: { ElSelect: select_default.a, ElOption: option_default.a }, methods: { handleChange: function handleChange(val) { if (val !== this.$parent.internalPageSize) { this.$parent.internalPageSize = val = parseInt(val, 10); this.$parent.userChangePageSize = true; this.$parent.$emit('update:pageSize', val); this.$parent.$emit('size-change', val); } } } }, Jumper: { mixins: [locale_default.a], components: { ElInput: input_default.a }, data: function data() { return { userInput: null }; }, watch: { '$parent.internalCurrentPage': function $parentInternalCurrentPage() { this.userInput = null; } }, methods: { handleKeyup: function handleKeyup(_ref) { var keyCode = _ref.keyCode, target = _ref.target; // Chrome, Safari, Firefox triggers change event on Enter // Hack for IE: https://github.com/ElemeFE/element/issues/11710 // Drop this method when we no longer supports IE if (keyCode === 13) { this.handleChange(target.value); } }, handleInput: function handleInput(value) { this.userInput = value; }, handleChange: function handleChange(value) { this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(value); this.$parent.emitChange(); this.userInput = null; } }, render: function render(h) { return h( 'span', { 'class': 'el-pagination__jump' }, [this.t('el.pagination.goto'), h('el-input', { 'class': 'el-pagination__editor is-in-pagination', attrs: { min: 1, max: this.$parent.internalPageCount, value: this.userInput !== null ? this.userInput : this.$parent.internalCurrentPage, type: 'number', disabled: this.$parent.disabled }, nativeOn: { 'keyup': this.handleKeyup }, on: { 'input': this.handleInput, 'change': this.handleChange } }), this.t('el.pagination.pageClassifier')] ); } }, Total: { mixins: [locale_default.a], render: function render(h) { return typeof this.$parent.total === 'number' ? h( 'span', { 'class': 'el-pagination__total' }, [this.t('el.pagination.total', { total: this.$parent.total })] ) : ''; } }, Pager: pager }, methods: { handleCurrentChange: function handleCurrentChange(val) { this.internalCurrentPage = this.getValidCurrentPage(val); this.userChangePageSize = true; this.emitChange(); }, prev: function prev() { if (this.disabled) return; var newVal = this.internalCurrentPage - 1; this.internalCurrentPage = this.getValidCurrentPage(newVal); this.$emit('prev-click', this.internalCurrentPage); this.emitChange(); }, next: function next() { if (this.disabled) return; var newVal = this.internalCurrentPage + 1; this.internalCurrentPage = this.getValidCurrentPage(newVal); this.$emit('next-click', this.internalCurrentPage); this.emitChange(); }, getValidCurrentPage: function getValidCurrentPage(value) { value = parseInt(value, 10); var havePageCount = typeof this.internalPageCount === 'number'; var resetValue = void 0; if (!havePageCount) { if (isNaN(value) || value < 1) resetValue = 1; } else { if (value < 1) { resetValue = 1; } else if (value > this.internalPageCount) { resetValue = this.internalPageCount; } } if (resetValue === undefined && isNaN(value)) { resetValue = 1; } else if (resetValue === 0) { resetValue = 1; } return resetValue === undefined ? value : resetValue; }, emitChange: function emitChange() { var _this2 = this; this.$nextTick(function () { if (_this2.internalCurrentPage !== _this2.lastEmittedPage || _this2.userChangePageSize) { _this2.$emit('current-change', _this2.internalCurrentPage); _this2.lastEmittedPage = _this2.internalCurrentPage; _this2.userChangePageSize = false; } }); } }, computed: { internalPageCount: function internalPageCount() { if (typeof this.total === 'number') { return Math.max(1, Math.ceil(this.total / this.internalPageSize)); } else if (typeof this.pageCount === 'number') { return Math.max(1, this.pageCount); } return null; } }, watch: { currentPage: { immediate: true, handler: function handler(val) { this.internalCurrentPage = this.getValidCurrentPage(val); } }, pageSize: { immediate: true, handler: function handler(val) { this.internalPageSize = isNaN(val) ? 10 : val; } }, internalCurrentPage: { immediate: true, handler: function handler(newVal) { this.$emit('update:currentPage', newVal); this.lastEmittedPage = -1; } }, internalPageCount: function internalPageCount(newVal) { /* istanbul ignore if */ var oldPage = this.internalCurrentPage; if (newVal > 0 && oldPage === 0) { this.internalCurrentPage = 1; } else if (oldPage > newVal) { this.internalCurrentPage = newVal === 0 ? 1 : newVal; this.userChangePageSize && this.emitChange(); } this.userChangePageSize = false; } } }); // CONCATENATED MODULE: ./packages/pagination/index.js /* istanbul ignore next */ pagination.install = function (Vue) { Vue.component(pagination.name, pagination); }; /* harmony default export */ var packages_pagination = (pagination); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/dialog/src/component.vue?vue&type=template&id=60140e62& var componentvue_type_template_id_60140e62_render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "transition", { attrs: { name: "dialog-fade" }, on: { "after-enter": _vm.afterEnter, "after-leave": _vm.afterLeave } }, [ _c( "div", { directives: [ { name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" } ], staticClass: "el-dialog__wrapper", on: { click: function($event) { if ($event.target !== $event.currentTarget) { return null } return _vm.handleWrapperClick($event) } } }, [ _c( "div", { key: _vm.key, ref: "dialog", class: [ "el-dialog", { "is-fullscreen": _vm.fullscreen, "el-dialog--center": _vm.center }, _vm.customClass ], style: _vm.style, attrs: { role: "dialog", "aria-modal": "true", "aria-label": _vm.title || "dialog" } }, [ _c( "div", { staticClass: "el-dialog__header" }, [ _vm._t("title", [ _c("span", { staticClass: "el-dialog__title" }, [ _vm._v(_vm._s(_vm.title)) ]) ]), _vm.showClose ? _c( "button", { staticClass: "el-dialog__headerbtn", attrs: { type: "button", "aria-label": "Close" }, on: { click: _vm.handleClose } }, [ _c("i", { staticClass: "el-dialog__close el-icon el-icon-close" }) ] ) : _vm._e() ], 2 ), _vm.rendered ? _c( "div", { staticClass: "el-dialog__body" }, [_vm._t("default")], 2 ) : _vm._e(), _vm.$slots.footer ? _c( "div", { staticClass: "el-dialog__footer" }, [_vm._t("footer")], 2 ) : _vm._e() ] ) ] ) ] ) } var componentvue_type_template_id_60140e62_staticRenderFns = [] componentvue_type_template_id_60140e62_render._withStripped = true // CONCATENATED MODULE: ./packages/dialog/src/component.vue?vue&type=template&id=60140e62& // EXTERNAL MODULE: external "element-ui/lib/utils/popup" var popup_ = __webpack_require__(11); var popup_default = /*#__PURE__*/__webpack_require__.n(popup_); // EXTERNAL MODULE: external "element-ui/lib/mixins/migrating" var migrating_ = __webpack_require__(9); var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_); // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter" var emitter_ = __webpack_require__(3); var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/dialog/src/component.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var componentvue_type_script_lang_js_ = ({ name: 'ElDialog', mixins: [popup_default.a, emitter_default.a, migrating_default.a], props: { title: { type: String, default: '' }, modal: { type: Boolean, default: true }, modalAppendToBody: { type: Boolean, default: true }, appendToBody: { type: Boolean, default: false }, lockScroll: { type: Boolean, default: true }, closeOnClickModal: { type: Boolean, default: true }, closeOnPressEscape: { type: Boolean, default: true }, showClose: { type: Boolean, default: true }, width: String, fullscreen: Boolean, customClass: { type: String, default: '' }, top: { type: String, default: '15vh' }, beforeClose: Function, center: { type: Boolean, default: false }, destroyOnClose: Boolean }, data: function data() { return { closed: false, key: 0 }; }, watch: { visible: function visible(val) { var _this = this; if (val) { this.closed = false; this.$emit('open'); this.$el.addEventListener('scroll', this.updatePopper); this.$nextTick(function () { _this.$refs.dialog.scrollTop = 0; }); if (this.appendToBody) { document.body.appendChild(this.$el); } } else { this.$el.removeEventListener('scroll', this.updatePopper); if (!this.closed) this.$emit('close'); if (this.destroyOnClose) { this.$nextTick(function () { _this.key++; }); } } } }, computed: { style: function style() { var style = {}; if (!this.fullscreen) { style.marginTop = this.top; if (this.width) { style.width = this.width; } } return style; } }, methods: { getMigratingConfig: function getMigratingConfig() { return { props: { 'size': 'size is removed.' } }; }, handleWrapperClick: function handleWrapperClick() { if (!this.closeOnClickModal) return; this.handleClose(); }, handleClose: function handleClose() { if (typeof this.beforeClose === 'function') { this.beforeClose(this.hide); } else { this.hide(); } }, hide: function hide(cancel) { if (cancel !== false) { this.$emit('update:visible', false); this.$emit('close'); this.closed = true; } }, updatePopper: function updatePopper() { this.broadcast('ElSelectDropdown', 'updatePopper'); this.broadcast('ElDropdownMenu', 'updatePopper'); }, afterEnter: function afterEnter() { this.$emit('opened'); }, afterLeave: function afterLeave() { this.$emit('closed'); } }, mounted: function mounted() { if (this.visible) { this.rendered = true; this.open(); if (this.appendToBody) { document.body.appendChild(this.$el); } } }, destroyed: function destroyed() { // if appendToBody is true, remove DOM node after destroy if (this.appendToBody && this.$el && this.$el.parentNode) { this.$el.parentNode.removeChild(this.$el); } } }); // CONCATENATED MODULE: ./packages/dialog/src/component.vue?vue&type=script&lang=js& /* harmony default export */ var src_componentvue_type_script_lang_js_ = (componentvue_type_script_lang_js_); // CONCATENATED MODULE: ./packages/dialog/src/component.vue /* normalize component */ var component_component = normalizeComponent( src_componentvue_type_script_lang_js_, componentvue_type_template_id_60140e62_render, componentvue_type_template_id_60140e62_staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var component_api; } component_component.options.__file = "packages/dialog/src/component.vue" /* harmony default export */ var src_component = (component_component.exports); // CONCATENATED MODULE: ./packages/dialog/index.js /* istanbul ignore next */ src_component.install = function (Vue) { Vue.component(src_component.name, src_component); }; /* harmony default export */ var dialog = (src_component); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/autocomplete/src/autocomplete.vue?vue&type=template&id=152f2ee6& var autocompletevue_type_template_id_152f2ee6_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.close, expression: "close" } ], staticClass: "el-autocomplete", attrs: { "aria-haspopup": "listbox", role: "combobox", "aria-expanded": _vm.suggestionVisible, "aria-owns": _vm.id } }, [ _c( "el-input", _vm._b( { ref: "input", on: { input: _vm.handleInput, change: _vm.handleChange, focus: _vm.handleFocus, blur: _vm.handleBlur, clear: _vm.handleClear }, nativeOn: { keydown: [ function($event) { if ( !("button" in $event) && _vm._k($event.keyCode, "up", 38, $event.key, [ "Up", "ArrowUp" ]) ) { return null } $event.preventDefault() _vm.highlight(_vm.highlightedIndex - 1) }, function($event) { if ( !("button" in $event) && _vm._k($event.keyCode, "down", 40, $event.key, [ "Down", "ArrowDown" ]) ) { return null } $event.preventDefault() _vm.highlight(_vm.highlightedIndex + 1) }, function($event) { if ( !("button" in $event) && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter") ) { return null } return _vm.handleKeyEnter($event) }, function($event) { if ( !("button" in $event) && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab") ) { return null } return _vm.close($event) } ] } }, "el-input", [_vm.$props, _vm.$attrs], false ), [ _vm.$slots.prepend ? _c("template", { slot: "prepend" }, [_vm._t("prepend")], 2) : _vm._e(), _vm.$slots.append ? _c("template", { slot: "append" }, [_vm._t("append")], 2) : _vm._e(), _vm.$slots.prefix ? _c("template", { slot: "prefix" }, [_vm._t("prefix")], 2) : _vm._e(), _vm.$slots.suffix ? _c("template", { slot: "suffix" }, [_vm._t("suffix")], 2) : _vm._e() ], 2 ), _c( "el-autocomplete-suggestions", { ref: "suggestions", class: [_vm.popperClass ? _vm.popperClass : ""], attrs: { "visible-arrow": "", "popper-options": _vm.popperOptions, "append-to-body": _vm.popperAppendToBody, placement: _vm.placement, id: _vm.id } }, _vm._l(_vm.suggestions, function(item, index) { return _c( "li", { key: index, class: { highlighted: _vm.highlightedIndex === index }, attrs: { id: _vm.id + "-item-" + index, role: "option", "aria-selected": _vm.highlightedIndex === index }, on: { click: function($event) { _vm.select(item) } } }, [ _vm._t( "default", [ _vm._v("\n " + _vm._s(item[_vm.valueKey]) + "\n ") ], { item: item } ) ], 2 ) }), 0 ) ], 1 ) } var autocompletevue_type_template_id_152f2ee6_staticRenderFns = [] autocompletevue_type_template_id_152f2ee6_render._withStripped = true // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete.vue?vue&type=template&id=152f2ee6& // EXTERNAL MODULE: external "throttle-debounce/debounce" var debounce_ = __webpack_require__(16); var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_); // EXTERNAL MODULE: external "element-ui/lib/utils/clickoutside" var clickoutside_ = __webpack_require__(10); var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=template&id=cd10dcf0& var autocomplete_suggestionsvue_type_template_id_cd10dcf0_render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "transition", { attrs: { name: "el-zoom-in-top" }, on: { "after-leave": _vm.doDestroy } }, [ _c( "div", { directives: [ { name: "show", rawName: "v-show", value: _vm.showPopper, expression: "showPopper" } ], staticClass: "el-autocomplete-suggestion el-popper", class: { "is-loading": !_vm.parent.hideLoading && _vm.parent.loading }, style: { width: _vm.dropdownWidth }, attrs: { role: "region" } }, [ _c( "el-scrollbar", { attrs: { tag: "ul", "wrap-class": "el-autocomplete-suggestion__wrap", "view-class": "el-autocomplete-suggestion__list" } }, [ !_vm.parent.hideLoading && _vm.parent.loading ? _c("li", [_c("i", { staticClass: "el-icon-loading" })]) : _vm._t("default") ], 2 ) ], 1 ) ] ) } var autocomplete_suggestionsvue_type_template_id_cd10dcf0_staticRenderFns = [] autocomplete_suggestionsvue_type_template_id_cd10dcf0_render._withStripped = true // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=template&id=cd10dcf0& // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper" var vue_popper_ = __webpack_require__(5); var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_); // EXTERNAL MODULE: external "element-ui/lib/scrollbar" var scrollbar_ = __webpack_require__(18); var scrollbar_default = /*#__PURE__*/__webpack_require__.n(scrollbar_); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // /* harmony default export */ var autocomplete_suggestionsvue_type_script_lang_js_ = ({ components: { ElScrollbar: scrollbar_default.a }, mixins: [vue_popper_default.a, emitter_default.a], componentName: 'ElAutocompleteSuggestions', data: function data() { return { parent: this.$parent, dropdownWidth: '' }; }, props: { options: { default: function _default() { return { gpuAcceleration: false }; } }, id: String }, methods: { select: function select(item) { this.dispatch('ElAutocomplete', 'item-click', item); } }, updated: function updated() { var _this = this; this.$nextTick(function (_) { _this.popperJS && _this.updatePopper(); }); }, mounted: function mounted() { this.$parent.popperElm = this.popperElm = this.$el; this.referenceElm = this.$parent.$refs.input.$refs.input || this.$parent.$refs.input.$refs.textarea; this.referenceList = this.$el.querySelector('.el-autocomplete-suggestion__list'); this.referenceList.setAttribute('role', 'listbox'); this.referenceList.setAttribute('id', this.id); }, created: function created() { var _this2 = this; this.$on('visible', function (val, inputWidth) { _this2.dropdownWidth = inputWidth + 'px'; _this2.showPopper = val; }); } }); // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=script&lang=js& /* harmony default export */ var src_autocomplete_suggestionsvue_type_script_lang_js_ = (autocomplete_suggestionsvue_type_script_lang_js_); // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue /* normalize component */ var autocomplete_suggestions_component = normalizeComponent( src_autocomplete_suggestionsvue_type_script_lang_js_, autocomplete_suggestionsvue_type_template_id_cd10dcf0_render, autocomplete_suggestionsvue_type_template_id_cd10dcf0_staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var autocomplete_suggestions_api; } autocomplete_suggestions_component.options.__file = "packages/autocomplete/src/autocomplete-suggestions.vue" /* harmony default export */ var autocomplete_suggestions = (autocomplete_suggestions_component.exports); // EXTERNAL MODULE: external "element-ui/lib/mixins/focus" var focus_ = __webpack_require__(23); var focus_default = /*#__PURE__*/__webpack_require__.n(focus_); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/autocomplete/src/autocomplete.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var autocompletevue_type_script_lang_js_ = ({ name: 'ElAutocomplete', mixins: [emitter_default.a, focus_default()('input'), migrating_default.a], inheritAttrs: false, componentName: 'ElAutocomplete', components: { ElInput: input_default.a, ElAutocompleteSuggestions: autocomplete_suggestions }, directives: { Clickoutside: clickoutside_default.a }, props: { valueKey: { type: String, default: 'value' }, popperClass: String, popperOptions: Object, placeholder: String, clearable: { type: Boolean, default: false }, disabled: Boolean, name: String, size: String, value: String, maxlength: Number, minlength: Number, autofocus: Boolean, fetchSuggestions: Function, triggerOnFocus: { type: Boolean, default: true }, customItem: String