vxe-pc-ui 3.14.27 → 3.14.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/es/date-panel/src/date-panel.js +11 -10
  2. package/es/date-panel/style.css +4 -0
  3. package/es/date-panel/style.min.css +1 -1
  4. package/es/date-range-picker/src/date-range-picker.js +17 -0
  5. package/es/select/src/select.js +4 -1
  6. package/es/style.css +1 -1
  7. package/es/style.min.css +1 -1
  8. package/es/table-select/src/table-select.js +4 -1
  9. package/es/tree-select/src/tree-select.js +4 -1
  10. package/es/ui/index.js +1 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/es/upload/src/upload.js +53 -3
  13. package/es/vxe-date-panel/style.css +4 -0
  14. package/es/vxe-date-panel/style.min.css +1 -1
  15. package/lib/date-panel/src/date-panel.js +46 -10
  16. package/lib/date-panel/src/date-panel.min.js +1 -1
  17. package/lib/date-panel/style/style.css +4 -0
  18. package/lib/date-panel/style/style.min.css +1 -1
  19. package/lib/date-range-picker/src/date-range-picker.js +21 -3
  20. package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
  21. package/lib/index.umd.js +148 -23
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/select/src/select.js +6 -1
  24. package/lib/select/src/select.min.js +1 -1
  25. package/lib/style.css +1 -1
  26. package/lib/style.min.css +1 -1
  27. package/lib/table-select/src/table-select.js +4 -1
  28. package/lib/table-select/src/table-select.min.js +1 -1
  29. package/lib/tree-select/src/tree-select.js +4 -1
  30. package/lib/tree-select/src/tree-select.min.js +1 -1
  31. package/lib/ui/index.js +1 -1
  32. package/lib/ui/index.min.js +1 -1
  33. package/lib/ui/src/log.js +1 -1
  34. package/lib/ui/src/log.min.js +1 -1
  35. package/lib/upload/src/upload.js +65 -5
  36. package/lib/upload/src/upload.min.js +1 -1
  37. package/lib/vxe-date-panel/style/style.css +4 -0
  38. package/lib/vxe-date-panel/style/style.min.css +1 -1
  39. package/package.json +1 -1
  40. package/packages/date-panel/src/date-panel.ts +11 -10
  41. package/packages/date-range-picker/src/date-range-picker.ts +18 -0
  42. package/packages/select/src/select.ts +4 -1
  43. package/packages/table-select/src/table-select.ts +4 -1
  44. package/packages/tree-select/src/tree-select.ts +4 -1
  45. package/packages/upload/src/upload.ts +73 -5
  46. package/styles/components/date-panel.scss +4 -0
  47. package/types/components/date-panel.d.ts +7 -0
  48. package/types/components/upload.d.ts +36 -1
  49. /package/es/icon/{iconfont.1780477610393.ttf → iconfont.1780570410811.ttf} +0 -0
  50. /package/es/icon/{iconfont.1780477610393.woff → iconfont.1780570410811.woff} +0 -0
  51. /package/es/icon/{iconfont.1780477610393.woff2 → iconfont.1780570410811.woff2} +0 -0
  52. /package/es/{iconfont.1780477610393.ttf → iconfont.1780570410811.ttf} +0 -0
  53. /package/es/{iconfont.1780477610393.woff → iconfont.1780570410811.woff} +0 -0
  54. /package/es/{iconfont.1780477610393.woff2 → iconfont.1780570410811.woff2} +0 -0
  55. /package/lib/icon/style/{iconfont.1780477610393.ttf → iconfont.1780570410811.ttf} +0 -0
  56. /package/lib/icon/style/{iconfont.1780477610393.woff → iconfont.1780570410811.woff} +0 -0
  57. /package/lib/icon/style/{iconfont.1780477610393.woff2 → iconfont.1780570410811.woff2} +0 -0
  58. /package/lib/{iconfont.1780477610393.ttf → iconfont.1780570410811.ttf} +0 -0
  59. /package/lib/{iconfont.1780477610393.woff → iconfont.1780570410811.woff} +0 -0
  60. /package/lib/{iconfont.1780477610393.woff2 → iconfont.1780570410811.woff2} +0 -0
@@ -37,7 +37,10 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
37
37
  },
38
38
  props: {
39
39
  value: [String, Number, Array],
40
- clearable: Boolean,
40
+ clearable: {
41
+ type: Boolean,
42
+ default: (0, _ui.getConfig)().tableSelect.clearable
43
+ },
41
44
  placeholder: {
42
45
  type: String,
43
46
  default: function _default() {
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,exports.getRowUniqueId=getRowUniqueId;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_utils=require("../../ui/src/utils"),_log=require("../../ui/src/log"),_input=_interopRequireDefault(require("../../input/src/input"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function getRowUniqueId(){return _xeUtils.default.uniqueId("row_")}function createInternalData(){return{fullRowMaps:{}}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTableSelect",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:[String,Number,Array],clearable:Boolean,placeholder:{type:String,default:function(){return _xeUtils.default.eqNull((0,_ui.getConfig)().tableSelect.placeholder)?(0,_ui.getI18n)("vxe.base.pleaseSelect"):(0,_ui.getConfig)().tableSelect.placeholder}},readonly:{type:Boolean,default:null},loading:Boolean,disabled:{type:Boolean,default:null},multiple:Boolean,className:[String,Function],prefixIcon:String,placement:String,columns:Array,options:Array,optionProps:Object,lazyOptions:Array,zIndex:Number,size:{type:String,default:function(){return(0,_ui.getConfig)().tableSelect.size||(0,_ui.getConfig)().size}},popupConfig:Object,gridConfig:Object,transfer:{type:Boolean,default:null}},inject:{$xeModal:{default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},provide:function(){return{$xeTableSelect:this}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1,tableColumns:[],fullOptionList:[],panelIndex:0,panelStyle:{},panelPlacement:null,triggerFocusPanel:!1,visiblePanel:!1,isAniVisible:!1,isActivated:!1},internalData:createInternalData(),gridEvents:{}}},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeBtnTransfer:function(){var e=this,t=e.$xeForm,n=e.$xeTable,i=e.$xeModal,a=e.$xeDrawer,l=e.transfer,e=e.computePopupOpts;if(_xeUtils.default.isBoolean(e.transfer))return e.transfer;if(null===l){e=(0,_ui.getConfig)().tableSelect.transfer;if(_xeUtils.default.isBoolean(e))return e;if(n||i||a||t)return!0}return l},computePropsOpts:function(){return this.optionProps||{}},computeRowOpts:function(){var e=this.computeGridOpts;return Object.assign({},e.rowConfig,{isCurrent:!0})},computeRowKeyField:function(){return this.computeRowOpts.keyField||"_X_ROW_KEY"},computeLabelField:function(){return this.computePropsOpts.label||"label"},computeValueField:function(){return this.computePropsOpts.value||"value"},computePopupOpts:function(){return Object.assign({},(0,_ui.getConfig)().tableSelect.popupConfig,this.popupConfig)},computeGridOpts:function(){return Object.assign({},(0,_ui.getConfig)().tableSelect.gridConfig,this.gridConfig,{data:void 0})},computeSelectGridOpts:function(){var a=this,e=a.computeGridOpts,l=e.pagerConfig,t=e.proxyConfig;if(t){var n,o,r,i=t.ajax;if(i&&i.query)return n=_xeUtils.default.clone(t,!0),(o=i.query)&&(r=t.response||t.props||{},Object.assign(n.ajax,{query:function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Promise.resolve(o.apply(void 0,[e].concat(n))).then(function(e){var t,n=[];return n=l?(t=r.result,(_xeUtils.default.isFunction(t)?t({data:e,$table:null,$grid:null,$gantt:null}):_xeUtils.default.get(e,t||"result"))||[]):((t=r.list)?_xeUtils.default.isFunction(t)?t({data:e,$table:null,$grid:null,$gantt:null}):_xeUtils.default.get(e,t):e)||[],a.cacheDataMap(n||[]),e})}})),Object.assign({},e,{proxyConfig:n})}return e},computeSelectLabel:function(){var e=this,t=e.reactData,n=e.value,i=e.lazyOptions,t=t.fullOptionList,a=e.internalData.fullRowMaps,l=e.computeValueField,o=e.computeLabelField;return t?(_xeUtils.default.isArray(n)?n:[n]).map(function(t){var e=a[t];if(e)return e.item[o];if(i){e=i.find(function(e){return e[l]===t});if(e)return e[o]}return t}).join(", "):""},computePopupWrapperStyle:function(){var e=this.computePopupOpts,t=e.height,e=e.width,n={};return e&&(n.width=(0,_dom.toCssUnit)(e)),t&&(n.height=(0,_dom.toCssUnit)(t)),n}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$tableSelect:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},getRowid:function(e){e=e[this.computeRowKeyField];return e?encodeURIComponent(e):""},getRowsByValue:function(e){var t=this.internalData.fullRowMaps,n=[];return(_xeUtils.default.eqNull(e)?[]:_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){e=t[e];e&&n.push(e.item)}),n},updateModel:function(n){var i=this,a=i.multiple;i.$nextTick(function(){var e,t=i.$refs.refGrid;t&&(e=i.getRowsByValue(n)).length&&(a?t.setCheckboxRow(e,!0):t.setRadioRow(e[0]))})},loadTableColumn:function(e){var t,n,i,a,l=this.reactData;e&&e.length&&(t=this.multiple,a=i=!(n=[]),e.forEach(function(e){i||"radio"!==e.type?a||"checkbox"!==e.type||(a=!0):i=!0,n.push(e)}),t?a||n.unshift({type:"checkbox",width:70}):i||n.unshift({type:"radio",width:70}),l.tableColumns=n)},cacheDataMap:function(e){var a=this,t=a,n=a.reactData,i=a.internalData,l=t.options,o=a.computeRowKeyField,r=a.computeValueField,u=a.computeGridOpts,s=u.treeConfig,u=u.pagerConfig,c={},p={};s||_xeUtils.default.arrayEach(e||l||[],function(e,t,n){var i=(i=a.getRowid(e))||getRowUniqueId(),i=(p[i]&&(0,_log.errLog)("vxe.error.repeatKey",["[table-select] ".concat(o),i]),p[i]=!0,e[r]);c[i]&&(0,_log.errLog)("vxe.error.repeatKey",["[table-select] ".concat(r),i]),c[i]={item:e,index:t,items:n,parent:null,nodes:[]}}),n.fullOptionList=e||l||[],i.fullRowMaps=u?Object.assign({},i.fullRowMaps,c):c,a.updateModel(t.value)},updateZindex:function(){var e=this.reactData,t=this.computePopupOpts.zIndex||this.zIndex;t?e.panelIndex=_xeUtils.default.toNumber(t):e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updatePlacement:function(){function e(){var e=(0,_dom.updatePanelPlacement)(l,o,{placement:u.placement||i,defaultPlacement:u.defaultPlacement,teleportTo:r}),t=Object.assign(e.style,{zIndex:a});n.panelStyle=t,n.panelPlacement=e.placement}var t=this,n=t.reactData,i=t.placement,a=n.panelIndex,l=t.$refs.refElem,o=t.$refs.refOptionPanel,r=t.computeBtnTransfer,u=t.computePopupOpts;return e(),t.$nextTick().then(e)},showOptionPanel:function(){var e,t,n=this,i=n,a=n.reactData,l=n.internalData;i.loading||n.computeIsDisabled||(l.vpTimeout&&clearTimeout(l.vpTimeout),l.hpTimeout&&clearTimeout(l.hpTimeout),a.initialized||(a.initialized=!0,e=n.computeBtnTransfer,t=n.$refs.refOptionPanel,e&&t&&document.body.appendChild(t)),a.isActivated=!0,a.isAniVisible=!0,l.vpTimeout=setTimeout(function(){a.visiblePanel=!0,n.updateModel(i.value),l.vpTimeout=void 0,n.updatePlacement()},10),n.updateZindex(),n.updatePlacement())},hideOptionPanel:function(){var e=this.reactData,t=this.internalData;e.visiblePanel=!1,t.hpTimeout=setTimeout(function(){e.isAniVisible=!1},350)},changeEvent:function(e,t,n){var i=this,a=i,l=i.$xeForm,o=i.formItemInfo;i.emitModel(t),t!==a.value&&(i.dispatchEvent("change",{value:t,row:n,option:n},e),l)&&o&&l.triggerItemEvent(e,o.itemConfig.field,t)},clearValueEvent:function(e,t){this.changeEvent(e,t,null),this.dispatchEvent("clear",{value:t},e)},clearEvent:function(e,t){var n=this.$refs.refGrid;n&&(n.clearRadioRow(),n.clearCheckboxRow()),this.clearValueEvent(t,null),this.hideOptionPanel()},handleGlobalMousewheelEvent:function(e){var t=this,n=t.reactData.visiblePanel;t.computeIsDisabled||n&&(n=t.$refs.refOptionPanel,(0,_dom.getEventTargetNode)(e,n).flag?t.updatePlacement():t.hideOptionPanel())},handleGlobalMousedownEvent:function(e){var t,n,i=this,a=i.reactData,l=a.visiblePanel;i.computeIsDisabled||(t=i.$refs.refElem,n=i.$refs.refOptionPanel,a.isActivated=(0,_dom.getEventTargetNode)(e,t).flag||(0,_dom.getEventTargetNode)(e,n).flag,l&&!a.isActivated&&i.hideOptionPanel())},handleGlobalBlurEvent:function(){var e=this.reactData,t=e.visiblePanel,n=e.isActivated;t&&this.hideOptionPanel(),n&&(e.isActivated=!1),(t||n)&&(e=this.$refs.refInput)&&e.blur()},handleGlobalResizeEvent:function(){this.reactData.visiblePanel&&this.updatePlacement()},focusEvent:function(e){var t=this.reactData;this.computeIsDisabled||t.visiblePanel||(t.triggerFocusPanel=!0,this.showOptionPanel(),setTimeout(function(){t.triggerFocusPanel=!1},150)),this.dispatchEvent("focus",{},e)},clickEvent:function(e){this.togglePanelEvent(e),this.dispatchEvent("click",{},e)},blurEvent:function(e){this.reactData.isActivated=!1,this.dispatchEvent("blur",{},e)},togglePanelEvent:function(e){var t=this.reactData;e.$event.preventDefault(),t.triggerFocusPanel?t.triggerFocusPanel=!1:t.visiblePanel?this.hideOptionPanel():this.showOptionPanel()},radioChangeEvent:function(e){var t=e.$event,e=e.row,n=e[this.computeValueField];this.changeEvent(t,n,e),this.hideOptionPanel()},checkboxChangeEvent:function(e){var t=e.$grid,n=e.$event,e=e.row,i=this.computeValueField;t&&(t=t.getCheckboxRecords().map(function(e){return e[i]}),this.changeEvent(n,t,e))},checkboxAllEvent:function(e){this.checkboxChangeEvent(e)},renderVN:function(e){var t=_ui.VxeUI.getComponent("vxe-grid"),n=this,i=n,a=n.$scopedSlots,l=n.reactData,o=i.className,r=i.options,u=i.loading,s=l.initialized,c=l.isActivated,p=l.isAniVisible,d=l.visiblePanel,f=l.tableColumns,v=n.computeSize,m=n.computeIsDisabled,h=n.computeSelectLabel,g=n.computeBtnTransfer,b=n.computeSelectGridOpts,x=n.computeRowOpts,_=n.computePopupWrapperStyle,y=a.header,E=a.footer,P=a.prefix,O=n.computePopupOpts.className;return n.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-table-select--readonly",o]},[e("span",{class:"vxe-table-select-label"},h)]):e("div",{ref:"refElem",class:["vxe-table-select",o?_xeUtils.default.isFunction(o)?o({$tableSelect:n}):o:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(v),v),"is--visible",d),"is--disabled",m),"is--loading",u),"is--active",c)]},[e(_input.default,{ref:"refInput",props:{clearable:i.clearable,placeholder:i.placeholder,editable:!1,disabled:m,type:"text",prefixIcon:i.prefixIcon,suffixIcon:u?(0,_ui.getIcon)().TABLE_SELECT_LOADED:d?(0,_ui.getIcon)().TABLE_SELECT_OPEN:(0,_ui.getIcon)().TABLE_SELECT_CLOSE,value:u?(0,_ui.getI18n)("vxe.select.loadingText"):h},on:{clear:n.clearEvent,click:n.clickEvent,focus:n.focusEvent,blur:n.blurEvent,"suffix-click":n.togglePanelEvent},scopedSlots:P?{prefix:function(){return P({})}}:{}}),e("div",{ref:"refOptionPanel",class:["vxe-table--ignore-clear vxe-table-select--panel",O?_xeUtils.default.isFunction(O)?O({$tableSelect:n}):O:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(v),v),"is--transfer",g),"ani--leave",!u&&p),"ani--enter",!u&&d)],attrs:{placement:l.panelPlacement},style:l.panelStyle},s?[e("div",{class:"vxe-table-select--panel-wrapper"},[y?e("div",{class:"vxe-table-select--panel-header"},y({})):(0,_ui.renderEmptyElement)(n),e("div",{class:"vxe-table-select--panel-body"},[e("div",{ref:"refGridWrapper",class:"vxe-table-select-grid--wrapper",style:_},[t?e(t,{ref:"refGrid",class:"vxe-table-select--grid",props:Object.assign(Object.assign({},b),{rowConfig:x,data:r,columns:f.length?f:b.columns,height:"100%",autoResize:!0}),on:Object.assign(Object.assign({},n.gridEvents),{"radio-change":n.radioChangeEvent,"checkbox-change":n.checkboxChangeEvent,"checkbox-all":n.checkboxAllEvent}),scopedSlots:Object.assign({},a,{header:void 0,footer:void 0,prefixSlot:void 0})}):(0,_ui.renderEmptyElement)(n)])]),E?e("div",{class:"vxe-table-select--panel-footer"},E({})):(0,_ui.renderEmptyElement)(n)])]:[])])}},watch:{options:function(){this.cacheDataMap()},columns:function(e){this.loadTableColumn(e)},value:function(e){this.updateModel(e)}},created:function(){var n=this,e=n,i=n.gridEvents;["form-submit","form-reset","form-collapse","page-change"].forEach(function(t){i[(0,_vn.getOnName)(t)]=function(e){n.dispatchEvent(t,e,e.$event)}}),n.loadTableColumn(e.columns),n.cacheDataMap()},mounted:function(){var e=this,t=e,n=e.reactData,i=_ui.VxeUI.getComponent("vxe-grid"),t=(e.$nextTick(function(){i||(0,_log.errLog)("vxe.error.reqComp",["[table-select] vxe-grid"])}),t.gridConfig);t&&t.proxyConfig&&!1!==t.proxyConfig.autoLoad&&(n.initialized=!0),_ui.globalEvents.on(e,"mousewheel",e.handleGlobalMousewheelEvent),_ui.globalEvents.on(e,"mousedown",e.handleGlobalMousedownEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent),_ui.globalEvents.on(e,"resize",e.handleGlobalResizeEvent)},beforeDestroy:function(){var e=this,t=e.$refs.refOptionPanel;t&&t.parentNode&&t.parentNode.removeChild(t),_ui.globalEvents.off(e,"mousewheel"),_ui.globalEvents.off(e,"mousedown"),_ui.globalEvents.off(e,"blur"),_ui.globalEvents.off(e,"resize")},render:function(e){return this.renderVN(e)}});
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,exports.getRowUniqueId=getRowUniqueId;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_utils=require("../../ui/src/utils"),_log=require("../../ui/src/log"),_input=_interopRequireDefault(require("../../input/src/input"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function getRowUniqueId(){return _xeUtils.default.uniqueId("row_")}function createInternalData(){return{fullRowMaps:{}}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTableSelect",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:[String,Number,Array],clearable:{type:Boolean,default:(0,_ui.getConfig)().tableSelect.clearable},placeholder:{type:String,default:function(){return _xeUtils.default.eqNull((0,_ui.getConfig)().tableSelect.placeholder)?(0,_ui.getI18n)("vxe.base.pleaseSelect"):(0,_ui.getConfig)().tableSelect.placeholder}},readonly:{type:Boolean,default:null},loading:Boolean,disabled:{type:Boolean,default:null},multiple:Boolean,className:[String,Function],prefixIcon:String,placement:String,columns:Array,options:Array,optionProps:Object,lazyOptions:Array,zIndex:Number,size:{type:String,default:function(){return(0,_ui.getConfig)().tableSelect.size||(0,_ui.getConfig)().size}},popupConfig:Object,gridConfig:Object,transfer:{type:Boolean,default:null}},inject:{$xeModal:{default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},provide:function(){return{$xeTableSelect:this}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1,tableColumns:[],fullOptionList:[],panelIndex:0,panelStyle:{},panelPlacement:null,triggerFocusPanel:!1,visiblePanel:!1,isAniVisible:!1,isActivated:!1},internalData:createInternalData(),gridEvents:{}}},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeBtnTransfer:function(){var e=this,t=e.$xeForm,n=e.$xeTable,i=e.$xeModal,a=e.$xeDrawer,l=e.transfer,e=e.computePopupOpts;if(_xeUtils.default.isBoolean(e.transfer))return e.transfer;if(null===l){e=(0,_ui.getConfig)().tableSelect.transfer;if(_xeUtils.default.isBoolean(e))return e;if(n||i||a||t)return!0}return l},computePropsOpts:function(){return this.optionProps||{}},computeRowOpts:function(){var e=this.computeGridOpts;return Object.assign({},e.rowConfig,{isCurrent:!0})},computeRowKeyField:function(){return this.computeRowOpts.keyField||"_X_ROW_KEY"},computeLabelField:function(){return this.computePropsOpts.label||"label"},computeValueField:function(){return this.computePropsOpts.value||"value"},computePopupOpts:function(){return Object.assign({},(0,_ui.getConfig)().tableSelect.popupConfig,this.popupConfig)},computeGridOpts:function(){return Object.assign({},(0,_ui.getConfig)().tableSelect.gridConfig,this.gridConfig,{data:void 0})},computeSelectGridOpts:function(){var a=this,e=a.computeGridOpts,l=e.pagerConfig,t=e.proxyConfig;if(t){var n,o,r,i=t.ajax;if(i&&i.query)return n=_xeUtils.default.clone(t,!0),(o=i.query)&&(r=t.response||t.props||{},Object.assign(n.ajax,{query:function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Promise.resolve(o.apply(void 0,[e].concat(n))).then(function(e){var t,n=[];return n=l?(t=r.result,(_xeUtils.default.isFunction(t)?t({data:e,$table:null,$grid:null,$gantt:null}):_xeUtils.default.get(e,t||"result"))||[]):((t=r.list)?_xeUtils.default.isFunction(t)?t({data:e,$table:null,$grid:null,$gantt:null}):_xeUtils.default.get(e,t):e)||[],a.cacheDataMap(n||[]),e})}})),Object.assign({},e,{proxyConfig:n})}return e},computeSelectLabel:function(){var e=this,t=e.reactData,n=e.value,i=e.lazyOptions,t=t.fullOptionList,a=e.internalData.fullRowMaps,l=e.computeValueField,o=e.computeLabelField;return t?(_xeUtils.default.isArray(n)?n:[n]).map(function(t){var e=a[t];if(e)return e.item[o];if(i){e=i.find(function(e){return e[l]===t});if(e)return e[o]}return t}).join(", "):""},computePopupWrapperStyle:function(){var e=this.computePopupOpts,t=e.height,e=e.width,n={};return e&&(n.width=(0,_dom.toCssUnit)(e)),t&&(n.height=(0,_dom.toCssUnit)(t)),n}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$tableSelect:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},getRowid:function(e){e=e[this.computeRowKeyField];return e?encodeURIComponent(e):""},getRowsByValue:function(e){var t=this.internalData.fullRowMaps,n=[];return(_xeUtils.default.eqNull(e)?[]:_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){e=t[e];e&&n.push(e.item)}),n},updateModel:function(n){var i=this,a=i.multiple;i.$nextTick(function(){var e,t=i.$refs.refGrid;t&&(e=i.getRowsByValue(n)).length&&(a?t.setCheckboxRow(e,!0):t.setRadioRow(e[0]))})},loadTableColumn:function(e){var t,n,i,a,l=this.reactData;e&&e.length&&(t=this.multiple,a=i=!(n=[]),e.forEach(function(e){i||"radio"!==e.type?a||"checkbox"!==e.type||(a=!0):i=!0,n.push(e)}),t?a||n.unshift({type:"checkbox",width:70}):i||n.unshift({type:"radio",width:70}),l.tableColumns=n)},cacheDataMap:function(e){var a=this,t=a,n=a.reactData,i=a.internalData,l=t.options,o=a.computeRowKeyField,r=a.computeValueField,u=a.computeGridOpts,s=u.treeConfig,u=u.pagerConfig,c={},p={};s||_xeUtils.default.arrayEach(e||l||[],function(e,t,n){var i=(i=a.getRowid(e))||getRowUniqueId(),i=(p[i]&&(0,_log.errLog)("vxe.error.repeatKey",["[table-select] ".concat(o),i]),p[i]=!0,e[r]);c[i]&&(0,_log.errLog)("vxe.error.repeatKey",["[table-select] ".concat(r),i]),c[i]={item:e,index:t,items:n,parent:null,nodes:[]}}),n.fullOptionList=e||l||[],i.fullRowMaps=u?Object.assign({},i.fullRowMaps,c):c,a.updateModel(t.value)},updateZindex:function(){var e=this.reactData,t=this.computePopupOpts.zIndex||this.zIndex;t?e.panelIndex=_xeUtils.default.toNumber(t):e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updatePlacement:function(){function e(){var e=(0,_dom.updatePanelPlacement)(l,o,{placement:u.placement||i,defaultPlacement:u.defaultPlacement,teleportTo:r}),t=Object.assign(e.style,{zIndex:a});n.panelStyle=t,n.panelPlacement=e.placement}var t=this,n=t.reactData,i=t.placement,a=n.panelIndex,l=t.$refs.refElem,o=t.$refs.refOptionPanel,r=t.computeBtnTransfer,u=t.computePopupOpts;return e(),t.$nextTick().then(e)},showOptionPanel:function(){var e,t,n=this,i=n,a=n.reactData,l=n.internalData;i.loading||n.computeIsDisabled||(l.vpTimeout&&clearTimeout(l.vpTimeout),l.hpTimeout&&clearTimeout(l.hpTimeout),a.initialized||(a.initialized=!0,e=n.computeBtnTransfer,t=n.$refs.refOptionPanel,e&&t&&document.body.appendChild(t)),a.isActivated=!0,a.isAniVisible=!0,l.vpTimeout=setTimeout(function(){a.visiblePanel=!0,n.updateModel(i.value),l.vpTimeout=void 0,n.updatePlacement()},10),n.updateZindex(),n.updatePlacement())},hideOptionPanel:function(){var e=this.reactData,t=this.internalData;e.visiblePanel=!1,t.hpTimeout=setTimeout(function(){e.isAniVisible=!1},350)},changeEvent:function(e,t,n){var i=this,a=i,l=i.$xeForm,o=i.formItemInfo;i.emitModel(t),t!==a.value&&(i.dispatchEvent("change",{value:t,row:n,option:n},e),l)&&o&&l.triggerItemEvent(e,o.itemConfig.field,t)},clearValueEvent:function(e,t){this.changeEvent(e,t,null),this.dispatchEvent("clear",{value:t},e)},clearEvent:function(e,t){var n=this.$refs.refGrid;n&&(n.clearRadioRow(),n.clearCheckboxRow()),this.clearValueEvent(t,null),this.hideOptionPanel()},handleGlobalMousewheelEvent:function(e){var t=this,n=t.reactData.visiblePanel;t.computeIsDisabled||n&&(n=t.$refs.refOptionPanel,(0,_dom.getEventTargetNode)(e,n).flag?t.updatePlacement():t.hideOptionPanel())},handleGlobalMousedownEvent:function(e){var t,n,i=this,a=i.reactData,l=a.visiblePanel;i.computeIsDisabled||(t=i.$refs.refElem,n=i.$refs.refOptionPanel,a.isActivated=(0,_dom.getEventTargetNode)(e,t).flag||(0,_dom.getEventTargetNode)(e,n).flag,l&&!a.isActivated&&i.hideOptionPanel())},handleGlobalBlurEvent:function(){var e=this.reactData,t=e.visiblePanel,n=e.isActivated;t&&this.hideOptionPanel(),n&&(e.isActivated=!1),(t||n)&&(e=this.$refs.refInput)&&e.blur()},handleGlobalResizeEvent:function(){this.reactData.visiblePanel&&this.updatePlacement()},focusEvent:function(e){var t=this.reactData;this.computeIsDisabled||t.visiblePanel||(t.triggerFocusPanel=!0,this.showOptionPanel(),setTimeout(function(){t.triggerFocusPanel=!1},150)),this.dispatchEvent("focus",{},e)},clickEvent:function(e){this.togglePanelEvent(e),this.dispatchEvent("click",{},e)},blurEvent:function(e){this.reactData.isActivated=!1,this.dispatchEvent("blur",{},e)},togglePanelEvent:function(e){var t=this.reactData;e.$event.preventDefault(),t.triggerFocusPanel?t.triggerFocusPanel=!1:t.visiblePanel?this.hideOptionPanel():this.showOptionPanel()},radioChangeEvent:function(e){var t=e.$event,e=e.row,n=e[this.computeValueField];this.changeEvent(t,n,e),this.hideOptionPanel()},checkboxChangeEvent:function(e){var t=e.$grid,n=e.$event,e=e.row,i=this.computeValueField;t&&(t=t.getCheckboxRecords().map(function(e){return e[i]}),this.changeEvent(n,t,e))},checkboxAllEvent:function(e){this.checkboxChangeEvent(e)},renderVN:function(e){var t=_ui.VxeUI.getComponent("vxe-grid"),n=this,i=n,a=n.$scopedSlots,l=n.reactData,o=i.className,r=i.options,u=i.loading,s=l.initialized,c=l.isActivated,p=l.isAniVisible,d=l.visiblePanel,f=l.tableColumns,v=n.computeSize,m=n.computeIsDisabled,h=n.computeSelectLabel,g=n.computeBtnTransfer,b=n.computeSelectGridOpts,x=n.computeRowOpts,_=n.computePopupWrapperStyle,y=a.header,E=a.footer,P=a.prefix,O=n.computePopupOpts.className;return n.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-table-select--readonly",o]},[e("span",{class:"vxe-table-select-label"},h)]):e("div",{ref:"refElem",class:["vxe-table-select",o?_xeUtils.default.isFunction(o)?o({$tableSelect:n}):o:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(v),v),"is--visible",d),"is--disabled",m),"is--loading",u),"is--active",c)]},[e(_input.default,{ref:"refInput",props:{clearable:i.clearable,placeholder:i.placeholder,editable:!1,disabled:m,type:"text",prefixIcon:i.prefixIcon,suffixIcon:u?(0,_ui.getIcon)().TABLE_SELECT_LOADED:d?(0,_ui.getIcon)().TABLE_SELECT_OPEN:(0,_ui.getIcon)().TABLE_SELECT_CLOSE,value:u?(0,_ui.getI18n)("vxe.select.loadingText"):h},on:{clear:n.clearEvent,click:n.clickEvent,focus:n.focusEvent,blur:n.blurEvent,"suffix-click":n.togglePanelEvent},scopedSlots:P?{prefix:function(){return P({})}}:{}}),e("div",{ref:"refOptionPanel",class:["vxe-table--ignore-clear vxe-table-select--panel",O?_xeUtils.default.isFunction(O)?O({$tableSelect:n}):O:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(v),v),"is--transfer",g),"ani--leave",!u&&p),"ani--enter",!u&&d)],attrs:{placement:l.panelPlacement},style:l.panelStyle},s?[e("div",{class:"vxe-table-select--panel-wrapper"},[y?e("div",{class:"vxe-table-select--panel-header"},y({})):(0,_ui.renderEmptyElement)(n),e("div",{class:"vxe-table-select--panel-body"},[e("div",{ref:"refGridWrapper",class:"vxe-table-select-grid--wrapper",style:_},[t?e(t,{ref:"refGrid",class:"vxe-table-select--grid",props:Object.assign(Object.assign({},b),{rowConfig:x,data:r,columns:f.length?f:b.columns,height:"100%",autoResize:!0}),on:Object.assign(Object.assign({},n.gridEvents),{"radio-change":n.radioChangeEvent,"checkbox-change":n.checkboxChangeEvent,"checkbox-all":n.checkboxAllEvent}),scopedSlots:Object.assign({},a,{header:void 0,footer:void 0,prefixSlot:void 0})}):(0,_ui.renderEmptyElement)(n)])]),E?e("div",{class:"vxe-table-select--panel-footer"},E({})):(0,_ui.renderEmptyElement)(n)])]:[])])}},watch:{options:function(){this.cacheDataMap()},columns:function(e){this.loadTableColumn(e)},value:function(e){this.updateModel(e)}},created:function(){var n=this,e=n,i=n.gridEvents;["form-submit","form-reset","form-collapse","page-change"].forEach(function(t){i[(0,_vn.getOnName)(t)]=function(e){n.dispatchEvent(t,e,e.$event)}}),n.loadTableColumn(e.columns),n.cacheDataMap()},mounted:function(){var e=this,t=e,n=e.reactData,i=_ui.VxeUI.getComponent("vxe-grid"),t=(e.$nextTick(function(){i||(0,_log.errLog)("vxe.error.reqComp",["[table-select] vxe-grid"])}),t.gridConfig);t&&t.proxyConfig&&!1!==t.proxyConfig.autoLoad&&(n.initialized=!0),_ui.globalEvents.on(e,"mousewheel",e.handleGlobalMousewheelEvent),_ui.globalEvents.on(e,"mousedown",e.handleGlobalMousedownEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent),_ui.globalEvents.on(e,"resize",e.handleGlobalResizeEvent)},beforeDestroy:function(){var e=this,t=e.$refs.refOptionPanel;t&&t.parentNode&&t.parentNode.removeChild(t),_ui.globalEvents.off(e,"mousewheel"),_ui.globalEvents.off(e,"mousedown"),_ui.globalEvents.off(e,"blur"),_ui.globalEvents.off(e,"resize")},render:function(e){return this.renderVN(e)}});
@@ -56,7 +56,10 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
56
56
  },
