UNPKG

yk-smart-ui-test

Version:

A Component Library for Vue.js.

1,525 lines (1,302 loc) 101 kB
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 = 35); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { module.exports = require("vue"); /***/ }), /* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; }); /* unused harmony export setStyle */ /* unused harmony export isScroll */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; }); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* istanbul ignore next */ var isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer; var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g; var MOZ_HACK_REGEXP = /^moz([A-Z])/; var ieVersion = isServer ? 0 : Number(document.documentMode); /* istanbul ignore next */ var trim = function trim(string) { return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ''); }; /* istanbul ignore next */ var camelCase = function camelCase(name) { return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) { return offset ? letter.toUpperCase() : letter; }).replace(MOZ_HACK_REGEXP, 'Moz$1'); }; /* istanbul ignore next */ var on = function () { if (!isServer && document.addEventListener) { return function (element, event, handler) { if (element && event && handler) { element.addEventListener(event, handler, false); } }; } else { return function (element, event, handler) { if (element && event && handler) { element.attachEvent('on' + event, handler); } }; } }(); /* istanbul ignore next */ var off = function () { if (!isServer && document.removeEventListener) { return function (element, event, handler) { if (element && event) { element.removeEventListener(event, handler, false); } }; } else { return function (element, event, handler) { if (element && event) { element.detachEvent('on' + event, handler); } }; } }(); /* istanbul ignore next */ var once = function once(el, event, fn) { var listener = function listener() { if (fn) { fn.apply(this, arguments); } off(el, event, listener); }; on(el, event, listener); }; /* istanbul ignore next */ function hasClass(el, cls) { if (!el || !cls) return false; if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.'); if (el.classList) { return el.classList.contains(cls); } else { return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1; } }; /* istanbul ignore next */ function addClass(el, cls) { if (!el) return; var curClass = el.className; var classes = (cls || '').split(' '); for (var i = 0, j = classes.length; i < j; i++) { var clsName = classes[i]; if (!clsName) continue; if (el.classList) { el.classList.add(clsName); } else if (!hasClass(el, clsName)) { curClass += ' ' + clsName; } } if (!el.classList) { el.setAttribute('class', curClass); } }; /* istanbul ignore next */ function removeClass(el, cls) { if (!el || !cls) return; var classes = cls.split(' '); var curClass = ' ' + el.className + ' '; for (var i = 0, j = classes.length; i < j; i++) { var clsName = classes[i]; if (!clsName) continue; if (el.classList) { el.classList.remove(clsName); } else if (hasClass(el, clsName)) { curClass = curClass.replace(' ' + clsName + ' ', ' '); } } if (!el.classList) { el.setAttribute('class', trim(curClass)); } }; /* istanbul ignore next */ var getStyle = ieVersion < 9 ? function (element, styleName) { if (isServer) return; if (!element || !styleName) return null; styleName = camelCase(styleName); if (styleName === 'float') { styleName = 'styleFloat'; } try { switch (styleName) { case 'opacity': try { return element.filters.item('alpha').opacity / 100; } catch (e) { return 1.0; } default: return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null; } } catch (e) { return element.style[styleName]; } } : function (element, styleName) { if (isServer) return; if (!element || !styleName) return null; styleName = camelCase(styleName); if (styleName === 'float') { styleName = 'cssFloat'; } try { var computed = document.defaultView.getComputedStyle(element, ''); return element.style[styleName] || computed ? computed[styleName] : null; } catch (e) { return element.style[styleName]; } }; /* istanbul ignore next */ function setStyle(element, styleName, value) { if (!element || !styleName) return; if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') { for (var prop in styleName) { if (styleName.hasOwnProperty(prop)) { setStyle(element, prop, styleName[prop]); } } } else { styleName = camelCase(styleName); if (styleName === 'opacity' && ieVersion < 9) { element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')'; } else { element.style[styleName] = value; } } }; var isScroll = function isScroll(el, vertical) { if (isServer) return; var determinedDirection = vertical !== null && vertical !== undefined; var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow'); return overflow.match(/(scroll|auto|overlay)/); }; var getScrollContainer = function getScrollContainer(el, vertical) { if (isServer) return; var parent = el; while (parent) { if ([window, document, document.documentElement].includes(parent)) { return window; } if (isScroll(parent, vertical)) { return parent; } parent = parent.parentNode; } return parent; }; var isInContainer = function isInContainer(el, container) { if (isServer || !el || !container) return false; var elRect = el.getBoundingClientRect(); var containerRect = void 0; if ([window, document, document.documentElement, null, undefined].includes(container)) { containerRect = { top: 0, right: window.innerWidth, bottom: window.innerHeight, left: 0 }; } else { containerRect = container.getBoundingClientRect(); } return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right; }; /***/ }), /* 2 */, /* 3 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return noop; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return hasOwn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return toObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return getValueByPath; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return getPropByPath; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return generateId; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return valueEquals; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return escapeRegexpString; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFindIndex; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayFind; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return coerceTruthyValueToArray; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return isIE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isEdge; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return isFirefox; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return autoprefixer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return kebabCase; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return capitalize; }); /* unused harmony export looseEqual */ /* unused harmony export arrayEquals */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return isEqual; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return isEmpty; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return rafThrottle; }); /* unused harmony export objToArray */ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var hasOwnProperty = Object.prototype.hasOwnProperty; function noop() {}; function hasOwn(obj, key) { return hasOwnProperty.call(obj, key); }; function extend(to, _from) { for (var key in _from) { to[key] = _from[key]; } return to; }; function toObject(arr) { var res = {}; for (var i = 0; i < arr.length; i++) { if (arr[i]) { extend(res, arr[i]); } } return res; }; var getValueByPath = function getValueByPath(object, prop) { prop = prop || ''; var paths = prop.split('.'); var current = object; var result = null; for (var i = 0, j = paths.length; i < j; i++) { var path = paths[i]; if (!current) break; if (i === j - 1) { result = current[path]; break; } current = current[path]; } return result; }; function getPropByPath(obj, path, strict) { var tempObj = obj; path = path.replace(/\[(\w+)\]/g, '.$1'); path = path.replace(/^\./, ''); var keyArr = path.split('.'); var i = 0; for (var len = keyArr.length; i < len - 1; ++i) { if (!tempObj && !strict) break; var key = keyArr[i]; if (key in tempObj) { tempObj = tempObj[key]; } else { if (strict) { throw new Error('please transfer a valid prop path to form item!'); } break; } } return { o: tempObj, k: keyArr[i], v: tempObj ? tempObj[keyArr[i]] : null }; }; var generateId = function generateId() { return Math.floor(Math.random() * 10000); }; var valueEquals = function valueEquals(a, b) { // see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript if (a === b) return true; if (!(a instanceof Array)) return false; if (!(b instanceof Array)) return false; if (a.length !== b.length) return false; for (var i = 0; i !== a.length; ++i) { if (a[i] !== b[i]) return false; } return true; }; var escapeRegexpString = function escapeRegexpString() { var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'); }; // TODO: use native Array.find, Array.findIndex when IE support is dropped var arrayFindIndex = function arrayFindIndex(arr, pred) { for (var i = 0; i !== arr.length; ++i) { if (pred(arr[i])) { return i; } } return -1; }; var arrayFind = function arrayFind(arr, pred) { var idx = arrayFindIndex(arr, pred); return idx !== -1 ? arr[idx] : undefined; }; // coerce truthy value to array var coerceTruthyValueToArray = function coerceTruthyValueToArray(val) { if (Array.isArray(val)) { return val; } else if (val) { return [val]; } else { return []; } }; var isIE = function isIE() { return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !isNaN(Number(document.documentMode)); }; var isEdge = function isEdge() { return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1; }; var isFirefox = function isFirefox() { return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i); }; var autoprefixer = function autoprefixer(style) { if ((typeof style === 'undefined' ? 'undefined' : _typeof(style)) !== 'object') return style; var rules = ['transform', 'transition', 'animation']; var prefixes = ['ms-', 'webkit-']; rules.forEach(function (rule) { var value = style[rule]; if (rule && value) { prefixes.forEach(function (prefix) { style[prefix + rule] = value; }); } }); return style; }; var kebabCase = function kebabCase(str) { var hyphenateRE = /([^-])([A-Z])/g; return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase(); }; var capitalize = function capitalize(str) { if (!Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isString */ "e"])(str)) return str; return str.charAt(0).toUpperCase() + str.slice(1); }; var looseEqual = function looseEqual(a, b) { var isObjectA = Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(a); var isObjectB = Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(b); if (isObjectA && isObjectB) { return JSON.stringify(a) === JSON.stringify(b); } else if (!isObjectA && !isObjectB) { return String(a) === String(b); } else { return false; } }; var arrayEquals = function arrayEquals(arrayA, arrayB) { arrayA = arrayA || []; arrayB = arrayB || []; if (arrayA.length !== arrayB.length) { return false; } for (var i = 0; i < arrayA.length; i++) { if (!looseEqual(arrayA[i], arrayB[i])) { return false; } } return true; }; var isEqual = function isEqual(value1, value2) { if (Array.isArray(value1) && Array.isArray(value2)) { return arrayEquals(value1, value2); } return looseEqual(value1, value2); }; var isEmpty = function isEmpty(val) { // null or undefined if (val == null) return true; if (typeof val === 'boolean') return false; if (typeof val === 'number') return !val; if (val instanceof Error) return val.message === ''; switch (Object.prototype.toString.call(val)) { // String or Array case '[object String]': case '[object Array]': return !val.length; // Map or Set or File case '[object File]': case '[object Map]': case '[object Set]': { return !val.size; } // Plain Object case '[object Object]': { return !Object.keys(val).length; } } return false; }; function rafThrottle(fn) { var locked = false; return function () { var _this = this; for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (locked) return; locked = true; window.requestAnimationFrame(function (_) { fn.apply(_this, args); locked = false; }); }; } function objToArray(obj) { if (Array.isArray(obj)) { return obj; } return isEmpty(obj) ? [] : [obj]; } /***/ }), /* 4 */, /* 5 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; }); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; function isString(obj) { return Object.prototype.toString.call(obj) === '[object String]'; } function isObject(obj) { return Object.prototype.toString.call(obj) === '[object Object]'; } function isHtmlElement(node) { return node && node.nodeType === Node.ELEMENT_NODE; } /** * - Inspired: * https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js */ var isFunction = function isFunction(functionToCheck) { var getType = {}; return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; }; if ( true && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) !== 'object' && (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer || typeof document.childNodes !== 'function')) { isFunction = function isFunction(obj) { return typeof obj === 'function' || false; }; } var isUndefined = function isUndefined(val) { return val === void 0; }; var isDefined = function isDefined(val) { return val !== undefined && val !== null; }; /***/ }), /* 6 */, /* 7 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony default export */ __webpack_exports__["a"] = (function (target) { for (var i = 1, j = arguments.length; i < j; i++) { var source = arguments[i] || {}; for (var prop in source) { if (source.hasOwnProperty(prop)) { var value = source[prop]; if (value !== undefined) { target[prop] = value; } } } } return target; });; /***/ }), /* 8 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); var scrollBarWidth = void 0; /* harmony default export */ __webpack_exports__["a"] = (function () { if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return 0; if (scrollBarWidth !== undefined) return scrollBarWidth; var outer = document.createElement('div'); outer.className = 'el-scrollbar__wrap'; outer.style.visibility = 'hidden'; outer.style.width = '100px'; outer.style.position = 'absolute'; outer.style.top = '-9999px'; document.body.appendChild(outer); var widthNoScroll = outer.offsetWidth; outer.style.overflow = 'scroll'; var inner = document.createElement('div'); inner.style.width = '100%'; outer.appendChild(inner); var widthWithScroll = inner.offsetWidth; outer.parentNode.removeChild(outer); scrollBarWidth = widthNoScroll - widthWithScroll; return scrollBarWidth; });; /***/ }), /* 9 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ popup_manager; }); // EXTERNAL MODULE: external "vue" var external_vue_ = __webpack_require__(0); var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_); // EXTERNAL MODULE: ./src/utils/merge.js var merge = __webpack_require__(7); // EXTERNAL MODULE: ./src/utils/dom.js var utils_dom = __webpack_require__(1); // CONCATENATED MODULE: ./src/utils/popup/popup-manager.js var hasModal = false; var hasInitZIndex = false; var popup_manager_zIndex = void 0; var popup_manager_getModal = function getModal() { if (external_vue_default.a.prototype.$isServer) return; var modalDom = PopupManager.modalDom; if (modalDom) { hasModal = true; } else { hasModal = false; modalDom = document.createElement('div'); PopupManager.modalDom = modalDom; modalDom.addEventListener('touchmove', function (event) { event.preventDefault(); event.stopPropagation(); }); modalDom.addEventListener('click', function () { PopupManager.doOnModalClick && PopupManager.doOnModalClick(); }); } return modalDom; }; var instances = {}; var PopupManager = { modalFade: true, getInstance: function getInstance(id) { return instances[id]; }, register: function register(id, instance) { if (id && instance) { instances[id] = instance; } }, deregister: function deregister(id) { if (id) { instances[id] = null; delete instances[id]; } }, nextZIndex: function nextZIndex() { return PopupManager.zIndex++; }, modalStack: [], doOnModalClick: function doOnModalClick() { var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1]; if (!topItem) return; var instance = PopupManager.getInstance(topItem.id); if (instance && instance.closeOnClickModal) { instance.close(); } }, openModal: function openModal(id, zIndex, dom, modalClass, modalFade) { if (external_vue_default.a.prototype.$isServer) return; if (!id || zIndex === undefined) return; this.modalFade = modalFade; var modalStack = this.modalStack; for (var i = 0, j = modalStack.length; i < j; i++) { var item = modalStack[i]; if (item.id === id) { return; } } var modalDom = popup_manager_getModal(); Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal'); if (this.modalFade && !hasModal) { Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-enter'); } if (modalClass) { var classArr = modalClass.trim().split(/\s+/); classArr.forEach(function (item) { return Object(utils_dom["a" /* addClass */])(modalDom, item); }); } setTimeout(function () { Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-enter'); }, 200); if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) { dom.parentNode.appendChild(modalDom); } else { document.body.appendChild(modalDom); } if (zIndex) { modalDom.style.zIndex = zIndex; } modalDom.tabIndex = 0; modalDom.style.display = ''; this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass }); }, closeModal: function closeModal(id) { var modalStack = this.modalStack; var modalDom = popup_manager_getModal(); if (modalStack.length > 0) { var topItem = modalStack[modalStack.length - 1]; if (topItem.id === id) { if (topItem.modalClass) { var classArr = topItem.modalClass.trim().split(/\s+/); classArr.forEach(function (item) { return Object(utils_dom["i" /* removeClass */])(modalDom, item); }); } modalStack.pop(); if (modalStack.length > 0) { modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex; } } else { for (var i = modalStack.length - 1; i >= 0; i--) { if (modalStack[i].id === id) { modalStack.splice(i, 1); break; } } } } if (modalStack.length === 0) { if (this.modalFade) { Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-leave'); } setTimeout(function () { if (modalStack.length === 0) { if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom); modalDom.style.display = 'none'; PopupManager.modalDom = undefined; } Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-leave'); }, 200); } } }; Object.defineProperty(PopupManager, 'zIndex', { configurable: true, get: function get() { if (!hasInitZIndex) { popup_manager_zIndex = popup_manager_zIndex || 3000; hasInitZIndex = true; } return popup_manager_zIndex; }, set: function set(value) { popup_manager_zIndex = value; } }); var popup_manager_getTopPopup = function getTopPopup() { if (external_vue_default.a.prototype.$isServer) return; if (PopupManager.modalStack.length > 0) { var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1]; if (!topPopup) return; var instance = PopupManager.getInstance(topPopup.id); return instance; } }; if (!external_vue_default.a.prototype.$isServer) { // handle `esc` key when the popup is shown window.addEventListener('keydown', function (event) { if (event.keyCode === 27) { var topPopup = popup_manager_getTopPopup(); if (topPopup && topPopup.closeOnPressEscape) { topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close(); } } }); } /* harmony default export */ var popup_manager = (PopupManager); // EXTERNAL MODULE: ./src/utils/scrollbar-width.js var scrollbar_width = __webpack_require__(8); // CONCATENATED MODULE: ./src/utils/popup/index.js var idSeed = 1; var scrollBarWidth = void 0; /* harmony default export */ var popup = __webpack_exports__["b"] = ({ props: { visible: { type: Boolean, default: false }, openDelay: {}, closeDelay: {}, zIndex: {}, modal: { type: Boolean, default: false }, modalFade: { type: Boolean, default: true }, modalClass: {}, modalAppendToBody: { type: Boolean, default: false }, lockScroll: { type: Boolean, default: true }, closeOnPressEscape: { type: Boolean, default: false }, closeOnClickModal: { type: Boolean, default: false } }, beforeMount: function beforeMount() { this._popupId = 'popup-' + idSeed++; popup_manager.register(this._popupId, this); }, beforeDestroy: function beforeDestroy() { popup_manager.deregister(this._popupId); popup_manager.closeModal(this._popupId); this.restoreBodyStyle(); }, data: function data() { return { opened: false, bodyPaddingRight: null, computedBodyPaddingRight: 0, withoutHiddenClass: true, rendered: false }; }, watch: { visible: function visible(val) { var _this = this; if (val) { if (this._opening) return; if (!this.rendered) { this.rendered = true; external_vue_default.a.nextTick(function () { _this.open(); }); } else { this.open(); } } else { this.close(); } } }, methods: { open: function open(options) { var _this2 = this; if (!this.rendered) { this.rendered = true; } var props = Object(merge["a" /* default */])({}, this.$props || this, options); if (this._closeTimer) { clearTimeout(this._closeTimer); this._closeTimer = null; } clearTimeout(this._openTimer); var openDelay = Number(props.openDelay); if (openDelay > 0) { this._openTimer = setTimeout(function () { _this2._openTimer = null; _this2.doOpen(props); }, openDelay); } else { this.doOpen(props); } }, doOpen: function doOpen(props) { if (this.$isServer) return; if (this.willOpen && !this.willOpen()) return; if (this.opened) return; this._opening = true; var dom = this.$el; var modal = props.modal; var zIndex = props.zIndex; if (zIndex) { popup_manager.zIndex = zIndex; } if (modal) { if (this._closing) { popup_manager.closeModal(this._popupId); this._closing = false; } popup_manager.openModal(this._popupId, popup_manager.nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade); if (props.lockScroll) { this.withoutHiddenClass = !Object(utils_dom["d" /* hasClass */])(document.body, 'el-popup-parent--hidden'); if (this.withoutHiddenClass) { this.bodyPaddingRight = document.body.style.paddingRight; this.computedBodyPaddingRight = parseInt(Object(utils_dom["c" /* getStyle */])(document.body, 'paddingRight'), 10); } scrollBarWidth = Object(scrollbar_width["a" /* default */])(); var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight; var bodyOverflowY = Object(utils_dom["c" /* getStyle */])(document.body, 'overflowY'); if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) { document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px'; } Object(utils_dom["a" /* addClass */])(document.body, 'el-popup-parent--hidden'); } } if (getComputedStyle(dom).position === 'static') { dom.style.position = 'absolute'; } dom.style.zIndex = popup_manager.nextZIndex(); this.opened = true; this.onOpen && this.onOpen(); this.doAfterOpen(); }, doAfterOpen: function doAfterOpen() { this._opening = false; }, close: function close() { var _this3 = this; if (this.willClose && !this.willClose()) return; if (this._openTimer !== null) { clearTimeout(this._openTimer); this._openTimer = null; } clearTimeout(this._closeTimer); var closeDelay = Number(this.closeDelay); if (closeDelay > 0) { this._closeTimer = setTimeout(function () { _this3._closeTimer = null; _this3.doClose(); }, closeDelay); } else { this.doClose(); } }, doClose: function doClose() { this._closing = true; this.onClose && this.onClose(); if (this.lockScroll) { setTimeout(this.restoreBodyStyle, 200); } this.opened = false; this.doAfterClose(); }, doAfterClose: function doAfterClose() { popup_manager.closeModal(this._popupId); this._closing = false; }, restoreBodyStyle: function restoreBodyStyle() { if (this.modal && this.withoutHiddenClass) { document.body.style.paddingRight = this.bodyPaddingRight; Object(utils_dom["i" /* removeClass */])(document.body, 'el-popup-parent--hidden'); } this.withoutHiddenClass = true; } } }); /***/ }), /* 10 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var element_ui_src_utils_popup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9); var PopperJS = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer ? function () {} : __webpack_require__(24); var stop = function stop(e) { return e.stopPropagation(); }; /** * @param {HTMLElement} [reference=$refs.reference] - The reference element used to position the popper. * @param {HTMLElement} [popper=$refs.popper] - The HTML element used as popper, or a configuration used to generate the popper. * @param {String} [placement=button] - Placement of the popper accepted values: top(-start, -end), right(-start, -end), bottom(-start, -end), left(-start, -end) * @param {Number} [offset=0] - Amount of pixels the popper will be shifted (can be negative). * @param {Boolean} [visible=false] Visibility of the popup element. * @param {Boolean} [visible-arrow=false] Visibility of the arrow, no style. */ /* harmony default export */ __webpack_exports__["a"] = ({ props: { transformOrigin: { type: [Boolean, String], default: true }, placement: { type: String, default: 'bottom' }, boundariesPadding: { type: Number, default: 5 }, reference: {}, popper: {}, offset: { default: 0 }, value: Boolean, visibleArrow: Boolean, arrowOffset: { type: Number, default: 35 }, appendToBody: { type: Boolean, default: true }, popperOptions: { type: Object, default: function _default() { return { gpuAcceleration: false }; } } }, data: function data() { return { showPopper: false, currentPlacement: '' }; }, watch: { value: { immediate: true, handler: function handler(val) { this.showPopper = val; this.$emit('input', val); } }, showPopper: function showPopper(val) { if (this.disabled) return; val ? this.updatePopper() : this.destroyPopper(); this.$emit('input', val); } }, methods: { createPopper: function createPopper() { var _this = this; if (this.$isServer) return; this.currentPlacement = this.currentPlacement || this.placement; if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement)) { return; } var options = this.popperOptions; var popper = this.popperElm = this.popperElm || this.popper || this.$refs.popper; var reference = this.referenceElm = this.referenceElm || this.reference || this.$refs.reference; if (!reference && this.$slots.reference && this.$slots.reference[0]) { reference = this.referenceElm = this.$slots.reference[0].elm; } if (!popper || !reference) return; if (this.visibleArrow) this.appendArrow(popper); if (this.appendToBody) document.body.appendChild(this.popperElm); if (this.popperJS && this.popperJS.destroy) { this.popperJS.destroy(); } options.placement = this.currentPlacement; options.offset = this.offset; options.arrowOffset = this.arrowOffset; this.popperJS = new PopperJS(reference, popper, options); this.popperJS.onCreate(function (_) { _this.$emit('created', _this); _this.resetTransformOrigin(); _this.$nextTick(_this.updatePopper); }); if (typeof options.onUpdate === 'function') { this.popperJS.onUpdate(options.onUpdate); } this.popperJS._popper.style.zIndex = element_ui_src_utils_popup__WEBPACK_IMPORTED_MODULE_1__[/* PopupManager */ "a"].nextZIndex(); this.popperElm.addEventListener('click', stop); }, updatePopper: function updatePopper() { var popperJS = this.popperJS; if (popperJS) { popperJS.update(); if (popperJS._popper) { popperJS._popper.style.zIndex = element_ui_src_utils_popup__WEBPACK_IMPORTED_MODULE_1__[/* PopupManager */ "a"].nextZIndex(); } } else { this.createPopper(); } }, doDestroy: function doDestroy(forceDestroy) { /* istanbul ignore if */ if (!this.popperJS || this.showPopper && !forceDestroy) return; this.popperJS.destroy(); this.popperJS = null; }, destroyPopper: function destroyPopper() { if (this.popperJS) { this.resetTransformOrigin(); } }, resetTransformOrigin: function resetTransformOrigin() { if (!this.transformOrigin) return; var placementMap = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' }; var placement = this.popperJS._popper.getAttribute('x-placement').split('-')[0]; var origin = placementMap[placement]; this.popperJS._popper.style.transformOrigin = typeof this.transformOrigin === 'string' ? this.transformOrigin : ['top', 'bottom'].indexOf(placement) > -1 ? 'center ' + origin : origin + ' center'; }, appendArrow: function appendArrow(element) { var hash = void 0; if (this.appended) { return; } this.appended = true; for (var item in element.attributes) { if (/^_v-/.test(element.attributes[item].name)) { hash = element.attributes[item].name; break; } } var arrow = document.createElement('div'); if (hash) { arrow.setAttribute(hash, ''); } arrow.setAttribute('x-arrow', ''); arrow.className = 'popper__arrow'; element.appendChild(arrow); } }, beforeDestroy: function beforeDestroy() { this.doDestroy(true); if (this.popperElm && this.popperElm.parentNode === document.body) { this.popperElm.removeEventListener('click', stop); document.body.removeChild(this.popperElm); } }, // call destroy in keep-alive mode deactivated: function deactivated() { this.$options.beforeDestroy[0].call(this); } }); /***/ }), /* 11 */, /* 12 */, /* 13 */, /* 14 */, /* 15 */, /* 16 */, /* 17 */, /* 18 */, /* 19 */, /* 20 */, /* 21 */ /***/ (function(module, exports) { module.exports = require("throttle-debounce/debounce"); /***/ }), /* 22 */, /* 23 */, /* 24 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** * @fileOverview Kickass library to create and place poppers near their reference elements. * @version {{version}} * @license * Copyright (c) 2016 Federico Zivolo and contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ // // Cross module loader // Supported: Node, AMD, Browser globals // ;(function (root, factory) { if (true) { // AMD. Register as an anonymous module. !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} })(this, function () { 'use strict'; var root = window; // default options var DEFAULTS = { // placement of the popper placement: 'bottom', gpuAcceleration: true, // shift popper from its origin by the given amount of pixels (can be negative) offset: 0, // the element which will act as boundary of the popper boundariesElement: 'viewport', // amount of pixel used to define a minimum distance between the boundaries and the popper boundariesPadding: 5, // popper will try to prevent overflow following this order, // by default, then, it could overflow on the left and on top of the boundariesElement preventOverflowOrder: ['left', 'right', 'top', 'bottom'], // the behavior used by flip to change the placement of the popper flipBehavior: 'flip', arrowElement: '[x-arrow]', arrowOffset: 0, // list of functions used to modify the offsets before they are applied to the popper modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'], modifiersIgnored: [], forceAbsolute: false }; /** * Create a new Popper.js instance * @constructor Popper * @param {HTMLElement} reference - The reference element used to position the popper * @param {HTMLElement|Object} popper * The HTML element used as popper, or a configuration used to generate the popper. * @param {String} [popper.tagName='div'] The tag name of the generated popper. * @param {Array} [popper.classNames=['popper']] Array of classes to apply to the generated popper. * @param {Array} [popper.attributes] Array of attributes to apply, specify `attr:value` to assign a value to it. * @param {HTMLElement|String} [popper.parent=window.document.body] The parent element, given as HTMLElement or as query string. * @param {String} [popper.content=''] The content of the popper, it can be text, html, or node; if it is not text, set `contentType` to `html` or `node`. * @param {String} [popper.contentType='text'] If `html`, the `content` will be parsed as HTML. If `node`, it will be appended as-is. * @param {String} [popper.arrowTagName='div'] Same as `popper.tagName` but for the arrow element. * @param {Array} [popper.arrowClassNames='popper__arrow'] Same as `popper.classNames` but for the arrow element. * @param {String} [popper.arrowAttributes=['x-arrow']] Same as `popper.attributes` but for the arrow element. * @param {Object} options * @param {String} [options.placement=bottom] * Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -right), * left(-start, -end)` * * @param {HTMLElement|String} [options.arrowElement='[x-arrow]'] * The DOM Node used as arrow for the popper, or a CSS selector used to get the DOM node. It must be child of * its parent Popper. Popper.js will apply to the given element the style required to align the arrow with its * reference element. * By default, it will look for a child node of the popper with the `x-arrow` attribute. * * @param {Boolean} [options.gpuAcceleration=true] * When this property is set to true, the popper position will be applied using CSS3 translate3d, allowing the * browser to use the GPU to accelerate the rendering. * If set to false, the popper will be placed using `top` and `left` properties, not using the GPU. * * @param {Number} [options.offset=0] * Amount of pixels the popper will be shifted (can be negative). * * @param {String|Element} [options.boundariesElement='viewport'] * The element which will define the boundaries of the popper position, the popper will never be placed outside * of the defined boundaries (except if `keepTogether` is enabled) * * @param {Number} [options.boundariesPadding=5] * Additional padding for the boundaries * * @param {Array} [options.preventOverflowOrder=['left', 'right', 'top', 'bottom']] * Order used when Popper.js tries to avoid overflows from the boundaries, they will be checked in order, * this means that the last ones will never overflow * * @param {String|Array} [options.flipBehavior='flip'] * The behavior used by the `flip` modifier to change the placement of the popper when the latter is trying to * overlap its reference element. Defining `flip` as value, the placement will be flipped on * its axis (`right - left`, `top - bottom`). * You can even pass an array of placements (eg: `['right', 'left', 'top']` ) to manually specify * how alter the placement when a flip is needed. (eg. in the above example, it would first flip from right to left, * then, if eve