yk-smart-ui-test
Version:
A Component Library for Vue.js.
1,767 lines (1,575 loc) • 239 kB
JavaScript
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/dist/";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 141);
/******/ })
/************************************************************************/
/******/ ({
/***/ 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;
};
/***/ }),
/***/ 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:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ t; });
// UNUSED EXPORTS: use, i18n
// CONCATENATED MODULE: ./src/locale/lang/zh-CN.js
/* harmony default export */ var zh_CN = ({
el: {
colorpicker: {
confirm: '确定',
clear: '清空'
},
datepicker: {
now: '此刻',
today: '今天',
cancel: '取消',
clear: '清空',
confirm: '确定',
selectDate: '选择日期',
selectTime: '选择时间',
startDate: '开始日期',
startTime: '开始时间',
endDate: '结束日期',
endTime: '结束时间',
prevYear: '前一年',
nextYear: '后一年',
prevMonth: '上个月',
nextMonth: '下个月',
year: '年',
month1: '1 月',
month2: '2 月',
month3: '3 月',
month4: '4 月',
month5: '5 月',
month6: '6 月',
month7: '7 月',
month8: '8 月',
month9: '9 月',
month10: '10 月',
month11: '11 月',
month12: '12 月',
// week: '周次',
weeks: {
sun: '日',
mon: '一',
tue: '二',
wed: '三',
thu: '四',
fri: '五',
sat: '六'
},
months: {
jan: '一月',
feb: '二月',
mar: '三月',
apr: '四月',
may: '五月',
jun: '六月',
jul: '七月',
aug: '八月',
sep: '九月',
oct: '十月',
nov: '十一月',
dec: '十二月'
},
shortcuts: {
Today: '今天',
Yestoday: '昨天',
LastThreeDays: '最近三天',
LastSevenDays: '最近七天',
ThisWeek: '本周',
LastWeek: '上周',
ThisMoth: '本月',
LastMonth: '上月',
LastThreeMonths: '最近三个月',
LastSixMonths: '最近六个月'
}
},
select: {
loading: '加载中',
noMatch: '无匹配数据',
noData: '无数据',
placeholder: '请选择'
},
cascader: {
noMatch: '无匹配数据',
loading: '加载中',
placeholder: '请选择',
noData: '暂无数据'
},
pagination: {
goto: '前往',
pagesize: '条/页',
total: '共 {total} 条',
pageClassifier: '页'
},
messagebox: {
title: '提示',
confirm: '确定',
cancel: '取消',
error: '输入的数据不合法!'
},
upload: {
deleteTip: '按 delete 键可删除',
delete: '删除',
preview: '查看图片',
continue: '继续上传'
},
table: {
emptyText: '暂无数据',
confirmFilter: '筛选',
resetFilter: '重置',
clearFilter: '全部',
sumText: '合计'
},
tree: {
emptyText: '暂无数据'
},
transfer: {
noMatch: '无匹配数据',
noData: '无数据',
titles: ['列表 1', '列表 2'],
filterPlaceholder: '请输入搜索内容',
noCheckedFormat: '共 {total} 项',
hasCheckedFormat: '已选 {checked}/{total} 项'
},
image: {
error: '加载失败'
},
pageHeader: {
title: '返回'
},
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消'
},
empty: {
description: '暂无数据'
}
}
});
// EXTERNAL MODULE: external "vue"
var external_vue_ = __webpack_require__(0);
var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
// EXTERNAL MODULE: external "deepmerge"
var external_deepmerge_ = __webpack_require__(17);
var external_deepmerge_default = /*#__PURE__*/__webpack_require__.n(external_deepmerge_);
// EXTERNAL MODULE: ./src/utils/util.js
var util = __webpack_require__(3);
// CONCATENATED MODULE: ./src/locale/format.js
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 RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
/**
* String format template
* - Inspired:
* https://github.com/Matt-Esch/string-template/index.js
*/
/* harmony default export */ var format = (function (Vue) {
/**
* template
*
* @param {String} string
* @param {Array} ...args
* @return {String}
*/
function template(string) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (args.length === 1 && _typeof(args[0]) === 'object') {
args = args[0];
}
if (!args || !args.hasOwnProperty) {
args = {};
}
return string.replace(RE_NARGS, function (match, prefix, i, index) {
var result = void 0;
if (string[index - 1] === '{' && string[index + match.length] === '}') {
return i;
} else {
result = Object(util["j" /* hasOwn */])(args, i) ? args[i] : null;
if (result === null || result === undefined) {
return '';
}
return result;
}
});
}
return template;
});
// CONCATENATED MODULE: ./src/locale/index.js
var locale_format = format(external_vue_default.a);
var lang = zh_CN;
var merged = false;
var locale_i18nHandler = function i18nHandler() {
var vuei18n = Object.getPrototypeOf(this || external_vue_default.a).$t;
if (typeof vuei18n === 'function' && !!external_vue_default.a.locale) {
if (!merged) {
merged = true;
external_vue_default.a.locale(external_vue_default.a.config.lang, external_deepmerge_default()(lang, external_vue_default.a.locale(external_vue_default.a.config.lang) || {}, { clone: true }));
}
return vuei18n.apply(this, arguments);
}
};
var t = function t(path, options) {
var value = locale_i18nHandler.apply(this, arguments);
if (value !== null && value !== undefined) return value;
var array = path.split('.');
var current = lang;
for (var i = 0, j = array.length; i < j; i++) {
var property = array[i];
value = current[property];
if (i === j - 1) return locale_format(value, options);
if (!value) return '';
current = value;
}
return '';
};
var use = function use(l) {
lang = l || lang;
};
var i18n = function i18n(fn) {
locale_i18nHandler = fn || locale_i18nHandler;
};
/* harmony default export */ var locale = ({ use: use, t: t, i18n: i18n });
/***/ }),
/***/ 12:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
/**
* Show migrating guide in browser console.
*
* Usage:
* import Migrating from 'element-ui/src/mixins/migrating';
*
* mixins: [Migrating]
*
* add getMigratingConfig method for your component.
* getMigratingConfig() {
* return {
* props: {
* 'allow-no-selection': 'allow-no-selection is removed.',
* 'selection-mode': 'selection-mode is removed.'
* },
* events: {
* selectionchange: 'selectionchange is renamed to selection-change.'
* }
* };
* },
*/
/* harmony default export */ __webpack_exports__["a"] = ({
mounted: function mounted() {
if (true) return;
if (!this.$vnode) return;
var _getMigratingConfig = this.getMigratingConfig(),
_getMigratingConfig$p = _getMigratingConfig.props,
props = _getMigratingConfig$p === undefined ? {} : _getMigratingConfig$p,
_getMigratingConfig$e = _getMigratingConfig.events,
events = _getMigratingConfig$e === undefined ? {} : _getMigratingConfig$e;
var _$vnode = this.$vnode,
data = _$vnode.data,
componentOptions = _$vnode.componentOptions;
var definedProps = data.attrs || {};
var definedEvents = componentOptions.listeners || {};
for (var propName in definedProps) {
propName = Object(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "p"])(propName); // compatible with camel case
if (props[propName]) {
console.warn('[Element Migrating][' + this.$options.name + '][Attribute]: ' + props[propName]);
}
}
for (var eventName in definedEvents) {
eventName = Object(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "p"])(eventName); // compatible with camel case
if (events[eventName]) {
console.warn('[Element Migrating][' + this.$options.name + '][Event]: ' + events[eventName]);
}
}
},
methods: {
getMigratingConfig: function getMigratingConfig() {
return {
props: {},
events: {}
};
}
}
});
/***/ }),
/***/ 13:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
/* harmony default export */ __webpack_exports__["a"] = ({
methods: {
t: function t() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__[/* t */ "a"].apply(this, args);
}
}
});
/***/ }),
/***/ 14:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addResizeListener; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeResizeListener; });
/* harmony import */ var resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
/* harmony import */ var resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_0__);
var isServer = typeof window === 'undefined';
/* istanbul ignore next */
var resizeHandler = function resizeHandler(entries) {
for (var _iterator = entries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var entry = _ref;
var listeners = entry.target.__resizeListeners__ || [];
if (listeners.length) {
listeners.forEach(function (fn) {
fn();
});
}
}
};
/* istanbul ignore next */
var addResizeListener = function addResizeListener(element, fn) {
if (isServer) return;
if (!element.__resizeListeners__) {
element.__resizeListeners__ = [];
element.__ro__ = new resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_0___default.a(resizeHandler);
element.__ro__.observe(element);
}
element.__resizeListeners__.push(fn);
};
/* istanbul ignore next */
var removeResizeListener = function removeResizeListener(element, fn) {
if (!element || !element.__resizeListeners__) return;
element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
if (!element.__resizeListeners__.length) {
element.__ro__.disconnect();
}
};
/***/ }),
/***/ 141:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/_vue-loader@15.9.8@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/cascader/src/cascader.vue?vue&type=template&id=032537a6&
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: function () {
return _vm.toggleDropDownVisible(false)
},
expression: "() => toggleDropDownVisible(false)",
},
],
ref: "reference",
class: [
"yk-cascader",
_vm.realSize && "yk-cascader--" + _vm.realSize,
{ "is-disabled": _vm.isDisabled },
],
on: {
mouseenter: function ($event) {
_vm.inputHover = true
},
mouseleave: function ($event) {
_vm.inputHover = false
},
click: function () {
return _vm.toggleDropDownVisible(_vm.readonly ? undefined : true)
},
keydown: _vm.handleKeyDown,
},
},
[
_c(
"yk-input",
{
ref: "input",
class: { "is-focus": _vm.dropDownVisible },
attrs: {
size: _vm.realSize,
placeholder: _vm.placeholder,
readonly: _vm.readonly,
disabled: _vm.isDisabled,
"validate-event": false,
},
on: {
focus: _vm.handleFocus,
blur: _vm.handleBlur,
input: _vm.handleInput,
},
model: {
value: _vm.multiple ? _vm.presentText : _vm.inputValue,
callback: function ($$v) {
_vm.multiple ? _vm.presentText : (_vm.inputValue = $$v)
},
expression: "multiple ? presentText : inputValue",
},
},
[
_c("template", { slot: "suffix" }, [
_vm.clearBtnVisible
? _c("i", {
key: "clear",
staticClass: "yk-input__icon yk_icon_close",
on: {
click: function ($event) {
$event.stopPropagation()
return _vm.handleClear($event)
},
},
})
: _c("i", {
key: "arrow-down",
class: [
"yk-input__icon",
"el-icon-arrow-down",
_vm.dropDownVisible && "is-reverse",
],
on: {
click: function ($event) {
$event.stopPropagation()
_vm.toggleDropDownVisible()
},
},
}),
]),
],
2
),
_vm.multiple
? _c(
"div",
{ staticClass: "yk-cascader__tags" },
[
_vm._l(_vm.presentTags, function (tag) {
return _c(
"yk-tag",
{
key: tag.key,
attrs: {
type: "info",
size: _vm.tagSize,
hit: tag.hitState,
closable: tag.closable,
"disable-transitions": "",
},
on: {
close: function ($event) {
_vm.deleteTag(tag)
},
},
},
[_c("span", [_vm._v(_vm._s(tag.text))])]
)
}),
_vm.filterable && !_vm.isDisabled
? _c("input", {
directives: [
{
name: "model",
rawName: "v-model.trim",
value: _vm.inputValue,
expression: "inputValue",
modifiers: { trim: true },
},
],
staticClass: "yk-cascader__search-input",
attrs: {
type: "text",
placeholder: _vm.presentTags.length
? ""
: _vm.placeholder,
},
domProps: { value: _vm.inputValue },
on: {
input: [
function ($event) {
if ($event.target.composing) {
return
}
_vm.inputValue = $event.target.value.trim()
},
function (e) {
return _vm.handleInput(_vm.inputValue, e)
},
],
click: function ($event) {
$event.stopPropagation()
_vm.toggleDropDownVisible(true)
},
keydown: function ($event) {
if (
!("button" in $event) &&
_vm._k(
$event.keyCode,
"delete",
[8, 46],
$event.key,
["Backspace", "Delete", "Del"]
)
) {
return null
}
return _vm.handleDelete($event)
},
blur: function ($event) {
_vm.$forceUpdate()
},
},
})
: _vm._e(),
],
2
)
: _vm._e(),
_c(
"transition",
{
attrs: { name: "yk-zoom-in-top" },
on: { "after-leave": _vm.handleDropdownLeave },
},
[
_c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.dropDownVisible,
expression: "dropDownVisible",
},
],
ref: "popper",
class: ["yk-popper", "yk-cascader__dropdown", _vm.popperClass],
},
[
_c("yk-cascader-panel", {
directives: [
{
name: "show",
rawName: "v-show",
value: !_vm.filtering,
expression: "!filtering",
},
],
ref: "panel",
attrs: {
options: _vm.options,
props: _vm.config,
border: false,
"render-label": _vm.$scopedSlots.default,
},
on: {
"expand-change": _vm.handleExpandChange,
close: function ($event) {
_vm.toggleDropDownVisible(false)
},
},
model: {
value: _vm.checkedValue,
callback: function ($$v) {
_vm.checkedValue = $$v
},
expression: "checkedValue",
},
}),
_vm.filterable
? _c(
"yk-scrollbar",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.filtering,
expression: "filtering",
},
],
ref: "suggestionPanel",
staticClass: "yk-cascader__suggestion-panel",
attrs: {
tag: "ul",
"view-class": "yk-cascader__suggestion-list",
},
nativeOn: {
keydown: function ($event) {
return _vm.handleSuggestionKeyDown($event)
},
},
},
[
_vm.suggestions.length
? _vm._l(_vm.suggestions, function (item, index) {
return _c(
"li",
{
key: item.uid,
class: [
"yk-cascader__suggestion-item",
item.checked && "is-checked",
],
attrs: { tabindex: -1 },
on: {
click: function ($event) {
_vm.handleSuggestionClick(index)
},
},
},
[
_c("span", [_vm._v(_vm._s(item.text))]),
item.checked
? _c("i", { staticClass: "el-icon-check" })
: _vm._e(),
]
)
})
: _vm._t("empty", [
_c(
"li",
{ staticClass: "yk-cascader__empty-text" },
[_vm._v(_vm._s(_vm.t("el.cascader.noMatch")))]
),
]),
],
2
)
: _vm._e(),
],
1
),
]
),
],
1
)
}
var staticRenderFns = []
render._withStripped = true
// CONCATENATED MODULE: ./packages/cascader/src/cascader.vue?vue&type=template&id=032537a6&
// EXTERNAL MODULE: ./src/utils/vue-popper.js
var vue_popper = __webpack_require__(10);
// EXTERNAL MODULE: ./src/utils/clickoutside.js
var clickoutside = __webpack_require__(19);
// EXTERNAL MODULE: ./src/mixins/emitter.js
var emitter = __webpack_require__(6);
// EXTERNAL MODULE: ./src/mixins/locale.js
var locale = __webpack_require__(13);
// EXTERNAL MODULE: ./src/mixins/migrating.js
var migrating = __webpack_require__(12);
// EXTERNAL MODULE: ./packages/input/index.js + 6 modules
var packages_input = __webpack_require__(18);
// EXTERNAL MODULE: ./packages/tag/index.js + 3 modules
var packages_tag = __webpack_require__(34);
// EXTERNAL MODULE: ./packages/scrollbar/index.js + 3 modules
var scrollbar = __webpack_require__(25);
// EXTERNAL MODULE: ./packages/cascader-panel/index.js + 13 modules
var cascader_panel = __webpack_require__(50);
// EXTERNAL MODULE: ./src/utils/aria-utils.js
var aria_utils = __webpack_require__(27);
// EXTERNAL MODULE: ./src/locale/index.js + 2 modules
var src_locale = __webpack_require__(11);
// EXTERNAL MODULE: ./src/utils/util.js
var util = __webpack_require__(3);
// EXTERNAL MODULE: ./src/utils/types.js
var types = __webpack_require__(5);
// EXTERNAL MODULE: ./src/utils/shared.js
var shared = __webpack_require__(16);
// EXTERNAL MODULE: ./src/utils/resize-event.js
var resize_event = __webpack_require__(14);
// EXTERNAL MODULE: external "throttle-debounce/debounce"
var debounce_ = __webpack_require__(21);
var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);
// CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/cascader/src/cascader.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var KeyCode = aria_utils["a" /* default */].keys;
var MigratingProps = {
expandTrigger: {
newProp: 'expandTrigger',
type: String
},
changeOnSelect: {
newProp: 'checkStrictly',
type: Boolean
},
hoverThreshold: {
newProp: 'hoverThreshold',
type: Number
}
};
var PopperMixin = {
props: {
placement: {
type: String,
default: 'bottom-start'
},
appendToBody: vue_popper["a" /* default */].props.appendToBody,
visibleArrow: {
type: Boolean,
default: true
},
arrowOffset: vue_popper["a" /* default */].props.arrowOffset,
offset: vue_popper["a" /* default */].props.offset,
boundariesPadding: vue_popper["a" /* default */].props.boundariesPadding,
popperOptions: vue_popper["a" /* default */].props.popperOptions
},
methods: vue_popper["a" /* default */].methods,
data: vue_popper["a" /* default */].data,
beforeDestroy: vue_popper["a" /* default */].beforeDestroy
};
var InputSizeMap = {
medium: 36,
small: 32,
mini: 28
};
/* harmony default export */ var cascadervue_type_script_lang_js_ = ({
name: 'YkCascader',
directives: { Clickoutside: clickoutside["a" /* default */] },
mixins: [PopperMixin, emitter["a" /* default */], locale["a" /* default */], migrating["a" /* default */]],
inject: {
ykForm: {
default: ''
},
ykFormItem: {
default: ''
}
},
components: {
YkInput: packages_input["default"],
YkTag: packages_tag["default"],
YkScrollbar: scrollbar["default"],
YkCascaderPanel: cascader_panel["default"]
},
props: {
value: {},
options: Array,
props: Object,
size: String,
placeholder: {
type: String,
default: function _default() {
return Object(src_locale["a" /* t */])('el.cascader.placeholder');
}
},
disabled: Boolean,
clearable: Boolean,
filterable: Boolean,
filterMethod: Function,
separator: {
type: String,
default: ' / '
},
showAllLevels: {
type: Boolean,
default: true
},
collapseTags: Boolean,
debounce: {
type: Number,
default: 300
},
beforeFilter: {
type: Function,
default: function _default() {
return function () {};
}
},
popperClass: String
},
data: function data() {
return {
dropDownVisible: false,
checkedValue: this.value || null,
inputHover: false,
inputValue: null,
presentText: null,
presentTags: [],
checkedNodes: [],
filtering: false,
suggestions: [],
inputInitialHeight: 0,
pressDeleteCount: 0
};
},
computed: {
realSize: function realSize() {
var _ykFormItemSize = (this.ykFormItem || {}).ykFormItemSize;
return this.size || _ykFormItemSize || (this.$ELEMENT || {}).size;
},
tagSize: function tagSize() {
return ['small', 'mini'].indexOf(this.realSize) > -1 ? 'mini' : 'small';
},
isDisabled: function isDisabled() {
return this.disabled || (this.ykForm || {}).disabled;
},
config: function config() {
var config = this.props || {};
var $attrs = this.$attrs;
Object.keys(MigratingProps).forEach(function (oldProp) {
var _MigratingProps$oldPr = MigratingProps[oldProp],
newProp = _MigratingProps$oldPr.newProp,
type = _MigratingProps$oldPr.type;
var oldValue = $attrs[oldProp] || $attrs[Object(util["p" /* kebabCase */])(oldProp)];
if (Object(shared["a" /* isDef */])(oldProp) && !Object(shared["a" /* isDef */])(config[newProp])) {
if (type === Boolean && oldValue === '') {
oldValue = true;
}
config[newProp] = oldValue;
}
});
return config;
},
multiple: function multiple() {
return this.config.multiple;
},
leafOnly: function leafOnly() {
return !this.config.checkStrictly;
},
readonly: function readonly() {
return !this.filterable || this.multiple;
},
clearBtnVisible: function clearBtnVisible() {
if (!this.clearable || this.isDisabled || this.filtering || !this.inputHover) {
return false;
}
return this.multiple ? !!this.checkedNodes.filter(function (node) {
return !node.isDisabled;
}).length : !!this.presentText;
},
panel: function panel() {
return this.$refs.panel;
}
},
watch: {
disabled: function disabled() {
this.computePresentContent();
},
value: function value(val) {
if (!Object(util["m" /* isEqual */])(val, this.checkedValue)) {
this.checkedValue = val;
this.computePresentContent();
}
},
checkedValue: function checkedValue(val) {
var value = this.value,
dropDownVisible = this.dropDownVisible;
var _config = this.config,
checkStrictly = _config.checkStrictly,
multiple = _config.multiple;
if (!Object(util["m" /* isEqual */])(val, value) || Object(types["f" /* isUndefined */])(value)) {
this.computePresentContent();
// hide dropdown when single mode
if (!multiple && !checkStrictly && dropDownVisible) {
this.toggleDropDownVisible(false);
}
this.$emit('input', val);
this.$emit('change', val);
this.dispatch('YkFormItem', 'el.form.change', [val]);
}
},
options: {
handler: function handler() {
this.$nextTick(this.computePresentContent);
},
deep: true
},
presentText: function presentText(val) {
this.inputValue = val;
},
presentTags: function presentTags(val, oldVal) {
if (this.multiple && (val.length || oldVal.length)) {
this.$nextTick(this.updateStyle);
}
},
filtering: function filtering(val) {
this.$nextTick(this.updatePopper);
}
},
mounted: function mounted() {
var _this = this;
var input = this.$refs.input;
if (input && input.$el) {
this.inputInitialHeight = input.$el.offsetHeight || InputSizeMap[this.realSize] || 40;
}
if (!Object(util["l" /* isEmpty */])(this.value)) {
this.computePresentContent();
}
this.filterHandler = debounce_default()(this.debounce, function () {
var inputValue = _this.inputValue;
if (!inputValue) {
_this.filtering = false;
return;
}
var before = _this.beforeFilter(inputValue);
if (before && before.then) {
before.then(_this.getSuggestions);
} else if (before !== false) {
_this.getSuggestions();
} else {
_this.filtering = false;
}
});
Object(resize_event["a" /* addResizeListener */])(this.$el, this.updateStyle);
},
beforeDestroy: function beforeDestroy() {
Object(resize_event["b" /* removeResizeListener */])(this.$el, this.updateStyle);
},
methods: {
getMigratingConfig: function getMigratingConfig() {
return {
props: {
'expand-trigger': 'expand-trigger is removed, use `props.expandTrigger` instead.',
'change-on-select': 'change-on-select is removed, use `props.checkStrictly` instead.',
'hover-threshold': 'hover-threshold is removed, use `props.hoverThreshold` instead'
},
events: {
'active-item-change': 'active-item-change is renamed to expand-change'
}
};
},
toggleDropDownVisible: function toggleDropDownVisible(visible) {
var _this2 = this;
if (this.isDisabled) return;
var dropDownVisible = this.dropDownVisible;
var input = this.$refs.input;
visible = Object(shared["a" /* isDef */])(visible) ? visible : !dropDownVisible;
if (visible !== dropDownVisible) {
this.dropDownVisible = visible;
if (visible) {
this.$nextTick(function () {
_this2.updatePopper();
_this2.panel.scrollIntoView();
});
}
input.$refs.input.setAttribute('aria-expanded', visible);
this.$emit('visible-change', visible);
}
},
handleDropdownLeave: function handleDropdownLeave() {
this.filtering = false;
this.inputValue = this.presentText;
},
handleKeyDown: function handleKeyDown(event) {
switch (event.keyCode) {
case KeyCode.enter:
this.toggleDropDownVisible();
break;
case KeyCode.down:
this.toggleDropDownVisible(true);
this.focusFirstNode();
event.preventDefault();
break;
case KeyCode.esc:
case KeyCode.tab:
this.toggleDropDownVisible(false);
break;
}
},
handleF