57
57
  props: {
58
58
  value: [String, Number, Array],
59
- clearable: Boolean,
59
+ clearable: {
60
+ type: Boolean,
61
+ default: (0, _ui.getConfig)().treeSelect.clearable
62
+ },
60
63
  placeholder: {
61
64
  type: String,
62
65
  default: function _default() {
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_util=require("../../tree/src/util"),_log=require("../../ui/src/log"),_input=_interopRequireDefault(require("../../input")),_button=_interopRequireDefault(require("../../button")),_tree=_interopRequireDefault(require("../../tree")),_vn=require("../../ui/src/vn");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function getOptUniqueId(){return _xeUtils.default.uniqueId("node_")}function createReactData(){return{initialized:!1,searchValue:"",searchLoading:!1,panelIndex:0,panelStyle:{},panelPlacement:null,triggerFocusPanel:!1,visiblePanel:!1,isAniVisible:!1,isActivated:!1,fullOptFlag:1,lazyOptFlag:1}}function createInternalData(){return{fullOptionList:[],fullNodeMaps:{},lazyNodeMaps:{}}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTreeSelect",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:[String,Number,Array],clearable:Boolean,placeholder:{type:String,default:function(){return _xeUtils.default.eqNull((0,_ui.getConfig)().treeSelect.placeholder)?(0,_ui.getI18n)("vxe.base.pleaseSelect"):(0,_ui.getConfig)().treeSelect.placeholder}},readonly:{type:Boolean,default:null},loading:Boolean,disabled:{type:Boolean,default:null},showFullLabel:{type:Boolean,default:(0,_ui.getConfig)().treeSelect.showFullLabel},separator:{type:String,default:(0,_ui.getConfig)().treeSelect.separator},filterable:Boolean,filterConfig:Object,multiple:Boolean,className:[String,Function],popupClassName:[String,Function],prefixIcon:String,placement:String,lazyOptions:Array,options:Array,optionProps:Object,zIndex:Number,size:{type:String,default:function(){return(0,_ui.getConfig)().treeSelect.size||(0,_ui.getConfig)().size}},remote:Boolean,remoteConfig:Function,popupConfig:Object,treeConfig:Object,menuConfig:Object,virtualYConfig:Object,autoClose:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.autoClose}},checkedClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.checkedClosable}},clearClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.clearClosable}},showCloseButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.showCloseButton}},showTotalButoon:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.showTotalButoon}},showCheckedButoon:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.showCheckedButoon}},showClearButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.showClearButton}},showExpandButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.showExpandButton}},transfer:{type:Boolean,default:null},remoteMethod:Function},inject:{$xeModal:{default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},provide:function(){return{$xeTreeSelect:this}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:createReactData(),internalData:createInternalData()}},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeBtnTransfer:function(){var e=this,t=e.$xeTable,n=e.$xeModal,l=e.$xeDrawer,i=e.$xeForm,o=e.transfer,e=e.computePopupOpts;if(_xeUtils.default.isBoolean(e.transfer))return e.transfer;if(null===o){e=(0,_ui.getConfig)().treeSelect.transfer;if(_xeUtils.default.isBoolean(e))return e;if(t||n||l||i)return!0}return o},computePopupOpts:function(){return Object.assign({},(0,_ui.getConfig)().treeSelect.popupConfig,this.popupConfig)},computeTreeOpts:function(){return Object.assign({},(0,_ui.getConfig)().treeSelect.treeConfig,this.treeConfig)},computeMenuOpts:function(){return Object.assign({},(0,_ui.getConfig)().treeSelect.menuConfig,this.menuConfig)},computeTreeNodeOpts:function(){var e=this.computeTreeOpts;return Object.assign({isHover:!0},e.nodeConfig)},computeTreeCheckboxOpts:function(){var e=this.computeTreeOpts;return Object.assign({showIcon:!!e.showCheckbox},e.checkboxConfig,{trigger:"node"})},computeTreeRadioOpts:function(){var e=this.computeTreeOpts;return Object.assign({showIcon:!!e.showRadio},e.radioConfig,{trigger:"node"})},computePropsOpts:function(){return Object.assign({},this.optionProps)},computeNodeKeyField:function(){return this.computeTreeOpts.keyField||"id"},computeLabelField:function(){return this.computePropsOpts.label||"label"},computeValueField:function(){return this.computePropsOpts.value||"value"},computeChildrenField:function(){return this.computePropsOpts.children||"children"},computeNodeParentField:function(){var e=this.computePropsOpts,t=this.computeTreeOpts;return e.parent||t.parentField||"parentId"},computeHasChildField:function(){return this.computePropsOpts.hasChild||"hasChild"},computeVirtualYOpts:function(){return Object.assign({},(0,_ui.getConfig)().treeSelect.virtualYConfig,this.virtualYConfig)},computeRemoteOpts:function(){return Object.assign({},(0,_ui.getConfig)().treeSelect.remoteConfig,this.remoteConfig)},computeFilterOpts:function(){var e=this.computeTreeOpts;return Object.assign({},e.filterConfig,this.filterConfig)},computeSelectLabel:function(){var e=this.reactData,t=this.internalData,n=this.value,l=this.showFullLabel,i=e.fullOptFlag,o=e.lazyOptFlag,a=t.fullNodeMaps,r=t.lazyNodeMaps,u=this.computeLabelField;return(_xeUtils.default.eqNull(n)?[]:_xeUtils.default.isArray(n)?n:[n]).map(function(e){var t=a[e];if(i&&t)return l?t.fullLabel:t.item[u];if(o){t=r[e];if(t)return l?t.fullLabel:t.item[u]}return e}).join(", ")},computePopupWrapperStyle:function(){var e=this.computePopupOpts,t=e.height,e=e.width,n={};return e&&(n.width=(0,_dom.toCssUnit)(e)),t&&(n.height=(0,_dom.toCssUnit)(t),n.maxHeight=(0,_dom.toCssUnit)(t)),n}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$treeSelect:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},callSlot:function(e,t,n){var l=this.$scopedSlots;return e&&(_xeUtils.default.isString(e)&&(e=l[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e.call(this,t,n)):[]},getNodeid:function(e){e=e[this.computeNodeKeyField];return e?encodeURIComponent(e):""},handleCacheMap:function(e){function t(e,t,n,l,i,o){var a=(a=r.getNodeid(e))||getOptUniqueId(),a=(f[a]&&(0,_log.errLog)("vxe.error.repeatKey",["[tree-select] ".concat(c),a]),f[a]=!0,e[s]);p[a]&&(0,_log.errLog)("vxe.error.repeatKey",["[tree-select] ".concat(s),a]),p[a]={item:e,index:t,items:n,parent:i,nodes:o,fullLabel:o.map(function(e){return e[d]}).join((u||"/")+" ")}}var r=this,u=r.separator,n=r.computeTreeOpts,c=r.computeNodeKeyField,l=r.computeChildrenField,s=r.computeValueField,d=r.computeLabelField,i=n.transform,p={},f={};return e&&(i?(i=_xeUtils.default.toArrayTree(e,{key:c,parentKey:r.computeNodeParentField,mapChildren:l,rootParentValue:n.rootParentValue,rootValues:n.rootValues}),_xeUtils.default.eachTree(i,t,{children:l})):_xeUtils.default.eachTree(e,t,{children:l})),p},cacheDataMap:function(){var e=this.reactData,t=this.internalData,n=this.options;t.fullNodeMaps=this.handleCacheMap(n||[]),t.fullOptionList=n||[],e.fullOptFlag++},cacheLazyDataMap:function(){var e=this.reactData,t=this.internalData,n=this.lazyOptions;t.lazyNodeMaps=this.handleCacheMap(n||[]),e.lazyOptFlag++},updateZindex:function(){var e=this.reactData,t=this.computePopupOpts.zIndex||this.zIndex;t?e.panelIndex=_xeUtils.default.toNumber(t):e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updatePlacement:function(){function e(){var e=(0,_dom.updatePanelPlacement)(o,a,{placement:u.placement||l,defaultPlacement:u.defaultPlacement,teleportTo:r}),t=Object.assign(e.style,{zIndex:i});n.panelStyle=t,n.panelPlacement=e.placement}var t=this,n=t.reactData,l=t.placement,i=n.panelIndex,o=t.$refs.refElem,a=t.$refs.refOptionPanel,r=t.computeBtnTransfer,u=t.computePopupOpts;return e(),t.$nextTick().then(e)},showOptionPanel:function(){var e=this,t=e.reactData,n=e.internalData,l=e.loading,i=e.remote,o=e.filterable,a=n.fullOptionList,r=e.computeRemoteOpts;l||e.computeIsDisabled||(n.hpTimeout&&clearTimeout(n.hpTimeout),t.initialized||(t.initialized=!0,l=e.computeBtnTransfer,n=e.$refs.refOptionPanel,l&&n&&document.body.appendChild(n)),t.isActivated=!0,t.isAniVisible=!0,o&&i&&r.enabled&&r.autoLoad&&!a.length&&e.handleSearchEvent(),setTimeout(function(){t.visiblePanel=!0,e.handleFocusSearch(),e.updatePlacement()},10),e.updateZindex(),e.updatePlacement(),e.dispatchEvent("visible-change",{visible:!0},null))},hideOptionPanel:function(e){var t=this.reactData,n=this.internalData;t.visiblePanel=!1,n.hpTimeout=setTimeout(function(){t.isAniVisible=!1},350),this.dispatchEvent("visible-change",{visible:!1},e||null)},changeEvent:function(e,t,n){var l=this,i=l,o=l.$xeForm,a=l.formItemInfo,t=_xeUtils.default.isArray(t)?t.map(_util.deNodeValue):(0,_util.deNodeValue)(t);l.emitModel(t),t!==i.value&&(l.dispatchEvent("change",{value:t,node:n,option:n},e),o)&&a&&o.triggerItemEvent(e,a.itemConfig.field,t)},clearValueEvent:function(e,t){this.changeEvent(e,t,null),this.dispatchEvent("clear",{value:t},e)},clearEvent:function(e){e=e.$event;this.clearValueEvent(e,null),this.hideOptionPanel(e)},allCheckedPanelEvent:function(e){var n=this,l=e.$event,e=n.multiple,i=n.autoClose,o=n.checkedClosable,t=n.$refs.refTree;e&&t&&t.setAllCheckboxNode(!0).then(function(e){var t=e.checkNodeKeys;n.changeEvent(l,t,e.checkNodes[0]),n.dispatchEvent("all-change",{value:t},l),(_xeUtils.default.isBoolean(i)?i:o)&&n.hideOptionPanel(l)})},clearCheckedPanelEvent:function(e){var t=this,n=e.$event,e=t.multiple,l=t.autoClose,i=t.clearClosable,o=t.$refs.refTree;o&&(e=e?[]:null,o.clearCheckboxNode().then(function(){(_xeUtils.default.isBoolean(l)?l:i)&&t.hideOptionPanel(n)}),t.changeEvent(n,e,null),t.dispatchEvent("clear",{value:e},n))},closePanelEvent:function(e){e=e.$event;this.hideOptionPanel(e)},allExpandPanelEvent:function(){var e=this.$refs.refTree;e&&e.setAllExpandNode(!0)},clearExpandPanelEvent:function(){var e=this.$refs.refTree;e&&e.clearAllExpandNode()},handleGlobalMousewheelEvent:function(e){var t=this,n=t.reactData.visiblePanel;t.computeIsDisabled||n&&(n=t.$refs.refOptionPanel,(0,_dom.getEventTargetNode)(e,n).flag?t.updatePlacement():t.hideOptionPanel(e))},handleGlobalMousedownEvent:function(e){var t,n,l=this,i=l.reactData,o=i.visiblePanel;l.computeIsDisabled||(t=l.$refs.refElem,n=l.$refs.refOptionPanel,i.isActivated=(0,_dom.getEventTargetNode)(e,t).flag||(0,_dom.getEventTargetNode)(e,n).flag,o&&!i.isActivated&&l.hideOptionPanel(e))},handleGlobalBlurEvent:function(e){var t=this.reactData,n=t.visiblePanel,l=t.isActivated;n&&this.hideOptionPanel(e),l&&(t.isActivated=!1),(n||l)&&(e=this.$refs.refInput)&&e.blur()},handleGlobalResizeEvent:function(){this.reactData.visiblePanel&&this.updatePlacement()},handleFocusSearch:function(){var t=this;t.filterable&&t.$nextTick(function(){var e=t.$refs.refInpSearch;e&&e.focus()})},focusEvent:function(e){var t=this.reactData;this.computeIsDisabled||t.visiblePanel||(t.triggerFocusPanel=!0,this.showOptionPanel(),setTimeout(function(){t.triggerFocusPanel=!1},150)),this.dispatchEvent("focus",{},e)},clickEvent:function(e){this.togglePanelEvent(e),this.dispatchEvent("click",{},e)},blurEvent:function(e){this.reactData.isActivated=!1,this.dispatchEvent("blur",{},e)},modelSearchEvent:function(e){this.reactData.searchValue=e},handleSearchEvent:function(){var e=this,t=e.reactData,n=e.value,l=t.searchValue,i=e.computeRemoteOpts,o=i.queryMethod||e.remoteMethod;e.remote&&o&&i.enabled&&(t.searchLoading=!0,Promise.resolve(o({$treeSelect:e,searchValue:l,value:n})).then(function(){return e.$nextTick()}).catch(function(){return e.$nextTick()}).finally(function(){t.searchLoading=!1}))},togglePanelEvent:function(e){var t=this.reactData,e=e.$event;e.preventDefault(),t.triggerFocusPanel?t.triggerFocusPanel=!1:t.visiblePanel?this.hideOptionPanel(e):this.showOptionPanel()},nodeExpandEvent:function(){this.updatePlacement()},nodeClickEvent:function(e){var t=e.$event;this.dispatchEvent("node-click",e,t)},radioChangeEvent:function(e){var t=e.value,n=e.$event;this.changeEvent(n,t,e.node),this.hideOptionPanel(n)},checkboxChangeEvent:function(e){var t=e.value;this.changeEvent(e.$event,t,e.node)},loadSuccessEvent:function(){this.cacheDataMap()},renderVN:function(t){var e,n,l,i,o,a,r,u,c,s,d,p,f,h,M,m,v,g,b,_=this,x=_,E=_.$scopedSlots,y=_.reactData,C=x.className,P=x.value,O=x.multiple,L=x.options,S=x.loading,V=x.menuConfig,z=x.filterable,U=x.showTotalButoon,F=x.showCheckedButoon,I=x.showClearButton,T=x.showExpandButton,j=x.showCloseButton,A=y.initialized,R=y.isActivated,q=y.isAniVisible,D=y.visiblePanel,K=y.searchValue,N=_.computeSize,H=_.computeIsDisabled,w=_.computeSelectLabel,G=_.computeBtnTransfer,Y=_.computePopupWrapperStyle,k=E.header,$=E.footer,Z=E.prefix,E=_.computePopupOpts,B=E.className||x.popupClassName;return _.computeFormReadonly?t("div",{ref:"refElem",class:["vxe-tree-select--readonly",C]},[t("span",{class:"vxe-tree-select-label"},w)]):(n=_.computeMenuOpts,l=_.computeTreeNodeOpts,i=_.computeTreeCheckboxOpts,o=_.computeTreeRadioOpts,a=_.computeNodeKeyField,r=_.computeLabelField,u=_.computeValueField,c=_.computeChildrenField,s=_.computeNodeParentField,d=_.computeHasChildField,p=_.computeVirtualYOpts,f=_.computeFilterOpts,h=(e=_.computeTreeOpts).slots,M=_xeUtils.default.eqNull(P)?[]:_xeUtils.default.isArray(P)?P:[P],m={},h&&(v=h.icon,g=h.title,b=h.extra,v&&(m.icon=function(e){return _.callSlot(v,e,t)}),g&&(m.title=function(e){return _.callSlot(g,e,t)}),b)&&(m.extra=function(e){return _.callSlot(b,e,t)}),t("div",{ref:"refElem",class:["vxe-tree-select",C?_xeUtils.default.isFunction(C)?C({$treeSelect:_}):C:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(N),N),"is--filterable",z),"is--visible",D),"is--disabled",H),"is--loading",S),"is--active",R)]},[t(_input.default,{ref:"refInput",props:{clearable:x.clearable,placeholder:x.placeholder,editable:!1,disabled:H,type:"text",prefixIcon:x.prefixIcon,suffixIcon:S?(0,_ui.getIcon)().TREE_SELECT_LOADED:D?(0,_ui.getIcon)().TREE_SELECT_OPEN:(0,_ui.getIcon)().TREE_SELECT_CLOSE,value:S?(0,_ui.getI18n)("vxe.select.loadingText"):w,title:w},on:{clear:_.clearEvent,click:_.clickEvent,focus:_.focusEvent,blur:_.blurEvent,"suffix-click":_.togglePanelEvent},scopedSlots:Z?{prefix:function(){return Z({})}}:{}}),t("div",{ref:"refOptionPanel",class:["vxe-table--ignore-clear vxe-tree-select--panel",B?_xeUtils.default.isFunction(B)?B({$treeSelect:_}):B:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(N),N),"is--transfer",G),"ani--leave",!S&&q),"ani--enter",!S&&D)],attrs:{placement:y.panelPlacement},style:y.panelStyle},A?[t("div",{class:"vxe-tree-select--panel-wrapper"},[z?t("div",{class:"vxe-tree-select--panel-search"},[t(_input.default,{ref:"refInpSearch",class:"vxe-tree-select-search--input",props:{value:K,title:w,clearable:!0,disabled:!1,readonly:!1,placeholder:(0,_ui.getI18n)("vxe.treeSelect.search"),prefixIcon:(0,_ui.getIcon)().INPUT_SEARCH},on:{"model-value":_.modelSearchEvent}})]):(0,_ui.renderEmptyElement)(_),F&&O||I||T||k?t("div",{class:"vxe-tree-select--panel-header"},k?k({}):[t("div",{class:"vxe-tree-select--header-button"},[F&&I?t("div",{class:"vxe-tree-select--selected-btns"},[F&&O?t(_button.default,{props:{content:(0,_ui.getI18n)("vxe.treeSelect.allChecked"),mode:"text"},on:{click:_.allCheckedPanelEvent}}):(0,_ui.renderEmptyElement)(_),I?t(_button.default,{props:{content:(0,_ui.getI18n)("vxe.treeSelect.clearChecked"),mode:"text"},on:{click:_.clearCheckedPanelEvent}}):(0,_ui.renderEmptyElement)(_)]):(0,_ui.renderEmptyElement)(_),T?t("div",{class:"vxe-tree-select--expand-btns"},[T?t(_button.default,{props:{content:(0,_ui.getI18n)("vxe.treeSelect.allExpand"),mode:"text"},on:{click:_.allExpandPanelEvent}}):(0,_ui.renderEmptyElement)(_),T?t(_button.default,{props:{content:(0,_ui.getI18n)("vxe.treeSelect.clearExpand"),mode:"text"},on:{click:_.clearExpandPanelEvent}}):(0,_ui.renderEmptyElement)(_)]):(0,_ui.renderEmptyElement)(_)])]):(0,_ui.renderEmptyElement)(_),t("div",{class:"vxe-tree-select--panel-body"},[t("div",{ref:"refTreeWrapper",class:"vxe-tree-select-tree--wrapper",style:Y},[t(_tree.default,{ref:"refTree",class:"vxe-tree-select--tree",props:{data:L,height:E.height?"100%":e.height,minHeight:e.minHeight,maxHeight:E.height?"":e.maxHeight,autoResize:!0,indent:e.indent,showRadio:!O,radioConfig:o,checkNodeKey:O?null:P,showCheckbox:!!O,checkNodeKeys:O?P:null,checkboxConfig:i,titleField:r,valueField:u,keyField:a,childrenField:e.childrenField||c,parentField:s,hasChildField:e.hasChildField||d,accordion:e.accordion,expandAll:e.expandAll,expandNodeKeys:e.expandNodeKeys,nodeConfig:l,lazy:e.lazy,loadMethod:e.loadMethod,toggleMethod:e.toggleMethod,transform:e.transform,rootParentValue:e.rootParentValue,rootValues:e.rootValues,trigger:e.trigger,showIcon:e.showIcon,showLine:e.showLine,iconOpen:e.iconOpen,iconLoaded:e.iconLoaded,iconClose:e.iconClose,filterValue:K,filterConfig:f,menuConfig:V?n:void 0,virtualYConfig:p},on:{"node-expand":_.nodeExpandEvent,"node-click":_.nodeClickEvent,"radio-change":_.radioChangeEvent,"checkbox-change":_.checkboxChangeEvent,"load-success":_.loadSuccessEvent},scopedSlots:m})])]),$||U||j&&O?t("div",{class:"vxe-tree-select--panel-footer"},$?$({}):[t("div",{class:"vxe-tree-select--footer-button"},[U?t("div",{class:"vxe-tree-select--total-btns"},(0,_ui.getI18n)("vxe.treeSelect.total",[M.length])):(0,_ui.renderEmptyElement)(_),j&&O?t("div",{class:"vxe-tree-select--oper-btns"},[t(_button.default,{props:{content:(0,_ui.getI18n)("vxe.select.close"),mode:"text"},on:{click:_.closePanelEvent}})]):(0,_ui.renderEmptyElement)(_)])]):(0,_ui.renderEmptyElement)(_)])]:[])]))}},watch:{options:function(){this.cacheDataMap()},lazyOptions:function(){this.cacheLazyDataMap()}},created:function(){this.cacheDataMap(),this.cacheLazyDataMap()},mounted:function(){var e=this;_xeUtils.default.isBoolean(e.autoClose)&&(0,_log.warnLog)("vxe.error.delProp",["auto-close","checked-closable | clear-closable"]),_ui.globalEvents.on(e,"mousewheel",e.handleGlobalMousewheelEvent),_ui.globalEvents.on(e,"mousedown",e.handleGlobalMousedownEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent),_ui.globalEvents.on(e,"resize",e.handleGlobalResizeEvent)},beforeDestroy:function(){var e=this,t=e.reactData,n=e.internalData,l=e.$refs.refOptionPanel;l&&l.parentNode&&l.parentNode.removeChild(l),_ui.globalEvents.off(e,"mousewheel"),_ui.globalEvents.off(e,"mousedown"),_ui.globalEvents.off(e,"blur"),_ui.globalEvents.off(e,"resize"),_xeUtils.default.assign(t,createReactData()),_xeUtils.default.assign(n,createInternalData())},render:function(e){return this.renderVN(e)}});
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_util=require("../../tree/src/util"),_log=require("../../ui/src/log"),_input=_interopRequireDefault(require("../../input")),_button=_interopRequireDefault(require("../../button")),_tree=_interopRequireDefault(require("../../tree")),_vn=require("../../ui/src/vn");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function getOptUniqueId(){return _xeUtils.default.uniqueId("node_")}function createReactData(){return{initialized:!1,searchValue:"",searchLoading:!1,panelIndex:0,panelStyle:{},panelPlacement:null,triggerFocusPanel:!1,visiblePanel:!1,isAniVisible:!1,isActivated:!1,fullOptFlag:1,lazyOptFlag:1}}function createInternalData(){return{fullOptionList:[],fullNodeMaps:{},lazyNodeMaps:{}}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTreeSelect",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:[String,Number,Array],clearable:{type:Boolean,default:(0,_ui.getConfig)().treeSelect.clearable},placeholder:{type:String,default:function(){return _xeUtils.default.eqNull((0,_ui.getConfig)().treeSelect.placeholder)?(0,_ui.getI18n)("vxe.base.pleaseSelect"):(0,_ui.getConfig)().treeSelect.placeholder}},readonly:{type:Boolean,default:null},loading:Boolean,disabled:{type:Boolean,default:null},showFullLabel:{type:Boolean,default:(0,_ui.getConfig)().treeSelect.showFullLabel},separator:{type:String,default:(0,_ui.getConfig)().treeSelect.separator},filterable:Boolean,filterConfig:Object,multiple:Boolean,className:[String,Function],popupClassName:[String,Function],prefixIcon:String,placement:String,lazyOptions:Array,options:Array,optionProps:Object,zIndex:Number,size:{type:String,default:function(){return(0,_ui.getConfig)().treeSelect.size||(0,_ui.getConfig)().size}},remote:Boolean,remoteConfig:Function,popupConfig:Object,treeConfig:Object,menuConfig:Object,virtualYConfig:Object,autoClose:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.autoClose}},checkedClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.checkedClosable}},clearClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.clearClosable}},showCloseButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.showCloseButton}},showTotalButoon:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.showTotalButoon}},showCheckedButoon:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.showCheckedButoon}},showClearButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.showClearButton}},showExpandButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().treeSelect.showExpandButton}},transfer:{type:Boolean,default:null},remoteMethod:Function},inject:{$xeModal:{default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},provide:function(){return{$xeTreeSelect:this}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:createReactData(),internalData:createInternalData()}},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeBtnTransfer:function(){var e=this,t=e.$xeTable,n=e.$xeModal,l=e.$xeDrawer,i=e.$xeForm,o=e.transfer,e=e.computePopupOpts;if(_xeUtils.default.isBoolean(e.transfer))return e.transfer;if(null===o){e=(0,_ui.getConfig)().treeSelect.transfer;if(_xeUtils.default.isBoolean(e))return e;if(t||n||l||i)return!0}return o},computePopupOpts:function(){return Object.assign({},(0,_ui.getConfig)().treeSelect.popupConfig,this.popupConfig)},computeTreeOpts:function(){return Object.assign({},(0,_ui.getConfig)().treeSelect.treeConfig,this.treeConfig)},computeMenuOpts:function(){return Object.assign({},(0,_ui.getConfig)().treeSelect.menuConfig,this.menuConfig)},computeTreeNodeOpts:function(){var e=this.computeTreeOpts;return Object.assign({isHover:!0},e.nodeConfig)},computeTreeCheckboxOpts:function(){var e=this.computeTreeOpts;return Object.assign({showIcon:!!e.showCheckbox},e.checkboxConfig,{trigger:"node"})},computeTreeRadioOpts:function(){var e=this.computeTreeOpts;return Object.assign({showIcon:!!e.showRadio},e.radioConfig,{trigger:"node"})},computePropsOpts:function(){return Object.assign({},this.optionProps)},computeNodeKeyField:function(){return this.computeTreeOpts.keyField||"id"},computeLabelField:function(){return this.computePropsOpts.label||"label"},computeValueField:function(){return this.computePropsOpts.value||"value"},computeChildrenField:function(){return this.computePropsOpts.children||"children"},computeNodeParentField:function(){var e=this.computePropsOpts,t=this.computeTreeOpts;return e.parent||t.parentField||"parentId"},computeHasChildField:function(){return this.computePropsOpts.hasChild||"hasChild"},computeVirtualYOpts:function(){return Object.assign({},(0,_ui.getConfig)().treeSelect.virtualYConfig,this.virtualYConfig)},computeRemoteOpts:function(){return Object.assign({},(0,_ui.getConfig)().treeSelect.remoteConfig,this.remoteConfig)},computeFilterOpts:function(){var e=this.computeTreeOpts;return Object.assign({},e.filterConfig,this.filterConfig)},computeSelectLabel:function(){var e=this.reactData,t=this.internalData,n=this.value,l=this.showFullLabel,i=e.fullOptFlag,o=e.lazyOptFlag,a=t.fullNodeMaps,r=t.lazyNodeMaps,u=this.computeLabelField;return(_xeUtils.default.eqNull(n)?[]:_xeUtils.default.isArray(n)?n:[n]).map(function(e){var t=a[e];if(i&&t)return l?t.fullLabel:t.item[u];if(o){t=r[e];if(t)return l?t.fullLabel:t.item[u]}return e}).join(", ")},computePopupWrapperStyle:function(){var e=this.computePopupOpts,t=e.height,e=e.width,n={};return e&&(n.width=(0,_dom.toCssUnit)(e)),t&&(n.height=(0,_dom.toCssUnit)(t),n.maxHeight=(0,_dom.toCssUnit)(t)),n}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$treeSelect:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},callSlot:function(e,t,n){var l=this.$scopedSlots;return e&&(_xeUtils.default.isString(e)&&(e=l[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e.call(this,t,n)):[]},getNodeid:function(e){e=e[this.computeNodeKeyField];return e?encodeURIComponent(e):""},handleCacheMap:function(e){function t(e,t,n,l,i,o){var a=(a=r.getNodeid(e))||getOptUniqueId(),a=(f[a]&&(0,_log.errLog)("vxe.error.repeatKey",["[tree-select] ".concat(c),a]),f[a]=!0,e[s]);p[a]&&(0,_log.errLog)("vxe.error.repeatKey",["[tree-select] ".concat(s),a]),p[a]={item:e,index:t,items:n,parent:i,nodes:o,fullLabel:o.map(function(e){return e[d]}).join((u||"/")+" ")}}var r=this,u=r.separator,n=r.computeTreeOpts,c=r.computeNodeKeyField,l=r.computeChildrenField,s=r.computeValueField,d=r.computeLabelField,i=n.transform,p={},f={};return e&&(i?(i=_xeUtils.default.toArrayTree(e,{key:c,parentKey:r.computeNodeParentField,mapChildren:l,rootParentValue:n.rootParentValue,rootValues:n.rootValues}),_xeUtils.default.eachTree(i,t,{children:l})):_xeUtils.default.eachTree(e,t,{children:l})),p},cacheDataMap:function(){var e=this.reactData,t=this.internalData,n=this.options;t.fullNodeMaps=this.handleCacheMap(n||[]),t.fullOptionList=n||[],e.fullOptFlag++},cacheLazyDataMap:function(){var e=this.reactData,t=this.internalData,n=this.lazyOptions;t.lazyNodeMaps=this.handleCacheMap(n||[]),e.lazyOptFlag++},updateZindex:function(){var e=this.reactData,t=this.computePopupOpts.zIndex||this.zIndex;t?e.panelIndex=_xeUtils.default.toNumber(t):e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updatePlacement:function(){function e(){var e=(0,_dom.updatePanelPlacement)(o,a,{placement:u.placement||l,defaultPlacement:u.defaultPlacement,teleportTo:r}),t=Object.assign(e.style,{zIndex:i});n.panelStyle=t,n.panelPlacement=e.placement}var t=this,n=t.reactData,l=t.placement,i=n.panelIndex,o=t.$refs.refElem,a=t.$refs.refOptionPanel,r=t.computeBtnTransfer,u=t.computePopupOpts;return e(),t.$nextTick().then(e)},showOptionPanel:function(){var e=this,t=e.reactData,n=e.internalData,l=e.loading,i=e.remote,o=e.filterable,a=n.fullOptionList,r=e.computeRemoteOpts;l||e.computeIsDisabled||(n.hpTimeout&&clearTimeout(n.hpTimeout),t.initialized||(t.initialized=!0,l=e.computeBtnTransfer,n=e.$refs.refOptionPanel,l&&n&&document.body.appendChild(n)),t.isActivated=!0,t.isAniVisible=!0,o&&i&&r.enabled&&r.autoLoad&&!a.length&&e.handleSearchEvent(),setTimeout(function(){t.visiblePanel=!0,e.handleFocusSearch(),e.updatePlacement()},10),e.updateZindex(),e.updatePlacement(),e.dispatchEvent("visible-change",{visible:!0},null))},hideOptionPanel:function(e){var t=this.reactData,n=this.internalData;t.visiblePanel=!1,n.hpTimeout=setTimeout(function(){t.isAniVisible=!1},350),this.dispatchEvent("visible-change",{visible:!1},e||null)},changeEvent:function(e,t,n){var l=this,i=l,o=l.$xeForm,a=l.formItemInfo,t=_xeUtils.default.isArray(t)?t.map(_util.deNodeValue):(0,_util.deNodeValue)(t);l.emitModel(t),t!==i.value&&(l.dispatchEvent("change",{value:t,node:n,option:n},e),o)&&a&&o.triggerItemEvent(e,a.itemConfig.field,t)},clearValueEvent:function(e,t){this.changeEvent(e,t,null),this.dispatchEvent("clear",{value:t},e)},clearEvent:function(e){e=e.$event;this.clearValueEvent(e,null),this.hideOptionPanel(e)},allCheckedPanelEvent:function(e){var n=this,l=e.$event,e=n.multiple,i=n.autoClose,o=n.checkedClosable,t=n.$refs.refTree;e&&t&&t.setAllCheckboxNode(!0).then(function(e){var t=e.checkNodeKeys;n.changeEvent(l,t,e.checkNodes[0]),n.dispatchEvent("all-change",{value:t},l),(_xeUtils.default.isBoolean(i)?i:o)&&n.hideOptionPanel(l)})},clearCheckedPanelEvent:function(e){var t=this,n=e.$event,e=t.multiple,l=t.autoClose,i=t.clearClosable,o=t.$refs.refTree;o&&(e=e?[]:null,o.clearCheckboxNode().then(function(){(_xeUtils.default.isBoolean(l)?l:i)&&t.hideOptionPanel(n)}),t.changeEvent(n,e,null),t.dispatchEvent("clear",{value:e},n))},closePanelEvent:function(e){e=e.$event;this.hideOptionPanel(e)},allExpandPanelEvent:function(){var e=this.$refs.refTree;e&&e.setAllExpandNode(!0)},clearExpandPanelEvent:function(){var e=this.$refs.refTree;e&&e.clearAllExpandNode()},handleGlobalMousewheelEvent:function(e){var t=this,n=t.reactData.visiblePanel;t.computeIsDisabled||n&&(n=t.$refs.refOptionPanel,(0,_dom.getEventTargetNode)(e,n).flag?t.updatePlacement():t.hideOptionPanel(e))},handleGlobalMousedownEvent:function(e){var t,n,l=this,i=l.reactData,o=i.visiblePanel;l.computeIsDisabled||(t=l.$refs.refElem,n=l.$refs.refOptionPanel,i.isActivated=(0,_dom.getEventTargetNode)(e,t).flag||(0,_dom.getEventTargetNode)(e,n).flag,o&&!i.isActivated&&l.hideOptionPanel(e))},handleGlobalBlurEvent:function(e){var t=this.reactData,n=t.visiblePanel,l=t.isActivated;n&&this.hideOptionPanel(e),l&&(t.isActivated=!1),(n||l)&&(e=this.$refs.refInput)&&e.blur()},handleGlobalResizeEvent:function(){this.reactData.visiblePanel&&this.updatePlacement()},handleFocusSearch:function(){var t=this;t.filterable&&t.$nextTick(function(){var e=t.$refs.refInpSearch;e&&e.focus()})},focusEvent:function(e){var t=this.reactData;this.computeIsDisabled||t.visiblePanel||(t.triggerFocusPanel=!0,this.showOptionPanel(),setTimeout(function(){t.triggerFocusPanel=!1},150)),this.dispatchEvent("focus",{},e)},clickEvent:function(e){this.togglePanelEvent(e),this.dispatchEvent("click",{},e)},blurEvent:function(e){this.reactData.isActivated=!1,this.dispatchEvent("blur",{},e)},modelSearchEvent:function(e){this.reactData.searchValue=e},handleSearchEvent:function(){var e=this,t=e.reactData,n=e.value,l=t.searchValue,i=e.computeRemoteOpts,o=i.queryMethod||e.remoteMethod;e.remote&&o&&i.enabled&&(t.searchLoading=!0,Promise.resolve(o({$treeSelect:e,searchValue:l,value:n})).then(function(){return e.$nextTick()}).catch(function(){return e.$nextTick()}).finally(function(){t.searchLoading=!1}))},togglePanelEvent:function(e){var t=this.reactData,e=e.$event;e.preventDefault(),t.triggerFocusPanel?t.triggerFocusPanel=!1:t.visiblePanel?this.hideOptionPanel(e):this.showOptionPanel()},nodeExpandEvent:function(){this.updatePlacement()},nodeClickEvent:function(e){var t=e.$event;this.dispatchEvent("node-click",e,t)},radioChangeEvent:function(e){var t=e.value,n=e.$event;this.changeEvent(n,t,e.node),this.hideOptionPanel(n)},checkboxChangeEvent:function(e){var t=e.value;this.changeEvent(e.$event,t,e.node)},loadSuccessEvent:function(){this.cacheDataMap()},renderVN:function(t){var e,n,l,i,o,a,r,u,c,s,d,p,f,h,M,m,v,g,b,_=this,x=_,E=_.$scopedSlots,y=_.reactData,C=x.className,P=x.value,O=x.multiple,L=x.options,S=x.loading,V=x.menuConfig,z=x.filterable,U=x.showTotalButoon,F=x.showCheckedButoon,I=x.showClearButton,T=x.showExpandButton,j=x.showCloseButton,A=y.initialized,R=y.isActivated,q=y.isAniVisible,D=y.visiblePanel,K=y.searchValue,N=_.computeSize,H=_.computeIsDisabled,w=_.computeSelectLabel,G=_.computeBtnTransfer,Y=_.computePopupWrapperStyle,k=E.header,$=E.footer,Z=E.prefix,E=_.computePopupOpts,B=E.className||x.popupClassName;return _.computeFormReadonly?t("div",{ref:"refElem",class:["vxe-tree-select--readonly",C]},[t("span",{class:"vxe-tree-select-label"},w)]):(n=_.computeMenuOpts,l=_.computeTreeNodeOpts,i=_.computeTreeCheckboxOpts,o=_.computeTreeRadioOpts,a=_.computeNodeKeyField,r=_.computeLabelField,u=_.computeValueField,c=_.computeChildrenField,s=_.computeNodeParentField,d=_.computeHasChildField,p=_.computeVirtualYOpts,f=_.computeFilterOpts,h=(e=_.computeTreeOpts).slots,M=_xeUtils.default.eqNull(P)?[]:_xeUtils.default.isArray(P)?P:[P],m={},h&&(v=h.icon,g=h.title,b=h.extra,v&&(m.icon=function(e){return _.callSlot(v,e,t)}),g&&(m.title=function(e){return _.callSlot(g,e,t)}),b)&&(m.extra=function(e){return _.callSlot(b,e,t)}),t("div",{ref:"refElem",class:["vxe-tree-select",C?_xeUtils.default.isFunction(C)?C({$treeSelect:_}):C:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(N),N),"is--filterable",z),"is--visible",D),"is--disabled",H),"is--loading",S),"is--active",R)]},[t(_input.default,{ref:"refInput",props:{clearable:x.clearable,placeholder:x.placeholder,editable:!1,disabled:H,type:"text",prefixIcon:x.prefixIcon,suffixIcon:S?(0,_ui.getIcon)().TREE_SELECT_LOADED:D?(0,_ui.getIcon)().TREE_SELECT_OPEN:(0,_ui.getIcon)().TREE_SELECT_CLOSE,value:S?(0,_ui.getI18n)("vxe.select.loadingText"):w,title:w},on:{clear:_.clearEvent,click:_.clickEvent,focus:_.focusEvent,blur:_.blurEvent,"suffix-click":_.togglePanelEvent},scopedSlots:Z?{prefix:function(){return Z({})}}:{}}),t("div",{ref:"refOptionPanel",class:["vxe-table--ignore-clear vxe-tree-select--panel",B?_xeUtils.default.isFunction(B)?B({$treeSelect:_}):B:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(N),N),"is--transfer",G),"ani--leave",!S&&q),"ani--enter",!S&&D)],attrs:{placement:y.panelPlacement},style:y.panelStyle},A?[t("div",{class:"vxe-tree-select--panel-wrapper"},[z?t("div",{class:"vxe-tree-select--panel-search"},[t(_input.default,{ref:"refInpSearch",class:"vxe-tree-select-search--input",props:{value:K,title:w,clearable:!0,disabled:!1,readonly:!1,placeholder:(0,_ui.getI18n)("vxe.treeSelect.search"),prefixIcon:(0,_ui.getIcon)().INPUT_SEARCH},on:{"model-value":_.modelSearchEvent}})]):(0,_ui.renderEmptyElement)(_),F&&O||I||T||k?t("div",{class:"vxe-tree-select--panel-header"},k?k({}):[t("div",{class:"vxe-tree-select--header-button"},[F&&I?t("div",{class:"vxe-tree-select--selected-btns"},[F&&O?t(_button.default,{props:{content:(0,_ui.getI18n)("vxe.treeSelect.allChecked"),mode:"text"},on:{click:_.allCheckedPanelEvent}}):(0,_ui.renderEmptyElement)(_),I?t(_button.default,{props:{content:(0,_ui.getI18n)("vxe.treeSelect.clearChecked"),mode:"text"},on:{click:_.clearCheckedPanelEvent}}):(0,_ui.renderEmptyElement)(_)]):(0,_ui.renderEmptyElement)(_),T?t("div",{class:"vxe-tree-select--expand-btns"},[T?t(_button.default,{props:{content:(0,_ui.getI18n)("vxe.treeSelect.allExpand"),mode:"text"},on:{click:_.allExpandPanelEvent}}):(0,_ui.renderEmptyElement)(_),T?t(_button.default,{props:{content:(0,_ui.getI18n)("vxe.treeSelect.clearExpand"),mode:"text"},on:{click:_.clearExpandPanelEvent}}):(0,_ui.renderEmptyElement)(_)]):(0,_ui.renderEmptyElement)(_)])]):(0,_ui.renderEmptyElement)(_),t("div",{class:"vxe-tree-select--panel-body"},[t("div",{ref:"refTreeWrapper",class:"vxe-tree-select-tree--wrapper",style:Y},[t(_tree.default,{ref:"refTree",class:"vxe-tree-select--tree",props:{data:L,height:E.height?"100%":e.height,minHeight:e.minHeight,maxHeight:E.height?"":e.maxHeight,autoResize:!0,indent:e.indent,showRadio:!O,radioConfig:o,checkNodeKey:O?null:P,showCheckbox:!!O,checkNodeKeys:O?P:null,checkboxConfig:i,titleField:r,valueField:u,keyField:a,childrenField:e.childrenField||c,parentField:s,hasChildField:e.hasChildField||d,accordion:e.accordion,expandAll:e.expandAll,expandNodeKeys:e.expandNodeKeys,nodeConfig:l,lazy:e.lazy,loadMethod:e.loadMethod,toggleMethod:e.toggleMethod,transform:e.transform,rootParentValue:e.rootParentValue,rootValues:e.rootValues,trigger:e.trigger,showIcon:e.showIcon,showLine:e.showLine,iconOpen:e.iconOpen,iconLoaded:e.iconLoaded,iconClose:e.iconClose,filterValue:K,filterConfig:f,menuConfig:V?n:void 0,virtualYConfig:p},on:{"node-expand":_.nodeExpandEvent,"node-click":_.nodeClickEvent,"radio-change":_.radioChangeEvent,"checkbox-change":_.checkboxChangeEvent,"load-success":_.loadSuccessEvent},scopedSlots:m})])]),$||U||j&&O?t("div",{class:"vxe-tree-select--panel-footer"},$?$({}):[t("div",{class:"vxe-tree-select--footer-button"},[U?t("div",{class:"vxe-tree-select--total-btns"},(0,_ui.getI18n)("vxe.treeSelect.total",[M.length])):(0,_ui.renderEmptyElement)(_),j&&O?t("div",{class:"vxe-tree-select--oper-btns"},[t(_button.default,{props:{content:(0,_ui.getI18n)("vxe.select.close"),mode:"text"},on:{click:_.closePanelEvent}})]):(0,_ui.renderEmptyElement)(_)])]):(0,_ui.renderEmptyElement)(_)])]:[])]))}},watch:{options:function(){this.cacheDataMap()},lazyOptions:function(){this.cacheLazyDataMap()}},created:function(){this.cacheDataMap(),this.cacheLazyDataMap()},mounted:function(){var e=this;_xeUtils.default.isBoolean(e.autoClose)&&(0,_log.warnLog)("vxe.error.delProp",["auto-close","checked-closable | clear-closable"]),_ui.globalEvents.on(e,"mousewheel",e.handleGlobalMousewheelEvent),_ui.globalEvents.on(e,"mousedown",e.handleGlobalMousedownEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent),_ui.globalEvents.on(e,"resize",e.handleGlobalResizeEvent)},beforeDestroy:function(){var e=this,t=e.reactData,n=e.internalData,l=e.$refs.refOptionPanel;l&&l.parentNode&&l.parentNode.removeChild(l),_ui.globalEvents.off(e,"mousewheel"),_ui.globalEvents.off(e,"mousedown"),_ui.globalEvents.off(e,"blur"),_ui.globalEvents.off(e,"resize"),_xeUtils.default.assign(t,createReactData()),_xeUtils.default.assign(n,createInternalData())},render:function(e){return this.renderVN(e)}});
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
- var version = exports.version = "3.14.27";
29
+ var version = exports.version = "3.14.28";
30
30
  _core.VxeUI.uiVersion = version;
31
31
  _core.VxeUI.dynamicApp = _dynamics.dynamicApp;
32
32
  function config(options) {
@@ -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"),version=exports.version="3.14.27";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:{autoClose:!0},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:{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:!0,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showErrorMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{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:{virtualYConfig:{enabled:!0,gt:60}},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}}},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},tree:{indent:20,minHeight:60,radioConfig:{strict:!0},dragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},treeSelect:{autoClose:null,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:{}});var iconPrefix="vxe-icon-",_default=((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"}),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"),version=exports.version="3.14.28";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:{autoClose:!0},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:{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:!0,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showErrorMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{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:{virtualYConfig:{enabled:!0,gt:60}},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}}},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},tree:{indent:20,minHeight:60,radioConfig:{strict:!0},dragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},treeSelect:{autoClose:null,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:{}});var iconPrefix="vxe-icon-",_default=((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"}),exports.default=_core.VxeUI);
package/lib/ui/src/log.js CHANGED
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.warnLog = exports.errLog = void 0;
7
7
  var _core = require("@vxe-ui/core");
8
- var version = "ui v".concat("3.14.27");
8
+ var version = "ui v".concat("3.14.28");
9
9
  var warnLog = exports.warnLog = _core.log.create('warn', version);
10
10
  var errLog = exports.errLog = _core.log.create('error', version);
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core"),version="ui v".concat("3.14.27"),warnLog=exports.warnLog=_core.log.create("warn",version),errLog=exports.errLog=_core.log.create("error",version);
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core"),version="ui v".concat("3.14.28"),warnLog=exports.warnLog=_core.log.create("warn",version),errLog=exports.errLog=_core.log.create("error",version);
@@ -65,6 +65,45 @@ function hideDropTip($xeUpload) {
65
65
  mdLineEl.style.display = '';
66
66
  }
67
67
  }
