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 = 46);
/******/ })
/************************************************************************/
/******/ ([
/* 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/checkbox");
/***/ }),
/* 15 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/utils/resize-event");
/***/ }),
/* 16 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/utils/types");
/***/ }),
/* 17 */
/***/ (function(module, exports) {
module.exports = require("throttle-debounce/debounce");
/***/ }),
/* 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/utils/lodash");
/***/ }),
/* 29 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/button-group");
/***/ }),
/* 30 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/tag");
/***/ }),
/* 31 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/utils/scrollbar-width");
/***/ }),
/* 32 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/checkbox-group");
/***/ }),
/* 33 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/utils/after-leave");
/***/ }),
/* 34 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/progress");
/***/ }),
/* 35 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/utils/aria-utils");
/***/ }),
/* 36 */
/***/ (function(module, exports) {
module.exports = require("throttle-debounce");
/***/ }),
/* 37 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/select");
/***/ }),
/* 38 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/option");
/***/ }),
/* 39 */
/***/ (function(module, exports) {
module.exports = require("normalize-wheel");
/***/ }),
/* 40 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/utils/aria-dialog");
/***/ }),
/* 41 */
/***/ (function(module, exports) {
module.exports = require("async-validator");
/***/ }),
/* 42 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/input-number");
/***/ }),
/* 43 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/cascader-panel");
/***/ }),
/* 44 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/radio");
/***/ }),
/* 45 */
/***/ (function(module, exports) {
module.exports = require("element-ui/lib/popover");
/***/ }),
/* 46 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(47);
/***/ }),
/* 47 */
/***/ (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__(37);
var select_default = /*#__PURE__*/__webpack_require__.n(select_);
// EXTERNAL MODULE: external "element-ui/lib/option"
var option_ = __webpack_require__(38);
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__(17);
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,
selectWhenUnmatched: {
type: Boolean,
default: false
},
prefixIcon: String,
suffixIcon: String,
label: String,
debounce: {
type: Number,
default: 300
},
placement: {
type: String,
default: 'bottom-start'
},
hideLoading: Boolean,
popperAppendToBody: {
type: Boolean,
default: true
},
highlightFirstItem: {
type: Boolean,
default: false
}
},
data: function data() {
return {
activated: false,
suggestions: [],
loading: false,
highlightedIndex: -1,
suggestionDisabled: false
};
},
computed: {
suggestionVisible: function suggestionVisible() {
var suggestions = this.suggestions;
var isValidData = Array.isArray(suggestions) && suggestions.length > 0;
return (isValidData || this.loading) && this.activated;
},
id: function id() {
return 'el-autocomplete-' + Object(util_["generateId"])();
}
},
watch: {
suggestionVisible: function suggestionVisible(val) {
var $input = this.getInput();
if ($input) {
this.broadcast('ElAutocompleteSuggestions', 'visible', [val, $input.offsetWidth]);
}
}
},
methods: {
getMigratingConfig: function getMigratingConfig() {
return {
props: {
'custom-item': 'custom-item is removed, use scoped slot instead.',
'props': 'props is removed, use value-key instead.'
}
};
},
getData: function getData(queryString) {
var _this = this;
if (this.suggestionDisabled) {
return;
}
this.loading = true;
this.fetchSuggestions(queryString, function (suggestions) {
_this.loading = false;
if (_this.suggestionDisabled) {
return;
}
if (Array.isArray(suggestions)) {
_this.suggestions = suggestions;
_this.highlightedIndex = _this.highlightFirstItem ? 0 : -1;
} else {
console.error('[Element Error][Autocomplete]autocomplete suggestions must be an array');
}
});
},
handleInput: function handleInput(value) {
this.$emit('input', value);
this.suggestionDisabled = false;
if (!this.triggerOnFocus && !value) {
this.suggestionDisabled = true;
this.suggestions = [];
return;
}
this.debouncedGetData(value);
},
handleChange: function handleChange(value) {
this.$emit('change', value);
},
handleFocus: function handleFocus(event) {
this.activated = true;
this.$emit('focus', event);
if (this.triggerOnFocus) {
this.debouncedGetData(this.value);
}
},
handleBlur: function handleBlur(event) {
this.$emit('blur', event);
},
handleClear: function handleClear() {
this.activated = false;
this.$emit('clear');
},
close: function close(e) {
this.activated = false;
},
handleKeyEnter: function handleKeyEnter(e) {
var _this2 = this;
if (this.suggestionVisible && this.highlightedIndex >= 0 && this.highlightedIndex < this.suggestions.length) {
e.preventDefault();
this.select(this.suggestions[this.highlightedIndex]);
} else if (this.selectWhenUnmatched) {
this.$emit('select', { value: this.value });
this.$nextTick(function (_) {
_this2.suggestions = [];
_this2.highlightedIndex = -1;
});
}
},
select: function select(item) {
var _this3 = this;
this.$emit('input', item[this.valueKey]);
this.$emit('select', item);
this.$nextTick(function (_) {
_this3.suggestions = [];
_this3.highlightedIndex = -1;
});
},
highlight: function highlight(index) {
if (!this.suggestionVisible || this.loading) {
return;
}
if (index < 0) {
this.highlightedIndex = -1;
return;
}
if (index >= this.suggestions.length) {
index = this.suggestions.length - 1;
}
var suggestion = this.$refs.suggestions.$el.querySelector('.el-autocomplete-suggestion__wrap');
var suggestionList = suggestion.querySelectorAll('.el-autocomplete-suggestion__list li');
var highlightItem = suggestionList[index];
var scrollTop = suggestion.scrollTop;
var offsetTop = highlightItem.offsetTop;
if (offsetTop + highlightItem.scrollHeight > scrollTop + suggestion.clientHeight) {
suggestion.scrollTop += highlightItem.scrollHeight;
}
if (offsetTop < scrollTop) {
suggestion.scrollTop -= highlightItem.scrollHeight;
}
this.highlightedIndex = index;
var $input = this.getInput();
$input.setAttribute('aria-activedescendant', this.id + '-item-' + this.highlightedIndex);
},
getInput: function getInput() {
return this.$refs.input.getInput();
}
},
mounted: function mounted() {
var _this4 = this;
this.debouncedGetData = debounce_default()(this.debounce, this.getData);
this.$on('item-click', function (item) {
_this4.select(item);
});
var $input = this.getInput();
$input.setAttribute('role', 'textbox');
$input.setAttribute('aria-autocomplete', 'list');
$input.setAttribute('aria-controls', 'id');
$input.setAttribute('aria-activedescendant', this.id + '-item-' + this.highlightedIndex);
},
beforeDestroy: function beforeDestroy() {
this.$refs.suggestions.$destroy();
}
});
// CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete.vue?vue&type=script&lang=js&
/* harmony default export */ var src_autocompletevue_type_script_lang_js_ = (autocompletevue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete.vue
/* normalize component */
var autocomplete_component = normalizeComponent(
src_autocompletevue_type_script_lang_js_,
autocompletevue_type_template_id_152f2ee6_render,
autocompletevue_type_template_id_152f2ee6_staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var autocomplete_api; }
autocomplete_component.options.__file = "packages/autocomplete/src/autocomplete.vue"
/* harmony default export */ var autocomplete = (autocomplete_component.exports);
// CONCATENATED MODULE: ./packages/autocomplete/index.js
/* istanbul ignore next */
autocomplete.install = function (Vue) {
Vue.component(autocomplete.name, autocomplete);
};
/* harmony default export */ var packages_autocomplete = (autocomplete);
// EXTERNAL MODULE: external "element-ui/lib/button"
var button_ = __webpack_require__(13);
var button_default = /*#__PURE__*/__webpack_require__.n(button_);
// EXTERNAL MODULE: external "element-ui/lib/button-group"
var button_group_ = __webpack_require__(29);
var button_group_default = /*#__PURE__*/__webpack_require__.n(button_group_);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown.vue?vue&type=script&lang=js&
/* harmony default export */ var dropdownvue_type_script_lang_js_ = ({
name: 'ElDropdown',
componentName: 'ElDropdown',
mixins: [emitter_default.a, migrating_default.a],
directives: { Clickoutside: clickoutside_default.a },
components: {
ElButton: button_default.a,
ElButtonGroup: button_group_default.a
},
provide: function provide() {
return {
dropdown: this
};
},
props: {
trigger: {
type: String,
default: 'hover'
},
type: String,
size: {
type: String,
default: ''
},
splitButton: Boolean,
hideOnClick: {
type: Boolean,
default: true
},
placement: {
type: String,
default: 'bottom-end'
},
visibleArrow: {
default: true
},
showTimeout: {
type: Number,
default: 250
},
hideTimeout: {
type: Number,
default: 150
},
tabindex: {
type: Number,
default: 0
},
disabled: {
type: Boolean,
default: false
}
},
data: function data() {
return {
timeout: null,
visible: false,
triggerElm: null,
menuItems: null,
menuItemsArray: null,
dropdownElm: null,
focusing: false,
listId: 'dropdown-menu-' + Object(util_["generateId"])()
};
},
computed: {
dropdownSize: function dropdownSize() {
return this.size || (this.$ELEMENT || {}).size;
}
},
mounted: function mounted() {
this.$on('menu-item-click', this.handleMenuItemClick);
},
watch: {
visible: function visible(val) {
this.broadcast('ElDropdownMenu', 'visible', val);
this.$emit('visible-change', val);
},
focusing: function focusing(val) {
var selfDefine = this.$el.querySelector('.el-dropdown-selfdefine');
if (selfDefine) {
// 自定义
if (val) {
selfDefine.className += ' focusing';
} else {
selfDefine.className = selfDefine.className.replace('focusing', '');
}
}
}
},
methods: {
getMigratingConfig: function getMigratingConfig() {
return {
props: {
'menu-align': 'menu-align is renamed to placement.'
}
};
},
show: function show() {
var _this = this;
if (this.disabled) return;
clearTimeout(this.timeout);
this.timeout = setTimeout(function () {
_this.visible = true;
}, this.trigger === 'click' ? 0 : this.showTimeout);
},
hide: function hide() {
var _this2 = this;
if (this.disabled) return;
this.removeTabindex();
if (this.tabindex >= 0) {
this.resetTabindex(this.triggerElm);
}
clearTimeout(this.timeout);
this.timeout = setTimeout(function () {
_this2.visible = false;
}, this.trigger === 'click' ? 0 : this.hideTimeout);
},
handleClick: function handleClick() {
if (this.disabled) return;
if (this.visible) {
this.hide();
} else {
this.show();
}
},
handleTriggerKeyDown: function handleTriggerKeyDown(ev) {
var keyCode = ev.keyCode;
if ([38, 40].indexOf(keyCode) > -1) {
// up/down
this.removeTabindex();
this.resetTabindex(this.menuItems[0]);
this.menuItems[0].focus();
ev.preventDefault();
ev.stopPropagation();
} else if (keyCode === 13) {
// space enter选中
this.handleClick();
} else if ([9, 27].indexOf(keyCode) > -1) {
// tab || esc
this.hide();
}
},
handleItemKeyDown: function handleItemKeyDown(ev) {
var keyCode = ev.keyCode;
var target = ev.target;
var currentIndex = this.menuItemsArray.indexOf(target);
var max = this.menuItemsArray.length - 1;
var nextIndex = void 0;
if ([38, 40].indexOf(keyCode) > -1) {
// up/down
if (keyCode === 38) {
// up
nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
} else {
// down
nextIndex = currentIndex < max ? currentIndex + 1 : max;
}
this.removeTabindex();
this.resetTabindex(this.menuItems[nextIndex]);
this.menuItems[nextIndex].focus();
ev.preventDefault();
ev.stopPropagation();
} else if (keyCode === 13) {
// enter选中
this.triggerElmFocus();
target.click();
if (this.hideOnClick) {
// click关闭
this.visible = false;
}
} else if ([9, 27].indexOf(keyCode) > -1) {
// tab // esc
this.hide();
this.triggerElmFocus();
}
},
resetTabindex: function resetTabindex(ele) {
// 下次tab时组件聚焦元素
this.removeTabindex();
ele.setAttribute('tabindex', '0'); // 下次期望的聚焦元素
},
removeTabindex: function removeTabindex() {
this.triggerElm.setAttribute('tabindex', '-1');
this.menuItemsArray.forEach(function (item) {
item.setAttribute('tabindex', '-1');
});
},
initAria: function initAria() {
this.dropdownElm.setAttribute('id', this.listId);
this.triggerElm.setAttribute('aria-haspopup', 'list');
this.triggerElm.setAttribute('aria-controls', this.listId);
if (!this.splitButton) {
// 自定义
this.triggerElm.setAttribute('role', 'button');
this.triggerElm.setAttribute('tabindex', this.tabindex);
this.triggerElm.setAttribute('class', (this.triggerElm.getAttribute('class') || '') + ' el-dropdown-selfdefine'); // 控制
}
},
initEvent: function initEvent() {
var _this3 = this;
var trigger = this.trigger,
show = this.show,
hide = this.hide,
handleClick = this.handleClick,
splitButton = this.splitButton,
handleTriggerKeyDown = this.handleTriggerKeyDown,
handleItemKeyDown = this.handleItemKeyDown;
this.triggerElm = splitButton ? this.$refs.trigger.$el : this.$slots.default[0].elm;
var dropdownElm = this.dropdownElm;
this.triggerElm.addEventListener('keydown', handleTriggerKeyDown); // triggerElm keydown
dropdownElm.addEventListener('keydown', handleItemKeyDown, true); // item keydown
// 控制自定义元素的样式
if (!splitButton) {
this.triggerElm.addEventListener('focus', function () {
_this3.focusing = true;
});
this.triggerElm.addEventListener('blur', function () {
_this3.focusing = false;
});
this.triggerElm.addEventListener('click', function () {
_this3.focusing = false;
});
}
if (trigger === 'hover') {
this.triggerElm.addEventListener('mouseenter', show);
this.triggerElm.addEventListener('mouseleave', hide);
dropdownElm.addEventListener('mouseenter', show);
dropdownElm.addEventListener('mouseleave', hide);
} else if (trigger === 'click') {
this.triggerElm.addEventListener('click', handleClick);
}
},
handleMenuItemClick: function handleMenuItemClick(command, instance) {
if (this.hideOnClick) {
this.visible = false;
}
this.$emit('command', command, instance);
},
triggerElmFocus: function triggerElmFocus() {
this.triggerElm.focus && this.triggerElm.focus();
},
initDomOperation: function initDomOperation() {
this.dropdownElm = this.popperElm;
this.menuItems = this.dropdownElm.querySelectorAll("[tabindex='-1']");
this.menuItemsArray = [].slice.call(this.menuItems);
this.initEvent();
this.initAria();
}
},
render: function render(h) {
var _this4 = this;
var hide = this.hide,
splitButton = this.splitButton,
type = this.type,
dropdownSize = this.dropdownSize,
disabled = this.disabled;
var handleMainButtonClick = function handleMainButtonClick(event) {
_this4.$emit('click', event);
hide();
};
var triggerElm = null;
if (splitButton) {
triggerElm = h('el-button-group', [h(
'el-button',
{
attrs: { type: type, size: dropdownSize, disabled: disabled },
nativeOn: {
'click': handleMainButtonClick
}
},
[this.$slots.default]
), h(
'el-button',
{ ref: 'trigger', attrs: { type: type, size: dropdownSize, disabled: disabled },
'class': 'el-dropdown__caret-button' },
[h('i', { 'class': 'el-dropdown__icon el-icon-arrow-down' })]
)]);
} else {
triggerElm = this.$slots.default;
var vnodeData = triggerElm[0].data || {};
var _vnodeData$attrs = vnodeData.attrs,
attrs = _vnodeData$attrs === undefined ? {} : _vnodeData$attrs;
if (disabled && !attrs.disabled) {
attrs.disabled = true;
vnodeData.attrs = attrs;
}
}
var menuElm = disabled ? null : this.$slots.dropdown;
return h(
'div',
{ 'class': 'el-dropdown', directives: [{
name: 'clickoutside',
value: hide
}],
attrs: { 'aria-disabled': disabled }
},
[triggerElm, menuElm]
);
}
});
// CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue?vue&type=script&lang=js&
/* harmony default export */ var src_dropdownvue_type_script_lang_js_ = (dropdownvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue
var dropdown_render, dropdown_staticRenderFns
/* normalize component */
var dropdown_component = normalizeComponent(
src_dropdownvue_type_script_lang_js_,
dropdown_render,
dropdown_staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var dropdown_api; }
dropdown_component.options.__file = "packages/dropdown/src/dropdown.vue"
/* harmony default export */ var dropdown = (dropdown_component.exports);
// CONCATENATED MODULE: ./packages/dropdown/index.js
/* istanbul ignore next */
dropdown.install = function (Vue) {
Vue.component(dropdown.name, dropdown);
};
/* harmony default export */ var packages_dropdown = (dropdown);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown-menu.vue?vue&type=template&id=0da6b714&
var dropdown_menuvue_type_template_id_0da6b714_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(
"ul",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.showPopper,
expression: "showPopper"
}
],
staticClass: "el-dropdown-menu el-popper",
class: [_vm.size && "el-dropdown-menu--" + _vm.size]
},
[_vm._t("default")],
2
)
]
)
}
var dropdown_menuvue_type_template_id_0da6b714_staticRenderFns = []
dropdown_menuvue_type_template_id_0da6b714_render._withStripped = true
// CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue?vue&type=template&id=0da6b714&
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown-menu.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
/* harmony default export */ var dropdown_menuvue_type_script_lang_js_ = ({
name: 'ElDropdownMenu',
componentName: 'ElDropdownMenu',
mixins: [vue_popper_default.a],
props: {
visibleArrow: {
type: Boolean,
default: true
},
arrowOffset: {
type: Number,
default: 0
}
},
data: function data() {
return {
size: this.dropdown.dropdownSize
};
},
inject: ['dropdown'],
created: function created() {
var _this = this;
this.$on('updatePopper', function () {
if (_this.showPopper) _this.updatePopper();
});
this.$on('visible', function (val) {
_this.showPopper = val;
});
},
mounted: function mounted() {
this.dropdown.popperElm = this.popperElm = this.$el;
this.referenceElm = this.dropdown.$el;
// compatible with 2.6 new v-slot syntax
// issue link https://github.com/ElemeFE/element/issues/14345
this.dropdown.initDomOperation();
},
watch: {
'dropdown.placement': {
immediate: true,
handler: function handler(val) {
this.currentPlacement = val;
}
}
}
});
// CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue?vue&type=script&lang=js&
/* harmony default export */ var src_dropdown_menuvue_type_script_lang_js_ = (dropdown_menuvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue
/* normalize component */
var dropdown_menu_component = normalizeComponent(
src_dropdown_menuvue_type_script_lang_js_,
dropdown_menuvue_type_template_id_0da6b714_render,
dropdown_menuvue_type_template_id_0da6b714_staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var dropdown_menu_api; }
dropdown_menu_component.options.__file = "packages/dropdown/src/dropdown-menu.vue"
/* harmony default export */ var dropdown_menu = (dropdown_menu_component.exports);
// CONCATENATED MODULE: ./packages/dropdown-menu/index.js
/* istanbul ignore next */
dropdown_menu.install = function (Vue) {
Vue.component(dropdown_menu.name, dropdown_menu);
};
/* harmony default export */ var packages_dropdown_menu = (dropdown_menu);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown-item.vue?vue&type=template&id=6359102a&
var dropdown_itemvue_type_template_id_6359102a_render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"li",
{
staticClass: "el-dropdown-menu__item",
class: {
"is-disabled": _vm.disabled,
"el-dropdown-menu__item--divided": _vm.divided
},
attrs: {
"aria-disabled": _vm.disabled,
tabindex: _vm.disabled ? null : -1
},
on: { click: _vm.handleClick }
},
[_vm.icon ? _c("i", { class: _vm.icon }) : _vm._e(), _vm._t("default")],
2
)
}
var dropdown_itemvue_type_template_id_6359102a_staticRenderFns = []
dropdown_itemvue_type_template_id_6359102a_render._withStripped = true
// CONCATENATED MODULE: ./packages/dropdown/src/dropdown-item.vue?vue&type=template&id=6359102a&
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown-item.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var dropdown_itemvue_type_script_lang_js_ = ({
name: 'ElDropdownItem',
mixins: [emitter_default.a],
props: {
command: {},
disabled: Boolean,
divided: Boolean,
icon: String
},
methods: {
handleClick: function handleClick(e) {
this.dispatch('ElDropdown', 'menu-item-click', [this.command, this]);
}
}
});
// CONCATENATED MODULE: ./packages/dropdown/src/dropdown-item.vue?vue&type=script&lang=js&
/* harmony default export */ var src_dropdown_itemvue_type_script_lang_js_ = (dropdown_itemvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/dropdown/src/dropdown-item.vue
/* normalize component */
var dropdown_item_component = normalizeComponent(
src_dropdown_itemvue_type_script_lang_js_,
dropdown_itemvue_type_template_id_6359102a_render,
dropdown_itemvue_type_template_id_6359102a_staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var dropdown_item_api; }
dropdown_item_component.options.__file = "packages/dropdown/src/dropdown-item.vue"
/* harmony default export */ var dropdown_item = (dropdown_item_component.exports);
// CONCATENATED MODULE: ./packages/dropdown-item/index.js
/* istanbul ignore next */
dropdown_item.install = function (Vue) {
Vue.component(dropdown_item.name, dropdown_item);
};
/* harmony default export */ var packages_dropdown_item = (dropdown_item);
// CONCATENATED MODULE: ./src/utils/aria-utils.js
var aria = aria || {};
aria.Utils = aria.Utils || {};
/**
* @desc Set focus on descendant nodes until the first focusable element is
* found.
* @param element
* DOM node for which to find the first focusable descendant.
* @returns
* true if a focusable element is found and focus is set.
*/
aria.Utils.focusFirstDescendant = function (element) {
for (var i = 0; i < element.childNodes.length; i++) {
var child = element.childNodes[i];
if (aria.Utils.attemptFocus(child) || aria.Utils.focusFirstDescendant(child)) {
return true;
}
}
return false;
};
/**
* @desc Find the last descendant node that is focusable.
* @param element
* DOM node for which to find the last focusable descendant.
* @returns
* true if a focusable element is found and focus is set.
*/
aria.Utils.focusLastDescendant = function (element) {
for (var i = element.childNodes.length - 1; i >= 0; i--) {
var child = element.childNodes[i];
if (aria.Utils.attemptFocus(child) || aria.Utils.focusLastDescendant(child)) {
return true;
}
}
return false;
};
/**
* @desc Set Attempt to set focus on the current node.
* @param element
* The node to attempt to focus on.
* @returns
* true if element is focused.
*/
aria.Utils.attemptFocus = function (element) {
if (!aria.Utils.isFocusable(element)) {
return false;
}
aria.Utils.IgnoreUtilFocusChanges = true;
try {
element.focus();
} catch (e) {}
aria.Utils.IgnoreUtilFocusChanges = false;
return document.activeElement === element;
};
aria.Utils.isFocusable = function (element) {
if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute('tabIndex') !== null) {
return true;
}
if (element.disabled) {
return false;
}
switch (element.nodeName) {
case 'A':
return !!element.href && element.rel !== 'ignore';
case 'INPUT':
return element.type !== 'hidden' && element.type !== 'file';
case 'BUTTON':
case 'SELECT':
case 'TEXTAREA':
return true;
default:
return false;
}
};
/**
* 触发一个事件
* mouseenter, mouseleave, mouseover, keyup, change, click 等
* @param {Element} elm
* @param {String} name
* @param {*} opts
*/
aria.Utils.triggerEvent = function (elm, name) {
var eventName = void 0;
if (/^mouse|click/.test(name)) {
eventName = 'MouseEvents';
} else if (/^key/.test(name)) {
eventName = 'KeyboardEvent';
} else {
eventName = 'HTMLEvents';
}
var evt = document.createEvent(eventName);
for (var _len = arguments.length, opts = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
opts[_key - 2] = arguments[_key];
}
evt.initEvent.apply(evt, [name].concat(opts));
elm.dispatchEvent ? elm.dispatchEvent(evt) : elm.fireEvent('on' + name, evt);
return elm;
};
aria.Utils.keys = {
tab: 9,
enter: 13,
space: 32,
left: 37,
up: 38,
right: 39,
down: 40,
esc: 27
};
/* harmony default export */ var aria_utils = (aria.Utils);
// CONCATENATED MODULE: ./src/utils/menu/aria-submenu.js
var SubMenu = function SubMenu(parent, domNode) {
this.domNode = domNode;
this.parent = parent;
this.subMenuItems = [];
this.subIndex = 0;
this.init();
};
SubMenu.prototype.init = function () {
this.subMenuItems = this.domNode.querySelectorAll('li');
this.addListeners();
};
SubMenu.prototype.gotoSubIndex = function (idx) {
if (idx === this.subMenuItems.length) {
idx = 0;
} else if (idx < 0) {
idx = this.subMenuItems.length - 1;
}
this.subMenuItems[idx].focus();
this.subIndex = idx;
};
SubMenu.prototype.addListeners = function () {
var _this = this;
var keys = aria_utils.keys;
var parentNode = this.parent.domNode;
Array.prototype.forEach.call(this.subMenuItems, function (el) {
el.addEventListener('keydown', function (event) {
var prevDef = false;
switch (event.keyCode) {
case keys.down:
_this.gotoSubIndex(_this.subIndex + 1);
prevDef = true;
break;
case keys.up:
_this.gotoSubIndex(_this.subIndex - 1);
prevDef = true;
break;
case keys.tab:
aria_utils.triggerEvent(parentNode, 'mouseleave');
break;
case keys.enter:
case keys.space:
prevDef = true;
event.currentTarget.click();
break;
}
if (prevDef) {
event.preventDefault();
event.stopPropagation();
}
return false;
});
});
};
/* harmony default export */ var aria_submenu = (SubMenu);
// CONCATENATED MODULE: ./src/utils/menu/aria-menuitem.js
var MenuItem = function MenuItem(domNode) {
this.domNode = domNode;
this.submenu = null;
this.init();
};
MenuItem.prototype.init = function () {
this.domNode.setAttribute('tabindex', '0');
var menuChild = this.domNode.querySelector('.el-menu');
if (menuChild) {
this.submenu = new aria_submenu(this, menuChild);
}
this.addListeners();
};
MenuItem.prototype.addListeners = function () {
var _this = this;
var keys = aria_utils.keys;
this.domNode.addEventListener('keydown', function (event) {
var prevDef = false;
switch (event.keyCode) {
case keys.down:
aria_utils.triggerEvent(event.currentTarget, 'mouseenter');
_this.submenu && _this.submenu.gotoSubIndex(0);
prevDef = true;
break;
case keys.up:
aria_utils.triggerEvent(event.currentTarget, 'mouseenter');
_this.submenu && _this.submenu.gotoSubIndex(_this.submenu.subMenuItems.length - 1);
prevDef = true;
break;
case keys.tab:
aria_utils.triggerEvent(event.currentTarget, 'mouseleave');
break;
case keys.enter:
case keys.space:
prevDef = true;
event.currentTarget.click();
break;
}
if (prevDef) {
event.preventDefault();
}
});
};
/* harmony default export */ var aria_menuitem = (MenuItem);
// CONCATENATED MODULE: ./src/utils/menu/aria-menubar.js
var Menu = function Menu(domNode) {
this.domNode = domNode;
this.init();
};
Menu.prototype.init = function () {
var menuChildren = this.domNode.childNodes;
[].filter.call(menuChildren, function (child) {
return child.nodeType === 1;
}).forEach(function (child) {
new aria_menuitem(child); // eslint-disable-line
});
};
/* harmony default export */ var aria_menubar = (Menu);
// EXTERNAL MODULE: external "element-ui/lib/utils/dom"
var dom_ = __webpack_require__(1);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu.vue?vue&type=script&lang=js&
/* harmony default export */ var menuvue_type_script_lang_js_ = ({
name: 'ElMenu',
render: function render(h) {
var component = h(
'ul',
{
attrs: {
role: 'menubar'
},
key: +this.collapse,
style: { backgroundColor: this.backgroundColor || '' },
'class': {
'el-menu--horizontal': this.mode === 'horizontal',
'el-menu--collapse': this.collapse,
"el-menu": true
}
},
[this.$slots.default]
);
if (this.collapseTransition) {
return h('el-menu-collapse-transition', [component]);
} else {
return component;
}
},
componentName: 'ElMenu',
mixins: [emitter_default.a, migrating_default.a],
provide: function provide() {
return {
rootMenu: this
};
},
components: {
'el-menu-collapse-transition': {
functional: true,
render: function render(createElement, context) {
var data = {
props: {
mode: 'out-in'
},
on: {
beforeEnter: function beforeEnter(el) {
el.style.opacity = 0.2;
},
enter: function enter(el) {
Object(dom_["addClass"])(el, 'el-opacity-transition');
el.style.opacity = 1;
},
afterEnter: function afterEnter(el) {
Object(dom_["removeClass"])(el, 'el-opacity-transition');
el.style.opacity = '';
},
beforeLeave: function beforeLeave(el) {
if (!el.dataset) el.dataset = {};
if (Object(dom_["hasClass"])(el, 'el-menu--collapse')) {
Object(dom_["removeClass"])(el, 'el-menu--collapse');
el.dataset.oldOverflow = el.style.overflow;
el.dataset.scrollWidth = el.clientWidth;
Object(dom_["addClass"])(el, 'el-menu--collapse');
} else {
Object(dom_["addClass"])(el, 'el-menu--collapse');
el.dataset.oldOverflow = el.style.overflow;
el.dataset.scrollWidth = el.clientWidth;
Object(dom_["removeClass"])(el, 'el-menu--collapse');
}
el.style.width = el.scrollWidth + 'px';
el.style.overflow = 'hidden';
},
leave: function leave(el) {
Object(dom_["addClass"])(el, 'horizontal-collapse-transition');
el.style.width = el.dataset.scrollWidth + 'px';
}
}
};
return createElement('transition', data, context.children);
}
}
},
props: {
mode: {
type: String,
default: 'vertical'
},
defaultActive: {
type: String,
default: ''
},
defaultOpeneds: Array,
uniqueOpened: Boolean,
router: Boolean,
menuTrigger: {
type: String,
default: 'hover'
},
collapse: Boolean,
backgroundColor: String,
textColor: String,
activeTextColor: String,
collapseTransition: {
type: Boolean,
default: true
}
},
data: function data() {
return {
activeIndex: this.defaultActive,
openedMenus: this.defaultOpeneds && !this.collapse ? this.defaultOpeneds.slice(0) : [],
items: {},
submenus: {}
};
},
computed: {
hoverBackground: function hoverBackground() {
return this.backgroundColor ? this.mixColor(this.backgroundColor, 0.2) : '';
},
isMenuPopup: function isMenuPopup() {
return this.mode === 'horizontal' || this.mode === 'vertical' && this.collapse;
}
},
watch: {
defaultActive: function defaultActive(value) {
if (!this.items[value]) {
this.activeIndex = null;
}
this.updateActiveIndex(value);
},
defaultOpeneds: function defaultOpeneds(value) {
if (!this.collapse) {
this.openedMenus = value;
}
},
collapse: function collapse(value) {
if (value) this.openedMenus = [];
this.broadcast('ElSubmenu', 'toggle-collapse', value);
}
},
methods: {
updateActiveIndex: function updateActiveIndex(val) {
var item = this.items[val] || this.items[this.activeIndex] || this.items[this.defaultActive];
if (item) {
this.activeIndex = item.index;
this.initOpenedMenu();
} else {
this.activeIndex = null;
}
},
getMigratingConfig: function getMigratingConfig() {
return {
props: {
'theme': 'theme is removed.'
}
};
},
getColorChannels: function getColorChannels(color) {
color = color.replace('#', '');
if (/^[0-9a-fA-F]{3}$/.test(color)) {
color = color.split('');
for (var i = 2; i >= 0; i--) {
color.splice(i, 0, color[i]);
}
color = color.join('');
}
if (/^[0-9a-fA-F]{6}$/.test(color)) {
return {
red: parseInt(color.slice(0, 2), 16),
green: parseInt(color.slice(2, 4), 16),
blue: parseInt(color.slice(4, 6), 16)
};
} else {
return {
red: 255,
green: 255,
blue: 255
};
}
},
mixColor: function mixColor(color, percent) {
var _getColorChannels = this.getColorChannels(color),
red = _getColorChannels.red,
green = _getColorChannels.green,
blue = _getColorChannels.blue;
if (percent > 0) {
// shade given color
red *= 1 - percent;
green *= 1 - percent;
blue *= 1 - percent;
} else {
// tint given color
red += (255 - red) * percent;
green += (255 - green) * percent;
blue += (255 - blue) * percent;
}
return 'rgb(' + Math.round(red) + ', ' + Math.round(green) + ', ' + Math.round(blue) + ')';
},
addItem: function addItem(item) {
this.$set(this.items, item.index, item);
},
removeItem: function removeItem(item) {
delete this.items[item.index];
},
addSubmenu: function addSubmenu(item) {
this.$set(this.submenus, item.index, item);
},
removeSubmenu: function removeSubmenu(item) {
delete this.submenus[item.index];
},
openMenu: function openMenu(index, indexPath) {
var openedMenus = this.openedMenus;
if (openedMenus.indexOf(index) !== -1) return;
// 将不在该菜单路径下的其余菜单收起
// collapse all menu that are not under current menu item
if (this.uniqueOpened) {
this.openedMenus = openedMenus.filter(function (index) {
return indexPath.indexOf(index) !== -1;
});
}
this.openedMenus.push(index);
},
closeMenu: function closeMenu(index) {
var i = this.openedMenus.indexOf(index);
if (i !== -1) {
this.openedMenus.splice(i, 1);
}
},
handleSubmenuClick: function handleSubmenuClick(submenu) {
var index = submenu.index,
indexPath = submenu.indexPath;
var isOpened = this.openedMenus.indexOf(index) !== -1;
if (isOpened) {
this.closeMenu(index);
this.$emit('close', index, indexPath);
} else {
this.openMenu(index, indexPath);
this.$emit('open', index, indexPath);
}
},
handleItemClick: function handleItemClick(item) {
var _this = this;
var index = item.index,
indexPath = item.indexPath;
var oldActiveIndex = this.activeIndex;
var hasIndex = item.index !== null;
if (hasIndex) {
this.activeIndex = item.index;
}
this.$emit('select', index, indexPath, item);
if (this.mode === 'horizontal' || this.collapse) {
this.openedMenus = [];
}
if (this.router && hasIndex) {
this.routeToItem(item, function (error) {
_this.activeIndex = oldActiveIndex;
if (error) {
// vue-router 3.1.0+ push/replace cause NavigationDuplicated error
// https://github.com/ElemeFE/element/issues/17044
if (error.name === 'NavigationDuplicated') return;
console.error(error);
}
});
}
},
// 初始化展开菜单
// initialize opened menu
initOpenedMenu: function initOpenedMenu() {
var _this2 = this;
var index = this.activeIndex;
var activeItem = this.items[index];
if (!activeItem || this.mode === 'horizontal' || this.collapse) return;
var indexPath = activeItem.indexPath;
// 展开该菜单项的路径上所有子菜单
// expand all submenus of the menu item
indexPath.forEach(function (index) {
var submenu = _this2.submenus[index];
submenu && _this2.openMenu(index, submenu.indexPath);
});
},
routeToItem: function routeToItem(item, onError) {
var route = item.route || item.index;
try {
this.$router.push(route, function () {}, onError);
} catch (e) {
console.error(e);
}
},
open: function open(index) {
var _this3 = this;
var indexPath = this.submenus[index.toString()].indexPath;
indexPath.forEach(function (i) {
return _this3.openMenu(i, indexPath);
});
},
close: function close(index) {
this.closeMenu(index);
}
},
mounted: function mounted() {
this.initOpenedMenu();
this.$on('item-click', this.handleItemClick);
this.$on('submenu-click', this.handleSubmenuClick);
if (this.mode === 'horizontal') {
new aria_menubar(this.$el); // eslint-disable-line
}
this.$watch('items', this.updateActiveIndex);
}
});
// CONCATENATED MODULE: ./packages/menu/src/menu.vue?vue&type=script&lang=js&
/* harmony default export */ var src_menuvue_type_script_lang_js_ = (menuvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/menu/src/menu.vue
var menu_render, menu_staticRenderFns
/* normalize component */
var menu_component = normalizeComponent(
src_menuvue_type_script_lang_js_,
menu_render,
menu_staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var menu_api; }
menu_component.options.__file = "packages/menu/src/menu.vue"
/* harmony default export */ var src_menu = (menu_component.exports);
// CONCATENATED MODULE: ./packages/menu/index.js
/* istanbul ignore next */
src_menu.install = function (Vue) {
Vue.component(src_menu.name, src_menu);
};
/* harmony default export */ var packages_menu = (src_menu);
// EXTERNAL MODULE: external "element-ui/lib/transitions/collapse-transition"
var collapse_transition_ = __webpack_require__(21);
var collapse_transition_default = /*#__PURE__*/__webpack_require__.n(collapse_transition_);
// CONCATENATED MODULE: ./packages/menu/src/menu-mixin.js
/* harmony default export */ var menu_mixin = ({
inject: ['rootMenu'],
computed: {
indexPath: function indexPath() {
var path = [this.index];
var parent = this.$parent;
while (parent.$options.componentName !== 'ElMenu') {
if (parent.index) {
path.unshift(parent.index);
}
parent = parent.$parent;
}
return path;
},
parentMenu: function parentMenu() {
var parent = this.$parent;
while (parent && ['ElMenu', 'ElSubmenu'].indexOf(parent.$options.componentName) === -1) {
parent = parent.$parent;
}
return parent;
},
paddingStyle: function paddingStyle() {
if (this.rootMenu.mode !== 'vertical') return {};
var padding = 20;
var parent = this.$parent;
if (this.rootMenu.collapse) {
padding = 20;
} else {
while (parent && parent.$options.componentName !== 'ElMenu') {
if (parent.$options.componentName === 'ElSubmenu') {
padding += 20;
}
parent = parent.$parent;
}
}
return { paddingLeft: padding + 'px' };
}
}
});
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/submenu.vue?vue&type=script&lang=js&
var poperMixins = {
props: {
transformOrigin: {
type: [Boolean, String],
default: false
},
offset: vue_popper_default.a.props.offset,
boundariesPadding: vue_popper_default.a.props.boundariesPadding,
popperOptions: vue_popper_default.a.props.popperOptions
},
data: vue_popper_default.a.data,
methods: vue_popper_default.a.methods,
beforeDestroy: vue_popper_default.a.beforeDestroy,
deactivated: vue_popper_default.a.deactivated
};
/* harmony default export */ var submenuvue_type_script_lang_js_ = ({
name: 'ElSubmenu',
componentName: 'ElSubmenu',
mixins: [menu_mixin, emitter_default.a, poperMixins],
components: { ElCollapseTransition: collapse_transition_default.a },
props: {
index: {
type: String,
required: true
},
showTimeout: {
type: Number,
default: 300
},
hideTimeout: {
type: Number,
default: 300
},
popperClass: String,
disabled: Boolean,
popperAppendToBody: {
type: Boolean,
default: undefined
}
},
data: function data() {
return {
popperJS: null,
timeout: null,
items: {},
submenus: {},
mouseInChild: false
};
},
watch: {
opened: function opened(val) {
var _this = this;
if (this.isMenuPopup) {
this.$nextTick(function (_) {
_this.updatePopper();
});
}
}
},
computed: {
// popper option
appendToBody: function appendToBody() {
return this.popperAppendToBody === undefined ? this.isFirstLevel : this.popperAppendToBody;
},
menuTransitionName: function menuTransitionName() {
return this.rootMenu.collapse ? 'el-zoom-in-left' : 'el-zoom-in-top';
},
opened: function opened() {
return this.rootMenu.openedMenus.indexOf(this.index) > -1;
},
active: function active() {
var isActive = false;
var submenus = this.submenus;
var items = this.items;
Object.keys(items).forEach(function (index) {
if (items[index].active) {
isActive = true;
}
});
Object.keys(submenus).forEach(function (index) {
if (submenus[index].active) {
isActive = true;
}
});
return isActive;
},
hoverBackground: function hoverBackground() {
return this.rootMenu.hoverBackground;
},
backgroundColor: function backgroundColor() {
return this.rootMenu.backgroundColor || '';
},
activeTextColor: function activeTextColor() {
return this.rootMenu.activeTextColor || '';
},
textColor: function textColor() {
return this.rootMenu.textColor || '';
},
mode: function mode() {
return this.rootMenu.mode;
},
isMenuPopup: function isMenuPopup() {
return this.rootMenu.isMenuPopup;
},
titleStyle: function titleStyle() {
if (this.mode !== 'horizontal') {
return {
color: this.textColor
};
}
return {
borderBottomColor: this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent',
color: this.active ? this.activeTextColor : this.textColor
};
},
isFirstLevel: function isFirstLevel() {
var isFirstLevel = true;
var parent = this.$parent;
while (parent && parent !== this.rootMenu) {
if (['ElSubmenu', 'ElMenuItemGroup'].indexOf(parent.$options.componentName) > -1) {
isFirstLevel = false;
break;
} else {
parent = parent.$parent;
}
}
return isFirstLevel;
}
},
methods: {
handleCollapseToggle: function handleCollapseToggle(value) {
if (value) {
this.initPopper();
} else {
this.doDestroy();
}
},
addItem: function addItem(item) {
this.$set(this.items, item.index, item);
},
removeItem: function removeItem(item) {
delete this.items[item.index];
},
addSubmenu: function addSubmenu(item) {
this.$set(this.submenus, item.index, item);
},
removeSubmenu: function removeSubmenu(item) {
delete this.submenus[item.index];
},
handleClick: function handleClick() {
var rootMenu = this.rootMenu,
disabled = this.disabled;
if (rootMenu.menuTrigger === 'hover' && rootMenu.mode === 'horizontal' || rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
return;
}
this.dispatch('ElMenu', 'submenu-click', this);
},
handleMouseenter: function handleMouseenter(event) {
var _this2 = this;
var showTimeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.showTimeout;
if (!('ActiveXObject' in window) && event.type === 'focus' && !event.relatedTarget) {
return;
}
var rootMenu = this.rootMenu,
disabled = this.disabled;
if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
return;
}
this.dispatch('ElSubmenu', 'mouse-enter-child');
clearTimeout(this.timeout);
this.timeout = setTimeout(function () {
_this2.rootMenu.openMenu(_this2.index, _this2.indexPath);
}, showTimeout);
if (this.appendToBody) {
this.$parent.$el.dispatchEvent(new MouseEvent('mouseenter'));
}
},
handleMouseleave: function handleMouseleave() {
var _this3 = this;
var deepDispatch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var rootMenu = this.rootMenu;
if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical') {
return;
}
this.dispatch('ElSubmenu', 'mouse-leave-child');
clearTimeout(this.timeout);
this.timeout = setTimeout(function () {
!_this3.mouseInChild && _this3.rootMenu.closeMenu(_this3.index);
}, this.hideTimeout);
if (this.appendToBody && deepDispatch) {
if (this.$parent.$options.name === 'ElSubmenu') {
this.$parent.handleMouseleave(true);
}
}
},
handleTitleMouseenter: function handleTitleMouseenter() {
if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
var title = this.$refs['submenu-title'];
title && (title.style.backgroundColor = this.rootMenu.hoverBackground);
},
handleTitleMouseleave: function handleTitleMouseleave() {
if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
var title = this.$refs['submenu-title'];
title && (title.style.backgroundColor = this.rootMenu.backgroundColor || '');
},
updatePlacement: function updatePlacement() {
this.currentPlacement = this.mode === 'horizontal' && this.isFirstLevel ? 'bottom-start' : 'right-start';
},
initPopper: function initPopper() {
this.referenceElm = this.$el;
this.popperElm = this.$refs.menu;
this.updatePlacement();
}
},
created: function created() {
var _this4 = this;
this.$on('toggle-collapse', this.handleCollapseToggle);
this.$on('mouse-enter-child', function () {
_this4.mouseInChild = true;
clearTimeout(_this4.timeout);
});
this.$on('mouse-leave-child', function () {
_this4.mouseInChild = false;
clearTimeout(_this4.timeout);
});
},
mounted: function mounted() {
this.parentMenu.addSubmenu(this);
this.rootMenu.addSubmenu(this);
this.initPopper();
},
beforeDestroy: function beforeDestroy() {
this.parentMenu.removeSubmenu(this);
this.rootMenu.removeSubmenu(this);
},
render: function render(h) {
var _this5 = this;
var active = this.active,
opened = this.opened,
paddingStyle = this.paddingStyle,
titleStyle = this.titleStyle,
backgroundColor = this.backgroundColor,
rootMenu = this.rootMenu,
currentPlacement = this.currentPlacement,
menuTransitionName = this.menuTransitionName,
mode = this.mode,
disabled = this.disabled,
popperClass = this.popperClass,
$slots = this.$slots,
isFirstLevel = this.isFirstLevel;
var popupMenu = h(
'transition',
{
attrs: { name: menuTransitionName }
},
[h(
'div',
{
ref: 'menu',
directives: [{
name: 'show',
value: opened
}],
'class': ['el-menu--' + mode, popperClass],
on: {
'mouseenter': function mouseenter($event) {
return _this5.handleMouseenter($event, 100);
},
'mouseleave': function mouseleave() {
return _this5.handleMouseleave(true);
},
'focus': function focus($event) {
return _this5.handleMouseenter($event, 100);
}
}
},
[h(
'ul',
{
attrs: {
role: 'menu'
},
'class': ['el-menu el-menu--popup', 'el-menu--popup-' + currentPlacement],
style: { backgroundColor: rootMenu.backgroundColor || '' } },
[$slots.default]
)]
)]
);
var inlineMenu = h('el-collapse-transition', [h(
'ul',
{
attrs: {
role: 'menu'
},
'class': 'el-menu el-menu--inline',
directives: [{
name: 'show',
value: opened
}],
style: { backgroundColor: rootMenu.backgroundColor || '' } },
[$slots.default]
)]);
var submenuTitleIcon = rootMenu.mode === 'horizontal' && isFirstLevel || rootMenu.mode === 'vertical' && !rootMenu.collapse ? 'el-icon-arrow-down' : 'el-icon-arrow-right';
return h(
'li',
{
'class': {
'el-submenu': true,
'is-active': active,
'is-opened': opened,
'is-disabled': disabled
},
attrs: { role: 'menuitem',
'aria-haspopup': 'true',
'aria-expanded': opened
},
on: {
'mouseenter': this.handleMouseenter,
'mouseleave': function mouseleave() {
return _this5.handleMouseleave(false);
},
'focus': this.handleMouseenter
}
},
[h(
'div',
{
'class': 'el-submenu__title',
ref: 'submenu-title',
on: {
'click': this.handleClick,
'mouseenter': this.handleTitleMouseenter,
'mouseleave': this.handleTitleMouseleave
},
style: [paddingStyle, titleStyle, { backgroundColor: backgroundColor }]
},
[$slots.title, h('i', { 'class': ['el-submenu__icon-arrow', submenuTitleIcon] })]
), this.isMenuPopup ? popupMenu : inlineMenu]
);
}
});
// CONCATENATED MODULE: ./packages/menu/src/submenu.vue?vue&type=script&lang=js&
/* harmony default export */ var src_submenuvue_type_script_lang_js_ = (submenuvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/menu/src/submenu.vue
var submenu_render, submenu_staticRenderFns
/* normalize component */
var submenu_component = normalizeComponent(
src_submenuvue_type_script_lang_js_,
submenu_render,
submenu_staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var submenu_api; }
submenu_component.options.__file = "packages/menu/src/submenu.vue"
/* harmony default export */ var submenu = (submenu_component.exports);
// CONCATENATED MODULE: ./packages/submenu/index.js
/* istanbul ignore next */
submenu.install = function (Vue) {
Vue.component(submenu.name, submenu);
};
/* harmony default export */ var packages_submenu = (submenu);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu-item.vue?vue&type=template&id=2a5dbfea&
var menu_itemvue_type_template_id_2a5dbfea_render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"li",
{
staticClass: "el-menu-item",
class: {
"is-active": _vm.active,
"is-disabled": _vm.disabled
},
style: [
_vm.paddingStyle,
_vm.itemStyle,
{ backgroundColor: _vm.backgroundColor }
],
attrs: { role: "menuitem", tabindex: "-1" },
on: {
click: _vm.handleClick,
mouseenter: _vm.onMouseEnter,
focus: _vm.onMouseEnter,
blur: _vm.onMouseLeave,
mouseleave: _vm.onMouseLeave
}
},
[
_vm.parentMenu.$options.componentName === "ElMenu" &&
_vm.rootMenu.collapse &&
_vm.$slots.title
? _c("el-tooltip", { attrs: { effect: "dark", placement: "right" } }, [
_c(
"div",
{ attrs: { slot: "content" }, slot: "content" },
[_vm._t("title")],
2
),
_c(
"div",
{
staticStyle: {
position: "absolute",
left: "0",
top: "0",
height: "100%",
width: "100%",
display: "inline-block",
"box-sizing": "border-box",
padding: "0 20px"
}
},
[_vm._t("default")],
2
)
])
: [_vm._t("default"), _vm._t("title")]
],
2
)
}
var menu_itemvue_type_template_id_2a5dbfea_staticRenderFns = []
menu_itemvue_type_template_id_2a5dbfea_render._withStripped = true
// CONCATENATED MODULE: ./packages/menu/src/menu-item.vue?vue&type=template&id=2a5dbfea&
// EXTERNAL MODULE: external "element-ui/lib/tooltip"
var tooltip_ = __webpack_require__(26);
var tooltip_default = /*#__PURE__*/__webpack_require__.n(tooltip_);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu-item.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var menu_itemvue_type_script_lang_js_ = ({
name: 'ElMenuItem',
componentName: 'ElMenuItem',
mixins: [menu_mixin, emitter_default.a],
components: { ElTooltip: tooltip_default.a },
props: {
index: {
default: null,
validator: function validator(val) {
return typeof val === 'string' || val === null;
}
},
route: [String, Object],
disabled: Boolean
},
computed: {
active: function active() {
return this.index === this.rootMenu.activeIndex;
},
hoverBackground: function hoverBackground() {
return this.rootMenu.hoverBackground;
},
backgroundColor: function backgroundColor() {
return this.rootMenu.backgroundColor || '';
},
activeTextColor: function activeTextColor() {
return this.rootMenu.activeTextColor || '';
},
textColor: function textColor() {
return this.rootMenu.textColor || '';
},
mode: function mode() {
return this.rootMenu.mode;
},
itemStyle: function itemStyle() {
var style = {
color: this.active ? this.activeTextColor : this.textColor
};
if (this.mode === 'horizontal' && !this.isNested) {
style.borderBottomColor = this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent';
}
return style;
},
isNested: function isNested() {
return this.parentMenu !== this.rootMenu;
}
},
methods: {
onMouseEnter: function onMouseEnter() {
if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
this.$el.style.backgroundColor = this.hoverBackground;
},
onMouseLeave: function onMouseLeave() {
if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
this.$el.style.backgroundColor = this.backgroundColor;
},
handleClick: function handleClick() {
if (!this.disabled) {
this.dispatch('ElMenu', 'item-click', this);
this.$emit('click', this);
}
}
},
mounted: function mounted() {
this.parentMenu.addItem(this);
this.rootMenu.addItem(this);
},
beforeDestroy: function beforeDestroy() {
this.parentMenu.removeItem(this);
this.rootMenu.removeItem(this);
}
});
// CONCATENATED MODULE: ./packages/menu/src/menu-item.vue?vue&type=script&lang=js&
/* harmony default export */ var src_menu_itemvue_type_script_lang_js_ = (menu_itemvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/menu/src/menu-item.vue
/* normalize component */
var menu_item_component = normalizeComponent(
src_menu_itemvue_type_script_lang_js_,
menu_itemvue_type_template_id_2a5dbfea_render,
menu_itemvue_type_template_id_2a5dbfea_staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var menu_item_api; }
menu_item_component.options.__file = "packages/menu/src/menu-item.vue"
/* harmony default export */ var menu_item = (menu_item_component.exports);
// CONCATENATED MODULE: ./packages/menu-item/index.js
/* istanbul ignore next */
menu_item.install = function (Vue) {
Vue.component(menu_item.name, menu_item);
};
/* harmony default export */ var packages_menu_item = (menu_item);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu-item-group.vue?vue&type=template&id=543b7bdc&
var menu_item_groupvue_type_template_id_543b7bdc_render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c("li", { staticClass: "el-menu-item-group" }, [
_c(
"div",
{
staticClass: "el-menu-item-group__title",
style: { paddingLeft: _vm.levelPadding + "px" }
},
[!_vm.$slots.title ? [_vm._v(_vm._s(_vm.title))] : _vm._t("title")],
2
),
_c("ul", [_vm._t("default")], 2)
])
}
var menu_item_groupvue_type_template_id_543b7bdc_staticRenderFns = []
menu_item_groupvue_type_template_id_543b7bdc_render._withStripped = true
// CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue?vue&type=template&id=543b7bdc&
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu-item-group.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var menu_item_groupvue_type_script_lang_js_ = ({
name: 'ElMenuItemGroup',
componentName: 'ElMenuItemGroup',
inject: ['rootMenu'],
props: {
title: {
type: String
}
},
data: function data() {
return {
paddingLeft: 20
};
},
computed: {
levelPadding: function levelPadding() {
var padding = 20;
var parent = this.$parent;
if (this.rootMenu.collapse) return 20;
while (parent && parent.$options.componentName !== 'ElMenu') {
if (parent.$options.componentName === 'ElSubmenu') {
padding += 20;
}
parent = parent.$parent;
}
return padding;
}
}
});
// CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue?vue&type=script&lang=js&
/* harmony default export */ var src_menu_item_groupvue_type_script_lang_js_ = (menu_item_groupvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue
/* normalize component */
var menu_item_group_component = normalizeComponent(
src_menu_item_groupvue_type_script_lang_js_,
menu_item_groupvue_type_template_id_543b7bdc_render,
menu_item_groupvue_type_template_id_543b7bdc_staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var menu_item_group_api; }
menu_item_group_component.options.__file = "packages/menu/src/menu-item-group.vue"
/* harmony default export */ var menu_item_group = (menu_item_group_component.exports);
// CONCATENATED MODULE: ./packages/menu-item-group/index.js
/* istanbul ignore next */
menu_item_group.install = function (Vue) {
Vue.component(menu_item_group.name, menu_item_group);
};
/* harmony default export */ var packages_menu_item_group = (menu_item_group);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=343dd774&
var inputvue_type_template_id_343dd774_render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"div",
{
class: [
_vm.type === "textarea" ? "el-textarea" : "el-input",
_vm.inputSize ? "el-input--" + _vm.inputSize : "",
{
"is-disabled": _vm.inputDisabled,
"is-exceed": _vm.inputExceed,
"el-input-group": _vm.$slots.prepend || _vm.$slots.append,
"el-input-group--append": _vm.$slots.append,
"el-input-group--prepend": _vm.$slots.prepend,
"el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
"el-input--suffix":
_vm.$slots.suffix ||
_vm.suffixIcon ||
_vm.clearable ||
_vm.showPassword
}
],
on: {
mouseenter: function($event) {
_vm.hovering = true
},
mouseleave: function($event) {
_vm.hovering = false
}
}
},
[
_vm.type !== "textarea"
? [
_vm.$slots.prepend
? _c(
"div",
{ staticClass: "el-input-group__prepend" },
[_vm._t("prepend")],
2
)
: _vm._e(),
_vm.type !== "textarea"
? _c(
"input",
_vm._b(
{
ref: "input",
staticClass: "el-input__inner",
attrs: {
tabindex: _vm.tabindex,
type: _vm.showPassword
? _vm.passwordVisible
? "text"
: "password"
: _vm.type,
disabled: _vm.inputDisabled,
readonly: _vm.readonly,
autocomplete: _vm.autoComplete || _vm.autocomplete,
"aria-label": _vm.label
},
on: {
compositionstart: _vm.handleCompositionStart,
compositionupdate: _vm.handleCompositionUpdate,
compositionend: _vm.handleCompositionEnd,
input: _vm.handleInput,
focus: _vm.handleFocus,
blur: _vm.handleBlur,
change: _vm.handleChange
}
},
"input",
_vm.$attrs,
false
)
)
: _vm._e(),
_vm.$slots.prefix || _vm.prefixIcon
? _c(
"span",
{ staticClass: "el-input__prefix" },
[
_vm._t("prefix"),
_vm.prefixIcon
? _c("i", {
staticClass: "el-input__icon",
class: _vm.prefixIcon
})
: _vm._e()
],
2
)
: _vm._e(),
_vm.getSuffixVisible()
? _c("span", { staticClass: "el-input__suffix" }, [
_c(
"span",
{ staticClass: "el-input__suffix-inner" },
[
!_vm.showClear ||
!_vm.showPwdVisible ||
!_vm.isWordLimitVisible
? [
_vm._t("suffix"),
_vm.suffixIcon
? _c("i", {
staticClass: "el-input__icon",
class: _vm.suffixIcon
})
: _vm._e()
]
: _vm._e(),
_vm.showClear
? _c("i", {
staticClass:
"el-input__icon el-icon-circle-close el-input__clear",
on: {
mousedown: function($event) {
$event.preventDefault()
},
click: _vm.clear
}
})
: _vm._e(),
_vm.showPwdVisible
? _c("i", {
staticClass:
"el-input__icon el-icon-view el-input__clear",
on: { click: _vm.handlePasswordVisible }
})
: _vm._e(),
_vm.isWordLimitVisible
? _c("span", { staticClass: "el-input__count" }, [
_c(
"span",
{ staticClass: "el-input__count-inner" },
[
_vm._v(
"\n " +
_vm._s(_vm.textLength) +
"/" +
_vm._s(_vm.upperLimit) +
"\n "
)
]
)
])
: _vm._e()
],
2
),
_vm.validateState
? _c("i", {
staticClass: "el-input__icon",
class: ["el-input__validateIcon", _vm.validateIcon]
})
: _vm._e()
])
: _vm._e(),
_vm.$slots.append
? _c(
"div",
{ staticClass: "el-input-group__append" },
[_vm._t("append")],
2
)
: _vm._e()
]
: _c(
"textarea",
_vm._b(
{
ref: "textarea",
staticClass: "el-textarea__inner",
style: _vm.textareaStyle,
attrs: {
tabindex: _vm.tabindex,
disabled: _vm.inputDisabled,
readonly: _vm.readonly,
autocomplete: _vm.autoComplete || _vm.autocomplete,
"aria-label": _vm.label
},
on: {
compositionstart: _vm.handleCompositionStart,
compositionupdate: _vm.handleCompositionUpdate,
compositionend: _vm.handleCompositionEnd,
input: _vm.handleInput,
focus: _vm.handleFocus,
blur: _vm.handleBlur,
change: _vm.handleChange
}
},
"textarea",
_vm.$attrs,
false
)
),
_vm.isWordLimitVisible && _vm.type === "textarea"
? _c("span", { staticClass: "el-input__count" }, [
_vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
])
: _vm._e()
],
2
)
}
var inputvue_type_template_id_343dd774_staticRenderFns = []
inputvue_type_template_id_343dd774_render._withStripped = true
// CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=343dd774&
// CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
var hiddenTextarea = void 0;
var HIDDEN_STYLE = '\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n';
var CONTEXT_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];
function calculateNodeStyling(targetElement) {
var style = window.getComputedStyle(targetElement);
var boxSizing = style.getPropertyValue('box-sizing');
var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
var contextStyle = CONTEXT_STYLE.map(function (name) {
return name + ':' + style.getPropertyValue(name);
}).join(';');
return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
}
function calcTextareaHeight(targetElement) {
var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
if (!hiddenTextarea) {
hiddenTextarea = document.createElement('textarea');
document.body.appendChild(hiddenTextarea);
}
var _calculateNodeStyling = calculateNodeStyling(targetElement),
paddingSize = _calculateNodeStyling.paddingSize,
borderSize = _calculateNodeStyling.borderSize,
boxSizing = _calculateNodeStyling.boxSizing,
contextStyle = _calculateNodeStyling.contextStyle;
hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
var height = hiddenTextarea.scrollHeight;
var result = {};
if (boxSizing === 'border-box') {
height = height + borderSize;
} else if (boxSizing === 'content-box') {
height = height - paddingSize;
}
hiddenTextarea.value = '';
var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
if (minRows !== null) {
var minHeight = singleRowHeight * minRows;
if (boxSizing === 'border-box') {
minHeight = minHeight + paddingSize + borderSize;
}
height = Math.max(minHeight, height);
result.minHeight = minHeight + 'px';
}
if (maxRows !== null) {
var maxHeight = singleRowHeight * maxRows;
if (boxSizing === 'border-box') {
maxHeight = maxHeight + paddingSize + borderSize;
}
height = Math.min(maxHeight, height);
}
result.height = height + 'px';
hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
hiddenTextarea = null;
return result;
};
// EXTERNAL MODULE: external "element-ui/lib/utils/merge"
var merge_ = __webpack_require__(7);
var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
// EXTERNAL MODULE: external "element-ui/lib/utils/shared"
var shared_ = __webpack_require__(19);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var inputvue_type_script_lang_js_ = ({
name: 'ElInput',
componentName: 'ElInput',
mixins: [emitter_default.a, migrating_default.a],
inheritAttrs: false,
inject: {
elForm: {
default: ''
},
elFormItem: {
default: ''
}
},
data: function data() {
return {
textareaCalcStyle: {},
hovering: false,
focused: false,
isComposing: false,
passwordVisible: false
};
},
props: {
value: [String, Number],
size: String,
resize: String,
form: String,
disabled: Boolean,
readonly: Boolean,
type: {
type: String,
default: 'text'
},
autosize: {
type: [Boolean, Object],
default: false
},
autocomplete: {
type: String,
default: 'off'
},
/** @Deprecated in next major version */
autoComplete: {
type: String,
validator: function validator(val) {
false && false;
return true;
}
},
validateEvent: {
type: Boolean,
default: true
},
suffixIcon: String,
prefixIcon: String,
label: String,
clearable: {
type: Boolean,
default: false
},
showPassword: {
type: Boolean,
default: false
},
showWordLimit: {
type: Boolean,
default: false
},
tabindex: String
},
computed: {
_elFormItemSize: function _elFormItemSize() {
return (this.elFormItem || {}).elFormItemSize;
},
validateState: function validateState() {
return this.elFormItem ? this.elFormItem.validateState : '';
},
needStatusIcon: function needStatusIcon() {
return this.elForm ? this.elForm.statusIcon : false;
},
validateIcon: function validateIcon() {
return {
validating: 'el-icon-loading',
success: 'el-icon-circle-check',
error: 'el-icon-circle-close'
}[this.validateState];
},
textareaStyle: function textareaStyle() {
return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
},
inputSize: function inputSize() {
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
},
inputDisabled: function inputDisabled() {
return this.disabled || (this.elForm || {}).disabled;
},
nativeInputValue: function nativeInputValue() {
return this.value === null || this.value === undefined ? '' : String(this.value);
},
showClear: function showClear() {
return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
},
showPwdVisible: function showPwdVisible() {
return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
},
isWordLimitVisible: function isWordLimitVisible() {
return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
},
upperLimit: function upperLimit() {
return this.$attrs.maxlength;
},
textLength: function textLength() {
if (typeof this.value === 'number') {
return String(this.value).length;
}
return (this.value || '').length;
},
inputExceed: function inputExceed() {
// show exceed style if length of initial value greater then maxlength
return this.isWordLimitVisible && this.textLength > this.upperLimit;
}
},
watch: {
value: function value(val) {
this.$nextTick(this.resizeTextarea);
if (this.validateEvent) {
this.dispatch('ElFormItem', 'el.form.change', [val]);
}
},
// native input value is set explicitly
// do not use v-model / :value in template
// see: https://github.com/ElemeFE/element/issues/14521
nativeInputValue: function nativeInputValue() {
this.setNativeInputValue();
},
// when change between and