@ -961,14 +961,14 @@ return /******/ (function(modules) { // webpackBootstrap
value : true
value : true
} ) ;
} ) ;
var _toConsumableArray2 = _ _webpack _require _ _ ( 62 ) ;
var _toConsumableArray3 = _interopRequireDefault ( _toConsumableArray2 ) ;
var _stringify = _ _webpack _require _ _ ( 56 ) ;
var _stringify = _ _webpack _require _ _ ( 56 ) ;
var _stringify2 = _interopRequireDefault ( _stringify ) ;
var _stringify2 = _interopRequireDefault ( _stringify ) ;
var _toConsumableArray2 = _ _webpack _require _ _ ( 62 ) ;
var _toConsumableArray3 = _interopRequireDefault ( _toConsumableArray2 ) ;
var _promise = _ _webpack _require _ _ ( 58 ) ;
var _promise = _ _webpack _require _ _ ( 58 ) ;
var _promise2 = _interopRequireDefault ( _promise ) ;
var _promise2 = _interopRequireDefault ( _promise ) ;
@ -1284,6 +1284,109 @@ return /******/ (function(modules) { // webpackBootstrap
return isArray ? addFiles : addFiles [ 0 ] ;
return isArray ? addFiles : addFiles [ 0 ] ;
} ,
} ,
addInputFile : function addInputFile ( el ) {
var files = [ ] ;
if ( el . files ) {
for ( var i = 0 ; i < el . files . length ; i ++ ) {
var file = el . files [ i ] ;
files . push ( {
size : file . size ,
name : file . webkitRelativePath || file . relativePath || file . name ,
type : file . type ,
file : file ,
el : el
} ) ;
}
} else {
files . push ( {
name : el . value . replace ( /^.*?([^\/\\\r\n]+)$/ , '$1' ) ,
el : el
} ) ;
}
return this . add ( files ) ;
} ,
addDataTransfer : function addDataTransfer ( dataTransfer ) {
var files = [ ] ;
if ( dataTransfer . items && dataTransfer . items . length ) {
var items = [ ] ;
for ( var i = 0 ; i < dataTransfer . items . length ; i ++ ) {
var item = dataTransfer . items [ i ] ;
if ( item . getAsEntry ) {
item = item . getAsEntry ( ) ;
} else if ( item . webkitGetAsEntry ) {
item = item . webkitGetAsEntry ( ) ;
} else {
item = item . getAsFile ( ) ;
}
if ( item ) {
items . push ( item ) ;
}
}
return new _promise2 . default ( function ( resolve , reject ) {
var _this = this ;
var forEach = function forEach ( i ) {
var item = items [ i ] ;
if ( ! item || ! _this . multiple && files . length ) {
return resolve ( _this . add ( files ) ) ;
}
_this . getEntry ( item ) . then ( function ( results ) {
files . push . apply ( files , ( 0 , _toConsumableArray3 . default ) ( results ) ) ;
forEach ( i + 1 ) ;
} ) ;
} ;
forEach ( 0 ) ;
} ) ;
}
if ( dataTransfer . files . length ) {
for ( var _i3 = 0 ; _i3 < dataTransfer . files . length ; _i3 ++ ) {
files . push ( dataTransfer . files [ _i3 ] ) ;
if ( ! this . multiple ) {
break ;
}
}
return _promise2 . default . resolve ( this . add ( files ) ) ;
}
return _promise2 . default . resolve ( [ ] ) ;
} ,
getEntry : function getEntry ( entry ) {
var _this2 = this ;
var path = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : '' ;
return new _promise2 . default ( function ( resolve , reject ) {
if ( entry . isFile ) {
entry . file ( function ( file ) {
resolve ( [ {
size : file . size ,
name : path + file . name ,
type : file . type ,
file : file
} ] ) ;
} ) ;
} else if ( entry . isDirectory && _this2 . dropDirectory ) {
entry . createReader ( ) . readEntries ( function ( entries ) {
var files = [ ] ;
var forEach = function forEach ( i ) {
if ( ! entries [ i ] || files . length && ! _this2 . multiple ) {
return resolve ( files ) ;
}
_this2 . getEntry ( entries [ i ] , path + entry . name + '/' ) . then ( function ( results ) {
files . push . apply ( files , ( 0 , _toConsumableArray3 . default ) ( results ) ) ;
forEach ( i + 1 ) ;
} ) ;
} ;
forEach ( 0 ) ;
} ) ;
} else {
resolve ( [ ] ) ;
}
} ) ;
} ,
remove : function remove ( file ) {
remove : function remove ( file ) {
file = this . get ( file ) ;
file = this . get ( file ) ;
if ( file ) {
if ( file ) {
@ -1350,16 +1453,16 @@ return /******/ (function(modules) { // webpackBootstrap
this . uploading ++ ;
this . uploading ++ ;
this . $nextTick ( function ( ) {
this . $nextTick ( function ( ) {
var _this = this ;
var _this 3 = this ;
setTimeout ( function ( ) {
setTimeout ( function ( ) {
_this . upload ( newFile ) . then ( function ( ) {
_this 3 . upload ( newFile ) . then ( function ( ) {
newFile = _this . get ( newFile ) ;
newFile = _this 3 . get ( newFile ) ;
if ( newFile ) {
if ( newFile ) {
_this . update ( newFile , { active : false , success : ! newFile . error } ) ;
_this 3 . update ( newFile , { active : false , success : ! newFile . error } ) ;
}
}
} ) . catch ( function ( e ) {
} ) . catch ( function ( e ) {
_this . update ( newFile , { active : false , success : false , error : e . code || e . error || e . message || e } ) ;
_this 3 . update ( newFile , { active : false , success : false , error : e . code || e . error || e . message || e } ) ;
} ) ;
} ) ;
} , parseInt ( Math . random ( ) * 50 + 50 ) ) ;
} , parseInt ( Math . random ( ) * 50 + 50 ) ) ;
} ) ;
} ) ;
@ -1447,13 +1550,13 @@ return /******/ (function(modules) { // webpackBootstrap
return this . uploadXhr ( xhr , file , form ) ;
return this . uploadXhr ( xhr , file , form ) ;
} ,
} ,
uploadXhr : function uploadXhr ( xhr , file , data ) {
uploadXhr : function uploadXhr ( xhr , file , data ) {
var _this 2 = this ;
var _this 4 = this ;
var speedTime = 0 ;
var speedTime = 0 ;
var speedLoaded = 0 ;
var speedLoaded = 0 ;
xhr . upload . onprogress = function ( e ) {
xhr . upload . onprogress = function ( e ) {
if ( ! e . lengthComputable || ! ( file = _this 2 . get ( file ) ) || ! file . active ) {
if ( ! e . lengthComputable || ! ( file = _this 4 . get ( file ) ) || ! file . active ) {
return ;
return ;
}
}
@ -1463,7 +1566,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
}
speedTime = speedTime2 ;
speedTime = speedTime2 ;
file = _this 2 . update ( file , {
file = _this 4 . update ( file , {
progress : ( e . loaded / e . total * 100 ) . toFixed ( 2 ) ,
progress : ( e . loaded / e . total * 100 ) . toFixed ( 2 ) ,
speed : e . loaded - speedLoaded
speed : e . loaded - speedLoaded
} ) ;
} ) ;
@ -1471,7 +1574,7 @@ return /******/ (function(modules) { // webpackBootstrap
} ;
} ;
var interval = setInterval ( function ( ) {
var interval = setInterval ( function ( ) {
file = _this 2 . get ( file ) ;
file = _this 4 . get ( file ) ;
if ( file && ! file . success && ! file . error && file . active ) {
if ( file && ! file . success && ! file . error && file . active ) {
return ;
return ;
}
}
@ -1499,7 +1602,7 @@ return /******/ (function(modules) { // webpackBootstrap
interval = false ;
interval = false ;
}
}
file = _this 2 . get ( file ) ;
file = _this 4 . get ( file ) ;
if ( ! file ) {
if ( ! file ) {
return reject ( 'not_exists' ) ;
return reject ( 'not_exists' ) ;
@ -1552,7 +1655,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
}
}
}
file = _this 2 . update ( file , data ) ;
file = _this 4 . update ( file , data ) ;
if ( file . error ) {
if ( file . error ) {
return reject ( file . error ) ;
return reject ( file . error ) ;
@ -1574,13 +1677,13 @@ return /******/ (function(modules) { // webpackBootstrap
xhr . setRequestHeader ( key , file . headers [ key ] ) ;
xhr . setRequestHeader ( key , file . headers [ key ] ) ;
}
}
file = _this 2 . update ( file , { xhr : xhr } ) ;
file = _this 4 . update ( file , { xhr : xhr } ) ;
xhr . send ( data ) ;
xhr . send ( data ) ;
} ) ;
} ) ;
} ,
} ,
uploadHtml4 : function uploadHtml4 ( file ) {
uploadHtml4 : function uploadHtml4 ( file ) {
var _this 3 = this ;
var _this 5 = this ;
var onKeydown = function onKeydown ( e ) {
var onKeydown = function onKeydown ( e ) {
if ( e . keyCode == 27 ) {
if ( e . keyCode == 27 ) {
@ -1644,12 +1747,12 @@ return /******/ (function(modules) { // webpackBootstrap
return new _promise2 . default ( function ( resolve , reject ) {
return new _promise2 . default ( function ( resolve , reject ) {
setTimeout ( function ( ) {
setTimeout ( function ( ) {
if ( ! ( file = _this 3 . update ( file , { iframe : iframe } ) ) ) {
if ( ! ( file = _this 5 . update ( file , { iframe : iframe } ) ) ) {
return reject ( 'not_exists' ) ;
return reject ( 'not_exists' ) ;
}
}
var interval = setInterval ( function ( ) {
var interval = setInterval ( function ( ) {
file = _this 3 . get ( file ) ;
file = _this 5 . get ( file ) ;
if ( file && ! file . success && ! file . error && file . active ) {
if ( file && ! file . success && ! file . error && file . active ) {
return ;
return ;
}
}
@ -1677,7 +1780,7 @@ return /******/ (function(modules) { // webpackBootstrap
document . body . removeEventListener ( 'keydown' , onKeydown ) ;
document . body . removeEventListener ( 'keydown' , onKeydown ) ;
file = _this 3 . get ( file ) ;
file = _this 5 . get ( file ) ;
if ( ! file ) {
if ( ! file ) {
return reject ( 'not_exists' ) ;
return reject ( 'not_exists' ) ;
@ -1729,7 +1832,7 @@ return /******/ (function(modules) { // webpackBootstrap
data . response = response ;
data . response = response ;
}
}
file = _this 3 . update ( file , data ) ;
file = _this 5 . update ( file , data ) ;
if ( file . error ) {
if ( file . error ) {
return reject ( file . error ) ;
return reject ( file . error ) ;
@ -1807,75 +1910,6 @@ return /******/ (function(modules) { // webpackBootstrap
this . dropElement . addEventListener ( 'drop' , this . onDrop , false ) ;
this . dropElement . addEventListener ( 'drop' , this . onDrop , false ) ;
}
}
} ,
} ,
addInputFile : function addInputFile ( el ) {
var files = [ ] ;
if ( el . files ) {
for ( var i = 0 ; i < el . files . length ; i ++ ) {
var file = el . files [ i ] ;
files . push ( {
size : file . size ,
name : file . webkitRelativePath || file . relativePath || file . name ,
type : file . type ,
file : file ,
el : el
} ) ;
}
} else {
files . push ( {
name : el . value . replace ( /^.*?([^\/\\\r\n]+)$/ , '$1' ) ,
el : el
} ) ;
}
this . add ( files ) ;
var Component = this . $options . components . InputFile ;
if ( ! Component . _Ctor ) { } else if ( typeof Component . _Ctor === 'function' ) {
Component = Component . _Ctor ;
} else {
Component = Component . _Ctor [ 0 ] ;
}
var inputFile = new Component ( {
parent : this ,
el : el
} ) ;
} ,
getEntry : function getEntry ( entry ) {
var _this4 = this ;
var path = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : '' ;
return new _promise2 . default ( function ( resolve , reject ) {
if ( entry . isFile ) {
entry . file ( function ( file ) {
resolve ( [ {
size : file . size ,
name : path + file . name ,
type : file . type ,
file : file
} ] ) ;
} ) ;
} else if ( entry . isDirectory && _this4 . dropDirectory ) {
entry . createReader ( ) . readEntries ( function ( entries ) {
var files = [ ] ;
var forEach = function forEach ( i ) {
if ( ! entries [ i ] || files . length && ! _this4 . multiple ) {
return resolve ( files ) ;
}
_this4 . getEntry ( entries [ i ] , path + entry . name + '/' ) . then ( function ( results ) {
files . push . apply ( files , ( 0 , _toConsumableArray3 . default ) ( results ) ) ;
forEach ( i + 1 ) ;
} ) ;
} ;
forEach ( 0 ) ;
} ) ;
} else {
resolve ( [ ] ) ;
}
} ) ;
} ,
onDragenter : function onDragenter ( e ) {
onDragenter : function onDragenter ( e ) {
e . preventDefault ( ) ;
e . preventDefault ( ) ;
if ( ! this . dropActive ) {
if ( ! this . dropActive ) {
@ -1892,48 +1926,9 @@ return /******/ (function(modules) { // webpackBootstrap
e . preventDefault ( ) ;
e . preventDefault ( ) ;
} ,
} ,
onDrop : function onDrop ( e ) {
onDrop : function onDrop ( e ) {
var _this5 = this ;
e . preventDefault ( ) ;
e . preventDefault ( ) ;
this . dropActive = false ;
this . dropActive = false ;
var dataTransfer = e . dataTransfer ;
this . addDataTransfer ( e . dataTransfer ) ;
var files = [ ] ;
if ( dataTransfer . items && dataTransfer . items . length ) {
var items = [ ] ;
for ( var i = 0 ; i < dataTransfer . items . length ; i ++ ) {
var item = dataTransfer . items [ i ] ;
if ( item . getAsEntry ) {
item = item . getAsEntry ( ) ;
} else if ( item . webkitGetAsEntry ) {
item = item . webkitGetAsEntry ( ) ;
} else {
item = item . getAsFile ( ) ;
}
items . push ( item ) ;
}
var forEach = function forEach ( i ) {
var item = items [ i ] ;
if ( ! item || ! _this5 . multiple && files . length ) {
return _this5 . add ( files ) ;
}
_this5 . getEntry ( item ) . then ( function ( results ) {
files . push . apply ( files , ( 0 , _toConsumableArray3 . default ) ( results ) ) ;
forEach ( i + 1 ) ;
} ) ;
} ;
forEach ( 0 ) ;
} else if ( dataTransfer . files . length ) {
for ( var _i3 = 0 ; _i3 < dataTransfer . files . length ; _i3 ++ ) {
files . push ( dataTransfer . files [ _i3 ] ) ;
if ( ! this . multiple ) {
break ;
}
}
this . add ( files ) ;
}
}
}
}
}
} ;
} ;
@ -1952,6 +1947,10 @@ return /******/ (function(modules) { // webpackBootstrap
change : function change ( e ) {
change : function change ( e ) {
this . $destroy ( ) ;
this . $destroy ( ) ;
this . $parent . addInputFile ( e . target ) ;
this . $parent . addInputFile ( e . target ) ;
new this . constructor ( {
parent : this . $parent ,
el : this . $el
} ) ;
}
}
}
}
} ;
} ;