68
+ var handleClearFile = function handleClearFile($xeUpload, evnt) {
69
+ var reactData = $xeUpload.reactData;
70
+ var fileList = reactData.fileList;
71
+ var urlProp = $xeUpload.computeUrlProp;
72
+ var rest = [];
73
+ _xeUtils.default.lastEach(fileList, function (item, index) {
74
+ rest.push($xeUpload.removeFileEvent(evnt, item, index).then(function (status) {
75
+ return {
76
+ url: item[urlProp],
77
+ status: status
78
+ };
79
+ }));
80
+ });
81
+ return Promise.all(rest);
82
+ };
83
+ function handleRemoveFile($xeUpload, evnt, urlOrItem) {
84
+ var reactData = $xeUpload.reactData;
85
+ var fileList = reactData.fileList;
86
+ var urlProp = $xeUpload.computeUrlProp;
87
+ var urls = _xeUtils.default.isArray(urlOrItem) ? urlOrItem : [urlOrItem];
88
+ var rest = [];
89
+ urls.forEach(function (obj) {
90
+ if (obj) {
91
+ var url = _xeUtils.default.isString(obj) ? obj : obj[urlProp];
92
+ var index = _xeUtils.default.findIndexOf(fileList, function (fileItem) {
93
+ return fileItem[urlProp] === url;
94
+ });
95
+ if (index > -1) {
96
+ rest.push($xeUpload.removeFileEvent(evnt, fileList[index], index).then(function (status) {
97
+ return {
98
+ url: url,
99
+ status: status
100
+ };
101
+ }));
102
+ }
103
+ }
104
+ });
105
+ return Promise.all(rest);
106
+ }
68
107
  function createReactData() {
69
108
  return {
70
109
  isDragUploadStatus: false,
@@ -579,6 +618,14 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
579
618
  var $xeUpload = this;
580
619
  return $xeUpload.handleChoose(null);
581
620
  },
621
+ clear: function clear() {
622
+ var $xeUpload = this;
623
+ return handleClearFile($xeUpload, null);
624
+ },
625
+ clearByEvent: function clearByEvent(evnt) {
626
+ var $xeUpload = this;
627
+ return handleClearFile($xeUpload, evnt);
628
+ },
582
629
  getPendingFiles: function getPendingFiles() {
583
630
  var $xeUpload = this;
584
631
  var reactData = $xeUpload.reactData;
@@ -659,6 +706,14 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
659
706
  }
660
707
  return $xeUpload.$nextTick();
661
708
  },
