vxe-pc-ui 4.6.45 → 4.6.47
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/icon/style.css +1 -1
- package/es/index.esm.js +6 -0
- package/es/input/src/input.js +4 -2
- package/es/language/ar-EG.js +1 -0
- package/es/language/de-DE.js +1 -0
- package/es/language/en-US.js +1 -0
- package/es/language/es-ES.js +1 -0
- package/es/language/fr-FR.js +1 -0
- package/es/language/hu-HU.js +1 -0
- package/es/language/hy-AM.js +1 -0
- package/es/language/id-ID.js +1 -0
- package/es/language/it-IT.js +1 -0
- package/es/language/ja-JP.js +1 -0
- package/es/language/ko-KR.js +1 -0
- package/es/language/ms-MY.js +1 -0
- package/es/language/nb-NO.js +1 -0
- package/es/language/pt-BR.js +1 -0
- package/es/language/ru-RU.js +1 -0
- package/es/language/th-TH.js +1 -0
- package/es/language/ug-CN.js +1 -0
- package/es/language/uk-UA.js +1 -0
- package/es/language/uz-UZ.js +1 -0
- package/es/language/vi-VN.js +1 -0
- package/es/language/zh-CHT.js +1 -0
- package/es/language/zh-CN.js +1 -0
- package/es/select/src/select.js +14 -3
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +5 -2
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +103 -44
- package/es/upload/style.css +45 -10
- package/es/upload/style.min.css +1 -1
- package/es/vxe-upload/style.css +45 -10
- package/es/vxe-upload/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.common.js +6 -0
- package/lib/index.umd.js +123 -37
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +4 -1
- package/lib/input/src/input.min.js +1 -1
- package/lib/language/ar-EG.js +1 -0
- package/lib/language/ar-EG.min.js +1 -1
- package/lib/language/ar-EG.umd.js +1 -0
- package/lib/language/de-DE.js +1 -0
- package/lib/language/de-DE.min.js +1 -1
- package/lib/language/de-DE.umd.js +1 -0
- package/lib/language/en-US.js +1 -0
- package/lib/language/en-US.min.js +1 -1
- package/lib/language/en-US.umd.js +1 -0
- package/lib/language/es-ES.js +1 -0
- package/lib/language/es-ES.min.js +1 -1
- package/lib/language/es-ES.umd.js +1 -0
- package/lib/language/fr-FR.js +1 -0
- package/lib/language/fr-FR.min.js +1 -1
- package/lib/language/fr-FR.umd.js +1 -0
- package/lib/language/hu-HU.js +1 -0
- package/lib/language/hu-HU.min.js +1 -1
- package/lib/language/hu-HU.umd.js +1 -0
- package/lib/language/hy-AM.js +1 -0
- package/lib/language/hy-AM.min.js +1 -1
- package/lib/language/hy-AM.umd.js +1 -0
- package/lib/language/id-ID.js +1 -0
- package/lib/language/id-ID.min.js +1 -1
- package/lib/language/id-ID.umd.js +1 -0
- package/lib/language/it-IT.js +1 -0
- package/lib/language/it-IT.min.js +1 -1
- package/lib/language/it-IT.umd.js +1 -0
- package/lib/language/ja-JP.js +1 -0
- package/lib/language/ja-JP.min.js +1 -1
- package/lib/language/ja-JP.umd.js +1 -0
- package/lib/language/ko-KR.js +1 -0
- package/lib/language/ko-KR.min.js +1 -1
- package/lib/language/ko-KR.umd.js +1 -0
- package/lib/language/ms-MY.js +1 -0
- package/lib/language/ms-MY.min.js +1 -1
- package/lib/language/ms-MY.umd.js +1 -0
- package/lib/language/nb-NO.js +1 -0
- package/lib/language/nb-NO.min.js +1 -1
- package/lib/language/nb-NO.umd.js +1 -0
- package/lib/language/pt-BR.js +1 -0
- package/lib/language/pt-BR.min.js +1 -1
- package/lib/language/pt-BR.umd.js +1 -0
- package/lib/language/ru-RU.js +1 -0
- package/lib/language/ru-RU.min.js +1 -1
- package/lib/language/ru-RU.umd.js +1 -0
- package/lib/language/th-TH.js +1 -0
- package/lib/language/th-TH.min.js +1 -1
- package/lib/language/th-TH.umd.js +1 -0
- package/lib/language/ug-CN.js +1 -0
- package/lib/language/ug-CN.min.js +1 -1
- package/lib/language/ug-CN.umd.js +1 -0
- package/lib/language/uk-UA.js +1 -0
- package/lib/language/uk-UA.min.js +1 -1
- package/lib/language/uk-UA.umd.js +1 -0
- package/lib/language/uz-UZ.js +1 -0
- package/lib/language/uz-UZ.min.js +1 -1
- package/lib/language/uz-UZ.umd.js +1 -0
- package/lib/language/vi-VN.js +1 -0
- package/lib/language/vi-VN.min.js +1 -1
- package/lib/language/vi-VN.umd.js +1 -0
- package/lib/language/zh-CHT.js +1 -0
- package/lib/language/zh-CHT.min.js +1 -1
- package/lib/language/zh-CHT.umd.js +1 -0
- package/lib/language/zh-CN.js +1 -0
- package/lib/language/zh-CN.min.js +1 -1
- package/lib/language/zh-CN.umd.js +1 -0
- package/lib/select/src/select.js +12 -3
- package/lib/select/src/select.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +5 -2
- 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 +100 -30
- package/lib/upload/src/upload.min.js +1 -1
- package/lib/upload/style/style.css +45 -10
- package/lib/upload/style/style.min.css +1 -1
- package/lib/vxe-upload/style/style.css +45 -10
- package/lib/vxe-upload/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/index.ts +21 -0
- package/packages/input/src/input.ts +4 -2
- package/packages/language/ar-EG.ts +1 -0
- package/packages/language/de-DE.ts +1 -0
- package/packages/language/en-US.ts +1 -0
- package/packages/language/es-ES.ts +1 -0
- package/packages/language/fr-FR.ts +1 -0
- package/packages/language/hu-HU.ts +1 -0
- package/packages/language/hy-AM.ts +1 -0
- package/packages/language/id-ID.ts +1 -0
- package/packages/language/it-IT.ts +1 -0
- package/packages/language/ja-JP.ts +1 -0
- package/packages/language/ko-KR.ts +1 -0
- package/packages/language/ms-MY.ts +1 -0
- package/packages/language/nb-NO.ts +1 -0
- package/packages/language/pt-BR.ts +1 -0
- package/packages/language/ru-RU.ts +1 -0
- package/packages/language/th-TH.ts +1 -0
- package/packages/language/ug-CN.ts +1 -0
- package/packages/language/uk-UA.ts +1 -0
- package/packages/language/uz-UZ.ts +1 -0
- package/packages/language/vi-VN.ts +1 -0
- package/packages/language/zh-CHT.ts +1 -0
- package/packages/language/zh-CN.ts +1 -0
- package/packages/select/src/select.ts +13 -3
- package/packages/ui/index.ts +4 -1
- package/packages/upload/src/upload.ts +106 -46
- package/styles/components/upload.scss +74 -25
- package/types/components/column.d.ts +6 -6
- package/types/components/input.d.ts +2 -0
- package/types/components/table-plugins/filters-combination.d.ts +15 -0
- package/types/components/table-plugins/filters-complex-input.d.ts +9 -0
- package/types/components/table-plugins/index.d.ts +2 -0
- package/types/components/upload.d.ts +14 -1
- package/types/ui/global-icon.d.ts +1 -0
- package/types/ui/renderer.d.ts +3 -0
- /package/es/icon/{iconfont.1751536878019.ttf → iconfont.1751618343421.ttf} +0 -0
- /package/es/icon/{iconfont.1751536878019.woff → iconfont.1751618343421.woff} +0 -0
- /package/es/icon/{iconfont.1751536878019.woff2 → iconfont.1751618343421.woff2} +0 -0
- /package/es/{iconfont.1751536878019.ttf → iconfont.1751618343421.ttf} +0 -0
- /package/es/{iconfont.1751536878019.woff → iconfont.1751618343421.woff} +0 -0
- /package/es/{iconfont.1751536878019.woff2 → iconfont.1751618343421.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1751536878019.ttf → iconfont.1751618343421.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1751536878019.woff → iconfont.1751618343421.woff} +0 -0
- /package/lib/icon/style/{iconfont.1751536878019.woff2 → iconfont.1751618343421.woff2} +0 -0
- /package/lib/{iconfont.1751536878019.ttf → iconfont.1751618343421.ttf} +0 -0
- /package/lib/{iconfont.1751536878019.woff → iconfont.1751618343421.woff} +0 -0
- /package/lib/{iconfont.1751536878019.woff2 → iconfont.1751618343421.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.6.
|
|
29
|
+
const version = exports.version = "4.6.47";
|
|
30
30
|
_core.VxeUI.uiVersion = version;
|
|
31
31
|
_core.VxeUI.dynamicApp = _dynamics.dynamicApp;
|
|
32
32
|
function config(options) {
|
|
@@ -397,7 +397,9 @@ _core.VxeUI.setup = setup;
|
|
|
397
397
|
dragToUpload: true,
|
|
398
398
|
// imageConfig: {},
|
|
399
399
|
showLimitSize: true,
|
|
400
|
-
showLimitCount: true
|
|
400
|
+
showLimitCount: true,
|
|
401
|
+
autoSubmit: true,
|
|
402
|
+
maxSimultaneousUploads: 5
|
|
401
403
|
},
|
|
402
404
|
watermark: {
|
|
403
405
|
rotate: -30,
|
|
@@ -500,6 +502,7 @@ const iconPrefix = 'vxe-icon-';
|
|
|
500
502
|
UPLOAD_FILE_ADD: iconPrefix + 'upload',
|
|
501
503
|
UPLOAD_FILE_REMOVE: iconPrefix + 'delete',
|
|
502
504
|
UPLOAD_FILE_DOWNLOAD: iconPrefix + 'download',
|
|
505
|
+
UPLOAD_IMAGE_UPLOAD: iconPrefix + 'upload',
|
|
503
506
|
UPLOAD_IMAGE_RE_UPLOAD: iconPrefix + 'repeat',
|
|
504
507
|
UPLOAD_IMAGE_ADD: iconPrefix + 'add',
|
|
505
508
|
UPLOAD_IMAGE_REMOVE: iconPrefix + 'close',
|
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.6.45";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:{showMessage:!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},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}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{destroyOnClose:!0},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:100,oSize:2}},split:{resize:!0,itemConfig:{minWidth:40,minHeight:40}},splitPane:{},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:{},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0}},treeSelect:{treeConfig:{radioConfig:{},checkboxConfig:{}}},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},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{}});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_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_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",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.6.47";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:{showMessage:!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},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}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{destroyOnClose:!0},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:100,oSize:2}},split:{resize:!0,itemConfig:{minWidth:40,minHeight:40}},splitPane:{},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:{},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0}},treeSelect:{treeConfig:{radioConfig:{},checkboxConfig:{}}},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:{}});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_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",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.6.
|
|
8
|
+
const version = `ui v${"4.6.47"}`;
|
|
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.6.
|
|
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.6.47",warnLog=exports.warnLog=_core.log.create("warn",version),errLog=exports.errLog=_core.log.create("error",version);
|
package/lib/upload/src/upload.js
CHANGED
|
@@ -31,6 +31,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
31
31
|
type: Boolean,
|
|
32
32
|
default: null
|
|
33
33
|
},
|
|
34
|
+
autoSubmit: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: () => (0, _ui.getConfig)().upload.autoSubmit
|
|
37
|
+
},
|
|
34
38
|
mode: {
|
|
35
39
|
type: String,
|
|
36
40
|
default: () => (0, _ui.getConfig)().upload.mode
|
|
@@ -120,6 +124,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
120
124
|
type: [String, Number, Function],
|
|
121
125
|
default: () => (0, _ui.getConfig)().upload.progressText
|
|
122
126
|
},
|
|
127
|
+
showSubmitButton: Boolean,
|
|
123
128
|
autoHiddenButton: {
|
|
124
129
|
type: Boolean,
|
|
125
130
|
default: () => (0, _ui.getConfig)().upload.autoHiddenButton
|
|
@@ -160,6 +165,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
160
165
|
type: Boolean,
|
|
161
166
|
default: () => null
|
|
162
167
|
},
|
|
168
|
+
maxSimultaneousUploads: {
|
|
169
|
+
type: Number,
|
|
170
|
+
default: () => (0, _ui.getConfig)().upload.maxSimultaneousUploads
|
|
171
|
+
},
|
|
163
172
|
tipText: [String, Number, Function],
|
|
164
173
|
hintText: String,
|
|
165
174
|
previewMethod: Function,
|
|
@@ -563,6 +572,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
563
572
|
const cacheItem = fileCacheMaps[fileKey];
|
|
564
573
|
if (cacheItem) {
|
|
565
574
|
cacheItem.percent = 100;
|
|
575
|
+
cacheItem.status = 'success';
|
|
566
576
|
}
|
|
567
577
|
Object.assign(item, res);
|
|
568
578
|
dispatchEvent('upload-success', {
|
|
@@ -620,7 +630,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
620
630
|
if (uploadFn && cacheItem) {
|
|
621
631
|
const file = cacheItem.file;
|
|
622
632
|
cacheItem.loading = true;
|
|
623
|
-
cacheItem.status = '';
|
|
633
|
+
cacheItem.status = 'pending';
|
|
624
634
|
cacheItem.percent = 0;
|
|
625
635
|
handleUploadResult(item, file).then(() => {
|
|
626
636
|
if (urlMode) {
|
|
@@ -629,14 +639,15 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
629
639
|
});
|
|
630
640
|
}
|
|
631
641
|
};
|
|
632
|
-
const
|
|
642
|
+
const handleUploadFile = (files, evnt) => {
|
|
633
643
|
const {
|
|
634
644
|
multiple,
|
|
635
645
|
urlMode,
|
|
636
646
|
showLimitSize,
|
|
637
647
|
limitSizeText,
|
|
638
648
|
showLimitCount,
|
|
639
|
-
limitCountText
|
|
649
|
+
limitCountText,
|
|
650
|
+
autoSubmit
|
|
640
651
|
} = props;
|
|
641
652
|
const {
|
|
642
653
|
fileList
|
|
@@ -736,13 +747,13 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
736
747
|
if (uploadFn) {
|
|
737
748
|
cacheMaps[fileKey] = {
|
|
738
749
|
file: file,
|
|
739
|
-
loading:
|
|
740
|
-
status: '',
|
|
750
|
+
loading: !!autoSubmit,
|
|
751
|
+
status: 'pending',
|
|
741
752
|
percent: 0
|
|
742
753
|
};
|
|
743
754
|
}
|
|
744
755
|
const item = (0, _vue.reactive)(fileObj);
|
|
745
|
-
if (uploadFn) {
|
|
756
|
+
if (uploadFn && autoSubmit) {
|
|
746
757
|
uploadPromiseRests.push(handleUploadResult(item, file));
|
|
747
758
|
}
|
|
748
759
|
newFileList.push(item);
|
|
@@ -779,7 +790,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
779
790
|
multiple,
|
|
780
791
|
types: isImage ? imageTypes : fileTypes
|
|
781
792
|
}).then(params => {
|
|
782
|
-
|
|
793
|
+
handleUploadFile(params.files, evnt);
|
|
783
794
|
return params;
|
|
784
795
|
});
|
|
785
796
|
};
|
|
@@ -936,7 +947,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
936
947
|
}
|
|
937
948
|
return;
|
|
938
949
|
}
|
|
939
|
-
|
|
950
|
+
handleUploadFile(files, evnt);
|
|
940
951
|
};
|
|
941
952
|
const handleUploadDropEvent = evnt => {
|
|
942
953
|
const dataTransfer = evnt.dataTransfer;
|
|
@@ -1204,6 +1215,45 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1204
1215
|
dispatchEvent,
|
|
1205
1216
|
choose() {
|
|
1206
1217
|
return handleChoose(null);
|
|
1218
|
+
},
|
|
1219
|
+
submit(isFull) {
|
|
1220
|
+
const {
|
|
1221
|
+
maxSimultaneousUploads
|
|
1222
|
+
} = props;
|
|
1223
|
+
const msNum = _xeUtils.default.toNumber(maxSimultaneousUploads || 1) || 1;
|
|
1224
|
+
const {
|
|
1225
|
+
fileList,
|
|
1226
|
+
fileCacheMaps
|
|
1227
|
+
} = reactData;
|
|
1228
|
+
const allPendingList = fileList.filter(item => {
|
|
1229
|
+
const fileKey = getFieldKey(item);
|
|
1230
|
+
const cacheItem = fileCacheMaps[fileKey];
|
|
1231
|
+
return cacheItem && (cacheItem.status === 'pending' || isFull && cacheItem.status === 'error');
|
|
1232
|
+
});
|
|
1233
|
+
const handleSubmit = item => {
|
|
1234
|
+
const fileKey = getFieldKey(item);
|
|
1235
|
+
const cacheItem = fileCacheMaps[fileKey];
|
|
1236
|
+
if (cacheItem) {
|
|
1237
|
+
const file = cacheItem.file;
|
|
1238
|
+
if (file && (cacheItem.status === 'pending' || isFull && cacheItem.status === 'error')) {
|
|
1239
|
+
cacheItem.loading = true;
|
|
1240
|
+
cacheItem.percent = 0;
|
|
1241
|
+
return handleUploadResult(item, file).then(handleNextSubmit);
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
return handleNextSubmit();
|
|
1245
|
+
};
|
|
1246
|
+
const handleNextSubmit = () => {
|
|
1247
|
+
if (allPendingList.length) {
|
|
1248
|
+
const item = allPendingList[0];
|
|
1249
|
+
allPendingList.splice(0, 1);
|
|
1250
|
+
return handleSubmit(item).then(handleNextSubmit);
|
|
1251
|
+
}
|
|
1252
|
+
return Promise.resolve();
|
|
1253
|
+
};
|
|
1254
|
+
return Promise.all(allPendingList.splice(0, msNum).map(handleSubmit)).then(() => {
|
|
1255
|
+
// 完成
|
|
1256
|
+
});
|
|
1207
1257
|
}
|
|
1208
1258
|
};
|
|
1209
1259
|
const uploadPrivateMethods = {};
|
|
@@ -1216,7 +1266,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1216
1266
|
progressText,
|
|
1217
1267
|
showPreview,
|
|
1218
1268
|
showErrorStatus,
|
|
1219
|
-
dragSort
|
|
1269
|
+
dragSort,
|
|
1270
|
+
autoSubmit,
|
|
1271
|
+
showSubmitButton
|
|
1220
1272
|
} = props;
|
|
1221
1273
|
const {
|
|
1222
1274
|
fileCacheMaps
|
|
@@ -1235,13 +1287,21 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1235
1287
|
return currList.map((item, index) => {
|
|
1236
1288
|
const fileKey = getFieldKey(item);
|
|
1237
1289
|
const cacheItem = fileCacheMaps[fileKey];
|
|
1238
|
-
|
|
1239
|
-
|
|
1290
|
+
let isLoading = false;
|
|
1291
|
+
let isError = false;
|
|
1292
|
+
let isPending = false;
|
|
1293
|
+
const fileName = `${item[nameProp] || ''}`;
|
|
1294
|
+
if (cacheItem) {
|
|
1295
|
+
isLoading = cacheItem.loading;
|
|
1296
|
+
isError = cacheItem.status === 'error';
|
|
1297
|
+
isPending = cacheItem.status === 'pending';
|
|
1298
|
+
}
|
|
1240
1299
|
return (0, _vue.h)('div', Object.assign({
|
|
1241
1300
|
key: dragSort ? fileKey : index,
|
|
1242
1301
|
class: ['vxe-upload--file-item', {
|
|
1243
1302
|
'is--preview': showPreview,
|
|
1244
1303
|
'is--loading': isLoading,
|
|
1304
|
+
'is--pending': isPending,
|
|
1245
1305
|
'is--error': isError
|
|
1246
1306
|
}],
|
|
1247
1307
|
fileid: fileKey,
|
|
@@ -1252,12 +1312,13 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1252
1312
|
class: (0, _ui.getIcon)()[`UPLOAD_FILE_TYPE_${`${item[typeProp]}`.toLocaleUpperCase()}`] || (0, _ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT
|
|
1253
1313
|
})]), (0, _vue.h)('div', {
|
|
1254
1314
|
class: 'vxe-upload--file-item-name',
|
|
1315
|
+
title: fileName,
|
|
1255
1316
|
onClick(evnt) {
|
|
1256
1317
|
if (!isLoading && !isError) {
|
|
1257
1318
|
handlePreviewFileEvent(evnt, item);
|
|
1258
1319
|
}
|
|
1259
1320
|
}
|
|
1260
|
-
},
|
|
1321
|
+
}, fileName), isLoading ? (0, _vue.h)('div', {
|
|
1261
1322
|
class: 'vxe-upload--file-item-loading-icon'
|
|
1262
1323
|
}, [(0, _vue.h)('i', {
|
|
1263
1324
|
class: (0, _ui.getIcon)().UPLOAD_LOADING
|
|
@@ -1265,13 +1326,13 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1265
1326
|
class: 'vxe-upload--file-item-loading-text'
|
|
1266
1327
|
}, progressText ? _xeUtils.default.toFormatString(`${_xeUtils.default.isFunction(progressText) ? progressText({}) : progressText}`, {
|
|
1267
1328
|
percent: cacheItem.percent
|
|
1268
|
-
}) : (0, _ui.getI18n)('vxe.upload.uploadProgress', [cacheItem.percent])) : (0, _ui.renderEmptyElement)($xeUpload),
|
|
1269
|
-
class: 'vxe-upload--
|
|
1329
|
+
}) : (0, _ui.getI18n)('vxe.upload.uploadProgress', [cacheItem.percent])) : (0, _ui.renderEmptyElement)($xeUpload), !isLoading && (isError && showErrorStatus || isPending && showSubmitButton && !autoSubmit) ? (0, _vue.h)('div', {
|
|
1330
|
+
class: 'vxe-upload--file-item-rebtn'
|
|
1270
1331
|
}, [(0, _vue.h)(_button.default, {
|
|
1271
|
-
icon: (0, _ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD,
|
|
1332
|
+
icon: isError ? (0, _ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD : (0, _ui.getIcon)().UPLOAD_IMAGE_UPLOAD,
|
|
1272
1333
|
mode: 'text',
|
|
1273
1334
|
status: 'primary',
|
|
1274
|
-
content: (0, _ui.getI18n)('vxe.upload.reUpload'),
|
|
1335
|
+
content: isError ? (0, _ui.getI18n)('vxe.upload.reUpload') : (0, _ui.getI18n)('vxe.upload.manualUpload'),
|
|
1275
1336
|
onClick() {
|
|
1276
1337
|
handleReUpload(item);
|
|
1277
1338
|
}
|
|
@@ -1283,7 +1344,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1283
1344
|
option: item,
|
|
1284
1345
|
isMoreView,
|
|
1285
1346
|
readonly: formReadonly
|
|
1286
|
-
}))) : (0, _ui.renderEmptyElement)($xeUpload), showDownloadButton && !isLoading ? (0, _vue.h)('div', {
|
|
1347
|
+
}))) : (0, _ui.renderEmptyElement)($xeUpload), showDownloadButton && !(isLoading || isPending) ? (0, _vue.h)('div', {
|
|
1287
1348
|
class: 'vxe-upload--file-item-download-btn',
|
|
1288
1349
|
onClick(evnt) {
|
|
1289
1350
|
downloadFileEvent(evnt, item);
|
|
@@ -1391,7 +1452,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1391
1452
|
progressText,
|
|
1392
1453
|
showPreview,
|
|
1393
1454
|
showErrorStatus,
|
|
1394
|
-
dragSort
|
|
1455
|
+
dragSort,
|
|
1456
|
+
autoSubmit,
|
|
1457
|
+
showSubmitButton
|
|
1395
1458
|
} = props;
|
|
1396
1459
|
const {
|
|
1397
1460
|
fileCacheMaps
|
|
@@ -1412,14 +1475,21 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1412
1475
|
return currList.map((item, index) => {
|
|
1413
1476
|
const fileKey = getFieldKey(item);
|
|
1414
1477
|
const cacheItem = fileCacheMaps[fileKey];
|
|
1415
|
-
|
|
1416
|
-
|
|
1478
|
+
let isLoading = false;
|
|
1479
|
+
let isError = false;
|
|
1480
|
+
let isPending = false;
|
|
1481
|
+
if (cacheItem) {
|
|
1482
|
+
isLoading = cacheItem.loading;
|
|
1483
|
+
isError = cacheItem.status === 'error';
|
|
1484
|
+
isPending = cacheItem.status === 'pending';
|
|
1485
|
+
}
|
|
1417
1486
|
return (0, _vue.h)('div', Object.assign({
|
|
1418
1487
|
key: dragSort ? fileKey : index,
|
|
1419
1488
|
class: ['vxe-upload--image-item', {
|
|
1420
1489
|
'is--preview': showPreview,
|
|
1421
1490
|
'is--circle': imageOpts.circle,
|
|
1422
1491
|
'is--loading': isLoading,
|
|
1492
|
+
'is--pending': isPending,
|
|
1423
1493
|
'is--error': isError
|
|
1424
1494
|
}],
|
|
1425
1495
|
fileid: fileKey,
|
|
@@ -1427,7 +1497,6 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1427
1497
|
}, ons), [(0, _vue.h)('div', {
|
|
1428
1498
|
class: 'vxe-upload--image-item-box',
|
|
1429
1499
|
style: isMoreView ? null : imgStyle,
|
|
1430
|
-
title: (0, _ui.getI18n)('vxe.upload.viewItemTitle'),
|
|
1431
1500
|
onClick(evnt) {
|
|
1432
1501
|
if (!isLoading && !isError) {
|
|
1433
1502
|
handlePreviewImageEvent(evnt, item, index);
|
|
@@ -1443,21 +1512,22 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1443
1512
|
class: 'vxe-upload--image-item-loading-text'
|
|
1444
1513
|
}, progressText ? _xeUtils.default.toFormatString(`${_xeUtils.default.isFunction(progressText) ? progressText({}) : progressText}`, {
|
|
1445
1514
|
percent: cacheItem.percent
|
|
1446
|
-
}) : (0, _ui.getI18n)('vxe.upload.uploadProgress', [cacheItem.percent])) : (0, _ui.renderEmptyElement)($xeUpload)]) : (0, _ui.renderEmptyElement)($xeUpload),
|
|
1447
|
-
class: 'vxe-upload--image-item-
|
|
1515
|
+
}) : (0, _ui.getI18n)('vxe.upload.uploadProgress', [cacheItem.percent])) : (0, _ui.renderEmptyElement)($xeUpload)]) : (0, _ui.renderEmptyElement)($xeUpload), (0, _vue.h)('div', {
|
|
1516
|
+
class: 'vxe-upload--image-item-img-wrapper',
|
|
1517
|
+
title: (0, _ui.getI18n)('vxe.upload.viewItemTitle')
|
|
1518
|
+
}, [(0, _vue.h)('img', {
|
|
1519
|
+
class: 'vxe-upload--image-item-img',
|
|
1520
|
+
src: getThumbnailFileUrl(item)
|
|
1521
|
+
})]), !isLoading && (isError && showErrorStatus || isPending && showSubmitButton && !autoSubmit) ? (0, _vue.h)('div', {
|
|
1522
|
+
class: 'vxe-upload--image-item-rebtn'
|
|
1448
1523
|
}, [(0, _vue.h)(_button.default, {
|
|
1449
|
-
icon: (0, _ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD,
|
|
1524
|
+
icon: isError ? (0, _ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD : (0, _ui.getIcon)().UPLOAD_IMAGE_UPLOAD,
|
|
1450
1525
|
mode: 'text',
|
|
1451
1526
|
status: 'primary',
|
|
1452
|
-
content: (0, _ui.getI18n)('vxe.upload.reUpload'),
|
|
1527
|
+
content: isError ? (0, _ui.getI18n)('vxe.upload.reUpload') : (0, _ui.getI18n)('vxe.upload.manualUpload'),
|
|
1453
1528
|
onClick() {
|
|
1454
1529
|
handleReUpload(item);
|
|
1455
1530
|
}
|
|
1456
|
-
})]) : (0, _vue.h)('div', {
|
|
1457
|
-
class: 'vxe-upload--image-item-img-wrapper'
|
|
1458
|
-
}, [(0, _vue.h)('img', {
|
|
1459
|
-
class: 'vxe-upload--image-item-img',
|
|
1460
|
-
src: getThumbnailFileUrl(item)
|
|
1461
1531
|
})]) : (0, _ui.renderEmptyElement)($xeUpload), (0, _vue.h)('div', {
|
|
1462
1532
|
class: 'vxe-upload--image-item-btn-wrapper',
|
|
1463
1533
|
onClick(evnt) {
|
|
@@ -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},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,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},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},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(E,e){const{emit:u,slots:w}=e,U=(0,_vue.inject)("$xeForm",null),b=(0,_vue.inject)("xeFormItemInfo",null),i=(0,_vue.inject)("$xeTable",null);var t=_xeUtils.default.uniqueId();const R=(0,_ui.useSize)(E)["computeSize"],g=(0,_vue.ref)(),v=(0,_vue.ref)(),m=(0,_vue.ref)(),c=(0,_vue.ref)(),T=(0,_vue.reactive)({isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}),r={imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1},l={refElem:g},C=(0,_vue.computed)(()=>{var e=E["readonly"];return null===e?!!U&&U.props.readonly:e}),I=(0,_vue.computed)(()=>{var e=E["disabled"];return null===e?!!U&&U.props.disabled:e}),M=(0,_vue.computed)(()=>E.keyField||"_X_KEY"),_=(0,_vue.computed)(()=>"image"===E.mode),D=(0,_vue.computed)(()=>E.nameField||"name"),S=(0,_vue.computed)(()=>E.typeField||"type"),B=(0,_vue.computed)(()=>E.urlField||"url"),L=(0,_vue.computed)(()=>E.sizeField||"size"),$=(0,_vue.computed)(()=>1024*_xeUtils.default.toNumber(E.limitSize)*1024),P=(0,_vue.computed)(()=>E.multiple?_xeUtils.default.toNumber(E.limitCount):1),f=(0,_vue.computed)(()=>{var e=E["multiple"],t=T["fileList"],o=P.value;return e?!o||t.length>=o:1<=t.length}),q=(0,_vue.computed)(()=>{var e=_xeUtils.default.toNumber(E.limitSize);return e?1048576<e?e/1048576+"T":1024<e?e/1024+"G":e+"M":""}),G=(0,_vue.computed)(()=>{var{showTip:e,tipText:t}=E;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t}),H=(0,_vue.computed)(()=>{var{limitSize:e,fileTypes:t,multiple:o,limitCount:i}=E,l=E.tipText||E.hintText,a=_.value,u=q.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({},E.imageConfig||E.imageStyle)),Y=(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}),Q=(0,_vue.computed)(()=>Object.assign({showMoreButton:!0},E.moreConfig)),d={},F={xID:t,props:E,context:e,reactData:T,internalData:r,getRefMaps:()=>l,getComputeMaps:()=>d},O=()=>_xeUtils.default.uniqueId(),A=e=>{return e[M.value]},s=()=>{var{modelValue:e,multiple:t}=E,o=C.value;const l=M.value,a=D.value,u=S.value,n=B.value,r=L.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]:"")||V(i),[n]:t,[r]:_xeUtils.default.toNumber(o?o.searchQuery[r]:0)||0,[l]:O()}}const i=e[a]||"";return e[a]=i,e[u]=e[u]||V(i),e[n]=e[n]||"",e[r]=e[r]||0,e[l]=e[l]||O(),e}):[];T.fileList=o||t?e:e.slice(0,1)},V=e=>{var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},z=(e,t,o)=>{u(e,(0,_ui.createEvent)(o,{$upload:F},t))},j=e=>{var{singleMode:t,urlMode:o}=E;const i=B.value,l=D.value;let a=e?e.slice(0):[];o&&(a=a.map(e=>{var t=e[i];if(t&&!_xeUtils.default.parseUrl(t).searchQuery[l])return""+t+(-1===t.indexOf("?")?"?":"&")+l+"="+encodeURIComponent(e[l]||"");return t})),u("update:modelValue",t?a[0]||null:a)},X=e=>{var t=E.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod;return t?t({$upload:F,option:e}):n(e)},n=e=>{var t=E.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=B.value;return t?t({$upload:F,option:e}):e[o]},W=(e,t)=>{var o=E.previewMethod||(0,_ui.getConfig)().upload.previewMethod;if(E.showPreview)if(o)o({$upload:F,option:t});else{var i=t;var{imageTypes:o,showDownloadButton:t}=E;const a=S.value,u=E.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;var l=r["imagePreviewTypes"];l.concat(o||[]).some(e=>(""+e).toLowerCase()===(""+i[a]).toLowerCase())&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:[n(i)],showDownloadButton:t,beforeDownloadMethod:u?()=>u({$upload:F,option:i}):void 0})}},K=(e,t,o)=>{var i=E["showDownloadButton"];const l=T["fileList"],a=E.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;E.showPreview&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:l.map(e=>n(e)),activeIndex:o,showDownloadButton:i,beforeDownloadMethod:a?({index:e})=>a({$upload:F,option:l[e]}):void 0})},J=(o,e)=>{const i=E["showErrorStatus"],l=A(o);var t=E.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?Promise.resolve(t({$upload:F,file:e,option:o,updateProgress(e){var t=T["fileCacheMaps"],t=t[A(o)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(e=>{var t=T["fileCacheMaps"],t=t[l];t&&(t.percent=100),Object.assign(o,e),z("upload-success",{option:o,data:e},null)}).catch(e=>{var t=T["fileCacheMaps"],t=t[l];t&&(t.status="error"),i?Object.assign(o,e):T.fileList=T.fileList.filter(e=>A(e)!==l),z("upload-error",{option:o,data:e},null)}).finally(()=>{var e=T["fileCacheMaps"],e=e[l];e&&(e.loading=!1)}):(t=T["fileCacheMaps"],(e=t[l])&&(e.loading=!1),Promise.resolve())},Z=e=>{const{uploadMethod:t,urlMode:o}=E;var i,l=T["fileCacheMaps"],l=l[A(e)];(t||(0,_ui.getConfig)().upload.uploadMethod)&&l&&(i=l.file,l.loading=!0,l.status="",l.percent=0,J(e,i).then(()=>{o&&j(T.fileList)}))},p=(t,i)=>{var{multiple:e,urlMode:o,showLimitSize:l,limitSizeText:a,showLimitCount:u,limitCountText:n}=E,r=T["fileList"];const d=E.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,s=M.value,p=D.value,v=S.value,g=B.value,m=L.value;var c=$.value;const _=P.value;var f=q.value;let h=t;if(e&&_){if(u&&r.length>=_)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:_}):n):(0,_ui.getI18n)("vxe.upload.overCountErr",[_])}));const C=h.length-(_-r.length);if(u&&0<C){const I=h.slice(_-r.length);n?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:""+(_xeUtils.default.isFunction(n)?n({maxCount:_}):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",[_,C])),(0,_vue.h)("div",{class:"vxe-upload--file-message-over-extra"},I.map((e,t)=>(0,_vue.h)("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)))])}}})}h=h.slice(0,_-r.length)}if(l&&c)for(let e=0;e<t.length;e++)if(t[0].size>c)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:c}):a):(0,_ui.getI18n)("vxe.upload.overSizeErr",[f])}));const x=Object.assign({},T.fileCacheMaps),y=e?r:[],w=[];h.forEach(e=>{var t=e["name"],o=O(),t={[p]:t,[v]:V(t),[m]:e.size,[g]:URL.createObjectURL(e),[s]:o},o=(d&&(x[o]={file:e,loading:!0,status:"",percent:0}),(0,_vue.reactive)(t));d&&w.push(J(o,e)),y.push(o),z("add",{option:o},i)}),T.fileList=y,T.fileCacheMaps=x,Promise.all(o?w:[]).then(()=>{j(y),U&&b&&U.triggerItemEvent(i,b.itemConfig.field,y)})},ee=t=>{var{multiple:e,imageTypes:o,fileTypes:i}=E,l=I.value,a=_.value;return l?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:a?o:i}).then(e=>(p(e.files,t),e))},te=e=>{ee(e).catch(()=>{})},oe=(e,t,o)=>{var i=T["fileList"];i.splice(o,1),j(i),U&&b&&U.triggerItemEvent(e,b.itemConfig.field,i),z("remove",{option:t},e)},ie=(t,o,i)=>{var e=E.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod;const l=E.removeMethod||(0,_ui.getConfig)().upload.removeMethod;Promise.resolve(!e||e({$upload:F,option:o})).then(e=>{e?l?Promise.resolve(l({$upload:F,option:o})).then(()=>{oe(t,o,i)}).catch(e=>e):oe(t,o,i):z("remove-fail",{option:o},t)})},le=(e,t)=>{z("download",{option:t},e)},ae=(t,o)=>{var e=E.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;const i=E.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!e||e({$upload:F,option:o})).then(e=>{e?i?Promise.resolve(i({$upload:F,option:o})).then(()=>{le(t,o)}).catch(e=>e):le(t,o):z("download-fail",{option:o},t)})},ue=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)&&(T.isDragUploadStatus=!1)},ne=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),T.isDragUploadStatus=!0)},re=(e,t)=>{const{imageTypes:o,fileTypes:i}=E;var l=r["imagePreviewTypes"];if(_.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=V(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),T.isDragUploadStatus=!1},se=e=>{const t=[];return _xeUtils.default.arrayEach(e,e=>{e=e.getAsFile();e&&t.push(e)}),t},h=()=>{const s=C.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}=E,{isActivated:i,isDragMove:l,isDragUploadStatus:a,dragIndex:u}=T;const n=T["fileList"];var r=I.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":a}]},d),[p?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--image-more-list"},{default:()=>k(n,!0).concat(N(!0))}):(0,_vue.h)("div",{class:"vxe-upload--image-more-list"},k(n,!0).concat(N(!0))):(0,_vue.h)("div",{class:"vxe-upload--file-more-list"},[y(!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:c,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(F),a?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(F)])}},onShow(){T.showMorePopup=!0},onHide(){T.showMorePopup=!1}})},pe=(e,t,o)=>{var i,l=T["showMorePopup"],a=g.value,u=v.value,u=l?u:a;u&&(a=u.getBoundingClientRect(),u=m.value,i=c.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))},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);T.isDragMove=!0,T.dragIndex=e,setTimeout(()=>{T.isDragMove=!1},500)},ge=t=>{t.stopPropagation(),t.preventDefault();var o=T["dragIndex"];if(-1!==o){var i=_.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?pe(0,a,e):(pe(0,a,e),r.prevDragIndex=l,r.prevDragPos=e)}},me=e=>{var{fileList:t,dragIndex:o}=T,{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),z("sort-dragend",{oldItem:u,newItem:n,dragPos:l,offsetIndex:a,_index:{newIndex:i,oldIndex:o}},e)),t=m.value,u=c.value,t&&(t.style.display=""),u&&(u.style.display=""),T.dragIndex=-1},ce=e=>{i&&e.stopPropagation(),T.isActivated=!0},_e=e=>{var t=E["pasteToUpload"],o=T["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),T.isActivated=i},he=()=>{T.isActivated=!1};t={dispatchEvent:z,choose(){return ee(null)}};Object.assign(F,t,{});const x=(e,u)=>{const{showRemoveButton:n,showDownloadButton:r,showProgress:d,progressText:s,showPreview:p,showErrorStatus:v,dragSort:g}=E,m=T["fileCacheMaps"],c=I.value,_=C.value,f=D.value,h=S.value,x=w.corner,y={};return g&&1<e.length&&(y.onDragstart=ve,y.onDragover=ge,y.onDragend=me),e.map((t,o)=>{var e=A(t),i=m[e];const l=i&&i.loading,a=i&&"error"===i.status;return(0,_vue.h)("div",Object.assign({key:g?e:o,class:["vxe-upload--file-item",{"is--preview":p,"is--loading":l,"is--error":a}],fileid:e,draggable:!!g||null},y),[(0,_vue.h)("div",{class:"vxe-upload--file-item-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_"+(""+t[h]).toLocaleUpperCase()]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),(0,_vue.h)("div",{class:"vxe-upload--file-item-name",onClick(e){l||a||W(e,t)}},""+(t[f]||"")),l?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(F),d&&l&&i?(0,_vue.h)("div",{class:"vxe-upload--file-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)(F),v&&a?(0,_vue.h)("div",{class:"vxe-upload--image-item-error"},[(0,_vue.h)(_button.default,{icon:(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD,mode:"text",status:"primary",content:(0,_ui.getI18n)("vxe.upload.reUpload"),onClick(){Z(t)}})]):(0,_ui.renderEmptyElement)(F),(0,_vue.h)("div",{class:"vxe-upload--file-item-btn-wrapper"},[x?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(x({option:t,isMoreView:u,readonly:_}))):(0,_ui.renderEmptyElement)(F),r&&!l?(0,_vue.h)("div",{class:"vxe-upload--file-item-download-btn",onClick(e){ae(e,t)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]):(0,_ui.renderEmptyElement)(F),!n||_||c||l?(0,_ui.renderEmptyElement)(F):(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})])])])})},y=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=E,n=I.value,r=C.value,d=G.value,s=H.value,p=f.value,v=w.default,g=w.tip||w.hint;return r||!t?(0,_ui.renderEmptyElement)(F):(0,_vue.h)("div",{class:"vxe-upload--file-action"},[u&&p?(0,_ui.renderEmptyElement)(F):(0,_vue.h)("div",{class:"vxe-upload--file-action-btn",onClick:te},v?(0,_vn.getSlotVNs)(v({$upload:F})):[(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:n})]),d&&(s||g)?(0,_vue.h)("div",{class:"vxe-upload--file-action-tip"},g?(0,_vn.getSlotVNs)(g({$upload:F})):""+s):(0,_ui.renderEmptyElement)(F)])},k=(e,u)=>{const{showRemoveButton:n,showProgress:r,progressText:d,showPreview:s,showErrorStatus:p,dragSort:v}=E,g=T["fileCacheMaps"],m=I.value,c=C.value,_=a.value,f=Y.value,h=w.corner,x={onMousedown:ce};return v&&1<e.length&&(x.onDragstart=ve,x.onDragover=ge,x.onDragend=me),e.map((t,o)=>{var e=A(t),i=g[e];const l=i&&i.loading,a=i&&"error"===i.status;return(0,_vue.h)("div",Object.assign({key:v?e:o,class:["vxe-upload--image-item",{"is--preview":s,"is--circle":_.circle,"is--loading":l,"is--error":a}],fileid:e,draggable:!!v||null},x),[(0,_vue.h)("div",{class:"vxe-upload--image-item-box",style:u?null:f,title:(0,_ui.getI18n)("vxe.upload.viewItemTitle"),onClick(e){l||a||K(e,t,o)}},[l&&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})]),r?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-text"},d?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(d)?d({}):d),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(F)]):(0,_ui.renderEmptyElement)(F),l?(0,_ui.renderEmptyElement)(F):a&&p?(0,_vue.h)("div",{class:"vxe-upload--image-item-error"},[(0,_vue.h)(_button.default,{icon:(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD,mode:"text",status:"primary",content:(0,_ui.getI18n)("vxe.upload.reUpload"),onClick(){Z(t)}})]):(0,_vue.h)("div",{class:"vxe-upload--image-item-img-wrapper"},[(0,_vue.h)("img",{class:"vxe-upload--image-item-img",src:X(t)})]),(0,_vue.h)("div",{class:"vxe-upload--image-item-btn-wrapper",onClick(e){e.stopPropagation()}},[h?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(h({option:t,isMoreView:u,readonly:c}))):(0,_ui.renderEmptyElement)(F),!n||c||m||l?(0,_ui.renderEmptyElement)(F):(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})])])])])})},N=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=E,n=C.value,r=G.value,d=H.value,s=f.value,p=Y.value,v=w.default,g=w.tip||w.hint;return n||!t||u&&s?(0,_ui.renderEmptyElement)(F):(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:F}):[(0,_vue.h)("div",{class:"vxe-upload--image-action-box",style:e?null:p},[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)(F),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)(F),r&&(d||g)?(0,_vue.h)("div",{class:"vxe-upload--image-action-hint"},g?(0,_vn.getSlotVNs)(g({$upload:F})):""+d):(0,_ui.renderEmptyElement)(F)])])])};const o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>E.modelValue?E.modelValue.length:0,()=>{o.value++}),(0,_vue.watch)(()=>E.modelValue,()=>{o.value++}),(0,_vue.watch)(o,()=>{s()}),(0,_vue.onMounted)(()=>{E.multiple&&E.singleMode&&(0,_log.errLog)("vxe.error.errConflicts",["multiple","single-mode"]),E.imageStyle&&(0,_log.warnLog)("vxe.error.delProp",["image-style","image-config"]),E.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(F,"paste",_e),_ui.globalEvents.on(F,"mousedown",fe),_ui.globalEvents.on(F,"blur",he)}),(0,_vue.onUnmounted)(()=>{T.isDragUploadStatus=!1,_ui.globalEvents.off(F,"paste"),_ui.globalEvents.off(F,"mousedown"),_ui.globalEvents.off(F,"blur")}),s(),F.renderVN=()=>{var{showErrorStatus:e,dragToUpload:t,pasteToUpload:o,dragSort:i}=E,{isDragUploadStatus:l,showMorePopup:a,isActivated:u,dragIndex:n}=T,r=R.value,d=I.value,s=C.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":l}]},v),[(p?()=>{var{showList:e,dragSort:t}=E;const{fileList:o,isDragMove:i}=T,{maxCount:l,showMoreButton:a}=Q.value;let u=o,n=0;return l&&o.length>l&&(n=o.length-l,u=o.slice(0,l)),(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:()=>k(u,!1).concat([a&&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:h})]):(0,_ui.renderEmptyElement)(F),N(!1)])}):(0,_vue.h)("div",{class:"vxe-upload--image-list"},k(u,!1).concat([a&&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:h})]):(0,_ui.renderEmptyElement)(F),N(!1)]))]:[(0,_vue.h)("div",{class:"vxe-upload--image-list"},[N(!1)])])}:()=>{var{showList:e,moreConfig:t,dragSort:o}=E,{fileList:i,isDragMove:l}=T,{maxCount:a,showMoreButton:u,layout:n}=Q.value,n="horizontal"===n;let r=i,d=0;return a&&i.length>a&&(d=i.length-a,r=i.slice(0,a)),(0,_vue.h)("div",{key:"all",class:"vxe-upload--file-wrapper"},e?[u&&t&&n?(0,_ui.renderEmptyElement)(F):y(!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"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>x(r,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},x(r,!1)):(0,_ui.renderEmptyElement)(F),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:h})]):(0,_ui.renderEmptyElement)(F),u&&t&&n?y(!1):(0,_ui.renderEmptyElement)(F)]):(0,_ui.renderEmptyElement)(F)]:[y(!1)])})(),i?(0,_vue.h)("div",{ref:m,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(F),l&&!a?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(F)])},F},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,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,M=(0,_vue.inject)("$xeForm",null),T=(0,_vue.inject)("xeFormItemInfo",null),i=(0,_vue.inject)("$xeTable",null);var t=_xeUtils.default.uniqueId();const I=(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?!!M&&M.props.readonly:e}),B=(0,_vue.computed)(()=>{var e=U["disabled"];return null===e?!!M&&M.props.disabled:e}),L=(0,_vue.computed)(()=>U.keyField||"_X_KEY"),_=(0,_vue.computed)(()=>"image"===U.mode),P=(0,_vue.computed)(()=>U.nameField||"name"),F=(0,_vue.computed)(()=>U.typeField||"type"),A=(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),C=(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=F.value,n=A.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,urlMode:o}=U;const i=A.value,a=P.value;let l=e?e.slice(0):[];o&&(l=l.map(e=>{var t=e[i];if(t&&!_xeUtils.default.parseUrl(t).searchQuery[a])return""+t+(-1===t.indexOf("?")?"?":"&")+a+"="+encodeURIComponent(e[a]||"");return t})),u("update:modelValue",t?l[0]||null:l)},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=A.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=F.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,i)=>{const{multiple:e,urlMode:o,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=F.value,m=A.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 C=x.length-(f-d.length);if(u&&0<C){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,C])),(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:[],I=[];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&&I.push(q(o,e)),w.push(o),R("add",{option:o},i)}),D.fileList=w,D.fileCacheMaps=y,Promise.all(o?I:[]).then(()=>{$(w),M&&T&&M.triggerItemEvent(i,T.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),M&&T&&M.triggerItemEvent(e,T.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,I=F.value,C=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[I]).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"},[C?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(C({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=C.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,I={onMousedown:ce};return g&&1<e.length&&(I.onDragstart=ve,I.onDragover=ge,I.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},I),[(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=C.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",["multiple","single-mode"]),U.imageStyle&&(0,_log.warnLog)("vxe.error.delProp",["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=I.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()}});
|