vxe-pc-ui 4.15.19 → 4.15.21
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/dist/all.esm.js +132 -67
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/checkbox/src/button.js +9 -1
- package/es/checkbox/src/checkbox.js +27 -7
- package/es/icon/style.css +1 -1
- package/es/radio/src/button.js +27 -15
- package/es/radio/src/radio.js +27 -15
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +30 -13
- package/lib/checkbox/src/button.js +10 -0
- package/lib/checkbox/src/button.min.js +1 -1
- package/lib/checkbox/src/checkbox.js +37 -10
- package/lib/checkbox/src/checkbox.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 +146 -75
- package/lib/index.umd.min.js +1 -1
- package/lib/radio/src/button.js +31 -25
- package/lib/radio/src/button.min.js +1 -1
- package/lib/radio/src/radio.js +31 -25
- package/lib/radio/src/radio.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/upload/src/upload.js +35 -13
- package/lib/upload/src/upload.min.js +1 -1
- package/package.json +1 -1
- package/packages/checkbox/src/button.ts +11 -1
- package/packages/checkbox/src/checkbox.ts +30 -7
- package/packages/radio/src/button.ts +30 -15
- package/packages/radio/src/radio.ts +30 -15
- package/packages/upload/src/upload.ts +30 -13
- package/types/components/checkbox-button.d.ts +3 -0
- package/types/components/checkbox.d.ts +6 -1
- package/types/components/radio-button.d.ts +3 -1
- package/types/components/radio.d.ts +6 -1
- package/types/components/table.d.ts +6 -1
- package/types/components/upload.d.ts +17 -0
- /package/es/icon/{iconfont.1782955796278.ttf → iconfont.1783046335286.ttf} +0 -0
- /package/es/icon/{iconfont.1782955796278.woff → iconfont.1783046335286.woff} +0 -0
- /package/es/icon/{iconfont.1782955796278.woff2 → iconfont.1783046335286.woff2} +0 -0
- /package/es/{iconfont.1782955796278.ttf → iconfont.1783046335286.ttf} +0 -0
- /package/es/{iconfont.1782955796278.woff → iconfont.1783046335286.woff} +0 -0
- /package/es/{iconfont.1782955796278.woff2 → iconfont.1783046335286.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1782955796278.ttf → iconfont.1783046335286.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1782955796278.woff → iconfont.1783046335286.woff} +0 -0
- /package/lib/icon/style/{iconfont.1782955796278.woff2 → iconfont.1783046335286.woff2} +0 -0
- /package/lib/{iconfont.1782955796278.ttf → iconfont.1783046335286.ttf} +0 -0
- /package/lib/{iconfont.1782955796278.woff → iconfont.1783046335286.woff} +0 -0
- /package/lib/{iconfont.1782955796278.woff2 → iconfont.1783046335286.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.15.
|
|
29
|
+
const version = exports.version = "4.15.21";
|
|
30
30
|
_core.VxeUI.uiVersion = version;
|
|
31
31
|
_core.VxeUI.dynamicApp = _dynamics.dynamicApp;
|
|
32
32
|
function config(options) {
|
package/lib/ui/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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");let version=exports.version="4.15.19";function config(e){return(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return(0,_log.warnLog)("vxe.error.delFunc",["setup","setConfig"]),(0,_core.setConfig)(e)}_core.VxeUI.uiVersion=version,_core.VxeUI.dynamicApp=_dynamics.dynamicApp,_core.VxeUI.config=config,_core.VxeUI.setup=setup,(0,_core.setConfig)({alert:{},anchor:{},anchorLink:{},avatar:{},backtop:{showIcon:!0,showContent:!0,showTop:!0,showBottom:!0,shadow:!0,threshold:20},badge:{},breadcrumb:{separator:"/"},breadcrumbItem:{},button:{trigger:"hover",prefixTooltip:{enterable:!0},suffixTooltip:{enterable:!0},showDropdownIcon:!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:{},cascader:{showFullLabel:!0,treeConfig:{showIcon:!0},filterConfig:{autoExpandMode:"first"}},checkbox:{},checkboxButton:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},contextMenu:{autoLocate:!0},countdown:{},colorPicker:{type:"rgb",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePanel:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1},datePicker:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,autoClose:!0,showClearButton:null,showConfirmButton:null},dateRangePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,separator:" ~ ",autoClose:!0,showClearButton:null,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showErrorMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"],popupConfig:{}},image:{draggable:null,showPreview:!0,showPrintButton:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0,maskClosable:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{backtopConfig:{}},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{dragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},virtualYConfig:{enabled:!0,gt:100}},loading:{showIcon:!0,showText:!0},menu:{},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controlConfig:{enabled:!0,layout:"right",showButton:!0,isWheel:!0,isArrow:!0}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},segmented:{},select:{multiCharOverflow:8,radioConfig:{showIcon:!0,trigger:"option"},checkboxConfig:{showIcon:!0,trigger:"option"},remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},splitter:{resize:!0,itemConfig:{minWidth:40,minHeight:40},resizeConfig:{showTip:!0}},splitterPanel:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tableTransfer:{},tabs:{},tag:{},textEllipsis:{underline:!0},text:{copyConfig:{showMessage:!0}},textarea:{resize:"none"},timeline:{},timelineItem:{},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},transfer:{},tree:{indent:20,minHeight:60,showOverflow:!0,radioConfig:{strict:!0},tooltipConfig:{mode:"tooltip",enterable:!0,leaveDelay:300,defaultPlacement:"top"},dragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},treeSelect:{virtualYConfig:{enabled:!0,gt:0,oSize:2},treeConfig:{maxHeight:300,radioConfig:{},checkboxConfig:{},filterConfig:{autoExpandAll:!0}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0,showLimitSize:!0,showLimitCount:!0,autoSubmit:!0,maxSimultaneousUploads:5,previewImageConfig:{}},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{},gantt:{}});let iconPrefix="vxe-icon-";(0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",SELECT_ADD_OPTION:iconPrefix+"add",ICON_PICKER_OPEN:iconPrefix+"caret-down rotate180",ICON_PICKER_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",RADIO_CHECKED:iconPrefix+"radio-checked-fill",RADIO_UNCHECKED:iconPrefix+"radio-unchecked",RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",INPUT_PLUS_NUM:iconPrefix+"caret-up",INPUT_MINUS_NUM:iconPrefix+"caret-down",NUMBER_INPUT_MINUS_NUM:iconPrefix+"minus",NUMBER_INPUT_PLUS_NUM:iconPrefix+"add",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_VALID_ERROR_ICON:iconPrefix+"warning-circle-fill",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_UPLOAD:iconPrefix+"upload",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_DRAG:iconPrefix+"drag-handle",TREE_DRAG_STATUS_NODE:iconPrefix+"sort",TREE_DRAG_STATUS_SUB_NODE:iconPrefix+"add-sub",TREE_DRAG_DISABLED:iconPrefix+"no-drop",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_TOP:iconPrefix+"arrow-up",TABS_TAB_BUTTON_BOTTOM:iconPrefix+"arrow-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",TAG_CLOSE:iconPrefix+"close",TAG_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_PICKER_COLOR_COPY:iconPrefix+"copy",COLOR_PICKER_EYE_DROPPER:iconPrefix+"dropper",COLOR_PICKER_TPTY_OPEN:iconPrefix+"arrow-down rotate180",COLOR_PICKER_TPTY_CLOSE:iconPrefix+"arrow-down",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right",BACKTOP_TOP:iconPrefix+"top",CONTEXT_MENU_OPTION_LOADING:iconPrefix+"spinner roll",CONTEXT_MENU_CHILDREN:iconPrefix+"arrow-right",CASCADER_NODE_OPEN:iconPrefix+"arrow-right",CASCADER_NODE_CLOSE:iconPrefix+"arrow-right",CASCADER_NODE_LOADED:iconPrefix+"spinner roll",LIST_DRAG:iconPrefix+"drag-handle",LIST_DRAG_STATUS_NODE:iconPrefix+"sort",LIST_DRAG_DISABLED:iconPrefix+"no-drop"});var _default=exports.default=_core.VxeUI;
|
|
1
|
+
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");let version=exports.version="4.15.21";function config(e){return(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return(0,_log.warnLog)("vxe.error.delFunc",["setup","setConfig"]),(0,_core.setConfig)(e)}_core.VxeUI.uiVersion=version,_core.VxeUI.dynamicApp=_dynamics.dynamicApp,_core.VxeUI.config=config,_core.VxeUI.setup=setup,(0,_core.setConfig)({alert:{},anchor:{},anchorLink:{},avatar:{},backtop:{showIcon:!0,showContent:!0,showTop:!0,showBottom:!0,shadow:!0,threshold:20},badge:{},breadcrumb:{separator:"/"},breadcrumbItem:{},button:{trigger:"hover",prefixTooltip:{enterable:!0},suffixTooltip:{enterable:!0},showDropdownIcon:!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:{},cascader:{showFullLabel:!0,treeConfig:{showIcon:!0},filterConfig:{autoExpandMode:"first"}},checkbox:{},checkboxButton:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},contextMenu:{autoLocate:!0},countdown:{},colorPicker:{type:"rgb",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePanel:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1},datePicker:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,autoClose:!0,showClearButton:null,showConfirmButton:null},dateRangePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,separator:" ~ ",autoClose:!0,showClearButton:null,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showErrorMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"],popupConfig:{}},image:{draggable:null,showPreview:!0,showPrintButton:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0,maskClosable:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{backtopConfig:{}},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{dragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},virtualYConfig:{enabled:!0,gt:100}},loading:{showIcon:!0,showText:!0},menu:{},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controlConfig:{enabled:!0,layout:"right",showButton:!0,isWheel:!0,isArrow:!0}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},segmented:{},select:{multiCharOverflow:8,radioConfig:{showIcon:!0,trigger:"option"},checkboxConfig:{showIcon:!0,trigger:"option"},remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},splitter:{resize:!0,itemConfig:{minWidth:40,minHeight:40},resizeConfig:{showTip:!0}},splitterPanel:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tableTransfer:{},tabs:{},tag:{},textEllipsis:{underline:!0},text:{copyConfig:{showMessage:!0}},textarea:{resize:"none"},timeline:{},timelineItem:{},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},transfer:{},tree:{indent:20,minHeight:60,showOverflow:!0,radioConfig:{strict:!0},tooltipConfig:{mode:"tooltip",enterable:!0,leaveDelay:300,defaultPlacement:"top"},dragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},treeSelect:{virtualYConfig:{enabled:!0,gt:0,oSize:2},treeConfig:{maxHeight:300,radioConfig:{},checkboxConfig:{},filterConfig:{autoExpandAll:!0}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0,showLimitSize:!0,showLimitCount:!0,autoSubmit:!0,maxSimultaneousUploads:5,previewImageConfig:{}},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{},gantt:{}});let iconPrefix="vxe-icon-";(0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",SELECT_ADD_OPTION:iconPrefix+"add",ICON_PICKER_OPEN:iconPrefix+"caret-down rotate180",ICON_PICKER_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",RADIO_CHECKED:iconPrefix+"radio-checked-fill",RADIO_UNCHECKED:iconPrefix+"radio-unchecked",RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",INPUT_PLUS_NUM:iconPrefix+"caret-up",INPUT_MINUS_NUM:iconPrefix+"caret-down",NUMBER_INPUT_MINUS_NUM:iconPrefix+"minus",NUMBER_INPUT_PLUS_NUM:iconPrefix+"add",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_VALID_ERROR_ICON:iconPrefix+"warning-circle-fill",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_UPLOAD:iconPrefix+"upload",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_DRAG:iconPrefix+"drag-handle",TREE_DRAG_STATUS_NODE:iconPrefix+"sort",TREE_DRAG_STATUS_SUB_NODE:iconPrefix+"add-sub",TREE_DRAG_DISABLED:iconPrefix+"no-drop",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_TOP:iconPrefix+"arrow-up",TABS_TAB_BUTTON_BOTTOM:iconPrefix+"arrow-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",TAG_CLOSE:iconPrefix+"close",TAG_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_PICKER_COLOR_COPY:iconPrefix+"copy",COLOR_PICKER_EYE_DROPPER:iconPrefix+"dropper",COLOR_PICKER_TPTY_OPEN:iconPrefix+"arrow-down rotate180",COLOR_PICKER_TPTY_CLOSE:iconPrefix+"arrow-down",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right",BACKTOP_TOP:iconPrefix+"top",CONTEXT_MENU_OPTION_LOADING:iconPrefix+"spinner roll",CONTEXT_MENU_CHILDREN:iconPrefix+"arrow-right",CASCADER_NODE_OPEN:iconPrefix+"arrow-right",CASCADER_NODE_CLOSE:iconPrefix+"arrow-right",CASCADER_NODE_LOADED:iconPrefix+"spinner roll",LIST_DRAG:iconPrefix+"drag-handle",LIST_DRAG_STATUS_NODE:iconPrefix+"sort",LIST_DRAG_DISABLED:iconPrefix+"no-drop"});var _default=exports.default=_core.VxeUI;
|
package/lib/ui/src/log.js
CHANGED
|
@@ -9,7 +9,7 @@ var _core = require("@vxe-ui/core");
|
|
|
9
9
|
const {
|
|
10
10
|
log
|
|
11
11
|
} = _core.VxeUI;
|
|
12
|
-
const uiVersion = `ui v${"4.15.
|
|
12
|
+
const uiVersion = `ui v${"4.15.21"}`;
|
|
13
13
|
function createComponentLog(name) {
|
|
14
14
|
const tableVersion = _core.VxeUI.tableVersion ? `table v${_core.VxeUI.tableVersion}` : '';
|
|
15
15
|
const ganttVersion = _core.VxeUI.ganttVersion ? `gantt v${_core.VxeUI.ganttVersion}` : '';
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.createComponentLog=createComponentLog,exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,uiVersion="ui v4.15.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.createComponentLog=createComponentLog,exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,uiVersion="ui v4.15.21";function createComponentLog(e){var r=_core.VxeUI.tableVersion?"table v"+_core.VxeUI.tableVersion:"",o=_core.VxeUI.ganttVersion?"gantt v"+_core.VxeUI.ganttVersion:"",n=_core.VxeUI.designVersion?"design v"+_core.VxeUI.designVersion:"",r=[uiVersion,r,o,n].join(" ");return{warnLog:log.create("warn",r+"] ["+e),errLog:log.create("error",r+"] ["+e)}}let warnLog=exports.warnLog=log.create("warn",uiVersion),errLog=exports.errLog=log.create("error",uiVersion);
|
package/lib/upload/src/upload.js
CHANGED
|
@@ -218,7 +218,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
218
218
|
default: () => (0, _ui.getConfig)().upload.size || (0, _ui.getConfig)().size
|
|
219
219
|
}
|
|
220
220
|
},
|
|
221
|
-
emits: ['update:modelValue', 'add', 'remove', 'remove-fail', 'download', 'download-fail', 'upload-start', 'upload-success', 'upload-error', 'upload-end', 'upload-queue-start', 'upload-queue-end', 'sort-dragend', 'more-visible'],
|
|
221
|
+
emits: ['update:modelValue', 'change', 'add', 'remove', 'remove-fail', 'download', 'download-fail', 'upload-start', 'upload-success', 'upload-error', 'upload-end', 'upload-queue-start', 'upload-queue-end', 'sort-dragend', 'more-visible'],
|
|
222
222
|
setup(props, context) {
|
|
223
223
|
const {
|
|
224
224
|
emit,
|
|
@@ -474,7 +474,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
474
474
|
const emitModel = value => {
|
|
475
475
|
emit('update:modelValue', value);
|
|
476
476
|
};
|
|
477
|
-
const
|
|
477
|
+
const handleChangeEvent = (evnt, vals) => {
|
|
478
478
|
const {
|
|
479
479
|
singleMode,
|
|
480
480
|
urlMode,
|
|
@@ -482,7 +482,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
482
482
|
} = props;
|
|
483
483
|
const urlProp = computeUrlProp.value;
|
|
484
484
|
const nameProp = computeNameProp.value;
|
|
485
|
-
let restList =
|
|
485
|
+
let restList = vals ? vals.slice(0) : [];
|
|
486
486
|
if (urlMode) {
|
|
487
487
|
restList = restList.map(item => {
|
|
488
488
|
const url = item[urlProp];
|
|
@@ -497,7 +497,12 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
497
497
|
return url;
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
|
-
|
|
500
|
+
const value = singleMode ? restList[0] || null : restList;
|
|
501
|
+
emitModel(value);
|
|
502
|
+
dispatchEvent('change', {
|
|
503
|
+
value
|
|
504
|
+
}, evnt);
|
|
505
|
+
return value;
|
|
501
506
|
};
|
|
502
507
|
const getThumbnailFileUrl = item => {
|
|
503
508
|
const getThumbnailUrlFn = props.getThumbnailUrlMethod || (0, _ui.getConfig)().upload.getThumbnailUrlMethod;
|
|
@@ -621,6 +626,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
621
626
|
if (cacheItem) {
|
|
622
627
|
cacheItem.percent = 100;
|
|
623
628
|
cacheItem.status = 'success';
|
|
629
|
+
cacheItem.response = res;
|
|
624
630
|
}
|
|
625
631
|
Object.assign(item, res);
|
|
626
632
|
dispatchEvent('upload-success', {
|
|
@@ -634,6 +640,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
634
640
|
const cacheItem = fileCacheMaps[fileKey];
|
|
635
641
|
if (cacheItem) {
|
|
636
642
|
cacheItem.status = 'error';
|
|
643
|
+
cacheItem.response = res;
|
|
637
644
|
}
|
|
638
645
|
if (showErrorStatus) {
|
|
639
646
|
Object.assign(item, res);
|
|
@@ -668,7 +675,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
668
675
|
}
|
|
669
676
|
return Promise.resolve();
|
|
670
677
|
};
|
|
671
|
-
const
|
|
678
|
+
const handleReUploadEvent = (evnt, item) => {
|
|
672
679
|
const {
|
|
673
680
|
uploadMethod,
|
|
674
681
|
urlMode
|
|
@@ -686,7 +693,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
686
693
|
cacheItem.percent = 0;
|
|
687
694
|
handleUploadResult(item, file).then(() => {
|
|
688
695
|
if (urlMode) {
|
|
689
|
-
|
|
696
|
+
handleChangeEvent(evnt, reactData.fileList);
|
|
690
697
|
}
|
|
691
698
|
});
|
|
692
699
|
}
|
|
@@ -804,7 +811,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
804
811
|
file: file,
|
|
805
812
|
loading: !!autoSubmit,
|
|
806
813
|
status: 'pending',
|
|
807
|
-
percent: 0
|
|
814
|
+
percent: 0,
|
|
815
|
+
response: null
|
|
808
816
|
};
|
|
809
817
|
}
|
|
810
818
|
const item = (0, _vue.reactive)(fileObj);
|
|
@@ -826,12 +834,26 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
826
834
|
}, evnt);
|
|
827
835
|
});
|
|
828
836
|
Promise.all(uploadPromiseRests).then(() => {
|
|
837
|
+
const {
|
|
838
|
+
fileCacheMaps
|
|
839
|
+
} = reactData;
|
|
829
840
|
const restFileList = reactData.fileList;
|
|
841
|
+
const uploadResults = restFileList.map(option => {
|
|
842
|
+
const fileKey = getFieldKey(option);
|
|
843
|
+
const cacheItem = fileCacheMaps[fileKey];
|
|
844
|
+
return {
|
|
845
|
+
option,
|
|
846
|
+
status: cacheItem ? cacheItem.status : null,
|
|
847
|
+
response: cacheItem ? cacheItem.response : null
|
|
848
|
+
};
|
|
849
|
+
});
|
|
850
|
+
const value = handleChangeEvent(evnt, restFileList);
|
|
830
851
|
dispatchEvent('upload-queue-end', {
|
|
852
|
+
value,
|
|
831
853
|
options: restFileList,
|
|
854
|
+
results: uploadResults,
|
|
832
855
|
files: selectFiles
|
|
833
856
|
}, evnt);
|
|
834
|
-
handleChange(restFileList);
|
|
835
857
|
// 自动更新校验状态
|
|
836
858
|
if ($xeForm && formItemInfo) {
|
|
837
859
|
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, restFileList);
|
|
@@ -871,7 +893,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
871
893
|
fileList
|
|
872
894
|
} = reactData;
|
|
873
895
|
fileList.splice(index, 1);
|
|
874
|
-
|
|
896
|
+
handleChangeEvent(evnt, fileList);
|
|
875
897
|
// 自动更新校验状态
|
|
876
898
|
if ($xeForm && formItemInfo) {
|
|
877
899
|
$xeForm.triggerItemEvent(evnt || {
|
|
@@ -1526,8 +1548,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1526
1548
|
mode: 'text',
|
|
1527
1549
|
status: 'primary',
|
|
1528
1550
|
content: isError ? (0, _ui.getI18n)('vxe.upload.reUpload') : (0, _ui.getI18n)('vxe.upload.manualUpload'),
|
|
1529
|
-
onClick() {
|
|
1530
|
-
|
|
1551
|
+
onClick(evnt) {
|
|
1552
|
+
handleReUploadEvent(evnt, item);
|
|
1531
1553
|
}
|
|
1532
1554
|
})]) : (0, _ui.renderEmptyElement)($xeUpload), (0, _vue.h)('div', {
|
|
1533
1555
|
class: 'vxe-upload--file-item-btn-wrapper'
|
|
@@ -1749,8 +1771,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1749
1771
|
mode: 'text',
|
|
1750
1772
|
status: 'primary',
|
|
1751
1773
|
content: isError ? (0, _ui.getI18n)('vxe.upload.reUpload') : (0, _ui.getI18n)('vxe.upload.manualUpload'),
|
|
1752
|
-
onClick() {
|
|
1753
|
-
|
|
1774
|
+
onClick(evnt) {
|
|
1775
|
+
handleReUploadEvent(evnt, item);
|
|
1754
1776
|
}
|
|
1755
1777
|
})]) : (0, _ui.renderEmptyElement)($xeUpload), (0, _vue.h)('div', {
|
|
1756
1778
|
class: 'vxe-upload--image-item-btn-wrapper',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_dom=require("../../ui/src/dom"),_util=require("./util"),_button=_interopRequireDefault(require("../../button/src/button"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let{warnLog,errLog}=(0,_log.createComponentLog)("upload");function createReactData(){return{isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}}function createInternalData(){return{moreId:_xeUtils.default.uniqueId("upload"),imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1}}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeUpload",props:{modelValue:[Array,String,Object],showList:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showList},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},autoSubmit:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoSubmit},mode:{type:String,default:()=>(0,_ui.getConfig)().upload.mode},imageTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)},imageConfig:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)},imageStyle:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)},fileTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)},dragSort:Boolean,dragToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)},dragPlaceholder:{type:String,default:()=>(0,_ui.getConfig)().upload.dragPlaceholder},pasteToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)},keyField:String,singleMode:Boolean,urlMode:Boolean,urlArgs:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.urlArgs},multiple:Boolean,limitSize:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitSize},showLimitSize:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitSize},limitSizeText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitSizeText},limitCount:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitCount},showLimitCount:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitCount},limitCountText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitCountText},nameField:{type:String,default:()=>(0,_ui.getConfig)().upload.nameField},typeField:{type:String,default:()=>(0,_ui.getConfig)().upload.typeField},urlField:{type:String,default:()=>(0,_ui.getConfig)().upload.urlField},sizeField:{type:String,default:()=>(0,_ui.getConfig)().upload.sizeField},showErrorStatus:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showErrorStatus},showProgress:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showProgress},progressText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.progressText},previewImageConfig:Object,showSubmitButton:Boolean,autoHiddenButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoHiddenButton},showUploadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showUploadButton},buttonText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.buttonText},buttonIcon:{type:String,default:()=>(0,_ui.getConfig)().upload.buttonIcon},showButtonText:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonText},showButtonIcon:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonIcon},showRemoveButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showRemoveButton},showDownloadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showDownloadButton},showPreview:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showPreview},showTip:{type:Boolean,default:()=>null},maxSimultaneousUploads:{type:Number,default:()=>(0,_ui.getConfig)().upload.maxSimultaneousUploads},tipText:[String,Number,Function],hintText:String,previewMethod:Function,beforeSelectMethod: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-start","upload-success","upload-error","upload-end","upload-queue-start","upload-queue-end","sort-dragend","more-visible"],setup(T,e){let{emit:i,slots:D}=e,I=(0,_vue.inject)("$xeForm",null),U=(0,_vue.inject)("xeFormItemInfo",null),l=(0,_vue.inject)("$xeTable",null);var t=_xeUtils.default.uniqueId();let G=(0,_ui.useSize)(T).computeSize,m=(0,_vue.ref)(),_=(0,_vue.ref)(),c=(0,_vue.ref)(),f=(0,_vue.ref)(),B=(0,_vue.reactive)(createReactData()),r=createInternalData(),a={refElem:m},L=(0,_vue.computed)(()=>{var e=T.readonly;return null===e?!!I&&I.props.readonly:e}),P=(0,_vue.computed)(()=>{var e=T.disabled;return null===e?!!I&&I.props.disabled:e}),C=(0,_vue.computed)(()=>T.keyField||"_X_KEY"),h=(0,_vue.computed)(()=>"image"===T.mode),V=(0,_vue.computed)(()=>T.nameField||"name"),F=(0,_vue.computed)(()=>T.typeField||"type"),E=(0,_vue.computed)(()=>T.urlField||"url"),M=(0,_vue.computed)(()=>T.sizeField||"size"),H=(0,_vue.computed)(()=>1024*_xeUtils.default.toNumber(T.limitSize)*1024),Y=(0,_vue.computed)(()=>T.multiple?_xeUtils.default.toNumber(T.limitCount):1),Q=(0,_vue.computed)(()=>{var e=T.showDownloadButton;return Object.assign({showDownloadButton:e},(0,_ui.getConfig)().upload.previewImageConfig,T.previewImageConfig)}),X=(0,_vue.computed)(()=>{var e=T.multiple,t=B.fileList,o=Y.value;return e?!o||t.length>=o:1<=t.length}),W=(0,_vue.computed)(()=>{var e=_xeUtils.default.toNumber(T.limitSize);return e?1048576<e?e/1048576+"T":1024<e?e/1024+"G":e+"M":""}),K=(0,_vue.computed)(()=>{var{showTip:e,tipText:t}=T;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t}),J=(0,_vue.computed)(()=>{var{limitSize:e,fileTypes:t,multiple:o,limitCount:i}=T,l=T.tipText||T.hintText,a=h.value,u=W.value;return _xeUtils.default.isString(l)?l:_xeUtils.default.isFunction(l)?""+l({}):(l=[],a?(o&&i&&l.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[i])),e&&u&&l.push((0,_ui.getI18n)("vxe.upload.imgSizeHint",[u]))):(t&&t.length&&l.push((0,_ui.getI18n)("vxe.upload.fileTypeHint",[t.join("/")])),e&&u&&l.push((0,_ui.getI18n)("vxe.upload.fileSizeHint",[u])),o&&i&&l.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[i]))),l.join((0,_ui.getI18n)("vxe.base.comma")))}),u=(0,_vue.computed)(()=>Object.assign({},T.imageConfig||T.imageStyle)),Z=(0,_vue.computed)(()=>{var{width:e,height:t}=u.value,o={};return e&&(o.width=(0,_dom.toCssUnit)(e)),t&&(o.height=(0,_dom.toCssUnit)(t)),o}),ee=(0,_vue.computed)(()=>Object.assign({showMoreButton:!0},T.moreConfig)),n={computeUrlProp:E},O={xID:t,props:T,context:e,reactData:B,internalData:r,getRefMaps:()=>a,getComputeMaps:()=>n},S=()=>_xeUtils.default.uniqueId(),A=e=>e[C.value],d=()=>{var{modelValue:e,multiple:t}=T,o=L.value;let l=C.value,a=V.value,u=F.value,n=E.value,r=M.value;e=e?(e?_xeUtils.default.isArray(e)?e:[e]:[]).map(t=>{if(!t||_xeUtils.default.isString(t)){var o=""+(t||""),i=_xeUtils.default.parseUrl(t);let e=(i?i.searchQuery[a]:"")||decodeURIComponent(""+(o||"")).split("/").pop()||"";return{[a]:e,[u]:(i?i.searchQuery[u]:"")||N(e),[n]:o,[r]:_xeUtils.default.toNumber(i?i.searchQuery[r]:0)||0,[l]:S()}}let e=t[a]||"";return t[a]=e,t[u]=t[u]||N(e),t[n]=t[n]||"",t[r]=t[r]||0,t[l]=t[l]||S(),t}):[];B.fileList=o||t?e:e.slice(0,1)},N=e=>{var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},z=(e,t,o)=>{i(e,(0,_ui.createEvent)(o,{$upload:O},t))},s=e=>{i("update:modelValue",e)},j=e=>{let{singleMode:t,urlMode:o,urlArgs:i}=T,l=E.value,a=V.value,u=e?e.slice(0):[];o&&(u=u.map(e=>{var t=e[l];if(t&&i){var o=_xeUtils.default.parseUrl(t);if(!o.searchQuery[a]&&-1===t.indexOf("blob:"))return""+t+(-1===t.indexOf("?")?"?":"&")+a+"="+encodeURIComponent(e[a]||"")}return t})),s(t?u[0]||null:u)},k=e=>{var t=T.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=E.value;return t?t({$upload:O,option:e}):e[o]},te=t=>{var{imageTypes:e,showDownloadButton:o}=T;let i=F.value;var l=Q.value;let a=T.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;var u=r.imagePreviewTypes;u.concat(e||[]).some(e=>(""+e).toLowerCase()===(""+t[i]).toLowerCase())&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage(Object.assign(Object.assign({},l),{urlList:[k(t)],showDownloadButton:o,beforeDownloadMethod:a?()=>a({$upload:O,option:t}):void 0}))},R=(i,e)=>{let l=T.showErrorStatus,a=A(i);var t=T.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?(z("upload-start",{option:i},null),Promise.resolve(t({$upload:O,file:e,option:i,updateProgress(e){var t=B.fileCacheMaps,t=t[A(i)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(e=>{var t=B.fileCacheMaps,t=t[a];t&&(t.percent=100,t.status="success"),Object.assign(i,e),z("upload-success",{option:i,data:e},null)}).catch(e=>{var t=B.fileCacheMaps,o=t[a];o&&(o.status="error"),l?Object.assign(i,e):(B.fileList=B.fileList.filter(e=>A(e)!==a),delete t[a]),z("upload-error",{option:i,data:e},null)}).finally(()=>{var e=B.fileCacheMaps,e=e[a];e&&(e.loading=!1),z("upload-end",{option:i},null)})):(t=B.fileCacheMaps,(e=t[a])&&(e.loading=!1),Promise.resolve())},oe=e=>{let{uploadMethod:t,urlMode:o}=T;var i,l=B.fileCacheMaps,l=l[A(e)];(t||(0,_ui.getConfig)().upload.uploadMethod)&&l&&(i=l.file,l.loading=!0,l.status="pending",l.percent=0,R(e,i).then(()=>{o&&j(B.fileList)}))},p=(t,o)=>{let{multiple:e,showLimitSize:i,limitSizeText:l,showLimitCount:a,limitCountText:u,autoSubmit:n}=T;var r=B.fileList;let d=T.beforeSelectMethod||(0,_ui.getConfig)().upload.beforeSelectMethod,s=T.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,p=C.value,v=V.value,g=F.value,m=E.value,_=M.value;var c=H.value;let f=Y.value;var h=W.value;let x=t;if(e&&f){if(a&&r.length>=f)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:u?""+(_xeUtils.default.isFunction(u)?u({maxCount:f}):u):(0,_ui.getI18n)("vxe.upload.overCountErr",[f])}));let t=x.length-(f-r.length);if(a&&0<t){let e=x.slice(f-r.length);u?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:""+(_xeUtils.default.isFunction(u)?u({maxCount:f}):u)}):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",width:null,slots:{default(){return(0,_vue.h)("div",{class:"vxe-upload--file-message-over-error"},[(0,_vue.h)("div",{},(0,_ui.getI18n)("vxe.upload.overCountExtraErr",[f,t])),(0,_vue.h)("div",{class:"vxe-upload--file-message-over-extra"},e.map((e,t)=>(0,_vue.h)("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)))])}}})}x=x.slice(0,f-r.length)}if(i&&c)for(let e=0;e<t.length;e++)if(t[0].size>c)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:l?""+(_xeUtils.default.isFunction(l)?l({maxSize:c}):l):(0,_ui.getI18n)("vxe.upload.overSizeErr",[h])}));z("upload-queue-start",{files:x},o);let w=Object.assign({},B.fileCacheMaps),y=e?r:[],b=[];x.forEach(e=>{var t=e.name,o=S(),t={[v]:t,[g]:N(t),[_]:e.size,[m]:URL.createObjectURL(e),[p]:o},o=(s&&(w[o]={file:e,loading:!!n,status:"pending",percent:0}),(0,_vue.reactive)(t));d&&!d({$upload:O,file:e})||(s&&n&&b.push(R(o,e)),y.push(o))}),B.fileList=y,B.fileCacheMaps=w,y.forEach(e=>{z("add",{option:e},o)}),Promise.all(b).then(()=>{var e=B.fileList;z("upload-queue-end",{options:e,files:x},o),j(e),I&&U&&I.triggerItemEvent(o,U.itemConfig.field,e)})},v=t=>{var{multiple:e,imageTypes:o,fileTypes:i}=T,l=P.value,a=h.value;return l?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:a?o:i}).then(e=>(p(e.files,t),e))},ie=e=>{v(e).catch(()=>{})},g=(e,t,o)=>{var i=B.fileList;i.splice(o,1),j(i),I&&U&&I.triggerItemEvent(e||{type:"remove"},U.itemConfig.field,i),e&&z("remove",{option:t},e)},$=(t,o,i)=>{var e=T.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod;let l=T.removeMethod||(0,_ui.getConfig)().upload.removeMethod;return Promise.resolve(!e||e({$upload:O,option:o})).then(e=>(e?l?Promise.resolve(l({$upload:O,option:o})).then(()=>{g(t,o,i)}).catch(e=>e):g(t,o,i):t&&z("remove-fail",{option:o},t),e))},le=(e,t)=>{z("download",{option:t},e)},ae=e=>{var t,o,i,l=e.currentTarget,{clientX:e,clientY:a}=e;l&&({x:l,y:t,height:o,width:i}=l.getBoundingClientRect(),e<l||l+i<e||a<t||t+o<a)&&(B.isDragUploadStatus=!1)},ue=e=>{var t=e.dataTransfer;t&&(t=t.items,t)&&t.length&&(e.preventDefault(),B.isDragUploadStatus=!0)},ne=(e,t)=>{let{imageTypes:i,fileTypes:l}=T;var a=r.imagePreviewTypes;if(h.value){let o=a.concat(i&&i.length?i:[]);t=t.filter(e=>{let t=(""+(e.type.split("/")[1]||"")).toLowerCase();return!!o.some(e=>(""+e).toLowerCase()===t)})}else if(l&&l.length){let o=[];if(t.forEach(e=>{let t=N(e.name);l.some(e=>(""+e).toLowerCase()===t)||o.push(t)}),o.length)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.error.notType",[o.join(", ")]),status:"error"}))}t.length?p(t,e):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.uploadTypeErr")})},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=>{let t=[];return _xeUtils.default.arrayEach(e,e=>{e=e.getAsFile();e&&t.push(e)}),t},x=e=>{let v=L.value,g=h.value;e=e.$event;_ui.VxeUI.modal&&(_ui.VxeUI.modal.open({id:r.moreId,title:v?(0,_ui.getI18n)("vxe.upload.morePopup.readTitle"):(0,_ui.getI18n)("vxe.upload.morePopup."+(g?"imageTitle":"fileTitle")),width:660,height:500,escClosable:!0,showMaximize:!0,resize:!0,maskClosable:!0,slots:{default(){var{showErrorStatus:e,dragToUpload:t,dragSort:o,dragPlaceholder:i}=T,{isActivated:l,isDragMove:a,isDragUploadStatus:u,dragIndex:n}=B;let r=B.fileList;var d=P.value,s=D.moreContent||D["more-content"],p={};return t&&-1===n&&(p.onDragover=ue,p.onDragleave=ae,p.onDrop=re),(0,_vue.h)("div",Object.assign({ref:_,class:["vxe-upload--more-popup",{"is--readonly":v,"is--disabled":d,"is--active":l,"show--error":e,"is--drag":u}]},p),s?(0,_vn.getSlotVNs)(s({options:r})):[g?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(a?"":"-disabled"),tag:"div",class:"vxe-upload--image-more-list"},{default:()=>b(r,!0).concat(q(!0))}):(0,_vue.h)("div",{class:"vxe-upload--image-more-list"},b(r,!0).concat(q(!0))):(0,_vue.h)("div",{class:"vxe-upload--file-more-list"},[y(!0),o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(a?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>w(r,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},w(r,!0))]),o?(0,_vue.h)("div",{ref:f,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(O),u?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},i||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(O)])}},onShow(){B.showMorePopup=!0},onHide({$event:e}){B.showMorePopup=!1,e&&z("more-visible",{visible:!1},e)}}),e)&&z("more-visible",{visible:!0},e)},se=(e,t,o)=>{var i,l=B.showMorePopup,a=m.value,u=_.value,u=l?u:a;u&&(a=u.getBoundingClientRect(),u=c.value,i=f.value,l=l?i:u)&&(i=t.getBoundingClientRect(),l.style.display="block",l.style.top=Math.max(1,i.y-a.y)+"px",l.style.left=Math.max(1,i.x-a.x)+"px",l.style.height=i.height+"px",l.style.width=i.width-1+"px",l.setAttribute("drag-pos",o))},pe=()=>{var e=c.value,t=f.value;e&&(e.style.display=""),t&&(t.style.display="")},ve=e=>{e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0);let 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=o=>{o.stopPropagation(),o.preventDefault();var i=B.dragIndex;if(-1!==i){var l=h.value;let t=o.currentTarget;var a=t.parentElement,a=_xeUtils.default.findIndexOf(Array.from(a.children),e=>t===e);let e="";e=l?o.clientX-t.getBoundingClientRect().x<t.clientWidth/2?"left":"right":o.clientY-t.getBoundingClientRect().y<t.clientHeight/2?"top":"bottom",i===a?se(o,t,e):(se(o,t,e),r.prevDragIndex=a,r.prevDragPos=e)}},me=e=>{var{fileList:t,dragIndex:o}=B,{prevDragIndex:i,prevDragPos:l}=r,a="bottom"===l||"right"===l?1:0,u=t[o];let n=t[i];u&&n&&(t.splice(o,1),i=_xeUtils.default.findIndexOf(t,e=>n===e)+a,t.splice(i,0,u),z("sort-dragend",{oldItem:u,newItem:n,dragPos:l,offsetIndex:a,_index:{newIndex:i,oldIndex:o}},e)),pe(),B.dragIndex=-1},_e=e=>{l&&e.stopPropagation(),B.isActivated=!0},ce=e=>{var t=T.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))},fe=e=>{var t=m.value,o=_.value;let i=(0,_dom.getEventTargetNode)(e,t).flag;!i&&o&&(o=(t=o.parentElement||o)&&t.parentElement,i=(0,_dom.getEventTargetNode)(e,o).flag),B.isActivated=i},he=()=>{B.isActivated=!1},xe=o=>{var e=B.fileList;let i=E.value,l=[];return _xeUtils.default.lastEach(e,(t,e)=>{l.push($(o,t,e).then(e=>({url:t[i],status:e})))}),Promise.all(l)},we=(o,e)=>{let i=B.fileList,l=E.value;e=_xeUtils.default.isArray(e)?e:[e];let a=[];return e.forEach(e=>{if(e){let t=_xeUtils.default.isString(e)?e:e[l];e=_xeUtils.default.findIndexOf(i,e=>e[l]===t);-1<e&&a.push($(o,i[e],e).then(e=>({url:t,status:e})))}}),Promise.all(a)};t={dispatchEvent:z,choose(){return v(null)},clear(){return xe(null)},clearByEvent(e){return xe(e)},getPendingFiles(){let{fileList:e,fileCacheMaps:t}=B,o=[];return e.forEach(e=>{e=A(e),e=t[e];e&&"pending"===e.status&&o.push(e.file)}),o},submit(i){var e=T.maxSimultaneousUploads,e=_xeUtils.default.toNumber(e||1)||1;let{fileList:t,fileCacheMaps:l}=B,o=t.filter(e=>{e=A(e),e=l[e];return e&&("pending"===e.status||i&&"error"===e.status)}),a=e=>{var t=A(e),t=l[t];if(t){var o=t.file;if(o&&("pending"===t.status||i&&"error"===t.status))return t.loading=!0,t.percent=0,R(e,o).then(u)}return u()},u=()=>{var e;return o.length?(e=o[0],o.splice(0,1),a(e).then(u)):Promise.resolve()};return Promise.all(o.splice(0,e).map(a)).then(()=>{})},getMoreVisible(){return B.showMorePopup},openMore(){return x({$event:new Event("click")}),(0,_vue.nextTick)()},openMoreByEvent(e){return x({$event:e}),(0,_vue.nextTick)()},closeMore(){return _ui.VxeUI.modal&&_ui.VxeUI.modal.close(r.moreId),(0,_vue.nextTick)()},remove(e){return we(null,e)},removeByEvent(e,t){return we(e,t)}},e={removeFileEvent:$};Object.assign(O,t,e);let w=(e,r)=>{let{showRemoveButton:d,showDownloadButton:s,showProgress:p,progressText:v,showPreview:g,showErrorStatus:m,dragSort:_,autoSubmit:c,showSubmitButton:f}=T,{fileList:h,fileCacheMaps:x}=B,w=P.value,y=L.value,b=V.value,I=F.value,U=D.option,C=D.action,E=D.corner,M=D.name,S={};return _&&1<e.length&&(S.onDragstart=ve,S.onDragover=ge,S.onDragend=me),e.map((i,t)=>{var e=A(i),o=x[e];let l=!1,a=!1,u=!1;var n=""+(i[b]||"");return o&&(l=o.loading,a="error"===o.status,u="pending"===o.status),(0,_vue.h)("div",Object.assign({key:_?e:t,class:["vxe-upload--file-item",{"is--preview":g,"is--loading":l,"is--pending":u,"is--error":a}],fileid:e,draggable:!!_||null},S),U?(0,_vn.getSlotVNs)(U({option:i,isMoreView:r,options:h})):[(0,_vue.h)("div",{class:"vxe-upload--file-item-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_"+(""+i[I]).toLocaleUpperCase()]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),(0,_vue.h)("div",{class:"vxe-upload--file-item-name",title:n,onClick(e){var t,o;l||a||(t=i,o=T.previewMethod||(0,_ui.getConfig)().upload.previewMethod,T.showPreview&&(o?o({$upload:O,option:t}):te(t)))}},M?(0,_vn.getSlotVNs)(M({option:i,isMoreView:r,options:h})):n),l?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(O),p&&l&&o?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-text"},v?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(v)?v({}):v),{percent:o.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[o.percent])):(0,_ui.renderEmptyElement)(O),!l&&(a&&m||u&&f&&!c)?(0,_vue.h)("div",{class:"vxe-upload--file-item-rebtn"},[(0,_vue.h)(_button.default,{icon:a?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:a?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload"),onClick(){oe(i)}})]):(0,_ui.renderEmptyElement)(O),(0,_vue.h)("div",{class:"vxe-upload--file-item-btn-wrapper"},C?(0,_vn.getSlotVNs)(C({option:i,isMoreView:r,options:h,readonly:y})):[E?(0,_vue.h)("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(E({option:i,isMoreView:r,options:h,readonly:y}))):(0,_ui.renderEmptyElement)(O),!s||l||u?(0,_ui.renderEmptyElement)(O):(0,_vue.h)("div",{class:"vxe-upload--file-item-download-btn",onClick(e){((t,o)=>{var e=T.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;let i=T.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!e||e({$upload:O,option:o})).then(e=>{e?i?Promise.resolve(i({$upload:O,option:o})).then(()=>{le(t,o)}).catch(e=>e):le(t,o):z("download-fail",{option:o},t)})})(e,i)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]),!d||y||w||l?(0,_ui.renderEmptyElement)(O):(0,_vue.h)("div",{class:"vxe-upload--file-item-remove-btn",onClick(e){$(e,i,t)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},y=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=T,n=B.fileList,r=P.value,d=L.value,s=K.value,p=J.value,v=X.value,g=D.default,m=D.tip||D.hint;return d||!t?(0,_ui.renderEmptyElement)(O):(0,_vue.h)("div",{class:"vxe-upload--file-action"},[u&&v?(0,_ui.renderEmptyElement)(O):(0,_vue.h)("div",{class:"vxe-upload--file-action-btn",onClick:ie},g?(0,_vn.getSlotVNs)(g({isMoreView:e,options:n,$upload:O})):[(0,_vue.h)(_button.default,{class:"vxe-upload--file-action-button",content:e||l?o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:a?i||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:r})]),s&&(p||m)?(0,_vue.h)("div",{class:"vxe-upload--file-action-tip"},m?(0,_vn.getSlotVNs)(m({isMoreView:e,options:n,$upload:O})):""+p):(0,_ui.renderEmptyElement)(O)])},b=(e,n)=>{let{showRemoveButton:r,showProgress:d,progressText:s,showPreview:p,showErrorStatus:v,dragSort:g,autoSubmit:m,showSubmitButton:_}=T,{fileList:c,fileCacheMaps:f}=B,h=P.value,x=L.value,w=u.value,y=Z.value,b=D.option,I=D.action,U=D.corner,C={onMousedown:_e};return g&&1<e.length&&(C.onDragstart=ve,C.onDragover=ge,C.onDragend=me),e.map((t,o)=>{var e=A(t),i=f[e];let l=!1,a=!1,u=!1;return i&&(l=i.loading,a="error"===i.status,u="pending"===i.status),(0,_vue.h)("div",Object.assign({key:g?e:o,class:["vxe-upload--image-item",{"is--preview":p,"is--circle":w.circle,"is--loading":l,"is--pending":u,"is--error":a}],fileid:e,draggable:!!g||null},C),b?(0,_vn.getSlotVNs)(b({option:t,isMoreView:n,options:c})):[(0,_vue.h)("div",{class:"vxe-upload--image-item-box",style:n?null:y,onClick(e){l||a||((e,t)=>{var o=T.showDownloadButton;let i=B.fileList;var l=Q.value,a=T.previewMethod||(0,_ui.getConfig)().upload.previewMethod;let u=T.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;T.showPreview&&(a?a({$upload:O,option:e}):_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage(Object.assign(Object.assign({},l),{urlList:i.map(e=>k(e)),activeIndex:t,showDownloadButton:o,beforeDownloadMethod:u?({index:e})=>u({$upload:O,option:i[e]}):void 0})))})(t,o)}},[l&&i?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading"},[(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),d?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-text"},s?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(s)?s({}):s),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(O)]):(0,_ui.renderEmptyElement)(O),(0,_vue.h)("div",{class:"vxe-upload--image-item-img-wrapper",title:(0,_ui.getI18n)("vxe.upload.viewItemTitle")},[(0,_vue.h)("img",{class:"vxe-upload--image-item-img",src:(e=t,(i=T.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod)?i({$upload:O,option:e}):k(e))})]),!l&&(a&&v||u&&_&&!m)?(0,_vue.h)("div",{class:"vxe-upload--image-item-rebtn"},[(0,_vue.h)(_button.default,{icon:a?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:a?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload"),onClick(){oe(t)}})]):(0,_ui.renderEmptyElement)(O),(0,_vue.h)("div",{class:"vxe-upload--image-item-btn-wrapper",onClick(e){e.stopPropagation()}},I?(0,_vn.getSlotVNs)(I({option:t,isMoreView:n,options:c,readonly:x})):[U?(0,_vue.h)("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(U({option:t,isMoreView:n,options:c,readonly:x}))):(0,_ui.renderEmptyElement)(O),!r||x||h||l?(0,_ui.renderEmptyElement)(O):(0,_vue.h)("div",{class:"vxe-upload--image-item-remove-btn",onClick(e){e.stopPropagation(),$(e,t,o)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},q=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=T,n=B.fileList,r=L.value,d=K.value,s=J.value,p=X.value,v=Z.value,g=D.default,m=D.tip||D.hint;return r||!t||u&&p?(0,_ui.renderEmptyElement)(O):(0,_vue.h)("div",{key:"action",class:"vxe-upload--image-action"},[(0,_vue.h)("div",{class:"vxe-upload--image-action-btn",onClick:ie},g?g({isMoreView:e,options:n,$upload:O}):[(0,_vue.h)("div",{class:"vxe-upload--image-action-box",style:e?null:v},[a?(0,_vue.h)("div",{class:"vxe-upload--image-action-icon"},[(0,_vue.h)("i",{class:i||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_ui.renderEmptyElement)(O),e||l?(0,_vue.h)("div",{class:"vxe-upload--image-action-content"},o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_ui.renderEmptyElement)(O),d&&(s||m)?(0,_vue.h)("div",{class:"vxe-upload--image-action-hint"},m?(0,_vn.getSlotVNs)(m({isMoreView:e,options:n,$upload:O})):""+s):(0,_ui.renderEmptyElement)(O)])])])};let o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>T.modelValue?T.modelValue.length:0,()=>{o.value++}),(0,_vue.watch)(()=>T.modelValue,()=>{o.value++}),(0,_vue.watch)(o,()=>{d()}),(0,_vue.onMounted)(()=>{T.multiple&&T.singleMode&&errLog("vxe.error.errConflicts",["multiple","single-mode"]),T.imageStyle&&warnLog("vxe.error.delProp",["image-style","image-config"]),T.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(O,"paste",ce),_ui.globalEvents.on(O,"click",fe),_ui.globalEvents.on(O,"blur",he)}),(0,_vue.onBeforeUnmount)(()=>{B.isDragUploadStatus=!1,_ui.globalEvents.off(O,"paste"),_ui.globalEvents.off(O,"click"),_ui.globalEvents.off(O,"blur"),_xeUtils.default.assign(B,createReactData()),_xeUtils.default.assign(r,createInternalData())}),d(),O.renderVN=()=>{var{showErrorStatus:e,dragToUpload:t,pasteToUpload:o,dragSort:i,dragPlaceholder:l}=T,{isDragUploadStatus:a,showMorePopup:u,isActivated:n,dragIndex:r}=B,d=G.value,s=P.value,p=L.value,v=h.value,g={onMousedown:_e};return t&&-1===r&&(g.onDragover=ue,g.onDragleave=ae,g.onDrop=re),(0,_vue.h)("div",Object.assign({ref:m,class:["vxe-upload",{["size--"+d]:d,"is--active":n,"is--readonly":p,"is--disabled":s,"is--paste":o,"show--error":e,"is--drag":a}]},g),[(v?()=>{var{showList:e,dragSort:t}=T;let{fileList:o,isDragMove:i}=B;var l=ee.value;let a=D.moreButton||D["more-button"],{maxCount:u,showMoreButton:n,moreButtonText:r}=l,d=o,s=0,p=!1,v=!1;return _xeUtils.default.isNumber(u)&&o.length>u&&(p=!0,v=0===u,s=o.length-u,d=o.slice(0,u)),(0,_vue.h)("div",{key:"image",class:"vxe-upload--image-wrapper"},e?[t?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(i?"":"-disabled"),tag:"div",class:"vxe-upload--image-list"},{default:()=>b(d,!1).concat([n&&s?(0,_vue.h)("div",{key:"om",class:"vxe-upload--image-over-more"},a?(0,_vn.getSlotVNs)(a({options:o})):[(0,_vue.h)(_button.default,{mode:"text",content:r?_xeUtils.default.isFunction(r)?r({$upload:O,options:o}):_xeUtils.default.toFormatString(r,[o.length]):(0,_ui.getI18n)(p&&v?"vxe.upload.moreImgBtnText":"vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:x})]):(0,_ui.renderEmptyElement)(O),q(!1)])}):(0,_vue.h)("div",{class:"vxe-upload--image-list"},b(d,!1).concat([n&&s?(0,_vue.h)("div",{class:"vxe-upload--image-over-more"},a?(0,_vn.getSlotVNs)(a({options:o})):[(0,_vue.h)(_button.default,{mode:"text",content:r?_xeUtils.default.isFunction(r)?r({$upload:O,options:o}):_xeUtils.default.toFormatString(r,[o.length]):(0,_ui.getI18n)(p&&v?"vxe.upload.moreImgBtnText":"vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:x})]):(0,_ui.renderEmptyElement)(O),q(!1)]))]:[(0,_vue.h)("div",{class:"vxe-upload--image-list"},[q(!1)])])}:()=>{var{showList:e,moreConfig:t,dragSort:o}=T,{fileList:i,isDragMove:l}=B,{maxCount:a,showMoreButton:u,layout:n,moreButtonText:r}=ee.value,n="horizontal"===n,d=D.moreButton||D["more-button"];let s=i,p=0,v=!1,g=!1;return _xeUtils.default.isNumber(a)&&i.length>a&&(v=!0,g=0===a,p=i.length-a,s=i.slice(0,a)),(0,_vue.h)("div",{key:"all",class:"vxe-upload--file-wrapper"},e?[u&&t&&n?(0,_ui.renderEmptyElement)(O):y(!0),(0,_vue.h)("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":n}]},[s.length?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>w(s,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},w(s,!1)):(0,_ui.renderEmptyElement)(O),u&&p?(0,_vue.h)("div",{class:"vxe-upload--file-over-more"},d?(0,_vn.getSlotVNs)(d({options:i})):[(0,_vue.h)(_button.default,{mode:"text",content:r?_xeUtils.default.isFunction(r)?r({$upload:O,options:i}):_xeUtils.default.toFormatString(r,[i.length]):(0,_ui.getI18n)(v&&g?"vxe.upload.moreFileBtnText":"vxe.upload.moreBtnText",[i.length]),status:"primary",onClick:x})]):(0,_ui.renderEmptyElement)(O),u&&t&&n?y(!1):(0,_ui.renderEmptyElement)(O)])]:[y(!1)])})(),i?(0,_vue.h)("div",{ref:c,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(O),a&&!u?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},l||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(O)])},O},render(){return this.renderVN()}});
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_dom=require("../../ui/src/dom"),_util=require("./util"),_button=_interopRequireDefault(require("../../button/src/button"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let{warnLog,errLog}=(0,_log.createComponentLog)("upload");function createReactData(){return{isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}}function createInternalData(){return{moreId:_xeUtils.default.uniqueId("upload"),imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1}}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeUpload",props:{modelValue:[Array,String,Object],showList:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showList},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},autoSubmit:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoSubmit},mode:{type:String,default:()=>(0,_ui.getConfig)().upload.mode},imageTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)},imageConfig:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)},imageStyle:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)},fileTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)},dragSort:Boolean,dragToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)},dragPlaceholder:{type:String,default:()=>(0,_ui.getConfig)().upload.dragPlaceholder},pasteToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)},keyField:String,singleMode:Boolean,urlMode:Boolean,urlArgs:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.urlArgs},multiple:Boolean,limitSize:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitSize},showLimitSize:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitSize},limitSizeText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitSizeText},limitCount:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitCount},showLimitCount:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitCount},limitCountText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitCountText},nameField:{type:String,default:()=>(0,_ui.getConfig)().upload.nameField},typeField:{type:String,default:()=>(0,_ui.getConfig)().upload.typeField},urlField:{type:String,default:()=>(0,_ui.getConfig)().upload.urlField},sizeField:{type:String,default:()=>(0,_ui.getConfig)().upload.sizeField},showErrorStatus:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showErrorStatus},showProgress:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showProgress},progressText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.progressText},previewImageConfig:Object,showSubmitButton:Boolean,autoHiddenButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoHiddenButton},showUploadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showUploadButton},buttonText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.buttonText},buttonIcon:{type:String,default:()=>(0,_ui.getConfig)().upload.buttonIcon},showButtonText:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonText},showButtonIcon:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonIcon},showRemoveButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showRemoveButton},showDownloadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showDownloadButton},showPreview:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showPreview},showTip:{type:Boolean,default:()=>null},maxSimultaneousUploads:{type:Number,default:()=>(0,_ui.getConfig)().upload.maxSimultaneousUploads},tipText:[String,Number,Function],hintText:String,previewMethod:Function,beforeSelectMethod: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","change","add","remove","remove-fail","download","download-fail","upload-start","upload-success","upload-error","upload-end","upload-queue-start","upload-queue-end","sort-dragend","more-visible"],setup(T,e){let{emit:i,slots:D}=e,I=(0,_vue.inject)("$xeForm",null),U=(0,_vue.inject)("xeFormItemInfo",null),l=(0,_vue.inject)("$xeTable",null);var t=_xeUtils.default.uniqueId();let G=(0,_ui.useSize)(T).computeSize,m=(0,_vue.ref)(),c=(0,_vue.ref)(),_=(0,_vue.ref)(),f=(0,_vue.ref)(),B=(0,_vue.reactive)(createReactData()),r=createInternalData(),a={refElem:m},L=(0,_vue.computed)(()=>{var e=T.readonly;return null===e?!!I&&I.props.readonly:e}),P=(0,_vue.computed)(()=>{var e=T.disabled;return null===e?!!I&&I.props.disabled:e}),C=(0,_vue.computed)(()=>T.keyField||"_X_KEY"),h=(0,_vue.computed)(()=>"image"===T.mode),V=(0,_vue.computed)(()=>T.nameField||"name"),F=(0,_vue.computed)(()=>T.typeField||"type"),E=(0,_vue.computed)(()=>T.urlField||"url"),M=(0,_vue.computed)(()=>T.sizeField||"size"),H=(0,_vue.computed)(()=>1024*_xeUtils.default.toNumber(T.limitSize)*1024),Y=(0,_vue.computed)(()=>T.multiple?_xeUtils.default.toNumber(T.limitCount):1),Q=(0,_vue.computed)(()=>{var e=T.showDownloadButton;return Object.assign({showDownloadButton:e},(0,_ui.getConfig)().upload.previewImageConfig,T.previewImageConfig)}),X=(0,_vue.computed)(()=>{var e=T.multiple,t=B.fileList,o=Y.value;return e?!o||t.length>=o:1<=t.length}),W=(0,_vue.computed)(()=>{var e=_xeUtils.default.toNumber(T.limitSize);return e?1048576<e?e/1048576+"T":1024<e?e/1024+"G":e+"M":""}),K=(0,_vue.computed)(()=>{var{showTip:e,tipText:t}=T;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t}),J=(0,_vue.computed)(()=>{var{limitSize:e,fileTypes:t,multiple:o,limitCount:i}=T,l=T.tipText||T.hintText,a=h.value,u=W.value;return _xeUtils.default.isString(l)?l:_xeUtils.default.isFunction(l)?""+l({}):(l=[],a?(o&&i&&l.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[i])),e&&u&&l.push((0,_ui.getI18n)("vxe.upload.imgSizeHint",[u]))):(t&&t.length&&l.push((0,_ui.getI18n)("vxe.upload.fileTypeHint",[t.join("/")])),e&&u&&l.push((0,_ui.getI18n)("vxe.upload.fileSizeHint",[u])),o&&i&&l.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[i]))),l.join((0,_ui.getI18n)("vxe.base.comma")))}),u=(0,_vue.computed)(()=>Object.assign({},T.imageConfig||T.imageStyle)),Z=(0,_vue.computed)(()=>{var{width:e,height:t}=u.value,o={};return e&&(o.width=(0,_dom.toCssUnit)(e)),t&&(o.height=(0,_dom.toCssUnit)(t)),o}),ee=(0,_vue.computed)(()=>Object.assign({showMoreButton:!0},T.moreConfig)),n={computeUrlProp:E},O={xID:t,props:T,context:e,reactData:B,internalData:r,getRefMaps:()=>a,getComputeMaps:()=>n},S=()=>_xeUtils.default.uniqueId(),A=e=>e[C.value],s=()=>{var{modelValue:e,multiple:t}=T,o=L.value;let l=C.value,a=V.value,u=F.value,n=E.value,r=M.value;e=e?(e?_xeUtils.default.isArray(e)?e:[e]:[]).map(t=>{if(!t||_xeUtils.default.isString(t)){var o=""+(t||""),i=_xeUtils.default.parseUrl(t);let e=(i?i.searchQuery[a]:"")||decodeURIComponent(""+(o||"")).split("/").pop()||"";return{[a]:e,[u]:(i?i.searchQuery[u]:"")||N(e),[n]:o,[r]:_xeUtils.default.toNumber(i?i.searchQuery[r]:0)||0,[l]:S()}}let e=t[a]||"";return t[a]=e,t[u]=t[u]||N(e),t[n]=t[n]||"",t[r]=t[r]||0,t[l]=t[l]||S(),t}):[];B.fileList=o||t?e:e.slice(0,1)},N=e=>{var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},z=(e,t,o)=>{i(e,(0,_ui.createEvent)(o,{$upload:O},t))},d=e=>{i("update:modelValue",e)},j=(e,t)=>{let{singleMode:o,urlMode:i,urlArgs:l}=T,a=E.value,u=V.value,n=t?t.slice(0):[];i&&(n=n.map(e=>{var t=e[a];if(t&&l){var o=_xeUtils.default.parseUrl(t);if(!o.searchQuery[u]&&-1===t.indexOf("blob:"))return""+t+(-1===t.indexOf("?")?"?":"&")+u+"="+encodeURIComponent(e[u]||"")}return t}));t=o?n[0]||null:n;return d(t),z("change",{value:t},e),t},k=e=>{var t=T.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=E.value;return t?t({$upload:O,option:e}):e[o]},te=t=>{var{imageTypes:e,showDownloadButton:o}=T;let i=F.value;var l=Q.value;let a=T.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;var u=r.imagePreviewTypes;u.concat(e||[]).some(e=>(""+e).toLowerCase()===(""+t[i]).toLowerCase())&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage(Object.assign(Object.assign({},l),{urlList:[k(t)],showDownloadButton:o,beforeDownloadMethod:a?()=>a({$upload:O,option:t}):void 0}))},R=(i,e)=>{let l=T.showErrorStatus,a=A(i);var t=T.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?(z("upload-start",{option:i},null),Promise.resolve(t({$upload:O,file:e,option:i,updateProgress(e){var t=B.fileCacheMaps,t=t[A(i)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(e=>{var t=B.fileCacheMaps,t=t[a];t&&(t.percent=100,t.status="success",t.response=e),Object.assign(i,e),z("upload-success",{option:i,data:e},null)}).catch(e=>{var t=B.fileCacheMaps,o=t[a];o&&(o.status="error",o.response=e),l?Object.assign(i,e):(B.fileList=B.fileList.filter(e=>A(e)!==a),delete t[a]),z("upload-error",{option:i,data:e},null)}).finally(()=>{var e=B.fileCacheMaps,e=e[a];e&&(e.loading=!1),z("upload-end",{option:i},null)})):(t=B.fileCacheMaps,(e=t[a])&&(e.loading=!1),Promise.resolve())},oe=(e,t)=>{let{uploadMethod:o,urlMode:i}=T;var l,a=B.fileCacheMaps,a=a[A(t)];(o||(0,_ui.getConfig)().upload.uploadMethod)&&a&&(l=a.file,a.loading=!0,a.status="pending",a.percent=0,R(t,l).then(()=>{i&&j(e,B.fileList)}))},p=(t,l)=>{let{multiple:e,showLimitSize:o,limitSizeText:i,showLimitCount:a,limitCountText:u,autoSubmit:n}=T;var r=B.fileList;let s=T.beforeSelectMethod||(0,_ui.getConfig)().upload.beforeSelectMethod,d=T.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,p=C.value,v=V.value,g=F.value,m=E.value,c=M.value;var _=H.value;let f=Y.value;var h=W.value;let x=t;if(e&&f){if(a&&r.length>=f)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:u?""+(_xeUtils.default.isFunction(u)?u({maxCount:f}):u):(0,_ui.getI18n)("vxe.upload.overCountErr",[f])}));let t=x.length-(f-r.length);if(a&&0<t){let e=x.slice(f-r.length);u?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:""+(_xeUtils.default.isFunction(u)?u({maxCount:f}):u)}):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",width:null,slots:{default(){return(0,_vue.h)("div",{class:"vxe-upload--file-message-over-error"},[(0,_vue.h)("div",{},(0,_ui.getI18n)("vxe.upload.overCountExtraErr",[f,t])),(0,_vue.h)("div",{class:"vxe-upload--file-message-over-extra"},e.map((e,t)=>(0,_vue.h)("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)))])}}})}x=x.slice(0,f-r.length)}if(o&&_)for(let e=0;e<t.length;e++)if(t[0].size>_)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:i?""+(_xeUtils.default.isFunction(i)?i({maxSize:_}):i):(0,_ui.getI18n)("vxe.upload.overSizeErr",[h])}));z("upload-queue-start",{files:x},l);let w=Object.assign({},B.fileCacheMaps),y=e?r:[],b=[];x.forEach(e=>{var t=e.name,o=S(),t={[v]:t,[g]:N(t),[c]:e.size,[m]:URL.createObjectURL(e),[p]:o},o=(d&&(w[o]={file:e,loading:!!n,status:"pending",percent:0,response:null}),(0,_vue.reactive)(t));s&&!s({$upload:O,file:e})||(d&&n&&b.push(R(o,e)),y.push(o))}),B.fileList=y,B.fileCacheMaps=w,y.forEach(e=>{z("add",{option:e},l)}),Promise.all(b).then(()=>{let o=B.fileCacheMaps;var e=B.fileList,t=e.map(e=>{var t=A(e),t=o[t];return{option:e,status:t?t.status:null,response:t?t.response:null}}),i=j(l,e);z("upload-queue-end",{value:i,options:e,results:t,files:x},l),I&&U&&I.triggerItemEvent(l,U.itemConfig.field,e)})},v=t=>{var{multiple:e,imageTypes:o,fileTypes:i}=T,l=P.value,a=h.value;return l?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:a?o:i}).then(e=>(p(e.files,t),e))},ie=e=>{v(e).catch(()=>{})},g=(e,t,o)=>{var i=B.fileList;i.splice(o,1),j(e,i),I&&U&&I.triggerItemEvent(e||{type:"remove"},U.itemConfig.field,i),e&&z("remove",{option:t},e)},$=(t,o,i)=>{var e=T.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod;let l=T.removeMethod||(0,_ui.getConfig)().upload.removeMethod;return Promise.resolve(!e||e({$upload:O,option:o})).then(e=>(e?l?Promise.resolve(l({$upload:O,option:o})).then(()=>{g(t,o,i)}).catch(e=>e):g(t,o,i):t&&z("remove-fail",{option:o},t),e))},le=(e,t)=>{z("download",{option:t},e)},ae=e=>{var t,o,i,l=e.currentTarget,{clientX:e,clientY:a}=e;l&&({x:l,y:t,height:o,width:i}=l.getBoundingClientRect(),e<l||l+i<e||a<t||t+o<a)&&(B.isDragUploadStatus=!1)},ue=e=>{var t=e.dataTransfer;t&&(t=t.items,t)&&t.length&&(e.preventDefault(),B.isDragUploadStatus=!0)},ne=(e,t)=>{let{imageTypes:i,fileTypes:l}=T;var a=r.imagePreviewTypes;if(h.value){let o=a.concat(i&&i.length?i:[]);t=t.filter(e=>{let t=(""+(e.type.split("/")[1]||"")).toLowerCase();return!!o.some(e=>(""+e).toLowerCase()===t)})}else if(l&&l.length){let o=[];if(t.forEach(e=>{let t=N(e.name);l.some(e=>(""+e).toLowerCase()===t)||o.push(t)}),o.length)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.error.notType",[o.join(", ")]),status:"error"}))}t.length?p(t,e):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.uploadTypeErr")})},re=e=>{var t=e.dataTransfer;t&&(t=t.items,t)&&t.length&&(e.preventDefault(),(t=se(t)).length)&&ne(e,t),B.isDragUploadStatus=!1},se=e=>{let t=[];return _xeUtils.default.arrayEach(e,e=>{e=e.getAsFile();e&&t.push(e)}),t},x=e=>{let v=L.value,g=h.value;e=e.$event;_ui.VxeUI.modal&&(_ui.VxeUI.modal.open({id:r.moreId,title:v?(0,_ui.getI18n)("vxe.upload.morePopup.readTitle"):(0,_ui.getI18n)("vxe.upload.morePopup."+(g?"imageTitle":"fileTitle")),width:660,height:500,escClosable:!0,showMaximize:!0,resize:!0,maskClosable:!0,slots:{default(){var{showErrorStatus:e,dragToUpload:t,dragSort:o,dragPlaceholder:i}=T,{isActivated:l,isDragMove:a,isDragUploadStatus:u,dragIndex:n}=B;let r=B.fileList;var s=P.value,d=D.moreContent||D["more-content"],p={};return t&&-1===n&&(p.onDragover=ue,p.onDragleave=ae,p.onDrop=re),(0,_vue.h)("div",Object.assign({ref:c,class:["vxe-upload--more-popup",{"is--readonly":v,"is--disabled":s,"is--active":l,"show--error":e,"is--drag":u}]},p),d?(0,_vn.getSlotVNs)(d({options:r})):[g?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(a?"":"-disabled"),tag:"div",class:"vxe-upload--image-more-list"},{default:()=>b(r,!0).concat(q(!0))}):(0,_vue.h)("div",{class:"vxe-upload--image-more-list"},b(r,!0).concat(q(!0))):(0,_vue.h)("div",{class:"vxe-upload--file-more-list"},[y(!0),o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(a?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>w(r,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},w(r,!0))]),o?(0,_vue.h)("div",{ref:f,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(O),u?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},i||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(O)])}},onShow(){B.showMorePopup=!0},onHide({$event:e}){B.showMorePopup=!1,e&&z("more-visible",{visible:!1},e)}}),e)&&z("more-visible",{visible:!0},e)},de=(e,t,o)=>{var i,l=B.showMorePopup,a=m.value,u=c.value,u=l?u:a;u&&(a=u.getBoundingClientRect(),u=_.value,i=f.value,l=l?i:u)&&(i=t.getBoundingClientRect(),l.style.display="block",l.style.top=Math.max(1,i.y-a.y)+"px",l.style.left=Math.max(1,i.x-a.x)+"px",l.style.height=i.height+"px",l.style.width=i.width-1+"px",l.setAttribute("drag-pos",o))},pe=()=>{var e=_.value,t=f.value;e&&(e.style.display=""),t&&(t.style.display="")},ve=e=>{e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0);let 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=o=>{o.stopPropagation(),o.preventDefault();var i=B.dragIndex;if(-1!==i){var l=h.value;let t=o.currentTarget;var a=t.parentElement,a=_xeUtils.default.findIndexOf(Array.from(a.children),e=>t===e);let e="";e=l?o.clientX-t.getBoundingClientRect().x<t.clientWidth/2?"left":"right":o.clientY-t.getBoundingClientRect().y<t.clientHeight/2?"top":"bottom",i===a?de(o,t,e):(de(o,t,e),r.prevDragIndex=a,r.prevDragPos=e)}},me=e=>{var{fileList:t,dragIndex:o}=B,{prevDragIndex:i,prevDragPos:l}=r,a="bottom"===l||"right"===l?1:0,u=t[o];let n=t[i];u&&n&&(t.splice(o,1),i=_xeUtils.default.findIndexOf(t,e=>n===e)+a,t.splice(i,0,u),z("sort-dragend",{oldItem:u,newItem:n,dragPos:l,offsetIndex:a,_index:{newIndex:i,oldIndex:o}},e)),pe(),B.dragIndex=-1},ce=e=>{l&&e.stopPropagation(),B.isActivated=!0},_e=e=>{var t=T.pasteToUpload,o=B.isActivated;o&&t&&(o=e.clipboardData||e.originalEvent.clipboardData)&&(t=o.items,t)&&(o=se(t)).length&&(e.preventDefault(),ne(e,o))},fe=e=>{var t=m.value,o=c.value;let i=(0,_dom.getEventTargetNode)(e,t).flag;!i&&o&&(o=(t=o.parentElement||o)&&t.parentElement,i=(0,_dom.getEventTargetNode)(e,o).flag),B.isActivated=i},he=()=>{B.isActivated=!1},xe=o=>{var e=B.fileList;let i=E.value,l=[];return _xeUtils.default.lastEach(e,(t,e)=>{l.push($(o,t,e).then(e=>({url:t[i],status:e})))}),Promise.all(l)},we=(o,e)=>{let i=B.fileList,l=E.value;e=_xeUtils.default.isArray(e)?e:[e];let a=[];return e.forEach(e=>{if(e){let t=_xeUtils.default.isString(e)?e:e[l];e=_xeUtils.default.findIndexOf(i,e=>e[l]===t);-1<e&&a.push($(o,i[e],e).then(e=>({url:t,status:e})))}}),Promise.all(a)};t={dispatchEvent:z,choose(){return v(null)},clear(){return xe(null)},clearByEvent(e){return xe(e)},getPendingFiles(){let{fileList:e,fileCacheMaps:t}=B,o=[];return e.forEach(e=>{e=A(e),e=t[e];e&&"pending"===e.status&&o.push(e.file)}),o},submit(i){var e=T.maxSimultaneousUploads,e=_xeUtils.default.toNumber(e||1)||1;let{fileList:t,fileCacheMaps:l}=B,o=t.filter(e=>{e=A(e),e=l[e];return e&&("pending"===e.status||i&&"error"===e.status)}),a=e=>{var t=A(e),t=l[t];if(t){var o=t.file;if(o&&("pending"===t.status||i&&"error"===t.status))return t.loading=!0,t.percent=0,R(e,o).then(u)}return u()},u=()=>{var e;return o.length?(e=o[0],o.splice(0,1),a(e).then(u)):Promise.resolve()};return Promise.all(o.splice(0,e).map(a)).then(()=>{})},getMoreVisible(){return B.showMorePopup},openMore(){return x({$event:new Event("click")}),(0,_vue.nextTick)()},openMoreByEvent(e){return x({$event:e}),(0,_vue.nextTick)()},closeMore(){return _ui.VxeUI.modal&&_ui.VxeUI.modal.close(r.moreId),(0,_vue.nextTick)()},remove(e){return we(null,e)},removeByEvent(e,t){return we(e,t)}},e={removeFileEvent:$};Object.assign(O,t,e);let w=(e,r)=>{let{showRemoveButton:s,showDownloadButton:d,showProgress:p,progressText:v,showPreview:g,showErrorStatus:m,dragSort:c,autoSubmit:_,showSubmitButton:f}=T,{fileList:h,fileCacheMaps:x}=B,w=P.value,y=L.value,b=V.value,I=F.value,U=D.option,C=D.action,E=D.corner,M=D.name,S={};return c&&1<e.length&&(S.onDragstart=ve,S.onDragover=ge,S.onDragend=me),e.map((i,t)=>{var e=A(i),o=x[e];let l=!1,a=!1,u=!1;var n=""+(i[b]||"");return o&&(l=o.loading,a="error"===o.status,u="pending"===o.status),(0,_vue.h)("div",Object.assign({key:c?e:t,class:["vxe-upload--file-item",{"is--preview":g,"is--loading":l,"is--pending":u,"is--error":a}],fileid:e,draggable:!!c||null},S),U?(0,_vn.getSlotVNs)(U({option:i,isMoreView:r,options:h})):[(0,_vue.h)("div",{class:"vxe-upload--file-item-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_"+(""+i[I]).toLocaleUpperCase()]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),(0,_vue.h)("div",{class:"vxe-upload--file-item-name",title:n,onClick(e){var t,o;l||a||(t=i,o=T.previewMethod||(0,_ui.getConfig)().upload.previewMethod,T.showPreview&&(o?o({$upload:O,option:t}):te(t)))}},M?(0,_vn.getSlotVNs)(M({option:i,isMoreView:r,options:h})):n),l?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(O),p&&l&&o?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-text"},v?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(v)?v({}):v),{percent:o.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[o.percent])):(0,_ui.renderEmptyElement)(O),!l&&(a&&m||u&&f&&!_)?(0,_vue.h)("div",{class:"vxe-upload--file-item-rebtn"},[(0,_vue.h)(_button.default,{icon:a?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:a?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload"),onClick(e){oe(e,i)}})]):(0,_ui.renderEmptyElement)(O),(0,_vue.h)("div",{class:"vxe-upload--file-item-btn-wrapper"},C?(0,_vn.getSlotVNs)(C({option:i,isMoreView:r,options:h,readonly:y})):[E?(0,_vue.h)("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(E({option:i,isMoreView:r,options:h,readonly:y}))):(0,_ui.renderEmptyElement)(O),!d||l||u?(0,_ui.renderEmptyElement)(O):(0,_vue.h)("div",{class:"vxe-upload--file-item-download-btn",onClick(e){((t,o)=>{var e=T.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;let i=T.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!e||e({$upload:O,option:o})).then(e=>{e?i?Promise.resolve(i({$upload:O,option:o})).then(()=>{le(t,o)}).catch(e=>e):le(t,o):z("download-fail",{option:o},t)})})(e,i)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]),!s||y||w||l?(0,_ui.renderEmptyElement)(O):(0,_vue.h)("div",{class:"vxe-upload--file-item-remove-btn",onClick(e){$(e,i,t)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},y=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=T,n=B.fileList,r=P.value,s=L.value,d=K.value,p=J.value,v=X.value,g=D.default,m=D.tip||D.hint;return s||!t?(0,_ui.renderEmptyElement)(O):(0,_vue.h)("div",{class:"vxe-upload--file-action"},[u&&v?(0,_ui.renderEmptyElement)(O):(0,_vue.h)("div",{class:"vxe-upload--file-action-btn",onClick:ie},g?(0,_vn.getSlotVNs)(g({isMoreView:e,options:n,$upload:O})):[(0,_vue.h)(_button.default,{class:"vxe-upload--file-action-button",content:e||l?o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:a?i||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:r})]),d&&(p||m)?(0,_vue.h)("div",{class:"vxe-upload--file-action-tip"},m?(0,_vn.getSlotVNs)(m({isMoreView:e,options:n,$upload:O})):""+p):(0,_ui.renderEmptyElement)(O)])},b=(e,n)=>{let{showRemoveButton:r,showProgress:s,progressText:d,showPreview:p,showErrorStatus:v,dragSort:g,autoSubmit:m,showSubmitButton:c}=T,{fileList:_,fileCacheMaps:f}=B,h=P.value,x=L.value,w=u.value,y=Z.value,b=D.option,I=D.action,U=D.corner,C={onMousedown:ce};return g&&1<e.length&&(C.onDragstart=ve,C.onDragover=ge,C.onDragend=me),e.map((t,o)=>{var e=A(t),i=f[e];let l=!1,a=!1,u=!1;return i&&(l=i.loading,a="error"===i.status,u="pending"===i.status),(0,_vue.h)("div",Object.assign({key:g?e:o,class:["vxe-upload--image-item",{"is--preview":p,"is--circle":w.circle,"is--loading":l,"is--pending":u,"is--error":a}],fileid:e,draggable:!!g||null},C),b?(0,_vn.getSlotVNs)(b({option:t,isMoreView:n,options:_})):[(0,_vue.h)("div",{class:"vxe-upload--image-item-box",style:n?null:y,onClick(e){l||a||((e,t)=>{var o=T.showDownloadButton;let i=B.fileList;var l=Q.value,a=T.previewMethod||(0,_ui.getConfig)().upload.previewMethod;let u=T.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;T.showPreview&&(a?a({$upload:O,option:e}):_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage(Object.assign(Object.assign({},l),{urlList:i.map(e=>k(e)),activeIndex:t,showDownloadButton:o,beforeDownloadMethod:u?({index:e})=>u({$upload:O,option:i[e]}):void 0})))})(t,o)}},[l&&i?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading"},[(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),s?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-text"},d?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(d)?d({}):d),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(O)]):(0,_ui.renderEmptyElement)(O),(0,_vue.h)("div",{class:"vxe-upload--image-item-img-wrapper",title:(0,_ui.getI18n)("vxe.upload.viewItemTitle")},[(0,_vue.h)("img",{class:"vxe-upload--image-item-img",src:(e=t,(i=T.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod)?i({$upload:O,option:e}):k(e))})]),!l&&(a&&v||u&&c&&!m)?(0,_vue.h)("div",{class:"vxe-upload--image-item-rebtn"},[(0,_vue.h)(_button.default,{icon:a?(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD:(0,_ui.getIcon)().UPLOAD_IMAGE_UPLOAD,mode:"text",status:"primary",content:a?(0,_ui.getI18n)("vxe.upload.reUpload"):(0,_ui.getI18n)("vxe.upload.manualUpload"),onClick(e){oe(e,t)}})]):(0,_ui.renderEmptyElement)(O),(0,_vue.h)("div",{class:"vxe-upload--image-item-btn-wrapper",onClick(e){e.stopPropagation()}},I?(0,_vn.getSlotVNs)(I({option:t,isMoreView:n,options:_,readonly:x})):[U?(0,_vue.h)("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(U({option:t,isMoreView:n,options:_,readonly:x}))):(0,_ui.renderEmptyElement)(O),!r||x||h||l?(0,_ui.renderEmptyElement)(O):(0,_vue.h)("div",{class:"vxe-upload--image-item-remove-btn",onClick(e){e.stopPropagation(),$(e,t,o)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},q=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=T,n=B.fileList,r=L.value,s=K.value,d=J.value,p=X.value,v=Z.value,g=D.default,m=D.tip||D.hint;return r||!t||u&&p?(0,_ui.renderEmptyElement)(O):(0,_vue.h)("div",{key:"action",class:"vxe-upload--image-action"},[(0,_vue.h)("div",{class:"vxe-upload--image-action-btn",onClick:ie},g?g({isMoreView:e,options:n,$upload:O}):[(0,_vue.h)("div",{class:"vxe-upload--image-action-box",style:e?null:v},[a?(0,_vue.h)("div",{class:"vxe-upload--image-action-icon"},[(0,_vue.h)("i",{class:i||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_ui.renderEmptyElement)(O),e||l?(0,_vue.h)("div",{class:"vxe-upload--image-action-content"},o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_ui.renderEmptyElement)(O),s&&(d||m)?(0,_vue.h)("div",{class:"vxe-upload--image-action-hint"},m?(0,_vn.getSlotVNs)(m({isMoreView:e,options:n,$upload:O})):""+d):(0,_ui.renderEmptyElement)(O)])])])};let o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>T.modelValue?T.modelValue.length:0,()=>{o.value++}),(0,_vue.watch)(()=>T.modelValue,()=>{o.value++}),(0,_vue.watch)(o,()=>{s()}),(0,_vue.onMounted)(()=>{T.multiple&&T.singleMode&&errLog("vxe.error.errConflicts",["multiple","single-mode"]),T.imageStyle&&warnLog("vxe.error.delProp",["image-style","image-config"]),T.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(O,"paste",_e),_ui.globalEvents.on(O,"click",fe),_ui.globalEvents.on(O,"blur",he)}),(0,_vue.onBeforeUnmount)(()=>{B.isDragUploadStatus=!1,_ui.globalEvents.off(O,"paste"),_ui.globalEvents.off(O,"click"),_ui.globalEvents.off(O,"blur"),_xeUtils.default.assign(B,createReactData()),_xeUtils.default.assign(r,createInternalData())}),s(),O.renderVN=()=>{var{showErrorStatus:e,dragToUpload:t,pasteToUpload:o,dragSort:i,dragPlaceholder:l}=T,{isDragUploadStatus:a,showMorePopup:u,isActivated:n,dragIndex:r}=B,s=G.value,d=P.value,p=L.value,v=h.value,g={onMousedown:ce};return t&&-1===r&&(g.onDragover=ue,g.onDragleave=ae,g.onDrop=re),(0,_vue.h)("div",Object.assign({ref:m,class:["vxe-upload",{["size--"+s]:s,"is--active":n,"is--readonly":p,"is--disabled":d,"is--paste":o,"show--error":e,"is--drag":a}]},g),[(v?()=>{var{showList:e,dragSort:t}=T;let{fileList:o,isDragMove:i}=B;var l=ee.value;let a=D.moreButton||D["more-button"],{maxCount:u,showMoreButton:n,moreButtonText:r}=l,s=o,d=0,p=!1,v=!1;return _xeUtils.default.isNumber(u)&&o.length>u&&(p=!0,v=0===u,d=o.length-u,s=o.slice(0,u)),(0,_vue.h)("div",{key:"image",class:"vxe-upload--image-wrapper"},e?[t?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(i?"":"-disabled"),tag:"div",class:"vxe-upload--image-list"},{default:()=>b(s,!1).concat([n&&d?(0,_vue.h)("div",{key:"om",class:"vxe-upload--image-over-more"},a?(0,_vn.getSlotVNs)(a({options:o})):[(0,_vue.h)(_button.default,{mode:"text",content:r?_xeUtils.default.isFunction(r)?r({$upload:O,options:o}):_xeUtils.default.toFormatString(r,[o.length]):(0,_ui.getI18n)(p&&v?"vxe.upload.moreImgBtnText":"vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:x})]):(0,_ui.renderEmptyElement)(O),q(!1)])}):(0,_vue.h)("div",{class:"vxe-upload--image-list"},b(s,!1).concat([n&&d?(0,_vue.h)("div",{class:"vxe-upload--image-over-more"},a?(0,_vn.getSlotVNs)(a({options:o})):[(0,_vue.h)(_button.default,{mode:"text",content:r?_xeUtils.default.isFunction(r)?r({$upload:O,options:o}):_xeUtils.default.toFormatString(r,[o.length]):(0,_ui.getI18n)(p&&v?"vxe.upload.moreImgBtnText":"vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:x})]):(0,_ui.renderEmptyElement)(O),q(!1)]))]:[(0,_vue.h)("div",{class:"vxe-upload--image-list"},[q(!1)])])}:()=>{var{showList:e,moreConfig:t,dragSort:o}=T,{fileList:i,isDragMove:l}=B,{maxCount:a,showMoreButton:u,layout:n,moreButtonText:r}=ee.value,n="horizontal"===n,s=D.moreButton||D["more-button"];let d=i,p=0,v=!1,g=!1;return _xeUtils.default.isNumber(a)&&i.length>a&&(v=!0,g=0===a,p=i.length-a,d=i.slice(0,a)),(0,_vue.h)("div",{key:"all",class:"vxe-upload--file-wrapper"},e?[u&&t&&n?(0,_ui.renderEmptyElement)(O):y(!0),(0,_vue.h)("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":n}]},[d.length?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>w(d,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},w(d,!1)):(0,_ui.renderEmptyElement)(O),u&&p?(0,_vue.h)("div",{class:"vxe-upload--file-over-more"},s?(0,_vn.getSlotVNs)(s({options:i})):[(0,_vue.h)(_button.default,{mode:"text",content:r?_xeUtils.default.isFunction(r)?r({$upload:O,options:i}):_xeUtils.default.toFormatString(r,[i.length]):(0,_ui.getI18n)(v&&g?"vxe.upload.moreFileBtnText":"vxe.upload.moreBtnText",[i.length]),status:"primary",onClick:x})]):(0,_ui.renderEmptyElement)(O),u&&t&&n?y(!1):(0,_ui.renderEmptyElement)(O)])]:[y(!1)])})(),i?(0,_vue.h)("div",{ref:_,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(O),a&&!u?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},l||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(O)])},O},render(){return this.renderVN()}});
|
package/package.json
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { h, computed, reactive, inject, PropType } from 'vue'
|
|
1
|
+
import { h, computed, reactive, inject, PropType, onMounted } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { getFuncText } from '../../ui/src/utils'
|
|
5
5
|
import { getConfig, createEvent, useSize, renderEmptyElement } from '../../ui'
|
|
6
|
+
import { createComponentLog } from '../../ui/src/log'
|
|
6
7
|
|
|
7
8
|
import type { VxeCheckboxButtonPropTypes, VxeCheckboxGroupConstructor, CheckboxButtonReactData, CheckboxButtonPrivateMethods, VxeCheckboxButtonConstructor, VxeCheckboxButtonEmits, VxeCheckboxGroupPrivateMethods, CheckboxButtonMethods, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines } from '../../../types'
|
|
8
9
|
|
|
10
|
+
const { warnLog } = createComponentLog('checkbox-button')
|
|
11
|
+
|
|
9
12
|
export default defineVxeComponent({
|
|
10
13
|
name: 'VxeCheckboxButton',
|
|
11
14
|
props: {
|
|
12
15
|
modelValue: [String, Number, Boolean] as PropType<VxeCheckboxButtonPropTypes.ModelValue>,
|
|
13
16
|
/**
|
|
14
17
|
* 已废弃,被 checkedValue 替换
|
|
18
|
+
* @deprecated
|
|
15
19
|
*/
|
|
16
20
|
label: {
|
|
17
21
|
type: [String, Number, Boolean] as PropType<VxeCheckboxButtonPropTypes.Label>,
|
|
@@ -204,6 +208,12 @@ export default defineVxeComponent({
|
|
|
204
208
|
])
|
|
205
209
|
}
|
|
206
210
|
|
|
211
|
+
onMounted(() => {
|
|
212
|
+
if (props.label !== null) {
|
|
213
|
+
warnLog('vxe.error.delProp', ['label', 'checked-value'])
|
|
214
|
+
}
|
|
215
|
+
})
|
|
216
|
+
|
|
207
217
|
$xeCheckboxButton.renderVN = renderVN
|
|
208
218
|
|
|
209
219
|
return renderVN
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
import { h, computed, inject, PropType, reactive } from 'vue'
|
|
1
|
+
import { h, computed, inject, PropType, reactive, onMounted } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { getFuncText } from '../../ui/src/utils'
|
|
5
5
|
import { getConfig, createEvent, useSize, getIcon, renderEmptyElement } from '../../ui'
|
|
6
|
+
import { createComponentLog } from '../../ui/src/log'
|
|
6
7
|
|
|
7
8
|
import type { VxeCheckboxConstructor, VxeCheckboxGroupConstructor, CheckboxReactData, VxeCheckboxEmits, ValueOf, VxeCheckboxGroupPrivateMethods, CheckboxMethods, VxeCheckboxPropTypes, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines } from '../../../types'
|
|
8
9
|
|
|
10
|
+
const { warnLog } = createComponentLog('checkbox')
|
|
11
|
+
|
|
9
12
|
export default defineVxeComponent({
|
|
10
13
|
name: 'VxeCheckbox',
|
|
11
14
|
props: {
|
|
12
15
|
modelValue: [String, Number, Boolean] as PropType<VxeCheckboxPropTypes.ModelValue>,
|
|
16
|
+
/**
|
|
17
|
+
* 已废弃,被 checkedValue 替换
|
|
18
|
+
* @deprecated
|
|
19
|
+
*/
|
|
13
20
|
label: {
|
|
14
21
|
type: [String, Number] as PropType<VxeCheckboxPropTypes.Label>,
|
|
15
22
|
default: null
|
|
@@ -61,9 +68,15 @@ export default defineVxeComponent({
|
|
|
61
68
|
|
|
62
69
|
const { computeSize } = useSize(props)
|
|
63
70
|
|
|
71
|
+
const computeCheckValue = computed(() => {
|
|
72
|
+
const { checkedValue, label } = props
|
|
73
|
+
return XEUtils.isUndefined(checkedValue) ? label : checkedValue
|
|
74
|
+
})
|
|
75
|
+
|
|
64
76
|
const computeIsChecked = computed(() => {
|
|
77
|
+
const checkValue = computeCheckValue.value
|
|
65
78
|
if ($xeCheckboxGroup) {
|
|
66
|
-
return XEUtils.includes($xeCheckboxGroup.props.modelValue,
|
|
79
|
+
return XEUtils.includes($xeCheckboxGroup.props.modelValue, checkValue)
|
|
67
80
|
}
|
|
68
81
|
return props.modelValue === props.checkedValue
|
|
69
82
|
})
|
|
@@ -84,15 +97,18 @@ export default defineVxeComponent({
|
|
|
84
97
|
})
|
|
85
98
|
|
|
86
99
|
const changeEvent = (evnt: Event & { target: { checked: boolean } }) => {
|
|
87
|
-
const {
|
|
100
|
+
const { uncheckedValue } = props
|
|
88
101
|
const isDisabled = computeIsDisabled.value
|
|
102
|
+
const checkValue = computeCheckValue.value
|
|
89
103
|
if (!isDisabled) {
|
|
90
104
|
const checked = evnt.target.checked
|
|
91
|
-
const value = checked ? checkedValue : uncheckedValue
|
|
92
|
-
const params = { checked, value, label: props.label }
|
|
93
105
|
if ($xeCheckboxGroup) {
|
|
106
|
+
const value = checkValue
|
|
107
|
+
const params = { checked, value, label: value }
|
|
94
108
|
$xeCheckboxGroup.handleChecked(params, evnt)
|
|
95
109
|
} else {
|
|
110
|
+
const value = checked ? checkValue : uncheckedValue
|
|
111
|
+
const params = { checked, value, label: value }
|
|
96
112
|
emit('update:modelValue', value)
|
|
97
113
|
checkboxMethods.dispatchEvent('change', params, evnt)
|
|
98
114
|
// 自动更新校验状态
|
|
@@ -114,10 +130,11 @@ export default defineVxeComponent({
|
|
|
114
130
|
Object.assign($xeCheckbox, checkboxMethods)
|
|
115
131
|
|
|
116
132
|
const renderVN = () => {
|
|
117
|
-
const {
|
|
133
|
+
const { content } = props
|
|
118
134
|
const vSize = computeSize.value
|
|
119
135
|
const isDisabled = computeIsDisabled.value
|
|
120
136
|
const isChecked = computeIsChecked.value
|
|
137
|
+
const checkValue = computeCheckValue.value
|
|
121
138
|
const indeterminate = !isChecked && props.indeterminate
|
|
122
139
|
const defaultSlot = slots.default
|
|
123
140
|
|
|
@@ -141,7 +158,7 @@ export default defineVxeComponent({
|
|
|
141
158
|
}
|
|
142
159
|
}
|
|
143
160
|
return h('label', {
|
|
144
|
-
key:
|
|
161
|
+
key: `${checkValue}`,
|
|
145
162
|
class: ['vxe-checkbox vxe-checkbox--default', {
|
|
146
163
|
[`size--${vSize}`]: vSize,
|
|
147
164
|
'is--indeterminate': indeterminate,
|
|
@@ -166,6 +183,12 @@ export default defineVxeComponent({
|
|
|
166
183
|
])
|
|
167
184
|
}
|
|
168
185
|
|
|
186
|
+
onMounted(() => {
|
|
187
|
+
if (props.label !== null) {
|
|
188
|
+
warnLog('vxe.error.delProp', ['label', 'checked-value'])
|
|
189
|
+
}
|
|
190
|
+
})
|
|
191
|
+
|
|
169
192
|
$xeCheckbox.renderVN = renderVN
|
|
170
193
|
|
|
171
194
|
return $xeCheckbox
|