709
+ remove: function remove(urlOrItem) {
710
+ var $xeUpload = this;
711
+ return handleRemoveFile($xeUpload, null, urlOrItem);
712
+ },
713
+ removeByEvent: function removeByEvent(evnt, urlOrItem) {
714
+ var $xeUpload = this;
715
+ return handleRemoveFile($xeUpload, evnt, urlOrItem);
716
+ },
662
717
  getFieldKey: function getFieldKey(item) {
663
718
  var $xeUpload = this;
664
719
  var keyField = $xeUpload.computeKeyField;
@@ -1089,18 +1144,22 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
1089
1144
  $xeUpload.handleChange(fileList);
1090
1145
  // 自动更新校验状态
1091
1146
  if ($xeForm && formItemInfo) {
1092
- $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, fileList);
1147
+ $xeForm.triggerItemEvent(evnt || {
1148
+ type: 'remove'
1149
+ }, formItemInfo.itemConfig.field, fileList);
1150
+ }
1151
+ if (evnt) {
1152
+ $xeUpload.dispatchEvent('remove', {
1153
+ option: item
1154
+ }, evnt);
1093
1155
  }
1094
- $xeUpload.dispatchEvent('remove', {
1095
- option: item
1096
- }, evnt);
1097
1156
  },
1098
1157
  removeFileEvent: function removeFileEvent(evnt, item, index) {
1099
1158
  var $xeUpload = this;
1100
1159
  var props = $xeUpload;
1101
1160
  var beforeRemoveFn = props.beforeRemoveMethod || (0, _ui.getConfig)().upload.beforeRemoveMethod;
1102
1161
  var removeFn = props.removeMethod || (0, _ui.getConfig)().upload.removeMethod;
1103
- Promise.resolve(beforeRemoveFn ? beforeRemoveFn({
1162
+ return Promise.resolve(beforeRemoveFn ? beforeRemoveFn({
1104
1163
  $upload: $xeUpload,
1105
1164
  option: item
1106
1165
  }) : true).then(function (status) {
@@ -1122,6 +1181,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
1122
1181
  option: item
1123
1182
  }, evnt);
1124
1183
  }
1184
+ return status;
1125
1185
  });
1126
1186
  },
