UNPKG

@mdsfe/mds-ui

Version:

A set of enterprise-class Vue UI components.

1,605 lines (1,371 loc) 172 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("vue"), require("./icon"), require("./_util/proptype"), require("./_mixin/locale"), require("./_mixin/emitter"), require("./input"), require("./_util/util"), require("./tag"), require("./_util/resizeEvent")); else if(typeof define === 'function' && define.amd) define(["vue", "./icon", "./_util/proptype", "./_mixin/locale", "./_mixin/emitter", "./input", "./_util/util", "./tag", "./_util/resizeEvent"], factory); else { var a = typeof exports === 'object' ? factory(require("vue"), require("./icon"), require("./_util/proptype"), require("./_mixin/locale"), require("./_mixin/emitter"), require("./input"), require("./_util/util"), require("./tag"), require("./_util/resizeEvent")) : factory(root["Vue"], root["./icon"], root["./_util/proptype"], root["./_mixin/locale"], root["./_mixin/emitter"], root["./input"], root["./_util/util"], root["./tag"], root["./_util/resizeEvent"]); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__7__, __WEBPACK_EXTERNAL_MODULE__8__, __WEBPACK_EXTERNAL_MODULE__9__, __WEBPACK_EXTERNAL_MODULE__14__, __WEBPACK_EXTERNAL_MODULE__17__, __WEBPACK_EXTERNAL_MODULE__22__, __WEBPACK_EXTERNAL_MODULE__51__, __WEBPACK_EXTERNAL_MODULE__61__) { return /******/ (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 = 92); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; }); /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules). // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call( this, (options.functional ? this.parent : this).$root.$options.shadowRoot ) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functional component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } } /***/ }), /***/ 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; }); /* unused harmony export 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__, "h", function() { return removeClass; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; }); /* unused harmony export setStyle */ /* unused harmony export isScroll */ /* unused harmony export getScrollContainer */ /* unused harmony export isInContainer */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return merge; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollBarWidth; }); /* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); /* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__); /* eslint-disable */ var isServer = vue__WEBPACK_IMPORTED_MODULE_1___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' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(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; }; function merge(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; } var scrollBarWidth = void 0; function getScrollBarWidth() { if (vue__WEBPACK_IMPORTED_MODULE_1___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; } /***/ }), /***/ 10: /***/ (function(module, exports) { module.exports = require("babel-runtime/helpers/typeof"); /***/ }), /***/ 11: /***/ (function(module, exports) { module.exports = require("babel-runtime/core-js/object/keys"); /***/ }), /***/ 14: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__14__; /***/ }), /***/ 142: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /***/ 16: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export noop */ /* unused harmony export getOffsetLeft */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getValueByPath; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return valueEquals; }); /* 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__, "c", function() { return coerceTruthyValueToArray; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return isIE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return isEdge; }); /* unused harmony export isFirefox */ /* unused harmony export assert */ /* unused harmony export escapeRegexpString */ /* unused harmony export getOffsetWidth */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return isFunction; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return fixBodyScroll; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return hasOwn; }); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); // import { getScrollBarWidth } from './_popper/dom-helper' var currentBodyOverflow = ''; // let currentBodyPaddingRight = '' var noop = function noop() {}; var getScroll = function getScroll(w, top) { var ret = top ? w.pageYOffset : w.pageXOffset; var method = top ? 'scrollTop' : 'scrollLeft'; if (typeof ret !== 'number') { var d = w.document; // ie6,7,8 standard mode ret = d.documentElement[method]; if (typeof ret !== 'number') { // quirks mode ret = d.body[method]; } } return ret; }; var getClientPosition = function getClientPosition(elem) { var box = void 0; var x = void 0; var y = void 0; var doc = elem.ownerDocument; var body = doc.body; var docElem = doc && doc.documentElement; box = elem.getBoundingClientRect(); x = box.left; y = box.top; x -= docElem.clientLeft || body.clientLeft || 0; y -= docElem.clientTop || body.clientTop || 0; return { left: x, top: y }; }; var getOffsetLeft = function getOffsetLeft(el) { var pos = getClientPosition(el); var doc = el.ownerDocument; var w = doc.defaultView || doc.parentWindow; pos.left += getScroll(w); return pos.left; }; /** * 获取对象深层级的对象,避免循环 * @export * @param {*} sourceObj 源对象 {a:{b:{d:1}}} * @param {*} pathName path组成的数组 例如:'a.b.c' * @param {*} defaultValue 如果没有值默认的值 [] */ function getValueByPath(sourceObj, pathName, defaultValue) { var getValue = function getValue(sourceObj, pathNameArray) { var key = pathNameArray.shift(); var value = sourceObj[key]; if (value === undefined || value === null) { return defaultValue; } else if (pathNameArray.length === 0) { return value; } else if (pathNameArray.length > 0) { return getValue(value, pathNameArray); } }; var pathNameArray = pathName.split('.'); return getValue(sourceObj, pathNameArray); } /** * * 判断两个数是否相等 * @param {*} a * @param {*} b * @returns */ 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; }; // 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 assert = function assert(condition, msg) { if (!condition) throw new Error('[mds-ui] ' + msg); }; /** * * 特殊字符转译 * @param {string} [value=''] */ var escapeRegexpString = function escapeRegexpString() { var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'); }; /** * Get element offset width * @param {*} node HTMLDOMElemment * @return {Number} width */ /** * Get element offset width * @param {*} node HTMLDOMElemment * @return {Number} width */ var getOffsetWidth = function getOffsetWidth(node) { return node ? node.offsetWidth : 0; }; /** 判断是否为函数 * @param {*} functionToCheck * @returns */ var isFunction = function isFunction(functionToCheck) { var getType = {}; return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; }; /** * 弹窗类组件显现时修正body滚动 * @param {Boolean} visible 弹窗显现状态 */ function fixBodyScroll(visible) { var bodyStyle = document.body.style; if (visible) { currentBodyOverflow = bodyStyle.overflow; // currentBodyPaddingRight = bodyStyle.paddingRight bodyStyle.overflow = 'hidden'; // const basePaddingRight = parseInt(currentBodyPaddingRight || 0) // const baseScrollWidth = parseInt(getScrollBarWidth()) // 防止页面抖动,后续需要自定义滚动条解决 // bodyStyle.paddingRight = basePaddingRight + baseScrollWidth + 'px' } else { var timer = setTimeout(function () { clearTimeout(timer); bodyStyle.overflow = currentBodyOverflow; // bodyStyle.paddingRight = currentBodyPaddingRight // currentBodyPaddingRight = '' }, 180); } } var hasOwnProperty = Object.prototype.hasOwnProperty; function hasOwn(obj, key) { return hasOwnProperty.call(obj, key); } /***/ }), /***/ 17: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__17__; /***/ }), /***/ 2: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__2__; /***/ }), /***/ 20: /***/ (function(module, exports) { module.exports = require("babel-runtime/core-js/object/get-own-property-descriptor"); /***/ }), /***/ 21: /***/ (function(module, exports) { module.exports = require("throttle-debounce"); /***/ }), /***/ 219: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /***/ 22: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__22__; /***/ }), /***/ 221: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /***/ 23: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return on; }); /* unused harmony export off */ /* unused harmony export once */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return hasClass; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return removeClass; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getStyle; }); /* unused harmony export setStyle */ /* unused harmony export isScroll */ /* unused harmony export getScrollContainer */ /* unused harmony export isInContainer */ /* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); /* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__); /* istanbul ignore next */ var isServer = vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$isServer; /* eslint no-useless-escape: 0 */ 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.className = 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.className = 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' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(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)/); }; 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; }; /***/ }), /***/ 27: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/scroll-bar/scroll-bar.vue?vue&type=template&id=2fbcec38& var render = function () { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "ul", { ref: "wrap", class: _vm.classes, attrs: { role: "mds-scroll-bar" } }, [_vm._t("default")], 2 ) } var staticRenderFns = [] render._withStripped = true // CONCATENATED MODULE: ./components/scroll-bar/scroll-bar.vue?vue&type=template&id=2fbcec38& // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/scroll-bar/scroll-bar.vue?vue&type=script&lang=js& // // // // // // // // // /* harmony default export */ var scroll_barvue_type_script_lang_js_ = ({ name: 'mdsScrollBar', props: { prefixCls: { type: String, default: 'mds-scroll-bar' } }, data: function data() { return {}; }, computed: { classes: function classes() { var prefixCls = this.prefixCls; return ['' + prefixCls, prefixCls + '-root']; }, wrap: function wrap() { return this.$refs.wrap; } }, methods: {}, created: function created() {} }); // CONCATENATED MODULE: ./components/scroll-bar/scroll-bar.vue?vue&type=script&lang=js& /* harmony default export */ var scroll_bar_scroll_barvue_type_script_lang_js_ = (scroll_barvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(0); // CONCATENATED MODULE: ./components/scroll-bar/scroll-bar.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( scroll_bar_scroll_barvue_type_script_lang_js_, render, staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "components/scroll-bar/scroll-bar.vue" /* harmony default export */ var scroll_bar = (component.exports); // CONCATENATED MODULE: ./components/scroll-bar/index.js /* harmony default export */ var components_scroll_bar = __webpack_exports__["a"] = (scroll_bar); /***/ }), /***/ 3: /***/ (function(module, exports) { module.exports = require("babel-runtime/helpers/defineProperty"); /***/ }), /***/ 37: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23); var nodeList = []; var ctx = '@@clickoutsideContext'; var startClick = void 0; var seed = 0; !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && Object(_dom_js__WEBPACK_IMPORTED_MODULE_1__[/* on */ "d"])(document, 'mousedown', function (e) { return startClick = e; }); !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && Object(_dom_js__WEBPACK_IMPORTED_MODULE_1__[/* on */ "d"])(document, 'mouseup', function (e) { nodeList.forEach(function (node) { return node[ctx].documentHandler(e, startClick); }); }); function createDocumentHandler(el, binding, vnode) { return function () { var mouseup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var mousedown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (!vnode || !vnode.context || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target || vnode.context.popperElm && (vnode.context.popperElm.contains(mouseup.target) || vnode.context.popperElm.contains(mousedown.target))) return; if (binding.expression && el[ctx].methodName && vnode.context[el[ctx].methodName]) { vnode.context[el[ctx].methodName](); } else { el[ctx].bindingFn && el[ctx].bindingFn(); } }; } /** * v-clickoutside * @desc 点击元素外面才会触发的事件 * @example * ```vue * <div v-element-clickoutside="handleClose"> * ``` */ /* harmony default export */ __webpack_exports__["a"] = ({ bind: function bind(el, binding, vnode) { nodeList.push(el); var id = seed++; el[ctx] = { id: id, documentHandler: createDocumentHandler(el, binding, vnode), methodName: binding.expression, bindingFn: binding.value }; }, update: function update(el, binding, vnode) { el[ctx].documentHandler = createDocumentHandler(el, binding, vnode); el[ctx].methodName = binding.expression; el[ctx].bindingFn = binding.value; }, unbind: function unbind(el) { var len = nodeList.length; for (var i = 0; i < len; i++) { if (nodeList[i][ctx].id === el[ctx].id) { nodeList.splice(i, 1); break; } } delete el[ctx]; } }); /***/ }), /***/ 5: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _dom_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); var hasModal = false; var hasInitZIndex = false; var zIndex = void 0; var getModal = function getModal() { if (vue__WEBPACK_IMPORTED_MODULE_0___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 (vue__WEBPACK_IMPORTED_MODULE_0___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 = getModal(); Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal'); if (this.modalFade && !hasModal) { Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal-enter'); } if (modalClass) { var classArr = modalClass.trim().split(/\s+/); classArr.forEach(function (item) { return Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, item); }); } setTimeout(function () { Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "h"])(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 = 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(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "h"])(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(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(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(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "h"])(modalDom, 'v-modal-leave'); }, 200); } } }; Object.defineProperty(PopupManager, 'zIndex', { configurable: true, get: function get() { if (!hasInitZIndex) { zIndex = zIndex || (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$ELEMENT || {}).zIndex || 2000; hasInitZIndex = true; } return zIndex; }, set: function set(value) { zIndex = value; } }); var getTopPopup = function getTopPopup() { if (vue__WEBPACK_IMPORTED_MODULE_0___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 (!vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) { // handle `esc` key when the popup is shown window.addEventListener('keydown', function (event) { if (event.keyCode === 27) { var topPopup = getTopPopup(); if (topPopup && topPopup.closeOnPressEscape) { topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close(); } } }); } /* harmony default export */ __webpack_exports__["a"] = (PopupManager); /***/ }), /***/ 51: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__51__; /***/ }), /***/ 6: /***/ (function(module, exports) { module.exports = require("babel-runtime/core-js/object/assign"); /***/ }), /***/ 61: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__61__; /***/ }), /***/ 7: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__7__; /***/ }), /***/ 8: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__8__; /***/ }), /***/ 9: /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__9__; /***/ }), /***/ 92: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXTERNAL MODULE: ./components/style/index.less var style = __webpack_require__(142); // EXTERNAL MODULE: ./components/select/style/index.less var select_style = __webpack_require__(219); // EXTERNAL MODULE: ./components/select/style/transition.less var transition = __webpack_require__(221); // CONCATENATED MODULE: ./components/select/style/index.js // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/select/select.vue?vue&type=template&id=12933cc4& var 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.handleClose, expression: "handleClose", }, ], class: _vm.wrapperClass, on: { click: function ($event) { $event.stopPropagation() return _vm.toggleMenu($event) }, }, }, [ _vm.multiple ? _c( "div", { ref: "tags", class: _vm.wrapperTagsClass, style: { "max-width": _vm.inputWidth - 32 + "px", width: "100%" }, }, [ _vm.selected.length ? _c( "span", [ _vm.collapseTags ? [ _c( "mds-tag", { key: _vm.getValueKey(_vm.selected[0]), ref: "tag", attrs: { closable: true, size: _vm.size, type: "info", useTransition: false, }, on: { close: function ($event) { return _vm.deleteTag( $event, _vm.selected[0] ) }, }, }, [ _c( "span", { class: _vm.prefixCls + "-tags-text" }, [ _vm._v( _vm._s( _vm.echoKey ? _vm.selected[0][_vm.echoKey] : _vm.selected[0].currentLabel ) ), ] ), ] ), _vm.selected.length > 1 ? _c( "mds-tag", { key: "collapseTagsName", attrs: { closable: false, size: _vm.size, type: "info", }, }, [ _c( "span", { class: _vm.prefixCls + "-tags-text" }, [ _vm._v( "+ " + _vm._s(_vm.selected.length - 1) ), ] ), ] ) : _vm._e(), ] : _c( "transition-group", { on: { "after-leave": _vm.resetInputHeight } }, _vm._l(_vm.selected, function (item) { return _c( "mds-tag", { key: _vm.getValueKey(item), ref: "tag", refInFor: true, attrs: { closable: !_vm.selectDisabled, size: _vm.size, hit: item.hitState, type: "info", }, on: { close: function ($event) { return _vm.deleteTag($event, item) }, }, }, [ _c( "span", { class: