|
|
|
!(function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}})("undefined"!=typeof self?self:this,(function(){return (function(e){function t(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=289)})({0:function(e,t){e.exports=function(e,t,n,i,a){var r,l=e=e||{},o=typeof e.default;"object"!==o&&"function"!==o||(r=e,l=e.default);var u="function"==typeof l?l.options:l;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns),i&&(u._scopeId=i);var s;if(a?(s=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=s):n&&(s=n),s){var d=u.functional,c=d?u.render:u.beforeCreate;d?u.render=function(e,t){return s.call(t),c(e,t)}:u.beforeCreate=c?[].concat(c,s):[s]}return{esModule:r,exports:l,options:u}}},109:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}));var i="undefined"==typeof window,a=i?Object:window.HTMLElement,r=i?Object:window.File},13:function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return r}));var i=function(e){"undefined"!=typeof window&&window.Vue&&window.Vue.use(e)},a=function(e,t){e.component(t.name,t)},r=function(e,t,n){e.prototype[t]=n}},254:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(255),a=n.n(i),r=n(13);n.d(t,"Upload",(function(){return a.a}));var l={install:function(e){Object(r.a)(e,a.a)}};Object(r.c)(l),t.default=l},255:function(e,t,n){var i=n(0)(n(256),n(257),null,null,null);e.exports=i.exports},256:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(42),a=n(109);t.default={name:"BUpload",mixins:[i.a],inheritAttrs:!1,props:{value:{type:[Object,Function,a.a,Array]},multiple:Boolean,disabled:Boolean,accept:String,dragDrop:Boolean,type:{type:String,default:"is-primary"},native:{type:Boolean,default:!1}},data:function(){return{newValue:this.value,dragDropFocus:!1,_elementRef:"input"}},watch:{value:function(e){this.newValue=e,(!this.newValue||Array.isArray(this.newValue)&&0===this.newValue.length)&&(this.$refs.input.value=null),!this.isValid&&!this.dragDrop&&this.checkHtml5Validity()}},methods:{onFileChange:function(e){if(!this.disabled&&!this.loading){this.dragDrop&&this.updateDragDropFocus(!1);var t=e.target.files||e.dataTransfer.files;if(0===t.length){if(!this.newValue)return;this.newValue=null}else if(this.multiple){var n=!1;!this.native&&this.newValue||(this.newValue=[],n=!0);for(var i=0;i<t.length;i++){var a=t[i];this.checkType(a)&&(this.newValue.push(a),n=!0)}if(!n)return}else{if(this.dragDrop&&1!==t.length)return;var r=t[0];if(this.checkType(r))this.newValue=r;else{if(!this.newValue)return;this.newValue=null}}this.$emit("input",this.newValue),!this.dragDrop&&this.checkHtml5Validity()}},updateDragDropFocus:function(e){this.disabled||this.loading||(this.dragDropFocus=e)},checkType:function(e){if(!this.accept)return!0;var t=this.accept.split(",");if(0===t.length)return!0;for(var n=!1,i=0;i<t.length&&!n;i++){var a=t[i].trim();if(a)if("."===a.substring(0,1)){var r=e.name.lastIndexOf("."),l=r>=0?e.name.substring(r):"";l.toLowerCase()===a.toLowerCase()&&(n=!0)}else e.type.match(a)&&(n=!0)}return n}}}},257:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",{staticClass:"upload control"},[e.dragDrop?n("div",{st
|