1127
1187
  handleDownloadEvent: function handleDownloadEvent(evnt, item) {
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _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}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,o){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0===o)return("string"===t?String:Number)(e);o=o.call(e,t||"default");if("object"!=_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}function getUniqueKey(){return _xeUtils.default.uniqueId()}function handleTransferFiles(e){var t=[];return _xeUtils.default.arrayEach(e,function(e){e=e.getAsFile();e&&t.push(e)}),t}function showDropTip(e,t,o,i){var n=e.xID,a=e.reactData.showMorePopup,r=e.$refs.refElem,l=document.getElementById("refPopupElem".concat(n)),l=a?l:r;l&&(r=l.getBoundingClientRect(),l=e.$refs.refDragLineElem,e=document.getElementById("refModalDragLineElem".concat(n)),n=a?e:l)&&(a=o.getBoundingClientRect(),n.style.display="block",n.style.top="".concat(Math.max(1,a.y-r.y),"px"),n.style.left="".concat(Math.max(1,a.x-r.x),"px"),n.style.height="".concat(a.height,"px"),n.style.width="".concat(a.width-1,"px"),n.setAttribute("drag-pos",i))}function hideDropTip(e){var t=e.xID,e=e.$refs.refDragLineElem,t=document.getElementById("refModalDragLineElem".concat(t));e&&(e.style.display=""),t&&(t.style.display="")}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 _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeUpload",model:{prop:"value",event:"modelValue"},mixins:[_ui.globalMixins.sizeMixin],props:{value:[Array,String,Object],showList:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showList}},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},autoSubmit:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.autoSubmit}},mode:{type:String,default:function(){return(0,_ui.getConfig)().upload.mode}},imageTypes:{type:Array,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)}},imageConfig:{type:Object,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)}},imageStyle:{type:Object,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)}},fileTypes:{type:Array,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)}},dragSort:Boolean,dragToUpload:{type:Boolean,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)}},dragPlaceholder:{type:String,default:function(){return(0,_ui.getConfig)().upload.dragPlaceholder}},pasteToUpload:{type:Boolean,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)}},keyField:String,singleMode:Boolean,urlMode:Boolean,urlArgs:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.urlArgs}},multiple:Boolean,limitSize:{type:[String,Number],default:function(){return(0,_ui.getConfig)().upload.limitSize}},showLimitSize:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showLimitSize}},limitSizeText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.limitSizeText}},limitCount:{type:[String,Number],default:function(){return(0,_ui.getConfig)().upload.limitCount}},showLimitCount:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showLimitCount}},limitCountText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.limitCountText}},nameField:{type:String,default:function(){return(0,_ui.getConfig)().upload.nameField}},typeField:{type:String,default:function(){return(0,_ui.getConfig)().upload.typeField}},urlField:{type:String,default:function(){return(0,_ui.getConfig)().upload.urlField}},sizeField:{type:String,default:function(){return(0,_ui.getConfig)().upload.sizeField}},showErrorStatus:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showErrorStatus}},showProgress:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showProgress}},progressText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.progressText}},previewImageConfig:Object,showSubmitButton:Boolean,autoHiddenButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.autoHiddenButton}},showUploadButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showUploadButton}},buttonText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.buttonText}},buttonIcon:{type:String,default:function(){return(0,_ui.getConfig)().upload.buttonIcon}},showButtonText:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showButtonText}},showButtonIcon:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showButtonIcon}},showRemoveButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showRemoveButton}},showDownloadButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showDownloadButton}},showPreview:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showPreview}},showTip:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showTip}},maxSimultaneousUploads:{type:Number,default:function(){return(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:function(){return(0,_ui.getConfig)().upload.size||(0,_ui.getConfig)().size}}},inject:{$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null},$xeTable:{default:null}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:createReactData(),internalData:createInternalData()}},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeKeyField:function(){return this.keyField||"_X_KEY"},computeIsImage:function(){return"image"===this.mode},computeNameProp:function(){return this.nameField||"name"},computeTypeProp:function(){return this.typeField||"type"},computeUrlProp:function(){return this.urlField||"url"},computeSizeProp:function(){return this.sizeField||"size"},computeLimitMaxSize:function(){return 1024*_xeUtils.default.toNumber(this.limitSize)*1024},computeLimitMaxCount:function(){return this.multiple?_xeUtils.default.toNumber(this.limitCount):1},computePreviewImageOpts:function(){var e=this.showDownloadButton;return Object.assign({showDownloadButton:e},(0,_ui.getConfig)().upload.previewImageConfig,this.previewImageConfig)},computeOverCount:function(){var e=this.reactData,t=this.multiple,e=e.fileList,o=this.computeLimitMaxCount;return t?!o||e.length>=o:1<=e.length},computeLimitSizeUnit:function(){var e=_xeUtils.default.toNumber(this.limitSize);return e?1048576<e?"".concat(e/1048576,"T"):1024<e?"".concat(e/1024,"G"):"".concat(e,"M"):""},computedShowTipText:function(){var e=this.showTip,t=this.tipText;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t},computedDefTipText:function(){var e=this,t=e.limitSize,o=e.fileTypes,i=e.multiple,n=e.limitCount,e=e.tipText||e.hintText,a=this.computeIsImage,r=this.computeLimitSizeUnit;return _xeUtils.default.isString(e)?e:_xeUtils.default.isFunction(e)?"".concat(e({})):(e=[],a?(i&&n&&e.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[n])),t&&r&&e.push((0,_ui.getI18n)("vxe.upload.imgSizeHint",[r]))):(o&&o.length&&e.push((0,_ui.getI18n)("vxe.upload.fileTypeHint",[o.join("/")])),t&&r&&e.push((0,_ui.getI18n)("vxe.upload.fileSizeHint",[r])),i&&n&&e.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[n]))),e.join((0,_ui.getI18n)("vxe.base.comma")))},computeImageOpts:function(){return Object.assign({},this.imageConfig||this.imageStyle)},computeImgStyle:function(){var e=this.computeImageOpts,t=e.width,e=e.height,o={};return t&&(o.width=(0,_dom.toCssUnit)(t)),e&&(o.height=(0,_dom.toCssUnit)(e)),o},computeMoreOpts:function(){return Object.assign({showMoreButton:!0},this.moreConfig)}}),watch:{value:function(){this.updateFileList()}},methods:{dispatchEvent:function(e,t,o){this.$emit(e,(0,_ui.createEvent)(o,{$upload:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},choose:function(){return this.handleChoose(null)},getPendingFiles:function(){var t=this,e=t.reactData,o=e.fileList,i=e.fileCacheMaps,n=[];return o.forEach(function(e){e=t.getFieldKey(e),e=i[e];e&&"pending"===e.status&&n.push(e.file)}),n},submit:function(i){var n=this,e=n.reactData,t=n.maxSimultaneousUploads,t=_xeUtils.default.toNumber(t||1)||1,o=e.fileList,a=e.fileCacheMaps,r=o.filter(function(e){e=n.getFieldKey(e),e=a[e];return e&&("pending"===e.status||i&&"error"===e.status)}),l=function(e){var t=n.getFieldKey(e),t=a[t];if(t){var o=t.file;if(o&&("pending"===t.status||i&&"error"===t.status))return t.loading=!0,t.percent=0,n.handleUploadResult(e,o).then(u)}return u()},u=function(){var e;return r.length?(e=r[0],r.splice(0,1),l(e).then(u)):Promise.resolve()};return Promise.all(r.splice(0,t).map(l)).then(function(){})},getMoreVisible:function(){return this.reactData.showMorePopup},openMore:function(){return this.handleMoreEvent({$event:new Event("click")}),this.$nextTick()},openMoreByEvent:function(e){return this.handleMoreEvent({$event:e}),this.$nextTick()},closeMore:function(){var e=this.internalData;return _ui.VxeUI.modal&&_ui.VxeUI.modal.close(e.moreId),this.$nextTick()},getFieldKey:function(e){return e[this.computeKeyField]},updateFileList:function(){var n=this,e=n.reactData,t=n.value,o=n.multiple,i=n.computeFormReadonly,a=n.computeKeyField,r=n.computeNameProp,l=n.computeTypeProp,u=n.computeUrlProp,s=n.computeSizeProp,t=t?(t?_xeUtils.default.isArray(t)?t:[t]:[]).map(function(e){var t,o,i;return!e||_xeUtils.default.isString(e)?(t="".concat(e||""),i=((o=_xeUtils.default.parseUrl(e))?o.searchQuery[r]:"")||n.parseFileName(t),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},r,i),l,(o?o.searchQuery[l]:"")||n.parseFileType(i)),u,t),s,_xeUtils.default.toNumber(o?o.searchQuery[s]:0)||0),a,getUniqueKey())):(i=e[r]||"",e[r]=i,e[l]=e[l]||n.parseFileType(i),e[u]=e[u]||"",e[s]=e[s]||0,e[a]=e[a]||getUniqueKey(),e)}):[];e.fileList=i||o?t:t.slice(0,1)},parseFileName:function(e){return decodeURIComponent("".concat(e||"")).split("/").pop()||""},parseFileType:function(e){var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},handleChange:function(e){var t=this.singleMode,o=this.urlMode,i=this.urlArgs,n=this.computeUrlProp,a=this.computeNameProp,e=e?e.slice(0):[];o&&(e=e.map(function(e){var t=e[n];if(t&&i){var o=_xeUtils.default.parseUrl(t);if(!o.searchQuery[a]&&-1===t.indexOf("blob:"))return"".concat(t).concat(-1===t.indexOf("?")?"?":"&").concat(encodeURIComponent(e[a]||""))}return t})),this.emitModel(t?e[0]||null:e)},getThumbnailFileUrl:function(e){var t=this.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod;return t?t({$upload:this,option:e}):this.getFileUrl(e)},getFileUrl:function(e){var t=this.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=this.computeUrlProp;return t?t({$upload:this,option:e}):e[o]},handleDefaultFilePreview:function(t){var e=this,o=e.internalData,i=e.imageTypes,n=e.computeTypeProp,a=e.computePreviewImageOpts,r=e.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;o.imagePreviewTypes.concat(i||[]).some(function(e){return"".concat(e).toLowerCase()==="".concat(t[n]).toLowerCase()})&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage(Object.assign(Object.assign({},a),{urlList:[e.getFileUrl(t)],beforeDownloadMethod:r?function(){return r({$upload:e,option:t})}:void 0}))},handlePreviewFileEvent:function(e,t){var o=this.previewMethod||(0,_ui.getConfig)().upload.previewMethod;this.showPreview&&(o?o({$upload:this,option:t}):this.handleDefaultFilePreview(t))},handlePreviewImageEvent:function(e,t,o){var i=this,n=i,a=i.reactData.fileList,r=i.computePreviewImageOpts,l=n.previewMethod||(0,_ui.getConfig)().upload.previewMethod,u=n.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;n.showPreview&&(l?l({$upload:i,option:t}):_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage(Object.assign(Object.assign({},r),{urlList:a.map(function(e){return i.getFileUrl(e)}),activeIndex:o,beforeDownloadMethod:u?function(e){e=e.index;return u({$upload:i,option:a[e]})}:void 0})))},handleUploadResult:function(i,e){var n=this,t=n,a=n.reactData,r=t.showErrorStatus,l=n.getFieldKey(i),t=t.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?Promise.resolve(t({$upload:n,file:e,option:i,updateProgress:function(e){var t=a.fileCacheMaps[n.getFieldKey(i)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(function(e){var t=a.fileCacheMaps[l];t&&(t.percent=100,t.status="success"),_xeUtils.default.each(e,function(e,t){n.$set(i,t,e)}),n.dispatchEvent("upload-success",{option:i,data:e},null)}).catch(function(e){var t=a.fileCacheMaps,o=t[l];o&&(o.status="error"),r?_xeUtils.default.each(e,function(e,t){n.$set(i,t,e)}):(a.fileList=a.fileList.filter(function(e){return n.getFieldKey(e)!==l}),delete t[l]),n.dispatchEvent("upload-error",{option:i,data:e},null)}).finally(function(){var e=a.fileCacheMaps[l];e&&(e.loading=!1)}):((t=a.fileCacheMaps[l])&&(t.loading=!1),Promise.resolve())},handleReUpload:function(e){var t=this,o=t.reactData,i=t.uploadMethod,n=t.urlMode,a=o.fileCacheMaps[t.getFieldKey(e)];(i||(0,_ui.getConfig)().upload.uploadMethod)&&a&&(i=a.file,a.loading=!0,a.status="pending",a.percent=0,t.handleUploadResult(e,i).then(function(){n&&t.handleChange(o.fileList)}))},handleUploadFile:function(e,t){var i=this,o=i,n=i.reactData,a=i.$xeForm,r=i.formItemInfo,l=o.multiple,u=o.urlMode,s=o.showLimitSize,d=o.limitSizeText,p=o.showLimitCount,c=o.limitCountText,g=o.autoSubmit,m=n.fileList,f=o.beforeSelectMethod||(0,_ui.getConfig)().upload.beforeSelectMethod,v=o.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,h=i.computeKeyField,_=i.computeNameProp,x=i.computeTypeProp,y=i.computeUrlProp,I=i.computeSizeProp,E=i.computeLimitMaxSize,D=i.computeLimitMaxCount,w=i.computeLimitSizeUnit,o=e;if(l&&D){if(p&&m.length>=D)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:c?"".concat(_xeUtils.default.isFunction(c)?c({maxCount:D}):c):(0,_ui.getI18n)("vxe.upload.overCountErr",[D])}));var U,b=o.length-(D-m.length);p&&0<b&&(U=o.slice(D-m.length),c?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:"".concat(_xeUtils.default.isFunction(c)?c({maxCount:D}):c)}):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",slots:{default:function(e,o){return o("div",{class:"vxe-upload--file-message-over-error"},[o("div",{},(0,_ui.getI18n)("vxe.upload.overCountExtraErr",[D,b])),o("div",{class:"vxe-upload--file-message-over-extra"},U.map(function(e,t){return o("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)}))])}}})),o=o.slice(0,D-m.length)}if(s&&E)for(var S=0;S<e.length;S++)if(e[0].size>E)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:d?"".concat(_xeUtils.default.isFunction(d)?d({maxSize:E}):d):(0,_ui.getI18n)("vxe.upload.overSizeErr",[w])}));var T=Object.assign({},n.fileCacheMaps),C=l?m:[],M=[];o.forEach(function(e){var t=e.name,o=getUniqueKey(),t=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},_,t),x,i.parseFileType(t)),I,e.size),y,URL.createObjectURL(e)),h,o),o=(v&&(T[o]={file:e,loading:!!g,status:"pending",percent:0}),t);f&&!f({$upload:i,file:e})||(v&&g&&M.push(i.handleUploadResult(o,e)),C.push(o))}),n.fileList=C,n.fileCacheMaps=T,C.forEach(function(e){i.dispatchEvent("add",{option:e},t)}),Promise.all(u?M:[]).then(function(){var e=n.fileList;i.handleChange(e),a&&r&&a.triggerItemEvent(t,r.itemConfig.field,e)})},handleChoose:function(t){var o=this,e=o.multiple,i=o.imageTypes,n=o.fileTypes,a=o.computeIsDisabled,r=o.computeIsImage;return a?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:r?i:n}).then(function(e){return o.handleUploadFile(e.files,t),e})},clickEvent:function(e){this.handleChoose(e).catch(function(){})},handleRemoveEvent:function(e,t,o){var i=this,n=i.reactData,a=i.$xeForm,r=i.formItemInfo,n=n.fileList;n.splice(o,1),i.handleChange(n),a&&r&&a.triggerItemEvent(e,r.itemConfig.field,n),i.dispatchEvent("remove",{option:t},e)},removeFileEvent:function(t,o,i){var n=this,e=n,a=e.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod,r=e.removeMethod||(0,_ui.getConfig)().upload.removeMethod;Promise.resolve(!a||a({$upload:n,option:o})).then(function(e){e?r?Promise.resolve(r({$upload:n,option:o})).then(function(){n.handleRemoveEvent(t,o,i)}).catch(function(e){return e}):n.handleRemoveEvent(t,o,i):n.dispatchEvent("remove-fail",{option:o},t)})},handleDownloadEvent:function(e,t){this.dispatchEvent("download",{option:t},e)},downloadFileEvent:function(t,o){var i=this,e=i,n=e.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod,a=e.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!n||n({$upload:i,option:o})).then(function(e){e?a?Promise.resolve(a({$upload:i,option:o})).then(function(){i.handleDownloadEvent(t,o)}).catch(function(e){return e}):i.handleDownloadEvent(t,o):i.dispatchEvent("download-fail",{option:o},t)})},handleUploadDragleaveEvent:function(e){var t,o,i=this.reactData,n=e.currentTarget,a=e.clientX,e=e.clientY;n&&(t=(n=n.getBoundingClientRect()).x,o=n.y,a<t||t+n.width<a||e<o||o+n.height<e)&&(i.isDragUploadStatus=!1)},handleUploadDragoverEvent:function(e){var t=this.reactData,o=e.dataTransfer;o&&(o=o.items)&&o.length&&(e.preventDefault(),t.isDragUploadStatus=!0)},uploadTransferFileEvent:function(e,t){var o=this,i=o.internalData,n=o.imageTypes,a=o.fileTypes,i=i.imagePreviewTypes;if(o.computeIsImage){var r=i.concat(n&&n.length?n:[]);t=t.filter(function(e){var t="".concat(e.type.split("/")[1]||"").toLowerCase();return!!r.some(function(e){return"".concat(e).toLowerCase()===t})})}else if(a&&a.length){var l=[];if(t.forEach(function(e){var t=o.parseFileType(e.name);a.some(function(e){return"".concat(e).toLowerCase()===t})||l.push(t)}),l.length)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.error.notType",[l.join(", ")]),status:"error"}))}t.length?o.handleUploadFile(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")})},handleUploadDropEvent:function(e){var t=this.reactData,o=e.dataTransfer;o&&(o=o.items)&&o.length&&(e.preventDefault(),(o=handleTransferFiles(o)).length)&&this.uploadTransferFileEvent(e,o),t.isDragUploadStatus=!1},handleMoreEvent:function(e){var m=this,f=m,v=m.$scopedSlots,h=m.reactData,_=m.xID,x=m.computeFormReadonly,y=m.computeIsImage,e=e.$event;_ui.VxeUI.modal&&(_ui.VxeUI.modal.open({id:m.internalData.moreId,title:x?(0,_ui.getI18n)("vxe.upload.morePopup.readTitle"):(0,_ui.getI18n)("vxe.upload.morePopup.".concat(y?"imageTitle":"fileTitle")),width:660,height:500,escClosable:!0,showMaximize:!0,resize:!0,maskClosable:!0,slots:{default:function(e,t){var o=f.showErrorStatus,i=f.dragToUpload,n=f.dragSort,a=f.dragPlaceholder,r=h.isActivated,l=h.isDragMove,u=h.isDragUploadStatus,s=h.dragIndex,d=h.fileList,p=m.computeIsDisabled,c=v.moreContent||v["more-content"],g={};return i&&-1===s&&(g.dragover=m.handleUploadDragoverEvent,g.dragleave=m.handleUploadDragleaveEvent,g.drop=m.handleUploadDropEvent),t("div",{attrs:{id:"refPopupElem".concat(_)},class:["vxe-upload--more-popup",{"is--readonly":x,"is--disabled":p,"is--active":r,"show--error":o,"is--drag":u}],on:g},c?(0,_vn.getSlotVNs)(c({options:d})):[y?n?t("transition-group",{props:{name:"vxe-upload--drag-list".concat(l?"":"-disabled"),tag:"div"},class:"vxe-upload--image-more-list"},m.renderImageItemList(t,d,!0).concat(m.renderImageAction(t,!0))):t("div",{class:"vxe-upload--image-more-list"},m.renderImageItemList(t,d,!0).concat(m.renderImageAction(t,!0))):t("div",{class:"vxe-upload--file-more-list"},[m.renderFileAction(t,!0),n?t("transition-group",{props:{name:"vxe-upload--drag-list".concat(l?"":"-disabled"),tag:"div"},class:"vxe-upload--file-list"},m.renderFileItemList(t,d,!0)):t("div",{class:"vxe-upload--file-list"},m.renderFileItemList(t,d,!0))]),n?t("div",{attrs:{id:"refModalDragLineElem".concat(_)},class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(m),u?t("div",{class:"vxe-upload--drag-placeholder"},a||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(m)])}},events:{show:function(){h.showMorePopup=!0},hide:function(e){e=e.$event;h.showMorePopup=!1,e&&m.dispatchEvent("more-visible",{visible:!1},e)}}}),e)&&m.dispatchEvent("more-visible",{visible:!0},e)},handleDragSortDragstartEvent:function(e){var t=this.reactData,o=(e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0),e.currentTarget),e=o.parentElement,e=_xeUtils.default.findIndexOf(Array.from(e.children),function(e){return o===e});t.isDragMove=!0,t.dragIndex=e,setTimeout(function(){t.isDragMove=!1},500)},handleDragSortDragoverEvent:function(e){var t,o,i,n,a=this,r=a.reactData,l=a.internalData,r=(e.stopPropagation(),e.preventDefault(),r.dragIndex);-1!==r&&(t=a.computeIsImage,i=(o=e.currentTarget).parentElement,i=_xeUtils.default.findIndexOf(Array.from(i.children),function(e){return o===e}),n="",n=t?e.clientX-o.getBoundingClientRect().x<o.clientWidth/2?"left":"right":e.clientY-o.getBoundingClientRect().y<o.clientHeight/2?"top":"bottom",r===i?showDropTip(a,e,o,n):(showDropTip(a,e,o,n),l.prevDragIndex=i,l.prevDragPos=n))},handleDragSortDragendEvent:function(e){var t=this.reactData,o=this.internalData,i=t.fileList,n=o.prevDragIndex,o=o.prevDragPos,a=t.dragIndex,r="bottom"===o||"right"===o?1:0,l=i[a],u=i[n];l&&u&&(i.splice(a,1),n=_xeUtils.default.findIndexOf(i,function(e){return u===e})+r,i.splice(n,0,l),this.dispatchEvent("sort-dragend",{oldItem:l,newItem:u,dragPos:o,offsetIndex:r,_index:{newIndex:n,oldIndex:a}},e)),hideDropTip(this),t.dragIndex=-1},handleItemMousedownEvent:function(e){var t=this.$xeTable,o=this.reactData;t&&e.stopPropagation(),o.isActivated=!0},handleGlobalPasteEvent:function(e){var t=this.reactData,o=this.pasteToUpload;t.isActivated&&o&&(t=e.clipboardData||e.originalEvent.clipboardData)&&(o=t.items)&&(t=handleTransferFiles(o)).length&&(e.preventDefault(),this.uploadTransferFileEvent(e,t))},handleGlobalClickEvent:function(e){var t=this.reactData,o=this.$refs.refElem,i=this.$refs.refPopupElem,o=(0,_dom.getEventTargetNode)(e,o).flag;!o&&i&&(i=(i=i.parentElement||i)&&i.parentElement,o=(0,_dom.getEventTargetNode)(e,i).flag),t.isActivated=o},handleGlobalBlurEvent:function(){this.reactData.isActivated=!1},renderFileItemList:function(u,e,s){var d=this,t=d.$scopedSlots,o=d.reactData,p=d.showRemoveButton,c=d.showDownloadButton,g=d.showProgress,m=d.progressText,f=d.showPreview,v=d.showErrorStatus,h=d.dragSort,_=d.autoSubmit,x=d.showSubmitButton,y=o.fileList,I=o.fileCacheMaps,E=d.computeIsDisabled,D=d.computeFormReadonly,w=d.computeNameProp,U=d.computeTypeProp,b=t.option,S=t.action,T=t.corner,C=t.name,M={};return h&&1<e.length&&(M.dragstart=d.handleDragSortDragstartEvent,M.dragover=d.handleDragSortDragoverEvent,M.dragend=d.handleDragSortDragendEvent),e.map(function(t,o){var e=d.getFieldKey(t),i=I[e],n=!1,a=!1,r=!1,l="".concat(t[w]||"");return i&&(n=i.loading,a="error"===i.status,r="pending"===i.status),u("div",{key:h?e:o,class:["vxe-upload--file-item",{"is--preview":f,"is--loading":n,"is--pending":r,"is--error":a}],attrs:{fileid:e,draggable:!!h||null},on:M},b?(0,_vn.getSlotVNs)(b({option:t,isMoreView:s,options:y})):[u("div",{class:"vxe-upload--file-item-icon"},[u("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_".concat("".concat(t[U]).toLocaleUpperCase())]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),u("div",{class:"vxe-upload--file-item-name",attrs:{title:l},on:{click:function(e){n||a||d.handlePreviewFileEvent(e,t)}}},C?(0,_vn.getSlotVNs)(C({option:t,isMoreView:s,options:y})):l),n?u("div",{class:"vxe-upload--file-item-loading-icon"},[u("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(d),g&&n&&i?u("div",{class:"vxe-upload--file-item-loading-text"},m?_xeUtils.default.toFormatString("".concat(_xeUtils.default.isFunction(m)?m({}):m),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(d),!n&&(a&&v||r&&x&&!_)?u("div",{class:"vxe-upload--file-item-rebtn"},[u(_button.default,{props:{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")},on:{click:function(){d.handleReUpload(t)}}})]):(0,_ui.renderEmptyElement)(d),u("div",{class:"vxe-upload--file-item-btn-wrapper"},S?(0,_vn.getSlotVNs)(S({option:t,isMoreView:s,options:y,readonly:D})):[T?u("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(T({option:t,isMoreView:s,options:y,readonly:D}))):(0,_ui.renderEmptyElement)(d),c&&!n?u("div",{class:"vxe-upload--file-item-download-btn",on:{click:function(e){d.downloadFileEvent(e,t)}}},[u("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]):(0,_ui.renderEmptyElement)(d),!p||D||E||n?(0,_ui.renderEmptyElement)(d):u("div",{class:"vxe-upload--file-item-remove-btn",on:{click:function(e){d.removeFileEvent(e,t,o)}}},[u("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},renderFileAction:function(e,t){var o=this,i=o.$scopedSlots,n=o.showUploadButton,a=o.buttonText,r=o.buttonIcon,l=o.showButtonText,u=o.showButtonIcon,s=o.autoHiddenButton,d=o.reactData.fileList,p=o.computeIsDisabled,c=o.computedShowTipText,g=o.computedDefTipText,m=o.computeOverCount,f=i.default,i=i.tip||i.hint;return o.computeFormReadonly||!n?(0,_ui.renderEmptyElement)(o):e("div",{class:"vxe-upload--file-action"},[s&&m?(0,_ui.renderEmptyElement)(o):e("div",{class:"vxe-upload--file-action-btn",on:{click:o.clickEvent}},f?(0,_vn.getSlotVNs)(f({isMoreView:t,options:d,$upload:o})):[e(_button.default,{class:"vxe-upload--file-action-button",props:{content:t||l?a?"".concat(_xeUtils.default.isFunction(a)?a({}):a):(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:u?r||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:p}})]),c&&(g||i)?e("div",{class:"vxe-upload--file-action-tip"},i?(0,_vn.getSlotVNs)(i({isMoreView:t,options:d,$upload:o})):"".concat(g)):(0,_ui.renderEmptyElement)(o)])},rendeFileMode:function(e){var t=this,o=t.$scopedSlots,i=t.reactData,n=t.showList,a=t.moreConfig,r=t.dragSort,l=i.fileList,i=i.isDragMove,u=t.computeMoreOpts,s=u.maxCount,d=u.showMoreButton,p=u.moreButtonText,u="horizontal"===u.layout,o=o.moreButton||o["more-button"],c=l,g=0,m=!1,f=!1;return _xeUtils.default.isNumber(s)&&l.length>s&&(m=!0,f=0===s,g=l.length-s,c=l.slice(0,s)),e("div",{key:"all",class:"vxe-upload--file-wrapper"},n?[d&&a&&u?(0,_ui.renderEmptyElement)(t):t.renderFileAction(e,!0),e("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":u}]},[c.length?r?e("transition-group",{attrs:{name:"vxe-upload--drag-list".concat(i?"":"-disabled"),tag:"div"},class:"vxe-upload--file-list"},t.renderFileItemList(e,c,!1)):e("div",{class:"vxe-upload--file-list"},t.renderFileItemList(e,c,!1)):(0,_ui.renderEmptyElement)(t),d&&g?e("div",{class:"vxe-upload--file-over-more"},o?(0,_vn.getSlotVNs)(o({options:l})):[e(_button.default,{props:{mode:"text",content:p?_xeUtils.default.isFunction(p)?p({$upload:t,options:l}):_xeUtils.default.toFormatString(p,[l.length]):(0,_ui.getI18n)(m&&f?"vxe.upload.moreFileBtnText":"vxe.upload.moreBtnText",[l.length]),status:"primary"},on:{click:t.handleMoreEvent}})]):(0,_ui.renderEmptyElement)(t),d&&a&&u?t.renderFileAction(e,!1):(0,_ui.renderEmptyElement)(t)])]:[t.renderFileAction(e,!1)])},renderImageItemList:function(l,e,u){var s=this,t=s.$scopedSlots,o=s.reactData,d=s.showRemoveButton,p=s.showProgress,c=s.progressText,g=s.showPreview,m=s.showErrorStatus,f=s.dragSort,v=s.autoSubmit,h=s.showSubmitButton,_=o.fileList,x=o.fileCacheMaps,y=s.computeIsDisabled,I=s.computeFormReadonly,E=s.computeImageOpts,D=s.computeImgStyle,w=t.option,U=t.action,b=t.corner,S={};return f&&1<e.length&&(S.dragstart=s.handleDragSortDragstartEvent,S.dragover=s.handleDragSortDragoverEvent,S.dragend=s.handleDragSortDragendEvent),e.map(function(t,o){var e=s.getFieldKey(t),i=x[e],n=!1,a=!1,r=!1;return i&&(n=i.loading,a="error"===i.status,r="pending"===i.status),l("div",{key:f?e:o,class:["vxe-upload--image-item",{"is--preview":g,"is--circle":E.circle,"is--loading":n,"is--pending":r,"is--error":a}],attrs:{fileid:e,draggable:!!f||null},on:S},w?(0,_vn.getSlotVNs)(w({option:t,isMoreView:u,options:_})):[l("div",{class:"vxe-upload--image-item-box",style:u?{}:D,on:{click:function(e){n||a||s.handlePreviewImageEvent(e,t,o)}}},[n&&i?l("div",{class:"vxe-upload--image-item-loading"},[l("div",{class:"vxe-upload--image-item-loading-icon"},[l("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),p?l("div",{class:"vxe-upload--image-item-loading-text"},c?_xeUtils.default.toFormatString("".concat(_xeUtils.default.isFunction(c)?c({}):c),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(s)]):(0,_ui.renderEmptyElement)(s),l("div",{class:"vxe-upload--image-item-img-wrapper",attrs:{title:(0,_ui.getI18n)("vxe.upload.viewItemTitle")}},[l("img",{class:"vxe-upload--image-item-img",attrs:{src:s.getThumbnailFileUrl(t)}})]),!n&&(a&&m||r&&h&&!v)?l("div",{class:"vxe-upload--image-item-rebtn"},[l(_button.default,{props:{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")},on:{click:function(){s.handleReUpload(t)}}})]):(0,_ui.renderEmptyElement)(s),l("div",{class:"vxe-upload--image-item-btn-wrapper",on:{click:function(e){e.stopPropagation()}}},U?(0,_vn.getSlotVNs)(U({option:t,isMoreView:u,options:_,readonly:I})):[b?l("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(b({option:t,isMoreView:u,options:_,readonly:I}))):(0,_ui.renderEmptyElement)(s),!d||I||y||n?(0,_ui.renderEmptyElement)(s):l("div",{class:"vxe-upload--image-item-remove-btn",on:{click:function(e){e.stopPropagation(),s.removeFileEvent(e,t,o)}}},[l("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},renderImageAction:function(e,t){var o=this,i=o.$scopedSlots,n=o.showUploadButton,a=o.buttonText,r=o.buttonIcon,l=o.showButtonText,u=o.showButtonIcon,s=o.reactData.fileList,d=o.computedShowTipText,p=o.computedDefTipText,c=o.computeImgStyle,g=i.default,i=i.tip||i.hint;return o.computeFormReadonly||!n||o.autoHiddenButton&&o.computeOverCount?(0,_ui.renderEmptyElement)(o):e("div",{key:"action",class:"vxe-upload--image-action"},[e("div",{class:"vxe-upload--image-action-btn",on:{click:o.clickEvent}},g?g({isMoreView:t,options:s,$upload:o}):[e("div",{class:"vxe-upload--image-action-box",style:t?{}:c},[u?e("div",{class:"vxe-upload--image-action-icon"},[e("i",{class:r||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_ui.renderEmptyElement)(o),t||l?e("div",{class:"vxe-upload--image-action-content"},a?"".concat(_xeUtils.default.isFunction(a)?a({}):a):(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_ui.renderEmptyElement)(o),d&&(p||i)?e("div",{class:"vxe-upload--image-action-hint"},i?(0,_vn.getSlotVNs)(i({isMoreView:t,options:s,$upload:o})):"".concat(p)):(0,_ui.renderEmptyElement)(o)])])])},renderImageMode:function(e){var t=this,o=t.$scopedSlots,i=t.reactData,n=t.showList,a=t.dragSort,r=i.fileList,i=i.isDragMove,l=t.computeMoreOpts,o=o.moreButton||o["more-button"],u=l.maxCount,s=l.showMoreButton,l=l.moreButtonText,d=r,p=0,c=!1,g=!1;return _xeUtils.default.isNumber(u)&&r.length>u&&(c=!0,g=0===u,p=r.length-u,d=r.slice(0,u)),e("div",{key:"image",class:"vxe-upload--image-wrapper"},n?[a?e("transition-group",{attrs:{name:"vxe-upload--drag-list".concat(i?"":"-disabled"),tag:"div"},class:"vxe-upload--image-list"},t.renderImageItemList(e,d,!1).concat([s&&p?e("div",{key:"om",class:"vxe-upload--image-over-more"},o?(0,_vn.getSlotVNs)(o({options:r})):[e(_button.default,{props:{mode:"text",content:l?_xeUtils.default.isFunction(l)?l({$upload:t,options:r}):_xeUtils.default.toFormatString(l,[r.length]):(0,_ui.getI18n)(c&&g?"vxe.upload.moreImgBtnText":"vxe.upload.moreBtnText",[r.length]),status:"primary"},on:{click:t.handleMoreEvent}})]):(0,_ui.renderEmptyElement)(t),t.renderImageAction(e,!1)])):e("div",{class:"vxe-upload--image-list"},t.renderImageItemList(e,d,!1).concat([s&&p?e("div",{class:"vxe-upload--image-over-more"},o?(0,_vn.getSlotVNs)(o({options:r})):[e(_button.default,{props:{mode:"text",content:l?_xeUtils.default.isFunction(l)?l({$upload:t,options:r}):_xeUtils.default.toFormatString(l,[r.length]):(0,_ui.getI18n)(c&&g?"vxe.upload.moreImgBtnText":"vxe.upload.moreBtnText",[r.length]),status:"primary"},on:{click:t.handleMoreEvent}})]):(0,_ui.renderEmptyElement)(t),t.renderImageAction(e,!1)]))]:[e("div",{class:"vxe-upload--image-list"},[t.renderImageAction(e,!1)])])},renderVN:function(e){var t=this,o=t.reactData,i=t.showErrorStatus,n=t.pasteToUpload,a=t.dragSort,r=t.dragPlaceholder,l=o.isDragUploadStatus,u=o.showMorePopup,s=o.isActivated,d=t.computeSize,p=t.computeIsDisabled,c=t.computeFormReadonly,g=t.computeIsImage,m={};return t.dragToUpload&&-1===o.dragIndex&&(m.dragover=t.handleUploadDragoverEvent,m.dragleave=t.handleUploadDragleaveEvent,m.drop=t.handleUploadDropEvent),e("div",{ref:"refElem",class:["vxe-upload",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(d),d),"is--active",s),"is--readonly",c),"is--disabled",p),"is--paste",n),"show--error",i),"is--drag",l)],on:m},[g?t.renderImageMode(e):t.rendeFileMode(e),a?e("div",{ref:"refDragLineElem",class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(t),l&&!u?e("div",{class:"vxe-upload--drag-placeholder"},r||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(t)])}},created:function(){this.updateFileList()},mounted:function(){var e=this,t=e;t.multiple&&t.singleMode&&(0,_log.errLog)("vxe.error.errConflicts",["[upload] multiple","single-mode"]),t.imageStyle&&(0,_log.warnLog)("vxe.error.delProp",["[upload] image-style","image-config"]),t.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(e,"paste",e.handleGlobalPasteEvent),_ui.globalEvents.on(e,"click",e.handleGlobalClickEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent)},beforeDestroy:function(){var e=this,t=e.reactData,o=e.internalData;t.isDragUploadStatus=!1,_ui.globalEvents.off(e,"paste"),_ui.globalEvents.off(e,"click"),_ui.globalEvents.off(e,"blur"),_xeUtils.default.assign(t,createReactData()),_xeUtils.default.assign(o,createInternalData())},render:function(e){return this.renderVN(e)}});
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _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}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,o){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0===o)return("string"===t?String:Number)(e);o=o.call(e,t||"default");if("object"!=_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}function getUniqueKey(){return _xeUtils.default.uniqueId()}function handleTransferFiles(e){var t=[];return _xeUtils.default.arrayEach(e,function(e){e=e.getAsFile();e&&t.push(e)}),t}function showDropTip(e,t,o,i){var n=e.xID,a=e.reactData.showMorePopup,r=e.$refs.refElem,l=document.getElementById("refPopupElem".concat(n)),l=a?l:r;l&&(r=l.getBoundingClientRect(),l=e.$refs.refDragLineElem,e=document.getElementById("refModalDragLineElem".concat(n)),n=a?e:l)&&(a=o.getBoundingClientRect(),n.style.display="block",n.style.top="".concat(Math.max(1,a.y-r.y),"px"),n.style.left="".concat(Math.max(1,a.x-r.x),"px"),n.style.height="".concat(a.height,"px"),n.style.width="".concat(a.width-1,"px"),n.setAttribute("drag-pos",i))}function hideDropTip(e){var t=e.xID,e=e.$refs.refDragLineElem,t=document.getElementById("refModalDragLineElem".concat(t));e&&(e.style.display=""),t&&(t.style.display="")}var handleClearFile=function(o,i){var e=o.reactData.fileList,n=o.computeUrlProp,a=[];return _xeUtils.default.lastEach(e,function(t,e){a.push(o.removeFileEvent(i,t,e).then(function(e){return{url:t[n],status:e}}))}),Promise.all(a)};function handleRemoveFile(o,i,e){var n=o.reactData.fileList,a=o.computeUrlProp,e=_xeUtils.default.isArray(e)?e:[e],r=[];return e.forEach(function(e){var t;e&&(t=_xeUtils.default.isString(e)?e:e[a],-1<(e=_xeUtils.default.findIndexOf(n,function(e){return e[a]===t})))&&r.push(o.removeFileEvent(i,n[e],e).then(function(e){return{url:t,status:e}}))}),Promise.all(r)}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 _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeUpload",model:{prop:"value",event:"modelValue"},mixins:[_ui.globalMixins.sizeMixin],props:{value:[Array,String,Object],showList:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showList}},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},autoSubmit:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.autoSubmit}},mode:{type:String,default:function(){return(0,_ui.getConfig)().upload.mode}},imageTypes:{type:Array,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)}},imageConfig:{type:Object,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)}},imageStyle:{type:Object,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)}},fileTypes:{type:Array,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)}},dragSort:Boolean,dragToUpload:{type:Boolean,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)}},dragPlaceholder:{type:String,default:function(){return(0,_ui.getConfig)().upload.dragPlaceholder}},pasteToUpload:{type:Boolean,default:function(){return _xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)}},keyField:String,singleMode:Boolean,urlMode:Boolean,urlArgs:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.urlArgs}},multiple:Boolean,limitSize:{type:[String,Number],default:function(){return(0,_ui.getConfig)().upload.limitSize}},showLimitSize:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showLimitSize}},limitSizeText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.limitSizeText}},limitCount:{type:[String,Number],default:function(){return(0,_ui.getConfig)().upload.limitCount}},showLimitCount:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showLimitCount}},limitCountText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.limitCountText}},nameField:{type:String,default:function(){return(0,_ui.getConfig)().upload.nameField}},typeField:{type:String,default:function(){return(0,_ui.getConfig)().upload.typeField}},urlField:{type:String,default:function(){return(0,_ui.getConfig)().upload.urlField}},sizeField:{type:String,default:function(){return(0,_ui.getConfig)().upload.sizeField}},showErrorStatus:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showErrorStatus}},showProgress:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showProgress}},progressText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.progressText}},previewImageConfig:Object,showSubmitButton:Boolean,autoHiddenButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.autoHiddenButton}},showUploadButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showUploadButton}},buttonText:{type:[String,Number,Function],default:function(){return(0,_ui.getConfig)().upload.buttonText}},buttonIcon:{type:String,default:function(){return(0,_ui.getConfig)().upload.buttonIcon}},showButtonText:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showButtonText}},showButtonIcon:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showButtonIcon}},showRemoveButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showRemoveButton}},showDownloadButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showDownloadButton}},showPreview:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showPreview}},showTip:{type:Boolean,default:function(){return(0,_ui.getConfig)().upload.showTip}},maxSimultaneousUploads:{type:Number,default:function(){return(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:function(){return(0,_ui.getConfig)().upload.size||(0,_ui.getConfig)().size}}},inject:{$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null},$xeTable:{default:null}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:createReactData(),internalData:createInternalData()}},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeKeyField:function(){return this.keyField||"_X_KEY"},computeIsImage:function(){return"image"===this.mode},computeNameProp:function(){return this.nameField||"name"},computeTypeProp:function(){return this.typeField||"type"},computeUrlProp:function(){return this.urlField||"url"},computeSizeProp:function(){return this.sizeField||"size"},computeLimitMaxSize:function(){return 1024*_xeUtils.default.toNumber(this.limitSize)*1024},computeLimitMaxCount:function(){return this.multiple?_xeUtils.default.toNumber(this.limitCount):1},computePreviewImageOpts:function(){var e=this.showDownloadButton;return Object.assign({showDownloadButton:e},(0,_ui.getConfig)().upload.previewImageConfig,this.previewImageConfig)},computeOverCount:function(){var e=this.reactData,t=this.multiple,e=e.fileList,o=this.computeLimitMaxCount;return t?!o||e.length>=o:1<=e.length},computeLimitSizeUnit:function(){var e=_xeUtils.default.toNumber(this.limitSize);return e?1048576<e?"".concat(e/1048576,"T"):1024<e?"".concat(e/1024,"G"):"".concat(e,"M"):""},computedShowTipText:function(){var e=this.showTip,t=this.tipText;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t},computedDefTipText:function(){var e=this,t=e.limitSize,o=e.fileTypes,i=e.multiple,n=e.limitCount,e=e.tipText||e.hintText,a=this.computeIsImage,r=this.computeLimitSizeUnit;return _xeUtils.default.isString(e)?e:_xeUtils.default.isFunction(e)?"".concat(e({})):(e=[],a?(i&&n&&e.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[n])),t&&r&&e.push((0,_ui.getI18n)("vxe.upload.imgSizeHint",[r]))):(o&&o.length&&e.push((0,_ui.getI18n)("vxe.upload.fileTypeHint",[o.join("/")])),t&&r&&e.push((0,_ui.getI18n)("vxe.upload.fileSizeHint",[r])),i&&n&&e.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[n]))),e.join((0,_ui.getI18n)("vxe.base.comma")))},computeImageOpts:function(){return Object.assign({},this.imageConfig||this.imageStyle)},computeImgStyle:function(){var e=this.computeImageOpts,t=e.width,e=e.height,o={};return t&&(o.width=(0,_dom.toCssUnit)(t)),e&&(o.height=(0,_dom.toCssUnit)(e)),o},computeMoreOpts:function(){return Object.assign({showMoreButton:!0},this.moreConfig)}}),watch:{value:function(){this.updateFileList()}},methods:{dispatchEvent:function(e,t,o){this.$emit(e,(0,_ui.createEvent)(o,{$upload:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},choose:function(){return this.handleChoose(null)},clear:function(){return handleClearFile(this,null)},clearByEvent:function(e){return handleClearFile(this,e)},getPendingFiles:function(){var t=this,e=t.reactData,o=e.fileList,i=e.fileCacheMaps,n=[];return o.forEach(function(e){e=t.getFieldKey(e),e=i[e];e&&"pending"===e.status&&n.push(e.file)}),n},submit:function(i){var n=this,e=n.reactData,t=n.maxSimultaneousUploads,t=_xeUtils.default.toNumber(t||1)||1,o=e.fileList,a=e.fileCacheMaps,r=o.filter(function(e){e=n.getFieldKey(e),e=a[e];return e&&("pending"===e.status||i&&"error"===e.status)}),l=function(e){var t=n.getFieldKey(e),t=a[t];if(t){var o=t.file;if(o&&("pending"===t.status||i&&"error"===t.status))return t.loading=!0,t.percent=0,n.handleUploadResult(e,o).then(u)}return u()},u=function(){var e;return r.length?(e=r[0],r.splice(0,1),l(e).then(u)):Promise.resolve()};return Promise.all(r.splice(0,t).map(l)).then(function(){})},getMoreVisible:function(){return this.reactData.showMorePopup},openMore:function(){return this.handleMoreEvent({$event:new Event("click")}),this.$nextTick()},openMoreByEvent:function(e){return this.handleMoreEvent({$event:e}),this.$nextTick()},closeMore:function(){var e=this.internalData;return _ui.VxeUI.modal&&_ui.VxeUI.modal.close(e.moreId),this.$nextTick()},remove:function(e){return handleRemoveFile(this,null,e)},removeByEvent:function(e,t){return handleRemoveFile(this,e,t)},getFieldKey:function(e){return e[this.computeKeyField]},updateFileList:function(){var n=this,e=n.reactData,t=n.value,o=n.multiple,i=n.computeFormReadonly,a=n.computeKeyField,r=n.computeNameProp,l=n.computeTypeProp,u=n.computeUrlProp,s=n.computeSizeProp,t=t?(t?_xeUtils.default.isArray(t)?t:[t]:[]).map(function(e){var t,o,i;return!e||_xeUtils.default.isString(e)?(t="".concat(e||""),i=((o=_xeUtils.default.parseUrl(e))?o.searchQuery[r]:"")||n.parseFileName(t),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},r,i),l,(o?o.searchQuery[l]:"")||n.parseFileType(i)),u,t),s,_xeUtils.default.toNumber(o?o.searchQuery[s]:0)||0),a,getUniqueKey())):(i=e[r]||"",e[r]=i,e[l]=e[l]||n.parseFileType(i),e[u]=e[u]||"",e[s]=e[s]||0,e[a]=e[a]||getUniqueKey(),e)}):[];e.fileList=i||o?t:t.slice(0,1)},parseFileName:function(e){return decodeURIComponent("".concat(e||"")).split("/").pop()||""},parseFileType:function(e){var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},handleChange:function(e){var t=this.singleMode,o=this.urlMode,i=this.urlArgs,n=this.computeUrlProp,a=this.computeNameProp,e=e?e.slice(0):[];o&&(e=e.map(function(e){var t=e[n];if(t&&i){var o=_xeUtils.default.parseUrl(t);if(!o.searchQuery[a]&&-1===t.indexOf("blob:"))return"".concat(t).concat(-1===t.indexOf("?")?"?":"&").concat(encodeURIComponent(e[a]||""))}return t})),this.emitModel(t?e[0]||null:e)},getThumbnailFileUrl:function(e){var t=this.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod;return t?t({$upload:this,option:e}):this.getFileUrl(e)},getFileUrl:function(e){var t=this.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=this.computeUrlProp;return t?t({$upload:this,option:e}):e[o]},handleDefaultFilePreview:function(t){var e=this,o=e.internalData,i=e.imageTypes,n=e.computeTypeProp,a=e.computePreviewImageOpts,r=e.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;o.imagePreviewTypes.concat(i||[]).some(function(e){return"".concat(e).toLowerCase()==="".concat(t[n]).toLowerCase()})&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage(Object.assign(Object.assign({},a),{urlList:[e.getFileUrl(t)],beforeDownloadMethod:r?function(){return r({$upload:e,option:t})}:void 0}))},handlePreviewFileEvent:function(e,t){var o=this.previewMethod||(0,_ui.getConfig)().upload.previewMethod;this.showPreview&&(o?o({$upload:this,option:t}):this.handleDefaultFilePreview(t))},handlePreviewImageEvent:function(e,t,o){var i=this,n=i,a=i.reactData.fileList,r=i.computePreviewImageOpts,l=n.previewMethod||(0,_ui.getConfig)().upload.previewMethod,u=n.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;n.showPreview&&(l?l({$upload:i,option:t}):_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage(Object.assign(Object.assign({},r),{urlList:a.map(function(e){return i.getFileUrl(e)}),activeIndex:o,beforeDownloadMethod:u?function(e){e=e.index;return u({$upload:i,option:a[e]})}:void 0})))},handleUploadResult:function(i,e){var n=this,t=n,a=n.reactData,r=t.showErrorStatus,l=n.getFieldKey(i),t=t.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?Promise.resolve(t({$upload:n,file:e,option:i,updateProgress:function(e){var t=a.fileCacheMaps[n.getFieldKey(i)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(function(e){var t=a.fileCacheMaps[l];t&&(t.percent=100,t.status="success"),_xeUtils.default.each(e,function(e,t){n.$set(i,t,e)}),n.dispatchEvent("upload-success",{option:i,data:e},null)}).catch(function(e){var t=a.fileCacheMaps,o=t[l];o&&(o.status="error"),r?_xeUtils.default.each(e,function(e,t){n.$set(i,t,e)}):(a.fileList=a.fileList.filter(function(e){return n.getFieldKey(e)!==l}),delete t[l]),n.dispatchEvent("upload-error",{option:i,data:e},null)}).finally(function(){var e=a.fileCacheMaps[l];e&&(e.loading=!1)}):((t=a.fileCacheMaps[l])&&(t.loading=!1),Promise.resolve())},handleReUpload:function(e){var t=this,o=t.reactData,i=t.uploadMethod,n=t.urlMode,a=o.fileCacheMaps[t.getFieldKey(e)];(i||(0,_ui.getConfig)().upload.uploadMethod)&&a&&(i=a.file,a.loading=!0,a.status="pending",a.percent=0,t.handleUploadResult(e,i).then(function(){n&&t.handleChange(o.fileList)}))},handleUploadFile:function(e,t){var i=this,o=i,n=i.reactData,a=i.$xeForm,r=i.formItemInfo,l=o.multiple,u=o.urlMode,s=o.showLimitSize,d=o.limitSizeText,p=o.showLimitCount,c=o.limitCountText,f=o.autoSubmit,m=n.fileList,g=o.beforeSelectMethod||(0,_ui.getConfig)().upload.beforeSelectMethod,v=o.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,h=i.computeKeyField,_=i.computeNameProp,x=i.computeTypeProp,y=i.computeUrlProp,I=i.computeSizeProp,E=i.computeLimitMaxSize,D=i.computeLimitMaxCount,U=i.computeLimitSizeUnit,o=e;if(l&&D){if(p&&m.length>=D)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:c?"".concat(_xeUtils.default.isFunction(c)?c({maxCount:D}):c):(0,_ui.getI18n)("vxe.upload.overCountErr",[D])}));var w,b=o.length-(D-m.length);p&&0<b&&(w=o.slice(D-m.length),c?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:"".concat(_xeUtils.default.isFunction(c)?c({maxCount:D}):c)}):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",slots:{default:function(e,o){return o("div",{class:"vxe-upload--file-message-over-error"},[o("div",{},(0,_ui.getI18n)("vxe.upload.overCountExtraErr",[D,b])),o("div",{class:"vxe-upload--file-message-over-extra"},w.map(function(e,t){return o("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)}))])}}})),o=o.slice(0,D-m.length)}if(s&&E)for(var F=0;F<e.length;F++)if(e[0].size>E)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:d?"".concat(_xeUtils.default.isFunction(d)?d({maxSize:E}):d):(0,_ui.getI18n)("vxe.upload.overSizeErr",[U])}));var C=Object.assign({},n.fileCacheMaps),S=l?m:[],T=[];o.forEach(function(e){var t=e.name,o=getUniqueKey(),t=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},_,t),x,i.parseFileType(t)),I,e.size),y,URL.createObjectURL(e)),h,o),o=(v&&(C[o]={file:e,loading:!!f,status:"pending",percent:0}),t);g&&!g({$upload:i,file:e})||(v&&f&&T.push(i.handleUploadResult(o,e)),S.push(o))}),n.fileList=S,n.fileCacheMaps=C,S.forEach(function(e){i.dispatchEvent("add",{option:e},t)}),Promise.all(u?T:[]).then(function(){var e=n.fileList;i.handleChange(e),a&&r&&a.triggerItemEvent(t,r.itemConfig.field,e)})},handleChoose:function(t){var o=this,e=o.multiple,i=o.imageTypes,n=o.fileTypes,a=o.computeIsDisabled,r=o.computeIsImage;return a?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:r?i:n}).then(function(e){return o.handleUploadFile(e.files,t),e})},clickEvent:function(e){this.handleChoose(e).catch(function(){})},handleRemoveEvent:function(e,t,o){var i=this,n=i.reactData,a=i.$xeForm,r=i.formItemInfo,n=n.fileList;n.splice(o,1),i.handleChange(n),a&&r&&a.triggerItemEvent(e||{type:"remove"},r.itemConfig.field,n),e&&i.dispatchEvent("remove",{option:t},e)},removeFileEvent:function(t,o,i){var n=this,e=n,a=e.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod,r=e.removeMethod||(0,_ui.getConfig)().upload.removeMethod;return Promise.resolve(!a||a({$upload:n,option:o})).then(function(e){return e?r?Promise.resolve(r({$upload:n,option:o})).then(function(){n.handleRemoveEvent(t,o,i)}).catch(function(e){return e}):n.handleRemoveEvent(t,o,i):n.dispatchEvent("remove-fail",{option:o},t),e})},handleDownloadEvent:function(e,t){this.dispatchEvent("download",{option:t},e)},downloadFileEvent:function(t,o){var i=this,e=i,n=e.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod,a=e.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!n||n({$upload:i,option:o})).then(function(e){e?a?Promise.resolve(a({$upload:i,option:o})).then(function(){i.handleDownloadEvent(t,o)}).catch(function(e){return e}):i.handleDownloadEvent(t,o):i.dispatchEvent("download-fail",{option:o},t)})},handleUploadDragleaveEvent:function(e){var t,o,i=this.reactData,n=e.currentTarget,a=e.clientX,e=e.clientY;n&&(t=(n=n.getBoundingClientRect()).x,o=n.y,a<t||t+n.width<a||e<o||o+n.height<e)&&(i.isDragUploadStatus=!1)},handleUploadDragoverEvent:function(e){var t=this.reactData,o=e.dataTransfer;o&&(o=o.items)&&o.length&&(e.preventDefault(),t.isDragUploadStatus=!0)},uploadTransferFileEvent:function(e,t){var o=this,i=o.internalData,n=o.imageTypes,a=o.fileTypes,i=i.imagePreviewTypes;if(o.computeIsImage){var r=i.concat(n&&n.length?n:[]);t=t.filter(function(e){var t="".concat(e.type.split("/")[1]||"").toLowerCase();return!!r.some(function(e){return"".concat(e).toLowerCase()===t})})}else if(a&&a.length){var l=[];if(t.forEach(function(e){var t=o.parseFileType(e.name);a.some(function(e){return"".concat(e).toLowerCase()===t})||l.push(t)}),l.length)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.error.notType",[l.join(", ")]),status:"error"}))}t.length?o.handleUploadFile(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")})},handleUploadDropEvent:function(e){var t=this.reactData,o=e.dataTransfer;o&&(o=o.items)&&o.length&&(e.preventDefault(),(o=handleTransferFiles(o)).length)&&this.uploadTransferFileEvent(e,o),t.isDragUploadStatus=!1},handleMoreEvent:function(e){var m=this,g=m,v=m.$scopedSlots,h=m.reactData,_=m.xID,x=m.computeFormReadonly,y=m.computeIsImage,e=e.$event;_ui.VxeUI.modal&&(_ui.VxeUI.modal.open({id:m.internalData.moreId,title:x?(0,_ui.getI18n)("vxe.upload.morePopup.readTitle"):(0,_ui.getI18n)("vxe.upload.morePopup.".concat(y?"imageTitle":"fileTitle")),width:660,height:500,escClosable:!0,showMaximize:!0,resize:!0,maskClosable:!0,slots:{default:function(e,t){var o=g.showErrorStatus,i=g.dragToUpload,n=g.dragSort,a=g.dragPlaceholder,r=h.isActivated,l=h.isDragMove,u=h.isDragUploadStatus,s=h.dragIndex,d=h.fileList,p=m.computeIsDisabled,c=v.moreContent||v["more-content"],f={};return i&&-1===s&&(f.dragover=m.handleUploadDragoverEvent,f.dragleave=m.handleUploadDragleaveEvent,f.drop=m.handleUploadDropEvent),t("div",{attrs:{id:"refPopupElem".concat(_)},class:["vxe-upload--more-popup",{"is--readonly":x,"is--disabled":p,"is--active":r,"show--error":o,"is--drag":u}],on:f},c?(0,_vn.getSlotVNs)(c({options:d})):[y?n?t("transition-group",{props:{name:"vxe-upload--drag-list".concat(l?"":"-disabled"),tag:"div"},class:"vxe-upload--image-more-list"},m.renderImageItemList(t,d,!0).concat(m.renderImageAction(t,!0))):t("div",{class:"vxe-upload--image-more-list"},m.renderImageItemList(t,d,!0).concat(m.renderImageAction(t,!0))):t("div",{class:"vxe-upload--file-more-list"},[m.renderFileAction(t,!0),n?t("transition-group",{props:{name:"vxe-upload--drag-list".concat(l?"":"-disabled"),tag:"div"},class:"vxe-upload--file-list"},m.renderFileItemList(t,d,!0)):t("div",{class:"vxe-upload--file-list"},m.renderFileItemList(t,d,!0))]),n?t("div",{attrs:{id:"refModalDragLineElem".concat(_)},class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(m),u?t("div",{class:"vxe-upload--drag-placeholder"},a||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(m)])}},events:{show:function(){h.showMorePopup=!0},hide:function(e){e=e.$event;h.showMorePopup=!1,e&&m.dispatchEvent("more-visible",{visible:!1},e)}}}),e)&&m.dispatchEvent("more-visible",{visible:!0},e)},handleDragSortDragstartEvent:function(e){var t=this.reactData,o=(e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0),e.currentTarget),e=o.parentElement,e=_xeUtils.default.findIndexOf(Array.from(e.children),function(e){return o===e});t.isDragMove=!0,t.dragIndex=e,setTimeout(function(){t.isDragMove=!1},500)},handleDragSortDragoverEvent:function(e){var t,o,i,n,a=this,r=a.reactData,l=a.internalData,r=(e.stopPropagation(),e.preventDefault(),r.dragIndex);-1!==r&&(t=a.computeIsImage,i=(o=e.currentTarget).parentElement,i=_xeUtils.default.findIndexOf(Array.from(i.children),function(e){return o===e}),n="",n=t?e.clientX-o.getBoundingClientRect().x<o.clientWidth/2?"left":"right":e.clientY-o.getBoundingClientRect().y<o.clientHeight/2?"top":"bottom",r===i?showDropTip(a,e,o,n):(showDropTip(a,e,o,n),l.prevDragIndex=i,l.prevDragPos=n))},handleDragSortDragendEvent:function(e){var t=this.reactData,o=this.internalData,i=t.fileList,n=o.prevDragIndex,o=o.prevDragPos,a=t.dragIndex,r="bottom"===o||"right"===o?1:0,l=i[a],u=i[n];l&&u&&(i.splice(a,1),n=_xeUtils.default.findIndexOf(i,function(e){return u===e})+r,i.splice(n,0,l),this.dispatchEvent("sort-dragend",{oldItem:l,newItem:u,dragPos:o,offsetIndex:r,_index:{newIndex:n,oldIndex:a}},e)),hideDropTip(this),t.dragIndex=-1},handleItemMousedownEvent:function(e){var t=this.$xeTable,o=this.reactData;t&&e.stopPropagation(),o.isActivated=!0},handleGlobalPasteEvent:function(e){var t=this.reactData,o=this.pasteToUpload;t.isActivated&&o&&(t=e.clipboardData||e.originalEvent.clipboardData)&&(o=t.items)&&(t=handleTransferFiles(o)).length&&(e.preventDefault(),this.uploadTransferFileEvent(e,t))},handleGlobalClickEvent:function(e){var t=this.reactData,o=this.$refs.refElem,i=this.$refs.refPopupElem,o=(0,_dom.getEventTargetNode)(e,o).flag;!o&&i&&(i=(i=i.parentElement||i)&&i.parentElement,o=(0,_dom.getEventTargetNode)(e,i).flag),t.isActivated=o},handleGlobalBlurEvent:function(){this.reactData.isActivated=!1},renderFileItemList:function(u,e,s){var d=this,t=d.$scopedSlots,o=d.reactData,p=d.showRemoveButton,c=d.showDownloadButton,f=d.showProgress,m=d.progressText,g=d.showPreview,v=d.showErrorStatus,h=d.dragSort,_=d.autoSubmit,x=d.showSubmitButton,y=o.fileList,I=o.fileCacheMaps,E=d.computeIsDisabled,D=d.computeFormReadonly,U=d.computeNameProp,w=d.computeTypeProp,b=t.option,F=t.action,C=t.corner,S=t.name,T={};return h&&1<e.length&&(T.dragstart=d.handleDragSortDragstartEvent,T.dragover=d.handleDragSortDragoverEvent,T.dragend=d.handleDragSortDragendEvent),e.map(function(t,o){var e=d.getFieldKey(t),i=I[e],n=!1,a=!1,r=!1,l="".concat(t[U]||"");return i&&(n=i.loading,a="error"===i.status,r="pending"===i.status),u("div",{key:h?e:o,class:["vxe-upload--file-item",{"is--preview":g,"is--loading":n,"is--pending":r,"is--error":a}],attrs:{fileid:e,draggable:!!h||null},on:T},b?(0,_vn.getSlotVNs)(b({option:t,isMoreView:s,options:y})):[u("div",{class:"vxe-upload--file-item-icon"},[u("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_".concat("".concat(t[w]).toLocaleUpperCase())]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),u("div",{class:"vxe-upload--file-item-name",attrs:{title:l},on:{click:function(e){n||a||d.handlePreviewFileEvent(e,t)}}},S?(0,_vn.getSlotVNs)(S({option:t,isMoreView:s,options:y})):l),n?u("div",{class:"vxe-upload--file-item-loading-icon"},[u("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(d),f&&n&&i?u("div",{class:"vxe-upload--file-item-loading-text"},m?_xeUtils.default.toFormatString("".concat(_xeUtils.default.isFunction(m)?m({}):m),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(d),!n&&(a&&v||r&&x&&!_)?u("div",{class:"vxe-upload--file-item-rebtn"},[u(_button.default,{props:{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")},on:{click:function(){d.handleReUpload(t)}}})]):(0,_ui.renderEmptyElement)(d),u("div",{class:"vxe-upload--file-item-btn-wrapper"},F?(0,_vn.getSlotVNs)(F({option:t,isMoreView:s,options:y,readonly:D})):[C?u("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(C({option:t,isMoreView:s,options:y,readonly:D}))):(0,_ui.renderEmptyElement)(d),c&&!n?u("div",{class:"vxe-upload--file-item-download-btn",on:{click:function(e){d.downloadFileEvent(e,t)}}},[u("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]):(0,_ui.renderEmptyElement)(d),!p||D||E||n?(0,_ui.renderEmptyElement)(d):u("div",{class:"vxe-upload--file-item-remove-btn",on:{click:function(e){d.removeFileEvent(e,t,o)}}},[u("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},renderFileAction:function(e,t){var o=this,i=o.$scopedSlots,n=o.showUploadButton,a=o.buttonText,r=o.buttonIcon,l=o.showButtonText,u=o.showButtonIcon,s=o.autoHiddenButton,d=o.reactData.fileList,p=o.computeIsDisabled,c=o.computedShowTipText,f=o.computedDefTipText,m=o.computeOverCount,g=i.default,i=i.tip||i.hint;return o.computeFormReadonly||!n?(0,_ui.renderEmptyElement)(o):e("div",{class:"vxe-upload--file-action"},[s&&m?(0,_ui.renderEmptyElement)(o):e("div",{class:"vxe-upload--file-action-btn",on:{click:o.clickEvent}},g?(0,_vn.getSlotVNs)(g({isMoreView:t,options:d,$upload:o})):[e(_button.default,{class:"vxe-upload--file-action-button",props:{content:t||l?a?"".concat(_xeUtils.default.isFunction(a)?a({}):a):(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:u?r||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:p}})]),c&&(f||i)?e("div",{class:"vxe-upload--file-action-tip"},i?(0,_vn.getSlotVNs)(i({isMoreView:t,options:d,$upload:o})):"".concat(f)):(0,_ui.renderEmptyElement)(o)])},rendeFileMode:function(e){var t=this,o=t.$scopedSlots,i=t.reactData,n=t.showList,a=t.moreConfig,r=t.dragSort,l=i.fileList,i=i.isDragMove,u=t.computeMoreOpts,s=u.maxCount,d=u.showMoreButton,p=u.moreButtonText,u="horizontal"===u.layout,o=o.moreButton||o["more-button"],c=l,f=0,m=!1,g=!1;return _xeUtils.default.isNumber(s)&&l.length>s&&(m=!0,g=0===s,f=l.length-s,c=l.slice(0,s)),e("div",{key:"all",class:"vxe-upload--file-wrapper"},n?[d&&a&&u?(0,_ui.renderEmptyElement)(t):t.renderFileAction(e,!0),e("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":u}]},[c.length?r?e("transition-group",{attrs:{name:"vxe-upload--drag-list".concat(i?"":"-disabled"),tag:"div"},class:"vxe-upload--file-list"},t.renderFileItemList(e,c,!1)):e("div",{class:"vxe-upload--file-list"},t.renderFileItemList(e,c,!1)):(0,_ui.renderEmptyElement)(t),d&&f?e("div",{class:"vxe-upload--file-over-more"},o?(0,_vn.getSlotVNs)(o({options:l})):[e(_button.default,{props:{mode:"text",content:p?_xeUtils.default.isFunction(p)?p({$upload:t,options:l}):_xeUtils.default.toFormatString(p,[l.length]):(0,_ui.getI18n)(m&&g?"vxe.upload.moreFileBtnText":"vxe.upload.moreBtnText",[l.length]),status:"primary"},on:{click:t.handleMoreEvent}})]):(0,_ui.renderEmptyElement)(t),d&&a&&u?t.renderFileAction(e,!1):(0,_ui.renderEmptyElement)(t)])]:[t.renderFileAction(e,!1)])},renderImageItemList:function(l,e,u){var s=this,t=s.$scopedSlots,o=s.reactData,d=s.showRemoveButton,p=s.showProgress,c=s.progressText,f=s.showPreview,m=s.showErrorStatus,g=s.dragSort,v=s.autoSubmit,h=s.showSubmitButton,_=o.fileList,x=o.fileCacheMaps,y=s.computeIsDisabled,I=s.computeFormReadonly,E=s.computeImageOpts,D=s.computeImgStyle,U=t.option,w=t.action,b=t.corner,F={};return g&&1<e.length&&(F.dragstart=s.handleDragSortDragstartEvent,F.dragover=s.handleDragSortDragoverEvent,F.dragend=s.handleDragSortDragendEvent),e.map(function(t,o){var e=s.getFieldKey(t),i=x[e],n=!1,a=!1,r=!1;return i&&(n=i.loading,a="error"===i.status,r="pending"===i.status),l("div",{key:g?e:o,class:["vxe-upload--image-item",{"is--preview":f,"is--circle":E.circle,"is--loading":n,"is--pending":r,"is--error":a}],attrs:{fileid:e,draggable:!!g||null},on:F},U?(0,_vn.getSlotVNs)(U({option:t,isMoreView:u,options:_})):[l("div",{class:"vxe-upload--image-item-box",style:u?{}:D,on:{click:function(e){n||a||s.handlePreviewImageEvent(e,t,o)}}},[n&&i?l("div",{class:"vxe-upload--image-item-loading"},[l("div",{class:"vxe-upload--image-item-loading-icon"},[l("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),p?l("div",{class:"vxe-upload--image-item-loading-text"},c?_xeUtils.default.toFormatString("".concat(_xeUtils.default.isFunction(c)?c({}):c),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(s)]):(0,_ui.renderEmptyElement)(s),l("div",{class:"vxe-upload--image-item-img-wrapper",attrs:{title:(0,_ui.getI18n)("vxe.upload.viewItemTitle")}},[l("img",{class:"vxe-upload--image-item-img",attrs:{src:s.getThumbnailFileUrl(t)}})]),!n&&(a&&m||r&&h&&!v)?l("div",{class:"vxe-upload--image-item-rebtn"},[l(_button.default,{props:{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")},on:{click:function(){s.handleReUpload(t)}}})]):(0,_ui.renderEmptyElement)(s),l("div",{class:"vxe-upload--image-item-btn-wrapper",on:{click:function(e){e.stopPropagation()}}},w?(0,_vn.getSlotVNs)(w({option:t,isMoreView:u,options:_,readonly:I})):[b?l("div",{class:"vxe-upload--file-item-action"},(0,_vn.getSlotVNs)(b({option:t,isMoreView:u,options:_,readonly:I}))):(0,_ui.renderEmptyElement)(s),!d||I||y||n?(0,_ui.renderEmptyElement)(s):l("div",{class:"vxe-upload--image-item-remove-btn",on:{click:function(e){e.stopPropagation(),s.removeFileEvent(e,t,o)}}},[l("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},renderImageAction:function(e,t){var o=this,i=o.$scopedSlots,n=o.showUploadButton,a=o.buttonText,r=o.buttonIcon,l=o.showButtonText,u=o.showButtonIcon,s=o.reactData.fileList,d=o.computedShowTipText,p=o.computedDefTipText,c=o.computeImgStyle,f=i.default,i=i.tip||i.hint;return o.computeFormReadonly||!n||o.autoHiddenButton&&o.computeOverCount?(0,_ui.renderEmptyElement)(o):e("div",{key:"action",class:"vxe-upload--image-action"},[e("div",{class:"vxe-upload--image-action-btn",on:{click:o.clickEvent}},f?f({isMoreView:t,options:s,$upload:o}):[e("div",{class:"vxe-upload--image-action-box",style:t?{}:c},[u?e("div",{class:"vxe-upload--image-action-icon"},[e("i",{class:r||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_ui.renderEmptyElement)(o),t||l?e("div",{class:"vxe-upload--image-action-content"},a?"".concat(_xeUtils.default.isFunction(a)?a({}):a):(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_ui.renderEmptyElement)(o),d&&(p||i)?e("div",{class:"vxe-upload--image-action-hint"},i?(0,_vn.getSlotVNs)(i({isMoreView:t,options:s,$upload:o})):"".concat(p)):(0,_ui.renderEmptyElement)(o)])])])},renderImageMode:function(e){var t=this,o=t.$scopedSlots,i=t.reactData,n=t.showList,a=t.dragSort,r=i.fileList,i=i.isDragMove,l=t.computeMoreOpts,o=o.moreButton||o["more-button"],u=l.maxCount,s=l.showMoreButton,l=l.moreButtonText,d=r,p=0,c=!1,f=!1;return _xeUtils.default.isNumber(u)&&r.length>u&&(c=!0,f=0===u,p=r.length-u,d=r.slice(0,u)),e("div",{key:"image",class:"vxe-upload--image-wrapper"},n?[a?e("transition-group",{attrs:{name:"vxe-upload--drag-list".concat(i?"":"-disabled"),tag:"div"},class:"vxe-upload--image-list"},t.renderImageItemList(e,d,!1).concat([s&&p?e("div",{key:"om",class:"vxe-upload--image-over-more"},o?(0,_vn.getSlotVNs)(o({options:r})):[e(_button.default,{props:{mode:"text",content:l?_xeUtils.default.isFunction(l)?l({$upload:t,options:r}):_xeUtils.default.toFormatString(l,[r.length]):(0,_ui.getI18n)(c&&f?"vxe.upload.moreImgBtnText":"vxe.upload.moreBtnText",[r.length]),status:"primary"},on:{click:t.handleMoreEvent}})]):(0,_ui.renderEmptyElement)(t),t.renderImageAction(e,!1)])):e("div",{class:"vxe-upload--image-list"},t.renderImageItemList(e,d,!1).concat([s&&p?e("div",{class:"vxe-upload--image-over-more"},o?(0,_vn.getSlotVNs)(o({options:r})):[e(_button.default,{props:{mode:"text",content:l?_xeUtils.default.isFunction(l)?l({$upload:t,options:r}):_xeUtils.default.toFormatString(l,[r.length]):(0,_ui.getI18n)(c&&f?"vxe.upload.moreImgBtnText":"vxe.upload.moreBtnText",[r.length]),status:"primary"},on:{click:t.handleMoreEvent}})]):(0,_ui.renderEmptyElement)(t),t.renderImageAction(e,!1)]))]:[e("div",{class:"vxe-upload--image-list"},[t.renderImageAction(e,!1)])])},renderVN:function(e){var t=this,o=t.reactData,i=t.showErrorStatus,n=t.pasteToUpload,a=t.dragSort,r=t.dragPlaceholder,l=o.isDragUploadStatus,u=o.showMorePopup,s=o.isActivated,d=t.computeSize,p=t.computeIsDisabled,c=t.computeFormReadonly,f=t.computeIsImage,m={};return t.dragToUpload&&-1===o.dragIndex&&(m.dragover=t.handleUploadDragoverEvent,m.dragleave=t.handleUploadDragleaveEvent,m.drop=t.handleUploadDropEvent),e("div",{ref:"refElem",class:["vxe-upload",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(d),d),"is--active",s),"is--readonly",c),"is--disabled",p),"is--paste",n),"show--error",i),"is--drag",l)],on:m},[f?t.renderImageMode(e):t.rendeFileMode(e),a?e("div",{ref:"refDragLineElem",class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(t),l&&!u?e("div",{class:"vxe-upload--drag-placeholder"},r||(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(t)])}},created:function(){this.updateFileList()},mounted:function(){var e=this,t=e;t.multiple&&t.singleMode&&(0,_log.errLog)("vxe.error.errConflicts",["[upload] multiple","single-mode"]),t.imageStyle&&(0,_log.warnLog)("vxe.error.delProp",["[upload] image-style","image-config"]),t.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(e,"paste",e.handleGlobalPasteEvent),_ui.globalEvents.on(e,"click",e.handleGlobalClickEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent)},beforeDestroy:function(){var e=this,t=e.reactData,o=e.internalData;t.isDragUploadStatus=!1,_ui.globalEvents.off(e,"paste"),_ui.globalEvents.off(e,"click"),_ui.globalEvents.off(e,"blur"),_xeUtils.default.assign(t,createReactData()),_xeUtils.default.assign(o,createInternalData())},render:function(e){return this.renderVN(e)}});