vxe-pc-ui 4.10.29 → 4.10.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/es/icon/style.css +1 -1
  2. package/es/style.css +1 -1
  3. package/es/style.min.css +1 -1
  4. package/es/ui/index.js +1 -1
  5. package/es/ui/src/dom.js +1 -1
  6. package/es/ui/src/log.js +1 -1
  7. package/es/upload/src/upload.js +8 -4
  8. package/lib/icon/style/style.css +1 -1
  9. package/lib/icon/style/style.min.css +1 -1
  10. package/lib/index.umd.js +13 -7
  11. package/lib/index.umd.min.js +1 -1
  12. package/lib/style.css +1 -1
  13. package/lib/style.min.css +1 -1
  14. package/lib/ui/index.js +1 -1
  15. package/lib/ui/index.min.js +1 -1
  16. package/lib/ui/src/dom.js +1 -1
  17. package/lib/ui/src/dom.min.js +1 -1
  18. package/lib/ui/src/log.js +1 -1
  19. package/lib/ui/src/log.min.js +1 -1
  20. package/lib/upload/src/upload.js +10 -4
  21. package/lib/upload/src/upload.min.js +1 -1
  22. package/package.json +2 -2
  23. package/packages/ui/src/dom.ts +1 -1
  24. package/packages/upload/src/upload.ts +8 -4
  25. package/types/components/grid.d.ts +10 -0
  26. package/types/components/upload.d.ts +2 -0
  27. /package/es/icon/{iconfont.1763715246712.ttf → iconfont.1764123661446.ttf} +0 -0
  28. /package/es/icon/{iconfont.1763715246712.woff → iconfont.1764123661446.woff} +0 -0
  29. /package/es/icon/{iconfont.1763715246712.woff2 → iconfont.1764123661446.woff2} +0 -0
  30. /package/es/{iconfont.1763715246712.ttf → iconfont.1764123661446.ttf} +0 -0
  31. /package/es/{iconfont.1763715246712.woff → iconfont.1764123661446.woff} +0 -0
  32. /package/es/{iconfont.1763715246712.woff2 → iconfont.1764123661446.woff2} +0 -0
  33. /package/lib/icon/style/{iconfont.1763715246712.ttf → iconfont.1764123661446.ttf} +0 -0
  34. /package/lib/icon/style/{iconfont.1763715246712.woff → iconfont.1764123661446.woff} +0 -0
  35. /package/lib/icon/style/{iconfont.1763715246712.woff2 → iconfont.1764123661446.woff2} +0 -0
  36. /package/lib/{iconfont.1763715246712.ttf → iconfont.1764123661446.ttf} +0 -0
  37. /package/lib/{iconfont.1763715246712.woff → iconfont.1764123661446.woff} +0 -0
  38. /package/lib/{iconfont.1763715246712.woff2 → iconfont.1764123661446.woff2} +0 -0
package/lib/ui/index.js CHANGED
@@ -26,7 +26,7 @@ Object.keys(_core).forEach(function (key) {
26
26
  });
27
27
  var _dynamics = require("../dynamics");
28
28
  var _log = require("./src/log");
29
- const version = exports.version = "4.10.29";
29
+ const version = exports.version = "4.10.31";
30
30
  _core.VxeUI.uiVersion = version;
31
31
  _core.VxeUI.dynamicApp = _dynamics.dynamicApp;
32
32
  function config(options) {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={version:!0,config:!0,setup:!0},_core=(exports.config=config,exports.default=void 0,exports.setup=setup,exports.version=void 0,require("@vxe-ui/core")),_dynamics=(Object.keys(_core).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_core[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _core[e]}})}),require("../dynamics")),_log=require("./src/log");const version=exports.version="4.10.29";function config(e){return(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return(0,_log.warnLog)("vxe.error.delFunc",["setup","setConfig"]),(0,_core.setConfig)(e)}_core.VxeUI.uiVersion=version,_core.VxeUI.dynamicApp=_dynamics.dynamicApp,_core.VxeUI.config=config,_core.VxeUI.setup=setup,(0,_core.setConfig)({alert:{},anchor:{},anchorLink:{},avatar:{},badge:{},breadcrumb:{separator:"/"},breadcrumbItem:{},button:{trigger:"hover",prefixTooltip:{enterable:!0},suffixTooltip:{enterable:!0}},buttonGroup:{},calendar:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1},card:{border:!0,padding:!0},carousel:{height:200,loop:!0,interval:5e3},carouselItem:{},checkbox:{},checkboxButton:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},countdown:{},colorPicker:{type:"rgb",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePanel:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1},datePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,autoClose:!0,showClearButton:null,showConfirmButton:null},dateRangePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,separator:" ~ ",autoClose:!0,showClearButton:null,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showErrorMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{showPreview:!0,showPrintButton:!0,maskClosable:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{virtualYConfig:{enabled:!0,gt:100}},loading:{showIcon:!0,showText:!0},menu:{},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controlConfig:{enabled:!0,layout:"right",showButton:!0,isWheel:!0,isArrow:!0}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},splitter:{resize:!0,itemConfig:{minWidth:40,minHeight:40},resizeConfig:{showTip:!0}},splitterPanel:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tabs:{},tag:{},textEllipsis:{underline:!0},text:{copyConfig:{showMessage:!0}},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},treeSelect:{autoClose:!0,virtualYConfig:{enabled:!0,gt:0,oSize:2},treeConfig:{maxHeight:300,radioConfig:{},checkboxConfig:{},filterConfig:{autoExpandAll:!0}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0,showLimitSize:!0,showLimitCount:!0,autoSubmit:!0,maxSimultaneousUploads:5},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{},gantt:{}});const iconPrefix="vxe-icon-";(0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",SELECT_ADD_OPTION:iconPrefix+"add",ICON_PICKER_OPEN:iconPrefix+"caret-down rotate180",ICON_PICKER_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",RADIO_CHECKED:iconPrefix+"radio-checked-fill",RADIO_UNCHECKED:iconPrefix+"radio-unchecked",RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",INPUT_PLUS_NUM:iconPrefix+"caret-up",INPUT_MINUS_NUM:iconPrefix+"caret-down",NUMBER_INPUT_MINUS_NUM:iconPrefix+"minus",NUMBER_INPUT_PLUS_NUM:iconPrefix+"add",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_VALID_ERROR_ICON:iconPrefix+"warning-circle-fill",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_UPLOAD:iconPrefix+"upload",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_TOP:iconPrefix+"arrow-up",TABS_TAB_BUTTON_BOTTOM:iconPrefix+"arrow-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",TAG_CLOSE:iconPrefix+"close",TAG_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_PICKER_COLOR_COPY:iconPrefix+"copy",COLOR_PICKER_EYE_DROPPER:iconPrefix+"dropper",COLOR_PICKER_TPTY_OPEN:iconPrefix+"arrow-down rotate180",COLOR_PICKER_TPTY_CLOSE:iconPrefix+"arrow-down",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right"});var _default=exports.default=_core.VxeUI;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={version:!0,config:!0,setup:!0},_core=(exports.config=config,exports.default=void 0,exports.setup=setup,exports.version=void 0,require("@vxe-ui/core")),_dynamics=(Object.keys(_core).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_core[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _core[e]}})}),require("../dynamics")),_log=require("./src/log");const version=exports.version="4.10.31";function config(e){return(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return(0,_log.warnLog)("vxe.error.delFunc",["setup","setConfig"]),(0,_core.setConfig)(e)}_core.VxeUI.uiVersion=version,_core.VxeUI.dynamicApp=_dynamics.dynamicApp,_core.VxeUI.config=config,_core.VxeUI.setup=setup,(0,_core.setConfig)({alert:{},anchor:{},anchorLink:{},avatar:{},badge:{},breadcrumb:{separator:"/"},breadcrumbItem:{},button:{trigger:"hover",prefixTooltip:{enterable:!0},suffixTooltip:{enterable:!0}},buttonGroup:{},calendar:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1},card:{border:!0,padding:!0},carousel:{height:200,loop:!0,interval:5e3},carouselItem:{},checkbox:{},checkboxButton:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},countdown:{},colorPicker:{type:"rgb",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePanel:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1},datePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,autoClose:!0,showClearButton:null,showConfirmButton:null},dateRangePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,separator:" ~ ",autoClose:!0,showClearButton:null,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showErrorMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{showPreview:!0,showPrintButton:!0,maskClosable:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{virtualYConfig:{enabled:!0,gt:100}},loading:{showIcon:!0,showText:!0},menu:{},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controlConfig:{enabled:!0,layout:"right",showButton:!0,isWheel:!0,isArrow:!0}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},splitter:{resize:!0,itemConfig:{minWidth:40,minHeight:40},resizeConfig:{showTip:!0}},splitterPanel:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tabs:{},tag:{},textEllipsis:{underline:!0},text:{copyConfig:{showMessage:!0}},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},treeSelect:{autoClose:!0,virtualYConfig:{enabled:!0,gt:0,oSize:2},treeConfig:{maxHeight:300,radioConfig:{},checkboxConfig:{},filterConfig:{autoExpandAll:!0}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0,showLimitSize:!0,showLimitCount:!0,autoSubmit:!0,maxSimultaneousUploads:5},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{},gantt:{}});const iconPrefix="vxe-icon-";(0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",SELECT_ADD_OPTION:iconPrefix+"add",ICON_PICKER_OPEN:iconPrefix+"caret-down rotate180",ICON_PICKER_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",RADIO_CHECKED:iconPrefix+"radio-checked-fill",RADIO_UNCHECKED:iconPrefix+"radio-unchecked",RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",INPUT_PLUS_NUM:iconPrefix+"caret-up",INPUT_MINUS_NUM:iconPrefix+"caret-down",NUMBER_INPUT_MINUS_NUM:iconPrefix+"minus",NUMBER_INPUT_PLUS_NUM:iconPrefix+"add",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_VALID_ERROR_ICON:iconPrefix+"warning-circle-fill",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_UPLOAD:iconPrefix+"upload",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_TOP:iconPrefix+"arrow-up",TABS_TAB_BUTTON_BOTTOM:iconPrefix+"arrow-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",TAG_CLOSE:iconPrefix+"close",TAG_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_PICKER_COLOR_COPY:iconPrefix+"copy",COLOR_PICKER_EYE_DROPPER:iconPrefix+"dropper",COLOR_PICKER_TPTY_OPEN:iconPrefix+"arrow-down rotate180",COLOR_PICKER_TPTY_CLOSE:iconPrefix+"arrow-down",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right"});var _default=exports.default=_core.VxeUI;
package/lib/ui/src/dom.js CHANGED
@@ -61,7 +61,7 @@ function getNodeOffset(elem, container, rest) {
61
61
  return rest;
62
62
  }
63
63
  function isPx(val) {
64
- return val && /^\d+(\.\d+)?px?$/.test(val);
64
+ return val && /^\d+(\.\d+)?(px)?$/.test(val);
65
65
  }
