vxe-pc-ui 3.16.1 → 3.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/es/cascader/src/cascader.js +7 -9
  2. package/es/icon/style.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/tree/src/tree.js +16 -6
  6. package/es/ui/index.js +1 -1
  7. package/es/ui/src/log.js +1 -1
  8. package/es/upload/src/upload.js +5 -3
  9. package/helper/vetur/attributes.json +1 -1
  10. package/helper/vetur/tags.json +1 -1
  11. package/lib/cascader/src/cascader.js +7 -9
  12. package/lib/cascader/src/cascader.min.js +1 -1
  13. package/lib/icon/style/style.css +1 -1
  14. package/lib/icon/style/style.min.css +1 -1
  15. package/lib/index.umd.js +34 -22
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/style.css +1 -1
  18. package/lib/style.min.css +1 -1
  19. package/lib/tree/src/tree.js +18 -6
  20. package/lib/tree/src/tree.min.js +1 -1
  21. package/lib/ui/index.js +1 -1
  22. package/lib/ui/index.min.js +1 -1
  23. package/lib/ui/src/log.js +1 -1
  24. package/lib/ui/src/log.min.js +1 -1
  25. package/lib/upload/src/upload.js +5 -3
  26. package/lib/upload/src/upload.min.js +1 -1
  27. package/package.json +1 -1
  28. package/packages/cascader/src/cascader.ts +7 -9
  29. package/packages/tree/src/tree.ts +16 -6
  30. package/packages/upload/src/upload.ts +5 -3
  31. package/types/all.d.ts +3 -1
  32. package/types/components/gantt.d.ts +1 -0
  33. /package/es/icon/{iconfont.1783439857168.ttf → iconfont.1783607039667.ttf} +0 -0
  34. /package/es/icon/{iconfont.1783439857168.woff → iconfont.1783607039667.woff} +0 -0
  35. /package/es/icon/{iconfont.1783439857168.woff2 → iconfont.1783607039667.woff2} +0 -0
  36. /package/es/{iconfont.1783439857168.ttf → iconfont.1783607039667.ttf} +0 -0
  37. /package/es/{iconfont.1783439857168.woff → iconfont.1783607039667.woff} +0 -0
  38. /package/es/{iconfont.1783439857168.woff2 → iconfont.1783607039667.woff2} +0 -0
  39. /package/lib/icon/style/{iconfont.1783439857168.ttf → iconfont.1783607039667.ttf} +0 -0
  40. /package/lib/icon/style/{iconfont.1783439857168.woff → iconfont.1783607039667.woff} +0 -0
  41. /package/lib/icon/style/{iconfont.1783439857168.woff2 → iconfont.1783607039667.woff2} +0 -0
  42. /package/lib/{iconfont.1783439857168.ttf → iconfont.1783607039667.ttf} +0 -0
  43. /package/lib/{iconfont.1783439857168.woff → iconfont.1783607039667.woff} +0 -0
  44. /package/lib/{iconfont.1783439857168.woff2 → iconfont.1783607039667.woff2} +0 -0
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_dom=require("../../ui/src/dom"),_util=require("./util"),_button=_interopRequireDefault(require("../../button/src/button"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,o){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0===o)return("string"===t?String:Number)(e);o=o.call(e,t||"default");if("object"!=_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}var _createComponentLog=(0,_log.createComponentLog)("upload"),warnLog=_createComponentLog.warnLog,errLog=_createComponentLog.errLog;function getUniqueKey(){return _xeUtils.default.uniqueId()}function handleTransferFiles(e){var t=[];return _xeUtils.default.arrayEach(e,function(e){e=e.getAsFile();e&&t.push(e)}),t}function showDropTip(e,t,o,i){var n=e.xID,a=e.reactData.showMorePopup,r=e.$refs.refElem,l=document.getElementById("refPopupElem".concat(n)),l=a?l:r;l&&(r=l.getBoundingClientRect(),l=e.$refs.refDragLineElem,e=document.getElementById("refModalDragLineElem".concat(n)),n=a?e:l)&&(a=o.getBoundingClientRect(),n.style.display="block",n.style.top="".concat(Math.max(1,a.y-r.y),"px"),n.style.left="".concat(Math.max(1,a.x-r.x),"px"),n.style.height="".concat(a.height,"px"),n.style.width="".concat(a.width-1,"px"),n.setAttribute("drag-pos",i))}function hideDropTip(e){var t=e.xID,e=e.$refs.refDragLineElem,t=document.getElementById("refModalDragLineElem".concat(t));e&&(e.style.display=""),t&&(t.style.display="")}var handleClearFile=function(o,i){var e=o.reactData.fileList,n=o.computeUrlProp,a=[];return _xeUtils.default.lastEach(e,function(t,e){a.push(o.removeFileEvent(i,t,e).then(function(e){return{url:t[n],status:e}}))}),Promise.all(a)};function handleRemoveFile(o,i,e){var n=o.reactData.fileList,a=o.computeUrlProp,e=_xeUtils.default.isArray(e)?e:[e],r=[];return e.forEach(function(e){var t;e&&(t=_xeUtils.default.isString(e)?e:e[a],-1<(e=_xeUtils.default.findIndexOf(n,function(e){return e[a]===t})))&&r.push(o.removeFileEvent(i,n[e],e).then(function(e){return{url:t,status:e}}))}),Promise.all(r)}function createReactData(){return{isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}}function createInternalData(){return{moreId:_xeUtils.default.uniqueId("upload"),imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeUpload",model:{prop:"value",event:"modelValue"},mixins:[_ui.globalMixins.sizeMixin],props:{value:[Array,String,Object],showList:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showList}},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},autoSubmit:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.autoSubmit}},mode:{type:String,default:function(){return(0,_ui.getConfig)().upload.mode}},imageTypes:{type:Array,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)}},imageConfig:{type:Object,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)}},imageStyle:{type:Object,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)}},fileTypes:{type:Array,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)}},dragSort:Boolean,dragToUpload:{type:Boolean,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)}},dragPlaceholder:{type:String,default:function(){return(0,_ui.getConfig)().upload.dragPlaceholder}},pasteToUpload:{type:Boolean,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)}},keyField:String,singleMode:Boolean,urlMode:Boolean,urlArgs:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.urlArgs}},multiple:Boolean,limitSize:{type:[String,Number],default:function(){return(0,_ui.getConfig)().upload.limitSize}},showLimitSize:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showLimitSize}},limitSizeText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.limitSizeText}},limitCount:{type:[String,Number],default:function(){return(0,_ui.getConfig)().upload.limitCount}},showLimitCount:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showLimitCount}},limitCountText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.limitCountText}},nameField:{type:String,default:function(){return(0,_ui.getConfig)().upload.nameField}},typeField:{type:String,default:function(){return(0,_ui.getConfig)().upload.typeField}},urlField:{type:String,default:function(){return(0,_ui.getConfig)().upload.urlField}},sizeField:{type:String,default:function(){return(0,_ui.getConfig)().upload.sizeField}},showErrorStatus:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showErrorStatus}},showProgress:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showProgress}},progressText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.progressText}},previewImageConfig:Object,showSubmitButton:Boolean,autoHiddenButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.autoHiddenButton}},showUploadButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showUploadButton}},buttonText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.buttonText}},buttonIcon:{type:String,default:function(){return(0,_ui.getConfig)().upload.buttonIcon}},showButtonText:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showButtonText}},showButtonIcon:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showButtonIcon}},showRemoveButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showRemoveButton}},showDownloadButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showDownloadButton}},showPreview:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showPreview}},showTip:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showTip}},maxSimultaneousUploads:{type:Number,default:function(){return(0,_ui.getConfig)().upload.maxSimultaneousUploads}},tipText:[String,Number,Function],hintText:String,previewMethod:Function,beforeSelectMethod:Function,uploadMethod:Function,beforeRemoveMethod:Function,removeMethod:Function,beforeDownloadMethod:Function,downloadMethod:Function,getUrlMethod:Function,getThumbnailUrlMethod:Function,size:{type:String,default:function(){return(0,_ui.getConfig)().upload.size||(0,_ui.getConfig)().size}}},inject:{$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null},$xeTable:{default:null}},data:function(){var e=_xeUtils.default.uniqueId(),t=createReactData();return Object.assign(Object.assign({},{}),{xID:e,reactData:t})},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeKeyField:function(){return this.keyField||"_X_KEY"},computeIsImage:function(){return"image"===this.mode},computeNameProp:function(){return this.nameField||"name"},computeTypeProp:function(){return this.typeField||"type"},computeUrlProp:function(){return this.urlField||"url"},computeSizeProp:function(){return this.sizeField||"size"},computeLimitMaxSize:function(){return 1024*_xeUtils.default.toNumber(this.limitSize)*1024},computeLimitMaxCount:function(){return this.multiple?_xeUtils.default.toNumber(this.limitCount):1},computePreviewImageOpts:function(){var e=this.showDownloadButton;return Object.assign({showDownloadButton:e},(0,_ui.getConfig)().upload.previewImageConfig,this.previewImageConfig)},computeOverCount:function(){var e=this.reactData,t=this.multiple,e=e.fileList,o=this.computeLimitMaxCount;return t?!o||e.length>=o:1<=e.length},computeLimitSizeUnit:function(){var e=_xeUtils.default.toNumber(this.limitSize);return e?1048576<e?"".concat(e/1048576,"T"):1024<e?"".concat(e/1024,"G"):"".concat(e,"M"):""},computedShowTipText:function(){var e=this.showTip,t=this.tipText;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t},computedDefTipText:function(){var e=this,t=e.limitSize,o=e.fileTypes,i=e.multiple,n=e.limitCount,e=e.tipText||e.hintText,a=this.computeIsImage,r=this.computeLimitSizeUnit;return _xeUtils.default.isString(e)?e:_xeUtils.default.isFunction(e)?"".concat(e({})):(e=[],a?(i&&n&&e.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[n])),t&&r&&e.push((0,_ui.getI18n)("vxe.upload.imgSizeHint",[r]))):(o&&o.length&&e.push((0,_ui.getI18n)("vxe.upload.fileTypeHint",[o.join("/")])),t&&r&&e.push((0,_ui.getI18n)("vxe.upload.fileSizeHint",[r])),i&&n&&e.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[n]))),e.join((0,_ui.getI18n)("vxe.base.comma")))},computeImageOpts:function(){return Object.assign({},this.imageConfig||this.imageStyle)},computeImgStyle:function(){var e=this.computeImageOpts,t=e.width,e=e.height,o={};return t&&(o.width=(0,_dom.toCssUnit)(t)),e&&(o.height=(0,_dom.toCssUnit)(e)),o},computeMoreOpts:function(){return Object.assign({showMoreButton:!0},this.moreConfig)}}),watch:{value:function(){this.updateFileList()}},methods:{dispatchEvent:function(e,t,o){this.$emit(e,(0,_ui.createEvent)(o,{$upload:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},choose:function(){return this.handleChoose(null)},clear:function(){return handleClearFile(this,null)},clearByEvent:function(e){return handleClearFile(this,e)},getPendingFiles:function(){var t=this,e=t.reactData,o=e.fileList,i=e.fileCacheMaps,n=[];return o.forEach(function(e){e=t.getFieldKey(e),e=i[e];e&&"pending"===e.status&&n.push(e.file)}),n},submit:function(i){var n=this,e=n.reactData,t=n.maxSimultaneousUploads,t=_xeUtils.default.toNumber(t||1)||1,o=e.fileList,a=e.fileCacheMaps,r=o.filter(function(e){e=n.getFieldKey(e),e=a[e];return e&&("pending"===e.status||i&&"error"===e.status)}),l=function(e){var t=n.getFieldKey(e),t=a[t];if(t){var o=t.file;if(o&&("pending"===t.status||i&&"error"===t.status))return t.loading=!0,t.percent=0,n.handleUploadResult(e,o).then(u)}return u()},u=function(){var e;return r.length?(e=r[0],r.splice(0,1),l(e).then(u)):Promise.resolve()};return Promise.all(r.splice(0,t).map(l)).then(function(){})},getMoreVisible:function(){return this.reactData.showMorePopup},openMore:function(){return this.handleMoreEvent({$event:new Event("click")}),this.$nextTick()},openMoreByEvent:function(e){return this.handleMoreEvent({$event:e}),this.$nextTick()},closeMore:function(){var e=this.internalData;return _ui.VxeUI.modal&&_ui.VxeUI.modal.close(e.moreId),this.$nextTick()},remove:function(e){return handleRemoveFile(this,null,e)},removeByEvent:function(e,t){return handleRemoveFile(this,e,t)},getFieldKey:function(e){return e[this.computeKeyField]},updateFileList:function(){var n=this,e=n.reactData,t=n.value,o=n.multiple,i=n.computeFormReadonly,a=n.computeKeyField,r=n.computeNameProp,l=n.computeTypeProp,u=n.computeUrlProp,s=n.computeSizeProp,t=t?(t?_xeUtils.default.isArray(t)?t:[t]:[]).map(function(e){var t,o,i;return!e||_xeUtils.default.isString(e)?(t="".concat(e||""),i=((o=_xeUtils.default.parseUrl(e))?o.searchQuery[r]:"")||n.parseFileName(t),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},r,i),l,(o?o.searchQuery[l]:"")||n.parseFileType(i)),u,t),s,_xeUtils.default.toNumber(o?o.searchQuery[s]:0)||0),a,getUniqueKey())):(i=e[r]||"",e[r]=i,e[l]=e[l]||n.parseFileType(i),e[u]=e[u]||"",e[s]=e[s]||0,e[a]=e[a]||getUniqueKey(),e)}):[];e.fileList=i||o?t:t.slice(0,1)},parseFileName:function(e){return decodeURIComponent("".concat(e||"")).split("/").pop()||""},parseFileType:function(e){var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},handleChangeEvent:function(e,t){var o=this,i=o.singleMode,n=o.urlMode,a=o.urlArgs,r=o.computeUrlProp,l=o.computeNameProp,t=t?t.slice(0):[],n=(n&&(t=t.map(function(e){var t=e[r];if(t&&a){var o=_xeUtils.default.parseUrl(t);if(!o.searchQuery[l]&&-1===t.indexOf("blob:"))return"".concat(t).concat(-1===t.indexOf("?")?"?":"&").concat(encodeURIComponent(e[l]||""))}return t})),i?t[0]||null:t);return o.emitModel(n),o.dispatchEvent("change",{value:n},e),n},getThumbnailFileUrl:function(e){var t=this.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod;return t?t({$upload:this,option:e}):this.getFileUrl(e)},getFileUrl:function(e){var t=this.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=this.computeUrlProp;return t?t({$upload:this,option:e}):e[o]},handleDefaultFilePreview:function(t){var e=this,o=e.internalData,i=e.imageTypes,n=e.computeTypeProp,a=e.computePreviewImageOpts,r=e.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;o.imagePreviewTypes.concat(i||[]).some(function(e){return"".concat(e).toLowerCase()==="".concat(t[n]).toLowerCase()})&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage(Object.assign(Object.assign({},a),{urlList:[e.getFileUrl(t)],beforeDownloadMethod:r?function(){return r({$upload:e,option:t})}:void 0}))},handlePreviewFileEvent:function(e,t){var o=this.previewMethod||(0,_ui.getConfig)().upload.previewMethod;this.showPreview&&(o?o({$upload:this,option:t}):this.handleDefaultFilePreview(t))},handlePreviewImageEvent:function(e,t,o){var i=this,n=i,a=i.reactData.fileList,r=i.computePreviewImageOpts,l=n.previewMethod||(0,_ui.getConfig)().upload.previewMethod,u=n.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;n.showPreview&&(l?l({$upload:i,option:t}):_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage(Object.assign(Object.assign({},r),{urlList:a.map(function(e){return i.getFileUrl(e)}),activeIndex:o,beforeDownloadMethod:u?function(e){e=e.index;return u({$upload:i,option:a[e]})}:void 0})))},handleUploadResult:function(i,e){var n=this,t=n,a=n.reactData,r=t.showErrorStatus,l=n.getFieldKey(i),t=t.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?(n.dispatchEvent("upload-start",{option:i},null),Promise.resolve(t({$upload:n,file:e,option:i,updateProgress:function(e){var t=a.fileCacheMaps[n.getFieldKey(i)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(function(e){var t=a.fileCacheMaps[l];t&&(t.percent=100,t.status="success",t.response=e),_xeUtils.default.each(e,function(e,t){n.$set(i,t,e)}),n.dispatchEvent("upload-success",{option:i,data:e},null)}).catch(function(e){var t=a.fileCacheMaps,o=t[l];o&&(o.status="error",o.response=e),r?_xeUtils.default.each(e,function(e,t){n.$set(i,t,e)}):(a.fileList=a.fileList.filter(function(e){return n.getFieldKey(e)!==l}),delete t[l]),n.dispatchEvent("upload-error",{option:i,data:e},null)}).finally(function(){var e=a.fileCacheMaps[l],e=(e&&(e.loading=!1),{option:i,status:e?e.status:null,response:e?e.response:null});n.dispatchEvent("upload-end",{option:i,result:e},null)})):((t=a.fileCacheMaps[l])&&(t.loading=!1),Promise.resolve())},handleReUploadEvent:function(e,t){var o=this,i=o.reactData,n=o.uploadMethod,a=o.urlMode,r=i.fileCacheMaps[o.getFieldKey(t)];(n||(0,_ui.getConfig)().upload.uploadMethod)&&r&&(n=r.file,r.loading=!0,r.status="pending",r.percent=0,o.handleUploadResult(t,n).then(function(){a&&o.handleChangeEvent(e,i.fileList)}))},handleUploadFile:function(e,n){var a=this,t=a,r=a.reactData,l=a.$xeForm,u=a.formItemInfo,o=t.multiple,i=t.showLimitSize,s=t.limitSizeText,d=t.showLimitCount,p=t.limitCountText,c=t.autoSubmit,f=r.fileList,g=t.beforeSelectMethod||(0,_ui.getConfig)().upload.beforeSelectMethod,m=t.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,v=a.computeKeyField,h=a.computeNameProp,_=a.computeTypeProp,x=a.computeUrlProp,y=a.computeSizeProp,E=a.computeLimitMaxSize,I=a.computeLimitMaxCount,D=a.computeLimitSizeUnit,w=e;if(o&&I){if(d&&f.length>=I)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:p?"".concat(_xeUtils.default.isFunction(p)?p({maxCount:I}):p):(0,_ui.getI18n)("vxe.upload.overCountErr",[I])}));var U,b=w.length-(I-f.length);d&&0<b&&(U=w.slice(I-f.length),p?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:"".concat(_xeUtils.default.isFunction(p)?p({maxCount:I}):p)}):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",slots:{default:function(e,o){return o("div",{class:"vxe-upload--file-message-over-error"},[o("div",{},(0,_ui.getI18n)("vxe.upload.overCountExtraErr",[I,b])),o("div",{class:"vxe-upload--file-message-over-extra"},U.map(function(e,t){return o("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)}))])}}})),w=w.slice(0,I-f.length)}if(i&&E)for(var C=0;C<e.length;C++)if(e[0].size>E)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:s?"".concat(_xeUtils.default.isFunction(s)?s({maxSize:E}):s):(0,_ui.getI18n)("vxe.upload.overSizeErr",[D])}));a.dispatchEvent("upload-queue-start",{files:w},n);var F=Object.assign({},r.fileCacheMaps),S=o?f:[],T=[];w.forEach(function(e){var t=e.name,o=getUniqueKey(),t=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},h,t),_,a.parseFileType(t)),y,e.size),x,URL.createObjectURL(e)),v,o),o=(m&&(F[o]={file:e,loading:!!c,status:"pending",percent:0,response:null}),t);g&&!g({$upload:a,file:e})||(m&&c&&T.push(a.handleUploadResult(o,e)),S.push(o))}),r.fileList=S,r.fileCacheMaps=F,S.forEach(function(e){a.dispatchEvent("add",{option:e},n)}),Promise.all(T).then(function(){var o=r.fileCacheMaps,e=r.fileList,t=S.map(function(e){var t=a.getFieldKey(e),t=o[t];return{option:e,status:t?t.status:null,response:t?t.response:null}}),i=a.handleChangeEvent(n,e);a.dispatchEvent("upload-queue-end",{value:i,options:e,results:t,files:w},n),l&&u&&l.triggerItemEvent(n,u.itemConfig.field,i)})},handleChoose:function(t){var o=this,e=o.multiple,i=o.imageTypes,n=o.fileTypes,a=o.computeIsDisabled,r=o.computeIsImage;return a?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:r?i:n}).then(function(e){return o.handleUploadFile(e.files,t),e})},clickEvent:function(e){this.handleChoose(e).catch(function(){})},handleRemoveEvent:function(e,t,o){var i=this,n=i.reactData,a=i.$xeForm,r=i.formItemInfo,n=n.fileList;n.splice(o,1),i.handleChangeEvent(e,n),a&&r&&a.triggerItemEvent(e||{type:"remove"},r.itemConfig.field,n),e&&i.dispatchEvent("remove",{option:t},e)},removeFileEvent:function(t,o,i){var n=this,e=n,a=e.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod,r=e.removeMethod||(0,_ui.getConfig)().upload.removeMethod;return Promise.resolve(!a||a({$upload:n,option:o})).then(function(e){return e?r?Promise.resolve(r({$upload:n,option:o})).then(function(){n.handleRemoveEvent(t,o,i)}).catch(function(e){return e}):n.handleRemoveEvent(t,o,i):n.dispatchEvent("remove-fail",{option:o},t),e})},handleDownloadEvent:function(e,t){this.dispatchEvent("download",{option:t},e)},downloadFileEvent:function(t,o){var i=this,e=i,n=e.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod,a=e.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!n||n({$upload:i,option:o})).then(function(e){e?a?Promise.resolve(a({$upload:i,option:o})).then(function(){i.handleDownloadEvent(t,o)}).catch(function(e){return e}):i.handleDownloadEvent(t,o):i.dispatchEvent("download-fail",{option:o},t)})},handleUploadDragleaveEvent:function(e){var t,o,i=this.reactData,n=e.currentTarget,a=e.clientX,e=e.clientY;n&&(t=(n=n.getBoundingClientRect()).x,o=n.y,a<t||t+n.width<a||e<o||o+n.height<e)&&(i.isDragUploadStatus=!1)},handleUploadDragoverEvent:function(e){var t=this.reactData,o=e.dataTransfer;o&&(o=o.items)&&o.length&&(e.preventDefault(),t.isDragUploadStatus=!0)},uploadTransferFileEvent:function(e,t){var o=this,i=o.internalData,n=o.imageTypes,a=o.fileTypes,i=i.imagePreviewTypes;if(o.computeIsImage){var r=i.concat(n&&n.length?n:[]);t=t.filter(function(e){var t="".concat(e.type.split("/")[1]||"").toLowerCase();return!!r.some(function(e){return"".concat(e).toLowerCase()===t})})}else if(a&&a.length){var l=[];if(t.forEach(function(e){var t=o.parseFileType(e.name);a.some(function(e){return"".concat(e).toLowerCase()===t})||l.push(t)}),l.length)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.error.notType",[l.join(", ")]),status:"error"}))}t.length?o.handleUploadFile(t,e):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.uploadTypeErr")})},handleUploadDropEvent:function(e){var t=this.reactData,o=e.dataTransfer;o&&(o=o.items)&&o.length&&(e.preventDefault(),(o=handleTransferFiles(o)).length)&&this.uploadTransferFileEvent(e,o),t.isDragUploadStatus=!1},handleMoreEvent:function(e){var g=this,m=g,v=g.$scopedSlots,h=g.reactData,_=g.xID,x=g.computeFormReadonly,y=g.computeIsImage,e=e.$event;_ui.VxeUI.modal&&(_ui.VxeUI.modal.open({id:g.internalData.moreId,title:x?(0,_ui.getI18n)("vxe.upload.morePopup.readTitle"):(0,_ui.getI18n)("vxe.upload.morePopup.".concat(y?"imageTitle":"fileTitle")),width:660,height:500,escClosable:!0,showMaximize:!0,resize:!0,maskClosable:!0,slots:{default:function(e,t){var o=m.showErrorStatus,i=m.dragToUpload,n=m.dragSort,a=m.dragPlaceholder,r=h.isActivated,l=h.isDragMove,u=h.isDragUploadStatus,s=h.dragIndex,d=h.fileList,p=g.computeIsDisabled,c=v.moreContent||v["more-content"],f={};return i&&-1===s&&(f.dragover=g.handleUploadDragoverEvent,f.dragleave=g.handleUploadDragleaveEvent,f.drop=g.handleUploadDropEvent),t("div",{attrs:{id:"refPopupElem".concat(_)},class:["vxe-upload--more-popup",{"is--readonly":x,"is--disabled":p,"is--active":r,"show--error":o,"is--drag":u}],on:f},c?(0,_vn.getSlotVNs)(c({options:d})):[y?n?t("transition-group",{props:{name:"vxe-upload--drag-list".concat(l?"":"-disabled"),tag:"div"},class:"vxe-upload--image-more-list"},g.renderImageItemList(t,d,!0).concat(g.renderImageAction(t,!0))):t("div",{class:"vxe-upload--image-more-list"},g.renderImageItemList(t,d,!0).concat(g.renderImageAction(t,!0))):t("div",{class:"vxe-upload--file-more-list"},[g.renderFileAction(t,!0),n?t("transition-group",{props:{name:"vxe-upload--drag-list".concat(l?"":"-disabled"),tag:"div"},class:"vxe-upload--file-list"},g.renderFileItemList(t,d,!0)):t("div",{class:"vxe-upload--file-list"},g.renderFileItemList(t,d,!0))]),n?t("div",{attrs:{id:"refModalDragLineElem".concat(_)},class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(g),u?t("div",{class:"vxe-upload--drag-placeholder"},a||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(g)])}},events:{show:function(){h.showMorePopup=!0},hide:function(e){e=e.$event;h.showMorePopup=!1,e&&g.dispatchEvent("more-visible",{visible:!1},e)}}}),e)&&g.dispatchEvent("more-visible",{visible:!0},e)},handleDragSortDragstartEvent:function(e){var t=this.reactData,o=(e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0),e.currentTarget),e=o.parentElement,e=_xeUtils.default.findIndexOf(Array.from(e.children),function(e){return o===e});t.isDragMove=!0,t.dragIndex=e,setTimeout(function(){t.isDragMove=!1},500)},handleDragSortDragoverEvent:function(e){var t,o,i,n,a=this,r=a.reactData,l=a.internalData,r=(e.stopPropagation(),e.preventDefault(),r.dragIndex);-1!==r&&(t=a.computeIsImage,i=(o=e.currentTarget).parentElement,i=_xeUtils.default.findIndexOf(Array.from(i.children),function(e){return o===e}),n="",n=t?e.clientX-o.getBoundingClientRect().x<o.clientWidth/2?"left":"right":e.clientY-o.getBoundingClientRect().y<o.clientHeight/2?"top":"bottom",r===i?showDropTip(a,e,o,n):(showDropTip(a,e,o,n),l.prevDragIndex=i,l.prevDragPos=n))},handleDragSortDragendEvent:function(e){var t=this.reactData,o=this.internalData,i=t.fileList,n=o.prevDragIndex,o=o.prevDragPos,a=t.dragIndex,r="bottom"===o||"right"===o?1:0,l=i[a],u=i[n];l&&u&&(i.splice(a,1),n=_xeUtils.default.findIndexOf(i,function(e){return u===e})+r,i.splice(n,0,l),this.dispatchEvent("sort-dragend",{oldItem:l,newItem:u,dragPos:o,offsetIndex:r,_index:{newIndex:n,oldIndex:a}},e)),hideDropTip(this),t.dragIndex=-1},handleItemMousedownEvent:function(e){var t=this.$xeTable,o=this.reactData;t&&e.stopPropagation(),o.isActivated=!0},handleGlobalPasteEvent:function(e){var t=this.reactData,o=this.pasteToUpload;t.isActivated&&o&&(t=e.clipboardData||e.originalEvent.clipboardData)&&(o=t.items)&&(t=handleTransferFiles(o)).length&&(e.preventDefault(),this.uploadTransferFileEvent(e,t))},handleGlobalClickEvent:function(e){var t=this.reactData,o=this.$refs.refElem,i=this.$refs.refPopupElem,o=(0,_dom.getEventTargetNode)(e,o).flag;!o&&i&&(i=(i=i.parentElement||i)&&i.parentElement,o=(0,_dom.getEventTargetNode)(e,i).flag),t.isActivated=o},handleGlobalBlurEvent:function(){this.reactData.isActivated=!1},renderFileItemList:function(u,e,s){var d=this,t=d.$scopedSlots,o=d.reactData,p=d.showRemoveButton,c=d.showDownloadButton,f=d.showProgress,g=d.progressText,m=d.showPreview,v=d.showErrorStatus,h=d.dragSort,_=d.autoSubmit,x=d.showSubmitButton,y=o.fileList,E=o.fileCacheMaps,I=d.computeIsDisabled,D=d.computeFormReadonly,w=d.computeNameProp,U=d.computeTypeProp,b=t.option,C=t.action,F=t.corner,S=t.name,T={};return h&&1<e.length&&(T.dragstart=d.handleDragSortDragstartEvent,T.dragover=d.handleDragSortDragoverEvent,T.dragend=d.handleDragSortDragendEvent),e.map(function(t,o){var e=d.getFieldKey(t),i=E[e],n=!1,a=!1,r=!1,l="".concat(t[w]||"");return i&&(n=i.loading,a="error"===i.status,r="pending"===i.status),u("div",{key:h?e:o,class:["vxe-upload--file-item",{"is--preview":m,"is--loading":n,"is--pending":r,"is--error":a}],attrs:{fileid:e,draggable:!!h||null},on:T},b?(0,_vn.getSlotVNs)(b({option:t,isMoreView:s,options:y})):[u("div",{class:"vxe-upload--file-item-icon"},[u("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_".concat("".concat(t[U]).toLocaleUpperCase())]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),u("div",{class:"vxe-upload--file-item-name",attrs:{title:l},on:{click:function(e){n||a||d.handlePreviewFileEvent(e,t)}}},S?(0,_vn.getSlotVNs)(S({option:t,isMoreView:s,options:y})):l),n?u("div",{class:"vxe-upload--file-item-loading-icon"},[u("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(d),f&&n&&i?u("div",{class:"vxe-upload--file-item-loading-text"},g?_xeUtils.default.toFormatString("".concat(_xeUtils.default.isFunction(g)?g({}):g),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(d),!n&&(a&&v||r&&x&&!_)?u("div",{class:"vxe-upload--file-item-rebtn"},[u(_button.default,{props:{icon:a?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:a?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload")},on:{click:function(e){d.handleReUploadEvent(e,t)}}})]):(0,_ui.renderEmptyElement)(d),u("div",{class:"vxe-upload--file-item-btn-wrapper"},C?(0,_vn.getSlotVNs)(C({option:t,isMoreView:s,options:y,readonly:D})):[F?u("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(F({option:t,isMoreView:s,options:y,readonly:D}))):(0,_ui.renderEmptyElement)(d),c&&!n?u("div",{class:"vxe-upload--file-item-download-btn",on:{click:function(e){d.downloadFileEvent(e,t)}}},[u("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]):(0,_ui.renderEmptyElement)(d),!p||D||I||n?(0,_ui.renderEmptyElement)(d):u("div",{class:"vxe-upload--file-item-remove-btn",on:{click:function(e){d.removeFileEvent(e,t,o)}}},[u("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},renderFileAction:function(e,t){var o=this,i=o.$scopedSlots,n=o.showUploadButton,a=o.buttonText,r=o.buttonIcon,l=o.showButtonText,u=o.showButtonIcon,s=o.autoHiddenButton,d=o.reactData.fileList,p=o.computeIsDisabled,c=o.computedShowTipText,f=o.computedDefTipText,g=o.computeOverCount,m=i.default,i=i.tip||i.hint;return o.computeFormReadonly||!n?(0,_ui.renderEmptyElement)(o):e("div",{class:"vxe-upload--file-action"},[s&&g?(0,_ui.renderEmptyElement)(o):e("div",{class:"vxe-upload--file-action-btn",on:{click:o.clickEvent}},m?(0,_vn.getSlotVNs)(m({isMoreView:t,options:d,$upload:o})):[e(_button.default,{class:"vxe-upload--file-action-button",props:{content:t||l?a?"".concat(_xeUtils.default.isFunction(a)?a({}):a):(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:u?r||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:p}})]),c&&(f||i)?e("div",{class:"vxe-upload--file-action-tip"},i?(0,_vn.getSlotVNs)(i({isMoreView:t,options:d,$upload:o})):"".concat(f)):(0,_ui.renderEmptyElement)(o)])},rendeFileMode:function(e){var t=this,o=t.$scopedSlots,i=t.reactData,n=t.showList,a=t.moreConfig,r=t.dragSort,l=i.fileList,i=i.isDragMove,u=t.computeMoreOpts,s=u.maxCount,d=u.showMoreButton,p=u.moreButtonText,u="horizontal"===u.layout,o=o.moreButton||o["more-button"],c=l,f=0,g=!1,m=!1;return _xeUtils.default.isNumber(s)&&l.length>s&&(g=!0,m=0===s,f=l.length-s,c=l.slice(0,s)),e("div",{key:"all",class:"vxe-upload--file-wrapper"},n?[d&&a&&u?(0,_ui.renderEmptyElement)(t):t.renderFileAction(e,!0),e("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":u}]},[c.length?r?e("transition-group",{attrs:{name:"vxe-upload--drag-list".concat(i?"":"-disabled"),tag:"div"},class:"vxe-upload--file-list"},t.renderFileItemList(e,c,!1)):e("div",{class:"vxe-upload--file-list"},t.renderFileItemList(e,c,!1)):(0,_ui.renderEmptyElement)(t),d&&f?e("div",{class:"vxe-upload--file-over-more"},o?(0,_vn.getSlotVNs)(o({options:l})):[e(_button.default,{props:{mode:"text",content:p?_xeUtils.default.isFunction(p)?p({$upload:t,options:l}):_xeUtils.default.toFormatString(p,[l.length]):(0,_ui.getI18n)(g&&m?"vxe.upload.moreFileBtnText":"vxe.upload.moreBtnText",[l.length]),status:"primary"},on:{click:t.handleMoreEvent}})]):(0,_ui.renderEmptyElement)(t),d&&a&&u?t.renderFileAction(e,!1):(0,_ui.renderEmptyElement)(t)])]:[t.renderFileAction(e,!1)])},renderImageItemList:function(l,e,u){var s=this,t=s.$scopedSlots,o=s.reactData,d=s.showRemoveButton,p=s.showProgress,c=s.progressText,f=s.showPreview,g=s.showErrorStatus,m=s.dragSort,v=s.autoSubmit,h=s.showSubmitButton,_=o.fileList,x=o.fileCacheMaps,y=s.computeIsDisabled,E=s.computeFormReadonly,I=s.computeImageOpts,D=s.computeImgStyle,w=t.option,U=t.action,b=t.corner,C={};return m&&1<e.length&&(C.dragstart=s.handleDragSortDragstartEvent,C.dragover=s.handleDragSortDragoverEvent,C.dragend=s.handleDragSortDragendEvent),e.map(function(t,o){var e=s.getFieldKey(t),i=x[e],n=!1,a=!1,r=!1;return i&&(n=i.loading,a="error"===i.status,r="pending"===i.status),l("div",{key:m?e:o,class:["vxe-upload--image-item",{"is--preview":f,"is--circle":I.circle,"is--loading":n,"is--pending":r,"is--error":a}],attrs:{fileid:e,draggable:!!m||null},on:C},w?(0,_vn.getSlotVNs)(w({option:t,isMoreView:u,options:_})):[l("div",{class:"vxe-upload--image-item-box",style:u?{}:D,on:{click:function(e){n||a||s.handlePreviewImageEvent(e,t,o)}}},[n&&i?l("div",{class:"vxe-upload--image-item-loading"},[l("div",{class:"vxe-upload--image-item-loading-icon"},[l("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),p?l("div",{class:"vxe-upload--image-item-loading-text"},c?_xeUtils.default.toFormatString("".concat(_xeUtils.default.isFunction(c)?c({}):c),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(s)]):(0,_ui.renderEmptyElement)(s),l("div",{class:"vxe-upload--image-item-img-wrapper",attrs:{title:(0,_ui.getI18n)("vxe.upload.viewItemTitle")}},[l("img",{class:"vxe-upload--image-item-img",attrs:{src:s.getThumbnailFileUrl(t)}})]),!n&&(a&&g||r&&h&&!v)?l("div",{class:"vxe-upload--image-item-rebtn"},[l(_button.default,{props:{icon:a?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:a?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload")},on:{click:function(e){s.handleReUploadEvent(e,t)}}})]):(0,_ui.renderEmptyElement)(s),l("div",{class:"vxe-upload--image-item-btn-wrapper",on:{click:function(e){e.stopPropagation()}}},U?(0,_vn.getSlotVNs)(U({option:t,isMoreView:u,options:_,readonly:E})):[b?l("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(b({option:t,isMoreView:u,options:_,readonly:E}))):(0,_ui.renderEmptyElement)(s),!d||E||y||n?(0,_ui.renderEmptyElement)(s):l("div",{class:"vxe-upload--image-item-remove-btn",on:{click:function(e){e.stopPropagation(),s.removeFileEvent(e,t,o)}}},[l("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},renderImageAction:function(e,t){var o=this,i=o.$scopedSlots,n=o.showUploadButton,a=o.buttonText,r=o.buttonIcon,l=o.showButtonText,u=o.showButtonIcon,s=o.reactData.fileList,d=o.computedShowTipText,p=o.computedDefTipText,c=o.computeImgStyle,f=i.default,i=i.tip||i.hint;return o.computeFormReadonly||!n||o.autoHiddenButton&&o.computeOverCount?(0,_ui.renderEmptyElement)(o):e("div",{key:"action",class:"vxe-upload--image-action"},[e("div",{class:"vxe-upload--image-action-btn",on:{click:o.clickEvent}},f?f({isMoreView:t,options:s,$upload:o}):[e("div",{class:"vxe-upload--image-action-box",style:t?{}:c},[u?e("div",{class:"vxe-upload--image-action-icon"},[e("i",{class:r||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_ui.renderEmptyElement)(o),t||l?e("div",{class:"vxe-upload--image-action-content"},a?"".concat(_xeUtils.default.isFunction(a)?a({}):a):(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_ui.renderEmptyElement)(o),d&&(p||i)?e("div",{class:"vxe-upload--image-action-hint"},i?(0,_vn.getSlotVNs)(i({isMoreView:t,options:s,$upload:o})):"".concat(p)):(0,_ui.renderEmptyElement)(o)])])])},renderImageMode:function(e){var t=this,o=t.$scopedSlots,i=t.reactData,n=t.showList,a=t.dragSort,r=i.fileList,i=i.isDragMove,l=t.computeMoreOpts,o=o.moreButton||o["more-button"],u=l.maxCount,s=l.showMoreButton,l=l.moreButtonText,d=r,p=0,c=!1,f=!1;return _xeUtils.default.isNumber(u)&&r.length>u&&(c=!0,f=0===u,p=r.length-u,d=r.slice(0,u)),e("div",{key:"image",class:"vxe-upload--image-wrapper"},n?[a?e("transition-group",{attrs:{name:"vxe-upload--drag-list".concat(i?"":"-disabled"),tag:"div"},class:"vxe-upload--image-list"},t.renderImageItemList(e,d,!1).concat([s&&p?e("div",{key:"om",class:"vxe-upload--image-over-more"},o?(0,_vn.getSlotVNs)(o({options:r})):[e(_button.default,{props:{mode:"text",content:l?_xeUtils.default.isFunction(l)?l({$upload:t,options:r}):_xeUtils.default.toFormatString(l,[r.length]):(0,_ui.getI18n)(c&&f?"vxe.upload.moreImgBtnText":"vxe.upload.moreBtnText",[r.length]),status:"primary"},on:{click:t.handleMoreEvent}})]):(0,_ui.renderEmptyElement)(t),t.renderImageAction(e,!1)])):e("div",{class:"vxe-upload--image-list"},t.renderImageItemList(e,d,!1).concat([s&&p?e("div",{class:"vxe-upload--image-over-more"},o?(0,_vn.getSlotVNs)(o({options:r})):[e(_button.default,{props:{mode:"text",content:l?_xeUtils.default.isFunction(l)?l({$upload:t,options:r}):_xeUtils.default.toFormatString(l,[r.length]):(0,_ui.getI18n)(c&&f?"vxe.upload.moreImgBtnText":"vxe.upload.moreBtnText",[r.length]),status:"primary"},on:{click:t.handleMoreEvent}})]):(0,_ui.renderEmptyElement)(t),t.renderImageAction(e,!1)]))]:[e("div",{class:"vxe-upload--image-list"},[t.renderImageAction(e,!1)])])},renderVN:function(e){var t=this,o=t.reactData,i=t.showErrorStatus,n=t.pasteToUpload,a=t.dragSort,r=t.dragPlaceholder,l=o.isDragUploadStatus,u=o.showMorePopup,s=o.isActivated,d=t.computeSize,p=t.computeIsDisabled,c=t.computeFormReadonly,f=t.computeIsImage,g={};return t.dragToUpload&&-1===o.dragIndex&&(g.dragover=t.handleUploadDragoverEvent,g.dragleave=t.handleUploadDragleaveEvent,g.drop=t.handleUploadDropEvent),e("div",{ref:"refElem",class:["vxe-upload",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(d),d),"is--active",s),"is--readonly",c),"is--disabled",p),"is--paste",n),"show--error",i),"is--drag",l)],on:g},[f?t.renderImageMode(e):t.rendeFileMode(e),a?e("div",{ref:"refDragLineElem",class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(t),l&&!u?e("div",{class:"vxe-upload--drag-placeholder"},r||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(t)])}},created:function(){this.internalData=createInternalData(),this.updateFileList()},mounted:function(){var e=this,t=e;t.multiple&&t.singleMode&&errLog("vxe.error.errConflicts",["multiple","single-mode"]),t.imageStyle&&warnLog("vxe.error.delProp",["image-style","image-config"]),t.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(e,"paste",e.handleGlobalPasteEvent),_ui.globalEvents.on(e,"click",e.handleGlobalClickEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent)},beforeDestroy:function(){var e=this,t=e.reactData,o=e.internalData;t.isDragUploadStatus=!1,_ui.globalEvents.off(e,"paste"),_ui.globalEvents.off(e,"click"),_ui.globalEvents.off(e,"blur"),_xeUtils.default.assign(t,createReactData()),_xeUtils.default.assign(o,createInternalData())},render:function(e){return this.renderVN(e)}});
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_dom=require("../../ui/src/dom"),_util=require("./util"),_button=_interopRequireDefault(require("../../button/src/button"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,o){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0===o)return("string"===t?String:Number)(e);o=o.call(e,t||"default");if("object"!=_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}var _createComponentLog=(0,_log.createComponentLog)("upload"),warnLog=_createComponentLog.warnLog,errLog=_createComponentLog.errLog;function getUniqueKey(){return _xeUtils.default.uniqueId()}function handleTransferFiles(e){var t=[];return _xeUtils.default.arrayEach(e,function(e){e=e.getAsFile();e&&t.push(e)}),t}function showDropTip(e,t,o,i){var n=e.xID,a=e.reactData.showMorePopup,r=e.$refs.refElem,l=document.getElementById("refPopupElem".concat(n)),l=a?l:r;l&&(r=l.getBoundingClientRect(),l=e.$refs.refDragLineElem,e=document.getElementById("refModalDragLineElem".concat(n)),n=a?e:l)&&(a=o.getBoundingClientRect(),n.style.display="block",n.style.top="".concat(Math.max(1,a.y-r.y),"px"),n.style.left="".concat(Math.max(1,a.x-r.x),"px"),n.style.height="".concat(a.height,"px"),n.style.width="".concat(a.width-1,"px"),n.setAttribute("drag-pos",i))}function hideDropTip(e){var t=e.xID,e=e.$refs.refDragLineElem,t=document.getElementById("refModalDragLineElem".concat(t));e&&(e.style.display=""),t&&(t.style.display="")}var handleClearFile=function(o,i){var e=o.reactData.fileList,n=o.computeUrlProp,a=[];return _xeUtils.default.lastEach(e,function(t,e){a.push(o.removeFileEvent(i,t,e).then(function(e){return{url:t[n],status:e}}))}),Promise.all(a)};function handleRemoveFile(o,i,e){var n=o.reactData.fileList,a=o.computeUrlProp,e=_xeUtils.default.isArray(e)?e:[e],r=[];return e.forEach(function(e){var t;e&&(t=_xeUtils.default.isString(e)?e:e[a],-1<(e=_xeUtils.default.findIndexOf(n,function(e){return e[a]===t})))&&r.push(o.removeFileEvent(i,n[e],e).then(function(e){return{url:t,status:e}}))}),Promise.all(r)}function createReactData(){return{isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}}function createInternalData(){return{moreId:_xeUtils.default.uniqueId("upload"),imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeUpload",model:{prop:"value",event:"modelValue"},mixins:[_ui.globalMixins.sizeMixin],props:{value:[Array,String,Object],showList:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showList}},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},autoSubmit:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.autoSubmit}},mode:{type:String,default:function(){return(0,_ui.getConfig)().upload.mode}},imageTypes:{type:Array,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)}},imageConfig:{type:Object,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)}},imageStyle:{type:Object,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)}},fileTypes:{type:Array,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)}},dragSort:Boolean,dragToUpload:{type:Boolean,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)}},dragPlaceholder:{type:String,default:function(){return(0,_ui.getConfig)().upload.dragPlaceholder}},pasteToUpload:{type:Boolean,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)}},keyField:String,singleMode:Boolean,urlMode:Boolean,urlArgs:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.urlArgs}},multiple:Boolean,limitSize:{type:[String,Number],default:function(){return(0,_ui.getConfig)().upload.limitSize}},showLimitSize:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showLimitSize}},limitSizeText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.limitSizeText}},limitCount:{type:[String,Number],default:function(){return(0,_ui.getConfig)().upload.limitCount}},showLimitCount:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showLimitCount}},limitCountText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.limitCountText}},nameField:{type:String,default:function(){return(0,_ui.getConfig)().upload.nameField}},typeField:{type:String,default:function(){return(0,_ui.getConfig)().upload.typeField}},urlField:{type:String,default:function(){return(0,_ui.getConfig)().upload.urlField}},sizeField:{type:String,default:function(){return(0,_ui.getConfig)().upload.sizeField}},showErrorStatus:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showErrorStatus}},showProgress:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showProgress}},progressText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.progressText}},previewImageConfig:Object,showSubmitButton:Boolean,autoHiddenButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.autoHiddenButton}},showUploadButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showUploadButton}},buttonText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.buttonText}},buttonIcon:{type:String,default:function(){return(0,_ui.getConfig)().upload.buttonIcon}},showButtonText:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showButtonText}},showButtonIcon:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showButtonIcon}},showRemoveButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showRemoveButton}},showDownloadButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showDownloadButton}},showPreview:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showPreview}},showTip:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showTip}},maxSimultaneousUploads:{type:Number,default:function(){return(0,_ui.getConfig)().upload.maxSimultaneousUploads}},tipText:[String,Number,Function],hintText:String,previewMethod:Function,beforeSelectMethod:Function,uploadMethod:Function,beforeRemoveMethod:Function,removeMethod:Function,beforeDownloadMethod:Function,downloadMethod:Function,getUrlMethod:Function,getThumbnailUrlMethod:Function,size:{type:String,default:function(){return(0,_ui.getConfig)().upload.size||(0,_ui.getConfig)().size}}},inject:{$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null},$xeTable:{default:null}},data:function(){var e=_xeUtils.default.uniqueId(),t=createReactData();return Object.assign(Object.assign({},{}),{xID:e,reactData:t})},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeKeyField:function(){return this.keyField||"_X_KEY"},computeIsImage:function(){return"image"===this.mode},computeNameProp:function(){return this.nameField||"name"},computeTypeProp:function(){return this.typeField||"type"},computeUrlProp:function(){return this.urlField||"url"},computeSizeProp:function(){return this.sizeField||"size"},computeLimitMaxSize:function(){return 1024*_xeUtils.default.toNumber(this.limitSize)*1024},computeLimitMaxCount:function(){return this.multiple?_xeUtils.default.toNumber(this.limitCount):1},computePreviewImageOpts:function(){var e=this.showDownloadButton;return Object.assign({showDownloadButton:e},(0,_ui.getConfig)().upload.previewImageConfig,this.previewImageConfig)},computeOverCount:function(){var e=this.reactData,t=this.multiple,e=e.fileList,o=this.computeLimitMaxCount;return t?!o||e.length>=o:1<=e.length},computeLimitSizeUnit:function(){var e=_xeUtils.default.toNumber(this.limitSize);return e?1048576<e?"".concat(e/1048576,"T"):1024<e?"".concat(e/1024,"G"):"".concat(e,"M"):""},computedShowTipText:function(){var e=this.showTip,t=this.tipText;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t},computedDefTipText:function(){var e=this,t=e.limitSize,o=e.fileTypes,i=e.multiple,n=e.limitCount,e=e.tipText||e.hintText,a=this.computeIsImage,r=this.computeLimitSizeUnit;return _xeUtils.default.isString(e)?e:_xeUtils.default.isFunction(e)?"".concat(e({})):(e=[],a?(i&&n&&e.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[n])),t&&r&&e.push((0,_ui.getI18n)("vxe.upload.imgSizeHint",[r]))):(o&&o.length&&e.push((0,_ui.getI18n)("vxe.upload.fileTypeHint",[o.join("/")])),t&&r&&e.push((0,_ui.getI18n)("vxe.upload.fileSizeHint",[r])),i&&n&&e.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[n]))),e.join((0,_ui.getI18n)("vxe.base.comma")))},computeImageOpts:function(){return Object.assign({},this.imageConfig||this.imageStyle)},computeImgStyle:function(){var e=this.computeImageOpts,t=e.width,e=e.height,o={};return t&&(o.width=(0,_dom.toCssUnit)(t)),e&&(o.height=(0,_dom.toCssUnit)(e)),o},computeMoreOpts:function(){return Object.assign({showMoreButton:!0},this.moreConfig)}}),watch:{value:function(){this.updateFileList()}},methods:{dispatchEvent:function(e,t,o){this.$emit(e,(0,_ui.createEvent)(o,{$upload:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},choose:function(){return this.handleChoose(null)},clear:function(){return handleClearFile(this,null)},clearByEvent:function(e){return handleClearFile(this,e)},getPendingFiles:function(){var t=this,e=t.reactData,o=e.fileList,i=e.fileCacheMaps,n=[];return o.forEach(function(e){e=t.getFieldKey(e),e=i[e];e&&"pending"===e.status&&n.push(e.file)}),n},submit:function(i){var n=this,e=n.reactData,t=n.maxSimultaneousUploads,t=_xeUtils.default.toNumber(t||1)||1,o=e.fileList,a=e.fileCacheMaps,r=o.filter(function(e){e=n.getFieldKey(e),e=a[e];return e&&("pending"===e.status||i&&"error"===e.status)}),l=function(e){var t=n.getFieldKey(e),t=a[t];if(t){var o=t.file;if(o&&("pending"===t.status||i&&"error"===t.status))return t.loading=!0,t.percent=0,n.handleUploadResult(e,o).then(u)}return u()},u=function(){var e;return r.length?(e=r[0],r.splice(0,1),l(e).then(u)):Promise.resolve()};return Promise.all(r.splice(0,t).map(l)).then(function(){})},getMoreVisible:function(){return this.reactData.showMorePopup},openMore:function(){return this.handleMoreEvent({$event:new Event("click")}),this.$nextTick()},openMoreByEvent:function(e){return this.handleMoreEvent({$event:e}),this.$nextTick()},closeMore:function(){var e=this.internalData;return _ui.VxeUI.modal&&_ui.VxeUI.modal.close(e.moreId),this.$nextTick()},remove:function(e){return handleRemoveFile(this,null,e)},removeByEvent:function(e,t){return handleRemoveFile(this,e,t)},getFieldKey:function(e){return e[this.computeKeyField]},updateFileList:function(){var n=this,e=n.reactData,t=n.value,o=n.multiple,i=n.computeFormReadonly,a=n.computeKeyField,r=n.computeNameProp,l=n.computeTypeProp,u=n.computeUrlProp,s=n.computeSizeProp,t=t?(t?_xeUtils.default.isArray(t)?t:[t]:[]).map(function(e){var t,o,i;return!e||_xeUtils.default.isString(e)?(t="".concat(e||""),i=((o=_xeUtils.default.parseUrl(e))?o.searchQuery[r]:"")||n.parseFileName(t),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},r,i),l,(o?o.searchQuery[l]:"")||n.parseFileType(i)),u,t),s,_xeUtils.default.toNumber(o?o.searchQuery[s]:0)||0),a,getUniqueKey())):(i=e[r]||"",e[r]=i,e[l]=e[l]||n.parseFileType(i),e[u]=e[u]||"",e[s]=e[s]||0,e[a]=e[a]||getUniqueKey(),e)}):[];e.fileList=i||o?t:t.slice(0,1)},parseFileName:function(e){return decodeURIComponent("".concat(e||"")).split("/").pop()||""},parseFileType:function(e){var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},handleChangeEvent:function(e,t){var o=this,i=o.singleMode,n=o.urlMode,a=o.urlArgs,r=o.computeUrlProp,l=o.computeNameProp,t=t?t.slice(0):[],n=(n&&(t=t.map(function(e){var t=e[r];if(t&&a){var o=_xeUtils.default.parseUrl(t);if(!o.searchQuery[l]&&-1===t.indexOf("blob:"))return"".concat(t).concat(-1===t.indexOf("?")?"?":"&").concat(encodeURIComponent(e[l]||""))}return t})),i?t[0]||null:t);return o.emitModel(n),o.dispatchEvent("change",{value:n},e),n},getThumbnailFileUrl:function(e){var t=this.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod;return t?t({$upload:this,option:e}):this.getFileUrl(e)},getFileUrl:function(e){var t=this.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=this.computeUrlProp;return t?t({$upload:this,option:e}):e[o]},handleDefaultFilePreview:function(t){var e=this,o=e.internalData,i=e.imageTypes,n=e.computeTypeProp,a=e.computePreviewImageOpts,r=e.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;o.imagePreviewTypes.concat(i||[]).some(function(e){return"".concat(e).toLowerCase()==="".concat(t[n]).toLowerCase()})&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage(Object.assign(Object.assign({},a),{urlList:[e.getFileUrl(t)],beforeDownloadMethod:r?function(){return r({$upload:e,option:t})}:void 0}))},handlePreviewFileEvent:function(e,t){var o=this.previewMethod||(0,_ui.getConfig)().upload.previewMethod;this.showPreview&&(o?o({$upload:this,option:t}):this.handleDefaultFilePreview(t))},handlePreviewImageEvent:function(e,t,o){var i=this,n=i,a=i.reactData.fileList,r=i.computePreviewImageOpts,l=n.previewMethod||(0,_ui.getConfig)().upload.previewMethod,u=n.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;n.showPreview&&(l?l({$upload:i,option:t}):_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage(Object.assign(Object.assign({},r),{urlList:a.map(function(e){return i.getFileUrl(e)}),activeIndex:o,beforeDownloadMethod:u?function(e){e=e.index;return u({$upload:i,option:a[e]})}:void 0})))},handleUploadResult:function(i,e){var n=this,t=n,a=n.reactData,r=t.showErrorStatus,l=n.getFieldKey(i),t=t.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?(n.dispatchEvent("upload-start",{option:i},null),Promise.resolve(t({$upload:n,file:e,option:i,updateProgress:function(e){var t=a.fileCacheMaps[n.getFieldKey(i)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(function(e){var t=a.fileCacheMaps[l];t&&(t.percent=100,t.status="success",t.response=e),_xeUtils.default.each(e,function(e,t){n.$set(i,t,e)}),n.dispatchEvent("upload-success",{option:i,data:e},null)}).catch(function(e){var t=a.fileCacheMaps,o=t[l];o&&(o.status="error",o.response=e),r?_xeUtils.default.each(e,function(e,t){n.$set(i,t,e)}):(a.fileList=a.fileList.filter(function(e){return n.getFieldKey(e)!==l}),delete t[l]),n.dispatchEvent("upload-error",{option:i,data:e},null)}).finally(function(){var e=a.fileCacheMaps[l],e=(e&&(e.loading=!1),{option:i,status:e?e.status:null,response:e?e.response:null});n.dispatchEvent("upload-end",{option:i,result:e},null)})):((t=a.fileCacheMaps[l])&&(t.loading=!1),Promise.resolve())},handleReUploadEvent:function(e,t){var o=this,i=o.reactData,n=o.uploadMethod,a=o.urlMode,r=i.fileCacheMaps[o.getFieldKey(t)];(n||(0,_ui.getConfig)().upload.uploadMethod)&&r&&(n=r.file,r.loading=!0,r.status="pending",r.percent=0,o.handleUploadResult(t,n).then(function(){a&&o.handleChangeEvent(e,i.fileList)}))},handleUploadFile:function(e,n){var a=this,t=a,r=a.reactData,l=a.$xeForm,u=a.formItemInfo,o=t.multiple,i=t.showLimitSize,s=t.limitSizeText,d=t.showLimitCount,p=t.limitCountText,c=t.autoSubmit,f=r.fileList,g=t.beforeSelectMethod||(0,_ui.getConfig)().upload.beforeSelectMethod,m=t.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,v=a.computeKeyField,h=a.computeNameProp,_=a.computeTypeProp,x=a.computeUrlProp,y=a.computeSizeProp,E=a.computeLimitMaxSize,I=a.computeLimitMaxCount,D=a.computeLimitSizeUnit,w=e;if(o&&I){if(d&&f.length>=I)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:p?"".concat(_xeUtils.default.isFunction(p)?p({maxCount:I}):p):(0,_ui.getI18n)("vxe.upload.overCountErr",[I])}));var U,b=w.length-(I-f.length);d&&0<b&&(U=w.slice(I-f.length),p?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:"".concat(_xeUtils.default.isFunction(p)?p({maxCount:I}):p)}):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",slots:{default:function(e,o){return o("div",{class:"vxe-upload--file-message-over-error"},[o("div",{},(0,_ui.getI18n)("vxe.upload.overCountExtraErr",[I,b])),o("div",{class:"vxe-upload--file-message-over-extra"},U.map(function(e,t){return o("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)}))])}}})),w=w.slice(0,I-f.length)}if(i&&E)for(var C=0;C<e.length;C++)if(e[0].size>E)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:s?"".concat(_xeUtils.default.isFunction(s)?s({maxSize:E}):s):(0,_ui.getI18n)("vxe.upload.overSizeErr",[D])}));a.dispatchEvent("upload-queue-start",{files:w},n);var F=Object.assign({},r.fileCacheMaps),S=o?f:[],T=[],M=[];w.forEach(function(e){var t=e.name,o=getUniqueKey(),t=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},h,t),_,a.parseFileType(t)),y,e.size),x,URL.createObjectURL(e)),v,o),o=(m&&(F[o]={file:e,loading:!!c,status:"pending",percent:0,response:null}),t);g&&!g({$upload:a,file:e})||(m&&c&&M.push(a.handleUploadResult(o,e)),T.push(o),S.push(o))}),r.fileList=S,r.fileCacheMaps=F,S.forEach(function(e){a.dispatchEvent("add",{option:e},n)}),Promise.all(M).then(function(){var o=r.fileCacheMaps,e=r.fileList,t=T.map(function(e){var t=a.getFieldKey(e),t=o[t];return{option:e,status:t?t.status:null,response:t?t.response:null}}),i=a.handleChangeEvent(n,e);a.dispatchEvent("upload-queue-end",{value:i,options:e,results:t,files:w},n),l&&u&&l.triggerItemEvent(n,u.itemConfig.field,i)})},handleChoose:function(t){var o=this,e=o.multiple,i=o.imageTypes,n=o.fileTypes,a=o.computeIsDisabled,r=o.computeIsImage;return a?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:r?i:n}).then(function(e){return o.handleUploadFile(e.files,t),e})},clickEvent:function(e){this.handleChoose(e).catch(function(){})},handleRemoveEvent:function(e,t,o){var i=this,n=i.reactData,a=i.$xeForm,r=i.formItemInfo,n=n.fileList;n.splice(o,1),i.handleChangeEvent(e,n),a&&r&&a.triggerItemEvent(e||{type:"remove"},r.itemConfig.field,n),e&&i.dispatchEvent("remove",{option:t},e)},removeFileEvent:function(t,o,i){var n=this,e=n,a=e.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod,r=e.removeMethod||(0,_ui.getConfig)().upload.removeMethod;return Promise.resolve(!a||a({$upload:n,option:o})).then(function(e){return e?r?Promise.resolve(r({$upload:n,option:o})).then(function(){n.handleRemoveEvent(t,o,i)}).catch(function(e){return e}):n.handleRemoveEvent(t,o,i):n.dispatchEvent("remove-fail",{option:o},t),e})},handleDownloadEvent:function(e,t){this.dispatchEvent("download",{option:t},e)},downloadFileEvent:function(t,o){var i=this,e=i,n=e.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod,a=e.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!n||n({$upload:i,option:o})).then(function(e){e?a?Promise.resolve(a({$upload:i,option:o})).then(function(){i.handleDownloadEvent(t,o)}).catch(function(e){return e}):i.handleDownloadEvent(t,o):i.dispatchEvent("download-fail",{option:o},t)})},handleUploadDragleaveEvent:function(e){var t,o,i=this.reactData,n=e.currentTarget,a=e.clientX,e=e.clientY;n&&(t=(n=n.getBoundingClientRect()).x,o=n.y,a<t||t+n.width<a||e<o||o+n.height<e)&&(i.isDragUploadStatus=!1)},handleUploadDragoverEvent:function(e){var t=this.reactData,o=e.dataTransfer;o&&(o=o.items)&&o.length&&(e.preventDefault(),t.isDragUploadStatus=!0)},uploadTransferFileEvent:function(e,t){var o=this,i=o.internalData,n=o.imageTypes,a=o.fileTypes,i=i.imagePreviewTypes;if(o.computeIsImage){var r=i.concat(n&&n.length?n:[]);t=t.filter(function(e){var t="".concat(e.type.split("/")[1]||"").toLowerCase();return!!r.some(function(e){return"".concat(e).toLowerCase()===t})})}else if(a&&a.length){var l=[];if(t.forEach(function(e){var t=o.parseFileType(e.name);a.some(function(e){return"".concat(e).toLowerCase()===t})||l.push(t)}),l.length)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.error.notType",[l.join(", ")]),status:"error"}))}t.length?o.handleUploadFile(t,e):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.uploadTypeErr")})},handleUploadDropEvent:function(e){var t=this.reactData,o=e.dataTransfer;o&&(o=o.items)&&o.length&&(e.preventDefault(),(o=handleTransferFiles(o)).length)&&this.uploadTransferFileEvent(e,o),t.isDragUploadStatus=!1},handleMoreEvent:function(e){var g=this,m=g,v=g.$scopedSlots,h=g.reactData,_=g.xID,x=g.computeFormReadonly,y=g.computeIsImage,e=e.$event;_ui.VxeUI.modal&&(_ui.VxeUI.modal.open({id:g.internalData.moreId,title:x?(0,_ui.getI18n)("vxe.upload.morePopup.readTitle"):(0,_ui.getI18n)("vxe.upload.morePopup.".concat(y?"imageTitle":"fileTitle")),width:660,height:500,escClosable:!0,showMaximize:!0,resize:!0,maskClosable:!0,slots:{default:function(e,t){var o=m.showErrorStatus,i=m.dragToUpload,n=m.dragSort,a=m.dragPlaceholder,r=h.isActivated,l=h.isDragMove,u=h.isDragUploadStatus,s=h.dragIndex,d=h.fileList,p=g.computeIsDisabled,c=v.moreContent||v["more-content"],f={};return i&&-1===s&&(f.dragover=g.handleUploadDragoverEvent,f.dragleave=g.handleUploadDragleaveEvent,f.drop=g.handleUploadDropEvent),t("div",{attrs:{id:"refPopupElem".concat(_)},class:["vxe-upload--more-popup",{"is--readonly":x,"is--disabled":p,"is--active":r,"show--error":o,"is--drag":u}],on:f},c?(0,_vn.getSlotVNs)(c({options:d})):[y?n?t("transition-group",{props:{name:"vxe-upload--drag-list".concat(l?"":"-disabled"),tag:"div"},class:"vxe-upload--image-more-list"},g.renderImageItemList(t,d,!0).concat(g.renderImageAction(t,!0))):t("div",{class:"vxe-upload--image-more-list"},g.renderImageItemList(t,d,!0).concat(g.renderImageAction(t,!0))):t("div",{class:"vxe-upload--file-more-list"},[g.renderFileAction(t,!0),n?t("transition-group",{props:{name:"vxe-upload--drag-list".concat(l?"":"-disabled"),tag:"div"},class:"vxe-upload--file-list"},g.renderFileItemList(t,d,!0)):t("div",{class:"vxe-upload--file-list"},g.renderFileItemList(t,d,!0))]),n?t("div",{attrs:{id:"refModalDragLineElem".concat(_)},class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(g),u?t("div",{class:"vxe-upload--drag-placeholder"},a||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(g)])}},events:{show:function(){h.showMorePopup=!0},hide:function(e){e=e.$event;h.showMorePopup=!1,e&&g.dispatchEvent("more-visible",{visible:!1},e)}}}),e)&&g.dispatchEvent("more-visible",{visible:!0},e)},handleDragSortDragstartEvent:function(e){var t=this.reactData,o=(e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0),e.currentTarget),e=o.parentElement,e=_xeUtils.default.findIndexOf(Array.from(e.children),function(e){return o===e});t.isDragMove=!0,t.dragIndex=e,setTimeout(function(){t.isDragMove=!1},500)},handleDragSortDragoverEvent:function(e){var t,o,i,n,a=this,r=a.reactData,l=a.internalData,r=(e.stopPropagation(),e.preventDefault(),r.dragIndex);-1!==r&&(t=a.computeIsImage,i=(o=e.currentTarget).parentElement,i=_xeUtils.default.findIndexOf(Array.from(i.children),function(e){return o===e}),n="",n=t?e.clientX-o.getBoundingClientRect().x<o.clientWidth/2?"left":"right":e.clientY-o.getBoundingClientRect().y<o.clientHeight/2?"top":"bottom",r===i?showDropTip(a,e,o,n):(showDropTip(a,e,o,n),l.prevDragIndex=i,l.prevDragPos=n))},handleDragSortDragendEvent:function(e){var t=this.reactData,o=this.internalData,i=t.fileList,n=o.prevDragIndex,o=o.prevDragPos,a=t.dragIndex,r="bottom"===o||"right"===o?1:0,l=i[a],u=i[n];l&&u&&(i.splice(a,1),n=_xeUtils.default.findIndexOf(i,function(e){return u===e})+r,i.splice(n,0,l),this.dispatchEvent("sort-dragend",{oldItem:l,newItem:u,dragPos:o,offsetIndex:r,_index:{newIndex:n,oldIndex:a}},e)),hideDropTip(this),t.dragIndex=-1},handleItemMousedownEvent:function(e){var t=this.$xeTable,o=this.reactData;t&&e.stopPropagation(),o.isActivated=!0},handleGlobalPasteEvent:function(e){var t=this.reactData,o=this.pasteToUpload;t.isActivated&&o&&(t=e.clipboardData||e.originalEvent.clipboardData)&&(o=t.items)&&(t=handleTransferFiles(o)).length&&(e.preventDefault(),this.uploadTransferFileEvent(e,t))},handleGlobalClickEvent:function(e){var t=this.reactData,o=this.$refs.refElem,i=this.$refs.refPopupElem,o=(0,_dom.getEventTargetNode)(e,o).flag;!o&&i&&(i=(i=i.parentElement||i)&&i.parentElement,o=(0,_dom.getEventTargetNode)(e,i).flag),t.isActivated=o},handleGlobalBlurEvent:function(){this.reactData.isActivated=!1},renderFileItemList:function(u,e,s){var d=this,t=d.$scopedSlots,o=d.reactData,p=d.showRemoveButton,c=d.showDownloadButton,f=d.showProgress,g=d.progressText,m=d.showPreview,v=d.showErrorStatus,h=d.dragSort,_=d.autoSubmit,x=d.showSubmitButton,y=o.fileList,E=o.fileCacheMaps,I=d.computeIsDisabled,D=d.computeFormReadonly,w=d.computeNameProp,U=d.computeTypeProp,b=t.option,C=t.action,F=t.corner,S=t.name,T={};return h&&1<e.length&&(T.dragstart=d.handleDragSortDragstartEvent,T.dragover=d.handleDragSortDragoverEvent,T.dragend=d.handleDragSortDragendEvent),e.map(function(t,o){var e=d.getFieldKey(t),i=E[e],n=!1,a=!1,r=!1,l="".concat(t[w]||"");return i&&(n=i.loading,a="error"===i.status,r="pending"===i.status),u("div",{key:h?e:o,class:["vxe-upload--file-item",{"is--preview":m,"is--loading":n,"is--pending":r,"is--error":a}],attrs:{fileid:e,draggable:!!h||null},on:T},b?(0,_vn.getSlotVNs)(b({option:t,isMoreView:s,options:y})):[u("div",{class:"vxe-upload--file-item-icon"},[u("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_".concat("".concat(t[U]).toLocaleUpperCase())]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),u("div",{class:"vxe-upload--file-item-name",attrs:{title:l},on:{click:function(e){n||a||d.handlePreviewFileEvent(e,t)}}},S?(0,_vn.getSlotVNs)(S({option:t,isMoreView:s,options:y})):l),n?u("div",{class:"vxe-upload--file-item-loading-icon"},[u("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(d),f&&n&&i?u("div",{class:"vxe-upload--file-item-loading-text"},g?_xeUtils.default.toFormatString("".concat(_xeUtils.default.isFunction(g)?g({}):g),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(d),!n&&(a&&v||r&&x&&!_)?u("div",{class:"vxe-upload--file-item-rebtn"},[u(_button.default,{props:{icon:a?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:a?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload")},on:{click:function(e){d.handleReUploadEvent(e,t)}}})]):(0,_ui.renderEmptyElement)(d),u("div",{class:"vxe-upload--file-item-btn-wrapper"},C?(0,_vn.getSlotVNs)(C({option:t,isMoreView:s,options:y,readonly:D})):[F?u("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(F({option:t,isMoreView:s,options:y,readonly:D}))):(0,_ui.renderEmptyElement)(d),c&&!n?u("div",{class:"vxe-upload--file-item-download-btn",on:{click:function(e){d.downloadFileEvent(e,t)}}},[u("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]):(0,_ui.renderEmptyElement)(d),!p||D||I||n?(0,_ui.renderEmptyElement)(d):u("div",{class:"vxe-upload--file-item-remove-btn",on:{click:function(e){d.removeFileEvent(e,t,o)}}},[u("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},renderFileAction:function(e,t){var o=this,i=o.$scopedSlots,n=o.showUploadButton,a=o.buttonText,r=o.buttonIcon,l=o.showButtonText,u=o.showButtonIcon,s=o.autoHiddenButton,d=o.reactData.fileList,p=o.computeIsDisabled,c=o.computedShowTipText,f=o.computedDefTipText,g=o.computeOverCount,m=i.default,i=i.tip||i.hint;return o.computeFormReadonly||!n?(0,_ui.renderEmptyElement)(o):e("div",{class:"vxe-upload--file-action"},[s&&g?(0,_ui.renderEmptyElement)(o):e("div",{class:"vxe-upload--file-action-btn",on:{click:o.clickEvent}},m?(0,_vn.getSlotVNs)(m({isMoreView:t,options:d,$upload:o})):[e(_button.default,{class:"vxe-upload--file-action-button",props:{content:t||l?a?"".concat(_xeUtils.default.isFunction(a)?a({}):a):(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:u?r||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:p}})]),c&&(f||i)?e("div",{class:"vxe-upload--file-action-tip"},i?(0,_vn.getSlotVNs)(i({isMoreView:t,options:d,$upload:o})):"".concat(f)):(0,_ui.renderEmptyElement)(o)])},rendeFileMode:function(e){var t=this,o=t.$scopedSlots,i=t.reactData,n=t.showList,a=t.moreConfig,r=t.dragSort,l=i.fileList,i=i.isDragMove,u=t.computeMoreOpts,s=u.maxCount,d=u.showMoreButton,p=u.moreButtonText,u="horizontal"===u.layout,o=o.moreButton||o["more-button"],c=l,f=0,g=!1,m=!1;return _xeUtils.default.isNumber(s)&&l.length>s&&(g=!0,m=0===s,f=l.length-s,c=l.slice(0,s)),e("div",{key:"all",class:"vxe-upload--file-wrapper"},n?[d&&a&&u?(0,_ui.renderEmptyElement)(t):t.renderFileAction(e,!0),e("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":u}]},[c.length?r?e("transition-group",{attrs:{name:"vxe-upload--drag-list".concat(i?"":"-disabled"),tag:"div"},class:"vxe-upload--file-list"},t.renderFileItemList(e,c,!1)):e("div",{class:"vxe-upload--file-list"},t.renderFileItemList(e,c,!1)):(0,_ui.renderEmptyElement)(t),d&&f?e("div",{class:"vxe-upload--file-over-more"},o?(0,_vn.getSlotVNs)(o({options:l})):[e(_button.default,{props:{mode:"text",content:p?_xeUtils.default.isFunction(p)?p({$upload:t,options:l}):_xeUtils.default.toFormatString(p,[l.length]):(0,_ui.getI18n)(g&&m?"vxe.upload.moreFileBtnText":"vxe.upload.moreBtnText",[l.length]),status:"primary"},on:{click:t.handleMoreEvent}})]):(0,_ui.renderEmptyElement)(t),d&&a&&u?t.renderFileAction(e,!1):(0,_ui.renderEmptyElement)(t)])]:[t.renderFileAction(e,!1)])},renderImageItemList:function(l,e,u){var s=this,t=s.$scopedSlots,o=s.reactData,d=s.showRemoveButton,p=s.showProgress,c=s.progressText,f=s.showPreview,g=s.showErrorStatus,m=s.dragSort,v=s.autoSubmit,h=s.showSubmitButton,_=o.fileList,x=o.fileCacheMaps,y=s.computeIsDisabled,E=s.computeFormReadonly,I=s.computeImageOpts,D=s.computeImgStyle,w=t.option,U=t.action,b=t.corner,C={};return m&&1<e.length&&(C.dragstart=s.handleDragSortDragstartEvent,C.dragover=s.handleDragSortDragoverEvent,C.dragend=s.handleDragSortDragendEvent),e.map(function(t,o){var e=s.getFieldKey(t),i=x[e],n=!1,a=!1,r=!1;return i&&(n=i.loading,a="error"===i.status,r="pending"===i.status),l("div",{key:m?e:o,class:["vxe-upload--image-item",{"is--preview":f,"is--circle":I.circle,"is--loading":n,"is--pending":r,"is--error":a}],attrs:{fileid:e,draggable:!!m||null},on:C},w?(0,_vn.getSlotVNs)(w({option:t,isMoreView:u,options:_})):[l("div",{class:"vxe-upload--image-item-box",style:u?{}:D,on:{click:function(e){n||a||s.handlePreviewImageEvent(e,t,o)}}},[n&&i?l("div",{class:"vxe-upload--image-item-loading"},[l("div",{class:"vxe-upload--image-item-loading-icon"},[l("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),p?l("div",{class:"vxe-upload--image-item-loading-text"},c?_xeUtils.default.toFormatString("".concat(_xeUtils.default.isFunction(c)?c({}):c),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(s)]):(0,_ui.renderEmptyElement)(s),l("div",{class:"vxe-upload--image-item-img-wrapper",attrs:{title:(0,_ui.getI18n)("vxe.upload.viewItemTitle")}},[l("img",{class:"vxe-upload--image-item-img",attrs:{src:s.getThumbnailFileUrl(t)}})]),!n&&(a&&g||r&&h&&!v)?l("div",{class:"vxe-upload--image-item-rebtn"},[l(_button.default,{props:{icon:a?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:a?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload")},on:{click:function(e){s.handleReUploadEvent(e,t)}}})]):(0,_ui.renderEmptyElement)(s),l("div",{class:"vxe-upload--image-item-btn-wrapper",on:{click:function(e){e.stopPropagation()}}},U?(0,_vn.getSlotVNs)(U({option:t,isMoreView:u,options:_,readonly:E})):[b?l("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(b({option:t,isMoreView:u,options:_,readonly:E}))):(0,_ui.renderEmptyElement)(s),!d||E||y||n?(0,_ui.renderEmptyElement)(s):l("div",{class:"vxe-upload--image-item-remove-btn",on:{click:function(e){e.stopPropagation(),s.removeFileEvent(e,t,o)}}},[l("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},renderImageAction:function(e,t){var o=this,i=o.$scopedSlots,n=o.showUploadButton,a=o.buttonText,r=o.buttonIcon,l=o.showButtonText,u=o.showButtonIcon,s=o.reactData.fileList,d=o.computedShowTipText,p=o.computedDefTipText,c=o.computeImgStyle,f=i.default,i=i.tip||i.hint;return o.computeFormReadonly||!n||o.autoHiddenButton&&o.computeOverCount?(0,_ui.renderEmptyElement)(o):e("div",{key:"action",class:"vxe-upload--image-action"},[e("div",{class:"vxe-upload--image-action-btn",on:{click:o.clickEvent}},f?f({isMoreView:t,options:s,$upload:o}):[e("div",{class:"vxe-upload--image-action-box",style:t?{}:c},[u?e("div",{class:"vxe-upload--image-action-icon"},[e("i",{class:r||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_ui.renderEmptyElement)(o),t||l?e("div",{class:"vxe-upload--image-action-content"},a?"".concat(_xeUtils.default.isFunction(a)?a({}):a):(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_ui.renderEmptyElement)(o),d&&(p||i)?e("div",{class:"vxe-upload--image-action-hint"},i?(0,_vn.getSlotVNs)(i({isMoreView:t,options:s,$upload:o})):"".concat(p)):(0,_ui.renderEmptyElement)(o)])])])},renderImageMode:function(e){var t=this,o=t.$scopedSlots,i=t.reactData,n=t.showList,a=t.dragSort,r=i.fileList,i=i.isDragMove,l=t.computeMoreOpts,o=o.moreButton||o["more-button"],u=l.maxCount,s=l.showMoreButton,l=l.moreButtonText,d=r,p=0,c=!1,f=!1;return _xeUtils.default.isNumber(u)&&r.length>u&&(c=!0,f=0===u,p=r.length-u,d=r.slice(0,u)),e("div",{key:"image",class:"vxe-upload--image-wrapper"},n?[a?e("transition-group",{attrs:{name:"vxe-upload--drag-list".concat(i?"":"-disabled"),tag:"div"},class:"vxe-upload--image-list"},t.renderImageItemList(e,d,!1).concat([s&&p?e("div",{key:"om",class:"vxe-upload--image-over-more"},o?(0,_vn.getSlotVNs)(o({options:r})):[e(_button.default,{props:{mode:"text",content:l?_xeUtils.default.isFunction(l)?l({$upload:t,options:r}):_xeUtils.default.toFormatString(l,[r.length]):(0,_ui.getI18n)(c&&f?"vxe.upload.moreImgBtnText":"vxe.upload.moreBtnText",[r.length]),status:"primary"},on:{click:t.handleMoreEvent}})]):(0,_ui.renderEmptyElement)(t),t.renderImageAction(e,!1)])):e("div",{class:"vxe-upload--image-list"},t.renderImageItemList(e,d,!1).concat([s&&p?e("div",{class:"vxe-upload--image-over-more"},o?(0,_vn.getSlotVNs)(o({options:r})):[e(_button.default,{props:{mode:"text",content:l?_xeUtils.default.isFunction(l)?l({$upload:t,options:r}):_xeUtils.default.toFormatString(l,[r.length]):(0,_ui.getI18n)(c&&f?"vxe.upload.moreImgBtnText":"vxe.upload.moreBtnText",[r.length]),status:"primary"},on:{click:t.handleMoreEvent}})]):(0,_ui.renderEmptyElement)(t),t.renderImageAction(e,!1)]))]:[e("div",{class:"vxe-upload--image-list"},[t.renderImageAction(e,!1)])])},renderVN:function(e){var t=this,o=t.reactData,i=t.showErrorStatus,n=t.pasteToUpload,a=t.dragSort,r=t.dragPlaceholder,l=o.isDragUploadStatus,u=o.showMorePopup,s=o.isActivated,d=t.computeSize,p=t.computeIsDisabled,c=t.computeFormReadonly,f=t.computeIsImage,g={};return t.dragToUpload&&-1===o.dragIndex&&(g.dragover=t.handleUploadDragoverEvent,g.dragleave=t.handleUploadDragleaveEvent,g.drop=t.handleUploadDropEvent),e("div",{ref:"refElem",class:["vxe-upload",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(d),d),"is--active",s),"is--readonly",c),"is--disabled",p),"is--paste",n),"show--error",i),"is--drag",l)],on:g},[f?t.renderImageMode(e):t.rendeFileMode(e),a?e("div",{ref:"refDragLineElem",class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(t),l&&!u?e("div",{class:"vxe-upload--drag-placeholder"},r||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(t)])}},created:function(){this.internalData=createInternalData(),this.updateFileList()},mounted:function(){var e=this,t=e;t.multiple&&t.singleMode&&errLog("vxe.error.errConflicts",["multiple","single-mode"]),t.imageStyle&&warnLog("vxe.error.delProp",["image-style","image-config"]),t.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(e,"paste",e.handleGlobalPasteEvent),_ui.globalEvents.on(e,"click",e.handleGlobalClickEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent)},beforeDestroy:function(){var e=this,t=e.reactData,o=e.internalData;t.isDragUploadStatus=!1,_ui.globalEvents.off(e,"paste"),_ui.globalEvents.off(e,"click"),_ui.globalEvents.off(e,"blur"),_xeUtils.default.assign(t,createReactData()),_xeUtils.default.assign(o,createInternalData())},render:function(e){return this.renderVN(e)}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-pc-ui",
3
- "version": "3.16.1",
3
+ "version": "3.16.3",
4
4
  "description": "A vue based PC component library",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -843,6 +843,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
843
843
  const reactData = $xeCascader.reactData
844
844
  const internalData = $xeCascader.internalData
845
845
 
846
+ const { currentNode } = reactData
846
847
  const { afterTreeList } = internalData
847
848
  const selectVals = $xeCascader.computeSelectVals
848
849
  const childrenField = $xeCascader.computeChildrenField
@@ -851,8 +852,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
851
852
  const { transform } = treeOpts
852
853
  const stItems: string[] = []
853
854
  const expandedMaps: Record<string, boolean> = {}
854
- if (selectVals.length) {
855
- const lastVal = enNodeValue(XEUtils.last(selectVals))
855
+ const lastVal = currentNode ? $xeCascader.getNodeId(currentNode) : enNodeValue(XEUtils.last(selectVals))
856
+ if (lastVal) {
856
857
  const stRest = XEUtils.findTree(afterTreeList, (item) => lastVal === $xeCascader.getNodeId(item), { children: transform ? mapChildrenField : childrenField })
857
858
  if (stRest) {
858
859
  const { nodes } = stRest
@@ -863,8 +864,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
863
864
  })
864
865
  }
865
866
  }
866
- internalData.treeExpandedMaps = expandedMaps
867
867
  reactData.currentItems = stItems
868
+ internalData.treeExpandedMaps = expandedMaps
868
869
  },
869
870
  updateZindex () {
870
871
  const $xeCascader = this
@@ -2027,13 +2028,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
2027
2028
  watch: {
2028
2029
  value () {
2029
2030
  const $xeCascader = this
2030
- const reactData = $xeCascader.reactData
2031
2031
 
2032
- if (!reactData.visiblePanel) {
2033
- $xeCascader.updateModelChecked()
2034
- $xeCascader.handleCurrentItems()
2035
- $xeCascader.updateCurrentChunk()
2036
- }
2032
+ $xeCascader.updateModelChecked()
2033
+ $xeCascader.handleCurrentItems()
2034
+ $xeCascader.updateCurrentChunk()
2037
2035
  },
2038
2036
  options () {
2039
2037
  const $xeCascader = this
@@ -2156,16 +2156,18 @@ export default /* define-vxe-component start */ defineVxeComponent({
2156
2156
  const { loadMethod } = props
2157
2157
  const { checkStrictly } = checkboxOpts
2158
2158
  return new Promise<void>(resolve => {
2159
+ const { nodeMaps } = internalData
2160
+ const nodeid = $xeTree.getNodeId(node)
2161
+ const nodeItem = nodeMaps[nodeid]
2159
2162
  if (loadMethod) {
2160
- const { nodeMaps } = internalData
2161
- const nodeid = $xeTree.getNodeId(node)
2162
- const nodeItem = nodeMaps[nodeid]
2163
2163
  internalData.treeExpandLazyLoadedMaps[nodeid] = true
2164
2164
  Promise.resolve(
2165
2165
  loadMethod({ $tree: $xeTree, node })
2166
2166
  ).then((childRecords: any) => {
2167
2167
  const { treeExpandLazyLoadedMaps } = internalData
2168
- nodeItem.treeLoaded = true
2168
+ if (nodeItem) {
2169
+ nodeItem.treeLoaded = true
2170
+ }
2169
2171
  if (treeExpandLazyLoadedMaps[nodeid]) {
2170
2172
  treeExpandLazyLoadedMaps[nodeid] = false
2171
2173
  }
@@ -2191,7 +2193,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
2191
2193
  }
2192
2194
  }).catch((e) => {
2193
2195
  const { treeExpandLazyLoadedMaps } = internalData
2194
- nodeItem.treeLoaded = false
2196
+ if (nodeItem) {
2197
+ nodeItem.treeLoaded = false
2198
+ }
2195
2199
  if (treeExpandLazyLoadedMaps[nodeid]) {
2196
2200
  treeExpandLazyLoadedMaps[nodeid] = false
2197
2201
  }
@@ -2202,6 +2206,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
2202
2206
  return $xeTree.recalculate()
2203
2207
  })
2204
2208
  } else {
2209
+ if (nodeItem) {
2210
+ nodeItem.treeLoaded = true
2211
+ }
2205
2212
  resolve()
2206
2213
  }
2207
2214
  })
@@ -3847,7 +3854,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
3847
3854
  const props = $xeTree
3848
3855
  const internalData = $xeTree.internalData
3849
3856
 
3850
- const { transform, drag, menuConfig, showOverflow } = props
3857
+ const { transform, drag, menuConfig, showOverflow, lazy, loadMethod } = props
3851
3858
  const dragOpts = $xeTree.computeDragOpts
3852
3859
  if (!showOverflow) {
3853
3860
  errLog('vxe.error.errProp', ['show-overflow=false', 'show-overflow=true'])
@@ -3858,6 +3865,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
3858
3865
  if (dragOpts.isCrossTreeDrag && !dragOpts.isCrossDrag) {
3859
3866
  errLog('vxe.error.reqSupportProp', ['drag-config.isCrossTreeDrag', 'drag-config.isCrossDrag'])
3860
3867
  }
3868
+ if (lazy && !loadMethod) {
3869
+ warnLog('vxe.error.reqSupportProp', ['lazy', 'load-method'])
3870
+ }
3861
3871
  // if (valueField) {
3862
3872
  // errLog('vxe.error.delProp', ['value-field', 'value-field'])
3863
3873
  // }
@@ -1049,7 +1049,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
1049
1049
  $xeUpload.dispatchEvent('upload-queue-start', { files: selectFiles }, evnt)
1050
1050
 
1051
1051
  const cacheMaps = Object.assign({}, reactData.fileCacheMaps)
1052
- const newFileList = multiple ? fileList : []
1052
+ const uploadFileList = multiple ? fileList : []
1053
+ const newFileList: VxeUploadDefines.FileObjItem[] = []
1053
1054
  const uploadPromiseRests: any[] = []
1054
1055
  selectFiles.forEach(file => {
1055
1056
  const { name } = file
@@ -1078,11 +1079,12 @@ export default /* define-vxe-component start */ defineVxeComponent({
1078
1079
  )
1079
1080
  }
1080
1081
  newFileList.push(item)
1082
+ uploadFileList.push(item)
1081
1083
  }
1082
1084
  })
1083
- reactData.fileList = newFileList
1085
+ reactData.fileList = uploadFileList
1084
1086
  reactData.fileCacheMaps = cacheMaps
1085
- newFileList.forEach(item => {
1087
+ uploadFileList.forEach(item => {
1086
1088
  $xeUpload.dispatchEvent('add', { option: item }, evnt)
1087
1089
  })
1088
1090
  Promise.all(uploadPromiseRests).then(() => {
package/types/all.d.ts CHANGED
@@ -120,7 +120,7 @@ declare global {
120
120
 
121
121
  export function install (app: VueConstructor, options?: VxeGlobalConfig): void
122
122
 
123
- interface AllComponents {
123
+ interface UIComponents {
124
124
  /**
125
125
  * Alert 警告提示
126
126
  */
@@ -382,7 +382,9 @@ interface AllComponents {
382
382
  * Watermark 水印
383
383
  */
384
384
  VxeWatermark: typeof VxeWatermark
385
+ }
385
386
 
387
+ interface AllComponents extends UIComponents {
386
388
  // Vxe Table
387
389
  /**
388
390
  * Column 基础表格 - 列
@@ -591,6 +591,7 @@ export interface GanttPrivateComputed<D = any> extends GridPrivateComputed<D> {
591
591
  computeDateFormat: string
592
592
  computeScaleUnit: VxeGanttDefines.ColumnScaleType
593
593
  computeMinScale: VxeGanttDefines.ColumnScaleObj
594
+ computeScaleStep: number
594
595
  computeWeekScale: VxeGanttDefines.ColumnScaleObj | null | undefined
595
596
  computeTitleField: string
596
597
  computeStartField: string