vxe-pc-ui 4.5.11 → 4.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/drawer/src/drawer.js +6 -5
- package/es/icon/style.css +1 -1
- package/es/modal/src/modal.js +6 -5
- package/es/split/src/split.js +30 -6
- package/es/split/style.css +10 -6
- package/es/split/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +22 -2
- package/es/vxe-split/style.css +10 -6
- package/es/vxe-split/style.min.css +1 -1
- package/lib/drawer/src/drawer.js +6 -5
- package/lib/drawer/src/drawer.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +69 -17
- package/lib/index.umd.min.js +1 -1
- package/lib/modal/src/modal.js +6 -5
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/split/src/split.js +29 -3
- package/lib/split/src/split.min.js +1 -1
- package/lib/split/style/style.css +10 -6
- package/lib/split/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +2 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/upload/src/upload.js +25 -2
- package/lib/upload/src/upload.min.js +1 -1
- package/lib/vxe-split/style/style.css +10 -6
- package/lib/vxe-split/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/drawer/src/drawer.ts +6 -5
- package/packages/modal/src/modal.ts +6 -5
- package/packages/split/src/split.ts +33 -6
- package/packages/ui/index.ts +1 -0
- package/packages/upload/src/upload.ts +23 -2
- package/styles/components/split.scss +28 -20
- package/types/components/drawer.d.ts +1 -0
- package/types/components/modal.d.ts +1 -0
- package/types/components/split.d.ts +5 -0
- package/types/components/table.d.ts +26 -2
- package/types/components/upload.d.ts +2 -0
- /package/es/icon/{iconfont.1743578648080.ttf → iconfont.1744078845757.ttf} +0 -0
- /package/es/icon/{iconfont.1743578648080.woff → iconfont.1744078845757.woff} +0 -0
- /package/es/icon/{iconfont.1743578648080.woff2 → iconfont.1744078845757.woff2} +0 -0
- /package/es/{iconfont.1743578648080.ttf → iconfont.1744078845757.ttf} +0 -0
- /package/es/{iconfont.1743578648080.woff → iconfont.1744078845757.woff} +0 -0
- /package/es/{iconfont.1743578648080.woff2 → iconfont.1744078845757.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1743578648080.ttf → iconfont.1744078845757.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1743578648080.woff → iconfont.1744078845757.woff} +0 -0
- /package/lib/icon/style/{iconfont.1743578648080.woff2 → iconfont.1744078845757.woff2} +0 -0
- /package/lib/{iconfont.1743578648080.ttf → iconfont.1744078845757.ttf} +0 -0
- /package/lib/{iconfont.1743578648080.woff → iconfont.1744078845757.woff} +0 -0
- /package/lib/{iconfont.1743578648080.woff2 → iconfont.1744078845757.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.5.
|
|
29
|
+
const version = exports.version = "4.5.14";
|
|
30
30
|
_core.VxeUI.uiVersion = version;
|
|
31
31
|
_core.VxeUI.dynamicApp = _dynamics.dynamicApp;
|
|
32
32
|
function config(options) {
|
|
@@ -294,6 +294,7 @@ _core.VxeUI.setup = setup;
|
|
|
294
294
|
}
|
|
295
295
|
},
|
|
296
296
|
split: {
|
|
297
|
+
resize: true,
|
|
297
298
|
itemConfig: {
|
|
298
299
|
minWidth: 40,
|
|
299
300
|
minHeight: 40
|
package/lib/ui/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={version:!0,config:!0,setup:!0},_core=(exports.config=config,exports.default=void 0,exports.setup=setup,exports.version=void 0,require("@vxe-ui/core")),_dynamics=(Object.keys(_core).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_core[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _core[e]}})}),require("../dynamics")),_log=require("./src/log");const version=exports.version="4.5.11";function config(e){return"development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return"development"===process.env.NODE_ENV&&(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:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},countdown:{},colorPicker:{type:"hex",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePicker:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,shortcutConfig:{align:"left",mode:"text",autoClose:!0}},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{showPreview:!0,showPrintButton:!0,maskClosable:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{virtualYConfig:{enabled:!0,gt:100}},loading:{showIcon:!0,showText:!0},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controls:!0},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{},passwordInput:{controls:!0},printPageBreak:{},pulldown:{destroyOnClose:!0},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:100,oSize:2}},split:{itemConfig:{minWidth:40,minHeight:40}},splitPane:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tabs:{},tag:{},textEllipsis:{underline:!0},text:{},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0}},treeSelect:{treeConfig:{radioConfig:{},checkboxConfig:{}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{}});const iconPrefix="vxe-icon-";(0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",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",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",NUMBER_INPUT_PREV_NUM:iconPrefix+"caret-up",NUMBER_INPUT_NEXT_NUM:iconPrefix+"caret-down",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_COPY:iconPrefix+"copy",EYE_DROPPER:iconPrefix+"dropper",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.5.14";function config(e){return"development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return"development"===process.env.NODE_ENV&&(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:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},countdown:{},colorPicker:{type:"hex",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePicker:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,shortcutConfig:{align:"left",mode:"text",autoClose:!0}},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{showPreview:!0,showPrintButton:!0,maskClosable:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{virtualYConfig:{enabled:!0,gt:100}},loading:{showIcon:!0,showText:!0},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controls:!0},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{},passwordInput:{controls:!0},printPageBreak:{},pulldown:{destroyOnClose:!0},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:100,oSize:2}},split:{resize:!0,itemConfig:{minWidth:40,minHeight:40}},splitPane:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tabs:{},tag:{},textEllipsis:{underline:!0},text:{},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0}},treeSelect:{treeConfig:{radioConfig:{},checkboxConfig:{}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{}});const iconPrefix="vxe-icon-";(0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",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",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",NUMBER_INPUT_PREV_NUM:iconPrefix+"caret-up",NUMBER_INPUT_NEXT_NUM:iconPrefix+"caret-down",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_COPY:iconPrefix+"copy",EYE_DROPPER:iconPrefix+"dropper",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right"});var _default=exports.default=_core.VxeUI;
|
package/lib/ui/src/log.js
CHANGED
|
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.warnLog = exports.errLog = void 0;
|
|
7
7
|
var _core = require("@vxe-ui/core");
|
|
8
|
-
const version = `ui v${"4.5.
|
|
8
|
+
const version = `ui v${"4.5.14"}`;
|
|
9
9
|
const warnLog = exports.warnLog = _core.log.create('warn', version);
|
|
10
10
|
const errLog = exports.errLog = _core.log.create('error', version);
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");const version="ui v4.5.
|
|
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.5.14",warnLog=exports.warnLog=_core.log.create("warn",version),errLog=exports.errLog=_core.log.create("error",version);
|
package/lib/upload/src/upload.js
CHANGED
|
@@ -139,6 +139,10 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
139
139
|
type: Boolean,
|
|
140
140
|
default: () => (0, _ui.getConfig)().upload.showPreview
|
|
141
141
|
},
|
|
142
|
+
showTip: {
|
|
143
|
+
type: Boolean,
|
|
144
|
+
default: () => null
|
|
145
|
+
},
|
|
142
146
|
tipText: String,
|
|
143
147
|
hintText: String,
|
|
144
148
|
previewMethod: Function,
|
|
@@ -266,6 +270,23 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
266
270
|
}
|
|
267
271
|
return '';
|
|
268
272
|
});
|
|
273
|
+
const computedShowTipText = (0, _vue.computed)(() => {
|
|
274
|
+
const {
|
|
275
|
+
showTip,
|
|
276
|
+
tipText
|
|
277
|
+
} = props;
|
|
278
|
+
if (_xeUtils.default.isBoolean(showTip)) {
|
|
279
|
+
return showTip;
|
|
280
|
+
}
|
|
281
|
+
const defShowTip = (0, _ui.getConfig)().upload.showTip;
|
|
282
|
+
if (_xeUtils.default.isBoolean(defShowTip)) {
|
|
283
|
+
return defShowTip;
|
|
284
|
+
}
|
|
285
|
+
if (tipText) {
|
|
286
|
+
return true;
|
|
287
|
+
}
|
|
288
|
+
return false;
|
|
289
|
+
});
|
|
269
290
|
const computedDefTipText = (0, _vue.computed)(() => {
|
|
270
291
|
const {
|
|
271
292
|
limitSize,
|
|
@@ -1234,6 +1255,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1234
1255
|
} = props;
|
|
1235
1256
|
const isDisabled = computeIsDisabled.value;
|
|
1236
1257
|
const formReadonly = computeFormReadonly.value;
|
|
1258
|
+
const showTipText = computedShowTipText.value;
|
|
1237
1259
|
const defTipText = computedDefTipText.value;
|
|
1238
1260
|
const overCount = computeOverCount.value;
|
|
1239
1261
|
const defaultSlot = slots.default;
|
|
@@ -1253,7 +1275,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1253
1275
|
content: isMoreView || showButtonText ? buttonText ? `${buttonText}` : (0, _ui.getI18n)('vxe.upload.fileBtnText') : '',
|
|
1254
1276
|
icon: showButtonIcon ? buttonIcon || (0, _ui.getIcon)().UPLOAD_FILE_ADD : '',
|
|
1255
1277
|
disabled: isDisabled
|
|
1256
|
-
})]), defTipText || tipSlot ? (0, _vue.h)('div', {
|
|
1278
|
+
})]), showTipText && (defTipText || tipSlot) ? (0, _vue.h)('div', {
|
|
1257
1279
|
class: 'vxe-upload--file-action-tip'
|
|
1258
1280
|
}, tipSlot ? (0, _vn.getSlotVNs)(tipSlot({
|
|
1259
1281
|
$upload: $xeUpload
|
|
@@ -1412,6 +1434,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1412
1434
|
autoHiddenButton
|
|
1413
1435
|
} = props;
|
|
1414
1436
|
const formReadonly = computeFormReadonly.value;
|
|
1437
|
+
const showTipText = computedShowTipText.value;
|
|
1415
1438
|
const defTipText = computedDefTipText.value;
|
|
1416
1439
|
const overCount = computeOverCount.value;
|
|
1417
1440
|
const imgStyle = computeImgStyle.value;
|
|
@@ -1437,7 +1460,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1437
1460
|
class: buttonIcon || (0, _ui.getIcon)().UPLOAD_IMAGE_ADD
|
|
1438
1461
|
})]) : (0, _vue.createCommentVNode)(), isMoreView || showButtonText ? (0, _vue.h)('div', {
|
|
1439
1462
|
class: 'vxe-upload--image-action-content'
|
|
1440
|
-
}, buttonText ? `${buttonText}` : (0, _ui.getI18n)('vxe.upload.imgBtnText')) : (0, _vue.createCommentVNode)(), defTipText || tipSlot ? (0, _vue.h)('div', {
|
|
1463
|
+
}, buttonText ? `${buttonText}` : (0, _ui.getI18n)('vxe.upload.imgBtnText')) : (0, _vue.createCommentVNode)(), showTipText && (defTipText || tipSlot) ? (0, _vue.h)('div', {
|
|
1441
1464
|
class: 'vxe-upload--image-action-hint'
|
|
1442
1465
|
}, tipSlot ? (0, _vn.getSlotVNs)(tipSlot({
|
|
1443
1466
|
$upload: $xeUpload
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_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,_vue.defineComponent)({name:"VxeUpload",props:{modelValue:[Array,String,Object],showList:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showList},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},mode:{type:String,default:()=>(0,_ui.getConfig)().upload.mode},imageTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)},imageConfig:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)},imageStyle:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)},fileTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)},dragSort:Boolean,dragToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)},pasteToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)},keyField:String,singleMode:Boolean,urlMode:Boolean,multiple:Boolean,limitSize:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitSize},limitCount:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitCount},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,default:()=>(0,_ui.getConfig)().upload.progressText},autoHiddenButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoHiddenButton},showUploadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showUploadButton},buttonText:{type:String,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},tipText:String,hintText:String,previewMethod:Function,uploadMethod:Function,beforeRemoveMethod:Function,removeMethod:Function,beforeDownloadMethod:Function,downloadMethod:Function,getUrlMethod:Function,getThumbnailUrlMethod:Function,size:{type:String,default:()=>(0,_ui.getConfig)().upload.size||(0,_ui.getConfig)().size}},emits:["update:modelValue","add","remove","remove-fail","download","download-fail","upload-success","upload-error","sort-dragend"],setup(C,e){const{emit:u,slots:y}=e,w=(0,_vue.inject)("$xeForm",null),I=(0,_vue.inject)("xeFormItemInfo",null),a=(0,_vue.inject)("$xeTable",null);var t=_xeUtils.default.uniqueId();const j=(0,_ui.useSize)(C)["computeSize"],g=(0,_vue.ref)(),p=(0,_vue.ref)(),c=(0,_vue.ref)(),m=(0,_vue.ref)(),b=(0,_vue.reactive)({isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}),r={imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1},l={refElem:g},U=(0,_vue.computed)(()=>{var e=C["readonly"];return null===e?!!w&&w.props.readonly:e}),M=(0,_vue.computed)(()=>{var e=C["disabled"];return null===e?!!w&&w.props.disabled:e}),D=(0,_vue.computed)(()=>C.keyField||"_X_KEY"),_=(0,_vue.computed)(()=>"image"===C.mode),T=(0,_vue.computed)(()=>C.nameField||"name"),E=(0,_vue.computed)(()=>C.typeField||"type"),S=(0,_vue.computed)(()=>C.urlField||"url"),V=(0,_vue.computed)(()=>C.sizeField||"size"),$=(0,_vue.computed)(()=>1024*_xeUtils.default.toNumber(C.limitSize)*1024),B=(0,_vue.computed)(()=>C.multiple?_xeUtils.default.toNumber(C.limitCount):1),f=(0,_vue.computed)(()=>{var e=C["multiple"],t=b["fileList"],o=B.value;return e?!o||t.length>=o:1<=t.length}),q=(0,_vue.computed)(()=>{var e=_xeUtils.default.toNumber(C.limitSize);return e?1048576<e?e/1048576+"T":1024<e?e/1024+"G":e+"M":""}),G=(0,_vue.computed)(()=>{var{limitSize:e,fileTypes:t,multiple:o,limitCount:a}=C,l=C.tipText||C.hintText,i=_.value,u=q.value;return _xeUtils.default.isString(l)?l:(l=[],i?(o&&a&&l.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[a])),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&&a&&l.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[a]))),l.join((0,_ui.getI18n)("vxe.base.comma")))}),i=(0,_vue.computed)(()=>Object.assign({},C.imageConfig||C.imageStyle)),H=(0,_vue.computed)(()=>{var{width:e,height:t}=i.value,o={};return e&&(o.width=(0,_dom.toCssUnit)(e)),t&&(o.height=(0,_dom.toCssUnit)(t)),o}),Y=(0,_vue.computed)(()=>Object.assign({showMoreButton:!0},C.moreConfig)),d={},h={xID:t,props:C,context:e,reactData:b,internalData:r,getRefMaps:()=>l,getComputeMaps:()=>d},P=()=>_xeUtils.default.uniqueId(),L=e=>{return e[D.value]},s=()=>{var{modelValue:e,multiple:t}=C,o=U.value;const l=D.value,i=T.value,u=E.value,n=S.value,r=V.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 a=(o?o.searchQuery[i]:"")||decodeURIComponent(""+(t||"")).split("/").pop()||"";return{[i]:a,[u]:(o?o.searchQuery[u]:"")||N(a),[n]:t,[r]:_xeUtils.default.toNumber(o?o.searchQuery[r]:0)||0,[l]:P()}}const a=e[i]||"";return e[i]=a,e[u]=e[u]||N(a),e[n]=e[n]||"",e[r]=e[r]||0,e[l]=e[l]||P(),e}):[];b.fileList=o||t?e:e.slice(0,1)},N=e=>{var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},O=(e,t,o)=>{u(e,(0,_ui.createEvent)(o,{$upload:h},t))},A=e=>{var{singleMode:t,urlMode:o}=C;const a=S.value,l=T.value;let i=e?e.slice(0):[];o&&(i=i.map(e=>{var t=e[a];if(t&&!_xeUtils.default.parseUrl(t).searchQuery[l])return""+t+(-1===t.indexOf("?")?"?":"&")+l+"="+encodeURIComponent(e[l]||"");return t})),u("update:modelValue",t?i[0]||null:i)},Q=e=>{var t=C.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod;return t?t({$upload:h,option:e}):n(e)},n=e=>{var t=C.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=S.value;return t?t({$upload:h,option:e}):e[o]},X=(e,t)=>{var o=C.previewMethod||(0,_ui.getConfig)().upload.previewMethod;if(C.showPreview)if(o)o({$upload:h,option:t});else{var a=t;var{imageTypes:o,showDownloadButton:t}=C;const i=E.value,u=C.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;var l=r["imagePreviewTypes"];l.concat(o||[]).some(e=>(""+e).toLowerCase()===(""+a[i]).toLowerCase())&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:[n(a)],showDownloadButton:t,beforeDownloadMethod:u?()=>u({$upload:h,option:a}):void 0})}},W=(e,t,o)=>{var a=C["showDownloadButton"];const l=b["fileList"],i=C.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;C.showPreview&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:l.map(e=>n(e)),activeIndex:o,showDownloadButton:a,beforeDownloadMethod:i?({index:e})=>i({$upload:h,option:l[e]}):void 0})},K=(o,e)=>{const a=C["showErrorStatus"],l=L(o);var t=C.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?Promise.resolve(t({$upload:h,file:e,option:o,updateProgress(e){var t=b["fileCacheMaps"],t=t[L(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),Object.assign(o,e),O("upload-success",{option:o,data:e},null)}).catch(e=>{var t=b["fileCacheMaps"],t=t[l];t&&(t.status="error"),a?Object.assign(o,e):b.fileList=b.fileList.filter(e=>L(e)!==l),O("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())},J=e=>{const{uploadMethod:t,urlMode:o}=C;var a,l=b["fileCacheMaps"],l=l[L(e)];(t||(0,_ui.getConfig)().upload.uploadMethod)&&l&&(a=l.file,l.loading=!0,l.status="",l.percent=0,K(e,a).then(()=>{o&&A(b.fileList)}))},v=(t,a)=>{var{multiple:e,urlMode:o}=C,l=b["fileList"];const i=C.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,u=D.value,n=T.value,r=E.value,d=S.value,s=V.value;var v=$.value;const p=B.value;var g=q.value;let c=t;if(e&&p){if(l.length>=p)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.overCountErr",[p])}));const h=c.length-(p-l.length);if(0<h){const x=c.slice(p-l.length);_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",[p,h])),(0,_vue.h)("div",{class:"vxe-upload--file-message-over-extra"},x.map((e,t)=>(0,_vue.h)("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)))])}}})}c=c.slice(0,p-l.length)}if(v)for(let e=0;e<t.length;e++)if(t[0].size>v)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.overSizeErr",[g])}));const m=Object.assign({},b.fileCacheMaps),_=e?l:[],f=[];c.forEach(e=>{var t=e["name"],o=P(),t={[n]:t,[r]:N(t),[s]:e.size,[d]:URL.createObjectURL(e),[u]:o},o=(i&&(m[o]={file:e,loading:!0,status:"",percent:0}),(0,_vue.reactive)(t));i&&f.push(K(o,e)),_.push(o),O("add",{option:o},a)}),b.fileList=_,b.fileCacheMaps=m,Promise.all(o?f:[]).then(()=>{A(_),w&&I&&w.triggerItemEvent(a,I.itemConfig.field,_)})},Z=t=>{var{multiple:e,imageTypes:o,fileTypes:a}=C,l=M.value,i=_.value;return l?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:i?o:a}).then(e=>(v(e.files,t),e))},ee=e=>{Z(e).catch(()=>{})},te=(e,t,o)=>{var a=b["fileList"];a.splice(o,1),A(a),w&&I&&w.triggerItemEvent(e,I.itemConfig.field,a),O("remove",{option:t},e)},oe=(t,o,a)=>{var e=C.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod;const l=C.removeMethod||(0,_ui.getConfig)().upload.removeMethod;Promise.resolve(!e||e({$upload:h,option:o})).then(e=>{e?l?Promise.resolve(l({$upload:h,option:o})).then(()=>{te(t,o,a)}).catch(e=>e):te(t,o,a):O("remove-fail",{option:o},t)})},ae=(e,t)=>{O("download",{option:t},e)},le=(t,o)=>{var e=C.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;const a=C.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!e||e({$upload:h,option:o})).then(e=>{e?a?Promise.resolve(a({$upload:h,option:o})).then(()=>{ae(t,o)}).catch(e=>e):ae(t,o):O("download-fail",{option:o},t)})},ie=e=>{var t,o,a,l=e.currentTarget,{clientX:e,clientY:i}=e;l&&({x:l,y:t,height:o,width:a}=l.getBoundingClientRect(),e<l||l+a<e||i<t||t+o<i)&&(b.isDragUploadStatus=!1)},ue=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),b.isDragUploadStatus=!0)},ne=(e,t)=>{var o=C["imageTypes"],a=r["imagePreviewTypes"];if(_.value){const l=a.concat(o&&o.length?o:[]);t=t.filter(e=>{const t=(""+(e.type.split("/")[1]||"")).toLowerCase();return!!l.some(e=>(""+e).toLowerCase()===t)})}t.length?v(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")})},re=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),(t=de(t)).length)&&ne(e,t),b.isDragUploadStatus=!1},de=e=>{const t=[];return _xeUtils.default.arrayEach(e,e=>{e=e.getAsFile();e&&t.push(e)}),t},x=()=>{const s=U.value,v=_.value;_ui.VxeUI.modal&&_ui.VxeUI.modal.open({title:s?(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}=C,{isActivated:a,isDragMove:l,isDragUploadStatus:i,dragIndex:u}=b;const n=b["fileList"];var r=M.value,d={};return t&&-1===u&&(d.onDragover=ue,d.onDragleave=ie,d.onDrop=re),(0,_vue.h)("div",Object.assign({ref:p,class:["vxe-upload--more-popup",{"is--readonly":s,"is--disabled":r,"is--active":a,"show--error":e,"is--drag":i}]},d),[v?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--image-more-list"},{default:()=>z(n,!0).concat(R(!0))}):(0,_vue.h)("div",{class:"vxe-upload--image-more-list"},z(n,!0).concat(R(!0))):(0,_vue.h)("div",{class:"vxe-upload--file-more-list"},[k(!0),o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>F(n,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},F(n,!0))]),o?(0,_vue.h)("div",{ref:m,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(h),i?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(h)])}},onShow(){b.showMorePopup=!0},onHide(){b.showMorePopup=!1}})},se=(e,t,o)=>{var a,l=b["showMorePopup"],i=g.value,u=p.value,u=l?u:i;u&&(i=u.getBoundingClientRect(),u=c.value,a=m.value,l=l?a:u)&&(a=t.getBoundingClientRect(),l.style.display="block",l.style.top=Math.max(1,a.y-i.y)+"px",l.style.left=Math.max(1,a.x-i.x)+"px",l.style.height=a.height+"px",l.style.width=a.width-1+"px",l.setAttribute("drag-pos",o))},ve=e=>{e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0);const t=e.currentTarget;e=t.parentElement,e=_xeUtils.default.findIndexOf(Array.from(e.children),e=>t===e);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 a=_.value;const i=t.currentTarget;var l=i.parentElement,l=_xeUtils.default.findIndexOf(Array.from(l.children),e=>i===e);let e="";e=a?t.clientX-i.getBoundingClientRect().x<i.clientWidth/2?"left":"right":t.clientY-i.getBoundingClientRect().y<i.clientHeight/2?"top":"bottom",o===l?se(0,i,e):(se(0,i,e),r.prevDragIndex=l,r.prevDragPos=e)}},ge=e=>{var{fileList:t,dragIndex:o}=b,{prevDragIndex:a,prevDragPos:l}=r,i="bottom"===l||"right"===l?1:0,u=t[o];const n=t[a];u&&n&&(t.splice(o,1),a=_xeUtils.default.findIndexOf(t,e=>n===e)+i,t.splice(a,0,u),O("sort-dragend",{oldItem:u,newItem:n,dragPos:l,offsetIndex:i,_index:{newIndex:a,oldIndex:o}},e)),t=c.value,u=m.value,t&&(t.style.display=""),u&&(u.style.display=""),b.dragIndex=-1},ce=e=>{a&&e.stopPropagation(),b.isActivated=!0},me=e=>{var t=C["pasteToUpload"],o=b["isActivated"];o&&t&&(o=e.clipboardData||e.originalEvent.clipboardData)&&(t=o["items"],t)&&(o=de(t)).length&&(e.preventDefault(),ne(e,o))},_e=e=>{var t=g.value,o=p.value;let a=(0,_dom.getEventTargetNode)(e,t).flag;!a&&o&&(o=(t=o.parentElement||o)&&t.parentElement,a=(0,_dom.getEventTargetNode)(e,o).flag),b.isActivated=a},fe=()=>{b.isActivated=!1};t={dispatchEvent:O,choose(){return Z(null)}};Object.assign(h,t,{});const F=(e,u)=>{const{showRemoveButton:n,showDownloadButton:r,showProgress:d,progressText:s,showPreview:v,showErrorStatus:p,dragSort:g}=C,c=b["fileCacheMaps"],m=M.value,_=U.value,f=T.value,h=E.value,x=y.corner,w={};return g&&1<e.length&&(w.onDragstart=ve,w.onDragover=pe,w.onDragend=ge),e.map((t,o)=>{var e=L(t),a=c[e];const l=a&&a.loading,i=a&&"error"===a.status;return(0,_vue.h)("div",Object.assign({key:g?e:o,class:["vxe-upload--file-item",{"is--preview":v,"is--loading":l,"is--error":i}],fileid:e,draggable:!!g||null},w),[(0,_vue.h)("div",{class:"vxe-upload--file-item-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_"+(""+t[h]).toLocaleUpperCase()]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),(0,_vue.h)("div",{class:"vxe-upload--file-item-name",onClick(e){l||i||X(e,t)}},""+(t[f]||"")),l?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_vue.createCommentVNode)(),d&&l&&a?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-text"},s?_xeUtils.default.toFormatString(s,{percent:a.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[a.percent])):(0,_vue.createCommentVNode)(),p&&i?(0,_vue.h)("div",{class:"vxe-upload--image-item-error"},[(0,_vue.h)(_button.default,{icon:(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD,mode:"text",status:"primary",content:(0,_ui.getI18n)("vxe.upload.reUpload"),onClick(){J(t)}})]):(0,_vue.createCommentVNode)(),(0,_vue.h)("div",{class:"vxe-upload--file-item-btn-wrapper"},[x?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(x({option:t,isMoreView:u,readonly:_}))):(0,_vue.createCommentVNode)(),r&&!l?(0,_vue.h)("div",{class:"vxe-upload--file-item-download-btn",onClick(e){le(e,t)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]):(0,_vue.createCommentVNode)(),!n||_||m||l?(0,_vue.createCommentVNode)():(0,_vue.h)("div",{class:"vxe-upload--file-item-remove-btn",onClick(e){oe(e,t,o)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},k=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:a,showButtonText:l,showButtonIcon:i,autoHiddenButton:u}=C,n=M.value,r=U.value,d=G.value,s=f.value,v=y.default,p=y.tip||y.hint;return r||!t?(0,_vue.createCommentVNode)():(0,_vue.h)("div",{class:"vxe-upload--file-action"},[u&&s?(0,_vue.createCommentVNode)():(0,_vue.h)("div",{class:"vxe-upload--file-action-btn",onClick:ee},v?(0,_vn.getSlotVNs)(v({$upload:h})):[(0,_vue.h)(_button.default,{class:"vxe-upload--file-action-button",content:e||l?o?""+o:(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:i?a||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:n})]),d||p?(0,_vue.h)("div",{class:"vxe-upload--file-action-tip"},p?(0,_vn.getSlotVNs)(p({$upload:h})):d):(0,_vue.createCommentVNode)()])},z=(e,u)=>{const{showRemoveButton:n,showProgress:r,progressText:d,showPreview:s,showErrorStatus:v,dragSort:p}=C,g=b["fileCacheMaps"],c=M.value,m=U.value,_=i.value,f=H.value,h=y.corner,x={onMousedown:ce};return p&&1<e.length&&(x.onDragstart=ve,x.onDragover=pe,x.onDragend=ge),e.map((t,o)=>{var e=L(t),a=g[e];const l=a&&a.loading,i=a&&"error"===a.status;return(0,_vue.h)("div",Object.assign({key:p?e:o,class:["vxe-upload--image-item",{"is--preview":s,"is--circle":_.circle,"is--loading":l,"is--error":i}],fileid:e,draggable:!!p||null},x),[(0,_vue.h)("div",{class:"vxe-upload--image-item-box",style:u?null:f,title:(0,_ui.getI18n)("vxe.upload.viewItemTitle"),onClick(e){l||i||W(e,t,o)}},[l&&a?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading"},[(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),r?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-text"},d?_xeUtils.default.toFormatString(d,{percent:a.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[a.percent])):(0,_vue.createCommentVNode)()]):(0,_vue.createCommentVNode)(),l?(0,_vue.createCommentVNode)():i&&v?(0,_vue.h)("div",{class:"vxe-upload--image-item-error"},[(0,_vue.h)(_button.default,{icon:(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD,mode:"text",status:"primary",content:(0,_ui.getI18n)("vxe.upload.reUpload"),onClick(){J(t)}})]):(0,_vue.h)("div",{class:"vxe-upload--image-item-img-wrapper"},[(0,_vue.h)("img",{class:"vxe-upload--image-item-img",src:Q(t)})]),(0,_vue.h)("div",{class:"vxe-upload--image-item-btn-wrapper",onClick(e){e.stopPropagation()}},[h?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(h({option:t,isMoreView:u,readonly:m}))):(0,_vue.createCommentVNode)(),!n||m||c||l?(0,_vue.createCommentVNode)():(0,_vue.h)("div",{class:"vxe-upload--image-item-remove-btn",onClick(e){e.stopPropagation(),oe(e,t,o)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},R=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:a,showButtonText:l,showButtonIcon:i,autoHiddenButton:u}=C,n=U.value,r=G.value,d=f.value,s=H.value,v=y.default,p=y.tip||y.hint;return n||!t||u&&d?(0,_vue.createCommentVNode)():(0,_vue.h)("div",{key:"action",class:"vxe-upload--image-action"},[(0,_vue.h)("div",{class:"vxe-upload--image-action-btn",onClick:ee},v?v({$upload:h}):[(0,_vue.h)("div",{class:"vxe-upload--image-action-box",style:e?null:s},[i?(0,_vue.h)("div",{class:"vxe-upload--image-action-icon"},[(0,_vue.h)("i",{class:a||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_vue.createCommentVNode)(),e||l?(0,_vue.h)("div",{class:"vxe-upload--image-action-content"},o?""+o:(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_vue.createCommentVNode)(),r||p?(0,_vue.h)("div",{class:"vxe-upload--image-action-hint"},p?(0,_vn.getSlotVNs)(p({$upload:h})):r):(0,_vue.createCommentVNode)()])])])};const o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>C.modelValue?C.modelValue.length:0,()=>{o.value++}),(0,_vue.watch)(()=>C.modelValue,()=>{o.value++}),(0,_vue.watch)(o,()=>{s()}),(0,_vue.onMounted)(()=>{"development"===process.env.NODE_ENV&&(C.multiple&&C.singleMode&&(0,_log.errLog)("vxe.error.errConflicts",["multiple","single-mode"]),C.imageStyle)&&(0,_log.warnLog)("vxe.error.delProp",["image-style","image-config"]),C.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(h,"paste",me),_ui.globalEvents.on(h,"mousedown",_e),_ui.globalEvents.on(h,"blur",fe)}),(0,_vue.onUnmounted)(()=>{b.isDragUploadStatus=!1,_ui.globalEvents.off(h,"paste"),_ui.globalEvents.off(h,"mousedown"),_ui.globalEvents.off(h,"blur")}),s(),h.renderVN=()=>{var{showErrorStatus:e,dragToUpload:t,pasteToUpload:o,dragSort:a}=C,{isDragUploadStatus:l,showMorePopup:i,isActivated:u,dragIndex:n}=b,r=j.value,d=M.value,s=U.value,v=_.value,p={onMousedown:ce};return t&&-1===n&&(p.onDragover=ue,p.onDragleave=ie,p.onDrop=re),(0,_vue.h)("div",Object.assign({ref:g,class:["vxe-upload",{["size--"+r]:r,"is--active":u,"is--readonly":s,"is--disabled":d,"is--paste":o,"show--error":e,"is--drag":l}]},p),[(v?()=>{var{showList:e,dragSort:t}=C;const{fileList:o,isDragMove:a}=b,{maxCount:l,showMoreButton:i}=Y.value;let u=o,n=0;return l&&o.length>l&&(n=o.length-l,u=o.slice(0,l)),(0,_vue.h)("div",{key:"image",class:"vxe-upload--image-wrapper"},e?[t?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(a?"":"-disabled"),tag:"div",class:"vxe-upload--image-list"},{default:()=>z(u,!1).concat([i&&n?(0,_vue.h)("div",{key:"om",class:"vxe-upload--image-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:x})]):(0,_vue.createCommentVNode)(),R(!1)])}):(0,_vue.h)("div",{class:"vxe-upload--image-list"},z(u,!1).concat([i&&n?(0,_vue.h)("div",{class:"vxe-upload--image-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:x})]):(0,_vue.createCommentVNode)(),R(!1)]))]:[(0,_vue.h)("div",{class:"vxe-upload--image-list"},[R(!1)])])}:()=>{var{showList:e,moreConfig:t,dragSort:o}=C,{fileList:a,isDragMove:l}=b,{maxCount:i,showMoreButton:u,layout:n}=Y.value,n="horizontal"===n;let r=a,d=0;return i&&a.length>i&&(d=a.length-i,r=a.slice(0,i)),(0,_vue.h)("div",{key:"all",class:"vxe-upload--file-wrapper"},e?[u&&t&&n?(0,_vue.createCommentVNode)():k(!0),r.length||u&&n?(0,_vue.h)("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":n}]},[r.length?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>F(r,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},F(r,!1)):(0,_vue.createCommentVNode)(),u&&d?(0,_vue.h)("div",{class:"vxe-upload--file-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[a.length]),status:"primary",onClick:x})]):(0,_vue.createCommentVNode)(),u&&t&&n?k(!1):(0,_vue.createCommentVNode)()]):(0,_vue.createCommentVNode)()]:[k(!1)])})(),a?(0,_vue.h)("div",{ref:c,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(h),l&&!i?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(h)])},h},render(){return this.renderVN()}});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_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,_vue.defineComponent)({name:"VxeUpload",props:{modelValue:[Array,String,Object],showList:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showList},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},mode:{type:String,default:()=>(0,_ui.getConfig)().upload.mode},imageTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)},imageConfig:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)},imageStyle:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)},fileTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)},dragSort:Boolean,dragToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)},pasteToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)},keyField:String,singleMode:Boolean,urlMode:Boolean,multiple:Boolean,limitSize:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitSize},limitCount:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitCount},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,default:()=>(0,_ui.getConfig)().upload.progressText},autoHiddenButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoHiddenButton},showUploadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showUploadButton},buttonText:{type:String,default:()=>(0,_ui.getConfig)().upload.buttonText},buttonIcon:{type:String,default:()=>(0,_ui.getConfig)().upload.buttonIcon},showButtonText:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonText},showButtonIcon:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonIcon},showRemoveButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showRemoveButton},showDownloadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showDownloadButton},showPreview:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showPreview},showTip:{type:Boolean,default:()=>null},tipText:String,hintText:String,previewMethod:Function,uploadMethod:Function,beforeRemoveMethod:Function,removeMethod:Function,beforeDownloadMethod:Function,downloadMethod:Function,getUrlMethod:Function,getThumbnailUrlMethod:Function,size:{type:String,default:()=>(0,_ui.getConfig)().upload.size||(0,_ui.getConfig)().size}},emits:["update:modelValue","add","remove","remove-fail","download","download-fail","upload-success","upload-error","sort-dragend"],setup(C,e){const{emit:u,slots:y}=e,w=(0,_vue.inject)("$xeForm",null),I=(0,_vue.inject)("xeFormItemInfo",null),a=(0,_vue.inject)("$xeTable",null);var t=_xeUtils.default.uniqueId();const j=(0,_ui.useSize)(C)["computeSize"],g=(0,_vue.ref)(),p=(0,_vue.ref)(),c=(0,_vue.ref)(),m=(0,_vue.ref)(),b=(0,_vue.reactive)({isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}),r={imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1},l={refElem:g},U=(0,_vue.computed)(()=>{var e=C["readonly"];return null===e?!!w&&w.props.readonly:e}),M=(0,_vue.computed)(()=>{var e=C["disabled"];return null===e?!!w&&w.props.disabled:e}),D=(0,_vue.computed)(()=>C.keyField||"_X_KEY"),_=(0,_vue.computed)(()=>"image"===C.mode),T=(0,_vue.computed)(()=>C.nameField||"name"),B=(0,_vue.computed)(()=>C.typeField||"type"),E=(0,_vue.computed)(()=>C.urlField||"url"),S=(0,_vue.computed)(()=>C.sizeField||"size"),$=(0,_vue.computed)(()=>1024*_xeUtils.default.toNumber(C.limitSize)*1024),V=(0,_vue.computed)(()=>C.multiple?_xeUtils.default.toNumber(C.limitCount):1),f=(0,_vue.computed)(()=>{var e=C["multiple"],t=b["fileList"],o=V.value;return e?!o||t.length>=o:1<=t.length}),q=(0,_vue.computed)(()=>{var e=_xeUtils.default.toNumber(C.limitSize);return e?1048576<e?e/1048576+"T":1024<e?e/1024+"G":e+"M":""}),G=(0,_vue.computed)(()=>{var{showTip:e,tipText:t}=C;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t}),H=(0,_vue.computed)(()=>{var{limitSize:e,fileTypes:t,multiple:o,limitCount:a}=C,l=C.tipText||C.hintText,i=_.value,u=q.value;return _xeUtils.default.isString(l)?l:(l=[],i?(o&&a&&l.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[a])),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&&a&&l.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[a]))),l.join((0,_ui.getI18n)("vxe.base.comma")))}),i=(0,_vue.computed)(()=>Object.assign({},C.imageConfig||C.imageStyle)),Y=(0,_vue.computed)(()=>{var{width:e,height:t}=i.value,o={};return e&&(o.width=(0,_dom.toCssUnit)(e)),t&&(o.height=(0,_dom.toCssUnit)(t)),o}),Q=(0,_vue.computed)(()=>Object.assign({showMoreButton:!0},C.moreConfig)),d={},h={xID:t,props:C,context:e,reactData:b,internalData:r,getRefMaps:()=>l,getComputeMaps:()=>d},P=()=>_xeUtils.default.uniqueId(),L=e=>{return e[D.value]},s=()=>{var{modelValue:e,multiple:t}=C,o=U.value;const l=D.value,i=T.value,u=B.value,n=E.value,r=S.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 a=(o?o.searchQuery[i]:"")||decodeURIComponent(""+(t||"")).split("/").pop()||"";return{[i]:a,[u]:(o?o.searchQuery[u]:"")||N(a),[n]:t,[r]:_xeUtils.default.toNumber(o?o.searchQuery[r]:0)||0,[l]:P()}}const a=e[i]||"";return e[i]=a,e[u]=e[u]||N(a),e[n]=e[n]||"",e[r]=e[r]||0,e[l]=e[l]||P(),e}):[];b.fileList=o||t?e:e.slice(0,1)},N=e=>{var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},O=(e,t,o)=>{u(e,(0,_ui.createEvent)(o,{$upload:h},t))},A=e=>{var{singleMode:t,urlMode:o}=C;const a=E.value,l=T.value;let i=e?e.slice(0):[];o&&(i=i.map(e=>{var t=e[a];if(t&&!_xeUtils.default.parseUrl(t).searchQuery[l])return""+t+(-1===t.indexOf("?")?"?":"&")+l+"="+encodeURIComponent(e[l]||"");return t})),u("update:modelValue",t?i[0]||null:i)},X=e=>{var t=C.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod;return t?t({$upload:h,option:e}):n(e)},n=e=>{var t=C.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=E.value;return t?t({$upload:h,option:e}):e[o]},W=(e,t)=>{var o=C.previewMethod||(0,_ui.getConfig)().upload.previewMethod;if(C.showPreview)if(o)o({$upload:h,option:t});else{var a=t;var{imageTypes:o,showDownloadButton:t}=C;const i=B.value,u=C.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;var l=r["imagePreviewTypes"];l.concat(o||[]).some(e=>(""+e).toLowerCase()===(""+a[i]).toLowerCase())&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:[n(a)],showDownloadButton:t,beforeDownloadMethod:u?()=>u({$upload:h,option:a}):void 0})}},K=(e,t,o)=>{var a=C["showDownloadButton"];const l=b["fileList"],i=C.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;C.showPreview&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:l.map(e=>n(e)),activeIndex:o,showDownloadButton:a,beforeDownloadMethod:i?({index:e})=>i({$upload:h,option:l[e]}):void 0})},J=(o,e)=>{const a=C["showErrorStatus"],l=L(o);var t=C.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?Promise.resolve(t({$upload:h,file:e,option:o,updateProgress(e){var t=b["fileCacheMaps"],t=t[L(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),Object.assign(o,e),O("upload-success",{option:o,data:e},null)}).catch(e=>{var t=b["fileCacheMaps"],t=t[l];t&&(t.status="error"),a?Object.assign(o,e):b.fileList=b.fileList.filter(e=>L(e)!==l),O("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}=C;var a,l=b["fileCacheMaps"],l=l[L(e)];(t||(0,_ui.getConfig)().upload.uploadMethod)&&l&&(a=l.file,l.loading=!0,l.status="",l.percent=0,J(e,a).then(()=>{o&&A(b.fileList)}))},v=(t,a)=>{var{multiple:e,urlMode:o}=C,l=b["fileList"];const i=C.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,u=D.value,n=T.value,r=B.value,d=E.value,s=S.value;var v=$.value;const p=V.value;var g=q.value;let c=t;if(e&&p){if(l.length>=p)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.overCountErr",[p])}));const h=c.length-(p-l.length);if(0<h){const x=c.slice(p-l.length);_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",[p,h])),(0,_vue.h)("div",{class:"vxe-upload--file-message-over-extra"},x.map((e,t)=>(0,_vue.h)("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)))])}}})}c=c.slice(0,p-l.length)}if(v)for(let e=0;e<t.length;e++)if(t[0].size>v)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.overSizeErr",[g])}));const m=Object.assign({},b.fileCacheMaps),_=e?l:[],f=[];c.forEach(e=>{var t=e["name"],o=P(),t={[n]:t,[r]:N(t),[s]:e.size,[d]:URL.createObjectURL(e),[u]:o},o=(i&&(m[o]={file:e,loading:!0,status:"",percent:0}),(0,_vue.reactive)(t));i&&f.push(J(o,e)),_.push(o),O("add",{option:o},a)}),b.fileList=_,b.fileCacheMaps=m,Promise.all(o?f:[]).then(()=>{A(_),w&&I&&w.triggerItemEvent(a,I.itemConfig.field,_)})},ee=t=>{var{multiple:e,imageTypes:o,fileTypes:a}=C,l=M.value,i=_.value;return l?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:i?o:a}).then(e=>(v(e.files,t),e))},te=e=>{ee(e).catch(()=>{})},oe=(e,t,o)=>{var a=b["fileList"];a.splice(o,1),A(a),w&&I&&w.triggerItemEvent(e,I.itemConfig.field,a),O("remove",{option:t},e)},ae=(t,o,a)=>{var e=C.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod;const l=C.removeMethod||(0,_ui.getConfig)().upload.removeMethod;Promise.resolve(!e||e({$upload:h,option:o})).then(e=>{e?l?Promise.resolve(l({$upload:h,option:o})).then(()=>{oe(t,o,a)}).catch(e=>e):oe(t,o,a):O("remove-fail",{option:o},t)})},le=(e,t)=>{O("download",{option:t},e)},ie=(t,o)=>{var e=C.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;const a=C.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!e||e({$upload:h,option:o})).then(e=>{e?a?Promise.resolve(a({$upload:h,option:o})).then(()=>{le(t,o)}).catch(e=>e):le(t,o):O("download-fail",{option:o},t)})},ue=e=>{var t,o,a,l=e.currentTarget,{clientX:e,clientY:i}=e;l&&({x:l,y:t,height:o,width:a}=l.getBoundingClientRect(),e<l||l+a<e||i<t||t+o<i)&&(b.isDragUploadStatus=!1)},ne=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),b.isDragUploadStatus=!0)},re=(e,t)=>{var o=C["imageTypes"],a=r["imagePreviewTypes"];if(_.value){const l=a.concat(o&&o.length?o:[]);t=t.filter(e=>{const t=(""+(e.type.split("/")[1]||"")).toLowerCase();return!!l.some(e=>(""+e).toLowerCase()===t)})}t.length?v(t,e):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.uploadTypeErr")})},de=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),(t=se(t)).length)&&re(e,t),b.isDragUploadStatus=!1},se=e=>{const t=[];return _xeUtils.default.arrayEach(e,e=>{e=e.getAsFile();e&&t.push(e)}),t},x=()=>{const s=U.value,v=_.value;_ui.VxeUI.modal&&_ui.VxeUI.modal.open({title:s?(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}=C,{isActivated:a,isDragMove:l,isDragUploadStatus:i,dragIndex:u}=b;const n=b["fileList"];var r=M.value,d={};return t&&-1===u&&(d.onDragover=ne,d.onDragleave=ue,d.onDrop=de),(0,_vue.h)("div",Object.assign({ref:p,class:["vxe-upload--more-popup",{"is--readonly":s,"is--disabled":r,"is--active":a,"show--error":e,"is--drag":i}]},d),[v?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--image-more-list"},{default:()=>z(n,!0).concat(R(!0))}):(0,_vue.h)("div",{class:"vxe-upload--image-more-list"},z(n,!0).concat(R(!0))):(0,_vue.h)("div",{class:"vxe-upload--file-more-list"},[k(!0),o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>F(n,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},F(n,!0))]),o?(0,_vue.h)("div",{ref:m,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(h),i?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(h)])}},onShow(){b.showMorePopup=!0},onHide(){b.showMorePopup=!1}})},ve=(e,t,o)=>{var a,l=b["showMorePopup"],i=g.value,u=p.value,u=l?u:i;u&&(i=u.getBoundingClientRect(),u=c.value,a=m.value,l=l?a:u)&&(a=t.getBoundingClientRect(),l.style.display="block",l.style.top=Math.max(1,a.y-i.y)+"px",l.style.left=Math.max(1,a.x-i.x)+"px",l.style.height=a.height+"px",l.style.width=a.width-1+"px",l.setAttribute("drag-pos",o))},pe=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)},ge=t=>{t.stopPropagation(),t.preventDefault();var o=b["dragIndex"];if(-1!==o){var a=_.value;const i=t.currentTarget;var l=i.parentElement,l=_xeUtils.default.findIndexOf(Array.from(l.children),e=>i===e);let e="";e=a?t.clientX-i.getBoundingClientRect().x<i.clientWidth/2?"left":"right":t.clientY-i.getBoundingClientRect().y<i.clientHeight/2?"top":"bottom",o===l?ve(0,i,e):(ve(0,i,e),r.prevDragIndex=l,r.prevDragPos=e)}},ce=e=>{var{fileList:t,dragIndex:o}=b,{prevDragIndex:a,prevDragPos:l}=r,i="bottom"===l||"right"===l?1:0,u=t[o];const n=t[a];u&&n&&(t.splice(o,1),a=_xeUtils.default.findIndexOf(t,e=>n===e)+i,t.splice(a,0,u),O("sort-dragend",{oldItem:u,newItem:n,dragPos:l,offsetIndex:i,_index:{newIndex:a,oldIndex:o}},e)),t=c.value,u=m.value,t&&(t.style.display=""),u&&(u.style.display=""),b.dragIndex=-1},me=e=>{a&&e.stopPropagation(),b.isActivated=!0},_e=e=>{var t=C["pasteToUpload"],o=b["isActivated"];o&&t&&(o=e.clipboardData||e.originalEvent.clipboardData)&&(t=o["items"],t)&&(o=se(t)).length&&(e.preventDefault(),re(e,o))},fe=e=>{var t=g.value,o=p.value;let a=(0,_dom.getEventTargetNode)(e,t).flag;!a&&o&&(o=(t=o.parentElement||o)&&t.parentElement,a=(0,_dom.getEventTargetNode)(e,o).flag),b.isActivated=a},he=()=>{b.isActivated=!1};t={dispatchEvent:O,choose(){return ee(null)}};Object.assign(h,t,{});const F=(e,u)=>{const{showRemoveButton:n,showDownloadButton:r,showProgress:d,progressText:s,showPreview:v,showErrorStatus:p,dragSort:g}=C,c=b["fileCacheMaps"],m=M.value,_=U.value,f=T.value,h=B.value,x=y.corner,w={};return g&&1<e.length&&(w.onDragstart=pe,w.onDragover=ge,w.onDragend=ce),e.map((t,o)=>{var e=L(t),a=c[e];const l=a&&a.loading,i=a&&"error"===a.status;return(0,_vue.h)("div",Object.assign({key:g?e:o,class:["vxe-upload--file-item",{"is--preview":v,"is--loading":l,"is--error":i}],fileid:e,draggable:!!g||null},w),[(0,_vue.h)("div",{class:"vxe-upload--file-item-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_"+(""+t[h]).toLocaleUpperCase()]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),(0,_vue.h)("div",{class:"vxe-upload--file-item-name",onClick(e){l||i||W(e,t)}},""+(t[f]||"")),l?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_vue.createCommentVNode)(),d&&l&&a?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-text"},s?_xeUtils.default.toFormatString(s,{percent:a.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[a.percent])):(0,_vue.createCommentVNode)(),p&&i?(0,_vue.h)("div",{class:"vxe-upload--image-item-error"},[(0,_vue.h)(_button.default,{icon:(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD,mode:"text",status:"primary",content:(0,_ui.getI18n)("vxe.upload.reUpload"),onClick(){Z(t)}})]):(0,_vue.createCommentVNode)(),(0,_vue.h)("div",{class:"vxe-upload--file-item-btn-wrapper"},[x?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(x({option:t,isMoreView:u,readonly:_}))):(0,_vue.createCommentVNode)(),r&&!l?(0,_vue.h)("div",{class:"vxe-upload--file-item-download-btn",onClick(e){ie(e,t)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]):(0,_vue.createCommentVNode)(),!n||_||m||l?(0,_vue.createCommentVNode)():(0,_vue.h)("div",{class:"vxe-upload--file-item-remove-btn",onClick(e){ae(e,t,o)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},k=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:a,showButtonText:l,showButtonIcon:i,autoHiddenButton:u}=C,n=M.value,r=U.value,d=G.value,s=H.value,v=f.value,p=y.default,g=y.tip||y.hint;return r||!t?(0,_vue.createCommentVNode)():(0,_vue.h)("div",{class:"vxe-upload--file-action"},[u&&v?(0,_vue.createCommentVNode)():(0,_vue.h)("div",{class:"vxe-upload--file-action-btn",onClick:te},p?(0,_vn.getSlotVNs)(p({$upload:h})):[(0,_vue.h)(_button.default,{class:"vxe-upload--file-action-button",content:e||l?o?""+o:(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:i?a||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:n})]),d&&(s||g)?(0,_vue.h)("div",{class:"vxe-upload--file-action-tip"},g?(0,_vn.getSlotVNs)(g({$upload:h})):s):(0,_vue.createCommentVNode)()])},z=(e,u)=>{const{showRemoveButton:n,showProgress:r,progressText:d,showPreview:s,showErrorStatus:v,dragSort:p}=C,g=b["fileCacheMaps"],c=M.value,m=U.value,_=i.value,f=Y.value,h=y.corner,x={onMousedown:me};return p&&1<e.length&&(x.onDragstart=pe,x.onDragover=ge,x.onDragend=ce),e.map((t,o)=>{var e=L(t),a=g[e];const l=a&&a.loading,i=a&&"error"===a.status;return(0,_vue.h)("div",Object.assign({key:p?e:o,class:["vxe-upload--image-item",{"is--preview":s,"is--circle":_.circle,"is--loading":l,"is--error":i}],fileid:e,draggable:!!p||null},x),[(0,_vue.h)("div",{class:"vxe-upload--image-item-box",style:u?null:f,title:(0,_ui.getI18n)("vxe.upload.viewItemTitle"),onClick(e){l||i||K(e,t,o)}},[l&&a?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading"},[(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),r?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-text"},d?_xeUtils.default.toFormatString(d,{percent:a.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[a.percent])):(0,_vue.createCommentVNode)()]):(0,_vue.createCommentVNode)(),l?(0,_vue.createCommentVNode)():i&&v?(0,_vue.h)("div",{class:"vxe-upload--image-item-error"},[(0,_vue.h)(_button.default,{icon:(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD,mode:"text",status:"primary",content:(0,_ui.getI18n)("vxe.upload.reUpload"),onClick(){Z(t)}})]):(0,_vue.h)("div",{class:"vxe-upload--image-item-img-wrapper"},[(0,_vue.h)("img",{class:"vxe-upload--image-item-img",src:X(t)})]),(0,_vue.h)("div",{class:"vxe-upload--image-item-btn-wrapper",onClick(e){e.stopPropagation()}},[h?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(h({option:t,isMoreView:u,readonly:m}))):(0,_vue.createCommentVNode)(),!n||m||c||l?(0,_vue.createCommentVNode)():(0,_vue.h)("div",{class:"vxe-upload--image-item-remove-btn",onClick(e){e.stopPropagation(),ae(e,t,o)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},R=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:a,showButtonText:l,showButtonIcon:i,autoHiddenButton:u}=C,n=U.value,r=G.value,d=H.value,s=f.value,v=Y.value,p=y.default,g=y.tip||y.hint;return n||!t||u&&s?(0,_vue.createCommentVNode)():(0,_vue.h)("div",{key:"action",class:"vxe-upload--image-action"},[(0,_vue.h)("div",{class:"vxe-upload--image-action-btn",onClick:te},p?p({$upload:h}):[(0,_vue.h)("div",{class:"vxe-upload--image-action-box",style:e?null:v},[i?(0,_vue.h)("div",{class:"vxe-upload--image-action-icon"},[(0,_vue.h)("i",{class:a||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_vue.createCommentVNode)(),e||l?(0,_vue.h)("div",{class:"vxe-upload--image-action-content"},o?""+o:(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_vue.createCommentVNode)(),r&&(d||g)?(0,_vue.h)("div",{class:"vxe-upload--image-action-hint"},g?(0,_vn.getSlotVNs)(g({$upload:h})):d):(0,_vue.createCommentVNode)()])])])};const o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>C.modelValue?C.modelValue.length:0,()=>{o.value++}),(0,_vue.watch)(()=>C.modelValue,()=>{o.value++}),(0,_vue.watch)(o,()=>{s()}),(0,_vue.onMounted)(()=>{"development"===process.env.NODE_ENV&&(C.multiple&&C.singleMode&&(0,_log.errLog)("vxe.error.errConflicts",["multiple","single-mode"]),C.imageStyle)&&(0,_log.warnLog)("vxe.error.delProp",["image-style","image-config"]),C.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(h,"paste",_e),_ui.globalEvents.on(h,"mousedown",fe),_ui.globalEvents.on(h,"blur",he)}),(0,_vue.onUnmounted)(()=>{b.isDragUploadStatus=!1,_ui.globalEvents.off(h,"paste"),_ui.globalEvents.off(h,"mousedown"),_ui.globalEvents.off(h,"blur")}),s(),h.renderVN=()=>{var{showErrorStatus:e,dragToUpload:t,pasteToUpload:o,dragSort:a}=C,{isDragUploadStatus:l,showMorePopup:i,isActivated:u,dragIndex:n}=b,r=j.value,d=M.value,s=U.value,v=_.value,p={onMousedown:me};return t&&-1===n&&(p.onDragover=ne,p.onDragleave=ue,p.onDrop=de),(0,_vue.h)("div",Object.assign({ref:g,class:["vxe-upload",{["size--"+r]:r,"is--active":u,"is--readonly":s,"is--disabled":d,"is--paste":o,"show--error":e,"is--drag":l}]},p),[(v?()=>{var{showList:e,dragSort:t}=C;const{fileList:o,isDragMove:a}=b,{maxCount:l,showMoreButton:i}=Q.value;let u=o,n=0;return l&&o.length>l&&(n=o.length-l,u=o.slice(0,l)),(0,_vue.h)("div",{key:"image",class:"vxe-upload--image-wrapper"},e?[t?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(a?"":"-disabled"),tag:"div",class:"vxe-upload--image-list"},{default:()=>z(u,!1).concat([i&&n?(0,_vue.h)("div",{key:"om",class:"vxe-upload--image-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:x})]):(0,_vue.createCommentVNode)(),R(!1)])}):(0,_vue.h)("div",{class:"vxe-upload--image-list"},z(u,!1).concat([i&&n?(0,_vue.h)("div",{class:"vxe-upload--image-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:x})]):(0,_vue.createCommentVNode)(),R(!1)]))]:[(0,_vue.h)("div",{class:"vxe-upload--image-list"},[R(!1)])])}:()=>{var{showList:e,moreConfig:t,dragSort:o}=C,{fileList:a,isDragMove:l}=b,{maxCount:i,showMoreButton:u,layout:n}=Q.value,n="horizontal"===n;let r=a,d=0;return i&&a.length>i&&(d=a.length-i,r=a.slice(0,i)),(0,_vue.h)("div",{key:"all",class:"vxe-upload--file-wrapper"},e?[u&&t&&n?(0,_vue.createCommentVNode)():k(!0),r.length||u&&n?(0,_vue.h)("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":n}]},[r.length?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>F(r,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},F(r,!1)):(0,_vue.createCommentVNode)(),u&&d?(0,_vue.h)("div",{class:"vxe-upload--file-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[a.length]),status:"primary",onClick:x})]):(0,_vue.createCommentVNode)(),u&&t&&n?k(!1):(0,_vue.createCommentVNode)()]):(0,_vue.createCommentVNode)()]:[k(!1)])})(),a?(0,_vue.h)("div",{ref:c,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(h),l&&!i?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(h)])},h},render(){return this.renderVN()}});
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
height: 100%;
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-direction: row;
|
|
27
|
-
overflow:
|
|
27
|
+
overflow: auto;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.vxe-split-slots {
|
|
@@ -93,19 +93,19 @@
|
|
|
93
93
|
.vxe-split-pane.is--border > .vxe-split-pane--wrapper, .vxe-split-pane.is--border > .vxe-split-pane-handle {
|
|
94
94
|
border: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
95
95
|
}
|
|
96
|
-
.vxe-split-pane.is--expand.is--horizontal > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
96
|
+
.vxe-split-pane.is--resize.is--expand.is--horizontal > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
97
97
|
cursor: w-resize;
|
|
98
98
|
}
|
|
99
|
-
.vxe-split-pane.is--expand.is--vertical > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
99
|
+
.vxe-split-pane.is--resize.is--expand.is--vertical > .vxe-split-pane-handle .vxe-split-pane-handle-bar {
|
|
100
100
|
cursor: n-resize;
|
|
101
101
|
}
|
|
102
|
-
.vxe-split-pane.is--expand > .vxe-split-pane-handle > .vxe-split-pane-handle-bar {
|
|
102
|
+
.vxe-split-pane.is--resize.is--expand > .vxe-split-pane-handle > .vxe-split-pane-handle-bar {
|
|
103
103
|
background-color: var(--vxe-split-handle-bar-background-color);
|
|
104
104
|
}
|
|
105
|
-
.vxe-split-pane.is--expand > .vxe-split-pane-handle > .vxe-split-pane-handle-bar:hover {
|
|
105
|
+
.vxe-split-pane.is--resize.is--expand > .vxe-split-pane-handle > .vxe-split-pane-handle-bar:hover {
|
|
106
106
|
background-color: var(--vxe-ui-font-primary-lighten-color);
|
|
107
107
|
}
|
|
108
|
-
.vxe-split-pane.is--expand > .vxe-split-pane-handle > .vxe-split-pane-handle-bar:active {
|
|
108
|
+
.vxe-split-pane.is--resize.is--expand > .vxe-split-pane-handle > .vxe-split-pane-handle-bar:active {
|
|
109
109
|
background-color: var(--vxe-ui-font-primary-darken-color);
|
|
110
110
|
}
|
|
111
111
|
.vxe-split-pane.is--horizontal {
|
|
@@ -155,4 +155,8 @@
|
|
|
155
155
|
}
|
|
156
156
|
.vxe-split-pane.is--vertical.is--border > .vxe-split-pane-handle {
|
|
157
157
|
border-width: 0 1px 0 1px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.vxe-modal--content > .vxe-split {
|
|
161
|
+
height: 100%;
|
|
158
162
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.vxe-split.is--vertical>.vxe-split-wrapper{flex-direction:column}.vxe-split.is--vertical>.vxe-split-wrapper>.vxe-split-pane{width:100%}.vxe-split.is--drag{-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-split.is--drag>.vxe-split-wrapper>.vxe-split-pane>.vxe-split-pane--wrapper::after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;background:0 0}.vxe-split-wrapper{height:100%;display:flex;flex-direction:row;overflow:
|
|
1
|
+
.vxe-split.is--vertical>.vxe-split-wrapper{flex-direction:column}.vxe-split.is--vertical>.vxe-split-wrapper>.vxe-split-pane{width:100%}.vxe-split.is--drag{-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-split.is--drag>.vxe-split-wrapper>.vxe-split-pane>.vxe-split-pane--wrapper::after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;background:0 0}.vxe-split-wrapper{height:100%;display:flex;flex-direction:row;overflow:auto}.vxe-split-slots{display:none}.vxe-split-pane-handle{position:relative;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-split-pane--wrapper{position:relative;word-break:break-word;overflow:hidden;flex-grow:1}.vxe-split-pane--inner{height:100%;width:100%;overflow:auto}.vxe-split-pane--inner>.vxe-split{height:100%}.vxe-split-pane-handle-bar{background-color:var(--vxe-split-handle-bar-background-color)}.vxe-split-pane-action-btn{display:block;position:absolute;z-index:2;cursor:pointer;background-color:var(--vxe-ui-layout-background-color);border:1px solid var(--vxe-ui-input-border-color);transition:transform .1s ease-in-out}.vxe-split-pane-action-btn:hover{color:var(--vxe-ui-layout-background-color);background-color:var(--vxe-ui-font-primary-lighten-color)}.vxe-split-pane{display:flex;position:relative;overflow:hidden}.vxe-split-pane.is--hidden{width:0}.vxe-split-pane.is--padding>.vxe-split-pane--wrapper{padding:var(--vxe-ui-layout-padding-default)}.vxe-split-pane.is--fill{flex-grow:1}.vxe-split-pane.is--height,.vxe-split-pane.is--width{flex-shrink:0}.vxe-split-pane.is--border>.vxe-split-pane--wrapper,.vxe-split-pane.is--border>.vxe-split-pane-handle{border:1px solid var(--vxe-ui-base-popup-border-color)}.vxe-split-pane.is--resize.is--expand.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-handle-bar{cursor:w-resize}.vxe-split-pane.is--resize.is--expand.is--vertical>.vxe-split-pane-handle .vxe-split-pane-handle-bar{cursor:n-resize}.vxe-split-pane.is--resize.is--expand>.vxe-split-pane-handle>.vxe-split-pane-handle-bar{background-color:var(--vxe-split-handle-bar-background-color)}.vxe-split-pane.is--resize.is--expand>.vxe-split-pane-handle>.vxe-split-pane-handle-bar:hover{background-color:var(--vxe-ui-font-primary-lighten-color)}.vxe-split-pane.is--resize.is--expand>.vxe-split-pane-handle>.vxe-split-pane-handle-bar:active{background-color:var(--vxe-ui-font-primary-darken-color)}.vxe-split-pane.is--horizontal{flex-direction:row}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle.to--prev .vxe-split-pane-action-btn{left:0}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle.to--next .vxe-split-pane-action-btn{right:0}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-handle-bar{width:var(--vxe-split-handle-bar-width);height:100%}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-action-btn{top:50%;transform:translateY(-50%);padding:1em 0}.vxe-split-pane.is--horizontal>.vxe-split-pane-handle .vxe-split-pane-action-btn:active{transform:translateY(-50%) scale(.9)}.vxe-split-pane.is--horizontal.is--border>.vxe-split-pane-handle{border-width:1px 0 1px 0}.vxe-split-pane.is--vertical{flex-direction:column}.vxe-split-pane.is--vertical>.vxe-split-pane-handle.to--prev .vxe-split-pane-action-btn{top:0}.vxe-split-pane.is--vertical>.vxe-split-pane-handle.to--next .vxe-split-pane-action-btn{bottom:0}.vxe-split-pane.is--vertical>.vxe-split-pane-handle .vxe-split-pane-handle-bar{height:var(--vxe-split-handle-bar-height);width:100%}.vxe-split-pane.is--vertical>.vxe-split-pane-handle .vxe-split-pane-action-btn{left:50%;transform:translateX(-50%);padding:0 1em}.vxe-split-pane.is--vertical>.vxe-split-pane-handle .vxe-split-pane-action-btn:active{transform:translateX(-50%) scale(.9)}.vxe-split-pane.is--vertical.is--border>.vxe-split-pane-handle{border-width:0 1px 0 1px}.vxe-modal--content>.vxe-split{height:100%}
|
package/package.json
CHANGED
|
@@ -145,7 +145,8 @@ export default defineComponent({
|
|
|
145
145
|
initialized: false,
|
|
146
146
|
visible: false,
|
|
147
147
|
contentVisible: false,
|
|
148
|
-
drawerZIndex: 0
|
|
148
|
+
drawerZIndex: 0,
|
|
149
|
+
resizeFlag: 1
|
|
149
150
|
})
|
|
150
151
|
|
|
151
152
|
const refMaps: DrawerPrivateRef = {
|
|
@@ -350,8 +351,6 @@ export default defineComponent({
|
|
|
350
351
|
const maxWidth = visibleWidth
|
|
351
352
|
const maxHeight = visibleHeight
|
|
352
353
|
const boxElem = getBox()
|
|
353
|
-
const domMousemove = document.onmousemove
|
|
354
|
-
const domMouseup = document.onmouseup
|
|
355
354
|
const clientWidth = boxElem.clientWidth
|
|
356
355
|
const clientHeight = boxElem.clientHeight
|
|
357
356
|
const disX = evnt.clientX
|
|
@@ -405,10 +404,12 @@ export default defineComponent({
|
|
|
405
404
|
}
|
|
406
405
|
boxElem.className = boxElem.className.replace(/\s?is--drag/, '') + ' is--drag'
|
|
407
406
|
dispatchEvent('resize', params, evnt)
|
|
407
|
+
reactData.resizeFlag++
|
|
408
408
|
}
|
|
409
409
|
document.onmouseup = () => {
|
|
410
|
-
document.onmousemove =
|
|
411
|
-
document.onmouseup =
|
|
410
|
+
document.onmousemove = null
|
|
411
|
+
document.onmouseup = null
|
|
412
|
+
reactData.resizeFlag++
|
|
412
413
|
setTimeout(() => {
|
|
413
414
|
boxElem.className = boxElem.className.replace(/\s?is--drag/, '')
|
|
414
415
|
}, 50)
|
|
@@ -216,7 +216,8 @@ export default defineComponent({
|
|
|
216
216
|
zoomStatus: '',
|
|
217
217
|
revertLocat: null,
|
|
218
218
|
prevLocat: null,
|
|
219
|
-
firstOpen: true
|
|
219
|
+
firstOpen: true,
|
|
220
|
+
resizeFlag: 1
|
|
220
221
|
})
|
|
221
222
|
|
|
222
223
|
const internalData: ModalInternalData = {
|
|
@@ -900,8 +901,6 @@ export default defineComponent({
|
|
|
900
901
|
}
|
|
901
902
|
if (zoomStatus !== 'maximize' && evnt.button === 0 && !getEventTargetNode(evnt, boxElem, 'trigger--btn').flag) {
|
|
902
903
|
evnt.preventDefault()
|
|
903
|
-
const domMousemove = document.onmousemove
|
|
904
|
-
const domMouseup = document.onmouseup
|
|
905
904
|
const disX = evnt.clientX - boxElem.offsetLeft
|
|
906
905
|
const disY = evnt.clientY - boxElem.offsetTop
|
|
907
906
|
const { visibleHeight, visibleWidth } = getDomNode()
|
|
@@ -931,15 +930,17 @@ export default defineComponent({
|
|
|
931
930
|
boxElem.style.top = `${top}px`
|
|
932
931
|
boxElem.className = boxElem.className.replace(/\s?is--drag/, '') + ' is--drag'
|
|
933
932
|
dispatchEvent('move', { type: 'move' }, evnt)
|
|
933
|
+
reactData.resizeFlag++
|
|
934
934
|
}
|
|
935
935
|
document.onmouseup = () => {
|
|
936
|
-
document.onmousemove =
|
|
937
|
-
document.onmouseup =
|
|
936
|
+
document.onmousemove = null
|
|
937
|
+
document.onmouseup = null
|
|
938
938
|
if (storage) {
|
|
939
939
|
nextTick(() => {
|
|
940
940
|
savePosStorage()
|
|
941
941
|
})
|
|
942
942
|
}
|
|
943
|
+
reactData.resizeFlag++
|
|
943
944
|
setTimeout(() => {
|
|
944
945
|
boxElem.className = boxElem.className.replace(/\s?is--drag/, '')
|
|
945
946
|
}, 50)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, PropType, ref, h, reactive, provide, VNode, computed, watch, nextTick, onMounted, onUnmounted, onActivated } from 'vue'
|
|
2
|
-
import { getConfig, getIcon, createEvent, globalEvents, renderEmptyElement } from '../../ui'
|
|
2
|
+
import { getConfig, getIcon, createEvent, globalEvents, globalResize, renderEmptyElement } from '../../ui'
|
|
3
3
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
4
4
|
import { toCssUnit, isScale, addClass, removeClass } from '../../ui/src/dom'
|
|
5
5
|
import { getGlobalDefaultConfig } from '../../ui/src/utils'
|
|
@@ -25,6 +25,10 @@ export default defineComponent({
|
|
|
25
25
|
type: Boolean as PropType<VxeSplitPropTypes.Padding>,
|
|
26
26
|
default: () => getConfig().split.padding
|
|
27
27
|
},
|
|
28
|
+
resize: {
|
|
29
|
+
type: Boolean as PropType<VxeSplitPropTypes.Resize>,
|
|
30
|
+
default: () => getConfig().split.resize
|
|
31
|
+
},
|
|
28
32
|
items: Array as PropType<VxeSplitPropTypes.Items>,
|
|
29
33
|
itemConfig: Object as PropType<VxeSplitPropTypes.ItemConfig>,
|
|
30
34
|
barConfig: Object as PropType<VxeSplitPropTypes.BarConfig>,
|
|
@@ -70,6 +74,10 @@ export default defineComponent({
|
|
|
70
74
|
return actionOpts.direction === 'next'
|
|
71
75
|
})
|
|
72
76
|
|
|
77
|
+
const computeVisibleItems = computed(() => {
|
|
78
|
+
return reactData.itemList.filter(item => item.isVisible)
|
|
79
|
+
})
|
|
80
|
+
|
|
73
81
|
const computeBarStyle = computed(() => {
|
|
74
82
|
const barOpts = computeBarOpts.value
|
|
75
83
|
const { width, height } = barOpts
|
|
@@ -272,9 +280,12 @@ export default defineComponent({
|
|
|
272
280
|
}
|
|
273
281
|
|
|
274
282
|
const dragEvent = (evnt: MouseEvent) => {
|
|
275
|
-
|
|
276
|
-
const { vertical } = props
|
|
283
|
+
const { resize, vertical } = props
|
|
277
284
|
const { itemList } = reactData
|
|
285
|
+
if (!resize) {
|
|
286
|
+
return
|
|
287
|
+
}
|
|
288
|
+
evnt.preventDefault()
|
|
278
289
|
const barEl = evnt.currentTarget as HTMLDivElement
|
|
279
290
|
const handleEl = barEl.parentElement as HTMLDivElement
|
|
280
291
|
const el = refElem.value
|
|
@@ -481,8 +492,9 @@ export default defineComponent({
|
|
|
481
492
|
}
|
|
482
493
|
|
|
483
494
|
const renderItems = () => {
|
|
484
|
-
const { border, padding, vertical } = props
|
|
495
|
+
const { border, padding, resize, vertical } = props
|
|
485
496
|
const { itemList } = reactData
|
|
497
|
+
const visibleItems = computeVisibleItems.value
|
|
486
498
|
const isFoldNext = computeIsFoldNext.value
|
|
487
499
|
const itemVNs: VNode[] = []
|
|
488
500
|
itemList.forEach((item, index) => {
|
|
@@ -491,19 +503,21 @@ export default defineComponent({
|
|
|
491
503
|
const stys: Record<string, string | number> = {}
|
|
492
504
|
const itemWidth = isVisible ? (foldWidth || resizeWidth || renderWidth) : 0
|
|
493
505
|
const itemHeight = isVisible ? (foldHeight || resizeHeight || renderHeight) : 0
|
|
506
|
+
// 当只剩下一个可视区自动占用 100%
|
|
494
507
|
if (vertical) {
|
|
495
508
|
if (itemHeight) {
|
|
496
|
-
stys.height = toCssUnit(itemHeight)
|
|
509
|
+
stys.height = visibleItems.length === 1 ? '100%' : toCssUnit(itemHeight)
|
|
497
510
|
}
|
|
498
511
|
} else {
|
|
499
512
|
if (itemWidth) {
|
|
500
|
-
stys.width = toCssUnit(itemWidth)
|
|
513
|
+
stys.width = visibleItems.length === 1 ? '100%' : toCssUnit(itemWidth)
|
|
501
514
|
}
|
|
502
515
|
}
|
|
503
516
|
itemVNs.push(
|
|
504
517
|
h('div', {
|
|
505
518
|
itemid: id,
|
|
506
519
|
class: ['vxe-split-pane', vertical ? 'is--vertical' : 'is--horizontal', {
|
|
520
|
+
'is--resize': resize,
|
|
507
521
|
'is--padding': padding,
|
|
508
522
|
'is--border': border,
|
|
509
523
|
'is--height': itemHeight,
|
|
@@ -574,15 +588,28 @@ export default defineComponent({
|
|
|
574
588
|
recalculate()
|
|
575
589
|
})
|
|
576
590
|
|
|
591
|
+
let resizeObserver: ResizeObserver
|
|
592
|
+
|
|
577
593
|
onMounted(() => {
|
|
578
594
|
nextTick(() => {
|
|
579
595
|
recalculate()
|
|
580
596
|
})
|
|
581
597
|
|
|
598
|
+
const el = refElem.value
|
|
599
|
+
if (el) {
|
|
600
|
+
resizeObserver = globalResize.create(() => {
|
|
601
|
+
recalculate()
|
|
602
|
+
})
|
|
603
|
+
resizeObserver.observe(el)
|
|
604
|
+
}
|
|
605
|
+
|
|
582
606
|
globalEvents.on($xeSplit, 'resize', handleGlobalResizeEvent)
|
|
583
607
|
})
|
|
584
608
|
|
|
585
609
|
onUnmounted(() => {
|
|
610
|
+
if (resizeObserver) {
|
|
611
|
+
resizeObserver.disconnect()
|
|
612
|
+
}
|
|
586
613
|
globalEvents.off($xeSplit, 'resize')
|
|
587
614
|
})
|
|
588
615
|
|
package/packages/ui/index.ts
CHANGED
|
@@ -136,6 +136,10 @@ export default defineComponent({
|
|
|
136
136
|
type: Boolean as PropType<VxeUploadPropTypes.ShowPreview>,
|
|
137
137
|
default: () => getConfig().upload.showPreview
|
|
138
138
|
},
|
|
139
|
+
showTip: {
|
|
140
|
+
type: Boolean as PropType<VxeUploadPropTypes.ShowTip>,
|
|
141
|
+
default: () => null
|
|
142
|
+
},
|
|
139
143
|
tipText: String as PropType<VxeUploadPropTypes.TipText>,
|
|
140
144
|
hintText: String as PropType<VxeUploadPropTypes.HintText>,
|
|
141
145
|
previewMethod: Function as PropType<VxeUploadPropTypes.PreviewMethod>,
|
|
@@ -280,6 +284,21 @@ export default defineComponent({
|
|
|
280
284
|
return ''
|
|
281
285
|
})
|
|
282
286
|
|
|
287
|
+
const computedShowTipText = computed(() => {
|
|
288
|
+
const { showTip, tipText } = props
|
|
289
|
+
if (XEUtils.isBoolean(showTip)) {
|
|
290
|
+
return showTip
|
|
291
|
+
}
|
|
292
|
+
const defShowTip = getConfig().upload.showTip
|
|
293
|
+
if (XEUtils.isBoolean(defShowTip)) {
|
|
294
|
+
return defShowTip
|
|
295
|
+
}
|
|
296
|
+
if (tipText) {
|
|
297
|
+
return true
|
|
298
|
+
}
|
|
299
|
+
return false
|
|
300
|
+
})
|
|
301
|
+
|
|
283
302
|
const computedDefTipText = computed(() => {
|
|
284
303
|
const { limitSize, fileTypes, multiple, limitCount } = props
|
|
285
304
|
const tipText = props.tipText || props.hintText
|
|
@@ -1244,6 +1263,7 @@ export default defineComponent({
|
|
|
1244
1263
|
const { showUploadButton, buttonText, buttonIcon, showButtonText, showButtonIcon, autoHiddenButton } = props
|
|
1245
1264
|
const isDisabled = computeIsDisabled.value
|
|
1246
1265
|
const formReadonly = computeFormReadonly.value
|
|
1266
|
+
const showTipText = computedShowTipText.value
|
|
1247
1267
|
const defTipText = computedDefTipText.value
|
|
1248
1268
|
const overCount = computeOverCount.value
|
|
1249
1269
|
const defaultSlot = slots.default
|
|
@@ -1270,7 +1290,7 @@ export default defineComponent({
|
|
|
1270
1290
|
disabled: isDisabled
|
|
1271
1291
|
})
|
|
1272
1292
|
]),
|
|
1273
|
-
defTipText || tipSlot
|
|
1293
|
+
showTipText && (defTipText || tipSlot)
|
|
1274
1294
|
? h('div', {
|
|
1275
1295
|
class: 'vxe-upload--file-action-tip'
|
|
1276
1296
|
}, tipSlot ? getSlotVNs(tipSlot({ $upload: $xeUpload })) : defTipText)
|
|
@@ -1467,6 +1487,7 @@ export default defineComponent({
|
|
|
1467
1487
|
const renderImageAction = (isMoreView: boolean) => {
|
|
1468
1488
|
const { showUploadButton, buttonText, buttonIcon, showButtonText, showButtonIcon, autoHiddenButton } = props
|
|
1469
1489
|
const formReadonly = computeFormReadonly.value
|
|
1490
|
+
const showTipText = computedShowTipText.value
|
|
1470
1491
|
const defTipText = computedDefTipText.value
|
|
1471
1492
|
const overCount = computeOverCount.value
|
|
1472
1493
|
const imgStyle = computeImgStyle.value
|
|
@@ -1504,7 +1525,7 @@ export default defineComponent({
|
|
|
1504
1525
|
class: 'vxe-upload--image-action-content'
|
|
1505
1526
|
}, buttonText ? `${buttonText}` : getI18n('vxe.upload.imgBtnText'))
|
|
1506
1527
|
: createCommentVNode(),
|
|
1507
|
-
defTipText || tipSlot
|
|
1528
|
+
showTipText && (defTipText || tipSlot)
|
|
1508
1529
|
? h('div', {
|
|
1509
1530
|
class: 'vxe-upload--image-action-hint'
|
|
1510
1531
|
}, tipSlot ? getSlotVNs(tipSlot({ $upload: $xeUpload })) : defTipText)
|