66
66
  function isScale(val) {
67
67
  return val && /^\d+(\.\d+)?%$/.test(val);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addClass=addClass,exports.getAbsolutePos=getAbsolutePos,exports.getDomNode=getDomNode,exports.getEventTargetNode=getEventTargetNode,exports.getOffsetPos=getOffsetPos,exports.getPaddingLeftRightSize=getPaddingLeftRightSize,exports.getPaddingTopBottomSize=getPaddingTopBottomSize,exports.getTpImg=getTpImg,exports.hasClass=hasClass,exports.hasControlKey=hasControlKey,exports.initTpImg=initTpImg,exports.isNodeElement=isNodeElement,exports.isPx=isPx,exports.isScale=isScale,exports.removeClass=removeClass,exports.scrollToView=scrollToView,exports.toCssUnit=toCssUnit,exports.triggerEvent=triggerEvent,exports.updatePanelPlacement=updatePanelPlacement;var _xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let tpImgEl;function initTpImg(){return tpImgEl||((tpImgEl=new Image).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),tpImgEl}function getTpImg(){return tpImgEl||initTpImg()}const reClsMap={};function getClsRE(e){return reClsMap[e]||(reClsMap[e]=new RegExp(`(?:^|\\s)${e}(?!\\S)`,"g")),reClsMap[e]}function getNodeOffset(e,t,o){if(e){var s=e.parentNode;if(o.top+=e.offsetTop,o.left+=e.offsetLeft,s&&s!==document.documentElement&&s!==document.body&&(o.top-=s.scrollTop,o.left-=s.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return getNodeOffset(e.offsetParent,t,o)}return o}function isPx(e){return e&&/^\d+(\.\d+)?px?$/.test(e)}function isScale(e){return e&&/^\d+(\.\d+)?%$/.test(e)}function hasClass(e,t){return!!(e&&e.className&&e.className.match&&e.className.match(getClsRE(t)))}function removeClass(e,t){e&&hasClass(e,t)&&(e.className=e.className.replace(getClsRE(t),""))}function addClass(e,t){e&&!hasClass(e,t)&&(removeClass(e,t),e.className=e.className+" "+t)}function hasControlKey(e){return e.ctrlKey||e.metaKey}function toCssUnit(e,t="px"){return _xeUtils.default.isNumber(e)||/^\d+$/.test(""+e)?""+e+t:""+(e||"")}function getDomNode(){var e=document.documentElement,t=document.body;return{scrollTop:e.scrollTop||t.scrollTop,scrollLeft:e.scrollLeft||t.scrollLeft,visibleHeight:e.clientHeight||t.clientHeight,visibleWidth:e.clientWidth||t.clientWidth}}function getEventTargetNode(e,t,o,s){let i,n=e.target.shadowRoot&&e.composed&&e.composedPath()[0]||e.target;for(;n&&n.nodeType&&n!==document;){if(o&&hasClass(n,o)&&(!s||s(n)))i=n;else if(n===t)return{flag:!o||!!i,container:t,targetElem:i};n=n.parentNode}return{flag:!1}}function getOffsetPos(e,t){return getNodeOffset(e,t,{left:0,top:0})}function getAbsolutePos(e){var e=e.getBoundingClientRect(),t=e.top,e=e.left,{scrollTop:o,scrollLeft:s,visibleHeight:i,visibleWidth:n}=getDomNode();return{boundingTop:t,top:o+t,boundingLeft:e,left:s+e,visibleHeight:i,visibleWidth:n}}function getPaddingTopBottomSize(e){return e?(e=getComputedStyle(e),_xeUtils.default.toNumber(e.paddingTop)+_xeUtils.default.toNumber(e.paddingBottom)):0}function getPaddingLeftRightSize(e){return e?(e=getComputedStyle(e),_xeUtils.default.toNumber(e.paddingLeft)+_xeUtils.default.toNumber(e.paddingRight)):0}const scrollIntoViewIfNeeded="scrollIntoViewIfNeeded",scrollIntoView="scrollIntoView";function scrollToView(e){e&&(e[scrollIntoViewIfNeeded]?e[scrollIntoViewIfNeeded]():e[scrollIntoView]&&e[scrollIntoView]())}function triggerEvent(e,t){e&&e.dispatchEvent(new Event(t))}function isNodeElement(e){return e&&1===e.nodeType}function updatePanelPlacement(e,t,o){var{placement:o,teleportTo:s,marginSize:i}=Object.assign({teleportTo:!1,marginSize:18},o);let n="bottom",l="",r="",a="";var d,g,f,u,p,c,m,h="",C={};return t&&e&&(m=document.documentElement,d=document.body,g=e.offsetHeight,f=t.offsetHeight,u=t.offsetWidth,t=t.getBoundingClientRect(),p=e.getBoundingClientRect(),c=m.clientHeight||d.clientHeight,m=m.clientWidth||d.clientWidth,h=e.offsetWidth,s?(a=p.left,l=p.top+g,"top"===o?(n="top",l=p.top-f):o||(l+f+i>c&&(n="top",l=p.top-f),l<i&&(n="bottom",l=p.top+g)),a+u+i>m&&(a-=a+u+i-m),a<i&&(a=i)):("top"===o?(n="top",r=g):o||(l=g,p.top+p.height+i>c&&p.top-g-f>i&&(n="top",l="",r=g)),t.left+t.width+i>m&&(a=-(t.left+t.width+i-m))),_xeUtils.default.isNumber(l)&&(C.top=toCssUnit(l)),_xeUtils.default.isNumber(r)&&(C.bottom=toCssUnit(r)),_xeUtils.default.isNumber(a)&&(C.left=toCssUnit(a)),_xeUtils.default.isNumber("")&&(C.right=toCssUnit("")),_xeUtils.default.isNumber(h))&&(C.minWidth=toCssUnit(h)),{top:l||0,bottom:r||0,left:a||0,right:0,style:C,placement:n}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addClass=addClass,exports.getAbsolutePos=getAbsolutePos,exports.getDomNode=getDomNode,exports.getEventTargetNode=getEventTargetNode,exports.getOffsetPos=getOffsetPos,exports.getPaddingLeftRightSize=getPaddingLeftRightSize,exports.getPaddingTopBottomSize=getPaddingTopBottomSize,exports.getTpImg=getTpImg,exports.hasClass=hasClass,exports.hasControlKey=hasControlKey,exports.initTpImg=initTpImg,exports.isNodeElement=isNodeElement,exports.isPx=isPx,exports.isScale=isScale,exports.removeClass=removeClass,exports.scrollToView=scrollToView,exports.toCssUnit=toCssUnit,exports.triggerEvent=triggerEvent,exports.updatePanelPlacement=updatePanelPlacement;var _xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let tpImgEl;function initTpImg(){return tpImgEl||((tpImgEl=new Image).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),tpImgEl}function getTpImg(){return tpImgEl||initTpImg()}const reClsMap={};function getClsRE(e){return reClsMap[e]||(reClsMap[e]=new RegExp(`(?:^|\\s)${e}(?!\\S)`,"g")),reClsMap[e]}function getNodeOffset(e,t,o){if(e){var s=e.parentNode;if(o.top+=e.offsetTop,o.left+=e.offsetLeft,s&&s!==document.documentElement&&s!==document.body&&(o.top-=s.scrollTop,o.left-=s.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return getNodeOffset(e.offsetParent,t,o)}return o}function isPx(e){return e&&/^\d+(\.\d+)?(px)?$/.test(e)}function isScale(e){return e&&/^\d+(\.\d+)?%$/.test(e)}function hasClass(e,t){return!!(e&&e.className&&e.className.match&&e.className.match(getClsRE(t)))}function removeClass(e,t){e&&hasClass(e,t)&&(e.className=e.className.replace(getClsRE(t),""))}function addClass(e,t){e&&!hasClass(e,t)&&(removeClass(e,t),e.className=e.className+" "+t)}function hasControlKey(e){return e.ctrlKey||e.metaKey}function toCssUnit(e,t="px"){return _xeUtils.default.isNumber(e)||/^\d+$/.test(""+e)?""+e+t:""+(e||"")}function getDomNode(){var e=document.documentElement,t=document.body;return{scrollTop:e.scrollTop||t.scrollTop,scrollLeft:e.scrollLeft||t.scrollLeft,visibleHeight:e.clientHeight||t.clientHeight,visibleWidth:e.clientWidth||t.clientWidth}}function getEventTargetNode(e,t,o,s){let i,n=e.target.shadowRoot&&e.composed&&e.composedPath()[0]||e.target;for(;n&&n.nodeType&&n!==document;){if(o&&hasClass(n,o)&&(!s||s(n)))i=n;else if(n===t)return{flag:!o||!!i,container:t,targetElem:i};n=n.parentNode}return{flag:!1}}function getOffsetPos(e,t){return getNodeOffset(e,t,{left:0,top:0})}function getAbsolutePos(e){var e=e.getBoundingClientRect(),t=e.top,e=e.left,{scrollTop:o,scrollLeft:s,visibleHeight:i,visibleWidth:n}=getDomNode();return{boundingTop:t,top:o+t,boundingLeft:e,left:s+e,visibleHeight:i,visibleWidth:n}}function getPaddingTopBottomSize(e){return e?(e=getComputedStyle(e),_xeUtils.default.toNumber(e.paddingTop)+_xeUtils.default.toNumber(e.paddingBottom)):0}function getPaddingLeftRightSize(e){return e?(e=getComputedStyle(e),_xeUtils.default.toNumber(e.paddingLeft)+_xeUtils.default.toNumber(e.paddingRight)):0}const scrollIntoViewIfNeeded="scrollIntoViewIfNeeded",scrollIntoView="scrollIntoView";function scrollToView(e){e&&(e[scrollIntoViewIfNeeded]?e[scrollIntoViewIfNeeded]():e[scrollIntoView]&&e[scrollIntoView]())}function triggerEvent(e,t){e&&e.dispatchEvent(new Event(t))}function isNodeElement(e){return e&&1===e.nodeType}function updatePanelPlacement(e,t,o){var{placement:o,teleportTo:s,marginSize:i}=Object.assign({teleportTo:!1,marginSize:18},o);let n="bottom",l="",r="",a="";var d,g,f,u,p,c,m,h="",C={};return t&&e&&(m=document.documentElement,d=document.body,g=e.offsetHeight,f=t.offsetHeight,u=t.offsetWidth,t=t.getBoundingClientRect(),p=e.getBoundingClientRect(),c=m.clientHeight||d.clientHeight,m=m.clientWidth||d.clientWidth,h=e.offsetWidth,s?(a=p.left,l=p.top+g,"top"===o?(n="top",l=p.top-f):o||(l+f+i>c&&(n="top",l=p.top-f),l<i&&(n="bottom",l=p.top+g)),a+u+i>m&&(a-=a+u+i-m),a<i&&(a=i)):("top"===o?(n="top",r=g):o||(l=g,p.top+p.height+i>c&&p.top-g-f>i&&(n="top",l="",r=g)),t.left+t.width+i>m&&(a=-(t.left+t.width+i-m))),_xeUtils.default.isNumber(l)&&(C.top=toCssUnit(l)),_xeUtils.default.isNumber(r)&&(C.bottom=toCssUnit(r)),_xeUtils.default.isNumber(a)&&(C.left=toCssUnit(a)),_xeUtils.default.isNumber("")&&(C.right=toCssUnit("")),_xeUtils.default.isNumber(h))&&(C.minWidth=toCssUnit(h)),{top:l||0,bottom:r||0,left:a||0,right:0,style:C,placement:n}}
package/lib/ui/src/log.js CHANGED
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.warnLog = exports.errLog = void 0;
7
7
  var _core = require("@vxe-ui/core");
8
- const version = `ui v${"4.10.29"}`;
8
+ const version = `ui v${"4.10.31"}`;
9
9
  const warnLog = exports.warnLog = _core.log.create('warn', version);
10
10
  const errLog = exports.errLog = _core.log.create('error', version);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");const version="ui v4.10.29",warnLog=exports.warnLog=_core.log.create("warn",version),errLog=exports.errLog=_core.log.create("error",version);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");const version="ui v4.10.31",warnLog=exports.warnLog=_core.log.create("warn",version),errLog=exports.errLog=_core.log.create("error",version);
@@ -64,6 +64,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
64
64
  type: Boolean,
65
65
  default: () => _xeUtils.default.clone((0, _ui.getConfig)().upload.dragToUpload, true)
66
66
  },
67
+ dragPlaceholder: {
68
+ type: String,
69
+ default: () => (0, _ui.getConfig)().upload.dragPlaceholder
70
+ },
67
71
  pasteToUpload: {
68
72
  type: Boolean,
69
73
  default: () => _xeUtils.default.clone((0, _ui.getConfig)().upload.pasteToUpload, true)
@@ -1006,7 +1010,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
1006
1010
  const {
1007
1011
  showErrorStatus,
1008
1012
  dragToUpload,
1009
- dragSort
1013
+ dragSort,
1014
+ dragPlaceholder
1010
1015
  } = props;
1011
1016
  const {
1012
1017
  isActivated,
@@ -1059,7 +1064,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
1059
1064
  class: 'vxe-upload--drag-line'
1060
1065
  }) : (0, _ui.renderEmptyElement)($xeUpload), isDragUploadStatus ? (0, _vue.h)('div', {
1061
1066
  class: 'vxe-upload--drag-placeholder'
1062
- }, (0, _ui.getI18n)('vxe.upload.dragPlaceholder')) : (0, _ui.renderEmptyElement)($xeUpload)]);
1067
+ }, dragPlaceholder || (0, _ui.getI18n)('vxe.upload.dragPlaceholder')) : (0, _ui.renderEmptyElement)($xeUpload)]);
1063
1068
  }
