UNPKG

yk-smart-ui-test

Version:

A Component Library for Vue.js.

1,759 lines (1,565 loc) 70.3 kB
module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 97); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ (function(module, exports) { module.exports = require("vue"); /***/ }), /***/ 11: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ t; }); // UNUSED EXPORTS: use, i18n // CONCATENATED MODULE: ./src/locale/lang/zh-CN.js /* harmony default export */ var zh_CN = ({ el: { colorpicker: { confirm: '确定', clear: '清空' }, datepicker: { now: '此刻', today: '今天', cancel: '取消', clear: '清空', confirm: '确定', selectDate: '选择日期', selectTime: '选择时间', startDate: '开始日期', startTime: '开始时间', endDate: '结束日期', endTime: '结束时间', prevYear: '前一年', nextYear: '后一年', prevMonth: '上个月', nextMonth: '下个月', year: '年', month1: '1 月', month2: '2 月', month3: '3 月', month4: '4 月', month5: '5 月', month6: '6 月', month7: '7 月', month8: '8 月', month9: '9 月', month10: '10 月', month11: '11 月', month12: '12 月', // week: '周次', weeks: { sun: '日', mon: '一', tue: '二', wed: '三', thu: '四', fri: '五', sat: '六' }, months: { jan: '一月', feb: '二月', mar: '三月', apr: '四月', may: '五月', jun: '六月', jul: '七月', aug: '八月', sep: '九月', oct: '十月', nov: '十一月', dec: '十二月' }, shortcuts: { Today: '今天', Yestoday: '昨天', LastThreeDays: '最近三天', LastSevenDays: '最近七天', ThisWeek: '本周', LastWeek: '上周', ThisMoth: '本月', LastMonth: '上月', LastThreeMonths: '最近三个月', LastSixMonths: '最近六个月' } }, select: { loading: '加载中', noMatch: '无匹配数据', noData: '无数据', placeholder: '请选择' }, cascader: { noMatch: '无匹配数据', loading: '加载中', placeholder: '请选择', noData: '暂无数据' }, pagination: { goto: '前往', pagesize: '条/页', total: '共 {total} 条', pageClassifier: '页' }, messagebox: { title: '提示', confirm: '确定', cancel: '取消', error: '输入的数据不合法!' }, upload: { deleteTip: '按 delete 键可删除', delete: '删除', preview: '查看图片', continue: '继续上传' }, table: { emptyText: '暂无数据', confirmFilter: '筛选', resetFilter: '重置', clearFilter: '全部', sumText: '合计' }, tree: { emptyText: '暂无数据' }, transfer: { noMatch: '无匹配数据', noData: '无数据', titles: ['列表 1', '列表 2'], filterPlaceholder: '请输入搜索内容', noCheckedFormat: '共 {total} 项', hasCheckedFormat: '已选 {checked}/{total} 项' }, image: { error: '加载失败' }, pageHeader: { title: '返回' }, popconfirm: { confirmButtonText: '确认', cancelButtonText: '取消' }, empty: { description: '暂无数据' } } }); // EXTERNAL MODULE: external "vue" var external_vue_ = __webpack_require__(0); var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_); // EXTERNAL MODULE: external "deepmerge" var external_deepmerge_ = __webpack_require__(17); var external_deepmerge_default = /*#__PURE__*/__webpack_require__.n(external_deepmerge_); // EXTERNAL MODULE: ./src/utils/util.js var util = __webpack_require__(3); // CONCATENATED MODULE: ./src/locale/format.js var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g; /** * String format template * - Inspired: * https://github.com/Matt-Esch/string-template/index.js */ /* harmony default export */ var format = (function (Vue) { /** * template * * @param {String} string * @param {Array} ...args * @return {String} */ function template(string) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } if (args.length === 1 && _typeof(args[0]) === 'object') { args = args[0]; } if (!args || !args.hasOwnProperty) { args = {}; } return string.replace(RE_NARGS, function (match, prefix, i, index) { var result = void 0; if (string[index - 1] === '{' && string[index + match.length] === '}') { return i; } else { result = Object(util["j" /* hasOwn */])(args, i) ? args[i] : null; if (result === null || result === undefined) { return ''; } return result; } }); } return template; }); // CONCATENATED MODULE: ./src/locale/index.js var locale_format = format(external_vue_default.a); var lang = zh_CN; var merged = false; var locale_i18nHandler = function i18nHandler() { var vuei18n = Object.getPrototypeOf(this || external_vue_default.a).$t; if (typeof vuei18n === 'function' && !!external_vue_default.a.locale) { if (!merged) { merged = true; external_vue_default.a.locale(external_vue_default.a.config.lang, external_deepmerge_default()(lang, external_vue_default.a.locale(external_vue_default.a.config.lang) || {}, { clone: true })); } return vuei18n.apply(this, arguments); } }; var t = function t(path, options) { var value = locale_i18nHandler.apply(this, arguments); if (value !== null && value !== undefined) return value; var array = path.split('.'); var current = lang; for (var i = 0, j = array.length; i < j; i++) { var property = array[i]; value = current[property]; if (i === j - 1) return locale_format(value, options); if (!value) return ''; current = value; } return ''; }; var use = function use(l) { lang = l || lang; }; var i18n = function i18n(fn) { locale_i18nHandler = fn || locale_i18nHandler; }; /* harmony default export */ var locale = ({ use: use, t: t, i18n: i18n }); /***/ }), /***/ 12: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); /** * Show migrating guide in browser console. * * Usage: * import Migrating from 'element-ui/src/mixins/migrating'; * * mixins: [Migrating] * * add getMigratingConfig method for your component. * getMigratingConfig() { * return { * props: { * 'allow-no-selection': 'allow-no-selection is removed.', * 'selection-mode': 'selection-mode is removed.' * }, * events: { * selectionchange: 'selectionchange is renamed to selection-change.' * } * }; * }, */ /* harmony default export */ __webpack_exports__["a"] = ({ mounted: function mounted() { if (true) return; if (!this.$vnode) return; var _getMigratingConfig = this.getMigratingConfig(), _getMigratingConfig$p = _getMigratingConfig.props, props = _getMigratingConfig$p === undefined ? {} : _getMigratingConfig$p, _getMigratingConfig$e = _getMigratingConfig.events, events = _getMigratingConfig$e === undefined ? {} : _getMigratingConfig$e; var _$vnode = this.$vnode, data = _$vnode.data, componentOptions = _$vnode.componentOptions; var definedProps = data.attrs || {}; var definedEvents = componentOptions.listeners || {}; for (var propName in definedProps) { propName = Object(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "p"])(propName); // compatible with camel case if (props[propName]) { console.warn('[Element Migrating][' + this.$options.name + '][Attribute]: ' + props[propName]); } } for (var eventName in definedEvents) { eventName = Object(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "p"])(eventName); // compatible with camel case if (events[eventName]) { console.warn('[Element Migrating][' + this.$options.name + '][Event]: ' + events[eventName]); } } }, methods: { getMigratingConfig: function getMigratingConfig() { return { props: {}, events: {} }; } } }); /***/ }), /***/ 13: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11); /* harmony default export */ __webpack_exports__["a"] = ({ methods: { t: function t() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__[/* t */ "a"].apply(this, args); } } }); /***/ }), /***/ 17: /***/ (function(module, exports) { module.exports = require("deepmerge"); /***/ }), /***/ 2: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; }); /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules). // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call( this, (options.functional ? this.parent : this).$root.$options.shadowRoot ) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functional component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } } /***/ }), /***/ 29: /***/ (function(module, exports) { module.exports = require("babel-helper-vue-jsx-merge-props"); /***/ }), /***/ 3: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return noop; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return hasOwn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return toObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return getValueByPath; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return getPropByPath; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return generateId; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return valueEquals; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return escapeRegexpString; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFindIndex; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayFind; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return coerceTruthyValueToArray; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return isIE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isEdge; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return isFirefox; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return autoprefixer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return kebabCase; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return capitalize; }); /* unused harmony export looseEqual */ /* unused harmony export arrayEquals */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return isEqual; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return isEmpty; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return rafThrottle; }); /* unused harmony export objToArray */ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var hasOwnProperty = Object.prototype.hasOwnProperty; function noop() {}; function hasOwn(obj, key) { return hasOwnProperty.call(obj, key); }; function extend(to, _from) { for (var key in _from) { to[key] = _from[key]; } return to; }; function toObject(arr) { var res = {}; for (var i = 0; i < arr.length; i++) { if (arr[i]) { extend(res, arr[i]); } } return res; }; var getValueByPath = function getValueByPath(object, prop) { prop = prop || ''; var paths = prop.split('.'); var current = object; var result = null; for (var i = 0, j = paths.length; i < j; i++) { var path = paths[i]; if (!current) break; if (i === j - 1) { result = current[path]; break; } current = current[path]; } return result; }; function getPropByPath(obj, path, strict) { var tempObj = obj; path = path.replace(/\[(\w+)\]/g, '.$1'); path = path.replace(/^\./, ''); var keyArr = path.split('.'); var i = 0; for (var len = keyArr.length; i < len - 1; ++i) { if (!tempObj && !strict) break; var key = keyArr[i]; if (key in tempObj) { tempObj = tempObj[key]; } else { if (strict) { throw new Error('please transfer a valid prop path to form item!'); } break; } } return { o: tempObj, k: keyArr[i], v: tempObj ? tempObj[keyArr[i]] : null }; }; var generateId = function generateId() { return Math.floor(Math.random() * 10000); }; var valueEquals = function valueEquals(a, b) { // see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript if (a === b) return true; if (!(a instanceof Array)) return false; if (!(b instanceof Array)) return false; if (a.length !== b.length) return false; for (var i = 0; i !== a.length; ++i) { if (a[i] !== b[i]) return false; } return true; }; var escapeRegexpString = function escapeRegexpString() { var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'); }; // TODO: use native Array.find, Array.findIndex when IE support is dropped var arrayFindIndex = function arrayFindIndex(arr, pred) { for (var i = 0; i !== arr.length; ++i) { if (pred(arr[i])) { return i; } } return -1; }; var arrayFind = function arrayFind(arr, pred) { var idx = arrayFindIndex(arr, pred); return idx !== -1 ? arr[idx] : undefined; }; // coerce truthy value to array var coerceTruthyValueToArray = function coerceTruthyValueToArray(val) { if (Array.isArray(val)) { return val; } else if (val) { return [val]; } else { return []; } }; var isIE = function isIE() { return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !isNaN(Number(document.documentMode)); }; var isEdge = function isEdge() { return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1; }; var isFirefox = function isFirefox() { return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i); }; var autoprefixer = function autoprefixer(style) { if ((typeof style === 'undefined' ? 'undefined' : _typeof(style)) !== 'object') return style; var rules = ['transform', 'transition', 'animation']; var prefixes = ['ms-', 'webkit-']; rules.forEach(function (rule) { var value = style[rule]; if (rule && value) { prefixes.forEach(function (prefix) { style[prefix + rule] = value; }); } }); return style; }; var kebabCase = function kebabCase(str) { var hyphenateRE = /([^-])([A-Z])/g; return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase(); }; var capitalize = function capitalize(str) { if (!Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isString */ "e"])(str)) return str; return str.charAt(0).toUpperCase() + str.slice(1); }; var looseEqual = function looseEqual(a, b) { var isObjectA = Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(a); var isObjectB = Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(b); if (isObjectA && isObjectB) { return JSON.stringify(a) === JSON.stringify(b); } else if (!isObjectA && !isObjectB) { return String(a) === String(b); } else { return false; } }; var arrayEquals = function arrayEquals(arrayA, arrayB) { arrayA = arrayA || []; arrayB = arrayB || []; if (arrayA.length !== arrayB.length) { return false; } for (var i = 0; i < arrayA.length; i++) { if (!looseEqual(arrayA[i], arrayB[i])) { return false; } } return true; }; var isEqual = function isEqual(value1, value2) { if (Array.isArray(value1) && Array.isArray(value2)) { return arrayEquals(value1, value2); } return looseEqual(value1, value2); }; var isEmpty = function isEmpty(val) { // null or undefined if (val == null) return true; if (typeof val === 'boolean') return false; if (typeof val === 'number') return !val; if (val instanceof Error) return val.message === ''; switch (Object.prototype.toString.call(val)) { // String or Array case '[object String]': case '[object Array]': return !val.length; // Map or Set or File case '[object File]': case '[object Map]': case '[object Set]': { return !val.size; } // Plain Object case '[object Object]': { return !Object.keys(val).length; } } return false; }; function rafThrottle(fn) { var locked = false; return function () { var _this = this; for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (locked) return; locked = true; window.requestAnimationFrame(function (_) { fn.apply(_this, args); locked = false; }); }; } function objToArray(obj) { if (Array.isArray(obj)) { return obj; } return isEmpty(obj) ? [] : [obj]; } /***/ }), /***/ 45: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/_vue-loader@15.9.8@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/progress/src/progress.vue?vue&type=template&id=229ee406& var render = function () { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "div", { staticClass: "yk-progress", class: [ "yk-progress--" + _vm.type, _vm.status ? "is-" + _vm.status : "", { "yk-progress--without-text": !_vm.showText, "yk-progress--text-inside": _vm.textInside, }, ], attrs: { role: "progressbar", "aria-valuenow": _vm.percentage, "aria-valuemin": "0", "aria-valuemax": "100", }, }, [ _vm.type === "line" ? _c("div", { staticClass: "yk-progress-bar" }, [ _c( "div", { staticClass: "yk-progress-bar__outer", style: { height: _vm.strokeWidth + "px" }, }, [ _c( "div", { staticClass: "yk-progress-bar__inner", style: _vm.barStyle, }, [ _vm.showText && _vm.textInside ? _c( "div", { staticClass: "yk-progress-bar__innerText" }, [_vm._v(_vm._s(_vm.content))] ) : _vm._e(), _vm.showProgressIcon ? _c( "span", { staticClass: "finish", style: _vm.finishColor }, [ _c("i", { class: _vm.progressIconType === "progressing" ? "el-icon-loading" : "yk_icon_tick", }), ] ) : _vm._e(), ] ), ] ), ]) : _c( "div", { staticClass: "yk-progress-circle", style: { height: _vm.width + "px", width: _vm.width + "px" }, }, [ _c("svg", { attrs: { viewBox: "0 0 100 100" } }, [ _c("path", { staticClass: "yk-progress-circle__track", style: _vm.trailPathStyle, attrs: { d: _vm.trackPath, stroke: "#e5e9f2", "stroke-width": "6", fill: "none", }, }), _c("path", { staticClass: "yk-progress-circle__path", style: _vm.circlePathStyle, attrs: { d: _vm.trackPath, stroke: _vm.stroke, fill: "none", "stroke-linecap": _vm.strokeLinecap, "stroke-width": _vm.percentage ? 6 : 0, }, }), ]), ] ), _vm.showText && !_vm.textInside ? _c( "div", { staticClass: "yk-progress__text", style: { fontSize: _vm.progressTextSize + "px", fontWeight: _vm.fontWeight, }, }, [ !_vm.status ? [_vm._v(_vm._s(_vm.content))] : _c("i", { class: _vm.iconClass, style: { fontSize: _vm.type === "line" ? "16px" : "36px", fontWeight: _vm.fontWeight, }, }), ], 2 ) : _vm._e(), ] ) } var staticRenderFns = [] render._withStripped = true // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=template&id=229ee406& // CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/progress/src/progress.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var progressvue_type_script_lang_js_ = ({ name: 'YkProgress', props: { type: { type: String, default: 'line', validator: function validator(val) { return ['line', 'circle', 'dashboard'].indexOf(val) > -1; } }, percentage: { type: Number, default: 0, required: true, validator: function validator(val) { return val >= 0 && val <= 100; } }, status: { type: String, validator: function validator(val) { return ['finish', 'basic', 'warning'].indexOf(val) > -1; } }, strokeWidth: { type: Number, default: 12 }, strokeLinecap: { type: String, default: 'round' }, textInside: { type: Boolean, default: false }, width: { type: Number, default: 126 }, showText: { type: Boolean, default: true }, color: { type: [String, Array, Function], default: '' }, showProgressIcon: { type: Boolean, default: false }, progressIconType: { type: String, default: 'finish' }, format: Function }, computed: { barStyle: function barStyle() { var style = {}; style.width = this.percentage + '%'; style.backgroundColor = this.getCurrentColor(this.percentage); return style; }, finishColor: function finishColor() { return { backgroundColor: this.getCurrentColor(this.percentage) }; }, relativeStrokeWidth: function relativeStrokeWidth() { return (this.strokeWidth / this.width * 100).toFixed(1); }, radius: function radius() { if (this.type === 'circle' || this.type === 'dashboard') { return parseInt(50 - parseFloat(this.relativeStrokeWidth) / 2, 10); } else { return 0; } }, trackPath: function trackPath() { var radius = this.radius; var isDashboard = this.type === 'dashboard'; return '\n M 50 50\n m 0 ' + (isDashboard ? '' : '-') + radius + '\n a ' + radius + ' ' + radius + ' 0 1 1 0 ' + (isDashboard ? '-' : '') + radius * 2 + '\n a ' + radius + ' ' + radius + ' 0 1 1 0 ' + (isDashboard ? '' : '-') + radius * 2 + '\n '; }, perimeter: function perimeter() { return 2 * Math.PI * this.radius; }, rate: function rate() { return this.type === 'dashboard' ? 0.75 : 1; }, strokeDashoffset: function strokeDashoffset() { var offset = -1 * this.perimeter * (1 - this.rate) / 2; return offset + 'px'; }, trailPathStyle: function trailPathStyle() { return { strokeDasharray: this.perimeter * this.rate + 'px, ' + this.perimeter + 'px', strokeDashoffset: this.strokeDashoffset }; }, circlePathStyle: function circlePathStyle() { return { strokeDasharray: this.perimeter * this.rate * (this.percentage / 100) + 'px, ' + this.perimeter + 'px', strokeDashoffset: this.strokeDashoffset, transition: 'stroke-dasharray 0.6s ease 0s, stroke 0.6s ease' }; }, stroke: function stroke() { var ret = void 0; if (this.color) { ret = this.getCurrentColor(this.percentage); } else { switch (this.status) { case 'finish': ret = '#13ce66'; break; case 'warning': ret = '#ff4949'; break; default: ret = '#20a0ff'; } } return ret; }, iconClass: function iconClass() { if (this.type === 'line') { return this.status === 'finish' ? 'yk_icon_tick' : 'yk_icon_close'; } else { return this.status === 'finish' ? 'el-icon-check' : 'el-icon-close'; } }, progressTextSize: function progressTextSize() { return this.type === 'line' ? 14 : this.width * 0.2 + 2; }, fontWeight: function fontWeight() { return this.type === 'line' ? 'normal' : 'bold'; }, content: function content() { if (typeof this.format === 'function') { return this.format(this.percentage) || ''; } else { return this.percentage + '%'; } } }, methods: { getCurrentColor: function getCurrentColor(percentage) { if (typeof this.color === 'function') { return this.color(percentage); } else if (typeof this.color === 'string') { return this.color; } else { return this.getLevelColor(percentage); } }, getLevelColor: function getLevelColor(percentage) { var colorArray = this.getColorArray().sort(function (a, b) { return a.percentage - b.percentage; }); for (var i = 0; i < colorArray.length; i++) { if (colorArray[i].percentage > percentage) { return colorArray[i].color; } } return colorArray[colorArray.length - 1].color; }, getColorArray: function getColorArray() { var color = this.color; var span = 100 / color.length; return color.map(function (seriesColor, index) { if (typeof seriesColor === 'string') { return { color: seriesColor, percentage: (index + 1) * span }; } return seriesColor; }); } } }); // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=script&lang=js& /* harmony default export */ var src_progressvue_type_script_lang_js_ = (progressvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/_vue-loader@15.9.8@vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(2); // CONCATENATED MODULE: ./packages/progress/src/progress.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( src_progressvue_type_script_lang_js_, render, staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "packages/progress/src/progress.vue" /* harmony default export */ var progress = (component.exports); // CONCATENATED MODULE: ./packages/progress/index.js /* istanbul ignore next */ progress.install = function (Vue) { Vue.component(progress.name, progress); }; /* harmony default export */ var packages_progress = __webpack_exports__["default"] = (progress); /***/ }), /***/ 5: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; }); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; function isString(obj) { return Object.prototype.toString.call(obj) === '[object String]'; } function isObject(obj) { return Object.prototype.toString.call(obj) === '[object Object]'; } function isHtmlElement(node) { return node && node.nodeType === Node.ELEMENT_NODE; } /** * - Inspired: * https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js */ var isFunction = function isFunction(functionToCheck) { var getType = {}; return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; }; if ( true && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) !== 'object' && (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer || typeof document.childNodes !== 'function')) { isFunction = function isFunction(obj) { return typeof obj === 'function' || false; }; } var isUndefined = function isUndefined(val) { return val === void 0; }; var isDefined = function isDefined(val) { return val !== undefined && val !== null; }; /***/ }), /***/ 65: /***/ (function(module, exports) { module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAALRJREFUOE9jZKAQMFKon4G6BigoKHDw8gor/P37/d61a9d+IbtOS0uLjZmZU+nz57cPHjx48AMmh+ICXV1jjf+/mbT+MjJ8+v37/eE7d+78BClUUVFhZ2UVtGX+z8DHyPrv2uXLZ29gNQBky///3HYghTBDQAphmkFijIxfDyG7DiMMkG0DaQAZgGwgzFVYXQATRDYEJIbuJeSwwRoLFBlAkRcoDkSKo5HihEROvqBuXiDHBQD0L5wRx5/JpwAAAABJRU5ErkJggg==" /***/ }), /***/ 97: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/_vue-loader@15.9.8@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/upload/src/upload-list.vue?vue&type=template&id=173fedf5& var upload_listvue_type_template_id_173fedf5_render = function () { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "transition-group", { class: [ "yk-upload-list", "yk-upload-list--" + _vm.listType, { "is-disabled": _vm.disabled }, ], attrs: { tag: "ul", name: "el-list" }, }, _vm._l(_vm.files, function (file) { return _c( "li", { key: file.uid, class: [ "yk-upload-list__item", "is-" + file.status, _vm.focusing ? "focusing" : "", ], attrs: { tabindex: "0" }, on: { keydown: function ($event) { if ( !("button" in $event) && _vm._k($event.keyCode, "delete", [8, 46], $event.key, [ "Backspace", "Delete", "Del", ]) ) { return null } !_vm.disabled && _vm.$emit("remove", file) }, focus: function ($event) { _vm.focusing = true }, blur: function ($event) { _vm.focusing = false }, click: function ($event) { _vm.focusing = false }, }, }, [ _vm._t( "default", [ file.status !== "uploading" && ["picture-card", "picture"].indexOf(_vm.listType) > -1 ? _c("img", { staticClass: "yk-upload-list__item-thumbnail", attrs: { src: file.url, alt: "" }, }) : _vm._e(), _c( "a", { staticClass: "yk-upload-list__item-name", on: { click: function ($event) { _vm.handleClick(file) }, }, }, [ _c("i", { staticClass: "el-icon-document" }), _vm._v(_vm._s(file.name) + "\n "), ] ), _c( "label", { staticClass: "yk-upload-list__item-status-label" }, [ _c("i", { class: { yk_icon_tick: true, }, }), ] ), !_vm.disabled ? _c("img", { staticClass: "yk_icon_close", attrs: { src: __webpack_require__(65) }, on: { click: function ($event) { _vm.$emit("remove", file) }, }, }) : _vm._e(), _vm.listType === "picture" && !_vm.disabled ? _c("div", { staticClass: "eye_open" }, [ _c("i", { staticClass: "yk_icon_eye_open_outline", on: { click: function ($event) { _vm.handlePreview(file) }, }, }), ]) : _vm._e(), !_vm.disabled ? _c("i", { staticClass: "el-icon-close-tip" }, [ _vm._v(_vm._s(_vm.t("el.upload.deleteTip"))), ]) : _vm._e(), file.status === "uploading" ? _c("yk-progress", { attrs: { type: _vm.listType === "picture-card" ? "circle" : "line", width: _vm.listType === "picture-card" ? 100 : 126, "stroke-width": _vm.listType === "picture-card" ? 6 : 2, percentage: _vm.parsePercentage(file.percentage), }, }) : _vm._e(), _vm.listType === "picture-card" ? _c("span", { staticClass: "yk-upload-list__item-actions" }, [ _vm.handlePreview && _vm.listType === "picture-card" ? _c( "span", { staticClass: "yk-upload-list__item-preview", on: { click: function ($event) { _vm.handlePreview(file) }, }, }, [_c("i", { staticClass: "yk_icon_eye_open_outline" })] ) : _vm._e(), !_vm.disabled ? _c( "span", { staticClass: "yk-upload-list__item-delete", on: { click: function ($event) { _vm.$emit("remove", file) }, }, }, [_c("i", { staticClass: "yk_icon_delete_outline" })] ) : _vm._e(), ]) : _vm._e(), ], { file: file } ), ], 2 ) }), 0 ) } var staticRenderFns = [] upload_listvue_type_template_id_173fedf5_render._withStripped = true // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=template&id=173fedf5& // EXTERNAL MODULE: ./src/mixins/locale.js var locale = __webpack_require__(13); // EXTERNAL MODULE: ./packages/progress/index.js + 5 modules var progress = __webpack_require__(45); // CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/upload/src/upload-list.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var upload_listvue_type_script_lang_js_ = ({ name: 'YkUploadList', mixins: [locale["a" /* default */]], data: function data() { return { focusing: false }; }, components: { YkProgress: progress["default"] }, props: { files: { type: Array, default: function _default() { return []; } }, disabled: { type: Boolean, default: false }, handlePreview: Function, listType: String }, methods: { parsePercentage: function parsePercentage(val) { return parseInt(val, 10); }, handleClick: function handleClick(file) { this.handlePreview && this.handlePreview(file); } } }); // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=script&lang=js& /* harmony default export */ var src_upload_listvue_type_script_lang_js_ = (upload_listvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/_vue-loader@15.9.8@vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(2); // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( src_upload_listvue_type_script_lang_js_, upload_listvue_type_template_id_173fedf5_render, staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "packages/upload/src/upload-list.vue" /* harmony default export */ var upload_list = (component.exports); // EXTERNAL MODULE: external "babel-helper-vue-jsx-merge-props" var external_babel_helper_vue_jsx_merge_props_ = __webpack_require__(29); var external_babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(external_babel_helper_vue_jsx_merge_props_); // CONCATENATED MODULE: ./packages/upload/src/ajax.js function getError(action, option, xhr) { var msg = void 0; if (xhr.response) { msg = '' + (xhr.response.error || xhr.response); } else if (xhr.responseText) { msg = '' + xhr.responseText; } else { msg = 'fail to post ' + action + ' ' + xhr.status; } var err = new Error(msg); err.status = xhr.status; err.method = 'post'; err.url = action; return err; } function getBody(xhr) { var text = xhr.responseText || xhr.response; if (!text) { return text; } try { return JSON.parse(text); } catch (e) { return text; } } function upload(option) { if (typeof XMLHttpRequest === 'undefined') { return; } var xhr = new XMLHttpRequest(); var action = option.action; if (xhr.upload) { xhr.upload.onprogress = function progress(e) { if (e.total > 0) { e.percent = e.loaded / e.total * 100; } option.onProgress(e); }; } var formData = new FormData(); if (option.data) { Object.keys(option.data).forEach(function (key) { formData.append(key, option.data[key]); }); } formData.append(option.filename, option.file, option.file.name); xhr.onerror = function error(e) { option.onError(e); }; xhr.onload = function onload() { if (xhr.status < 200 || xhr.status >= 300) { return option.onError(getError(action, option, xhr)); } option.onSuccess(getBody(xhr)); }; xhr.open('post', action, true); if (option.withCredentials && 'withCredentials' in xhr) { xhr.withCredentials = true; } var headers = option.headers || {}; for (var item in headers) { if (headers.hasOwnProperty(item) && headers[item] !== null) { xhr.setRequestHeader(item, headers[item]); } } xhr.send(formData); return xhr; } // CONCATENATED MODULE: ./node_modules/_vue-loader@15.9.8@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=template&id=7ebbf219& var upload_draggervue_type_template_id_7ebbf219_render = function () { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "div", { staticClass: "yk-upload-dragger", class: { "is-dragover": _vm.dragover, }, on: {