mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-06-05 08:39:17 +08:00
30629 lines
838 KiB
JavaScript
30629 lines
838 KiB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
|
||
if(typeof exports === 'object' && typeof module === 'object')
|
||
module.exports = factory(require("vue"));
|
||
else if(typeof define === 'function' && define.amd)
|
||
define("fes-ui", ["vue"], factory);
|
||
else if(typeof exports === 'object')
|
||
exports["fes-ui"] = factory(require("vue"));
|
||
else
|
||
root["fes-ui"] = factory(root["Vue"]);
|
||
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_28__) {
|
||
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, {
|
||
/******/ configurable: false,
|
||
/******/ enumerable: true,
|
||
/******/ get: getter
|
||
/******/ });
|
||
/******/ }
|
||
/******/ };
|
||
/******/
|
||
/******/ // 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 = "";
|
||
/******/
|
||
/******/ // Load entry module and return exports
|
||
/******/ return __webpack_require__(__webpack_require__.s = 145);
|
||
/******/ })
|
||
/************************************************************************/
|
||
/******/ ([
|
||
/* 0 */
|
||
/***/ (function(module, exports) {
|
||
|
||
/* globals __VUE_SSR_CONTEXT__ */
|
||
|
||
// this module is a runtime utility for cleaner component module output and will
|
||
// be included in the final webpack user bundle
|
||
|
||
module.exports = function normalizeComponent (
|
||
rawScriptExports,
|
||
compiledTemplate,
|
||
injectStyles,
|
||
scopeId,
|
||
moduleIdentifier /* server only */
|
||
) {
|
||
var esModule
|
||
var scriptExports = rawScriptExports = rawScriptExports || {}
|
||
|
||
// ES6 modules interop
|
||
var type = typeof rawScriptExports.default
|
||
if (type === 'object' || type === 'function') {
|
||
esModule = rawScriptExports
|
||
scriptExports = rawScriptExports.default
|
||
}
|
||
|
||
// Vue.extend constructor export interop
|
||
var options = typeof scriptExports === 'function'
|
||
? scriptExports.options
|
||
: scriptExports
|
||
|
||
// render functions
|
||
if (compiledTemplate) {
|
||
options.render = compiledTemplate.render
|
||
options.staticRenderFns = compiledTemplate.staticRenderFns
|
||
}
|
||
|
||
// scopedId
|
||
if (scopeId) {
|
||
options._scopeId = 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 = injectStyles
|
||
}
|
||
|
||
if (hook) {
|
||
var functional = options.functional
|
||
var existing = functional
|
||
? options.render
|
||
: options.beforeCreate
|
||
if (!functional) {
|
||
// inject component registration as beforeCreate hook
|
||
options.beforeCreate = existing
|
||
? [].concat(existing, hook)
|
||
: [hook]
|
||
} else {
|
||
// register for functioal component in vue file
|
||
options.render = function renderWithStyleInjection (h, context) {
|
||
hook.call(context)
|
||
return existing(h, context)
|
||
}
|
||
}
|
||
}
|
||
|
||
return {
|
||
esModule: esModule,
|
||
exports: scriptExports,
|
||
options: options
|
||
}
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
/* 1 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.noop = exports.debounce = undefined;
|
||
|
||
var _typeof2 = __webpack_require__(31);
|
||
|
||
var _typeof3 = _interopRequireDefault(_typeof2);
|
||
|
||
exports.isIEVersion = isIEVersion;
|
||
exports.getClass = getClass;
|
||
exports.hasClass = hasClass;
|
||
exports.setClass = setClass;
|
||
exports.addClass = addClass;
|
||
exports.removeClass = removeClass;
|
||
exports.contains = contains;
|
||
exports.merge = merge;
|
||
exports.extend = extend;
|
||
exports.isNumber = isNumber;
|
||
exports.isDate = isDate;
|
||
exports.isFunction = isFunction;
|
||
exports.isObject = isObject;
|
||
exports.isArray = isArray;
|
||
exports.isObjectLike = isObjectLike;
|
||
exports.isString = isString;
|
||
exports.getPositionWhenAfterBorther = getPositionWhenAfterBorther;
|
||
exports.typeOf = typeOf;
|
||
exports.deepCopy = deepCopy;
|
||
exports.findComponentUpward = findComponentUpward;
|
||
exports.findComponentDownward = findComponentDownward;
|
||
exports.getScroll = getScroll;
|
||
exports.getOffset = getOffset;
|
||
exports.getViewport = getViewport;
|
||
exports.oneOf = oneOf;
|
||
exports.hasOwn = hasOwn;
|
||
exports.scrollTo = scrollTo;
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
var inBrowser = typeof window !== 'undefined' && Object.prototype.toString.call(window) !== '[object Object]';
|
||
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
|
||
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
|
||
var objectToString = Object.prototype.toString;
|
||
|
||
function isIELowVersion(v) {
|
||
var b = document.createElement('b');
|
||
b.innerHTML = '<!--[if IE ' + v + ']><i></i><![endif]-->';
|
||
return b.getElementsByTagName('i').length === 1;
|
||
}
|
||
function isIEHightVersion(v) {
|
||
return RegExp('msie' + (!isNaN(v) ? '\\s' + v : ''), 'i').test(navigator.userAgent);
|
||
}
|
||
|
||
/**
|
||
* For IE detect
|
||
*
|
||
* @param {Number} ver ie version
|
||
* @return {Boolean}
|
||
*/
|
||
function isIEVersion(v) {
|
||
return v > 9 ? isIEHightVersion(v) : isIELowVersion(v);
|
||
}
|
||
|
||
/**
|
||
* For IE9 compat: when both class and :class are present
|
||
* getAttribute('class') returns wrong value...
|
||
*
|
||
* @param {Element} el
|
||
* @return {String}
|
||
*/
|
||
function getClass(el) {
|
||
var classname = el.className;
|
||
if ((typeof classname === 'undefined' ? 'undefined' : (0, _typeof3.default)(classname)) === 'object') {
|
||
classname = classname.baseVal || '';
|
||
}
|
||
return classname;
|
||
}
|
||
|
||
/**
|
||
* 判断dom节点是否有某样式
|
||
*
|
||
* @param {Element} el
|
||
* @return {String}
|
||
* @returns {boolean}
|
||
*/
|
||
function hasClass(el, name) {
|
||
if (!el) return;
|
||
var className = getClass(el);
|
||
var classes = className.split(' ');
|
||
return classes.indexOf(name) != -1;
|
||
}
|
||
|
||
/**
|
||
* In IE9, setAttribute('class') will result in empty class
|
||
* if the element also has the :class attribute; However in
|
||
* PhantomJS, setting `className` does not work on SVG elements...
|
||
* So we have to do a conditional check here.
|
||
*
|
||
* @param {Element} el
|
||
* @param {String} cls
|
||
*/
|
||
function setClass(el, cls) {
|
||
/* istanbul ignore if */
|
||
if (isIE9 && !/svg$/.test(el.namespaceURI)) {
|
||
el.className = cls;
|
||
} else {
|
||
el.setAttribute('class', cls);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Add class with compatibility for IE & SVG
|
||
*
|
||
* @param {Element} el
|
||
* @param {String} cls
|
||
*/
|
||
|
||
function addClass(el, cls) {
|
||
if (el.classList) {
|
||
el.classList.add(cls);
|
||
} else {
|
||
var cur = ' ' + getClass(el) + ' ';
|
||
if (cur.indexOf(' ' + cls + ' ') < 0) {
|
||
setClass(el, (cur + cls).trim());
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Remove class with compatibility for IE & SVG
|
||
*
|
||
* @param {Element} el
|
||
* @param {String} cls
|
||
*/
|
||
|
||
function removeClass(el, cls) {
|
||
if (el.classList) {
|
||
el.classList.remove(cls);
|
||
} else {
|
||
var cur = ' ' + getClass(el) + ' ';
|
||
var tar = ' ' + cls + ' ';
|
||
while (cur.indexOf(tar) >= 0) {
|
||
cur = cur.replace(tar, ' ');
|
||
}
|
||
setClass(el, cur.trim());
|
||
}
|
||
if (!el.className) {
|
||
el.removeAttribute('class');
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 从jquery扣过来的,递归去算
|
||
*
|
||
* @param {Element} a
|
||
* @param {Element} b
|
||
* @returns {boolean}
|
||
*/
|
||
function contains(a, b) {
|
||
var adown = a.nodeType === 9 ? a.documentElement : a;
|
||
var bup = b && b.parentNode;
|
||
return a === bup || !!(bup && bup.nodeType === 1 && adown.contains(bup));
|
||
}
|
||
|
||
function merge() {
|
||
var base = arguments[0];
|
||
if (!base) return;
|
||
[].forEach.call(arguments, function (item, index) {
|
||
if (index > 0) {
|
||
for (var attrname in item) {
|
||
base[attrname] = item[attrname];
|
||
}
|
||
}
|
||
});
|
||
return base;
|
||
}
|
||
|
||
function extend() {
|
||
var base = arguments[0];
|
||
if (!base) return;
|
||
[].forEach.call(arguments, function (item, index) {
|
||
if (index > 0) {
|
||
for (var attrname in item) {
|
||
if (base[attrname] !== undefined) {
|
||
base[attrname] = item[attrname];
|
||
}
|
||
}
|
||
}
|
||
});
|
||
return base;
|
||
}
|
||
|
||
function isNumber(value) {
|
||
return typeof value === 'number';
|
||
}
|
||
|
||
function isDate(value) {
|
||
return toString.call(value) === '[object Date]';
|
||
}
|
||
|
||
function isFunction(value) {
|
||
return typeof value === 'function';
|
||
}
|
||
|
||
function isObject(value) {
|
||
var type = typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value);
|
||
return !!value && (type == 'object' || type == 'function');
|
||
}
|
||
|
||
function isArray(value) {
|
||
return Array.isArray(value);
|
||
}
|
||
|
||
function isObjectLike(value) {
|
||
return !!value && (typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) === 'object';
|
||
}
|
||
|
||
function isString(value) {
|
||
return typeof value === 'string' || !isArray(value) && isObjectLike(value) && objectToString.call(value) == '[object String]';
|
||
}
|
||
|
||
/**
|
||
* 通过direction和align计算元素的位置
|
||
*
|
||
* @param brotherEle
|
||
* @param direction
|
||
* @param align
|
||
* @param displacementX
|
||
* @param displacementY
|
||
* @returns {{left: number, top: number, position: null}}
|
||
*/
|
||
function getPositionWhenAfterBorther(brotherEle, direction, align, displacementX, displacementY) {
|
||
var offset = {
|
||
left: 0,
|
||
top: 0,
|
||
position: null
|
||
};
|
||
displacementX = displacementX || 0;
|
||
displacementY = displacementY || 0;
|
||
direction = direction || 'bottom';
|
||
align = align || 'left';
|
||
|
||
var style = window.getComputedStyle(brotherEle, null);
|
||
var rect = brotherEle.getBoundingClientRect();
|
||
var height = rect.height || rect.bottom - rect.top;
|
||
var width = rect.width || rect.right - rect.left;
|
||
if (style.position === 'fixed' || style.position === 'absolute') {
|
||
offset.position = style.position;
|
||
offset.left = Number(/^([0-9]*)/.exec(style.left)[0]) + displacementX;
|
||
offset.top = Number(/^([0-9]*)/.exec(style.top)[0]) + displacementY;
|
||
} else {
|
||
offset.position = 'absolute';
|
||
// 如果target元素不在任何相对定位下,则直接计算离屏幕的高度
|
||
if (!brotherEle.offsetParent) {
|
||
offset.left = rect.left + document.documentElement.scrollLeft + displacementX;
|
||
offset.top = rect.top + document.documentElement.scrollTop + displacementY;
|
||
} else {
|
||
// offsetTop和offsetLeft表示该元素的左上角(边框外边缘)与已定位的父容器(offsetParent对象)左上角的距离
|
||
offset.left = brotherEle.offsetLeft + displacementX;
|
||
offset.top = brotherEle.offsetTop + displacementY;
|
||
}
|
||
}
|
||
|
||
switch (direction) {
|
||
case 'top':
|
||
// offset.top = offset.top;
|
||
if (align === 'left') {
|
||
// offset.left = offset.left;
|
||
} else if (align === 'center') {
|
||
offset.left += width / 2;
|
||
} else if (align === 'right') {
|
||
offset.left += width;
|
||
}
|
||
break;
|
||
case 'bottom':
|
||
offset.top += height;
|
||
if (align === 'left') {
|
||
// offset.left = offset.left;
|
||
} else if (align === 'center') {
|
||
offset.left += width / 2;
|
||
} else if (align === 'right') {
|
||
offset.left += width;
|
||
}
|
||
break;
|
||
case 'left':
|
||
// offset.left = offset.left;
|
||
if (align === 'top') {
|
||
// offset.top = offset.top;
|
||
} else if (align === 'center') {
|
||
offset.top += height / 2;
|
||
} else if (align === 'bottom') {
|
||
offset.top += height;
|
||
}
|
||
break;
|
||
case 'right':
|
||
offset.left += width;
|
||
if (align === 'top') {
|
||
// offset.top = offset.top;
|
||
} else if (align === 'center') {
|
||
offset.top += height / 2;
|
||
} else if (align === 'bottom') {
|
||
offset.top += height;
|
||
}
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
|
||
offset.left += 'px';
|
||
offset.top += 'px';
|
||
|
||
return offset;
|
||
}
|
||
|
||
/**
|
||
*判断类型
|
||
* @param {*} obj 需要判断的对象
|
||
*/
|
||
function typeOf(obj) {
|
||
var toString = Object.prototype.toString;
|
||
var map = {
|
||
'[object Boolean]': 'boolean',
|
||
'[object Number]': 'number',
|
||
'[object String]': 'string',
|
||
'[object Function]': 'function',
|
||
'[object Array]': 'array',
|
||
'[object Date]': 'date',
|
||
'[object RegExp]': 'regExp',
|
||
'[object Undefined]': 'undefined',
|
||
'[object Null]': 'null',
|
||
'[object Object]': 'object'
|
||
};
|
||
return map[toString.call(obj)];
|
||
}
|
||
|
||
/**
|
||
* 深度copy对象
|
||
* @param {* 原始数据} data
|
||
*/
|
||
function deepCopy(data) {
|
||
var t = typeOf(data);
|
||
var o = void 0;
|
||
|
||
if (t === 'array') {
|
||
o = [];
|
||
} else if (t === 'object') {
|
||
o = {};
|
||
} else {
|
||
return data;
|
||
}
|
||
|
||
if (t === 'array') {
|
||
for (var i = 0; i < data.length; i++) {
|
||
o.push(deepCopy(data[i]));
|
||
}
|
||
} else if (t === 'object') {
|
||
for (var _i in data) {
|
||
o[_i] = deepCopy(data[_i]);
|
||
}
|
||
}
|
||
return o;
|
||
}
|
||
|
||
// Find components upward
|
||
function findComponentUpward(context, componentName) {
|
||
var componentNames = void 0;
|
||
if (typeOf(componentName) === 'string') {
|
||
componentNames = [componentName];
|
||
} else if (typeOf(componentName) === 'array') {
|
||
componentNames = componentName;
|
||
} else {
|
||
return null;
|
||
}
|
||
|
||
var parent = context.$parent;
|
||
var name = parent.$options.name;
|
||
while (parent && (!name || componentNames.indexOf(name) < 0)) {
|
||
parent = parent.$parent;
|
||
if (parent) name = parent.$options.name;
|
||
}
|
||
return parent;
|
||
}
|
||
|
||
// Find component downward
|
||
function findComponentDownward(context, componentName) {
|
||
var componentNames = void 0;
|
||
if (typeOf(componentName) === 'string') {
|
||
componentNames = [componentName];
|
||
} else if (typeOf(componentName) === 'array') {
|
||
componentNames = componentName;
|
||
} else {
|
||
return null;
|
||
}
|
||
|
||
var childrens = context.$children;
|
||
var children = null;
|
||
|
||
if (childrens.length) {
|
||
childrens.forEach(function (child) {
|
||
var name = child.$options.name;
|
||
if (componentNames.indexOf(name) != -1) {
|
||
children = child;
|
||
}
|
||
});
|
||
|
||
for (var i = 0; i < childrens.length; i++) {
|
||
var child = childrens[i];
|
||
var name = child.$options.name;
|
||
if (componentNames.indexOf(name) != -1) {
|
||
children = child;
|
||
break;
|
||
} else {
|
||
children = findComponentDownward(child, componentNames);
|
||
if (children) break;
|
||
}
|
||
}
|
||
}
|
||
return children;
|
||
}
|
||
|
||
/**
|
||
* 空闲控制 返回函数连续调用时,空闲时间必须大于或等于 wait,func 才会执行
|
||
*
|
||
* @param {function} func 传入函数
|
||
* @param {number} wait 表示时间窗口的间隔
|
||
* @param {boolean} immediate 设置为ture时,调用触发于开始边界而不是结束边界
|
||
* @return {function} 返回客户调用函数
|
||
*/
|
||
var debounce = exports.debounce = function debounce(func, wait, immediate) {
|
||
var timeout = void 0;var args = void 0;var context = void 0;var timestamp = void 0;var result = void 0;
|
||
|
||
var later = function later() {
|
||
// 据上一次触发时间间隔
|
||
var last = new Date().getTime() - timestamp;
|
||
|
||
// 上次被包装函数被调用时间间隔last小于设定时间间隔wait
|
||
if (last < wait && last > 0) {
|
||
timeout = setTimeout(later, wait - last);
|
||
} else {
|
||
timeout = null;
|
||
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
|
||
if (!immediate) {
|
||
result = func.apply(context, args);
|
||
if (!timeout) context = args = null;
|
||
}
|
||
}
|
||
};
|
||
|
||
return function () {
|
||
context = this;
|
||
args = arguments;
|
||
timestamp = new Date().getTime();
|
||
var callNow = immediate && !timeout;
|
||
// 如果延时不存在,重新设定延时
|
||
if (!timeout) timeout = setTimeout(later, wait);
|
||
if (callNow) {
|
||
result = func.apply(context, args);
|
||
context = args = null;
|
||
}
|
||
return result;
|
||
};
|
||
};
|
||
|
||
function getScroll(target, top) {
|
||
if (typeof window === 'undefined') return 0;
|
||
|
||
var prop = top ? 'pageYOffset' : 'pageXOffset';
|
||
var method = top ? 'scrollTop' : 'scrollLeft';
|
||
var isWindow = target === window;
|
||
var ret = isWindow ? target[prop] : target[method];
|
||
if (isWindow && typeof ret !== 'number') {
|
||
var d = window.document;
|
||
// ie6,7,8 standard mode
|
||
if (document.compatMode === 'CSS1Compat') {
|
||
ret = d.documentElement[method];
|
||
} else {
|
||
// quirks mode
|
||
ret = d.body[method];
|
||
}
|
||
}
|
||
return ret;
|
||
}
|
||
|
||
// 获取元素top,left,bottom的绝对位置
|
||
function getOffset(element, target) {
|
||
var el_rect = element.getBoundingClientRect();
|
||
var target_rect = target === window ? {
|
||
top: 0,
|
||
left: 0,
|
||
bottom: window.innerHeight
|
||
} : target.getBoundingClientRect();
|
||
var clientTop = element.clientTop || 0;
|
||
var clientLeft = element.clientLeft || 0;
|
||
|
||
var scrollTop = getScroll(target, true);
|
||
var scrollLeft = getScroll(target, false);
|
||
var topOffset = scrollTop - target_rect.top;
|
||
var leftOffset = scrollLeft - target_rect.left;
|
||
return {
|
||
top: el_rect.top + topOffset - clientTop,
|
||
left: el_rect.left + leftOffset - clientLeft,
|
||
bottom: el_rect.bottom + topOffset - clientTop
|
||
};
|
||
}
|
||
|
||
function getViewport() {
|
||
if (document.compatMode == 'BackCompat') {
|
||
return {
|
||
width: document.body.clientWidth,
|
||
height: document.body.clientHeight
|
||
};
|
||
}
|
||
return {
|
||
width: document.documentElement.clientWidth,
|
||
height: document.documentElement.clientHeight
|
||
};
|
||
}
|
||
|
||
// 判断参数是否是其中之一
|
||
function oneOf(value, validList) {
|
||
for (var i = 0; i < validList.length; i++) {
|
||
if (value === validList[i]) {
|
||
return true;
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
|
||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||
function hasOwn(obj, key) {
|
||
return hasOwnProperty.call(obj, key);
|
||
}
|
||
|
||
// 将元素滚动到指定位置
|
||
function scrollTo(element, to, duration) {
|
||
var requestAnimationFrame = window.requestAnimationFrame || function (func) {
|
||
return setTimeout(function () {
|
||
func && func();
|
||
}, 10);
|
||
};
|
||
if (duration <= 0) {
|
||
element.scrollTop = to;
|
||
return;
|
||
}
|
||
var difference = to - element.scrollTop;
|
||
var perTick = difference / duration * 10;
|
||
requestAnimationFrame(function () {
|
||
element.scrollTop += perTick;
|
||
if (element.scrollTop === to) {
|
||
return;
|
||
}
|
||
scrollTo(element, to, duration - 10);
|
||
});
|
||
}
|
||
|
||
var noop = exports.noop = function noop() {
|
||
// 空函数
|
||
};
|
||
|
||
/***/ }),
|
||
/* 2 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var global = __webpack_require__(20);
|
||
var core = __webpack_require__(33);
|
||
var hide = __webpack_require__(86);
|
||
var redefine = __webpack_require__(90);
|
||
var ctx = __webpack_require__(91);
|
||
var PROTOTYPE = 'prototype';
|
||
|
||
var $export = function (type, name, source) {
|
||
var IS_FORCED = type & $export.F;
|
||
var IS_GLOBAL = type & $export.G;
|
||
var IS_STATIC = type & $export.S;
|
||
var IS_PROTO = type & $export.P;
|
||
var IS_BIND = type & $export.B;
|
||
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
|
||
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
|
||
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
|
||
var key, own, out, exp;
|
||
if (IS_GLOBAL) source = name;
|
||
for (key in source) {
|
||
// contains in native
|
||
own = !IS_FORCED && target && target[key] !== undefined;
|
||
// export native or passed
|
||
out = (own ? target : source)[key];
|
||
// bind timers to global for call from export context
|
||
exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
|
||
// extend global
|
||
if (target) redefine(target, key, out, type & $export.U);
|
||
// export
|
||
if (exports[key] != out) hide(exports, key, exp);
|
||
if (IS_PROTO && expProto[key] != out) expProto[key] = out;
|
||
}
|
||
};
|
||
global.core = core;
|
||
// type bitmap
|
||
$export.F = 1; // forced
|
||
$export.G = 2; // global
|
||
$export.S = 4; // static
|
||
$export.P = 8; // proto
|
||
$export.B = 16; // bind
|
||
$export.W = 32; // wrap
|
||
$export.U = 64; // safe
|
||
$export.R = 128; // real proto method for `library`
|
||
module.exports = $export;
|
||
|
||
|
||
/***/ }),
|
||
/* 3 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _icon = __webpack_require__(217);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _icon2.default;
|
||
|
||
/***/ }),
|
||
/* 4 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
/* WEBPACK VAR INJECTION */(function(process) {
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
||
|
||
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; };
|
||
|
||
exports.convertFieldsError = convertFieldsError;
|
||
exports.format = format;
|
||
exports.isEmptyValue = isEmptyValue;
|
||
exports.isEmptyObject = isEmptyObject;
|
||
exports.asyncMap = asyncMap;
|
||
exports.complementError = complementError;
|
||
exports.deepMerge = deepMerge;
|
||
/* eslint no-console:0 */
|
||
|
||
var formatRegExp = /%[sdj%]/g;
|
||
|
||
var warning = exports.warning = function warning() {};
|
||
|
||
// don't print warning message when in production env or node runtime
|
||
if (process.env.NODE_ENV !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
|
||
exports.warning = warning = function warning(type, errors) {
|
||
if (typeof console !== 'undefined' && console.warn) {
|
||
if (errors.every(function (e) {
|
||
return typeof e === 'string';
|
||
})) {
|
||
console.warn(type, errors);
|
||
}
|
||
}
|
||
};
|
||
}
|
||
|
||
function convertFieldsError(errors) {
|
||
if (!errors || !errors.length) return null;
|
||
var fields = {};
|
||
errors.forEach(function (error) {
|
||
var field = error.field;
|
||
fields[field] = fields[field] || [];
|
||
fields[field].push(error);
|
||
});
|
||
return fields;
|
||
}
|
||
|
||
function format() {
|
||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||
args[_key] = arguments[_key];
|
||
}
|
||
|
||
var i = 1;
|
||
var f = args[0];
|
||
var len = args.length;
|
||
if (typeof f === 'function') {
|
||
return f.apply(null, args.slice(1));
|
||
}
|
||
if (typeof f === 'string') {
|
||
var str = String(f).replace(formatRegExp, function (x) {
|
||
if (x === '%%') {
|
||
return '%';
|
||
}
|
||
if (i >= len) {
|
||
return x;
|
||
}
|
||
switch (x) {
|
||
case '%s':
|
||
return String(args[i++]);
|
||
case '%d':
|
||
return Number(args[i++]);
|
||
case '%j':
|
||
try {
|
||
return JSON.stringify(args[i++]);
|
||
} catch (_) {
|
||
return '[Circular]';
|
||
}
|
||
break;
|
||
default:
|
||
return x;
|
||
}
|
||
});
|
||
for (var arg = args[i]; i < len; arg = args[++i]) {
|
||
str += ' ' + arg;
|
||
}
|
||
return str;
|
||
}
|
||
return f;
|
||
}
|
||
|
||
function isNativeStringType(type) {
|
||
return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
|
||
}
|
||
|
||
function isEmptyValue(value, type) {
|
||
if (value === undefined || value === null) {
|
||
return true;
|
||
}
|
||
if (type === 'array' && Array.isArray(value) && !value.length) {
|
||
return true;
|
||
}
|
||
if (isNativeStringType(type) && typeof value === 'string' && !value) {
|
||
return true;
|
||
}
|
||
return false;
|
||
}
|
||
|
||
function isEmptyObject(obj) {
|
||
return Object.keys(obj).length === 0;
|
||
}
|
||
|
||
function asyncParallelArray(arr, func, callback) {
|
||
var results = [];
|
||
var total = 0;
|
||
var arrLength = arr.length;
|
||
|
||
function count(errors) {
|
||
results.push.apply(results, errors);
|
||
total++;
|
||
if (total === arrLength) {
|
||
callback(results);
|
||
}
|
||
}
|
||
|
||
arr.forEach(function (a) {
|
||
func(a, count);
|
||
});
|
||
}
|
||
|
||
function asyncSerialArray(arr, func, callback) {
|
||
var index = 0;
|
||
var arrLength = arr.length;
|
||
|
||
function next(errors) {
|
||
if (errors && errors.length) {
|
||
callback(errors);
|
||
return;
|
||
}
|
||
var original = index;
|
||
index = index + 1;
|
||
if (original < arrLength) {
|
||
func(arr[original], next);
|
||
} else {
|
||
callback([]);
|
||
}
|
||
}
|
||
|
||
next([]);
|
||
}
|
||
|
||
function flattenObjArr(objArr) {
|
||
var ret = [];
|
||
Object.keys(objArr).forEach(function (k) {
|
||
ret.push.apply(ret, objArr[k]);
|
||
});
|
||
return ret;
|
||
}
|
||
|
||
function asyncMap(objArr, option, func, callback) {
|
||
if (option.first) {
|
||
var flattenArr = flattenObjArr(objArr);
|
||
return asyncSerialArray(flattenArr, func, callback);
|
||
}
|
||
var firstFields = option.firstFields || [];
|
||
if (firstFields === true) {
|
||
firstFields = Object.keys(objArr);
|
||
}
|
||
var objArrKeys = Object.keys(objArr);
|
||
var objArrLength = objArrKeys.length;
|
||
var total = 0;
|
||
var results = [];
|
||
var pending = new Promise(function (resolve, reject) {
|
||
var next = function next(errors) {
|
||
results.push.apply(results, errors);
|
||
total++;
|
||
if (total === objArrLength) {
|
||
callback(results);
|
||
return results.length ? reject({ errors: results, fields: convertFieldsError(results) }) : resolve();
|
||
}
|
||
};
|
||
objArrKeys.forEach(function (key) {
|
||
var arr = objArr[key];
|
||
if (firstFields.indexOf(key) !== -1) {
|
||
asyncSerialArray(arr, func, next);
|
||
} else {
|
||
asyncParallelArray(arr, func, next);
|
||
}
|
||
});
|
||
});
|
||
pending['catch'](function (e) {
|
||
return e;
|
||
});
|
||
return pending;
|
||
}
|
||
|
||
function complementError(rule) {
|
||
return function (oe) {
|
||
if (oe && oe.message) {
|
||
oe.field = oe.field || rule.fullField;
|
||
return oe;
|
||
}
|
||
return {
|
||
message: typeof oe === 'function' ? oe() : oe,
|
||
field: oe.field || rule.fullField
|
||
};
|
||
};
|
||
}
|
||
|
||
function deepMerge(target, source) {
|
||
if (source) {
|
||
for (var s in source) {
|
||
if (source.hasOwnProperty(s)) {
|
||
var value = source[s];
|
||
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && _typeof(target[s]) === 'object') {
|
||
target[s] = _extends({}, target[s], value);
|
||
} else {
|
||
target[s] = value;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return target;
|
||
}
|
||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(431)))
|
||
|
||
/***/ }),
|
||
/* 5 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
function _broadcast(componentName, eventName, params) {
|
||
this.$children.forEach(function (child) {
|
||
var name = child.$options.name;
|
||
|
||
if (name === componentName) {
|
||
child.$emit.apply(child, [eventName].concat(params));
|
||
} else {
|
||
// todo 如果 params 是空数组,接收到的会是 undefined
|
||
_broadcast.apply(child, [componentName, eventName].concat([params]));
|
||
}
|
||
});
|
||
}
|
||
exports.default = {
|
||
methods: {
|
||
dispatch: function dispatch(componentName, eventName, params) {
|
||
var parent = this.$parent || this.$root;
|
||
var name = parent.$options.name;
|
||
|
||
while (parent && (!name || name !== componentName)) {
|
||
parent = parent.$parent;
|
||
|
||
if (parent) {
|
||
name = parent.$options.name;
|
||
}
|
||
}
|
||
if (parent) {
|
||
parent.$emit.apply(parent, [eventName].concat(params));
|
||
}
|
||
},
|
||
broadcast: function broadcast(componentName, eventName, params) {
|
||
_broadcast.call(this, componentName, eventName, params);
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 6 */
|
||
/***/ (function(module, exports) {
|
||
|
||
var core = module.exports = { version: '2.6.11' };
|
||
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
|
||
|
||
|
||
/***/ }),
|
||
/* 7 */
|
||
/***/ (function(module, exports) {
|
||
|
||
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
||
var global = module.exports = typeof window != 'undefined' && window.Math == Math
|
||
? window : typeof self != 'undefined' && self.Math == Math ? self
|
||
// eslint-disable-next-line no-new-func
|
||
: Function('return this')();
|
||
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
|
||
|
||
|
||
/***/ }),
|
||
/* 8 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var store = __webpack_require__(71)('wks');
|
||
var uid = __webpack_require__(54);
|
||
var Symbol = __webpack_require__(7).Symbol;
|
||
var USE_SYMBOL = typeof Symbol == 'function';
|
||
|
||
var $exports = module.exports = function (name) {
|
||
return store[name] || (store[name] =
|
||
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
|
||
};
|
||
|
||
$exports.store = store;
|
||
|
||
|
||
/***/ }),
|
||
/* 9 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _required = __webpack_require__(139);
|
||
|
||
var _required2 = _interopRequireDefault(_required);
|
||
|
||
var _whitespace = __webpack_require__(434);
|
||
|
||
var _whitespace2 = _interopRequireDefault(_whitespace);
|
||
|
||
var _type = __webpack_require__(435);
|
||
|
||
var _type2 = _interopRequireDefault(_type);
|
||
|
||
var _range = __webpack_require__(436);
|
||
|
||
var _range2 = _interopRequireDefault(_range);
|
||
|
||
var _enum = __webpack_require__(437);
|
||
|
||
var _enum2 = _interopRequireDefault(_enum);
|
||
|
||
var _pattern = __webpack_require__(438);
|
||
|
||
var _pattern2 = _interopRequireDefault(_pattern);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
exports['default'] = {
|
||
required: _required2['default'],
|
||
whitespace: _whitespace2['default'],
|
||
type: _type2['default'],
|
||
range: _range2['default'],
|
||
'enum': _enum2['default'],
|
||
pattern: _pattern2['default']
|
||
};
|
||
|
||
/***/ }),
|
||
/* 10 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = function (exec) {
|
||
try {
|
||
return !!exec();
|
||
} catch (e) {
|
||
return true;
|
||
}
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 11 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = function (it) {
|
||
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 12 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _typeof2 = __webpack_require__(31);
|
||
|
||
var _typeof3 = _interopRequireDefault(_typeof2);
|
||
|
||
var _ = __webpack_require__(113);
|
||
|
||
var _watch = __webpack_require__(114);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
beforeCreate: function beforeCreate() {
|
||
// 如果存在vue-i18n就不自己搞watch了
|
||
var $t = this.$t;
|
||
var $i18n = this.$i18n;
|
||
if (typeof $t !== 'function' || (typeof $i18n === 'undefined' ? 'undefined' : (0, _typeof3.default)($i18n)) !== 'object') {
|
||
(0, _watch.subscribeDataChanging)(this);
|
||
}
|
||
},
|
||
|
||
methods: {
|
||
t: function t() {
|
||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||
args[_key] = arguments[_key];
|
||
}
|
||
|
||
return _.t.apply(this, args);
|
||
}
|
||
},
|
||
beforeDestory: function beforeDestory() {
|
||
(0, _watch.unsubscribeDataChanging)(this);
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 13 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var fails = __webpack_require__(10);
|
||
|
||
module.exports = function (method, arg) {
|
||
return !!method && fails(function () {
|
||
// eslint-disable-next-line no-useless-call
|
||
arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
|
||
});
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 14 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var global = __webpack_require__(7);
|
||
var core = __webpack_require__(6);
|
||
var ctx = __webpack_require__(50);
|
||
var hide = __webpack_require__(24);
|
||
var has = __webpack_require__(27);
|
||
var PROTOTYPE = 'prototype';
|
||
|
||
var $export = function (type, name, source) {
|
||
var IS_FORCED = type & $export.F;
|
||
var IS_GLOBAL = type & $export.G;
|
||
var IS_STATIC = type & $export.S;
|
||
var IS_PROTO = type & $export.P;
|
||
var IS_BIND = type & $export.B;
|
||
var IS_WRAP = type & $export.W;
|
||
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
|
||
var expProto = exports[PROTOTYPE];
|
||
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
|
||
var key, own, out;
|
||
if (IS_GLOBAL) source = name;
|
||
for (key in source) {
|
||
// contains in native
|
||
own = !IS_FORCED && target && target[key] !== undefined;
|
||
if (own && has(exports, key)) continue;
|
||
// export native or passed
|
||
out = own ? target[key] : source[key];
|
||
// prevent global pollution for namespaces
|
||
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
|
||
// bind timers to global for call from export context
|
||
: IS_BIND && own ? ctx(out, global)
|
||
// wrap global constructors for prevent change them in library
|
||
: IS_WRAP && target[key] == out ? (function (C) {
|
||
var F = function (a, b, c) {
|
||
if (this instanceof C) {
|
||
switch (arguments.length) {
|
||
case 0: return new C();
|
||
case 1: return new C(a);
|
||
case 2: return new C(a, b);
|
||
} return new C(a, b, c);
|
||
} return C.apply(this, arguments);
|
||
};
|
||
F[PROTOTYPE] = C[PROTOTYPE];
|
||
return F;
|
||
// make static versions for prototype methods
|
||
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
|
||
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
|
||
if (IS_PROTO) {
|
||
(exports.virtual || (exports.virtual = {}))[key] = out;
|
||
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
|
||
if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
|
||
}
|
||
}
|
||
};
|
||
// type bitmap
|
||
$export.F = 1; // forced
|
||
$export.G = 2; // global
|
||
$export.S = 4; // static
|
||
$export.P = 8; // proto
|
||
$export.B = 16; // bind
|
||
$export.W = 32; // wrap
|
||
$export.U = 64; // safe
|
||
$export.R = 128; // real proto method for `library`
|
||
module.exports = $export;
|
||
|
||
|
||
/***/ }),
|
||
/* 15 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// most Object methods by ES6 should accept primitives
|
||
var $export = __webpack_require__(2);
|
||
var core = __webpack_require__(33);
|
||
var fails = __webpack_require__(10);
|
||
module.exports = function (KEY, exec) {
|
||
var fn = (core.Object || {})[KEY] || Object[KEY];
|
||
var exp = {};
|
||
exp[KEY] = exec(fn);
|
||
$export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 16 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// Thank's IE8 for his funny defineProperty
|
||
module.exports = !__webpack_require__(10)(function () {
|
||
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 17 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var isObject = __webpack_require__(25);
|
||
module.exports = function (it) {
|
||
if (!isObject(it)) throw TypeError(it + ' is not an object!');
|
||
return it;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 18 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// Thank's IE8 for his funny defineProperty
|
||
module.exports = !__webpack_require__(26)(function () {
|
||
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 19 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
/**
|
||
* @ignore
|
||
* some key-codes definition and utils from closure-library
|
||
* @author yiminghe@gmail.com
|
||
*/
|
||
|
||
var KeyCode = {
|
||
|
||
/**
|
||
* MAC_ENTER
|
||
*/
|
||
MAC_ENTER: 3,
|
||
|
||
/**
|
||
* BACKSPACE
|
||
*/
|
||
BACKSPACE: 8,
|
||
|
||
/**
|
||
* TAB
|
||
*/
|
||
TAB: 9,
|
||
|
||
/**
|
||
* NUMLOCK on FF/Safari Mac
|
||
*/
|
||
NUM_CENTER: 12, // NUMLOCK on FF/Safari Mac
|
||
/**
|
||
* ENTER
|
||
*/
|
||
ENTER: 13,
|
||
|
||
/**
|
||
* SHIFT
|
||
*/
|
||
SHIFT: 16,
|
||
|
||
/**
|
||
* CTRL
|
||
*/
|
||
CTRL: 17,
|
||
|
||
/**
|
||
* ALT
|
||
*/
|
||
ALT: 18,
|
||
|
||
/**
|
||
* PAUSE
|
||
*/
|
||
PAUSE: 19,
|
||
|
||
/**
|
||
* CAPS_LOCK
|
||
*/
|
||
CAPS_LOCK: 20,
|
||
|
||
/**
|
||
* ESC
|
||
*/
|
||
ESC: 27,
|
||
|
||
/**
|
||
* SPACE
|
||
*/
|
||
SPACE: 32,
|
||
|
||
/**
|
||
* PAGE_UP
|
||
*/
|
||
PAGE_UP: 33, // also NUM_NORTH_EAST
|
||
/**
|
||
* PAGE_DOWN
|
||
*/
|
||
PAGE_DOWN: 34, // also NUM_SOUTH_EAST
|
||
/**
|
||
* END
|
||
*/
|
||
END: 35, // also NUM_SOUTH_WEST
|
||
/**
|
||
* HOME
|
||
*/
|
||
HOME: 36, // also NUM_NORTH_WEST
|
||
/**
|
||
* LEFT
|
||
*/
|
||
LEFT: 37, // also NUM_WEST
|
||
/**
|
||
* UP
|
||
*/
|
||
UP: 38, // also NUM_NORTH
|
||
/**
|
||
* RIGHT
|
||
*/
|
||
RIGHT: 39, // also NUM_EAST
|
||
/**
|
||
* DOWN
|
||
*/
|
||
DOWN: 40, // also NUM_SOUTH
|
||
/**
|
||
* PRINT_SCREEN
|
||
*/
|
||
PRINT_SCREEN: 44,
|
||
|
||
/**
|
||
* INSERT
|
||
*/
|
||
INSERT: 45, // also NUM_INSERT
|
||
/**
|
||
* DELETE
|
||
*/
|
||
DELETE: 46, // also NUM_DELETE
|
||
/**
|
||
* ZERO
|
||
*/
|
||
ZERO: 48,
|
||
|
||
/**
|
||
* ONE
|
||
*/
|
||
ONE: 49,
|
||
|
||
/**
|
||
* TWO
|
||
*/
|
||
TWO: 50,
|
||
|
||
/**
|
||
* THREE
|
||
*/
|
||
THREE: 51,
|
||
|
||
/**
|
||
* FOUR
|
||
*/
|
||
FOUR: 52,
|
||
|
||
/**
|
||
* FIVE
|
||
*/
|
||
FIVE: 53,
|
||
|
||
/**
|
||
* SIX
|
||
*/
|
||
SIX: 54,
|
||
|
||
/**
|
||
* SEVEN
|
||
*/
|
||
SEVEN: 55,
|
||
|
||
/**
|
||
* EIGHT
|
||
*/
|
||
EIGHT: 56,
|
||
|
||
/**
|
||
* NINE
|
||
*/
|
||
NINE: 57,
|
||
|
||
/**
|
||
* QUESTION_MARK
|
||
*/
|
||
QUESTION_MARK: 63, // needs localization
|
||
/**
|
||
* A
|
||
*/
|
||
A: 65,
|
||
|
||
/**
|
||
* B
|
||
*/
|
||
B: 66,
|
||
|
||
/**
|
||
* C
|
||
*/
|
||
C: 67,
|
||
|
||
/**
|
||
* D
|
||
*/
|
||
D: 68,
|
||
|
||
/**
|
||
* E
|
||
*/
|
||
E: 69,
|
||
|
||
/**
|
||
* F
|
||
*/
|
||
F: 70,
|
||
|
||
/**
|
||
* G
|
||
*/
|
||
G: 71,
|
||
|
||
/**
|
||
* H
|
||
*/
|
||
H: 72,
|
||
|
||
/**
|
||
* I
|
||
*/
|
||
I: 73,
|
||
|
||
/**
|
||
* J
|
||
*/
|
||
J: 74,
|
||
|
||
/**
|
||
* K
|
||
*/
|
||
K: 75,
|
||
|
||
/**
|
||
* L
|
||
*/
|
||
L: 76,
|
||
|
||
/**
|
||
* M
|
||
*/
|
||
M: 77,
|
||
|
||
/**
|
||
* N
|
||
*/
|
||
N: 78,
|
||
|
||
/**
|
||
* O
|
||
*/
|
||
O: 79,
|
||
|
||
/**
|
||
* P
|
||
*/
|
||
P: 80,
|
||
|
||
/**
|
||
* Q
|
||
*/
|
||
Q: 81,
|
||
|
||
/**
|
||
* R
|
||
*/
|
||
R: 82,
|
||
|
||
/**
|
||
* S
|
||
*/
|
||
S: 83,
|
||
|
||
/**
|
||
* T
|
||
*/
|
||
T: 84,
|
||
|
||
/**
|
||
* U
|
||
*/
|
||
U: 85,
|
||
|
||
/**
|
||
* V
|
||
*/
|
||
V: 86,
|
||
|
||
/**
|
||
* W
|
||
*/
|
||
W: 87,
|
||
|
||
/**
|
||
* X
|
||
*/
|
||
X: 88,
|
||
|
||
/**
|
||
* Y
|
||
*/
|
||
Y: 89,
|
||
|
||
/**
|
||
* Z
|
||
*/
|
||
Z: 90,
|
||
|
||
/**
|
||
* META
|
||
*/
|
||
META: 91, // WIN_KEY_LEFT
|
||
/**
|
||
* WIN_KEY_RIGHT
|
||
*/
|
||
WIN_KEY_RIGHT: 92,
|
||
|
||
/**
|
||
* CONTEXT_MENU
|
||
*/
|
||
CONTEXT_MENU: 93,
|
||
|
||
/**
|
||
* NUM_ZERO
|
||
*/
|
||
NUM_ZERO: 96,
|
||
|
||
/**
|
||
* NUM_ONE
|
||
*/
|
||
NUM_ONE: 97,
|
||
|
||
/**
|
||
* NUM_TWO
|
||
*/
|
||
NUM_TWO: 98,
|
||
|
||
/**
|
||
* NUM_THREE
|
||
*/
|
||
NUM_THREE: 99,
|
||
|
||
/**
|
||
* NUM_FOUR
|
||
*/
|
||
NUM_FOUR: 100,
|
||
|
||
/**
|
||
* NUM_FIVE
|
||
*/
|
||
NUM_FIVE: 101,
|
||
|
||
/**
|
||
* NUM_SIX
|
||
*/
|
||
NUM_SIX: 102,
|
||
|
||
/**
|
||
* NUM_SEVEN
|
||
*/
|
||
NUM_SEVEN: 103,
|
||
|
||
/**
|
||
* NUM_EIGHT
|
||
*/
|
||
NUM_EIGHT: 104,
|
||
|
||
/**
|
||
* NUM_NINE
|
||
*/
|
||
NUM_NINE: 105,
|
||
|
||
/**
|
||
* NUM_MULTIPLY
|
||
*/
|
||
NUM_MULTIPLY: 106,
|
||
|
||
/**
|
||
* NUM_PLUS
|
||
*/
|
||
NUM_PLUS: 107,
|
||
|
||
/**
|
||
* NUM_MINUS
|
||
*/
|
||
NUM_MINUS: 109,
|
||
|
||
/**
|
||
* NUM_PERIOD
|
||
*/
|
||
NUM_PERIOD: 110,
|
||
|
||
/**
|
||
* NUM_DIVISION
|
||
*/
|
||
NUM_DIVISION: 111,
|
||
|
||
/**
|
||
* F1
|
||
*/
|
||
F1: 112,
|
||
|
||
/**
|
||
* F2
|
||
*/
|
||
F2: 113,
|
||
|
||
/**
|
||
* F3
|
||
*/
|
||
F3: 114,
|
||
|
||
/**
|
||
* F4
|
||
*/
|
||
F4: 115,
|
||
|
||
/**
|
||
* F5
|
||
*/
|
||
F5: 116,
|
||
|
||
/**
|
||
* F6
|
||
*/
|
||
F6: 117,
|
||
|
||
/**
|
||
* F7
|
||
*/
|
||
F7: 118,
|
||
|
||
/**
|
||
* F8
|
||
*/
|
||
F8: 119,
|
||
|
||
/**
|
||
* F9
|
||
*/
|
||
F9: 120,
|
||
|
||
/**
|
||
* F10
|
||
*/
|
||
F10: 121,
|
||
|
||
/**
|
||
* F11
|
||
*/
|
||
F11: 122,
|
||
|
||
/**
|
||
* F12
|
||
*/
|
||
F12: 123,
|
||
|
||
/**
|
||
* NUMLOCK
|
||
*/
|
||
NUMLOCK: 144,
|
||
|
||
/**
|
||
* SEMICOLON
|
||
*/
|
||
SEMICOLON: 186, // needs localization
|
||
/**
|
||
* DASH
|
||
*/
|
||
DASH: 189, // needs localization
|
||
/**
|
||
* EQUALS
|
||
*/
|
||
EQUALS: 187, // needs localization
|
||
/**
|
||
* COMMA
|
||
*/
|
||
COMMA: 188, // needs localization
|
||
/**
|
||
* PERIOD
|
||
*/
|
||
PERIOD: 190, // needs localization
|
||
/**
|
||
* SLASH
|
||
*/
|
||
SLASH: 191, // needs localization
|
||
/**
|
||
* APOSTROPHE
|
||
*/
|
||
APOSTROPHE: 192, // needs localization
|
||
/**
|
||
* SINGLE_QUOTE
|
||
*/
|
||
SINGLE_QUOTE: 222, // needs localization
|
||
/**
|
||
* OPEN_SQUARE_BRACKET
|
||
*/
|
||
OPEN_SQUARE_BRACKET: 219, // needs localization
|
||
/**
|
||
* BACKSLASH
|
||
*/
|
||
BACKSLASH: 220, // needs localization
|
||
/**
|
||
* CLOSE_SQUARE_BRACKET
|
||
*/
|
||
CLOSE_SQUARE_BRACKET: 221, // needs localization
|
||
/**
|
||
* WIN_KEY
|
||
*/
|
||
WIN_KEY: 224,
|
||
|
||
/**
|
||
* MAC_FF_META
|
||
*/
|
||
MAC_FF_META: 224, // Firefox (Gecko) fires this for the meta key instead of 91
|
||
/**
|
||
* WIN_IME
|
||
*/
|
||
WIN_IME: 229
|
||
};
|
||
|
||
/*
|
||
whether text and modified key is entered at the same time.
|
||
*/
|
||
KeyCode.isTextModifyingKeyEvent = function isTextModifyingKeyEvent(e) {
|
||
var keyCode = e.keyCode;
|
||
if (e.altKey && !e.ctrlKey || e.metaKey
|
||
// Function keys don't generate text
|
||
|| keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
|
||
return false;
|
||
}
|
||
|
||
// The following keys are quite harmless, even in combination with
|
||
// CTRL, ALT or SHIFT.
|
||
switch (keyCode) {
|
||
case KeyCode.ALT:
|
||
case KeyCode.CAPS_LOCK:
|
||
case KeyCode.CONTEXT_MENU:
|
||
case KeyCode.CTRL:
|
||
case KeyCode.DOWN:
|
||
case KeyCode.END:
|
||
case KeyCode.ESC:
|
||
case KeyCode.HOME:
|
||
case KeyCode.INSERT:
|
||
case KeyCode.LEFT:
|
||
case KeyCode.MAC_FF_META:
|
||
case KeyCode.META:
|
||
case KeyCode.NUMLOCK:
|
||
case KeyCode.NUM_CENTER:
|
||
case KeyCode.PAGE_DOWN:
|
||
case KeyCode.PAGE_UP:
|
||
case KeyCode.PAUSE:
|
||
case KeyCode.PRINT_SCREEN:
|
||
case KeyCode.RIGHT:
|
||
case KeyCode.SHIFT:
|
||
case KeyCode.UP:
|
||
case KeyCode.WIN_KEY:
|
||
case KeyCode.WIN_KEY_RIGHT:
|
||
return false;
|
||
default:
|
||
return true;
|
||
}
|
||
};
|
||
|
||
/*
|
||
whether character is entered.
|
||
*/
|
||
KeyCode.isCharacterKey = function isCharacterKey(keyCode) {
|
||
if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
|
||
return true;
|
||
}
|
||
|
||
if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
|
||
return true;
|
||
}
|
||
|
||
if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
|
||
return true;
|
||
}
|
||
|
||
// Safari sends zero key code for non-latin characters.
|
||
if (window.navigation.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
|
||
return true;
|
||
}
|
||
|
||
switch (keyCode) {
|
||
case KeyCode.SPACE:
|
||
case KeyCode.QUESTION_MARK:
|
||
case KeyCode.NUM_PLUS:
|
||
case KeyCode.NUM_MINUS:
|
||
case KeyCode.NUM_PERIOD:
|
||
case KeyCode.NUM_DIVISION:
|
||
case KeyCode.SEMICOLON:
|
||
case KeyCode.DASH:
|
||
case KeyCode.EQUALS:
|
||
case KeyCode.COMMA:
|
||
case KeyCode.PERIOD:
|
||
case KeyCode.SLASH:
|
||
case KeyCode.APOSTROPHE:
|
||
case KeyCode.SINGLE_QUOTE:
|
||
case KeyCode.OPEN_SQUARE_BRACKET:
|
||
case KeyCode.BACKSLASH:
|
||
case KeyCode.CLOSE_SQUARE_BRACKET:
|
||
return true;
|
||
default:
|
||
return false;
|
||
}
|
||
};
|
||
|
||
exports.default = KeyCode;
|
||
|
||
/***/ }),
|
||
/* 20 */
|
||
/***/ (function(module, exports) {
|
||
|
||
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
||
var global = module.exports = typeof window != 'undefined' && window.Math == Math
|
||
? window : typeof self != 'undefined' && self.Math == Math ? self
|
||
// eslint-disable-next-line no-new-func
|
||
: Function('return this')();
|
||
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
|
||
|
||
|
||
/***/ }),
|
||
/* 21 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var anObject = __webpack_require__(17);
|
||
var IE8_DOM_DEFINE = __webpack_require__(102);
|
||
var toPrimitive = __webpack_require__(68);
|
||
var dP = Object.defineProperty;
|
||
|
||
exports.f = __webpack_require__(18) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
|
||
anObject(O);
|
||
P = toPrimitive(P, true);
|
||
anObject(Attributes);
|
||
if (IE8_DOM_DEFINE) try {
|
||
return dP(O, P, Attributes);
|
||
} catch (e) { /* empty */ }
|
||
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
|
||
if ('value' in Attributes) O[P] = Attributes.value;
|
||
return O;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 22 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// to indexed object, toObject with fallback for non-array-like ES3 strings
|
||
var IObject = __webpack_require__(46);
|
||
var defined = __webpack_require__(48);
|
||
module.exports = function (it) {
|
||
return IObject(defined(it));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 23 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 7.1.13 ToObject(argument)
|
||
var defined = __webpack_require__(48);
|
||
module.exports = function (it) {
|
||
return Object(defined(it));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 24 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var dP = __webpack_require__(21);
|
||
var createDesc = __webpack_require__(52);
|
||
module.exports = __webpack_require__(18) ? function (object, key, value) {
|
||
return dP.f(object, key, createDesc(1, value));
|
||
} : function (object, key, value) {
|
||
object[key] = value;
|
||
return object;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 25 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = function (it) {
|
||
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 26 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = function (exec) {
|
||
try {
|
||
return !!exec();
|
||
} catch (e) {
|
||
return true;
|
||
}
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 27 */
|
||
/***/ (function(module, exports) {
|
||
|
||
var hasOwnProperty = {}.hasOwnProperty;
|
||
module.exports = function (it, key) {
|
||
return hasOwnProperty.call(it, key);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 28 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = __WEBPACK_EXTERNAL_MODULE_28__;
|
||
|
||
/***/ }),
|
||
/* 29 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
var cache = {};
|
||
var key = 1;
|
||
exports.default = {
|
||
inserted: function inserted(el, binding) {
|
||
el.outsideKey = key++;
|
||
var self = {};
|
||
self.documentHandler = function (e) {
|
||
if (util.contains(el, e.target)) {
|
||
return false;
|
||
}
|
||
if (binding.value) {
|
||
binding.value();
|
||
}
|
||
};
|
||
cache[el.outsideKey] = self;
|
||
document.addEventListener('click', self.documentHandler);
|
||
},
|
||
unbind: function unbind(el) {
|
||
var self = cache[el.outsideKey];
|
||
if (self) {
|
||
document.removeEventListener('click', self.documentHandler);
|
||
delete cache[el.outsideKey];
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 30 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// to indexed object, toObject with fallback for non-array-like ES3 strings
|
||
var IObject = __webpack_require__(104);
|
||
var defined = __webpack_require__(53);
|
||
module.exports = function (it) {
|
||
return IObject(defined(it));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 31 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
exports.__esModule = true;
|
||
|
||
var _iterator = __webpack_require__(226);
|
||
|
||
var _iterator2 = _interopRequireDefault(_iterator);
|
||
|
||
var _symbol = __webpack_require__(235);
|
||
|
||
var _symbol2 = _interopRequireDefault(_symbol);
|
||
|
||
var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
|
||
return typeof obj === "undefined" ? "undefined" : _typeof(obj);
|
||
} : function (obj) {
|
||
return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
|
||
};
|
||
|
||
/***/ }),
|
||
/* 32 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = {};
|
||
|
||
|
||
/***/ }),
|
||
/* 33 */
|
||
/***/ (function(module, exports) {
|
||
|
||
var core = module.exports = { version: '2.6.11' };
|
||
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
|
||
|
||
|
||
/***/ }),
|
||
/* 34 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var anObject = __webpack_require__(35);
|
||
var IE8_DOM_DEFINE = __webpack_require__(87);
|
||
var toPrimitive = __webpack_require__(60);
|
||
var dP = Object.defineProperty;
|
||
|
||
exports.f = __webpack_require__(16) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
|
||
anObject(O);
|
||
P = toPrimitive(P, true);
|
||
anObject(Attributes);
|
||
if (IE8_DOM_DEFINE) try {
|
||
return dP(O, P, Attributes);
|
||
} catch (e) { /* empty */ }
|
||
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
|
||
if ('value' in Attributes) O[P] = Attributes.value;
|
||
return O;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 35 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var isObject = __webpack_require__(11);
|
||
module.exports = function (it) {
|
||
if (!isObject(it)) throw TypeError(it + ' is not an object!');
|
||
return it;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 36 */
|
||
/***/ (function(module, exports) {
|
||
|
||
var hasOwnProperty = {}.hasOwnProperty;
|
||
module.exports = function (it, key) {
|
||
return hasOwnProperty.call(it, key);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 37 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 7.1.15 ToLength
|
||
var toInteger = __webpack_require__(38);
|
||
var min = Math.min;
|
||
module.exports = function (it) {
|
||
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 38 */
|
||
/***/ (function(module, exports) {
|
||
|
||
// 7.1.4 ToInteger
|
||
var ceil = Math.ceil;
|
||
var floor = Math.floor;
|
||
module.exports = function (it) {
|
||
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 39 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 0 -> Array#forEach
|
||
// 1 -> Array#map
|
||
// 2 -> Array#filter
|
||
// 3 -> Array#some
|
||
// 4 -> Array#every
|
||
// 5 -> Array#find
|
||
// 6 -> Array#findIndex
|
||
var ctx = __webpack_require__(91);
|
||
var IObject = __webpack_require__(46);
|
||
var toObject = __webpack_require__(23);
|
||
var toLength = __webpack_require__(37);
|
||
var asc = __webpack_require__(176);
|
||
module.exports = function (TYPE, $create) {
|
||
var IS_MAP = TYPE == 1;
|
||
var IS_FILTER = TYPE == 2;
|
||
var IS_SOME = TYPE == 3;
|
||
var IS_EVERY = TYPE == 4;
|
||
var IS_FIND_INDEX = TYPE == 6;
|
||
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
||
var create = $create || asc;
|
||
return function ($this, callbackfn, that) {
|
||
var O = toObject($this);
|
||
var self = IObject(O);
|
||
var f = ctx(callbackfn, that, 3);
|
||
var length = toLength(self.length);
|
||
var index = 0;
|
||
var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
|
||
var val, res;
|
||
for (;length > index; index++) if (NO_HOLES || index in self) {
|
||
val = self[index];
|
||
res = f(val, index, O);
|
||
if (TYPE) {
|
||
if (IS_MAP) result[index] = res; // map
|
||
else if (res) switch (TYPE) {
|
||
case 3: return true; // some
|
||
case 5: return val; // find
|
||
case 6: return index; // findIndex
|
||
case 2: result.push(val); // filter
|
||
} else if (IS_EVERY) return false; // every
|
||
}
|
||
}
|
||
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
|
||
};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 40 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
|
||
var $keys = __webpack_require__(103);
|
||
var enumBugKeys = __webpack_require__(72);
|
||
|
||
module.exports = Object.keys || function keys(O) {
|
||
return $keys(O, enumBugKeys);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 41 */
|
||
/***/ (function(module, exports) {
|
||
|
||
var toString = {}.toString;
|
||
|
||
module.exports = function (it) {
|
||
return toString.call(it).slice(8, -1);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 42 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = true;
|
||
|
||
|
||
/***/ }),
|
||
/* 43 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = { "default": __webpack_require__(319), __esModule: true };
|
||
|
||
/***/ }),
|
||
/* 44 */
|
||
/***/ (function(module, exports) {
|
||
|
||
var id = 0;
|
||
var px = Math.random();
|
||
module.exports = function (key) {
|
||
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 45 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = function (it) {
|
||
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
|
||
return it;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 46 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
||
var cof = __webpack_require__(47);
|
||
// eslint-disable-next-line no-prototype-builtins
|
||
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
||
return cof(it) == 'String' ? it.split('') : Object(it);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 47 */
|
||
/***/ (function(module, exports) {
|
||
|
||
var toString = {}.toString;
|
||
|
||
module.exports = function (it) {
|
||
return toString.call(it).slice(8, -1);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 48 */
|
||
/***/ (function(module, exports) {
|
||
|
||
// 7.2.1 RequireObjectCoercible(argument)
|
||
module.exports = function (it) {
|
||
if (it == undefined) throw TypeError("Can't call method on " + it);
|
||
return it;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 49 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = { "default": __webpack_require__(202), __esModule: true };
|
||
|
||
/***/ }),
|
||
/* 50 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// optional / simple context binding
|
||
var aFunction = __webpack_require__(51);
|
||
module.exports = function (fn, that, length) {
|
||
aFunction(fn);
|
||
if (that === undefined) return fn;
|
||
switch (length) {
|
||
case 1: return function (a) {
|
||
return fn.call(that, a);
|
||
};
|
||
case 2: return function (a, b) {
|
||
return fn.call(that, a, b);
|
||
};
|
||
case 3: return function (a, b, c) {
|
||
return fn.call(that, a, b, c);
|
||
};
|
||
}
|
||
return function (/* ...args */) {
|
||
return fn.apply(that, arguments);
|
||
};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 51 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = function (it) {
|
||
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
|
||
return it;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 52 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = function (bitmap, value) {
|
||
return {
|
||
enumerable: !(bitmap & 1),
|
||
configurable: !(bitmap & 2),
|
||
writable: !(bitmap & 4),
|
||
value: value
|
||
};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 53 */
|
||
/***/ (function(module, exports) {
|
||
|
||
// 7.2.1 RequireObjectCoercible(argument)
|
||
module.exports = function (it) {
|
||
if (it == undefined) throw TypeError("Can't call method on " + it);
|
||
return it;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 54 */
|
||
/***/ (function(module, exports) {
|
||
|
||
var id = 0;
|
||
var px = Math.random();
|
||
module.exports = function (key) {
|
||
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 55 */
|
||
/***/ (function(module, exports) {
|
||
|
||
exports.f = {}.propertyIsEnumerable;
|
||
|
||
|
||
/***/ }),
|
||
/* 56 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 7.1.13 ToObject(argument)
|
||
var defined = __webpack_require__(53);
|
||
module.exports = function (it) {
|
||
return Object(defined(it));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 57 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $at = __webpack_require__(228)(true);
|
||
|
||
// 21.1.3.27 String.prototype[@@iterator]()
|
||
__webpack_require__(106)(String, 'String', function (iterated) {
|
||
this._t = String(iterated); // target
|
||
this._i = 0; // next index
|
||
// 21.1.5.2.1 %StringIteratorPrototype%.next()
|
||
}, function () {
|
||
var O = this._t;
|
||
var index = this._i;
|
||
var point;
|
||
if (index >= O.length) return { value: undefined, done: true };
|
||
point = $at(O, index);
|
||
this._i += point.length;
|
||
return { value: point, done: false };
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 58 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var def = __webpack_require__(21).f;
|
||
var has = __webpack_require__(27);
|
||
var TAG = __webpack_require__(8)('toStringTag');
|
||
|
||
module.exports = function (it, tag, stat) {
|
||
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 59 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(232);
|
||
var global = __webpack_require__(7);
|
||
var hide = __webpack_require__(24);
|
||
var Iterators = __webpack_require__(32);
|
||
var TO_STRING_TAG = __webpack_require__(8)('toStringTag');
|
||
|
||
var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
|
||
'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
|
||
'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
|
||
'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
|
||
'TextTrackList,TouchList').split(',');
|
||
|
||
for (var i = 0; i < DOMIterables.length; i++) {
|
||
var NAME = DOMIterables[i];
|
||
var Collection = global[NAME];
|
||
var proto = Collection && Collection.prototype;
|
||
if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
|
||
Iterators[NAME] = Iterators.Array;
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
/* 60 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 7.1.1 ToPrimitive(input [, PreferredType])
|
||
var isObject = __webpack_require__(11);
|
||
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
|
||
// and the second argument - flag - preferred type is a string
|
||
module.exports = function (it, S) {
|
||
if (!isObject(it)) return it;
|
||
var fn, val;
|
||
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
|
||
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
|
||
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
|
||
throw TypeError("Can't convert object to primitive value");
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 61 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var core = __webpack_require__(33);
|
||
var global = __webpack_require__(20);
|
||
var SHARED = '__core-js_shared__';
|
||
var store = global[SHARED] || (global[SHARED] = {});
|
||
|
||
(module.exports = function (key, value) {
|
||
return store[key] || (store[key] = value !== undefined ? value : {});
|
||
})('versions', []).push({
|
||
version: core.version,
|
||
mode: __webpack_require__(149) ? 'pure' : 'global',
|
||
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 62 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var shared = __webpack_require__(61)('keys');
|
||
var uid = __webpack_require__(44);
|
||
module.exports = function (key) {
|
||
return shared[key] || (shared[key] = uid(key));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 63 */
|
||
/***/ (function(module, exports) {
|
||
|
||
// IE 8- don't enum bug keys
|
||
module.exports = (
|
||
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
||
).split(',');
|
||
|
||
|
||
/***/ }),
|
||
/* 64 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var META = __webpack_require__(44)('meta');
|
||
var isObject = __webpack_require__(11);
|
||
var has = __webpack_require__(36);
|
||
var setDesc = __webpack_require__(34).f;
|
||
var id = 0;
|
||
var isExtensible = Object.isExtensible || function () {
|
||
return true;
|
||
};
|
||
var FREEZE = !__webpack_require__(10)(function () {
|
||
return isExtensible(Object.preventExtensions({}));
|
||
});
|
||
var setMeta = function (it) {
|
||
setDesc(it, META, { value: {
|
||
i: 'O' + ++id, // object ID
|
||
w: {} // weak collections IDs
|
||
} });
|
||
};
|
||
var fastKey = function (it, create) {
|
||
// return primitive with prefix
|
||
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
||
if (!has(it, META)) {
|
||
// can't set metadata to uncaught frozen object
|
||
if (!isExtensible(it)) return 'F';
|
||
// not necessary to add metadata
|
||
if (!create) return 'E';
|
||
// add missing metadata
|
||
setMeta(it);
|
||
// return object ID
|
||
} return it[META].i;
|
||
};
|
||
var getWeak = function (it, create) {
|
||
if (!has(it, META)) {
|
||
// can't set metadata to uncaught frozen object
|
||
if (!isExtensible(it)) return true;
|
||
// not necessary to add metadata
|
||
if (!create) return false;
|
||
// add missing metadata
|
||
setMeta(it);
|
||
// return hash weak collections IDs
|
||
} return it[META].w;
|
||
};
|
||
// add metadata on freeze-family methods calling
|
||
var onFreeze = function (it) {
|
||
if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
|
||
return it;
|
||
};
|
||
var meta = module.exports = {
|
||
KEY: META,
|
||
NEED: false,
|
||
fastKey: fastKey,
|
||
getWeak: getWeak,
|
||
onFreeze: onFreeze
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 65 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var $export = __webpack_require__(2);
|
||
var defined = __webpack_require__(48);
|
||
var fails = __webpack_require__(10);
|
||
var spaces = __webpack_require__(66);
|
||
var space = '[' + spaces + ']';
|
||
var non = '\u200b\u0085';
|
||
var ltrim = RegExp('^' + space + space + '*');
|
||
var rtrim = RegExp(space + space + '*$');
|
||
|
||
var exporter = function (KEY, exec, ALIAS) {
|
||
var exp = {};
|
||
var FORCE = fails(function () {
|
||
return !!spaces[KEY]() || non[KEY]() != non;
|
||
});
|
||
var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
|
||
if (ALIAS) exp[ALIAS] = fn;
|
||
$export($export.P + $export.F * FORCE, 'String', exp);
|
||
};
|
||
|
||
// 1 -> String#trimLeft
|
||
// 2 -> String#trimRight
|
||
// 3 -> String#trim
|
||
var trim = exporter.trim = function (string, TYPE) {
|
||
string = String(defined(string));
|
||
if (TYPE & 1) string = string.replace(ltrim, '');
|
||
if (TYPE & 2) string = string.replace(rtrim, '');
|
||
return string;
|
||
};
|
||
|
||
module.exports = exporter;
|
||
|
||
|
||
/***/ }),
|
||
/* 66 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
|
||
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
||
|
||
|
||
/***/ }),
|
||
/* 67 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var isObject = __webpack_require__(25);
|
||
var document = __webpack_require__(7).document;
|
||
// typeof document.createElement is 'object' in old IE
|
||
var is = isObject(document) && isObject(document.createElement);
|
||
module.exports = function (it) {
|
||
return is ? document.createElement(it) : {};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 68 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 7.1.1 ToPrimitive(input [, PreferredType])
|
||
var isObject = __webpack_require__(25);
|
||
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
|
||
// and the second argument - flag - preferred type is a string
|
||
module.exports = function (it, S) {
|
||
if (!isObject(it)) return it;
|
||
var fn, val;
|
||
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
|
||
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
|
||
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
|
||
throw TypeError("Can't convert object to primitive value");
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 69 */
|
||
/***/ (function(module, exports) {
|
||
|
||
// 7.1.4 ToInteger
|
||
var ceil = Math.ceil;
|
||
var floor = Math.floor;
|
||
module.exports = function (it) {
|
||
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 70 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var shared = __webpack_require__(71)('keys');
|
||
var uid = __webpack_require__(54);
|
||
module.exports = function (key) {
|
||
return shared[key] || (shared[key] = uid(key));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 71 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var core = __webpack_require__(6);
|
||
var global = __webpack_require__(7);
|
||
var SHARED = '__core-js_shared__';
|
||
var store = global[SHARED] || (global[SHARED] = {});
|
||
|
||
(module.exports = function (key, value) {
|
||
return store[key] || (store[key] = value !== undefined ? value : {});
|
||
})('versions', []).push({
|
||
version: core.version,
|
||
mode: __webpack_require__(42) ? 'pure' : 'global',
|
||
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 72 */
|
||
/***/ (function(module, exports) {
|
||
|
||
// IE 8- don't enum bug keys
|
||
module.exports = (
|
||
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
||
).split(',');
|
||
|
||
|
||
/***/ }),
|
||
/* 73 */
|
||
/***/ (function(module, exports) {
|
||
|
||
exports.f = Object.getOwnPropertySymbols;
|
||
|
||
|
||
/***/ }),
|
||
/* 74 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = { "default": __webpack_require__(207), __esModule: true };
|
||
|
||
/***/ }),
|
||
/* 75 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _button = __webpack_require__(220);
|
||
|
||
var _button2 = _interopRequireDefault(_button);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _button2.default;
|
||
|
||
/***/ }),
|
||
/* 76 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
exports.f = __webpack_require__(8);
|
||
|
||
|
||
/***/ }),
|
||
/* 77 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var global = __webpack_require__(7);
|
||
var core = __webpack_require__(6);
|
||
var LIBRARY = __webpack_require__(42);
|
||
var wksExt = __webpack_require__(76);
|
||
var defineProperty = __webpack_require__(21).f;
|
||
module.exports = function (name) {
|
||
var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
|
||
if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 78 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
exports.__esModule = true;
|
||
|
||
var _isIterable2 = __webpack_require__(288);
|
||
|
||
var _isIterable3 = _interopRequireDefault(_isIterable2);
|
||
|
||
var _getIterator2 = __webpack_require__(116);
|
||
|
||
var _getIterator3 = _interopRequireDefault(_getIterator2);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = function () {
|
||
function sliceIterator(arr, i) {
|
||
var _arr = [];
|
||
var _n = true;
|
||
var _d = false;
|
||
var _e = undefined;
|
||
|
||
try {
|
||
for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
||
_arr.push(_s.value);
|
||
|
||
if (i && _arr.length === i) break;
|
||
}
|
||
} catch (err) {
|
||
_d = true;
|
||
_e = err;
|
||
} finally {
|
||
try {
|
||
if (!_n && _i["return"]) _i["return"]();
|
||
} finally {
|
||
if (_d) throw _e;
|
||
}
|
||
}
|
||
|
||
return _arr;
|
||
}
|
||
|
||
return function (arr, i) {
|
||
if (Array.isArray(arr)) {
|
||
return arr;
|
||
} else if ((0, _isIterable3.default)(Object(arr))) {
|
||
return sliceIterator(arr, i);
|
||
} else {
|
||
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
||
}
|
||
};
|
||
}();
|
||
|
||
/***/ }),
|
||
/* 79 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// getting tag from 19.1.3.6 Object.prototype.toString()
|
||
var cof = __webpack_require__(41);
|
||
var TAG = __webpack_require__(8)('toStringTag');
|
||
// ES3 wrong here
|
||
var ARG = cof(function () { return arguments; }()) == 'Arguments';
|
||
|
||
// fallback for IE11 Script Access Denied error
|
||
var tryGet = function (it, key) {
|
||
try {
|
||
return it[key];
|
||
} catch (e) { /* empty */ }
|
||
};
|
||
|
||
module.exports = function (it) {
|
||
var O, T, B;
|
||
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
||
// @@toStringTag case
|
||
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
|
||
// builtinTag case
|
||
: ARG ? cof(O)
|
||
// ES3 arguments fallback
|
||
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 80 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _parseInt = __webpack_require__(118);
|
||
|
||
var _parseInt2 = _interopRequireDefault(_parseInt);
|
||
|
||
var _slicedToArray2 = __webpack_require__(78);
|
||
|
||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
computed: {
|
||
vFormat: function vFormat() {
|
||
if (this.onlyMonth) {
|
||
return 'YYYY-MM';
|
||
}
|
||
if (this.enableTime) {
|
||
if (this.enableSeconds) {
|
||
return 'YYYY-MM-DD HH:mm:ss';
|
||
}
|
||
return 'YYYY-MM-DD HH:mm';
|
||
}
|
||
return this.format;
|
||
}
|
||
},
|
||
methods: {
|
||
// 对比时间,相等 0, 小于 -1 大于 1
|
||
timeFormat: function timeFormat(time, format) {
|
||
var year = time.getFullYear();
|
||
var month = time.getMonth();
|
||
var day = time.getDate();
|
||
var hours24 = time.getHours();
|
||
var hours = hours24 % 12 === 0 ? 12 : hours24 % 12;
|
||
var minutes = time.getMinutes();
|
||
var seconds = time.getSeconds();
|
||
var milliseconds = time.getMilliseconds();
|
||
var dd = function dd(t) {
|
||
return ('0' + t).slice(-2);
|
||
};
|
||
var map = {
|
||
YYYY: year,
|
||
MM: dd(month + 1),
|
||
MMMM: this.t('el.datepicker.month' + (month + 1)),
|
||
M: month + 1,
|
||
DD: dd(day),
|
||
D: day,
|
||
HH: dd(hours24),
|
||
H: hours24,
|
||
hh: dd(hours),
|
||
h: hours,
|
||
mm: dd(minutes),
|
||
m: minutes,
|
||
ss: dd(seconds),
|
||
s: seconds,
|
||
S: milliseconds
|
||
};
|
||
return (format || this.vFormat || this.format).replace(/Y+|M+|D+|H+|h+|m+|s+|S+/g, function (str) {
|
||
return map[str];
|
||
});
|
||
},
|
||
|
||
// 判断是否同一天
|
||
isSameDay: function isSameDay(date1, date2) {
|
||
return this.timeFormat(date1, 'YYYY-MM-DD') === this.timeFormat(date2, 'YYYY-MM-DD');
|
||
},
|
||
contrastDate: function contrastDate(date1, date2) {
|
||
var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'YYYY-MM-DD HH:mm:ss';
|
||
|
||
var t1 = this.timeFormat(date1, format);
|
||
var t2 = this.timeFormat(date2, format);
|
||
if (t1 > t2) return 1;
|
||
if (t1 === t2) return 0;
|
||
return -1;
|
||
},
|
||
isEmpty: function isEmpty(val) {
|
||
if (!val) return true;
|
||
if (Array.isArray(val)) {
|
||
return val.length === 0 || !val.some(function (item) {
|
||
return item;
|
||
});
|
||
}
|
||
return false;
|
||
},
|
||
isEqual: function isEqual(val, dates) {
|
||
var _this = this;
|
||
|
||
var emptyVal = this.isEmpty(val);
|
||
var emptyDates = this.isEmpty(dates);
|
||
if (emptyVal && emptyDates) return true;
|
||
if (emptyVal && !emptyDates || !emptyVal && emptyDates) return false;
|
||
if (this.model === 'single') {
|
||
return this.contrastDate(new Date(dates), new Date(val)) === 0;
|
||
}
|
||
if (val.length !== dates.length) return false;
|
||
return val.every(function (timestamp, i) {
|
||
return _this.contrastDate(new Date(dates[i]), new Date(timestamp)) === 0;
|
||
});
|
||
},
|
||
inOnePanel: function inOnePanel(dates, format) {
|
||
var _dates = (0, _slicedToArray3.default)(dates, 2),
|
||
start = _dates[0],
|
||
end = _dates[1];
|
||
|
||
if (start && end) {
|
||
if (format.indexOf('D') !== -1) {
|
||
if (this.timeFormat(start, 'YYYYMM') === this.timeFormat(end, 'YYYYMM')) {
|
||
return true;
|
||
}
|
||
} else if (format.indexOf('M') !== -1) {
|
||
if (start.getFullYear() === end.getFullYear()) {
|
||
return true;
|
||
}
|
||
} else if ((0, _parseInt2.default)(start.getFullYear() / 10) === (0, _parseInt2.default)(end.getFullYear() / 10)) {
|
||
return true;
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 81 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
// 25.4.1.5 NewPromiseCapability(C)
|
||
var aFunction = __webpack_require__(51);
|
||
|
||
function PromiseCapability(C) {
|
||
var resolve, reject;
|
||
this.promise = new C(function ($$resolve, $$reject) {
|
||
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
||
resolve = $$resolve;
|
||
reject = $$reject;
|
||
});
|
||
this.resolve = aFunction(resolve);
|
||
this.reject = aFunction(reject);
|
||
}
|
||
|
||
module.exports.f = function (C) {
|
||
return new PromiseCapability(C);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 82 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
/**
|
||
* cssfilter
|
||
*
|
||
* @author 老雷<leizongmin@gmail.com>
|
||
*/
|
||
|
||
var DEFAULT = __webpack_require__(130);
|
||
var FilterCSS = __webpack_require__(335);
|
||
|
||
|
||
/**
|
||
* XSS过滤
|
||
*
|
||
* @param {String} css 要过滤的CSS代码
|
||
* @param {Object} options 选项:whiteList, onAttr, onIgnoreAttr
|
||
* @return {String}
|
||
*/
|
||
function filterCSS (html, options) {
|
||
var xss = new FilterCSS(options);
|
||
return xss.process(html);
|
||
}
|
||
|
||
|
||
// 输出
|
||
exports = module.exports = filterCSS;
|
||
exports.FilterCSS = FilterCSS;
|
||
for (var i in DEFAULT) exports[i] = DEFAULT[i];
|
||
|
||
// 在浏览器端使用
|
||
if (typeof window !== 'undefined') {
|
||
window.filterCSS = module.exports;
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
/* 83 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = {
|
||
indexOf: function(arr, item) {
|
||
var i, j;
|
||
if (Array.prototype.indexOf) {
|
||
return arr.indexOf(item);
|
||
}
|
||
for (i = 0, j = arr.length; i < j; i++) {
|
||
if (arr[i] === item) {
|
||
return i;
|
||
}
|
||
}
|
||
return -1;
|
||
},
|
||
forEach: function(arr, fn, scope) {
|
||
var i, j;
|
||
if (Array.prototype.forEach) {
|
||
return arr.forEach(fn, scope);
|
||
}
|
||
for (i = 0, j = arr.length; i < j; i++) {
|
||
fn.call(scope, arr[i], i, arr);
|
||
}
|
||
},
|
||
trim: function(str) {
|
||
if (String.prototype.trim) {
|
||
return str.trim();
|
||
}
|
||
return str.replace(/(^\s*)|(\s*$)/g, "");
|
||
},
|
||
spaceIndex: function(str) {
|
||
var reg = /\s|\n|\t/;
|
||
var match = reg.exec(str);
|
||
return match ? match.index : -1;
|
||
}
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 84 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _vue = __webpack_require__(28);
|
||
|
||
var _vue2 = _interopRequireDefault(_vue);
|
||
|
||
var _toast = __webpack_require__(351);
|
||
|
||
var _toast2 = _interopRequireDefault(_toast);
|
||
|
||
var _swap = __webpack_require__(354);
|
||
|
||
var _swap2 = _interopRequireDefault(_swap);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
var swapTop = null;
|
||
var swapCenter = null;
|
||
|
||
var init = function init(align, parent) {
|
||
if (!(parent instanceof _vue2.default)) {
|
||
// 使用mixin事先收集了root
|
||
parent = toast.root;
|
||
}
|
||
if (align === 'top') {
|
||
if (!swapTop) {
|
||
swapTop = new _vue2.default({
|
||
parent: parent,
|
||
components: {
|
||
swap: _swap2.default
|
||
},
|
||
render: function render(h) {
|
||
return h('swap', {
|
||
props: {
|
||
align: 'top'
|
||
}
|
||
});
|
||
}
|
||
});
|
||
var vm = swapTop.$mount();
|
||
document.body.appendChild(vm.$el);
|
||
return swapTop;
|
||
}
|
||
return swapTop;
|
||
}
|
||
if (align == 'center') {
|
||
if (!swapCenter) {
|
||
swapCenter = new _vue2.default({
|
||
parent: parent,
|
||
components: {
|
||
swap: _swap2.default
|
||
},
|
||
render: function render(h) {
|
||
return h('swap', {
|
||
props: {
|
||
align: 'center'
|
||
}
|
||
});
|
||
}
|
||
});
|
||
var _vm = swapCenter.$mount();
|
||
document.body.appendChild(_vm.$el);
|
||
return swapCenter;
|
||
}
|
||
return swapCenter;
|
||
}
|
||
};
|
||
|
||
var create = function create(option, parent) {
|
||
// 初始化
|
||
var $swap = init(option.align, parent);
|
||
|
||
var toast = new _vue2.default({
|
||
parent: $swap,
|
||
components: {
|
||
toast: _toast2.default
|
||
},
|
||
data: function data() {
|
||
return option;
|
||
},
|
||
mounted: function mounted() {
|
||
var _this = this;
|
||
|
||
setTimeout(function () {
|
||
_this.$destroy();
|
||
}, this.duration);
|
||
},
|
||
destroyed: function destroyed() {
|
||
this.onClose && this.onClose();
|
||
this.$el.remove();
|
||
},
|
||
render: function render(h) {
|
||
return h('toast', {
|
||
props: {
|
||
message: this.message,
|
||
type: this.type
|
||
}
|
||
});
|
||
}
|
||
});
|
||
|
||
toast.$mount();
|
||
$swap.$el.appendChild(toast.$el);
|
||
|
||
return function () {
|
||
toast.$destroy();
|
||
toast = null;
|
||
};
|
||
};
|
||
|
||
var param = function param(option) {
|
||
option = option || {};
|
||
option.duration = option.duration || 3000;
|
||
option.align = option.align || 'center';
|
||
option.onClose = option.onClose || util.noop;
|
||
return option;
|
||
};
|
||
|
||
var toast = function toast(message, option) {
|
||
if (!message) {
|
||
return;
|
||
}
|
||
var vm = this;
|
||
return create(util.merge(param(option), {
|
||
message: message,
|
||
type: 'info'
|
||
}), vm);
|
||
};
|
||
|
||
toast.error = function (message, option) {
|
||
if (!message) {
|
||
return;
|
||
}
|
||
return create(util.merge(param(option), {
|
||
message: message,
|
||
type: 'error'
|
||
}));
|
||
};
|
||
|
||
toast.warn = function (message, option) {
|
||
if (!message) {
|
||
return;
|
||
}
|
||
return create(util.merge(param(option), {
|
||
message: message,
|
||
type: 'warn'
|
||
}));
|
||
};
|
||
|
||
toast.success = function (message, option) {
|
||
if (!message) {
|
||
return;
|
||
}
|
||
return create(util.merge(param(option), {
|
||
message: message,
|
||
type: 'success'
|
||
}));
|
||
};
|
||
|
||
exports.default = toast;
|
||
|
||
/***/ }),
|
||
/* 85 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = { "default": __webpack_require__(373), __esModule: true };
|
||
|
||
/***/ }),
|
||
/* 86 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var dP = __webpack_require__(34);
|
||
var createDesc = __webpack_require__(89);
|
||
module.exports = __webpack_require__(16) ? function (object, key, value) {
|
||
return dP.f(object, key, createDesc(1, value));
|
||
} : function (object, key, value) {
|
||
object[key] = value;
|
||
return object;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 87 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = !__webpack_require__(16) && !__webpack_require__(10)(function () {
|
||
return Object.defineProperty(__webpack_require__(88)('div'), 'a', { get: function () { return 7; } }).a != 7;
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 88 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var isObject = __webpack_require__(11);
|
||
var document = __webpack_require__(20).document;
|
||
// typeof document.createElement is 'object' in old IE
|
||
var is = isObject(document) && isObject(document.createElement);
|
||
module.exports = function (it) {
|
||
return is ? document.createElement(it) : {};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 89 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = function (bitmap, value) {
|
||
return {
|
||
enumerable: !(bitmap & 1),
|
||
configurable: !(bitmap & 2),
|
||
writable: !(bitmap & 4),
|
||
value: value
|
||
};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 90 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var global = __webpack_require__(20);
|
||
var hide = __webpack_require__(86);
|
||
var has = __webpack_require__(36);
|
||
var SRC = __webpack_require__(44)('src');
|
||
var $toString = __webpack_require__(148);
|
||
var TO_STRING = 'toString';
|
||
var TPL = ('' + $toString).split(TO_STRING);
|
||
|
||
__webpack_require__(33).inspectSource = function (it) {
|
||
return $toString.call(it);
|
||
};
|
||
|
||
(module.exports = function (O, key, val, safe) {
|
||
var isFunction = typeof val == 'function';
|
||
if (isFunction) has(val, 'name') || hide(val, 'name', key);
|
||
if (O[key] === val) return;
|
||
if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
|
||
if (O === global) {
|
||
O[key] = val;
|
||
} else if (!safe) {
|
||
delete O[key];
|
||
hide(O, key, val);
|
||
} else if (O[key]) {
|
||
O[key] = val;
|
||
} else {
|
||
hide(O, key, val);
|
||
}
|
||
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
||
})(Function.prototype, TO_STRING, function toString() {
|
||
return typeof this == 'function' && this[SRC] || $toString.call(this);
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 91 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// optional / simple context binding
|
||
var aFunction = __webpack_require__(45);
|
||
module.exports = function (fn, that, length) {
|
||
aFunction(fn);
|
||
if (that === undefined) return fn;
|
||
switch (length) {
|
||
case 1: return function (a) {
|
||
return fn.call(that, a);
|
||
};
|
||
case 2: return function (a, b) {
|
||
return fn.call(that, a, b);
|
||
};
|
||
case 3: return function (a, b, c) {
|
||
return fn.call(that, a, b, c);
|
||
};
|
||
}
|
||
return function (/* ...args */) {
|
||
return fn.apply(that, arguments);
|
||
};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 92 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var dP = __webpack_require__(34);
|
||
var anObject = __webpack_require__(35);
|
||
var getKeys = __webpack_require__(93);
|
||
|
||
module.exports = __webpack_require__(16) ? Object.defineProperties : function defineProperties(O, Properties) {
|
||
anObject(O);
|
||
var keys = getKeys(Properties);
|
||
var length = keys.length;
|
||
var i = 0;
|
||
var P;
|
||
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
|
||
return O;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 93 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
|
||
var $keys = __webpack_require__(94);
|
||
var enumBugKeys = __webpack_require__(63);
|
||
|
||
module.exports = Object.keys || function keys(O) {
|
||
return $keys(O, enumBugKeys);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 94 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var has = __webpack_require__(36);
|
||
var toIObject = __webpack_require__(22);
|
||
var arrayIndexOf = __webpack_require__(95)(false);
|
||
var IE_PROTO = __webpack_require__(62)('IE_PROTO');
|
||
|
||
module.exports = function (object, names) {
|
||
var O = toIObject(object);
|
||
var i = 0;
|
||
var result = [];
|
||
var key;
|
||
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
|
||
// Don't enum bug & hidden keys
|
||
while (names.length > i) if (has(O, key = names[i++])) {
|
||
~arrayIndexOf(result, key) || result.push(key);
|
||
}
|
||
return result;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 95 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// false -> Array#indexOf
|
||
// true -> Array#includes
|
||
var toIObject = __webpack_require__(22);
|
||
var toLength = __webpack_require__(37);
|
||
var toAbsoluteIndex = __webpack_require__(96);
|
||
module.exports = function (IS_INCLUDES) {
|
||
return function ($this, el, fromIndex) {
|
||
var O = toIObject($this);
|
||
var length = toLength(O.length);
|
||
var index = toAbsoluteIndex(fromIndex, length);
|
||
var value;
|
||
// Array#includes uses SameValueZero equality algorithm
|
||
// eslint-disable-next-line no-self-compare
|
||
if (IS_INCLUDES && el != el) while (length > index) {
|
||
value = O[index++];
|
||
// eslint-disable-next-line no-self-compare
|
||
if (value != value) return true;
|
||
// Array#indexOf ignores holes, Array#includes - not
|
||
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
|
||
if (O[index] === el) return IS_INCLUDES || index || 0;
|
||
} return !IS_INCLUDES && -1;
|
||
};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 96 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var toInteger = __webpack_require__(38);
|
||
var max = Math.max;
|
||
var min = Math.min;
|
||
module.exports = function (index, length) {
|
||
index = toInteger(index);
|
||
return index < 0 ? max(index + length, 0) : min(index, length);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 97 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var document = __webpack_require__(20).document;
|
||
module.exports = document && document.documentElement;
|
||
|
||
|
||
/***/ }),
|
||
/* 98 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 7.2.2 IsArray(argument)
|
||
var cof = __webpack_require__(47);
|
||
module.exports = Array.isArray || function isArray(arg) {
|
||
return cof(arg) == 'Array';
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 99 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var aFunction = __webpack_require__(45);
|
||
var toObject = __webpack_require__(23);
|
||
var IObject = __webpack_require__(46);
|
||
var toLength = __webpack_require__(37);
|
||
|
||
module.exports = function (that, callbackfn, aLen, memo, isRight) {
|
||
aFunction(callbackfn);
|
||
var O = toObject(that);
|
||
var self = IObject(O);
|
||
var length = toLength(O.length);
|
||
var index = isRight ? length - 1 : 0;
|
||
var i = isRight ? -1 : 1;
|
||
if (aLen < 2) for (;;) {
|
||
if (index in self) {
|
||
memo = self[index];
|
||
index += i;
|
||
break;
|
||
}
|
||
index += i;
|
||
if (isRight ? index < 0 : length <= index) {
|
||
throw TypeError('Reduce of empty array with no initial value');
|
||
}
|
||
}
|
||
for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {
|
||
memo = callbackfn(memo, self[index], index, O);
|
||
}
|
||
return memo;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 100 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var cof = __webpack_require__(47);
|
||
module.exports = function (it, msg) {
|
||
if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);
|
||
return +it;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 101 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
// 21.2.5.3 get RegExp.prototype.flags
|
||
var anObject = __webpack_require__(35);
|
||
module.exports = function () {
|
||
var that = anObject(this);
|
||
var result = '';
|
||
if (that.global) result += 'g';
|
||
if (that.ignoreCase) result += 'i';
|
||
if (that.multiline) result += 'm';
|
||
if (that.unicode) result += 'u';
|
||
if (that.sticky) result += 'y';
|
||
return result;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 102 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = !__webpack_require__(18) && !__webpack_require__(26)(function () {
|
||
return Object.defineProperty(__webpack_require__(67)('div'), 'a', { get: function () { return 7; } }).a != 7;
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 103 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var has = __webpack_require__(27);
|
||
var toIObject = __webpack_require__(30);
|
||
var arrayIndexOf = __webpack_require__(205)(false);
|
||
var IE_PROTO = __webpack_require__(70)('IE_PROTO');
|
||
|
||
module.exports = function (object, names) {
|
||
var O = toIObject(object);
|
||
var i = 0;
|
||
var result = [];
|
||
var key;
|
||
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
|
||
// Don't enum bug & hidden keys
|
||
while (names.length > i) if (has(O, key = names[i++])) {
|
||
~arrayIndexOf(result, key) || result.push(key);
|
||
}
|
||
return result;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 104 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
||
var cof = __webpack_require__(41);
|
||
// eslint-disable-next-line no-prototype-builtins
|
||
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
||
return cof(it) == 'String' ? it.split('') : Object(it);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 105 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 7.1.15 ToLength
|
||
var toInteger = __webpack_require__(69);
|
||
var min = Math.min;
|
||
module.exports = function (it) {
|
||
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 106 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var LIBRARY = __webpack_require__(42);
|
||
var $export = __webpack_require__(14);
|
||
var redefine = __webpack_require__(107);
|
||
var hide = __webpack_require__(24);
|
||
var Iterators = __webpack_require__(32);
|
||
var $iterCreate = __webpack_require__(229);
|
||
var setToStringTag = __webpack_require__(58);
|
||
var getPrototypeOf = __webpack_require__(231);
|
||
var ITERATOR = __webpack_require__(8)('iterator');
|
||
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
|
||
var FF_ITERATOR = '@@iterator';
|
||
var KEYS = 'keys';
|
||
var VALUES = 'values';
|
||
|
||
var returnThis = function () { return this; };
|
||
|
||
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
|
||
$iterCreate(Constructor, NAME, next);
|
||
var getMethod = function (kind) {
|
||
if (!BUGGY && kind in proto) return proto[kind];
|
||
switch (kind) {
|
||
case KEYS: return function keys() { return new Constructor(this, kind); };
|
||
case VALUES: return function values() { return new Constructor(this, kind); };
|
||
} return function entries() { return new Constructor(this, kind); };
|
||
};
|
||
var TAG = NAME + ' Iterator';
|
||
var DEF_VALUES = DEFAULT == VALUES;
|
||
var VALUES_BUG = false;
|
||
var proto = Base.prototype;
|
||
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
|
||
var $default = $native || getMethod(DEFAULT);
|
||
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
|
||
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
|
||
var methods, key, IteratorPrototype;
|
||
// Fix native
|
||
if ($anyNative) {
|
||
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
|
||
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
|
||
// Set @@toStringTag to native iterators
|
||
setToStringTag(IteratorPrototype, TAG, true);
|
||
// fix for some old engines
|
||
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
|
||
}
|
||
}
|
||
// fix Array#{values, @@iterator}.name in V8 / FF
|
||
if (DEF_VALUES && $native && $native.name !== VALUES) {
|
||
VALUES_BUG = true;
|
||
$default = function values() { return $native.call(this); };
|
||
}
|
||
// Define iterator
|
||
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
|
||
hide(proto, ITERATOR, $default);
|
||
}
|
||
// Plug for library
|
||
Iterators[NAME] = $default;
|
||
Iterators[TAG] = returnThis;
|
||
if (DEFAULT) {
|
||
methods = {
|
||
values: DEF_VALUES ? $default : getMethod(VALUES),
|
||
keys: IS_SET ? $default : getMethod(KEYS),
|
||
entries: $entries
|
||
};
|
||
if (FORCED) for (key in methods) {
|
||
if (!(key in proto)) redefine(proto, key, methods[key]);
|
||
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
|
||
}
|
||
return methods;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 107 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = __webpack_require__(24);
|
||
|
||
|
||
/***/ }),
|
||
/* 108 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
|
||
var anObject = __webpack_require__(17);
|
||
var dPs = __webpack_require__(230);
|
||
var enumBugKeys = __webpack_require__(72);
|
||
var IE_PROTO = __webpack_require__(70)('IE_PROTO');
|
||
var Empty = function () { /* empty */ };
|
||
var PROTOTYPE = 'prototype';
|
||
|
||
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
||
var createDict = function () {
|
||
// Thrash, waste and sodomy: IE GC bug
|
||
var iframe = __webpack_require__(67)('iframe');
|
||
var i = enumBugKeys.length;
|
||
var lt = '<';
|
||
var gt = '>';
|
||
var iframeDocument;
|
||
iframe.style.display = 'none';
|
||
__webpack_require__(109).appendChild(iframe);
|
||
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
|
||
// createDict = iframe.contentWindow.Object;
|
||
// html.removeChild(iframe);
|
||
iframeDocument = iframe.contentWindow.document;
|
||
iframeDocument.open();
|
||
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
||
iframeDocument.close();
|
||
createDict = iframeDocument.F;
|
||
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
|
||
return createDict();
|
||
};
|
||
|
||
module.exports = Object.create || function create(O, Properties) {
|
||
var result;
|
||
if (O !== null) {
|
||
Empty[PROTOTYPE] = anObject(O);
|
||
result = new Empty();
|
||
Empty[PROTOTYPE] = null;
|
||
// add "__proto__" for Object.getPrototypeOf polyfill
|
||
result[IE_PROTO] = O;
|
||
} else result = createDict();
|
||
return Properties === undefined ? result : dPs(result, Properties);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 109 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var document = __webpack_require__(7).document;
|
||
module.exports = document && document.documentElement;
|
||
|
||
|
||
/***/ }),
|
||
/* 110 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
|
||
var $keys = __webpack_require__(103);
|
||
var hiddenKeys = __webpack_require__(72).concat('length', 'prototype');
|
||
|
||
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
||
return $keys(O, hiddenKeys);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 111 */
|
||
/***/ (function(module, exports) {
|
||
|
||
|
||
|
||
/***/ }),
|
||
/* 112 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(253),
|
||
/* template */
|
||
__webpack_require__(276),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/table.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] table.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-5f5e0750", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-5f5e0750", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 113 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.mergeLocaleMessage = exports.setHandler = exports.setLocale = exports.t = undefined;
|
||
|
||
var _typeof2 = __webpack_require__(31);
|
||
|
||
var _typeof3 = _interopRequireDefault(_typeof2);
|
||
|
||
var _vue = __webpack_require__(28);
|
||
|
||
var _vue2 = _interopRequireDefault(_vue);
|
||
|
||
var _messages = __webpack_require__(254);
|
||
|
||
var _messages2 = _interopRequireDefault(_messages);
|
||
|
||
var _format = __webpack_require__(255);
|
||
|
||
var _format2 = _interopRequireDefault(_format);
|
||
|
||
var _watch = __webpack_require__(114);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
var format = (0, _format2.default)(_vue2.default);
|
||
var locale = 'zh-cn';
|
||
var merged = false;
|
||
|
||
var i18nHandler = function i18nHandler() {
|
||
if (this instanceof _vue2.default) {
|
||
var $t = this.$t;
|
||
var $i18n = this.$i18n;
|
||
if (typeof $t === 'function' && (typeof $i18n === 'undefined' ? 'undefined' : (0, _typeof3.default)($i18n)) === 'object') {
|
||
if (!merged) {
|
||
merged = true;
|
||
for (var p in _messages2.default) {
|
||
$i18n.mergeLocaleMessage(p, _messages2.default[p]);
|
||
}
|
||
}
|
||
return $t.apply(this, arguments);
|
||
}
|
||
}
|
||
};
|
||
|
||
var t = exports.t = function t(path, options) {
|
||
var value = i18nHandler.apply(this, arguments);
|
||
if (value !== null && value !== undefined) return value;
|
||
|
||
var array = path.split('.');
|
||
var current = _messages2.default[locale];
|
||
|
||
for (var i = 0, j = array.length; i < j; i++) {
|
||
var property = array[i];
|
||
value = current[property];
|
||
if (i === j - 1) return format(value, options);
|
||
if (!value) return '';
|
||
current = value;
|
||
}
|
||
return '';
|
||
};
|
||
|
||
var setLocale = exports.setLocale = function setLocale(l) {
|
||
var oldLocale = locale;
|
||
locale = l && l.toLowerCase() || locale;
|
||
if (oldLocale !== locale) {
|
||
(0, _watch.trigger)();
|
||
}
|
||
};
|
||
|
||
var setHandler = exports.setHandler = function setHandler(fn) {
|
||
var oldHander = i18nHandler;
|
||
i18nHandler = fn || i18nHandler;
|
||
if (oldHander !== i18nHandler) {
|
||
(0, _watch.trigger)();
|
||
}
|
||
};
|
||
|
||
var mergeLocaleMessage = exports.mergeLocaleMessage = function mergeLocaleMessage(local, message) {
|
||
_messages2.default[local] = message;
|
||
// 后续添加的字符匹配也要添加到vue-i18n
|
||
if (this instanceof _vue2.default) {
|
||
var $t = this.$t;
|
||
var $i18n = this.$i18n;
|
||
if (typeof $t === 'function' && (typeof $i18n === 'undefined' ? 'undefined' : (0, _typeof3.default)($i18n)) === 'object') {
|
||
$i18n.mergeLocaleMessage(local, message);
|
||
}
|
||
}
|
||
};
|
||
|
||
exports.default = {
|
||
t: t, setLocale: setLocale, setHandler: setHandler, mergeLocaleMessage: mergeLocaleMessage
|
||
};
|
||
|
||
/***/ }),
|
||
/* 114 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.subscribeDataChanging = subscribeDataChanging;
|
||
exports.unsubscribeDataChanging = unsubscribeDataChanging;
|
||
exports.trigger = trigger;
|
||
|
||
var _vue = __webpack_require__(28);
|
||
|
||
var _vue2 = _interopRequireDefault(_vue);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
var dataListeners = [];
|
||
|
||
function subscribeDataChanging(vm) {
|
||
var index = dataListeners.indexOf(vm);
|
||
if (index === -1 && !vm.ui_i18n_subscribing) {
|
||
dataListeners.push(vm);
|
||
vm.ui_i18n_subscribing = true;
|
||
}
|
||
}
|
||
|
||
function unsubscribeDataChanging(vm) {
|
||
var index = dataListeners.indexOf(vm);
|
||
if (index !== -1 && vm.ui_i18n_subscribing) {
|
||
dataListeners.splice(index, 1);
|
||
}
|
||
}
|
||
|
||
function trigger() {
|
||
var i = dataListeners.length;
|
||
|
||
var _loop = function _loop() {
|
||
var vm = dataListeners[i];
|
||
_vue2.default.nextTick(function () {
|
||
vm && vm.$forceUpdate();
|
||
});
|
||
};
|
||
|
||
while (i--) {
|
||
_loop();
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 115 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(287),
|
||
/* template */
|
||
__webpack_require__(305),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/date-picker/calendars.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] calendars.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-10bfb5b5", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-10bfb5b5", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 116 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = { "default": __webpack_require__(291), __esModule: true };
|
||
|
||
/***/ }),
|
||
/* 117 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var classof = __webpack_require__(79);
|
||
var ITERATOR = __webpack_require__(8)('iterator');
|
||
var Iterators = __webpack_require__(32);
|
||
module.exports = __webpack_require__(6).getIteratorMethod = function (it) {
|
||
if (it != undefined) return it[ITERATOR]
|
||
|| it['@@iterator']
|
||
|| Iterators[classof(it)];
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 118 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = { "default": __webpack_require__(295), __esModule: true };
|
||
|
||
/***/ }),
|
||
/* 119 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
|
||
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
||
|
||
|
||
/***/ }),
|
||
/* 120 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(299),
|
||
/* template */
|
||
__webpack_require__(303),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/time-picker/pickerContent.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] pickerContent.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-192aef8c", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-192aef8c", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 121 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _readonlyInput = __webpack_require__(308);
|
||
|
||
var _readonlyInput2 = _interopRequireDefault(_readonlyInput);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _readonlyInput2.default;
|
||
|
||
/***/ }),
|
||
/* 122 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _pickerPopup = __webpack_require__(311);
|
||
|
||
var _pickerPopup2 = _interopRequireDefault(_pickerPopup);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _pickerPopup2.default;
|
||
|
||
/***/ }),
|
||
/* 123 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(316),
|
||
/* template */
|
||
__webpack_require__(317),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/loading/loading.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] loading.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-643d0cab", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-643d0cab", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 124 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 7.3.20 SpeciesConstructor(O, defaultConstructor)
|
||
var anObject = __webpack_require__(17);
|
||
var aFunction = __webpack_require__(51);
|
||
var SPECIES = __webpack_require__(8)('species');
|
||
module.exports = function (O, D) {
|
||
var C = anObject(O).constructor;
|
||
var S;
|
||
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 125 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var ctx = __webpack_require__(50);
|
||
var invoke = __webpack_require__(325);
|
||
var html = __webpack_require__(109);
|
||
var cel = __webpack_require__(67);
|
||
var global = __webpack_require__(7);
|
||
var process = global.process;
|
||
var setTask = global.setImmediate;
|
||
var clearTask = global.clearImmediate;
|
||
var MessageChannel = global.MessageChannel;
|
||
var Dispatch = global.Dispatch;
|
||
var counter = 0;
|
||
var queue = {};
|
||
var ONREADYSTATECHANGE = 'onreadystatechange';
|
||
var defer, channel, port;
|
||
var run = function () {
|
||
var id = +this;
|
||
// eslint-disable-next-line no-prototype-builtins
|
||
if (queue.hasOwnProperty(id)) {
|
||
var fn = queue[id];
|
||
delete queue[id];
|
||
fn();
|
||
}
|
||
};
|
||
var listener = function (event) {
|
||
run.call(event.data);
|
||
};
|
||
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
|
||
if (!setTask || !clearTask) {
|
||
setTask = function setImmediate(fn) {
|
||
var args = [];
|
||
var i = 1;
|
||
while (arguments.length > i) args.push(arguments[i++]);
|
||
queue[++counter] = function () {
|
||
// eslint-disable-next-line no-new-func
|
||
invoke(typeof fn == 'function' ? fn : Function(fn), args);
|
||
};
|
||
defer(counter);
|
||
return counter;
|
||
};
|
||
clearTask = function clearImmediate(id) {
|
||
delete queue[id];
|
||
};
|
||
// Node.js 0.8-
|
||
if (__webpack_require__(41)(process) == 'process') {
|
||
defer = function (id) {
|
||
process.nextTick(ctx(run, id, 1));
|
||
};
|
||
// Sphere (JS game engine) Dispatch API
|
||
} else if (Dispatch && Dispatch.now) {
|
||
defer = function (id) {
|
||
Dispatch.now(ctx(run, id, 1));
|
||
};
|
||
// Browsers with MessageChannel, includes WebWorkers
|
||
} else if (MessageChannel) {
|
||
channel = new MessageChannel();
|
||
port = channel.port2;
|
||
channel.port1.onmessage = listener;
|
||
defer = ctx(port.postMessage, port, 1);
|
||
// Browsers with postMessage, skip WebWorkers
|
||
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
|
||
} else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
|
||
defer = function (id) {
|
||
global.postMessage(id + '', '*');
|
||
};
|
||
global.addEventListener('message', listener, false);
|
||
// IE8-
|
||
} else if (ONREADYSTATECHANGE in cel('script')) {
|
||
defer = function (id) {
|
||
html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
|
||
html.removeChild(this);
|
||
run.call(id);
|
||
};
|
||
};
|
||
// Rest old browsers
|
||
} else {
|
||
defer = function (id) {
|
||
setTimeout(ctx(run, id, 1), 0);
|
||
};
|
||
}
|
||
}
|
||
module.exports = {
|
||
set: setTask,
|
||
clear: clearTask
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 126 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = function (exec) {
|
||
try {
|
||
return { e: false, v: exec() };
|
||
} catch (e) {
|
||
return { e: true, v: e };
|
||
}
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 127 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var anObject = __webpack_require__(17);
|
||
var isObject = __webpack_require__(25);
|
||
var newPromiseCapability = __webpack_require__(81);
|
||
|
||
module.exports = function (C, x) {
|
||
anObject(C);
|
||
if (isObject(x) && x.constructor === C) return x;
|
||
var promiseCapability = newPromiseCapability.f(C);
|
||
var resolve = promiseCapability.resolve;
|
||
resolve(x);
|
||
return promiseCapability.promise;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 128 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
/**
|
||
* xss
|
||
*
|
||
* @author Zongmin Lei<leizongmin@gmail.com>
|
||
*/
|
||
|
||
var DEFAULT = __webpack_require__(129);
|
||
var parser = __webpack_require__(132);
|
||
var FilterXSS = __webpack_require__(337);
|
||
|
||
/**
|
||
* filter xss function
|
||
*
|
||
* @param {String} html
|
||
* @param {Object} options { whiteList, onTag, onTagAttr, onIgnoreTag, onIgnoreTagAttr, safeAttrValue, escapeHtml }
|
||
* @return {String}
|
||
*/
|
||
function filterXSS(html, options) {
|
||
var xss = new FilterXSS(options);
|
||
return xss.process(html);
|
||
}
|
||
|
||
exports = module.exports = filterXSS;
|
||
exports.filterXSS = filterXSS;
|
||
exports.FilterXSS = FilterXSS;
|
||
for (var i in DEFAULT) exports[i] = DEFAULT[i];
|
||
for (var i in parser) exports[i] = parser[i];
|
||
|
||
// using `xss` on the browser, output `filterXSS` to the globals
|
||
if (typeof window !== "undefined") {
|
||
window.filterXSS = module.exports;
|
||
}
|
||
|
||
// using `xss` on the WebWorker, output `filterXSS` to the globals
|
||
function isWorkerEnv() {
|
||
return typeof self !== 'undefined' && typeof DedicatedWorkerGlobalScope !== 'undefined' && self instanceof DedicatedWorkerGlobalScope;
|
||
}
|
||
if (isWorkerEnv()) {
|
||
self.filterXSS = module.exports;
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
/* 129 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
/**
|
||
* default settings
|
||
*
|
||
* @author Zongmin Lei<leizongmin@gmail.com>
|
||
*/
|
||
|
||
var FilterCSS = __webpack_require__(82).FilterCSS;
|
||
var getDefaultCSSWhiteList = __webpack_require__(82).getDefaultWhiteList;
|
||
var _ = __webpack_require__(83);
|
||
|
||
function getDefaultWhiteList() {
|
||
return {
|
||
a: ["target", "href", "title"],
|
||
abbr: ["title"],
|
||
address: [],
|
||
area: ["shape", "coords", "href", "alt"],
|
||
article: [],
|
||
aside: [],
|
||
audio: ["autoplay", "controls", "loop", "preload", "src"],
|
||
b: [],
|
||
bdi: ["dir"],
|
||
bdo: ["dir"],
|
||
big: [],
|
||
blockquote: ["cite"],
|
||
br: [],
|
||
caption: [],
|
||
center: [],
|
||
cite: [],
|
||
code: [],
|
||
col: ["align", "valign", "span", "width"],
|
||
colgroup: ["align", "valign", "span", "width"],
|
||
dd: [],
|
||
del: ["datetime"],
|
||
details: ["open"],
|
||
div: [],
|
||
dl: [],
|
||
dt: [],
|
||
em: [],
|
||
font: ["color", "size", "face"],
|
||
footer: [],
|
||
h1: [],
|
||
h2: [],
|
||
h3: [],
|
||
h4: [],
|
||
h5: [],
|
||
h6: [],
|
||
header: [],
|
||
hr: [],
|
||
i: [],
|
||
img: ["src", "alt", "title", "width", "height"],
|
||
ins: ["datetime"],
|
||
li: [],
|
||
mark: [],
|
||
nav: [],
|
||
ol: [],
|
||
p: [],
|
||
pre: [],
|
||
s: [],
|
||
section: [],
|
||
small: [],
|
||
span: [],
|
||
sub: [],
|
||
sup: [],
|
||
strong: [],
|
||
table: ["width", "border", "align", "valign"],
|
||
tbody: ["align", "valign"],
|
||
td: ["width", "rowspan", "colspan", "align", "valign"],
|
||
tfoot: ["align", "valign"],
|
||
th: ["width", "rowspan", "colspan", "align", "valign"],
|
||
thead: ["align", "valign"],
|
||
tr: ["rowspan", "align", "valign"],
|
||
tt: [],
|
||
u: [],
|
||
ul: [],
|
||
video: ["autoplay", "controls", "loop", "preload", "src", "height", "width"]
|
||
};
|
||
}
|
||
|
||
var defaultCSSFilter = new FilterCSS();
|
||
|
||
/**
|
||
* default onTag function
|
||
*
|
||
* @param {String} tag
|
||
* @param {String} html
|
||
* @param {Object} options
|
||
* @return {String}
|
||
*/
|
||
function onTag(tag, html, options) {
|
||
// do nothing
|
||
}
|
||
|
||
/**
|
||
* default onIgnoreTag function
|
||
*
|
||
* @param {String} tag
|
||
* @param {String} html
|
||
* @param {Object} options
|
||
* @return {String}
|
||
*/
|
||
function onIgnoreTag(tag, html, options) {
|
||
// do nothing
|
||
}
|
||
|
||
/**
|
||
* default onTagAttr function
|
||
*
|
||
* @param {String} tag
|
||
* @param {String} name
|
||
* @param {String} value
|
||
* @return {String}
|
||
*/
|
||
function onTagAttr(tag, name, value) {
|
||
// do nothing
|
||
}
|
||
|
||
/**
|
||
* default onIgnoreTagAttr function
|
||
*
|
||
* @param {String} tag
|
||
* @param {String} name
|
||
* @param {String} value
|
||
* @return {String}
|
||
*/
|
||
function onIgnoreTagAttr(tag, name, value) {
|
||
// do nothing
|
||
}
|
||
|
||
/**
|
||
* default escapeHtml function
|
||
*
|
||
* @param {String} html
|
||
*/
|
||
function escapeHtml(html) {
|
||
return html.replace(REGEXP_LT, "<").replace(REGEXP_GT, ">");
|
||
}
|
||
|
||
/**
|
||
* default safeAttrValue function
|
||
*
|
||
* @param {String} tag
|
||
* @param {String} name
|
||
* @param {String} value
|
||
* @param {Object} cssFilter
|
||
* @return {String}
|
||
*/
|
||
function safeAttrValue(tag, name, value, cssFilter) {
|
||
// unescape attribute value firstly
|
||
value = friendlyAttrValue(value);
|
||
|
||
if (name === "href" || name === "src") {
|
||
// filter `href` and `src` attribute
|
||
// only allow the value that starts with `http://` | `https://` | `mailto:` | `/` | `#`
|
||
value = _.trim(value);
|
||
if (value === "#") return "#";
|
||
if (
|
||
!(
|
||
value.substr(0, 7) === "http://" ||
|
||
value.substr(0, 8) === "https://" ||
|
||
value.substr(0, 7) === "mailto:" ||
|
||
value.substr(0, 4) === "tel:" ||
|
||
value.substr(0, 11) === "data:image/" ||
|
||
value.substr(0, 6) === "ftp://" ||
|
||
value.substr(0, 2) === "./" ||
|
||
value.substr(0, 3) === "../" ||
|
||
value[0] === "#" ||
|
||
value[0] === "/"
|
||
)
|
||
) {
|
||
return "";
|
||
}
|
||
} else if (name === "background") {
|
||
// filter `background` attribute (maybe no use)
|
||
// `javascript:`
|
||
REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
|
||
if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {
|
||
return "";
|
||
}
|
||
} else if (name === "style") {
|
||
// `expression()`
|
||
REGEXP_DEFAULT_ON_TAG_ATTR_7.lastIndex = 0;
|
||
if (REGEXP_DEFAULT_ON_TAG_ATTR_7.test(value)) {
|
||
return "";
|
||
}
|
||
// `url()`
|
||
REGEXP_DEFAULT_ON_TAG_ATTR_8.lastIndex = 0;
|
||
if (REGEXP_DEFAULT_ON_TAG_ATTR_8.test(value)) {
|
||
REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
|
||
if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {
|
||
return "";
|
||
}
|
||
}
|
||
if (cssFilter !== false) {
|
||
cssFilter = cssFilter || defaultCSSFilter;
|
||
value = cssFilter.process(value);
|
||
}
|
||
}
|
||
|
||
// escape `<>"` before returns
|
||
value = escapeAttrValue(value);
|
||
return value;
|
||
}
|
||
|
||
// RegExp list
|
||
var REGEXP_LT = /</g;
|
||
var REGEXP_GT = />/g;
|
||
var REGEXP_QUOTE = /"/g;
|
||
var REGEXP_QUOTE_2 = /"/g;
|
||
var REGEXP_ATTR_VALUE_1 = /&#([a-zA-Z0-9]*);?/gim;
|
||
var REGEXP_ATTR_VALUE_COLON = /:?/gim;
|
||
var REGEXP_ATTR_VALUE_NEWLINE = /&newline;?/gim;
|
||
var REGEXP_DEFAULT_ON_TAG_ATTR_3 = /\/\*|\*\//gm;
|
||
var REGEXP_DEFAULT_ON_TAG_ATTR_4 = /((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi;
|
||
var REGEXP_DEFAULT_ON_TAG_ATTR_5 = /^[\s"'`]*(d\s*a\s*t\s*a\s*)\:/gi;
|
||
var REGEXP_DEFAULT_ON_TAG_ATTR_6 = /^[\s"'`]*(d\s*a\s*t\s*a\s*)\:\s*image\//gi;
|
||
var REGEXP_DEFAULT_ON_TAG_ATTR_7 = /e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi;
|
||
var REGEXP_DEFAULT_ON_TAG_ATTR_8 = /u\s*r\s*l\s*\(.*/gi;
|
||
|
||
/**
|
||
* escape doube quote
|
||
*
|
||
* @param {String} str
|
||
* @return {String} str
|
||
*/
|
||
function escapeQuote(str) {
|
||
return str.replace(REGEXP_QUOTE, """);
|
||
}
|
||
|
||
/**
|
||
* unescape double quote
|
||
*
|
||
* @param {String} str
|
||
* @return {String} str
|
||
*/
|
||
function unescapeQuote(str) {
|
||
return str.replace(REGEXP_QUOTE_2, '"');
|
||
}
|
||
|
||
/**
|
||
* escape html entities
|
||
*
|
||
* @param {String} str
|
||
* @return {String}
|
||
*/
|
||
function escapeHtmlEntities(str) {
|
||
return str.replace(REGEXP_ATTR_VALUE_1, function replaceUnicode(str, code) {
|
||
return code[0] === "x" || code[0] === "X"
|
||
? String.fromCharCode(parseInt(code.substr(1), 16))
|
||
: String.fromCharCode(parseInt(code, 10));
|
||
});
|
||
}
|
||
|
||
/**
|
||
* escape html5 new danger entities
|
||
*
|
||
* @param {String} str
|
||
* @return {String}
|
||
*/
|
||
function escapeDangerHtml5Entities(str) {
|
||
return str
|
||
.replace(REGEXP_ATTR_VALUE_COLON, ":")
|
||
.replace(REGEXP_ATTR_VALUE_NEWLINE, " ");
|
||
}
|
||
|
||
/**
|
||
* clear nonprintable characters
|
||
*
|
||
* @param {String} str
|
||
* @return {String}
|
||
*/
|
||
function clearNonPrintableCharacter(str) {
|
||
var str2 = "";
|
||
for (var i = 0, len = str.length; i < len; i++) {
|
||
str2 += str.charCodeAt(i) < 32 ? " " : str.charAt(i);
|
||
}
|
||
return _.trim(str2);
|
||
}
|
||
|
||
/**
|
||
* get friendly attribute value
|
||
*
|
||
* @param {String} str
|
||
* @return {String}
|
||
*/
|
||
function friendlyAttrValue(str) {
|
||
str = unescapeQuote(str);
|
||
str = escapeHtmlEntities(str);
|
||
str = escapeDangerHtml5Entities(str);
|
||
str = clearNonPrintableCharacter(str);
|
||
return str;
|
||
}
|
||
|
||
/**
|
||
* unescape attribute value
|
||
*
|
||
* @param {String} str
|
||
* @return {String}
|
||
*/
|
||
function escapeAttrValue(str) {
|
||
str = escapeQuote(str);
|
||
str = escapeHtml(str);
|
||
return str;
|
||
}
|
||
|
||
/**
|
||
* `onIgnoreTag` function for removing all the tags that are not in whitelist
|
||
*/
|
||
function onIgnoreTagStripAll() {
|
||
return "";
|
||
}
|
||
|
||
/**
|
||
* remove tag body
|
||
* specify a `tags` list, if the tag is not in the `tags` list then process by the specify function (optional)
|
||
*
|
||
* @param {array} tags
|
||
* @param {function} next
|
||
*/
|
||
function StripTagBody(tags, next) {
|
||
if (typeof next !== "function") {
|
||
next = function() {};
|
||
}
|
||
|
||
var isRemoveAllTag = !Array.isArray(tags);
|
||
function isRemoveTag(tag) {
|
||
if (isRemoveAllTag) return true;
|
||
return _.indexOf(tags, tag) !== -1;
|
||
}
|
||
|
||
var removeList = [];
|
||
var posStart = false;
|
||
|
||
return {
|
||
onIgnoreTag: function(tag, html, options) {
|
||
if (isRemoveTag(tag)) {
|
||
if (options.isClosing) {
|
||
var ret = "[/removed]";
|
||
var end = options.position + ret.length;
|
||
removeList.push([
|
||
posStart !== false ? posStart : options.position,
|
||
end
|
||
]);
|
||
posStart = false;
|
||
return ret;
|
||
} else {
|
||
if (!posStart) {
|
||
posStart = options.position;
|
||
}
|
||
return "[removed]";
|
||
}
|
||
} else {
|
||
return next(tag, html, options);
|
||
}
|
||
},
|
||
remove: function(html) {
|
||
var rethtml = "";
|
||
var lastPos = 0;
|
||
_.forEach(removeList, function(pos) {
|
||
rethtml += html.slice(lastPos, pos[0]);
|
||
lastPos = pos[1];
|
||
});
|
||
rethtml += html.slice(lastPos);
|
||
return rethtml;
|
||
}
|
||
};
|
||
}
|
||
|
||
/**
|
||
* remove html comments
|
||
*
|
||
* @param {String} html
|
||
* @return {String}
|
||
*/
|
||
function stripCommentTag(html) {
|
||
return html.replace(STRIP_COMMENT_TAG_REGEXP, "");
|
||
}
|
||
var STRIP_COMMENT_TAG_REGEXP = /<!--[\s\S]*?-->/g;
|
||
|
||
/**
|
||
* remove invisible characters
|
||
*
|
||
* @param {String} html
|
||
* @return {String}
|
||
*/
|
||
function stripBlankChar(html) {
|
||
var chars = html.split("");
|
||
chars = chars.filter(function(char) {
|
||
var c = char.charCodeAt(0);
|
||
if (c === 127) return false;
|
||
if (c <= 31) {
|
||
if (c === 10 || c === 13) return true;
|
||
return false;
|
||
}
|
||
return true;
|
||
});
|
||
return chars.join("");
|
||
}
|
||
|
||
exports.whiteList = getDefaultWhiteList();
|
||
exports.getDefaultWhiteList = getDefaultWhiteList;
|
||
exports.onTag = onTag;
|
||
exports.onIgnoreTag = onIgnoreTag;
|
||
exports.onTagAttr = onTagAttr;
|
||
exports.onIgnoreTagAttr = onIgnoreTagAttr;
|
||
exports.safeAttrValue = safeAttrValue;
|
||
exports.escapeHtml = escapeHtml;
|
||
exports.escapeQuote = escapeQuote;
|
||
exports.unescapeQuote = unescapeQuote;
|
||
exports.escapeHtmlEntities = escapeHtmlEntities;
|
||
exports.escapeDangerHtml5Entities = escapeDangerHtml5Entities;
|
||
exports.clearNonPrintableCharacter = clearNonPrintableCharacter;
|
||
exports.friendlyAttrValue = friendlyAttrValue;
|
||
exports.escapeAttrValue = escapeAttrValue;
|
||
exports.onIgnoreTagStripAll = onIgnoreTagStripAll;
|
||
exports.StripTagBody = StripTagBody;
|
||
exports.stripCommentTag = stripCommentTag;
|
||
exports.stripBlankChar = stripBlankChar;
|
||
exports.cssFilter = defaultCSSFilter;
|
||
exports.getDefaultCSSWhiteList = getDefaultCSSWhiteList;
|
||
|
||
|
||
/***/ }),
|
||
/* 130 */
|
||
/***/ (function(module, exports) {
|
||
|
||
/**
|
||
* cssfilter
|
||
*
|
||
* @author 老雷<leizongmin@gmail.com>
|
||
*/
|
||
|
||
function getDefaultWhiteList () {
|
||
// 白名单值说明:
|
||
// true: 允许该属性
|
||
// Function: function (val) { } 返回true表示允许该属性,其他值均表示不允许
|
||
// RegExp: regexp.test(val) 返回true表示允许该属性,其他值均表示不允许
|
||
// 除上面列出的值外均表示不允许
|
||
var whiteList = {};
|
||
|
||
whiteList['align-content'] = false; // default: auto
|
||
whiteList['align-items'] = false; // default: auto
|
||
whiteList['align-self'] = false; // default: auto
|
||
whiteList['alignment-adjust'] = false; // default: auto
|
||
whiteList['alignment-baseline'] = false; // default: baseline
|
||
whiteList['all'] = false; // default: depending on individual properties
|
||
whiteList['anchor-point'] = false; // default: none
|
||
whiteList['animation'] = false; // default: depending on individual properties
|
||
whiteList['animation-delay'] = false; // default: 0
|
||
whiteList['animation-direction'] = false; // default: normal
|
||
whiteList['animation-duration'] = false; // default: 0
|
||
whiteList['animation-fill-mode'] = false; // default: none
|
||
whiteList['animation-iteration-count'] = false; // default: 1
|
||
whiteList['animation-name'] = false; // default: none
|
||
whiteList['animation-play-state'] = false; // default: running
|
||
whiteList['animation-timing-function'] = false; // default: ease
|
||
whiteList['azimuth'] = false; // default: center
|
||
whiteList['backface-visibility'] = false; // default: visible
|
||
whiteList['background'] = true; // default: depending on individual properties
|
||
whiteList['background-attachment'] = true; // default: scroll
|
||
whiteList['background-clip'] = true; // default: border-box
|
||
whiteList['background-color'] = true; // default: transparent
|
||
whiteList['background-image'] = true; // default: none
|
||
whiteList['background-origin'] = true; // default: padding-box
|
||
whiteList['background-position'] = true; // default: 0% 0%
|
||
whiteList['background-repeat'] = true; // default: repeat
|
||
whiteList['background-size'] = true; // default: auto
|
||
whiteList['baseline-shift'] = false; // default: baseline
|
||
whiteList['binding'] = false; // default: none
|
||
whiteList['bleed'] = false; // default: 6pt
|
||
whiteList['bookmark-label'] = false; // default: content()
|
||
whiteList['bookmark-level'] = false; // default: none
|
||
whiteList['bookmark-state'] = false; // default: open
|
||
whiteList['border'] = true; // default: depending on individual properties
|
||
whiteList['border-bottom'] = true; // default: depending on individual properties
|
||
whiteList['border-bottom-color'] = true; // default: current color
|
||
whiteList['border-bottom-left-radius'] = true; // default: 0
|
||
whiteList['border-bottom-right-radius'] = true; // default: 0
|
||
whiteList['border-bottom-style'] = true; // default: none
|
||
whiteList['border-bottom-width'] = true; // default: medium
|
||
whiteList['border-collapse'] = true; // default: separate
|
||
whiteList['border-color'] = true; // default: depending on individual properties
|
||
whiteList['border-image'] = true; // default: none
|
||
whiteList['border-image-outset'] = true; // default: 0
|
||
whiteList['border-image-repeat'] = true; // default: stretch
|
||
whiteList['border-image-slice'] = true; // default: 100%
|
||
whiteList['border-image-source'] = true; // default: none
|
||
whiteList['border-image-width'] = true; // default: 1
|
||
whiteList['border-left'] = true; // default: depending on individual properties
|
||
whiteList['border-left-color'] = true; // default: current color
|
||
whiteList['border-left-style'] = true; // default: none
|
||
whiteList['border-left-width'] = true; // default: medium
|
||
whiteList['border-radius'] = true; // default: 0
|
||
whiteList['border-right'] = true; // default: depending on individual properties
|
||
whiteList['border-right-color'] = true; // default: current color
|
||
whiteList['border-right-style'] = true; // default: none
|
||
whiteList['border-right-width'] = true; // default: medium
|
||
whiteList['border-spacing'] = true; // default: 0
|
||
whiteList['border-style'] = true; // default: depending on individual properties
|
||
whiteList['border-top'] = true; // default: depending on individual properties
|
||
whiteList['border-top-color'] = true; // default: current color
|
||
whiteList['border-top-left-radius'] = true; // default: 0
|
||
whiteList['border-top-right-radius'] = true; // default: 0
|
||
whiteList['border-top-style'] = true; // default: none
|
||
whiteList['border-top-width'] = true; // default: medium
|
||
whiteList['border-width'] = true; // default: depending on individual properties
|
||
whiteList['bottom'] = false; // default: auto
|
||
whiteList['box-decoration-break'] = true; // default: slice
|
||
whiteList['box-shadow'] = true; // default: none
|
||
whiteList['box-sizing'] = true; // default: content-box
|
||
whiteList['box-snap'] = true; // default: none
|
||
whiteList['box-suppress'] = true; // default: show
|
||
whiteList['break-after'] = true; // default: auto
|
||
whiteList['break-before'] = true; // default: auto
|
||
whiteList['break-inside'] = true; // default: auto
|
||
whiteList['caption-side'] = false; // default: top
|
||
whiteList['chains'] = false; // default: none
|
||
whiteList['clear'] = true; // default: none
|
||
whiteList['clip'] = false; // default: auto
|
||
whiteList['clip-path'] = false; // default: none
|
||
whiteList['clip-rule'] = false; // default: nonzero
|
||
whiteList['color'] = true; // default: implementation dependent
|
||
whiteList['color-interpolation-filters'] = true; // default: auto
|
||
whiteList['column-count'] = false; // default: auto
|
||
whiteList['column-fill'] = false; // default: balance
|
||
whiteList['column-gap'] = false; // default: normal
|
||
whiteList['column-rule'] = false; // default: depending on individual properties
|
||
whiteList['column-rule-color'] = false; // default: current color
|
||
whiteList['column-rule-style'] = false; // default: medium
|
||
whiteList['column-rule-width'] = false; // default: medium
|
||
whiteList['column-span'] = false; // default: none
|
||
whiteList['column-width'] = false; // default: auto
|
||
whiteList['columns'] = false; // default: depending on individual properties
|
||
whiteList['contain'] = false; // default: none
|
||
whiteList['content'] = false; // default: normal
|
||
whiteList['counter-increment'] = false; // default: none
|
||
whiteList['counter-reset'] = false; // default: none
|
||
whiteList['counter-set'] = false; // default: none
|
||
whiteList['crop'] = false; // default: auto
|
||
whiteList['cue'] = false; // default: depending on individual properties
|
||
whiteList['cue-after'] = false; // default: none
|
||
whiteList['cue-before'] = false; // default: none
|
||
whiteList['cursor'] = false; // default: auto
|
||
whiteList['direction'] = false; // default: ltr
|
||
whiteList['display'] = true; // default: depending on individual properties
|
||
whiteList['display-inside'] = true; // default: auto
|
||
whiteList['display-list'] = true; // default: none
|
||
whiteList['display-outside'] = true; // default: inline-level
|
||
whiteList['dominant-baseline'] = false; // default: auto
|
||
whiteList['elevation'] = false; // default: level
|
||
whiteList['empty-cells'] = false; // default: show
|
||
whiteList['filter'] = false; // default: none
|
||
whiteList['flex'] = false; // default: depending on individual properties
|
||
whiteList['flex-basis'] = false; // default: auto
|
||
whiteList['flex-direction'] = false; // default: row
|
||
whiteList['flex-flow'] = false; // default: depending on individual properties
|
||
whiteList['flex-grow'] = false; // default: 0
|
||
whiteList['flex-shrink'] = false; // default: 1
|
||
whiteList['flex-wrap'] = false; // default: nowrap
|
||
whiteList['float'] = false; // default: none
|
||
whiteList['float-offset'] = false; // default: 0 0
|
||
whiteList['flood-color'] = false; // default: black
|
||
whiteList['flood-opacity'] = false; // default: 1
|
||
whiteList['flow-from'] = false; // default: none
|
||
whiteList['flow-into'] = false; // default: none
|
||
whiteList['font'] = true; // default: depending on individual properties
|
||
whiteList['font-family'] = true; // default: implementation dependent
|
||
whiteList['font-feature-settings'] = true; // default: normal
|
||
whiteList['font-kerning'] = true; // default: auto
|
||
whiteList['font-language-override'] = true; // default: normal
|
||
whiteList['font-size'] = true; // default: medium
|
||
whiteList['font-size-adjust'] = true; // default: none
|
||
whiteList['font-stretch'] = true; // default: normal
|
||
whiteList['font-style'] = true; // default: normal
|
||
whiteList['font-synthesis'] = true; // default: weight style
|
||
whiteList['font-variant'] = true; // default: normal
|
||
whiteList['font-variant-alternates'] = true; // default: normal
|
||
whiteList['font-variant-caps'] = true; // default: normal
|
||
whiteList['font-variant-east-asian'] = true; // default: normal
|
||
whiteList['font-variant-ligatures'] = true; // default: normal
|
||
whiteList['font-variant-numeric'] = true; // default: normal
|
||
whiteList['font-variant-position'] = true; // default: normal
|
||
whiteList['font-weight'] = true; // default: normal
|
||
whiteList['grid'] = false; // default: depending on individual properties
|
||
whiteList['grid-area'] = false; // default: depending on individual properties
|
||
whiteList['grid-auto-columns'] = false; // default: auto
|
||
whiteList['grid-auto-flow'] = false; // default: none
|
||
whiteList['grid-auto-rows'] = false; // default: auto
|
||
whiteList['grid-column'] = false; // default: depending on individual properties
|
||
whiteList['grid-column-end'] = false; // default: auto
|
||
whiteList['grid-column-start'] = false; // default: auto
|
||
whiteList['grid-row'] = false; // default: depending on individual properties
|
||
whiteList['grid-row-end'] = false; // default: auto
|
||
whiteList['grid-row-start'] = false; // default: auto
|
||
whiteList['grid-template'] = false; // default: depending on individual properties
|
||
whiteList['grid-template-areas'] = false; // default: none
|
||
whiteList['grid-template-columns'] = false; // default: none
|
||
whiteList['grid-template-rows'] = false; // default: none
|
||
whiteList['hanging-punctuation'] = false; // default: none
|
||
whiteList['height'] = true; // default: auto
|
||
whiteList['hyphens'] = false; // default: manual
|
||
whiteList['icon'] = false; // default: auto
|
||
whiteList['image-orientation'] = false; // default: auto
|
||
whiteList['image-resolution'] = false; // default: normal
|
||
whiteList['ime-mode'] = false; // default: auto
|
||
whiteList['initial-letters'] = false; // default: normal
|
||
whiteList['inline-box-align'] = false; // default: last
|
||
whiteList['justify-content'] = false; // default: auto
|
||
whiteList['justify-items'] = false; // default: auto
|
||
whiteList['justify-self'] = false; // default: auto
|
||
whiteList['left'] = false; // default: auto
|
||
whiteList['letter-spacing'] = true; // default: normal
|
||
whiteList['lighting-color'] = true; // default: white
|
||
whiteList['line-box-contain'] = false; // default: block inline replaced
|
||
whiteList['line-break'] = false; // default: auto
|
||
whiteList['line-grid'] = false; // default: match-parent
|
||
whiteList['line-height'] = false; // default: normal
|
||
whiteList['line-snap'] = false; // default: none
|
||
whiteList['line-stacking'] = false; // default: depending on individual properties
|
||
whiteList['line-stacking-ruby'] = false; // default: exclude-ruby
|
||
whiteList['line-stacking-shift'] = false; // default: consider-shifts
|
||
whiteList['line-stacking-strategy'] = false; // default: inline-line-height
|
||
whiteList['list-style'] = true; // default: depending on individual properties
|
||
whiteList['list-style-image'] = true; // default: none
|
||
whiteList['list-style-position'] = true; // default: outside
|
||
whiteList['list-style-type'] = true; // default: disc
|
||
whiteList['margin'] = true; // default: depending on individual properties
|
||
whiteList['margin-bottom'] = true; // default: 0
|
||
whiteList['margin-left'] = true; // default: 0
|
||
whiteList['margin-right'] = true; // default: 0
|
||
whiteList['margin-top'] = true; // default: 0
|
||
whiteList['marker-offset'] = false; // default: auto
|
||
whiteList['marker-side'] = false; // default: list-item
|
||
whiteList['marks'] = false; // default: none
|
||
whiteList['mask'] = false; // default: border-box
|
||
whiteList['mask-box'] = false; // default: see individual properties
|
||
whiteList['mask-box-outset'] = false; // default: 0
|
||
whiteList['mask-box-repeat'] = false; // default: stretch
|
||
whiteList['mask-box-slice'] = false; // default: 0 fill
|
||
whiteList['mask-box-source'] = false; // default: none
|
||
whiteList['mask-box-width'] = false; // default: auto
|
||
whiteList['mask-clip'] = false; // default: border-box
|
||
whiteList['mask-image'] = false; // default: none
|
||
whiteList['mask-origin'] = false; // default: border-box
|
||
whiteList['mask-position'] = false; // default: center
|
||
whiteList['mask-repeat'] = false; // default: no-repeat
|
||
whiteList['mask-size'] = false; // default: border-box
|
||
whiteList['mask-source-type'] = false; // default: auto
|
||
whiteList['mask-type'] = false; // default: luminance
|
||
whiteList['max-height'] = true; // default: none
|
||
whiteList['max-lines'] = false; // default: none
|
||
whiteList['max-width'] = true; // default: none
|
||
whiteList['min-height'] = true; // default: 0
|
||
whiteList['min-width'] = true; // default: 0
|
||
whiteList['move-to'] = false; // default: normal
|
||
whiteList['nav-down'] = false; // default: auto
|
||
whiteList['nav-index'] = false; // default: auto
|
||
whiteList['nav-left'] = false; // default: auto
|
||
whiteList['nav-right'] = false; // default: auto
|
||
whiteList['nav-up'] = false; // default: auto
|
||
whiteList['object-fit'] = false; // default: fill
|
||
whiteList['object-position'] = false; // default: 50% 50%
|
||
whiteList['opacity'] = false; // default: 1
|
||
whiteList['order'] = false; // default: 0
|
||
whiteList['orphans'] = false; // default: 2
|
||
whiteList['outline'] = false; // default: depending on individual properties
|
||
whiteList['outline-color'] = false; // default: invert
|
||
whiteList['outline-offset'] = false; // default: 0
|
||
whiteList['outline-style'] = false; // default: none
|
||
whiteList['outline-width'] = false; // default: medium
|
||
whiteList['overflow'] = false; // default: depending on individual properties
|
||
whiteList['overflow-wrap'] = false; // default: normal
|
||
whiteList['overflow-x'] = false; // default: visible
|
||
whiteList['overflow-y'] = false; // default: visible
|
||
whiteList['padding'] = true; // default: depending on individual properties
|
||
whiteList['padding-bottom'] = true; // default: 0
|
||
whiteList['padding-left'] = true; // default: 0
|
||
whiteList['padding-right'] = true; // default: 0
|
||
whiteList['padding-top'] = true; // default: 0
|
||
whiteList['page'] = false; // default: auto
|
||
whiteList['page-break-after'] = false; // default: auto
|
||
whiteList['page-break-before'] = false; // default: auto
|
||
whiteList['page-break-inside'] = false; // default: auto
|
||
whiteList['page-policy'] = false; // default: start
|
||
whiteList['pause'] = false; // default: implementation dependent
|
||
whiteList['pause-after'] = false; // default: implementation dependent
|
||
whiteList['pause-before'] = false; // default: implementation dependent
|
||
whiteList['perspective'] = false; // default: none
|
||
whiteList['perspective-origin'] = false; // default: 50% 50%
|
||
whiteList['pitch'] = false; // default: medium
|
||
whiteList['pitch-range'] = false; // default: 50
|
||
whiteList['play-during'] = false; // default: auto
|
||
whiteList['position'] = false; // default: static
|
||
whiteList['presentation-level'] = false; // default: 0
|
||
whiteList['quotes'] = false; // default: text
|
||
whiteList['region-fragment'] = false; // default: auto
|
||
whiteList['resize'] = false; // default: none
|
||
whiteList['rest'] = false; // default: depending on individual properties
|
||
whiteList['rest-after'] = false; // default: none
|
||
whiteList['rest-before'] = false; // default: none
|
||
whiteList['richness'] = false; // default: 50
|
||
whiteList['right'] = false; // default: auto
|
||
whiteList['rotation'] = false; // default: 0
|
||
whiteList['rotation-point'] = false; // default: 50% 50%
|
||
whiteList['ruby-align'] = false; // default: auto
|
||
whiteList['ruby-merge'] = false; // default: separate
|
||
whiteList['ruby-position'] = false; // default: before
|
||
whiteList['shape-image-threshold'] = false; // default: 0.0
|
||
whiteList['shape-outside'] = false; // default: none
|
||
whiteList['shape-margin'] = false; // default: 0
|
||
whiteList['size'] = false; // default: auto
|
||
whiteList['speak'] = false; // default: auto
|
||
whiteList['speak-as'] = false; // default: normal
|
||
whiteList['speak-header'] = false; // default: once
|
||
whiteList['speak-numeral'] = false; // default: continuous
|
||
whiteList['speak-punctuation'] = false; // default: none
|
||
whiteList['speech-rate'] = false; // default: medium
|
||
whiteList['stress'] = false; // default: 50
|
||
whiteList['string-set'] = false; // default: none
|
||
whiteList['tab-size'] = false; // default: 8
|
||
whiteList['table-layout'] = false; // default: auto
|
||
whiteList['text-align'] = true; // default: start
|
||
whiteList['text-align-last'] = true; // default: auto
|
||
whiteList['text-combine-upright'] = true; // default: none
|
||
whiteList['text-decoration'] = true; // default: none
|
||
whiteList['text-decoration-color'] = true; // default: currentColor
|
||
whiteList['text-decoration-line'] = true; // default: none
|
||
whiteList['text-decoration-skip'] = true; // default: objects
|
||
whiteList['text-decoration-style'] = true; // default: solid
|
||
whiteList['text-emphasis'] = true; // default: depending on individual properties
|
||
whiteList['text-emphasis-color'] = true; // default: currentColor
|
||
whiteList['text-emphasis-position'] = true; // default: over right
|
||
whiteList['text-emphasis-style'] = true; // default: none
|
||
whiteList['text-height'] = true; // default: auto
|
||
whiteList['text-indent'] = true; // default: 0
|
||
whiteList['text-justify'] = true; // default: auto
|
||
whiteList['text-orientation'] = true; // default: mixed
|
||
whiteList['text-overflow'] = true; // default: clip
|
||
whiteList['text-shadow'] = true; // default: none
|
||
whiteList['text-space-collapse'] = true; // default: collapse
|
||
whiteList['text-transform'] = true; // default: none
|
||
whiteList['text-underline-position'] = true; // default: auto
|
||
whiteList['text-wrap'] = true; // default: normal
|
||
whiteList['top'] = false; // default: auto
|
||
whiteList['transform'] = false; // default: none
|
||
whiteList['transform-origin'] = false; // default: 50% 50% 0
|
||
whiteList['transform-style'] = false; // default: flat
|
||
whiteList['transition'] = false; // default: depending on individual properties
|
||
whiteList['transition-delay'] = false; // default: 0s
|
||
whiteList['transition-duration'] = false; // default: 0s
|
||
whiteList['transition-property'] = false; // default: all
|
||
whiteList['transition-timing-function'] = false; // default: ease
|
||
whiteList['unicode-bidi'] = false; // default: normal
|
||
whiteList['vertical-align'] = false; // default: baseline
|
||
whiteList['visibility'] = false; // default: visible
|
||
whiteList['voice-balance'] = false; // default: center
|
||
whiteList['voice-duration'] = false; // default: auto
|
||
whiteList['voice-family'] = false; // default: implementation dependent
|
||
whiteList['voice-pitch'] = false; // default: medium
|
||
whiteList['voice-range'] = false; // default: medium
|
||
whiteList['voice-rate'] = false; // default: normal
|
||
whiteList['voice-stress'] = false; // default: normal
|
||
whiteList['voice-volume'] = false; // default: medium
|
||
whiteList['volume'] = false; // default: medium
|
||
whiteList['white-space'] = false; // default: normal
|
||
whiteList['widows'] = false; // default: 2
|
||
whiteList['width'] = true; // default: auto
|
||
whiteList['will-change'] = false; // default: auto
|
||
whiteList['word-break'] = true; // default: normal
|
||
whiteList['word-spacing'] = true; // default: normal
|
||
whiteList['word-wrap'] = true; // default: normal
|
||
whiteList['wrap-flow'] = false; // default: auto
|
||
whiteList['wrap-through'] = false; // default: wrap
|
||
whiteList['writing-mode'] = false; // default: horizontal-tb
|
||
whiteList['z-index'] = false; // default: auto
|
||
|
||
return whiteList;
|
||
}
|
||
|
||
|
||
/**
|
||
* 匹配到白名单上的一个属性时
|
||
*
|
||
* @param {String} name
|
||
* @param {String} value
|
||
* @param {Object} options
|
||
* @return {String}
|
||
*/
|
||
function onAttr (name, value, options) {
|
||
// do nothing
|
||
}
|
||
|
||
/**
|
||
* 匹配到不在白名单上的一个属性时
|
||
*
|
||
* @param {String} name
|
||
* @param {String} value
|
||
* @param {Object} options
|
||
* @return {String}
|
||
*/
|
||
function onIgnoreAttr (name, value, options) {
|
||
// do nothing
|
||
}
|
||
|
||
var REGEXP_URL_JAVASCRIPT = /javascript\s*\:/img;
|
||
|
||
/**
|
||
* 过滤属性值
|
||
*
|
||
* @param {String} name
|
||
* @param {String} value
|
||
* @return {String}
|
||
*/
|
||
function safeAttrValue(name, value) {
|
||
if (REGEXP_URL_JAVASCRIPT.test(value)) return '';
|
||
return value;
|
||
}
|
||
|
||
|
||
exports.whiteList = getDefaultWhiteList();
|
||
exports.getDefaultWhiteList = getDefaultWhiteList;
|
||
exports.onAttr = onAttr;
|
||
exports.onIgnoreAttr = onIgnoreAttr;
|
||
exports.safeAttrValue = safeAttrValue;
|
||
|
||
|
||
/***/ }),
|
||
/* 131 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = {
|
||
indexOf: function (arr, item) {
|
||
var i, j;
|
||
if (Array.prototype.indexOf) {
|
||
return arr.indexOf(item);
|
||
}
|
||
for (i = 0, j = arr.length; i < j; i++) {
|
||
if (arr[i] === item) {
|
||
return i;
|
||
}
|
||
}
|
||
return -1;
|
||
},
|
||
forEach: function (arr, fn, scope) {
|
||
var i, j;
|
||
if (Array.prototype.forEach) {
|
||
return arr.forEach(fn, scope);
|
||
}
|
||
for (i = 0, j = arr.length; i < j; i++) {
|
||
fn.call(scope, arr[i], i, arr);
|
||
}
|
||
},
|
||
trim: function (str) {
|
||
if (String.prototype.trim) {
|
||
return str.trim();
|
||
}
|
||
return str.replace(/(^\s*)|(\s*$)/g, '');
|
||
},
|
||
trimRight: function (str) {
|
||
if (String.prototype.trimRight) {
|
||
return str.trimRight();
|
||
}
|
||
return str.replace(/(\s*$)/g, '');
|
||
}
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 132 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
/**
|
||
* Simple HTML Parser
|
||
*
|
||
* @author Zongmin Lei<leizongmin@gmail.com>
|
||
*/
|
||
|
||
var _ = __webpack_require__(83);
|
||
|
||
/**
|
||
* get tag name
|
||
*
|
||
* @param {String} html e.g. '<a hef="#">'
|
||
* @return {String}
|
||
*/
|
||
function getTagName(html) {
|
||
var i = _.spaceIndex(html);
|
||
if (i === -1) {
|
||
var tagName = html.slice(1, -1);
|
||
} else {
|
||
var tagName = html.slice(1, i + 1);
|
||
}
|
||
tagName = _.trim(tagName).toLowerCase();
|
||
if (tagName.slice(0, 1) === "/") tagName = tagName.slice(1);
|
||
if (tagName.slice(-1) === "/") tagName = tagName.slice(0, -1);
|
||
return tagName;
|
||
}
|
||
|
||
/**
|
||
* is close tag?
|
||
*
|
||
* @param {String} html 如:'<a hef="#">'
|
||
* @return {Boolean}
|
||
*/
|
||
function isClosing(html) {
|
||
return html.slice(0, 2) === "</";
|
||
}
|
||
|
||
/**
|
||
* parse input html and returns processed html
|
||
*
|
||
* @param {String} html
|
||
* @param {Function} onTag e.g. function (sourcePosition, position, tag, html, isClosing)
|
||
* @param {Function} escapeHtml
|
||
* @return {String}
|
||
*/
|
||
function parseTag(html, onTag, escapeHtml) {
|
||
"use strict";
|
||
|
||
var rethtml = "";
|
||
var lastPos = 0;
|
||
var tagStart = false;
|
||
var quoteStart = false;
|
||
var currentPos = 0;
|
||
var len = html.length;
|
||
var currentTagName = "";
|
||
var currentHtml = "";
|
||
|
||
chariterator: for (currentPos = 0; currentPos < len; currentPos++) {
|
||
var c = html.charAt(currentPos);
|
||
if (tagStart === false) {
|
||
if (c === "<") {
|
||
tagStart = currentPos;
|
||
continue;
|
||
}
|
||
} else {
|
||
if (quoteStart === false) {
|
||
if (c === "<") {
|
||
rethtml += escapeHtml(html.slice(lastPos, currentPos));
|
||
tagStart = currentPos;
|
||
lastPos = currentPos;
|
||
continue;
|
||
}
|
||
if (c === ">") {
|
||
rethtml += escapeHtml(html.slice(lastPos, tagStart));
|
||
currentHtml = html.slice(tagStart, currentPos + 1);
|
||
currentTagName = getTagName(currentHtml);
|
||
rethtml += onTag(
|
||
tagStart,
|
||
rethtml.length,
|
||
currentTagName,
|
||
currentHtml,
|
||
isClosing(currentHtml)
|
||
);
|
||
lastPos = currentPos + 1;
|
||
tagStart = false;
|
||
continue;
|
||
}
|
||
if ((c === '"' || c === "'")) {
|
||
var i = 1;
|
||
var ic = html.charAt(currentPos - i);
|
||
|
||
while ((ic === " ") || (ic === "=")) {
|
||
if (ic === "=") {
|
||
quoteStart = c;
|
||
continue chariterator;
|
||
}
|
||
ic = html.charAt(currentPos - ++i);
|
||
}
|
||
}
|
||
} else {
|
||
if (c === quoteStart) {
|
||
quoteStart = false;
|
||
continue;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
if (lastPos < html.length) {
|
||
rethtml += escapeHtml(html.substr(lastPos));
|
||
}
|
||
|
||
return rethtml;
|
||
}
|
||
|
||
var REGEXP_ILLEGAL_ATTR_NAME = /[^a-zA-Z0-9_:\.\-]/gim;
|
||
|
||
/**
|
||
* parse input attributes and returns processed attributes
|
||
*
|
||
* @param {String} html e.g. `href="#" target="_blank"`
|
||
* @param {Function} onAttr e.g. `function (name, value)`
|
||
* @return {String}
|
||
*/
|
||
function parseAttr(html, onAttr) {
|
||
"use strict";
|
||
|
||
var lastPos = 0;
|
||
var retAttrs = [];
|
||
var tmpName = false;
|
||
var len = html.length;
|
||
|
||
function addAttr(name, value) {
|
||
name = _.trim(name);
|
||
name = name.replace(REGEXP_ILLEGAL_ATTR_NAME, "").toLowerCase();
|
||
if (name.length < 1) return;
|
||
var ret = onAttr(name, value || "");
|
||
if (ret) retAttrs.push(ret);
|
||
}
|
||
|
||
// 逐个分析字符
|
||
for (var i = 0; i < len; i++) {
|
||
var c = html.charAt(i);
|
||
var v, j;
|
||
if (tmpName === false && c === "=") {
|
||
tmpName = html.slice(lastPos, i);
|
||
lastPos = i + 1;
|
||
continue;
|
||
}
|
||
if (tmpName !== false) {
|
||
if (
|
||
i === lastPos &&
|
||
(c === '"' || c === "'") &&
|
||
html.charAt(i - 1) === "="
|
||
) {
|
||
j = html.indexOf(c, i + 1);
|
||
if (j === -1) {
|
||
break;
|
||
} else {
|
||
v = _.trim(html.slice(lastPos + 1, j));
|
||
addAttr(tmpName, v);
|
||
tmpName = false;
|
||
i = j;
|
||
lastPos = i + 1;
|
||
continue;
|
||
}
|
||
}
|
||
}
|
||
if (/\s|\n|\t/.test(c)) {
|
||
html = html.replace(/\s|\n|\t/g, " ");
|
||
if (tmpName === false) {
|
||
j = findNextEqual(html, i);
|
||
if (j === -1) {
|
||
v = _.trim(html.slice(lastPos, i));
|
||
addAttr(v);
|
||
tmpName = false;
|
||
lastPos = i + 1;
|
||
continue;
|
||
} else {
|
||
i = j - 1;
|
||
continue;
|
||
}
|
||
} else {
|
||
j = findBeforeEqual(html, i - 1);
|
||
if (j === -1) {
|
||
v = _.trim(html.slice(lastPos, i));
|
||
v = stripQuoteWrap(v);
|
||
addAttr(tmpName, v);
|
||
tmpName = false;
|
||
lastPos = i + 1;
|
||
continue;
|
||
} else {
|
||
continue;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
if (lastPos < html.length) {
|
||
if (tmpName === false) {
|
||
addAttr(html.slice(lastPos));
|
||
} else {
|
||
addAttr(tmpName, stripQuoteWrap(_.trim(html.slice(lastPos))));
|
||
}
|
||
}
|
||
|
||
return _.trim(retAttrs.join(" "));
|
||
}
|
||
|
||
function findNextEqual(str, i) {
|
||
for (; i < str.length; i++) {
|
||
var c = str[i];
|
||
if (c === " ") continue;
|
||
if (c === "=") return i;
|
||
return -1;
|
||
}
|
||
}
|
||
|
||
function findBeforeEqual(str, i) {
|
||
for (; i > 0; i--) {
|
||
var c = str[i];
|
||
if (c === " ") continue;
|
||
if (c === "=") return i;
|
||
return -1;
|
||
}
|
||
}
|
||
|
||
function isQuoteWrapString(text) {
|
||
if (
|
||
(text[0] === '"' && text[text.length - 1] === '"') ||
|
||
(text[0] === "'" && text[text.length - 1] === "'")
|
||
) {
|
||
return true;
|
||
} else {
|
||
return false;
|
||
}
|
||
}
|
||
|
||
function stripQuoteWrap(text) {
|
||
if (isQuoteWrapString(text)) {
|
||
return text.substr(1, text.length - 2);
|
||
} else {
|
||
return text;
|
||
}
|
||
}
|
||
|
||
exports.parseTag = parseTag;
|
||
exports.parseAttr = parseAttr;
|
||
|
||
|
||
/***/ }),
|
||
/* 133 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
var requestFrame = function () {
|
||
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function fallbackRAF(func) {
|
||
return setTimeout(function () {
|
||
func && func();
|
||
}, 20);
|
||
};
|
||
return function requestFrameFunction(func) {
|
||
return raf(func);
|
||
};
|
||
}();
|
||
|
||
var cancelFrame = function () {
|
||
var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout;
|
||
return function cancelFrameFunction(id) {
|
||
return cancel(id);
|
||
};
|
||
}();
|
||
|
||
function resizeListener(e) {
|
||
var win = e.target || e.srcElement;
|
||
if (win.__resizeRAF__) {
|
||
cancelFrame(win.__resizeRAF__);
|
||
}
|
||
win.__resizeRAF__ = requestFrame(function () {
|
||
var trigger = win.__resizeTrigger__;
|
||
var listeners = trigger && trigger.__resizeListeners__;
|
||
if (listeners) {
|
||
listeners.forEach(function (fn) {
|
||
fn.call(trigger, e);
|
||
});
|
||
}
|
||
});
|
||
}
|
||
|
||
var exportsFn = function exportsFn(element, fn) {
|
||
var document = window.document;
|
||
var attachEvent = document.attachEvent;
|
||
function objectLoad() {
|
||
this.contentDocument.defaultView.__resizeTrigger__ = this.__resizeElement__;
|
||
this.contentDocument.defaultView.addEventListener('resize', resizeListener);
|
||
}
|
||
|
||
if (!element.__resizeListeners__) {
|
||
element.__resizeListeners__ = [];
|
||
if (attachEvent) {
|
||
element.__resizeTrigger__ = element;
|
||
element.attachEvent('onresize', resizeListener);
|
||
} else {
|
||
if (getComputedStyle(element).position === 'static') {
|
||
element.style.position = 'relative';
|
||
}
|
||
var obj = element.__resizeTrigger__ = document.createElement('object');
|
||
obj.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1; opacity: 0;');
|
||
obj.setAttribute('class', 'resize-sensor');
|
||
obj.__resizeElement__ = element;
|
||
obj.onload = objectLoad;
|
||
obj.type = 'text/html';
|
||
obj.data = 'about:blank';
|
||
element.appendChild(obj);
|
||
}
|
||
}
|
||
element.__resizeListeners__.push(fn);
|
||
};
|
||
|
||
exportsFn = typeof window === 'undefined' ? exportsFn : exportsFn.bind(window);
|
||
|
||
exportsFn.unbind = function (element, fn) {
|
||
var attachEvent = document.attachEvent;
|
||
var listeners = element.__resizeListeners__ || [];
|
||
if (fn) {
|
||
var index = listeners.indexOf(fn);
|
||
if (index !== -1) {
|
||
listeners.splice(index, 1);
|
||
}
|
||
} else {
|
||
listeners = element.__resizeListeners__ = [];
|
||
}
|
||
if (!listeners.length) {
|
||
if (attachEvent) {
|
||
element.detachEvent('onresize', resizeListener);
|
||
} else if (element.__resizeTrigger__) {
|
||
if (element.__resizeTrigger__.contentDocument) {
|
||
element.__resizeTrigger__.contentDocument.defaultView.removeEventListener('resize', resizeListener);
|
||
delete element.__resizeTrigger__.contentDocument.defaultView.__resizeTrigger__;
|
||
}
|
||
element.__resizeTrigger__ = !element.removeChild(element.__resizeTrigger__);
|
||
}
|
||
delete element.__resizeListeners__;
|
||
}
|
||
};
|
||
|
||
exports.default = exportsFn;
|
||
|
||
/***/ }),
|
||
/* 134 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(377),
|
||
/* template */
|
||
__webpack_require__(378),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/zoom/zoom.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] zoom.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-7de8ea51", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-7de8ea51", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 135 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(388),
|
||
/* template */
|
||
__webpack_require__(392),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tooltip/tooltip.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] tooltip.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-5ce53c39", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-5ce53c39", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 136 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _select = __webpack_require__(397);
|
||
|
||
var _select2 = _interopRequireDefault(_select);
|
||
|
||
var _option = __webpack_require__(400);
|
||
|
||
var _option2 = _interopRequireDefault(_option);
|
||
|
||
var _optionGroup = __webpack_require__(403);
|
||
|
||
var _optionGroup2 = _interopRequireDefault(_optionGroup);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
WbSelect: _select2.default,
|
||
WbOption: _option2.default,
|
||
OptionGroup: _optionGroup2.default
|
||
};
|
||
|
||
/***/ }),
|
||
/* 137 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _input = __webpack_require__(406);
|
||
|
||
var _input2 = _interopRequireDefault(_input);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _input2.default;
|
||
|
||
/***/ }),
|
||
/* 138 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
||
|
||
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 _util = __webpack_require__(4);
|
||
|
||
var _validator = __webpack_require__(432);
|
||
|
||
var _validator2 = _interopRequireDefault(_validator);
|
||
|
||
var _messages2 = __webpack_require__(452);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
/**
|
||
* Encapsulates a validation schema.
|
||
*
|
||
* @param descriptor An object declaring validation rules
|
||
* for this schema.
|
||
*/
|
||
function Schema(descriptor) {
|
||
this.rules = null;
|
||
this._messages = _messages2.messages;
|
||
this.define(descriptor);
|
||
}
|
||
|
||
Schema.prototype = {
|
||
messages: function messages(_messages) {
|
||
if (_messages) {
|
||
this._messages = (0, _util.deepMerge)((0, _messages2.newMessages)(), _messages);
|
||
}
|
||
return this._messages;
|
||
},
|
||
define: function define(rules) {
|
||
if (!rules) {
|
||
throw new Error('Cannot configure a schema with no rules');
|
||
}
|
||
if ((typeof rules === 'undefined' ? 'undefined' : _typeof(rules)) !== 'object' || Array.isArray(rules)) {
|
||
throw new Error('Rules must be an object');
|
||
}
|
||
this.rules = {};
|
||
var z = void 0;
|
||
var item = void 0;
|
||
for (z in rules) {
|
||
if (rules.hasOwnProperty(z)) {
|
||
item = rules[z];
|
||
this.rules[z] = Array.isArray(item) ? item : [item];
|
||
}
|
||
}
|
||
},
|
||
validate: function validate(source_) {
|
||
var _this = this;
|
||
|
||
var o = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||
var oc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
|
||
|
||
var source = source_;
|
||
var options = o;
|
||
var callback = oc;
|
||
if (typeof options === 'function') {
|
||
callback = options;
|
||
options = {};
|
||
}
|
||
if (!this.rules || Object.keys(this.rules).length === 0) {
|
||
if (callback) {
|
||
callback();
|
||
}
|
||
return Promise.resolve();
|
||
}
|
||
|
||
function complete(results) {
|
||
var i = void 0;
|
||
var errors = [];
|
||
var fields = {};
|
||
|
||
function add(e) {
|
||
if (Array.isArray(e)) {
|
||
var _errors;
|
||
|
||
errors = (_errors = errors).concat.apply(_errors, e);
|
||
} else {
|
||
errors.push(e);
|
||
}
|
||
}
|
||
|
||
for (i = 0; i < results.length; i++) {
|
||
add(results[i]);
|
||
}
|
||
if (!errors.length) {
|
||
errors = null;
|
||
fields = null;
|
||
} else {
|
||
fields = (0, _util.convertFieldsError)(errors);
|
||
}
|
||
callback(errors, fields);
|
||
}
|
||
|
||
if (options.messages) {
|
||
var messages = this.messages();
|
||
if (messages === _messages2.messages) {
|
||
messages = (0, _messages2.newMessages)();
|
||
}
|
||
(0, _util.deepMerge)(messages, options.messages);
|
||
options.messages = messages;
|
||
} else {
|
||
options.messages = this.messages();
|
||
}
|
||
var arr = void 0;
|
||
var value = void 0;
|
||
var series = {};
|
||
var keys = options.keys || Object.keys(this.rules);
|
||
keys.forEach(function (z) {
|
||
arr = _this.rules[z];
|
||
value = source[z];
|
||
arr.forEach(function (r) {
|
||
var rule = r;
|
||
if (typeof rule.transform === 'function') {
|
||
if (source === source_) {
|
||
source = _extends({}, source);
|
||
}
|
||
value = source[z] = rule.transform(value);
|
||
}
|
||
if (typeof rule === 'function') {
|
||
rule = {
|
||
validator: rule
|
||
};
|
||
} else {
|
||
rule = _extends({}, rule);
|
||
}
|
||
rule.validator = _this.getValidationMethod(rule);
|
||
rule.field = z;
|
||
rule.fullField = rule.fullField || z;
|
||
rule.type = _this.getType(rule);
|
||
if (!rule.validator) {
|
||
return;
|
||
}
|
||
series[z] = series[z] || [];
|
||
series[z].push({
|
||
rule: rule,
|
||
value: value,
|
||
source: source,
|
||
field: z
|
||
});
|
||
});
|
||
});
|
||
var errorFields = {};
|
||
return (0, _util.asyncMap)(series, options, function (data, doIt) {
|
||
var rule = data.rule;
|
||
var deep = (rule.type === 'object' || rule.type === 'array') && (_typeof(rule.fields) === 'object' || _typeof(rule.defaultField) === 'object');
|
||
deep = deep && (rule.required || !rule.required && data.value);
|
||
rule.field = data.field;
|
||
|
||
function addFullfield(key, schema) {
|
||
return _extends({}, schema, {
|
||
fullField: rule.fullField + '.' + key
|
||
});
|
||
}
|
||
|
||
function cb() {
|
||
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||
|
||
var errors = e;
|
||
if (!Array.isArray(errors)) {
|
||
errors = [errors];
|
||
}
|
||
if (!options.suppressWarning && errors.length) {
|
||
Schema.warning('async-validator:', errors);
|
||
}
|
||
if (errors.length && rule.message) {
|
||
errors = [].concat(rule.message);
|
||
}
|
||
|
||
errors = errors.map((0, _util.complementError)(rule));
|
||
|
||
if (options.first && errors.length) {
|
||
errorFields[rule.field] = 1;
|
||
return doIt(errors);
|
||
}
|
||
if (!deep) {
|
||
doIt(errors);
|
||
} else {
|
||
// if rule is required but the target object
|
||
// does not exist fail at the rule level and don't
|
||
// go deeper
|
||
if (rule.required && !data.value) {
|
||
if (rule.message) {
|
||
errors = [].concat(rule.message).map((0, _util.complementError)(rule));
|
||
} else if (options.error) {
|
||
errors = [options.error(rule, (0, _util.format)(options.messages.required, rule.field))];
|
||
} else {
|
||
errors = [];
|
||
}
|
||
return doIt(errors);
|
||
}
|
||
|
||
var fieldsSchema = {};
|
||
if (rule.defaultField) {
|
||
for (var k in data.value) {
|
||
if (data.value.hasOwnProperty(k)) {
|
||
fieldsSchema[k] = rule.defaultField;
|
||
}
|
||
}
|
||
}
|
||
fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);
|
||
for (var f in fieldsSchema) {
|
||
if (fieldsSchema.hasOwnProperty(f)) {
|
||
var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
|
||
fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
|
||
}
|
||
}
|
||
var schema = new Schema(fieldsSchema);
|
||
schema.messages(options.messages);
|
||
if (data.rule.options) {
|
||
data.rule.options.messages = options.messages;
|
||
data.rule.options.error = options.error;
|
||
}
|
||
schema.validate(data.value, data.rule.options || options, function (errs) {
|
||
var finalErrors = [];
|
||
if (errors && errors.length) {
|
||
finalErrors.push.apply(finalErrors, errors);
|
||
}
|
||
if (errs && errs.length) {
|
||
finalErrors.push.apply(finalErrors, errs);
|
||
}
|
||
doIt(finalErrors.length ? finalErrors : null);
|
||
});
|
||
}
|
||
}
|
||
|
||
var res = void 0;
|
||
if (rule.asyncValidator) {
|
||
res = rule.asyncValidator(rule, data.value, cb, data.source, options);
|
||
} else if (rule.validator) {
|
||
res = rule.validator(rule, data.value, cb, data.source, options);
|
||
if (res === true) {
|
||
cb();
|
||
} else if (res === false) {
|
||
cb(rule.message || rule.field + ' fails');
|
||
} else if (res instanceof Array) {
|
||
cb(res);
|
||
} else if (res instanceof Error) {
|
||
cb(res.message);
|
||
}
|
||
}
|
||
if (res && res.then) {
|
||
res.then(function () {
|
||
return cb();
|
||
}, function (e) {
|
||
return cb(e);
|
||
});
|
||
}
|
||
}, function (results) {
|
||
complete(results);
|
||
});
|
||
},
|
||
getType: function getType(rule) {
|
||
if (rule.type === undefined && rule.pattern instanceof RegExp) {
|
||
rule.type = 'pattern';
|
||
}
|
||
if (typeof rule.validator !== 'function' && rule.type && !_validator2['default'].hasOwnProperty(rule.type)) {
|
||
throw new Error((0, _util.format)('Unknown rule type %s', rule.type));
|
||
}
|
||
return rule.type || 'string';
|
||
},
|
||
getValidationMethod: function getValidationMethod(rule) {
|
||
if (typeof rule.validator === 'function') {
|
||
return rule.validator;
|
||
}
|
||
var keys = Object.keys(rule);
|
||
var messageIndex = keys.indexOf('message');
|
||
if (messageIndex !== -1) {
|
||
keys.splice(messageIndex, 1);
|
||
}
|
||
if (keys.length === 1 && keys[0] === 'required') {
|
||
return _validator2['default'].required;
|
||
}
|
||
return _validator2['default'][this.getType(rule)] || false;
|
||
}
|
||
};
|
||
|
||
Schema.register = function register(type, validator) {
|
||
if (typeof validator !== 'function') {
|
||
throw new Error('Cannot register a validator by type, validator is not a function');
|
||
}
|
||
_validator2['default'][type] = validator;
|
||
};
|
||
|
||
Schema.warning = _util.warning;
|
||
|
||
Schema.messages = _messages2.messages;
|
||
|
||
exports['default'] = Schema;
|
||
|
||
/***/ }),
|
||
/* 139 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
|
||
|
||
/**
|
||
* Rule for validating required fields.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param source The source object being validated.
|
||
* @param errors An array of errors that this rule may add
|
||
* validation errors to.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function required(rule, value, source, errors, options, type) {
|
||
if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type || rule.type))) {
|
||
errors.push(util.format(options.messages.required, rule.fullField));
|
||
}
|
||
}
|
||
|
||
exports['default'] = required;
|
||
|
||
/***/ }),
|
||
/* 140 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(459),
|
||
/* template */
|
||
__webpack_require__(460),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/menu/menu.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] menu.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-6df37c5e", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-6df37c5e", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 141 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(461),
|
||
/* template */
|
||
__webpack_require__(462),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/menu/subMenu.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] subMenu.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-526ceb3d", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-526ceb3d", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 142 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(463),
|
||
/* template */
|
||
__webpack_require__(464),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/menu/menuItem.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] menuItem.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-34a7c9f8", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-34a7c9f8", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 143 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
var EventListener = {
|
||
|
||
/**
|
||
* Listen to DOM events during the bubble phase.
|
||
*
|
||
* @param {DOMEventTarget} target DOM element to register listener on.
|
||
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
|
||
* @param {function} callback Callback function.
|
||
* @return {object} Object with a `remove` method.
|
||
*/
|
||
listen: function listen(target, eventType, callback) {
|
||
var proxy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
||
|
||
if (target.addEventListener) {
|
||
target.addEventListener(eventType, callback, proxy);
|
||
return {
|
||
remove: function remove() {
|
||
target.removeEventListener(eventType, callback, proxy);
|
||
}
|
||
};
|
||
}
|
||
// attachEvent作为fallback的函数,else不需要再做判断
|
||
target.attachEvent("on" + eventType, callback, proxy);
|
||
return {
|
||
remove: function remove() {
|
||
target.detachEvent("on" + eventType, callback, proxy);
|
||
}
|
||
};
|
||
}
|
||
};
|
||
|
||
exports.default = EventListener;
|
||
|
||
/***/ }),
|
||
/* 144 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(490),
|
||
/* template */
|
||
__webpack_require__(491),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/dropdown-com/dropdownMenu.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] dropdownMenu.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-3bf5e95c", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-3bf5e95c", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 145 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(146);
|
||
module.exports = __webpack_require__(201);
|
||
|
||
|
||
/***/ }),
|
||
/* 146 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(147);
|
||
__webpack_require__(151);
|
||
__webpack_require__(152);
|
||
__webpack_require__(153);
|
||
__webpack_require__(156);
|
||
__webpack_require__(158);
|
||
__webpack_require__(159);
|
||
__webpack_require__(162);
|
||
__webpack_require__(163);
|
||
__webpack_require__(164);
|
||
__webpack_require__(165);
|
||
__webpack_require__(166);
|
||
__webpack_require__(167);
|
||
__webpack_require__(168);
|
||
__webpack_require__(171);
|
||
__webpack_require__(172);
|
||
__webpack_require__(173);
|
||
__webpack_require__(174);
|
||
__webpack_require__(175);
|
||
__webpack_require__(179);
|
||
__webpack_require__(180);
|
||
__webpack_require__(181);
|
||
__webpack_require__(182);
|
||
__webpack_require__(183);
|
||
__webpack_require__(184);
|
||
__webpack_require__(185);
|
||
__webpack_require__(186);
|
||
__webpack_require__(187);
|
||
__webpack_require__(189);
|
||
__webpack_require__(190);
|
||
__webpack_require__(191);
|
||
__webpack_require__(193);
|
||
__webpack_require__(194);
|
||
__webpack_require__(196);
|
||
__webpack_require__(198);
|
||
__webpack_require__(199);
|
||
module.exports = __webpack_require__(33);
|
||
|
||
|
||
/***/ }),
|
||
/* 147 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var $export = __webpack_require__(2);
|
||
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
|
||
$export($export.S, 'Object', { create: __webpack_require__(150) });
|
||
|
||
|
||
/***/ }),
|
||
/* 148 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = __webpack_require__(61)('native-function-to-string', Function.toString);
|
||
|
||
|
||
/***/ }),
|
||
/* 149 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = false;
|
||
|
||
|
||
/***/ }),
|
||
/* 150 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
|
||
var anObject = __webpack_require__(35);
|
||
var dPs = __webpack_require__(92);
|
||
var enumBugKeys = __webpack_require__(63);
|
||
var IE_PROTO = __webpack_require__(62)('IE_PROTO');
|
||
var Empty = function () { /* empty */ };
|
||
var PROTOTYPE = 'prototype';
|
||
|
||
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
||
var createDict = function () {
|
||
// Thrash, waste and sodomy: IE GC bug
|
||
var iframe = __webpack_require__(88)('iframe');
|
||
var i = enumBugKeys.length;
|
||
var lt = '<';
|
||
var gt = '>';
|
||
var iframeDocument;
|
||
iframe.style.display = 'none';
|
||
__webpack_require__(97).appendChild(iframe);
|
||
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
|
||
// createDict = iframe.contentWindow.Object;
|
||
// html.removeChild(iframe);
|
||
iframeDocument = iframe.contentWindow.document;
|
||
iframeDocument.open();
|
||
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
||
iframeDocument.close();
|
||
createDict = iframeDocument.F;
|
||
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
|
||
return createDict();
|
||
};
|
||
|
||
module.exports = Object.create || function create(O, Properties) {
|
||
var result;
|
||
if (O !== null) {
|
||
Empty[PROTOTYPE] = anObject(O);
|
||
result = new Empty();
|
||
Empty[PROTOTYPE] = null;
|
||
// add "__proto__" for Object.getPrototypeOf polyfill
|
||
result[IE_PROTO] = O;
|
||
} else result = createDict();
|
||
return Properties === undefined ? result : dPs(result, Properties);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 151 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var $export = __webpack_require__(2);
|
||
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
|
||
$export($export.S + $export.F * !__webpack_require__(16), 'Object', { defineProperty: __webpack_require__(34).f });
|
||
|
||
|
||
/***/ }),
|
||
/* 152 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var $export = __webpack_require__(2);
|
||
// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
|
||
$export($export.S + $export.F * !__webpack_require__(16), 'Object', { defineProperties: __webpack_require__(92) });
|
||
|
||
|
||
/***/ }),
|
||
/* 153 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
|
||
var toIObject = __webpack_require__(22);
|
||
var $getOwnPropertyDescriptor = __webpack_require__(154).f;
|
||
|
||
__webpack_require__(15)('getOwnPropertyDescriptor', function () {
|
||
return function getOwnPropertyDescriptor(it, key) {
|
||
return $getOwnPropertyDescriptor(toIObject(it), key);
|
||
};
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 154 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var pIE = __webpack_require__(155);
|
||
var createDesc = __webpack_require__(89);
|
||
var toIObject = __webpack_require__(22);
|
||
var toPrimitive = __webpack_require__(60);
|
||
var has = __webpack_require__(36);
|
||
var IE8_DOM_DEFINE = __webpack_require__(87);
|
||
var gOPD = Object.getOwnPropertyDescriptor;
|
||
|
||
exports.f = __webpack_require__(16) ? gOPD : function getOwnPropertyDescriptor(O, P) {
|
||
O = toIObject(O);
|
||
P = toPrimitive(P, true);
|
||
if (IE8_DOM_DEFINE) try {
|
||
return gOPD(O, P);
|
||
} catch (e) { /* empty */ }
|
||
if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 155 */
|
||
/***/ (function(module, exports) {
|
||
|
||
exports.f = {}.propertyIsEnumerable;
|
||
|
||
|
||
/***/ }),
|
||
/* 156 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.9 Object.getPrototypeOf(O)
|
||
var toObject = __webpack_require__(23);
|
||
var $getPrototypeOf = __webpack_require__(157);
|
||
|
||
__webpack_require__(15)('getPrototypeOf', function () {
|
||
return function getPrototypeOf(it) {
|
||
return $getPrototypeOf(toObject(it));
|
||
};
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 157 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
|
||
var has = __webpack_require__(36);
|
||
var toObject = __webpack_require__(23);
|
||
var IE_PROTO = __webpack_require__(62)('IE_PROTO');
|
||
var ObjectProto = Object.prototype;
|
||
|
||
module.exports = Object.getPrototypeOf || function (O) {
|
||
O = toObject(O);
|
||
if (has(O, IE_PROTO)) return O[IE_PROTO];
|
||
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
||
return O.constructor.prototype;
|
||
} return O instanceof Object ? ObjectProto : null;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 158 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.14 Object.keys(O)
|
||
var toObject = __webpack_require__(23);
|
||
var $keys = __webpack_require__(93);
|
||
|
||
__webpack_require__(15)('keys', function () {
|
||
return function keys(it) {
|
||
return $keys(toObject(it));
|
||
};
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 159 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.7 Object.getOwnPropertyNames(O)
|
||
__webpack_require__(15)('getOwnPropertyNames', function () {
|
||
return __webpack_require__(160).f;
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 160 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
|
||
var toIObject = __webpack_require__(22);
|
||
var gOPN = __webpack_require__(161).f;
|
||
var toString = {}.toString;
|
||
|
||
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
||
? Object.getOwnPropertyNames(window) : [];
|
||
|
||
var getWindowNames = function (it) {
|
||
try {
|
||
return gOPN(it);
|
||
} catch (e) {
|
||
return windowNames.slice();
|
||
}
|
||
};
|
||
|
||
module.exports.f = function getOwnPropertyNames(it) {
|
||
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 161 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
|
||
var $keys = __webpack_require__(94);
|
||
var hiddenKeys = __webpack_require__(63).concat('length', 'prototype');
|
||
|
||
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
||
return $keys(O, hiddenKeys);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 162 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.5 Object.freeze(O)
|
||
var isObject = __webpack_require__(11);
|
||
var meta = __webpack_require__(64).onFreeze;
|
||
|
||
__webpack_require__(15)('freeze', function ($freeze) {
|
||
return function freeze(it) {
|
||
return $freeze && isObject(it) ? $freeze(meta(it)) : it;
|
||
};
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 163 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.17 Object.seal(O)
|
||
var isObject = __webpack_require__(11);
|
||
var meta = __webpack_require__(64).onFreeze;
|
||
|
||
__webpack_require__(15)('seal', function ($seal) {
|
||
return function seal(it) {
|
||
return $seal && isObject(it) ? $seal(meta(it)) : it;
|
||
};
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 164 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.15 Object.preventExtensions(O)
|
||
var isObject = __webpack_require__(11);
|
||
var meta = __webpack_require__(64).onFreeze;
|
||
|
||
__webpack_require__(15)('preventExtensions', function ($preventExtensions) {
|
||
return function preventExtensions(it) {
|
||
return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
|
||
};
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 165 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.12 Object.isFrozen(O)
|
||
var isObject = __webpack_require__(11);
|
||
|
||
__webpack_require__(15)('isFrozen', function ($isFrozen) {
|
||
return function isFrozen(it) {
|
||
return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
|
||
};
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 166 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.13 Object.isSealed(O)
|
||
var isObject = __webpack_require__(11);
|
||
|
||
__webpack_require__(15)('isSealed', function ($isSealed) {
|
||
return function isSealed(it) {
|
||
return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
|
||
};
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 167 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.11 Object.isExtensible(O)
|
||
var isObject = __webpack_require__(11);
|
||
|
||
__webpack_require__(15)('isExtensible', function ($isExtensible) {
|
||
return function isExtensible(it) {
|
||
return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
|
||
};
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 168 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
|
||
var $export = __webpack_require__(2);
|
||
|
||
$export($export.P, 'Function', { bind: __webpack_require__(169) });
|
||
|
||
|
||
/***/ }),
|
||
/* 169 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var aFunction = __webpack_require__(45);
|
||
var isObject = __webpack_require__(11);
|
||
var invoke = __webpack_require__(170);
|
||
var arraySlice = [].slice;
|
||
var factories = {};
|
||
|
||
var construct = function (F, len, args) {
|
||
if (!(len in factories)) {
|
||
for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
|
||
// eslint-disable-next-line no-new-func
|
||
factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
|
||
} return factories[len](F, args);
|
||
};
|
||
|
||
module.exports = Function.bind || function bind(that /* , ...args */) {
|
||
var fn = aFunction(this);
|
||
var partArgs = arraySlice.call(arguments, 1);
|
||
var bound = function (/* args... */) {
|
||
var args = partArgs.concat(arraySlice.call(arguments));
|
||
return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
|
||
};
|
||
if (isObject(fn.prototype)) bound.prototype = fn.prototype;
|
||
return bound;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 170 */
|
||
/***/ (function(module, exports) {
|
||
|
||
// fast apply, http://jsperf.lnkit.com/fast-apply/5
|
||
module.exports = function (fn, args, that) {
|
||
var un = that === undefined;
|
||
switch (args.length) {
|
||
case 0: return un ? fn()
|
||
: fn.call(that);
|
||
case 1: return un ? fn(args[0])
|
||
: fn.call(that, args[0]);
|
||
case 2: return un ? fn(args[0], args[1])
|
||
: fn.call(that, args[0], args[1]);
|
||
case 3: return un ? fn(args[0], args[1], args[2])
|
||
: fn.call(that, args[0], args[1], args[2]);
|
||
case 4: return un ? fn(args[0], args[1], args[2], args[3])
|
||
: fn.call(that, args[0], args[1], args[2], args[3]);
|
||
} return fn.apply(that, args);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 171 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
|
||
var $export = __webpack_require__(2);
|
||
|
||
$export($export.S, 'Array', { isArray: __webpack_require__(98) });
|
||
|
||
|
||
/***/ }),
|
||
/* 172 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
// 22.1.3.13 Array.prototype.join(separator)
|
||
var $export = __webpack_require__(2);
|
||
var toIObject = __webpack_require__(22);
|
||
var arrayJoin = [].join;
|
||
|
||
// fallback for not array-like strings
|
||
$export($export.P + $export.F * (__webpack_require__(46) != Object || !__webpack_require__(13)(arrayJoin)), 'Array', {
|
||
join: function join(separator) {
|
||
return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 173 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var html = __webpack_require__(97);
|
||
var cof = __webpack_require__(47);
|
||
var toAbsoluteIndex = __webpack_require__(96);
|
||
var toLength = __webpack_require__(37);
|
||
var arraySlice = [].slice;
|
||
|
||
// fallback for not array-like ES3 strings and DOM objects
|
||
$export($export.P + $export.F * __webpack_require__(10)(function () {
|
||
if (html) arraySlice.call(html);
|
||
}), 'Array', {
|
||
slice: function slice(begin, end) {
|
||
var len = toLength(this.length);
|
||
var klass = cof(this);
|
||
end = end === undefined ? len : end;
|
||
if (klass == 'Array') return arraySlice.call(this, begin, end);
|
||
var start = toAbsoluteIndex(begin, len);
|
||
var upTo = toAbsoluteIndex(end, len);
|
||
var size = toLength(upTo - start);
|
||
var cloned = new Array(size);
|
||
var i = 0;
|
||
for (; i < size; i++) cloned[i] = klass == 'String'
|
||
? this.charAt(start + i)
|
||
: this[start + i];
|
||
return cloned;
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 174 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var aFunction = __webpack_require__(45);
|
||
var toObject = __webpack_require__(23);
|
||
var fails = __webpack_require__(10);
|
||
var $sort = [].sort;
|
||
var test = [1, 2, 3];
|
||
|
||
$export($export.P + $export.F * (fails(function () {
|
||
// IE8-
|
||
test.sort(undefined);
|
||
}) || !fails(function () {
|
||
// V8 bug
|
||
test.sort(null);
|
||
// Old WebKit
|
||
}) || !__webpack_require__(13)($sort)), 'Array', {
|
||
// 22.1.3.25 Array.prototype.sort(comparefn)
|
||
sort: function sort(comparefn) {
|
||
return comparefn === undefined
|
||
? $sort.call(toObject(this))
|
||
: $sort.call(toObject(this), aFunction(comparefn));
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 175 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var $forEach = __webpack_require__(39)(0);
|
||
var STRICT = __webpack_require__(13)([].forEach, true);
|
||
|
||
$export($export.P + $export.F * !STRICT, 'Array', {
|
||
// 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
|
||
forEach: function forEach(callbackfn /* , thisArg */) {
|
||
return $forEach(this, callbackfn, arguments[1]);
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 176 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
|
||
var speciesConstructor = __webpack_require__(177);
|
||
|
||
module.exports = function (original, length) {
|
||
return new (speciesConstructor(original))(length);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 177 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var isObject = __webpack_require__(11);
|
||
var isArray = __webpack_require__(98);
|
||
var SPECIES = __webpack_require__(178)('species');
|
||
|
||
module.exports = function (original) {
|
||
var C;
|
||
if (isArray(original)) {
|
||
C = original.constructor;
|
||
// cross-realm fallback
|
||
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
||
if (isObject(C)) {
|
||
C = C[SPECIES];
|
||
if (C === null) C = undefined;
|
||
}
|
||
} return C === undefined ? Array : C;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 178 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var store = __webpack_require__(61)('wks');
|
||
var uid = __webpack_require__(44);
|
||
var Symbol = __webpack_require__(20).Symbol;
|
||
var USE_SYMBOL = typeof Symbol == 'function';
|
||
|
||
var $exports = module.exports = function (name) {
|
||
return store[name] || (store[name] =
|
||
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
|
||
};
|
||
|
||
$exports.store = store;
|
||
|
||
|
||
/***/ }),
|
||
/* 179 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var $map = __webpack_require__(39)(1);
|
||
|
||
$export($export.P + $export.F * !__webpack_require__(13)([].map, true), 'Array', {
|
||
// 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
|
||
map: function map(callbackfn /* , thisArg */) {
|
||
return $map(this, callbackfn, arguments[1]);
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 180 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var $filter = __webpack_require__(39)(2);
|
||
|
||
$export($export.P + $export.F * !__webpack_require__(13)([].filter, true), 'Array', {
|
||
// 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
|
||
filter: function filter(callbackfn /* , thisArg */) {
|
||
return $filter(this, callbackfn, arguments[1]);
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 181 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var $some = __webpack_require__(39)(3);
|
||
|
||
$export($export.P + $export.F * !__webpack_require__(13)([].some, true), 'Array', {
|
||
// 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
|
||
some: function some(callbackfn /* , thisArg */) {
|
||
return $some(this, callbackfn, arguments[1]);
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 182 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var $every = __webpack_require__(39)(4);
|
||
|
||
$export($export.P + $export.F * !__webpack_require__(13)([].every, true), 'Array', {
|
||
// 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
|
||
every: function every(callbackfn /* , thisArg */) {
|
||
return $every(this, callbackfn, arguments[1]);
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 183 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var $reduce = __webpack_require__(99);
|
||
|
||
$export($export.P + $export.F * !__webpack_require__(13)([].reduce, true), 'Array', {
|
||
// 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
|
||
reduce: function reduce(callbackfn /* , initialValue */) {
|
||
return $reduce(this, callbackfn, arguments.length, arguments[1], false);
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 184 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var $reduce = __webpack_require__(99);
|
||
|
||
$export($export.P + $export.F * !__webpack_require__(13)([].reduceRight, true), 'Array', {
|
||
// 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
|
||
reduceRight: function reduceRight(callbackfn /* , initialValue */) {
|
||
return $reduce(this, callbackfn, arguments.length, arguments[1], true);
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 185 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var $indexOf = __webpack_require__(95)(false);
|
||
var $native = [].indexOf;
|
||
var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
|
||
|
||
$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(13)($native)), 'Array', {
|
||
// 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
|
||
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
|
||
return NEGATIVE_ZERO
|
||
// convert -0 to +0
|
||
? $native.apply(this, arguments) || 0
|
||
: $indexOf(this, searchElement, arguments[1]);
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 186 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var toIObject = __webpack_require__(22);
|
||
var toInteger = __webpack_require__(38);
|
||
var toLength = __webpack_require__(37);
|
||
var $native = [].lastIndexOf;
|
||
var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
|
||
|
||
$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(13)($native)), 'Array', {
|
||
// 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
|
||
lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
|
||
// convert -0 to +0
|
||
if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;
|
||
var O = toIObject(this);
|
||
var length = toLength(O.length);
|
||
var index = length - 1;
|
||
if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));
|
||
if (index < 0) index = length + index;
|
||
for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;
|
||
return -1;
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 187 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var toInteger = __webpack_require__(38);
|
||
var aNumberValue = __webpack_require__(100);
|
||
var repeat = __webpack_require__(188);
|
||
var $toFixed = 1.0.toFixed;
|
||
var floor = Math.floor;
|
||
var data = [0, 0, 0, 0, 0, 0];
|
||
var ERROR = 'Number.toFixed: incorrect invocation!';
|
||
var ZERO = '0';
|
||
|
||
var multiply = function (n, c) {
|
||
var i = -1;
|
||
var c2 = c;
|
||
while (++i < 6) {
|
||
c2 += n * data[i];
|
||
data[i] = c2 % 1e7;
|
||
c2 = floor(c2 / 1e7);
|
||
}
|
||
};
|
||
var divide = function (n) {
|
||
var i = 6;
|
||
var c = 0;
|
||
while (--i >= 0) {
|
||
c += data[i];
|
||
data[i] = floor(c / n);
|
||
c = (c % n) * 1e7;
|
||
}
|
||
};
|
||
var numToString = function () {
|
||
var i = 6;
|
||
var s = '';
|
||
while (--i >= 0) {
|
||
if (s !== '' || i === 0 || data[i] !== 0) {
|
||
var t = String(data[i]);
|
||
s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
|
||
}
|
||
} return s;
|
||
};
|
||
var pow = function (x, n, acc) {
|
||
return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
|
||
};
|
||
var log = function (x) {
|
||
var n = 0;
|
||
var x2 = x;
|
||
while (x2 >= 4096) {
|
||
n += 12;
|
||
x2 /= 4096;
|
||
}
|
||
while (x2 >= 2) {
|
||
n += 1;
|
||
x2 /= 2;
|
||
} return n;
|
||
};
|
||
|
||
$export($export.P + $export.F * (!!$toFixed && (
|
||
0.00008.toFixed(3) !== '0.000' ||
|
||
0.9.toFixed(0) !== '1' ||
|
||
1.255.toFixed(2) !== '1.25' ||
|
||
1000000000000000128.0.toFixed(0) !== '1000000000000000128'
|
||
) || !__webpack_require__(10)(function () {
|
||
// V8 ~ Android 4.3-
|
||
$toFixed.call({});
|
||
})), 'Number', {
|
||
toFixed: function toFixed(fractionDigits) {
|
||
var x = aNumberValue(this, ERROR);
|
||
var f = toInteger(fractionDigits);
|
||
var s = '';
|
||
var m = ZERO;
|
||
var e, z, j, k;
|
||
if (f < 0 || f > 20) throw RangeError(ERROR);
|
||
// eslint-disable-next-line no-self-compare
|
||
if (x != x) return 'NaN';
|
||
if (x <= -1e21 || x >= 1e21) return String(x);
|
||
if (x < 0) {
|
||
s = '-';
|
||
x = -x;
|
||
}
|
||
if (x > 1e-21) {
|
||
e = log(x * pow(2, 69, 1)) - 69;
|
||
z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
|
||
z *= 0x10000000000000;
|
||
e = 52 - e;
|
||
if (e > 0) {
|
||
multiply(0, z);
|
||
j = f;
|
||
while (j >= 7) {
|
||
multiply(1e7, 0);
|
||
j -= 7;
|
||
}
|
||
multiply(pow(10, j, 1), 0);
|
||
j = e - 1;
|
||
while (j >= 23) {
|
||
divide(1 << 23);
|
||
j -= 23;
|
||
}
|
||
divide(1 << j);
|
||
multiply(1, 1);
|
||
divide(2);
|
||
m = numToString();
|
||
} else {
|
||
multiply(0, z);
|
||
multiply(1 << -e, 0);
|
||
m = numToString() + repeat.call(ZERO, f);
|
||
}
|
||
}
|
||
if (f > 0) {
|
||
k = m.length;
|
||
m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
|
||
} else {
|
||
m = s + m;
|
||
} return m;
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 188 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var toInteger = __webpack_require__(38);
|
||
var defined = __webpack_require__(48);
|
||
|
||
module.exports = function repeat(count) {
|
||
var str = String(defined(this));
|
||
var res = '';
|
||
var n = toInteger(count);
|
||
if (n < 0 || n == Infinity) throw RangeError("Count can't be negative");
|
||
for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;
|
||
return res;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 189 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var $fails = __webpack_require__(10);
|
||
var aNumberValue = __webpack_require__(100);
|
||
var $toPrecision = 1.0.toPrecision;
|
||
|
||
$export($export.P + $export.F * ($fails(function () {
|
||
// IE7-
|
||
return $toPrecision.call(1, undefined) !== '1';
|
||
}) || !$fails(function () {
|
||
// V8 ~ Android 4.3-
|
||
$toPrecision.call({});
|
||
})), 'Number', {
|
||
toPrecision: function toPrecision(precision) {
|
||
var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
|
||
return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 190 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 20.3.3.1 / 15.9.4.4 Date.now()
|
||
var $export = __webpack_require__(2);
|
||
|
||
$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });
|
||
|
||
|
||
/***/ }),
|
||
/* 191 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
|
||
var $export = __webpack_require__(2);
|
||
var toISOString = __webpack_require__(192);
|
||
|
||
// PhantomJS / old WebKit has a broken implementations
|
||
$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {
|
||
toISOString: toISOString
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 192 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
|
||
var fails = __webpack_require__(10);
|
||
var getTime = Date.prototype.getTime;
|
||
var $toISOString = Date.prototype.toISOString;
|
||
|
||
var lz = function (num) {
|
||
return num > 9 ? num : '0' + num;
|
||
};
|
||
|
||
// PhantomJS / old WebKit has a broken implementations
|
||
module.exports = (fails(function () {
|
||
return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
|
||
}) || !fails(function () {
|
||
$toISOString.call(new Date(NaN));
|
||
})) ? function toISOString() {
|
||
if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');
|
||
var d = this;
|
||
var y = d.getUTCFullYear();
|
||
var m = d.getUTCMilliseconds();
|
||
var s = y < 0 ? '-' : y > 9999 ? '+' : '';
|
||
return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
|
||
'-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
|
||
'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
|
||
':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
|
||
} : $toISOString;
|
||
|
||
|
||
/***/ }),
|
||
/* 193 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var $export = __webpack_require__(2);
|
||
var toObject = __webpack_require__(23);
|
||
var toPrimitive = __webpack_require__(60);
|
||
|
||
$export($export.P + $export.F * __webpack_require__(10)(function () {
|
||
return new Date(NaN).toJSON() !== null
|
||
|| Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
|
||
}), 'Date', {
|
||
// eslint-disable-next-line no-unused-vars
|
||
toJSON: function toJSON(key) {
|
||
var O = toObject(this);
|
||
var pv = toPrimitive(O);
|
||
return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 194 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var $export = __webpack_require__(2);
|
||
var $parseInt = __webpack_require__(195);
|
||
// 18.2.5 parseInt(string, radix)
|
||
$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });
|
||
|
||
|
||
/***/ }),
|
||
/* 195 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var $parseInt = __webpack_require__(20).parseInt;
|
||
var $trim = __webpack_require__(65).trim;
|
||
var ws = __webpack_require__(66);
|
||
var hex = /^[-+]?0[xX]/;
|
||
|
||
module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
|
||
var string = $trim(String(str), 3);
|
||
return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
|
||
} : $parseInt;
|
||
|
||
|
||
/***/ }),
|
||
/* 196 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var $export = __webpack_require__(2);
|
||
var $parseFloat = __webpack_require__(197);
|
||
// 18.2.4 parseFloat(string)
|
||
$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });
|
||
|
||
|
||
/***/ }),
|
||
/* 197 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var $parseFloat = __webpack_require__(20).parseFloat;
|
||
var $trim = __webpack_require__(65).trim;
|
||
|
||
module.exports = 1 / $parseFloat(__webpack_require__(66) + '-0') !== -Infinity ? function parseFloat(str) {
|
||
var string = $trim(String(str), 3);
|
||
var result = $parseFloat(string);
|
||
return result === 0 && string.charAt(0) == '-' ? -0 : result;
|
||
} : $parseFloat;
|
||
|
||
|
||
/***/ }),
|
||
/* 198 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
// 21.1.3.25 String.prototype.trim()
|
||
__webpack_require__(65)('trim', function ($trim) {
|
||
return function trim() {
|
||
return $trim(this, 3);
|
||
};
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 199 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
__webpack_require__(200);
|
||
var anObject = __webpack_require__(35);
|
||
var $flags = __webpack_require__(101);
|
||
var DESCRIPTORS = __webpack_require__(16);
|
||
var TO_STRING = 'toString';
|
||
var $toString = /./[TO_STRING];
|
||
|
||
var define = function (fn) {
|
||
__webpack_require__(90)(RegExp.prototype, TO_STRING, fn, true);
|
||
};
|
||
|
||
// 21.2.5.14 RegExp.prototype.toString()
|
||
if (__webpack_require__(10)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
|
||
define(function toString() {
|
||
var R = anObject(this);
|
||
return '/'.concat(R.source, '/',
|
||
'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
|
||
});
|
||
// FF44- RegExp#toString has a wrong name
|
||
} else if ($toString.name != TO_STRING) {
|
||
define(function toString() {
|
||
return $toString.call(this);
|
||
});
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
/* 200 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 21.2.5.3 get RegExp.prototype.flags()
|
||
if (__webpack_require__(16) && /./g.flags != 'g') __webpack_require__(34).f(RegExp.prototype, 'flags', {
|
||
configurable: true,
|
||
get: __webpack_require__(101)
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 201 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _assign = __webpack_require__(49);
|
||
|
||
var _assign2 = _interopRequireDefault(_assign);
|
||
|
||
var _keys = __webpack_require__(74);
|
||
|
||
var _keys2 = _interopRequireDefault(_keys);
|
||
|
||
var _layout = __webpack_require__(210);
|
||
|
||
var _layout2 = _interopRequireDefault(_layout);
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
var _button = __webpack_require__(75);
|
||
|
||
var _button2 = _interopRequireDefault(_button);
|
||
|
||
var _tabCom = __webpack_require__(223);
|
||
|
||
var _tabCom2 = _interopRequireDefault(_tabCom);
|
||
|
||
var _dataTable = __webpack_require__(252);
|
||
|
||
var _dataTable2 = _interopRequireDefault(_dataTable);
|
||
|
||
var _carousel = __webpack_require__(282);
|
||
|
||
var _carousel2 = _interopRequireDefault(_carousel);
|
||
|
||
var _datePicker = __webpack_require__(286);
|
||
|
||
var _datePicker2 = _interopRequireDefault(_datePicker);
|
||
|
||
var _loading = __webpack_require__(315);
|
||
|
||
var _loading2 = _interopRequireDefault(_loading);
|
||
|
||
var _message = __webpack_require__(318);
|
||
|
||
var _message2 = _interopRequireDefault(_message);
|
||
|
||
var _modal = __webpack_require__(339);
|
||
|
||
var _modal2 = _interopRequireDefault(_modal);
|
||
|
||
var _switch = __webpack_require__(347);
|
||
|
||
var _switch2 = _interopRequireDefault(_switch);
|
||
|
||
var _toast = __webpack_require__(84);
|
||
|
||
var _toast2 = _interopRequireDefault(_toast);
|
||
|
||
var _tree = __webpack_require__(357);
|
||
|
||
var _tree2 = _interopRequireDefault(_tree);
|
||
|
||
var _upload = __webpack_require__(366);
|
||
|
||
var _upload2 = _interopRequireDefault(_upload);
|
||
|
||
var _zoom = __webpack_require__(376);
|
||
|
||
var _zoom2 = _interopRequireDefault(_zoom);
|
||
|
||
var _stepCom = __webpack_require__(380);
|
||
|
||
var _stepCom2 = _interopRequireDefault(_stepCom);
|
||
|
||
var _tooltip = __webpack_require__(387);
|
||
|
||
var _tooltip2 = _interopRequireDefault(_tooltip);
|
||
|
||
var _pagination = __webpack_require__(394);
|
||
|
||
var _pagination2 = _interopRequireDefault(_pagination);
|
||
|
||
var _input = __webpack_require__(137);
|
||
|
||
var _input2 = _interopRequireDefault(_input);
|
||
|
||
var _select = __webpack_require__(136);
|
||
|
||
var _select2 = _interopRequireDefault(_select);
|
||
|
||
var _radioCom = __webpack_require__(414);
|
||
|
||
var _radioCom2 = _interopRequireDefault(_radioCom);
|
||
|
||
var _checkboxCom = __webpack_require__(421);
|
||
|
||
var _checkboxCom2 = _interopRequireDefault(_checkboxCom);
|
||
|
||
var _form = __webpack_require__(428);
|
||
|
||
var _form2 = _interopRequireDefault(_form);
|
||
|
||
var _menu = __webpack_require__(458);
|
||
|
||
var _menu2 = _interopRequireDefault(_menu);
|
||
|
||
var _panel = __webpack_require__(471);
|
||
|
||
var _panel2 = _interopRequireDefault(_panel);
|
||
|
||
var _affix = __webpack_require__(475);
|
||
|
||
var _affix2 = _interopRequireDefault(_affix);
|
||
|
||
var _backTop = __webpack_require__(479);
|
||
|
||
var _backTop2 = _interopRequireDefault(_backTop);
|
||
|
||
var _processCircle = __webpack_require__(483);
|
||
|
||
var _processCircle2 = _interopRequireDefault(_processCircle);
|
||
|
||
var _dropdownCom = __webpack_require__(487);
|
||
|
||
var _dropdownCom2 = _interopRequireDefault(_dropdownCom);
|
||
|
||
var _draggable = __webpack_require__(493);
|
||
|
||
var _draggable2 = _interopRequireDefault(_draggable);
|
||
|
||
var _contextmenu = __webpack_require__(507);
|
||
|
||
var _contextmenu2 = _interopRequireDefault(_contextmenu);
|
||
|
||
var _splitCom = __webpack_require__(512);
|
||
|
||
var _splitCom2 = _interopRequireDefault(_splitCom);
|
||
|
||
var _timePicker = __webpack_require__(519);
|
||
|
||
var _timePicker2 = _interopRequireDefault(_timePicker);
|
||
|
||
var _collapse = __webpack_require__(523);
|
||
|
||
var _collapse2 = _interopRequireDefault(_collapse);
|
||
|
||
var _i18n = __webpack_require__(113);
|
||
|
||
var _i18n2 = _interopRequireDefault(_i18n);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
var UiWebank = {
|
||
Row: _layout2.default.Row,
|
||
Cell: _layout2.default.Cell,
|
||
Icon: _icon2.default,
|
||
WbButton: _button2.default,
|
||
Tabs: _tabCom2.default.Tabs,
|
||
Tab: _tabCom2.default.Tab,
|
||
Carousel: _carousel2.default,
|
||
WbTable: _dataTable2.default.WbTable,
|
||
TreeTable: _dataTable2.default.TreeTable,
|
||
Column: _dataTable2.default.Column,
|
||
WbInputDatePicker: _datePicker2.default,
|
||
DatePicker: _datePicker.Calendar,
|
||
Loading: _loading2.default,
|
||
Modal: _modal2.default,
|
||
WbSwitch: _switch2.default,
|
||
Tree: _tree2.default,
|
||
Zoom: _zoom2.default,
|
||
Steps: _stepCom2.default.Steps,
|
||
Step: _stepCom2.default.Step,
|
||
Tooltip: _tooltip2.default,
|
||
Pagination: _pagination2.default,
|
||
WbInput: _input2.default,
|
||
WbSelect: _select2.default.WbSelect,
|
||
WbOption: _select2.default.WbOption,
|
||
OptionGroup: _select2.default.OptionGroup,
|
||
Radio: _radioCom2.default.Radio,
|
||
RadioGroup: _radioCom2.default.RadioGroup,
|
||
Checkbox: _checkboxCom2.default.Checkbox,
|
||
CheckboxGroup: _checkboxCom2.default.CheckboxGroup,
|
||
WbForm: _form2.default.WbForm,
|
||
FormItem: _form2.default.FormItem,
|
||
Panel: _panel2.default,
|
||
WbMenu: _menu2.default.WbMenu,
|
||
WbMenuItem: _menu2.default.WbMenuItem,
|
||
WbSubMenu: _menu2.default.WbSubMenu,
|
||
WbMenuGroup: _menu2.default.WbMenuGroup,
|
||
RouteMenu: _menu2.default.RouteMenu,
|
||
Upload: _upload2.default,
|
||
Affix: _affix2.default,
|
||
BackTop: _backTop2.default,
|
||
ProcessCircle: _processCircle2.default,
|
||
Dropdown: _dropdownCom2.default.Dropdown,
|
||
DropdownMenu: _dropdownCom2.default.DropdownMenu,
|
||
Draggable: _draggable2.default,
|
||
Contextmenu: _contextmenu2.default,
|
||
Split: _splitCom2.default.Split,
|
||
SplitItem: _splitCom2.default.SplitItem,
|
||
TimePicker: _timePicker2.default,
|
||
Collapse: _collapse2.default,
|
||
CollapsePanel: _collapse.CollapsePanel
|
||
}; /* !
|
||
* fes-ui v0.1.0
|
||
* (c) 2016 harrywan
|
||
* Released under the MIT License.
|
||
*/
|
||
|
||
|
||
var install = function install(Vue) {
|
||
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||
|
||
_i18n2.default.setLocale(opts.locale);
|
||
_i18n2.default.setHandler(opts.handle);
|
||
|
||
(0, _keys2.default)(UiWebank).forEach(function (key) {
|
||
Vue.component(key, UiWebank[key]);
|
||
});
|
||
Vue.directive('Zoom', _zoom2.default._directive);
|
||
Vue.directive('Tooltip', _tooltip2.default._directive);
|
||
Vue.prototype.$Message = window.Message = _message2.default;
|
||
Vue.prototype.$Toast = window.Toast = _toast2.default;
|
||
Vue.mixin({
|
||
created: function created() {
|
||
if (this.$root) {
|
||
_message2.default.root = this.$root;
|
||
_toast2.default.root = this.$root;
|
||
}
|
||
}
|
||
});
|
||
};
|
||
|
||
if (typeof window !== 'undefined' && window.Vue) {
|
||
install(window.Vue);
|
||
}
|
||
// webpack2 之后不允许混用impiort和module.exports https://github.com/webpack/webpack/issues/4039
|
||
exports.default = (0, _assign2.default)(UiWebank, {
|
||
install: install,
|
||
version: '2.3.6',
|
||
i18n: _i18n2.default
|
||
}); // eslint-disable-line no-undef
|
||
|
||
/***/ }),
|
||
/* 202 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(203);
|
||
module.exports = __webpack_require__(6).Object.assign;
|
||
|
||
|
||
/***/ }),
|
||
/* 203 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.3.1 Object.assign(target, source)
|
||
var $export = __webpack_require__(14);
|
||
|
||
$export($export.S + $export.F, 'Object', { assign: __webpack_require__(204) });
|
||
|
||
|
||
/***/ }),
|
||
/* 204 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
// 19.1.2.1 Object.assign(target, source, ...)
|
||
var DESCRIPTORS = __webpack_require__(18);
|
||
var getKeys = __webpack_require__(40);
|
||
var gOPS = __webpack_require__(73);
|
||
var pIE = __webpack_require__(55);
|
||
var toObject = __webpack_require__(56);
|
||
var IObject = __webpack_require__(104);
|
||
var $assign = Object.assign;
|
||
|
||
// should work with symbols and should have deterministic property order (V8 bug)
|
||
module.exports = !$assign || __webpack_require__(26)(function () {
|
||
var A = {};
|
||
var B = {};
|
||
// eslint-disable-next-line no-undef
|
||
var S = Symbol();
|
||
var K = 'abcdefghijklmnopqrst';
|
||
A[S] = 7;
|
||
K.split('').forEach(function (k) { B[k] = k; });
|
||
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
|
||
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
|
||
var T = toObject(target);
|
||
var aLen = arguments.length;
|
||
var index = 1;
|
||
var getSymbols = gOPS.f;
|
||
var isEnum = pIE.f;
|
||
while (aLen > index) {
|
||
var S = IObject(arguments[index++]);
|
||
var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
|
||
var length = keys.length;
|
||
var j = 0;
|
||
var key;
|
||
while (length > j) {
|
||
key = keys[j++];
|
||
if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
|
||
}
|
||
} return T;
|
||
} : $assign;
|
||
|
||
|
||
/***/ }),
|
||
/* 205 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// false -> Array#indexOf
|
||
// true -> Array#includes
|
||
var toIObject = __webpack_require__(30);
|
||
var toLength = __webpack_require__(105);
|
||
var toAbsoluteIndex = __webpack_require__(206);
|
||
module.exports = function (IS_INCLUDES) {
|
||
return function ($this, el, fromIndex) {
|
||
var O = toIObject($this);
|
||
var length = toLength(O.length);
|
||
var index = toAbsoluteIndex(fromIndex, length);
|
||
var value;
|
||
// Array#includes uses SameValueZero equality algorithm
|
||
// eslint-disable-next-line no-self-compare
|
||
if (IS_INCLUDES && el != el) while (length > index) {
|
||
value = O[index++];
|
||
// eslint-disable-next-line no-self-compare
|
||
if (value != value) return true;
|
||
// Array#indexOf ignores holes, Array#includes - not
|
||
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
|
||
if (O[index] === el) return IS_INCLUDES || index || 0;
|
||
} return !IS_INCLUDES && -1;
|
||
};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 206 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var toInteger = __webpack_require__(69);
|
||
var max = Math.max;
|
||
var min = Math.min;
|
||
module.exports = function (index, length) {
|
||
index = toInteger(index);
|
||
return index < 0 ? max(index + length, 0) : min(index, length);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 207 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(208);
|
||
module.exports = __webpack_require__(6).Object.keys;
|
||
|
||
|
||
/***/ }),
|
||
/* 208 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.14 Object.keys(O)
|
||
var toObject = __webpack_require__(56);
|
||
var $keys = __webpack_require__(40);
|
||
|
||
__webpack_require__(209)('keys', function () {
|
||
return function keys(it) {
|
||
return $keys(toObject(it));
|
||
};
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 209 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// most Object methods by ES6 should accept primitives
|
||
var $export = __webpack_require__(14);
|
||
var core = __webpack_require__(6);
|
||
var fails = __webpack_require__(26);
|
||
module.exports = function (KEY, exec) {
|
||
var fn = (core.Object || {})[KEY] || Object[KEY];
|
||
var exp = {};
|
||
exp[KEY] = exec(fn);
|
||
$export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 210 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _row = __webpack_require__(211);
|
||
|
||
var _row2 = _interopRequireDefault(_row);
|
||
|
||
var _cell = __webpack_require__(214);
|
||
|
||
var _cell2 = _interopRequireDefault(_cell);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
Row: _row2.default, Cell: _cell2.default
|
||
};
|
||
|
||
/***/ }),
|
||
/* 211 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(212),
|
||
/* template */
|
||
__webpack_require__(213),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/layout/row.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] row.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-50d25823", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-50d25823", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 212 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Row'
|
||
};
|
||
|
||
/***/ }),
|
||
/* 213 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-row"
|
||
}, [_vm._t("default")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-50d25823", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 214 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(215),
|
||
/* template */
|
||
__webpack_require__(216),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/layout/cell.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] cell.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-da672f2e", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-da672f2e", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 215 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Cell',
|
||
props: {
|
||
span: {
|
||
required: true,
|
||
type: [String, Number]
|
||
},
|
||
offset: {
|
||
type: [String, Number],
|
||
default: undefined
|
||
}
|
||
},
|
||
computed: {
|
||
getClass: function getClass() {
|
||
var classList = ['ui-cell-span-' + this.span];
|
||
if (this.offset) {
|
||
classList.push('ui-cell-offset-' + this.offset);
|
||
}
|
||
return classList;
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 216 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-cell",
|
||
class: _vm.getClass
|
||
}, [_vm._t("default")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-da672f2e", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 217 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(218),
|
||
/* template */
|
||
__webpack_require__(219),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/icon/icon.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] icon.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-430afbde", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-430afbde", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 218 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Icon',
|
||
props: {
|
||
type: {
|
||
required: true,
|
||
type: String
|
||
},
|
||
size: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
color: {
|
||
type: String,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {};
|
||
},
|
||
|
||
computed: {
|
||
getClass: function getClass() {
|
||
return 'ui-icon-' + this.type;
|
||
},
|
||
getStyle: function getStyle() {
|
||
var style = {};
|
||
if (this.size) {
|
||
style['font-size'] = this.size + 'px';
|
||
}
|
||
if (this.color) {
|
||
style.color = this.color;
|
||
}
|
||
return style;
|
||
}
|
||
},
|
||
methods: {
|
||
click: function click(event) {
|
||
this.$emit('click', event);
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 219 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('i', {
|
||
staticClass: "ui-icon",
|
||
class: _vm.getClass,
|
||
style: (_vm.getStyle),
|
||
on: {
|
||
"click": _vm.click
|
||
}
|
||
})
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-430afbde", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 220 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(221),
|
||
/* template */
|
||
__webpack_require__(222),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/button/button.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] button.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-11797d71", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-11797d71", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 221 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'Button',
|
||
components: {
|
||
Icon: _icon2.default
|
||
},
|
||
props: {
|
||
type: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
long: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
circle: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
icon: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
control: {
|
||
type: Number,
|
||
default: 300
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
buttonType: {
|
||
type: String,
|
||
default: 'button'
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
currentDisabled: this.disabled,
|
||
iconOnly: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getClass: function getClass() {
|
||
var arr = [];
|
||
if (this.type) {
|
||
arr.push('ui-button-type-' + this.type);
|
||
}
|
||
if (this.circle) {
|
||
arr.push('ui-button-circle');
|
||
}
|
||
if (this.long) {
|
||
arr.push('ui-button-long');
|
||
}
|
||
if (this.iconOnly) {
|
||
arr.push('ui-button-icon-only');
|
||
}
|
||
if (this.currentDisabled) {
|
||
arr.push('ui-button-disabled');
|
||
}
|
||
return arr;
|
||
}
|
||
},
|
||
watch: {
|
||
disabled: function disabled() {
|
||
this.currentDisabled = this.disabled;
|
||
}
|
||
},
|
||
created: function created() {
|
||
this.iconOnly = this.$slots.default === undefined && this.icon;
|
||
},
|
||
|
||
methods: {
|
||
handleClick: function handleClick(event) {
|
||
var _this = this;
|
||
|
||
if (this.currentDisabled) return;
|
||
if (this.notAllowed) return;
|
||
|
||
// 点击完多少秒不能继续点
|
||
this.notAllowed = true;
|
||
setTimeout(function () {
|
||
_this.notAllowed = false;
|
||
}, this.control);
|
||
this.$emit('click', event, this);
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 222 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('button', {
|
||
staticClass: "ui-button",
|
||
class: _vm.getClass,
|
||
attrs: {
|
||
"type": _vm.buttonType
|
||
},
|
||
on: {
|
||
"click": _vm.handleClick
|
||
}
|
||
}, [(_vm.icon) ? _c('Icon', {
|
||
attrs: {
|
||
"type": _vm.icon
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), _c('span', {
|
||
staticClass: "content"
|
||
}, [_vm._t("default")], 2)], 1)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-11797d71", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 223 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _tabs = __webpack_require__(224);
|
||
|
||
var _tabs2 = _interopRequireDefault(_tabs);
|
||
|
||
var _tab = __webpack_require__(249);
|
||
|
||
var _tab2 = _interopRequireDefault(_tab);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
Tabs: _tabs2.default,
|
||
Tab: _tab2.default
|
||
};
|
||
|
||
/***/ }),
|
||
/* 224 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(225),
|
||
/* template */
|
||
__webpack_require__(248),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tab-com/tabs.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] tabs.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-6670c432", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-6670c432", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 225 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var _tabComponent = __webpack_require__(245);
|
||
|
||
var _tabComponent2 = _interopRequireDefault(_tabComponent);
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'Tabs',
|
||
components: {
|
||
Icon: _icon2.default,
|
||
tabComponent: _tabComponent2.default
|
||
},
|
||
props: {
|
||
value: {
|
||
type: [Number, String],
|
||
default: 1
|
||
},
|
||
type: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
closable: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
draggable: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
uid: 1,
|
||
activeKey: this.value,
|
||
tabs: [],
|
||
cacheTabs: [],
|
||
scrollable: false,
|
||
navStyle: {
|
||
transform: ''
|
||
},
|
||
dragIndex: null,
|
||
dragItem: null,
|
||
scrollIndex: 0
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
isCard: function isCard() {
|
||
return this.type === 'card';
|
||
}
|
||
},
|
||
watch: {
|
||
value: function value() {
|
||
this.activeKey = this.value;
|
||
},
|
||
tabs: function tabs() {
|
||
var _this = this;
|
||
|
||
if (this.tabs.length > 0) {
|
||
this.$nextTick(function () {
|
||
_this.isScrollable();
|
||
});
|
||
}
|
||
},
|
||
scrollIndex: function scrollIndex() {
|
||
var offset = 0;
|
||
for (var i = 0; i < this.scrollIndex; i++) {
|
||
var tabDom = this.$refs[this.tabs[i].tabName];
|
||
offset += tabDom ? tabDom[0].offsetWidth : 0;
|
||
}
|
||
this.setOffset(offset);
|
||
}
|
||
},
|
||
methods: {
|
||
isString: _util.isString,
|
||
isObject: _util.isObject,
|
||
isScrollable: function isScrollable() {
|
||
var navWidth = this.$refs.nav ? this.$refs.nav.offsetWidth : 0;
|
||
var containerWidth = this.$refs.container ? this.$refs.container.offsetWidth : 0;
|
||
this.scrollable = navWidth > containerWidth;
|
||
if (!this.scrollable) {
|
||
this.scrollIndex = 0;
|
||
}
|
||
},
|
||
getHeaderClass: function getHeaderClass(tab, index) {
|
||
var arr = [];
|
||
if (tab.show) {
|
||
arr.push('ui-tabs-header-current');
|
||
}
|
||
if (tab.disabled) {
|
||
arr.push('ui-tabs-header-disabled');
|
||
}
|
||
if (index == this.dragIndex) {
|
||
arr.push('ui-tabs-header-draging');
|
||
}
|
||
return arr;
|
||
},
|
||
addTab: function addTab(tab) {
|
||
tab.tabName = tab.name || this.uid;
|
||
this.tabs.push(tab);
|
||
this.cacheTabs.push(tab);
|
||
this.uid++;
|
||
},
|
||
removeTab: function removeTab(tab) {
|
||
var index = this.tabs.indexOf(tab);
|
||
if (index != -1) {
|
||
this.tabs.splice(index, 1);
|
||
this.$emit('on-tab-remove', tab.tabName, index);
|
||
}
|
||
if (tab.show && this.tabs.length > 0) {
|
||
var newIndex = index - 1 < 0 ? index : index - 1;
|
||
this.activeKey = this.tabs[newIndex].tabName;
|
||
}
|
||
},
|
||
choose: function choose(tab) {
|
||
this.activeKey = tab.tabName;
|
||
this.$emit('input', tab.tabName);
|
||
this.$emit('on-click', tab.tabName);
|
||
},
|
||
getCurrentScrollOffset: function getCurrentScrollOffset() {
|
||
return this.navStyle.transform ? Number(this.navStyle.transform.match(/translateX\(-(\d+(\.\d+)*)px\)/)[1]) : 0;
|
||
},
|
||
scrollNext: function scrollNext() {
|
||
if (this.scrollIndex < this.tabs.length - 1) {
|
||
this.scrollIndex += 1;
|
||
}
|
||
},
|
||
scrollPrev: function scrollPrev() {
|
||
if (this.scrollIndex > 0) {
|
||
this.scrollIndex -= 1;
|
||
}
|
||
},
|
||
setOffset: function setOffset(newOffset) {
|
||
this.navStyle.transform = 'translateX(-' + newOffset + 'px)';
|
||
},
|
||
dragstart: function dragstart(e, index) {
|
||
if (!this.draggable) {
|
||
return;
|
||
}
|
||
this.dragIndex = index;
|
||
this.dragItem = this.tabs[index];
|
||
},
|
||
dragenter: function dragenter(e, index) {
|
||
if (!this.draggable) {
|
||
return;
|
||
}
|
||
if (this.dragIndex != index) {
|
||
var obj = this.tabs[this.dragIndex];
|
||
this.tabs.splice(this.dragIndex, 1);
|
||
this.tabs.splice(index, 0, obj);
|
||
this.$emit('on-tab-change', {
|
||
from: this.dragIndex,
|
||
to: index
|
||
});
|
||
this.dragIndex = index;
|
||
}
|
||
},
|
||
dragend: function dragend() {
|
||
if (!this.draggable) {
|
||
return;
|
||
}
|
||
this.dragItem = null;
|
||
this.dragIndex = null;
|
||
},
|
||
reset: function reset() {
|
||
var _this2 = this;
|
||
|
||
// 保存开始的顺序,提供接口恢复原状
|
||
this.tabs = this.cacheTabs;
|
||
this.cacheTabs = [];
|
||
this.tabs.forEach(function (item) {
|
||
_this2.cacheTabs.push(item);
|
||
});
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 226 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = { "default": __webpack_require__(227), __esModule: true };
|
||
|
||
/***/ }),
|
||
/* 227 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(57);
|
||
__webpack_require__(59);
|
||
module.exports = __webpack_require__(76).f('iterator');
|
||
|
||
|
||
/***/ }),
|
||
/* 228 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var toInteger = __webpack_require__(69);
|
||
var defined = __webpack_require__(53);
|
||
// true -> String#at
|
||
// false -> String#codePointAt
|
||
module.exports = function (TO_STRING) {
|
||
return function (that, pos) {
|
||
var s = String(defined(that));
|
||
var i = toInteger(pos);
|
||
var l = s.length;
|
||
var a, b;
|
||
if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
|
||
a = s.charCodeAt(i);
|
||
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
|
||
? TO_STRING ? s.charAt(i) : a
|
||
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
|
||
};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 229 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var create = __webpack_require__(108);
|
||
var descriptor = __webpack_require__(52);
|
||
var setToStringTag = __webpack_require__(58);
|
||
var IteratorPrototype = {};
|
||
|
||
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
|
||
__webpack_require__(24)(IteratorPrototype, __webpack_require__(8)('iterator'), function () { return this; });
|
||
|
||
module.exports = function (Constructor, NAME, next) {
|
||
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
|
||
setToStringTag(Constructor, NAME + ' Iterator');
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 230 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var dP = __webpack_require__(21);
|
||
var anObject = __webpack_require__(17);
|
||
var getKeys = __webpack_require__(40);
|
||
|
||
module.exports = __webpack_require__(18) ? Object.defineProperties : function defineProperties(O, Properties) {
|
||
anObject(O);
|
||
var keys = getKeys(Properties);
|
||
var length = keys.length;
|
||
var i = 0;
|
||
var P;
|
||
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
|
||
return O;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 231 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
|
||
var has = __webpack_require__(27);
|
||
var toObject = __webpack_require__(56);
|
||
var IE_PROTO = __webpack_require__(70)('IE_PROTO');
|
||
var ObjectProto = Object.prototype;
|
||
|
||
module.exports = Object.getPrototypeOf || function (O) {
|
||
O = toObject(O);
|
||
if (has(O, IE_PROTO)) return O[IE_PROTO];
|
||
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
||
return O.constructor.prototype;
|
||
} return O instanceof Object ? ObjectProto : null;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 232 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var addToUnscopables = __webpack_require__(233);
|
||
var step = __webpack_require__(234);
|
||
var Iterators = __webpack_require__(32);
|
||
var toIObject = __webpack_require__(30);
|
||
|
||
// 22.1.3.4 Array.prototype.entries()
|
||
// 22.1.3.13 Array.prototype.keys()
|
||
// 22.1.3.29 Array.prototype.values()
|
||
// 22.1.3.30 Array.prototype[@@iterator]()
|
||
module.exports = __webpack_require__(106)(Array, 'Array', function (iterated, kind) {
|
||
this._t = toIObject(iterated); // target
|
||
this._i = 0; // next index
|
||
this._k = kind; // kind
|
||
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
|
||
}, function () {
|
||
var O = this._t;
|
||
var kind = this._k;
|
||
var index = this._i++;
|
||
if (!O || index >= O.length) {
|
||
this._t = undefined;
|
||
return step(1);
|
||
}
|
||
if (kind == 'keys') return step(0, index);
|
||
if (kind == 'values') return step(0, O[index]);
|
||
return step(0, [index, O[index]]);
|
||
}, 'values');
|
||
|
||
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
|
||
Iterators.Arguments = Iterators.Array;
|
||
|
||
addToUnscopables('keys');
|
||
addToUnscopables('values');
|
||
addToUnscopables('entries');
|
||
|
||
|
||
/***/ }),
|
||
/* 233 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = function () { /* empty */ };
|
||
|
||
|
||
/***/ }),
|
||
/* 234 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = function (done, value) {
|
||
return { value: value, done: !!done };
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 235 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = { "default": __webpack_require__(236), __esModule: true };
|
||
|
||
/***/ }),
|
||
/* 236 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(237);
|
||
__webpack_require__(111);
|
||
__webpack_require__(243);
|
||
__webpack_require__(244);
|
||
module.exports = __webpack_require__(6).Symbol;
|
||
|
||
|
||
/***/ }),
|
||
/* 237 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
// ECMAScript 6 symbols shim
|
||
var global = __webpack_require__(7);
|
||
var has = __webpack_require__(27);
|
||
var DESCRIPTORS = __webpack_require__(18);
|
||
var $export = __webpack_require__(14);
|
||
var redefine = __webpack_require__(107);
|
||
var META = __webpack_require__(238).KEY;
|
||
var $fails = __webpack_require__(26);
|
||
var shared = __webpack_require__(71);
|
||
var setToStringTag = __webpack_require__(58);
|
||
var uid = __webpack_require__(54);
|
||
var wks = __webpack_require__(8);
|
||
var wksExt = __webpack_require__(76);
|
||
var wksDefine = __webpack_require__(77);
|
||
var enumKeys = __webpack_require__(239);
|
||
var isArray = __webpack_require__(240);
|
||
var anObject = __webpack_require__(17);
|
||
var isObject = __webpack_require__(25);
|
||
var toObject = __webpack_require__(56);
|
||
var toIObject = __webpack_require__(30);
|
||
var toPrimitive = __webpack_require__(68);
|
||
var createDesc = __webpack_require__(52);
|
||
var _create = __webpack_require__(108);
|
||
var gOPNExt = __webpack_require__(241);
|
||
var $GOPD = __webpack_require__(242);
|
||
var $GOPS = __webpack_require__(73);
|
||
var $DP = __webpack_require__(21);
|
||
var $keys = __webpack_require__(40);
|
||
var gOPD = $GOPD.f;
|
||
var dP = $DP.f;
|
||
var gOPN = gOPNExt.f;
|
||
var $Symbol = global.Symbol;
|
||
var $JSON = global.JSON;
|
||
var _stringify = $JSON && $JSON.stringify;
|
||
var PROTOTYPE = 'prototype';
|
||
var HIDDEN = wks('_hidden');
|
||
var TO_PRIMITIVE = wks('toPrimitive');
|
||
var isEnum = {}.propertyIsEnumerable;
|
||
var SymbolRegistry = shared('symbol-registry');
|
||
var AllSymbols = shared('symbols');
|
||
var OPSymbols = shared('op-symbols');
|
||
var ObjectProto = Object[PROTOTYPE];
|
||
var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
|
||
var QObject = global.QObject;
|
||
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
|
||
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
||
|
||
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
|
||
var setSymbolDesc = DESCRIPTORS && $fails(function () {
|
||
return _create(dP({}, 'a', {
|
||
get: function () { return dP(this, 'a', { value: 7 }).a; }
|
||
})).a != 7;
|
||
}) ? function (it, key, D) {
|
||
var protoDesc = gOPD(ObjectProto, key);
|
||
if (protoDesc) delete ObjectProto[key];
|
||
dP(it, key, D);
|
||
if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
|
||
} : dP;
|
||
|
||
var wrap = function (tag) {
|
||
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
|
||
sym._k = tag;
|
||
return sym;
|
||
};
|
||
|
||
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
|
||
return typeof it == 'symbol';
|
||
} : function (it) {
|
||
return it instanceof $Symbol;
|
||
};
|
||
|
||
var $defineProperty = function defineProperty(it, key, D) {
|
||
if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
|
||
anObject(it);
|
||
key = toPrimitive(key, true);
|
||
anObject(D);
|
||
if (has(AllSymbols, key)) {
|
||
if (!D.enumerable) {
|
||
if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
|
||
it[HIDDEN][key] = true;
|
||
} else {
|
||
if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
|
||
D = _create(D, { enumerable: createDesc(0, false) });
|
||
} return setSymbolDesc(it, key, D);
|
||
} return dP(it, key, D);
|
||
};
|
||
var $defineProperties = function defineProperties(it, P) {
|
||
anObject(it);
|
||
var keys = enumKeys(P = toIObject(P));
|
||
var i = 0;
|
||
var l = keys.length;
|
||
var key;
|
||
while (l > i) $defineProperty(it, key = keys[i++], P[key]);
|
||
return it;
|
||
};
|
||
var $create = function create(it, P) {
|
||
return P === undefined ? _create(it) : $defineProperties(_create(it), P);
|
||
};
|
||
var $propertyIsEnumerable = function propertyIsEnumerable(key) {
|
||
var E = isEnum.call(this, key = toPrimitive(key, true));
|
||
if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
|
||
return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
|
||
};
|
||
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
|
||
it = toIObject(it);
|
||
key = toPrimitive(key, true);
|
||
if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
|
||
var D = gOPD(it, key);
|
||
if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
|
||
return D;
|
||
};
|
||
var $getOwnPropertyNames = function getOwnPropertyNames(it) {
|
||
var names = gOPN(toIObject(it));
|
||
var result = [];
|
||
var i = 0;
|
||
var key;
|
||
while (names.length > i) {
|
||
if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
|
||
} return result;
|
||
};
|
||
var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
|
||
var IS_OP = it === ObjectProto;
|
||
var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
|
||
var result = [];
|
||
var i = 0;
|
||
var key;
|
||
while (names.length > i) {
|
||
if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
|
||
} return result;
|
||
};
|
||
|
||
// 19.4.1.1 Symbol([description])
|
||
if (!USE_NATIVE) {
|
||
$Symbol = function Symbol() {
|
||
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
|
||
var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
|
||
var $set = function (value) {
|
||
if (this === ObjectProto) $set.call(OPSymbols, value);
|
||
if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
||
setSymbolDesc(this, tag, createDesc(1, value));
|
||
};
|
||
if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
|
||
return wrap(tag);
|
||
};
|
||
redefine($Symbol[PROTOTYPE], 'toString', function toString() {
|
||
return this._k;
|
||
});
|
||
|
||
$GOPD.f = $getOwnPropertyDescriptor;
|
||
$DP.f = $defineProperty;
|
||
__webpack_require__(110).f = gOPNExt.f = $getOwnPropertyNames;
|
||
__webpack_require__(55).f = $propertyIsEnumerable;
|
||
$GOPS.f = $getOwnPropertySymbols;
|
||
|
||
if (DESCRIPTORS && !__webpack_require__(42)) {
|
||
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
|
||
}
|
||
|
||
wksExt.f = function (name) {
|
||
return wrap(wks(name));
|
||
};
|
||
}
|
||
|
||
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
|
||
|
||
for (var es6Symbols = (
|
||
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
|
||
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
|
||
).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
|
||
|
||
for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
|
||
|
||
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
|
||
// 19.4.2.1 Symbol.for(key)
|
||
'for': function (key) {
|
||
return has(SymbolRegistry, key += '')
|
||
? SymbolRegistry[key]
|
||
: SymbolRegistry[key] = $Symbol(key);
|
||
},
|
||
// 19.4.2.5 Symbol.keyFor(sym)
|
||
keyFor: function keyFor(sym) {
|
||
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
|
||
for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
|
||
},
|
||
useSetter: function () { setter = true; },
|
||
useSimple: function () { setter = false; }
|
||
});
|
||
|
||
$export($export.S + $export.F * !USE_NATIVE, 'Object', {
|
||
// 19.1.2.2 Object.create(O [, Properties])
|
||
create: $create,
|
||
// 19.1.2.4 Object.defineProperty(O, P, Attributes)
|
||
defineProperty: $defineProperty,
|
||
// 19.1.2.3 Object.defineProperties(O, Properties)
|
||
defineProperties: $defineProperties,
|
||
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
|
||
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
|
||
// 19.1.2.7 Object.getOwnPropertyNames(O)
|
||
getOwnPropertyNames: $getOwnPropertyNames,
|
||
// 19.1.2.8 Object.getOwnPropertySymbols(O)
|
||
getOwnPropertySymbols: $getOwnPropertySymbols
|
||
});
|
||
|
||
// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
|
||
// https://bugs.chromium.org/p/v8/issues/detail?id=3443
|
||
var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
|
||
|
||
$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
|
||
getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
||
return $GOPS.f(toObject(it));
|
||
}
|
||
});
|
||
|
||
// 24.3.2 JSON.stringify(value [, replacer [, space]])
|
||
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
|
||
var S = $Symbol();
|
||
// MS Edge converts symbol values to JSON as {}
|
||
// WebKit converts symbol values to JSON as null
|
||
// V8 throws on boxed symbols
|
||
return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
|
||
})), 'JSON', {
|
||
stringify: function stringify(it) {
|
||
var args = [it];
|
||
var i = 1;
|
||
var replacer, $replacer;
|
||
while (arguments.length > i) args.push(arguments[i++]);
|
||
$replacer = replacer = args[1];
|
||
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
|
||
if (!isArray(replacer)) replacer = function (key, value) {
|
||
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
||
if (!isSymbol(value)) return value;
|
||
};
|
||
args[1] = replacer;
|
||
return _stringify.apply($JSON, args);
|
||
}
|
||
});
|
||
|
||
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
|
||
$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(24)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
|
||
// 19.4.3.5 Symbol.prototype[@@toStringTag]
|
||
setToStringTag($Symbol, 'Symbol');
|
||
// 20.2.1.9 Math[@@toStringTag]
|
||
setToStringTag(Math, 'Math', true);
|
||
// 24.3.3 JSON[@@toStringTag]
|
||
setToStringTag(global.JSON, 'JSON', true);
|
||
|
||
|
||
/***/ }),
|
||
/* 238 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var META = __webpack_require__(54)('meta');
|
||
var isObject = __webpack_require__(25);
|
||
var has = __webpack_require__(27);
|
||
var setDesc = __webpack_require__(21).f;
|
||
var id = 0;
|
||
var isExtensible = Object.isExtensible || function () {
|
||
return true;
|
||
};
|
||
var FREEZE = !__webpack_require__(26)(function () {
|
||
return isExtensible(Object.preventExtensions({}));
|
||
});
|
||
var setMeta = function (it) {
|
||
setDesc(it, META, { value: {
|
||
i: 'O' + ++id, // object ID
|
||
w: {} // weak collections IDs
|
||
} });
|
||
};
|
||
var fastKey = function (it, create) {
|
||
// return primitive with prefix
|
||
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
||
if (!has(it, META)) {
|
||
// can't set metadata to uncaught frozen object
|
||
if (!isExtensible(it)) return 'F';
|
||
// not necessary to add metadata
|
||
if (!create) return 'E';
|
||
// add missing metadata
|
||
setMeta(it);
|
||
// return object ID
|
||
} return it[META].i;
|
||
};
|
||
var getWeak = function (it, create) {
|
||
if (!has(it, META)) {
|
||
// can't set metadata to uncaught frozen object
|
||
if (!isExtensible(it)) return true;
|
||
// not necessary to add metadata
|
||
if (!create) return false;
|
||
// add missing metadata
|
||
setMeta(it);
|
||
// return hash weak collections IDs
|
||
} return it[META].w;
|
||
};
|
||
// add metadata on freeze-family methods calling
|
||
var onFreeze = function (it) {
|
||
if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
|
||
return it;
|
||
};
|
||
var meta = module.exports = {
|
||
KEY: META,
|
||
NEED: false,
|
||
fastKey: fastKey,
|
||
getWeak: getWeak,
|
||
onFreeze: onFreeze
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 239 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// all enumerable object keys, includes symbols
|
||
var getKeys = __webpack_require__(40);
|
||
var gOPS = __webpack_require__(73);
|
||
var pIE = __webpack_require__(55);
|
||
module.exports = function (it) {
|
||
var result = getKeys(it);
|
||
var getSymbols = gOPS.f;
|
||
if (getSymbols) {
|
||
var symbols = getSymbols(it);
|
||
var isEnum = pIE.f;
|
||
var i = 0;
|
||
var key;
|
||
while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
|
||
} return result;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 240 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 7.2.2 IsArray(argument)
|
||
var cof = __webpack_require__(41);
|
||
module.exports = Array.isArray || function isArray(arg) {
|
||
return cof(arg) == 'Array';
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 241 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
|
||
var toIObject = __webpack_require__(30);
|
||
var gOPN = __webpack_require__(110).f;
|
||
var toString = {}.toString;
|
||
|
||
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
||
? Object.getOwnPropertyNames(window) : [];
|
||
|
||
var getWindowNames = function (it) {
|
||
try {
|
||
return gOPN(it);
|
||
} catch (e) {
|
||
return windowNames.slice();
|
||
}
|
||
};
|
||
|
||
module.exports.f = function getOwnPropertyNames(it) {
|
||
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 242 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var pIE = __webpack_require__(55);
|
||
var createDesc = __webpack_require__(52);
|
||
var toIObject = __webpack_require__(30);
|
||
var toPrimitive = __webpack_require__(68);
|
||
var has = __webpack_require__(27);
|
||
var IE8_DOM_DEFINE = __webpack_require__(102);
|
||
var gOPD = Object.getOwnPropertyDescriptor;
|
||
|
||
exports.f = __webpack_require__(18) ? gOPD : function getOwnPropertyDescriptor(O, P) {
|
||
O = toIObject(O);
|
||
P = toPrimitive(P, true);
|
||
if (IE8_DOM_DEFINE) try {
|
||
return gOPD(O, P);
|
||
} catch (e) { /* empty */ }
|
||
if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 243 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(77)('asyncIterator');
|
||
|
||
|
||
/***/ }),
|
||
/* 244 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(77)('observable');
|
||
|
||
|
||
/***/ }),
|
||
/* 245 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(246),
|
||
/* template */
|
||
__webpack_require__(247),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tab-com/tabComponent.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] tabComponent.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-cd67b6c8", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-cd67b6c8", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 246 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
exports.default = {
|
||
props: {
|
||
component: {
|
||
type: Object,
|
||
default: undefined
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
if (this.component && util.isObject(this.component)) {
|
||
this.component.$mount(this.$refs.swap);
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 247 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
ref: "swap"
|
||
})
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-cd67b6c8", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 248 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-tabs"
|
||
}, [_c('div', {
|
||
staticClass: "ui-tabs-header",
|
||
class: {
|
||
'ui-tabs-header-card': _vm.isCard
|
||
}
|
||
}, [_c('div', {
|
||
ref: "container",
|
||
staticClass: "ui-tabs-header-container",
|
||
class: {
|
||
'ui-tabs-header-scroll': _vm.scrollable
|
||
}
|
||
}, [(_vm.scrollable) ? [_c('Icon', {
|
||
staticClass: "button-left",
|
||
class: {
|
||
disabled: _vm.scrollIndex === 0
|
||
},
|
||
attrs: {
|
||
"type": "ios-arrow-back",
|
||
"size": "14"
|
||
},
|
||
on: {
|
||
"click": _vm.scrollPrev
|
||
}
|
||
}), _vm._v(" "), _c('Icon', {
|
||
staticClass: "button-right",
|
||
class: {
|
||
disabled: _vm.scrollIndex === _vm.tabs.length - 1
|
||
},
|
||
attrs: {
|
||
"type": "ios-arrow-forward",
|
||
"size": "14"
|
||
},
|
||
on: {
|
||
"click": _vm.scrollNext
|
||
}
|
||
})] : _vm._e(), _vm._v(" "), _c('div', {
|
||
ref: "nav",
|
||
staticClass: "ui-tabs-header-swap",
|
||
style: (_vm.navStyle)
|
||
}, _vm._l((_vm.tabs), function(tab, index) {
|
||
return _c('div', {
|
||
key: tab.tabName,
|
||
ref: tab.tabName,
|
||
refInFor: true,
|
||
staticClass: "ui-tabs-header-item",
|
||
class: _vm.getHeaderClass(tab, index),
|
||
attrs: {
|
||
"draggable": _vm.draggable
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.choose(tab, index)
|
||
},
|
||
"dragstart": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.dragstart($event, index)
|
||
},
|
||
"dragenter": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.dragenter($event, index)
|
||
},
|
||
"dragend": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.dragend($event)
|
||
}
|
||
}
|
||
}, [_c('div', {
|
||
staticClass: "ui-tabs-header-label"
|
||
}, [(tab.icon) ? _c('Icon', {
|
||
attrs: {
|
||
"type": tab.icon
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), (_vm.isString(tab.label)) ? [_vm._v("\n " + _vm._s(tab.label) + "\n ")] : _vm._e(), _vm._v(" "), (_vm.isObject(tab.label)) ? [_c('tab-component', {
|
||
attrs: {
|
||
"component": tab.label
|
||
}
|
||
})] : _vm._e()], 2), _vm._v(" "), (_vm.closable) ? _c('Icon', {
|
||
staticClass: "button-close",
|
||
attrs: {
|
||
"type": "md-close",
|
||
"size": "14"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.removeTab(tab)
|
||
}
|
||
}
|
||
}) : _vm._e()], 1)
|
||
}), 0)], 2), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-tab-buttons"
|
||
}, [_vm._t("action")], 2)]), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-tabs-body"
|
||
}, [_vm._t("default")], 2)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-6670c432", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 249 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(250),
|
||
/* template */
|
||
__webpack_require__(251),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tab-com/tab.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] tab.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-e0da81de", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-e0da81de", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 250 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
exports.default = {
|
||
name: 'Tab',
|
||
props: {
|
||
name: {
|
||
type: [String, Number],
|
||
default: undefined
|
||
},
|
||
label: {
|
||
type: [String, Object],
|
||
required: true
|
||
},
|
||
icon: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
tabName: '',
|
||
parent: (0, _util.findComponentUpward)(this, 'Tabs')
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
show: function show() {
|
||
return this.tabName == this.parent.activeKey;
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
this.parent.addTab(this);
|
||
},
|
||
destroyed: function destroyed() {
|
||
this.parent.removeTab(this);
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 251 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('transition', {
|
||
attrs: {
|
||
"name": "tabfade"
|
||
}
|
||
}, [_c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.show),
|
||
expression: "show"
|
||
}],
|
||
staticClass: "ui-tab"
|
||
}, [_vm._t("default")], 2)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-e0da81de", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 252 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _table = __webpack_require__(112);
|
||
|
||
var _table2 = _interopRequireDefault(_table);
|
||
|
||
var _treeTable = __webpack_require__(277);
|
||
|
||
var _treeTable2 = _interopRequireDefault(_treeTable);
|
||
|
||
var _column = __webpack_require__(280);
|
||
|
||
var _column2 = _interopRequireDefault(_column);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
WbTable: _table2.default,
|
||
TreeTable: _treeTable2.default,
|
||
Column: _column2.default
|
||
};
|
||
|
||
/***/ }),
|
||
/* 253 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
var _mixin = __webpack_require__(12);
|
||
|
||
var _mixin2 = _interopRequireDefault(_mixin);
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
var _tableAction = __webpack_require__(256);
|
||
|
||
var _tableAction2 = _interopRequireDefault(_tableAction);
|
||
|
||
var _tableText = __webpack_require__(259);
|
||
|
||
var _tableText2 = _interopRequireDefault(_tableText);
|
||
|
||
var _tableComponent = __webpack_require__(262);
|
||
|
||
var _tableComponent2 = _interopRequireDefault(_tableComponent);
|
||
|
||
var _tableDetailComponent = __webpack_require__(265);
|
||
|
||
var _tableDetailComponent2 = _interopRequireDefault(_tableDetailComponent);
|
||
|
||
var _headComponent = __webpack_require__(268);
|
||
|
||
var _headComponent2 = _interopRequireDefault(_headComponent);
|
||
|
||
var _tableExpand = __webpack_require__(271);
|
||
|
||
var _tableExpand2 = _interopRequireDefault(_tableExpand);
|
||
|
||
var _editCell = __webpack_require__(273);
|
||
|
||
var _editCell2 = _interopRequireDefault(_editCell);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
var rowKey = 1;
|
||
exports.default = {
|
||
name: 'Table',
|
||
components: {
|
||
Icon: _icon2.default,
|
||
tableAction: _tableAction2.default,
|
||
tableText: _tableText2.default,
|
||
tableComponent: _tableComponent2.default,
|
||
tableExpand: _tableExpand2.default,
|
||
headComponent: _headComponent2.default,
|
||
tableDetailComponent: _tableDetailComponent2.default,
|
||
editCell: _editCell2.default
|
||
},
|
||
mixins: [_mixin2.default],
|
||
props: {
|
||
data: {
|
||
type: Array,
|
||
default: undefined
|
||
},
|
||
border: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
trClass: {
|
||
type: Function,
|
||
default: undefined
|
||
},
|
||
noDataText: {
|
||
type: String,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
sortCol: null,
|
||
renderExpanded: null,
|
||
expandedList: [],
|
||
showData: [],
|
||
children: [],
|
||
detailList: {}
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
cols: function cols() {
|
||
return this.getAllColumns(this.children).filter(function (item) {
|
||
return !item.children.length;
|
||
});
|
||
},
|
||
headerRows: function headerRows() {
|
||
return this.convertToRows(this.children);
|
||
},
|
||
classes: function classes() {
|
||
return this.border ? 'ui-table-swap-border' : '';
|
||
},
|
||
selectedAllRow: function selectedAllRow() {
|
||
var _this = this;
|
||
|
||
var ableRow = this.showData.filter(function () {
|
||
return !_this.disabledRow.apply(_this, arguments);
|
||
});
|
||
return ableRow.length && ableRow.every(function (item) {
|
||
return item._selected;
|
||
});
|
||
}
|
||
},
|
||
watch: {
|
||
data: {
|
||
handler: function handler() {
|
||
this.showData = this.makeData();
|
||
},
|
||
|
||
deep: true
|
||
},
|
||
selectedAllRow: function selectedAllRow() {
|
||
this.$emit('on-select-all', this.getSelected());
|
||
}
|
||
},
|
||
created: function created() {
|
||
this.showData = this.makeData();
|
||
},
|
||
|
||
methods: {
|
||
addColumn: function addColumn(column) {
|
||
this.children.push(column);
|
||
},
|
||
removeColumn: function removeColumn(column) {
|
||
var index = this.children.indexOf(column);
|
||
if (index != -1) {
|
||
this.children.splice(index, 1);
|
||
}
|
||
},
|
||
makeData: function makeData(data) {
|
||
data = data || this.data;
|
||
var arr = [];
|
||
if (util.isArray(data)) {
|
||
arr = util.deepCopy(data);
|
||
arr.forEach(function (obj, index) {
|
||
obj._index = index;
|
||
obj._rowKey = rowKey++;
|
||
if (obj._selected === undefined) {
|
||
obj._selected = false;
|
||
}
|
||
});
|
||
if (this.sortCol) {
|
||
this.sortData(arr);
|
||
}
|
||
}
|
||
return arr;
|
||
},
|
||
getAllColumns: function getAllColumns(columns) {
|
||
var _this2 = this;
|
||
|
||
var result = [];
|
||
columns.forEach(function (column) {
|
||
if (column.$options.name == 'Column') {
|
||
result.push(column);
|
||
if (column.children && column.children.length > 0) {
|
||
result.push.apply(result, _this2.getAllColumns(column.children));
|
||
}
|
||
}
|
||
});
|
||
result.forEach(function (item, index) {
|
||
return item.__old_index = index;
|
||
});
|
||
return result.sort(function (a, b) {
|
||
return a.index - b.index || a.__old_index - b.__old_index;
|
||
});
|
||
},
|
||
convertToRows: function convertToRows(originColumns) {
|
||
var maxLevel = 1;
|
||
var traverse = function traverse(column, parent) {
|
||
if (parent) {
|
||
column.level = parent.level + 1;
|
||
if (maxLevel < column.level) {
|
||
maxLevel = column.level;
|
||
}
|
||
}
|
||
if (column.children && column.children.length > 0) {
|
||
var colSpan = 0;
|
||
column.children.forEach(function (subColumn) {
|
||
traverse(subColumn, column);
|
||
colSpan += subColumn.colSpan || 1;
|
||
});
|
||
column.colSpan = colSpan;
|
||
} else {
|
||
column.colSpan = 1;
|
||
}
|
||
};
|
||
|
||
originColumns.forEach(function (column) {
|
||
if (column.$options.name == 'Column') {
|
||
column.level = 1;
|
||
traverse(column);
|
||
}
|
||
});
|
||
|
||
var rows = [];
|
||
for (var i = 0; i < maxLevel; i++) {
|
||
rows.push([]);
|
||
}
|
||
|
||
var allColumns = this.getAllColumns(originColumns);
|
||
|
||
allColumns.forEach(function (column) {
|
||
if (column.children.length == 0) {
|
||
column.rowSpan = maxLevel - column.level + 1;
|
||
} else {
|
||
column.rowSpan = 1;
|
||
}
|
||
rows[column.level - 1].push(column);
|
||
});
|
||
|
||
return rows;
|
||
},
|
||
|
||
// 设置Tr的样式
|
||
getTrClass: function getTrClass(rowIndex, trData) {
|
||
var result = 'row_' + (rowIndex + 1) + ' ';
|
||
if (this.trClass && util.isFunction(this.trClass)) {
|
||
var parent = null;
|
||
if (this.$vnode) {
|
||
parent = this.$vnode.context;
|
||
}
|
||
var rst = this.trClass.call(parent || this, trData, rowIndex);
|
||
if (rst) {
|
||
result += rst;
|
||
}
|
||
}
|
||
return result;
|
||
},
|
||
|
||
// 设置td的个性样式
|
||
getTdClass: function getTdClass(col, index, tdData, trData) {
|
||
var arr = ['col_' + (index + 1)];
|
||
if (col.classes) {
|
||
var classes = void 0;
|
||
if (util.isString(col.classes)) {
|
||
classes = col.classes.split(' ');
|
||
} else if (util.isFunction(col.classes)) {
|
||
var rst = col.classes(tdData, trData);
|
||
if (util.isString(rst)) {
|
||
classes = rst.split(' ');
|
||
}
|
||
}
|
||
if (classes && classes.length > 0) {
|
||
classes.forEach(function (key) {
|
||
arr.push(key);
|
||
});
|
||
}
|
||
}
|
||
return arr;
|
||
},
|
||
getThClass: function getThClass(col) {
|
||
var classStr = '';
|
||
var classPrefix = 'ui-table-th-';
|
||
if (col.headTip) {
|
||
classStr = classPrefix + 'headtip';
|
||
}
|
||
return classStr;
|
||
},
|
||
|
||
// 设置样式
|
||
getTdStyle: function getTdStyle(col) {
|
||
return {
|
||
'text-align': col.align,
|
||
width: col.width
|
||
};
|
||
},
|
||
getSortClass: function getSortClass(col, direction) {
|
||
var arr = [];
|
||
if (this.sortCol == col && col.sortDirection == direction) {
|
||
arr.push('on');
|
||
}
|
||
return arr;
|
||
},
|
||
sortData: function sortData(arr) {
|
||
var _this3 = this;
|
||
|
||
arr.sort(function (a, b) {
|
||
var direction = _this3.sortCol.sortDirection;
|
||
if (direction === 'up') {
|
||
return a[_this3.sortCol.prop] > b[_this3.sortCol.prop] ? 1 : -1;
|
||
}if (direction === 'down') {
|
||
return b[_this3.sortCol.prop] > a[_this3.sortCol.prop] ? 1 : -1;
|
||
}
|
||
return 0;
|
||
});
|
||
},
|
||
sortUp: function sortUp(col) {
|
||
this.sortCol = col;
|
||
this.sortCol.sortDirection = 'up';
|
||
this.sortData(this.showData);
|
||
},
|
||
sortDown: function sortDown(col) {
|
||
this.sortCol = col;
|
||
this.sortCol.sortDirection = 'down';
|
||
this.sortData(this.showData);
|
||
},
|
||
|
||
// 点击th列
|
||
thClick: function thClick(col, index, event) {
|
||
if (col.sort) {
|
||
this.sortCol = col;
|
||
if (this.sortCol.sortDirection == '') {
|
||
this.sortCol.sortDirection = 'up';
|
||
} else if (this.sortCol.sortDirection == 'up') {
|
||
this.sortCol.sortDirection = 'down';
|
||
} else if (this.sortCol.sortDirection == 'down') {
|
||
this.sortCol.sortDirection = 'up';
|
||
} else {
|
||
this.sortCol = null;
|
||
}
|
||
this.sortData(this.showData);
|
||
}
|
||
this.$emit('on-th-click', col, index, event);
|
||
},
|
||
|
||
// 点击内容行
|
||
trClick: function trClick(trData, index, event) {
|
||
this.$emit('on-tr-click', trData, index, event);
|
||
},
|
||
|
||
// 点击td
|
||
tdClick: function tdClick(trData, tdData, index, event, col, rowkey) {
|
||
this.$emit('on-td-click', trData, tdData, index, event);
|
||
if (col && col.detailComponent) {
|
||
var key = rowkey + '_detail_' + col.prop;
|
||
if (!this.detailList[key]) {
|
||
this.$set(this.detailList, key, {
|
||
rowkey: rowkey,
|
||
key: key,
|
||
col: col,
|
||
show: true,
|
||
updateTime: Date.now()
|
||
});
|
||
} else {
|
||
this.detailList[key].show = !this.detailList[key].show;
|
||
this.detailList[key].updateTime = Date.now();
|
||
}
|
||
}
|
||
},
|
||
|
||
// 触发action动作
|
||
fireAction: function fireAction(action, trData, event) {
|
||
var parent = null;
|
||
if (this.$vnode) {
|
||
parent = this.$vnode.context;
|
||
}
|
||
if (util.isString(action.func) && parent && parent[action.func]) {
|
||
parent[action.func].call(parent || this, trData, event);
|
||
}
|
||
if (util.isFunction(action.func)) {
|
||
action.func.call(parent || this, trData, event);
|
||
}
|
||
},
|
||
expand: function expand(trData, index, event) {
|
||
var i = this.expandedList.indexOf(index);
|
||
if (i != -1) {
|
||
this.expandedList.splice(i, 1);
|
||
this.$emit('on-expand-hide', trData, index, event);
|
||
} else {
|
||
this.expandedList.push(index);
|
||
this.$emit('on-expand-show', trData, index, event);
|
||
}
|
||
},
|
||
disabledRow: function disabledRow() {
|
||
return false;
|
||
},
|
||
changeRowsSelected: function changeRowsSelected(selected) {
|
||
var _this4 = this;
|
||
|
||
if (selected) {
|
||
this.showData.filter(function (obj, index) {
|
||
return !_this4.disabledRow(obj, index);
|
||
}).forEach(function (obj) {
|
||
obj._selected = true;
|
||
});
|
||
} else {
|
||
this.showData.filter(function (obj, index) {
|
||
return !_this4.disabledRow(obj, index);
|
||
}).forEach(function (obj) {
|
||
obj._selected = false;
|
||
});
|
||
}
|
||
},
|
||
changeRowSelected: function changeRowSelected(trData, index, selected) {
|
||
this.$emit('on-select', trData, index, selected);
|
||
},
|
||
getSelected: function getSelected() {
|
||
var _this5 = this;
|
||
|
||
var arr = [];
|
||
this.showData.filter(function (obj) {
|
||
return obj._selected;
|
||
}).forEach(function (obj) {
|
||
arr.push(_this5.data[obj._index]);
|
||
});
|
||
return arr;
|
||
},
|
||
getTrDetailList: function getTrDetailList(rowkey) {
|
||
var obj = [];
|
||
for (var p in this.detailList) {
|
||
if (this.detailList[p].rowkey === rowkey) {
|
||
obj.push(this.detailList[p]);
|
||
}
|
||
}
|
||
obj = obj.sort(function (a, b) {
|
||
return b.updateTime - a.updateTime;
|
||
});
|
||
return obj;
|
||
},
|
||
getTdDetailType: function getTdDetailType(col, rowkey) {
|
||
var key = rowkey + '_detail_' + col.prop;
|
||
return this.detailList[key] && this.detailList[key].show ? 'down' : 'ellipsis';
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 254 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.default = {
|
||
'zh-cn': {
|
||
el: {
|
||
table: {
|
||
expandOpen: '展开',
|
||
expandClose: '关闭'
|
||
},
|
||
datepicker: {
|
||
weekFirstDay: '1',
|
||
wheel: '滚动选择',
|
||
prevMonth: '上个月',
|
||
nextMonth: '下个月',
|
||
selectDate: '请选择日期',
|
||
confirmBtn: '确定',
|
||
timeTitle: 'YYYY年 MMMM DD日',
|
||
footSelectTime: '选择时间',
|
||
footSelectDate: '选择日期',
|
||
// week: '周次',
|
||
weeks: {
|
||
sun: '日',
|
||
mon: '一',
|
||
tue: '二',
|
||
wed: '三',
|
||
thu: '四',
|
||
fri: '五',
|
||
sat: '六'
|
||
},
|
||
yearSuffix: '年',
|
||
month1: '1月',
|
||
month2: '2月',
|
||
month3: '3月',
|
||
month4: '4月',
|
||
month5: '5月',
|
||
month6: '6月',
|
||
month7: '7月',
|
||
month8: '8月',
|
||
month9: '9月',
|
||
month10: '10月',
|
||
month11: '11月',
|
||
month12: '12月',
|
||
months: {
|
||
jan: '一月',
|
||
feb: '二月',
|
||
mar: '三月',
|
||
apr: '四月',
|
||
may: '五月',
|
||
jun: '六月',
|
||
jul: '七月',
|
||
aug: '八月',
|
||
sep: '九月',
|
||
oct: '十月',
|
||
nov: '十一月',
|
||
dec: '十二月'
|
||
}
|
||
},
|
||
timepicker: {
|
||
placeholder: '请选择时间'
|
||
},
|
||
input: {
|
||
chooseFile: '请选择文件'
|
||
},
|
||
message: {
|
||
confirm: '确定',
|
||
cancel: '取消'
|
||
},
|
||
select: {
|
||
placeholder: '请选择',
|
||
searchPlaceholder: '请输入关键字搜索'
|
||
},
|
||
tooltip: {
|
||
confirm: '确定',
|
||
cancel: '取消'
|
||
},
|
||
upload: {
|
||
placeholder: '点击选择上传文件',
|
||
suffixTip: '文件"{filename}"格式不正确, 只支持上传"{suffix}"后缀的文件',
|
||
sizeTip: '文件"{filename}"大小不能超过{size}MB',
|
||
heightTip: '文件"{filename}"高度不能超过{height}px',
|
||
widthTip: '文件"{filename}"宽度不能超过{width}px'
|
||
},
|
||
zoom: {
|
||
close: '关闭'
|
||
},
|
||
pagination: {
|
||
pprev: '向前{n}页',
|
||
prev: '上一页',
|
||
next: '下一页',
|
||
nnext: '向后{n}页',
|
||
first: '第一页',
|
||
last: '最后一页',
|
||
n: '第{n}页',
|
||
select: '{n} 条/页',
|
||
jumper: {
|
||
pre: '跳至',
|
||
next: '页'
|
||
}
|
||
}
|
||
}
|
||
},
|
||
en: {
|
||
el: {
|
||
table: {
|
||
expandOpen: 'Open',
|
||
expandClose: 'Close'
|
||
},
|
||
datepicker: {
|
||
weekFirstDay: '7',
|
||
wheel: 'Wheel select',
|
||
prevMonth: 'Previous month',
|
||
nextMonth: 'Next month',
|
||
selectDate: 'Select date',
|
||
confirmBtn: 'OK',
|
||
timeTitle: 'MMMM DD YYYY',
|
||
footSelectTime: 'select time',
|
||
footSelectDate: 'select date',
|
||
yearSuffix: '',
|
||
weeks: {
|
||
sun: 'Su',
|
||
mon: 'Mo',
|
||
tue: 'Tu',
|
||
wed: 'We',
|
||
thu: 'Th',
|
||
fri: 'Fr',
|
||
sat: 'Sa'
|
||
},
|
||
months: {
|
||
jan: 'Jan',
|
||
feb: 'Feb',
|
||
mar: 'Mar',
|
||
apr: 'Apr',
|
||
may: 'May',
|
||
jun: 'Jun',
|
||
jul: 'Jul',
|
||
aug: 'Aug',
|
||
sep: 'Sep',
|
||
oct: 'Oct',
|
||
nov: 'Nov',
|
||
dec: 'Dec'
|
||
},
|
||
month1: 'Jan',
|
||
month2: 'Feb',
|
||
month3: 'Mar',
|
||
month4: 'Apr',
|
||
month5: 'May',
|
||
month6: 'Jun',
|
||
month7: 'Jul',
|
||
month8: 'Aug',
|
||
month9: 'Sep',
|
||
month10: 'Oct',
|
||
month11: 'Nov',
|
||
month12: 'Dec'
|
||
},
|
||
timepicker: {
|
||
placeholder: 'Select time'
|
||
},
|
||
input: {
|
||
chooseFile: 'Select a file'
|
||
},
|
||
message: {
|
||
confirm: 'OK',
|
||
cancel: 'Cancel'
|
||
},
|
||
select: {
|
||
placeholder: 'Select',
|
||
searchPlaceholder: 'Enter a keyword search'
|
||
},
|
||
tooltip: {
|
||
confirm: 'OK',
|
||
cancel: 'Cancel'
|
||
},
|
||
upload: {
|
||
placeholder: 'Upload files',
|
||
suffixTip: 'File "{filename}" format is incorrect. Only files with suffix {suffix} can be uploaded',
|
||
sizeTip: 'File "{filename}" size exceeds {size}MB',
|
||
heightTip: 'File "{filename}" height exceeds {height}px',
|
||
widthTip: 'File "{filename}" width exceeds {width}px'
|
||
},
|
||
zoom: {
|
||
close: 'Close'
|
||
},
|
||
pagination: {
|
||
pprev: 'Previous {n} pages',
|
||
prev: 'Previous page',
|
||
next: 'Next page',
|
||
nnext: 'Next {n} pages',
|
||
first: 'Frist page',
|
||
last: 'Last page',
|
||
n: 'Page {n}',
|
||
select: '{n} / Page',
|
||
jumper: {
|
||
pre: 'Goto',
|
||
next: ''
|
||
}
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 255 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _typeof2 = __webpack_require__(31);
|
||
|
||
var _typeof3 = _interopRequireDefault(_typeof2);
|
||
|
||
exports.default = function () {
|
||
/**
|
||
* 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 && (0, _typeof3.default)(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;
|
||
}
|
||
result = (0, _util.hasOwn)(args, i) ? args[i] : null;
|
||
if (result === null || result === undefined) {
|
||
return '';
|
||
}
|
||
|
||
return result;
|
||
});
|
||
}
|
||
|
||
return template;
|
||
};
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
|
||
|
||
/**
|
||
* String format template
|
||
* - Inspired:
|
||
* https://github.com/Matt-Esch/string-template/index.js
|
||
*/
|
||
|
||
/***/ }),
|
||
/* 256 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(257),
|
||
/* template */
|
||
__webpack_require__(258),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/tableAction.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] tableAction.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-756dfbae", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-756dfbae", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 257 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _button = __webpack_require__(75);
|
||
|
||
var _button2 = _interopRequireDefault(_button);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
components: {
|
||
WbButton: _button2.default
|
||
},
|
||
props: {
|
||
col: {
|
||
type: Object,
|
||
default: undefined
|
||
},
|
||
trData: {
|
||
type: Object,
|
||
default: undefined
|
||
}
|
||
},
|
||
methods: {
|
||
fireAction: function fireAction(item, event) {
|
||
this.$emit('on-click', item, this.trData, event);
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 258 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-table-action"
|
||
}, _vm._l((_vm.col.action), function(item, index) {
|
||
return _c('Wb-button', {
|
||
key: index,
|
||
staticClass: "ui-table-action-text",
|
||
attrs: {
|
||
"type": "text"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.fireAction(item, $event)
|
||
}
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(item.text) + "\n ")])
|
||
}), 1)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-756dfbae", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 259 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(260),
|
||
/* template */
|
||
__webpack_require__(261),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/tableText.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] tableText.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-0b1331b6", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-0b1331b6", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 260 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
exports.default = {
|
||
props: {
|
||
col: {
|
||
type: Object,
|
||
default: undefined
|
||
},
|
||
trData: {
|
||
type: Object,
|
||
default: undefined
|
||
}
|
||
},
|
||
computed: {
|
||
text: function text() {
|
||
var col = this.col;
|
||
var filter = col.filter;
|
||
var rst = this.trData[col.prop];
|
||
// 如果filter存在
|
||
if (util.isArray(filter)) {
|
||
var theOne = col.filter.filter(function (o) {
|
||
return o.value == rst;
|
||
});
|
||
if (theOne.length > 0) {
|
||
rst = theOne[0].text;
|
||
}
|
||
} else if (util.isFunction(col.filter)) {
|
||
rst = col.filter(rst, this.trData);
|
||
}
|
||
return rst;
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 261 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('span', [_vm._v("\n " + _vm._s(_vm.text) + "\n")])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-0b1331b6", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 262 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(263),
|
||
/* template */
|
||
__webpack_require__(264),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/tableComponent.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] tableComponent.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-e2be3196", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-e2be3196", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 263 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
exports.default = {
|
||
props: {
|
||
col: {
|
||
type: Object,
|
||
default: undefined
|
||
},
|
||
trData: {
|
||
type: Object,
|
||
default: undefined
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
if (this.col.component && util.isFunction(this.col.component)) {
|
||
var parent = null;
|
||
if (this.$parent && this.$parent.$vnode) {
|
||
parent = this.$parent.$vnode.context;
|
||
}
|
||
var component = this.col.component.call(parent || this.col, this.trData, this.trData[this.col.prop]);
|
||
component.$mount(this.$refs.swap);
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 264 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
ref: "swap"
|
||
})
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-e2be3196", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 265 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(266),
|
||
/* template */
|
||
__webpack_require__(267),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/tableDetailComponent.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] tableDetailComponent.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-2812b264", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-2812b264", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 266 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
exports.default = {
|
||
props: {
|
||
cols: {
|
||
type: Array,
|
||
default: undefined
|
||
},
|
||
col: {
|
||
type: Object,
|
||
default: undefined
|
||
},
|
||
trData: {
|
||
type: Object,
|
||
default: undefined
|
||
},
|
||
tdData: {
|
||
type: Object,
|
||
default: undefined
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
if (this.col.detailComponent && util.isFunction(this.col.detailComponent)) {
|
||
var parent = null;
|
||
if (this.$parent && this.$parent.$vnode) {
|
||
parent = this.$parent.$vnode.context;
|
||
}
|
||
var component = this.col.detailComponent.call(parent || this.col, this.trData, this.trData[this.col.prop]);
|
||
component.$mount(this.$refs.swap);
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 267 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('td', {
|
||
staticClass: "ui-table-detail-cell",
|
||
attrs: {
|
||
"colspan": _vm.cols.length
|
||
}
|
||
}, [_c('div', {
|
||
ref: "swap"
|
||
})])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-2812b264", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 268 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(269),
|
||
/* template */
|
||
__webpack_require__(270),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/headComponent.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] headComponent.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-7e4e8a07", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-7e4e8a07", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 269 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
exports.default = {
|
||
props: {
|
||
col: {
|
||
type: Object,
|
||
default: undefined
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
var parent = null;
|
||
var component = void 0;
|
||
if (this.$parent && this.$parent.$vnode) {
|
||
parent = this.$parent.$vnode.context;
|
||
}
|
||
if (this.col.name && util.isFunction(this.col.name)) {
|
||
component = this.col.name.call(parent || this.col);
|
||
}
|
||
if (this.col.name && util.isObject(this.col.name)) {
|
||
component = this.col.name;
|
||
}
|
||
component && component.$mount(this.$refs.swap);
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 270 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
ref: "swap"
|
||
})
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-7e4e8a07", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 271 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(272),
|
||
/* template */
|
||
null,
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/tableExpand.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-27388a12", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-27388a12", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 272 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.default = {
|
||
props: {
|
||
cols: {
|
||
type: Array,
|
||
default: undefined
|
||
},
|
||
trData: {
|
||
type: Object,
|
||
default: undefined
|
||
},
|
||
renderExpanded: {
|
||
type: Function,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {};
|
||
},
|
||
render: function render(h) {
|
||
return h('td', {
|
||
attrs: {
|
||
colspan: this.cols.length
|
||
},
|
||
class: 'ui-table-expanded-cell'
|
||
}, [this.renderExpanded(this.trData)]);
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 273 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(274),
|
||
/* template */
|
||
__webpack_require__(275),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/editCell.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] editCell.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-1bb8c0f2", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-1bb8c0f2", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 274 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
var _clickoutside = __webpack_require__(29);
|
||
|
||
var _clickoutside2 = _interopRequireDefault(_clickoutside);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
components: {
|
||
Icon: _icon2.default
|
||
},
|
||
directives: {
|
||
clickoutside: _clickoutside2.default
|
||
},
|
||
props: {
|
||
col: {
|
||
type: Object,
|
||
default: undefined
|
||
},
|
||
trData: {
|
||
type: Object,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
newValue: '',
|
||
isEditing: false,
|
||
editConf: this.col.editableConf,
|
||
optionList: this.col.editableConf.list || [],
|
||
limit: this.col.editableConf.multipleLimit,
|
||
multiple: this.col.editableConf.multiple
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
text: function text() {
|
||
var col = this.col;
|
||
var rst = this.trData[col.prop];
|
||
if (util.isFunction(col.filter)) {
|
||
rst = col.filter(rst, this.trData);
|
||
} else if (util.isArray(rst)) {
|
||
rst = rst.join(',');
|
||
}
|
||
return rst;
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
if (this.editConf.type === 'select') {
|
||
if (this.multiple) {
|
||
this.newValue = [];
|
||
}
|
||
}
|
||
},
|
||
|
||
methods: {
|
||
edit: function edit() {
|
||
var _this = this;
|
||
|
||
this.newValue = this.text;
|
||
if (this.editConf.type === 'select') {
|
||
if (this.multiple) {
|
||
this.newValue = [].concat(this.trData[this.col.prop]);
|
||
} else {
|
||
var item = this.optionList.find(function (it) {
|
||
return it.value === _this.trData[_this.col.prop] || it.label === _this.trData[_this.col.prop];
|
||
});
|
||
this.newValue = item && item.value;
|
||
}
|
||
}
|
||
this.initValue = this.newValue;
|
||
this.isEditing = true;
|
||
},
|
||
confirmChange: function confirmChange() {
|
||
var _this2 = this;
|
||
|
||
if (this.newValue === this.initValue) return this.reset();
|
||
var valid = true;
|
||
var _editConf = this.editConf,
|
||
validate = _editConf.validate,
|
||
confirm = _editConf.confirm;
|
||
|
||
if (util.isFunction(validate)) {
|
||
var args = [this.trData[this.col.prop], this.newValue, this.trData];
|
||
valid = validate.apply(this.col, args);
|
||
}
|
||
if (confirm) {
|
||
if (valid === true) {
|
||
this.showConfirm();
|
||
} else if (valid && util.isFunction(valid.then)) {
|
||
valid.then(function () {
|
||
_this2.showConfirm();
|
||
});
|
||
}
|
||
} else {
|
||
this.change();
|
||
}
|
||
},
|
||
showConfirm: function showConfirm() {
|
||
var _this3 = this;
|
||
|
||
var name = '';
|
||
if (typeof this.col.name === 'string') {
|
||
name = this.col.name;
|
||
}
|
||
this.$Message.confirm('修改', '\u662F\u5426\u786E\u8BA4\u4FEE\u6539' + name + '?').then(function (index) {
|
||
if (index === 0) {
|
||
_this3.change();
|
||
}
|
||
_this3.reset();
|
||
});
|
||
},
|
||
change: function change() {
|
||
if (util.isFunction(this.editConf.change)) {
|
||
var args = [this.trData[this.col.prop], this.newValue, this.col, this.trData];
|
||
this.editConf.change.apply(null, args);
|
||
this.reset();
|
||
}
|
||
},
|
||
reset: function reset() {
|
||
this.isEditing = false;
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 275 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={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.reset),
|
||
expression: "reset"
|
||
}],
|
||
staticClass: "ui-table-edit-cell"
|
||
}, [(!_vm.isEditing) ? _c('div', [_vm._v("\n " + _vm._s(_vm.text) + "\n "), _c('Icon', {
|
||
staticClass: "edit-icon",
|
||
attrs: {
|
||
"type": "md-create",
|
||
"size": "12"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.edit($event)
|
||
}
|
||
}
|
||
})], 1) : (_vm.editConf.type === 'input') ? _c('Wb-input', {
|
||
model: {
|
||
value: (_vm.newValue),
|
||
callback: function($$v) {
|
||
_vm.newValue = $$v
|
||
},
|
||
expression: "newValue"
|
||
}
|
||
}) : (_vm.editConf.type === 'select') ? _c('Wb-select', {
|
||
attrs: {
|
||
"multiple-limit": _vm.limit,
|
||
"multiple": _vm.multiple,
|
||
"filterable": ""
|
||
},
|
||
model: {
|
||
value: (_vm.newValue),
|
||
callback: function($$v) {
|
||
_vm.newValue = $$v
|
||
},
|
||
expression: "newValue"
|
||
}
|
||
}, _vm._l((_vm.optionList), function(item) {
|
||
return _c('wb-option', {
|
||
key: item.value,
|
||
attrs: {
|
||
"value": item.value
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(item.label) + "\n ")])
|
||
}), 1) : _vm._e(), _vm._v(" "), (_vm.isEditing) ? _c('Icon', {
|
||
staticClass: "edit-icon",
|
||
attrs: {
|
||
"type": "md-checkmark",
|
||
"size": "14"
|
||
},
|
||
on: {
|
||
"click": _vm.confirmChange
|
||
}
|
||
}) : _vm._e()], 1)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-1bb8c0f2", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 276 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-table-swap",
|
||
class: _vm.classes
|
||
}, [_vm._t("default"), _vm._v(" "), _c('table', {
|
||
staticClass: "ui-table"
|
||
}, [_c('thead', {
|
||
staticClass: "ui-table-thead"
|
||
}, _vm._l((_vm.headerRows), function(row, rowIndex) {
|
||
return _c('tr', {
|
||
key: rowIndex
|
||
}, _vm._l((row), function(col, colIndex) {
|
||
return _c('th', {
|
||
key: col.uid,
|
||
class: _vm.getThClass(col, colIndex),
|
||
style: (_vm.getTdStyle(col)),
|
||
attrs: {
|
||
"colspan": col.colSpan,
|
||
"rowspan": col.rowSpan
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.thClick(col, colIndex, $event)
|
||
}
|
||
}
|
||
}, [(!col.type) ? [(col.headTip) ? [_c('span', {
|
||
directives: [{
|
||
name: "tooltip",
|
||
rawName: "v-tooltip",
|
||
value: (col.headTip),
|
||
expression: "col.headTip"
|
||
}]
|
||
}, [_vm._v(_vm._s(col.name))]), _vm._v(" "), _c('Icon', {
|
||
attrs: {
|
||
"type": "md-information-circle-outline",
|
||
"color": "#aaa",
|
||
"size": "12"
|
||
}
|
||
})] : [(typeof col.name === 'string') ? [_vm._v("\n " + _vm._s(col.name) + "\n ")] : [_c('head-component', {
|
||
attrs: {
|
||
"col": col
|
||
}
|
||
})], _vm._v(" "), (col.sort) ? _c('div', {
|
||
staticClass: "ui-table-column-sorter"
|
||
}, [_c('span', {
|
||
staticClass: "ui-table-column-sorter-up",
|
||
class: _vm.getSortClass(col, 'up'),
|
||
attrs: {
|
||
"title": "↑"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.sortUp(col)
|
||
}
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "md-arrow-dropup"
|
||
}
|
||
})], 1), _vm._v(" "), _c('span', {
|
||
staticClass: "ui-table-column-sorter-down",
|
||
class: _vm.getSortClass(col, 'down'),
|
||
attrs: {
|
||
"title": "↓"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.sortDown(col)
|
||
}
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "md-arrow-dropdown"
|
||
}
|
||
})], 1)]) : _vm._e()]] : _vm._e(), _vm._v(" "), (col.type == 'selection') ? [_c('Checkbox', {
|
||
attrs: {
|
||
"value": _vm.selectedAllRow
|
||
},
|
||
on: {
|
||
"click": _vm.changeRowsSelected
|
||
}
|
||
})] : _vm._e()], 2)
|
||
}), 0)
|
||
}), 0), _vm._v(" "), _c('tbody', {
|
||
staticClass: "ui-table-tbody"
|
||
}, [_vm._l((_vm.showData), function(trData, rowIndex) {
|
||
return [_c('tr', {
|
||
key: trData._rowKey,
|
||
class: _vm.getTrClass(rowIndex, _vm.data[trData._index]),
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.trClick(_vm.data[trData._index], rowIndex, $event)
|
||
}
|
||
}
|
||
}, _vm._l((_vm.cols), function(col, colIndex) {
|
||
return _c('td', {
|
||
key: col.uid,
|
||
class: _vm.getTdClass(col, colIndex, _vm.data[trData._index][col.prop], _vm.data[trData._index]),
|
||
style: (_vm.getTdStyle(col)),
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.tdClick(_vm.data[trData._index], _vm.data[trData._index][col.prop], colIndex, $event, col, trData._rowKey)
|
||
}
|
||
}
|
||
}, [(col.type === 'expand') ? [_c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.expandedList.indexOf(rowIndex) == -1),
|
||
expression: "expandedList.indexOf(rowIndex) == -1"
|
||
}],
|
||
staticClass: "ui-table-icon",
|
||
attrs: {
|
||
"title": _vm.t("el.table.expandOpen")
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.expand(_vm.data[trData._index], rowIndex, $event)
|
||
}
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "ios-arrow-forward"
|
||
}
|
||
})], 1), _vm._v(" "), _c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.expandedList.indexOf(rowIndex) != -1),
|
||
expression: "expandedList.indexOf(rowIndex) != -1"
|
||
}],
|
||
staticClass: "ui-table-icon",
|
||
attrs: {
|
||
"title": _vm.t("el.table.expandClose")
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.expand(_vm.data[trData._index], rowIndex, $event)
|
||
}
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "ios-arrow-down"
|
||
}
|
||
})], 1)] : _vm._e(), _vm._v(" "), (col.type === 'selection') ? [_c('Checkbox', {
|
||
attrs: {
|
||
"disabled": _vm.disabledRow(_vm.data[trData._index], rowIndex)
|
||
},
|
||
on: {
|
||
"on-change": function($event) {
|
||
return _vm.changeRowSelected(_vm.data[trData._index], rowIndex, trData._selected)
|
||
}
|
||
},
|
||
model: {
|
||
value: (trData._selected),
|
||
callback: function($$v) {
|
||
_vm.$set(trData, "_selected", $$v)
|
||
},
|
||
expression: "trData._selected"
|
||
}
|
||
})] : [(!col.action && !col.component && !col.editable) ? _c('table-text', {
|
||
attrs: {
|
||
"col": col,
|
||
"tr-data": _vm.data[trData._index]
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), (col.action) ? _c('table-action', {
|
||
attrs: {
|
||
"col": col,
|
||
"tr-data": _vm.data[trData._index]
|
||
},
|
||
on: {
|
||
"on-click": _vm.fireAction
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), (!col.editable && col.component) ? _c('table-component', {
|
||
attrs: {
|
||
"col": col,
|
||
"tr-data": _vm.data[trData._index]
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), (col.editable && !col.component) ? _c('edit-cell', {
|
||
attrs: {
|
||
"col": col,
|
||
"tr-data": _vm.data[trData._index]
|
||
}
|
||
}) : _vm._e()], _vm._v(" "), (col.detailComponent) ? _c('Icon', {
|
||
staticClass: "ui-table-detail-icon",
|
||
attrs: {
|
||
"type": _vm.getTdDetailType(col, trData._rowKey)
|
||
}
|
||
}) : _vm._e()], 2)
|
||
}), 0), _vm._v(" "), (_vm.renderExpanded) ? _c('tr', {
|
||
key: trData._rowKey + '_expanded'
|
||
}, [_c('table-expand', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.expandedList.indexOf(rowIndex) != -1),
|
||
expression: "expandedList.indexOf(rowIndex) != -1"
|
||
}],
|
||
attrs: {
|
||
"render-expanded": _vm.renderExpanded,
|
||
"cols": _vm.cols,
|
||
"tr-data": _vm.data[trData._index]
|
||
}
|
||
})], 1) : _vm._e(), _vm._v(" "), _vm._l((_vm.getTrDetailList(trData._rowKey)), function(detail) {
|
||
return _c('tr', {
|
||
key: detail.key
|
||
}, [_c('table-detail-component', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (detail.show),
|
||
expression: "detail.show"
|
||
}],
|
||
attrs: {
|
||
"cols": _vm.cols,
|
||
"col": detail.col,
|
||
"tr-data": _vm.data[trData._index]
|
||
}
|
||
})], 1)
|
||
})]
|
||
})], 2)]), _vm._v(" "), (_vm.noDataText) ? _c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.showData.length == 0),
|
||
expression: "showData.length == 0"
|
||
}],
|
||
staticClass: "ui-table-empty"
|
||
}, [_vm._v("\n " + _vm._s(_vm.noDataText) + "\n ")]) : _vm._e()], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-5f5e0750", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 277 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(278),
|
||
/* template */
|
||
__webpack_require__(279),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/treeTable.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] treeTable.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-47d2115a", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-47d2115a", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 278 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _table = __webpack_require__(112);
|
||
|
||
var _table2 = _interopRequireDefault(_table);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'TreeTable',
|
||
extends: _table2.default,
|
||
watch: {
|
||
data: {
|
||
handler: function handler() {
|
||
this.showData = this.makeData(this.objectToArray(this.data));
|
||
},
|
||
|
||
deep: true
|
||
}
|
||
},
|
||
created: function created() {
|
||
this.showData = this.makeData(this.objectToArray(this.data));
|
||
},
|
||
|
||
methods: {
|
||
getArrowType: function getArrowType(expand) {
|
||
var type = '';
|
||
if (!expand) {
|
||
type = 'md-arrow-dropright';
|
||
} else {
|
||
type = 'md-arrow-dropdown';
|
||
}
|
||
return type;
|
||
},
|
||
|
||
// 设置样式
|
||
getTdStyle: function getTdStyle(col, index) {
|
||
return {
|
||
'text-align': index === 0 ? 'left' : col.align,
|
||
width: col.width
|
||
};
|
||
},
|
||
objectToArray: function objectToArray(data, collection, parent) {
|
||
collection = collection || [];
|
||
if (util.isArray(data)) {
|
||
var arr = util.deepCopy(data);
|
||
var length = arr.length;
|
||
for (var i = 0; i < length; i++) {
|
||
var item = arr[i];
|
||
if (parent) {
|
||
item._parentSeq = parent._seq;
|
||
item._seq = parent._seq + '.' + (i + 1);
|
||
} else {
|
||
item._seq = '' + (i + 1);
|
||
}
|
||
collection.push(item);
|
||
if (item.children && item.children.length > 0) {
|
||
item._expanded = item._expanded !== undefined ? item._expanded : false;
|
||
this.objectToArray(item.children, collection, item);
|
||
}
|
||
}
|
||
}
|
||
return collection;
|
||
},
|
||
|
||
// 设置td的个性样式
|
||
getTreeTdClass: function getTreeTdClass(col, index, tdData, trData) {
|
||
var arr = this.getTdClass(col, index, tdData, trData);
|
||
if (index == 0) {
|
||
arr.push('tree-level-' + trData._seq.split('.').length);
|
||
}
|
||
return arr;
|
||
},
|
||
|
||
// 判断是否一个节点是否显示,需要去递归去找父节点直到父节点是闭合,闭合则隐藏
|
||
isShow: function isShow(trData) {
|
||
var _this = this;
|
||
|
||
var digui = function digui(data) {
|
||
var parent = _this.showData.filter(function (item) {
|
||
return item._seq == data._parentSeq;
|
||
});
|
||
if (parent[0]) {
|
||
if (parent[0]._expanded) {
|
||
return digui(parent[0]);
|
||
}
|
||
return false;
|
||
}
|
||
return true;
|
||
};
|
||
return digui(trData);
|
||
},
|
||
toggle: function toggle(data) {
|
||
if (data._expanded !== undefined) {
|
||
data._expanded = !data._expanded;
|
||
}
|
||
},
|
||
getOriginalData: function getOriginalData(trData) {
|
||
var _this2 = this;
|
||
|
||
var result = null;
|
||
trData._seq.split('.').forEach(function (index) {
|
||
if (result == null) {
|
||
result = _this2.data[index - 1];
|
||
} else {
|
||
result = result.children[index - 1];
|
||
}
|
||
});
|
||
return result;
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 279 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-table-swap",
|
||
class: _vm.classes
|
||
}, [_vm._t("default"), _vm._v(" "), _c('table', {
|
||
staticClass: "ui-table"
|
||
}, [_c('thead', {
|
||
staticClass: "ui-table-thead"
|
||
}, _vm._l((_vm.headerRows), function(row, rowIndex) {
|
||
return _c('tr', {
|
||
key: rowIndex
|
||
}, _vm._l((row), function(col, colIndex) {
|
||
return _c('th', {
|
||
key: colIndex,
|
||
style: (_vm.getTdStyle(col, colIndex)),
|
||
attrs: {
|
||
"colspan": col.colSpan,
|
||
"rowspan": col.rowSpan
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.thClick(col, colIndex, $event)
|
||
}
|
||
}
|
||
}, [_c('span', [_vm._v("\n " + _vm._s(col.name) + "\n "), (col.sort) ? _c('div', {
|
||
staticClass: "ui-table-column-sorter"
|
||
}, [_c('span', {
|
||
staticClass: "ui-table-column-sorter-up",
|
||
class: _vm.getSortClass(col, 'up'),
|
||
attrs: {
|
||
"title": "↑"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.sortUp(col)
|
||
}
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "md-arrow-dropup"
|
||
}
|
||
})], 1), _vm._v(" "), _c('span', {
|
||
staticClass: "ui-table-column-sorter-down",
|
||
class: _vm.getSortClass(col, 'down'),
|
||
attrs: {
|
||
"title": "↓"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.sortDown(col)
|
||
}
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "md-arrow-dropdown"
|
||
}
|
||
})], 1)]) : _vm._e()])])
|
||
}), 0)
|
||
}), 0), _vm._v(" "), _c('tbody', {
|
||
staticClass: "ui-table-tbody"
|
||
}, _vm._l((_vm.showData), function(trData, rowIndex) {
|
||
return _c('tr', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.isShow(trData)),
|
||
expression: "isShow(trData)"
|
||
}],
|
||
key: trData._rowKey,
|
||
class: _vm.getTrClass(rowIndex),
|
||
on: {
|
||
"click": function($event) {
|
||
_vm.trClick(_vm.getOriginalData(trData), rowIndex, $event)
|
||
}
|
||
}
|
||
}, _vm._l((_vm.cols), function(col, colIndex) {
|
||
return _c('td', {
|
||
key: colIndex,
|
||
class: _vm.getTreeTdClass(col, colIndex, trData[col.prop], trData),
|
||
style: (_vm.getTdStyle(col, colIndex)),
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.tdClick(trData, trData[col.prop], colIndex, $event)
|
||
}
|
||
}
|
||
}, [(trData.children && trData.children.length > 0 && colIndex == 0) ? _c('Icon', {
|
||
staticClass: "ui-expand-arrow",
|
||
attrs: {
|
||
"type": _vm.getArrowType(trData._expanded)
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.toggle(trData, $event)
|
||
}
|
||
}
|
||
}) : _c('i', {
|
||
staticClass: "ui-expand-null"
|
||
}), _vm._v(" "), (!col.action && !col.component) ? _c('table-text', {
|
||
attrs: {
|
||
"col": col,
|
||
"tr-data": trData
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), (col.action) ? _c('table-action', {
|
||
attrs: {
|
||
"col": col,
|
||
"tr-data": trData
|
||
},
|
||
on: {
|
||
"on-click": _vm.fireAction
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), (col.component) ? _c('table-component', {
|
||
attrs: {
|
||
"col": col,
|
||
"tr-data": trData
|
||
}
|
||
}) : _vm._e()], 1)
|
||
}), 0)
|
||
}), 0)]), _vm._v(" "), (_vm.noDataText) ? _c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.showData.length == 0),
|
||
expression: "showData.length == 0"
|
||
}],
|
||
staticClass: "ui-table-empty"
|
||
}, [_vm._v("\n " + _vm._s(_vm.noDataText) + "\n ")]) : _vm._e()], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-47d2115a", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 280 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(281),
|
||
/* template */
|
||
null,
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/data-table/column.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-189be43c", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-189be43c", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 281 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _assign = __webpack_require__(49);
|
||
|
||
var _assign2 = _interopRequireDefault(_assign);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
var editable = {
|
||
type: 'input', // 单元格编辑组件类型,仅支持input,select
|
||
multiple: false, // type为select时提供多选
|
||
multipleLimit: 1, // 多选限制
|
||
confirm: false, // 是否提示修改
|
||
validate: function validate() {
|
||
return true;
|
||
},
|
||
change: undefined
|
||
};
|
||
exports.default = {
|
||
name: 'Column',
|
||
props: {
|
||
prop: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
name: {
|
||
type: [String, Function, Object],
|
||
default: undefined
|
||
},
|
||
align: {
|
||
type: String,
|
||
default: 'center'
|
||
},
|
||
index: {
|
||
type: Number,
|
||
default: 0
|
||
},
|
||
filter: {
|
||
type: [Array, Function],
|
||
default: undefined
|
||
},
|
||
action: {
|
||
type: [Array, Object],
|
||
default: undefined
|
||
},
|
||
sort: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
width: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
classes: {
|
||
type: [String, Function],
|
||
default: undefined
|
||
},
|
||
component: {
|
||
type: Function,
|
||
default: undefined
|
||
},
|
||
type: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
headTip: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
disabled: {
|
||
type: Function,
|
||
default: undefined
|
||
},
|
||
detailComponent: {
|
||
type: Function,
|
||
default: undefined
|
||
},
|
||
editable: {
|
||
type: Object,
|
||
default: null
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
sortDirection: '',
|
||
children: [],
|
||
parent: this.$parent
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
editableConf: function editableConf() {
|
||
var conf = {};
|
||
if (util.isObject(this.editable)) {
|
||
conf = (0, _assign2.default)({}, editable, this.editable);
|
||
}
|
||
return conf;
|
||
}
|
||
},
|
||
created: function created() {
|
||
var _this = this;
|
||
|
||
this.$options.render = function (h) {
|
||
return h('span', _this.$slots.default);
|
||
};
|
||
var _self = this;
|
||
if (this.type === 'expand') {
|
||
this.parent.renderExpanded = function (data) {
|
||
return _self.$scopedSlots.default ? _self.$scopedSlots.default(data) : _self.$slots.default;
|
||
};
|
||
}
|
||
if (this.type == 'selection') {
|
||
if (util.isFunction(this.disabled)) {
|
||
this.parent.disabledRow = this.disabled;
|
||
}
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
if (this.action && util.isObject(this.action) && !util.isArray(this.action)) {
|
||
this.action = [this.action];
|
||
}
|
||
this.children = this.$children.filter(function (child) {
|
||
return child.$options.name == 'Column';
|
||
});
|
||
if (this.parent && (this.parent.$options.name == 'Table' || this.parent.$options.name == 'TreeTable')) {
|
||
this.uid = this._uid;
|
||
this.parent.addColumn(this);
|
||
}
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
if (this.parent && (this.parent.$options.name == 'Table' || this.parent.$options.name == 'TreeTable')) {
|
||
this.parent.removeColumn(this);
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 282 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _carousel = __webpack_require__(283);
|
||
|
||
var _carousel2 = _interopRequireDefault(_carousel);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _carousel2.default;
|
||
|
||
/***/ }),
|
||
/* 283 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(284),
|
||
/* template */
|
||
__webpack_require__(285),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/carousel/carousel.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] carousel.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-2ea6fe1e", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-2ea6fe1e", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 284 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Carousel',
|
||
props: {
|
||
interval: { // 自动轮播的时间间隔
|
||
type: Number,
|
||
default: 6000
|
||
},
|
||
data: { // 数据
|
||
type: Array,
|
||
required: true
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
baseWidth: 0, // 基准宽度
|
||
current: 0, // 当前在第几个
|
||
timerId: null
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
// 列表的宽度
|
||
listWidth: function listWidth() {
|
||
return this.useList.length * this.baseWidth;
|
||
},
|
||
getListStyle: function getListStyle() {
|
||
return {
|
||
width: this.listWidth + 'px',
|
||
transform: 'translate(' + -1 * this.baseWidth * this.current + 'px, 0)'
|
||
};
|
||
},
|
||
getItemStyle: function getItemStyle() {
|
||
return {
|
||
width: this.baseWidth + 'px'
|
||
};
|
||
},
|
||
useList: function useList() {
|
||
var data = this.data.slice(0);
|
||
data.forEach(function (item) {
|
||
item.link = item.link || 'javascript:void 0';
|
||
});
|
||
return data;
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
this.baseWidth = this.$refs.carousel.offsetWidth;
|
||
this.timerId = this.createTimer();
|
||
},
|
||
destroyed: function destroyed() {
|
||
if (this.timerId) {
|
||
clearTimeout(this.timerId);
|
||
this.timerId = null;
|
||
}
|
||
},
|
||
|
||
methods: {
|
||
createTimer: function createTimer() {
|
||
var _this = this;
|
||
|
||
return setTimeout(function () {
|
||
if (_this.useList && _this.useList.length > 0) {
|
||
// 如果当前处于最后一个,需要自动滚动到第一个,过渡效果需要特殊处理
|
||
if (_this.current == _this.useList.length - 1) {
|
||
_this.current = 0;
|
||
} else {
|
||
_this.current += 1;
|
||
}
|
||
}
|
||
_this.timerId = _this.createTimer();
|
||
}, this.interval);
|
||
},
|
||
go: function go(num) {
|
||
clearTimeout(this.timerId);
|
||
this.timerId = null;
|
||
this.current = num;
|
||
this.timerId = this.createTimer();
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 285 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
ref: "carousel",
|
||
staticClass: "ui-carousel"
|
||
}, [_c('div', {
|
||
staticClass: "ui-carousel-list",
|
||
style: (_vm.getListStyle)
|
||
}, _vm._l((_vm.useList), function(item, index) {
|
||
return _c('div', {
|
||
key: index,
|
||
staticClass: "ui-carousel-list-item",
|
||
style: (_vm.getItemStyle)
|
||
}, [_c('a', {
|
||
attrs: {
|
||
"href": item.link
|
||
}
|
||
}, [_c('img', {
|
||
attrs: {
|
||
"src": item.image
|
||
}
|
||
})])])
|
||
}), 0), _vm._v(" "), (_vm.useList.length > 1) ? _c('div', {
|
||
staticClass: "ui-carousel-dot"
|
||
}, _vm._l((_vm.useList), function(item, index) {
|
||
return _c('li', {
|
||
key: index,
|
||
staticClass: "ui-carousel-dot-item",
|
||
class: {
|
||
'current': _vm.current == index
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.go(index)
|
||
}
|
||
}
|
||
})
|
||
}), 0) : _vm._e()])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-2ea6fe1e", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 286 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.Calendar = undefined;
|
||
|
||
var _calendars = __webpack_require__(115);
|
||
|
||
Object.defineProperty(exports, 'Calendar', {
|
||
enumerable: true,
|
||
get: function get() {
|
||
return _interopRequireDefault(_calendars).default;
|
||
}
|
||
});
|
||
|
||
var _datePicker = __webpack_require__(306);
|
||
|
||
var _datePicker2 = _interopRequireDefault(_datePicker);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _datePicker2.default;
|
||
|
||
/***/ }),
|
||
/* 287 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _slicedToArray2 = __webpack_require__(78);
|
||
|
||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
|
||
|
||
var _calendar = __webpack_require__(293);
|
||
|
||
var _calendar2 = _interopRequireDefault(_calendar);
|
||
|
||
var _clickoutside = __webpack_require__(29);
|
||
|
||
var _clickoutside2 = _interopRequireDefault(_clickoutside);
|
||
|
||
var _button = __webpack_require__(75);
|
||
|
||
var _button2 = _interopRequireDefault(_button);
|
||
|
||
var _propsMixin = __webpack_require__(80);
|
||
|
||
var _propsMixin2 = _interopRequireDefault(_propsMixin);
|
||
|
||
var _mixin = __webpack_require__(12);
|
||
|
||
var _mixin2 = _interopRequireDefault(_mixin);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Calendars',
|
||
components: {
|
||
Calendar: _calendar2.default,
|
||
WbButton: _button2.default
|
||
},
|
||
directives: {
|
||
clickoutside: _clickoutside2.default
|
||
},
|
||
mixins: [_propsMixin2.default, _mixin2.default],
|
||
props: {
|
||
value: {
|
||
type: [Date, Array, Number],
|
||
default: null
|
||
},
|
||
model: {
|
||
default: 'single',
|
||
validator: function validator(value) {
|
||
return ['single', 'multiple', 'range'].indexOf(value) !== -1;
|
||
}
|
||
},
|
||
showConfirm: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
showInline: {
|
||
type: Boolean,
|
||
default: true
|
||
},
|
||
// 兼容老的 API
|
||
inline: {
|
||
type: Boolean,
|
||
default: true
|
||
},
|
||
enableTime: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
enableSeconds: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
onlyMonth: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
format: {
|
||
type: String,
|
||
default: 'YYYY-MM-DD'
|
||
},
|
||
maxDate: {
|
||
type: Date,
|
||
default: null
|
||
},
|
||
minDate: {
|
||
type: Date,
|
||
default: null
|
||
},
|
||
maxRange: {
|
||
// 7D七天, 1M一个月, 2Y两年
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
disable: {
|
||
// 禁用的时间
|
||
type: Array,
|
||
default: function _default() {
|
||
return [];
|
||
}
|
||
},
|
||
enable: {
|
||
// 允许的时间
|
||
type: Array,
|
||
default: function _default() {
|
||
return [];
|
||
}
|
||
},
|
||
disabledDate: {
|
||
type: Function,
|
||
default: function _default() {
|
||
return false;
|
||
}
|
||
}
|
||
},
|
||
leftTime: null,
|
||
rightTime: null,
|
||
data: function data() {
|
||
return {
|
||
dates: null,
|
||
showArrow: false,
|
||
showTime: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
range: function range() {
|
||
return this.model === 'range';
|
||
},
|
||
showTimeBth: function showTimeBth() {
|
||
return this.vFormat.indexOf('H') !== -1;
|
||
},
|
||
confirm: function confirm() {
|
||
return this.showConfirm || this.vFormat.indexOf('H') !== -1 || this.model === 'multiple';
|
||
},
|
||
confirmDisabled: function confirmDisabled() {
|
||
if (!this.range) {
|
||
return !this.dates || this.dates.length === 0;
|
||
}
|
||
return !(this.dates[0] && this.dates[1]);
|
||
}
|
||
},
|
||
watch: {
|
||
value: function value() {
|
||
var dates = this.get();
|
||
if (!this.isEqual(this.value, dates)) {
|
||
this.valueToDate(this.value);
|
||
}
|
||
}
|
||
},
|
||
created: function created() {
|
||
this.valueToDate(this.value);
|
||
},
|
||
|
||
methods: {
|
||
get: function get() {
|
||
if (Array.isArray(this.dates)) {
|
||
return this.dates[0] ? this.dates.map(function (item) {
|
||
return item.getTime();
|
||
}) : null;
|
||
}
|
||
return this.dates ? this.dates.getTime() : null;
|
||
},
|
||
valueToDate: function valueToDate(val) {
|
||
if (this.model === 'single') {
|
||
this.dates = val ? new Date(val) : null;
|
||
} else if (!this.isEmpty(val)) {
|
||
this.dates = val.map(function (item) {
|
||
return new Date(item);
|
||
});
|
||
} else {
|
||
// 使用 [null, null] 的原因是:
|
||
// 1. 为了统一数据结构为数组,好操作(可能换用链表或Map结构好些)。
|
||
// 2. 用 null 填充数组是为了后续的 splice 操作,确保大的时间在右边
|
||
this.dates = this.model === 'range' ? [null, null] : [];
|
||
}
|
||
},
|
||
formatRangeStartTime: function formatRangeStartTime(time, format) {
|
||
var _this = this;
|
||
|
||
var is = function is(c) {
|
||
return (format || _this.vFormat).indexOf(c) !== -1;
|
||
};
|
||
var year = time.getFullYear();
|
||
var month = time.getMonth();
|
||
var day = time.getDate();
|
||
var hour = time.getHours();
|
||
var minute = time.getMinutes();
|
||
|
||
if (is('s')) {
|
||
return new Date(time);
|
||
}if (is('m') && (is('h') || is('H'))) {
|
||
return new Date(year, month, day, hour, minute, 0);
|
||
}if (is('D')) {
|
||
return new Date(year, month, day, 0, 0, 0);
|
||
}if (is('M')) {
|
||
return new Date(year, month, 1, 0, 0, 0);
|
||
}if (is('Y')) {
|
||
return new Date(year, 0, 1, 0, 0, 0);
|
||
}
|
||
return new Date(time);
|
||
},
|
||
formatRangeEndTime: function formatRangeEndTime(time, format) {
|
||
var _this2 = this;
|
||
|
||
var is = function is(c) {
|
||
return (format || _this2.vFormat).indexOf(c) !== -1;
|
||
};
|
||
|
||
var newTime = new Date(time);
|
||
if (is('s')) {
|
||
return newTime;
|
||
}if (is('m') && (is('h') || is('H'))) {
|
||
return new Date(newTime.getTime() + 59 * 1000);
|
||
}if (is('D')) {
|
||
return new Date(newTime.getTime() + 60 * 60 * 24 * 1000 - 1000);
|
||
}if (is('M')) {
|
||
newTime.setMonth(newTime.getMonth() + 1);
|
||
return new Date(newTime.getTime() - 1000);
|
||
}if (is('Y')) {
|
||
newTime.setFullYear(newTime.getFullYear() + 1);
|
||
return new Date(newTime.getTime() - 1000);
|
||
}
|
||
throw new Error('Error time format: ' + this.vFormat);
|
||
},
|
||
resetRangeDates: function resetRangeDates() {
|
||
if (this.rangeIsComplete()) {
|
||
this.dates = [null, null];
|
||
}
|
||
},
|
||
rangeIsComplete: function rangeIsComplete() {
|
||
return this.dates && this.dates[0] && this.dates[1];
|
||
},
|
||
leftRangeChange: function leftRangeChange(date, isTime, isOut) {
|
||
if (isOut) {
|
||
this.rightRangeChange(date, isTime);
|
||
return;
|
||
}
|
||
if (isTime) {
|
||
this.dates.splice(0, 1, date);
|
||
} else {
|
||
this.resetRangeDates();
|
||
var dates = this.dates;
|
||
if (this.isEmpty(dates) || !this.dates[0]) {
|
||
dates.splice(0, 1, date);
|
||
} else if (dates[0] > date) {
|
||
dates.splice(1, 1, this.formatRangeEndTime(dates[0]));
|
||
dates.splice(0, 1, date);
|
||
} else {
|
||
dates.splice(1, 1, this.formatRangeEndTime(date));
|
||
}
|
||
}
|
||
|
||
this.rangeChange(date, isTime);
|
||
},
|
||
rightRangeChange: function rightRangeChange(date, isTime, isOut) {
|
||
if (isOut) {
|
||
this.leftRangeChange(date, isTime);
|
||
return;
|
||
}
|
||
if (isTime) {
|
||
this.dates.splice(1, 1, this.formatRangeEndTime(date));
|
||
} else {
|
||
this.resetRangeDates();
|
||
var dates = this.dates;
|
||
if (this.isEmpty(dates) || !this.dates[1]) {
|
||
dates.splice(1, 1, this.formatRangeEndTime(date));
|
||
} else if (dates[1] > date) {
|
||
dates.splice(0, 1, date);
|
||
} else {
|
||
dates.splice(0, 1, this.formatRangeStartTime(dates[1]));
|
||
dates.splice(1, 1, this.formatRangeEndTime(date));
|
||
}
|
||
}
|
||
|
||
this.rangeChange(date, isTime);
|
||
},
|
||
rangeChange: function rangeChange(date, isTime) {
|
||
if (this.rangeIsComplete()) {
|
||
if (this.contrastDate(this.dates[0], this.dates[1], this.vFormat) === 1) {
|
||
if (isTime && this.isSameDay(this.dates[0], this.dates[1])) {
|
||
// 同年同月同日 只是时间不同
|
||
this.dates.splice(1, 1, this.formatRangeEndTime(this.dates[0]));
|
||
} else {
|
||
var _dates = (0, _slicedToArray3.default)(this.dates, 2),
|
||
start = _dates[0],
|
||
end = _dates[1];
|
||
|
||
this.dates = [this.formatRangeStartTime(end), this.formatRangeEndTime(start)];
|
||
}
|
||
}
|
||
this.noticeParent(date, isTime);
|
||
}
|
||
},
|
||
change: function change(date, isTime) {
|
||
var _this3 = this;
|
||
|
||
if (this.model === 'single') {
|
||
if (!this.dates || this.contrastDate(date, this.dates, this.vFormat) !== 0) {
|
||
this.dates = date;
|
||
this.noticeParent(date, isTime);
|
||
}
|
||
} else if (this.model === 'multiple') {
|
||
if (isTime) {
|
||
this.dates.pop();
|
||
this.dates.push(date);
|
||
} else {
|
||
var has = this.dates.findIndex(function (item) {
|
||
return _this3.contrastDate(item, date, _this3.vFormat) === 0;
|
||
});
|
||
// 删除
|
||
if (has !== -1) {
|
||
this.dates.splice(has, 1);
|
||
} else {
|
||
this.dates.push(date);
|
||
}
|
||
}
|
||
this.noticeParent(date, isTime);
|
||
}
|
||
},
|
||
noticeParent: function noticeParent(date, isTime) {
|
||
this.$emit('input', this.get());
|
||
this.$emit('on-change', this.get(), date);
|
||
if (!isTime && !this.confirm) {
|
||
this.finished();
|
||
}
|
||
},
|
||
beyondTimeScope: function beyondTimeScope(min, max, time, format) {
|
||
return this.contrastDate(time, min, format) === -1 || this.contrastDate(time, max, format) === 1;
|
||
},
|
||
isTagTime: function isTagTime(data, time, format) {
|
||
var len = data.length;
|
||
if (len > 0) {
|
||
for (var i = 0; i < len; i++) {
|
||
var item = data[i];
|
||
if (util.isDate(item)) {
|
||
return this.contrastDate(item, time, format) === 0;
|
||
}if (util.isFunction(item)) {
|
||
return item(time, format);
|
||
}if (util.isObject(item) && item.from && item.to && util.isDate(item.from) && util.isDate(item.to)) {
|
||
if (!this.beyondTimeScope(item.from, item.to, time, format)) {
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return false;
|
||
},
|
||
maxRangeDisabled: function maxRangeDisabled(time, format) {
|
||
if (this.model === 'range' && this.maxRange && this.dates) {
|
||
var _dates2 = (0, _slicedToArray3.default)(this.dates, 2),
|
||
start = _dates2[0],
|
||
end = _dates2[1];
|
||
|
||
if (start && end) return false;
|
||
var flagDate = start || end;
|
||
var arr = this.maxRange.match(/(\d*)([MDY])/);
|
||
if (flagDate && arr) {
|
||
var length = Number(arr[1]) - 1;
|
||
var type = arr[2];
|
||
flagDate = new Date(flagDate.getFullYear(), flagDate.getMonth(), flagDate.getDate());
|
||
var minDate = new Date(flagDate);
|
||
var maxDate = new Date(flagDate);
|
||
if (type === 'D') {
|
||
minDate.setDate(minDate.getDate() - length);
|
||
maxDate.setDate(maxDate.getDate() + length);
|
||
maxDate = this.formatRangeEndTime(maxDate, 'YYYY-MM-DD');
|
||
} else if (type === 'M') {
|
||
minDate.setMonth(minDate.getMonth() - length);
|
||
maxDate.setMonth(maxDate.getMonth() + length);
|
||
minDate = new Date(minDate.getFullYear(), minDate.getMonth());
|
||
maxDate = this.formatRangeEndTime(new Date(maxDate.getFullYear(), maxDate.getMonth()), 'YYYY-MM');
|
||
} else if (type === 'Y') {
|
||
minDate = new Date(minDate.getFullYear() - length, 0);
|
||
maxDate = this.formatRangeEndTime(new Date(maxDate.getFullYear() + length, 0), 'YYYY');
|
||
}
|
||
return this.beyondTimeScope(minDate, maxDate, time, format);
|
||
}
|
||
}
|
||
return false;
|
||
},
|
||
disabled: function disabled(time, format) {
|
||
var min = this.minDate && this.contrastDate(time, this.minDate, format) === -1;
|
||
var max = this.maxDate && this.contrastDate(time, this.maxDate, format) === 1;
|
||
var enable = false;
|
||
if (this.enable.length > 0) {
|
||
enable = !this.isTagTime(this.enable, time, format);
|
||
}
|
||
|
||
return min || max || this.isTagTime(this.disable, time, format) || enable || this.maxRangeDisabled(time, format) || this.disabledDate(time, format);
|
||
},
|
||
finished: function finished() {
|
||
this.showTime = false;
|
||
this.$emit('on-finish');
|
||
},
|
||
is: function is(c) {
|
||
return this.vFormat.indexOf(c) !== -1;
|
||
},
|
||
currentChange: function currentChange() {
|
||
var _$options = this.$options,
|
||
leftTime = _$options.leftTime,
|
||
rightTime = _$options.rightTime;
|
||
|
||
if (leftTime && rightTime) {
|
||
if (this.is('D')) {
|
||
var monthDiff = Math.abs(rightTime.month - leftTime.month);
|
||
if (rightTime.year === leftTime.year && (monthDiff === 1 || monthDiff === 11) || rightTime.year - leftTime.year === 1 && monthDiff === 11) {
|
||
this.showArrow = false;
|
||
} else {
|
||
this.showArrow = true;
|
||
}
|
||
} else if (this.is('M')) {
|
||
if (Math.abs(rightTime.year - leftTime.year) <= 1) {
|
||
this.showArrow = false;
|
||
} else {
|
||
this.showArrow = true;
|
||
}
|
||
} else if (Math.abs((rightTime.year / 10 | 0) - (leftTime.year / 10 | 0)) <= 1) {
|
||
this.showArrow = false;
|
||
} else {
|
||
this.showArrow = true;
|
||
}
|
||
}
|
||
},
|
||
leftCurrentChange: function leftCurrentChange(leftTime) {
|
||
this.$options.leftTime = leftTime;
|
||
this.currentChange();
|
||
},
|
||
rightCurrentChange: function rightCurrentChange(rightTime) {
|
||
this.$options.rightTime = rightTime;
|
||
this.currentChange();
|
||
},
|
||
onSelectTime: function onSelectTime() {
|
||
if (this.confirmDisabled) return;
|
||
this.showTime = !this.showTime;
|
||
},
|
||
|
||
// 当用户只选择一个日期,就关闭弹窗的时候,默认将时间补充为一个范围
|
||
formatRange: function formatRange() {
|
||
if (this.range) {
|
||
if (this.dates[1] && !this.dates[0]) {
|
||
var startTime = this.formatRangeStartTime(this.dates[1]);
|
||
this.dates.splice(0, 1, startTime);
|
||
this.noticeParent(startTime, false);
|
||
} else if (this.dates[0] && !this.dates[1]) {
|
||
var changeDate = this.formatRangeEndTime(this.dates[0]);
|
||
this.dates.splice(1, 1, changeDate);
|
||
this.noticeParent(changeDate, false);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 288 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = { "default": __webpack_require__(289), __esModule: true };
|
||
|
||
/***/ }),
|
||
/* 289 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(59);
|
||
__webpack_require__(57);
|
||
module.exports = __webpack_require__(290);
|
||
|
||
|
||
/***/ }),
|
||
/* 290 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var classof = __webpack_require__(79);
|
||
var ITERATOR = __webpack_require__(8)('iterator');
|
||
var Iterators = __webpack_require__(32);
|
||
module.exports = __webpack_require__(6).isIterable = function (it) {
|
||
var O = Object(it);
|
||
return O[ITERATOR] !== undefined
|
||
|| '@@iterator' in O
|
||
// eslint-disable-next-line no-prototype-builtins
|
||
|| Iterators.hasOwnProperty(classof(O));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 291 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(59);
|
||
__webpack_require__(57);
|
||
module.exports = __webpack_require__(292);
|
||
|
||
|
||
/***/ }),
|
||
/* 292 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var anObject = __webpack_require__(17);
|
||
var get = __webpack_require__(117);
|
||
module.exports = __webpack_require__(6).getIterator = function (it) {
|
||
var iterFn = get(it);
|
||
if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
|
||
return anObject(iterFn.call(it));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 293 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(294),
|
||
/* template */
|
||
__webpack_require__(304),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/date-picker/calendar.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] calendar.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-08ae112e", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-08ae112e", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 294 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _slicedToArray2 = __webpack_require__(78);
|
||
|
||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
|
||
|
||
var _parseInt = __webpack_require__(118);
|
||
|
||
var _parseInt2 = _interopRequireDefault(_parseInt);
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
var _pickerContent = __webpack_require__(120);
|
||
|
||
var _pickerContent2 = _interopRequireDefault(_pickerContent);
|
||
|
||
var _propsMixin = __webpack_require__(80);
|
||
|
||
var _propsMixin2 = _interopRequireDefault(_propsMixin);
|
||
|
||
var _mixin = __webpack_require__(12);
|
||
|
||
var _mixin2 = _interopRequireDefault(_mixin);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
var YEAR_NUM = 1;
|
||
var MONTH_NUM = 2;
|
||
var DAY_NUM = 4;
|
||
var HOUR_NUM = 8;
|
||
var MINUTE_NUM = 16;
|
||
var SECOND_NUM = 32;
|
||
var YEAR_MONTH = YEAR_NUM + MONTH_NUM;
|
||
var YEAR_MONTH_DAY = YEAR_MONTH + DAY_NUM;
|
||
var YEAR_MONTH_DAY_HOUR = YEAR_MONTH_DAY + HOUR_NUM;
|
||
var YEAR_MONTH_DAY_HOUR_MINUTE = YEAR_MONTH_DAY_HOUR + MINUTE_NUM;
|
||
var YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = YEAR_MONTH_DAY_HOUR_MINUTE + SECOND_NUM;
|
||
|
||
var _WEEKS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
|
||
|
||
exports.default = {
|
||
name: 'Calendar',
|
||
components: {
|
||
Icon: _icon2.default,
|
||
TimeSelect: _pickerContent2.default
|
||
},
|
||
mixins: [_propsMixin2.default, _mixin2.default],
|
||
props: {
|
||
value: {
|
||
type: [Date, Array],
|
||
default: function _default() {
|
||
return new Date();
|
||
}
|
||
},
|
||
model: {
|
||
default: 'single',
|
||
validator: function validator(value) {
|
||
return ['single', 'range', 'multiple'].indexOf(value) !== -1;
|
||
}
|
||
},
|
||
format: {
|
||
type: String,
|
||
default: 'YYYY-MM-DD'
|
||
},
|
||
position: {
|
||
default: undefined,
|
||
validator: function validator(value) {
|
||
return ['left', 'right'].includes(value);
|
||
}
|
||
},
|
||
disabledDate: {
|
||
type: Function,
|
||
default: function _default() {
|
||
return false;
|
||
}
|
||
},
|
||
showLeftArrow: {
|
||
type: Boolean,
|
||
default: true
|
||
},
|
||
showRightArrow: {
|
||
type: Boolean,
|
||
default: true
|
||
},
|
||
showTime: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
months: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'],
|
||
pattern: 0,
|
||
showYears: false,
|
||
showMonths: false,
|
||
showHours: false,
|
||
showMinutes: false,
|
||
showSeconds: false,
|
||
times: '',
|
||
current: {}
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
weekFirstDay: function weekFirstDay() {
|
||
return (0, _parseInt2.default)(this.t('el.datepicker.weekFirstDay'));
|
||
},
|
||
WEEKS: function WEEKS() {
|
||
var week = this.weekFirstDay;
|
||
return _WEEKS.concat(_WEEKS).slice(week, week + 7);
|
||
},
|
||
yearStart: function yearStart() {
|
||
return parseInt(this.current.year / 10) * 10;
|
||
},
|
||
yearEnd: function yearEnd() {
|
||
return this.yearStart + 9;
|
||
},
|
||
years: function years() {
|
||
var arr = [];
|
||
var start = this.yearStart;
|
||
while (arr.length < 10) {
|
||
arr.push(start++);
|
||
}
|
||
return arr;
|
||
},
|
||
days: function days() {
|
||
var days = [];
|
||
var _current = this.current,
|
||
year = _current.year,
|
||
month = _current.month;
|
||
|
||
var time = new Date(year, month, 1);
|
||
var weekFirstDay = this.weekFirstDay;
|
||
time.setDate(0); // switch to the last day of last month
|
||
var lastDay = time.getDate();
|
||
var week = time.getDay() || 7;
|
||
var count = weekFirstDay <= week ? week - weekFirstDay + 1 : week + (7 - weekFirstDay + 1);
|
||
while (count > 0) {
|
||
days.push({
|
||
day: lastDay - count + 1,
|
||
year: month > 0 ? year : year - 1,
|
||
month: month > 0 ? month - 1 : 11,
|
||
pre: true
|
||
});
|
||
count--;
|
||
}
|
||
time.setMonth(time.getMonth() + 2, 0); // switch to the last day of the current month
|
||
lastDay = time.getDate();
|
||
var i = 1;
|
||
for (i = 1; i <= lastDay; i++) {
|
||
days.push({
|
||
day: i,
|
||
year: year,
|
||
month: month
|
||
});
|
||
}
|
||
for (i = 1; days.length < 42; i++) {
|
||
days.push({
|
||
day: i,
|
||
year: month < 11 ? year : year + 1,
|
||
month: month < 11 ? month + 1 : 0,
|
||
next: true
|
||
});
|
||
}
|
||
return days;
|
||
},
|
||
hasMonth: function hasMonth() {
|
||
return this.pattern >= YEAR_MONTH;
|
||
},
|
||
hasDay: function hasDay() {
|
||
return this.pattern >= YEAR_MONTH_DAY;
|
||
},
|
||
hasHour: function hasHour() {
|
||
return this.pattern >= YEAR_MONTH_DAY_HOUR;
|
||
},
|
||
hasMinute: function hasMinute() {
|
||
return this.pattern >= YEAR_MONTH_DAY_HOUR_MINUTE;
|
||
},
|
||
hasSecond: function hasSecond() {
|
||
return this.pattern >= YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||
},
|
||
tFormat: function tFormat() {
|
||
var tf = [];
|
||
if (this.hasHour) {
|
||
tf.push('HH');
|
||
}
|
||
if (this.hasMinute) {
|
||
tf.push('mm');
|
||
}
|
||
if (this.hasSecond) {
|
||
tf.push('ss');
|
||
}
|
||
return tf.join(':');
|
||
},
|
||
vShowTime: function vShowTime() {
|
||
return this.showTime && this.pattern >= YEAR_MONTH_DAY_HOUR;
|
||
},
|
||
getSeletedTime: function getSeletedTime() {
|
||
var dates = this.value;
|
||
if (this.model === 'single') return [dates];
|
||
return dates.filter(function (date) {
|
||
return date;
|
||
});
|
||
},
|
||
timeTitle: function timeTitle() {
|
||
var timeTitleFormat = this.t('el.datepicker.timeTitle');
|
||
if (this.model === 'single') {
|
||
return this.timeFormat(this.value, timeTitleFormat);
|
||
}
|
||
if (this.model === 'multiple') {
|
||
return this.timeFormat(this.value[this.value.length - 1], timeTitleFormat);
|
||
}
|
||
if (this.position === 'left') {
|
||
return this.timeFormat(this.value[0], timeTitleFormat);
|
||
}
|
||
return this.timeFormat(this.value[1], timeTitleFormat);
|
||
}
|
||
},
|
||
watch: {
|
||
value: function value(val) {
|
||
this.initTime(val);
|
||
},
|
||
|
||
current: {
|
||
handler: function handler() {
|
||
this.$emit('onCurrentChange', this.current);
|
||
},
|
||
|
||
deep: true
|
||
}
|
||
},
|
||
created: function created() {
|
||
var _this = this;
|
||
|
||
var is = function is(c) {
|
||
return _this.format.indexOf(c) !== -1;
|
||
};
|
||
if (is('Y')) {
|
||
this.pattern += YEAR_NUM;
|
||
}
|
||
if (is('M')) {
|
||
this.pattern += MONTH_NUM;
|
||
}
|
||
if (is('D')) {
|
||
this.pattern += DAY_NUM;
|
||
}
|
||
if (is('H')) {
|
||
this.pattern += HOUR_NUM;
|
||
}
|
||
if (is('m')) {
|
||
this.pattern += MINUTE_NUM;
|
||
}
|
||
if (is('s')) {
|
||
this.pattern += SECOND_NUM;
|
||
}
|
||
|
||
if (this.pattern === YEAR_NUM) {
|
||
this.showYears = true;
|
||
} else if (this.pattern === YEAR_MONTH) {
|
||
this.showMonths = true;
|
||
}
|
||
this.initTime(this.value);
|
||
},
|
||
|
||
methods: {
|
||
parseDate: function parseDate(date) {
|
||
var vDate = new Date(date);
|
||
return {
|
||
year: vDate.getFullYear(),
|
||
month: vDate.getMonth(),
|
||
day: vDate.getDate(),
|
||
hour: vDate.getHours(),
|
||
minute: vDate.getMinutes(),
|
||
second: vDate.getSeconds(),
|
||
raw: vDate
|
||
};
|
||
},
|
||
defaultDate: function defaultDate() {
|
||
var date = new Date();
|
||
if (this.model === 'range' && this.position === 'right') {
|
||
if (this.hasDay) {
|
||
date.setMonth(date.getMonth() + 1);
|
||
} else if (this.pattern === YEAR_MONTH) {
|
||
date.setFullYear(date.getFullYear() + 1);
|
||
} else if (this.pattern === YEAR_NUM) {
|
||
date.setFullYear(date.getFullYear() + 10);
|
||
}
|
||
}
|
||
|
||
return date;
|
||
},
|
||
initTime: function initTime(value) {
|
||
this.times = this.getTime(value);
|
||
// 如果为 range 并且在一个 calendar, current 不能跟着变动
|
||
this.current = this.getCurrentDate(value);
|
||
},
|
||
padStartZero: function padStartZero(target) {
|
||
var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
||
|
||
return ('' + target).padStart(len, '0');
|
||
},
|
||
getTime: function getTime(date) {
|
||
var _get = this.get(date, true),
|
||
hour = _get.hour,
|
||
minute = _get.minute,
|
||
second = _get.second;
|
||
|
||
var tf = [];
|
||
if (this.hasHour) {
|
||
tf.push(this.padStartZero(hour));
|
||
}
|
||
if (this.hasMinute) {
|
||
tf.push(this.padStartZero(minute));
|
||
}
|
||
if (this.hasSecond) {
|
||
tf.push(this.padStartZero(second));
|
||
}
|
||
return tf.join(':');
|
||
},
|
||
getRangeDate: function getRangeDate(date, activeDate) {
|
||
if (this.inOnePanel(date, this.format)) {
|
||
if (date[0].getFullYear() === activeDate.getFullYear()) {
|
||
if (this.position === 'left' && date[0].getMonth() <= activeDate.getMonth() || this.position === 'right' && date[0].getMonth() >= activeDate.getMonth()) {
|
||
return date[0];
|
||
}
|
||
}
|
||
return activeDate;
|
||
}
|
||
if (this.position === 'left') {
|
||
return date[0] || activeDate;
|
||
}
|
||
return date[1] || activeDate;
|
||
},
|
||
getCurrentDate: function getCurrentDate(date) {
|
||
var _get2 = this.get(date),
|
||
year = _get2.year,
|
||
month = _get2.month,
|
||
day = _get2.day;
|
||
|
||
return { year: year, month: month, day: day };
|
||
},
|
||
get: function get(date, isTime) {
|
||
var activeDate = this.defaultDate();
|
||
if (!this.isEmpty(date)) {
|
||
var model = this.model;
|
||
if (model === 'multiple') {
|
||
activeDate = date[date.length - 1];
|
||
} else if (model === 'range') {
|
||
if (!isTime) {
|
||
activeDate = this.getRangeDate(date, activeDate);
|
||
} else {
|
||
activeDate = (this.position === 'left' ? date[0] : date[1]) || activeDate;
|
||
}
|
||
} else if (model === 'single') {
|
||
activeDate = date;
|
||
}
|
||
}
|
||
|
||
return this.parseDate(activeDate);
|
||
},
|
||
isSelected: function isSelected(time, format) {
|
||
var _this2 = this;
|
||
|
||
if (this.isEmpty(this.value)) return false;
|
||
|
||
var selectedTimes = this.getSeletedTime;
|
||
return selectedTimes.some(function (item) {
|
||
var flag = _this2.timeFormat(item, format) === _this2.timeFormat(time, format);
|
||
if (_this2.model === 'range') {
|
||
if (_this2.pattern >= YEAR_MONTH_DAY) {
|
||
return flag && _this2.current.month === time.getMonth();
|
||
}
|
||
if (_this2.pattern === YEAR_NUM) {
|
||
return flag && (_this2.current.year / 10 | 0) === (time.getFullYear() / 10 | 0);
|
||
}
|
||
}
|
||
return flag;
|
||
});
|
||
},
|
||
isSelectedYear: function isSelectedYear(time, format) {
|
||
if (this.pattern !== YEAR_NUM) {
|
||
return time.getFullYear() === this.current.year;
|
||
}
|
||
return this.isSelected(time, format);
|
||
},
|
||
isSelectedMonth: function isSelectedMonth(time, format) {
|
||
if (this.pattern !== YEAR_MONTH) {
|
||
return time.getMonth() === this.current.month;
|
||
}
|
||
return this.isSelected(time, format);
|
||
},
|
||
inRangeDate: function inRangeDate(time, format) {
|
||
if (this.model === 'range' && !this.isEmpty(this.value)) {
|
||
var _value = (0, _slicedToArray3.default)(this.value, 2),
|
||
start = _value[0],
|
||
end = _value[1];
|
||
|
||
var isIn = start && end && this.contrastDate(time, start, format) === 1 && this.contrastDate(time, end, format) === -1;
|
||
if (this.pattern >= YEAR_MONTH_DAY) {
|
||
return isIn && time.getMonth() === this.current.month;
|
||
}
|
||
return isIn;
|
||
}
|
||
return false;
|
||
},
|
||
yearCls: function yearCls(year) {
|
||
var time = new Date(year, 0);
|
||
var format = 'YYYY';
|
||
var cls = {
|
||
'ui-calendar-date': true,
|
||
'ui-calendar-date-disabled': this.disabledDate(time, format),
|
||
'ui-calendar-date-selected': this.isSelectedYear(time, format)
|
||
};
|
||
if (this.pattern === YEAR_NUM) {
|
||
cls['ui-calendar-date-on'] = this.inRangeDate(time, format);
|
||
}
|
||
return cls;
|
||
},
|
||
monthCls: function monthCls(month) {
|
||
var format = 'YYYY-MM';
|
||
var year = this.current.year;
|
||
var time = new Date(year, month);
|
||
var cls = {
|
||
'ui-calendar-date': true,
|
||
'ui-calendar-date-disabled': this.disabledDate(time, format),
|
||
'ui-calendar-date-selected': this.isSelectedMonth(time, format)
|
||
};
|
||
if (this.pattern === YEAR_MONTH) {
|
||
cls['ui-calendar-date-on'] = this.inRangeDate(time, format);
|
||
}
|
||
return cls;
|
||
},
|
||
dayCls: function dayCls(item) {
|
||
var format = 'YYYY-MM-DD';
|
||
var year = item.year,
|
||
month = item.month;
|
||
|
||
var maxDay = new Date(year, month + 1, 0).getDate();
|
||
var day = item.day > maxDay ? maxDay : item.day;
|
||
var time = new Date(year, month, day);
|
||
return {
|
||
'ui-calendar-date-out': item.pre || item.next,
|
||
'ui-calendar-date': true,
|
||
'ui-calendar-date-disabled': this.disabledDate(time, format),
|
||
'ui-calendar-date-on': this.inRangeDate(time, format),
|
||
'ui-calendar-date-selected': this.isSelected(time, format),
|
||
'ui-calendar-date-today': this.timeFormat(time, format) === this.timeFormat(new Date(), format)
|
||
};
|
||
},
|
||
getTimesDate: function getTimesDate() {
|
||
if (this.model === 'range' && this.inOnePanel(this.value, 'YYYY-MM-DD')) {
|
||
if (this.position === 'left') {
|
||
return this.parseDate(this.value[0]);
|
||
}
|
||
return this.parseDate(this.value[1]);
|
||
}
|
||
return this.current;
|
||
},
|
||
disabledHours: function disabledHours() {
|
||
var _getTimesDate = this.getTimesDate(),
|
||
year = _getTimesDate.year,
|
||
month = _getTimesDate.month,
|
||
day = _getTimesDate.day;
|
||
|
||
var format = 'YYYY-MM-DD HH';
|
||
var disableds = [];
|
||
var time = new Date(year, month, day, 0);
|
||
var dayEqual = this.position === 'right' && this.isSameDay(this.value[0], time);
|
||
var leftRangeHour = this.position === 'right' ? this.value[0].getHours() : 0;
|
||
for (var i = 0; i < 24; i++) {
|
||
time.setHours(i);
|
||
if (this.disabledDate(time, format) || dayEqual && leftRangeHour > i) {
|
||
disableds.push(i);
|
||
}
|
||
}
|
||
return disableds;
|
||
},
|
||
disabledMinutes: function disabledMinutes() {
|
||
var _getTimesDate2 = this.getTimesDate(),
|
||
year = _getTimesDate2.year,
|
||
month = _getTimesDate2.month,
|
||
day = _getTimesDate2.day;
|
||
|
||
var format = 'YYYY-MM-DD HH:mm';
|
||
var disableds = [];
|
||
var hour = this.times ? (0, _parseInt2.default)(this.times.split(':')[0]) : 0;
|
||
var time = new Date(year, month, day, hour);
|
||
var dayEqual = this.position === 'right' && this.isSameDay(this.value[0], time);
|
||
for (var i = 0; i < 60; i++) {
|
||
time.setMinutes(i);
|
||
if (this.disabledDate(time, format) || dayEqual && this.contrastDate(this.value[0], time, format) === 1) {
|
||
disableds.push(i);
|
||
}
|
||
}
|
||
return disableds;
|
||
},
|
||
disabledSeconds: function disabledSeconds() {
|
||
var _getTimesDate3 = this.getTimesDate(),
|
||
year = _getTimesDate3.year,
|
||
month = _getTimesDate3.month,
|
||
day = _getTimesDate3.day;
|
||
|
||
var format = 'YYYY-MM-DD HH:mm:ss';
|
||
var disableds = [];
|
||
|
||
var _ref = this.times ? this.times.split(':').map(function (item) {
|
||
return parseInt(item);
|
||
}) : [0, 0],
|
||
_ref2 = (0, _slicedToArray3.default)(_ref, 2),
|
||
hour = _ref2[0],
|
||
minute = _ref2[1];
|
||
|
||
var time = new Date(year, month, day, hour, minute);
|
||
var dayEqual = this.position === 'right' && this.isSameDay(this.value[0], time);
|
||
for (var i = 0; i < 60; i++) {
|
||
time.setSeconds(i);
|
||
if (this.disabledDate(time, format) || dayEqual && this.contrastDate(this.value[0], time, format) === 1) {
|
||
disableds.push(i);
|
||
}
|
||
}
|
||
return disableds;
|
||
},
|
||
monthToNext: function monthToNext() {
|
||
if (this.current.month < 11) {
|
||
this.current.month++;
|
||
} else {
|
||
this.current.month = 0;
|
||
this.current.year++;
|
||
}
|
||
},
|
||
monthToPre: function monthToPre() {
|
||
if (this.current.month > 0) {
|
||
this.current.month--;
|
||
} else {
|
||
this.current.month = 11;
|
||
this.current.year--;
|
||
}
|
||
},
|
||
is: function is(e) {
|
||
return e.target.className.indexOf('ui-calendar-date-disabled') === -1;
|
||
},
|
||
selectedYear: function selectedYear(year) {
|
||
var pattern = this.pattern;
|
||
this.showYears = pattern === YEAR_NUM;
|
||
|
||
if (pattern === YEAR_NUM) {
|
||
var isOut = false;
|
||
if (this.model === 'range') {
|
||
if (!this.showLeftArrow && (year / 10 | 0) < (this.current.year / 10 | 0) || !this.showRightArrow && (year / 10 | 0) > (this.current.year / 10 | 0)) {
|
||
isOut = true;
|
||
}
|
||
}
|
||
if (!isOut) {
|
||
this.current.year = year;
|
||
}
|
||
var date = new Date(year, 0);
|
||
this.onChange(date, false, isOut);
|
||
} else {
|
||
this.current.year = year;
|
||
}
|
||
},
|
||
selectedMonth: function selectedMonth(month) {
|
||
var pattern = this.pattern;
|
||
this.current.month = month;
|
||
this.showMonths = pattern === YEAR_MONTH;
|
||
if (pattern === YEAR_MONTH) {
|
||
var date = new Date(this.current.year, month);
|
||
this.onChange(date);
|
||
}
|
||
},
|
||
timesToNum: function timesToNum() {
|
||
var timesArr = this.times.split(':');
|
||
var hour = 0;
|
||
var minute = 0;
|
||
var second = 0;
|
||
if (this.hasHour) {
|
||
hour = (0, _parseInt2.default)(timesArr.shift());
|
||
}
|
||
if (this.hasMinute) {
|
||
minute = (0, _parseInt2.default)(timesArr.shift());
|
||
}
|
||
if (this.hasSecond) {
|
||
second = (0, _parseInt2.default)(timesArr.shift());
|
||
}
|
||
return { hour: hour, minute: minute, second: second };
|
||
},
|
||
selectedDay: function selectedDay(info) {
|
||
var isOut = false;
|
||
if (this.model === 'range') {
|
||
if (!this.showLeftArrow && info.pre || !this.showRightArrow && info.next) {
|
||
isOut = true;
|
||
}
|
||
}
|
||
|
||
if (!isOut) {
|
||
info.next && this.monthToNext();
|
||
info.pre && this.monthToPre();
|
||
this.current.day = info.day;
|
||
}
|
||
|
||
var year = info.year,
|
||
month = info.month,
|
||
day = info.day;
|
||
|
||
var _timesToNum = this.timesToNum(),
|
||
hour = _timesToNum.hour,
|
||
minute = _timesToNum.minute,
|
||
second = _timesToNum.second;
|
||
|
||
var date = new Date(year, month, day, hour, minute, second);
|
||
this.onChange(date, false, isOut);
|
||
},
|
||
changeTimes: function changeTimes() {
|
||
var date = void 0;
|
||
if (this.model === 'single') {
|
||
date = this.parseDate(this.value);
|
||
} else if (this.model === 'range') {
|
||
if (this.position === 'left') {
|
||
date = this.parseDate(this.value[0]);
|
||
} else {
|
||
date = this.parseDate(this.value[1]);
|
||
}
|
||
} else {
|
||
date = this.parseDate(this.value[this.value.length - 1]);
|
||
}
|
||
|
||
var _timesToNum2 = this.timesToNum(),
|
||
hour = _timesToNum2.hour,
|
||
minute = _timesToNum2.minute,
|
||
second = _timesToNum2.second;
|
||
|
||
this.onChange(new Date(date.year, date.month, date.day, hour, minute, second), true);
|
||
},
|
||
onChange: function onChange(date, isTime, isOut) {
|
||
this.$emit('on-change', date, isTime, isOut);
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 295 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(296);
|
||
module.exports = __webpack_require__(6).Number.parseInt;
|
||
|
||
|
||
/***/ }),
|
||
/* 296 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var $export = __webpack_require__(14);
|
||
var $parseInt = __webpack_require__(297);
|
||
// 20.1.2.13 Number.parseInt(string, radix)
|
||
$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });
|
||
|
||
|
||
/***/ }),
|
||
/* 297 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var $parseInt = __webpack_require__(7).parseInt;
|
||
var $trim = __webpack_require__(298).trim;
|
||
var ws = __webpack_require__(119);
|
||
var hex = /^[-+]?0[xX]/;
|
||
|
||
module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
|
||
var string = $trim(String(str), 3);
|
||
return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
|
||
} : $parseInt;
|
||
|
||
|
||
/***/ }),
|
||
/* 298 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var $export = __webpack_require__(14);
|
||
var defined = __webpack_require__(53);
|
||
var fails = __webpack_require__(26);
|
||
var spaces = __webpack_require__(119);
|
||
var space = '[' + spaces + ']';
|
||
var non = '\u200b\u0085';
|
||
var ltrim = RegExp('^' + space + space + '*');
|
||
var rtrim = RegExp(space + space + '*$');
|
||
|
||
var exporter = function (KEY, exec, ALIAS) {
|
||
var exp = {};
|
||
var FORCE = fails(function () {
|
||
return !!spaces[KEY]() || non[KEY]() != non;
|
||
});
|
||
var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
|
||
if (ALIAS) exp[ALIAS] = fn;
|
||
$export($export.P + $export.F * FORCE, 'String', exp);
|
||
};
|
||
|
||
// 1 -> String#trimLeft
|
||
// 2 -> String#trimRight
|
||
// 3 -> String#trim
|
||
var trim = exporter.trim = function (string, TYPE) {
|
||
string = String(defined(string));
|
||
if (TYPE & 1) string = string.replace(ltrim, '');
|
||
if (TYPE & 2) string = string.replace(rtrim, '');
|
||
return string;
|
||
};
|
||
|
||
module.exports = exporter;
|
||
|
||
|
||
/***/ }),
|
||
/* 299 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _keyCode = __webpack_require__(19);
|
||
|
||
var _keyCode2 = _interopRequireDefault(_keyCode);
|
||
|
||
var _PickerItem = __webpack_require__(300);
|
||
|
||
var _PickerItem2 = _interopRequireDefault(_PickerItem);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
components: {
|
||
PickerItem: _PickerItem2.default
|
||
},
|
||
props: {
|
||
value: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
format: {
|
||
type: String,
|
||
default: 'HH:mm:ss'
|
||
},
|
||
hourStep: {
|
||
type: Number,
|
||
default: 1
|
||
},
|
||
minuteStep: {
|
||
type: Number,
|
||
default: 1
|
||
},
|
||
secondStep: {
|
||
type: Number,
|
||
default: 1
|
||
},
|
||
disabledHours: {
|
||
type: Function,
|
||
default: undefined
|
||
},
|
||
disabledMinutes: {
|
||
type: Function,
|
||
default: undefined
|
||
},
|
||
disabledSeconds: {
|
||
type: Function,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
var _parseTime = this.parseTime(),
|
||
_parseTime$hour = _parseTime.hour,
|
||
hour = _parseTime$hour === undefined ? '' : _parseTime$hour,
|
||
_parseTime$minute = _parseTime.minute,
|
||
minute = _parseTime$minute === undefined ? '' : _parseTime$minute,
|
||
_parseTime$seconds = _parseTime.seconds,
|
||
seconds = _parseTime$seconds === undefined ? '' : _parseTime$seconds;
|
||
|
||
return {
|
||
show: false,
|
||
hasFocus: false,
|
||
selectedHour: hour,
|
||
selectedMinute: minute,
|
||
selectedSeconds: seconds,
|
||
focus: {
|
||
1: -1,
|
||
2: -1,
|
||
4: -1
|
||
},
|
||
historyFocus: {
|
||
1: -1,
|
||
2: -1,
|
||
4: -1
|
||
},
|
||
focusType: '' // 当前获取焦点的时间类型
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
bit: function bit() {
|
||
var num = 0;
|
||
if (/H/.test(this.format)) {
|
||
num += 1;
|
||
}
|
||
if (/m/.test(this.format)) {
|
||
num += 2;
|
||
}
|
||
if (/s/.test(this.format)) {
|
||
num += 4;
|
||
}
|
||
return num;
|
||
},
|
||
tabindex: function tabindex() {
|
||
if (this.disabled || this.readonly) {
|
||
return -1;
|
||
}
|
||
return 0;
|
||
},
|
||
hours: function hours() {
|
||
var disabledHours = this.disabledHours ? this.disabledHours() : [];
|
||
if (this.format.indexOf('H') !== -1) {
|
||
return this.formatTime(24, this.hourStep, disabledHours, /HH/.test(this.format));
|
||
}
|
||
return null;
|
||
},
|
||
minutes: function minutes() {
|
||
var disabledMinutes = this.disabledMinutes ? this.disabledMinutes(this.selectedHour) : [];
|
||
if (this.format.indexOf('m') !== -1) {
|
||
return this.formatTime(60, this.minuteStep, disabledMinutes, /mm/.test(this.format));
|
||
}
|
||
return null;
|
||
},
|
||
seconds: function seconds() {
|
||
var disabledSeconds = this.disabledSeconds ? this.disabledSeconds(this.selectedHour, this.selectedMinute) : [];
|
||
if (this.format.indexOf('s') !== -1) {
|
||
return this.formatTime(60, this.secondStep, disabledSeconds, /ss/.test(this.format));
|
||
}
|
||
return null;
|
||
},
|
||
times: function times() {
|
||
var times = '';
|
||
var selectedHour = this.selectedHour,
|
||
selectedMinute = this.selectedMinute,
|
||
selectedSeconds = this.selectedSeconds;
|
||
|
||
if (!(selectedHour || selectedMinute || selectedSeconds)) {
|
||
return times;
|
||
}
|
||
if (/H/.test(this.format)) {
|
||
times += selectedHour;
|
||
}
|
||
if (/m/.test(this.format)) {
|
||
times += times.length > 0 ? ':' + selectedMinute : selectedMinute;
|
||
}
|
||
if (/s/.test(this.format)) {
|
||
times += times.length > 0 ? ':' + selectedSeconds : selectedSeconds;
|
||
}
|
||
return times;
|
||
}
|
||
},
|
||
watch: {
|
||
value: function value() {
|
||
if (this.times !== this.value) {
|
||
var _parseTime2 = this.parseTime(),
|
||
hour = _parseTime2.hour,
|
||
minute = _parseTime2.minute,
|
||
seconds = _parseTime2.seconds;
|
||
|
||
this.selectedHour = hour;
|
||
this.selectedMinute = minute;
|
||
this.selectedSeconds = seconds;
|
||
}
|
||
},
|
||
times: function times() {
|
||
this.$emit('input', this.times);
|
||
this.$emit('change', this.times);
|
||
}
|
||
},
|
||
methods: {
|
||
parseTime: function parseTime() {
|
||
if (!this.value) return {};
|
||
var splitTime = this.value.split(':');
|
||
var hour = void 0;
|
||
var minute = void 0;
|
||
var seconds = void 0;
|
||
if (/H/.test(this.format)) {
|
||
hour = splitTime.shift() || this.formatSingleTime('HH');
|
||
}
|
||
if (/m/.test(this.format)) {
|
||
minute = splitTime.shift() || this.formatSingleTime('mm');
|
||
}
|
||
if (/s/.test(this.format)) {
|
||
seconds = splitTime.shift() || this.formatSingleTime('ss');
|
||
}
|
||
return {
|
||
hour: hour,
|
||
minute: minute,
|
||
seconds: seconds
|
||
};
|
||
},
|
||
formatTime: function formatTime(total, step) {
|
||
var disableds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
||
var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
||
|
||
var formatData = [];
|
||
for (var i = 0; i < total; i += step) {
|
||
var value = void 0;
|
||
if (format) {
|
||
value = ('' + i).padStart(2, '0');
|
||
} else {
|
||
value = '' + i;
|
||
}
|
||
formatData.push({
|
||
disabled: disableds.includes(i),
|
||
value: value
|
||
});
|
||
}
|
||
return formatData;
|
||
},
|
||
formatSingleTime: function formatSingleTime(timeFormat) {
|
||
return this.format.indexOf(timeFormat) !== -1 ? '00' : '0';
|
||
},
|
||
changeSelectedHour: function changeSelectedHour(option) {
|
||
this.selectedHour = option.value;
|
||
if (/m/.test(this.format) && !this.selectedMinute) {
|
||
this.selectedMinute = this.formatSingleTime('mm');
|
||
}
|
||
if (/s/.test(this.format) && !this.selectedSeconds) {
|
||
this.selectedSeconds = this.formatSingleTime('ss');
|
||
}
|
||
},
|
||
changeSelectedMinute: function changeSelectedMinute(option) {
|
||
this.selectedMinute = option.value;
|
||
if (/H/.test(this.format) && !this.selectedHour) {
|
||
this.selectedHour = this.formatSingleTime('HH');
|
||
}
|
||
if (/s/.test(this.format) && !this.selectedSeconds) {
|
||
this.selectedSeconds = this.formatSingleTime('ss');
|
||
}
|
||
},
|
||
changeSelectedSeconds: function changeSelectedSeconds(option) {
|
||
this.selectedSeconds = option.value;
|
||
if (/H/.test(this.format) && !this.selectedHour) {
|
||
this.selectedHour = this.formatSingleTime('HH');
|
||
}
|
||
if (/m/.test(this.format) && !this.selectedMinute) {
|
||
this.selectedMinute = this.formatSingleTime('mm');
|
||
}
|
||
},
|
||
findCanFocus: function findCanFocus(target, anchor, direction) {
|
||
// 处理禁止选的情况
|
||
if (direction > 0) {
|
||
for (var i = anchor; i < target.length; ++i) {
|
||
if (!target[i].disabled) return i;
|
||
}
|
||
} else {
|
||
for (var _i = anchor; _i >= 0; --_i) {
|
||
if (!target[_i].disabled) return _i;
|
||
}
|
||
}
|
||
return null;
|
||
},
|
||
resetFindFocus: function resetFindFocus(target, anchor, direction) {
|
||
var canFocusIndex = this.findCanFocus(target, anchor, direction);
|
||
return canFocusIndex !== null ? canFocusIndex : -1;
|
||
},
|
||
findFocus: function findFocus() {
|
||
var focus = void 0;
|
||
if (this.bit & 1) {
|
||
focus = this.resetFindFocus(this.hours, 0, 1);
|
||
this.focusType = 1;
|
||
} else if (this.bit & 2) {
|
||
focus = this.resetFindFocus(this.minutes, 0, 1);
|
||
this.focusType = 2;
|
||
} else if (this.bit & 4) {
|
||
focus = this.resetFindFocus(this.seconds, 0, 1);
|
||
this.focusType = 4;
|
||
}
|
||
this.focus[this.focusType] = focus;
|
||
},
|
||
preventCalculateOverflow: function preventCalculateOverflow(cur, step, target) {
|
||
var overflow = target.length;
|
||
var next = cur + step;
|
||
if (next < 0) return 0;
|
||
if (next === overflow) return cur;
|
||
next = this.findCanFocus(target, next, step);
|
||
return next !== null ? next : cur;
|
||
},
|
||
updateFocusElem: function updateFocusElem(isUp) {
|
||
var step = isUp ? -1 : 1;
|
||
var target = void 0;
|
||
if (this.focusType & 1) {
|
||
target = this.hours;
|
||
} else if (this.focusType & 2) {
|
||
target = this.minutes;
|
||
} else if (this.focusType & 4) {
|
||
target = this.seconds;
|
||
}
|
||
this.focus[this.focusType] = this.preventCalculateOverflow(this.focus[this.focusType], step, target);
|
||
},
|
||
resetFromHistory: function resetFromHistory(target) {
|
||
return this.historyFocus[this.focusType] !== -1 ? this.historyFocus[this.focusType] : this.resetFindFocus(target, 0, 1);
|
||
},
|
||
changeCurrentFocus: function changeCurrentFocus() {
|
||
if (this.focusType & 1) {
|
||
this.focus = {
|
||
1: this.resetFromHistory(this.hours),
|
||
2: -1,
|
||
4: -1
|
||
};
|
||
} else if (this.focusType & 2) {
|
||
this.focus = {
|
||
1: -1,
|
||
2: this.resetFromHistory(this.minutes),
|
||
4: -1
|
||
};
|
||
} else if (this.focusType & 4) {
|
||
this.focus = {
|
||
1: -1,
|
||
2: -1,
|
||
4: this.resetFromHistory(this.seconds)
|
||
};
|
||
}
|
||
},
|
||
moveFocus: function moveFocus(isRight) {
|
||
if (this.bit === 7) {
|
||
if (isRight && this.focusType & 3) {
|
||
this.historyFocus[this.focusType] = this.focus[this.focusType];
|
||
this.focusType <<= 1;
|
||
this.changeCurrentFocus();
|
||
}
|
||
if (!isRight && this.focusType & 6) {
|
||
this.historyFocus[this.focusType] = this.focus[this.focusType];
|
||
this.focusType >>>= 1;
|
||
this.changeCurrentFocus();
|
||
}
|
||
} else if (this.bit === 3) {
|
||
if (isRight && this.focusType & 1) {
|
||
this.historyFocus[this.focusType] = this.focus[this.focusType];
|
||
this.focusType <<= 1;
|
||
this.changeCurrentFocus();
|
||
}
|
||
if (!isRight && this.focusType & 2) {
|
||
this.historyFocus[this.focusType] = this.focus[this.focusType];
|
||
this.focusType >>>= 1;
|
||
this.changeCurrentFocus();
|
||
}
|
||
} else if (this.bit === 6) {
|
||
if (isRight && this.focusType & 2) {
|
||
this.historyFocus[this.focusType] = this.focus[this.focusType];
|
||
this.focusType <<= 1;
|
||
this.changeCurrentFocus();
|
||
}
|
||
if (!isRight && this.focusType & 4) {
|
||
this.historyFocus[this.focusType] = this.focus[this.focusType];
|
||
this.focusType >>>= 1;
|
||
this.changeCurrentFocus();
|
||
}
|
||
}
|
||
},
|
||
selectFocusElem: function selectFocusElem() {
|
||
if (this.focusType & 1) {
|
||
this.changeSelectedHour(this.hours[this.focus[this.focusType]]);
|
||
} else if (this.focusType & 2) {
|
||
this.changeSelectedMinute(this.minutes[this.focus[this.focusType]]);
|
||
} else if (this.focusType & 4) {
|
||
this.changeSelectedSeconds(this.seconds[this.focus[this.focusType]]);
|
||
}
|
||
},
|
||
keydown: function keydown(e) {
|
||
if (e.keyCode == _keyCode2.default.TAB) {
|
||
e.preventDefault();
|
||
if (!this.hasFocus) {
|
||
this.findFocus();
|
||
} else {
|
||
this.$emit('blur');
|
||
}
|
||
this.hasFocus = !this.hasFocus;
|
||
} else if (e.keyCode == _keyCode2.default.DOWN || e.keyCode == _keyCode2.default.UP) {
|
||
e.preventDefault();
|
||
this.updateFocusElem(e.keyCode == _keyCode2.default.UP);
|
||
} else if (e.keyCode == _keyCode2.default.LEFT || e.keyCode == _keyCode2.default.RIGHT) {
|
||
e.preventDefault();
|
||
this.moveFocus(e.keyCode == _keyCode2.default.RIGHT);
|
||
} else if (e.keyCode == _keyCode2.default.ENTER || e.keyCode == _keyCode2.default.MAC_ENTER || e.keyCode == _keyCode2.default.SPACE) {
|
||
e.preventDefault();
|
||
this.selectFocusElem();
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 300 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(301),
|
||
/* template */
|
||
__webpack_require__(302),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/time-picker/PickerItem.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] PickerItem.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-684fe530", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-684fe530", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 301 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
exports.default = {
|
||
props: {
|
||
value: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
focus: {
|
||
type: Number,
|
||
default: -1
|
||
},
|
||
times: {
|
||
type: Array,
|
||
default: function _default() {
|
||
return [];
|
||
}
|
||
}
|
||
},
|
||
computed: {
|
||
selectedIndex: function selectedIndex() {
|
||
var _this = this;
|
||
|
||
if (this.value) {
|
||
return this.times.findIndex(function (item) {
|
||
return item.value === _this.value;
|
||
});
|
||
}
|
||
return -1;
|
||
}
|
||
},
|
||
watch: {
|
||
selectedIndex: function selectedIndex() {
|
||
var _this2 = this;
|
||
|
||
this.$nextTick(function () {
|
||
_this2.scrollToSelected(120);
|
||
});
|
||
},
|
||
focus: function focus() {
|
||
var _this3 = this;
|
||
|
||
this.$nextTick(function () {
|
||
_this3.scrollToView(0);
|
||
});
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
var _this4 = this;
|
||
|
||
this.$nextTick(function () {
|
||
_this4.scrollToSelected(0);
|
||
});
|
||
},
|
||
|
||
methods: {
|
||
scrollToSelected: function scrollToSelected(duration) {
|
||
// move to selected item
|
||
var select = this.$el;
|
||
var list = this.$refs.list;
|
||
if (!list) {
|
||
return;
|
||
}
|
||
var index = this.selectedIndex;
|
||
if (index < 0) {
|
||
index = 0;
|
||
}
|
||
var to = list.children[index].offsetTop;
|
||
var firstTop = list.children[0].offsetTop;
|
||
(0, _util.scrollTo)(select, to - firstTop, duration);
|
||
},
|
||
scrollToView: function scrollToView(duration) {
|
||
var select = this.$el;
|
||
var list = this.$refs.list;
|
||
var index = this.focus;
|
||
if (!list || index < 0) {
|
||
return;
|
||
}
|
||
var scrollTop = select.scrollTop;
|
||
var offsetTop = list.children[index].offsetTop;
|
||
var difference = offsetTop - scrollTop;
|
||
if (difference < 0) {
|
||
(0, _util.scrollTo)(select, offsetTop, duration);
|
||
} else if (difference > 160) {
|
||
(0, _util.scrollTo)(select, scrollTop + (difference - 160), duration);
|
||
}
|
||
},
|
||
selectedTime: function selectedTime(e) {
|
||
var key = e.target.getAttribute('data-key');
|
||
var option = this.times.filter(function (item) {
|
||
return item.value === key;
|
||
});
|
||
if (option.length > 0 && option[0].disabled === false) {
|
||
this.$emit('change', option[0]);
|
||
}
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 302 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('ul', {
|
||
ref: "list",
|
||
staticClass: "picker-item",
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.selectedTime($event)
|
||
}
|
||
}
|
||
}, _vm._l((_vm.times), function(item, index) {
|
||
return _c('li', {
|
||
key: item.value,
|
||
staticClass: "picker-item-child",
|
||
class: {
|
||
disabled: item.disabled, active: item.value === _vm.value, focus: _vm.focus === index
|
||
},
|
||
attrs: {
|
||
"data-key": item.value
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(item.value) + "\n ")])
|
||
}), 0)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-684fe530", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 303 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-time-picker-content",
|
||
attrs: {
|
||
"tabindex": "0"
|
||
},
|
||
on: {
|
||
"keydown": _vm.keydown
|
||
}
|
||
}, [(_vm.hours) ? _c('picker-item', {
|
||
attrs: {
|
||
"times": _vm.hours,
|
||
"value": _vm.selectedHour,
|
||
"focus": _vm.focus['1']
|
||
},
|
||
on: {
|
||
"change": _vm.changeSelectedHour
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), (_vm.minutes) ? _c('picker-item', {
|
||
attrs: {
|
||
"times": _vm.minutes,
|
||
"value": _vm.selectedMinute,
|
||
"focus": _vm.focus['2']
|
||
},
|
||
on: {
|
||
"change": _vm.changeSelectedMinute
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), (_vm.seconds) ? _c('picker-item', {
|
||
attrs: {
|
||
"times": _vm.seconds,
|
||
"value": _vm.selectedSeconds,
|
||
"focus": _vm.focus['4']
|
||
},
|
||
on: {
|
||
"change": _vm.changeSelectedSeconds
|
||
}
|
||
}) : _vm._e()], 1)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-192aef8c", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 304 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-calendar"
|
||
}, [_c('div', {
|
||
staticClass: "ui-calendar-head"
|
||
}, [_c('div', {
|
||
staticClass: "ui-calendar-head-left"
|
||
}, [_c('span', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.showYears && _vm.showLeftArrow),
|
||
expression: "showYears && showLeftArrow"
|
||
}],
|
||
staticClass: "icon",
|
||
on: {
|
||
"click": function($event) {
|
||
_vm.current.year -= 10
|
||
}
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "ios-arrow-back",
|
||
"size": "10"
|
||
}
|
||
}), _vm._v(" "), _c('Icon', {
|
||
staticClass: "next-icon",
|
||
attrs: {
|
||
"type": "ios-arrow-back",
|
||
"size": "10"
|
||
}
|
||
})], 1), _vm._v(" "), _c('span', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (!_vm.showYears && _vm.showLeftArrow),
|
||
expression: "!showYears && showLeftArrow"
|
||
}],
|
||
staticClass: "icon",
|
||
on: {
|
||
"click": function($event) {
|
||
_vm.current.year--
|
||
}
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "ios-arrow-back",
|
||
"size": "10"
|
||
}
|
||
}), _vm._v(" "), _c('Icon', {
|
||
staticClass: "next-icon",
|
||
attrs: {
|
||
"type": "ios-arrow-back",
|
||
"size": "10"
|
||
}
|
||
})], 1), _vm._v(" "), _c('Icon', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (!_vm.showYears && !_vm.showMonths && _vm.showLeftArrow),
|
||
expression: "!showYears && !showMonths && showLeftArrow"
|
||
}],
|
||
staticClass: "icon",
|
||
attrs: {
|
||
"type": "ios-arrow-back",
|
||
"size": "10"
|
||
},
|
||
on: {
|
||
"click": _vm.monthToPre
|
||
}
|
||
})], 1), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-calendar-head-middle"
|
||
}, [_c('a', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.showYears),
|
||
expression: "showYears"
|
||
}]
|
||
}, [_vm._v(_vm._s(_vm.yearStart + "-" + _vm.yearEnd))]), _vm._v(" "), (_vm.t('el.datepicker.yearSuffix')) ? [_c('a', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (!_vm.showYears),
|
||
expression: "!showYears"
|
||
}],
|
||
on: {
|
||
"click": function($event) {
|
||
_vm.showYears = !_vm.showYears
|
||
}
|
||
}
|
||
}, [_vm._v(_vm._s(_vm.current.year) + "\n " + _vm._s(_vm.t("el.datepicker.yearSuffix")))]), _vm._v(" "), _c('a', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (!_vm.showYears && !_vm.showMonths),
|
||
expression: "!showYears && !showMonths"
|
||
}],
|
||
on: {
|
||
"click": function($event) {
|
||
_vm.showMonths = !_vm.showMonths
|
||
}
|
||
}
|
||
}, [_vm._v(_vm._s(_vm.t("el.datepicker.month" + (_vm.current.month + 1))))])] : [_c('a', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (!_vm.showYears && !_vm.showMonths),
|
||
expression: "!showYears && !showMonths"
|
||
}],
|
||
on: {
|
||
"click": function($event) {
|
||
_vm.showMonths = !_vm.showMonths
|
||
}
|
||
}
|
||
}, [_vm._v(_vm._s(_vm.t("el.datepicker.month" + (_vm.current.month + 1))))]), _vm._v(" "), _c('a', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (!_vm.showYears),
|
||
expression: "!showYears"
|
||
}],
|
||
on: {
|
||
"click": function($event) {
|
||
_vm.showYears = !_vm.showYears
|
||
}
|
||
}
|
||
}, [_vm._v(_vm._s(_vm.current.year))])]], 2), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-calendar-head-right"
|
||
}, [_c('Icon', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (!_vm.showYears && !_vm.showMonths && _vm.showRightArrow),
|
||
expression: "!showYears && !showMonths && showRightArrow"
|
||
}],
|
||
staticClass: "icon",
|
||
attrs: {
|
||
"type": "ios-arrow-forward",
|
||
"size": "10"
|
||
},
|
||
on: {
|
||
"click": _vm.monthToNext
|
||
}
|
||
}), _vm._v(" "), _c('span', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (!_vm.showYears && _vm.showRightArrow),
|
||
expression: "!showYears && showRightArrow"
|
||
}],
|
||
staticClass: "icon",
|
||
on: {
|
||
"click": function($event) {
|
||
_vm.current.year++
|
||
}
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "ios-arrow-forward",
|
||
"size": "10"
|
||
}
|
||
}), _vm._v(" "), _c('Icon', {
|
||
staticClass: "next-icon",
|
||
attrs: {
|
||
"type": "ios-arrow-forward",
|
||
"size": "10"
|
||
}
|
||
})], 1), _vm._v(" "), _c('span', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.showYears && _vm.showRightArrow),
|
||
expression: "showYears && showRightArrow"
|
||
}],
|
||
staticClass: "icon",
|
||
on: {
|
||
"click": function($event) {
|
||
_vm.current.year += 10
|
||
}
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "ios-arrow-forward",
|
||
"size": "10"
|
||
}
|
||
}), _vm._v(" "), _c('Icon', {
|
||
staticClass: "next-icon",
|
||
attrs: {
|
||
"type": "ios-arrow-forward",
|
||
"size": "10"
|
||
}
|
||
})], 1)], 1)]), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-calendar-body"
|
||
}, [(_vm.hasDay) ? _c('div', {
|
||
staticClass: "ui-calendar-days"
|
||
}, [_vm._l((_vm.WEEKS), function(week) {
|
||
return _c('span', {
|
||
key: week,
|
||
staticClass: "ui-calendar-week"
|
||
}, [_vm._v(_vm._s(_vm.t("el.datepicker.weeks." + week)))])
|
||
}), _vm._v(" "), _vm._l((_vm.days), function(item, i) {
|
||
return _c('span', {
|
||
key: i,
|
||
class: _vm.dayCls(item),
|
||
on: {
|
||
"click": function($event) {
|
||
_vm.is($event) && _vm.selectedDay(item)
|
||
}
|
||
}
|
||
}, [_vm._v(_vm._s(item.day))])
|
||
})], 2) : _vm._e(), _vm._v(" "), (_vm.hasMonth) ? _c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.showMonths),
|
||
expression: "showMonths"
|
||
}],
|
||
staticClass: "ui-calendar-months"
|
||
}, _vm._l((_vm.months), function(month, i) {
|
||
return _c('span', {
|
||
key: i,
|
||
class: _vm.monthCls(i),
|
||
on: {
|
||
"click": function($event) {
|
||
_vm.is($event) && _vm.selectedMonth(i)
|
||
}
|
||
}
|
||
}, [_vm._v(_vm._s(_vm.t("el.datepicker.months." + month)))])
|
||
}), 0) : _vm._e(), _vm._v(" "), _c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.showYears),
|
||
expression: "showYears"
|
||
}],
|
||
staticClass: "ui-calendar-years"
|
||
}, _vm._l((_vm.years), function(i, j) {
|
||
return _c('span', {
|
||
key: j,
|
||
class: _vm.yearCls(i, j),
|
||
on: {
|
||
"click": function($event) {
|
||
_vm.is($event) && _vm.selectedYear(i)
|
||
}
|
||
}
|
||
}, [_vm._v(_vm._s(i))])
|
||
}), 0), _vm._v(" "), (_vm.vShowTime) ? _c('div', {
|
||
staticClass: "ui-calendar-times-wrapper"
|
||
}, [_c('div', {
|
||
staticClass: "ui-calendar-title"
|
||
}, [_vm._v("\n " + _vm._s(_vm.timeTitle) + "\n ")]), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-calendar-times"
|
||
}, [_c('time-select', {
|
||
attrs: {
|
||
"format": _vm.tFormat,
|
||
"disabled-hours": _vm.disabledHours,
|
||
"disabled-minutes": _vm.disabledMinutes,
|
||
"disabled-seconds": _vm.disabledSeconds
|
||
},
|
||
on: {
|
||
"change": _vm.changeTimes
|
||
},
|
||
model: {
|
||
value: (_vm.times),
|
||
callback: function($$v) {
|
||
_vm.times = $$v
|
||
},
|
||
expression: "times"
|
||
}
|
||
})], 1)]) : _vm._e()])])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-08ae112e", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 305 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={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.formatRange),
|
||
expression: "formatRange"
|
||
}],
|
||
staticClass: "ui-calendars",
|
||
class: {
|
||
position: _vm.inline, inline: _vm.showInline
|
||
}
|
||
}, [(_vm.range) ? [_c('div', {
|
||
staticClass: "ui-calendars-range"
|
||
}, [_c('calendar', {
|
||
attrs: {
|
||
"value": _vm.dates,
|
||
"format": _vm.vFormat,
|
||
"model": _vm.model,
|
||
"disabled-date": _vm.disabled,
|
||
"show-right-arrow": _vm.showArrow,
|
||
"show-time": _vm.showTime,
|
||
"position": "left"
|
||
},
|
||
on: {
|
||
"on-change": _vm.leftRangeChange,
|
||
"onCurrentChange": _vm.leftCurrentChange
|
||
}
|
||
}), _vm._v(" "), _c('calendar', {
|
||
attrs: {
|
||
"value": _vm.dates,
|
||
"format": _vm.vFormat,
|
||
"model": _vm.model,
|
||
"show-left-arrow": _vm.showArrow,
|
||
"disabled-date": _vm.disabled,
|
||
"show-time": _vm.showTime,
|
||
"position": "right"
|
||
},
|
||
on: {
|
||
"on-change": _vm.rightRangeChange,
|
||
"onCurrentChange": _vm.rightCurrentChange
|
||
}
|
||
})], 1)] : [_c('calendar', {
|
||
attrs: {
|
||
"value": _vm.dates,
|
||
"format": _vm.vFormat,
|
||
"model": _vm.model,
|
||
"disabled-date": _vm.disabled,
|
||
"show-time": _vm.showTime
|
||
},
|
||
on: {
|
||
"on-change": _vm.change
|
||
}
|
||
})], _vm._v(" "), (_vm.$slots.addon || _vm.confirm) ? _c('div', {
|
||
staticClass: "ui-calendars-footer"
|
||
}, [_vm._t("addon"), _vm._v(" "), (_vm.confirm || _vm.showTimeBth) ? _c('div', {
|
||
staticClass: "inner-footer"
|
||
}, [(_vm.showTimeBth) ? _c('span', {
|
||
staticClass: "select-time",
|
||
class: {
|
||
disabled: _vm.confirmDisabled
|
||
},
|
||
on: {
|
||
"click": _vm.onSelectTime
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(_vm.showTime ? _vm.t('el.datepicker.footSelectDate') : _vm.t('el.datepicker.footSelectTime')) + "\n ")]) : _vm._e(), _vm._v(" "), _c('wb-button', {
|
||
attrs: {
|
||
"disabled": _vm.confirmDisabled,
|
||
"type": "primary"
|
||
},
|
||
on: {
|
||
"click": _vm.finished
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(_vm.t('el.datepicker.confirmBtn')) + "\n ")])], 1) : _vm._e()], 2) : _vm._e()], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-10bfb5b5", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 306 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(307),
|
||
/* template */
|
||
__webpack_require__(314),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/date-picker/datePicker.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] datePicker.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-96e56a68", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-96e56a68", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 307 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _calendars = __webpack_require__(115);
|
||
|
||
var _calendars2 = _interopRequireDefault(_calendars);
|
||
|
||
var _vReadonlyInput = __webpack_require__(121);
|
||
|
||
var _vReadonlyInput2 = _interopRequireDefault(_vReadonlyInput);
|
||
|
||
var _vPickerPopup = __webpack_require__(122);
|
||
|
||
var _vPickerPopup2 = _interopRequireDefault(_vPickerPopup);
|
||
|
||
var _keyCode = __webpack_require__(19);
|
||
|
||
var _keyCode2 = _interopRequireDefault(_keyCode);
|
||
|
||
var _propsMixin = __webpack_require__(80);
|
||
|
||
var _propsMixin2 = _interopRequireDefault(_propsMixin);
|
||
|
||
var _clickoutside = __webpack_require__(29);
|
||
|
||
var _clickoutside2 = _interopRequireDefault(_clickoutside);
|
||
|
||
var _mixin = __webpack_require__(12);
|
||
|
||
var _mixin2 = _interopRequireDefault(_mixin);
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'InputDatePicker',
|
||
directives: {
|
||
clickoutside: _clickoutside2.default
|
||
},
|
||
components: {
|
||
Calendars: _calendars2.default,
|
||
ReadonlyInput: _vReadonlyInput2.default,
|
||
PickerPopup: _vPickerPopup2.default
|
||
},
|
||
mixins: [_propsMixin2.default, _mixin2.default, _emitter2.default],
|
||
props: {
|
||
icon: {
|
||
type: String,
|
||
default: 'md-calendar'
|
||
},
|
||
value: {
|
||
type: [Date, Array, Number],
|
||
default: null
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
readonly: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
position: {
|
||
type: String,
|
||
default: null
|
||
},
|
||
model: {
|
||
default: 'single',
|
||
validator: function validator(value) {
|
||
// 这个值必须匹配下列字符串中的一个
|
||
return ['single', 'multiple', 'range'].indexOf(value) !== -1;
|
||
}
|
||
},
|
||
showConfirm: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
rangeSeparator: {
|
||
type: String,
|
||
default: '~'
|
||
},
|
||
clearable: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
placeholder: {
|
||
type: String,
|
||
default: '请选择日期'
|
||
},
|
||
format: {
|
||
type: String,
|
||
default: 'YYYY-MM-DD'
|
||
},
|
||
enableTime: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
enableSeconds: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
onlyMonth: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
minDate: {
|
||
type: Date,
|
||
default: undefined
|
||
},
|
||
maxDate: {
|
||
type: Date,
|
||
default: undefined
|
||
},
|
||
maxRange: {
|
||
// 7D七天, 1M一个月, 2Y两年
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
disable: {
|
||
// 禁用的时间
|
||
type: Array,
|
||
default: function _default() {
|
||
return [];
|
||
}
|
||
},
|
||
enable: {
|
||
// 允许的时间
|
||
type: Array,
|
||
default: function _default() {
|
||
return [];
|
||
}
|
||
},
|
||
disabledDate: {
|
||
type: Function,
|
||
default: function _default() {
|
||
return false;
|
||
}
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
show: false,
|
||
dates: this.value
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
text: function text() {
|
||
var _this = this;
|
||
|
||
var dates = this.dates;
|
||
if (this.isEmpty(dates)) return '';
|
||
if (this.model === 'single') {
|
||
return this.timeFormat(new Date(dates));
|
||
}if (this.model === 'range') {
|
||
return dates.map(function (date) {
|
||
return _this.timeFormat(new Date(date));
|
||
});
|
||
}
|
||
return dates.map(function (date) {
|
||
return _this.timeFormat(new Date(date));
|
||
}).join(', ');
|
||
}
|
||
},
|
||
watch: {
|
||
value: function value() {
|
||
if (!this.isEqual(this.value, this.dates)) {
|
||
this.dates = this.value;
|
||
}
|
||
}
|
||
},
|
||
methods: {
|
||
hidePopup: function hidePopup() {
|
||
if (this.show) {
|
||
this.show = false;
|
||
this.dispatch('FormItem', 'on-form-blur', [this.dates]);
|
||
}
|
||
},
|
||
showPopup: function showPopup() {
|
||
if (!(this.readonly || this.disabled)) {
|
||
this.show = true;
|
||
}
|
||
},
|
||
keydown: function keydown(e) {
|
||
if (e.keyCode == _keyCode2.default.ENTER || e.keyCode == _keyCode2.default.MAC_ENTER) {
|
||
this.$emit('on-enter', e);
|
||
} else if (!this.show) {
|
||
if (e.keyCode == _keyCode2.default.SPACE || e.keyCode == _keyCode2.default.TAB) {
|
||
e.preventDefault();
|
||
this.showPopup();
|
||
}
|
||
}
|
||
},
|
||
clear: function clear() {
|
||
this.$emit('clear');
|
||
this.$emit('input', this.model === 'single' ? null : []);
|
||
},
|
||
change: function change(dates, time) {
|
||
this.$emit('input', dates, time);
|
||
this.$emit('on-input', dates, time);
|
||
this.$emit('on-change', dates, time);
|
||
this.$emit('on-input-change', dates, time);
|
||
this.dispatch('FormItem', 'on-form-change', [dates]);
|
||
},
|
||
onBlur: function onBlur(event) {
|
||
this.$emit('on-blur', event);
|
||
// this.hidePopup();
|
||
},
|
||
finish: function finish() {
|
||
this.hidePopup();
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 308 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(309),
|
||
/* template */
|
||
__webpack_require__(310),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/v-readonly-input/readonlyInput.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] readonlyInput.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-493d99bd", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-493d99bd", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 309 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
components: {
|
||
Icon: _icon2.default
|
||
},
|
||
props: {
|
||
value: {
|
||
type: [String, Array],
|
||
default: ''
|
||
},
|
||
placeholder: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
icon: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
clearable: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
readonly: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
showClear: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
showClearIcon: function showClearIcon() {
|
||
return this.clearable && !this.disabled && !this.readonly && this.value && this.showClear;
|
||
},
|
||
tabindex: function tabindex() {
|
||
if (this.disabled || this.readonly) {
|
||
return -1;
|
||
}
|
||
return 0;
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 310 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('span', {
|
||
staticClass: "ui-readonly-input",
|
||
class: {
|
||
disabled: _vm.disabled
|
||
},
|
||
attrs: {
|
||
"tabindex": _vm.tabindex
|
||
},
|
||
on: {
|
||
"mouseenter": function($event) {
|
||
_vm.showClear = true
|
||
},
|
||
"mouseleave": function($event) {
|
||
_vm.showClear = false
|
||
},
|
||
"click": function($event) {
|
||
return _vm.$emit('click')
|
||
},
|
||
"focus": function($event) {
|
||
return _vm.$emit('on-focus', $event)
|
||
},
|
||
"blur": function($event) {
|
||
return _vm.$emit('on-blur', $event)
|
||
},
|
||
"keydown": function($event) {
|
||
return _vm.$emit('keydown', $event)
|
||
}
|
||
}
|
||
}, [_c('span', {
|
||
staticClass: "ui-readonly-input-content",
|
||
class: {
|
||
placeholder: !_vm.value
|
||
}
|
||
}, [_vm._t("default", [_vm._v(_vm._s(_vm.value || _vm.placeholder))])], 2), _vm._v(" "), (_vm.icon) ? _c('Icon', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (!_vm.showClearIcon),
|
||
expression: "!showClearIcon"
|
||
}],
|
||
attrs: {
|
||
"type": _vm.icon
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), _c('Icon', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.showClearIcon),
|
||
expression: "showClearIcon"
|
||
}],
|
||
attrs: {
|
||
"type": "md-close-circle"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.$emit('clear')
|
||
}
|
||
}
|
||
})], 1)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-493d99bd", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 311 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(312),
|
||
/* template */
|
||
__webpack_require__(313),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/v-picker-popup/pickerPopup.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] pickerPopup.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-26f64581", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-26f64581", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 312 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
props: {
|
||
show: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
position: {
|
||
default: null,
|
||
validator: function validator(value) {
|
||
// 这个值必须匹配下列字符串中的一个
|
||
return [null, 'bottomLeft', 'bottomRight', 'topLeft', 'topRight'].indexOf(value) !== -1;
|
||
}
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
popupPosition: 'bottomLeft'
|
||
};
|
||
},
|
||
|
||
watch: {
|
||
show: function show() {
|
||
var _this = this;
|
||
|
||
if (!this.position && this.show) {
|
||
this.$nextTick(function () {
|
||
_this.calPosition();
|
||
});
|
||
}
|
||
}
|
||
},
|
||
methods: {
|
||
calPosition: function calPosition() {
|
||
// 可以选择的弹窗位置
|
||
// bottomLeft | bottomRight | topLeft | topRight
|
||
// 父元素的位置
|
||
var _$parent$$el$getBound = this.$parent.$el.getBoundingClientRect(),
|
||
left = _$parent$$el$getBound.left,
|
||
right = _$parent$$el$getBound.right,
|
||
top = _$parent$$el$getBound.top,
|
||
bottom = _$parent$$el$getBound.bottom;
|
||
|
||
// 得到滚动条的位置。
|
||
|
||
|
||
var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
|
||
var scrollLeft = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft;
|
||
|
||
// 弹窗宽高,
|
||
// 弹窗有动画,不能使用 getBoundingClientRect 获取宽高
|
||
var contentW = this.$refs.pickerPopup.offsetWidth;
|
||
var contentH = this.$refs.pickerPopup.offsetHeight;
|
||
|
||
// 文档区域宽高
|
||
var docW = document.documentElement.scrollWidth;
|
||
var docH = document.documentElement.scrollHeight;
|
||
|
||
var topSpace = top + scrollTop;
|
||
var rightSpace = docW - (left + scrollLeft);
|
||
var bottomSpace = docH - (bottom + scrollTop);
|
||
var leftSpace = right + scrollLeft;
|
||
|
||
// 优先级
|
||
// bottomLeft | bottomRight | topLeft | topRight
|
||
if (bottomSpace >= contentH) {
|
||
if (rightSpace < contentW && leftSpace >= contentW) {
|
||
this.popupPosition = 'bottomRight';
|
||
} else {
|
||
this.popupPosition = 'bottomLeft';
|
||
}
|
||
} else if (topSpace >= contentH) {
|
||
if (rightSpace < contentW && leftSpace >= contentW) {
|
||
this.popupPosition = 'topRight';
|
||
} else {
|
||
this.popupPosition = 'topLeft';
|
||
}
|
||
} else {
|
||
this.popupPosition = 'bottomLeft';
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 313 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('transition', {
|
||
attrs: {
|
||
"name": "slide-to-down"
|
||
}
|
||
}, [_c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.show),
|
||
expression: "show"
|
||
}],
|
||
ref: "pickerPopup",
|
||
staticClass: "ui-picker-popup",
|
||
class: [_vm.position || _vm.popupPosition]
|
||
}, [_vm._t("default")], 2)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-26f64581", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 314 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={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.hidePopup),
|
||
expression: "hidePopup"
|
||
}],
|
||
staticClass: "ui-date-picker"
|
||
}, [_c('readonly-input', {
|
||
class: _vm.model,
|
||
attrs: {
|
||
"value": _vm.text,
|
||
"placeholder": _vm.placeholder || _vm.t('el.datepicker.selectDate'),
|
||
"icon": _vm.icon,
|
||
"disabled": _vm.disabled,
|
||
"readonly": _vm.readonly,
|
||
"clearable": _vm.clearable
|
||
},
|
||
on: {
|
||
"on-focus": function($event) {
|
||
return _vm.$emit('on-focus', $event)
|
||
},
|
||
"on-blur": _vm.onBlur,
|
||
"clear": _vm.clear,
|
||
"click": _vm.showPopup,
|
||
"keydown": _vm.keydown
|
||
}
|
||
}, [(_vm.model === 'range' && _vm.text.length > 0) ? _c('span', [_c('span', [_vm._v(_vm._s(_vm.text[0]))]), _c('span', {
|
||
staticClass: "range-separator"
|
||
}, [_vm._v(_vm._s(_vm.rangeSeparator))]), _c('span', [_vm._v(_vm._s(_vm.text[1]))])]) : _vm._e()]), _vm._v(" "), _c('picker-popup', {
|
||
attrs: {
|
||
"show": _vm.show,
|
||
"position": _vm.position
|
||
}
|
||
}, [_c('calendars', {
|
||
attrs: {
|
||
"model": _vm.model,
|
||
"format": _vm.format,
|
||
"disabled-date": _vm.disabledDate,
|
||
"enable-time": _vm.enableTime,
|
||
"enable-seconds": _vm.enableSeconds,
|
||
"only-month": _vm.onlyMonth,
|
||
"show-confirm": _vm.showConfirm,
|
||
"show-inline": false,
|
||
"min-date": _vm.minDate,
|
||
"max-date": _vm.maxDate,
|
||
"max-range": _vm.maxRange,
|
||
"disable": _vm.disable,
|
||
"enable": _vm.enable
|
||
},
|
||
on: {
|
||
"on-change": _vm.change,
|
||
"on-finish": _vm.finish
|
||
},
|
||
scopedSlots: _vm._u([{
|
||
key: "addon",
|
||
fn: function() {
|
||
return [_vm._t("addon")]
|
||
},
|
||
proxy: true
|
||
}], null, true),
|
||
model: {
|
||
value: (_vm.dates),
|
||
callback: function($$v) {
|
||
_vm.dates = $$v
|
||
},
|
||
expression: "dates"
|
||
}
|
||
})], 1)], 1)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-96e56a68", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 315 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _loading = __webpack_require__(123);
|
||
|
||
var _loading2 = _interopRequireDefault(_loading);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _loading2.default;
|
||
|
||
/***/ }),
|
||
/* 316 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
props: {
|
||
color: {
|
||
type: String,
|
||
default: '#2db7f5'
|
||
},
|
||
size: {
|
||
type: String,
|
||
default: '32px'
|
||
},
|
||
borderWidth: {
|
||
type: String,
|
||
default: '2px'
|
||
}
|
||
},
|
||
computed: {
|
||
clipStyle: function clipStyle() {
|
||
var style = {
|
||
height: this.size,
|
||
width: this.size,
|
||
borderWidth: this.borderWidth,
|
||
borderStyle: 'solid'
|
||
};
|
||
if (this.color) {
|
||
style.borderColor = this.color + ' ' + this.color + ' transparent';
|
||
}
|
||
return style;
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 317 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-loading",
|
||
style: (_vm.clipStyle)
|
||
})
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-643d0cab", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 318 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _promise = __webpack_require__(43);
|
||
|
||
var _promise2 = _interopRequireDefault(_promise);
|
||
|
||
var _typeof2 = __webpack_require__(31);
|
||
|
||
var _typeof3 = _interopRequireDefault(_typeof2);
|
||
|
||
var _vue = __webpack_require__(28);
|
||
|
||
var _vue2 = _interopRequireDefault(_vue);
|
||
|
||
var _message = __webpack_require__(333);
|
||
|
||
var _message2 = _interopRequireDefault(_message);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
var _mixin = __webpack_require__(12);
|
||
|
||
var _mixin2 = _interopRequireDefault(_mixin);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
var showingMessage = null;
|
||
|
||
var init = function init() {
|
||
var opt = {};
|
||
var arg0 = arguments[0];
|
||
var arg1 = arguments[1];
|
||
if (typeof arg0 === 'string') {
|
||
if (arg1) {
|
||
opt.title = arg0;
|
||
opt.template = arg1;
|
||
} else {
|
||
opt.template = arg0;
|
||
}
|
||
} else if ((typeof arg0 === 'undefined' ? 'undefined' : (0, _typeof3.default)(arg0)) === 'object') {
|
||
var config = arg0;
|
||
if (config.buttons && !util.isArray(config.buttons)) {
|
||
delete config.buttons;
|
||
}
|
||
config.buttons && config.buttons.forEach(function (button) {
|
||
if (button.show === undefined) {
|
||
button.show = true;
|
||
}
|
||
});
|
||
util.merge(opt, config);
|
||
}
|
||
return opt;
|
||
};
|
||
|
||
var create = function create(parent, _option, type) {
|
||
if (!(parent instanceof _vue2.default)) {
|
||
// 使用mixin事先收集了root
|
||
parent = message.root;
|
||
}
|
||
if (showingMessage) {
|
||
showingMessage.$destroy(true);
|
||
showingMessage = null;
|
||
}
|
||
var promise = new _promise2.default(function (resolve) {
|
||
var message = showingMessage = new _vue2.default({
|
||
name: 'MessageSwap',
|
||
parent: parent,
|
||
components: {
|
||
message: _message2.default
|
||
},
|
||
mixins: [_mixin2.default],
|
||
computed: {
|
||
confirmText: function confirmText() {
|
||
return this.t('el.message.confirm');
|
||
},
|
||
cancelText: function cancelText() {
|
||
return this.t('el.message.cancel');
|
||
},
|
||
option: function option() {
|
||
if (type === 'alert') {
|
||
_option.buttons = [{
|
||
text: this.confirmText,
|
||
show: true
|
||
}];
|
||
}
|
||
if (type === 'confirm') {
|
||
_option.buttons = [{
|
||
text: this.confirmText,
|
||
show: true
|
||
}, {
|
||
text: this.cancelText,
|
||
show: true
|
||
}];
|
||
}
|
||
if (!_option.buttons) {
|
||
_option.buttons = [{
|
||
text: this.confirmText,
|
||
show: true
|
||
}, {
|
||
text: this.cancelText,
|
||
show: true
|
||
}];
|
||
}
|
||
return _option;
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
this.$on('on-close', function (index) {
|
||
this.$destroy(true);
|
||
resolve(index);
|
||
});
|
||
},
|
||
destroyed: function destroyed() {
|
||
this.$el.remove();
|
||
},
|
||
render: function render(h) {
|
||
return h('message', {
|
||
props: {
|
||
title: this.option.title,
|
||
template: this.option.template,
|
||
buttons: this.option.buttons
|
||
}
|
||
});
|
||
}
|
||
});
|
||
message.$mount();
|
||
document.body.appendChild(message.$el);
|
||
});
|
||
return promise;
|
||
};
|
||
|
||
var message = function message() {
|
||
var parent = this;
|
||
return create(parent, init.apply(this, arguments));
|
||
};
|
||
|
||
message.alert = function () {
|
||
var opt = init.apply(this, arguments);
|
||
return create(undefined, opt, 'alert');
|
||
};
|
||
|
||
message.confirm = function () {
|
||
var opt = init.apply(this, arguments);
|
||
return create(undefined, opt, 'confirm');
|
||
};
|
||
|
||
exports.default = message;
|
||
|
||
/***/ }),
|
||
/* 319 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(111);
|
||
__webpack_require__(57);
|
||
__webpack_require__(59);
|
||
__webpack_require__(320);
|
||
__webpack_require__(331);
|
||
__webpack_require__(332);
|
||
module.exports = __webpack_require__(6).Promise;
|
||
|
||
|
||
/***/ }),
|
||
/* 320 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var LIBRARY = __webpack_require__(42);
|
||
var global = __webpack_require__(7);
|
||
var ctx = __webpack_require__(50);
|
||
var classof = __webpack_require__(79);
|
||
var $export = __webpack_require__(14);
|
||
var isObject = __webpack_require__(25);
|
||
var aFunction = __webpack_require__(51);
|
||
var anInstance = __webpack_require__(321);
|
||
var forOf = __webpack_require__(322);
|
||
var speciesConstructor = __webpack_require__(124);
|
||
var task = __webpack_require__(125).set;
|
||
var microtask = __webpack_require__(326)();
|
||
var newPromiseCapabilityModule = __webpack_require__(81);
|
||
var perform = __webpack_require__(126);
|
||
var userAgent = __webpack_require__(327);
|
||
var promiseResolve = __webpack_require__(127);
|
||
var PROMISE = 'Promise';
|
||
var TypeError = global.TypeError;
|
||
var process = global.process;
|
||
var versions = process && process.versions;
|
||
var v8 = versions && versions.v8 || '';
|
||
var $Promise = global[PROMISE];
|
||
var isNode = classof(process) == 'process';
|
||
var empty = function () { /* empty */ };
|
||
var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
|
||
var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
|
||
|
||
var USE_NATIVE = !!function () {
|
||
try {
|
||
// correct subclassing with @@species support
|
||
var promise = $Promise.resolve(1);
|
||
var FakePromise = (promise.constructor = {})[__webpack_require__(8)('species')] = function (exec) {
|
||
exec(empty, empty);
|
||
};
|
||
// unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
||
return (isNode || typeof PromiseRejectionEvent == 'function')
|
||
&& promise.then(empty) instanceof FakePromise
|
||
// v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
||
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
|
||
// we can't detect it synchronously, so just check versions
|
||
&& v8.indexOf('6.6') !== 0
|
||
&& userAgent.indexOf('Chrome/66') === -1;
|
||
} catch (e) { /* empty */ }
|
||
}();
|
||
|
||
// helpers
|
||
var isThenable = function (it) {
|
||
var then;
|
||
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
|
||
};
|
||
var notify = function (promise, isReject) {
|
||
if (promise._n) return;
|
||
promise._n = true;
|
||
var chain = promise._c;
|
||
microtask(function () {
|
||
var value = promise._v;
|
||
var ok = promise._s == 1;
|
||
var i = 0;
|
||
var run = function (reaction) {
|
||
var handler = ok ? reaction.ok : reaction.fail;
|
||
var resolve = reaction.resolve;
|
||
var reject = reaction.reject;
|
||
var domain = reaction.domain;
|
||
var result, then, exited;
|
||
try {
|
||
if (handler) {
|
||
if (!ok) {
|
||
if (promise._h == 2) onHandleUnhandled(promise);
|
||
promise._h = 1;
|
||
}
|
||
if (handler === true) result = value;
|
||
else {
|
||
if (domain) domain.enter();
|
||
result = handler(value); // may throw
|
||
if (domain) {
|
||
domain.exit();
|
||
exited = true;
|
||
}
|
||
}
|
||
if (result === reaction.promise) {
|
||
reject(TypeError('Promise-chain cycle'));
|
||
} else if (then = isThenable(result)) {
|
||
then.call(result, resolve, reject);
|
||
} else resolve(result);
|
||
} else reject(value);
|
||
} catch (e) {
|
||
if (domain && !exited) domain.exit();
|
||
reject(e);
|
||
}
|
||
};
|
||
while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
|
||
promise._c = [];
|
||
promise._n = false;
|
||
if (isReject && !promise._h) onUnhandled(promise);
|
||
});
|
||
};
|
||
var onUnhandled = function (promise) {
|
||
task.call(global, function () {
|
||
var value = promise._v;
|
||
var unhandled = isUnhandled(promise);
|
||
var result, handler, console;
|
||
if (unhandled) {
|
||
result = perform(function () {
|
||
if (isNode) {
|
||
process.emit('unhandledRejection', value, promise);
|
||
} else if (handler = global.onunhandledrejection) {
|
||
handler({ promise: promise, reason: value });
|
||
} else if ((console = global.console) && console.error) {
|
||
console.error('Unhandled promise rejection', value);
|
||
}
|
||
});
|
||
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
|
||
promise._h = isNode || isUnhandled(promise) ? 2 : 1;
|
||
} promise._a = undefined;
|
||
if (unhandled && result.e) throw result.v;
|
||
});
|
||
};
|
||
var isUnhandled = function (promise) {
|
||
return promise._h !== 1 && (promise._a || promise._c).length === 0;
|
||
};
|
||
var onHandleUnhandled = function (promise) {
|
||
task.call(global, function () {
|
||
var handler;
|
||
if (isNode) {
|
||
process.emit('rejectionHandled', promise);
|
||
} else if (handler = global.onrejectionhandled) {
|
||
handler({ promise: promise, reason: promise._v });
|
||
}
|
||
});
|
||
};
|
||
var $reject = function (value) {
|
||
var promise = this;
|
||
if (promise._d) return;
|
||
promise._d = true;
|
||
promise = promise._w || promise; // unwrap
|
||
promise._v = value;
|
||
promise._s = 2;
|
||
if (!promise._a) promise._a = promise._c.slice();
|
||
notify(promise, true);
|
||
};
|
||
var $resolve = function (value) {
|
||
var promise = this;
|
||
var then;
|
||
if (promise._d) return;
|
||
promise._d = true;
|
||
promise = promise._w || promise; // unwrap
|
||
try {
|
||
if (promise === value) throw TypeError("Promise can't be resolved itself");
|
||
if (then = isThenable(value)) {
|
||
microtask(function () {
|
||
var wrapper = { _w: promise, _d: false }; // wrap
|
||
try {
|
||
then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
|
||
} catch (e) {
|
||
$reject.call(wrapper, e);
|
||
}
|
||
});
|
||
} else {
|
||
promise._v = value;
|
||
promise._s = 1;
|
||
notify(promise, false);
|
||
}
|
||
} catch (e) {
|
||
$reject.call({ _w: promise, _d: false }, e); // wrap
|
||
}
|
||
};
|
||
|
||
// constructor polyfill
|
||
if (!USE_NATIVE) {
|
||
// 25.4.3.1 Promise(executor)
|
||
$Promise = function Promise(executor) {
|
||
anInstance(this, $Promise, PROMISE, '_h');
|
||
aFunction(executor);
|
||
Internal.call(this);
|
||
try {
|
||
executor(ctx($resolve, this, 1), ctx($reject, this, 1));
|
||
} catch (err) {
|
||
$reject.call(this, err);
|
||
}
|
||
};
|
||
// eslint-disable-next-line no-unused-vars
|
||
Internal = function Promise(executor) {
|
||
this._c = []; // <- awaiting reactions
|
||
this._a = undefined; // <- checked in isUnhandled reactions
|
||
this._s = 0; // <- state
|
||
this._d = false; // <- done
|
||
this._v = undefined; // <- value
|
||
this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
|
||
this._n = false; // <- notify
|
||
};
|
||
Internal.prototype = __webpack_require__(328)($Promise.prototype, {
|
||
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
|
||
then: function then(onFulfilled, onRejected) {
|
||
var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
|
||
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
|
||
reaction.fail = typeof onRejected == 'function' && onRejected;
|
||
reaction.domain = isNode ? process.domain : undefined;
|
||
this._c.push(reaction);
|
||
if (this._a) this._a.push(reaction);
|
||
if (this._s) notify(this, false);
|
||
return reaction.promise;
|
||
},
|
||
// 25.4.5.1 Promise.prototype.catch(onRejected)
|
||
'catch': function (onRejected) {
|
||
return this.then(undefined, onRejected);
|
||
}
|
||
});
|
||
OwnPromiseCapability = function () {
|
||
var promise = new Internal();
|
||
this.promise = promise;
|
||
this.resolve = ctx($resolve, promise, 1);
|
||
this.reject = ctx($reject, promise, 1);
|
||
};
|
||
newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
|
||
return C === $Promise || C === Wrapper
|
||
? new OwnPromiseCapability(C)
|
||
: newGenericPromiseCapability(C);
|
||
};
|
||
}
|
||
|
||
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
|
||
__webpack_require__(58)($Promise, PROMISE);
|
||
__webpack_require__(329)(PROMISE);
|
||
Wrapper = __webpack_require__(6)[PROMISE];
|
||
|
||
// statics
|
||
$export($export.S + $export.F * !USE_NATIVE, PROMISE, {
|
||
// 25.4.4.5 Promise.reject(r)
|
||
reject: function reject(r) {
|
||
var capability = newPromiseCapability(this);
|
||
var $$reject = capability.reject;
|
||
$$reject(r);
|
||
return capability.promise;
|
||
}
|
||
});
|
||
$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
|
||
// 25.4.4.6 Promise.resolve(x)
|
||
resolve: function resolve(x) {
|
||
return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
|
||
}
|
||
});
|
||
$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(330)(function (iter) {
|
||
$Promise.all(iter)['catch'](empty);
|
||
})), PROMISE, {
|
||
// 25.4.4.1 Promise.all(iterable)
|
||
all: function all(iterable) {
|
||
var C = this;
|
||
var capability = newPromiseCapability(C);
|
||
var resolve = capability.resolve;
|
||
var reject = capability.reject;
|
||
var result = perform(function () {
|
||
var values = [];
|
||
var index = 0;
|
||
var remaining = 1;
|
||
forOf(iterable, false, function (promise) {
|
||
var $index = index++;
|
||
var alreadyCalled = false;
|
||
values.push(undefined);
|
||
remaining++;
|
||
C.resolve(promise).then(function (value) {
|
||
if (alreadyCalled) return;
|
||
alreadyCalled = true;
|
||
values[$index] = value;
|
||
--remaining || resolve(values);
|
||
}, reject);
|
||
});
|
||
--remaining || resolve(values);
|
||
});
|
||
if (result.e) reject(result.v);
|
||
return capability.promise;
|
||
},
|
||
// 25.4.4.4 Promise.race(iterable)
|
||
race: function race(iterable) {
|
||
var C = this;
|
||
var capability = newPromiseCapability(C);
|
||
var reject = capability.reject;
|
||
var result = perform(function () {
|
||
forOf(iterable, false, function (promise) {
|
||
C.resolve(promise).then(capability.resolve, reject);
|
||
});
|
||
});
|
||
if (result.e) reject(result.v);
|
||
return capability.promise;
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 321 */
|
||
/***/ (function(module, exports) {
|
||
|
||
module.exports = function (it, Constructor, name, forbiddenField) {
|
||
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
|
||
throw TypeError(name + ': incorrect invocation!');
|
||
} return it;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 322 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var ctx = __webpack_require__(50);
|
||
var call = __webpack_require__(323);
|
||
var isArrayIter = __webpack_require__(324);
|
||
var anObject = __webpack_require__(17);
|
||
var toLength = __webpack_require__(105);
|
||
var getIterFn = __webpack_require__(117);
|
||
var BREAK = {};
|
||
var RETURN = {};
|
||
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
|
||
var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
|
||
var f = ctx(fn, that, entries ? 2 : 1);
|
||
var index = 0;
|
||
var length, step, iterator, result;
|
||
if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
|
||
// fast case for arrays with default iterator
|
||
if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
|
||
result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
|
||
if (result === BREAK || result === RETURN) return result;
|
||
} else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
|
||
result = call(iterator, f, step.value, entries);
|
||
if (result === BREAK || result === RETURN) return result;
|
||
}
|
||
};
|
||
exports.BREAK = BREAK;
|
||
exports.RETURN = RETURN;
|
||
|
||
|
||
/***/ }),
|
||
/* 323 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// call something on iterator step with safe closing on error
|
||
var anObject = __webpack_require__(17);
|
||
module.exports = function (iterator, fn, value, entries) {
|
||
try {
|
||
return entries ? fn(anObject(value)[0], value[1]) : fn(value);
|
||
// 7.4.6 IteratorClose(iterator, completion)
|
||
} catch (e) {
|
||
var ret = iterator['return'];
|
||
if (ret !== undefined) anObject(ret.call(iterator));
|
||
throw e;
|
||
}
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 324 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// check on default Array iterator
|
||
var Iterators = __webpack_require__(32);
|
||
var ITERATOR = __webpack_require__(8)('iterator');
|
||
var ArrayProto = Array.prototype;
|
||
|
||
module.exports = function (it) {
|
||
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 325 */
|
||
/***/ (function(module, exports) {
|
||
|
||
// fast apply, http://jsperf.lnkit.com/fast-apply/5
|
||
module.exports = function (fn, args, that) {
|
||
var un = that === undefined;
|
||
switch (args.length) {
|
||
case 0: return un ? fn()
|
||
: fn.call(that);
|
||
case 1: return un ? fn(args[0])
|
||
: fn.call(that, args[0]);
|
||
case 2: return un ? fn(args[0], args[1])
|
||
: fn.call(that, args[0], args[1]);
|
||
case 3: return un ? fn(args[0], args[1], args[2])
|
||
: fn.call(that, args[0], args[1], args[2]);
|
||
case 4: return un ? fn(args[0], args[1], args[2], args[3])
|
||
: fn.call(that, args[0], args[1], args[2], args[3]);
|
||
} return fn.apply(that, args);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 326 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var global = __webpack_require__(7);
|
||
var macrotask = __webpack_require__(125).set;
|
||
var Observer = global.MutationObserver || global.WebKitMutationObserver;
|
||
var process = global.process;
|
||
var Promise = global.Promise;
|
||
var isNode = __webpack_require__(41)(process) == 'process';
|
||
|
||
module.exports = function () {
|
||
var head, last, notify;
|
||
|
||
var flush = function () {
|
||
var parent, fn;
|
||
if (isNode && (parent = process.domain)) parent.exit();
|
||
while (head) {
|
||
fn = head.fn;
|
||
head = head.next;
|
||
try {
|
||
fn();
|
||
} catch (e) {
|
||
if (head) notify();
|
||
else last = undefined;
|
||
throw e;
|
||
}
|
||
} last = undefined;
|
||
if (parent) parent.enter();
|
||
};
|
||
|
||
// Node.js
|
||
if (isNode) {
|
||
notify = function () {
|
||
process.nextTick(flush);
|
||
};
|
||
// browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
|
||
} else if (Observer && !(global.navigator && global.navigator.standalone)) {
|
||
var toggle = true;
|
||
var node = document.createTextNode('');
|
||
new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
|
||
notify = function () {
|
||
node.data = toggle = !toggle;
|
||
};
|
||
// environments with maybe non-completely correct, but existent Promise
|
||
} else if (Promise && Promise.resolve) {
|
||
// Promise.resolve without an argument throws an error in LG WebOS 2
|
||
var promise = Promise.resolve(undefined);
|
||
notify = function () {
|
||
promise.then(flush);
|
||
};
|
||
// for other environments - macrotask based on:
|
||
// - setImmediate
|
||
// - MessageChannel
|
||
// - window.postMessag
|
||
// - onreadystatechange
|
||
// - setTimeout
|
||
} else {
|
||
notify = function () {
|
||
// strange IE + webpack dev server bug - use .call(global)
|
||
macrotask.call(global, flush);
|
||
};
|
||
}
|
||
|
||
return function (fn) {
|
||
var task = { fn: fn, next: undefined };
|
||
if (last) last.next = task;
|
||
if (!head) {
|
||
head = task;
|
||
notify();
|
||
} last = task;
|
||
};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 327 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var global = __webpack_require__(7);
|
||
var navigator = global.navigator;
|
||
|
||
module.exports = navigator && navigator.userAgent || '';
|
||
|
||
|
||
/***/ }),
|
||
/* 328 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var hide = __webpack_require__(24);
|
||
module.exports = function (target, src, safe) {
|
||
for (var key in src) {
|
||
if (safe && target[key]) target[key] = src[key];
|
||
else hide(target, key, src[key]);
|
||
} return target;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 329 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var global = __webpack_require__(7);
|
||
var core = __webpack_require__(6);
|
||
var dP = __webpack_require__(21);
|
||
var DESCRIPTORS = __webpack_require__(18);
|
||
var SPECIES = __webpack_require__(8)('species');
|
||
|
||
module.exports = function (KEY) {
|
||
var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
|
||
if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
|
||
configurable: true,
|
||
get: function () { return this; }
|
||
});
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 330 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var ITERATOR = __webpack_require__(8)('iterator');
|
||
var SAFE_CLOSING = false;
|
||
|
||
try {
|
||
var riter = [7][ITERATOR]();
|
||
riter['return'] = function () { SAFE_CLOSING = true; };
|
||
// eslint-disable-next-line no-throw-literal
|
||
Array.from(riter, function () { throw 2; });
|
||
} catch (e) { /* empty */ }
|
||
|
||
module.exports = function (exec, skipClosing) {
|
||
if (!skipClosing && !SAFE_CLOSING) return false;
|
||
var safe = false;
|
||
try {
|
||
var arr = [7];
|
||
var iter = arr[ITERATOR]();
|
||
iter.next = function () { return { done: safe = true }; };
|
||
arr[ITERATOR] = function () { return iter; };
|
||
exec(arr);
|
||
} catch (e) { /* empty */ }
|
||
return safe;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 331 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
// https://github.com/tc39/proposal-promise-finally
|
||
|
||
var $export = __webpack_require__(14);
|
||
var core = __webpack_require__(6);
|
||
var global = __webpack_require__(7);
|
||
var speciesConstructor = __webpack_require__(124);
|
||
var promiseResolve = __webpack_require__(127);
|
||
|
||
$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
|
||
var C = speciesConstructor(this, core.Promise || global.Promise);
|
||
var isFunction = typeof onFinally == 'function';
|
||
return this.then(
|
||
isFunction ? function (x) {
|
||
return promiseResolve(C, onFinally()).then(function () { return x; });
|
||
} : onFinally,
|
||
isFunction ? function (e) {
|
||
return promiseResolve(C, onFinally()).then(function () { throw e; });
|
||
} : onFinally
|
||
);
|
||
} });
|
||
|
||
|
||
/***/ }),
|
||
/* 332 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
// https://github.com/tc39/proposal-promise-try
|
||
var $export = __webpack_require__(14);
|
||
var newPromiseCapability = __webpack_require__(81);
|
||
var perform = __webpack_require__(126);
|
||
|
||
$export($export.S, 'Promise', { 'try': function (callbackfn) {
|
||
var promiseCapability = newPromiseCapability.f(this);
|
||
var result = perform(callbackfn);
|
||
(result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
|
||
return promiseCapability.promise;
|
||
} });
|
||
|
||
|
||
/***/ }),
|
||
/* 333 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(334),
|
||
/* template */
|
||
__webpack_require__(338),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/message/message.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] message.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-68881441", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-68881441", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 334 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _xss = __webpack_require__(128);
|
||
|
||
var _xss2 = _interopRequireDefault(_xss);
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'Message',
|
||
components: {
|
||
Icon: _icon2.default
|
||
},
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
title: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
template: {
|
||
type: String,
|
||
required: true
|
||
},
|
||
buttons: {
|
||
type: Array,
|
||
default: undefined
|
||
}
|
||
},
|
||
methods: {
|
||
xssFilter: function xssFilter(html) {
|
||
return (0, _xss2.default)(html, {
|
||
onIgnoreTagAttr: function onIgnoreTagAttr(tag, name, value) {
|
||
if (name === 'style' || name === 'class') {
|
||
// 通过内置的escapeAttrValue函数来对属性值进行转义
|
||
return name + '="' + (0, _xss.safeAttrValue)(tag, name, value) + '"';
|
||
}
|
||
}
|
||
});
|
||
},
|
||
getButtonClass: function getButtonClass(button) {
|
||
return button.class;
|
||
},
|
||
click: function click(index) {
|
||
this.dispatch('MessageSwap', 'on-close', index);
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 335 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
/**
|
||
* cssfilter
|
||
*
|
||
* @author 老雷<leizongmin@gmail.com>
|
||
*/
|
||
|
||
var DEFAULT = __webpack_require__(130);
|
||
var parseStyle = __webpack_require__(336);
|
||
var _ = __webpack_require__(131);
|
||
|
||
|
||
/**
|
||
* 返回值是否为空
|
||
*
|
||
* @param {Object} obj
|
||
* @return {Boolean}
|
||
*/
|
||
function isNull (obj) {
|
||
return (obj === undefined || obj === null);
|
||
}
|
||
|
||
/**
|
||
* 浅拷贝对象
|
||
*
|
||
* @param {Object} obj
|
||
* @return {Object}
|
||
*/
|
||
function shallowCopyObject (obj) {
|
||
var ret = {};
|
||
for (var i in obj) {
|
||
ret[i] = obj[i];
|
||
}
|
||
return ret;
|
||
}
|
||
|
||
/**
|
||
* 创建CSS过滤器
|
||
*
|
||
* @param {Object} options
|
||
* - {Object} whiteList
|
||
* - {Function} onAttr
|
||
* - {Function} onIgnoreAttr
|
||
* - {Function} safeAttrValue
|
||
*/
|
||
function FilterCSS (options) {
|
||
options = shallowCopyObject(options || {});
|
||
options.whiteList = options.whiteList || DEFAULT.whiteList;
|
||
options.onAttr = options.onAttr || DEFAULT.onAttr;
|
||
options.onIgnoreAttr = options.onIgnoreAttr || DEFAULT.onIgnoreAttr;
|
||
options.safeAttrValue = options.safeAttrValue || DEFAULT.safeAttrValue;
|
||
this.options = options;
|
||
}
|
||
|
||
FilterCSS.prototype.process = function (css) {
|
||
// 兼容各种奇葩输入
|
||
css = css || '';
|
||
css = css.toString();
|
||
if (!css) return '';
|
||
|
||
var me = this;
|
||
var options = me.options;
|
||
var whiteList = options.whiteList;
|
||
var onAttr = options.onAttr;
|
||
var onIgnoreAttr = options.onIgnoreAttr;
|
||
var safeAttrValue = options.safeAttrValue;
|
||
|
||
var retCSS = parseStyle(css, function (sourcePosition, position, name, value, source) {
|
||
|
||
var check = whiteList[name];
|
||
var isWhite = false;
|
||
if (check === true) isWhite = check;
|
||
else if (typeof check === 'function') isWhite = check(value);
|
||
else if (check instanceof RegExp) isWhite = check.test(value);
|
||
if (isWhite !== true) isWhite = false;
|
||
|
||
// 如果过滤后 value 为空则直接忽略
|
||
value = safeAttrValue(name, value);
|
||
if (!value) return;
|
||
|
||
var opts = {
|
||
position: position,
|
||
sourcePosition: sourcePosition,
|
||
source: source,
|
||
isWhite: isWhite
|
||
};
|
||
|
||
if (isWhite) {
|
||
|
||
var ret = onAttr(name, value, opts);
|
||
if (isNull(ret)) {
|
||
return name + ':' + value;
|
||
} else {
|
||
return ret;
|
||
}
|
||
|
||
} else {
|
||
|
||
var ret = onIgnoreAttr(name, value, opts);
|
||
if (!isNull(ret)) {
|
||
return ret;
|
||
}
|
||
|
||
}
|
||
});
|
||
|
||
return retCSS;
|
||
};
|
||
|
||
|
||
module.exports = FilterCSS;
|
||
|
||
|
||
/***/ }),
|
||
/* 336 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
/**
|
||
* cssfilter
|
||
*
|
||
* @author 老雷<leizongmin@gmail.com>
|
||
*/
|
||
|
||
var _ = __webpack_require__(131);
|
||
|
||
|
||
/**
|
||
* 解析style
|
||
*
|
||
* @param {String} css
|
||
* @param {Function} onAttr 处理属性的函数
|
||
* 参数格式: function (sourcePosition, position, name, value, source)
|
||
* @return {String}
|
||
*/
|
||
function parseStyle (css, onAttr) {
|
||
css = _.trimRight(css);
|
||
if (css[css.length - 1] !== ';') css += ';';
|
||
var cssLength = css.length;
|
||
var isParenthesisOpen = false;
|
||
var lastPos = 0;
|
||
var i = 0;
|
||
var retCSS = '';
|
||
|
||
function addNewAttr () {
|
||
// 如果没有正常的闭合圆括号,则直接忽略当前属性
|
||
if (!isParenthesisOpen) {
|
||
var source = _.trim(css.slice(lastPos, i));
|
||
var j = source.indexOf(':');
|
||
if (j !== -1) {
|
||
var name = _.trim(source.slice(0, j));
|
||
var value = _.trim(source.slice(j + 1));
|
||
// 必须有属性名称
|
||
if (name) {
|
||
var ret = onAttr(lastPos, retCSS.length, name, value, source);
|
||
if (ret) retCSS += ret + '; ';
|
||
}
|
||
}
|
||
}
|
||
lastPos = i + 1;
|
||
}
|
||
|
||
for (; i < cssLength; i++) {
|
||
var c = css[i];
|
||
if (c === '/' && css[i + 1] === '*') {
|
||
// 备注开始
|
||
var j = css.indexOf('*/', i + 2);
|
||
// 如果没有正常的备注结束,则后面的部分全部跳过
|
||
if (j === -1) break;
|
||
// 直接将当前位置调到备注结尾,并且初始化状态
|
||
i = j + 1;
|
||
lastPos = i + 1;
|
||
isParenthesisOpen = false;
|
||
} else if (c === '(') {
|
||
isParenthesisOpen = true;
|
||
} else if (c === ')') {
|
||
isParenthesisOpen = false;
|
||
} else if (c === ';') {
|
||
if (isParenthesisOpen) {
|
||
// 在圆括号里面,忽略
|
||
} else {
|
||
addNewAttr();
|
||
}
|
||
} else if (c === '\n') {
|
||
addNewAttr();
|
||
}
|
||
}
|
||
|
||
return _.trim(retCSS);
|
||
}
|
||
|
||
module.exports = parseStyle;
|
||
|
||
|
||
/***/ }),
|
||
/* 337 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
/**
|
||
* filter xss
|
||
*
|
||
* @author Zongmin Lei<leizongmin@gmail.com>
|
||
*/
|
||
|
||
var FilterCSS = __webpack_require__(82).FilterCSS;
|
||
var DEFAULT = __webpack_require__(129);
|
||
var parser = __webpack_require__(132);
|
||
var parseTag = parser.parseTag;
|
||
var parseAttr = parser.parseAttr;
|
||
var _ = __webpack_require__(83);
|
||
|
||
/**
|
||
* returns `true` if the input value is `undefined` or `null`
|
||
*
|
||
* @param {Object} obj
|
||
* @return {Boolean}
|
||
*/
|
||
function isNull(obj) {
|
||
return obj === undefined || obj === null;
|
||
}
|
||
|
||
/**
|
||
* get attributes for a tag
|
||
*
|
||
* @param {String} html
|
||
* @return {Object}
|
||
* - {String} html
|
||
* - {Boolean} closing
|
||
*/
|
||
function getAttrs(html) {
|
||
var i = _.spaceIndex(html);
|
||
if (i === -1) {
|
||
return {
|
||
html: "",
|
||
closing: html[html.length - 2] === "/"
|
||
};
|
||
}
|
||
html = _.trim(html.slice(i + 1, -1));
|
||
var isClosing = html[html.length - 1] === "/";
|
||
if (isClosing) html = _.trim(html.slice(0, -1));
|
||
return {
|
||
html: html,
|
||
closing: isClosing
|
||
};
|
||
}
|
||
|
||
/**
|
||
* shallow copy
|
||
*
|
||
* @param {Object} obj
|
||
* @return {Object}
|
||
*/
|
||
function shallowCopyObject(obj) {
|
||
var ret = {};
|
||
for (var i in obj) {
|
||
ret[i] = obj[i];
|
||
}
|
||
return ret;
|
||
}
|
||
|
||
/**
|
||
* FilterXSS class
|
||
*
|
||
* @param {Object} options
|
||
* whiteList, onTag, onTagAttr, onIgnoreTag,
|
||
* onIgnoreTagAttr, safeAttrValue, escapeHtml
|
||
* stripIgnoreTagBody, allowCommentTag, stripBlankChar
|
||
* css{whiteList, onAttr, onIgnoreAttr} `css=false` means don't use `cssfilter`
|
||
*/
|
||
function FilterXSS(options) {
|
||
options = shallowCopyObject(options || {});
|
||
|
||
if (options.stripIgnoreTag) {
|
||
if (options.onIgnoreTag) {
|
||
console.error(
|
||
'Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'
|
||
);
|
||
}
|
||
options.onIgnoreTag = DEFAULT.onIgnoreTagStripAll;
|
||
}
|
||
|
||
options.whiteList = options.whiteList || DEFAULT.whiteList;
|
||
options.onTag = options.onTag || DEFAULT.onTag;
|
||
options.onTagAttr = options.onTagAttr || DEFAULT.onTagAttr;
|
||
options.onIgnoreTag = options.onIgnoreTag || DEFAULT.onIgnoreTag;
|
||
options.onIgnoreTagAttr = options.onIgnoreTagAttr || DEFAULT.onIgnoreTagAttr;
|
||
options.safeAttrValue = options.safeAttrValue || DEFAULT.safeAttrValue;
|
||
options.escapeHtml = options.escapeHtml || DEFAULT.escapeHtml;
|
||
this.options = options;
|
||
|
||
if (options.css === false) {
|
||
this.cssFilter = false;
|
||
} else {
|
||
options.css = options.css || {};
|
||
this.cssFilter = new FilterCSS(options.css);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* start process and returns result
|
||
*
|
||
* @param {String} html
|
||
* @return {String}
|
||
*/
|
||
FilterXSS.prototype.process = function(html) {
|
||
// compatible with the input
|
||
html = html || "";
|
||
html = html.toString();
|
||
if (!html) return "";
|
||
|
||
var me = this;
|
||
var options = me.options;
|
||
var whiteList = options.whiteList;
|
||
var onTag = options.onTag;
|
||
var onIgnoreTag = options.onIgnoreTag;
|
||
var onTagAttr = options.onTagAttr;
|
||
var onIgnoreTagAttr = options.onIgnoreTagAttr;
|
||
var safeAttrValue = options.safeAttrValue;
|
||
var escapeHtml = options.escapeHtml;
|
||
var cssFilter = me.cssFilter;
|
||
|
||
// remove invisible characters
|
||
if (options.stripBlankChar) {
|
||
html = DEFAULT.stripBlankChar(html);
|
||
}
|
||
|
||
// remove html comments
|
||
if (!options.allowCommentTag) {
|
||
html = DEFAULT.stripCommentTag(html);
|
||
}
|
||
|
||
// if enable stripIgnoreTagBody
|
||
var stripIgnoreTagBody = false;
|
||
if (options.stripIgnoreTagBody) {
|
||
var stripIgnoreTagBody = DEFAULT.StripTagBody(
|
||
options.stripIgnoreTagBody,
|
||
onIgnoreTag
|
||
);
|
||
onIgnoreTag = stripIgnoreTagBody.onIgnoreTag;
|
||
}
|
||
|
||
var retHtml = parseTag(
|
||
html,
|
||
function(sourcePosition, position, tag, html, isClosing) {
|
||
var info = {
|
||
sourcePosition: sourcePosition,
|
||
position: position,
|
||
isClosing: isClosing,
|
||
isWhite: whiteList.hasOwnProperty(tag)
|
||
};
|
||
|
||
// call `onTag()`
|
||
var ret = onTag(tag, html, info);
|
||
if (!isNull(ret)) return ret;
|
||
|
||
if (info.isWhite) {
|
||
if (info.isClosing) {
|
||
return "</" + tag + ">";
|
||
}
|
||
|
||
var attrs = getAttrs(html);
|
||
var whiteAttrList = whiteList[tag];
|
||
var attrsHtml = parseAttr(attrs.html, function(name, value) {
|
||
// call `onTagAttr()`
|
||
var isWhiteAttr = _.indexOf(whiteAttrList, name) !== -1;
|
||
var ret = onTagAttr(tag, name, value, isWhiteAttr);
|
||
if (!isNull(ret)) return ret;
|
||
|
||
if (isWhiteAttr) {
|
||
// call `safeAttrValue()`
|
||
value = safeAttrValue(tag, name, value, cssFilter);
|
||
if (value) {
|
||
return name + '="' + value + '"';
|
||
} else {
|
||
return name;
|
||
}
|
||
} else {
|
||
// call `onIgnoreTagAttr()`
|
||
var ret = onIgnoreTagAttr(tag, name, value, isWhiteAttr);
|
||
if (!isNull(ret)) return ret;
|
||
return;
|
||
}
|
||
});
|
||
|
||
// build new tag html
|
||
var html = "<" + tag;
|
||
if (attrsHtml) html += " " + attrsHtml;
|
||
if (attrs.closing) html += " /";
|
||
html += ">";
|
||
return html;
|
||
} else {
|
||
// call `onIgnoreTag()`
|
||
var ret = onIgnoreTag(tag, html, info);
|
||
if (!isNull(ret)) return ret;
|
||
return escapeHtml(html);
|
||
}
|
||
},
|
||
escapeHtml
|
||
);
|
||
|
||
// if enable stripIgnoreTagBody
|
||
if (stripIgnoreTagBody) {
|
||
retHtml = stripIgnoreTagBody.remove(retHtml);
|
||
}
|
||
|
||
return retHtml;
|
||
};
|
||
|
||
module.exports = FilterXSS;
|
||
|
||
|
||
/***/ }),
|
||
/* 338 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-message"
|
||
}, [_c('div', {
|
||
staticClass: "ui-message-swap"
|
||
}, [_c('div', {
|
||
staticClass: "ui-message-body"
|
||
}, [(_vm.title) ? _c('div', {
|
||
staticClass: "ui-message-title"
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "md-help-circle"
|
||
}
|
||
}), _vm._v(" "), _c('span', {
|
||
staticClass: "ui-message-title-text",
|
||
domProps: {
|
||
"innerHTML": _vm._s(_vm.xssFilter(_vm.title))
|
||
}
|
||
})], 1) : _vm._e(), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-message-content",
|
||
domProps: {
|
||
"innerHTML": _vm._s(_vm.xssFilter(_vm.template))
|
||
}
|
||
})]), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-message-buttons"
|
||
}, _vm._l((_vm.buttons), function(button, index) {
|
||
return _c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (button.show),
|
||
expression: "button.show"
|
||
}],
|
||
key: index,
|
||
staticClass: "ui-button",
|
||
class: _vm.getButtonClass(button),
|
||
domProps: {
|
||
"textContent": _vm._s(button.text)
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.click(index, $event)
|
||
}
|
||
}
|
||
})
|
||
}), 0)])])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-68881441", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 339 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _modal = __webpack_require__(340);
|
||
|
||
var _modal2 = _interopRequireDefault(_modal);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _modal2.default;
|
||
|
||
/***/ }),
|
||
/* 340 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(341),
|
||
/* template */
|
||
__webpack_require__(346),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/modal/modal.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] modal.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-941c1be6", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-941c1be6", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 341 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _regenerator = __webpack_require__(342);
|
||
|
||
var _regenerator2 = _interopRequireDefault(_regenerator);
|
||
|
||
var _asyncToGenerator2 = __webpack_require__(345);
|
||
|
||
var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
var _elementResizeEvent = __webpack_require__(133);
|
||
|
||
var _elementResizeEvent2 = _interopRequireDefault(_elementResizeEvent);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
components: {
|
||
Icon: _icon2.default
|
||
},
|
||
props: {
|
||
title: {
|
||
type: String,
|
||
required: true
|
||
},
|
||
subTitle: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
width: {
|
||
type: [Number, String],
|
||
default: 400
|
||
},
|
||
closeOnClickShadow: {
|
||
type: Boolean,
|
||
default: true
|
||
},
|
||
canFullScreen: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
disableEsc: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
beforeClose: {
|
||
type: Function,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
isShow: false,
|
||
isScroll: false,
|
||
isFullScreen: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getStyle: function getStyle() {
|
||
if (this.width) {
|
||
return {
|
||
width: this.width + 'px'
|
||
};
|
||
}
|
||
return {};
|
||
}
|
||
},
|
||
watch: {
|
||
isShow: function isShow() {
|
||
var _this = this;
|
||
|
||
var body = document.body;
|
||
if (this.isShow) {
|
||
// 必须这样,要不然,这个点击事件会触发
|
||
if (this.closeOnClickShadow) {
|
||
setTimeout(function () {
|
||
_this.$el.addEventListener('click', _this.clickFn, false);
|
||
}, 0);
|
||
}
|
||
util.addClass(body, 'ui-modal-open');
|
||
|
||
// 当modal中的内容超出整个屏幕时,modal-dialog用absolute定位不能撑开滚动,导致看不全,需要特殊处理
|
||
this.$nextTick(this.computeScroll);
|
||
} else {
|
||
util.removeClass(body, 'ui-modal-open');
|
||
if (this.closeOnClickShadow) {
|
||
this.$el.removeEventListener('click', this.clickFn);
|
||
}
|
||
}
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
// 监听esc
|
||
document.addEventListener('keydown', this.esc, false);
|
||
(0, _elementResizeEvent2.default)(this.$refs.dialog, this.computeScroll);
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
document.removeEventListener('keydown', this.esc);
|
||
_elementResizeEvent2.default.unbind(this.$refs.dialog);
|
||
},
|
||
|
||
methods: {
|
||
computeScroll: function computeScroll() {
|
||
var bodyHeight = window.innerHeight;
|
||
var dialogElemStyle = window.getComputedStyle(this.$refs.dialog, null);
|
||
var height = /^([0-9]*)/.exec(dialogElemStyle.height)[0];
|
||
if (height > bodyHeight - 50) {
|
||
this.isScroll = true;
|
||
} else {
|
||
this.isScroll = false;
|
||
}
|
||
},
|
||
esc: function esc(event) {
|
||
// 禁止esc键
|
||
if (this.disableEsc) return;
|
||
var which = event.which || event.keyCode;
|
||
|
||
if (this.isShow && which == 27) {
|
||
// 若modal已全屏,esc先取消全屏
|
||
if (this.isFullScreen) {
|
||
return this.fullScreen();
|
||
}
|
||
this.handleClose();
|
||
}
|
||
},
|
||
clickFn: function clickFn(event) {
|
||
if (event.target === this.$el && this.isShow) {
|
||
this.handleClose();
|
||
}
|
||
},
|
||
handleClose: function handleClose() {
|
||
var _this2 = this;
|
||
|
||
return (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
|
||
var close;
|
||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||
while (1) {
|
||
switch (_context.prev = _context.next) {
|
||
case 0:
|
||
// beforeClose 关闭前钩子函数,可以返回promise
|
||
close = true;
|
||
|
||
if (!_this2.beforeClose) {
|
||
_context.next = 11;
|
||
break;
|
||
}
|
||
|
||
_context.prev = 2;
|
||
_context.next = 5;
|
||
return _this2.beforeClose({ isFullScreen: _this2.isFullScreen });
|
||
|
||
case 5:
|
||
close = _context.sent;
|
||
_context.next = 11;
|
||
break;
|
||
|
||
case 8:
|
||
_context.prev = 8;
|
||
_context.t0 = _context['catch'](2);
|
||
|
||
close = false;
|
||
|
||
case 11:
|
||
if (close) {
|
||
_this2.close();
|
||
}
|
||
|
||
case 12:
|
||
case 'end':
|
||
return _context.stop();
|
||
}
|
||
}
|
||
}, _callee, _this2, [[2, 8]]);
|
||
}))();
|
||
},
|
||
close: function close() {
|
||
this.isShow = false;
|
||
this.$emit('on-close');
|
||
},
|
||
hide: function hide() {
|
||
this.handleClose();
|
||
},
|
||
scroll: function scroll(event) {
|
||
this.$emit('on-scroll', event);
|
||
},
|
||
show: function show() {
|
||
this.isShow = true;
|
||
},
|
||
fullScreen: function fullScreen() {
|
||
this.isFullScreen = !this.isFullScreen;
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 342 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = __webpack_require__(343);
|
||
|
||
|
||
/***/ }),
|
||
/* 343 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
/**
|
||
* Copyright (c) 2014-present, Facebook, Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/
|
||
|
||
// This method of obtaining a reference to the global object needs to be
|
||
// kept identical to the way it is obtained in runtime.js
|
||
var g = (function() { return this })() || Function("return this")();
|
||
|
||
// Use `getOwnPropertyNames` because not all browsers support calling
|
||
// `hasOwnProperty` on the global `self` object in a worker. See #183.
|
||
var hadRuntime = g.regeneratorRuntime &&
|
||
Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
|
||
|
||
// Save the old regeneratorRuntime in case it needs to be restored later.
|
||
var oldRuntime = hadRuntime && g.regeneratorRuntime;
|
||
|
||
// Force reevalutation of runtime.js.
|
||
g.regeneratorRuntime = undefined;
|
||
|
||
module.exports = __webpack_require__(344);
|
||
|
||
if (hadRuntime) {
|
||
// Restore the original runtime.
|
||
g.regeneratorRuntime = oldRuntime;
|
||
} else {
|
||
// Remove the global property added by runtime.js.
|
||
try {
|
||
delete g.regeneratorRuntime;
|
||
} catch(e) {
|
||
g.regeneratorRuntime = undefined;
|
||
}
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
/* 344 */
|
||
/***/ (function(module, exports) {
|
||
|
||
/**
|
||
* Copyright (c) 2014-present, Facebook, Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/
|
||
|
||
!(function(global) {
|
||
"use strict";
|
||
|
||
var Op = Object.prototype;
|
||
var hasOwn = Op.hasOwnProperty;
|
||
var undefined; // More compressible than void 0.
|
||
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
||
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
||
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
||
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
||
|
||
var inModule = typeof module === "object";
|
||
var runtime = global.regeneratorRuntime;
|
||
if (runtime) {
|
||
if (inModule) {
|
||
// If regeneratorRuntime is defined globally and we're in a module,
|
||
// make the exports object identical to regeneratorRuntime.
|
||
module.exports = runtime;
|
||
}
|
||
// Don't bother evaluating the rest of this file if the runtime was
|
||
// already defined globally.
|
||
return;
|
||
}
|
||
|
||
// Define the runtime globally (as expected by generated code) as either
|
||
// module.exports (if we're in a module) or a new, empty object.
|
||
runtime = global.regeneratorRuntime = inModule ? module.exports : {};
|
||
|
||
function wrap(innerFn, outerFn, self, tryLocsList) {
|
||
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
||
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
||
var generator = Object.create(protoGenerator.prototype);
|
||
var context = new Context(tryLocsList || []);
|
||
|
||
// The ._invoke method unifies the implementations of the .next,
|
||
// .throw, and .return methods.
|
||
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
||
|
||
return generator;
|
||
}
|
||
runtime.wrap = wrap;
|
||
|
||
// Try/catch helper to minimize deoptimizations. Returns a completion
|
||
// record like context.tryEntries[i].completion. This interface could
|
||
// have been (and was previously) designed to take a closure to be
|
||
// invoked without arguments, but in all the cases we care about we
|
||
// already have an existing method we want to call, so there's no need
|
||
// to create a new function object. We can even get away with assuming
|
||
// the method takes exactly one argument, since that happens to be true
|
||
// in every case, so we don't have to touch the arguments object. The
|
||
// only additional allocation required is the completion record, which
|
||
// has a stable shape and so hopefully should be cheap to allocate.
|
||
function tryCatch(fn, obj, arg) {
|
||
try {
|
||
return { type: "normal", arg: fn.call(obj, arg) };
|
||
} catch (err) {
|
||
return { type: "throw", arg: err };
|
||
}
|
||
}
|
||
|
||
var GenStateSuspendedStart = "suspendedStart";
|
||
var GenStateSuspendedYield = "suspendedYield";
|
||
var GenStateExecuting = "executing";
|
||
var GenStateCompleted = "completed";
|
||
|
||
// Returning this object from the innerFn has the same effect as
|
||
// breaking out of the dispatch switch statement.
|
||
var ContinueSentinel = {};
|
||
|
||
// Dummy constructor functions that we use as the .constructor and
|
||
// .constructor.prototype properties for functions that return Generator
|
||
// objects. For full spec compliance, you may wish to configure your
|
||
// minifier not to mangle the names of these two functions.
|
||
function Generator() {}
|
||
function GeneratorFunction() {}
|
||
function GeneratorFunctionPrototype() {}
|
||
|
||
// This is a polyfill for %IteratorPrototype% for environments that
|
||
// don't natively support it.
|
||
var IteratorPrototype = {};
|
||
IteratorPrototype[iteratorSymbol] = function () {
|
||
return this;
|
||
};
|
||
|
||
var getProto = Object.getPrototypeOf;
|
||
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
||
if (NativeIteratorPrototype &&
|
||
NativeIteratorPrototype !== Op &&
|
||
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
||
// This environment has a native %IteratorPrototype%; use it instead
|
||
// of the polyfill.
|
||
IteratorPrototype = NativeIteratorPrototype;
|
||
}
|
||
|
||
var Gp = GeneratorFunctionPrototype.prototype =
|
||
Generator.prototype = Object.create(IteratorPrototype);
|
||
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
||
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
||
GeneratorFunctionPrototype[toStringTagSymbol] =
|
||
GeneratorFunction.displayName = "GeneratorFunction";
|
||
|
||
// Helper for defining the .next, .throw, and .return methods of the
|
||
// Iterator interface in terms of a single ._invoke method.
|
||
function defineIteratorMethods(prototype) {
|
||
["next", "throw", "return"].forEach(function(method) {
|
||
prototype[method] = function(arg) {
|
||
return this._invoke(method, arg);
|
||
};
|
||
});
|
||
}
|
||
|
||
runtime.isGeneratorFunction = function(genFun) {
|
||
var ctor = typeof genFun === "function" && genFun.constructor;
|
||
return ctor
|
||
? ctor === GeneratorFunction ||
|
||
// For the native GeneratorFunction constructor, the best we can
|
||
// do is to check its .name property.
|
||
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
||
: false;
|
||
};
|
||
|
||
runtime.mark = function(genFun) {
|
||
if (Object.setPrototypeOf) {
|
||
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
||
} else {
|
||
genFun.__proto__ = GeneratorFunctionPrototype;
|
||
if (!(toStringTagSymbol in genFun)) {
|
||
genFun[toStringTagSymbol] = "GeneratorFunction";
|
||
}
|
||
}
|
||
genFun.prototype = Object.create(Gp);
|
||
return genFun;
|
||
};
|
||
|
||
// Within the body of any async function, `await x` is transformed to
|
||
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
||
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
||
// meant to be awaited.
|
||
runtime.awrap = function(arg) {
|
||
return { __await: arg };
|
||
};
|
||
|
||
function AsyncIterator(generator) {
|
||
function invoke(method, arg, resolve, reject) {
|
||
var record = tryCatch(generator[method], generator, arg);
|
||
if (record.type === "throw") {
|
||
reject(record.arg);
|
||
} else {
|
||
var result = record.arg;
|
||
var value = result.value;
|
||
if (value &&
|
||
typeof value === "object" &&
|
||
hasOwn.call(value, "__await")) {
|
||
return Promise.resolve(value.__await).then(function(value) {
|
||
invoke("next", value, resolve, reject);
|
||
}, function(err) {
|
||
invoke("throw", err, resolve, reject);
|
||
});
|
||
}
|
||
|
||
return Promise.resolve(value).then(function(unwrapped) {
|
||
// When a yielded Promise is resolved, its final value becomes
|
||
// the .value of the Promise<{value,done}> result for the
|
||
// current iteration. If the Promise is rejected, however, the
|
||
// result for this iteration will be rejected with the same
|
||
// reason. Note that rejections of yielded Promises are not
|
||
// thrown back into the generator function, as is the case
|
||
// when an awaited Promise is rejected. This difference in
|
||
// behavior between yield and await is important, because it
|
||
// allows the consumer to decide what to do with the yielded
|
||
// rejection (swallow it and continue, manually .throw it back
|
||
// into the generator, abandon iteration, whatever). With
|
||
// await, by contrast, there is no opportunity to examine the
|
||
// rejection reason outside the generator function, so the
|
||
// only option is to throw it from the await expression, and
|
||
// let the generator function handle the exception.
|
||
result.value = unwrapped;
|
||
resolve(result);
|
||
}, reject);
|
||
}
|
||
}
|
||
|
||
var previousPromise;
|
||
|
||
function enqueue(method, arg) {
|
||
function callInvokeWithMethodAndArg() {
|
||
return new Promise(function(resolve, reject) {
|
||
invoke(method, arg, resolve, reject);
|
||
});
|
||
}
|
||
|
||
return previousPromise =
|
||
// If enqueue has been called before, then we want to wait until
|
||
// all previous Promises have been resolved before calling invoke,
|
||
// so that results are always delivered in the correct order. If
|
||
// enqueue has not been called before, then it is important to
|
||
// call invoke immediately, without waiting on a callback to fire,
|
||
// so that the async generator function has the opportunity to do
|
||
// any necessary setup in a predictable way. This predictability
|
||
// is why the Promise constructor synchronously invokes its
|
||
// executor callback, and why async functions synchronously
|
||
// execute code before the first await. Since we implement simple
|
||
// async functions in terms of async generators, it is especially
|
||
// important to get this right, even though it requires care.
|
||
previousPromise ? previousPromise.then(
|
||
callInvokeWithMethodAndArg,
|
||
// Avoid propagating failures to Promises returned by later
|
||
// invocations of the iterator.
|
||
callInvokeWithMethodAndArg
|
||
) : callInvokeWithMethodAndArg();
|
||
}
|
||
|
||
// Define the unified helper method that is used to implement .next,
|
||
// .throw, and .return (see defineIteratorMethods).
|
||
this._invoke = enqueue;
|
||
}
|
||
|
||
defineIteratorMethods(AsyncIterator.prototype);
|
||
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
||
return this;
|
||
};
|
||
runtime.AsyncIterator = AsyncIterator;
|
||
|
||
// Note that simple async functions are implemented on top of
|
||
// AsyncIterator objects; they just return a Promise for the value of
|
||
// the final result produced by the iterator.
|
||
runtime.async = function(innerFn, outerFn, self, tryLocsList) {
|
||
var iter = new AsyncIterator(
|
||
wrap(innerFn, outerFn, self, tryLocsList)
|
||
);
|
||
|
||
return runtime.isGeneratorFunction(outerFn)
|
||
? iter // If outerFn is a generator, return the full iterator.
|
||
: iter.next().then(function(result) {
|
||
return result.done ? result.value : iter.next();
|
||
});
|
||
};
|
||
|
||
function makeInvokeMethod(innerFn, self, context) {
|
||
var state = GenStateSuspendedStart;
|
||
|
||
return function invoke(method, arg) {
|
||
if (state === GenStateExecuting) {
|
||
throw new Error("Generator is already running");
|
||
}
|
||
|
||
if (state === GenStateCompleted) {
|
||
if (method === "throw") {
|
||
throw arg;
|
||
}
|
||
|
||
// Be forgiving, per 25.3.3.3.3 of the spec:
|
||
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
||
return doneResult();
|
||
}
|
||
|
||
context.method = method;
|
||
context.arg = arg;
|
||
|
||
while (true) {
|
||
var delegate = context.delegate;
|
||
if (delegate) {
|
||
var delegateResult = maybeInvokeDelegate(delegate, context);
|
||
if (delegateResult) {
|
||
if (delegateResult === ContinueSentinel) continue;
|
||
return delegateResult;
|
||
}
|
||
}
|
||
|
||
if (context.method === "next") {
|
||
// Setting context._sent for legacy support of Babel's
|
||
// function.sent implementation.
|
||
context.sent = context._sent = context.arg;
|
||
|
||
} else if (context.method === "throw") {
|
||
if (state === GenStateSuspendedStart) {
|
||
state = GenStateCompleted;
|
||
throw context.arg;
|
||
}
|
||
|
||
context.dispatchException(context.arg);
|
||
|
||
} else if (context.method === "return") {
|
||
context.abrupt("return", context.arg);
|
||
}
|
||
|
||
state = GenStateExecuting;
|
||
|
||
var record = tryCatch(innerFn, self, context);
|
||
if (record.type === "normal") {
|
||
// If an exception is thrown from innerFn, we leave state ===
|
||
// GenStateExecuting and loop back for another invocation.
|
||
state = context.done
|
||
? GenStateCompleted
|
||
: GenStateSuspendedYield;
|
||
|
||
if (record.arg === ContinueSentinel) {
|
||
continue;
|
||
}
|
||
|
||
return {
|
||
value: record.arg,
|
||
done: context.done
|
||
};
|
||
|
||
} else if (record.type === "throw") {
|
||
state = GenStateCompleted;
|
||
// Dispatch the exception by looping back around to the
|
||
// context.dispatchException(context.arg) call above.
|
||
context.method = "throw";
|
||
context.arg = record.arg;
|
||
}
|
||
}
|
||
};
|
||
}
|
||
|
||
// Call delegate.iterator[context.method](context.arg) and handle the
|
||
// result, either by returning a { value, done } result from the
|
||
// delegate iterator, or by modifying context.method and context.arg,
|
||
// setting context.delegate to null, and returning the ContinueSentinel.
|
||
function maybeInvokeDelegate(delegate, context) {
|
||
var method = delegate.iterator[context.method];
|
||
if (method === undefined) {
|
||
// A .throw or .return when the delegate iterator has no .throw
|
||
// method always terminates the yield* loop.
|
||
context.delegate = null;
|
||
|
||
if (context.method === "throw") {
|
||
if (delegate.iterator.return) {
|
||
// If the delegate iterator has a return method, give it a
|
||
// chance to clean up.
|
||
context.method = "return";
|
||
context.arg = undefined;
|
||
maybeInvokeDelegate(delegate, context);
|
||
|
||
if (context.method === "throw") {
|
||
// If maybeInvokeDelegate(context) changed context.method from
|
||
// "return" to "throw", let that override the TypeError below.
|
||
return ContinueSentinel;
|
||
}
|
||
}
|
||
|
||
context.method = "throw";
|
||
context.arg = new TypeError(
|
||
"The iterator does not provide a 'throw' method");
|
||
}
|
||
|
||
return ContinueSentinel;
|
||
}
|
||
|
||
var record = tryCatch(method, delegate.iterator, context.arg);
|
||
|
||
if (record.type === "throw") {
|
||
context.method = "throw";
|
||
context.arg = record.arg;
|
||
context.delegate = null;
|
||
return ContinueSentinel;
|
||
}
|
||
|
||
var info = record.arg;
|
||
|
||
if (! info) {
|
||
context.method = "throw";
|
||
context.arg = new TypeError("iterator result is not an object");
|
||
context.delegate = null;
|
||
return ContinueSentinel;
|
||
}
|
||
|
||
if (info.done) {
|
||
// Assign the result of the finished delegate to the temporary
|
||
// variable specified by delegate.resultName (see delegateYield).
|
||
context[delegate.resultName] = info.value;
|
||
|
||
// Resume execution at the desired location (see delegateYield).
|
||
context.next = delegate.nextLoc;
|
||
|
||
// If context.method was "throw" but the delegate handled the
|
||
// exception, let the outer generator proceed normally. If
|
||
// context.method was "next", forget context.arg since it has been
|
||
// "consumed" by the delegate iterator. If context.method was
|
||
// "return", allow the original .return call to continue in the
|
||
// outer generator.
|
||
if (context.method !== "return") {
|
||
context.method = "next";
|
||
context.arg = undefined;
|
||
}
|
||
|
||
} else {
|
||
// Re-yield the result returned by the delegate method.
|
||
return info;
|
||
}
|
||
|
||
// The delegate iterator is finished, so forget it and continue with
|
||
// the outer generator.
|
||
context.delegate = null;
|
||
return ContinueSentinel;
|
||
}
|
||
|
||
// Define Generator.prototype.{next,throw,return} in terms of the
|
||
// unified ._invoke helper method.
|
||
defineIteratorMethods(Gp);
|
||
|
||
Gp[toStringTagSymbol] = "Generator";
|
||
|
||
// A Generator should always return itself as the iterator object when the
|
||
// @@iterator function is called on it. Some browsers' implementations of the
|
||
// iterator prototype chain incorrectly implement this, causing the Generator
|
||
// object to not be returned from this call. This ensures that doesn't happen.
|
||
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
||
Gp[iteratorSymbol] = function() {
|
||
return this;
|
||
};
|
||
|
||
Gp.toString = function() {
|
||
return "[object Generator]";
|
||
};
|
||
|
||
function pushTryEntry(locs) {
|
||
var entry = { tryLoc: locs[0] };
|
||
|
||
if (1 in locs) {
|
||
entry.catchLoc = locs[1];
|
||
}
|
||
|
||
if (2 in locs) {
|
||
entry.finallyLoc = locs[2];
|
||
entry.afterLoc = locs[3];
|
||
}
|
||
|
||
this.tryEntries.push(entry);
|
||
}
|
||
|
||
function resetTryEntry(entry) {
|
||
var record = entry.completion || {};
|
||
record.type = "normal";
|
||
delete record.arg;
|
||
entry.completion = record;
|
||
}
|
||
|
||
function Context(tryLocsList) {
|
||
// The root entry object (effectively a try statement without a catch
|
||
// or a finally block) gives us a place to store values thrown from
|
||
// locations where there is no enclosing try statement.
|
||
this.tryEntries = [{ tryLoc: "root" }];
|
||
tryLocsList.forEach(pushTryEntry, this);
|
||
this.reset(true);
|
||
}
|
||
|
||
runtime.keys = function(object) {
|
||
var keys = [];
|
||
for (var key in object) {
|
||
keys.push(key);
|
||
}
|
||
keys.reverse();
|
||
|
||
// Rather than returning an object with a next method, we keep
|
||
// things simple and return the next function itself.
|
||
return function next() {
|
||
while (keys.length) {
|
||
var key = keys.pop();
|
||
if (key in object) {
|
||
next.value = key;
|
||
next.done = false;
|
||
return next;
|
||
}
|
||
}
|
||
|
||
// To avoid creating an additional object, we just hang the .value
|
||
// and .done properties off the next function object itself. This
|
||
// also ensures that the minifier will not anonymize the function.
|
||
next.done = true;
|
||
return next;
|
||
};
|
||
};
|
||
|
||
function values(iterable) {
|
||
if (iterable) {
|
||
var iteratorMethod = iterable[iteratorSymbol];
|
||
if (iteratorMethod) {
|
||
return iteratorMethod.call(iterable);
|
||
}
|
||
|
||
if (typeof iterable.next === "function") {
|
||
return iterable;
|
||
}
|
||
|
||
if (!isNaN(iterable.length)) {
|
||
var i = -1, next = function next() {
|
||
while (++i < iterable.length) {
|
||
if (hasOwn.call(iterable, i)) {
|
||
next.value = iterable[i];
|
||
next.done = false;
|
||
return next;
|
||
}
|
||
}
|
||
|
||
next.value = undefined;
|
||
next.done = true;
|
||
|
||
return next;
|
||
};
|
||
|
||
return next.next = next;
|
||
}
|
||
}
|
||
|
||
// Return an iterator with no values.
|
||
return { next: doneResult };
|
||
}
|
||
runtime.values = values;
|
||
|
||
function doneResult() {
|
||
return { value: undefined, done: true };
|
||
}
|
||
|
||
Context.prototype = {
|
||
constructor: Context,
|
||
|
||
reset: function(skipTempReset) {
|
||
this.prev = 0;
|
||
this.next = 0;
|
||
// Resetting context._sent for legacy support of Babel's
|
||
// function.sent implementation.
|
||
this.sent = this._sent = undefined;
|
||
this.done = false;
|
||
this.delegate = null;
|
||
|
||
this.method = "next";
|
||
this.arg = undefined;
|
||
|
||
this.tryEntries.forEach(resetTryEntry);
|
||
|
||
if (!skipTempReset) {
|
||
for (var name in this) {
|
||
// Not sure about the optimal order of these conditions:
|
||
if (name.charAt(0) === "t" &&
|
||
hasOwn.call(this, name) &&
|
||
!isNaN(+name.slice(1))) {
|
||
this[name] = undefined;
|
||
}
|
||
}
|
||
}
|
||
},
|
||
|
||
stop: function() {
|
||
this.done = true;
|
||
|
||
var rootEntry = this.tryEntries[0];
|
||
var rootRecord = rootEntry.completion;
|
||
if (rootRecord.type === "throw") {
|
||
throw rootRecord.arg;
|
||
}
|
||
|
||
return this.rval;
|
||
},
|
||
|
||
dispatchException: function(exception) {
|
||
if (this.done) {
|
||
throw exception;
|
||
}
|
||
|
||
var context = this;
|
||
function handle(loc, caught) {
|
||
record.type = "throw";
|
||
record.arg = exception;
|
||
context.next = loc;
|
||
|
||
if (caught) {
|
||
// If the dispatched exception was caught by a catch block,
|
||
// then let that catch block handle the exception normally.
|
||
context.method = "next";
|
||
context.arg = undefined;
|
||
}
|
||
|
||
return !! caught;
|
||
}
|
||
|
||
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
||
var entry = this.tryEntries[i];
|
||
var record = entry.completion;
|
||
|
||
if (entry.tryLoc === "root") {
|
||
// Exception thrown outside of any try block that could handle
|
||
// it, so set the completion value of the entire function to
|
||
// throw the exception.
|
||
return handle("end");
|
||
}
|
||
|
||
if (entry.tryLoc <= this.prev) {
|
||
var hasCatch = hasOwn.call(entry, "catchLoc");
|
||
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
||
|
||
if (hasCatch && hasFinally) {
|
||
if (this.prev < entry.catchLoc) {
|
||
return handle(entry.catchLoc, true);
|
||
} else if (this.prev < entry.finallyLoc) {
|
||
return handle(entry.finallyLoc);
|
||
}
|
||
|
||
} else if (hasCatch) {
|
||
if (this.prev < entry.catchLoc) {
|
||
return handle(entry.catchLoc, true);
|
||
}
|
||
|
||
} else if (hasFinally) {
|
||
if (this.prev < entry.finallyLoc) {
|
||
return handle(entry.finallyLoc);
|
||
}
|
||
|
||
} else {
|
||
throw new Error("try statement without catch or finally");
|
||
}
|
||
}
|
||
}
|
||
},
|
||
|
||
abrupt: function(type, arg) {
|
||
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
||
var entry = this.tryEntries[i];
|
||
if (entry.tryLoc <= this.prev &&
|
||
hasOwn.call(entry, "finallyLoc") &&
|
||
this.prev < entry.finallyLoc) {
|
||
var finallyEntry = entry;
|
||
break;
|
||
}
|
||
}
|
||
|
||
if (finallyEntry &&
|
||
(type === "break" ||
|
||
type === "continue") &&
|
||
finallyEntry.tryLoc <= arg &&
|
||
arg <= finallyEntry.finallyLoc) {
|
||
// Ignore the finally entry if control is not jumping to a
|
||
// location outside the try/catch block.
|
||
finallyEntry = null;
|
||
}
|
||
|
||
var record = finallyEntry ? finallyEntry.completion : {};
|
||
record.type = type;
|
||
record.arg = arg;
|
||
|
||
if (finallyEntry) {
|
||
this.method = "next";
|
||
this.next = finallyEntry.finallyLoc;
|
||
return ContinueSentinel;
|
||
}
|
||
|
||
return this.complete(record);
|
||
},
|
||
|
||
complete: function(record, afterLoc) {
|
||
if (record.type === "throw") {
|
||
throw record.arg;
|
||
}
|
||
|
||
if (record.type === "break" ||
|
||
record.type === "continue") {
|
||
this.next = record.arg;
|
||
} else if (record.type === "return") {
|
||
this.rval = this.arg = record.arg;
|
||
this.method = "return";
|
||
this.next = "end";
|
||
} else if (record.type === "normal" && afterLoc) {
|
||
this.next = afterLoc;
|
||
}
|
||
|
||
return ContinueSentinel;
|
||
},
|
||
|
||
finish: function(finallyLoc) {
|
||
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
||
var entry = this.tryEntries[i];
|
||
if (entry.finallyLoc === finallyLoc) {
|
||
this.complete(entry.completion, entry.afterLoc);
|
||
resetTryEntry(entry);
|
||
return ContinueSentinel;
|
||
}
|
||
}
|
||
},
|
||
|
||
"catch": function(tryLoc) {
|
||
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
||
var entry = this.tryEntries[i];
|
||
if (entry.tryLoc === tryLoc) {
|
||
var record = entry.completion;
|
||
if (record.type === "throw") {
|
||
var thrown = record.arg;
|
||
resetTryEntry(entry);
|
||
}
|
||
return thrown;
|
||
}
|
||
}
|
||
|
||
// The context.catch method must only be called with a location
|
||
// argument that corresponds to a known catch block.
|
||
throw new Error("illegal catch attempt");
|
||
},
|
||
|
||
delegateYield: function(iterable, resultName, nextLoc) {
|
||
this.delegate = {
|
||
iterator: values(iterable),
|
||
resultName: resultName,
|
||
nextLoc: nextLoc
|
||
};
|
||
|
||
if (this.method === "next") {
|
||
// Deliberately forget the last sent value so that we don't
|
||
// accidentally pass it on to the delegate.
|
||
this.arg = undefined;
|
||
}
|
||
|
||
return ContinueSentinel;
|
||
}
|
||
};
|
||
})(
|
||
// In sloppy mode, unbound `this` refers to the global object, fallback to
|
||
// Function constructor if we're in global strict mode. That is sadly a form
|
||
// of indirect eval which violates Content Security Policy.
|
||
(function() { return this })() || Function("return this")()
|
||
);
|
||
|
||
|
||
/***/ }),
|
||
/* 345 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
exports.__esModule = true;
|
||
|
||
var _promise = __webpack_require__(43);
|
||
|
||
var _promise2 = _interopRequireDefault(_promise);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = function (fn) {
|
||
return function () {
|
||
var gen = fn.apply(this, arguments);
|
||
return new _promise2.default(function (resolve, reject) {
|
||
function step(key, arg) {
|
||
try {
|
||
var info = gen[key](arg);
|
||
var value = info.value;
|
||
} catch (error) {
|
||
reject(error);
|
||
return;
|
||
}
|
||
|
||
if (info.done) {
|
||
resolve(value);
|
||
} else {
|
||
return _promise2.default.resolve(value).then(function (value) {
|
||
step("next", value);
|
||
}, function (err) {
|
||
step("throw", err);
|
||
});
|
||
}
|
||
}
|
||
|
||
return step("next");
|
||
});
|
||
};
|
||
};
|
||
|
||
/***/ }),
|
||
/* 346 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.isShow),
|
||
expression: "isShow"
|
||
}],
|
||
staticClass: "ui-modal",
|
||
class: {
|
||
scroll: _vm.isScroll, 'full-screen': _vm.isFullScreen
|
||
},
|
||
on: {
|
||
"scroll": _vm.scroll
|
||
}
|
||
}, [_c('div', {
|
||
ref: "dialog",
|
||
staticClass: "ui-modal-dialog"
|
||
}, [_c('div', {
|
||
staticClass: "ui-modal-title"
|
||
}, [_c('span', {
|
||
staticClass: "ui-modal-title-main"
|
||
}, [_vm._v("\n " + _vm._s(_vm.title) + "\n ")]), _vm._v(" "), _c('span', {
|
||
staticClass: "ui-modal-title-sub"
|
||
}, [_vm._v("\n " + _vm._s(_vm.subTitle) + "\n ")]), _vm._v(" "), _c('Icon', {
|
||
attrs: {
|
||
"type": "md-close"
|
||
},
|
||
on: {
|
||
"click": _vm.handleClose
|
||
}
|
||
}), _vm._v(" "), (_vm.canFullScreen) ? _c('Icon', {
|
||
attrs: {
|
||
"type": "md-resize"
|
||
},
|
||
on: {
|
||
"click": _vm.fullScreen
|
||
}
|
||
}) : _vm._e()], 1), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-modal-body",
|
||
style: (_vm.getStyle)
|
||
}, [_vm._t("default")], 2)])])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-941c1be6", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 347 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _switch = __webpack_require__(348);
|
||
|
||
var _switch2 = _interopRequireDefault(_switch);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _switch2.default;
|
||
|
||
/***/ }),
|
||
/* 348 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(349),
|
||
/* template */
|
||
__webpack_require__(350),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/switch/switch.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] switch.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-65d2119e", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-65d2119e", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 349 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _keyCode = __webpack_require__(19);
|
||
|
||
var _keyCode2 = _interopRequireDefault(_keyCode);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'WbSwitch',
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
value: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
readonly: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
confirm: {
|
||
type: Function,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
currentValue: this.value
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getClass: function getClass() {
|
||
var classes = {
|
||
'ui-switch-on': this.currentValue,
|
||
'ui-switch-off': !this.currentValue,
|
||
'ui-switch-readonly': this.readonly,
|
||
'ui-switch-disabled': this.disabled
|
||
};
|
||
return classes;
|
||
}
|
||
},
|
||
watch: {
|
||
value: function value(val) {
|
||
this.currentValue = val;
|
||
}
|
||
},
|
||
methods: {
|
||
toggle: function toggle() {
|
||
var _this = this;
|
||
|
||
if (this.disabled || this.readonly) return;
|
||
if (this.confirm) {
|
||
this.confirm(this.currentValue).then(function () {
|
||
_this.currentValue = !_this.currentValue;
|
||
_this.$emit('input', _this.currentValue);
|
||
_this.$emit('on-change', _this.currentValue);
|
||
_this.dispatch('FormItem', 'on-form-change', [_this.currentValue]);
|
||
});
|
||
} else {
|
||
this.currentValue = !this.currentValue;
|
||
this.$emit('input', this.currentValue);
|
||
this.$emit('on-change', this.currentValue);
|
||
this.dispatch('FormItem', 'on-form-change', [this.currentValue]);
|
||
}
|
||
},
|
||
keydown: function keydown(e) {
|
||
if (this.disabled || this.readonly) return;
|
||
if (e.keyCode == _keyCode2.default.ENTER || e.keyCode == _keyCode2.default.MAC_ENTER || e.keyCode == _keyCode2.default.SPACE) {
|
||
e.preventDefault();
|
||
this.toggle();
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 350 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-switch",
|
||
class: _vm.getClass,
|
||
attrs: {
|
||
"tabindex": "0"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.toggle($event)
|
||
},
|
||
"keydown": _vm.keydown
|
||
}
|
||
}, [_c('div', {
|
||
staticClass: "ui-switch-circle"
|
||
}), _vm._v(" "), (_vm.currentValue) ? _vm._t("open") : _vm._t("close")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-65d2119e", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 351 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(352),
|
||
/* template */
|
||
__webpack_require__(353),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/toast/toast.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] toast.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-1f604b81", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-1f604b81", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 352 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'Toast',
|
||
components: {
|
||
Icon: _icon2.default
|
||
},
|
||
props: {
|
||
message: {
|
||
type: [String, Number],
|
||
default: undefined
|
||
},
|
||
type: {
|
||
type: String,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
icons: {
|
||
info: 'md-information-circle',
|
||
warn: 'md-alert',
|
||
error: 'md-close-circle',
|
||
success: 'md-checkmark-circle'
|
||
}
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getType: function getType() {
|
||
if (this.type) {
|
||
return this.icons[this.type];
|
||
}
|
||
return '';
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 353 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-toast-parent"
|
||
}, [_c('div', {
|
||
staticClass: "ui-toast",
|
||
class: 'ui-toast-' + _vm.type
|
||
}, [(_vm.getType) ? _c('Icon', {
|
||
attrs: {
|
||
"type": _vm.getType
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.message))])], 1)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-1f604b81", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 354 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(355),
|
||
/* template */
|
||
__webpack_require__(356),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/toast/swap.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] swap.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-b9b8f7ae", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-b9b8f7ae", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 355 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'ToastSwap',
|
||
props: {
|
||
align: {
|
||
type: String,
|
||
default: 'center'
|
||
}
|
||
},
|
||
computed: {
|
||
getClass: function getClass() {
|
||
return 'ui-toast-swap-' + this.align;
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 356 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-toast-swap",
|
||
class: _vm.getClass
|
||
})
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-b9b8f7ae", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 357 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _tree = __webpack_require__(358);
|
||
|
||
var _tree2 = _interopRequireDefault(_tree);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _tree2.default;
|
||
|
||
/***/ }),
|
||
/* 358 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(359),
|
||
/* template */
|
||
__webpack_require__(365),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tree/tree.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] tree.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-aec8bd9e", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-aec8bd9e", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 359 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _assign = __webpack_require__(49);
|
||
|
||
var _assign2 = _interopRequireDefault(_assign);
|
||
|
||
var _getIterator2 = __webpack_require__(116);
|
||
|
||
var _getIterator3 = _interopRequireDefault(_getIterator2);
|
||
|
||
var _treeNode = __webpack_require__(360);
|
||
|
||
var _treeNode2 = _interopRequireDefault(_treeNode);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
var key = 1; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Tree',
|
||
components: {
|
||
treeNode: _treeNode2.default
|
||
},
|
||
props: {
|
||
inline: {
|
||
type: Boolean,
|
||
default: true
|
||
},
|
||
multiple: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
data: {
|
||
type: Array,
|
||
default: undefined
|
||
},
|
||
loadData: {
|
||
type: Function,
|
||
default: null
|
||
},
|
||
// 二次点击时,是否继续保持选中状态
|
||
twiceClickSelected: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
selectedNode: null,
|
||
root: {
|
||
children: []
|
||
}
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getClass: function getClass() {
|
||
var arr = [];
|
||
if (this.inline) {
|
||
arr.push('ui-tree-inline');
|
||
}
|
||
return arr;
|
||
}
|
||
},
|
||
watch: {
|
||
data: {
|
||
handler: function handler() {
|
||
this.init();
|
||
},
|
||
|
||
deep: true
|
||
}
|
||
},
|
||
created: function created() {
|
||
this.init();
|
||
},
|
||
mounted: function mounted() {
|
||
this.$on('on-node-click', function (node) {
|
||
if (this.selectedNode) {
|
||
this.selectedNode.selected = false;
|
||
}
|
||
if (!this.twiceClickSelected) {
|
||
if (node !== this.selectedNode) {
|
||
node.selected = true;
|
||
this.selectedNode = node;
|
||
} else {
|
||
this.selectedNode = null;
|
||
}
|
||
} else {
|
||
node.selected = true;
|
||
this.selectedNode = node;
|
||
}
|
||
this.$emit('on-select-change', this.selectedNode);
|
||
});
|
||
|
||
this.$on('on-check-click', function (node) {
|
||
if (node.childrenCheckedStatus == '0' || node.childrenCheckedStatus == '1') {
|
||
this.setChild(node, true);
|
||
} else if (node.childrenCheckedStatus == '2') {
|
||
this.setChild(node, false);
|
||
}
|
||
this.setParent(node);
|
||
this.$emit('on-check-change', this.getCheckedNode());
|
||
});
|
||
|
||
this.$on('on-load-data', function (parent, data) {
|
||
this.setLoadData(parent, data);
|
||
this.$emit('on-check-change', this.getCheckedNode());
|
||
});
|
||
},
|
||
|
||
methods: {
|
||
init: function init() {
|
||
var _this = this;
|
||
|
||
this.root.children = [];
|
||
this.data.forEach(function (node) {
|
||
_this.recursion(_this.root.children, node, _this.root);
|
||
});
|
||
},
|
||
setChild: function setChild(node, checked) {
|
||
var _this2 = this;
|
||
|
||
node.checked = checked;
|
||
node.childrenCheckedStatus = checked ? '2' : '0';
|
||
if (node.children && node.children.length > 0) {
|
||
node.children.forEach(function (obj) {
|
||
_this2.setChild(obj, checked);
|
||
});
|
||
}
|
||
},
|
||
setParent: function setParent(node) {
|
||
var parent = node.parent;
|
||
if (parent) {
|
||
parent.checked = parent.children.some(function (obj) {
|
||
return obj.checked;
|
||
});
|
||
var childrenCheckedStatus = void 0;
|
||
if (parent.children.every(function (son) {
|
||
return son.childrenCheckedStatus === '0';
|
||
})) {
|
||
childrenCheckedStatus = '0';
|
||
} else if (parent.children.every(function (son) {
|
||
return son.childrenCheckedStatus === '2';
|
||
})) {
|
||
childrenCheckedStatus = '2';
|
||
} else {
|
||
childrenCheckedStatus = '1';
|
||
}
|
||
parent.childrenCheckedStatus = childrenCheckedStatus;
|
||
this.setParent(parent);
|
||
}
|
||
},
|
||
getCheckedNode: function getCheckedNode(data) {
|
||
data = data || this.root.children;
|
||
var res = [];
|
||
var _iteratorNormalCompletion = true;
|
||
var _didIteratorError = false;
|
||
var _iteratorError = undefined;
|
||
|
||
try {
|
||
for (var _iterator = (0, _getIterator3.default)(data), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||
var node = _step.value;
|
||
|
||
if (node.checked) {
|
||
res.push(node);
|
||
}
|
||
if (node.children && node.children.length) {
|
||
res = res.concat(this.getCheckedNode(node.children));
|
||
}
|
||
}
|
||
} catch (err) {
|
||
_didIteratorError = true;
|
||
_iteratorError = err;
|
||
} finally {
|
||
try {
|
||
if (!_iteratorNormalCompletion && _iterator.return) {
|
||
_iterator.return();
|
||
}
|
||
} finally {
|
||
if (_didIteratorError) {
|
||
throw _iteratorError;
|
||
}
|
||
}
|
||
}
|
||
|
||
return res;
|
||
},
|
||
recursion: function recursion(collection, node, parent) {
|
||
var _this3 = this;
|
||
|
||
var obj = (0, _assign2.default)({}, node, { children: [] });
|
||
this.$set(obj, '_key', key++);
|
||
this.$set(obj, 'parent', parent);
|
||
this.$set(obj, 'expand', node.expand || false);
|
||
// 多选状态下,不存在selected
|
||
this.$set(obj, 'selected', this.multiple ? false : node.selected || false);
|
||
if (node.children && node.children.length > 0) {
|
||
var f = node.children.every(function (item) {
|
||
return !item.children || item.children.length == 0;
|
||
});
|
||
if (f) {
|
||
this.$set(obj, 'onlyDataChild', true);
|
||
}
|
||
this.$set(obj, 'checked', false);
|
||
this.$set(obj, 'childrenCheckedStatus', '0');
|
||
node.children.forEach(function (item) {
|
||
_this3.recursion(obj.children, item, obj);
|
||
});
|
||
var checkedChildren = obj.children.filter(function (item) {
|
||
return item.checked;
|
||
});
|
||
if (checkedChildren.length == obj.children.length) {
|
||
// 如果子项全部选中,则父选中
|
||
obj.childrenCheckedStatus = '2';
|
||
obj.checked = true;
|
||
} else if (checkedChildren.length > 0 && checkedChildren.length < obj.children.length) {
|
||
obj.childrenCheckedStatus = '1';
|
||
}
|
||
} else {
|
||
// 只是子节点,选中的则默认选中
|
||
this.$set(obj, 'checked', node.checked || false);
|
||
this.$set(obj, 'childrenCheckedStatus', node.checked ? '2' : '0');
|
||
if (obj.selected) {
|
||
this.selectedNode = obj;
|
||
}
|
||
}
|
||
collection.push(obj);
|
||
},
|
||
setLoadData: function setLoadData(parent, data) {
|
||
var _this4 = this;
|
||
|
||
if (Array.isArray(data)) {
|
||
data.forEach(function (node) {
|
||
var obj = (0, _assign2.default)({}, node, { children: [] });
|
||
_this4.$set(obj, '_key', key++);
|
||
_this4.$set(obj, 'parent', parent);
|
||
_this4.$set(obj, 'expand', false);
|
||
_this4.$set(obj, 'selected', false);
|
||
// 加载的数据 checked 继承父的状态
|
||
_this4.$set(obj, 'checked', parent.checked);
|
||
_this4.$set(obj, 'childrenCheckedStatus', parent.checked ? '2' : '0');
|
||
if (node.children && node.children.length > 0) {
|
||
_this4.setLoadData(node, node.children);
|
||
}
|
||
parent.children.push(obj);
|
||
});
|
||
}
|
||
},
|
||
addNode: function addNode(parent, node) {
|
||
var obj = (0, _assign2.default)({}, node, { children: [] });
|
||
this.$set(obj, '_key', key++);
|
||
this.$set(obj, 'parent', parent);
|
||
this.$set(obj, 'expand', false);
|
||
this.$set(obj, 'selected', false);
|
||
// 加载的数据 checked 继承父的状态
|
||
this.$set(obj, 'checked', parent.checked);
|
||
this.$set(obj, 'childrenCheckedStatus', parent.checked ? '2' : '0');
|
||
parent.children.push(obj);
|
||
},
|
||
removeNode: function removeNode(node) {
|
||
if (node.parent) {
|
||
var parent = node.parent;
|
||
node.parent = null;
|
||
var index = parent.children.indexOf(node);
|
||
if (index != -1) {
|
||
parent.children.splice(index, 1);
|
||
var _node = parent.children.length > 0 ? parent.children[0] : parent;
|
||
this.setParent(_node);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 360 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(361),
|
||
/* template */
|
||
__webpack_require__(364),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tree/treeNode.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] treeNode.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-2f83edd3", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-2f83edd3", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 361 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var _loading = __webpack_require__(123);
|
||
|
||
var _loading2 = _interopRequireDefault(_loading);
|
||
|
||
var _nodeText = __webpack_require__(362);
|
||
|
||
var _nodeText2 = _interopRequireDefault(_nodeText);
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'TreeNode',
|
||
components: {
|
||
Icon: _icon2.default,
|
||
loading: _loading2.default,
|
||
nodeText: _nodeText2.default
|
||
},
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
multiple: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
parentNode: { // 上级节点
|
||
type: Object,
|
||
default: undefined
|
||
},
|
||
node: { // 本节点
|
||
type: Object,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
rootTree: (0, _util.findComponentUpward)(this, 'Tree'),
|
||
dataLoading: false,
|
||
dataLoaded: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getClass: function getClass() {
|
||
var arr = ['ui-tree', 'ui-child-tree'];
|
||
if (this.node.onlyDataChild) {
|
||
arr.push('ui-tree-just-data');
|
||
}
|
||
return arr;
|
||
},
|
||
showArrow: function showArrow() {
|
||
if (!this.rootTree.loadData) {
|
||
return this.node.children && this.node.children.length > 0;
|
||
}
|
||
if (this.dataLoaded) {
|
||
return this.node.children && this.node.children.length > 0;
|
||
}
|
||
return true;
|
||
}
|
||
},
|
||
methods: {
|
||
getArrowType: function getArrowType(node) {
|
||
var type = '';
|
||
if (!node.expand) {
|
||
type = 'md-arrow-dropright';
|
||
} else {
|
||
type = 'md-arrow-dropdown';
|
||
}
|
||
return type;
|
||
},
|
||
getCheckClass: function getCheckClass(node) {
|
||
var arr = [];
|
||
if (node.childrenCheckedStatus == '1') {
|
||
arr.push('ui-checkbox-indeterminate');
|
||
}
|
||
if (node.childrenCheckedStatus == '2') {
|
||
arr.push('ui-checkbox-checked');
|
||
}
|
||
return arr;
|
||
},
|
||
toggle: function toggle(node) {
|
||
if (this.rootTree.loadData && !this.dataLoaded) {
|
||
this.dataLoading = true;
|
||
this.rootTree.loadData(this.node, this.addData);
|
||
} else {
|
||
node.expand = !node.expand;
|
||
}
|
||
},
|
||
addData: function addData(data) {
|
||
this.dispatch('Tree', 'on-load-data', [this.node, data]);
|
||
this.node.expand = true;
|
||
this.dataLoading = false;
|
||
this.dataLoaded = true;
|
||
},
|
||
clickNode: function clickNode() {
|
||
if (!this.rootTree.multiple) {
|
||
this.dispatch('Tree', 'on-node-click', this.node);
|
||
} else {
|
||
this.dispatch('Tree', 'on-check-click', this.node);
|
||
}
|
||
},
|
||
clickCheckBox: function clickCheckBox() {
|
||
if (this.rootTree.multiple) {
|
||
this.dispatch('Tree', 'on-check-click', this.node);
|
||
}
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 362 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(363),
|
||
/* template */
|
||
null,
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tree/nodeText.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-60c0e43c", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-60c0e43c", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 363 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.default = {
|
||
props: {
|
||
root: {
|
||
type: Object,
|
||
default: undefined
|
||
},
|
||
node: {
|
||
type: Object,
|
||
default: undefined
|
||
},
|
||
render: {
|
||
type: Function,
|
||
default: undefined
|
||
}
|
||
},
|
||
methods: {
|
||
clickHandler: function clickHandler() {
|
||
this.$emit('on-click');
|
||
}
|
||
},
|
||
render: function render(h) {
|
||
var son = [];
|
||
if (this.root.$scopedSlots.default) {
|
||
son.push(this.root.$scopedSlots.default({ node: this.node, root: this.root }));
|
||
} else {
|
||
son.push(this.node.name);
|
||
}
|
||
return h('span', {
|
||
class: {
|
||
'ui-tree-node-text': true,
|
||
selected: this.node.selected
|
||
},
|
||
on: {
|
||
click: this.clickHandler
|
||
}
|
||
}, son);
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 364 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('li', {
|
||
staticClass: "ui-tree-node"
|
||
}, [(_vm.showArrow) ? [(!_vm.dataLoading) ? _c('Icon', {
|
||
staticClass: "ui-expand-arrow",
|
||
attrs: {
|
||
"type": _vm.getArrowType(_vm.node)
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.toggle(_vm.node)
|
||
}
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), (_vm.dataLoading) ? _c('i', {
|
||
staticClass: "loading"
|
||
}, [_c('Loading', {
|
||
attrs: {
|
||
"size": "14px",
|
||
"color": "#657180"
|
||
}
|
||
})], 1) : _vm._e()] : _c('i', {
|
||
staticClass: "ui-expand-null"
|
||
}), _vm._v(" "), (_vm.multiple) ? _c('label', {
|
||
staticClass: "ui-checkbox",
|
||
class: _vm.getCheckClass(_vm.node),
|
||
on: {
|
||
"click": _vm.clickCheckBox
|
||
}
|
||
}, [_c('span', {
|
||
staticClass: "ui-checkbox-inner"
|
||
})]) : _vm._e(), _vm._v(" "), _c('nodeText', {
|
||
attrs: {
|
||
"root": _vm.rootTree,
|
||
"node": _vm.node
|
||
},
|
||
on: {
|
||
"on-click": _vm.clickNode
|
||
}
|
||
}), _vm._v(" "), (_vm.node.children && _vm.node.children.length > 0) ? _c('ul', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.node.expand),
|
||
expression: "node.expand"
|
||
}],
|
||
class: _vm.getClass
|
||
}, _vm._l((_vm.node.children), function(sonNode) {
|
||
return _c('Tree-node', {
|
||
key: sonNode._key,
|
||
attrs: {
|
||
"parent-node": _vm.node,
|
||
"node": sonNode,
|
||
"multiple": _vm.multiple
|
||
},
|
||
on: {
|
||
"update:parentNode": function($event) {
|
||
_vm.node = $event
|
||
},
|
||
"update:parent-node": function($event) {
|
||
_vm.node = $event
|
||
},
|
||
"update:node": function($event) {
|
||
sonNode = $event
|
||
}
|
||
}
|
||
})
|
||
}), 1) : _vm._e()], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-2f83edd3", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 365 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('ul', {
|
||
staticClass: "ui-tree",
|
||
class: _vm.getClass
|
||
}, _vm._l((_vm.root.children), function(node) {
|
||
return _c('tree-node', {
|
||
key: node._key,
|
||
attrs: {
|
||
"node": node,
|
||
"parent-node": _vm.root,
|
||
"multiple": _vm.multiple
|
||
},
|
||
on: {
|
||
"update:node": function($event) {
|
||
node = $event
|
||
},
|
||
"update:parentNode": function($event) {
|
||
_vm.root = $event
|
||
},
|
||
"update:parent-node": function($event) {
|
||
_vm.root = $event
|
||
}
|
||
}
|
||
})
|
||
}), 1)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-aec8bd9e", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 366 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _upload = __webpack_require__(367);
|
||
|
||
var _upload2 = _interopRequireDefault(_upload);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _upload2.default;
|
||
|
||
/***/ }),
|
||
/* 367 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
function injectStyle (ssrContext) {
|
||
if (disposed) return
|
||
__webpack_require__(368)
|
||
}
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(372),
|
||
/* template */
|
||
__webpack_require__(375),
|
||
/* styles */
|
||
injectStyle,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/upload/upload.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] upload.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-1bd712de", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-1bd712de", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 368 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// style-loader: Adds some css to the DOM by adding a <style> tag
|
||
|
||
// load the styles
|
||
var content = __webpack_require__(369);
|
||
if(typeof content === 'string') content = [[module.i, content, '']];
|
||
// add the styles to the DOM
|
||
var update = __webpack_require__(371)(content, {});
|
||
if(content.locals) module.exports = content.locals;
|
||
// Hot Module Replacement
|
||
if(false) {
|
||
// When the styles change, update the <style> tags
|
||
if(!content.locals) {
|
||
module.hot.accept("!!../../../node_modules/css-loader/index.js!../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1bd712de\",\"scoped\":false,\"hasInlineConfig\":false}!../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./upload.vue", function() {
|
||
var newContent = require("!!../../../node_modules/css-loader/index.js!../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1bd712de\",\"scoped\":false,\"hasInlineConfig\":false}!../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./upload.vue");
|
||
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
||
update(newContent);
|
||
});
|
||
}
|
||
// When the module is disposed, remove the <style> tags
|
||
module.hot.dispose(function() { update(); });
|
||
}
|
||
|
||
/***/ }),
|
||
/* 369 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
exports = module.exports = __webpack_require__(370)();
|
||
// imports
|
||
|
||
|
||
// module
|
||
exports.push([module.i, "\n.ui-upload {\n position: relative;\n}\n.ui-upload .ie-hack {\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n opacity: 0;\n z-index: 1000;\n}\n", ""]);
|
||
|
||
// exports
|
||
|
||
|
||
/***/ }),
|
||
/* 370 */
|
||
/***/ (function(module, exports) {
|
||
|
||
/*
|
||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||
Author Tobias Koppers @sokra
|
||
*/
|
||
// css base code, injected by the css-loader
|
||
module.exports = function() {
|
||
var list = [];
|
||
|
||
// return the list of modules as css string
|
||
list.toString = function toString() {
|
||
var result = [];
|
||
for(var i = 0; i < this.length; i++) {
|
||
var item = this[i];
|
||
if(item[2]) {
|
||
result.push("@media " + item[2] + "{" + item[1] + "}");
|
||
} else {
|
||
result.push(item[1]);
|
||
}
|
||
}
|
||
return result.join("");
|
||
};
|
||
|
||
// import a list of modules into the list
|
||
list.i = function(modules, mediaQuery) {
|
||
if(typeof modules === "string")
|
||
modules = [[null, modules, ""]];
|
||
var alreadyImportedModules = {};
|
||
for(var i = 0; i < this.length; i++) {
|
||
var id = this[i][0];
|
||
if(typeof id === "number")
|
||
alreadyImportedModules[id] = true;
|
||
}
|
||
for(i = 0; i < modules.length; i++) {
|
||
var item = modules[i];
|
||
// skip already imported module
|
||
// this implementation is not 100% perfect for weird media query combinations
|
||
// when a module is imported multiple times with different media queries.
|
||
// I hope this will never occur (Hey this way we have smaller bundles)
|
||
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
|
||
if(mediaQuery && !item[2]) {
|
||
item[2] = mediaQuery;
|
||
} else if(mediaQuery) {
|
||
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
|
||
}
|
||
list.push(item);
|
||
}
|
||
}
|
||
};
|
||
return list;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 371 */
|
||
/***/ (function(module, exports) {
|
||
|
||
/*
|
||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||
Author Tobias Koppers @sokra
|
||
*/
|
||
var stylesInDom = {},
|
||
memoize = function(fn) {
|
||
var memo;
|
||
return function () {
|
||
if (typeof memo === "undefined") memo = fn.apply(this, arguments);
|
||
return memo;
|
||
};
|
||
},
|
||
isOldIE = memoize(function() {
|
||
return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
|
||
}),
|
||
getHeadElement = memoize(function () {
|
||
return document.head || document.getElementsByTagName("head")[0];
|
||
}),
|
||
singletonElement = null,
|
||
singletonCounter = 0,
|
||
styleElementsInsertedAtTop = [];
|
||
|
||
module.exports = function(list, options) {
|
||
if(typeof DEBUG !== "undefined" && DEBUG) {
|
||
if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
|
||
}
|
||
|
||
options = options || {};
|
||
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
|
||
// tags it will allow on a page
|
||
if (typeof options.singleton === "undefined") options.singleton = isOldIE();
|
||
|
||
// By default, add <style> tags to the bottom of <head>.
|
||
if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
|
||
|
||
var styles = listToStyles(list);
|
||
addStylesToDom(styles, options);
|
||
|
||
return function update(newList) {
|
||
var mayRemove = [];
|
||
for(var i = 0; i < styles.length; i++) {
|
||
var item = styles[i];
|
||
var domStyle = stylesInDom[item.id];
|
||
domStyle.refs--;
|
||
mayRemove.push(domStyle);
|
||
}
|
||
if(newList) {
|
||
var newStyles = listToStyles(newList);
|
||
addStylesToDom(newStyles, options);
|
||
}
|
||
for(var i = 0; i < mayRemove.length; i++) {
|
||
var domStyle = mayRemove[i];
|
||
if(domStyle.refs === 0) {
|
||
for(var j = 0; j < domStyle.parts.length; j++)
|
||
domStyle.parts[j]();
|
||
delete stylesInDom[domStyle.id];
|
||
}
|
||
}
|
||
};
|
||
}
|
||
|
||
function addStylesToDom(styles, options) {
|
||
for(var i = 0; i < styles.length; i++) {
|
||
var item = styles[i];
|
||
var domStyle = stylesInDom[item.id];
|
||
if(domStyle) {
|
||
domStyle.refs++;
|
||
for(var j = 0; j < domStyle.parts.length; j++) {
|
||
domStyle.parts[j](item.parts[j]);
|
||
}
|
||
for(; j < item.parts.length; j++) {
|
||
domStyle.parts.push(addStyle(item.parts[j], options));
|
||
}
|
||
} else {
|
||
var parts = [];
|
||
for(var j = 0; j < item.parts.length; j++) {
|
||
parts.push(addStyle(item.parts[j], options));
|
||
}
|
||
stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
|
||
}
|
||
}
|
||
}
|
||
|
||
function listToStyles(list) {
|
||
var styles = [];
|
||
var newStyles = {};
|
||
for(var i = 0; i < list.length; i++) {
|
||
var item = list[i];
|
||
var id = item[0];
|
||
var css = item[1];
|
||
var media = item[2];
|
||
var sourceMap = item[3];
|
||
var part = {css: css, media: media, sourceMap: sourceMap};
|
||
if(!newStyles[id])
|
||
styles.push(newStyles[id] = {id: id, parts: [part]});
|
||
else
|
||
newStyles[id].parts.push(part);
|
||
}
|
||
return styles;
|
||
}
|
||
|
||
function insertStyleElement(options, styleElement) {
|
||
var head = getHeadElement();
|
||
var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
|
||
if (options.insertAt === "top") {
|
||
if(!lastStyleElementInsertedAtTop) {
|
||
head.insertBefore(styleElement, head.firstChild);
|
||
} else if(lastStyleElementInsertedAtTop.nextSibling) {
|
||
head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
|
||
} else {
|
||
head.appendChild(styleElement);
|
||
}
|
||
styleElementsInsertedAtTop.push(styleElement);
|
||
} else if (options.insertAt === "bottom") {
|
||
head.appendChild(styleElement);
|
||
} else {
|
||
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
|
||
}
|
||
}
|
||
|
||
function removeStyleElement(styleElement) {
|
||
styleElement.parentNode.removeChild(styleElement);
|
||
var idx = styleElementsInsertedAtTop.indexOf(styleElement);
|
||
if(idx >= 0) {
|
||
styleElementsInsertedAtTop.splice(idx, 1);
|
||
}
|
||
}
|
||
|
||
function createStyleElement(options) {
|
||
var styleElement = document.createElement("style");
|
||
styleElement.type = "text/css";
|
||
insertStyleElement(options, styleElement);
|
||
return styleElement;
|
||
}
|
||
|
||
function addStyle(obj, options) {
|
||
var styleElement, update, remove;
|
||
|
||
if (options.singleton) {
|
||
var styleIndex = singletonCounter++;
|
||
styleElement = singletonElement || (singletonElement = createStyleElement(options));
|
||
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
|
||
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
|
||
} else {
|
||
styleElement = createStyleElement(options);
|
||
update = applyToTag.bind(null, styleElement);
|
||
remove = function() {
|
||
removeStyleElement(styleElement);
|
||
};
|
||
}
|
||
|
||
update(obj);
|
||
|
||
return function updateStyle(newObj) {
|
||
if(newObj) {
|
||
if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
|
||
return;
|
||
update(obj = newObj);
|
||
} else {
|
||
remove();
|
||
}
|
||
};
|
||
}
|
||
|
||
var replaceText = (function () {
|
||
var textStore = [];
|
||
|
||
return function (index, replacement) {
|
||
textStore[index] = replacement;
|
||
return textStore.filter(Boolean).join('\n');
|
||
};
|
||
})();
|
||
|
||
function applyToSingletonTag(styleElement, index, remove, obj) {
|
||
var css = remove ? "" : obj.css;
|
||
|
||
if (styleElement.styleSheet) {
|
||
styleElement.styleSheet.cssText = replaceText(index, css);
|
||
} else {
|
||
var cssNode = document.createTextNode(css);
|
||
var childNodes = styleElement.childNodes;
|
||
if (childNodes[index]) styleElement.removeChild(childNodes[index]);
|
||
if (childNodes.length) {
|
||
styleElement.insertBefore(cssNode, childNodes[index]);
|
||
} else {
|
||
styleElement.appendChild(cssNode);
|
||
}
|
||
}
|
||
}
|
||
|
||
function applyToTag(styleElement, obj) {
|
||
var css = obj.css;
|
||
var media = obj.media;
|
||
var sourceMap = obj.sourceMap;
|
||
|
||
if (media) {
|
||
styleElement.setAttribute("media", media);
|
||
}
|
||
|
||
if (sourceMap) {
|
||
// https://developer.chrome.com/devtools/docs/javascript-debugging
|
||
// this makes source maps inside style tags work properly in Chrome
|
||
css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */';
|
||
// http://stackoverflow.com/a/26603875
|
||
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
|
||
}
|
||
|
||
if (styleElement.styleSheet) {
|
||
styleElement.styleSheet.cssText = css;
|
||
} else {
|
||
while(styleElement.firstChild) {
|
||
styleElement.removeChild(styleElement.firstChild);
|
||
}
|
||
styleElement.appendChild(document.createTextNode(css));
|
||
}
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
/* 372 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _stringify = __webpack_require__(85);
|
||
|
||
var _stringify2 = _interopRequireDefault(_stringify);
|
||
|
||
var _promise = __webpack_require__(43);
|
||
|
||
var _promise2 = _interopRequireDefault(_promise);
|
||
|
||
var _toast = __webpack_require__(84);
|
||
|
||
var _toast2 = _interopRequireDefault(_toast);
|
||
|
||
var _iePolyfill = __webpack_require__(374);
|
||
|
||
var _iePolyfill2 = _interopRequireDefault(_iePolyfill);
|
||
|
||
var _mixin = __webpack_require__(12);
|
||
|
||
var _mixin2 = _interopRequireDefault(_mixin);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'Upload',
|
||
mixins: [_iePolyfill2.default, _mixin2.default],
|
||
props: {
|
||
url: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
action: {
|
||
type: Function,
|
||
default: undefined
|
||
},
|
||
param: {
|
||
type: String,
|
||
default: 'upFiles'
|
||
},
|
||
accept: {
|
||
type: [String, Array],
|
||
default: undefined
|
||
},
|
||
multiple: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
imageSize: {
|
||
type: Object,
|
||
default: undefined
|
||
},
|
||
maxSize: {
|
||
type: Number,
|
||
default: undefined
|
||
}
|
||
},
|
||
methods: {
|
||
click: function click() {
|
||
if (this.isIE(9)) return;
|
||
this.$refs.input.click();
|
||
},
|
||
validate: function validate(file) {
|
||
var _this = this;
|
||
|
||
return new _promise2.default(function (resolve, reject) {
|
||
if (_this.accept) {
|
||
var filenames = file.name.split('.');
|
||
var lastName = filenames[filenames.length - 1];
|
||
if (Array.isArray(_this.accept)) {
|
||
if (_this.accept.indexOf(lastName) == -1) {
|
||
_toast2.default.error(_this.t('el.upload.suffixTip', {
|
||
filename: file.name,
|
||
suffix: (0, _stringify2.default)(_this.accept)
|
||
}));
|
||
reject();
|
||
}
|
||
} else if (lastName != _this.accept) {
|
||
_toast2.default.error(_this.t('el.upload.suffixTip', {
|
||
filename: file.name,
|
||
suffix: (0, _stringify2.default)(_this.accept)
|
||
}));
|
||
reject();
|
||
}
|
||
}
|
||
if (_this.maxSize && file.size > _this.maxSize) {
|
||
_toast2.default.error(_this.t('el.upload.sizeTip', {
|
||
filename: file.name,
|
||
size: _this.maxSize / 1024 / 1024
|
||
}));
|
||
reject();
|
||
}
|
||
if (file.type.indexOf('image') != -1 && _this.imageSize) {
|
||
var img = document.createElement('img');
|
||
img.src = window.URL.createObjectURL(file);
|
||
img.onload = function () {
|
||
if (_this.imageSize.height) {
|
||
if (_this.imageSize.height != img.height) {
|
||
_toast2.default.error(_this.t('el.upload.heightTip', {
|
||
filename: file.name,
|
||
height: _this.imageSize.height
|
||
}));
|
||
reject();
|
||
}
|
||
}
|
||
if (_this.imageSize.width) {
|
||
if (_this.imageSize.width != img.width) {
|
||
_toast2.default.error(_this.t('el.upload.widthTip', {
|
||
filename: file.name,
|
||
width: _this.imageSize.width
|
||
}));
|
||
reject();
|
||
}
|
||
}
|
||
window.URL.revokeObjectURL(img.src);
|
||
resolve(file);
|
||
};
|
||
} else {
|
||
resolve(file);
|
||
}
|
||
});
|
||
},
|
||
change: function change(e) {
|
||
var _this2 = this;
|
||
|
||
this.$emit('on-change', e);
|
||
if (this.isIE(9)) return this.iePost(e);
|
||
var files = e.target.files;
|
||
var len = files.length;
|
||
var validateArray = [];
|
||
for (var i = 0; i < len; i++) {
|
||
var file = e.target.files[i];
|
||
validateArray.push(this.validate(file));
|
||
}
|
||
_promise2.default.all(validateArray).then(function (values) {
|
||
var fileForm = new FormData();
|
||
values.forEach(function (file) {
|
||
fileForm.append(_this2.param, file);
|
||
});
|
||
if (_this2.action) {
|
||
_this2.action(true, fileForm);
|
||
_this2.$refs.input.value = '';
|
||
} else {
|
||
if (!_this2.url) {
|
||
return console.error('没有配置URL参数');
|
||
}
|
||
var xhr = new XMLHttpRequest();
|
||
xhr.onreadystatechange = function () {
|
||
if (xhr.readyState == 4) {
|
||
if (xhr.status >= 200 && xhr.status < 300 || xhr.status == 304) {
|
||
try {
|
||
var result = JSON.parse(xhr.responseText);
|
||
_this2.$emit('on-success', files, result);
|
||
} catch (e1) {
|
||
console.error('响应格式不正确');
|
||
}
|
||
} else {
|
||
_this2.$emit('on-fail', files, xhr.status);
|
||
}
|
||
_this2.$refs.input.value = '';
|
||
}
|
||
};
|
||
xhr.open('POST', _this2.url);
|
||
xhr.send(fileForm);
|
||
}
|
||
}, function () {
|
||
// 校验失败
|
||
_this2.$refs.input.value = '';
|
||
if (_this2.action) {
|
||
_this2.action(false);
|
||
} else {
|
||
_this2.$emit('on-fail', files, -1);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 373 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var core = __webpack_require__(6);
|
||
var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });
|
||
module.exports = function stringify(it) { // eslint-disable-line no-unused-vars
|
||
return $JSON.stringify.apply($JSON, arguments);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 374 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _keys = __webpack_require__(74);
|
||
|
||
var _keys2 = _interopRequireDefault(_keys);
|
||
|
||
var _stringify = __webpack_require__(85);
|
||
|
||
var _stringify2 = _interopRequireDefault(_stringify);
|
||
|
||
var _toast = __webpack_require__(84);
|
||
|
||
var _toast2 = _interopRequireDefault(_toast);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
mounted: function mounted() {
|
||
this.computedIEStyle();
|
||
},
|
||
|
||
methods: {
|
||
computedIEStyle: function computedIEStyle() {
|
||
var _this = this;
|
||
|
||
var ele = this.$slots.default && this.$slots.default[0] && this.$slots.default[0].elm;
|
||
if (ele && this.isIE(9)) {
|
||
this.$nextTick(function () {
|
||
_this.$refs.input.style.width = ele.clientWidth + 'px';
|
||
_this.$refs.input.style.height = ele.clientHeight + 'px';
|
||
});
|
||
}
|
||
},
|
||
isIE: function isIE(ver) {
|
||
return (0, _util.isIEVersion)(ver);
|
||
},
|
||
iePost: function iePost() {
|
||
var _this2 = this;
|
||
|
||
var form = document.createElement('form');
|
||
var iframe = document.createElement('iframe');
|
||
var input = this.$refs.input;
|
||
|
||
var filenames = input.value.split('.');
|
||
var lastName = filenames[filenames.length - 1];
|
||
if (Array.isArray(this.accept)) {
|
||
if (this.accept.indexOf(lastName) == -1) {
|
||
_toast2.default.error('\u6587\u4EF6[' + input.value + ']\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u53EA\u80FD\u4E0A\u4F20\u540E\u7F00\u4E3A' + (0, _stringify2.default)(this.accept) + '\u7684\u6587\u4EF6');
|
||
this.$refs.input.value = '';
|
||
this.$emit('on-fail', this.$refs.input);
|
||
return;
|
||
}
|
||
}
|
||
|
||
input.name = this.param;
|
||
form.style.display = 'none';
|
||
iframe.name = 'vueUploadFile' + Date.now();
|
||
|
||
form.action = this.url;
|
||
form.method = 'post';
|
||
form.target = iframe.name;
|
||
form.enctype = 'multipart/form-data';
|
||
form.encoding = 'multipart/form-data';
|
||
|
||
this.$refs.input.parentNode.insertBefore(form, this.$refs.input);
|
||
form.appendChild(input);
|
||
form.appendChild(iframe);
|
||
|
||
iframe.addEventListener('load', function () {
|
||
try {
|
||
var iframeNodes = iframe.contentDocument.all;
|
||
var rstMap = {};
|
||
var rst = {
|
||
result: {}
|
||
};
|
||
for (var i = 0; i < iframeNodes.length; i++) {
|
||
rstMap[iframeNodes[i].nodeName.toLowerCase()] = iframeNodes[i];
|
||
}
|
||
if (rstMap.result) {
|
||
(0, _keys2.default)(rstMap).forEach(function (key) {
|
||
rst.result[key] = rstMap[key].textContent;
|
||
});
|
||
_this2.$emit('on-success', _this2.$refs.input, rst);
|
||
} else if (rstMap.title) {
|
||
_toast2.default.error(rstMap.title.textContent);
|
||
_this2.$emit('on-fail', _this2.$refs.input, rst);
|
||
} else {
|
||
_toast2.default.error('IE获取url失败,请重新登录重新或改用chrome浏览器');
|
||
_this2.$emit('on-fail', _this2.$refs.input, rst);
|
||
}
|
||
} catch (e) {
|
||
_this2.$emit('on-fail', _this2.$refs.input);
|
||
_toast2.default.error('IE上传失败,请改用其他浏览器');
|
||
throw e;
|
||
}
|
||
_this2.$refs.input.parentNode.parentNode.appendChild(input);
|
||
_this2.$refs.input.parentNode.removeChild(form);
|
||
|
||
input = null;
|
||
form = null;
|
||
iframe = null;
|
||
_this2.$refs.input.value = '';
|
||
});
|
||
form.submit();
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 375 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-upload",
|
||
on: {
|
||
"click": _vm.click
|
||
}
|
||
}, [_vm._t("default", [_c('Wb-button', {
|
||
attrs: {
|
||
"type": "ghost",
|
||
"icon": "md-cloud-upload"
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(_vm.t('el.upload.placeholder')) + "\n ")])]), _vm._v(" "), _c('input', {
|
||
ref: "input",
|
||
staticClass: "ui-upload-file",
|
||
class: {
|
||
'ie-hack': _vm.isIE(9)
|
||
},
|
||
attrs: {
|
||
"multiple": _vm.multiple,
|
||
"type": "file",
|
||
"accept": "*"
|
||
},
|
||
on: {
|
||
"change": _vm.change
|
||
}
|
||
})], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-1bd712de", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 376 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _zoom = __webpack_require__(134);
|
||
|
||
var _zoom2 = _interopRequireDefault(_zoom);
|
||
|
||
var _zoom3 = __webpack_require__(379);
|
||
|
||
var _zoom4 = _interopRequireDefault(_zoom3);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
_zoom2.default._directive = _zoom4.default;
|
||
|
||
exports.default = _zoom2.default;
|
||
|
||
/***/ }),
|
||
/* 377 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _mixin = __webpack_require__(12);
|
||
|
||
var _mixin2 = _interopRequireDefault(_mixin);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'Zoom',
|
||
components: {
|
||
Icon: _icon2.default
|
||
},
|
||
mixins: [_emitter2.default, _mixin2.default],
|
||
props: {
|
||
src: {
|
||
type: String,
|
||
required: true
|
||
},
|
||
minWidth: {
|
||
type: Number,
|
||
default: 140
|
||
},
|
||
maxWidth: {
|
||
type: Number,
|
||
default: window.innerWidth * 0.8
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
init: false
|
||
};
|
||
},
|
||
mounted: function mounted() {
|
||
// 监听esc
|
||
document.addEventListener('keydown', this.esc, false);
|
||
},
|
||
destroyed: function destroyed() {
|
||
document.removeEventListener('keydown', this.esc);
|
||
},
|
||
|
||
methods: {
|
||
esc: function esc(event) {
|
||
var which = event.which || event.keyCode;
|
||
if (which == 27) {
|
||
this.close();
|
||
}
|
||
},
|
||
close: function close() {
|
||
this.dispatch('ZoomContainer', 'on-close');
|
||
},
|
||
load: function load(e) {
|
||
var style = {};
|
||
var imgEle = e.target || e.srcElement;
|
||
var tempImg = {};
|
||
tempImg.width = imgEle.width;
|
||
tempImg.height = imgEle.height;
|
||
var swapEle = this.$el.querySelector('.ui-zoom-image');
|
||
style.imgWidth = tempImg.width;
|
||
style.imgHeight = tempImg.height;
|
||
style.bodyWidth = window.innerWidth;
|
||
style.bodyHeight = window.innerHeight;
|
||
// 最小宽度是140
|
||
if (style.imgWidth <= this.minWidth) {
|
||
style.imgHeight = tempImg.height * this.minWidth / style.imgWidth;
|
||
style.imgWidth = this.minWidth;
|
||
} else if (style.imgWidth >= this.maxWidth) {
|
||
style.imgHeight = tempImg.height * this.maxWidth / style.imgWidth;
|
||
style.imgWidth = this.maxWidth;
|
||
}
|
||
imgEle.style.width = style.imgWidth + 'px';
|
||
imgEle.style.height = style.imgHeight + 'px';
|
||
|
||
var left = (style.bodyWidth - style.imgWidth) / 2 + 'px';
|
||
var top = (style.bodyHeight - style.imgHeight) / 2;
|
||
top = (top > 0 ? top : 0) + 'px';
|
||
swapEle.style.left = left;
|
||
swapEle.style.top = top;
|
||
if (style.bodyHeight < style.imgHeight) {
|
||
swapEle.style.margin = '100px 0';
|
||
}
|
||
this.init = true;
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 378 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-zoom"
|
||
}, [_c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.init),
|
||
expression: "init"
|
||
}],
|
||
staticClass: "ui-zoom-image"
|
||
}, [_c('div', {
|
||
staticClass: "ui-zoom-close",
|
||
attrs: {
|
||
"title": _vm.t('el.zoom.close')
|
||
},
|
||
on: {
|
||
"click": _vm.close
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "md-close-circle"
|
||
}
|
||
})], 1), _vm._v(" "), _c('img', {
|
||
attrs: {
|
||
"src": _vm.src
|
||
},
|
||
on: {
|
||
"load": _vm.load
|
||
}
|
||
})])])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-7de8ea51", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 379 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _vue = __webpack_require__(28);
|
||
|
||
var _vue2 = _interopRequireDefault(_vue);
|
||
|
||
var _zoom = __webpack_require__(134);
|
||
|
||
var _zoom2 = _interopRequireDefault(_zoom);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
function create(parent, zoomOption) {
|
||
var zoomComponent = new _vue2.default({
|
||
name: 'ZoomContainer',
|
||
components: {
|
||
zoom: _zoom2.default
|
||
},
|
||
data: function data() {
|
||
var defaultOption = {
|
||
show: true,
|
||
src: undefined,
|
||
minWidth: undefined,
|
||
maxWidth: undefined
|
||
};
|
||
return util.merge(defaultOption, zoomOption || {});
|
||
},
|
||
created: function created() {
|
||
this.$on('on-close', this.close);
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
this.$off('on-close');
|
||
},
|
||
|
||
methods: {
|
||
close: function close() {
|
||
this.show = false;
|
||
}
|
||
},
|
||
render: function render(h) {
|
||
return h('zoom', {
|
||
style: {
|
||
display: !this.show ? 'none' : 'block'
|
||
},
|
||
props: {
|
||
src: this.src,
|
||
minWidth: this.minWidth,
|
||
maxWidth: this.maxWidth
|
||
}
|
||
});
|
||
}
|
||
});
|
||
var component = zoomComponent.$mount();
|
||
document.body.appendChild(component.$el);
|
||
return zoomComponent;
|
||
}
|
||
|
||
function trigger() {
|
||
if (!this.component) {
|
||
this.component = create(this, this.option);
|
||
} else {
|
||
this.component.show = true;
|
||
}
|
||
}
|
||
|
||
var cache = {};
|
||
exports.default = {
|
||
inserted: function inserted(el, binding) {
|
||
var self = cache[el] = {};
|
||
if (util.typeOf(binding.value) == 'object') {
|
||
self.option = binding.value;
|
||
} else {
|
||
self.option = {
|
||
src: el.src
|
||
};
|
||
}
|
||
el.addEventListener('click', trigger.bind(self), false);
|
||
},
|
||
unbind: function unbind(el) {
|
||
var self = cache[el];
|
||
el.removeEventListener('click', trigger.bind(self));
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 380 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _steps = __webpack_require__(381);
|
||
|
||
var _steps2 = _interopRequireDefault(_steps);
|
||
|
||
var _step = __webpack_require__(384);
|
||
|
||
var _step2 = _interopRequireDefault(_step);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
Steps: _steps2.default,
|
||
Step: _step2.default
|
||
};
|
||
|
||
/***/ }),
|
||
/* 381 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(382),
|
||
/* template */
|
||
__webpack_require__(383),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/step-com/steps.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] steps.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-ae23d4f4", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-ae23d4f4", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 382 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Steps',
|
||
props: {
|
||
current: {
|
||
type: Number,
|
||
required: true
|
||
},
|
||
size: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
direction: {
|
||
type: String,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
len: 0,
|
||
sonWidth: ''
|
||
};
|
||
},
|
||
|
||
watch: {
|
||
current: function current() {
|
||
this.upDateChildren();
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
this.len = this.$children.length;
|
||
this.sonWidth = 100 / this.len + '%';
|
||
if (this.direction == 'vertical') {
|
||
this.sonWidth = '100%';
|
||
}
|
||
this.upDateChildren();
|
||
},
|
||
|
||
methods: {
|
||
upDateChildren: function upDateChildren() {
|
||
var _this = this;
|
||
if (this.$children) {
|
||
this.$children.forEach(function (step, index) {
|
||
step.index = index + 1;
|
||
if (step.index > _this.current) {
|
||
step.status = 'ready';
|
||
} else if (step.index == _this.current) {
|
||
step.status = 'doing';
|
||
} else {
|
||
step.status = 'done';
|
||
}
|
||
});
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 383 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-steps",
|
||
class: {
|
||
'ui-steps-small': _vm.size == 'small', 'ui-steps-vertical': _vm.direction == 'vertical'
|
||
}
|
||
}, [_vm._t("default")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-ae23d4f4", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 384 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(385),
|
||
/* template */
|
||
__webpack_require__(386),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/step-com/step.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] step.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-bb881986", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-bb881986", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 385 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'Step',
|
||
components: {
|
||
Icon: _icon2.default
|
||
},
|
||
props: {
|
||
title: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
content: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
icon: {
|
||
type: String,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
status: 'ready', // ready, doing, done
|
||
index: 0
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
showTail: function showTail() {
|
||
return this.$parent.len != this.index;
|
||
},
|
||
getClass: function getClass() {
|
||
return 'ui-step-' + this.status;
|
||
},
|
||
getStyles: function getStyles() {
|
||
return { width: this.$parent.sonWidth };
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 386 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-step",
|
||
class: _vm.getClass,
|
||
style: (_vm.getStyles)
|
||
}, [_c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.showTail),
|
||
expression: "showTail"
|
||
}],
|
||
staticClass: "ui-step-tail"
|
||
}, [_c('i')]), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-step-head"
|
||
}, [_c('div', {
|
||
staticClass: "ui-step-head-swap"
|
||
}, [(!_vm.$slots.default) ? [(_vm.status == 'done') ? _c('Icon', {
|
||
attrs: {
|
||
"type": "md-checkmark"
|
||
}
|
||
}) : _c('span', [_vm._v("\n " + _vm._s(_vm.index) + "\n ")])] : [_vm._t("default")]], 2)]), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-step-main"
|
||
}, [_c('div', {
|
||
staticClass: "ui-step-title"
|
||
}, [_vm._v("\n " + _vm._s(_vm.title) + "\n ")]), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-step-desc"
|
||
}, [_vm._v("\n " + _vm._s(_vm.content) + "\n ")])])])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-bb881986", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 387 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _tooltip = __webpack_require__(135);
|
||
|
||
var _tooltip2 = _interopRequireDefault(_tooltip);
|
||
|
||
var _tooltip3 = __webpack_require__(393);
|
||
|
||
var _tooltip4 = _interopRequireDefault(_tooltip3);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
_tooltip2.default._directive = _tooltip4.default;
|
||
|
||
exports.default = _tooltip2.default;
|
||
|
||
/***/ }),
|
||
/* 388 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _vue = __webpack_require__(28);
|
||
|
||
var _vue2 = _interopRequireDefault(_vue);
|
||
|
||
var _xss = __webpack_require__(128);
|
||
|
||
var _xss2 = _interopRequireDefault(_xss);
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _tooltipComponent = __webpack_require__(389);
|
||
|
||
var _tooltipComponent2 = _interopRequireDefault(_tooltipComponent);
|
||
|
||
var _mixin = __webpack_require__(12);
|
||
|
||
var _mixin2 = _interopRequireDefault(_mixin);
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Tooltip',
|
||
components: {
|
||
Icon: _icon2.default,
|
||
tooltipComponent: _tooltipComponent2.default
|
||
},
|
||
mixins: [_emitter2.default, _mixin2.default],
|
||
props: {
|
||
text: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
html: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
component: {
|
||
type: [Object, null],
|
||
default: undefined
|
||
},
|
||
styleObject: {
|
||
type: Object,
|
||
default: undefined
|
||
},
|
||
direction: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
align: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
confirm: {
|
||
type: [Boolean, String],
|
||
default: undefined
|
||
}
|
||
},
|
||
computed: {
|
||
isComponent: function isComponent() {
|
||
return this.component != null && this.component.constructor === _vue2.default;
|
||
},
|
||
isHtml: function isHtml() {
|
||
return !this.isComponent && this.html && this.html.length > 0;
|
||
},
|
||
isText: function isText() {
|
||
return !this.isComponent && !this.isHtml && this.text && this.text.length > 0;
|
||
},
|
||
getClass: function getClass() {
|
||
var arr = ['ui-tooltip-direction-' + this.direction, 'ui-tooltip-align-' + this.align];
|
||
if (this.isHtml || this.isComponent) {
|
||
arr.push('ui-tooltip-rich');
|
||
}
|
||
if (this.confirm === 'true' || this.confirm === 'confirm' || this.confirm) {
|
||
arr.push('ui-tooltip-confirm');
|
||
}
|
||
return arr;
|
||
}
|
||
},
|
||
methods: {
|
||
xssFilter: function xssFilter(html) {
|
||
return (0, _xss2.default)(html, {
|
||
onIgnoreTagAttr: function onIgnoreTagAttr(tag, name, value) {
|
||
if (name === 'style' || name === 'class') {
|
||
// 通过内置的escapeAttrValue函数来对属性值进行转义
|
||
return name + '="' + (0, _xss.safeAttrValue)(tag, name, value) + '"';
|
||
}
|
||
}
|
||
});
|
||
},
|
||
ok: function ok() {
|
||
this.dispatch('TooltipDirective', 'tooltip.ok');
|
||
},
|
||
cancel: function cancel() {
|
||
this.dispatch('TooltipDirective', 'tooltip.cancel');
|
||
},
|
||
mouseenter: function mouseenter() {
|
||
this.dispatch('TooltipDirective', 'tooltip.mouseenter');
|
||
},
|
||
mouseleave: function mouseleave() {
|
||
this.dispatch('TooltipDirective', 'tooltip.mouseleave');
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 389 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(390),
|
||
/* template */
|
||
__webpack_require__(391),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/tooltip/tooltipComponent.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] tooltipComponent.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-a0201718", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-a0201718", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 390 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
props: {
|
||
component: {
|
||
type: [Object, null],
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {};
|
||
},
|
||
mounted: function mounted() {
|
||
if (this.component) {
|
||
this.component.$mount(this.$refs.swap);
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 391 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
ref: "swap"
|
||
})
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-a0201718", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 392 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-tooltip",
|
||
class: _vm.getClass,
|
||
style: (_vm.styleObject),
|
||
on: {
|
||
"mouseenter": _vm.mouseenter,
|
||
"mouseleave": _vm.mouseleave
|
||
}
|
||
}, [_c('div', {
|
||
staticClass: "ui-tooltip-swap"
|
||
}, [_c('div', {
|
||
staticClass: "ui-tooltip-arrow"
|
||
}), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-tooltip-inner"
|
||
}, [(_vm.isText) ? _c('div', {
|
||
staticClass: "ui-tooltip-text"
|
||
}, [(_vm.confirm) ? _c('Icon', {
|
||
attrs: {
|
||
"type": "md-help-circle"
|
||
}
|
||
}) : _vm._e(), _vm._v("\n " + _vm._s(_vm.text) + "\n ")], 1) : _vm._e(), _vm._v(" "), (_vm.isHtml) ? _c('div', {
|
||
domProps: {
|
||
"innerHTML": _vm._s(_vm.xssFilter(_vm.html))
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), (_vm.isComponent) ? _c('div', [_c('tooltip-component', {
|
||
attrs: {
|
||
"component": _vm.component
|
||
}
|
||
})], 1) : _vm._e(), _vm._v(" "), (_vm.confirm) ? _c('div', {
|
||
staticClass: "ui-tooltip-buttons"
|
||
}, [_c('div', {
|
||
staticClass: "ui-button",
|
||
on: {
|
||
"click": _vm.ok
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(_vm.t('el.tooltip.confirm')) + "\n ")]), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-button",
|
||
on: {
|
||
"click": _vm.cancel
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(_vm.t('el.tooltip.cancel')) + "\n ")])]) : _vm._e()])])])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-5ce53c39", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 393 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _vue = __webpack_require__(28);
|
||
|
||
var _vue2 = _interopRequireDefault(_vue);
|
||
|
||
var _tooltip = __webpack_require__(135);
|
||
|
||
var _tooltip2 = _interopRequireDefault(_tooltip);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
var cache = {};
|
||
|
||
var triggerMap = {
|
||
mouseenter: ['mouseenter', 'mouseleave'],
|
||
click: ['click', 'click'],
|
||
focus: ['focus', 'blur'],
|
||
outsideClick: ['click', 'outsideClick']
|
||
};
|
||
|
||
var create = function create(parent, option) {
|
||
var tooltipComponent = new _vue2.default({
|
||
name: 'TooltipDirective',
|
||
components: {
|
||
Tooltip: _tooltip2.default
|
||
},
|
||
data: function data() {
|
||
var defaultOption = {
|
||
show: false,
|
||
direction: 'bottom',
|
||
align: 'center',
|
||
styleObject: {},
|
||
text: '',
|
||
html: '',
|
||
confirm: false,
|
||
component: null
|
||
};
|
||
return util.extend(defaultOption, option || {});
|
||
},
|
||
created: function created() {
|
||
this.$on('tooltip.ok', this.ok);
|
||
this.$on('tooltip.cancel', this.cancel);
|
||
this.$on('tooltip.mouseenter', this.mouseenter);
|
||
this.$on('tooltip.mouseleave', this.mouseleave);
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
this.$off('tooltip.ok');
|
||
this.$off('tooltip.cancel');
|
||
this.$off('tooltip.mouseenter');
|
||
this.$off('tooltip.mouseleave');
|
||
},
|
||
|
||
methods: {
|
||
mouseenter: function mouseenter() {
|
||
this.show = true;
|
||
},
|
||
mouseleave: function mouseleave() {
|
||
this.show = false;
|
||
},
|
||
ok: function ok() {
|
||
option.onOk && option.onOk.call(parent.vm);
|
||
},
|
||
cancel: function cancel() {
|
||
option.onCancel && option.onCancel.call(parent.vm);
|
||
}
|
||
},
|
||
render: function render(h) {
|
||
return h('tooltip', {
|
||
props: {
|
||
direction: this.direction,
|
||
align: this.align,
|
||
text: this.text,
|
||
html: this.html,
|
||
component: this.component,
|
||
confirm: this.confirm,
|
||
styleObject: this.styleObject,
|
||
transition: 'fade'
|
||
},
|
||
style: {
|
||
display: this.show ? 'block' : 'none'
|
||
}
|
||
});
|
||
}
|
||
// template: '<tooltip v-show="show" :direction="direction" :align="align" :text="text" :html="html" :component="component"
|
||
// :confirm="confirm" :style-object="styleObject" transition="fade"></tooltip>'
|
||
|
||
});
|
||
var component = tooltipComponent.$mount();
|
||
if (parent.el.parentNode) {
|
||
parent.el.parentNode.appendChild(component.$el);
|
||
} else {
|
||
parent.el.appendChild(component.$el);
|
||
}
|
||
return tooltipComponent;
|
||
};
|
||
|
||
exports.default = {
|
||
inserted: function inserted(el, binding) {
|
||
// 指令插入节点后执行
|
||
// 准备工作
|
||
var self = {
|
||
el: el
|
||
};
|
||
cache[el] = self;
|
||
if (util.typeOf(binding.value) == 'string') {
|
||
self.tooltipOption = {
|
||
text: binding.value
|
||
};
|
||
} else if (util.typeOf(binding.value) == 'object') {
|
||
self.tooltipOption = binding.value;
|
||
} else {
|
||
return console.warn('请正确使用tooltip组件!');
|
||
}
|
||
|
||
// 默认是bottom
|
||
if (!self.tooltipOption.direction) {
|
||
self.tooltipOption.direction = 'bottom';
|
||
}
|
||
if (!self.tooltipOption.align) {
|
||
self.tooltipOption.align = 'center';
|
||
}
|
||
self.tooltipOption.trigger = self.tooltipOption.trigger || 'mouseenter';
|
||
|
||
self.triggerBind = function () {
|
||
if (!self.tooltipComponent) return;
|
||
self.tooltipComponent.show = !self.tooltipComponent.show;
|
||
};
|
||
|
||
self.showTooltipBind = function () {
|
||
if (!self.tooltipComponent) return;
|
||
self.tooltipComponent.show = true;
|
||
};
|
||
|
||
self.hideTooltipBind = function () {
|
||
if (!self.tooltipComponent) return;
|
||
self.tooltipComponent.show = false;
|
||
};
|
||
|
||
self.bodyHideTooltipBind = function (e) {
|
||
if (!self.tooltipComponent) return;
|
||
if (self.el != e.target && self.tooltipComponent.$el != e.target && !util.contains(self.el, e.target) && !util.contains(self.tooltipComponent.$el, e.target)) {
|
||
self.tooltipComponent.show = false;
|
||
}
|
||
};
|
||
|
||
var show = triggerMap[self.tooltipOption.trigger][0];
|
||
var hide = triggerMap[self.tooltipOption.trigger][1];
|
||
if (hide === 'outsideClick') {
|
||
el.addEventListener('click', self.triggerBind, false);
|
||
document.addEventListener('click', self.bodyHideTooltipBind, false);
|
||
} else if (show === hide) {
|
||
el.addEventListener(show, self.triggerBind, false);
|
||
} else {
|
||
el.addEventListener(show, self.showTooltipBind, false);
|
||
el.addEventListener(hide, self.hideTooltipBind, false);
|
||
}
|
||
|
||
// 根据父节点计算指令的位置
|
||
self.tooltipOption.styleObject = util.getPositionWhenAfterBorther(el, self.tooltipOption.direction, self.tooltipOption.align);
|
||
self.tooltipComponent = create(self, self.tooltipOption);
|
||
},
|
||
unbind: function unbind(el) {
|
||
// 清理工作
|
||
// 例如,删除 bind() 添加的事件监听器
|
||
var self = cache[el];
|
||
var show = triggerMap[self.tooltipOption.trigger][0];
|
||
var hide = triggerMap[self.tooltipOption.trigger][1];
|
||
if (hide === 'outsideClick') {
|
||
el.removeEventListener('click', self.triggerBind);
|
||
document.removeEventListener('click', self.bodyHideTooltipBind);
|
||
} else if (show === hide) {
|
||
el.removeEventListener(show, self.triggerBind);
|
||
} else {
|
||
el.removeEventListener(show, self.showTooltipBind);
|
||
el.removeEventListener(hide, self.hideTooltipBind);
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 394 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _pagination = __webpack_require__(395);
|
||
|
||
var _pagination2 = _interopRequireDefault(_pagination);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _pagination2.default;
|
||
|
||
/***/ }),
|
||
/* 395 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(396),
|
||
/* template */
|
||
__webpack_require__(413),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/pagination/pagination.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] pagination.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-71ca1bf1", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-71ca1bf1", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 396 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
var _select = __webpack_require__(136);
|
||
|
||
var _select2 = _interopRequireDefault(_select);
|
||
|
||
var _input = __webpack_require__(137);
|
||
|
||
var _input2 = _interopRequireDefault(_input);
|
||
|
||
var _mixin = __webpack_require__(12);
|
||
|
||
var _mixin2 = _interopRequireDefault(_mixin);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
var WbSelect = _select2.default.WbSelect,
|
||
WbOption = _select2.default.WbOption;
|
||
exports.default = {
|
||
components: {
|
||
Icon: _icon2.default,
|
||
WbSelect: WbSelect,
|
||
WbOption: WbOption,
|
||
WbInput: _input2.default
|
||
},
|
||
mixins: [_mixin2.default],
|
||
props: {
|
||
size: {
|
||
// 分页大小
|
||
type: Number,
|
||
default: 8
|
||
},
|
||
current: {
|
||
// 当前页面
|
||
type: Number,
|
||
default: 1
|
||
},
|
||
total: {
|
||
// 总页数
|
||
type: Number,
|
||
default: 0
|
||
},
|
||
locking: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
showSizeChanger: {
|
||
type: Boolean,
|
||
default: true
|
||
},
|
||
showQuickJumper: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
sizeList: {
|
||
type: Array,
|
||
default: function _default() {
|
||
return [8, 16, 32, 50, 100];
|
||
}
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
pageSizeList: this.sizeList,
|
||
len: 6,
|
||
myCurrent: this.current,
|
||
mySize: this.size,
|
||
jumperPage: ''
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
pageCode: function pageCode() {
|
||
var pageCode = [];
|
||
for (var i = 1; i <= this.total; i++) {
|
||
pageCode.push(i);
|
||
}
|
||
return pageCode;
|
||
},
|
||
codes: function codes() {
|
||
var _this = this;
|
||
|
||
var result = [];
|
||
if (this.pageCode.length > 0) {
|
||
this.pageCode.slice(0).forEach(function (item) {
|
||
if (Math.floor((_this.myCurrent - 1) / _this.len) * _this.len < item) {
|
||
result.push(item);
|
||
}
|
||
});
|
||
}
|
||
return result.slice(0, this.len);
|
||
},
|
||
showFirst: function showFirst() {
|
||
return this.codes[0] > this.len;
|
||
},
|
||
showLast: function showLast() {
|
||
return this.codes[this.len - 1] < this.total;
|
||
}
|
||
},
|
||
watch: {
|
||
current: function current(value) {
|
||
if (this.myCurrent === value) {
|
||
return;
|
||
}
|
||
this.myCurrent = value;
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
if (this.pageSizeList.indexOf(this.size) == -1) {
|
||
this.pageSizeList.push(this.size);
|
||
}
|
||
},
|
||
|
||
methods: {
|
||
dispatch: function dispatch() {
|
||
this.$emit('on-change', {
|
||
current: this.myCurrent,
|
||
size: this.mySize
|
||
});
|
||
this.$emit('update:current', this.myCurrent);
|
||
this.$emit('update:size', this.mySize);
|
||
},
|
||
last: function last() {
|
||
if (this.myCurrent > 1 && !this.locking) {
|
||
this.myCurrent -= 1;
|
||
this.dispatch();
|
||
}
|
||
},
|
||
next: function next() {
|
||
if (this.myCurrent < this.total && !this.locking) {
|
||
this.myCurrent += 1;
|
||
this.dispatch();
|
||
}
|
||
},
|
||
prev: function prev() {
|
||
if (this.myCurrent > 1 && !this.locking) {
|
||
this.myCurrent -= this.len;
|
||
if (this.myCurrent < 1) {
|
||
this.myCurrent = 1;
|
||
}
|
||
this.dispatch();
|
||
}
|
||
},
|
||
nnext: function nnext() {
|
||
if (this.myCurrent < this.total && !this.locking) {
|
||
this.myCurrent += this.len;
|
||
if (this.myCurrent > this.total) {
|
||
this.myCurrent = this.total;
|
||
}
|
||
this.dispatch();
|
||
}
|
||
},
|
||
go: function go(code) {
|
||
if (this.myCurrent >= 1 && this.myCurrent <= this.total && !this.locking) {
|
||
this.myCurrent = code;
|
||
this.dispatch();
|
||
}
|
||
},
|
||
jumper: function jumper() {
|
||
this.go(this.jumperPage);
|
||
},
|
||
changePageSize: function changePageSize() {
|
||
this.myCurrent = 1;
|
||
this.dispatch();
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 397 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(398),
|
||
/* template */
|
||
__webpack_require__(399),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/select/select.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] select.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-5e88339e", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-5e88339e", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 398 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _assign = __webpack_require__(49);
|
||
|
||
var _assign2 = _interopRequireDefault(_assign);
|
||
|
||
var _clickoutside = __webpack_require__(29);
|
||
|
||
var _clickoutside2 = _interopRequireDefault(_clickoutside);
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
var _keyCode = __webpack_require__(19);
|
||
|
||
var _keyCode2 = _interopRequireDefault(_keyCode);
|
||
|
||
var _mixin = __webpack_require__(12);
|
||
|
||
var _mixin2 = _interopRequireDefault(_mixin);
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'WbSelect',
|
||
components: {
|
||
Icon: _icon2.default
|
||
},
|
||
directives: {
|
||
clickoutside: _clickoutside2.default
|
||
},
|
||
mixins: [_emitter2.default, _mixin2.default],
|
||
props: {
|
||
value: {
|
||
type: [String, Number, Array],
|
||
default: ''
|
||
},
|
||
placeholder: {
|
||
type: String,
|
||
default: function _default() {
|
||
return '';
|
||
}
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
filterable: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
clearable: {
|
||
type: Boolean,
|
||
default: true
|
||
},
|
||
readonly: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
multiple: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
multipleLimit: {
|
||
type: Number,
|
||
default: 0
|
||
},
|
||
options: {
|
||
type: Array,
|
||
default: function _default() {
|
||
return [];
|
||
}
|
||
},
|
||
optionsValueName: {
|
||
type: String,
|
||
default: 'value'
|
||
},
|
||
optionsTextName: {
|
||
type: String,
|
||
default: 'text'
|
||
}
|
||
},
|
||
data: function data() {
|
||
var myOptions = this.makeData();
|
||
return {
|
||
focusOption: null,
|
||
currentValue: this.value,
|
||
searchValue: '',
|
||
showClear: false,
|
||
showList: false,
|
||
myOptions: myOptions,
|
||
noChildren: myOptions.length,
|
||
pagination: {
|
||
size: 100,
|
||
current: 0
|
||
},
|
||
searching: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getTabindex: function getTabindex() {
|
||
if (this.disabled || this.readonly) {
|
||
return -1;
|
||
}
|
||
return 0;
|
||
},
|
||
getUISelectClass: function getUISelectClass() {
|
||
if (this.selectedOption && this.selectedOption.currentLabel) {
|
||
return 'ui-select-selected-value';
|
||
}
|
||
return 'ui-select-placeholder';
|
||
},
|
||
localPlaceholder: function localPlaceholder() {
|
||
return this.t('el.select.placeholder');
|
||
},
|
||
selectedOption: function selectedOption() {
|
||
var arr = [];
|
||
this.myOptions.forEach(function (option) {
|
||
if (option.selected) {
|
||
arr.push(option);
|
||
}
|
||
});
|
||
if (this.multiple) {
|
||
return arr;
|
||
}
|
||
if (arr.length > 0) {
|
||
return arr[0];
|
||
}
|
||
return null;
|
||
},
|
||
disableLimit: function disableLimit() {
|
||
var currentValue = this.currentValue,
|
||
multiple = this.multiple,
|
||
multipleLimit = this.multipleLimit;
|
||
|
||
var disableLimit = false;
|
||
if (multiple) {
|
||
disableLimit = (currentValue || []).length >= multipleLimit && multipleLimit > 0;
|
||
}
|
||
return disableLimit;
|
||
},
|
||
searchOptions: function searchOptions() {
|
||
var _this = this;
|
||
|
||
var searchOptions = [];
|
||
this.myOptions.forEach(function (option) {
|
||
if (_this.searchValue && option.text.indexOf(_this.searchValue) != -1) {
|
||
searchOptions.push(option);
|
||
} else if (!_this.searchValue) {
|
||
searchOptions.push(option);
|
||
}
|
||
});
|
||
return searchOptions;
|
||
},
|
||
currentOptions: function currentOptions() {
|
||
var start = this.pagination.size * this.pagination.current;
|
||
var arr = this.searchOptions.slice(start, start + this.pagination.size);
|
||
return arr;
|
||
}
|
||
},
|
||
watch: {
|
||
value: function value(_value) {
|
||
if (_value === this.currentValue) return;
|
||
this.currentValue = _value;
|
||
this.changeCurrentValue();
|
||
},
|
||
showList: function showList(value) {
|
||
if (this.filterable && value) {
|
||
this.$nextTick(function () {
|
||
this.$refs.searchInput.focus();
|
||
});
|
||
}
|
||
},
|
||
|
||
options: {
|
||
handler: function handler() {
|
||
this.myOptions = this.makeData();
|
||
this.noChildren = this.myOptions.length;
|
||
},
|
||
|
||
deep: true
|
||
}
|
||
},
|
||
created: function created() {
|
||
this.addOptionCache = [];
|
||
var debounce = function debounce(fn) {
|
||
var waiting = void 0;
|
||
return function () {
|
||
if (waiting) return;
|
||
waiting = true;
|
||
var context = this;
|
||
var args = arguments;
|
||
var later = function later() {
|
||
waiting = false;
|
||
fn.apply(context, args);
|
||
};
|
||
this.$nextTick(later);
|
||
};
|
||
};
|
||
this.debouncedAppend = debounce(function () {
|
||
this.myOptions = this.myOptions.concat(this.addOptionCache);
|
||
this.addOptionCache = [];
|
||
});
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
// 如果Select组件销毁,则把这个清除。然后removeOption的逻辑就不会执行,则不会触发可能的改变currentValue的逻辑
|
||
this.myOptions = [];
|
||
},
|
||
|
||
methods: {
|
||
addTitleAttr: function addTitleAttr(target, text) {
|
||
if (target.clientWidth < target.scrollWidth) {
|
||
target.setAttribute('title', text);
|
||
} else {
|
||
target.setAttribute('title', '');
|
||
}
|
||
},
|
||
handleTitleAttr: function handleTitleAttr(e) {
|
||
this.addTitleAttr(e.target, e.target.innerText);
|
||
},
|
||
addOption: function addOption(option) {
|
||
this.addOptionCache.push(option);
|
||
this.debouncedAppend();
|
||
},
|
||
removeOption: function removeOption(option) {
|
||
if (this.myOptions.length === 0) {
|
||
return;
|
||
}
|
||
var index = this.myOptions.indexOf(option);
|
||
if (index != -1) {
|
||
this.myOptions.splice(index, 1);
|
||
}
|
||
// 如果删除的option在选中状态,则清除选中的值
|
||
if (option.selected) {
|
||
if (this.multiple) {
|
||
var i = this.currentValue.indexOf(option.value);
|
||
if (i != -1) {
|
||
this.currentValue.splice(index, 1);
|
||
}
|
||
} else {
|
||
this.currentValue = '';
|
||
}
|
||
this.changeCurrentValue();
|
||
}
|
||
},
|
||
makeData: function makeData() {
|
||
var _this2 = this;
|
||
|
||
var myOptions = [];
|
||
var use = [];
|
||
this.options.forEach(function (option) {
|
||
var text = option[_this2.optionsTextName];
|
||
var value = option[_this2.optionsValueName];
|
||
var selected = void 0;
|
||
if (_this2.multiple) {
|
||
selected = _this2.value.indexOf(value) != -1;
|
||
} else {
|
||
selected = _this2.value === value;
|
||
}
|
||
selected && use.push(value);
|
||
myOptions.push((0, _assign2.default)({
|
||
selected: selected || false,
|
||
isFocus: false,
|
||
currentLabel: text,
|
||
value: value,
|
||
text: text
|
||
}, option));
|
||
});
|
||
// 如果value中的某个值,不在options中的话,则清除value中的那个值
|
||
// 只有初始化之后的才这样
|
||
if (this.searching) {
|
||
if (this.multiple) {
|
||
if (this.value.length !== use.length || !this.value.every(function (val) {
|
||
return use.indexOf(val) != -1;
|
||
})) {
|
||
this.currentValue = use;
|
||
this.changeCurrentValue();
|
||
}
|
||
} else if (!use.some(function (val) {
|
||
return val === _this2.value;
|
||
})) {
|
||
setTimeout(function () {
|
||
_this2.currentValue = '';
|
||
_this2.changeCurrentValue();
|
||
}, 0);
|
||
}
|
||
this.searching = false;
|
||
}
|
||
return myOptions;
|
||
},
|
||
selectOption: function selectOption(e) {
|
||
if (this.disabled || this.readonly) {
|
||
return;
|
||
}
|
||
var key = e.target.getAttribute('data-key');
|
||
var options = this.myOptions.filter(function (option) {
|
||
return option.value == key;
|
||
});
|
||
if (options.length > 0) {
|
||
var option = options[0];
|
||
if (option.disabled) {
|
||
return;
|
||
}
|
||
if (this.disableLimit && !option.selected) {
|
||
return;
|
||
}
|
||
this.clickOption(option);
|
||
}
|
||
},
|
||
clickOption: function clickOption(option) {
|
||
if (this.disabled || this.readonly) return;
|
||
if (this.multiple) {
|
||
var index = this.currentValue.indexOf(option.value);
|
||
if (index != -1) {
|
||
this.currentValue.splice(index, 1);
|
||
} else if (this.multipleLimit <= 0 || this.currentValue.length < this.multipleLimit) {
|
||
this.currentValue.push(option.value);
|
||
}
|
||
} else {
|
||
this.showList = false;
|
||
this.currentValue = option.value;
|
||
this.finished();
|
||
}
|
||
this.changeCurrentValue();
|
||
},
|
||
changeCurrentValue: function changeCurrentValue() {
|
||
var _this3 = this;
|
||
|
||
// 如果是高性能模式,则当值改变时,需要变更selected状态
|
||
if (this.noChildren) {
|
||
this.myOptions.forEach(function (option) {
|
||
var selected = void 0;
|
||
if (_this3.multiple) {
|
||
selected = _this3.currentValue.indexOf(option.value) != -1;
|
||
} else {
|
||
selected = _this3.currentValue === option.value;
|
||
}
|
||
option.selected = selected;
|
||
});
|
||
}
|
||
this.$emit('input', this.currentValue);
|
||
this.$emit('change', this.currentValue);
|
||
this.$emit('on-change', this.currentValue);
|
||
this.dispatch('FormItem', 'on-form-change', [this.currentValue]);
|
||
},
|
||
removeSelectedOption: function removeSelectedOption(option) {
|
||
if (this.disabled || this.readonly) return;
|
||
var index = this.currentValue.indexOf(option.value);
|
||
if (index != -1) {
|
||
this.currentValue.splice(index, 1);
|
||
}
|
||
this.finished();
|
||
this.changeCurrentValue();
|
||
},
|
||
|
||
changeSearchValue: util.debounce(function () {
|
||
this.searching = true;
|
||
this.$emit('on-search', this.searchValue);
|
||
this.pagination.current = 0;
|
||
}, 200),
|
||
blur: function blur() {
|
||
console.log('on-blur');
|
||
this.$emit('on-blur');
|
||
if (!this.disabled && !this.readonly && this.clearable) {
|
||
this.showClear = false;
|
||
}
|
||
},
|
||
focus: function focus() {
|
||
this.$emit('on-focus');
|
||
if (!this.disabled && !this.readonly && this.clearable && (this.currentValue != '' || this.currentValue.length > 0)) {
|
||
this.showClear = true;
|
||
}
|
||
},
|
||
toggle: function toggle() {
|
||
this.$emit('on-click');
|
||
if (this.disabled || this.readonly) return;
|
||
this.showList = !this.showList;
|
||
this.$nextTick(function () {
|
||
var bottom = util.getViewport().height - this.$el.getBoundingClientRect().bottom;
|
||
if (!this.listHeight) {
|
||
this.listHeight = this.$refs.list.clientHeight;
|
||
}
|
||
if (bottom - this.listHeight < 0) {
|
||
this.$refs.list.style.top = '-' + (this.listHeight + 10) + 'px';
|
||
} else {
|
||
this.$refs.list.style.top = '32px';
|
||
}
|
||
});
|
||
},
|
||
clear: function clear() {
|
||
if (this.disabled || this.readonly) return;
|
||
this.showClear = false;
|
||
if (!this.multiple) {
|
||
this.currentValue = '';
|
||
} else {
|
||
this.currentValue = [];
|
||
}
|
||
this.searchValue = '';
|
||
this.finished();
|
||
this.changeCurrentValue();
|
||
},
|
||
close: function close() {
|
||
if (this.showList) {
|
||
this.finished();
|
||
this.dispatch('FormItem', 'on-form-blur', [this.currentValue]);
|
||
}
|
||
this.showList = false;
|
||
this.searchValue = '';
|
||
},
|
||
finished: function finished() {
|
||
this.$emit('finished', this.currentValue);
|
||
},
|
||
prev: function prev() {
|
||
if (this.pagination.current > 0) {
|
||
this.pagination.current -= 1;
|
||
this.$nextTick(function () {
|
||
this.$refs.list.scrollTop = 0;
|
||
});
|
||
}
|
||
},
|
||
next: function next() {
|
||
if (this.pagination.current < Math.ceil(this.searchOptions.length / this.pagination.size)) {
|
||
this.pagination.current += 1;
|
||
this.$nextTick(function () {
|
||
this.$refs.list.scrollTop = 0;
|
||
});
|
||
}
|
||
},
|
||
doFocus: function doFocus(option) {
|
||
if (this.focusOption) {
|
||
this.focusOption.isFocus = false;
|
||
}
|
||
option.isFocus = true;
|
||
this.focusOption = option;
|
||
},
|
||
keydown: function keydown(e) {
|
||
if (this.disabled || this.readonly) return;
|
||
if (!this.showList) {
|
||
if (e.keyCode == _keyCode2.default.SPACE || e.keyCode == _keyCode2.default.ENTER || e.keyCode == _keyCode2.default.MAC_ENTER) {
|
||
e.preventDefault();
|
||
this.showList = true;
|
||
}
|
||
} else {
|
||
if (e.keyCode == _keyCode2.default.DOWN || e.keyCode == _keyCode2.default.UP) {
|
||
e.preventDefault();
|
||
this.mouseChooseOption(e.keyCode);
|
||
}
|
||
if (e.keyCode == _keyCode2.default.ENTER || e.keyCode == _keyCode2.default.MAC_ENTER || e.keyCode == _keyCode2.default.SPACE) {
|
||
e.preventDefault();
|
||
if (!this.focusOption) return;
|
||
if (this.focusOption.disabled) return;
|
||
if (this.disableLimit && !this.focusOption.selected) {
|
||
return;
|
||
}
|
||
this.clickOption(this.focusOption);
|
||
this.$refs.selection.focus();
|
||
}
|
||
}
|
||
},
|
||
mouseChooseOption: function mouseChooseOption(direction) {
|
||
var _this4 = this;
|
||
|
||
var index = direction == _keyCode2.default.DOWN ? 0 : this.myOptions.length - 1;
|
||
this.myOptions.forEach(function (item, _index) {
|
||
if (_this4.focusOption && item.value === _this4.focusOption.value) {
|
||
index = direction == _keyCode2.default.DOWN ? _index + 1 : _index - 1;
|
||
if (direction == _keyCode2.default.DOWN) {
|
||
if (index > _this4.myOptions.length - 1) {
|
||
index = 0;
|
||
}
|
||
} else if (direction == _keyCode2.default.UP) {
|
||
if (index < 0) {
|
||
index = _this4.myOptions.length - 1;
|
||
}
|
||
}
|
||
}
|
||
});
|
||
var focusOption = this.myOptions[index];
|
||
if (this.focusOption) {
|
||
this.focusOption.isFocus = false;
|
||
this.focusOption = null;
|
||
}
|
||
focusOption.isFocus = true;
|
||
this.focusOption = focusOption;
|
||
if (this.focusOption.disabled || this.disableLimit && !this.focusOption.selected) {
|
||
this.mouseChooseOption(direction);
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 399 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
directives: [{
|
||
name: "clickoutside",
|
||
rawName: "v-clickoutside",
|
||
value: (_vm.close),
|
||
expression: "close"
|
||
}],
|
||
staticClass: "ui-select",
|
||
class: {
|
||
'ui-select-visible': _vm.showList,
|
||
'ui-select-disabled': _vm.disabled,
|
||
'ui-select-readonly': _vm.readonly,
|
||
'ui-select-multiple': _vm.multiple
|
||
}
|
||
}, [_c('div', {
|
||
ref: "selection",
|
||
staticClass: "ui-select-selection",
|
||
attrs: {
|
||
"tabindex": _vm.getTabindex
|
||
},
|
||
on: {
|
||
"click": _vm.toggle,
|
||
"mouseenter": _vm.focus,
|
||
"focus": _vm.focus,
|
||
"mouseleave": _vm.blur,
|
||
"blur": _vm.blur,
|
||
"keydown": _vm.keydown
|
||
}
|
||
}, [(_vm.multiple) ? [(_vm.currentValue === '' || _vm.currentValue.length == 0) ? _c('span', {
|
||
staticClass: "ui-select-placeholder"
|
||
}, [_vm._v("\n " + _vm._s(_vm.placeholder || _vm.localPlaceholder) + "\n ")]) : [_c('div', {
|
||
staticClass: "ui-select-multiple-selected"
|
||
}, _vm._l((_vm.selectedOption), function(option, index) {
|
||
return _c('span', {
|
||
key: index,
|
||
staticClass: "ui-select-selected-value"
|
||
}, [_vm._v("\n " + _vm._s(option.currentLabel) + "\n "), _c('Icon', {
|
||
attrs: {
|
||
"type": "md-close"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.removeSelectedOption(option)
|
||
}
|
||
}
|
||
})], 1)
|
||
}), 0)]] : [_c('span', {
|
||
class: _vm.getUISelectClass,
|
||
on: {
|
||
"mouseenter": _vm.handleTitleAttr
|
||
}
|
||
}, [_vm._v("\n " + _vm._s((_vm.selectedOption && _vm.selectedOption.currentLabel) ||
|
||
_vm.placeholder ||
|
||
_vm.localPlaceholder) + "\n ")])], _vm._v(" "), _c('div', {
|
||
staticClass: "ui-select-selection-icons"
|
||
}, [_c('Icon', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (!_vm.showClear),
|
||
expression: "!showClear"
|
||
}],
|
||
attrs: {
|
||
"type": "md-arrow-dropdown"
|
||
}
|
||
}), _vm._v(" "), (_vm.clearable) ? _c('Icon', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.showClear),
|
||
expression: "showClear"
|
||
}],
|
||
attrs: {
|
||
"type": "md-close-circle"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.clear($event)
|
||
}
|
||
}
|
||
}) : _vm._e()], 1)], 2), _vm._v(" "), _c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.showList),
|
||
expression: "showList"
|
||
}],
|
||
ref: "list",
|
||
staticClass: "ui-select-dropdown",
|
||
class: {
|
||
'no-option-children': _vm.noChildren
|
||
},
|
||
attrs: {
|
||
"transition": "slide"
|
||
}
|
||
}, [(_vm.filterable) ? [_c('input', {
|
||
directives: [{
|
||
name: "model",
|
||
rawName: "v-model",
|
||
value: (_vm.searchValue),
|
||
expression: "searchValue"
|
||
}],
|
||
ref: "searchInput",
|
||
staticClass: "ui-select-selected-input",
|
||
attrs: {
|
||
"placeholder": _vm.t('el.select.searchPlaceholder')
|
||
},
|
||
domProps: {
|
||
"value": (_vm.searchValue)
|
||
},
|
||
on: {
|
||
"input": [function($event) {
|
||
if ($event.target.composing) { return; }
|
||
_vm.searchValue = $event.target.value
|
||
}, _vm.changeSearchValue],
|
||
"keydown": _vm.keydown
|
||
}
|
||
})] : _vm._e(), _vm._v(" "), _c('ul', {
|
||
staticClass: "ui-select-dropdown-list",
|
||
on: {
|
||
"click": _vm.selectOption
|
||
}
|
||
}, [_vm._t("default"), _vm._v(" "), (_vm.noChildren) ? [_vm._l((_vm.currentOptions), function(item, index) {
|
||
return _c('li', {
|
||
key: index,
|
||
staticClass: "ui-select-item",
|
||
class: {
|
||
'ui-select-item-selected': item.selected,
|
||
'ui-select-item-disabled':
|
||
item.disabled ||
|
||
(_vm.disableLimit && !item.selected),
|
||
focus: item.isFocus
|
||
},
|
||
attrs: {
|
||
"data-key": item.value
|
||
},
|
||
on: {
|
||
"mouseenter": _vm.handleTitleAttr,
|
||
"mouseover": function($event) {
|
||
return _vm.doFocus(item)
|
||
}
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(item.text) + "\n ")])
|
||
}), _vm._v(" "), _c('li', {
|
||
staticClass: "ui-select-pagination"
|
||
}, [_c('wb-button', {
|
||
attrs: {
|
||
"disabled": _vm.pagination.current == 0,
|
||
"icon": "md-arrow-back",
|
||
"type": "text"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.prev($event)
|
||
}
|
||
}
|
||
}), _vm._v(" "), _c('wb-button', {
|
||
attrs: {
|
||
"disabled": _vm.pagination.current ==
|
||
Math.ceil(
|
||
_vm.searchOptions.length / _vm.pagination.size
|
||
) -
|
||
1,
|
||
"icon": "md-arrow-forward",
|
||
"type": "text"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.next($event)
|
||
}
|
||
}
|
||
})], 1)] : _vm._e()], 2)], 2)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-5e88339e", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 400 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(401),
|
||
/* template */
|
||
__webpack_require__(402),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/select/option.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] option.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-f56255ac", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-f56255ac", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 401 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
exports.default = {
|
||
name: 'SelectOption',
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
value: {
|
||
type: [String, Number],
|
||
required: true
|
||
},
|
||
label: {
|
||
type: [String, Number],
|
||
default: undefined
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
currentLabel: this.label,
|
||
wbSelect: (0, _util.findComponentUpward)(this, 'WbSelect'),
|
||
isFocus: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
selected: function selected() {
|
||
if (this.wbSelect.multiple) {
|
||
return util.isArray(this.wbSelect.currentValue) && this.wbSelect.currentValue.indexOf(this.value) != -1;
|
||
}
|
||
return this.wbSelect.currentValue == this.value;
|
||
},
|
||
show: function show() {
|
||
if (this.wbSelect.searchValue && this.currentLabel) {
|
||
return this.currentLabel.indexOf(this.wbSelect.searchValue) != -1;
|
||
}
|
||
return true;
|
||
}
|
||
},
|
||
created: function created() {
|
||
if (this.wbSelect) {
|
||
this.wbSelect.addOption(this);
|
||
} else {
|
||
(0, _util.findComponentUpward)(this, 'WbSelect').addOption(this);
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
this.currentLabel = this.label || this.$el.innerText || this.value;
|
||
},
|
||
updated: function updated() {
|
||
this.currentLabel = this.label || this.$el.innerText || this.value;
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
if (this.wbSelect) {
|
||
this.wbSelect.removeOption(this);
|
||
} else {
|
||
(0, _util.findComponentUpward)(this, 'WbSelect').removeOption(this);
|
||
}
|
||
},
|
||
|
||
methods: {
|
||
mouseenter: function mouseenter(e) {
|
||
if (e.target.clientWidth < e.target.scrollWidth) {
|
||
// 因为 currentLabel 可能不是文本,需要加一层判断
|
||
if (typeof this.currentLabel === 'string') {
|
||
e.target.setAttribute('title', this.currentLabel.trim());
|
||
}
|
||
} else {
|
||
e.target.setAttribute('title', '');
|
||
}
|
||
},
|
||
focus: function focus() {
|
||
if (this.wbSelect.focusOption) {
|
||
this.wbSelect.focusOption.isFocus = false;
|
||
}
|
||
this.isFocus = true;
|
||
this.wbSelect.focusOption = this;
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 402 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('li', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.show),
|
||
expression: "show"
|
||
}],
|
||
staticClass: "ui-select-item",
|
||
class: {
|
||
'ui-select-item-selected': _vm.selected,
|
||
'ui-select-item-disabled': _vm.disabled || (_vm.wbSelect.disableLimit && !_vm.selected),
|
||
'focus': _vm.isFocus
|
||
},
|
||
attrs: {
|
||
"data-key": _vm.value
|
||
},
|
||
on: {
|
||
"mouseover": _vm.focus,
|
||
"mouseenter": _vm.mouseenter
|
||
}
|
||
}, [_vm._t("default", [_vm._v(_vm._s(_vm.currentLabel))])], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-f56255ac", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 403 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(404),
|
||
/* template */
|
||
__webpack_require__(405),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/select/optionGroup.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] optionGroup.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-1aad1a25", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-1aad1a25", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 404 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
props: {
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
readonly: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 405 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div')
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-1aad1a25", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 406 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(407),
|
||
/* template */
|
||
__webpack_require__(412),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/input/input.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] input.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-7f8a54f2", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-7f8a54f2", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 407 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _isNan = __webpack_require__(408);
|
||
|
||
var _isNan2 = _interopRequireDefault(_isNan);
|
||
|
||
var _autoRow = __webpack_require__(411);
|
||
|
||
var _autoRow2 = _interopRequireDefault(_autoRow);
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _mixin = __webpack_require__(12);
|
||
|
||
var _mixin2 = _interopRequireDefault(_mixin);
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Input',
|
||
components: {
|
||
Icon: _icon2.default
|
||
},
|
||
directives: {
|
||
autoRow: _autoRow2.default
|
||
},
|
||
mixins: [_emitter2.default, _mixin2.default],
|
||
props: {
|
||
value: {
|
||
type: [Number, String, File],
|
||
default: ''
|
||
},
|
||
type: {
|
||
type: String,
|
||
default: 'text'
|
||
},
|
||
placeholder: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
readonly: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
clearable: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
maxlength: {
|
||
type: Number,
|
||
default: undefined
|
||
},
|
||
icon: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
rows: {
|
||
type: Number,
|
||
default: undefined
|
||
},
|
||
width: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
name: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
autocomplete: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
autosize: {
|
||
type: [Boolean, Object],
|
||
default: undefined
|
||
},
|
||
accept: {
|
||
type: String,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
currentValue: this.value,
|
||
password: false,
|
||
textarea: false,
|
||
showPassword: true,
|
||
prepend: true,
|
||
append: true,
|
||
currentType: this.type,
|
||
over: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
isNormal: function isNormal() {
|
||
return ['text', 'password', 'number'].indexOf(this.currentType) != -1;
|
||
},
|
||
getClass: function getClass() {
|
||
var arr = ['ui-input-' + this.currentType];
|
||
if (this.prepend || this.append) {
|
||
arr.push('ui-input-group');
|
||
this.prepend && arr.push('ui-input-group-prepend');
|
||
this.append && arr.push('ui-input-group-append');
|
||
}
|
||
if (this.readonly) {
|
||
arr.push('ui-input-readonly');
|
||
}
|
||
if (this.disabled) {
|
||
arr.push('ui-input-disabled');
|
||
}
|
||
return arr;
|
||
},
|
||
getStyle: function getStyle() {
|
||
if (this.width) {
|
||
return {
|
||
width: this.width
|
||
};
|
||
}
|
||
return null;
|
||
}
|
||
},
|
||
watch: {
|
||
value: function value(val) {
|
||
this.setCurrentValue(val);
|
||
}
|
||
},
|
||
created: function created() {
|
||
if (this.currentType !== 'textarea') {
|
||
this.prepend = this.$slots.prepend !== undefined;
|
||
this.append = this.$slots.append !== undefined;
|
||
} else {
|
||
this.prepend = false;
|
||
this.append = false;
|
||
}
|
||
this.slotReady = true;
|
||
|
||
if (this.currentType == 'password') {
|
||
this.password = true;
|
||
} else if (this.currentType == 'textarea') {
|
||
this.textarea = true;
|
||
}
|
||
},
|
||
|
||
methods: {
|
||
handleDelete: function handleDelete(event) {
|
||
// IE9删除时不触发input事件
|
||
if (navigator.userAgent.indexOf('MSIE 9') === -1) return;
|
||
this.handleInput(event);
|
||
},
|
||
handleIconClick: function handleIconClick(event) {
|
||
if (this.readonly || this.disabled) {
|
||
return;
|
||
}
|
||
this.$emit('on-click', event);
|
||
},
|
||
handleEnter: function handleEnter(event) {
|
||
this.$emit('on-enter', event);
|
||
},
|
||
handleFocus: function handleFocus(event) {
|
||
this.$emit('on-focus', event);
|
||
},
|
||
handleBlur: function handleBlur(event) {
|
||
this.$emit('on-blur', event);
|
||
this.dispatch('FormItem', 'on-form-blur', [this.currentValue]);
|
||
},
|
||
handleInput: function handleInput(event) {
|
||
if (this.disabled || this.readonly) return;
|
||
var value = event.target.value;
|
||
if (this.number) value = (0, _isNan2.default)(Number(value)) ? value : Number(value);
|
||
this.$emit('input', value, event);
|
||
this.$emit('on-input', value, event);
|
||
this.$emit('on-change', value, event);
|
||
this.setCurrentValue(value);
|
||
},
|
||
changeInputType: function changeInputType() {
|
||
this.showPassword = !this.showPassword;
|
||
this.currentType = this.showPassword ? 'password' : 'text';
|
||
},
|
||
setCurrentValue: function setCurrentValue(value) {
|
||
if (value === this.currentValue) return;
|
||
this.currentValue = value;
|
||
this.dispatch('FormItem', 'on-form-change', [this.currentValue]);
|
||
},
|
||
click: function click(e) {
|
||
this.$emit('click', e);
|
||
},
|
||
chooseFile: function chooseFile() {
|
||
this.$refs.input.click();
|
||
},
|
||
updateFile: function updateFile(e) {
|
||
if (this.disabled || this.readonly) return;
|
||
var files = e.target.files;
|
||
this.setCurrentValue(files[0]);
|
||
this.$emit('input', files[0], e);
|
||
this.$emit('on-change', files[0], e);
|
||
e.target.value = '';
|
||
},
|
||
clear: function clear() {
|
||
if (this.disabled || this.readonly) return;
|
||
if (this.currentValue === '') return;
|
||
this.$emit('input', '');
|
||
this.$emit('on-input', '');
|
||
this.$emit('on-change', '');
|
||
this.setCurrentValue('');
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 408 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = { "default": __webpack_require__(409), __esModule: true };
|
||
|
||
/***/ }),
|
||
/* 409 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(410);
|
||
module.exports = __webpack_require__(6).Number.isNaN;
|
||
|
||
|
||
/***/ }),
|
||
/* 410 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
// 20.1.2.4 Number.isNaN(number)
|
||
var $export = __webpack_require__(14);
|
||
|
||
$export($export.S, 'Number', {
|
||
isNaN: function isNaN(number) {
|
||
// eslint-disable-next-line no-self-compare
|
||
return number != number;
|
||
}
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
/* 411 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _typeof2 = __webpack_require__(31);
|
||
|
||
var _typeof3 = _interopRequireDefault(_typeof2);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
var cache = {};
|
||
var key = 1;
|
||
exports.default = {
|
||
inserted: function inserted(el, binding) {
|
||
el.autoRowKey = key++;
|
||
var self = cache[el.autoRowKey] = {};
|
||
// 例如,添加事件处理器或只需要运行一次的高耗任务
|
||
self.handler = function () {
|
||
var config = void 0;
|
||
if (util.isObject(binding.value) && binding.value.min && binding.value.max) {
|
||
config = binding.value;
|
||
} else if (binding.value === true) {
|
||
config = { min: 2, max: 1000000 };
|
||
} else {
|
||
return;
|
||
}
|
||
var style = window.getComputedStyle(el, null);
|
||
var paddingTop = parseInt(style.paddingTop);
|
||
var paddingBottom = parseInt(style.paddingBottom);
|
||
var baseLineHeight = parseInt(style.lineHeight);
|
||
var borderWidth = parseInt(style.borderBottomWidth) + parseInt(style.borderTopWidth);
|
||
var po = paddingTop + paddingBottom;
|
||
var baseHeight = baseLineHeight * config.min;
|
||
el.style.height = baseHeight + po + borderWidth + 'px';
|
||
var scrollVal = el.scrollHeight;
|
||
if (scrollVal - po >= baseLineHeight * config.max) {
|
||
scrollVal = baseLineHeight * config.max + po;
|
||
}
|
||
if (util.isIEVersion(9)) {
|
||
// ie9读取不到baseLine值
|
||
baseLineHeight = baseHeight < 12 ? 12 : baseHeight;
|
||
el.style.height = baseLineHeight * config.max + po + borderWidth + 'px';
|
||
return;
|
||
}if (util.isIEVersion(10)) {
|
||
// ie10读取不到scrollHieght值
|
||
return;
|
||
}
|
||
el.style.height = scrollVal + borderWidth + 'px';
|
||
};
|
||
self.handler();
|
||
},
|
||
update: function update(el) {
|
||
// 值更新时的工作
|
||
// 也会以初始值为参数调用一次
|
||
if (el._value === null && (0, _typeof3.default)(el._value) === 'object') return;
|
||
var self = cache[el.autoRowKey];
|
||
if (self) {
|
||
el.style.overflow = 'hidden';
|
||
self.handler();
|
||
el.style.overflow = 'auto';
|
||
}
|
||
},
|
||
unbind: function unbind(el) {
|
||
// 清理工作
|
||
// 例如,删除 bind() 添加的事件监听器
|
||
var self = cache[el.autoRowKey];
|
||
if (self) {
|
||
el.removeEventListener('input', self.handler);
|
||
el.removeEventListener('keydown', self.keydown);
|
||
el.removeEventListener('keyup', self.keyup);
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 412 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-input-swap",
|
||
class: _vm.getClass,
|
||
style: (_vm.getStyle)
|
||
}, [(_vm.prepend) ? _c('div', {
|
||
ref: "prepend",
|
||
staticClass: "ui-input-prepend"
|
||
}, [_vm._t("prepend")], 2) : _vm._e(), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-input-content",
|
||
on: {
|
||
"mouseenter": function($event) {
|
||
_vm.over = true
|
||
},
|
||
"mouseleave": function($event) {
|
||
_vm.over = false
|
||
}
|
||
}
|
||
}, [(_vm.icon) ? [_c('Icon', {
|
||
staticClass: "ui-input-icon",
|
||
attrs: {
|
||
"type": _vm.icon
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.handleIconClick($event)
|
||
}
|
||
}
|
||
})] : _vm._e(), _vm._v(" "), (_vm.password) ? [(_vm.showPassword) ? _c('Icon', {
|
||
staticClass: "ui-input-icon",
|
||
attrs: {
|
||
"type": "md-eye"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.changeInputType($event)
|
||
}
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), (!_vm.showPassword) ? _c('Icon', {
|
||
staticClass: "ui-input-icon",
|
||
attrs: {
|
||
"type": "md-eye-off"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.changeInputType($event)
|
||
}
|
||
}
|
||
}) : _vm._e()] : _vm._e(), _vm._v(" "), (_vm.clearable && !_vm.readonly && !_vm.disabled && _vm.over) ? [_c('Icon', {
|
||
staticClass: "ui-input-icon",
|
||
attrs: {
|
||
"type": "md-close-circle"
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.clear($event)
|
||
}
|
||
}
|
||
})] : _vm._e(), _vm._v(" "), (_vm.isNormal) ? [_c('input', {
|
||
staticClass: "ui-input",
|
||
attrs: {
|
||
"maxlength": _vm.maxlength,
|
||
"readonly": _vm.readonly,
|
||
"type": _vm.currentType,
|
||
"disabled": _vm.disabled,
|
||
"placeholder": _vm.placeholder,
|
||
"autocomplete": _vm.autocomplete,
|
||
"name": _vm.name
|
||
},
|
||
domProps: {
|
||
"value": _vm.currentValue
|
||
},
|
||
on: {
|
||
"keyup": [function($event) {
|
||
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { return null; }
|
||
return _vm.handleEnter($event)
|
||
}, function($event) {
|
||
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "delete", [8, 46], $event.key, ["Backspace", "Delete", "Del"])) { return null; }
|
||
return _vm.handleDelete($event)
|
||
}],
|
||
"focus": _vm.handleFocus,
|
||
"blur": _vm.handleBlur,
|
||
"input": _vm.handleInput,
|
||
"click": _vm.click
|
||
}
|
||
})] : _vm._e(), _vm._v(" "), (_vm.type == 'file') ? [_c('div', {
|
||
staticClass: "ui-upload"
|
||
}, [_c('Wb-button', {
|
||
attrs: {
|
||
"disabled": _vm.disabled || _vm.readonly,
|
||
"type": "ghost",
|
||
"icon": "md-cloud-upload"
|
||
},
|
||
on: {
|
||
"click": _vm.chooseFile
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(_vm.placeholder || _vm.t('el.input.chooseFile')) + "\n ")]), _vm._v(" "), _c('span', {
|
||
staticClass: "ui-input-file-text"
|
||
}, [_vm._v(_vm._s(_vm.currentValue && _vm.currentValue.name))]), _vm._v(" "), _c('input', {
|
||
ref: "input",
|
||
staticClass: "ui-upload-file",
|
||
attrs: {
|
||
"accept": _vm.accept,
|
||
"type": "file"
|
||
},
|
||
on: {
|
||
"change": _vm.updateFile
|
||
}
|
||
})], 1)] : _vm._e(), _vm._v(" "), (_vm.textarea) ? [_c('textarea', {
|
||
directives: [{
|
||
name: "auto-row",
|
||
rawName: "v-auto-row",
|
||
value: (_vm.autosize),
|
||
expression: "autosize"
|
||
}],
|
||
staticClass: "ui-input",
|
||
attrs: {
|
||
"rows": _vm.rows,
|
||
"maxlength": _vm.maxlength,
|
||
"readonly": _vm.readonly,
|
||
"disabled": _vm.disabled,
|
||
"placeholder": _vm.placeholder
|
||
},
|
||
domProps: {
|
||
"value": _vm.currentValue
|
||
},
|
||
on: {
|
||
"keyup": [function($event) {
|
||
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { return null; }
|
||
return _vm.handleEnter($event)
|
||
}, function($event) {
|
||
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "delete", [8, 46], $event.key, ["Backspace", "Delete", "Del"])) { return null; }
|
||
return _vm.handleDelete($event)
|
||
}],
|
||
"focus": _vm.handleFocus,
|
||
"blur": _vm.handleBlur,
|
||
"input": _vm.handleInput,
|
||
"click": _vm.click
|
||
}
|
||
})] : _vm._e()], 2), _vm._v(" "), (_vm.append) ? _c('div', {
|
||
ref: "append",
|
||
staticClass: "ui-input-append"
|
||
}, [_vm._t("append")], 2) : _vm._e()])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-7f8a54f2", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 413 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('ul', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.total > 0),
|
||
expression: "total > 0"
|
||
}],
|
||
staticClass: "ui-page"
|
||
}, [_c('li', {
|
||
staticClass: "ui-page-prev",
|
||
attrs: {
|
||
"title": _vm.t('el.pagination.prev')
|
||
},
|
||
on: {
|
||
"click": _vm.last
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "ios-arrow-back"
|
||
}
|
||
})], 1), _vm._v(" "), (_vm.showFirst) ? _c('li', {
|
||
staticClass: "ui-page-item",
|
||
attrs: {
|
||
"title": _vm.t('el.pagination.first')
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.go(1)
|
||
}
|
||
}
|
||
}, [_vm._v("\n 1\n ")]) : _vm._e(), _vm._v(" "), (_vm.showFirst) ? _c('li', {
|
||
staticClass: "ui-page-item-jump-prev",
|
||
attrs: {
|
||
"title": _vm.t('el.pagination.pprev', {
|
||
n: _vm.len
|
||
})
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.prev()
|
||
}
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "ios-arrow-back"
|
||
}
|
||
}), _vm._v(" "), _c('Icon', {
|
||
staticClass: "second-icon",
|
||
attrs: {
|
||
"type": "ios-arrow-back"
|
||
}
|
||
})], 1) : _vm._e(), _vm._v(" "), _vm._l((_vm.codes), function(code, index) {
|
||
return _c('li', {
|
||
key: index,
|
||
staticClass: "ui-page-item",
|
||
class: {
|
||
'ui-page-item-active': _vm.myCurrent == code
|
||
},
|
||
attrs: {
|
||
"title": _vm.t('el.pagination.n', {
|
||
n: code
|
||
})
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.go(code)
|
||
}
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(code) + "\n ")])
|
||
}), _vm._v(" "), (_vm.showLast) ? _c('li', {
|
||
staticClass: "ui-page-item-jump-next",
|
||
attrs: {
|
||
"title": _vm.t('el.pagination.nnext', {
|
||
n: _vm.len
|
||
})
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.nnext()
|
||
}
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "ios-arrow-forward"
|
||
}
|
||
}), _vm._v(" "), _c('Icon', {
|
||
staticClass: "second-icon",
|
||
attrs: {
|
||
"type": "ios-arrow-forward"
|
||
}
|
||
})], 1) : _vm._e(), _vm._v(" "), (_vm.showLast) ? _c('li', {
|
||
staticClass: "ui-page-item",
|
||
attrs: {
|
||
"title": _vm.t('el.pagination.last')
|
||
},
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.go(_vm.total)
|
||
}
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(_vm.total) + "\n ")]) : _vm._e(), _vm._v(" "), _c('li', {
|
||
staticClass: "ui-page-next",
|
||
attrs: {
|
||
"title": _vm.t('el.pagination.next')
|
||
},
|
||
on: {
|
||
"click": _vm.next
|
||
}
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "ios-arrow-forward"
|
||
}
|
||
})], 1), _vm._v(" "), (_vm.showSizeChanger) ? _c('li', {
|
||
staticClass: "ui-page-select"
|
||
}, [_c('wb-select', {
|
||
attrs: {
|
||
"clearable": false
|
||
},
|
||
on: {
|
||
"on-change": _vm.changePageSize
|
||
},
|
||
model: {
|
||
value: (_vm.mySize),
|
||
callback: function($$v) {
|
||
_vm.mySize = $$v
|
||
},
|
||
expression: "mySize"
|
||
}
|
||
}, _vm._l((_vm.pageSizeList), function(i, index) {
|
||
return _c('wb-option', {
|
||
key: index,
|
||
attrs: {
|
||
"value": i
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(_vm.t("el.pagination.select", {
|
||
n: i
|
||
})) + "\n ")])
|
||
}), 1)], 1) : _vm._e(), _vm._v(" "), (_vm.showQuickJumper) ? _c('li', {
|
||
staticClass: "ui-page-quick-jumper",
|
||
on: {
|
||
"keydown": function($event) {
|
||
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { return null; }
|
||
return _vm.jumper($event)
|
||
}
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(_vm.t("el.pagination.jumper.pre")) + "\n "), _c('wb-input', {
|
||
staticClass: "jumper-input",
|
||
model: {
|
||
value: (_vm.jumperPage),
|
||
callback: function($$v) {
|
||
_vm.jumperPage = $$v
|
||
},
|
||
expression: "jumperPage"
|
||
}
|
||
}), _vm._v("\n " + _vm._s(_vm.t("el.pagination.jumper.next")) + "\n ")], 1) : _vm._e()], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-71ca1bf1", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 414 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _radio = __webpack_require__(415);
|
||
|
||
var _radio2 = _interopRequireDefault(_radio);
|
||
|
||
var _radioGroup = __webpack_require__(418);
|
||
|
||
var _radioGroup2 = _interopRequireDefault(_radioGroup);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
Radio: _radio2.default,
|
||
RadioGroup: _radioGroup2.default
|
||
};
|
||
|
||
/***/ }),
|
||
/* 415 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(416),
|
||
/* template */
|
||
__webpack_require__(417),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/radio-com/radio.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] radio.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-51b9e246", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-51b9e246", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 416 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var _keyCode = __webpack_require__(19);
|
||
|
||
var _keyCode2 = _interopRequireDefault(_keyCode);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Radio',
|
||
props: {
|
||
value: {
|
||
type: [String, Number, Boolean],
|
||
default: false
|
||
},
|
||
label: {
|
||
type: [String, Number],
|
||
default: undefined
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
readonly: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
name: '',
|
||
group: false,
|
||
checked: this.value,
|
||
tabindex: 0,
|
||
parent: (0, _util.findComponentUpward)(this, 'RadioGroup'),
|
||
isFoucs: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getClass: function getClass() {
|
||
var arr = [];
|
||
if (this.checked) {
|
||
arr.push('ui-radio-wrapper-checked');
|
||
}
|
||
if (this.readonly || this.parent && this.parent.readonly) {
|
||
arr.push('ui-radio-wrapper-readonly');
|
||
}
|
||
if (this.disabled || this.parent && this.parent.disabled) {
|
||
arr.push('ui-radio-wrapper-disabled');
|
||
}
|
||
if (this.isFoucs) {
|
||
arr.push('ui-radio-wrapper-focus');
|
||
}
|
||
return arr;
|
||
}
|
||
},
|
||
watch: {
|
||
value: function value(_value) {
|
||
if (!this.group) {
|
||
this.checked = _value;
|
||
this.$emit('change', this.checked);
|
||
this.$emit('on-change', this.checked);
|
||
}
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
if (this.parent) {
|
||
this.checked = false;
|
||
this.tabindex = -1;
|
||
this.parent.addItem(this);
|
||
}
|
||
},
|
||
|
||
methods: {
|
||
click: function click() {
|
||
if (this.disabled || this.readonly || this.parent && this.parent.disabled || this.parent && this.parent.readonly) {
|
||
return false;
|
||
}
|
||
if (this.group) {
|
||
if (this.checked) {
|
||
return false;
|
||
}
|
||
this.parent.change(this.value);
|
||
} else {
|
||
this.checked = !this.checked;
|
||
this.$emit('click', this.checked);
|
||
this.$emit('input', this.checked);
|
||
this.$emit('change', this.checked);
|
||
this.$emit('on-change', this.checked);
|
||
}
|
||
},
|
||
keydown: function keydown(e) {
|
||
if (this.disabled || this.readonly || this.parent && this.parent.disabled || this.parent && this.parent.readonly) {
|
||
return false;
|
||
}
|
||
if (this.group) {
|
||
return;
|
||
}
|
||
if (e.keyCode == _keyCode2.default.ENTER || e.keyCode == _keyCode2.default.MAC_ENTER || e.keyCode == _keyCode2.default.SPACE) {
|
||
e.preventDefault();
|
||
this.click();
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 417 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('label', {
|
||
staticClass: "ui-radio-wrapper",
|
||
class: _vm.getClass,
|
||
attrs: {
|
||
"tabindex": _vm.tabindex
|
||
},
|
||
on: {
|
||
"click": _vm.click,
|
||
"keydown": _vm.keydown
|
||
}
|
||
}, [_c('span', {
|
||
staticClass: "ui-radio",
|
||
class: {
|
||
'ui-radio-checked': _vm.checked
|
||
}
|
||
}, [_c('span', {
|
||
staticClass: "ui-radio-inner"
|
||
})]), _vm._v(" "), _c('span', {
|
||
staticClass: "ui-radio-content"
|
||
}, [_vm._t("default", [_vm._v(_vm._s(_vm.label))])], 2)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-51b9e246", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 418 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(419),
|
||
/* template */
|
||
__webpack_require__(420),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/radio-com/radioGroup.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] radioGroup.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-4307f852", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-4307f852", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 419 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _keyCode = __webpack_require__(19);
|
||
|
||
var _keyCode2 = _interopRequireDefault(_keyCode);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'RadioGroup',
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
value: {
|
||
type: [String, Number, Boolean],
|
||
default: ''
|
||
},
|
||
vertical: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
type: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
readonly: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
name: 'RadioGroup_' + new Date().getTime(),
|
||
currentValue: this.value,
|
||
options: [],
|
||
selectedOption: null,
|
||
focusIndex: null
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getClass: function getClass() {
|
||
var arr = [];
|
||
if (this.vertical) {
|
||
arr.push('ui-radio-group-vertical');
|
||
}
|
||
if (this.type) {
|
||
arr.push('ui-radio-group-' + this.type);
|
||
}
|
||
return arr;
|
||
}
|
||
},
|
||
watch: {
|
||
value: function value(val) {
|
||
if (val === this.currentValue) return;
|
||
this.currentValue = val;
|
||
this.changeValue(this.currentValue);
|
||
},
|
||
focusIndex: function focusIndex(val, old) {
|
||
if (this.$children[old]) this.$children[old].isFoucs = false;
|
||
if (this.$children[val]) this.$children[val].isFoucs = true;
|
||
}
|
||
},
|
||
methods: {
|
||
addItem: function addItem(radio) {
|
||
radio.name = this.name;
|
||
radio.group = true;
|
||
this.options.push(radio);
|
||
this.init(this.currentValue);
|
||
},
|
||
changeValue: function changeValue(val) {
|
||
if (this.selectedOption) {
|
||
this.selectedOption.checked = false;
|
||
this.selectedOption = null;
|
||
}
|
||
this.init(val);
|
||
this.$emit('input', val);
|
||
this.$emit('change', val);
|
||
this.$emit('on-change', val);
|
||
this.dispatch('FormItem', 'on-form-change', [val]);
|
||
},
|
||
init: function init(value) {
|
||
var _this = this;
|
||
|
||
if (this.options) {
|
||
this.options.forEach(function (option) {
|
||
if (option.value === value) {
|
||
option.checked = true;
|
||
_this.selectedOption = option;
|
||
}
|
||
});
|
||
}
|
||
},
|
||
|
||
// 提供给子组件调用
|
||
change: function change(value) {
|
||
if (this.currentValue == value) {
|
||
this.currentValue = '';
|
||
} else {
|
||
this.currentValue = value;
|
||
}
|
||
this.changeValue(this.currentValue);
|
||
},
|
||
keydown: function keydown(e) {
|
||
if (this.disabled || this.readonly) return;
|
||
if (e.keyCode == _keyCode2.default.DOWN || e.keyCode == _keyCode2.default.RIGHT) {
|
||
e.preventDefault();
|
||
this.focusIndex += 1;
|
||
if (this.focusIndex > this.$children.length - 1) {
|
||
this.focusIndex = 0;
|
||
}
|
||
var option = this.$children[this.focusIndex];
|
||
if (option.disabled || option.readonly) {
|
||
this.keydown(e);
|
||
} else {
|
||
option.click();
|
||
}
|
||
}
|
||
if (e.keyCode == _keyCode2.default.UP || e.keyCode == _keyCode2.default.LEFT) {
|
||
e.preventDefault();
|
||
this.focusIndex -= 1;
|
||
if (this.focusIndex < 0) {
|
||
this.focusIndex = this.$children.length - 1;
|
||
}
|
||
var _option = this.$children[this.focusIndex];
|
||
if (_option.disabled || _option.readonly) {
|
||
this.keydown(e);
|
||
} else {
|
||
_option.click();
|
||
}
|
||
}
|
||
if (e.keyCode == _keyCode2.default.ENTER || e.keyCode == _keyCode2.default.MAC_ENTER || e.keyCode == _keyCode2.default.SPACE) {
|
||
e.preventDefault();
|
||
var _option2 = this.$children[this.focusIndex];
|
||
if (_option2) _option2.click();
|
||
}
|
||
},
|
||
focus: function focus() {
|
||
if (this.disabled || this.readonly) return;
|
||
var len = this.$children.length;
|
||
if (len > 0) {
|
||
this.focusIndex = 0;
|
||
}
|
||
},
|
||
blur: function blur() {
|
||
this.focusIndex = null;
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 420 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-radio-group",
|
||
class: _vm.getClass,
|
||
attrs: {
|
||
"tabindex": "0"
|
||
},
|
||
on: {
|
||
"keydown": _vm.keydown,
|
||
"focus": _vm.focus,
|
||
"blur": _vm.blur
|
||
}
|
||
}, [_vm._t("default")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-4307f852", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 421 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _checkbox = __webpack_require__(422);
|
||
|
||
var _checkbox2 = _interopRequireDefault(_checkbox);
|
||
|
||
var _checkboxGroup = __webpack_require__(425);
|
||
|
||
var _checkboxGroup2 = _interopRequireDefault(_checkboxGroup);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
Checkbox: _checkbox2.default,
|
||
CheckboxGroup: _checkboxGroup2.default
|
||
};
|
||
|
||
/***/ }),
|
||
/* 422 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(423),
|
||
/* template */
|
||
__webpack_require__(424),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/checkbox-com/checkbox.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] checkbox.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-abb759c6", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-abb759c6", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 423 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var _keyCode = __webpack_require__(19);
|
||
|
||
var _keyCode2 = _interopRequireDefault(_keyCode);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'CheckBox',
|
||
props: {
|
||
value: {
|
||
type: [String, Number, Boolean],
|
||
default: false
|
||
},
|
||
label: {
|
||
type: [String, Number],
|
||
default: undefined
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
readonly: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
var parent = (0, _util.findComponentUpward)(this, 'CheckboxGroup');
|
||
return {
|
||
name: '',
|
||
checked: parent ? false : this.value,
|
||
group: false,
|
||
parent: parent,
|
||
tabindex: 0,
|
||
isFoucs: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getClass: function getClass() {
|
||
var arr = [];
|
||
if (this.checked) {
|
||
arr.push('ui-checkbox-wrapper-checked');
|
||
}
|
||
if (this.readonly || this.parent && this.parent.readonly) {
|
||
arr.push('ui-checkbox-wrapper-readonly');
|
||
}
|
||
if (this.disabled || this.parent && this.parent.disabled) {
|
||
arr.push('ui-checkbox-wrapper-disabled');
|
||
}
|
||
if (this.isFoucs) {
|
||
arr.push('ui-checkbox-wrapper-focus');
|
||
}
|
||
return arr;
|
||
}
|
||
},
|
||
watch: {
|
||
value: function value(_value) {
|
||
if (!this.group && this.checked != _value) {
|
||
this.checked = _value;
|
||
this.$emit('change', this.checked);
|
||
this.$emit('on-change', this.checked);
|
||
}
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
if (this.parent) {
|
||
if (this.parent.currentValue.indexOf(this.value) != -1) {
|
||
this.checked = true;
|
||
} else {
|
||
this.checked = false;
|
||
}
|
||
this.parent.addItem(this);
|
||
this.tabindex = -1;
|
||
}
|
||
},
|
||
|
||
methods: {
|
||
click: function click() {
|
||
if (this.disabled || this.readonly || this.parent && this.parent.disabled || this.parent && this.parent.readonly) {
|
||
return false;
|
||
}
|
||
this.checked = !this.checked;
|
||
if (this.group) {
|
||
this.parent.change(this.value, this.checked);
|
||
} else {
|
||
this.$emit('click', this.checked);
|
||
this.$emit('input', this.checked);
|
||
this.$emit('change', this.checked);
|
||
this.$emit('on-change', this.checked);
|
||
}
|
||
},
|
||
keydown: function keydown(e) {
|
||
if (this.disabled || this.readonly || this.parent && this.parent.disabled || this.parent && this.parent.readonly) {
|
||
return false;
|
||
}
|
||
if (this.group) {
|
||
return;
|
||
}
|
||
if (e.keyCode == _keyCode2.default.ENTER || e.keyCode == _keyCode2.default.MAC_ENTER || e.keyCode == _keyCode2.default.SPACE) {
|
||
e.preventDefault();
|
||
this.click();
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 424 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('label', {
|
||
staticClass: "ui-checkbox-wrapper",
|
||
class: _vm.getClass,
|
||
attrs: {
|
||
"tabindex": _vm.tabindex
|
||
},
|
||
on: {
|
||
"click": _vm.click,
|
||
"keydown": _vm.keydown
|
||
}
|
||
}, [_c('span', {
|
||
staticClass: "ui-checkbox",
|
||
class: {
|
||
'ui-checkbox-checked': _vm.checked
|
||
}
|
||
}, [_c('span', {
|
||
staticClass: "ui-checkbox-inner"
|
||
})]), _vm._v(" "), _c('span', {
|
||
staticClass: "ui-checkbox-content"
|
||
}, [_vm._t("default", [_vm._v(_vm._s(_vm.label))])], 2)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-abb759c6", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 425 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(426),
|
||
/* template */
|
||
__webpack_require__(427),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/checkbox-com/checkboxGroup.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] checkboxGroup.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-c13147dc", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-c13147dc", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 426 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _keyCode = __webpack_require__(19);
|
||
|
||
var _keyCode2 = _interopRequireDefault(_keyCode);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'CheckboxGroup',
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
value: {
|
||
type: Array,
|
||
default: function _default() {
|
||
return [];
|
||
}
|
||
},
|
||
vertical: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
readonly: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
currentValue: this.value,
|
||
name: 'checkbox_' + new Date().getTime(),
|
||
options: [],
|
||
focusIndex: null
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getClass: function getClass() {
|
||
var arr = [];
|
||
if (this.vertical) {
|
||
arr.push('ui-checkbox-group-vertical');
|
||
}
|
||
return arr;
|
||
}
|
||
},
|
||
watch: {
|
||
value: function value() {
|
||
this.currentValue = this.value;
|
||
this.updateChild();
|
||
},
|
||
focusIndex: function focusIndex(val, old) {
|
||
if (this.$children[old]) this.$children[old].isFoucs = false;
|
||
if (this.$children[val]) this.$children[val].isFoucs = true;
|
||
}
|
||
},
|
||
methods: {
|
||
updateChild: function updateChild() {
|
||
var _this = this;
|
||
|
||
this.options.forEach(function (child) {
|
||
if (_this.currentValue.indexOf(child.value) != -1) {
|
||
child.checked = true;
|
||
} else {
|
||
child.checked = false;
|
||
}
|
||
});
|
||
},
|
||
addItem: function addItem(checkbox) {
|
||
checkbox.name = this.name;
|
||
checkbox.group = true;
|
||
this.options.push(checkbox);
|
||
},
|
||
change: function change(value, checked) {
|
||
if (checked) {
|
||
this.currentValue.push(value);
|
||
} else {
|
||
var index = this.currentValue.indexOf(value);
|
||
if (index != -1) {
|
||
this.currentValue.splice(index, 1);
|
||
} else {
|
||
console.warn('checkbox组件出现异常');
|
||
}
|
||
}
|
||
this.changeValue();
|
||
},
|
||
changeValue: function changeValue() {
|
||
this.$emit('input', this.currentValue);
|
||
this.$emit('change', this.currentValue);
|
||
this.$emit('on-change', this.currentValue);
|
||
this.dispatch('FormItem', 'on-form-change', [this.currentValue]);
|
||
},
|
||
keydown: function keydown(e) {
|
||
if (this.disabled || this.readonly) return;
|
||
if (e.keyCode == _keyCode2.default.DOWN || e.keyCode == _keyCode2.default.RIGHT) {
|
||
e.preventDefault();
|
||
this.focusIndex += 1;
|
||
if (this.focusIndex > this.$children.length - 1) {
|
||
this.focusIndex = 0;
|
||
}
|
||
var option = this.$children[this.focusIndex];
|
||
if (option.disabled || option.readonly) {
|
||
this.keydown(e);
|
||
}
|
||
}
|
||
if (e.keyCode == _keyCode2.default.UP || e.keyCode == _keyCode2.default.LEFT) {
|
||
e.preventDefault();
|
||
this.focusIndex -= 1;
|
||
if (this.focusIndex < 0) {
|
||
this.focusIndex = this.$children.length - 1;
|
||
}
|
||
var _option = this.$children[this.focusIndex];
|
||
if (_option.disabled || _option.readonly) {
|
||
this.keydown(e);
|
||
}
|
||
}
|
||
if (e.keyCode == _keyCode2.default.SPACE || e.keyCode == _keyCode2.default.ENTER || e.keyCode == _keyCode2.default.MAC_ENTER) {
|
||
e.preventDefault();
|
||
var _option2 = this.$children[this.focusIndex];
|
||
_option2.click();
|
||
}
|
||
},
|
||
focus: function focus() {
|
||
if (this.disabled || this.readonly) return;
|
||
var len = this.$children.length;
|
||
if (len > 0) {
|
||
this.focusIndex = 0;
|
||
}
|
||
},
|
||
blur: function blur() {
|
||
this.focusIndex = null;
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 427 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-checkbox-group",
|
||
class: _vm.getClass,
|
||
attrs: {
|
||
"tabindex": "0"
|
||
},
|
||
on: {
|
||
"keydown": _vm.keydown,
|
||
"focus": _vm.focus,
|
||
"blur": _vm.blur
|
||
}
|
||
}, [_vm._t("default")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-c13147dc", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 428 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _formItem = __webpack_require__(429);
|
||
|
||
var _formItem2 = _interopRequireDefault(_formItem);
|
||
|
||
var _form = __webpack_require__(455);
|
||
|
||
var _form2 = _interopRequireDefault(_form);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
WbForm: _form2.default,
|
||
FormItem: _formItem2.default
|
||
};
|
||
|
||
/***/ }),
|
||
/* 429 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(430),
|
||
/* template */
|
||
__webpack_require__(454),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/form/formItem.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] formItem.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-b9625bb8", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-b9625bb8", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 430 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _asyncValidator = __webpack_require__(138);
|
||
|
||
var _asyncValidator2 = _interopRequireDefault(_asyncValidator);
|
||
|
||
__webpack_require__(453);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'FormItem',
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
prop: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
label: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
labelWidth: {
|
||
type: Number,
|
||
default: undefined
|
||
},
|
||
labelPosition: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
showMessage: {
|
||
type: Boolean,
|
||
default: true
|
||
},
|
||
rule: {
|
||
type: Array,
|
||
default: undefined
|
||
},
|
||
value: {
|
||
type: [String, Number, Array, Boolean, Object],
|
||
default: null
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
// hasLabel: true,
|
||
validateState: '',
|
||
validateMessage: '',
|
||
form: (0, _util.findComponentUpward)(this, 'WbForm')
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
currentRule: function currentRule() {
|
||
return [].concat(this.rule || []).concat(this.form.rule && this.form.rule[this.prop] || []);
|
||
},
|
||
required: function required() {
|
||
if (this.currentRule && this.currentRule.length > 0) {
|
||
return this.currentRule.filter(function (rule) {
|
||
return rule.required;
|
||
}).length > 0;
|
||
}
|
||
return false;
|
||
},
|
||
getClass: function getClass() {
|
||
var arr = [];
|
||
if (this.required) {
|
||
arr.push('ui-form-item-required');
|
||
}
|
||
if (this.validateState == 'error') {
|
||
arr.push('ui-form-item-error');
|
||
}
|
||
arr.push('ui-form-position-' + (this.labelPosition || this.form.labelPosition));
|
||
return arr;
|
||
},
|
||
getLabelStyle: function getLabelStyle() {
|
||
return {
|
||
width: (this.labelWidth || this.form.labelWidth) + 'px'
|
||
};
|
||
},
|
||
getContentStyle: function getContentStyle() {
|
||
return {
|
||
marginLeft: (this.labelPosition || this.form.labelPosition) == 'top' ? 0 : (this.labelWidth || this.form.labelWidth) + 'px'
|
||
};
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
if (this.prop) {
|
||
this.$on('on-form-blur', this.onFieldBlur);
|
||
this.$on('on-form-change', this.onFieldChange);
|
||
}
|
||
this.form.addItem(this);
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
this.form.removeItem(this);
|
||
},
|
||
|
||
methods: {
|
||
validate: function validate(trigger, callback, currentValue) {
|
||
var _this = this;
|
||
|
||
callback = callback || _util.noop;
|
||
var value = void 0;
|
||
if (currentValue !== undefined) {
|
||
value = currentValue;
|
||
} else if (this.value !== null) {
|
||
value = this.value;
|
||
} else {
|
||
var child = (0, _util.findComponentDownward)(this, ['Input', 'CheckboxGroup', 'InputDatePicker', 'RadioGroup', 'WbSelect', 'Switch', 'TimePicker']);
|
||
if (child) {
|
||
value = child.value;
|
||
} else {
|
||
return console.warn('表单组件请用FormItem组件包裹');
|
||
}
|
||
}
|
||
if (!this.currentRule || this.currentRule.length == 0) {
|
||
callback();
|
||
return true;
|
||
}
|
||
var rules = this.currentRule.filter(function (rule) {
|
||
return !rule.trigger || rule.trigger.indexOf(trigger) !== -1;
|
||
});
|
||
if (rules.length === 0) {
|
||
callback();
|
||
return true;
|
||
}
|
||
this.validateState = 'validating';
|
||
var descriptor = {};
|
||
var model = {};
|
||
descriptor[this.prop] = rules;
|
||
model[this.prop] = value;
|
||
var validator = new _asyncValidator2.default(descriptor);
|
||
validator.validate(model, function (errors) {
|
||
_this.dispatch('WbForm', 'on-item-validate', [errors]);
|
||
if (errors) {
|
||
_this.validateState = 'error';
|
||
_this.validateMessage = errors[0].message;
|
||
callback(errors);
|
||
} else {
|
||
_this.validateState = '';
|
||
callback();
|
||
}
|
||
});
|
||
},
|
||
resetField: function resetField() {
|
||
this.validateState = '';
|
||
this.validateMessage = '';
|
||
},
|
||
onFieldBlur: function onFieldBlur(currentValue) {
|
||
this.validate('blur', null, currentValue);
|
||
},
|
||
onFieldChange: function onFieldChange(currentValue) {
|
||
this.validate('change', null, currentValue);
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 431 */
|
||
/***/ (function(module, exports) {
|
||
|
||
// shim for using process in browser
|
||
var process = module.exports = {};
|
||
|
||
// cached from whatever global is present so that test runners that stub it
|
||
// don't break things. But we need to wrap it in a try catch in case it is
|
||
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
||
// function because try/catches deoptimize in certain engines.
|
||
|
||
var cachedSetTimeout;
|
||
var cachedClearTimeout;
|
||
|
||
function defaultSetTimout() {
|
||
throw new Error('setTimeout has not been defined');
|
||
}
|
||
function defaultClearTimeout () {
|
||
throw new Error('clearTimeout has not been defined');
|
||
}
|
||
(function () {
|
||
try {
|
||
if (typeof setTimeout === 'function') {
|
||
cachedSetTimeout = setTimeout;
|
||
} else {
|
||
cachedSetTimeout = defaultSetTimout;
|
||
}
|
||
} catch (e) {
|
||
cachedSetTimeout = defaultSetTimout;
|
||
}
|
||
try {
|
||
if (typeof clearTimeout === 'function') {
|
||
cachedClearTimeout = clearTimeout;
|
||
} else {
|
||
cachedClearTimeout = defaultClearTimeout;
|
||
}
|
||
} catch (e) {
|
||
cachedClearTimeout = defaultClearTimeout;
|
||
}
|
||
} ())
|
||
function runTimeout(fun) {
|
||
if (cachedSetTimeout === setTimeout) {
|
||
//normal enviroments in sane situations
|
||
return setTimeout(fun, 0);
|
||
}
|
||
// if setTimeout wasn't available but was latter defined
|
||
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
||
cachedSetTimeout = setTimeout;
|
||
return setTimeout(fun, 0);
|
||
}
|
||
try {
|
||
// when when somebody has screwed with setTimeout but no I.E. maddness
|
||
return cachedSetTimeout(fun, 0);
|
||
} catch(e){
|
||
try {
|
||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
||
return cachedSetTimeout.call(null, fun, 0);
|
||
} catch(e){
|
||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
||
return cachedSetTimeout.call(this, fun, 0);
|
||
}
|
||
}
|
||
|
||
|
||
}
|
||
function runClearTimeout(marker) {
|
||
if (cachedClearTimeout === clearTimeout) {
|
||
//normal enviroments in sane situations
|
||
return clearTimeout(marker);
|
||
}
|
||
// if clearTimeout wasn't available but was latter defined
|
||
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
||
cachedClearTimeout = clearTimeout;
|
||
return clearTimeout(marker);
|
||
}
|
||
try {
|
||
// when when somebody has screwed with setTimeout but no I.E. maddness
|
||
return cachedClearTimeout(marker);
|
||
} catch (e){
|
||
try {
|
||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
||
return cachedClearTimeout.call(null, marker);
|
||
} catch (e){
|
||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
||
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
||
return cachedClearTimeout.call(this, marker);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
}
|
||
var queue = [];
|
||
var draining = false;
|
||
var currentQueue;
|
||
var queueIndex = -1;
|
||
|
||
function cleanUpNextTick() {
|
||
if (!draining || !currentQueue) {
|
||
return;
|
||
}
|
||
draining = false;
|
||
if (currentQueue.length) {
|
||
queue = currentQueue.concat(queue);
|
||
} else {
|
||
queueIndex = -1;
|
||
}
|
||
if (queue.length) {
|
||
drainQueue();
|
||
}
|
||
}
|
||
|
||
function drainQueue() {
|
||
if (draining) {
|
||
return;
|
||
}
|
||
var timeout = runTimeout(cleanUpNextTick);
|
||
draining = true;
|
||
|
||
var len = queue.length;
|
||
while(len) {
|
||
currentQueue = queue;
|
||
queue = [];
|
||
while (++queueIndex < len) {
|
||
if (currentQueue) {
|
||
currentQueue[queueIndex].run();
|
||
}
|
||
}
|
||
queueIndex = -1;
|
||
len = queue.length;
|
||
}
|
||
currentQueue = null;
|
||
draining = false;
|
||
runClearTimeout(timeout);
|
||
}
|
||
|
||
process.nextTick = function (fun) {
|
||
var args = new Array(arguments.length - 1);
|
||
if (arguments.length > 1) {
|
||
for (var i = 1; i < arguments.length; i++) {
|
||
args[i - 1] = arguments[i];
|
||
}
|
||
}
|
||
queue.push(new Item(fun, args));
|
||
if (queue.length === 1 && !draining) {
|
||
runTimeout(drainQueue);
|
||
}
|
||
};
|
||
|
||
// v8 likes predictible objects
|
||
function Item(fun, array) {
|
||
this.fun = fun;
|
||
this.array = array;
|
||
}
|
||
Item.prototype.run = function () {
|
||
this.fun.apply(null, this.array);
|
||
};
|
||
process.title = 'browser';
|
||
process.browser = true;
|
||
process.env = {};
|
||
process.argv = [];
|
||
process.version = ''; // empty string to avoid regexp issues
|
||
process.versions = {};
|
||
|
||
function noop() {}
|
||
|
||
process.on = noop;
|
||
process.addListener = noop;
|
||
process.once = noop;
|
||
process.off = noop;
|
||
process.removeListener = noop;
|
||
process.removeAllListeners = noop;
|
||
process.emit = noop;
|
||
process.prependListener = noop;
|
||
process.prependOnceListener = noop;
|
||
|
||
process.listeners = function (name) { return [] }
|
||
|
||
process.binding = function (name) {
|
||
throw new Error('process.binding is not supported');
|
||
};
|
||
|
||
process.cwd = function () { return '/' };
|
||
process.chdir = function (dir) {
|
||
throw new Error('process.chdir is not supported');
|
||
};
|
||
process.umask = function() { return 0; };
|
||
|
||
|
||
/***/ }),
|
||
/* 432 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _string = __webpack_require__(433);
|
||
|
||
var _string2 = _interopRequireDefault(_string);
|
||
|
||
var _method = __webpack_require__(439);
|
||
|
||
var _method2 = _interopRequireDefault(_method);
|
||
|
||
var _number = __webpack_require__(440);
|
||
|
||
var _number2 = _interopRequireDefault(_number);
|
||
|
||
var _boolean = __webpack_require__(441);
|
||
|
||
var _boolean2 = _interopRequireDefault(_boolean);
|
||
|
||
var _regexp = __webpack_require__(442);
|
||
|
||
var _regexp2 = _interopRequireDefault(_regexp);
|
||
|
||
var _integer = __webpack_require__(443);
|
||
|
||
var _integer2 = _interopRequireDefault(_integer);
|
||
|
||
var _float = __webpack_require__(444);
|
||
|
||
var _float2 = _interopRequireDefault(_float);
|
||
|
||
var _array = __webpack_require__(445);
|
||
|
||
var _array2 = _interopRequireDefault(_array);
|
||
|
||
var _object = __webpack_require__(446);
|
||
|
||
var _object2 = _interopRequireDefault(_object);
|
||
|
||
var _enum = __webpack_require__(447);
|
||
|
||
var _enum2 = _interopRequireDefault(_enum);
|
||
|
||
var _pattern = __webpack_require__(448);
|
||
|
||
var _pattern2 = _interopRequireDefault(_pattern);
|
||
|
||
var _date = __webpack_require__(449);
|
||
|
||
var _date2 = _interopRequireDefault(_date);
|
||
|
||
var _required = __webpack_require__(450);
|
||
|
||
var _required2 = _interopRequireDefault(_required);
|
||
|
||
var _type = __webpack_require__(451);
|
||
|
||
var _type2 = _interopRequireDefault(_type);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
exports['default'] = {
|
||
string: _string2['default'],
|
||
method: _method2['default'],
|
||
number: _number2['default'],
|
||
boolean: _boolean2['default'],
|
||
regexp: _regexp2['default'],
|
||
integer: _integer2['default'],
|
||
float: _float2['default'],
|
||
array: _array2['default'],
|
||
object: _object2['default'],
|
||
'enum': _enum2['default'],
|
||
pattern: _pattern2['default'],
|
||
date: _date2['default'],
|
||
url: _type2['default'],
|
||
hex: _type2['default'],
|
||
email: _type2['default'],
|
||
required: _required2['default']
|
||
};
|
||
|
||
/***/ }),
|
||
/* 433 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
/**
|
||
* Performs validation for string types.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param callback The callback function.
|
||
* @param source The source object being validated.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function string(rule, value, callback, source, options) {
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
if (validate) {
|
||
if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options, 'string');
|
||
if (!(0, _util.isEmptyValue)(value, 'string')) {
|
||
_rule2['default'].type(rule, value, source, errors, options);
|
||
_rule2['default'].range(rule, value, source, errors, options);
|
||
_rule2['default'].pattern(rule, value, source, errors, options);
|
||
if (rule.whitespace === true) {
|
||
_rule2['default'].whitespace(rule, value, source, errors, options);
|
||
}
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = string;
|
||
|
||
/***/ }),
|
||
/* 434 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
|
||
|
||
/**
|
||
* Rule for validating whitespace.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param source The source object being validated.
|
||
* @param errors An array of errors that this rule may add
|
||
* validation errors to.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function whitespace(rule, value, source, errors, options) {
|
||
if (/^\s+$/.test(value) || value === '') {
|
||
errors.push(util.format(options.messages.whitespace, rule.fullField));
|
||
}
|
||
}
|
||
|
||
exports['default'] = whitespace;
|
||
|
||
/***/ }),
|
||
/* 435 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
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 _util = __webpack_require__(4);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
var _required = __webpack_require__(139);
|
||
|
||
var _required2 = _interopRequireDefault(_required);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
|
||
|
||
/* eslint max-len:0 */
|
||
|
||
var pattern = {
|
||
// http://emailregex.com/
|
||
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
||
url: new RegExp('^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$', 'i'),
|
||
hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
|
||
};
|
||
|
||
var types = {
|
||
integer: function integer(value) {
|
||
return types.number(value) && parseInt(value, 10) === value;
|
||
},
|
||
float: function float(value) {
|
||
return types.number(value) && !types.integer(value);
|
||
},
|
||
array: function array(value) {
|
||
return Array.isArray(value);
|
||
},
|
||
regexp: function regexp(value) {
|
||
if (value instanceof RegExp) {
|
||
return true;
|
||
}
|
||
try {
|
||
return !!new RegExp(value);
|
||
} catch (e) {
|
||
return false;
|
||
}
|
||
},
|
||
date: function date(value) {
|
||
return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function';
|
||
},
|
||
number: function number(value) {
|
||
if (isNaN(value)) {
|
||
return false;
|
||
}
|
||
return typeof value === 'number';
|
||
},
|
||
object: function object(value) {
|
||
return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !types.array(value);
|
||
},
|
||
method: function method(value) {
|
||
return typeof value === 'function';
|
||
},
|
||
email: function email(value) {
|
||
return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
|
||
},
|
||
url: function url(value) {
|
||
return typeof value === 'string' && !!value.match(pattern.url);
|
||
},
|
||
hex: function hex(value) {
|
||
return typeof value === 'string' && !!value.match(pattern.hex);
|
||
}
|
||
};
|
||
|
||
/**
|
||
* Rule for validating the type of a value.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param source The source object being validated.
|
||
* @param errors An array of errors that this rule may add
|
||
* validation errors to.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function type(rule, value, source, errors, options) {
|
||
if (rule.required && value === undefined) {
|
||
(0, _required2['default'])(rule, value, source, errors, options);
|
||
return;
|
||
}
|
||
var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
|
||
var ruleType = rule.type;
|
||
if (custom.indexOf(ruleType) > -1) {
|
||
if (!types[ruleType](value)) {
|
||
errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));
|
||
}
|
||
// straight typeof check
|
||
} else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {
|
||
errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));
|
||
}
|
||
}
|
||
|
||
exports['default'] = type;
|
||
|
||
/***/ }),
|
||
/* 436 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
|
||
|
||
/**
|
||
* Rule for validating minimum and maximum allowed values.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param source The source object being validated.
|
||
* @param errors An array of errors that this rule may add
|
||
* validation errors to.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function range(rule, value, source, errors, options) {
|
||
var len = typeof rule.len === 'number';
|
||
var min = typeof rule.min === 'number';
|
||
var max = typeof rule.max === 'number';
|
||
// 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
|
||
var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
||
var val = value;
|
||
var key = null;
|
||
var num = typeof value === 'number';
|
||
var str = typeof value === 'string';
|
||
var arr = Array.isArray(value);
|
||
if (num) {
|
||
key = 'number';
|
||
} else if (str) {
|
||
key = 'string';
|
||
} else if (arr) {
|
||
key = 'array';
|
||
}
|
||
// if the value is not of a supported type for range validation
|
||
// the validation rule rule should use the
|
||
// type property to also test for a particular type
|
||
if (!key) {
|
||
return false;
|
||
}
|
||
if (arr) {
|
||
val = value.length;
|
||
}
|
||
if (str) {
|
||
// 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
|
||
val = value.replace(spRegexp, '_').length;
|
||
}
|
||
if (len) {
|
||
if (val !== rule.len) {
|
||
errors.push(util.format(options.messages[key].len, rule.fullField, rule.len));
|
||
}
|
||
} else if (min && !max && val < rule.min) {
|
||
errors.push(util.format(options.messages[key].min, rule.fullField, rule.min));
|
||
} else if (max && !min && val > rule.max) {
|
||
errors.push(util.format(options.messages[key].max, rule.fullField, rule.max));
|
||
} else if (min && max && (val < rule.min || val > rule.max)) {
|
||
errors.push(util.format(options.messages[key].range, rule.fullField, rule.min, rule.max));
|
||
}
|
||
}
|
||
|
||
exports['default'] = range;
|
||
|
||
/***/ }),
|
||
/* 437 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
|
||
|
||
var ENUM = 'enum';
|
||
|
||
/**
|
||
* Rule for validating a value exists in an enumerable list.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param source The source object being validated.
|
||
* @param errors An array of errors that this rule may add
|
||
* validation errors to.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function enumerable(rule, value, source, errors, options) {
|
||
rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
|
||
if (rule[ENUM].indexOf(value) === -1) {
|
||
errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
|
||
}
|
||
}
|
||
|
||
exports['default'] = enumerable;
|
||
|
||
/***/ }),
|
||
/* 438 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
|
||
|
||
/**
|
||
* Rule for validating a regular expression pattern.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param source The source object being validated.
|
||
* @param errors An array of errors that this rule may add
|
||
* validation errors to.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function pattern(rule, value, source, errors, options) {
|
||
if (rule.pattern) {
|
||
if (rule.pattern instanceof RegExp) {
|
||
// if a RegExp instance is passed, reset `lastIndex` in case its `global`
|
||
// flag is accidentally set to `true`, which in a validation scenario
|
||
// is not necessary and the result might be misleading
|
||
rule.pattern.lastIndex = 0;
|
||
if (!rule.pattern.test(value)) {
|
||
errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
|
||
}
|
||
} else if (typeof rule.pattern === 'string') {
|
||
var _pattern = new RegExp(rule.pattern);
|
||
if (!_pattern.test(value)) {
|
||
errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
exports['default'] = pattern;
|
||
|
||
/***/ }),
|
||
/* 439 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
/**
|
||
* Validates a function.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param callback The callback function.
|
||
* @param source The source object being validated.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function method(rule, value, callback, source, options) {
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
if (validate) {
|
||
if ((0, _util.isEmptyValue)(value) && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options);
|
||
if (value !== undefined) {
|
||
_rule2['default'].type(rule, value, source, errors, options);
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = method;
|
||
|
||
/***/ }),
|
||
/* 440 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
/**
|
||
* Validates a number.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param callback The callback function.
|
||
* @param source The source object being validated.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function number(rule, value, callback, source, options) {
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
if (validate) {
|
||
if (value === '') {
|
||
value = undefined;
|
||
}
|
||
if ((0, _util.isEmptyValue)(value) && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options);
|
||
if (value !== undefined) {
|
||
_rule2['default'].type(rule, value, source, errors, options);
|
||
_rule2['default'].range(rule, value, source, errors, options);
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = number;
|
||
|
||
/***/ }),
|
||
/* 441 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
/**
|
||
* Validates a boolean.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param callback The callback function.
|
||
* @param source The source object being validated.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function boolean(rule, value, callback, source, options) {
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
if (validate) {
|
||
if ((0, _util.isEmptyValue)(value) && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options);
|
||
if (value !== undefined) {
|
||
_rule2['default'].type(rule, value, source, errors, options);
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = boolean;
|
||
|
||
/***/ }),
|
||
/* 442 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
/**
|
||
* Validates the regular expression type.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param callback The callback function.
|
||
* @param source The source object being validated.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function regexp(rule, value, callback, source, options) {
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
if (validate) {
|
||
if ((0, _util.isEmptyValue)(value) && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options);
|
||
if (!(0, _util.isEmptyValue)(value)) {
|
||
_rule2['default'].type(rule, value, source, errors, options);
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = regexp;
|
||
|
||
/***/ }),
|
||
/* 443 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
/**
|
||
* Validates a number is an integer.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param callback The callback function.
|
||
* @param source The source object being validated.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function integer(rule, value, callback, source, options) {
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
if (validate) {
|
||
if ((0, _util.isEmptyValue)(value) && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options);
|
||
if (value !== undefined) {
|
||
_rule2['default'].type(rule, value, source, errors, options);
|
||
_rule2['default'].range(rule, value, source, errors, options);
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = integer;
|
||
|
||
/***/ }),
|
||
/* 444 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
/**
|
||
* Validates a number is a floating point number.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param callback The callback function.
|
||
* @param source The source object being validated.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function floatFn(rule, value, callback, source, options) {
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
if (validate) {
|
||
if ((0, _util.isEmptyValue)(value) && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options);
|
||
if (value !== undefined) {
|
||
_rule2['default'].type(rule, value, source, errors, options);
|
||
_rule2['default'].range(rule, value, source, errors, options);
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = floatFn;
|
||
|
||
/***/ }),
|
||
/* 445 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
/**
|
||
* Validates an array.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param callback The callback function.
|
||
* @param source The source object being validated.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function array(rule, value, callback, source, options) {
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
if (validate) {
|
||
if ((0, _util.isEmptyValue)(value, 'array') && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options, 'array');
|
||
if (!(0, _util.isEmptyValue)(value, 'array')) {
|
||
_rule2['default'].type(rule, value, source, errors, options);
|
||
_rule2['default'].range(rule, value, source, errors, options);
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = array;
|
||
|
||
/***/ }),
|
||
/* 446 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
/**
|
||
* Validates an object.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param callback The callback function.
|
||
* @param source The source object being validated.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function object(rule, value, callback, source, options) {
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
if (validate) {
|
||
if ((0, _util.isEmptyValue)(value) && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options);
|
||
if (value !== undefined) {
|
||
_rule2['default'].type(rule, value, source, errors, options);
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = object;
|
||
|
||
/***/ }),
|
||
/* 447 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
var ENUM = 'enum';
|
||
|
||
/**
|
||
* Validates an enumerable list.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param callback The callback function.
|
||
* @param source The source object being validated.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function enumerable(rule, value, callback, source, options) {
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
if (validate) {
|
||
if ((0, _util.isEmptyValue)(value) && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options);
|
||
if (value) {
|
||
_rule2['default'][ENUM](rule, value, source, errors, options);
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = enumerable;
|
||
|
||
/***/ }),
|
||
/* 448 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
/**
|
||
* Validates a regular expression pattern.
|
||
*
|
||
* Performs validation when a rule only contains
|
||
* a pattern property but is not declared as a string type.
|
||
*
|
||
* @param rule The validation rule.
|
||
* @param value The value of the field on the source object.
|
||
* @param callback The callback function.
|
||
* @param source The source object being validated.
|
||
* @param options The validation options.
|
||
* @param options.messages The validation messages.
|
||
*/
|
||
function pattern(rule, value, callback, source, options) {
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
if (validate) {
|
||
if ((0, _util.isEmptyValue)(value, 'string') && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options);
|
||
if (!(0, _util.isEmptyValue)(value, 'string')) {
|
||
_rule2['default'].pattern(rule, value, source, errors, options);
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = pattern;
|
||
|
||
/***/ }),
|
||
/* 449 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
function date(rule, value, callback, source, options) {
|
||
// console.log('integer rule called %j', rule);
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
// console.log('validate on %s value', value);
|
||
if (validate) {
|
||
if ((0, _util.isEmptyValue)(value) && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options);
|
||
if (!(0, _util.isEmptyValue)(value)) {
|
||
var dateObject = void 0;
|
||
|
||
if (typeof value === 'number') {
|
||
dateObject = new Date(value);
|
||
} else {
|
||
dateObject = value;
|
||
}
|
||
|
||
_rule2['default'].type(rule, dateObject, source, errors, options);
|
||
if (dateObject) {
|
||
_rule2['default'].range(rule, dateObject.getTime(), source, errors, options);
|
||
}
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = date;
|
||
|
||
/***/ }),
|
||
/* 450 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
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 _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
function required(rule, value, callback, source, options) {
|
||
var errors = [];
|
||
var type = Array.isArray(value) ? 'array' : typeof value === 'undefined' ? 'undefined' : _typeof(value);
|
||
_rule2['default'].required(rule, value, source, errors, options, type);
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = required;
|
||
|
||
/***/ }),
|
||
/* 451 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _rule = __webpack_require__(9);
|
||
|
||
var _rule2 = _interopRequireDefault(_rule);
|
||
|
||
var _util = __webpack_require__(4);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||
|
||
function type(rule, value, callback, source, options) {
|
||
var ruleType = rule.type;
|
||
var errors = [];
|
||
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
||
if (validate) {
|
||
if ((0, _util.isEmptyValue)(value, ruleType) && !rule.required) {
|
||
return callback();
|
||
}
|
||
_rule2['default'].required(rule, value, source, errors, options, ruleType);
|
||
if (!(0, _util.isEmptyValue)(value, ruleType)) {
|
||
_rule2['default'].type(rule, value, source, errors, options);
|
||
}
|
||
}
|
||
callback(errors);
|
||
}
|
||
|
||
exports['default'] = type;
|
||
|
||
/***/ }),
|
||
/* 452 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.newMessages = newMessages;
|
||
function newMessages() {
|
||
return {
|
||
'default': 'Validation error on field %s',
|
||
required: '%s is required',
|
||
'enum': '%s must be one of %s',
|
||
whitespace: '%s cannot be empty',
|
||
date: {
|
||
format: '%s date %s is invalid for format %s',
|
||
parse: '%s date could not be parsed, %s is invalid ',
|
||
invalid: '%s date %s is invalid'
|
||
},
|
||
types: {
|
||
string: '%s is not a %s',
|
||
method: '%s is not a %s (function)',
|
||
array: '%s is not an %s',
|
||
object: '%s is not an %s',
|
||
number: '%s is not a %s',
|
||
date: '%s is not a %s',
|
||
boolean: '%s is not a %s',
|
||
integer: '%s is not an %s',
|
||
float: '%s is not a %s',
|
||
regexp: '%s is not a valid %s',
|
||
email: '%s is not a valid %s',
|
||
url: '%s is not a valid %s',
|
||
hex: '%s is not a valid %s'
|
||
},
|
||
string: {
|
||
len: '%s must be exactly %s characters',
|
||
min: '%s must be at least %s characters',
|
||
max: '%s cannot be longer than %s characters',
|
||
range: '%s must be between %s and %s characters'
|
||
},
|
||
number: {
|
||
len: '%s must equal %s',
|
||
min: '%s cannot be less than %s',
|
||
max: '%s cannot be greater than %s',
|
||
range: '%s must be between %s and %s'
|
||
},
|
||
array: {
|
||
len: '%s must be exactly %s in length',
|
||
min: '%s cannot be less than %s in length',
|
||
max: '%s cannot be greater than %s in length',
|
||
range: '%s must be between %s and %s in length'
|
||
},
|
||
pattern: {
|
||
mismatch: '%s value %s does not match pattern %s'
|
||
},
|
||
clone: function clone() {
|
||
var cloned = JSON.parse(JSON.stringify(this));
|
||
cloned.clone = this.clone;
|
||
return cloned;
|
||
}
|
||
};
|
||
}
|
||
|
||
var messages = exports.messages = newMessages();
|
||
|
||
/***/ }),
|
||
/* 453 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var _asyncValidator = __webpack_require__(138);
|
||
|
||
var _asyncValidator2 = _interopRequireDefault(_asyncValidator);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
// 手机号
|
||
_asyncValidator2.default.register('mobile', function (rule, value, cb) {
|
||
if (value != '' && !/^1\d{10}$/.test(value)) {
|
||
cb(new Error(rule.message || '请输入正确的手机号码'));
|
||
} else {
|
||
cb();
|
||
}
|
||
});
|
||
|
||
// 中文名
|
||
_asyncValidator2.default.register('cname', function (rule, value, cb) {
|
||
if (value != '' && !/^[\u4E00-\u9FA50-9a-zA-Z]{2,10}$/.test(value)) {
|
||
cb(new Error(rule.message || '请输入正确的中文名'));
|
||
} else {
|
||
cb();
|
||
}
|
||
});
|
||
|
||
// 密码
|
||
_asyncValidator2.default.register('password', function (rule, value, cb) {
|
||
if (value != '' && (value.length > 16 || value.length < 8 || !/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,16}$/.test(value))) {
|
||
cb(new Error(rule.message || '请输入正确的密码,必须包含大写、小写字符和数字,8-16位'));
|
||
} else {
|
||
cb();
|
||
}
|
||
});
|
||
|
||
// 金额
|
||
_asyncValidator2.default.register('money', function (rule, value, cb) {
|
||
var len = rule.afterPoint || 2;
|
||
if (value != '' && !new RegExp('(^[1-9]\\d*(\\.\\d{1,' + len + '})?$)|(^0(\\.\\d{1,' + len + '})?$)').test(value)) {
|
||
cb(new Error(rule.message || '请输入正确的金额'));
|
||
} else {
|
||
cb();
|
||
}
|
||
});
|
||
|
||
// 相等
|
||
_asyncValidator2.default.register('equal', function (rule, value, cb) {
|
||
var enqualTo = rule.enqualTo;
|
||
if (value != enqualTo) {
|
||
cb(new Error(rule.message));
|
||
} else {
|
||
cb();
|
||
}
|
||
});
|
||
|
||
// 不小于
|
||
_asyncValidator2.default.register('min', function (rule, value, cb) {
|
||
var minTo = rule.minTo;
|
||
if (value !== '' && value !== null && value !== undefined && Number(value) < Number(minTo)) {
|
||
cb(new Error(rule.message));
|
||
} else {
|
||
cb();
|
||
}
|
||
});
|
||
|
||
// 不大于
|
||
_asyncValidator2.default.register('max', function (rule, value, cb) {
|
||
var maxTo = rule.maxTo;
|
||
if (value !== '' && value !== null && value !== undefined && Number(value) > Number(maxTo)) {
|
||
cb(new Error(rule.message));
|
||
} else {
|
||
cb();
|
||
}
|
||
});
|
||
|
||
/***/ }),
|
||
/* 454 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-form-item",
|
||
class: _vm.getClass
|
||
}, [(_vm.label) ? _c('label', {
|
||
ref: "label",
|
||
staticClass: "ui-form-label",
|
||
style: (_vm.getLabelStyle)
|
||
}, [_vm._v(_vm._s(_vm.label))]) : _vm._e(), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-form-content",
|
||
style: (_vm.getContentStyle)
|
||
}, [_vm._t("default"), _vm._v(" "), (_vm.validateState === 'error' && _vm.showMessage && _vm.form.currentShowMessage) ? _c('div', {
|
||
staticClass: "ui-form-error-tip"
|
||
}, [_vm._v("\n " + _vm._s(_vm.validateMessage) + "\n ")]) : _vm._e()], 2)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-b9625bb8", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 455 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(456),
|
||
/* template */
|
||
__webpack_require__(457),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/form/form.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] form.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-fc3cee1e", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-fc3cee1e", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 456 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'WbForm',
|
||
props: {
|
||
labelPosition: {
|
||
type: String,
|
||
default: 'right' // left、right、top
|
||
},
|
||
labelWidth: {
|
||
type: Number,
|
||
default: 80
|
||
},
|
||
rule: {
|
||
type: [Object, Array],
|
||
default: undefined
|
||
},
|
||
type: {
|
||
type: String,
|
||
default: 'normal' // normal、query
|
||
},
|
||
showMessage: {
|
||
type: Boolean,
|
||
default: true
|
||
},
|
||
autocomplete: {
|
||
type: String,
|
||
default: 'off'
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
validateFormItems: []
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getClass: function getClass() {
|
||
var arr = [];
|
||
arr.push('ui-form-type-' + this.type);
|
||
return arr;
|
||
},
|
||
currentShowMessage: function currentShowMessage() {
|
||
if (this.type == 'query') {
|
||
return false;
|
||
}
|
||
return this.showMessage;
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
this.$on('on-item-validate', function (errors) {
|
||
this.$emit('on-validate', errors);
|
||
});
|
||
},
|
||
|
||
methods: {
|
||
addItem: function addItem(item) {
|
||
if (this.validateFormItems.indexOf(item) == -1) {
|
||
if (item.prop && item.currentRule.length > 0) {
|
||
this.validateFormItems.push(item);
|
||
}
|
||
}
|
||
},
|
||
removeItem: function removeItem(item) {
|
||
var index = this.validateFormItems.indexOf(item);
|
||
if (index != -1) {
|
||
this.validateFormItems.splice(index, 1);
|
||
}
|
||
},
|
||
validate: function validate(callback) {
|
||
var len = this.validateFormItems.length;
|
||
var k = 0;
|
||
var valid = true;
|
||
var errorArr = [];
|
||
if (len > 0) {
|
||
for (var i = 0; i < len; i++) {
|
||
var item = this.validateFormItems[i];
|
||
// 第一个参数为”“表示校验所有规则
|
||
item.validate('', function (errors) {
|
||
k++;
|
||
if (errors) {
|
||
valid = false;
|
||
errorArr.push(errors);
|
||
}
|
||
if (typeof callback === 'function' && k == len) {
|
||
callback(valid, errorArr);
|
||
}
|
||
});
|
||
}
|
||
} else {
|
||
callback(valid, errorArr);
|
||
}
|
||
},
|
||
validateField: function validateField(filed, callback) {
|
||
var len = this.validateFormItems.length;
|
||
var valid = true;
|
||
for (var i = 0; i < len; i++) {
|
||
var item = this.validateFormItems[i];
|
||
if (filed && item.prop == filed) {
|
||
// 第一个参数为”“表示校验所有规则
|
||
item.validate('', function (errors) {
|
||
if (errors) {
|
||
valid = false;
|
||
}
|
||
if (typeof callback === 'function') {
|
||
callback(valid, errors);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
},
|
||
resetFields: function resetFields(filed) {
|
||
this.validateFormItems.forEach(function (item) {
|
||
if (!filed) {
|
||
item.resetField();
|
||
} else if (item.prop == filed) {
|
||
item.resetField();
|
||
}
|
||
});
|
||
},
|
||
handleSubmit: function handleSubmit() {
|
||
var _this = this;
|
||
|
||
this.validate(function (valid, errorArr) {
|
||
_this.$emit('submit', valid, errorArr);
|
||
});
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 457 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('form', {
|
||
staticClass: "ui-form",
|
||
class: _vm.getClass,
|
||
attrs: {
|
||
"autocomplete": _vm.autocomplete
|
||
},
|
||
on: {
|
||
"submit": _vm.handleSubmit
|
||
}
|
||
}, [_vm._t("default")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-fc3cee1e", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 458 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _menu = __webpack_require__(140);
|
||
|
||
var _menu2 = _interopRequireDefault(_menu);
|
||
|
||
var _subMenu = __webpack_require__(141);
|
||
|
||
var _subMenu2 = _interopRequireDefault(_subMenu);
|
||
|
||
var _menuItem = __webpack_require__(142);
|
||
|
||
var _menuItem2 = _interopRequireDefault(_menuItem);
|
||
|
||
var _menuGroup = __webpack_require__(465);
|
||
|
||
var _menuGroup2 = _interopRequireDefault(_menuGroup);
|
||
|
||
var _routeMenu = __webpack_require__(468);
|
||
|
||
var _routeMenu2 = _interopRequireDefault(_routeMenu);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
WbMenu: _menu2.default, WbSubMenu: _subMenu2.default, WbMenuItem: _menuItem2.default, WbMenuGroup: _menuGroup2.default, RouteMenu: _routeMenu2.default
|
||
};
|
||
|
||
/***/ }),
|
||
/* 459 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _promise = __webpack_require__(43);
|
||
|
||
var _promise2 = _interopRequireDefault(_promise);
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Menu',
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
mode: {
|
||
validator: function validator(value) {
|
||
return (0, _util.oneOf)(value, ['horizontal', 'vertical']);
|
||
},
|
||
|
||
default: 'vertical' // 垂直模式
|
||
},
|
||
width: {
|
||
type: [String, Number],
|
||
default: undefined
|
||
},
|
||
activeName: {
|
||
type: [String, Number],
|
||
default: undefined
|
||
},
|
||
type: {
|
||
validator: function validator(value) {
|
||
return (0, _util.oneOf)(value, ['light', 'dark']);
|
||
},
|
||
|
||
default: 'light'
|
||
},
|
||
autoClose: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
asyncSelect: Function
|
||
},
|
||
data: function data() {
|
||
return {
|
||
currentActiveName: this.activeName
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getClass: function getClass() {
|
||
var className = [];
|
||
if (this.mode) {
|
||
className.push('ui-menu-mode-' + this.mode);
|
||
}
|
||
if (this.type) {
|
||
className.push('ui-menu-type-' + this.type);
|
||
}
|
||
return className;
|
||
},
|
||
menuWidth: function menuWidth() {
|
||
if (this.width && (typeof this.width === 'number' || this.width.indexOf('%') === -1 && this.width.indexOf('px') === -1)) {
|
||
return this.width + 'px';
|
||
}
|
||
return this.width;
|
||
}
|
||
},
|
||
watch: {
|
||
activeName: function activeName(name) {
|
||
this.updateName(name);
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
var _this = this;
|
||
|
||
if (this.currentActiveName) {
|
||
// 向下广播选择节点
|
||
this.broadcast('MenuItem', 'fes_menu_activeName', this.currentActiveName);
|
||
this.broadcast('SubMenu', 'fes_menu_activeName', this.currentActiveName);
|
||
}
|
||
this.$on('fes_menu_item_click', function (name) {
|
||
if (_this.asyncSelect && typeof _this.asyncSelect === 'function') {
|
||
_promise2.default.resolve(_this.asyncSelect(name)).then(function () {
|
||
_this.updateName(name);
|
||
});
|
||
} else {
|
||
_this.updateName(name);
|
||
// 选择事件
|
||
_this.$emit('select', name);
|
||
}
|
||
});
|
||
this.$on('fes_submenu_click', function (args) {
|
||
if (_this.autoClose) {
|
||
_this.broadcast('SubMenu', 'fes_submenu_close_other', args);
|
||
}
|
||
});
|
||
this.$on('fes_allowPage_change', function () {
|
||
// 向下广播选择节点
|
||
_this.broadcast('MenuItem', 'fes_menu_activeName', _this.currentActiveName);
|
||
_this.broadcast('SubMenu', 'fes_menu_activeName', _this.currentActiveName);
|
||
});
|
||
},
|
||
|
||
methods: {
|
||
updateName: function updateName(name) {
|
||
if (name !== this.currentActiveName) {
|
||
this.currentActiveName = name;
|
||
// 向下广播选择节点
|
||
this.broadcast('MenuItem', 'fes_menu_activeName', this.currentActiveName);
|
||
this.broadcast('SubMenu', 'fes_menu_activeName', this.currentActiveName);
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 460 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-menu",
|
||
class: _vm.getClass,
|
||
style: ({
|
||
width: _vm.menuWidth
|
||
})
|
||
}, [_c('ul', [_vm._t("default")], 2)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-6df37c5e", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 461 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'SubMenu',
|
||
components: {
|
||
Icon: _icon2.default
|
||
},
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
title: {
|
||
type: String,
|
||
default: undefined
|
||
},
|
||
icon: {
|
||
required: false,
|
||
type: String,
|
||
default: ''
|
||
},
|
||
expand: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
children: [],
|
||
active: this.expand,
|
||
choosed: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
arrowClassNames: function arrowClassNames() {
|
||
return {
|
||
'ui-menu-arrow': true,
|
||
'ui-menu-arrow-active': this.active
|
||
};
|
||
},
|
||
subMenuClassNames: function subMenuClassNames() {
|
||
return {
|
||
'ui-menu-submenu': true,
|
||
'ui-menu-submenu-actived': this.active,
|
||
'ui-menu-submenu-choosed': this.choosed
|
||
};
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
var _this = this;
|
||
|
||
// 如果是垂直状态,计算下UL的最低宽度
|
||
if (this.$parent.mode == 'horizontal') {
|
||
this.$refs.submenuSwap.style['min-width'] = this.$el.clientWidth + 'px';
|
||
}
|
||
|
||
// 拿到它的子菜单
|
||
this.children = this.getItems(this.$children);
|
||
|
||
// 点击了一项菜单
|
||
this.$on('fes_menu_activeName', function (name) {
|
||
if (_this.children.indexOf(name) != -1) {
|
||
_this.choosed = true;
|
||
// 水平模式下, 选择完子项,150毫秒之后消失下拉框
|
||
if (_this.$parent.mode == 'horizontal') {
|
||
setTimeout(function () {
|
||
_this.active = false;
|
||
}, 150);
|
||
}
|
||
} else {
|
||
_this.choosed = false;
|
||
}
|
||
});
|
||
|
||
this.$on('fes_submenu_close_other', function (args) {
|
||
if (args._uid != _this._uid) {
|
||
_this.active = false;
|
||
}
|
||
});
|
||
},
|
||
|
||
methods: {
|
||
loadIcon: function loadIcon() {
|
||
// 如果是垂直状态,计算下UL的最低宽度
|
||
if (this.$parent.mode == 'horizontal') {
|
||
this.$refs.submenuSwap.style['min-width'] = this.$el.clientWidth + 'px';
|
||
}
|
||
},
|
||
toggle: function toggle(e) {
|
||
var _this2 = this;
|
||
|
||
// 垂直模式下, 悬浮切换关闭
|
||
if (this.$parent.mode == 'horizontal') {
|
||
if (e.type == 'mouseover') {
|
||
if (this.toggleTimer) {
|
||
clearTimeout(this.toggleTimer);
|
||
}
|
||
this.active = true;
|
||
}
|
||
if (e.type == 'mouseout') {
|
||
this.toggleTimer = setTimeout(function () {
|
||
_this2.active = false;
|
||
}, 200);
|
||
}
|
||
}
|
||
},
|
||
click: function click() {
|
||
this.dispatch('Menu', 'fes_submenu_click', this);
|
||
// 垂直模式下, 点击切换关闭
|
||
if (this.$parent.mode == 'vertical') {
|
||
this.active = !this.active;
|
||
}
|
||
},
|
||
getItems: function getItems(columns) {
|
||
var _this3 = this;
|
||
|
||
var result = [];
|
||
if (columns) {
|
||
columns.forEach(function (column) {
|
||
if (column.$options.name == 'MenuItem') {
|
||
result.push(column.name);
|
||
}
|
||
if (column.$children && column.$children.length > 0) {
|
||
result.push.apply(result, _this3.getItems(column.$children));
|
||
}
|
||
});
|
||
}
|
||
return result;
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 462 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('li', {
|
||
class: _vm.subMenuClassNames,
|
||
on: {
|
||
"mouseover": _vm.toggle,
|
||
"mouseout": _vm.toggle
|
||
}
|
||
}, [_c('div', {
|
||
staticClass: "ui-menu-submenu-title",
|
||
on: {
|
||
"click": _vm.click
|
||
}
|
||
}, [(_vm.icon) ? _c('img', {
|
||
staticClass: "ui-menu-submenu-icon",
|
||
attrs: {
|
||
"src": _vm.icon
|
||
},
|
||
on: {
|
||
"load": _vm.loadIcon
|
||
}
|
||
}) : _vm._e(), _vm._v("\n " + _vm._s(_vm.title) + "\n "), _c('div', {
|
||
class: _vm.arrowClassNames
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "ios-arrow-down",
|
||
"size": "12"
|
||
}
|
||
})], 1)]), _vm._v(" "), _c('ul', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.active),
|
||
expression: "active"
|
||
}],
|
||
ref: "submenuSwap",
|
||
staticClass: "ui-menu-submenu-ul"
|
||
}, [_vm._t("default")], 2)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-526ceb3d", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 463 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'MenuItem',
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
name: {
|
||
required: true,
|
||
type: [String, Number]
|
||
},
|
||
icon: {
|
||
required: false,
|
||
type: String,
|
||
default: ''
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
actived: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
classNames: function classNames() {
|
||
return {
|
||
'ui-menu-item-actived': this.actived,
|
||
'ui-menu-item': true
|
||
};
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
var _this = this;
|
||
|
||
this.$on('fes_menu_activeName', function (name) {
|
||
_this.actived = name === _this.name;
|
||
});
|
||
},
|
||
|
||
methods: {
|
||
click: function click() {
|
||
this.dispatch('Menu', 'fes_menu_item_click', this.name);
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 464 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('li', {
|
||
class: _vm.classNames,
|
||
on: {
|
||
"click": _vm.click
|
||
}
|
||
}, [(_vm.icon) ? _c('img', {
|
||
staticClass: "ui-menu-item-icon",
|
||
attrs: {
|
||
"src": _vm.icon
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), _vm._t("default")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-34a7c9f8", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 465 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(466),
|
||
/* template */
|
||
__webpack_require__(467),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/menu/menuGroup.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] menuGroup.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-0c9b0444", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-0c9b0444", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 466 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'MenuGroup',
|
||
props: {
|
||
title: {
|
||
type: String,
|
||
default: undefined
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 467 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-menu-group"
|
||
}, [_c('div', {
|
||
staticClass: "ui-menu-group-title"
|
||
}, [_vm._v("\n " + _vm._s(_vm.title) + "\n ")]), _vm._v(" "), _c('ul', [_vm._t("default")], 2)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-0c9b0444", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 468 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(469),
|
||
/* template */
|
||
__webpack_require__(470),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/menu/routeMenu.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] routeMenu.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-4cf944c6", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-4cf944c6", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 469 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _promise = __webpack_require__(43);
|
||
|
||
var _promise2 = _interopRequireDefault(_promise);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var _menu = __webpack_require__(140);
|
||
|
||
var _menu2 = _interopRequireDefault(_menu);
|
||
|
||
var _menuItem = __webpack_require__(142);
|
||
|
||
var _menuItem2 = _interopRequireDefault(_menuItem);
|
||
|
||
var _subMenu = __webpack_require__(141);
|
||
|
||
var _subMenu2 = _interopRequireDefault(_subMenu);
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'RouteMenu',
|
||
components: {
|
||
WbMenu: _menu2.default,
|
||
WbMenuItem: _menuItem2.default,
|
||
WbSubMenu: _subMenu2.default
|
||
},
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
mode: {
|
||
validator: function validator(value) {
|
||
return (0, _util.oneOf)(value, ['horizontal', 'vertical']);
|
||
},
|
||
|
||
default: 'vertical' // 垂直模式
|
||
},
|
||
width: {
|
||
type: [String, Number],
|
||
default: undefined
|
||
},
|
||
menu: {
|
||
type: Array,
|
||
default: undefined
|
||
},
|
||
type: {
|
||
validator: function validator(value) {
|
||
return (0, _util.oneOf)(value, ['light', 'dark']);
|
||
},
|
||
|
||
default: 'light'
|
||
},
|
||
autoClose: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
activeName: ''
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
allPath: function allPath() {
|
||
var menu = this.menu;
|
||
var allPath = [];
|
||
for (var i = 0; i < menu.length; i++) {
|
||
var item = menu[i];
|
||
if (item.path && (!item.subMenu || item.subMenu.length === 0)) {
|
||
allPath.push(item.path);
|
||
} else if (item.subMenu && item.subMenu.length > 0) {
|
||
for (var j = 0; j < item.subMenu.length; j++) {
|
||
var subItem = item.subMenu[j];
|
||
if (subItem.path) {
|
||
allPath.push(subItem.path);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return allPath;
|
||
}
|
||
},
|
||
watch: {
|
||
$route: function $route() {
|
||
this.$nextTick(function () {
|
||
var path = this.$route.path.split('?')[0];
|
||
if (this.allPath.indexOf(path) !== -1) {
|
||
this.activeName = path;
|
||
}
|
||
this.broadcast('Menu', 'fes_allowPage_change');
|
||
});
|
||
},
|
||
|
||
menu: {
|
||
handler: function handler() {
|
||
this.$nextTick(function () {
|
||
this.broadcast('Menu', 'fes_allowPage_change');
|
||
});
|
||
},
|
||
|
||
deep: true
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
var path = this.$route.path.split('?')[0];
|
||
if (this.allPath.indexOf(path) !== -1) {
|
||
this.activeName = path;
|
||
}
|
||
},
|
||
|
||
methods: {
|
||
asyncSelect: function asyncSelect(name) {
|
||
var _this = this;
|
||
|
||
if (name) {
|
||
return new _promise2.default(function (resolve, reject) {
|
||
_this.$router.push(name, resolve, reject);
|
||
});
|
||
}
|
||
return _promise2.default.resolve();
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 470 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('wb-menu', {
|
||
attrs: {
|
||
"width": _vm.width,
|
||
"active-name": _vm.activeName,
|
||
"type": _vm.type,
|
||
"mode": _vm.mode,
|
||
"auto-close": _vm.autoClose,
|
||
"async-select": _vm.asyncSelect
|
||
}
|
||
}, [(_vm.menu && _vm.menu.length > 0) ? [_vm._l((_vm.menu), function(item, index) {
|
||
return [(item.subMenu && item.subMenu.length > 0) ? _c('wb-sub-menu', {
|
||
key: item.title + index,
|
||
attrs: {
|
||
"title": item.title,
|
||
"icon": item.icon
|
||
}
|
||
}, _vm._l((item.subMenu), function(subItem) {
|
||
return _c('wb-menu-item', {
|
||
key: subItem.path,
|
||
attrs: {
|
||
"name": subItem.path,
|
||
"icon": subItem.icon
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(subItem.title) + "\n ")])
|
||
}), 1) : _c('wb-menu-item', {
|
||
key: item.path,
|
||
attrs: {
|
||
"name": item.path,
|
||
"icon": item.icon
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(item.title) + "\n ")])]
|
||
})] : _vm._e()], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-4cf944c6", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 471 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _panel = __webpack_require__(472);
|
||
|
||
var _panel2 = _interopRequireDefault(_panel);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _panel2.default;
|
||
|
||
/***/ }),
|
||
/* 472 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(473),
|
||
/* template */
|
||
__webpack_require__(474),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/panel/panel.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] panel.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-00d2e70a", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-00d2e70a", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 473 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Panel',
|
||
props: {
|
||
title: {
|
||
type: String,
|
||
default: undefined
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 474 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-panel"
|
||
}, [_c('div', {
|
||
staticClass: "ui-panel-title"
|
||
}, [_vm._v("\n " + _vm._s(_vm.title) + "\n "), _c('div', {
|
||
staticClass: "ui-panel-title-button"
|
||
}, [_vm._t("action")], 2)]), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-panel-content"
|
||
}, [_vm._t("default")], 2)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-00d2e70a", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 475 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _affix = __webpack_require__(476);
|
||
|
||
var _affix2 = _interopRequireDefault(_affix);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _affix2.default;
|
||
|
||
/***/ }),
|
||
/* 476 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(477),
|
||
/* template */
|
||
__webpack_require__(478),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/affix/affix.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] affix.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-fbb5f1da", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-fbb5f1da", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 477 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _EventListener = __webpack_require__(143);
|
||
|
||
var _EventListener2 = _interopRequireDefault(_EventListener);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
/**
|
||
* props参数说明
|
||
* @param {offsetTop}: 距离滚动元素顶部的距离
|
||
* @param {offsetBottom}: 距离滚动元素底部的距离
|
||
* @param {target}: 滚动的元素,需要区分是window滚动还是元素内滚动
|
||
* */
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Affix',
|
||
props: {
|
||
offsetTop: {
|
||
type: Number,
|
||
default: 0
|
||
},
|
||
offsetBottom: {
|
||
type: Number,
|
||
default: undefined
|
||
},
|
||
target: {
|
||
type: Function,
|
||
default: function _default() {
|
||
return document.body;
|
||
}
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
affix: false, // 是否激活当前图钉
|
||
styles: null,
|
||
elHeight: 0
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
offsetType: function offsetType() {
|
||
var type = 'top';
|
||
if (this.offsetBottom >= 0) {
|
||
type = 'bottom';
|
||
}
|
||
return type;
|
||
}
|
||
},
|
||
watch: {
|
||
affix: function affix(value) {
|
||
this.$emit('on-change', value);
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
var _this = this;
|
||
|
||
this.$nextTick(function () {
|
||
// 保存元素高度,防止当元素fixed时候内层div脱离文档流时this.$el.getBoundingClientRect()拿到的el_rect.bottom = el_rect.top导致高度=0时出现的闪烁问题
|
||
_this._target = _this.target();
|
||
var rect = _this.$el.getBoundingClientRect();
|
||
var target_rect = _this._target.getBoundingClientRect();
|
||
_this._height = rect.height;
|
||
_this._width = rect.width;
|
||
_this.initDistance = rect.top - target_rect.top;
|
||
_this._scrollEvent = _EventListener2.default.listen(_this._target, 'scroll', _this.handleScroll);
|
||
_this._resizeEvent = _EventListener2.default.listen(_this._target, 'resize', _this.handleScroll);
|
||
_this.handleScroll();
|
||
});
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
// ready的时候已经绑定了事件,destroy的时候直接删除
|
||
this._scrollEvent.remove();
|
||
this._resizeEvent.remove();
|
||
},
|
||
|
||
methods: {
|
||
handleScroll: function handleScroll() {
|
||
var el = this.$el;
|
||
var target = this._target;
|
||
// 获取当前元素的位置信息
|
||
var rect = el.getBoundingClientRect();
|
||
// 获取父亲元素坐标信息
|
||
var target_rect = target.getBoundingClientRect();
|
||
|
||
var scrollTop = (0, _util.getScroll)(target, true); // 获取父亲元素滚动条信息scrollTop
|
||
var scrollLeft = (0, _util.getScroll)(target, false);
|
||
var clientLeft = el.clientLeft || 0;
|
||
var left = rect.left + scrollLeft - clientLeft;
|
||
|
||
var targetHeight = target_rect.height;
|
||
if (this.offsetType === 'top') {
|
||
// 解决人为设的offsetTop比父级滚动元素高度还高的情况的bug
|
||
if (this.offsetTop + this._height > targetHeight) {
|
||
return;
|
||
}
|
||
// Fixed Top
|
||
// 当父滚动元素滚动高度+设定的图钉顶部距父元素顶部的距离 >= 一开始图钉相对父元素文档流的距离,则满足条件,固定
|
||
if (this.offsetTop + scrollTop >= this.initDistance) {
|
||
if (!this.affix) {
|
||
this.affix = true;
|
||
this.styles = {
|
||
top: this.offsetTop + target_rect.top + 'px',
|
||
left: left + 'px',
|
||
height: this._height + 'px',
|
||
width: this._width + 'px'
|
||
};
|
||
}
|
||
} else if (this.affix) {
|
||
this.affix = false;
|
||
this.styles = null;
|
||
}
|
||
} else {
|
||
if (this.offsetBottom + this._height > targetHeight) {
|
||
return;
|
||
}
|
||
// Fixed Bottom
|
||
// 当一开始图钉相对父元素文档流的距离 + 本身高度 + 设定的图钉底部距父元素底边的距离 > 父元素滚动高度 + 父元素本身高度时,固定
|
||
if (this.initDistance + this._height + this.offsetBottom > scrollTop + targetHeight) {
|
||
if (!this.affix) {
|
||
this.affix = true;
|
||
this.styles = {
|
||
top: target_rect.bottom - this.offsetBottom - this._height + 'px',
|
||
left: left + 'px',
|
||
height: this._height + 'px',
|
||
width: this._width + 'px'
|
||
};
|
||
}
|
||
} else if (this.affix) {
|
||
this.affix = false;
|
||
this.styles = null;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 478 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
class: {
|
||
'ui-affix': _vm.affix
|
||
},
|
||
style: (_vm.styles)
|
||
}, [_vm._t("default")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-fbb5f1da", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 479 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _backTop = __webpack_require__(480);
|
||
|
||
var _backTop2 = _interopRequireDefault(_backTop);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _backTop2.default;
|
||
|
||
/***/ }),
|
||
/* 480 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(481),
|
||
/* template */
|
||
__webpack_require__(482),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/back-top/backTop.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] backTop.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-0df8bc08", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-0df8bc08", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 481 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var _EventListener = __webpack_require__(143);
|
||
|
||
var _EventListener2 = _interopRequireDefault(_EventListener);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
function easeInOutCubic(t, b, c, d) {
|
||
var cc = c - b;
|
||
var tt = t / (d / 2);
|
||
var result = 0;
|
||
if (tt < 1) {
|
||
result = cc / 2 * tt * tt * tt + b;
|
||
} else {
|
||
result = cc / 2 * ((tt -= 2) * tt * tt + 2) + b;
|
||
}
|
||
return result;
|
||
} //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
function getRequestAnimationFrame() {
|
||
var func = _util.noop;
|
||
if (typeof window !== 'undefined') {
|
||
func = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {
|
||
setTimeout(function () {
|
||
callback && callback();
|
||
}, 1000 / 60);
|
||
};
|
||
}
|
||
return func;
|
||
}
|
||
exports.default = {
|
||
name: 'BackTop',
|
||
components: {
|
||
Icon: _icon2.default
|
||
},
|
||
props: {
|
||
heightToShow: {
|
||
type: Number,
|
||
default: 400
|
||
},
|
||
target: {
|
||
type: Function,
|
||
default: function _default() {
|
||
return document.documentElement;
|
||
}
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
visible: false,
|
||
container: null
|
||
};
|
||
},
|
||
mounted: function mounted() {
|
||
var _this = this;
|
||
|
||
this.$nextTick(function () {
|
||
_this.container = _this.target();
|
||
if (_this.container === document.documentElement) {
|
||
_this._scrollEvent = _EventListener2.default.listen(window, 'scroll', _this.handleScroll);
|
||
} else {
|
||
_this._scrollEvent = _EventListener2.default.listen(_this.container, 'scroll', _this.handleScroll);
|
||
}
|
||
});
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
this._scrollEvent.remove();
|
||
},
|
||
|
||
methods: {
|
||
setScrollTop: function setScrollTop(value) {
|
||
this.container.scrollTop = value;
|
||
},
|
||
scrollToTop: function scrollToTop() {
|
||
var _this2 = this;
|
||
|
||
var currentScrollTop = this.container.scrollTop;
|
||
var reqAnimationFrame = getRequestAnimationFrame();
|
||
var beginTime = Date.now();
|
||
|
||
var animationFrameFunc = function animationFrameFunc() {
|
||
var currentTime = Date.now();
|
||
var time = currentTime - beginTime;
|
||
_this2.setScrollTop(easeInOutCubic(time, currentScrollTop, 0, 400));
|
||
if (time < 400) reqAnimationFrame(animationFrameFunc);
|
||
};
|
||
reqAnimationFrame(animationFrameFunc);
|
||
},
|
||
handleScroll: function handleScroll() {
|
||
var scrollTop = (0, _util.getScroll)(this.container, true);
|
||
this.visible = scrollTop > this.heightToShow;
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 482 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.visible),
|
||
expression: "visible"
|
||
}],
|
||
staticClass: "ui-back-top-outer",
|
||
on: {
|
||
"click": _vm.scrollToTop
|
||
}
|
||
}, [_vm._t("default", [_c('div', {
|
||
staticClass: "ui-back-top-inner"
|
||
}, [_c('Icon', {
|
||
attrs: {
|
||
"type": "md-arrow-up",
|
||
"size": "25"
|
||
}
|
||
})], 1)])], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-0df8bc08", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 483 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _processCircle = __webpack_require__(484);
|
||
|
||
var _processCircle2 = _interopRequireDefault(_processCircle);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _processCircle2.default;
|
||
|
||
/***/ }),
|
||
/* 484 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(485),
|
||
/* template */
|
||
__webpack_require__(486),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/process-circle/processCircle.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] processCircle.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-349bb328", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-349bb328", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 485 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'ProcessCircle',
|
||
props: {
|
||
percent: {
|
||
type: Number,
|
||
default: 0
|
||
},
|
||
size: {
|
||
type: Number,
|
||
default: 120
|
||
},
|
||
strokeWidth: {
|
||
type: Number,
|
||
default: 6
|
||
},
|
||
strokeColor: {
|
||
type: String,
|
||
default: '#3399ff'
|
||
},
|
||
strokeType: {
|
||
validator: function validator(value) {
|
||
return ['square', 'round'].indexOf(value) !== -1;
|
||
},
|
||
default: 'round'
|
||
},
|
||
trailWidth: {
|
||
type: Number,
|
||
default: 5
|
||
},
|
||
trailColor: {
|
||
type: String,
|
||
default: '#eaeef2'
|
||
}
|
||
},
|
||
computed: {
|
||
getSize: function getSize() {
|
||
return {
|
||
width: this.size + 'px',
|
||
height: this.size + 'px'
|
||
};
|
||
},
|
||
radius: function radius() {
|
||
return 50 - this.strokeWidth / 2;
|
||
},
|
||
pathString: function pathString() {
|
||
return 'M 50 , 50 m 0 ,-' + this.radius + ' a ' + this.radius + ' , ' + this.radius + ' 0 1 1 0 , ' + 2 * this.radius + ' a ' + this.radius + ' , ' + this.radius + ' 0 1 1 0 , -' + 2 * this.radius;
|
||
},
|
||
circleLen: function circleLen() {
|
||
return Math.PI * 2 * this.radius;
|
||
},
|
||
pathStyle: function pathStyle() {
|
||
return {
|
||
'stroke-dasharray': this.circleLen + 'px ' + this.circleLen + 'px',
|
||
'stroke-dashoffset': (100 - this.percent) / 100 * this.circleLen + 'px',
|
||
transition: 'stroke-dashoffset 0.6s ease 0s, stroke 0.6s ease'
|
||
};
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 486 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-process-circle",
|
||
style: (_vm.getSize)
|
||
}, [_c('svg', {
|
||
attrs: {
|
||
"viewBox": "0 0 100 100"
|
||
}
|
||
}, [_c('path', {
|
||
attrs: {
|
||
"d": _vm.pathString,
|
||
"stroke": _vm.trailColor,
|
||
"stroke-width": _vm.trailWidth,
|
||
"fill-opacity": 0
|
||
}
|
||
}), _vm._v(" "), _c('path', {
|
||
style: (_vm.pathStyle),
|
||
attrs: {
|
||
"d": _vm.pathString,
|
||
"stroke-linecap": _vm.strokeType,
|
||
"stroke": _vm.strokeColor,
|
||
"stroke-width": _vm.strokeWidth,
|
||
"fill-opacity": "0"
|
||
}
|
||
})]), _vm._v(" "), _c('div', {
|
||
staticClass: "ui-process-circle-inner"
|
||
}, [_vm._t("default")], 2)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-349bb328", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 487 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _dropdown = __webpack_require__(488);
|
||
|
||
var _dropdown2 = _interopRequireDefault(_dropdown);
|
||
|
||
var _dropdownMenu = __webpack_require__(144);
|
||
|
||
var _dropdownMenu2 = _interopRequireDefault(_dropdownMenu);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
Dropdown: _dropdown2.default,
|
||
DropdownMenu: _dropdownMenu2.default
|
||
};
|
||
|
||
/***/ }),
|
||
/* 488 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(489),
|
||
/* template */
|
||
__webpack_require__(492),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/dropdown-com/dropdown.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] dropdown.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-87393c46", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-87393c46", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 489 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _dropdownMenu = __webpack_require__(144);
|
||
|
||
var _dropdownMenu2 = _interopRequireDefault(_dropdownMenu);
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var _clickoutside = __webpack_require__(29);
|
||
|
||
var _clickoutside2 = _interopRequireDefault(_clickoutside);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Dropdown',
|
||
directives: {
|
||
clickoutside: _clickoutside2.default
|
||
},
|
||
components: {
|
||
dropdownMenu: _dropdownMenu2.default
|
||
},
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
trigger: {
|
||
required: false,
|
||
type: String,
|
||
default: 'hover',
|
||
validator: function validator(value) {
|
||
return ['click', 'hover'].indexOf(value) !== -1;
|
||
}
|
||
},
|
||
data: {
|
||
type: Array,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
sonOpen: false,
|
||
timer: null
|
||
};
|
||
},
|
||
mounted: function mounted() {
|
||
var _this = this;
|
||
|
||
this.$on('chooseItem', function (item, event) {
|
||
_this.$emit('on-choose', item, event);
|
||
_this.close();
|
||
});
|
||
},
|
||
|
||
methods: {
|
||
close: function close() {
|
||
var _this2 = this;
|
||
|
||
this.sonOpen = false;
|
||
this.closing = true;
|
||
setTimeout(function () {
|
||
_this2.closing = false;
|
||
}, 300);
|
||
this.broadcast('DropdownMenu', 'hideSubmenu', this); // 当点击item时,从根往下广播关闭,修正click时候直接点击docment.body后再打开保持原样的问题
|
||
},
|
||
mouseover: function mouseover(event) {
|
||
if (this.trigger == 'hover' && (!this.closing || (0, _util.contains)(this.$refs['dropdown-slot'], event.target))) {
|
||
if (this.timer) {
|
||
clearTimeout(this.timer);
|
||
}
|
||
this.sonOpen = true;
|
||
}
|
||
},
|
||
mouseout: function mouseout() {
|
||
var _this3 = this;
|
||
|
||
if (this.trigger == 'hover') {
|
||
this.timer = setTimeout(function () {
|
||
_this3.sonOpen = false;
|
||
}, 300);
|
||
}
|
||
},
|
||
click: function click() {
|
||
if (this.trigger == 'click') {
|
||
this.sonOpen = !this.sonOpen;
|
||
}
|
||
},
|
||
clickoutside: function clickoutside() {
|
||
if (this.trigger == 'click' && this.sonOpen) {
|
||
this.close();
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 490 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'DropdownMenu',
|
||
mixins: [_emitter2.default],
|
||
props: {
|
||
type: {
|
||
required: false,
|
||
type: String,
|
||
default: 'root'
|
||
},
|
||
data: {
|
||
type: Array,
|
||
default: undefined
|
||
},
|
||
open: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
currentData: this.data,
|
||
timer: null
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
dropdownMenuClass: function dropdownMenuClass() {
|
||
if (this.type === 'sub') {
|
||
return 'wb-dropdown-menu-sub';
|
||
}
|
||
}
|
||
},
|
||
created: function created() {
|
||
var _this = this;
|
||
|
||
this.$on('hideSubmenu', function () {
|
||
_this.broadcast('DropdownMenu', 'hideSubmenu', _this);
|
||
_this.currentData.forEach(function (item) {
|
||
if (item.children && item.children.length > 0) {
|
||
item.sonOpen = false;
|
||
}
|
||
});
|
||
});
|
||
},
|
||
mounted: function mounted() {
|
||
var _this2 = this;
|
||
|
||
this.currentData.forEach(function (item) {
|
||
if (item.children && item.children.length > 0) {
|
||
_this2.$set(item, 'sonOpen', false);
|
||
}
|
||
});
|
||
},
|
||
|
||
methods: {
|
||
getItemClass: function getItemClass(item) {
|
||
var arr = ['wb-dropdown-menu-item', { 'wb-dropdown-menu-item-disabled': item.disabled }, { 'wb-dropdown-menu-item-divider': item.divided }];
|
||
if (item.children && item.children.length > 0) {
|
||
arr.push('wb-dropdown-menu-item-swap');
|
||
}
|
||
return arr;
|
||
},
|
||
mouseover: function mouseover(item) {
|
||
if (!item.children || item.children.length == 0) {
|
||
return;
|
||
}
|
||
if (item.timer) {
|
||
clearTimeout(item.timer);
|
||
}
|
||
item.sonOpen = true;
|
||
},
|
||
mouseout: function mouseout(item) {
|
||
if (!item.children || item.children.length == 0) {
|
||
return;
|
||
}
|
||
item.timer = setTimeout(function () {
|
||
item.sonOpen = false;
|
||
}, 300);
|
||
},
|
||
choose: function choose(item, event) {
|
||
if (!item.children || item.children.length == 0) {
|
||
this.dispatch('Dropdown', 'chooseItem', [item, event]);
|
||
}
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 491 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('transition', {
|
||
attrs: {
|
||
"name": "slide-to-down"
|
||
}
|
||
}, [_c('ul', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.open),
|
||
expression: "open"
|
||
}],
|
||
ref: "list",
|
||
staticClass: "wb-dropdown-menu",
|
||
class: _vm.dropdownMenuClass
|
||
}, _vm._l((_vm.currentData), function(item, index) {
|
||
return _c('li', {
|
||
key: index,
|
||
class: _vm.getItemClass(item),
|
||
on: {
|
||
"mouseover": function($event) {
|
||
return _vm.mouseover(item)
|
||
},
|
||
"mouseout": function($event) {
|
||
return _vm.mouseout(item)
|
||
},
|
||
"click": function($event) {
|
||
return _vm.choose(item, $event)
|
||
}
|
||
}
|
||
}, [_vm._v("\n " + _vm._s(item.content) + "\n "), (item.children && item.children.length) ? [_c('dropdown-menu', {
|
||
attrs: {
|
||
"data": item.children,
|
||
"open": item.sonOpen,
|
||
"type": "sub"
|
||
}
|
||
})] : _vm._e()], 2)
|
||
}), 0)])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-3bf5e95c", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 492 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={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.clickoutside),
|
||
expression: "clickoutside"
|
||
}],
|
||
staticClass: "wb-dropdown",
|
||
on: {
|
||
"mouseover": _vm.mouseover,
|
||
"mouseout": _vm.mouseout
|
||
}
|
||
}, [_c('div', {
|
||
ref: "dropdown-slot",
|
||
staticClass: "wb-dropdown-slot",
|
||
on: {
|
||
"click": _vm.click
|
||
}
|
||
}, [_vm._t("default")], 2), _vm._v(" "), _c('dropdown-menu', {
|
||
attrs: {
|
||
"data": _vm.data,
|
||
"open": _vm.sonOpen
|
||
}
|
||
})], 1)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-87393c46", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 493 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _Draggable = __webpack_require__(494);
|
||
|
||
var _Draggable2 = _interopRequireDefault(_Draggable);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _Draggable2.default;
|
||
|
||
/***/ }),
|
||
/* 494 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(495),
|
||
/* template */
|
||
__webpack_require__(506),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/draggable/Draggable.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] Draggable.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-3684b2a6", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-3684b2a6", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 495 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _keys = __webpack_require__(74);
|
||
|
||
var _keys2 = _interopRequireDefault(_keys);
|
||
|
||
var _DraggableItem = __webpack_require__(496);
|
||
|
||
var _DraggableItem2 = _interopRequireDefault(_DraggableItem);
|
||
|
||
var _utils = __webpack_require__(499);
|
||
|
||
var _Manager = __webpack_require__(500);
|
||
|
||
var _Manager2 = _interopRequireDefault(_Manager);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'Draggable',
|
||
components: {
|
||
DraggableItem: _DraggableItem2.default
|
||
},
|
||
props: {
|
||
value: {
|
||
type: Array,
|
||
required: true
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
manager: new _Manager2.default(),
|
||
collection: 'default',
|
||
events: {
|
||
mousedown: 'handleStart',
|
||
mousemove: 'handleMove',
|
||
mouseup: 'handleUp'
|
||
}
|
||
};
|
||
},
|
||
provide: function provide() {
|
||
return {
|
||
manager: this.manager
|
||
};
|
||
},
|
||
mounted: function mounted() {
|
||
var _this = this;
|
||
|
||
this.collection = this._uid;
|
||
this.container = this.$el;
|
||
this._window = window;
|
||
(0, _keys2.default)(this.events).forEach(function (evName) {
|
||
_this.container.addEventListener(evName, _this[_this.events[evName]], false);
|
||
});
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
var _this2 = this;
|
||
|
||
(0, _keys2.default)(this.events).forEach(function (evName) {
|
||
_this2.container.removeEventListener(evName, _this2[_this2.events[evName]]);
|
||
});
|
||
},
|
||
|
||
methods: {
|
||
handleStart: function handleStart(e) {
|
||
e.stopPropagation();
|
||
if (this.disabled) return;
|
||
this._pos = {
|
||
x: e.pageX,
|
||
y: e.pageY
|
||
};
|
||
var node = (0, _utils.closest)(e.target, function (el) {
|
||
return el.sortableInfo && el.sortableInfo != null;
|
||
});
|
||
if (node && node.sortableInfo) {
|
||
var _node$sortableInfo = node.sortableInfo,
|
||
index = _node$sortableInfo.index,
|
||
item = _node$sortableInfo.item;
|
||
|
||
this.activeNode = node;
|
||
this.$emit('on-sort-ready', { e: e, item: item, index: index });
|
||
this.handlePress(e);
|
||
}
|
||
},
|
||
handlePress: function handlePress() {
|
||
var _this3 = this;
|
||
|
||
var nodes = this.manager.getOrderedRefs(this.collection);
|
||
this.activeIndex = nodes.findIndex(function (node) {
|
||
return node === _this3.activeNode;
|
||
});
|
||
this.nodeRect = this.activeNode.getBoundingClientRect();
|
||
this.width = this.nodeRect.width;
|
||
this.height = this.nodeRect.height;
|
||
this.offsetEdge = this.getEdgeOffset(this.activeNode);
|
||
this.sorting = true;
|
||
},
|
||
handleUp: function handleUp() {
|
||
this.sorting = false;
|
||
},
|
||
handleMove: function handleMove(e) {
|
||
e.preventDefault();
|
||
if (!this.sorting) return;
|
||
var mouseMove = {
|
||
x: e.pageX - this._pos.x,
|
||
y: e.pageY - this._pos.y
|
||
};
|
||
if (Math.abs(mouseMove.x) > 5 || Math.abs(mouseMove.y) > 5) {
|
||
var _activeNode$sortableI = this.activeNode.sortableInfo,
|
||
index = _activeNode$sortableI.index,
|
||
item = _activeNode$sortableI.item;
|
||
|
||
this.$emit('on-sort-start', { e: e, item: item, index: index });
|
||
if (item.sortDisabled) {
|
||
return;
|
||
}
|
||
if (!this.helper) {
|
||
this._window.addEventListener('mousemove', this.handleSortMove, false);
|
||
this._window.addEventListener('mouseup', this.handleSortEnd, false);
|
||
var cloneNode = this.activeNode.cloneNode(true);
|
||
this.activeNode.style.opacity = 0;
|
||
this.activeNode.style.visibility = 'hidden';
|
||
this.initHelper(cloneNode);
|
||
}
|
||
}
|
||
},
|
||
handleSortMove: function handleSortMove(e) {
|
||
var mouseMove = {
|
||
x: e.pageX - this._pos.x,
|
||
y: e.pageY - this._pos.y
|
||
};
|
||
var sortingOffset = {
|
||
left: this.offsetEdge.left + mouseMove.x,
|
||
top: this.offsetEdge.top + mouseMove.y
|
||
};
|
||
this.newIndex = null;
|
||
var nodes = this.manager.getOrderedRefs(this.collection);
|
||
for (var i = 0; i < nodes.length; i++) {
|
||
this._translate = {
|
||
x: 0,
|
||
y: 0
|
||
};
|
||
var currentNode = nodes[i];
|
||
var width = currentNode.offsetWidth;
|
||
var height = currentNode.offsetHeight;
|
||
var halfOffset = {
|
||
width: this.width > width ? width / 2 : this.width / 2,
|
||
height: this.height > height ? height / 2 : this.height / 2
|
||
};
|
||
var edgeOffset = currentNode.edgeOffset;
|
||
if (!edgeOffset) {
|
||
currentNode.edgeOffset = edgeOffset = this.getEdgeOffset(currentNode);
|
||
}
|
||
|
||
if (i === this.activeIndex) continue;
|
||
if (i > this.activeIndex && sortingOffset.top + halfOffset.height > edgeOffset.top) {
|
||
this.newIndex = i;
|
||
this._translate.y = -height;
|
||
} else if (i < this.activeIndex && sortingOffset.top <= edgeOffset.top + halfOffset.height) {
|
||
this._translate.y = height;
|
||
if (this.newIndex == null) {
|
||
this.newIndex = i;
|
||
}
|
||
}
|
||
currentNode.style[_utils.vendorPrefix + 'TransitionDuration'] = '300ms';
|
||
currentNode.style[_utils.vendorPrefix + 'Transform'] = 'translate3d(' + this._translate.x + 'px,' + this._translate.y + 'px,0)';
|
||
}
|
||
if (this.newIndex == null) {
|
||
this.newIndex = this.activeIndex;
|
||
}
|
||
this.helper.style[_utils.vendorPrefix + 'Transform'] = 'translate3d(' + mouseMove.x + 'px,' + mouseMove.y + 'px, 0)';
|
||
},
|
||
handleSortEnd: function handleSortEnd(e) {
|
||
if (!this.helper) return;
|
||
this._window.removeEventListener('mousemove', this.handleSortMove, false);
|
||
this._window.removeEventListener('mouseup', this.handleSortEnd, false);
|
||
this.helper.parentNode.removeChild(this.helper);
|
||
this.sorting = false;
|
||
this.activeNode.style.visibility = '';
|
||
this.activeNode.style.opacity = '';
|
||
var nodes = this.manager.getOrderedRefs(this.collection);
|
||
for (var i = 0, len = nodes.length; i < len; i++) {
|
||
var node = nodes[i];
|
||
|
||
node.edgeOffset = null;
|
||
node.style[_utils.vendorPrefix + 'Transform'] = '';
|
||
node.style[_utils.vendorPrefix + 'TransitionDuration'] = '';
|
||
}
|
||
var _activeNode$sortableI2 = this.activeNode.sortableInfo,
|
||
index = _activeNode$sortableI2.index,
|
||
item = _activeNode$sortableI2.item;
|
||
|
||
this.$emit('input', (0, _utils.arrayMove)(this.value, this.activeIndex, this.newIndex));
|
||
this.$emit('on-sort-end', { e: e, item: item, index: index });
|
||
this.newIndex = null;
|
||
this.helper = null;
|
||
this.sorting = false;
|
||
},
|
||
initHelper: function initHelper(cloneNode) {
|
||
this.helper = this.container.appendChild(cloneNode);
|
||
this.helper.style.position = 'fixed';
|
||
this.helper.style.top = this.nodeRect.top + 'px';
|
||
this.helper.style.left = this.nodeRect.left + 'px';
|
||
this.helper.style.width = this.width + 'px';
|
||
this.helper.style.height = this.height + 'px';
|
||
},
|
||
getEdgeOffset: function getEdgeOffset(node) {
|
||
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { top: 0, left: 0 };
|
||
|
||
var nodeOffset = {
|
||
top: offset.top + node.offsetTop,
|
||
left: offset.left + node.offsetLeft
|
||
};
|
||
if (node.parentNode && node.parentNode !== this.container) {
|
||
return this.getEdgeOffset(node.parentNode, nodeOffset);
|
||
}
|
||
return nodeOffset;
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 496 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(497),
|
||
/* template */
|
||
__webpack_require__(498),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/draggable/DraggableItem.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] DraggableItem.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-49a49c40", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-49a49c40", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 497 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'DraggableItem',
|
||
props: {
|
||
index: {
|
||
type: Number,
|
||
default: undefined
|
||
},
|
||
item: {
|
||
type: Object,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
collection: 'default'
|
||
};
|
||
},
|
||
|
||
inject: ['manager'],
|
||
watch: {
|
||
index: function index(newIndex) {
|
||
if (this.$el) {
|
||
this.$el.sortableInfo.newIndex = newIndex;
|
||
}
|
||
},
|
||
|
||
item: {
|
||
handler: function handler(newItem) {
|
||
if (this.$el) {
|
||
this.$el.sortableInfo.item = newItem;
|
||
}
|
||
},
|
||
|
||
deep: true
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
this.collection = this.getClosetDraggable(this)._uid;
|
||
this.initItem(this.index, this.item);
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
this.removeDraggable();
|
||
},
|
||
|
||
methods: {
|
||
initItem: function initItem(index, item) {
|
||
var node = this.$el;
|
||
node.sortableInfo = {
|
||
index: index,
|
||
item: item
|
||
};
|
||
this.ref = node;
|
||
this.manager.add(this.ref, this.collection);
|
||
},
|
||
removeDraggable: function removeDraggable() {
|
||
this.manager.remove(this.ref, this.collection);
|
||
},
|
||
getClosetDraggable: function getClosetDraggable(com) {
|
||
var parentCom = com.$parent;
|
||
if (!parentCom) {
|
||
return null;
|
||
}if (parentCom.$options.name === 'Draggable') {
|
||
return parentCom;
|
||
}
|
||
return this.getClosetDraggable(parentCom);
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 498 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "draggable-item"
|
||
}, [_vm._t("default")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-49a49c40", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 499 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.arrayMove = arrayMove;
|
||
exports.closest = closest;
|
||
exports.limit = limit;
|
||
exports.getElementMargin = getElementMargin;
|
||
exports.getHelperDimensions = getHelperDimensions;
|
||
function arrayMove(arr, previousIndex, newIndex) {
|
||
var array = arr.slice(0);
|
||
if (newIndex >= array.length) {
|
||
var k = newIndex - array.length;
|
||
while (k-- + 1) {
|
||
array.push(undefined);
|
||
}
|
||
}
|
||
array.splice(newIndex, 0, array.splice(previousIndex, 1)[0]);
|
||
return array;
|
||
}
|
||
|
||
var vendorPrefix = exports.vendorPrefix = function () {
|
||
if (typeof window === 'undefined' || typeof document === 'undefined') return ''; // server environment
|
||
var styles = window.getComputedStyle(document.documentElement, '') || ['-moz-hidden-iframe'];
|
||
var pre = (Array.prototype.slice.call(styles).join('').match(/-(moz|webkit|ms)-/) || styles.OLink === '' && ['', 'o'])[1];
|
||
|
||
switch (pre) {
|
||
case 'ms':
|
||
return 'ms';
|
||
default:
|
||
return pre && pre.length ? pre[0].toUpperCase() + pre.substr(1) : '';
|
||
}
|
||
}();
|
||
|
||
function closest(el, fn) {
|
||
while (el) {
|
||
if (fn(el)) return el;
|
||
el = el.parentNode;
|
||
}
|
||
}
|
||
|
||
function limit(min, max, value) {
|
||
if (value < min) {
|
||
return min;
|
||
}
|
||
if (value > max) {
|
||
return max;
|
||
}
|
||
return value;
|
||
}
|
||
|
||
function getCSSPixelValue(stringValue) {
|
||
if (stringValue.substr(-2) === 'px') {
|
||
return parseFloat(stringValue);
|
||
}
|
||
return 0;
|
||
}
|
||
|
||
function getElementMargin(element) {
|
||
var style = window.getComputedStyle(element);
|
||
|
||
return {
|
||
top: getCSSPixelValue(style.marginTop),
|
||
right: getCSSPixelValue(style.marginRight),
|
||
bottom: getCSSPixelValue(style.marginBottom),
|
||
left: getCSSPixelValue(style.marginLeft)
|
||
};
|
||
}
|
||
|
||
function getHelperDimensions(node) {
|
||
return {
|
||
width: node.offsetWidth,
|
||
height: node.offsetHeight
|
||
};
|
||
}
|
||
|
||
/***/ }),
|
||
/* 500 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _classCallCheck2 = __webpack_require__(501);
|
||
|
||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
||
|
||
var _createClass2 = __webpack_require__(502);
|
||
|
||
var _createClass3 = _interopRequireDefault(_createClass2);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
var Manager = function () {
|
||
function Manager() {
|
||
(0, _classCallCheck3.default)(this, Manager);
|
||
|
||
this.refs = {};
|
||
}
|
||
|
||
(0, _createClass3.default)(Manager, [{
|
||
key: 'add',
|
||
value: function add(ref) {
|
||
var collection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
||
|
||
if (!this.refs[collection]) {
|
||
this.refs[collection] = [];
|
||
}
|
||
|
||
this.refs[collection].push(ref);
|
||
}
|
||
}, {
|
||
key: 'remove',
|
||
value: function remove(ref) {
|
||
var collection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
||
|
||
var index = this.getIndex(ref, collection);
|
||
if (index !== -1) {
|
||
this.refs[collection].splice(index, 1);
|
||
}
|
||
}
|
||
}, {
|
||
key: 'isActive',
|
||
value: function isActive() {
|
||
return this.active;
|
||
}
|
||
}, {
|
||
key: 'getActive',
|
||
value: function getActive() {
|
||
var _this = this;
|
||
|
||
var collection = 'default';
|
||
return this.refs[collection].find(function (node) {
|
||
return node.sortableInfo.index == _this.active.index;
|
||
});
|
||
}
|
||
}, {
|
||
key: 'getIndex',
|
||
value: function getIndex(ref) {
|
||
var collection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
||
|
||
return this.refs[collection].indexOf(ref);
|
||
}
|
||
}, {
|
||
key: 'getOrderedRefs',
|
||
value: function getOrderedRefs() {
|
||
var collection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
||
|
||
return this.refs[collection];
|
||
}
|
||
}]);
|
||
return Manager;
|
||
}();
|
||
|
||
exports.default = Manager;
|
||
|
||
/***/ }),
|
||
/* 501 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
exports.__esModule = true;
|
||
|
||
exports.default = function (instance, Constructor) {
|
||
if (!(instance instanceof Constructor)) {
|
||
throw new TypeError("Cannot call a class as a function");
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 502 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
exports.__esModule = true;
|
||
|
||
var _defineProperty = __webpack_require__(503);
|
||
|
||
var _defineProperty2 = _interopRequireDefault(_defineProperty);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = function () {
|
||
function defineProperties(target, props) {
|
||
for (var i = 0; i < props.length; i++) {
|
||
var descriptor = props[i];
|
||
descriptor.enumerable = descriptor.enumerable || false;
|
||
descriptor.configurable = true;
|
||
if ("value" in descriptor) descriptor.writable = true;
|
||
(0, _defineProperty2.default)(target, descriptor.key, descriptor);
|
||
}
|
||
}
|
||
|
||
return function (Constructor, protoProps, staticProps) {
|
||
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
||
if (staticProps) defineProperties(Constructor, staticProps);
|
||
return Constructor;
|
||
};
|
||
}();
|
||
|
||
/***/ }),
|
||
/* 503 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports = { "default": __webpack_require__(504), __esModule: true };
|
||
|
||
/***/ }),
|
||
/* 504 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
__webpack_require__(505);
|
||
var $Object = __webpack_require__(6).Object;
|
||
module.exports = function defineProperty(it, key, desc) {
|
||
return $Object.defineProperty(it, key, desc);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
/* 505 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var $export = __webpack_require__(14);
|
||
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
|
||
$export($export.S + $export.F * !__webpack_require__(18), 'Object', { defineProperty: __webpack_require__(21).f });
|
||
|
||
|
||
/***/ }),
|
||
/* 506 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "draggable-container"
|
||
}, _vm._l((_vm.value), function(item, index) {
|
||
return _c('DraggableItem', {
|
||
key: index,
|
||
attrs: {
|
||
"index": index,
|
||
"item": item
|
||
}
|
||
}, [_vm._t("default", null, {
|
||
"item": item,
|
||
"index": index
|
||
})], 2)
|
||
}), 1)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-3684b2a6", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 507 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _index = __webpack_require__(508);
|
||
|
||
var _index2 = _interopRequireDefault(_index);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _index2.default;
|
||
|
||
/***/ }),
|
||
/* 508 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(509),
|
||
/* template */
|
||
__webpack_require__(511),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/contextmenu/index.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-b8038c5a", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-b8038c5a", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 509 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _clickoutside = __webpack_require__(29);
|
||
|
||
var _clickoutside2 = _interopRequireDefault(_clickoutside);
|
||
|
||
var _mouseoutside = __webpack_require__(510);
|
||
|
||
var _mouseoutside2 = _interopRequireDefault(_mouseoutside);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Contextmenu',
|
||
directives: {
|
||
clickoutside: _clickoutside2.default, mouseoutside: _mouseoutside2.default
|
||
},
|
||
props: {
|
||
data: {
|
||
type: Array,
|
||
default: undefined
|
||
},
|
||
clickNoClose: {
|
||
type: Boolean,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
show: false,
|
||
left: 0,
|
||
top: 0
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getStyle: function getStyle() {
|
||
return {
|
||
left: this.left + 'px',
|
||
top: this.top + 'px'
|
||
};
|
||
}
|
||
},
|
||
methods: {
|
||
showMenu: function showMenu(e) {
|
||
this.left = e.offsetX;
|
||
this.top = e.offsetY;
|
||
this.show = true;
|
||
},
|
||
clickoutside: function clickoutside(type) {
|
||
var that = this;
|
||
var fn = function fn() {
|
||
that.show = false;
|
||
};
|
||
if (!this.clickNoClose && type === 'list') {
|
||
return fn;
|
||
}if (this.clickNoClose && type === 'menu') {
|
||
return fn;
|
||
}
|
||
},
|
||
choose: function choose(item, index) {
|
||
this.show = false;
|
||
this.$emit('on-choose', item, index);
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 510 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
var cache = {};
|
||
var key = 1;
|
||
exports.default = {
|
||
inserted: function inserted(el, binding) {
|
||
el.outsideKey = key++;
|
||
var self = {};
|
||
self.documentHandler = function (e) {
|
||
if (util.contains(el, e.target)) {
|
||
return false;
|
||
}
|
||
if (binding.value) {
|
||
binding.value();
|
||
}
|
||
};
|
||
cache[el.outsideKey] = self;
|
||
document.addEventListener('mousedown', self.documentHandler);
|
||
},
|
||
unbind: function unbind(el) {
|
||
var self = cache[el.outsideKey];
|
||
document.removeEventListener('mousedown', self.documentHandler);
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 511 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={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.clickoutside('menu')),
|
||
expression: "clickoutside('menu')"
|
||
}, {
|
||
name: "mouseoutside",
|
||
rawName: "v-mouseoutside",
|
||
value: (_vm.clickoutside('menu')),
|
||
expression: "clickoutside('menu')"
|
||
}],
|
||
staticClass: "ui-contextmenu"
|
||
}, [_c('div', {
|
||
staticClass: "ui-contextmenu-slot",
|
||
on: {
|
||
"contextmenu": function($event) {
|
||
$event.preventDefault();
|
||
$event.stopPropagation();
|
||
return _vm.showMenu($event)
|
||
}
|
||
}
|
||
}, [_vm._t("default")], 2), _vm._v(" "), (_vm.data.length > 0) ? _c('div', {
|
||
directives: [{
|
||
name: "clickoutside",
|
||
rawName: "v-clickoutside",
|
||
value: (_vm.clickoutside('list')),
|
||
expression: "clickoutside('list')"
|
||
}, {
|
||
name: "mouseoutside",
|
||
rawName: "v-mouseoutside",
|
||
value: (_vm.clickoutside('list')),
|
||
expression: "clickoutside('list')"
|
||
}, {
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.show),
|
||
expression: "show"
|
||
}],
|
||
staticClass: "ui-contextmenu-list",
|
||
style: (_vm.getStyle),
|
||
on: {
|
||
"click": function($event) {
|
||
$event.stopPropagation();
|
||
}
|
||
}
|
||
}, _vm._l((_vm.data), function(item, index) {
|
||
return _c('div', {
|
||
key: index,
|
||
staticClass: "ui-contextmenu-item",
|
||
on: {
|
||
"click": function($event) {
|
||
return _vm.choose(item, index)
|
||
}
|
||
}
|
||
}, [_vm._v(_vm._s(item))])
|
||
}), 0) : _vm._e()])
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-b8038c5a", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 512 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _split = __webpack_require__(513);
|
||
|
||
var _split2 = _interopRequireDefault(_split);
|
||
|
||
var _splitItem = __webpack_require__(516);
|
||
|
||
var _splitItem2 = _interopRequireDefault(_splitItem);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
Split: _split2.default,
|
||
SplitItem: _splitItem2.default
|
||
};
|
||
|
||
/***/ }),
|
||
/* 513 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(514),
|
||
/* template */
|
||
__webpack_require__(515),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/split-com/split.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] split.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-7c3fd94a", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-7c3fd94a", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 514 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
var _elementResizeEvent = __webpack_require__(133);
|
||
|
||
var _elementResizeEvent2 = _interopRequireDefault(_elementResizeEvent);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
props: {
|
||
diretion: {
|
||
type: String,
|
||
default: 'horizontal' // vertical垂直、horizontal水平
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
items: [],
|
||
clientWidth: 0,
|
||
clientHeight: 0,
|
||
readyToAllocationWidth: 0,
|
||
readyToAllocationHeight: 0,
|
||
readyToAllocationItemLength: 0,
|
||
moveIndex: null,
|
||
currentChange: null
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
getClass: function getClass() {
|
||
return 'ui-split-' + this.diretion;
|
||
},
|
||
itemLength: function itemLength() {
|
||
return this.items.length;
|
||
},
|
||
fristItem: function fristItem() {
|
||
var _this = this;
|
||
|
||
if (this.moveIndex) {
|
||
var fristItem = this.items.filter(function (item) {
|
||
return item.index == _this.moveIndex - 1;
|
||
})[0];
|
||
return fristItem;
|
||
}
|
||
},
|
||
secondItem: function secondItem() {
|
||
var _this2 = this;
|
||
|
||
if (this.moveIndex) {
|
||
var secondItem = this.items.filter(function (item) {
|
||
return item.index == _this2.moveIndex;
|
||
})[0];
|
||
return secondItem;
|
||
}
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
window.addEventListener('mousemove', this.handleMouseMove);
|
||
window.addEventListener('mouseup', this.handleMouseUp);
|
||
_elementResizeEvent2.default.bind(this.$el, this.resize);
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
window.removeEventListener('mousemove', this.handleMouseMove);
|
||
window.removeEventListener('mouseup', this.handleMouseUp);
|
||
_elementResizeEvent2.default.unbind(this.$el);
|
||
},
|
||
|
||
methods: {
|
||
resize: function resize() {
|
||
this.clientWidth = this.$el.clientWidth;
|
||
this.clientHeight = this.$el.clientHeight;
|
||
this.initItem();
|
||
},
|
||
initItem: function initItem() {
|
||
var _this3 = this;
|
||
|
||
if (!this.clientWidth && !this.clientHeight) {
|
||
this.clientWidth = this.$el.clientWidth;
|
||
this.clientHeight = this.$el.clientHeight;
|
||
}
|
||
this.readyToAllocationItemLength = 0;
|
||
if (this.diretion == 'horizontal') {
|
||
// 如果item设置了width,则根据width计算出它的currentWidth。如果没设置width,则平均 总宽度减去已经设置过的宽度
|
||
this.readyToAllocationWidth = this.clientWidth;
|
||
this.items.forEach(function (element) {
|
||
if (element.width) {
|
||
var currentWidth = element.width;
|
||
if (util.isString(currentWidth)) {
|
||
currentWidth = Number(currentWidth);
|
||
}
|
||
if (currentWidth < 1) {
|
||
currentWidth = _this3.clientWidth * currentWidth;
|
||
}
|
||
element.currentWidth = currentWidth;
|
||
_this3.readyToAllocationWidth -= element.currentWidth;
|
||
} else {
|
||
_this3.readyToAllocationItemLength += 1;
|
||
}
|
||
});
|
||
this.items.forEach(function (element) {
|
||
if (!element.width) {
|
||
element.currentWidth = _this3.readyToAllocationWidth / _this3.readyToAllocationItemLength;
|
||
}
|
||
});
|
||
}
|
||
if (this.diretion == 'vertical') {
|
||
// 高度同上
|
||
this.readyToAllocationHeight = this.clientHeight;
|
||
this.items.forEach(function (element) {
|
||
if (element.height) {
|
||
var currentHeight = element.height;
|
||
if (util.isString(currentHeight)) {
|
||
currentHeight = Number(currentHeight);
|
||
}
|
||
if (currentHeight < 1) {
|
||
currentHeight = _this3.clientHeight * currentHeight;
|
||
}
|
||
element.currentHeight = currentHeight;
|
||
_this3.readyToAllocationHeight -= element.currentHeight;
|
||
} else {
|
||
_this3.readyToAllocationItemLength += 1;
|
||
}
|
||
});
|
||
this.items.forEach(function (element) {
|
||
if (!element.height) {
|
||
element.currentHeight = _this3.readyToAllocationHeight / _this3.readyToAllocationItemLength;
|
||
}
|
||
});
|
||
}
|
||
},
|
||
addItem: function addItem(item) {
|
||
this.items.push(item);
|
||
if (this.items.length == this.$children.length) {
|
||
this.initItem();
|
||
}
|
||
},
|
||
removeItem: function removeItem(item) {
|
||
var index = this.items.indexOf(item);
|
||
if (index != -1) {
|
||
this.items.splice(index, 1);
|
||
}
|
||
this.initItem();
|
||
},
|
||
getLeft: function getLeft(index) {
|
||
var width = 0;
|
||
this.items.forEach(function (element) {
|
||
if (element.index < index) {
|
||
width += element.cWidth;
|
||
}
|
||
});
|
||
return width;
|
||
},
|
||
getTop: function getTop(index) {
|
||
var height = 0;
|
||
this.items.forEach(function (element) {
|
||
if (element.index < index) {
|
||
height += element.cHeight;
|
||
}
|
||
});
|
||
return height;
|
||
},
|
||
getDashStyle: function getDashStyle(index) {
|
||
var diretion = this.diretion;
|
||
var base = 4;
|
||
if (diretion == 'horizontal') {
|
||
return {
|
||
left: this.getLeft(index) - base / 2 + 'px',
|
||
top: 0,
|
||
bottom: 0,
|
||
width: base + 'px'
|
||
};
|
||
}
|
||
if (diretion == 'vertical') {
|
||
return {
|
||
top: this.getTop(index) - base / 2 + 'px',
|
||
left: 0,
|
||
right: 0,
|
||
height: base + 'px'
|
||
};
|
||
}
|
||
},
|
||
handleMouseDown: function handleMouseDown(index, event) {
|
||
this.moveIndex = index;
|
||
var mouseEvent = this.getStdMouseEvent(event);
|
||
this.startX = mouseEvent.positionX;
|
||
this.startY = mouseEvent.positionY;
|
||
this.$emit('on-move-start', event);
|
||
},
|
||
handleMouseMove: function handleMouseMove(event) {
|
||
var _this4 = this;
|
||
|
||
if (this.moveIndex) {
|
||
this.$emit('on-moving', event);
|
||
event.stopPropagation();
|
||
event.preventDefault();
|
||
var mouseEvent = this.getStdMouseEvent(event);
|
||
this.currentX = mouseEvent.positionX;
|
||
this.currentY = mouseEvent.positionY;
|
||
var variable = '';
|
||
if (this.diretion == 'horizontal') {
|
||
this.currentChange = this.currentX - this.startX;
|
||
variable = 'currentWidth';
|
||
}
|
||
if (this.diretion == 'vertical') {
|
||
this.currentChange = this.currentY - this.startY;
|
||
variable = 'currentHeight';
|
||
}
|
||
var fristSize = this.fristItem[variable] + this.currentChange;
|
||
var secondSize = this.secondItem[variable] - this.currentChange;
|
||
if (this.fristItem.minSize && fristSize < this.fristItem.minSize) {
|
||
this.currentChange = this.fristItem.minSize - this.fristItem[variable];
|
||
} else if (this.fristItem.maxSize && fristSize > this.fristItem.maxSize) {
|
||
this.currentChange = this.fristItem.maxSize - this.fristItem[variable];
|
||
} else if (this.secondItem.minSize && secondSize < this.secondItem.minSize) {
|
||
this.currentChange = this.secondItem[variable] - this.secondItem.minSize;
|
||
} else if (this.secondItem.maxSize && secondSize > this.secondItem.maxSize) {
|
||
this.currentChange = this.secondItem[variable] - this.secondItem.maxSize;
|
||
} else if (fristSize < 10) {
|
||
// 最小宽度为10,不要就要拖的重合了
|
||
this.currentChange = 10 - this.fristItem[variable];
|
||
} else if (secondSize < 10) {
|
||
// 最小宽度为10,不要就要拖的重合了
|
||
this.currentChange = this.secondItem[variable] - 10;
|
||
}
|
||
window.requestAnimationFrame(function () {
|
||
if (_this4.currentChange) {
|
||
_this4.fristItem.currentChange = _this4.currentChange;
|
||
_this4.secondItem.currentChange = -_this4.currentChange;
|
||
}
|
||
});
|
||
}
|
||
},
|
||
handleMouseUp: function handleMouseUp(event) {
|
||
var _this5 = this;
|
||
|
||
if (this.moveIndex) {
|
||
this.$emit('on-move-end', event);
|
||
event.stopPropagation();
|
||
event.preventDefault();
|
||
var variable = '';
|
||
if (this.diretion == 'horizontal') {
|
||
variable = 'currentWidth';
|
||
}
|
||
if (this.diretion == 'vertical') {
|
||
variable = 'currentHeight';
|
||
}
|
||
window.requestAnimationFrame(function () {
|
||
// 停止后记录更新当前的currentWidth或者currentHeight
|
||
var fristSize = _this5.fristItem[variable] + _this5.currentChange;
|
||
var secondSize = _this5.secondItem[variable] - _this5.currentChange;
|
||
_this5.fristItem[variable] = fristSize;
|
||
_this5.fristItem.currentChange = 0;
|
||
_this5.secondItem[variable] = secondSize;
|
||
_this5.secondItem.currentChange = 0;
|
||
_this5.moveIndex = null;
|
||
_this5.startX = null;
|
||
_this5.startY = null;
|
||
_this5.currentX = null;
|
||
_this5.currentY = null;
|
||
_this5.currentChange = null;
|
||
});
|
||
}
|
||
},
|
||
getStdMouseEvent: function getStdMouseEvent(event) {
|
||
return {
|
||
positionX: event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft,
|
||
positionY: event.clientY + document.body.scrollTop + document.documentElement.scrollTop
|
||
};
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 515 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-split",
|
||
class: _vm.getClass
|
||
}, [_vm._t("default"), _vm._v(" "), _vm._l((_vm.itemLength), function(i) {
|
||
return (i > 1) ? _c('div', {
|
||
key: i,
|
||
staticClass: "ui-split-dash",
|
||
style: (_vm.getDashStyle(i)),
|
||
on: {
|
||
"mousedown": function($event) {
|
||
$event.stopPropagation();
|
||
return _vm.handleMouseDown(i, $event)
|
||
}
|
||
}
|
||
}) : _vm._e()
|
||
})], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-7c3fd94a", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 516 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(517),
|
||
/* template */
|
||
__webpack_require__(518),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/split-com/splitItem.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] splitItem.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-52ce178e", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-52ce178e", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 517 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
var util = _interopRequireWildcard(_util);
|
||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||
|
||
exports.default = {
|
||
props: {
|
||
min: {
|
||
type: [Number, String],
|
||
default: undefined
|
||
},
|
||
max: {
|
||
type: [Number, String],
|
||
default: undefined
|
||
},
|
||
width: {
|
||
type: [Number, String],
|
||
default: undefined
|
||
},
|
||
height: {
|
||
type: [Number, String],
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
index: null,
|
||
parent: this.$parent,
|
||
currentWidth: 0,
|
||
currentHeight: 0,
|
||
currentChange: 0,
|
||
isFullScreen: false
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
minSize: function minSize() {
|
||
var min = this.min;
|
||
if (util.isString(min)) {
|
||
min = Number(min);
|
||
}
|
||
if (min < 1) {
|
||
var diretion = this.parent.diretion;
|
||
if (diretion == 'horizontal') {
|
||
min = this.parent.clientWidth * min;
|
||
}
|
||
if (diretion == 'vertical') {
|
||
min = this.parent.clientHeight * min;
|
||
}
|
||
}
|
||
return min;
|
||
},
|
||
maxSize: function maxSize() {
|
||
var max = this.max;
|
||
if (util.isString(max)) {
|
||
max = Number(max);
|
||
}
|
||
if (max < 1) {
|
||
var diretion = this.parent.diretion;
|
||
if (diretion == 'horizontal') {
|
||
max = this.parent.clientWidth * max;
|
||
}
|
||
if (diretion == 'vertical') {
|
||
max = this.parent.clientHeight * max;
|
||
}
|
||
}
|
||
return max;
|
||
},
|
||
cWidth: function cWidth() {
|
||
return this.currentWidth + this.currentChange;
|
||
},
|
||
cHeight: function cHeight() {
|
||
return this.currentHeight + this.currentChange;
|
||
},
|
||
left: function left() {
|
||
return this.parent.getLeft(this.index);
|
||
},
|
||
top: function top() {
|
||
return this.parent.getTop(this.index);
|
||
},
|
||
getStyle: function getStyle() {
|
||
if (!this.isFullScreen) {
|
||
var diretion = this.parent.diretion;
|
||
if (diretion == 'horizontal') {
|
||
return {
|
||
left: this.left + 'px',
|
||
top: 0,
|
||
bottom: 0,
|
||
width: this.cWidth + 'px'
|
||
};
|
||
}
|
||
if (diretion == 'vertical') {
|
||
return {
|
||
top: this.top + 'px',
|
||
left: 0,
|
||
right: 0,
|
||
height: this.cHeight + 'px'
|
||
};
|
||
}
|
||
} else {
|
||
return {
|
||
position: 'fixed',
|
||
left: 0,
|
||
right: 0,
|
||
top: 0,
|
||
bottom: 0,
|
||
'z-index': 2010
|
||
};
|
||
}
|
||
}
|
||
},
|
||
watch: {
|
||
height: function height() {
|
||
this.parent.initItem();
|
||
},
|
||
width: function width() {
|
||
this.parent.initItem();
|
||
},
|
||
cWidth: function cWidth() {
|
||
this.$emit('on-change', {
|
||
height: this.cHeight,
|
||
width: this.cWidth
|
||
});
|
||
},
|
||
cHeight: function cHeight() {
|
||
this.$emit('on-change', {
|
||
height: this.cHeight,
|
||
width: this.cWidth
|
||
});
|
||
}
|
||
},
|
||
mounted: function mounted() {
|
||
this.index = this.parent.$children.indexOf(this) + 1;
|
||
this.parent.addItem(this);
|
||
},
|
||
beforeDestroy: function beforeDestroy() {
|
||
this.parent.removeItem(this);
|
||
},
|
||
|
||
methods: {
|
||
fullScreen: function fullScreen() {
|
||
this.isFullScreen = true;
|
||
},
|
||
releaseFullScreen: function releaseFullScreen() {
|
||
this.isFullScreen = false;
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 518 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-split-item",
|
||
style: (_vm.getStyle)
|
||
}, [_vm._t("default")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-52ce178e", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 519 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _timePicker = __webpack_require__(520);
|
||
|
||
var _timePicker2 = _interopRequireDefault(_timePicker);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _timePicker2.default;
|
||
|
||
/***/ }),
|
||
/* 520 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(521),
|
||
/* template */
|
||
__webpack_require__(522),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/time-picker/timePicker.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] timePicker.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-6bb3450a", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-6bb3450a", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 521 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _pickerContent = __webpack_require__(120);
|
||
|
||
var _pickerContent2 = _interopRequireDefault(_pickerContent);
|
||
|
||
var _vReadonlyInput = __webpack_require__(121);
|
||
|
||
var _vReadonlyInput2 = _interopRequireDefault(_vReadonlyInput);
|
||
|
||
var _vPickerPopup = __webpack_require__(122);
|
||
|
||
var _vPickerPopup2 = _interopRequireDefault(_vPickerPopup);
|
||
|
||
var _clickoutside = __webpack_require__(29);
|
||
|
||
var _clickoutside2 = _interopRequireDefault(_clickoutside);
|
||
|
||
var _keyCode = __webpack_require__(19);
|
||
|
||
var _keyCode2 = _interopRequireDefault(_keyCode);
|
||
|
||
var _emitter = __webpack_require__(5);
|
||
|
||
var _emitter2 = _interopRequireDefault(_emitter);
|
||
|
||
var _mixin = __webpack_require__(12);
|
||
|
||
var _mixin2 = _interopRequireDefault(_mixin);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'TimePicker',
|
||
directives: {
|
||
clickoutside: _clickoutside2.default
|
||
},
|
||
components: {
|
||
TimeSelect: _pickerContent2.default,
|
||
ReadonlyInput: _vReadonlyInput2.default,
|
||
PickerPopup: _vPickerPopup2.default
|
||
},
|
||
mixins: [_emitter2.default, _mixin2.default],
|
||
props: {
|
||
value: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
placeholder: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
icon: {
|
||
type: String,
|
||
default: 'md-time'
|
||
},
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
clearable: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
readonly: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
format: {
|
||
type: String,
|
||
default: 'HH:mm:ss'
|
||
},
|
||
hourStep: {
|
||
type: Number,
|
||
default: 1
|
||
},
|
||
minuteStep: {
|
||
type: Number,
|
||
default: 1
|
||
},
|
||
secondStep: {
|
||
type: Number,
|
||
default: 1
|
||
},
|
||
disabledHours: {
|
||
type: Function,
|
||
default: undefined
|
||
},
|
||
disabledMinutes: {
|
||
type: Function,
|
||
default: undefined
|
||
},
|
||
disabledSeconds: {
|
||
type: Function,
|
||
default: undefined
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
show: false,
|
||
times: this.value || ''
|
||
};
|
||
},
|
||
|
||
watch: {
|
||
value: function value() {
|
||
if (this.times !== this.value) {
|
||
this.times = this.value;
|
||
}
|
||
},
|
||
times: function times() {
|
||
this.$emit('input', this.times);
|
||
this.$emit('change', this.times);
|
||
// 适配表单
|
||
this.dispatch('FormItem', 'on-form-change', [this.times]);
|
||
}
|
||
},
|
||
methods: {
|
||
outside: function outside() {
|
||
if (this.show) {
|
||
this.show = false;
|
||
this.dispatch('FormItem', 'on-form-blur', [this.times]);
|
||
}
|
||
},
|
||
showPopup: function showPopup() {
|
||
if (this.readonly || this.disabled) return;
|
||
this.show = true;
|
||
},
|
||
keydown: function keydown(e) {
|
||
if (!this.show) {
|
||
if (e.keyCode == _keyCode2.default.SPACE || e.keyCode == _keyCode2.default.ENTER || e.keyCode == _keyCode2.default.MAC_ENTER || e.keyCode == _keyCode2.default.TAB) {
|
||
// e.preventDefault();
|
||
this.showPopup();
|
||
}
|
||
}
|
||
},
|
||
selectBlur: function selectBlur() {
|
||
this.outside();
|
||
},
|
||
clear: function clear() {
|
||
this.times = '';
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 522 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={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.outside),
|
||
expression: "outside"
|
||
}],
|
||
staticClass: "ui-time-picker"
|
||
}, [_c('readonly-input', {
|
||
attrs: {
|
||
"value": _vm.times,
|
||
"placeholder": _vm.placeholder || _vm.t('el.timepicker.placeholder'),
|
||
"icon": _vm.icon,
|
||
"disabled": _vm.disabled,
|
||
"readonly": _vm.readonly,
|
||
"clearable": _vm.clearable
|
||
},
|
||
on: {
|
||
"clear": _vm.clear,
|
||
"click": _vm.showPopup,
|
||
"keydown": _vm.keydown
|
||
}
|
||
}), _vm._v(" "), _c('picker-popup', {
|
||
attrs: {
|
||
"show": _vm.show
|
||
}
|
||
}, [_c('time-select', {
|
||
attrs: {
|
||
"format": _vm.format,
|
||
"hour-step": _vm.hourStep,
|
||
"minute-step": _vm.minuteStep,
|
||
"second-step": _vm.secondStep,
|
||
"disabled-hours": _vm.disabledHours,
|
||
"disabled-minutes": _vm.disabledMinutes,
|
||
"disabled-seconds": _vm.disabledSeconds
|
||
},
|
||
on: {
|
||
"blur": _vm.selectBlur
|
||
},
|
||
model: {
|
||
value: (_vm.times),
|
||
callback: function($$v) {
|
||
_vm.times = $$v
|
||
},
|
||
expression: "times"
|
||
}
|
||
}), _vm._v(" "), _vm._t("addon")], 2)], 1)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-6bb3450a", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 523 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
exports.CollapsePanel = undefined;
|
||
|
||
var _collapsePanel = __webpack_require__(524);
|
||
|
||
Object.defineProperty(exports, 'CollapsePanel', {
|
||
enumerable: true,
|
||
get: function get() {
|
||
return _interopRequireDefault(_collapsePanel).default;
|
||
}
|
||
});
|
||
|
||
var _collapse = __webpack_require__(530);
|
||
|
||
var _collapse2 = _interopRequireDefault(_collapse);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = _collapse2.default;
|
||
|
||
/***/ }),
|
||
/* 524 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(525),
|
||
/* template */
|
||
__webpack_require__(529),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/collapse/collapsePanel.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] collapsePanel.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-d9baadba", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-d9baadba", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 525 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _icon = __webpack_require__(3);
|
||
|
||
var _icon2 = _interopRequireDefault(_icon);
|
||
|
||
var _openAnim = __webpack_require__(526);
|
||
|
||
var _openAnim2 = _interopRequireDefault(_openAnim);
|
||
|
||
var _util = __webpack_require__(1);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
exports.default = {
|
||
name: 'CollapsePanel',
|
||
components: {
|
||
Icon: _icon2.default,
|
||
OpenAnim: _openAnim2.default
|
||
},
|
||
props: {
|
||
disabled: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
title: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
name: {
|
||
type: [String, Number],
|
||
required: true,
|
||
default: null
|
||
},
|
||
forceRender: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
showArrow: {
|
||
type: Boolean,
|
||
default: true
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
collapse: (0, _util.findComponentUpward)(this, 'Collapse')
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
leftArrow: function leftArrow() {
|
||
return this.showArrow && this.collapse.iconPosition === 'left';
|
||
},
|
||
rightArrow: function rightArrow() {
|
||
return this.showArrow && this.collapse.iconPosition === 'right';
|
||
},
|
||
active: function active() {
|
||
if (this.forceRender) return true;
|
||
|
||
var activeNames = this.collapse.activeNames;
|
||
if (Array.isArray(activeNames)) {
|
||
return activeNames.includes(this.name);
|
||
}
|
||
return this.collapse.value === this.name;
|
||
}
|
||
},
|
||
methods: {
|
||
handlePanel: function handlePanel() {
|
||
if (!this.disabled) {
|
||
var active = this.forceRender ? false : this.active;
|
||
this.collapse.change(this.name, active);
|
||
}
|
||
}
|
||
}
|
||
}; //
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
/***/ }),
|
||
/* 526 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(527),
|
||
/* template */
|
||
__webpack_require__(528),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/collapse/openAnim.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] openAnim.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-3d26e45f", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-3d26e45f", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 527 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
methods: {
|
||
beforeEnter: function beforeEnter(el) {
|
||
// 动画之前
|
||
el.style.height = 0;
|
||
el.style.transition = 'height .15s ease-out';
|
||
},
|
||
enter: function enter(el) {
|
||
// 动画过程
|
||
if (el.scrollHeight !== 0) {
|
||
el.style.height = el.scrollHeight + 'px';
|
||
} else {
|
||
el.style.height = '';
|
||
}
|
||
},
|
||
afterEnter: function afterEnter(el) {
|
||
// 动画之后
|
||
el.style.transition = '';
|
||
el.style.height = '';
|
||
},
|
||
beforeLeave: function beforeLeave(el) {
|
||
el.style.height = el.scrollHeight + 'px';
|
||
el.style.overflow = 'hidden';
|
||
},
|
||
leave: function leave(el) {
|
||
if (el.scrollHeight !== 0) {
|
||
el.style.transition = 'height .15s cubic-bezier(0.55, 0.055, 0.675, 0.19)';
|
||
el.style.height = 0;
|
||
}
|
||
},
|
||
afterLeave: function afterLeave(el) {
|
||
el.style.transition = '';
|
||
el.style.height = '';
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 528 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('transition', {
|
||
on: {
|
||
"before-enter": _vm.beforeEnter,
|
||
"enter": _vm.enter,
|
||
"after-enter": _vm.afterEnter,
|
||
"before-leave": _vm.beforeLeave,
|
||
"leave": _vm.leave,
|
||
"after-leave": _vm.afterLeave
|
||
}
|
||
}, [_vm._t("default")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-3d26e45f", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 529 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-collapse-panel"
|
||
}, [_c('div', {
|
||
staticClass: "ui-collapse-panel-title",
|
||
class: {
|
||
'left-icon': _vm.leftArrow, disabled: _vm.disabled
|
||
},
|
||
on: {
|
||
"click": _vm.handlePanel
|
||
}
|
||
}, [(_vm.leftArrow) ? _c('Icon', {
|
||
class: {
|
||
active: _vm.active
|
||
},
|
||
attrs: {
|
||
"type": "ios-arrow-forward"
|
||
}
|
||
}) : _vm._e(), _vm._v(" "), _c('div', [_vm._t("title", [_vm._v("\n " + _vm._s(_vm.title) + "\n ")])], 2), _vm._v(" "), (_vm.rightArrow) ? _c('Icon', {
|
||
class: {
|
||
active: _vm.active
|
||
},
|
||
attrs: {
|
||
"type": "ios-arrow-forward"
|
||
}
|
||
}) : _vm._e()], 1), _vm._v(" "), _c('open-anim', [_c('div', {
|
||
directives: [{
|
||
name: "show",
|
||
rawName: "v-show",
|
||
value: (_vm.active || _vm.forceRender),
|
||
expression: "active || forceRender"
|
||
}],
|
||
staticClass: "ui-collapse-panel-content",
|
||
class: {
|
||
'left-icon': _vm.leftArrow
|
||
}
|
||
}, [_vm._t("default")], 2)])], 1)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-d9baadba", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ }),
|
||
/* 530 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
var disposed = false
|
||
var Component = __webpack_require__(0)(
|
||
/* script */
|
||
__webpack_require__(531),
|
||
/* template */
|
||
__webpack_require__(532),
|
||
/* styles */
|
||
null,
|
||
/* scopeId */
|
||
null,
|
||
/* moduleIdentifier (server only) */
|
||
null
|
||
)
|
||
Component.options.__file = "/Users/harrywan/company/git/fes.js/packages/fes-ui/src/components/collapse/collapse.vue"
|
||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
|
||
if (Component.options.functional) {console.error("[vue-loader] collapse.vue: functional components are not supported with templates, they should use render functions.")}
|
||
|
||
/* hot reload */
|
||
if (false) {(function () {
|
||
var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
|
||
hotAPI.install(require("vue"), false)
|
||
if (!hotAPI.compatible) return
|
||
module.hot.accept()
|
||
if (!module.hot.data) {
|
||
hotAPI.createRecord("data-v-47f97791", Component.options)
|
||
} else {
|
||
hotAPI.reload("data-v-47f97791", Component.options)
|
||
}
|
||
module.hot.dispose(function (data) {
|
||
disposed = true
|
||
})
|
||
})()}
|
||
|
||
module.exports = Component.exports
|
||
|
||
|
||
/***/ }),
|
||
/* 531 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", {
|
||
value: true
|
||
});
|
||
|
||
var _stringify = __webpack_require__(85);
|
||
|
||
var _stringify2 = _interopRequireDefault(_stringify);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
//
|
||
|
||
exports.default = {
|
||
name: 'Collapse',
|
||
props: {
|
||
value: {
|
||
type: [String, Number, Array],
|
||
default: null
|
||
},
|
||
bordered: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
accordion: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
iconPosition: {
|
||
validator: function validator(value) {
|
||
return ['left', 'right'].includes(value);
|
||
},
|
||
|
||
default: 'right'
|
||
}
|
||
},
|
||
data: function data() {
|
||
return {
|
||
activeNames: null
|
||
};
|
||
},
|
||
|
||
watch: {
|
||
value: {
|
||
handler: function handler() {
|
||
if ((0, _stringify2.default)(this.value) !== (0, _stringify2.default)(this.activeNames)) {
|
||
this.resetActiveNames();
|
||
}
|
||
},
|
||
|
||
immediate: true
|
||
}
|
||
},
|
||
methods: {
|
||
resetActiveNames: function resetActiveNames() {
|
||
if (this.accordion && Array.isArray(this.value)) {
|
||
this.activeNames = this.value[0];
|
||
this.noticeParent();
|
||
} else {
|
||
this.activeNames = this.value;
|
||
}
|
||
},
|
||
change: function change(key, del) {
|
||
if (this.accordion) {
|
||
this.activeNames = del ? '' : key;
|
||
} else if (del) {
|
||
if (Array.isArray(this.activeNames)) {
|
||
this.activeNames = this.activeNames.filter(function (name) {
|
||
return name !== key;
|
||
});
|
||
} else {
|
||
this.activeNames = '';
|
||
}
|
||
} else if (Array.isArray(this.activeNames)) {
|
||
this.activeNames.push(key);
|
||
} else if (this.activeNames) {
|
||
this.activeNames = [this.activeNames, key];
|
||
} else {
|
||
this.activeNames = [key];
|
||
}
|
||
this.noticeParent();
|
||
},
|
||
noticeParent: function noticeParent() {
|
||
this.$emit('input', this.activeNames);
|
||
this.$emit('change', this.activeNames);
|
||
}
|
||
}
|
||
};
|
||
|
||
/***/ }),
|
||
/* 532 */
|
||
/***/ (function(module, exports, __webpack_require__) {
|
||
|
||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
||
return _c('div', {
|
||
staticClass: "ui-collapse",
|
||
class: {
|
||
bordered: _vm.bordered
|
||
}
|
||
}, [_vm._t("default")], 2)
|
||
},staticRenderFns: []}
|
||
module.exports.render._withStripped = true
|
||
if (false) {
|
||
module.hot.accept()
|
||
if (module.hot.data) {
|
||
require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-47f97791", module.exports)
|
||
}
|
||
}
|
||
|
||
/***/ })
|
||
/******/ ]);
|
||
}); |