1064
1069
  },
1065
1070
  onShow() {
@@ -1750,7 +1755,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
1750
1755
  showErrorStatus,
1751
1756
  dragToUpload,
1752
1757
  pasteToUpload,
1753
- dragSort
1758
+ dragSort,
1759
+ dragPlaceholder
1754
1760
  } = props;
1755
1761
  const {
1756
1762
  isDragUploadStatus,
@@ -1786,7 +1792,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
1786
1792
  class: 'vxe-upload--drag-line'
1787
1793
  }) : (0, _ui.renderEmptyElement)($xeUpload), isDragUploadStatus && !showMorePopup ? (0, _vue.h)('div', {
1788
1794
  class: 'vxe-upload--drag-placeholder'
1789
- }, (0, _ui.getI18n)('vxe.upload.dragPlaceholder')) : (0, _ui.renderEmptyElement)($xeUpload)]);
1795
+ }, dragPlaceholder || (0, _ui.getI18n)('vxe.upload.dragPlaceholder')) : (0, _ui.renderEmptyElement)($xeUpload)]);
1790
1796
  };
1791
1797
  const listFlag = (0, _vue.ref)(0);
1792
1798
  (0, _vue.watch)(() => props.modelValue ? props.modelValue.length : 0, () => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_dom=require("../../ui/src/dom"),_util=require("./util"),_button=_interopRequireDefault(require("../../button/src/button"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeUpload",props:{modelValue:[Array,String,Object],showList:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showList},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},autoSubmit:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoSubmit},mode:{type:String,default:()=>(0,_ui.getConfig)().upload.mode},imageTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)},imageConfig:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)},imageStyle:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)},fileTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)},dragSort:Boolean,dragToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)},pasteToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)},keyField:String,singleMode:Boolean,urlMode:Boolean,urlArgs:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.urlArgs},multiple:Boolean,limitSize:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitSize},showLimitSize:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitSize},limitSizeText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitSizeText},limitCount:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitCount},showLimitCount:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitCount},limitCountText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitCountText},nameField:{type:String,default:()=>(0,_ui.getConfig)().upload.nameField},typeField:{type:String,default:()=>(0,_ui.getConfig)().upload.typeField},urlField:{type:String,default:()=>(0,_ui.getConfig)().upload.urlField},sizeField:{type:String,default:()=>(0,_ui.getConfig)().upload.sizeField},showErrorStatus:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showErrorStatus},showProgress:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showProgress},progressText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.progressText},showSubmitButton:Boolean,autoHiddenButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoHiddenButton},showUploadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showUploadButton},buttonText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.buttonText},buttonIcon:{type:String,default:()=>(0,_ui.getConfig)().upload.buttonIcon},showButtonText:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonText},showButtonIcon:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonIcon},showRemoveButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showRemoveButton},showDownloadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showDownloadButton},showPreview:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showPreview},showTip:{type:Boolean,default:()=>null},maxSimultaneousUploads:{type:Number,default:()=>(0,_ui.getConfig)().upload.maxSimultaneousUploads},tipText:[String,Number,Function],hintText:String,previewMethod:Function,uploadMethod:Function,beforeRemoveMethod:Function,removeMethod:Function,beforeDownloadMethod:Function,downloadMethod:Function,getUrlMethod:Function,getThumbnailUrlMethod:Function,size:{type:String,default:()=>(0,_ui.getConfig)().upload.size||(0,_ui.getConfig)().size}},emits:["update:modelValue","add","remove","remove-fail","download","download-fail","upload-success","upload-error","sort-dragend","more-visible"],setup(S,e){const{emit:u,slots:D}=e,U=(0,_vue.inject)("$xeForm",null),E=(0,_vue.inject)("xeFormItemInfo",null),i=(0,_vue.inject)("$xeTable",null);var t=_xeUtils.default.uniqueId();const b=(0,_ui.useSize)(S)["computeSize"],g=(0,_vue.ref)(),m=(0,_vue.ref)(),c=(0,_vue.ref)(),_=(0,_vue.ref)(),B=(0,_vue.reactive)({isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}),r={moreId:_xeUtils.default.uniqueId("upload"),imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1},l={refElem:g},L=(0,_vue.computed)(()=>{var e=S["readonly"];return null===e?!!U&&U.props.readonly:e}),P=(0,_vue.computed)(()=>{var e=S["disabled"];return null===e?!!U&&U.props.disabled:e}),M=(0,_vue.computed)(()=>S.keyField||"_X_KEY"),f=(0,_vue.computed)(()=>"image"===S.mode),V=(0,_vue.computed)(()=>S.nameField||"name"),A=(0,_vue.computed)(()=>S.typeField||"type"),T=(0,_vue.computed)(()=>S.urlField||"url"),F=(0,_vue.computed)(()=>S.sizeField||"size"),H=(0,_vue.computed)(()=>1024*_xeUtils.default.toNumber(S.limitSize)*1024),O=(0,_vue.computed)(()=>S.multiple?_xeUtils.default.toNumber(S.limitCount):1),C=(0,_vue.computed)(()=>{var e=S["multiple"],t=B["fileList"],o=O.value;return e?!o||t.length>=o:1<=t.length}),Y=(0,_vue.computed)(()=>{var e=_xeUtils.default.toNumber(S.limitSize);return e?1048576<e?e/1048576+"T":1024<e?e/1024+"G":e+"M":""}),Q=(0,_vue.computed)(()=>{var{showTip:e,tipText:t}=S;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t}),X=(0,_vue.computed)(()=>{var{limitSize:e,fileTypes:t,multiple:o,limitCount:i}=S,l=S.tipText||S.hintText,a=f.value,u=Y.value;return _xeUtils.default.isString(l)?l:_xeUtils.default.isFunction(l)?""+l({}):(l=[],a?(o&&i&&l.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[i])),e&&u&&l.push((0,_ui.getI18n)("vxe.upload.imgSizeHint",[u]))):(t&&t.length&&l.push((0,_ui.getI18n)("vxe.upload.fileTypeHint",[t.join("/")])),e&&u&&l.push((0,_ui.getI18n)("vxe.upload.fileSizeHint",[u])),o&&i&&l.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[i]))),l.join((0,_ui.getI18n)("vxe.base.comma")))}),a=(0,_vue.computed)(()=>Object.assign({},S.imageConfig||S.imageStyle)),W=(0,_vue.computed)(()=>{var{width:e,height:t}=a.value,o={};return e&&(o.width=(0,_dom.toCssUnit)(e)),t&&(o.height=(0,_dom.toCssUnit)(t)),o}),K=(0,_vue.computed)(()=>Object.assign({showMoreButton:!0},S.moreConfig)),n={},N={xID:t,props:S,context:e,reactData:B,internalData:r,getRefMaps:()=>l,getComputeMaps:()=>n},z=()=>_xeUtils.default.uniqueId(),k=e=>{return e[M.value]},s=()=>{var{modelValue:e,multiple:t}=S,o=L.value;const l=M.value,a=V.value,u=A.value,n=T.value,r=F.value;e=e?(e?_xeUtils.default.isArray(e)?e:[e]:[]).map(e=>{if(!e||_xeUtils.default.isString(e)){var t=""+(e||""),o=_xeUtils.default.parseUrl(e);const i=(o?o.searchQuery[a]:"")||decodeURIComponent(""+(t||"")).split("/").pop()||"";return{[a]:i,[u]:(o?o.searchQuery[u]:"")||j(i),[n]:t,[r]:_xeUtils.default.toNumber(o?o.searchQuery[r]:0)||0,[l]:z()}}const i=e[a]||"";return e[a]=i,e[u]=e[u]||j(i),e[n]=e[n]||"",e[r]=e[r]||0,e[l]=e[l]||z(),e}):[];B.fileList=o||t?e:e.slice(0,1)},j=e=>{var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},R=(e,t,o)=>{u(e,(0,_ui.createEvent)(o,{$upload:N},t))},$=e=>{var{singleMode:t,urlArgs:o}=S;const i=T.value,l=V.value;let a=e?e.slice(0):[];o&&(a=a.map(e=>{var t=e[i];if(t){var o=_xeUtils.default.parseUrl(t);if(!o.searchQuery[l]&&-1===t.indexOf("blob:"))return""+t+(-1===t.indexOf("?")?"?":"&")+l+"="+encodeURIComponent(e[l]||"")}return t})),e=t?a[0]||null:a,u("update:modelValue",e)},q=e=>{var t=S.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=T.value;return t?t({$upload:N,option:e}):e[o]},J=t=>{var{imageTypes:e,showDownloadButton:o}=S;const i=A.value,l=S.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;var a=r["imagePreviewTypes"];a.concat(e||[]).some(e=>(""+e).toLowerCase()===(""+t[i]).toLowerCase())&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:[q(t)],showDownloadButton:o,beforeDownloadMethod:l?()=>l({$upload:N,option:t}):void 0})},G=(o,e)=>{const i=S["showErrorStatus"],l=k(o);var t=S.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?Promise.resolve(t({$upload:N,file:e,option:o,updateProgress(e){var t=B["fileCacheMaps"],t=t[k(o)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(e=>{var t=B["fileCacheMaps"],t=t[l];t&&(t.percent=100,t.status="success"),Object.assign(o,e),R("upload-success",{option:o,data:e},null)}).catch(e=>{var t=B["fileCacheMaps"],t=t[l];t&&(t.status="error"),i?Object.assign(o,e):B.fileList=B.fileList.filter(e=>k(e)!==l),R("upload-error",{option:o,data:e},null)}).finally(()=>{var e=B["fileCacheMaps"],e=e[l];e&&(e.loading=!1)}):(t=B["fileCacheMaps"],(e=t[l])&&(e.loading=!1),Promise.resolve())},Z=e=>{const{uploadMethod:t,urlMode:o}=S;var i,l=B["fileCacheMaps"],l=l[k(e)];(t||(0,_ui.getConfig)().upload.uploadMethod)&&l&&(i=l.file,l.loading=!0,l.status="pending",l.percent=0,G(e,i).then(()=>{o&&$(B.fileList)}))},d=(t,o)=>{const{multiple:e,urlMode:i,showLimitSize:l,limitSizeText:a,showLimitCount:u,limitCountText:n,autoSubmit:r}=S;var s=B["fileList"];const d=S.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,p=M.value,v=V.value,g=A.value,m=T.value,c=F.value;var _=H.value;const f=O.value;var h=Y.value;let x=t;if(e&&f){if(u&&s.length>=f)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:n?""+(_xeUtils.default.isFunction(n)?n({maxCount:f}):n):(0,_ui.getI18n)("vxe.upload.overCountErr",[f])}));const b=x.length-(f-s.length);if(u&&0<b){const C=x.slice(f-s.length);n?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:""+(_xeUtils.default.isFunction(n)?n({maxCount:f}):n)}):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",width:null,slots:{default(){return(0,_vue.h)("div",{class:"vxe-upload--file-message-over-error"},[(0,_vue.h)("div",{},(0,_ui.getI18n)("vxe.upload.overCountExtraErr",[f,b])),(0,_vue.h)("div",{class:"vxe-upload--file-message-over-extra"},C.map((e,t)=>(0,_vue.h)("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)))])}}})}x=x.slice(0,f-s.length)}if(l&&_)for(let e=0;e<t.length;e++)if(t[0].size>_)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:a?""+(_xeUtils.default.isFunction(a)?a({maxSize:_}):a):(0,_ui.getI18n)("vxe.upload.overSizeErr",[h])}));const w=Object.assign({},B.fileCacheMaps),y=e?s:[],I=[];x.forEach(e=>{var t=e["name"],o=z(),t={[v]:t,[g]:j(t),[c]:e.size,[m]:URL.createObjectURL(e),[p]:o},o=(d&&(w[o]={file:e,loading:!!r,status:"pending",percent:0}),(0,_vue.reactive)(t));d&&r&&I.push(G(o,e)),y.push(o)}),B.fileList=y,B.fileCacheMaps=w,y.forEach(e=>{R("add",{option:e},o)}),Promise.all(i?I:[]).then(()=>{$(y),U&&E&&U.triggerItemEvent(o,E.itemConfig.field,y)})},p=t=>{var{multiple:e,imageTypes:o,fileTypes:i}=S,l=P.value,a=f.value;return l?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:a?o:i}).then(e=>(d(e.files,t),e))},ee=e=>{p(e).catch(()=>{})},v=(e,t,o)=>{var i=B["fileList"];i.splice(o,1),$(i),U&&E&&U.triggerItemEvent(e,E.itemConfig.field,i),R("remove",{option:t},e)},te=(t,o,i)=>{var e=S.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod;const l=S.removeMethod||(0,_ui.getConfig)().upload.removeMethod;Promise.resolve(!e||e({$upload:N,option:o})).then(e=>{e?l?Promise.resolve(l({$upload:N,option:o})).then(()=>{v(t,o,i)}).catch(e=>e):v(t,o,i):R("remove-fail",{option:o},t)})},oe=(e,t)=>{R("download",{option:t},e)},ie=e=>{var t,o,i,l=e.currentTarget,{clientX:e,clientY:a}=e;l&&({x:l,y:t,height:o,width:i}=l.getBoundingClientRect(),e<l||l+i<e||a<t||t+o<a)&&(B.isDragUploadStatus=!1)},le=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),B.isDragUploadStatus=!0)},ae=(e,t)=>{const{imageTypes:o,fileTypes:i}=S;var l=r["imagePreviewTypes"];if(f.value){const a=l.concat(o&&o.length?o:[]);t=t.filter(e=>{const t=(""+(e.type.split("/")[1]||"")).toLowerCase();return!!a.some(e=>(""+e).toLowerCase()===t)})}else if(i&&i.length){const u=[];if(t.forEach(e=>{const t=j(e.name);i.some(e=>(""+e).toLowerCase()===t)||u.push(t)}),u.length)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.error.notType",[u.join(", ")]),status:"error"}))}t.length?d(t,e):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.uploadTypeErr")})},ue=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),(t=ne(t)).length)&&ae(e,t),B.isDragUploadStatus=!1},ne=e=>{const t=[];return _xeUtils.default.arrayEach(e,e=>{e=e.getAsFile();e&&t.push(e)}),t},h=e=>{const p=L.value,v=f.value;e=e.$event;_ui.VxeUI.modal&&(_ui.VxeUI.modal.open({id:r.moreId,title:p?(0,_ui.getI18n)("vxe.upload.morePopup.readTitle"):(0,_ui.getI18n)("vxe.upload.morePopup."+(v?"imageTitle":"fileTitle")),width:660,height:500,escClosable:!0,showMaximize:!0,resize:!0,maskClosable:!0,slots:{default(){var{showErrorStatus:e,dragToUpload:t,dragSort:o}=S,{isActivated:i,isDragMove:l,isDragUploadStatus:a,dragIndex:u}=B;const n=B["fileList"];var r=P.value,s=D.moreContent||D["more-content"],d={};return t&&-1===u&&(d.onDragover=le,d.onDragleave=ie,d.onDrop=ue),(0,_vue.h)("div",Object.assign({ref:m,class:["vxe-upload--more-popup",{"is--readonly":p,"is--disabled":r,"is--active":i,"show--error":e,"is--drag":a}]},d),s?(0,_vn.getSlotVNs)(s({options:n})):[v?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--image-more-list"},{default:()=>y(n,!0).concat(I(!0))}):(0,_vue.h)("div",{class:"vxe-upload--image-more-list"},y(n,!0).concat(I(!0))):(0,_vue.h)("div",{class:"vxe-upload--file-more-list"},[w(!0),o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>x(n,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},x(n,!0))]),o?(0,_vue.h)("div",{ref:_,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(N),a?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(N)])}},onShow(){B.showMorePopup=!0},onHide({$event:e}){B.showMorePopup=!1,e&&R("more-visible",{visible:!1},e)}}),e)&&R("more-visible",{visible:!0},e)},re=(e,t,o)=>{var i,l=B["showMorePopup"],a=g.value,u=m.value,u=l?u:a;u&&(a=u.getBoundingClientRect(),u=c.value,i=_.value,l=l?i:u)&&(i=t.getBoundingClientRect(),l.style.display="block",l.style.top=Math.max(1,i.y-a.y)+"px",l.style.left=Math.max(1,i.x-a.x)+"px",l.style.height=i.height+"px",l.style.width=i.width-1+"px",l.setAttribute("drag-pos",o))},se=()=>{var e=c.value,t=_.value;e&&(e.style.display=""),t&&(t.style.display="")},de=e=>{e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0);const t=e.currentTarget;e=t.parentElement,e=_xeUtils.default.findIndexOf(Array.from(e.children),e=>t===e);B.isDragMove=!0,B.dragIndex=e,setTimeout(()=>{B.isDragMove=!1},500)},pe=t=>{t.stopPropagation(),t.preventDefault();var o=B["dragIndex"];if(-1!==o){var i=f.value;const a=t.currentTarget;var l=a.parentElement,l=_xeUtils.default.findIndexOf(Array.from(l.children),e=>a===e);let e="";e=i?t.clientX-a.getBoundingClientRect().x<a.clientWidth/2?"left":"right":t.clientY-a.getBoundingClientRect().y<a.clientHeight/2?"top":"bottom",o===l?re(t,a,e):(re(t,a,e),r.prevDragIndex=l,r.prevDragPos=e)}},ve=e=>{var{fileList:t,dragIndex:o}=B,{prevDragIndex:i,prevDragPos:l}=r,a="bottom"===l||"right"===l?1:0,u=t[o];const n=t[i];u&&n&&(t.splice(o,1),i=_xeUtils.default.findIndexOf(t,e=>n===e)+a,t.splice(i,0,u),R("sort-dragend",{oldItem:u,newItem:n,dragPos:l,offsetIndex:a,_index:{newIndex:i,oldIndex:o}},e)),se(),B.dragIndex=-1},ge=e=>{i&&e.stopPropagation(),B.isActivated=!0},me=e=>{var t=S["pasteToUpload"],o=B["isActivated"];o&&t&&(o=e.clipboardData||e.originalEvent.clipboardData)&&(t=o["items"],t)&&(o=ne(t)).length&&(e.preventDefault(),ae(e,o))},ce=e=>{var t=g.value,o=m.value;let i=(0,_dom.getEventTargetNode)(e,t).flag;!i&&o&&(o=(t=o.parentElement||o)&&t.parentElement,i=(0,_dom.getEventTargetNode)(e,o).flag),B.isActivated=i},_e=()=>{B.isActivated=!1};t={dispatchEvent:R,choose(){return p(null)},submit(i){var e=S["maxSimultaneousUploads"],e=_xeUtils.default.toNumber(e||1)||1;const{fileList:t,fileCacheMaps:l}=B,o=t.filter(e=>{e=k(e),e=l[e];return e&&("pending"===e.status||i&&"error"===e.status)}),a=e=>{var t=k(e),t=l[t];if(t){var o=t.file;if(o&&("pending"===t.status||i&&"error"===t.status))return t.loading=!0,t.percent=0,G(e,o).then(u)}return u()},u=()=>{var e;return o.length?(e=o[0],o.splice(0,1),a(e).then(u)):Promise.resolve()};return Promise.all(o.splice(0,e).map(a)).then(()=>{})},getMoreVisible(){return B.showMorePopup},openMore(){return h({$event:new Event("click")}),(0,_vue.nextTick)()},openMoreByEvent(e){return h({$event:e}),(0,_vue.nextTick)()},closeMore(){return _ui.VxeUI.modal&&_ui.VxeUI.modal.close(r.moreId),(0,_vue.nextTick)()}};Object.assign(N,t,{});const x=(e,r)=>{const{showRemoveButton:s,showDownloadButton:d,showProgress:p,progressText:v,showPreview:g,showErrorStatus:m,dragSort:c,autoSubmit:_,showSubmitButton:f}=S,{fileList:h,fileCacheMaps:x}=B,w=P.value,y=L.value,I=V.value,b=A.value,C=D.option,U=D.action,E=D.corner,M=D.name,T={};return c&&1<e.length&&(T.onDragstart=de,T.onDragover=pe,T.onDragend=ve),e.map((l,t)=>{var e=k(l),o=x[e];let i=!1,a=!1,u=!1;var n=""+(l[I]||"");return o&&(i=o.loading,a="error"===o.status,u="pending"===o.status),(0,_vue.h)("div",Object.assign({key:c?e:t,class:["vxe-upload--file-item",{"is--preview":g,"is--loading":i,"is--pending":u,"is--error":a}],fileid:e,draggable:!!c||null},T),C?(0,_vn.getSlotVNs)(C({option:l,isMoreView:r,options:h})):[(0,_vue.h)("div",{class:"vxe-upload--file-item-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_"+(""+l[b]).toLocaleUpperCase()]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),(0,_vue.h)("div",{class:"vxe-upload--file-item-name",title:n,onClick(e){var t,o;i||a||(t=l,o=S.previewMethod||(0,_ui.getConfig)().upload.previewMethod,S.showPreview&&(o?o({$upload:N,option:t}):J(t)))}},M?(0,_vn.getSlotVNs)(M({option:l,isMoreView:r,options:h})):n),i?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(N),p&&i&&o?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-text"},v?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(v)?v({}):v),{percent:o.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[o.percent])):(0,_ui.renderEmptyElement)(N),!i&&(a&&m||u&&f&&!_)?(0,_vue.h)("div",{class:"vxe-upload--file-item-rebtn"},[(0,_vue.h)(_button.default,{icon:a?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:a?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload"),onClick(){Z(l)}})]):(0,_ui.renderEmptyElement)(N),(0,_vue.h)("div",{class:"vxe-upload--file-item-btn-wrapper"},U?(0,_vn.getSlotVNs)(U({option:l,isMoreView:r,options:h,readonly:y})):[E?(0,_vue.h)("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(E({option:l,isMoreView:r,options:h,readonly:y}))):(0,_ui.renderEmptyElement)(N),!d||i||u?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--file-item-download-btn",onClick(e){{var t=e,o=l;e=S.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;const i=S.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!e||e({$upload:N,option:o})).then(e=>{e?i?Promise.resolve(i({$upload:N,option:o})).then(()=>{oe(t,o)}).catch(e=>e):oe(t,o):R("download-fail",{option:o},t)})}}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]),!s||y||w||i?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--file-item-remove-btn",onClick(e){te(e,l,t)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},w=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=S,n=B["fileList"],r=P.value,s=L.value,d=Q.value,p=X.value,v=C.value,g=D.default,m=D.tip||D.hint;return s||!t?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--file-action"},[u&&v?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--file-action-btn",onClick:ee},g?(0,_vn.getSlotVNs)(g({isMoreView:e,options:n,$upload:N})):[(0,_vue.h)(_button.default,{class:"vxe-upload--file-action-button",content:e||l?o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:a?i||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:r})]),d&&(p||m)?(0,_vue.h)("div",{class:"vxe-upload--file-action-tip"},m?(0,_vn.getSlotVNs)(m({isMoreView:e,options:n,$upload:N})):""+p):(0,_ui.renderEmptyElement)(N)])},y=(e,l)=>{const{showRemoveButton:r,showProgress:s,progressText:d,showPreview:p,showErrorStatus:v,dragSort:g,autoSubmit:m,showSubmitButton:c}=S,{fileList:_,fileCacheMaps:f}=B,h=P.value,x=L.value,w=a.value,y=W.value,I=D.option,b=D.action,C=D.corner,U={onMousedown:ge};return g&&1<e.length&&(U.onDragstart=de,U.onDragover=pe,U.onDragend=ve),e.map((t,a)=>{var e=k(t),o=f[e];let u=!1,n=!1,i=!1;return o&&(u=o.loading,n="error"===o.status,i="pending"===o.status),(0,_vue.h)("div",Object.assign({key:g?e:a,class:["vxe-upload--image-item",{"is--preview":p,"is--circle":w.circle,"is--loading":u,"is--pending":i,"is--error":n}],fileid:e,draggable:!!g||null},U),I?(0,_vn.getSlotVNs)(I({option:t,isMoreView:l,options:_})):[(0,_vue.h)("div",{class:"vxe-upload--image-item-box",style:l?null:y,onClick(e){if(!u&&!n){var t=a;var o=S["showDownloadButton"];const i=B["fileList"],l=S.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;S.showPreview&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:i.map(e=>q(e)),activeIndex:t,showDownloadButton:o,beforeDownloadMethod:l?({index:e})=>l({$upload:N,option:i[e]}):void 0})}}},[u&&o?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading"},[(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),s?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-text"},d?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(d)?d({}):d),{percent:o.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[o.percent])):(0,_ui.renderEmptyElement)(N)]):(0,_ui.renderEmptyElement)(N),(0,_vue.h)("div",{class:"vxe-upload--image-item-img-wrapper",title:(0,_ui.getI18n)("vxe.upload.viewItemTitle")},[(0,_vue.h)("img",{class:"vxe-upload--image-item-img",src:(e=t,(o=S.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod)?o({$upload:N,option:e}):q(e))})]),!u&&(n&&v||i&&c&&!m)?(0,_vue.h)("div",{class:"vxe-upload--image-item-rebtn"},[(0,_vue.h)(_button.default,{icon:n?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:n?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload"),onClick(){Z(t)}})]):(0,_ui.renderEmptyElement)(N),(0,_vue.h)("div",{class:"vxe-upload--image-item-btn-wrapper",onClick(e){e.stopPropagation()}},b?(0,_vn.getSlotVNs)(b({option:t,isMoreView:l,options:_,readonly:x})):[C?(0,_vue.h)("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(C({option:t,isMoreView:l,options:_,readonly:x}))):(0,_ui.renderEmptyElement)(N),!r||x||h||u?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--image-item-remove-btn",onClick(e){e.stopPropagation(),te(e,t,a)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},I=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=S,n=B["fileList"],r=L.value,s=Q.value,d=X.value,p=C.value,v=W.value,g=D.default,m=D.tip||D.hint;return r||!t||u&&p?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{key:"action",class:"vxe-upload--image-action"},[(0,_vue.h)("div",{class:"vxe-upload--image-action-btn",onClick:ee},g?g({isMoreView:e,options:n,$upload:N}):[(0,_vue.h)("div",{class:"vxe-upload--image-action-box",style:e?null:v},[a?(0,_vue.h)("div",{class:"vxe-upload--image-action-icon"},[(0,_vue.h)("i",{class:i||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_ui.renderEmptyElement)(N),e||l?(0,_vue.h)("div",{class:"vxe-upload--image-action-content"},o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_ui.renderEmptyElement)(N),s&&(d||m)?(0,_vue.h)("div",{class:"vxe-upload--image-action-hint"},m?(0,_vn.getSlotVNs)(m({isMoreView:e,options:n,$upload:N})):""+d):(0,_ui.renderEmptyElement)(N)])])])};const o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>S.modelValue?S.modelValue.length:0,()=>{o.value++}),(0,_vue.watch)(()=>S.modelValue,()=>{o.value++}),(0,_vue.watch)(o,()=>{s()}),(0,_vue.onMounted)(()=>{S.multiple&&S.singleMode&&(0,_log.errLog)("vxe.error.errConflicts",["[upload] multiple","single-mode"]),S.imageStyle&&(0,_log.warnLog)("vxe.error.delProp",["[upload] image-style","image-config"]),S.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(N,"paste",me),_ui.globalEvents.on(N,"mousedown",ce),_ui.globalEvents.on(N,"blur",_e)}),(0,_vue.onUnmounted)(()=>{B.isDragUploadStatus=!1,_ui.globalEvents.off(N,"paste"),_ui.globalEvents.off(N,"mousedown"),_ui.globalEvents.off(N,"blur")}),s(),N.renderVN=()=>{var{showErrorStatus:e,dragToUpload:t,pasteToUpload:o,dragSort:i}=S,{isDragUploadStatus:l,showMorePopup:a,isActivated:u,dragIndex:n}=B,r=b.value,s=P.value,d=L.value,p=f.value,v={onMousedown:ge};return t&&-1===n&&(v.onDragover=le,v.onDragleave=ie,v.onDrop=ue),(0,_vue.h)("div",Object.assign({ref:g,class:["vxe-upload",{["size--"+r]:r,"is--active":u,"is--readonly":d,"is--disabled":s,"is--paste":o,"show--error":e,"is--drag":l}]},v),[(p?()=>{var{showList:e,dragSort:t}=S;const{fileList:o,isDragMove:i}=B;var l=K.value;const a=D.moreButton||D["more-button"],{maxCount:u,showMoreButton:n}=l;let r=o,s=0;return u&&o.length>u&&(s=o.length-u,r=o.slice(0,u)),(0,_vue.h)("div",{key:"image",class:"vxe-upload--image-wrapper"},e?[t?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(i?"":"-disabled"),tag:"div",class:"vxe-upload--image-list"},{default:()=>y(r,!1).concat([n&&s?(0,_vue.h)("div",{key:"om",class:"vxe-upload--image-over-more"},a?(0,_vn.getSlotVNs)(a({options:o})):[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:h})]):(0,_ui.renderEmptyElement)(N),I(!1)])}):(0,_vue.h)("div",{class:"vxe-upload--image-list"},y(r,!1).concat([n&&s?(0,_vue.h)("div",{class:"vxe-upload--image-over-more"},a?(0,_vn.getSlotVNs)(a({options:o})):[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:h})]):(0,_ui.renderEmptyElement)(N),I(!1)]))]:[(0,_vue.h)("div",{class:"vxe-upload--image-list"},[I(!1)])])}:()=>{var{showList:e,moreConfig:t,dragSort:o}=S,{fileList:i,isDragMove:l}=B,{maxCount:a,showMoreButton:u,layout:n}=K.value,n="horizontal"===n,r=D.moreButton||D["more-button"];let s=i,d=0;return a&&i.length>a&&(d=i.length-a,s=i.slice(0,a)),(0,_vue.h)("div",{key:"all",class:"vxe-upload--file-wrapper"},e?[u&&t&&n?(0,_ui.renderEmptyElement)(N):w(!0),s.length||u&&n?(0,_vue.h)("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":n}]},[s.length?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>x(s,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},x(s,!1)):(0,_ui.renderEmptyElement)(N),u&&d?(0,_vue.h)("div",{class:"vxe-upload--file-over-more"},r?(0,_vn.getSlotVNs)(r({options:i})):[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[i.length]),status:"primary",onClick:h})]):(0,_ui.renderEmptyElement)(N),u&&t&&n?w(!1):(0,_ui.renderEmptyElement)(N)]):(0,_ui.renderEmptyElement)(N)]:[w(!1)])})(),i?(0,_vue.h)("div",{ref:c,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(N),l&&!a?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(N)])},N},render(){return this.renderVN()}});
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)},dragPlaceholder:{type:String,default:()=>(0,_ui.getConfig)().upload.dragPlaceholder},pasteToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)},keyField:String,singleMode:Boolean,urlMode:Boolean,urlArgs:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.urlArgs},multiple:Boolean,limitSize:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitSize},showLimitSize:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitSize},limitSizeText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitSizeText},limitCount:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitCount},showLimitCount:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitCount},limitCountText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitCountText},nameField:{type:String,default:()=>(0,_ui.getConfig)().upload.nameField},typeField:{type:String,default:()=>(0,_ui.getConfig)().upload.typeField},urlField:{type:String,default:()=>(0,_ui.getConfig)().upload.urlField},sizeField:{type:String,default:()=>(0,_ui.getConfig)().upload.sizeField},showErrorStatus:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showErrorStatus},showProgress:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showProgress},progressText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.progressText},showSubmitButton:Boolean,autoHiddenButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoHiddenButton},showUploadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showUploadButton},buttonText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.buttonText},buttonIcon:{type:String,default:()=>(0,_ui.getConfig)().upload.buttonIcon},showButtonText:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonText},showButtonIcon:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonIcon},showRemoveButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showRemoveButton},showDownloadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showDownloadButton},showPreview:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showPreview},showTip:{type:Boolean,default:()=>null},maxSimultaneousUploads:{type:Number,default:()=>(0,_ui.getConfig)().upload.maxSimultaneousUploads},tipText:[String,Number,Function],hintText:String,previewMethod:Function,uploadMethod:Function,beforeRemoveMethod:Function,removeMethod:Function,beforeDownloadMethod:Function,downloadMethod:Function,getUrlMethod:Function,getThumbnailUrlMethod:Function,size:{type:String,default:()=>(0,_ui.getConfig)().upload.size||(0,_ui.getConfig)().size}},emits:["update:modelValue","add","remove","remove-fail","download","download-fail","upload-success","upload-error","sort-dragend","more-visible"],setup(S,e){const{emit:u,slots:D}=e,U=(0,_vue.inject)("$xeForm",null),E=(0,_vue.inject)("xeFormItemInfo",null),i=(0,_vue.inject)("$xeTable",null);var t=_xeUtils.default.uniqueId();const C=(0,_ui.useSize)(S)["computeSize"],m=(0,_vue.ref)(),c=(0,_vue.ref)(),_=(0,_vue.ref)(),f=(0,_vue.ref)(),B=(0,_vue.reactive)({isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}),r={moreId:_xeUtils.default.uniqueId("upload"),imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1},l={refElem:m},L=(0,_vue.computed)(()=>{var e=S["readonly"];return null===e?!!U&&U.props.readonly:e}),P=(0,_vue.computed)(()=>{var e=S["disabled"];return null===e?!!U&&U.props.disabled:e}),M=(0,_vue.computed)(()=>S.keyField||"_X_KEY"),h=(0,_vue.computed)(()=>"image"===S.mode),V=(0,_vue.computed)(()=>S.nameField||"name"),A=(0,_vue.computed)(()=>S.typeField||"type"),T=(0,_vue.computed)(()=>S.urlField||"url"),F=(0,_vue.computed)(()=>S.sizeField||"size"),H=(0,_vue.computed)(()=>1024*_xeUtils.default.toNumber(S.limitSize)*1024),O=(0,_vue.computed)(()=>S.multiple?_xeUtils.default.toNumber(S.limitCount):1),Y=(0,_vue.computed)(()=>{var e=S["multiple"],t=B["fileList"],o=O.value;return e?!o||t.length>=o:1<=t.length}),Q=(0,_vue.computed)(()=>{var e=_xeUtils.default.toNumber(S.limitSize);return e?1048576<e?e/1048576+"T":1024<e?e/1024+"G":e+"M":""}),X=(0,_vue.computed)(()=>{var{showTip:e,tipText:t}=S;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t}),W=(0,_vue.computed)(()=>{var{limitSize:e,fileTypes:t,multiple:o,limitCount:i}=S,l=S.tipText||S.hintText,a=h.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({},S.imageConfig||S.imageStyle)),K=(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}),J=(0,_vue.computed)(()=>Object.assign({showMoreButton:!0},S.moreConfig)),n={},N={xID:t,props:S,context:e,reactData:B,internalData:r,getRefMaps:()=>l,getComputeMaps:()=>n},z=()=>_xeUtils.default.uniqueId(),k=e=>{return e[M.value]},s=()=>{var{modelValue:e,multiple:t}=S,o=L.value;const l=M.value,a=V.value,u=A.value,n=T.value,r=F.value;e=e?(e?_xeUtils.default.isArray(e)?e:[e]:[]).map(e=>{if(!e||_xeUtils.default.isString(e)){var t=""+(e||""),o=_xeUtils.default.parseUrl(e);const i=(o?o.searchQuery[a]:"")||decodeURIComponent(""+(t||"")).split("/").pop()||"";return{[a]:i,[u]:(o?o.searchQuery[u]:"")||j(i),[n]:t,[r]:_xeUtils.default.toNumber(o?o.searchQuery[r]:0)||0,[l]:z()}}const i=e[a]||"";return e[a]=i,e[u]=e[u]||j(i),e[n]=e[n]||"",e[r]=e[r]||0,e[l]=e[l]||z(),e}):[];B.fileList=o||t?e:e.slice(0,1)},j=e=>{var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},R=(e,t,o)=>{u(e,(0,_ui.createEvent)(o,{$upload:N},t))},$=e=>{var{singleMode:t,urlArgs:o}=S;const i=T.value,l=V.value;let a=e?e.slice(0):[];o&&(a=a.map(e=>{var t=e[i];if(t){var o=_xeUtils.default.parseUrl(t);if(!o.searchQuery[l]&&-1===t.indexOf("blob:"))return""+t+(-1===t.indexOf("?")?"?":"&")+l+"="+encodeURIComponent(e[l]||"")}return t})),e=t?a[0]||null:a,u("update:modelValue",e)},q=e=>{var t=S.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=T.value;return t?t({$upload:N,option:e}):e[o]},Z=t=>{var{imageTypes:e,showDownloadButton:o}=S;const i=A.value,l=S.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;var a=r["imagePreviewTypes"];a.concat(e||[]).some(e=>(""+e).toLowerCase()===(""+t[i]).toLowerCase())&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:[q(t)],showDownloadButton:o,beforeDownloadMethod:l?()=>l({$upload:N,option:t}):void 0})},G=(o,e)=>{const i=S["showErrorStatus"],l=k(o);var t=S.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?Promise.resolve(t({$upload:N,file:e,option:o,updateProgress(e){var t=B["fileCacheMaps"],t=t[k(o)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(e=>{var t=B["fileCacheMaps"],t=t[l];t&&(t.percent=100,t.status="success"),Object.assign(o,e),R("upload-success",{option:o,data:e},null)}).catch(e=>{var t=B["fileCacheMaps"],t=t[l];t&&(t.status="error"),i?Object.assign(o,e):B.fileList=B.fileList.filter(e=>k(e)!==l),R("upload-error",{option:o,data:e},null)}).finally(()=>{var e=B["fileCacheMaps"],e=e[l];e&&(e.loading=!1)}):(t=B["fileCacheMaps"],(e=t[l])&&(e.loading=!1),Promise.resolve())},ee=e=>{const{uploadMethod:t,urlMode:o}=S;var i,l=B["fileCacheMaps"],l=l[k(e)];(t||(0,_ui.getConfig)().upload.uploadMethod)&&l&&(i=l.file,l.loading=!0,l.status="pending",l.percent=0,G(e,i).then(()=>{o&&$(B.fileList)}))},d=(t,o)=>{const{multiple:e,urlMode:i,showLimitSize:l,limitSizeText:a,showLimitCount:u,limitCountText:n,autoSubmit:r}=S;var s=B["fileList"];const d=S.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,p=M.value,v=V.value,g=A.value,m=T.value,c=F.value;var _=H.value;const f=O.value;var h=Q.value;let x=t;if(e&&f){if(u&&s.length>=f)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:n?""+(_xeUtils.default.isFunction(n)?n({maxCount:f}):n):(0,_ui.getI18n)("vxe.upload.overCountErr",[f])}));const b=x.length-(f-s.length);if(u&&0<b){const C=x.slice(f-s.length);n?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:""+(_xeUtils.default.isFunction(n)?n({maxCount:f}):n)}):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",width:null,slots:{default(){return(0,_vue.h)("div",{class:"vxe-upload--file-message-over-error"},[(0,_vue.h)("div",{},(0,_ui.getI18n)("vxe.upload.overCountExtraErr",[f,b])),(0,_vue.h)("div",{class:"vxe-upload--file-message-over-extra"},C.map((e,t)=>(0,_vue.h)("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)))])}}})}x=x.slice(0,f-s.length)}if(l&&_)for(let e=0;e<t.length;e++)if(t[0].size>_)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:a?""+(_xeUtils.default.isFunction(a)?a({maxSize:_}):a):(0,_ui.getI18n)("vxe.upload.overSizeErr",[h])}));const w=Object.assign({},B.fileCacheMaps),y=e?s:[],I=[];x.forEach(e=>{var t=e["name"],o=z(),t={[v]:t,[g]:j(t),[c]:e.size,[m]:URL.createObjectURL(e),[p]:o},o=(d&&(w[o]={file:e,loading:!!r,status:"pending",percent:0}),(0,_vue.reactive)(t));d&&r&&I.push(G(o,e)),y.push(o)}),B.fileList=y,B.fileCacheMaps=w,y.forEach(e=>{R("add",{option:e},o)}),Promise.all(i?I:[]).then(()=>{$(y),U&&E&&U.triggerItemEvent(o,E.itemConfig.field,y)})},p=t=>{var{multiple:e,imageTypes:o,fileTypes:i}=S,l=P.value,a=h.value;return l?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:a?o:i}).then(e=>(d(e.files,t),e))},te=e=>{p(e).catch(()=>{})},v=(e,t,o)=>{var i=B["fileList"];i.splice(o,1),$(i),U&&E&&U.triggerItemEvent(e,E.itemConfig.field,i),R("remove",{option:t},e)},oe=(t,o,i)=>{var e=S.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod;const l=S.removeMethod||(0,_ui.getConfig)().upload.removeMethod;Promise.resolve(!e||e({$upload:N,option:o})).then(e=>{e?l?Promise.resolve(l({$upload:N,option:o})).then(()=>{v(t,o,i)}).catch(e=>e):v(t,o,i):R("remove-fail",{option:o},t)})},ie=(e,t)=>{R("download",{option:t},e)},le=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)&&(B.isDragUploadStatus=!1)},ae=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),B.isDragUploadStatus=!0)},g=(e,t)=>{const{imageTypes:o,fileTypes:i}=S;var l=r["imagePreviewTypes"];if(h.value){const a=l.concat(o&&o.length?o:[]);t=t.filter(e=>{const t=(""+(e.type.split("/")[1]||"")).toLowerCase();return!!a.some(e=>(""+e).toLowerCase()===t)})}else if(i&&i.length){const u=[];if(t.forEach(e=>{const t=j(e.name);i.some(e=>(""+e).toLowerCase()===t)||u.push(t)}),u.length)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.error.notType",[u.join(", ")]),status:"error"}))}t.length?d(t,e):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.uploadTypeErr")})},ue=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),(t=ne(t)).length)&&g(e,t),B.isDragUploadStatus=!1},ne=e=>{const t=[];return _xeUtils.default.arrayEach(e,e=>{e=e.getAsFile();e&&t.push(e)}),t},x=e=>{const v=L.value,g=h.value;e=e.$event;_ui.VxeUI.modal&&(_ui.VxeUI.modal.open({id:r.moreId,title:v?(0,_ui.getI18n)("vxe.upload.morePopup.readTitle"):(0,_ui.getI18n)("vxe.upload.morePopup."+(g?"imageTitle":"fileTitle")),width:660,height:500,escClosable:!0,showMaximize:!0,resize:!0,maskClosable:!0,slots:{default(){var{showErrorStatus:e,dragToUpload:t,dragSort:o,dragPlaceholder:i}=S,{isActivated:l,isDragMove:a,isDragUploadStatus:u,dragIndex:n}=B;const r=B["fileList"];var s=P.value,d=D.moreContent||D["more-content"],p={};return t&&-1===n&&(p.onDragover=ae,p.onDragleave=le,p.onDrop=ue),(0,_vue.h)("div",Object.assign({ref:c,class:["vxe-upload--more-popup",{"is--readonly":v,"is--disabled":s,"is--active":l,"show--error":e,"is--drag":u}]},p),d?(0,_vn.getSlotVNs)(d({options:r})):[g?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(a?"":"-disabled"),tag:"div",class:"vxe-upload--image-more-list"},{default:()=>I(r,!0).concat(b(!0))}):(0,_vue.h)("div",{class:"vxe-upload--image-more-list"},I(r,!0).concat(b(!0))):(0,_vue.h)("div",{class:"vxe-upload--file-more-list"},[y(!0),o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(a?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>w(r,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},w(r,!0))]),o?(0,_vue.h)("div",{ref:f,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(N),u?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},i||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(N)])}},onShow(){B.showMorePopup=!0},onHide({$event:e}){B.showMorePopup=!1,e&&R("more-visible",{visible:!1},e)}}),e)&&R("more-visible",{visible:!0},e)},re=(e,t,o)=>{var i,l=B["showMorePopup"],a=m.value,u=c.value,u=l?u:a;u&&(a=u.getBoundingClientRect(),u=_.value,i=f.value,l=l?i:u)&&(i=t.getBoundingClientRect(),l.style.display="block",l.style.top=Math.max(1,i.y-a.y)+"px",l.style.left=Math.max(1,i.x-a.x)+"px",l.style.height=i.height+"px",l.style.width=i.width-1+"px",l.setAttribute("drag-pos",o))},se=()=>{var e=_.value,t=f.value;e&&(e.style.display=""),t&&(t.style.display="")},de=e=>{e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0);const t=e.currentTarget;e=t.parentElement,e=_xeUtils.default.findIndexOf(Array.from(e.children),e=>t===e);B.isDragMove=!0,B.dragIndex=e,setTimeout(()=>{B.isDragMove=!1},500)},pe=t=>{t.stopPropagation(),t.preventDefault();var o=B["dragIndex"];if(-1!==o){var i=h.value;const a=t.currentTarget;var l=a.parentElement,l=_xeUtils.default.findIndexOf(Array.from(l.children),e=>a===e);let e="";e=i?t.clientX-a.getBoundingClientRect().x<a.clientWidth/2?"left":"right":t.clientY-a.getBoundingClientRect().y<a.clientHeight/2?"top":"bottom",o===l?re(t,a,e):(re(t,a,e),r.prevDragIndex=l,r.prevDragPos=e)}},ve=e=>{var{fileList:t,dragIndex:o}=B,{prevDragIndex:i,prevDragPos:l}=r,a="bottom"===l||"right"===l?1:0,u=t[o];const n=t[i];u&&n&&(t.splice(o,1),i=_xeUtils.default.findIndexOf(t,e=>n===e)+a,t.splice(i,0,u),R("sort-dragend",{oldItem:u,newItem:n,dragPos:l,offsetIndex:a,_index:{newIndex:i,oldIndex:o}},e)),se(),B.dragIndex=-1},ge=e=>{i&&e.stopPropagation(),B.isActivated=!0},me=e=>{var t=S["pasteToUpload"],o=B["isActivated"];o&&t&&(o=e.clipboardData||e.originalEvent.clipboardData)&&(t=o["items"],t)&&(o=ne(t)).length&&(e.preventDefault(),g(e,o))},ce=e=>{var t=m.value,o=c.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),B.isActivated=i},_e=()=>{B.isActivated=!1};t={dispatchEvent:R,choose(){return p(null)},submit(i){var e=S["maxSimultaneousUploads"],e=_xeUtils.default.toNumber(e||1)||1;const{fileList:t,fileCacheMaps:l}=B,o=t.filter(e=>{e=k(e),e=l[e];return e&&("pending"===e.status||i&&"error"===e.status)}),a=e=>{var t=k(e),t=l[t];if(t){var o=t.file;if(o&&("pending"===t.status||i&&"error"===t.status))return t.loading=!0,t.percent=0,G(e,o).then(u)}return u()},u=()=>{var e;return o.length?(e=o[0],o.splice(0,1),a(e).then(u)):Promise.resolve()};return Promise.all(o.splice(0,e).map(a)).then(()=>{})},getMoreVisible(){return B.showMorePopup},openMore(){return x({$event:new Event("click")}),(0,_vue.nextTick)()},openMoreByEvent(e){return x({$event:e}),(0,_vue.nextTick)()},closeMore(){return _ui.VxeUI.modal&&_ui.VxeUI.modal.close(r.moreId),(0,_vue.nextTick)()}};Object.assign(N,t,{});const w=(e,r)=>{const{showRemoveButton:s,showDownloadButton:d,showProgress:p,progressText:v,showPreview:g,showErrorStatus:m,dragSort:c,autoSubmit:_,showSubmitButton:f}=S,{fileList:h,fileCacheMaps:x}=B,w=P.value,y=L.value,I=V.value,b=A.value,C=D.option,U=D.action,E=D.corner,M=D.name,T={};return c&&1<e.length&&(T.onDragstart=de,T.onDragover=pe,T.onDragend=ve),e.map((l,t)=>{var e=k(l),o=x[e];let i=!1,a=!1,u=!1;var n=""+(l[I]||"");return o&&(i=o.loading,a="error"===o.status,u="pending"===o.status),(0,_vue.h)("div",Object.assign({key:c?e:t,class:["vxe-upload--file-item",{"is--preview":g,"is--loading":i,"is--pending":u,"is--error":a}],fileid:e,draggable:!!c||null},T),C?(0,_vn.getSlotVNs)(C({option:l,isMoreView:r,options:h})):[(0,_vue.h)("div",{class:"vxe-upload--file-item-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_"+(""+l[b]).toLocaleUpperCase()]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),(0,_vue.h)("div",{class:"vxe-upload--file-item-name",title:n,onClick(e){var t,o;i||a||(t=l,o=S.previewMethod||(0,_ui.getConfig)().upload.previewMethod,S.showPreview&&(o?o({$upload:N,option:t}):Z(t)))}},M?(0,_vn.getSlotVNs)(M({option:l,isMoreView:r,options:h})):n),i?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(N),p&&i&&o?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-text"},v?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(v)?v({}):v),{percent:o.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[o.percent])):(0,_ui.renderEmptyElement)(N),!i&&(a&&m||u&&f&&!_)?(0,_vue.h)("div",{class:"vxe-upload--file-item-rebtn"},[(0,_vue.h)(_button.default,{icon:a?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:a?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload"),onClick(){ee(l)}})]):(0,_ui.renderEmptyElement)(N),(0,_vue.h)("div",{class:"vxe-upload--file-item-btn-wrapper"},U?(0,_vn.getSlotVNs)(U({option:l,isMoreView:r,options:h,readonly:y})):[E?(0,_vue.h)("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(E({option:l,isMoreView:r,options:h,readonly:y}))):(0,_ui.renderEmptyElement)(N),!d||i||u?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--file-item-download-btn",onClick(e){{var t=e,o=l;e=S.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;const i=S.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!e||e({$upload:N,option:o})).then(e=>{e?i?Promise.resolve(i({$upload:N,option:o})).then(()=>{ie(t,o)}).catch(e=>e):ie(t,o):R("download-fail",{option:o},t)})}}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]),!s||y||w||i?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--file-item-remove-btn",onClick(e){oe(e,l,t)}},[(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}=S,n=B["fileList"],r=P.value,s=L.value,d=X.value,p=W.value,v=Y.value,g=D.default,m=D.tip||D.hint;return s||!t?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--file-action"},[u&&v?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--file-action-btn",onClick:te},g?(0,_vn.getSlotVNs)(g({isMoreView:e,options:n,$upload:N})):[(0,_vue.h)(_button.default,{class:"vxe-upload--file-action-button",content:e||l?o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:a?i||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:r})]),d&&(p||m)?(0,_vue.h)("div",{class:"vxe-upload--file-action-tip"},m?(0,_vn.getSlotVNs)(m({isMoreView:e,options:n,$upload:N})):""+p):(0,_ui.renderEmptyElement)(N)])},I=(e,l)=>{const{showRemoveButton:r,showProgress:s,progressText:d,showPreview:p,showErrorStatus:v,dragSort:g,autoSubmit:m,showSubmitButton:c}=S,{fileList:_,fileCacheMaps:f}=B,h=P.value,x=L.value,w=a.value,y=K.value,I=D.option,b=D.action,C=D.corner,U={onMousedown:ge};return g&&1<e.length&&(U.onDragstart=de,U.onDragover=pe,U.onDragend=ve),e.map((t,a)=>{var e=k(t),o=f[e];let u=!1,n=!1,i=!1;return o&&(u=o.loading,n="error"===o.status,i="pending"===o.status),(0,_vue.h)("div",Object.assign({key:g?e:a,class:["vxe-upload--image-item",{"is--preview":p,"is--circle":w.circle,"is--loading":u,"is--pending":i,"is--error":n}],fileid:e,draggable:!!g||null},U),I?(0,_vn.getSlotVNs)(I({option:t,isMoreView:l,options:_})):[(0,_vue.h)("div",{class:"vxe-upload--image-item-box",style:l?null:y,onClick(e){if(!u&&!n){var t=a;var o=S["showDownloadButton"];const i=B["fileList"],l=S.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;S.showPreview&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:i.map(e=>q(e)),activeIndex:t,showDownloadButton:o,beforeDownloadMethod:l?({index:e})=>l({$upload:N,option:i[e]}):void 0})}}},[u&&o?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading"},[(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),s?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-text"},d?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(d)?d({}):d),{percent:o.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[o.percent])):(0,_ui.renderEmptyElement)(N)]):(0,_ui.renderEmptyElement)(N),(0,_vue.h)("div",{class:"vxe-upload--image-item-img-wrapper",title:(0,_ui.getI18n)("vxe.upload.viewItemTitle")},[(0,_vue.h)("img",{class:"vxe-upload--image-item-img",src:(e=t,(o=S.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod)?o({$upload:N,option:e}):q(e))})]),!u&&(n&&v||i&&c&&!m)?(0,_vue.h)("div",{class:"vxe-upload--image-item-rebtn"},[(0,_vue.h)(_button.default,{icon:n?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:n?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload"),onClick(){ee(t)}})]):(0,_ui.renderEmptyElement)(N),(0,_vue.h)("div",{class:"vxe-upload--image-item-btn-wrapper",onClick(e){e.stopPropagation()}},b?(0,_vn.getSlotVNs)(b({option:t,isMoreView:l,options:_,readonly:x})):[C?(0,_vue.h)("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(C({option:t,isMoreView:l,options:_,readonly:x}))):(0,_ui.renderEmptyElement)(N),!r||x||h||u?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{class:"vxe-upload--image-item-remove-btn",onClick(e){e.stopPropagation(),oe(e,t,a)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},b=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=S,n=B["fileList"],r=L.value,s=X.value,d=W.value,p=Y.value,v=K.value,g=D.default,m=D.tip||D.hint;return r||!t||u&&p?(0,_ui.renderEmptyElement)(N):(0,_vue.h)("div",{key:"action",class:"vxe-upload--image-action"},[(0,_vue.h)("div",{class:"vxe-upload--image-action-btn",onClick:te},g?g({isMoreView:e,options:n,$upload:N}):[(0,_vue.h)("div",{class:"vxe-upload--image-action-box",style:e?null:v},[a?(0,_vue.h)("div",{class:"vxe-upload--image-action-icon"},[(0,_vue.h)("i",{class:i||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_ui.renderEmptyElement)(N),e||l?(0,_vue.h)("div",{class:"vxe-upload--image-action-content"},o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_ui.renderEmptyElement)(N),s&&(d||m)?(0,_vue.h)("div",{class:"vxe-upload--image-action-hint"},m?(0,_vn.getSlotVNs)(m({isMoreView:e,options:n,$upload:N})):""+d):(0,_ui.renderEmptyElement)(N)])])])};const o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>S.modelValue?S.modelValue.length:0,()=>{o.value++}),(0,_vue.watch)(()=>S.modelValue,()=>{o.value++}),(0,_vue.watch)(o,()=>{s()}),(0,_vue.onMounted)(()=>{S.multiple&&S.singleMode&&(0,_log.errLog)("vxe.error.errConflicts",["[upload] multiple","single-mode"]),S.imageStyle&&(0,_log.warnLog)("vxe.error.delProp",["[upload] image-style","image-config"]),S.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(N,"paste",me),_ui.globalEvents.on(N,"mousedown",ce),_ui.globalEvents.on(N,"blur",_e)}),(0,_vue.onUnmounted)(()=>{B.isDragUploadStatus=!1,_ui.globalEvents.off(N,"paste"),_ui.globalEvents.off(N,"mousedown"),_ui.globalEvents.off(N,"blur")}),s(),N.renderVN=()=>{var{showErrorStatus:e,dragToUpload:t,pasteToUpload:o,dragSort:i,dragPlaceholder:l}=S,{isDragUploadStatus:a,showMorePopup:u,isActivated:n,dragIndex:r}=B,s=C.value,d=P.value,p=L.value,v=h.value,g={onMousedown:ge};return t&&-1===r&&(g.onDragover=ae,g.onDragleave=le,g.onDrop=ue),(0,_vue.h)("div",Object.assign({ref:m,class:["vxe-upload",{["size--"+s]:s,"is--active":n,"is--readonly":p,"is--disabled":d,"is--paste":o,"show--error":e,"is--drag":a}]},g),[(v?()=>{var{showList:e,dragSort:t}=S;const{fileList:o,isDragMove:i}=B;var l=J.value;const a=D.moreButton||D["more-button"],{maxCount:u,showMoreButton:n}=l;let r=o,s=0;return u&&o.length>u&&(s=o.length-u,r=o.slice(0,u)),(0,_vue.h)("div",{key:"image",class:"vxe-upload--image-wrapper"},e?[t?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(i?"":"-disabled"),tag:"div",class:"vxe-upload--image-list"},{default:()=>I(r,!1).concat([n&&s?(0,_vue.h)("div",{key:"om",class:"vxe-upload--image-over-more"},a?(0,_vn.getSlotVNs)(a({options:o})):[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:x})]):(0,_ui.renderEmptyElement)(N),b(!1)])}):(0,_vue.h)("div",{class:"vxe-upload--image-list"},I(r,!1).concat([n&&s?(0,_vue.h)("div",{class:"vxe-upload--image-over-more"},a?(0,_vn.getSlotVNs)(a({options:o})):[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:x})]):(0,_ui.renderEmptyElement)(N),b(!1)]))]:[(0,_vue.h)("div",{class:"vxe-upload--image-list"},[b(!1)])])}:()=>{var{showList:e,moreConfig:t,dragSort:o}=S,{fileList:i,isDragMove:l}=B,{maxCount:a,showMoreButton:u,layout:n}=J.value,n="horizontal"===n,r=D.moreButton||D["more-button"];let s=i,d=0;return a&&i.length>a&&(d=i.length-a,s=i.slice(0,a)),(0,_vue.h)("div",{key:"all",class:"vxe-upload--file-wrapper"},e?[u&&t&&n?(0,_ui.renderEmptyElement)(N):y(!0),s.length||u&&n?(0,_vue.h)("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":n}]},[s.length?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>w(s,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},w(s,!1)):(0,_ui.renderEmptyElement)(N),u&&d?(0,_vue.h)("div",{class:"vxe-upload--file-over-more"},r?(0,_vn.getSlotVNs)(r({options:i})):[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[i.length]),status:"primary",onClick:x})]):(0,_ui.renderEmptyElement)(N),u&&t&&n?y(!1):(0,_ui.renderEmptyElement)(N)]):(0,_ui.renderEmptyElement)(N)]:[y(!1)])})(),i?(0,_vue.h)("div",{ref:_,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(N),a&&!u?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},l||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(N)])},N},render(){return this.renderVN()}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-pc-ui",
3
- "version": "4.10.29",
3
+ "version": "4.10.31",
4
4
  "description": "A vue based PC component library",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -25,7 +25,7 @@
25
25
  "style": "lib/style.css",
26
26
  "typings": "types/index.d.ts",
27
27
  "dependencies": {
28
- "@vxe-ui/core": "^4.2.14"
28
+ "@vxe-ui/core": "^4.2.15"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@typescript-eslint/eslint-plugin": "^6.21.0",
@@ -43,7 +43,7 @@ function getNodeOffset (elem: any, container: any, rest: any): any {
43
43
  }
44
44
 
45
45
  export function isPx (val: any) {
46
- return val && /^\d+(\.\d+)?px?$/.test(val)
46
+ return val && /^\d+(\.\d+)?(px)?$/.test(val)
47
47
  }
48
48
 
49
49
  export function isScale (val: any) {
@@ -61,6 +61,10 @@ export default defineVxeComponent({
61
61
  type: Boolean as PropType<VxeUploadPropTypes.DragToUpload>,
62
62
  default: () => XEUtils.clone(getConfig().upload.dragToUpload, true)
63
63
  },
64
+ dragPlaceholder: {
65
+ type: String as PropType<VxeUploadPropTypes.DragPlaceholder>,
66
+ default: () => getConfig().upload.dragPlaceholder
67
+ },
64
68
  pasteToUpload: {
65
69
  type: Boolean as PropType<VxeUploadPropTypes.PasteToUpload>,
66
70
  default: () => XEUtils.clone(getConfig().upload.pasteToUpload, true)
@@ -978,7 +982,7 @@ export default defineVxeComponent({
978
982
  maskClosable: true,
979
983
  slots: {
980
984
  default () {
981
- const { showErrorStatus, dragToUpload, dragSort } = props
985
+ const { showErrorStatus, dragToUpload, dragSort, dragPlaceholder } = props
982
986
  const { isActivated, isDragMove, isDragUploadStatus, dragIndex } = reactData
983
987
  const { fileList } = reactData
984
988
  const isDisabled = computeIsDisabled.value
@@ -1043,7 +1047,7 @@ export default defineVxeComponent({
1043
1047
  isDragUploadStatus
1044
1048
  ? h('div', {
1045
1049
  class: 'vxe-upload--drag-placeholder'
1046
- }, getI18n('vxe.upload.dragPlaceholder'))
1050
+ }, dragPlaceholder || getI18n('vxe.upload.dragPlaceholder'))
1047
1051
  : renderEmptyElement($xeUpload)
1048
1052
  ])
1049
1053
  }
@@ -1773,7 +1777,7 @@ export default defineVxeComponent({
1773
1777
  }
1774
1778
 
1775
1779
  const renderVN = () => {
1776
- const { showErrorStatus, dragToUpload, pasteToUpload, dragSort } = props
1780
+ const { showErrorStatus, dragToUpload, pasteToUpload, dragSort, dragPlaceholder } = props
1777
1781
  const { isDragUploadStatus, showMorePopup, isActivated, dragIndex } = reactData
1778
1782
  const vSize = computeSize.value
1779
1783
  const isDisabled = computeIsDisabled.value
@@ -1812,7 +1816,7 @@ export default defineVxeComponent({
1812
1816
  isDragUploadStatus && !showMorePopup
1813
1817
  ? h('div', {
1814
1818
  class: 'vxe-upload--drag-placeholder'
1815
- }, getI18n('vxe.upload.dragPlaceholder'))
1819
+ }, dragPlaceholder || getI18n('vxe.upload.dragPlaceholder'))
1816
1820
  : renderEmptyElement($xeUpload)
1817
1821
  ])
1818
1822
  }
@@ -91,6 +91,7 @@ export namespace VxeGridPropTypes {
91
91
  [key: string]: any
92
92
  }
93
93
  }
94
+ interface ProxyAjaxQueryFooterParams<D = any> extends ProxyAjaxQueryParams<D> {}
94
95
 
95
96
  interface ProxyAjaxQueryAllParams<D = any> {
96
97
  $table: VxeTableConstructor<D>
@@ -163,6 +164,12 @@ export namespace VxeGridPropTypes {
163
164
  $grid: VxeGridConstructor<D> | null | undefined
164
165
  $gantt: VxeGanttConstructor<D> | null | undefined
165
166
  }) => any[])
167
+ footerData?: string | ((params: {
168
+ data: any
169
+ $table: VxeTableConstructor<D>
170
+ $grid: VxeGridConstructor<D> | null | undefined
171
+ $gantt: VxeGanttConstructor<D> | null | undefined
172
+ }) => any[])
166
173
  total?: string | ((params: {
167
174
  data: any
168
175
  $table: VxeTableConstructor<D>
@@ -183,6 +190,9 @@ export namespace VxeGridPropTypes {
183
190
  queryAll?(params: ProxyAjaxQueryAllParams<D>): Promise<any>
184
191
  queryAllSuccess?(params: ProxyAjaxQueryAllParams<D> & ProxyAjaxResponseParams): void
185
192
  queryAllError?(params: ProxyAjaxQueryAllParams<D> & ProxyAjaxResponseParams): void
193
+ queryFooter?(params: ProxyAjaxQueryFooterParams<D>, ...args: any[]): Promise<any>
194
+ queryFooterSuccess?(params: ProxyAjaxQueryFooterParams<D> & ProxyAjaxResponseParams): void
195
+ queryFooterError?(params: ProxyAjaxQueryFooterParams<D> & ProxyAjaxResponseParams): void
186
196
  delete?(params: ProxyAjaxDeleteParams<D>, ...args: any[]): Promise<any>
187
197
  deleteSuccess?(params: ProxyAjaxDeleteParams<D> & ProxyAjaxResponseParams): void
188
198
  deleteError?(params: ProxyAjaxDeleteParams<D> & ProxyAjaxResponseParams): void
@@ -54,6 +54,7 @@ export namespace VxeUploadPropTypes {
54
54
  export type SingleMode = boolean
55
55
  export type DragSort = boolean
56
56
  export type DragToUpload = boolean
57
+ export type DragPlaceholder = string
57
58
  export type PasteToUpload = boolean
58
59
  export type KeyField = string
59
60
  export type UrlMode = boolean
@@ -152,6 +153,7 @@ export interface VxeUploadProps {
152
153
  singleMode?: VxeUploadPropTypes.SingleMode
153
154
  dragSort?: VxeUploadPropTypes.DragSort
154
155
  dragToUpload?: VxeUploadPropTypes.DragToUpload
156
+ dragPlaceholder?: VxeUploadPropTypes.DragPlaceholder
155
157
  pasteToUpload?: VxeUploadPropTypes.PasteToUpload
156
158
  keyField?: VxeUploadPropTypes.KeyField
157
159
  urlMode?: VxeUploadPropTypes.UrlMode