vxe-pc-ui 4.10.22 → 4.10.24
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.
- package/es/date-panel/src/date-panel.js +1 -1
- package/es/date-range-picker/src/date-range-picker.js +6 -0
- package/es/icon/style.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +250 -203
- package/lib/date-panel/src/date-panel.js +1 -1
- package/lib/date-panel/src/date-panel.min.js +1 -1
- package/lib/date-range-picker/src/date-range-picker.js +6 -0
- package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +99 -13
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/upload/src/upload.js +90 -10
- package/lib/upload/src/upload.min.js +1 -1
- package/package.json +1 -1
- package/packages/date-panel/src/date-panel.ts +1 -1
- package/packages/date-range-picker/src/date-range-picker.ts +6 -0
- package/packages/upload/src/upload.ts +265 -219
- package/types/components/upload.d.ts +54 -4
- /package/es/icon/{iconfont.1762936771626.ttf → iconfont.1763014441538.ttf} +0 -0
- /package/es/icon/{iconfont.1762936771626.woff → iconfont.1763014441538.woff} +0 -0
- /package/es/icon/{iconfont.1762936771626.woff2 → iconfont.1763014441538.woff2} +0 -0
- /package/es/{iconfont.1762936771626.ttf → iconfont.1763014441538.ttf} +0 -0
- /package/es/{iconfont.1762936771626.woff → iconfont.1763014441538.woff} +0 -0
- /package/es/{iconfont.1762936771626.woff2 → iconfont.1763014441538.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1762936771626.ttf → iconfont.1763014441538.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1762936771626.woff → iconfont.1763014441538.woff} +0 -0
- /package/lib/icon/style/{iconfont.1762936771626.woff2 → iconfont.1763014441538.woff2} +0 -0
- /package/lib/{iconfont.1762936771626.ttf → iconfont.1763014441538.ttf} +0 -0
- /package/lib/{iconfont.1762936771626.woff → iconfont.1763014441538.woff} +0 -0
- /package/lib/{iconfont.1762936771626.woff2 → iconfont.1763014441538.woff2} +0 -0
package/lib/ui/index.js
CHANGED
|
@@ -26,7 +26,7 @@ Object.keys(_core).forEach(function (key) {
|
|
|
26
26
|
});
|
|
27
27
|
var _dynamics = require("../dynamics");
|
|
28
28
|
var _log = require("./src/log");
|
|
29
|
-
const version = exports.version = "4.10.
|
|
29
|
+
const version = exports.version = "4.10.24";
|
|
30
30
|
_core.VxeUI.uiVersion = version;
|
|
31
31
|
_core.VxeUI.dynamicApp = _dynamics.dynamicApp;
|
|
32
32
|
function config(options) {
|
package/lib/ui/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={version:!0,config:!0,setup:!0},_core=(exports.config=config,exports.default=void 0,exports.setup=setup,exports.version=void 0,require("@vxe-ui/core")),_dynamics=(Object.keys(_core).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_core[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _core[e]}})}),require("../dynamics")),_log=require("./src/log");const version=exports.version="4.10.22";function config(e){return(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return(0,_log.warnLog)("vxe.error.delFunc",["setup","setConfig"]),(0,_core.setConfig)(e)}_core.VxeUI.uiVersion=version,_core.VxeUI.dynamicApp=_dynamics.dynamicApp,_core.VxeUI.config=config,_core.VxeUI.setup=setup,(0,_core.setConfig)({alert:{},anchor:{},anchorLink:{},avatar:{},badge:{},breadcrumb:{separator:"/"},breadcrumbItem:{},button:{trigger:"hover",prefixTooltip:{enterable:!0},suffixTooltip:{enterable:!0}},buttonGroup:{},calendar:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1},card:{border:!0,padding:!0},carousel:{height:200,loop:!0,interval:5e3},carouselItem:{},checkbox:{},checkboxButton:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},countdown:{},colorPicker:{type:"rgb",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePanel:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1},datePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,autoClose:!0,showClearButton:null,showConfirmButton:null},dateRangePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,separator:" ~ ",autoClose:!0,showClearButton:null,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showErrorMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{showPreview:!0,showPrintButton:!0,maskClosable:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{virtualYConfig:{enabled:!0,gt:100}},loading:{showIcon:!0,showText:!0},menu:{},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controlConfig:{enabled:!0,layout:"right",showButton:!0,isWheel:!0,isArrow:!0}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},splitter:{resize:!0,itemConfig:{minWidth:40,minHeight:40},resizeConfig:{showTip:!0}},splitterPanel:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tabs:{},tag:{},textEllipsis:{underline:!0},text:{copyConfig:{showMessage:!0}},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},treeSelect:{autoClose:!0,virtualYConfig:{enabled:!0,gt:0,oSize:2},treeConfig:{maxHeight:300,radioConfig:{},checkboxConfig:{},filterConfig:{autoExpandAll:!0}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0,showLimitSize:!0,showLimitCount:!0,autoSubmit:!0,maxSimultaneousUploads:5},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{},gantt:{}});const iconPrefix="vxe-icon-";(0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",SELECT_ADD_OPTION:iconPrefix+"add",ICON_PICKER_OPEN:iconPrefix+"caret-down rotate180",ICON_PICKER_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",RADIO_CHECKED:iconPrefix+"radio-checked-fill",RADIO_UNCHECKED:iconPrefix+"radio-unchecked",RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",INPUT_PLUS_NUM:iconPrefix+"caret-up",INPUT_MINUS_NUM:iconPrefix+"caret-down",NUMBER_INPUT_MINUS_NUM:iconPrefix+"minus",NUMBER_INPUT_PLUS_NUM:iconPrefix+"add",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_VALID_ERROR_ICON:iconPrefix+"warning-circle-fill",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_UPLOAD:iconPrefix+"upload",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_TOP:iconPrefix+"arrow-up",TABS_TAB_BUTTON_BOTTOM:iconPrefix+"arrow-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",TAG_CLOSE:iconPrefix+"close",TAG_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_PICKER_COLOR_COPY:iconPrefix+"copy",COLOR_PICKER_EYE_DROPPER:iconPrefix+"dropper",COLOR_PICKER_TPTY_OPEN:iconPrefix+"arrow-down rotate180",COLOR_PICKER_TPTY_CLOSE:iconPrefix+"arrow-down",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right"});var _default=exports.default=_core.VxeUI;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={version:!0,config:!0,setup:!0},_core=(exports.config=config,exports.default=void 0,exports.setup=setup,exports.version=void 0,require("@vxe-ui/core")),_dynamics=(Object.keys(_core).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_core[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _core[e]}})}),require("../dynamics")),_log=require("./src/log");const version=exports.version="4.10.24";function config(e){return(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return(0,_log.warnLog)("vxe.error.delFunc",["setup","setConfig"]),(0,_core.setConfig)(e)}_core.VxeUI.uiVersion=version,_core.VxeUI.dynamicApp=_dynamics.dynamicApp,_core.VxeUI.config=config,_core.VxeUI.setup=setup,(0,_core.setConfig)({alert:{},anchor:{},anchorLink:{},avatar:{},badge:{},breadcrumb:{separator:"/"},breadcrumbItem:{},button:{trigger:"hover",prefixTooltip:{enterable:!0},suffixTooltip:{enterable:!0}},buttonGroup:{},calendar:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1},card:{border:!0,padding:!0},carousel:{height:200,loop:!0,interval:5e3},carouselItem:{},checkbox:{},checkboxButton:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},countdown:{},colorPicker:{type:"rgb",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePanel:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1},datePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,autoClose:!0,showClearButton:null,showConfirmButton:null},dateRangePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,separator:" ~ ",autoClose:!0,showClearButton:null,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showErrorMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{showPreview:!0,showPrintButton:!0,maskClosable:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{virtualYConfig:{enabled:!0,gt:100}},loading:{showIcon:!0,showText:!0},menu:{},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controlConfig:{enabled:!0,layout:"right",showButton:!0,isWheel:!0,isArrow:!0}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},splitter:{resize:!0,itemConfig:{minWidth:40,minHeight:40},resizeConfig:{showTip:!0}},splitterPanel:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tabs:{},tag:{},textEllipsis:{underline:!0},text:{copyConfig:{showMessage:!0}},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},treeSelect:{autoClose:!0,virtualYConfig:{enabled:!0,gt:0,oSize:2},treeConfig:{maxHeight:300,radioConfig:{},checkboxConfig:{},filterConfig:{autoExpandAll:!0}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0,showLimitSize:!0,showLimitCount:!0,autoSubmit:!0,maxSimultaneousUploads:5},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{},gantt:{}});const iconPrefix="vxe-icon-";(0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",SELECT_ADD_OPTION:iconPrefix+"add",ICON_PICKER_OPEN:iconPrefix+"caret-down rotate180",ICON_PICKER_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",RADIO_CHECKED:iconPrefix+"radio-checked-fill",RADIO_UNCHECKED:iconPrefix+"radio-unchecked",RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",INPUT_PLUS_NUM:iconPrefix+"caret-up",INPUT_MINUS_NUM:iconPrefix+"caret-down",NUMBER_INPUT_MINUS_NUM:iconPrefix+"minus",NUMBER_INPUT_PLUS_NUM:iconPrefix+"add",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_VALID_ERROR_ICON:iconPrefix+"warning-circle-fill",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_UPLOAD:iconPrefix+"upload",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_TOP:iconPrefix+"arrow-up",TABS_TAB_BUTTON_BOTTOM:iconPrefix+"arrow-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",TAG_CLOSE:iconPrefix+"close",TAG_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_PICKER_COLOR_COPY:iconPrefix+"copy",COLOR_PICKER_EYE_DROPPER:iconPrefix+"dropper",COLOR_PICKER_TPTY_OPEN:iconPrefix+"arrow-down rotate180",COLOR_PICKER_TPTY_CLOSE:iconPrefix+"arrow-down",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right"});var _default=exports.default=_core.VxeUI;
|
package/lib/ui/src/log.js
CHANGED
|
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.warnLog = exports.errLog = void 0;
|
|
7
7
|
var _core = require("@vxe-ui/core");
|
|
8
|
-
const version = `ui v${"4.10.
|
|
8
|
+
const version = `ui v${"4.10.24"}`;
|
|
9
9
|
const warnLog = exports.warnLog = _core.log.create('warn', version);
|
|
10
10
|
const errLog = exports.errLog = _core.log.create('error', version);
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");const version="ui v4.10.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");const version="ui v4.10.24",warnLog=exports.warnLog=_core.log.create("warn",version),errLog=exports.errLog=_core.log.create("error",version);
|
package/lib/upload/src/upload.js
CHANGED
|
@@ -188,7 +188,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
188
188
|
default: () => (0, _ui.getConfig)().upload.size || (0, _ui.getConfig)().size
|
|
189
189
|
}
|
|
190
190
|
},
|
|
191
|
-
emits: ['update:modelValue', 'add', 'remove', 'remove-fail', 'download', 'download-fail', 'upload-success', 'upload-error', 'sort-dragend'],
|
|
191
|
+
emits: ['update:modelValue', 'add', 'remove', 'remove-fail', 'download', 'download-fail', 'upload-success', 'upload-error', 'sort-dragend', 'more-visible'],
|
|
192
192
|
setup(props, context) {
|
|
193
193
|
const {
|
|
194
194
|
emit,
|
|
@@ -216,6 +216,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
216
216
|
dragTipText: ''
|
|
217
217
|
});
|
|
218
218
|
const internalData = {
|
|
219
|
+
moreId: _xeUtils.default.uniqueId('upload'),
|
|
219
220
|
imagePreviewTypes: ['jpg', 'jpeg', 'png', 'gif'],
|
|
220
221
|
prevDragIndex: -1
|
|
221
222
|
// prevDragPos: ''
|
|
@@ -986,11 +987,13 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
986
987
|
});
|
|
987
988
|
return files;
|
|
988
989
|
};
|
|
989
|
-
const handleMoreEvent =
|
|
990
|
+
const handleMoreEvent = evntParams => {
|
|
990
991
|
const formReadonly = computeFormReadonly.value;
|
|
991
992
|
const isImage = computeIsImage.value;
|
|
993
|
+
const evnt = evntParams.$event;
|
|
992
994
|
if (_ui.VxeUI.modal) {
|
|
993
995
|
_ui.VxeUI.modal.open({
|
|
996
|
+
id: internalData.moreId,
|
|
994
997
|
title: formReadonly ? (0, _ui.getI18n)('vxe.upload.morePopup.readTitle') : (0, _ui.getI18n)(`vxe.upload.morePopup.${isImage ? 'imageTitle' : 'fileTitle'}`),
|
|
995
998
|
width: 660,
|
|
996
999
|
height: 500,
|
|
@@ -1015,6 +1018,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1015
1018
|
fileList
|
|
1016
1019
|
} = reactData;
|
|
1017
1020
|
const isDisabled = computeIsDisabled.value;
|
|
1021
|
+
const moreContSlot = slots.moreContent || slots['more-content'];
|
|
1018
1022
|
const ons = {};
|
|
1019
1023
|
if (dragToUpload && dragIndex === -1) {
|
|
1020
1024
|
ons.onDragover = handleUploadDragoverEvent;
|
|
@@ -1030,7 +1034,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1030
1034
|
'show--error': showErrorStatus,
|
|
1031
1035
|
'is--drag': isDragUploadStatus
|
|
1032
1036
|
}]
|
|
1033
|
-
}, ons),
|
|
1037
|
+
}, ons), moreContSlot ? (0, _vn.getSlotVNs)(moreContSlot({
|
|
1038
|
+
options: fileList
|
|
1039
|
+
})) : [isImage ? dragSort ? (0, _vue.h)(_vue.TransitionGroup, {
|
|
1034
1040
|
name: `vxe-upload--drag-list${isDragMove ? '' : '-disabled'}`,
|
|
1035
1041
|
tag: 'div',
|
|
1036
1042
|
class: 'vxe-upload--image-more-list'
|
|
@@ -1059,10 +1065,22 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1059
1065
|
onShow() {
|
|
1060
1066
|
reactData.showMorePopup = true;
|
|
1061
1067
|
},
|
|
1062
|
-
onHide(
|
|
1068
|
+
onHide({
|
|
1069
|
+
$event
|
|
1070
|
+
}) {
|
|
1063
1071
|
reactData.showMorePopup = false;
|
|
1072
|
+
if ($event) {
|
|
1073
|
+
dispatchEvent('more-visible', {
|
|
1074
|
+
visible: false
|
|
1075
|
+
}, $event);
|
|
1076
|
+
}
|
|
1064
1077
|
}
|
|
1065
1078
|
});
|
|
1079
|
+
if (evnt) {
|
|
1080
|
+
dispatchEvent('more-visible', {
|
|
1081
|
+
visible: true
|
|
1082
|
+
}, evnt);
|
|
1083
|
+
}
|
|
1066
1084
|
}
|
|
1067
1085
|
};
|
|
1068
1086
|
const showDropTip = (evnt, dragEl, dragPos) => {
|
|
@@ -1265,6 +1283,27 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1265
1283
|
return Promise.all(allPendingList.splice(0, msNum).map(handleSubmit)).then(() => {
|
|
1266
1284
|
// 完成
|
|
1267
1285
|
});
|
|
1286
|
+
},
|
|
1287
|
+
getMoreVisible() {
|
|
1288
|
+
return reactData.showMorePopup;
|
|
1289
|
+
},
|
|
1290
|
+
openMore() {
|
|
1291
|
+
handleMoreEvent({
|
|
1292
|
+
$event: new Event('click')
|
|
1293
|
+
});
|
|
1294
|
+
return (0, _vue.nextTick)();
|
|
1295
|
+
},
|
|
1296
|
+
openMoreByEvent(evnt) {
|
|
1297
|
+
handleMoreEvent({
|
|
1298
|
+
$event: evnt
|
|
1299
|
+
});
|
|
1300
|
+
return (0, _vue.nextTick)();
|
|
1301
|
+
},
|
|
1302
|
+
closeMore() {
|
|
1303
|
+
if (_ui.VxeUI.modal) {
|
|
1304
|
+
_ui.VxeUI.modal.close(internalData.moreId);
|
|
1305
|
+
}
|
|
1306
|
+
return (0, _vue.nextTick)();
|
|
1268
1307
|
}
|
|
1269
1308
|
};
|
|
1270
1309
|
const uploadPrivateMethods = {};
|
|
@@ -1282,13 +1321,16 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1282
1321
|
showSubmitButton
|
|
1283
1322
|
} = props;
|
|
1284
1323
|
const {
|
|
1324
|
+
fileList,
|
|
1285
1325
|
fileCacheMaps
|
|
1286
1326
|
} = reactData;
|
|
1287
1327
|
const isDisabled = computeIsDisabled.value;
|
|
1288
1328
|
const formReadonly = computeFormReadonly.value;
|
|
1289
1329
|
const nameProp = computeNameProp.value;
|
|
1290
1330
|
const typeProp = computeTypeProp.value;
|
|
1331
|
+
const optionSlot = slots.option;
|
|
1291
1332
|
const cornerSlot = slots.corner;
|
|
1333
|
+
const nameSlot = slots.name;
|
|
1292
1334
|
const ons = {};
|
|
1293
1335
|
if (dragSort && currList.length > 1) {
|
|
1294
1336
|
ons.onDragstart = handleDragSortDragstartEvent;
|
|
@@ -1317,7 +1359,11 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1317
1359
|
}],
|
|
1318
1360
|
fileid: fileKey,
|
|
1319
1361
|
draggable: dragSort ? true : null
|
|
1320
|
-
}, ons),
|
|
1362
|
+
}, ons), optionSlot ? (0, _vn.getSlotVNs)(optionSlot({
|
|
1363
|
+
option: item,
|
|
1364
|
+
isMoreView,
|
|
1365
|
+
options: fileList
|
|
1366
|
+
})) : [(0, _vue.h)('div', {
|
|
1321
1367
|
class: 'vxe-upload--file-item-icon'
|
|
1322
1368
|
}, [(0, _vue.h)('i', {
|
|
1323
1369
|
class: (0, _ui.getIcon)()[`UPLOAD_FILE_TYPE_${`${item[typeProp]}`.toLocaleUpperCase()}`] || (0, _ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT
|
|
@@ -1329,7 +1375,11 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1329
1375
|
handlePreviewFileEvent(evnt, item);
|
|
1330
1376
|
}
|
|
1331
1377
|
}
|
|
1332
|
-
},
|
|
1378
|
+
}, nameSlot ? (0, _vn.getSlotVNs)(nameSlot({
|
|
1379
|
+
option: item,
|
|
1380
|
+
isMoreView,
|
|
1381
|
+
options: fileList
|
|
1382
|
+
})) : fileName), isLoading ? (0, _vue.h)('div', {
|
|
1333
1383
|
class: 'vxe-upload--file-item-loading-icon'
|
|
1334
1384
|
}, [(0, _vue.h)('i', {
|
|
1335
1385
|
class: (0, _ui.getIcon)().UPLOAD_LOADING
|
|
@@ -1354,6 +1404,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1354
1404
|
}, (0, _vn.getSlotVNs)(cornerSlot({
|
|
1355
1405
|
option: item,
|
|
1356
1406
|
isMoreView,
|
|
1407
|
+
options: fileList,
|
|
1357
1408
|
readonly: formReadonly
|
|
1358
1409
|
}))) : (0, _ui.renderEmptyElement)($xeUpload), showDownloadButton && !(isLoading || isPending) ? (0, _vue.h)('div', {
|
|
1359
1410
|
class: 'vxe-upload--file-item-download-btn',
|
|
@@ -1381,6 +1432,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1381
1432
|
showButtonIcon,
|
|
1382
1433
|
autoHiddenButton
|
|
1383
1434
|
} = props;
|
|
1435
|
+
const {
|
|
1436
|
+
fileList
|
|
1437
|
+
} = reactData;
|
|
1384
1438
|
const isDisabled = computeIsDisabled.value;
|
|
1385
1439
|
const formReadonly = computeFormReadonly.value;
|
|
1386
1440
|
const showTipText = computedShowTipText.value;
|
|
@@ -1397,6 +1451,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1397
1451
|
class: 'vxe-upload--file-action-btn',
|
|
1398
1452
|
onClick: clickEvent
|
|
1399
1453
|
}, defaultSlot ? (0, _vn.getSlotVNs)(defaultSlot({
|
|
1454
|
+
isMoreView,
|
|
1455
|
+
options: fileList,
|
|
1400
1456
|
$upload: $xeUpload
|
|
1401
1457
|
})) : [(0, _vue.h)(_button.default, {
|
|
1402
1458
|
class: 'vxe-upload--file-action-button',
|
|
@@ -1406,6 +1462,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1406
1462
|
})]), showTipText && (defTipText || tipSlot) ? (0, _vue.h)('div', {
|
|
1407
1463
|
class: 'vxe-upload--file-action-tip'
|
|
1408
1464
|
}, tipSlot ? (0, _vn.getSlotVNs)(tipSlot({
|
|
1465
|
+
isMoreView,
|
|
1466
|
+
options: fileList,
|
|
1409
1467
|
$upload: $xeUpload
|
|
1410
1468
|
})) : `${defTipText}`) : (0, _ui.renderEmptyElement)($xeUpload)]);
|
|
1411
1469
|
};
|
|
@@ -1426,6 +1484,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1426
1484
|
layout
|
|
1427
1485
|
} = moreOpts;
|
|
1428
1486
|
const isHorizontal = layout === 'horizontal';
|
|
1487
|
+
const moreBtnSlot = slots.moreButton || slots['more-button'];
|
|
1429
1488
|
let currList = fileList;
|
|
1430
1489
|
let overMaxNum = 0;
|
|
1431
1490
|
if (maxCount && fileList.length > maxCount) {
|
|
@@ -1449,7 +1508,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1449
1508
|
class: 'vxe-upload--file-list'
|
|
1450
1509
|
}, renderFileItemList(currList, false)) : (0, _ui.renderEmptyElement)($xeUpload), showMoreButton && overMaxNum ? (0, _vue.h)('div', {
|
|
1451
1510
|
class: 'vxe-upload--file-over-more'
|
|
1452
|
-
},
|
|
1511
|
+
}, moreBtnSlot ? (0, _vn.getSlotVNs)(moreBtnSlot({
|
|
1512
|
+
options: fileList
|
|
1513
|
+
})) : [(0, _vue.h)(_button.default, {
|
|
1453
1514
|
mode: 'text',
|
|
1454
1515
|
content: (0, _ui.getI18n)('vxe.upload.moreBtnText', [fileList.length]),
|
|
1455
1516
|
status: 'primary',
|
|
@@ -1468,12 +1529,14 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1468
1529
|
showSubmitButton
|
|
1469
1530
|
} = props;
|
|
1470
1531
|
const {
|
|
1532
|
+
fileList,
|
|
1471
1533
|
fileCacheMaps
|
|
1472
1534
|
} = reactData;
|
|
1473
1535
|
const isDisabled = computeIsDisabled.value;
|
|
1474
1536
|
const formReadonly = computeFormReadonly.value;
|
|
1475
1537
|
const imageOpts = computeImageOpts.value;
|
|
1476
1538
|
const imgStyle = computeImgStyle.value;
|
|
1539
|
+
const optionSlot = slots.option;
|
|
1477
1540
|
const cornerSlot = slots.corner;
|
|
1478
1541
|
const ons = {
|
|
1479
1542
|
onMousedown: handleItemMousedownEvent
|
|
@@ -1505,7 +1568,11 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1505
1568
|
}],
|
|
1506
1569
|
fileid: fileKey,
|
|
1507
1570
|
draggable: dragSort ? true : null
|
|
1508
|
-
}, ons),
|
|
1571
|
+
}, ons), optionSlot ? (0, _vn.getSlotVNs)(optionSlot({
|
|
1572
|
+
option: item,
|
|
1573
|
+
isMoreView,
|
|
1574
|
+
options: fileList
|
|
1575
|
+
})) : [(0, _vue.h)('div', {
|
|
1509
1576
|
class: 'vxe-upload--image-item-box',
|
|
1510
1577
|
style: isMoreView ? null : imgStyle,
|
|
1511
1578
|
onClick(evnt) {
|
|
@@ -1549,6 +1616,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1549
1616
|
}, (0, _vn.getSlotVNs)(cornerSlot({
|
|
1550
1617
|
option: item,
|
|
1551
1618
|
isMoreView,
|
|
1619
|
+
options: fileList,
|
|
1552
1620
|
readonly: formReadonly
|
|
1553
1621
|
}))) : (0, _ui.renderEmptyElement)($xeUpload), showRemoveButton && !formReadonly && !isDisabled && !isLoading ? (0, _vue.h)('div', {
|
|
1554
1622
|
class: 'vxe-upload--image-item-remove-btn',
|
|
@@ -1570,6 +1638,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1570
1638
|
showButtonIcon,
|
|
1571
1639
|
autoHiddenButton
|
|
1572
1640
|
} = props;
|
|
1641
|
+
const {
|
|
1642
|
+
fileList
|
|
1643
|
+
} = reactData;
|
|
1573
1644
|
const formReadonly = computeFormReadonly.value;
|
|
1574
1645
|
const showTipText = computedShowTipText.value;
|
|
1575
1646
|
const defTipText = computedDefTipText.value;
|
|
@@ -1587,6 +1658,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1587
1658
|
class: 'vxe-upload--image-action-btn',
|
|
1588
1659
|
onClick: clickEvent
|
|
1589
1660
|
}, defaultSlot ? defaultSlot({
|
|
1661
|
+
isMoreView,
|
|
1662
|
+
options: fileList,
|
|
1590
1663
|
$upload: $xeUpload
|
|
1591
1664
|
}) : [(0, _vue.h)('div', {
|
|
1592
1665
|
class: 'vxe-upload--image-action-box',
|
|
@@ -1600,6 +1673,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1600
1673
|
}, buttonText ? `${_xeUtils.default.isFunction(buttonText) ? buttonText({}) : buttonText}` : (0, _ui.getI18n)('vxe.upload.imgBtnText')) : (0, _ui.renderEmptyElement)($xeUpload), showTipText && (defTipText || tipSlot) ? (0, _vue.h)('div', {
|
|
1601
1674
|
class: 'vxe-upload--image-action-hint'
|
|
1602
1675
|
}, tipSlot ? (0, _vn.getSlotVNs)(tipSlot({
|
|
1676
|
+
isMoreView,
|
|
1677
|
+
options: fileList,
|
|
1603
1678
|
$upload: $xeUpload
|
|
1604
1679
|
})) : `${defTipText}`) : (0, _ui.renderEmptyElement)($xeUpload)])])]);
|
|
1605
1680
|
};
|
|
@@ -1613,6 +1688,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1613
1688
|
isDragMove
|
|
1614
1689
|
} = reactData;
|
|
1615
1690
|
const moreOpts = computeMoreOpts.value;
|
|
1691
|
+
const moreBtnSlot = slots.moreButton || slots['more-button'];
|
|
1616
1692
|
const {
|
|
1617
1693
|
maxCount,
|
|
1618
1694
|
showMoreButton
|
|
@@ -1634,7 +1710,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1634
1710
|
default: () => renderImageItemList(currList, false).concat([showMoreButton && overMaxNum ? (0, _vue.h)('div', {
|
|
1635
1711
|
key: 'om',
|
|
1636
1712
|
class: 'vxe-upload--image-over-more'
|
|
1637
|
-
},
|
|
1713
|
+
}, moreBtnSlot ? (0, _vn.getSlotVNs)(moreBtnSlot({
|
|
1714
|
+
options: fileList
|
|
1715
|
+
})) : [(0, _vue.h)(_button.default, {
|
|
1638
1716
|
mode: 'text',
|
|
1639
1717
|
content: (0, _ui.getI18n)('vxe.upload.moreBtnText', [fileList.length]),
|
|
1640
1718
|
status: 'primary',
|
|
@@ -1644,7 +1722,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1644
1722
|
class: 'vxe-upload--image-list'
|
|
1645
1723
|
}, renderImageItemList(currList, false).concat([showMoreButton && overMaxNum ? (0, _vue.h)('div', {
|
|
1646
1724
|
class: 'vxe-upload--image-over-more'
|
|
1647
|
-
},
|
|
1725
|
+
}, moreBtnSlot ? (0, _vn.getSlotVNs)(moreBtnSlot({
|
|
1726
|
+
options: fileList
|
|
1727
|
+
})) : [(0, _vue.h)(_button.default, {
|
|
1648
1728
|
mode: 'text',
|
|
1649
1729
|
content: (0, _ui.getI18n)('vxe.upload.moreBtnText', [fileList.length]),
|
|
1650
1730
|
status: 'primary',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_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}}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeUpload",props:{modelValue:[Array,String,Object],showList:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showList},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},autoSubmit:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoSubmit},mode:{type:String,default:()=>(0,_ui.getConfig)().upload.mode},imageTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)},imageConfig:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)},imageStyle:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)},fileTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)},dragSort:Boolean,dragToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)},pasteToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)},keyField:String,singleMode:Boolean,urlMode:Boolean,urlArgs:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.urlArgs},multiple:Boolean,limitSize:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitSize},showLimitSize:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitSize},limitSizeText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitSizeText},limitCount:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitCount},showLimitCount:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitCount},limitCountText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitCountText},nameField:{type:String,default:()=>(0,_ui.getConfig)().upload.nameField},typeField:{type:String,default:()=>(0,_ui.getConfig)().upload.typeField},urlField:{type:String,default:()=>(0,_ui.getConfig)().upload.urlField},sizeField:{type:String,default:()=>(0,_ui.getConfig)().upload.sizeField},showErrorStatus:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showErrorStatus},showProgress:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showProgress},progressText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.progressText},showSubmitButton:Boolean,autoHiddenButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoHiddenButton},showUploadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showUploadButton},buttonText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.buttonText},buttonIcon:{type:String,default:()=>(0,_ui.getConfig)().upload.buttonIcon},showButtonText:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonText},showButtonIcon:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonIcon},showRemoveButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showRemoveButton},showDownloadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showDownloadButton},showPreview:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showPreview},showTip:{type:Boolean,default:()=>null},maxSimultaneousUploads:{type:Number,default:()=>(0,_ui.getConfig)().upload.maxSimultaneousUploads},tipText:[String,Number,Function],hintText:String,previewMethod:Function,uploadMethod:Function,beforeRemoveMethod:Function,removeMethod:Function,beforeDownloadMethod:Function,downloadMethod:Function,getUrlMethod:Function,getThumbnailUrlMethod:Function,size:{type:String,default:()=>(0,_ui.getConfig)().upload.size||(0,_ui.getConfig)().size}},emits:["update:modelValue","add","remove","remove-fail","download","download-fail","upload-success","upload-error","sort-dragend"],setup(U,e){const{emit:u,slots:E}=e,T=(0,_vue.inject)("$xeForm",null),M=(0,_vue.inject)("xeFormItemInfo",null),i=(0,_vue.inject)("$xeTable",null);var t=_xeUtils.default.uniqueId();const C=(0,_ui.useSize)(U)["computeSize"],g=(0,_vue.ref)(),v=(0,_vue.ref)(),m=(0,_vue.ref)(),c=(0,_vue.ref)(),D=(0,_vue.reactive)({isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}),r={imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1},a={refElem:g},S=(0,_vue.computed)(()=>{var e=U["readonly"];return null===e?!!T&&T.props.readonly:e}),B=(0,_vue.computed)(()=>{var e=U["disabled"];return null===e?!!T&&T.props.disabled:e}),L=(0,_vue.computed)(()=>U.keyField||"_X_KEY"),_=(0,_vue.computed)(()=>"image"===U.mode),P=(0,_vue.computed)(()=>U.nameField||"name"),A=(0,_vue.computed)(()=>U.typeField||"type"),F=(0,_vue.computed)(()=>U.urlField||"url"),O=(0,_vue.computed)(()=>U.sizeField||"size"),G=(0,_vue.computed)(()=>1024*_xeUtils.default.toNumber(U.limitSize)*1024),V=(0,_vue.computed)(()=>U.multiple?_xeUtils.default.toNumber(U.limitCount):1),I=(0,_vue.computed)(()=>{var e=U["multiple"],t=D["fileList"],o=V.value;return e?!o||t.length>=o:1<=t.length}),H=(0,_vue.computed)(()=>{var e=_xeUtils.default.toNumber(U.limitSize);return e?1048576<e?e/1048576+"T":1024<e?e/1024+"G":e+"M":""}),b=(0,_vue.computed)(()=>{var{showTip:e,tipText:t}=U;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t}),Y=(0,_vue.computed)(()=>{var{limitSize:e,fileTypes:t,multiple:o,limitCount:i}=U,a=U.tipText||U.hintText,l=_.value,u=H.value;return _xeUtils.default.isString(a)?a:_xeUtils.default.isFunction(a)?""+a({}):(a=[],l?(o&&i&&a.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[i])),e&&u&&a.push((0,_ui.getI18n)("vxe.upload.imgSizeHint",[u]))):(t&&t.length&&a.push((0,_ui.getI18n)("vxe.upload.fileTypeHint",[t.join("/")])),e&&u&&a.push((0,_ui.getI18n)("vxe.upload.fileSizeHint",[u])),o&&i&&a.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[i]))),a.join((0,_ui.getI18n)("vxe.base.comma")))}),l=(0,_vue.computed)(()=>Object.assign({},U.imageConfig||U.imageStyle)),Q=(0,_vue.computed)(()=>{var{width:e,height:t}=l.value,o={};return e&&(o.width=(0,_dom.toCssUnit)(e)),t&&(o.height=(0,_dom.toCssUnit)(t)),o}),X=(0,_vue.computed)(()=>Object.assign({showMoreButton:!0},U.moreConfig)),d={},z={xID:t,props:U,context:e,reactData:D,internalData:r,getRefMaps:()=>a,getComputeMaps:()=>d},N=()=>_xeUtils.default.uniqueId(),j=e=>{return e[L.value]},s=()=>{var{modelValue:e,multiple:t}=U,o=S.value;const a=L.value,l=P.value,u=A.value,n=F.value,r=O.value;e=e?(e?_xeUtils.default.isArray(e)?e:[e]:[]).map(e=>{if(!e||_xeUtils.default.isString(e)){var t=""+(e||""),o=_xeUtils.default.parseUrl(e);const i=(o?o.searchQuery[l]:"")||decodeURIComponent(""+(t||"")).split("/").pop()||"";return{[l]:i,[u]:(o?o.searchQuery[u]:"")||k(i),[n]:t,[r]:_xeUtils.default.toNumber(o?o.searchQuery[r]:0)||0,[a]:N()}}const i=e[l]||"";return e[l]=i,e[u]=e[u]||k(i),e[n]=e[n]||"",e[r]=e[r]||0,e[a]=e[a]||N(),e}):[];D.fileList=o||t?e:e.slice(0,1)},k=e=>{var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},R=(e,t,o)=>{u(e,(0,_ui.createEvent)(o,{$upload:z},t))},$=e=>{var{singleMode:t,urlArgs:o}=U;const i=F.value,a=P.value;let l=e?e.slice(0):[];o&&(l=l.map(e=>{var t=e[i];if(t){var o=_xeUtils.default.parseUrl(t);if(!o.searchQuery[a]&&-1===t.indexOf("blob:"))return""+t+(-1===t.indexOf("?")?"?":"&")+a+"="+encodeURIComponent(e[a]||"")}return t})),e=t?l[0]||null:l,u("update:modelValue",e)},W=e=>{var t=U.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod;return t?t({$upload:z,option:e}):n(e)},n=e=>{var t=U.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=F.value;return t?t({$upload:z,option:e}):e[o]},K=(e,t)=>{var o=U.previewMethod||(0,_ui.getConfig)().upload.previewMethod;if(U.showPreview)if(o)o({$upload:z,option:t});else{var i=t;var{imageTypes:o,showDownloadButton:t}=U;const l=A.value,u=U.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;var a=r["imagePreviewTypes"];a.concat(o||[]).some(e=>(""+e).toLowerCase()===(""+i[l]).toLowerCase())&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:[n(i)],showDownloadButton:t,beforeDownloadMethod:u?()=>u({$upload:z,option:i}):void 0})}},J=(e,t,o)=>{var i=U["showDownloadButton"];const a=D["fileList"],l=U.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;U.showPreview&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:a.map(e=>n(e)),activeIndex:o,showDownloadButton:i,beforeDownloadMethod:l?({index:e})=>l({$upload:z,option:a[e]}):void 0})},q=(o,e)=>{const i=U["showErrorStatus"],a=j(o);var t=U.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?Promise.resolve(t({$upload:z,file:e,option:o,updateProgress(e){var t=D["fileCacheMaps"],t=t[j(o)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(e=>{var t=D["fileCacheMaps"],t=t[a];t&&(t.percent=100,t.status="success"),Object.assign(o,e),R("upload-success",{option:o,data:e},null)}).catch(e=>{var t=D["fileCacheMaps"],t=t[a];t&&(t.status="error"),i?Object.assign(o,e):D.fileList=D.fileList.filter(e=>j(e)!==a),R("upload-error",{option:o,data:e},null)}).finally(()=>{var e=D["fileCacheMaps"],e=e[a];e&&(e.loading=!1)}):(t=D["fileCacheMaps"],(e=t[a])&&(e.loading=!1),Promise.resolve())},Z=e=>{const{uploadMethod:t,urlMode:o}=U;var i,a=D["fileCacheMaps"],a=a[j(e)];(t||(0,_ui.getConfig)().upload.uploadMethod)&&a&&(i=a.file,a.loading=!0,a.status="pending",a.percent=0,q(e,i).then(()=>{o&&$(D.fileList)}))},p=(t,o)=>{const{multiple:e,urlMode:i,showLimitSize:a,limitSizeText:l,showLimitCount:u,limitCountText:n,autoSubmit:r}=U;var d=D["fileList"];const s=U.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,p=L.value,v=P.value,g=A.value,m=F.value,c=O.value;var _=G.value;const f=V.value;var h=H.value;let x=t;if(e&&f){if(u&&d.length>=f)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:n?""+(_xeUtils.default.isFunction(n)?n({maxCount:f}):n):(0,_ui.getI18n)("vxe.upload.overCountErr",[f])}));const I=x.length-(f-d.length);if(u&&0<I){const b=x.slice(f-d.length);n?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:""+(_xeUtils.default.isFunction(n)?n({maxCount:f}):n)}):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",width:null,slots:{default(){return(0,_vue.h)("div",{class:"vxe-upload--file-message-over-error"},[(0,_vue.h)("div",{},(0,_ui.getI18n)("vxe.upload.overCountExtraErr",[f,I])),(0,_vue.h)("div",{class:"vxe-upload--file-message-over-extra"},b.map((e,t)=>(0,_vue.h)("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)))])}}})}x=x.slice(0,f-d.length)}if(a&&_)for(let e=0;e<t.length;e++)if(t[0].size>_)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:l?""+(_xeUtils.default.isFunction(l)?l({maxSize:_}):l):(0,_ui.getI18n)("vxe.upload.overSizeErr",[h])}));const y=Object.assign({},D.fileCacheMaps),w=e?d:[],C=[];x.forEach(e=>{var t=e["name"],o=N(),t={[v]:t,[g]:k(t),[c]:e.size,[m]:URL.createObjectURL(e),[p]:o},o=(s&&(y[o]={file:e,loading:!!r,status:"pending",percent:0}),(0,_vue.reactive)(t));s&&r&&C.push(q(o,e)),w.push(o)}),D.fileList=w,D.fileCacheMaps=y,w.forEach(e=>{R("add",{option:e},o)}),Promise.all(i?C:[]).then(()=>{$(w),T&&M&&T.triggerItemEvent(o,M.itemConfig.field,w)})},ee=t=>{var{multiple:e,imageTypes:o,fileTypes:i}=U,a=B.value,l=_.value;return a?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:l?o:i}).then(e=>(p(e.files,t),e))},te=e=>{ee(e).catch(()=>{})},oe=(e,t,o)=>{var i=D["fileList"];i.splice(o,1),$(i),T&&M&&T.triggerItemEvent(e,M.itemConfig.field,i),R("remove",{option:t},e)},ie=(t,o,i)=>{var e=U.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod;const a=U.removeMethod||(0,_ui.getConfig)().upload.removeMethod;Promise.resolve(!e||e({$upload:z,option:o})).then(e=>{e?a?Promise.resolve(a({$upload:z,option:o})).then(()=>{oe(t,o,i)}).catch(e=>e):oe(t,o,i):R("remove-fail",{option:o},t)})},ae=(e,t)=>{R("download",{option:t},e)},le=(t,o)=>{var e=U.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;const i=U.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!e||e({$upload:z,option:o})).then(e=>{e?i?Promise.resolve(i({$upload:z,option:o})).then(()=>{ae(t,o)}).catch(e=>e):ae(t,o):R("download-fail",{option:o},t)})},ue=e=>{var t,o,i,a=e.currentTarget,{clientX:e,clientY:l}=e;a&&({x:a,y:t,height:o,width:i}=a.getBoundingClientRect(),e<a||a+i<e||l<t||t+o<l)&&(D.isDragUploadStatus=!1)},ne=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),D.isDragUploadStatus=!0)},re=(e,t)=>{const{imageTypes:o,fileTypes:i}=U;var a=r["imagePreviewTypes"];if(_.value){const l=a.concat(o&&o.length?o:[]);t=t.filter(e=>{const t=(""+(e.type.split("/")[1]||"")).toLowerCase();return!!l.some(e=>(""+e).toLowerCase()===t)})}else if(i&&i.length){const u=[];if(t.forEach(e=>{const t=k(e.name);i.some(e=>(""+e).toLowerCase()===t)||u.push(t)}),u.length)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.error.notType",[u.join(", ")]),status:"error"}))}t.length?p(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")})},de=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),(t=se(t)).length)&&re(e,t),D.isDragUploadStatus=!1},se=e=>{const t=[];return _xeUtils.default.arrayEach(e,e=>{e=e.getAsFile();e&&t.push(e)}),t},f=()=>{const s=S.value,p=_.value;_ui.VxeUI.modal&&_ui.VxeUI.modal.open({title:s?(0,_ui.getI18n)("vxe.upload.morePopup.readTitle"):(0,_ui.getI18n)("vxe.upload.morePopup."+(p?"imageTitle":"fileTitle")),width:660,height:500,escClosable:!0,showMaximize:!0,resize:!0,maskClosable:!0,slots:{default(){var{showErrorStatus:e,dragToUpload:t,dragSort:o}=U,{isActivated:i,isDragMove:a,isDragUploadStatus:l,dragIndex:u}=D;const n=D["fileList"];var r=B.value,d={};return t&&-1===u&&(d.onDragover=ne,d.onDragleave=ue,d.onDrop=de),(0,_vue.h)("div",Object.assign({ref:v,class:["vxe-upload--more-popup",{"is--readonly":s,"is--disabled":r,"is--active":i,"show--error":e,"is--drag":l}]},d),[p?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(a?"":"-disabled"),tag:"div",class:"vxe-upload--image-more-list"},{default:()=>y(n,!0).concat(w(!0))}):(0,_vue.h)("div",{class:"vxe-upload--image-more-list"},y(n,!0).concat(w(!0))):(0,_vue.h)("div",{class:"vxe-upload--file-more-list"},[x(!0),o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(a?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>h(n,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},h(n,!0))]),o?(0,_vue.h)("div",{ref:c,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(z),l?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(z)])}},onShow(){D.showMorePopup=!0},onHide(){D.showMorePopup=!1}})},pe=(e,t,o)=>{var i,a=D["showMorePopup"],l=g.value,u=v.value,u=a?u:l;u&&(l=u.getBoundingClientRect(),u=m.value,i=c.value,a=a?i:u)&&(i=t.getBoundingClientRect(),a.style.display="block",a.style.top=Math.max(1,i.y-l.y)+"px",a.style.left=Math.max(1,i.x-l.x)+"px",a.style.height=i.height+"px",a.style.width=i.width-1+"px",a.setAttribute("drag-pos",o))},ve=e=>{e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0);const t=e.currentTarget;e=t.parentElement,e=_xeUtils.default.findIndexOf(Array.from(e.children),e=>t===e);D.isDragMove=!0,D.dragIndex=e,setTimeout(()=>{D.isDragMove=!1},500)},ge=t=>{t.stopPropagation(),t.preventDefault();var o=D["dragIndex"];if(-1!==o){var i=_.value;const l=t.currentTarget;var a=l.parentElement,a=_xeUtils.default.findIndexOf(Array.from(a.children),e=>l===e);let e="";e=i?t.clientX-l.getBoundingClientRect().x<l.clientWidth/2?"left":"right":t.clientY-l.getBoundingClientRect().y<l.clientHeight/2?"top":"bottom",o===a?pe(0,l,e):(pe(0,l,e),r.prevDragIndex=a,r.prevDragPos=e)}},me=e=>{var{fileList:t,dragIndex:o}=D,{prevDragIndex:i,prevDragPos:a}=r,l="bottom"===a||"right"===a?1:0,u=t[o];const n=t[i];u&&n&&(t.splice(o,1),i=_xeUtils.default.findIndexOf(t,e=>n===e)+l,t.splice(i,0,u),R("sort-dragend",{oldItem:u,newItem:n,dragPos:a,offsetIndex:l,_index:{newIndex:i,oldIndex:o}},e)),t=m.value,u=c.value,t&&(t.style.display=""),u&&(u.style.display=""),D.dragIndex=-1},ce=e=>{i&&e.stopPropagation(),D.isActivated=!0},_e=e=>{var t=U["pasteToUpload"],o=D["isActivated"];o&&t&&(o=e.clipboardData||e.originalEvent.clipboardData)&&(t=o["items"],t)&&(o=se(t)).length&&(e.preventDefault(),re(e,o))},fe=e=>{var t=g.value,o=v.value;let i=(0,_dom.getEventTargetNode)(e,t).flag;!i&&o&&(o=(t=o.parentElement||o)&&t.parentElement,i=(0,_dom.getEventTargetNode)(e,o).flag),D.isActivated=i},he=()=>{D.isActivated=!1};t={dispatchEvent:R,choose(){return ee(null)},submit(i){var e=U["maxSimultaneousUploads"],e=_xeUtils.default.toNumber(e||1)||1;const{fileList:t,fileCacheMaps:a}=D,o=t.filter(e=>{e=j(e),e=a[e];return e&&("pending"===e.status||i&&"error"===e.status)}),l=e=>{var t=j(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,q(e,o).then(u)}return u()},u=()=>{var e;return o.length?(e=o[0],o.splice(0,1),l(e).then(u)):Promise.resolve()};return Promise.all(o.splice(0,e).map(l)).then(()=>{})}};Object.assign(z,t,{});const h=(e,r)=>{const{showRemoveButton:d,showDownloadButton:s,showProgress:p,progressText:v,showPreview:g,showErrorStatus:m,dragSort:c,autoSubmit:_,showSubmitButton:f}=U,h=D["fileCacheMaps"],x=B.value,y=S.value,w=P.value,C=A.value,I=E.corner,b={};return c&&1<e.length&&(b.onDragstart=ve,b.onDragover=ge,b.onDragend=me),e.map((t,o)=>{var e=j(t),i=h[e];let a=!1,l=!1,u=!1;var n=""+(t[w]||"");return i&&(a=i.loading,l="error"===i.status,u="pending"===i.status),(0,_vue.h)("div",Object.assign({key:c?e:o,class:["vxe-upload--file-item",{"is--preview":g,"is--loading":a,"is--pending":u,"is--error":l}],fileid:e,draggable:!!c||null},b),[(0,_vue.h)("div",{class:"vxe-upload--file-item-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_"+(""+t[C]).toLocaleUpperCase()]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),(0,_vue.h)("div",{class:"vxe-upload--file-item-name",title:n,onClick(e){a||l||K(e,t)}},n),a?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(z),p&&a&&i?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-text"},v?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(v)?v({}):v),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(z),!a&&(l&&m||u&&f&&!_)?(0,_vue.h)("div",{class:"vxe-upload--file-item-rebtn"},[(0,_vue.h)(_button.default,{icon:l?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:l?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload"),onClick(){Z(t)}})]):(0,_ui.renderEmptyElement)(z),(0,_vue.h)("div",{class:"vxe-upload--file-item-btn-wrapper"},[I?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(I({option:t,isMoreView:r,readonly:y}))):(0,_ui.renderEmptyElement)(z),!s||a||u?(0,_ui.renderEmptyElement)(z):(0,_vue.h)("div",{class:"vxe-upload--file-item-download-btn",onClick(e){le(e,t)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]),!d||y||x||a?(0,_ui.renderEmptyElement)(z):(0,_vue.h)("div",{class:"vxe-upload--file-item-remove-btn",onClick(e){ie(e,t,o)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},x=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:a,showButtonIcon:l,autoHiddenButton:u}=U,n=B.value,r=S.value,d=b.value,s=Y.value,p=I.value,v=E.default,g=E.tip||E.hint;return r||!t?(0,_ui.renderEmptyElement)(z):(0,_vue.h)("div",{class:"vxe-upload--file-action"},[u&&p?(0,_ui.renderEmptyElement)(z):(0,_vue.h)("div",{class:"vxe-upload--file-action-btn",onClick:te},v?(0,_vn.getSlotVNs)(v({$upload:z})):[(0,_vue.h)(_button.default,{class:"vxe-upload--file-action-button",content:e||a?o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:l?i||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:n})]),d&&(s||g)?(0,_vue.h)("div",{class:"vxe-upload--file-action-tip"},g?(0,_vn.getSlotVNs)(g({$upload:z})):""+s):(0,_ui.renderEmptyElement)(z)])},y=(e,n)=>{const{showRemoveButton:r,showProgress:d,progressText:s,showPreview:p,showErrorStatus:v,dragSort:g,autoSubmit:m,showSubmitButton:c}=U,_=D["fileCacheMaps"],f=B.value,h=S.value,x=l.value,y=Q.value,w=E.corner,C={onMousedown:ce};return g&&1<e.length&&(C.onDragstart=ve,C.onDragover=ge,C.onDragend=me),e.map((t,o)=>{var e=j(t),i=_[e];let a=!1,l=!1,u=!1;return i&&(a=i.loading,l="error"===i.status,u="pending"===i.status),(0,_vue.h)("div",Object.assign({key:g?e:o,class:["vxe-upload--image-item",{"is--preview":p,"is--circle":x.circle,"is--loading":a,"is--pending":u,"is--error":l}],fileid:e,draggable:!!g||null},C),[(0,_vue.h)("div",{class:"vxe-upload--image-item-box",style:n?null:y,onClick(e){a||l||J(e,t,o)}},[a&&i?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading"},[(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),d?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-text"},s?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(s)?s({}):s),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(z)]):(0,_ui.renderEmptyElement)(z),(0,_vue.h)("div",{class:"vxe-upload--image-item-img-wrapper",title:(0,_ui.getI18n)("vxe.upload.viewItemTitle")},[(0,_vue.h)("img",{class:"vxe-upload--image-item-img",src:W(t)})]),!a&&(l&&v||u&&c&&!m)?(0,_vue.h)("div",{class:"vxe-upload--image-item-rebtn"},[(0,_vue.h)(_button.default,{icon:l?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:l?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload"),onClick(){Z(t)}})]):(0,_ui.renderEmptyElement)(z),(0,_vue.h)("div",{class:"vxe-upload--image-item-btn-wrapper",onClick(e){e.stopPropagation()}},[w?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(w({option:t,isMoreView:n,readonly:h}))):(0,_ui.renderEmptyElement)(z),!r||h||f||a?(0,_ui.renderEmptyElement)(z):(0,_vue.h)("div",{class:"vxe-upload--image-item-remove-btn",onClick(e){e.stopPropagation(),ie(e,t,o)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},w=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:a,showButtonIcon:l,autoHiddenButton:u}=U,n=S.value,r=b.value,d=Y.value,s=I.value,p=Q.value,v=E.default,g=E.tip||E.hint;return n||!t||u&&s?(0,_ui.renderEmptyElement)(z):(0,_vue.h)("div",{key:"action",class:"vxe-upload--image-action"},[(0,_vue.h)("div",{class:"vxe-upload--image-action-btn",onClick:te},v?v({$upload:z}):[(0,_vue.h)("div",{class:"vxe-upload--image-action-box",style:e?null:p},[l?(0,_vue.h)("div",{class:"vxe-upload--image-action-icon"},[(0,_vue.h)("i",{class:i||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_ui.renderEmptyElement)(z),e||a?(0,_vue.h)("div",{class:"vxe-upload--image-action-content"},o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_ui.renderEmptyElement)(z),r&&(d||g)?(0,_vue.h)("div",{class:"vxe-upload--image-action-hint"},g?(0,_vn.getSlotVNs)(g({$upload:z})):""+d):(0,_ui.renderEmptyElement)(z)])])])};const o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>U.modelValue?U.modelValue.length:0,()=>{o.value++}),(0,_vue.watch)(()=>U.modelValue,()=>{o.value++}),(0,_vue.watch)(o,()=>{s()}),(0,_vue.onMounted)(()=>{U.multiple&&U.singleMode&&(0,_log.errLog)("vxe.error.errConflicts",["[upload] multiple","single-mode"]),U.imageStyle&&(0,_log.warnLog)("vxe.error.delProp",["[upload] image-style","image-config"]),U.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(z,"paste",_e),_ui.globalEvents.on(z,"mousedown",fe),_ui.globalEvents.on(z,"blur",he)}),(0,_vue.onUnmounted)(()=>{D.isDragUploadStatus=!1,_ui.globalEvents.off(z,"paste"),_ui.globalEvents.off(z,"mousedown"),_ui.globalEvents.off(z,"blur")}),s(),z.renderVN=()=>{var{showErrorStatus:e,dragToUpload:t,pasteToUpload:o,dragSort:i}=U,{isDragUploadStatus:a,showMorePopup:l,isActivated:u,dragIndex:n}=D,r=C.value,d=B.value,s=S.value,p=_.value,v={onMousedown:ce};return t&&-1===n&&(v.onDragover=ne,v.onDragleave=ue,v.onDrop=de),(0,_vue.h)("div",Object.assign({ref:g,class:["vxe-upload",{["size--"+r]:r,"is--active":u,"is--readonly":s,"is--disabled":d,"is--paste":o,"show--error":e,"is--drag":a}]},v),[(p?()=>{var{showList:e,dragSort:t}=U;const{fileList:o,isDragMove:i}=D,{maxCount:a,showMoreButton:l}=X.value;let u=o,n=0;return a&&o.length>a&&(n=o.length-a,u=o.slice(0,a)),(0,_vue.h)("div",{key:"image",class:"vxe-upload--image-wrapper"},e?[t?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(i?"":"-disabled"),tag:"div",class:"vxe-upload--image-list"},{default:()=>y(u,!1).concat([l&&n?(0,_vue.h)("div",{key:"om",class:"vxe-upload--image-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:f})]):(0,_ui.renderEmptyElement)(z),w(!1)])}):(0,_vue.h)("div",{class:"vxe-upload--image-list"},y(u,!1).concat([l&&n?(0,_vue.h)("div",{class:"vxe-upload--image-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:f})]):(0,_ui.renderEmptyElement)(z),w(!1)]))]:[(0,_vue.h)("div",{class:"vxe-upload--image-list"},[w(!1)])])}:()=>{var{showList:e,moreConfig:t,dragSort:o}=U,{fileList:i,isDragMove:a}=D,{maxCount:l,showMoreButton:u,layout:n}=X.value,n="horizontal"===n;let r=i,d=0;return l&&i.length>l&&(d=i.length-l,r=i.slice(0,l)),(0,_vue.h)("div",{key:"all",class:"vxe-upload--file-wrapper"},e?[u&&t&&n?(0,_ui.renderEmptyElement)(z):x(!0),r.length||u&&n?(0,_vue.h)("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":n}]},[r.length?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(a?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>h(r,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},h(r,!1)):(0,_ui.renderEmptyElement)(z),u&&d?(0,_vue.h)("div",{class:"vxe-upload--file-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[i.length]),status:"primary",onClick:f})]):(0,_ui.renderEmptyElement)(z),u&&t&&n?x(!1):(0,_ui.renderEmptyElement)(z)]):(0,_ui.renderEmptyElement)(z)]:[x(!1)])})(),i?(0,_vue.h)("div",{ref:m,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(z),a&&!l?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(z)])},z},render(){return this.renderVN()}});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_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}}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeUpload",props:{modelValue:[Array,String,Object],showList:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showList},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},autoSubmit:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoSubmit},mode:{type:String,default:()=>(0,_ui.getConfig)().upload.mode},imageTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)},imageConfig:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)},imageStyle:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)},fileTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)},dragSort:Boolean,dragToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)},pasteToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)},keyField:String,singleMode:Boolean,urlMode:Boolean,urlArgs:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.urlArgs},multiple:Boolean,limitSize:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitSize},showLimitSize:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitSize},limitSizeText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitSizeText},limitCount:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitCount},showLimitCount:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitCount},limitCountText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitCountText},nameField:{type:String,default:()=>(0,_ui.getConfig)().upload.nameField},typeField:{type:String,default:()=>(0,_ui.getConfig)().upload.typeField},urlField:{type:String,default:()=>(0,_ui.getConfig)().upload.urlField},sizeField:{type:String,default:()=>(0,_ui.getConfig)().upload.sizeField},showErrorStatus:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showErrorStatus},showProgress:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showProgress},progressText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.progressText},showSubmitButton:Boolean,autoHiddenButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoHiddenButton},showUploadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showUploadButton},buttonText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.buttonText},buttonIcon:{type:String,default:()=>(0,_ui.getConfig)().upload.buttonIcon},showButtonText:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonText},showButtonIcon:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonIcon},showRemoveButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showRemoveButton},showDownloadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showDownloadButton},showPreview:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showPreview},showTip:{type:Boolean,default:()=>null},maxSimultaneousUploads:{type:Number,default:()=>(0,_ui.getConfig)().upload.maxSimultaneousUploads},tipText:[String,Number,Function],hintText:String,previewMethod:Function,uploadMethod:Function,beforeRemoveMethod:Function,removeMethod:Function,beforeDownloadMethod:Function,downloadMethod:Function,getUrlMethod:Function,getThumbnailUrlMethod:Function,size:{type:String,default:()=>(0,_ui.getConfig)().upload.size||(0,_ui.getConfig)().size}},emits:["update:modelValue","add","remove","remove-fail","download","download-fail","upload-success","upload-error","sort-dragend","more-visible"],setup(T,e){const{emit:u,slots:S}=e,U=(0,_vue.inject)("$xeForm",null),E=(0,_vue.inject)("xeFormItemInfo",null),i=(0,_vue.inject)("$xeTable",null);var t=_xeUtils.default.uniqueId();const b=(0,_ui.useSize)(T)["computeSize"],g=(0,_vue.ref)(),m=(0,_vue.ref)(),c=(0,_vue.ref)(),_=(0,_vue.ref)(),D=(0,_vue.reactive)({isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}),r={moreId:_xeUtils.default.uniqueId("upload"),imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1},l={refElem:g},B=(0,_vue.computed)(()=>{var e=T["readonly"];return null===e?!!U&&U.props.readonly:e}),L=(0,_vue.computed)(()=>{var e=T["disabled"];return null===e?!!U&&U.props.disabled:e}),M=(0,_vue.computed)(()=>T.keyField||"_X_KEY"),f=(0,_vue.computed)(()=>"image"===T.mode),P=(0,_vue.computed)(()=>T.nameField||"name"),V=(0,_vue.computed)(()=>T.typeField||"type"),A=(0,_vue.computed)(()=>T.urlField||"url"),F=(0,_vue.computed)(()=>T.sizeField||"size"),H=(0,_vue.computed)(()=>1024*_xeUtils.default.toNumber(T.limitSize)*1024),O=(0,_vue.computed)(()=>T.multiple?_xeUtils.default.toNumber(T.limitCount):1),C=(0,_vue.computed)(()=>{var e=T["multiple"],t=D["fileList"],o=O.value;return e?!o||t.length>=o:1<=t.length}),Y=(0,_vue.computed)(()=>{var e=_xeUtils.default.toNumber(T.limitSize);return e?1048576<e?e/1048576+"T":1024<e?e/1024+"G":e+"M":""}),Q=(0,_vue.computed)(()=>{var{showTip:e,tipText:t}=T;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t}),X=(0,_vue.computed)(()=>{var{limitSize:e,fileTypes:t,multiple:o,limitCount:i}=T,l=T.tipText||T.hintText,a=f.value,u=Y.value;return _xeUtils.default.isString(l)?l:_xeUtils.default.isFunction(l)?""+l({}):(l=[],a?(o&&i&&l.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[i])),e&&u&&l.push((0,_ui.getI18n)("vxe.upload.imgSizeHint",[u]))):(t&&t.length&&l.push((0,_ui.getI18n)("vxe.upload.fileTypeHint",[t.join("/")])),e&&u&&l.push((0,_ui.getI18n)("vxe.upload.fileSizeHint",[u])),o&&i&&l.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[i]))),l.join((0,_ui.getI18n)("vxe.base.comma")))}),a=(0,_vue.computed)(()=>Object.assign({},T.imageConfig||T.imageStyle)),W=(0,_vue.computed)(()=>{var{width:e,height:t}=a.value,o={};return e&&(o.width=(0,_dom.toCssUnit)(e)),t&&(o.height=(0,_dom.toCssUnit)(t)),o}),K=(0,_vue.computed)(()=>Object.assign({showMoreButton:!0},T.moreConfig)),n={},N={xID:t,props:T,context:e,reactData:D,internalData:r,getRefMaps:()=>l,getComputeMaps:()=>n},z=()=>_xeUtils.default.uniqueId(),k=e=>{return e[M.value]},s=()=>{var{modelValue:e,multiple:t}=T,o=B.value;const l=M.value,a=P.value,u=V.value,n=A.value,r=F.value;e=e?(e?_xeUtils.default.isArray(e)?e:[e]:[]).map(e=>{if(!e||_xeUtils.default.isString(e)){var t=""+(e||""),o=_xeUtils.default.parseUrl(e);const i=(o?o.searchQuery[a]:"")||decodeURIComponent(""+(t||"")).split("/").pop()||"";return{[a]:i,[u]:(o?o.searchQuery[u]:"")||j(i),[n]:t,[r]:_xeUtils.default.toNumber(o?o.searchQuery[r]:0)||0,[l]:z()}}const i=e[a]||"";return e[a]=i,e[u]=e[u]||j(i),e[n]=e[n]||"",e[r]=e[r]||0,e[l]=e[l]||z(),e}):[];D.fileList=o||t?e:e.slice(0,1)},j=e=>{var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},R=(e,t,o)=>{u(e,(0,_ui.createEvent)(o,{$upload:N},t))},$=e=>{var{singleMode:t,urlArgs:o}=T;const i=A.value,l=P.value;let a=e?e.slice(0):[];o&&(a=a.map(e=>{var t=e[i];if(t){var o=_xeUtils.default.parseUrl(t);if(!o.searchQuery[l]&&-1===t.indexOf("blob:"))return""+t+(-1===t.indexOf("?")?"?":"&")+l+"="+encodeURIComponent(e[l]||"")}return t})),e=t?a[0]||null:a,u("update:modelValue",e)},q=e=>{var t=T.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=A.value;return t?t({$upload:N,option:e}):e[o]},J=t=>{var{imageTypes:e,showDownloadButton:o}=T;const i=V.value,l=T.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;var a=r["imagePreviewTypes"];a.concat(e||[]).some(e=>(""+e).toLowerCase()===(""+t[i]).toLowerCase())&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:[q(t)],showDownloadButton:o,beforeDownloadMethod:l?()=>l({$upload:N,option:t}):void 0})},G=(o,e)=>{const i=T["showErrorStatus"],l=k(o);var t=T.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?Promise.resolve(t({$upload:N,file:e,option:o,updateProgress(e){var t=D["fileCacheMaps"],t=t[k(o)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(e=>{var t=D["fileCacheMaps"],t=t[l];t&&(t.percent=100,t.status="success"),Object.assign(o,e),R("upload-success",{option:o,data:e},null)}).catch(e=>{var t=D["fileCacheMaps"],t=t[l];t&&(t.status="error"),i?Object.assign(o,e):D.fileList=D.fileList.filter(e=>k(e)!==l),R("upload-error",{option:o,data:e},null)}).finally(()=>{var e=D["fileCacheMaps"],e=e[l];e&&(e.loading=!1)}):(t=D["fileCacheMaps"],(e=t[l])&&(e.loading=!1),Promise.resolve())},Z=e=>{const{uploadMethod:t,urlMode:o}=T;var i,l=D["fileCacheMaps"],l=l[k(e)];(t||(0,_ui.getConfig)().upload.uploadMethod)&&l&&(i=l.file,l.loading=!0,l.status="pending",l.percent=0,G(e,i).then(()=>{o&&$(D.fileList)}))},d=(t,o)=>{const{multiple:e,urlMode:i,showLimitSize:l,limitSizeText:a,showLimitCount:u,limitCountText:n,autoSubmit:r}=T;var s=D["fileList"];const d=T.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,p=M.value,v=P.value,g=V.value,m=A.value,c=F.value;var _=H.value;const f=O.value;var h=Y.value;let x=t;if(e&&f){if(u&&s.length>=f)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:n?""+(_xeUtils.default.isFunction(n)?n({maxCount:f}):n):(0,_ui.getI18n)("vxe.upload.overCountErr",[f])}));const b=x.length-(f-s.length);if(u&&0<b){const C=x.slice(f-s.length);n?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:""+(_xeUtils.default.isFunction(n)?n({maxCount:f}):n)}):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",width:null,slots:{default(){return(0,_vue.h)("div",{class:"vxe-upload--file-message-over-error"},[(0,_vue.h)("div",{},(0,_ui.getI18n)("vxe.upload.overCountExtraErr",[f,b])),(0,_vue.h)("div",{class:"vxe-upload--file-message-over-extra"},C.map((e,t)=>(0,_vue.h)("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)))])}}})}x=x.slice(0,f-s.length)}if(l&&_)for(let e=0;e<t.length;e++)if(t[0].size>_)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:a?""+(_xeUtils.default.isFunction(a)?a({maxSize:_}):a):(0,_ui.getI18n)("vxe.upload.overSizeErr",[h])}));const w=Object.assign({},D.fileCacheMaps),y=e?s:[],I=[];x.forEach(e=>{var t=e["name"],o=z(),t={[v]:t,[g]:j(t),[c]:e.size,[m]:URL.createObjectURL(e),[p]:o},o=(d&&(w[o]={file:e,loading:!!r,status:"pending",percent:0}),(0,_vue.reactive)(t));d&&r&&I.push(G(o,e)),y.push(o)}),D.fileList=y,D.fileCacheMaps=w,y.forEach(e=>{R("add",{option:e},o)}),Promise.all(i?I:[]).then(()=>{$(y),U&&E&&U.triggerItemEvent(o,E.itemConfig.field,y)})},p=t=>{var{multiple:e,imageTypes:o,fileTypes:i}=T,l=L.value,a=f.value;return l?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:a?o:i}).then(e=>(d(e.files,t),e))},ee=e=>{p(e).catch(()=>{})},v=(e,t,o)=>{var i=D["fileList"];i.splice(o,1),$(i),U&&E&&U.triggerItemEvent(e,E.itemConfig.field,i),R("remove",{option:t},e)},te=(t,o,i)=>{var e=T.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod;const l=T.removeMethod||(0,_ui.getConfig)().upload.removeMethod;Promise.resolve(!e||e({$upload:N,option:o})).then(e=>{e?l?Promise.resolve(l({$upload:N,option:o})).then(()=>{v(t,o,i)}).catch(e=>e):v(t,o,i):R("remove-fail",{option:o},t)})},oe=(e,t)=>{R("download",{option:t},e)},ie=e=>{var t,o,i,l=e.currentTarget,{clientX:e,clientY:a}=e;l&&({x:l,y:t,height:o,width:i}=l.getBoundingClientRect(),e<l||l+i<e||a<t||t+o<a)&&(D.isDragUploadStatus=!1)},le=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),D.isDragUploadStatus=!0)},ae=(e,t)=>{const{imageTypes:o,fileTypes:i}=T;var l=r["imagePreviewTypes"];if(f.value){const a=l.concat(o&&o.length?o:[]);t=t.filter(e=>{const t=(""+(e.type.split("/")[1]||"")).toLowerCase();return!!a.some(e=>(""+e).toLowerCase()===t)})}else if(i&&i.length){const u=[];if(t.forEach(e=>{const t=j(e.name);i.some(e=>(""+e).toLowerCase()===t)||u.push(t)}),u.length)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.error.notType",[u.join(", ")]),status:"error"}))}t.length?d(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")})},ue=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),(t=ne(t)).length)&&ae(e,t),D.isDragUploadStatus=!1},ne=e=>{const t=[];return _xeUtils.default.arrayEach(e,e=>{e=e.getAsFile();e&&t.push(e)}),t},h=e=>{const p=B.value,v=f.value;e=e.$event;_ui.VxeUI.modal&&(_ui.VxeUI.modal.open({id:r.moreId,title:p?(0,_ui.getI18n)("vxe.upload.morePopup.readTitle"):(0,_ui.getI18n)("vxe.upload.morePopup."+(v?"imageTitle":"fileTitle")),width:660,height:500,escClosable:!0,showMaximize:!0,resize:!0,maskClosable:!0,slots:{default(){var{showErrorStatus:e,dragToUpload:t,dragSort:o}=T,{isActivated:i,isDragMove:l,isDragUploadStatus:a,dragIndex:u}=D;const n=D["fileList"];var r=L.value,s=S.moreContent||S["more-content"],d={};return t&&-1===u&&(d.onDragover=le,d.onDragleave=ie,d.onDrop=ue),(0,_vue.h)("div",Object.assign({ref:m,class:["vxe-upload--more-popup",{"is--readonly":p,"is--disabled":r,"is--active":i,"show--error":e,"is--drag":a}]},d),s?(0,_vn.getSlotVNs)(s({options:n})):[v?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--image-more-list"},{default:()=>y(n,!0).concat(I(!0))}):(0,_vue.h)("div",{class:"vxe-upload--image-more-list"},y(n,!0).concat(I(!0))):(0,_vue.h)("div",{class:"vxe-upload--file-more-list"},[w(!0),o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>x(n,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},x(n,!0))]),o?(0,_vue.h)("div",{ref:_,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(N),a?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(N)])}},onShow(){D.showMorePopup=!0},onHide({$event:e}){D.showMorePopup=!1,e&&R("more-visible",{visible:!1},e)}}),e)&&R("more-visible",{visible:!0},e)},re=(e,t,o)=>{var i,l=D["showMorePopup"],a=g.value,u=m.value,u=l?u:a;u&&(a=u.getBoundingClientRect(),u=c.value,i=_.value,l=l?i:u)&&(i=t.getBoundingClientRect(),l.style.display="block",l.style.top=Math.max(1,i.y-a.y)+"px",l.style.left=Math.max(1,i.x-a.x)+"px",l.style.height=i.height+"px",l.style.width=i.width-1+"px",l.setAttribute("drag-pos",o))},se=()=>{var e=c.value,t=_.value;e&&(e.style.display=""),t&&(t.style.display="")},de=e=>{e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0);const t=e.currentTarget;e=t.parentElement,e=_xeUtils.default.findIndexOf(Array.from(e.children),e=>t===e);D.isDragMove=!0,D.dragIndex=e,setTimeout(()=>{D.isDragMove=!1},500)},pe=t=>{t.stopPropagation(),t.preventDefault();var o=D["dragIndex"];if(-1!==o){var i=f.value;const a=t.currentTarget;var l=a.parentElement,l=_xeUtils.default.findIndexOf(Array.from(l.children),e=>a===e);let e="";e=i?t.clientX-a.getBoundingClientRect().x<a.clientWidth/2?"left":"right":t.clientY-a.getBoundingClientRect().y<a.clientHeight/2?"top":"bottom",o===l?re(t,a,e):(re(t,a,e),r.prevDragIndex=l,r.prevDragPos=e)}},ve=e=>{var{fileList:t,dragIndex:o}=D,{prevDragIndex:i,prevDragPos:l}=r,a="bottom"===l||"right"===l?1:0,u=t[o];const n=t[i];u&&n&&(t.splice(o,1),i=_xeUtils.default.findIndexOf(t,e=>n===e)+a,t.splice(i,0,u),R("sort-dragend",{oldItem:u,newItem:n,dragPos:l,offsetIndex:a,_index:{newIndex:i,oldIndex:o}},e)),se(),D.dragIndex=-1},ge=e=>{i&&e.stopPropagation(),D.isActivated=!0},me=e=>{var t=T["pasteToUpload"],o=D["isActivated"];o&&t&&(o=e.clipboardData||e.originalEvent.clipboardData)&&(t=o["items"],t)&&(o=ne(t)).length&&(e.preventDefault(),ae(e,o))},ce=e=>{var t=g.value,o=m.value;let i=(0,_dom.getEventTargetNode)(e,t).flag;!i&&o&&(o=(t=o.parentElement||o)&&t.parentElement,i=(0,_dom.getEventTargetNode)(e,o).flag),D.isActivated=i},_e=()=>{D.isActivated=!1};t={dispatchEvent:R,choose(){return p(null)},submit(i){var e=T["maxSimultaneousUploads"],e=_xeUtils.default.toNumber(e||1)||1;const{fileList:t,fileCacheMaps:l}=D,o=t.filter(e=>{e=k(e),e=l[e];return e&&("pending"===e.status||i&&"error"===e.status)}),a=e=>{var t=k(e),t=l[t];if(t){var o=t.file;if(o&&("pending"===t.status||i&&"error"===t.status))return t.loading=!0,t.percent=0,G(e,o).then(u)}return u()},u=()=>{var e;return o.length?(e=o[0],o.splice(0,1),a(e).then(u)):Promise.resolve()};return Promise.all(o.splice(0,e).map(a)).then(()=>{})},getMoreVisible(){return D.showMorePopup},openMore(){return h({$event:new Event("click")}),(0,_vue.nextTick)()},openMoreByEvent(e){return h({$event:e}),(0,_vue.nextTick)()},closeMore(){return _ui.VxeUI.modal&&_ui.VxeUI.modal.close(r.moreId),(0,_vue.nextTick)()}};Object.assign(N,t,{});const x=(e,r)=>{const{showRemoveButton:s,showDownloadButton:d,showProgress:p,progressText:v,showPreview:g,showErrorStatus:m,dragSort:c,autoSubmit:_,showSubmitButton:f}=T,{fileList:h,fileCacheMaps:x}=D,w=L.value,y=B.value,I=P.value,b=V.value,C=S.option,U=S.corner,E=S.name,M={};return c&&1<e.length&&(M.onDragstart=de,M.onDragover=pe,M.onDragend=ve),e.map((l,t)=>{var e=k(l),o=x[e];let i=!1,a=!1,u=!1;var n=""+(l[I]||"");return o&&(i=o.loading,a="error"===o.status,u="pending"===o.status),(0,_vue.h)("div",Object.assign({key:c?e:t,class:["vxe-upload--file-item",{"is--preview":g,"is--loading":i,"is--pending":u,"is--error":a}],fileid:e,draggable:!!c||null},M),C?(0,_vn.getSlotVNs)(C({option:l,isMoreView:r,options:h})):[(0,_vue.h)("div",{class:"vxe-upload--file-item-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_"+(""+l[b]).toLocaleUpperCase()]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),(0,_vue.h)("div",{class:"vxe-upload--file-item-name",title:n,onClick(e){var t,o;i||a||(t=l,o=T.previewMethod||(0,_ui.getConfig)().upload.previewMethod,T.showPreview&&(o?o({$upload:N,option:t}):J(t)))}},E?(0,_vn.getSlotVNs)(E({option:l,isMoreView:r,options:h})):n),i?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(N),p&&i&&o?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-text"},v?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(v)?v({}):v),{percent:o.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[o.percent])):(0,_ui.renderEmptyElement)(N),!i&&(a&&m||u&&f&&!_)?(0,_vue.h)("div",{class:"vxe-upload--file-item-rebtn"},[(0,_vue.h)(_button.default,{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"),onClick(){Z(l)}})]):(0,_ui.renderEmptyElement)(N),(0,_vue.h)("div",{class:"vxe-upload--file-item-btn-wrapper"},[U?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(U({option:l,isMoreView:r,options:h,readonly:y}))):(0,_ui.renderEmptyElement)(N),!d||i||u?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--file-item-download-btn",onClick(e){{var t=e,o=l;e=T.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;const i=T.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!e||e({$upload:N,option:o})).then(e=>{e?i?Promise.resolve(i({$upload:N,option:o})).then(()=>{oe(t,o)}).catch(e=>e):oe(t,o):R("download-fail",{option:o},t)})}}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]),!s||y||w||i?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--file-item-remove-btn",onClick(e){te(e,l,t)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},w=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=T,n=D["fileList"],r=L.value,s=B.value,d=Q.value,p=X.value,v=C.value,g=S.default,m=S.tip||S.hint;return s||!t?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--file-action"},[u&&v?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--file-action-btn",onClick:ee},g?(0,_vn.getSlotVNs)(g({isMoreView:e,options:n,$upload:N})):[(0,_vue.h)(_button.default,{class:"vxe-upload--file-action-button",content:e||l?o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:a?i||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:r})]),d&&(p||m)?(0,_vue.h)("div",{class:"vxe-upload--file-action-tip"},m?(0,_vn.getSlotVNs)(m({isMoreView:e,options:n,$upload:N})):""+p):(0,_ui.renderEmptyElement)(N)])},y=(e,l)=>{const{showRemoveButton:r,showProgress:s,progressText:d,showPreview:p,showErrorStatus:v,dragSort:g,autoSubmit:m,showSubmitButton:c}=T,{fileList:_,fileCacheMaps:f}=D,h=L.value,x=B.value,w=a.value,y=W.value,I=S.option,b=S.corner,C={onMousedown:ge};return g&&1<e.length&&(C.onDragstart=de,C.onDragover=pe,C.onDragend=ve),e.map((t,a)=>{var e=k(t),o=f[e];let u=!1,n=!1,i=!1;return o&&(u=o.loading,n="error"===o.status,i="pending"===o.status),(0,_vue.h)("div",Object.assign({key:g?e:a,class:["vxe-upload--image-item",{"is--preview":p,"is--circle":w.circle,"is--loading":u,"is--pending":i,"is--error":n}],fileid:e,draggable:!!g||null},C),I?(0,_vn.getSlotVNs)(I({option:t,isMoreView:l,options:_})):[(0,_vue.h)("div",{class:"vxe-upload--image-item-box",style:l?null:y,onClick(e){if(!u&&!n){var t=a;var o=T["showDownloadButton"];const i=D["fileList"],l=T.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;T.showPreview&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:i.map(e=>q(e)),activeIndex:t,showDownloadButton:o,beforeDownloadMethod:l?({index:e})=>l({$upload:N,option:i[e]}):void 0})}}},[u&&o?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading"},[(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),s?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-text"},d?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(d)?d({}):d),{percent:o.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[o.percent])):(0,_ui.renderEmptyElement)(N)]):(0,_ui.renderEmptyElement)(N),(0,_vue.h)("div",{class:"vxe-upload--image-item-img-wrapper",title:(0,_ui.getI18n)("vxe.upload.viewItemTitle")},[(0,_vue.h)("img",{class:"vxe-upload--image-item-img",src:(e=t,(o=T.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod)?o({$upload:N,option:e}):q(e))})]),!u&&(n&&v||i&&c&&!m)?(0,_vue.h)("div",{class:"vxe-upload--image-item-rebtn"},[(0,_vue.h)(_button.default,{icon:n?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:n?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload"),onClick(){Z(t)}})]):(0,_ui.renderEmptyElement)(N),(0,_vue.h)("div",{class:"vxe-upload--image-item-btn-wrapper",onClick(e){e.stopPropagation()}},[b?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(b({option:t,isMoreView:l,options:_,readonly:x}))):(0,_ui.renderEmptyElement)(N),!r||x||h||u?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--image-item-remove-btn",onClick(e){e.stopPropagation(),te(e,t,a)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},I=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=T,n=D["fileList"],r=B.value,s=Q.value,d=X.value,p=C.value,v=W.value,g=S.default,m=S.tip||S.hint;return r||!t||u&&p?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{key:"action",class:"vxe-upload--image-action"},[(0,_vue.h)("div",{class:"vxe-upload--image-action-btn",onClick:ee},g?g({isMoreView:e,options:n,$upload:N}):[(0,_vue.h)("div",{class:"vxe-upload--image-action-box",style:e?null:v},[a?(0,_vue.h)("div",{class:"vxe-upload--image-action-icon"},[(0,_vue.h)("i",{class:i||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_ui.renderEmptyElement)(N),e||l?(0,_vue.h)("div",{class:"vxe-upload--image-action-content"},o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_ui.renderEmptyElement)(N),s&&(d||m)?(0,_vue.h)("div",{class:"vxe-upload--image-action-hint"},m?(0,_vn.getSlotVNs)(m({isMoreView:e,options:n,$upload:N})):""+d):(0,_ui.renderEmptyElement)(N)])])])};const o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>T.modelValue?T.modelValue.length:0,()=>{o.value++}),(0,_vue.watch)(()=>T.modelValue,()=>{o.value++}),(0,_vue.watch)(o,()=>{s()}),(0,_vue.onMounted)(()=>{T.multiple&&T.singleMode&&(0,_log.errLog)("vxe.error.errConflicts",["[upload] multiple","single-mode"]),T.imageStyle&&(0,_log.warnLog)("vxe.error.delProp",["[upload] image-style","image-config"]),T.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(N,"paste",me),_ui.globalEvents.on(N,"mousedown",ce),_ui.globalEvents.on(N,"blur",_e)}),(0,_vue.onUnmounted)(()=>{D.isDragUploadStatus=!1,_ui.globalEvents.off(N,"paste"),_ui.globalEvents.off(N,"mousedown"),_ui.globalEvents.off(N,"blur")}),s(),N.renderVN=()=>{var{showErrorStatus:e,dragToUpload:t,pasteToUpload:o,dragSort:i}=T,{isDragUploadStatus:l,showMorePopup:a,isActivated:u,dragIndex:n}=D,r=b.value,s=L.value,d=B.value,p=f.value,v={onMousedown:ge};return t&&-1===n&&(v.onDragover=le,v.onDragleave=ie,v.onDrop=ue),(0,_vue.h)("div",Object.assign({ref:g,class:["vxe-upload",{["size--"+r]:r,"is--active":u,"is--readonly":d,"is--disabled":s,"is--paste":o,"show--error":e,"is--drag":l}]},v),[(p?()=>{var{showList:e,dragSort:t}=T;const{fileList:o,isDragMove:i}=D;var l=K.value;const a=S.moreButton||S["more-button"],{maxCount:u,showMoreButton:n}=l;let r=o,s=0;return u&&o.length>u&&(s=o.length-u,r=o.slice(0,u)),(0,_vue.h)("div",{key:"image",class:"vxe-upload--image-wrapper"},e?[t?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(i?"":"-disabled"),tag:"div",class:"vxe-upload--image-list"},{default:()=>y(r,!1).concat([n&&s?(0,_vue.h)("div",{key:"om",class:"vxe-upload--image-over-more"},a?(0,_vn.getSlotVNs)(a({options:o})):[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:h})]):(0,_ui.renderEmptyElement)(N),I(!1)])}):(0,_vue.h)("div",{class:"vxe-upload--image-list"},y(r,!1).concat([n&&s?(0,_vue.h)("div",{class:"vxe-upload--image-over-more"},a?(0,_vn.getSlotVNs)(a({options:o})):[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:h})]):(0,_ui.renderEmptyElement)(N),I(!1)]))]:[(0,_vue.h)("div",{class:"vxe-upload--image-list"},[I(!1)])])}:()=>{var{showList:e,moreConfig:t,dragSort:o}=T,{fileList:i,isDragMove:l}=D,{maxCount:a,showMoreButton:u,layout:n}=K.value,n="horizontal"===n,r=S.moreButton||S["more-button"];let s=i,d=0;return a&&i.length>a&&(d=i.length-a,s=i.slice(0,a)),(0,_vue.h)("div",{key:"all",class:"vxe-upload--file-wrapper"},e?[u&&t&&n?(0,_ui.renderEmptyElement)(N):w(!0),s.length||u&&n?(0,_vue.h)("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":n}]},[s.length?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>x(s,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},x(s,!1)):(0,_ui.renderEmptyElement)(N),u&&d?(0,_vue.h)("div",{class:"vxe-upload--file-over-more"},r?(0,_vn.getSlotVNs)(r({options:i})):[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[i.length]),status:"primary",onClick:h})]):(0,_ui.renderEmptyElement)(N),u&&t&&n?w(!1):(0,_ui.renderEmptyElement)(N)]):(0,_ui.renderEmptyElement)(N)]:[w(!1)])})(),i?(0,_vue.h)("div",{ref:c,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(N),l&&!a?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(N)])},N},render(){return this.renderVN()}});
|
package/package.json
CHANGED
|
@@ -1087,7 +1087,7 @@ export default defineVxeComponent({
|
|
|
1087
1087
|
dtPanelValue = XEUtils.getWhatDay(Date.now(), 0, 'first')
|
|
1088
1088
|
if (defaultTime) {
|
|
1089
1089
|
const defTime = toStringTimeDate(defaultTime)
|
|
1090
|
-
if (defTime) {
|
|
1090
|
+
if (XEUtils.isValidDate(defTime)) {
|
|
1091
1091
|
dtPanelValue.setHours(defTime.getHours())
|
|
1092
1092
|
dtPanelValue.setMinutes(defTime.getMinutes())
|
|
1093
1093
|
dtPanelValue.setSeconds(defTime.getSeconds())
|
|
@@ -235,6 +235,9 @@ export default defineVxeComponent({
|
|
|
235
235
|
if (XEUtils.isArray(defaultDate)) {
|
|
236
236
|
return defaultDate
|
|
237
237
|
}
|
|
238
|
+
if (`${defaultDate}`.indexOf(',') > -1) {
|
|
239
|
+
return `${defaultDate}`.split(',')
|
|
240
|
+
}
|
|
238
241
|
return [defaultDate, defaultDate]
|
|
239
242
|
}
|
|
240
243
|
return []
|
|
@@ -246,6 +249,9 @@ export default defineVxeComponent({
|
|
|
246
249
|
if (XEUtils.isArray(defaultTime)) {
|
|
247
250
|
return defaultTime
|
|
248
251
|
}
|
|
252
|
+
if (`${defaultTime}`.indexOf(',') > -1) {
|
|
253
|
+
return `${defaultTime}`.split(',')
|
|
254
|
+
}
|
|
249
255
|
return [defaultTime, defaultTime]
|
|
250
256
|
}
|
|
251
257
|
return []
|