UNPKG

element-ui-for-gov

Version:

element-ui for gov

1,664 lines (1,514 loc) 58.1 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 = 281); /******/ }) /************************************************************************/ /******/ ({ /***/ 1: /***/ (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 } } /***/ }), /***/ 14: /***/ (function(module, exports) { var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/ module.exports = function mergeJSXProps (objs) { return objs.reduce(function (a, b) { var aa, bb, key, nestedKey, temp for (key in b) { aa = a[key] bb = b[key] if (aa && nestRE.test(key)) { // normalize class if (key === 'class') { if (typeof aa === 'string') { temp = aa a[key] = aa = {} aa[temp] = true } if (typeof bb === 'string') { temp = bb b[key] = bb = {} bb[temp] = true } } if (key === 'on' || key === 'nativeOn' || key === 'hook') { // merge functions for (nestedKey in bb) { aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey]) } } else if (Array.isArray(aa)) { a[key] = aa.concat(bb) } else if (Array.isArray(bb)) { a[key] = [aa].concat(bb) } else { for (nestedKey in bb) { aa[nestedKey] = bb[nestedKey] } } } else { a[key] = b[key] } } return a }, {}) } function mergeFn (a, b) { return function () { a && a.apply(this, arguments) b && b.apply(this, arguments) } } /***/ }), /***/ 17: /***/ (function(module, exports) { module.exports = require("element-ui-for-gov/lib/mixins/migrating"); /***/ }), /***/ 22: /***/ (function(module, exports) { module.exports = require("element-ui-for-gov/lib/tooltip"); /***/ }), /***/ 281: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXTERNAL MODULE: external "element-ui-for-gov/lib/message" var message_ = __webpack_require__(79); var message_default = /*#__PURE__*/__webpack_require__.n(message_); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/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: [ "el-upload-list", "el-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: [ "el-upload-list__item", "is-" + file.status, _vm.focusing ? "focusing" : "", file[_vm.bottomTextKey] ? "hasfoot" : "" ], 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", [ _c( "div", { class: { "el-upload-list__item-hover-flex": _vm.renderFileName, "el-upload-list__item-hover": true } }, [ file.status !== "uploading" && ["picture-card", "picture"].indexOf(_vm.listType) > -1 ? _c("img", { staticClass: "el-upload-list__item-thumbnail", attrs: { src: file.url, alt: "" } }) : _vm._e(), _c( "el-tooltip", { attrs: { effect: "light", content: file.errorText || "上传失败", placement: "top", disabled: file.status !== "fail" } }, [ _c( "a", { class: { "el-upload-list__item-name": true, "el-upload-list__item-name-hasRender": _vm.renderFileName }, on: { click: function($event) { _vm.handleClick(file) } } }, [ file.status === "uploading" && _vm.listType === "text" ? _c("i", { staticClass: "el-icon-loading" }) : _vm._e(), _c("svg-dom", { staticClass: "el-upload-list__item-svg", attrs: { svgName: _vm.fileIcon(file.name) } }), file.status !== "fail" ? [ _c("tooltip-over", { attrs: { content: file.name } }) ] : [ _vm._v( "\n " + _vm._s(file.name) + "\n " ) ] ], 2 ) ] ), _vm.renderFileName ? [ _c( "span", { staticClass: "el-upload-list__item-render" }, [ _vm._v( _vm._s( _vm.renderFileName ? _vm.renderFileName(file) : null ) ) ] ) ] : _vm._e(), _c( "label", { staticClass: "el-upload-list__item-status-label" }, [ _c("i", { class: { "el-icon-upload-success": true, "el-icon-circle-check": _vm.listType === "text", "el-icon-check": ["picture-card", "picture"].indexOf(_vm.listType) > -1 } }) ] ), _vm.showDownloadIcon && _vm.listType === "text" ? _c("i", { staticClass: "el-icon-download", on: { click: function($event) { _vm.handleClickDownload(file) } } }) : _vm._e(), !_vm.disabled ? _c( "i", { class: { "el-icon-delete-text": _vm.listType === "text", "el-icon-close": ["picture-card", "picture"].indexOf( _vm.listType ) > -1 }, on: { click: function($event) { _vm.$emit("remove", file) } } }, [_vm._v(_vm._s(_vm.listType === "text" ? "删除" : ""))] ) : _vm._e(), file.status === "uploading" ? _c("el-progress", { class: { "el-progress-texttype": _vm.listType === "text" }, attrs: { type: _vm.listType === "picture-card" ? "circle" : "line", "stroke-width": _vm.listType === "picture-card" ? 6 : 2, percentage: _vm.parsePercentage(file.percentage) } }) : _vm._e(), _vm.listType === "picture-card" ? _c( "span", { staticClass: "el-upload-list__item-actions" }, [ _vm.handlePreview && _vm.listType === "picture-card" ? _c( "span", { staticClass: "el-upload-list__item-preview", on: { click: function($event) { _vm.handlePreview(file) } } }, [_c("i", { staticClass: "el-icon-zoom-in" })] ) : _vm._e(), !_vm.disabled ? _c( "span", { staticClass: "el-upload-list__item-delete", on: { click: function($event) { _vm.$emit("remove", file) } } }, [ _c("el-button", { attrs: { type: "text" } }, [ _vm._v("删除") ]) ], 1 ) : _vm._e() ] ) : _vm._e() ], 2 ) ], { file: file } ), file[_vm.bottomTextKey] ? _c("div", { staticClass: "el-upload-list__item-footer" }, [ _c("span", [_vm._v(_vm._s(file[_vm.bottomTextKey]))]) ]) : _vm._e() ], 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: external "element-ui-for-gov/lib/mixins/locale" var locale_ = __webpack_require__(7); var locale_default = /*#__PURE__*/__webpack_require__.n(locale_); // EXTERNAL MODULE: external "element-ui-for-gov/lib/progress" var progress_ = __webpack_require__(53); var progress_default = /*#__PURE__*/__webpack_require__.n(progress_); // EXTERNAL MODULE: external "element-ui-for-gov/lib/tooltip" var tooltip_ = __webpack_require__(22); var tooltip_default = /*#__PURE__*/__webpack_require__.n(tooltip_); // EXTERNAL MODULE: external "element-ui-for-gov/lib/button" var button_ = __webpack_require__(9); var button_default = /*#__PURE__*/__webpack_require__.n(button_); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/tooltip-over.vue?vue&type=template&id=546776e3& var tooltip_overvue_type_template_id_546776e3_render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "div", { staticClass: "el-upload-tooltip" }, [ _c( "el-tooltip", { attrs: { effect: "light", disabled: _vm.isShowTooltip, content: _vm.content, placement: "top" } }, [ _c( "span", { staticClass: "el-upload-tooltip__overflow", on: { mouseover: _vm.onMouseOver } }, [_vm._v("\n " + _vm._s(_vm.content) + "\n ")] ) ] ) ], 1 ) } var tooltip_overvue_type_template_id_546776e3_staticRenderFns = [] tooltip_overvue_type_template_id_546776e3_render._withStripped = true // CONCATENATED MODULE: ./packages/upload/src/tooltip-over.vue?vue&type=template&id=546776e3& // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/tooltip-over.vue?vue&type=script&lang=js& // // // // // // // // // // /* harmony default export */ var tooltip_overvue_type_script_lang_js_ = ({ name: 'TooltipOver', components: { ElTooltip: tooltip_default.a }, props: { // 显示的文字内容 content: { type: String, default: function _default() { return ''; } } }, data: function data() { return { isShowTooltip: false }; }, methods: { onMouseOver: function onMouseOver(e) { var parentWidth = this.$el.offsetWidth; var range = document.createRange(); range.setStart(this.$el, 0); range.setEnd(this.$el, this.$el.childNodes.length); var contentWidth = range.getBoundingClientRect().width; // 判断是否开启tooltip功能 if (contentWidth > parentWidth || this.$el.scrollWidth > parentWidth) { this.isShowTooltip = false; } else { this.isShowTooltip = true; } } } }); // CONCATENATED MODULE: ./packages/upload/src/tooltip-over.vue?vue&type=script&lang=js& /* harmony default export */ var src_tooltip_overvue_type_script_lang_js_ = (tooltip_overvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(1); // CONCATENATED MODULE: ./packages/upload/src/tooltip-over.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( src_tooltip_overvue_type_script_lang_js_, tooltip_overvue_type_template_id_546776e3_render, tooltip_overvue_type_template_id_546776e3_staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "packages/upload/src/tooltip-over.vue" /* harmony default export */ var tooltip_over = (component.exports); // CONCATENATED MODULE: ./packages/upload/src/svg.js /* harmony default export */ var svg = ({ props: { svgName: { type: String, default: 'other' } }, methods: { renderSvg: function renderSvg() { var h = this.$createElement; switch (this.svgName) { case 'picture': return h( 'span', { attrs: { role: 'img', 'aria-label': 'pic_lg' }, 'class': 'anticon anticon-pic_lg', style: 'color: rgb(0, 153, 232);' }, [h( 'svg', { attrs: { viewBox: '0 0 36 36', focusable: 'false', 'data-icon': 'pic_lg', width: '1em', height: '1em', fill: 'currentColor', 'aria-hidden': 'true' }, 'class': '' }, [h('path', { attrs: { d: 'M30.9 0c1.8 0 2.4.2 3.1.5s1.2.9 1.5 1.5c.3.7.5 1.3.5 3.1v25.7c0 1.8-.2 2.4-.5 3.1s-.9 1.2-1.5 1.5c-.7.3-1.3.5-3.1.5H5.1c-1.8 0-2.4-.2-3.1-.5S.8 34.5.5 33.9c-.3-.6-.5-1.2-.5-3V5.1C0 3.3.2 2.7.5 2 .9 1.4 1.4.9 2 .5 2.7.2 3.3 0 5.1 0h25.8zM14 16.6c-.7-.6-1.6-.5-2.2.3l-5.7 8.3-.1.1c-.2.4 0 .7.4.7h23c.4 0 .6-.4.3-.7l-5.4-7.5-.1-.1c-.3-.3-.8-.3-1.1 0l-4 4.7-5.2-5.7.1-.1zM23 9c-1.5 0-2.8 1.2-2.8 2.7s1.2 2.7 2.8 2.7c1.5 0 2.8-1.2 2.8-2.7S24.5 9 23 9z' } })] )] ); case 'doc': return h( 'span', { attrs: { role: 'img', 'aria-label': 'word_lg' }, 'class': 'anticon anticon-word_lg', style: 'color: rgb(57, 128, 252);' }, [h( 'svg', { attrs: { viewBox: '0 0 36 36', focusable: 'false', 'data-icon': 'word_lg', width: '1em', height: '1em', fill: 'currentColor', 'aria-hidden': 'true' }, 'class': '' }, [h('path', { attrs: { d: 'M30.9 0c1.8 0 2.4.2 3.1.5s1.2.9 1.5 1.5c.3.7.5 1.3.5 3.1v25.7c0 1.8-.2 2.4-.5 3.1s-.9 1.2-1.5 1.5c-.7.3-1.3.5-3.1.5H5.1c-1.8 0-2.4-.2-3.1-.5S.8 34.5.5 33.9c-.3-.6-.5-1.2-.5-3V5.1C0 3.3.2 2.7.5 2S1.4.9 2 .5 3.3 0 5.1 0h25.8zM13.2 10H10l3.8 16h2.1l2.1-9.6 2.1 9.6h2.1L26 10h-5.3v2.2h1.7l-1.6 8L19.1 10h-2.2l-1.7 10.2-2-10.2z' } })] )] ); case 'xlsx': return h( 'span', { attrs: { role: 'img', 'aria-label': 'excel_lg' }, 'class': 'anticon anticon-excel_lg', style: 'color: rgb(2, 157, 85);' }, [h( 'svg', { attrs: { viewBox: '0 0 36 36', focusable: 'false', 'data-icon': 'excel_lg', width: '1em', height: '1em', fill: 'currentColor', 'aria-hidden': 'true' }, 'class': '' }, [h('path', { attrs: { d: 'M30.9 0c1.8 0 2.4.2 3.1.5s1.2.9 1.5 1.5c.3.7.5 1.3.5 3.1v25.7c0 1.8-.2 2.4-.5 3.1s-.9 1.2-1.5 1.5c-.7.3-1.3.5-3.1.5H5.1c-1.8 0-2.4-.2-3.1-.5S.8 34.5.5 33.9c-.3-.6-.5-1.2-.5-3V5.1C0 3.3.2 2.7.5 2 .9 1.4 1.4.9 2 .5 2.7.2 3.3 0 5.1 0h25.8zM14.3 10H11l4.8 7.2L10 26h7.5v-2.2h-2.9l2.9-4.2 4.3 6.4H25l-5.9-8.8L24 10h-3.2l-3.2 4.8-3.3-4.8z' } })] )] ); case 'ppt': return h( 'span', { attrs: { role: 'img', 'aria-label': 'ppt_lg' }, 'class': 'anticon anticon-ppt_lg', style: 'color: rgb(242, 117, 29);' }, [h( 'svg', { attrs: { viewBox: '0 0 36 36', focusable: 'false', 'data-icon': 'ppt_lg', width: '1em', height: '1em', fill: 'currentColor', 'aria-hidden': 'true' }, 'class': '' }, [h('path', { attrs: { d: 'M30.9 0c1.8 0 2.4.2 3.1.5s1.2.9 1.5 1.5c.3.7.5 1.3.5 3.1v25.7c0 1.8-.2 2.4-.5 3.1s-.9 1.2-1.5 1.5c-.7.3-1.3.5-3.1.5H5.1c-1.8 0-2.4-.2-3.1-.5S.8 34.5.5 33.9c-.3-.6-.5-1.2-.5-3V5.1C0 3.3.2 2.7.5 2 .9 1.4 1.4.9 2 .5S3.3 0 5.1 0h25.8zM19.6 10H12v2.1h2.2V26h3.3v-5.3h2.2c3.3 0 5.4-2.1 5.4-5.3-.1-3.2-2.3-5.4-5.5-5.4zm0 2.2c1.1 0 2.7 1.1 2.7 3.2s-1.7 3.2-2.7 3.2h-2.2v-6.4h2.2z' } })] )] ); case 'pdf': return h( 'span', { attrs: { role: 'img', 'aria-label': 'pdf_lg' }, 'class': 'anticon anticon-pdf_lg', style: 'color: rgb(229, 77, 58);' }, [h( 'svg', { attrs: { viewBox: '0 0 36 36', focusable: 'false', 'data-icon': 'pdf_lg', width: '1em', height: '1em', fill: 'currentColor', 'aria-hidden': 'true' }, 'class': '' }, [h('path', { attrs: { d: 'M30.9 0c1.8 0 2.4.2 3.1.5s1.2.9 1.5 1.5c.3.7.5 1.3.5 3.1v25.7c0 1.8-.2 2.4-.5 3.1s-.9 1.2-1.5 1.5c-.7.3-1.3.5-3.1.5H5.1c-1.8 0-2.4-.2-3.1-.5S.8 34.5.5 33.9c-.3-.6-.5-1.2-.5-3V5.1C0 3.3.2 2.7.5 2 .9 1.4 1.4.9 2 .5S3.3 0 5.1 0h25.8zM16.8 7c-.8-.1-1.5.3-1.9 1-1.1 1.8.5 5.5 1.2 6.9-.9 2.6-1.9 5.1-3.2 7.6C7.3 24.9 7 26.4 7 27v.1c0 .7.4 1.3 1 1.7.3.1.6.2 1 .2 1.5 0 3.3-1.7 5.2-5.1 2.4-1 4.8-1.8 7.3-2.3 1.3 1.1 2.9 1.7 4.5 1.8 1 0 3.1 0 3.1-2.1.1-.8-.4-2.1-3.2-2.2-1.3 0-2.6.2-3.8.4-1.5-1.4-2.8-3.1-3.8-4.9 1-3.4 1.1-5.8.3-6.9-.5-.4-1.2-.7-1.8-.7zM11 25.4c-.5.8-1.2 1.4-2 1.7l-.2.1c.6-.8 1.3-1.4 2.2-1.8zm6.4-7.7c.7 1 1.5 2.1 2.4 3h-.2l.1.1c-1.3.3-2.8.7-4.2 1.2v-.1l-.1.1c.7-1.3 1.3-2.8 1.8-4.2l.1.1.1-.2zm8.3 3.3c1.2 0 1.5.3 1.5.5-.4.1-.8.2-1.2.1-.6-.1-1.2-.2-1.8-.5.5-.1.9-.1 1.5-.1zM17 8.8c.3 1 .3 2.1-.1 3.2-.4-1-.6-2.1-.4-3.1.1-.1.2-.1.2-.1h.3z' } })] )] ); case 'mp3': return h( 'span', { attrs: { role: 'img', 'aria-label': 'voice_lg' }, 'class': 'anticon anticon-voice_lg', style: 'color: rgb(243, 165, 40);' }, [h( 'svg', { attrs: { viewBox: '0 0 36 36', focusable: 'false', 'data-icon': 'voice_lg', width: '1em', height: '1em', fill: 'currentColor', 'aria-hidden': 'true' }, 'class': '' }, [h('path', { attrs: { d: 'M30.9 0c1.8 0 2.4.2 3.1.5s1.2.9 1.5 1.5c.3.7.5 1.3.5 3.1v25.7c0 1.8-.2 2.4-.5 3.1s-.9 1.2-1.5 1.5c-.7.3-1.3.5-3.1.5H5.1c-1.8 0-2.4-.2-3.1-.5S.8 34.5.5 33.9c-.3-.6-.5-1.2-.5-3V5.1C0 3.3.2 2.7.5 2 .9 1.4 1.4.9 2 .5 2.7.2 3.3 0 5.1 0h25.8zM18 9c-5 0-9 4.2-9 9.4v5.5c0 1.7 1.3 3.1 3 3.1h2.1c.5 0 .9-.4.9-.9v-4.2c0-.5-.4-.9-.9-.9H11v-2.6c0-4 3.1-7.3 7-7.3s7 3.3 7 7.3V21h-3.1c-.5 0-.9.4-.9.9v4.2c0 .5.4.9.9.9H24c1.7 0 3-1.4 3-3.1v-5.5c0-5.2-4-9.4-9-9.4z' } })] )] ); case 'mp4': return h( 'span', { attrs: { role: 'img', 'aria-label': 'video_lg' }, 'class': 'anticon anticon-video_lg', style: 'color: rgb(164, 98, 197);' }, [h( 'svg', { attrs: { viewBox: '0 0 36 36', focusable: 'false', 'data-icon': 'video_lg', width: '1em', height: '1em', fill: 'currentColor', 'aria-hidden': 'true' }, 'class': '' }, [h('path', { attrs: { d: 'M30.9 0c1.8 0 2.4.2 3.1.5s1.2.9 1.5 1.5c.3.7.5 1.3.5 3.1v25.7c0 1.8-.2 2.4-.5 3.1s-.9 1.2-1.5 1.5c-.7.3-1.3.5-3.1.5H5.1c-1.8 0-2.4-.2-3.1-.5S.8 34.5.5 33.9c-.3-.6-.5-1.2-.5-3V5.1C0 3.3.2 2.7.5 2 .9 1.4 1.4.9 2 .5S3.3 0 5.1 0h25.8zM20.5 13h-9c-.2 0-1.5.1-1.5 1.4v7.1c0 1.4 1.5 1.4 1.5 1.4h9s1.5 0 1.5-1.4v-7.1c0-1.3-1.3-1.4-1.5-1.4zm6.5 0l-4 2.8v4.4l4 2.8V13z' } })] )] ); case 'zip': return h( 'span', { attrs: { role: 'img', 'aria-label': 'zip_lg' }, 'class': 'anticon anticon-zip_lg', style: 'color: rgb(109, 129, 148);' }, [h( 'svg', { attrs: { viewBox: '0 0 36 36', focusable: 'false', 'data-icon': 'zip_lg', width: '1em', height: '1em', fill: 'currentColor', 'aria-hidden': 'true' }, 'class': '' }, [h('path', { attrs: { d: 'M30.9 0c1.8 0 2.4.2 3.1.5s1.2.9 1.5 1.5c.3.7.5 1.3.5 3.1v25.7c0 1.8-.2 2.4-.5 3.1s-.9 1.2-1.5 1.5c-.7.3-1.3.5-3.1.5H5.1c-1.8 0-2.4-.2-3.1-.5S.8 34.5.5 33.9s-.5-1.2-.5-3V5.1C0 3.3.2 2.7.5 2 .9 1.4 1.4.9 2 .5 2.7.2 3.3 0 5.1 0h25.8zM22 26h-4v4h4v-4zm-4-4h-4v4h4v-4zm4-4h-4v4h4v-4zm-4-4h-4v4h4v-4zm4-4h-4v4h4v-4zm-4-4h-4v4h4V6z' } })] )] ); default: return h( 'span', { attrs: { role: 'img', 'aria-label': 'file_lg' }, 'class': 'anticon anticon-file_lg', style: 'color: rgb(57, 128, 252);' }, [h( 'svg', { attrs: { viewBox: '0 0 36 36', focusable: 'false', 'data-icon': 'file_lg', width: '1em', height: '1em', fill: 'currentColor', 'aria-hidden': 'true' }, 'class': '' }, [h('path', { attrs: { d: 'M30.9 0c1.8 0 2.4.2 3.1.5s1.2.9 1.5 1.5c.3.7.5 1.3.5 3.1v25.7c0 1.8-.2 2.4-.5 3.1s-.9 1.2-1.5 1.5c-.7.3-1.3.5-3.1.5H5.1c-1.8 0-2.4-.2-3.1-.5S.8 34.5.5 33.9c-.3-.6-.5-1.2-.5-3V5.1C0 3.3.2 2.7.5 2S1.4.9 2 .5 3.3 0 5.1 0h25.8zM20 9h-8a2 2 0 00-2 2v14c0 1.1.9 2 2 2h12a2 2 0 002-2V14l-6-5zm2 11c.6 0 1 .4 1 1s-.4 1-1 1h-7.1c-.5-.1-.9-.5-.9-1 0-.6.4-1 1-1h7zm-1-4c.6 0 1 .4 1 1s-.4 1-1 1h-6.1c-.5-.1-.9-.5-.9-1 0-.6.4-1 1-1h6z' } })] )] ); } } }, render: function render() { return this.renderSvg(); } }); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/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: 'ElUploadList', mixins: [locale_default.a], data: function data() { return { focusing: false }; }, components: { ElProgress: progress_default.a, SvgDom: svg, ElTooltip: tooltip_default.a, ElButton: button_default.a, TooltipOver: tooltip_over }, props: { files: { type: Array, default: function _default() { return []; } }, disabled: { type: Boolean, default: false }, renderFileName: Function, handlePreview: Function, listType: String, showDownloadIcon: Boolean, handleDownload: Function, bottomTextKey: String }, methods: { parsePercentage: function parsePercentage(val) { return parseInt(val, 10); }, handleClick: function handleClick(file) { this.handlePreview && this.handlePreview(file); }, fileIcon: function fileIcon(name) { var suffix = name.substr(name.lastIndexOf('.') + 1); return { 'jpeg': 'picture', 'jpg': 'picture', 'png': 'picture' }[suffix] || suffix; }, handleClickDownload: function handleClickDownload(file) { this.handleDownload && this.handleDownload(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_); // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue /* normalize component */ var upload_list_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 upload_list_api; } upload_list_component.options.__file = "packages/upload/src/upload-list.vue" /* harmony default export */ var upload_list = (upload_list_component.exports); // EXTERNAL MODULE: ./node_modules/babel-helper-vue-jsx-merge-props/index.js var babel_helper_vue_jsx_merge_props = __webpack_require__(14); var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(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() { console.log('onload'); if (xhr.status < 200 || xhr.status >= 300 || option.isErrorInterceptor && option.isErrorInterceptor(xhr)) { console.log('iserror'); 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/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/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: "el-upload-dragger", class: { "is-dragover": _vm.dragover }, on: { drop: function($event) { $event.preventDefault() return _vm.onDrop($event) }, dragover: function($event) { $event.preventDefault() return _vm.onDragover($event) }, dragleave: function($event) { $event.preventDefault() _vm.dragover = false } } }, [_vm._t("default")], 2 ) } var upload_draggervue_type_template_id_7ebbf219_staticRenderFns = [] upload_draggervue_type_template_id_7ebbf219_render._withStripped = true // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=template&id=7ebbf219& // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js& // // // // // // // // // // // // // /* harmony default export */ var upload_draggervue_type_script_lang_js_ = ({ name: 'ElUploadDrag', props: { disabled: Boolean }, inject: { uploader: { default: '' } }, data: function data() { return { dragover: false }; }, methods: { onDragover: function onDragover() { if (!this.disabled) { this.dragover = true; } }, onDrop: function onDrop(e) { if (this.disabled || !this.uploader) return; var accept = this.uploader.accept; this.dragover = false; if (!accept) { this.$emit('file', e.dataTransfer.files); return; } this.$emit('file', [].slice.call(e.dataTransfer.files).filter(function (file) { var type = file.type, name = file.name; var extension = name.indexOf('.') > -1 ? '.' + name.split('.').pop() : ''; var baseType = type.replace(/\/.*$/, ''); return accept.split(',').map(function (type) { return type.trim(); }).filter(function (type) { return type; }).some(function (acceptedType) { if (/\..+$/.test(acceptedType)) { return extension === acceptedType; } if (/\/\*$/.test(acceptedType)) { return baseType === acceptedType.replace(/\/\*$/, ''); } if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) { return type === acceptedType; } return false; }); })); } } }); // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js& /* harmony default export */ var src_upload_draggervue_type_script_lang_js_ = (upload_draggervue_type_script_lang_js_); // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue /* normalize component */ var upload_dragger_component = Object(componentNormalizer["a" /* default */])( src_upload_draggervue_type_script_lang_js_, upload_draggervue_type_template_id_7ebbf219_render, upload_draggervue_type_template_id_7ebbf219_staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var upload_dragger_api; } upload_dragger_component.options.__file = "packages/upload/src/upload-dragger.vue" /* harmony default export */ var upload_dragger = (upload_dragger_component.exports); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload.vue?vue&type=script&lang=js& /* harmony default export */ var uploadvue_type_script_lang_js_ = ({ inject: ['uploader'], components: { UploadDragger: upload_dragger }, props: { type: String, action: { type: String, required: true }, name: { type: String, default: 'file' }, data: Object, headers: Object, withCredentials: Boolean, multiple: Boolean, accept: String, onStart: Function, onProgress: Function, onSuccess: Function, onError: Function, beforeUpload: Function, drag: Boolean, onPreview: { type: Function, default: function _default() {} }, onRemove: { type: Function, default: function _default() {} }, fileList: Array, autoUpload: Boolean, listType: String, httpRequest: { type: Function, default: upload }, disabled: Boolean, limit: Number, onExceed: Function, isErrorInterceptor: Function }, data: function data() { return { mouseover: false, reqs: {} }; }, methods: { isImage: function isImage(str) { return str.indexOf('image') !== -1; }, handleChange: function handleChange(ev) { var files = ev.target.files; if (!files) return; this.uploadFiles(files); }, uploadFiles: function uploadFiles(files) { var _this = this; if (this.limit && this.fileList.length + files.length > this.limit) { this.onExceed && this.onExceed(files, this.fileList); return; } var postFiles = Array.prototype.slice.call(files); if (!this.multiple) { postFiles = postFiles.slice(0, 1); } if (postFiles.length === 0) { return; } postFiles.forEach(function (rawFile) { _this.onStart(rawFile); if (_this.autoUpload) _this.upload(rawFile); }); }, upload: function upload(rawFile) { var _this2 = this; this.$refs.input.value = null; if (!this.beforeUpload) { return this.post(rawFile); } var before = this.beforeUpload(rawFile); if (before && before.then) { before.then(function (processedFile) { var fileType = Object.prototype.toString.call(processedFile); if (fileType === '[object File]' || fileType === '[object Blob]') { if (fileType === '[object Blob]') { processedFile = new File([processedFile], rawFile.name, { type: rawFile.type }); } for (var p in rawFile) { if (rawFile.hasOwnProperty(p)) { processedFile[p] = rawFile[p]; } } _this2.post(processedFile); } else { _this2.post(rawFile); } }, function () { _this2.onRemove(null, rawFile); }); } else if (before !== false) { this.post(rawFile); } else { this.onRemove(null, rawFile); } }, abort: function abort(file) { var reqs = this.reqs; if (file) { var uid = file; if (file.uid) uid = file.uid; if (reqs[uid]) { reqs[uid].abort(); } } else { Object.keys(reqs).forEach(function (uid) { if (reqs[uid]) reqs[uid].abort(); delete reqs[uid]; }); } }, post: function post(rawFile) { var _this3 = this; var uid = rawFile.uid; var options = { headers: this.headers, withCredentials: this.withCredentials, file: rawFile, data: this.data, filename: this.name, action: this.action, isErrorInterceptor: function isErrorInterceptor(e) { return _this3.isErrorInterceptor && _this3.isErrorInterceptor(e, rawFile); }, onProgress: function onProgress(e) { _this3.onProgress(e, rawFile); }, onSuccess: function onSuccess(res) { _this3.onSuccess(res, rawFile); delete _this3.reqs[uid]; }, onError: function onError(err) { _this3.onError(err, rawFile); delete _this3.reqs[uid]; } }; var req = this.httpRequest(options); this.reqs[uid] = req; if (req && req.then) { req.then(options.onSuccess, options.onError); } }, handleClick: function handleClick() { if (!this.disabled) { this.$refs.input.value = null; this.$refs.input.click(); } }, handleKeydown: function handleKeydown(e) { if (e.target !== e.currentTarget) return; if (e.keyCode === 13 || e.keyCode === 32) { this.handleClick(); } } }, render: function render(h) { var handleClick = this.handleClick, drag = this.drag, name = this.name, handleChange = this.handleChange, multiple = this.multiple, accept = this.accept, listType = this.listType, uploadFiles = this.uploadFiles, disabled = this.disabled, handleKeydown = this.handleKeydown; var data = { class: { 'el-upload': true }, on: { click: handleClick, keydown: handleKeydown } }; data.class['el-upload--' + listType] = true; return h( 'div', babel_helper_vue_jsx_merge_props_default()([data, { attrs: { tabindex: '0' } }]), [drag ? h( 'upload-dragger', { attrs: { disabled: disabled }, on: { 'file': uploadFiles } }, [this.$slots.default] ) : this.$slots.default, h('input', { 'class': 'el-upload__input', attrs: { type: 'file', name: name, multiple: multiple, accept: accept }, ref: 'input', on: { 'change': handleChange } })] ); } }); // CONCATENATED MODULE: ./packages/upload/src/upload.vue?vue&type=script&lang=js& /* harmony default export */ var src_uploadvue_type_script_lang_js_ = (uploadvue_type_script_lang_js_); // CONCATENATED MODULE: ./packages/upload/src/upload.vue var upload_render, upload_staticRenderFns /* normalize component */ var upload_component = Object(componentNormalizer["a" /* default */])( src_uploadvue_type_script_lang_js_, upload_render, upload_staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var upload_api; } upload_component.options.__file = "packages/upload/src/upload.vue" /* harmony default export */ var src_upload = (upload_component.exports); // EXTERNAL MODULE: external "element-ui-for-gov/lib/mixins/migrating" var migrating_ = __webpack_require__(17); var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/index.vue?vue&type=script&lang=js& function noop() {} /* harmony default export */ var srcvue_type_script_lang_js_ = ({ name: 'ElUpload', mixins: [migrating_default.a], components: { ElProgress: progress_default.a, UploadList: upload_list, Upload: src_upload, Message: message_default.a }, provide: function provide() { return { uploader: this }; }, inject: { elForm: { default: '' } }, props: { action: { type: String, required: true }, headers: { type: Object, default: function _default() { return {}; } }, data: Object, multiple: Boolean, name: { type: String, default: 'file' }, drag: Boolean, dragger: Boolean, withCredentials: Boolean, showFileList: { type: Boolean, default: true }, accept: String, type: { type: String, default: 'select' }, beforeUpload: Function, beforeRemove: Function, onRemove: { type: Function, default: noop }, onChange: { type: Function, default: noop }, onPreview: { type: Function }, onSuccess: { type: Function, default: noop }, onProgress: { type: Function, default: noop }, onError: { type: Function, default: noop }, fileList: { type: Array, default: function _default() { return []; } }, autoUpload: { type: Boolean, default: true }, listType: { type: String, default: 'text' // text,picture,picture-card }, httpRequest: Function, disabled: Boolean, limit: Number, onExceed: { type: Function, default: noop }, showDownloadIcon: { type: Boolean, default: false }, onDownload: { type: Function }, setBottomText: { type: Function, default: noop }, bottomTextKey: { type: String, default: 'bottomText' }, isErrorInterceptor: Function, layout: Array, renderFileName: Function }, data: function data() { return { uploadFiles: [], dragOver: false, draging: false, tempIndex: 1 }; }, computed: { uploadDisabled: function uploadDisabled() { return this.disabled || (this.elForm || {}).disabled; } }, watch: { listType: function listType(type) { if (type === 'picture-card' || type === 'picture') { this.uploadFiles = this.uploadFiles.map(function (file) { if (!file.url && file.raw) { try { file.url = URL.createObjectURL(file.raw); } catch (err) { console.error('[Element Error][Upload]', err); } } return file; }); } }, fileList: { immediate: true, handler: function handler(fileList) { var _this = this; this.uplo