vxe-pc-ui 3.3.104 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/color-picker/src/color-picker.js +37 -1
- package/es/color-picker/style.css +23 -3
- package/es/color-picker/style.min.css +1 -1
- package/es/icon/{iconfont.1740799717762.ttf → iconfont.1741051466512.ttf} +0 -0
- package/es/icon/iconfont.1741051466512.woff +0 -0
- package/es/icon/iconfont.1741051466512.woff2 +0 -0
- package/es/icon/style.css +5 -1
- package/es/icon/style.min.css +1 -1
- package/es/icon-picker/src/icon-picker.js +9 -3
- package/{lib/icon/style/iconfont.1740799717762.ttf → es/iconfont.1741051466512.ttf} +0 -0
- package/es/iconfont.1741051466512.woff +0 -0
- package/es/iconfont.1741051466512.woff2 +0 -0
- package/es/modal/src/modal.js +6 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tooltip/src/tooltip.js +5 -5
- package/es/tooltip/style.css +24 -24
- package/es/tooltip/style.min.css +1 -1
- package/es/ui/index.js +3 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-color-picker/style.css +23 -3
- package/es/vxe-color-picker/style.min.css +1 -1
- package/es/vxe-icon/style.css +5 -1
- package/es/vxe-icon/style.min.css +1 -1
- package/es/vxe-tooltip/style.css +24 -24
- package/es/vxe-tooltip/style.min.css +1 -1
- package/lib/color-picker/src/color-picker.js +32 -2
- package/lib/color-picker/src/color-picker.min.js +1 -1
- package/lib/color-picker/style/style.css +23 -3
- package/lib/color-picker/style/style.min.css +1 -1
- package/lib/{iconfont.1740799717762.ttf → icon/style/iconfont.1741051466512.ttf} +0 -0
- package/lib/icon/style/iconfont.1741051466512.woff +0 -0
- package/lib/icon/style/iconfont.1741051466512.woff2 +0 -0
- package/lib/icon/style/style.css +5 -1
- package/lib/icon/style/style.min.css +5 -1
- package/lib/icon-picker/src/icon-picker.js +9 -3
- package/lib/icon-picker/src/icon-picker.min.js +1 -1
- package/{es/iconfont.1740799717762.ttf → lib/iconfont.1741051466512.ttf} +0 -0
- package/lib/iconfont.1741051466512.woff +0 -0
- package/lib/iconfont.1741051466512.woff2 +0 -0
- package/lib/index.umd.js +56 -15
- package/lib/index.umd.min.js +1 -1
- package/lib/modal/src/modal.js +6 -2
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tooltip/src/tooltip.js +5 -5
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tooltip/style/style.css +24 -24
- package/lib/tooltip/style/style.min.css +1 -1
- package/lib/ui/index.js +3 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-color-picker/style/style.css +23 -3
- package/lib/vxe-color-picker/style/style.min.css +1 -1
- package/lib/vxe-icon/style/style.css +5 -1
- package/lib/vxe-icon/style/style.min.css +1 -1
- package/lib/vxe-tooltip/style/style.css +24 -24
- package/lib/vxe-tooltip/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/color-picker/src/color-picker.ts +38 -1
- package/packages/icon-picker/src/icon-picker.ts +9 -3
- package/packages/modal/src/modal.ts +6 -2
- package/packages/tooltip/src/tooltip.ts +5 -5
- package/packages/ui/index.ts +2 -1
- package/styles/components/color-picker.scss +21 -3
- package/styles/components/icon.scss +5 -1
- package/styles/components/tooltip.scss +11 -11
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/types/components/color-picker.d.ts +2 -0
- package/types/components/icon-picker.d.ts +4 -1
- package/types/components/icon.d.ts +1 -1
- package/types/components/table.d.ts +46 -0
- package/types/ui/global-icon.d.ts +1 -0
- package/es/icon/iconfont.1740799717762.woff +0 -0
- package/es/icon/iconfont.1740799717762.woff2 +0 -0
- package/es/iconfont.1740799717762.woff +0 -0
- package/es/iconfont.1740799717762.woff2 +0 -0
- package/lib/icon/style/iconfont.1740799717762.woff +0 -0
- package/lib/icon/style/iconfont.1740799717762.woff2 +0 -0
- package/lib/iconfont.1740799717762.woff +0 -0
- package/lib/iconfont.1740799717762.woff2 +0 -0
package/lib/modal/src/modal.js
CHANGED
|
@@ -837,6 +837,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
837
837
|
},
|
|
838
838
|
handleMaximize: function handleMaximize() {
|
|
839
839
|
var $xeModal = this;
|
|
840
|
+
var props = $xeModal;
|
|
840
841
|
var reactData = $xeModal.reactData;
|
|
841
842
|
var prevZoomStatus = reactData.zoomStatus;
|
|
842
843
|
reactData.prevZoomStatus = prevZoomStatus;
|
|
@@ -846,9 +847,12 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
846
847
|
if (boxElem) {
|
|
847
848
|
// 如果当前处于复原状态
|
|
848
849
|
if (!prevZoomStatus) {
|
|
850
|
+
var marginSize = _xeUtils.default.toNumber(props.marginSize);
|
|
851
|
+
var clientVisibleWidth = document.documentElement.clientWidth || document.body.clientWidth;
|
|
852
|
+
var clientVisibleHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
|
849
853
|
reactData.revertLocat = {
|
|
850
|
-
top: boxElem.
|
|
851
|
-
left: boxElem.
|
|
854
|
+
top: Math.max(marginSize, clientVisibleHeight / 2 - boxElem.offsetHeight / 2),
|
|
855
|
+
left: Math.max(marginSize, clientVisibleWidth / 2 - boxElem.offsetWidth / 2),
|
|
852
856
|
width: boxElem.offsetWidth + (boxElem.style.width ? 0 : 1),
|
|
853
857
|
height: boxElem.offsetHeight + (boxElem.style.height ? 0 : 1)
|
|
854
858
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.allActiveModals=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"),_button=_interopRequireDefault(require("../../button/src/button")),_index=_interopRequireDefault(require("../../loading/index")),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default: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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=Array(t);o<t;o++)i[o]=e[o];return i}function _iterableToArrayLimit(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i,n,a,l,r=[],s=!0,u=!1;try{if(a=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;s=!1}else for(;!(s=(i=a.call(o)).done)&&(r.push(i.value),r.length!==t);s=!0);}catch(e){u=!0,n=e}finally{try{if(!s&&null!=o.return&&(l=o.return(),Object(l)!==l))return}finally{if(u)throw n}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}var allActiveModals=exports.allActiveModals=[],msgQueue=[],notifyQueue=[],lockScrollAttrKey="data-vxe-lock-scroll",lockScrollCssWidthKey="--vxe-ui-modal-lock-scroll-view-width",_default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeModal",mixins:[_ui.globalMixins.sizeMixin,_ui.globalMixins.permissionMixin],props:{value:Boolean,id:String,type:{type:String,default:"modal"},loading:{type:Boolean,default:null},status:String,iconStatus:String,className:String,top:{type:[Number,String],default:function(){return(0,_ui.getConfig)().modal.top}},position:[String,Object],title:String,duration:{type:[Number,String],default:function(){return(0,_ui.getConfig)().modal.duration}},content:[Number,String],showCancelButton:{type:Boolean,default:null},cancelButtonText:{type:String,default:function(){return(0,_ui.getConfig)().modal.cancelButtonText}},showConfirmButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.showConfirmButton}},confirmButtonText:{type:String,default:function(){return(0,_ui.getConfig)().modal.confirmButtonText}},lockView:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.lockView}},lockScroll:Boolean,mask:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.mask}},maskClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.maskClosable}},escClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.escClosable}},cancelClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.cancelClosable}},confirmClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.confirmClosable}},resize:Boolean,showHeader:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.showHeader}},showFooter:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.showFooter}},showZoom:Boolean,zoomConfig:Object,showMaximize:{type:Boolean,default:function(){return(0,_utils.handleBooleanDefaultValue)((0,_ui.getConfig)().modal.showMaximize)}},showMinimize:{type:Boolean,default:function(){return(0,_utils.handleBooleanDefaultValue)((0,_ui.getConfig)().modal.showMinimize)}},showClose:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.showClose}},dblclickZoom:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.dblclickZoom}},width:[Number,String],height:[Number,String],minWidth:{type:[Number,String],default:function(){return(0,_ui.getConfig)().modal.minWidth}},minHeight:{type:[Number,String],default:function(){return(0,_ui.getConfig)().modal.minHeight}},zIndex:Number,marginSize:{type:[Number,String],default:function(){return(0,_ui.getConfig)().modal.marginSize}},fullscreen:Boolean,draggable:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.draggable}},remember:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.remember}},destroyOnClose:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.destroyOnClose}},showTitleOverflow:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.showTitleOverflow}},transfer:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.transfer}},storage:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.storage}},storageKey:{type:String,default:function(){return(0,_ui.getConfig)().modal.storageKey}},padding:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.padding}},size:{type:String,default:function(){return(0,_ui.getConfig)().modal.size||(0,_ui.getConfig)().size}},beforeHideMethod:Function,slots:Object,message:[Number,String],animat:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.animat}}},inject:{$xeParentModal:{from:"$xeModal",default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null}},provide:function(){return{$xeModal:this}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1,visible:!1,contentVisible:!1,modalTop:0,modalZindex:0,prevZoomStatus:"",zoomStatus:"",revertLocat:null,prevLocat:null,firstOpen:!0},internalData:{msgTimeout:void 0}}},computed:Object.assign(Object.assign({},{}),{computeBtnTransfer:function(){var e=this,t=e.$xeTable,o=e.$xeParentModal,i=e.$xeDrawer,n=e.$xeForm,e=e.transfer;if(null===e){var a=(0,_ui.getConfig)().select.transfer;if(_xeUtils.default.isBoolean(a))return a;if(t||o||i||n)return!0}return e},computeIsMsg:function(){return"message"===this.type||"notification"===this.type},computeIsMinimizeStatus:function(){return"minimize"===this.reactData.zoomStatus},computeIsMaximizeStatus:function(){return"maximize"===this.reactData.zoomStatus},computeZoomOpts:function(){return Object.assign({},(0,_ui.getConfig)().modal.zoomConfig,this.zoomConfig)}}),watch:{width:function(){this.recalculate()},height:function(){this.recalculate()},value:function(e){e?this.openModal():this.closeModal("model")}},methods:{dispatchEvent:function(e,t,o){this.$emit(e,(0,_ui.createEvent)(o,{$modal:this},t))},emitModel:function(e){var t=this._events;this.$emit("input",e),t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},callSlot:function(e,t,o){var i=this.$scopedSlots;return e&&(_xeUtils.default.isString(e)&&(e=i[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e.call(this,t,o)):[]},open:function(){return this.openModal()},close:function(){return this.closeModal("close")},getBox:function(){return this.$refs.refModalBox},getPosition:function(){if(!this.computeIsMsg){var e=this.getBox();if(e)return{top:e.offsetTop,left:e.offsetLeft}}return null},setPosition:function(e,t){var o;return this.computeIsMsg||(o=this.getBox())&&(_xeUtils.default.isNumber(e)&&(o.style.top="".concat(e,"px")),_xeUtils.default.isNumber(t))&&(o.style.left="".concat(t,"px")),this.$nextTick()},isMinimized:function(){return"minimize"===this.reactData.zoomStatus},isMaximized:function(){return"maximize"===this.reactData.zoomStatus},zoom:function(){return this.handleZoom()},minimize:function(){return this.reactData.visible?this.handleMinimize():Promise.resolve({status:!1})},maximize:function(){return this.reactData.visible?this.handleMaximize():Promise.resolve({status:!1})},revert:function(){return this.reactData.visible?this.handleRevert():Promise.resolve({status:!1})},recalculate:function(){var e=this.width,t=this.height,o=this.getBox();return o&&(o.style.width=e?(0,_dom.toCssUnit)(e):"",o.style.height=t?(0,_dom.toCssUnit)(t):""),this.$nextTick()},updateZindex:function(){var e=this.reactData,t=this.zIndex,o=e.modalZindex;t?e.modalZindex=t:o<(0,_utils.getLastZIndex)()&&(e.modalZindex=(0,_utils.nextZIndex)())},updatePosition:function(){var c=this,d=c;return c.$nextTick().then(function(){var e,t,o,i,n,a,l,r=d.position,s=_xeUtils.default.toNumber(d.marginSize),u=c.getBox();u&&(e=document.documentElement.clientWidth||document.body.clientWidth,t=document.documentElement.clientHeight||document.body.clientHeight,o="center"===r,i=(r=_xeUtils.default.isString(r)?{top:r,left:r}:Object.assign({},r)).top,n=o||"center"===i,a=l="",a=(r=r.left)&&!(o||"center"===r)?isNaN(r)?r:"".concat(r,"px"):"".concat(Math.max(s,e/2-u.offsetWidth/2),"px"),l=i&&!n?isNaN(i)?i:"".concat(i,"px"):"".concat(Math.max(s,t/2-u.offsetHeight/2),"px"),u.style.top=l,u.style.left=a)})},updateStyle:function(){var t=this;this.$nextTick(function(){var e=t.type,o=0;("notification"===e?notifyQueue:msgQueue).forEach(function(e){var t=e.getBox();t&&(o+=_xeUtils.default.toNumber(e.top),e.reactData.modalTop=o,o+=t.clientHeight)})})},removeMsgQueue:function(){var t=this,e="notification"===t.type?notifyQueue:msgQueue;-1<e.indexOf(t)&&_xeUtils.default.remove(e,function(e){return e===t}),t.updateStyle()},closeModal:function(e){var t=this,o=t.reactData,i=t.remember,n=o.visible,a=t.computeIsMsg,l=t.beforeHideMethod||(0,_ui.getConfig)().modal.beforeHideMethod,r={type:e};return n&&Promise.resolve(l?l(r):null).then(function(e){_xeUtils.default.isError(e)||(a&&t.removeMsgQueue(),o.contentVisible=!1,i||t.handleRevert(),_xeUtils.default.remove(allActiveModals,function(e){return e===t}),t.dispatchEvent("before-hide",r,null),setTimeout(function(){o.visible=!1,t.emitModel(!1),t.dispatchEvent("hide",r,null)},200),t.removeBodyLockScroll())}).catch(function(e){return e}),t.$nextTick()},closeEvent:function(e){var t="close";this.dispatchEvent(t,{type:t},e),this.closeModal(t)},confirmEvent:function(e){var t=this.confirmClosable,o="confirm";this.dispatchEvent(o,{type:o},e),t&&this.closeModal(o)},cancelEvent:function(e){var t=this.cancelClosable,o="cancel";this.dispatchEvent(o,{type:o},e),t&&this.closeModal(o)},getStorageMap:function(e){var t=(0,_ui.getConfig)().version,e=_xeUtils.default.toStringJSON(localStorage.getItem(e)||"");return e&&e._v===t?e:{_v:t}},hasPosStorage:function(){var e=this.id,t=this.storage,o=this.storageKey;return!!(e&&t&&this.getStorageMap(o)[e])},restorePosStorage:function(){var e,t,o,i,n,a,l=this.reactData,r=this.id,s=this.storage,u=this.storageKey;r&&s&&(s=this.getStorageMap(u)[r])&&(u=this.getBox(),s=(r=_slicedToArray(s.split(","),8))[0],e=r[1],t=r[2],o=r[3],i=r[4],n=r[5],a=r[6],r=r[7],u&&(s&&(u.style.left="".concat(s,"px")),e&&(u.style.top="".concat(e,"px")),t&&(u.style.width="".concat(t,"px")),o)&&(u.style.height="".concat(o,"px")),i)&&n&&(l.revertLocat={left:i,top:n,width:a,height:r})},addMsgQueue:function(){var e="notification"===this.type?notifyQueue:msgQueue;-1===e.indexOf(this)&&e.push(this),this.updateStyle()},savePosStorage:function(){var e=this.reactData,t=this.id,o=this.storage,i=this.storageKey,n=e.zoomStatus,e=e.revertLocat;n||t&&o&&(n=this.getBox())&&((o=this.getStorageMap(i))[t]=[n.style.left,n.style.top,n.style.width,n.style.height].concat(e?[e.left,e.top,e.width,e.height]:[]).map(function(e){return e?_xeUtils.default.toNumber(e):""}).join(","),localStorage.setItem(i,_xeUtils.default.toJSONString(o)))},handleMinimize:function(){var r=this,s=r.reactData,e=r.computeZoomOpts,t=e.minimizeLayout,o=e.minimizeMaxSize,u=e.minimizeHorizontalOffset,c=e.minimizeVerticalOffset,d=e.minimizeOffsetMethod,m="horizontal"===t,f=s.zoomStatus,i=[],n=[],p=(allActiveModals.forEach(function(e){e.xID!==r.xID&&"modal"===e.type&&"minimize"===e.reactData.zoomStatus&&("horizontal"===e.computeZoomOpts.minimizeLayout?i:n).push(e)}),m?i:n);return o&&o<=p.length?(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({status:"error",content:(0,_ui.getI18n)("vxe.modal.miniMaxSize",[o])}),Promise.resolve({status:!1})):(s.prevZoomStatus=f,s.zoomStatus="minimize",r.$nextTick().then(function(){var e,t,o,i,n,a,l=r.getBox();return l&&(e=r.$refs.refHeaderElem)?(a=(0,_dom.getDomNode)().visibleHeight,f||(s.revertLocat={top:l.offsetTop,left:l.offsetLeft,width:l.offsetWidth+(l.style.width?0:1),height:l.offsetHeight+(l.style.height?0:1)}),o=_xeUtils.default[m?"max":"min"](p,function(e){e=e.getBox();return e?_xeUtils.default.toNumber(e.style[m?"left":"top"]):0}),a=a-e.offsetHeight-16,n=16,o&&(o=o.getBox())&&(t=_xeUtils.default.toNumber(o.style.left),o=_xeUtils.default.toNumber(o.style.top),i={},i=m?Object.assign({},u):Object.assign({},c),n=t+_xeUtils.default.toNumber(i.left),a=o+_xeUtils.default.toNumber(i.top),d)&&(i=d({$modal:r,left:n,top:a}),n=_xeUtils.default.toNumber(i.left),a=_xeUtils.default.toNumber(i.top)),Object.assign(l.style,{top:"".concat(a,"px"),left:"".concat(n,"px"),width:"200px",height:"".concat(e.offsetHeight,"px")}),r.savePosStorage(),{status:!0}):{status:!1}}))},handleMaximize:function(){var t=this,o=t.reactData,i=o.zoomStatus;return o.prevZoomStatus=i,o.zoomStatus="maximize",t.$nextTick().then(function(){var e=t.getBox();e&&(i||(o.revertLocat={top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth+(e.style.width?0:1),height:e.offsetHeight+(e.style.height?0:1)}),Object.assign(e.style,{top:"0",left:"0",width:"100%",height:"100%"})),t.savePosStorage()})},handleMsgAutoClose:function(){var e=this,t=e.internalData,o=e.duration;-1!==o&&(t.msgTimeout=setTimeout(function(){return e.closeModal("close")},_xeUtils.default.toNumber(o)))},removeBodyLockScroll:function(){var t=this.xID,e=document.documentElement,o=e.getAttribute(lockScrollAttrKey);o&&((o=o.split(",").filter(function(e){return e!==t})).length?e.setAttribute(lockScrollAttrKey,o.join(",")):(e.removeAttribute(lockScrollAttrKey),e.style.removeProperty(lockScrollCssWidthKey)))},addBodyLockScroll:function(){var e,t=this.xID,o=this.lockScroll,i=this.computeIsMsg;o&&!i&&(o=document.documentElement,i=document.body.clientWidth,(e=(e=o.getAttribute(lockScrollAttrKey))?e.split(","):[]).includes(t)||(e.push(t),o.setAttribute(lockScrollAttrKey,e.join(","))),o.style.setProperty(lockScrollCssWidthKey,"".concat(i,"px")))},openModal:function(){var o=this,t=o,i=o.reactData,n=t.remember,a=t.showFooter,e=i.initialized,l=i.visible,r=o.computeIsMsg,s=o.computeBtnTransfer;return e||(i.initialized=!0,s&&(e=o.$refs.refElem,document.body.appendChild(e))),l||(o.addBodyLockScroll(),i.visible=!0,i.contentVisible=!1,o.updateZindex(),allActiveModals.push(o),setTimeout(function(){i.contentVisible=!0,o.$nextTick(function(){a&&(e=o.$refs.refConfirmBtn,t=o.$refs.refCancelBtn,e=e||t)&&e.focus();var e,t={type:""};o.emitModel(!0),o.dispatchEvent("show",t,null)})},10),r?(o.addMsgQueue(),o.handleMsgAutoClose()):o.$nextTick(function(){var e=t.fullscreen;i.firstOpen?(i.firstOpen=!1,o.hasPosStorage()?o.restorePosStorage():e?o.$nextTick(function(){return o.handleMaximize()}):(o.recalculate(),o.updatePosition().then(function(){setTimeout(function(){return o.updatePosition()},20)}))):n||(o.recalculate(),o.updatePosition().then(function(){setTimeout(function(){return o.updatePosition()},20)}))})),o.$nextTick()},selfClickEvent:function(e){var t=this.$refs.refElem;this.maskClosable&&e.target===t&&this.closeModal("mask")},selfMouseoverEvent:function(){var e=this.internalData,t=e.msgTimeout;t&&this.computeIsMsg&&(clearTimeout(t),e.msgTimeout=void 0)},selfMouseoutEvent:function(){this.internalData.msgTimeout||this.computeIsMsg&&this.handleMsgAutoClose()},handleGlobalKeydownEvent:function(e){var t,o=this;_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE)&&(t=_xeUtils.default.max(allActiveModals,function(e){return e.reactData.modalZindex}))&&setTimeout(function(){t===o&&t.escClosable&&(o.dispatchEvent("close",{type:"exit"},e),o.closeModal("exit"))},10)},handleRevert:function(){var o=this,i=o.reactData;return i.prevZoomStatus=i.zoomStatus,i.zoomStatus="",o.$nextTick().then(function(){var e,t=i.revertLocat;return t?(e=o.getBox(),i.revertLocat=null,e&&Object.assign(e.style,{top:"".concat(t.top,"px"),left:"".concat(t.left,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}),o.savePosStorage(),o.$nextTick().then(function(){return{status:!0}})):{status:!1}})},handleZoom:function(t){var o=this,e=o.reactData,i=e.zoomStatus;return new Promise(function(e){if(t)return"maximize"===t?void e(o.handleMaximize()):"minimize"===t?void e(o.handleMinimize()):void e(o.handleRevert());e(i?o.handleRevert():o.handleMaximize())}).then(function(){return e.zoomStatus||"revert"})},toggleZoomMinEvent:function(t){var o=this,e=o.reactData,i=e.zoomStatus;return o.handleZoom("minimize"===i?e.prevZoomStatus||"revert":"minimize").then(function(e){o.dispatchEvent("zoom",{type:e},t)})},toggleZoomMaxEvent:function(t){var o=this;return o.handleZoom().then(function(e){o.dispatchEvent("zoom",{type:e},t)})},boxMousedownEvent:function(){var t=this.reactData.modalZindex;allActiveModals.some(function(e){return e.reactData.visible&&e.reactData.modalZindex>t})&&this.updateZindex()},mousedownEvent:function(e){var t,o,a,l,r,s,u=this,i=u.reactData,n=u.storage,i=i.zoomStatus,c=_xeUtils.default.toNumber(u.marginSize),d=u.getBox();d&&"maximize"!==i&&0===e.button&&!(0,_dom.getEventTargetNode)(e,d,"trigger--btn").flag&&(e.preventDefault(),t=document.onmousemove,o=document.onmouseup,a=e.clientX-d.offsetLeft,l=e.clientY-d.offsetTop,i=(0,_dom.getDomNode)(),r=i.visibleHeight,s=i.visibleWidth,document.onmousemove=function(e){e.preventDefault();var t=d.offsetWidth,o=d.offsetHeight,t=s-t-c-1,o=r-o-c-1,i=e.clientX-a,n=e.clientY-l;(n=o<n?o:n)<c&&(n=c),d.style.left="".concat(i=(i=t<i?t:i)<c?c:i,"px"),d.style.top="".concat(n,"px"),d.className=d.className.replace(/\s?is--drag/,"")+" is--drag",u.$emit("move",(0,_ui.createEvent)(e,{type:"move"}))},document.onmouseup=function(){document.onmousemove=t,document.onmouseup=o,n&&u.$nextTick(function(){u.savePosStorage()}),setTimeout(function(){d.className=d.className.replace(/\s?is--drag/,"")},50)})},dragEvent:function(e){var a=this,t=a,o=a.reactData,l=(e.preventDefault(),t.storage),i=(0,_dom.getDomNode)(),r=i.visibleHeight,s=i.visibleWidth,u=_xeUtils.default.toNumber(t.marginSize),c=e.target.getAttribute("type"),d=_xeUtils.default.toNumber(t.minWidth),m=_xeUtils.default.toNumber(t.minHeight),f=s,p=r,h=a.getBox(),n=document.onmousemove,g=document.onmouseup,v=h.clientWidth,x=h.clientHeight,y=e.clientX,_=e.clientY,b=h.offsetTop,S=h.offsetLeft,M={type:"resize"};document.onmousemove=function(e){var t,o,i,n;switch(e.preventDefault(),c){case"wl":i=(t=y-e.clientX)+v,u<S-t&&d<i&&(h.style.width="".concat(i<f?i:f,"px"),h.style.left="".concat(S-t,"px"));break;case"swst":i=(t=y-e.clientX)+v,n=(o=_-e.clientY)+x,u<S-t&&d<i&&(h.style.width="".concat(i<f?i:f,"px"),h.style.left="".concat(S-t,"px")),u<b-o&&m<n&&(h.style.height="".concat(n<p?n:p,"px"),h.style.top="".concat(b-o,"px"));break;case"swlb":i=(t=y-e.clientX)+v,n=(o=e.clientY-_)+x,u<S-t&&d<i&&(h.style.width="".concat(i<f?i:f,"px"),h.style.left="".concat(S-t,"px")),b+n+u<r&&m<n&&(h.style.height="".concat(n<p?n:p,"px"));break;case"st":o=_-e.clientY,n=x+o,u<b-o&&m<n&&(h.style.height="".concat(n<p?n:p,"px"),h.style.top="".concat(b-o,"px"));break;case"wr":t=e.clientX-y,S+(i=t+v)+u<s&&d<i&&(h.style.width="".concat(i<f?i:f,"px"));break;case"sest":t=e.clientX-y,n=(o=_-e.clientY)+x,S+(i=t+v)+u<s&&d<i&&(h.style.width="".concat(i<f?i:f,"px")),u<b-o&&m<n&&(h.style.height="".concat(n<p?n:p,"px"),h.style.top="".concat(b-o,"px"));break;case"selb":t=e.clientX-y,n=(o=e.clientY-_)+x,S+(i=t+v)+u<s&&d<i&&(h.style.width="".concat(i<f?i:f,"px")),b+n+u<r&&m<n&&(h.style.height="".concat(n<p?n:p,"px"));break;case"sb":o=e.clientY-_,b+(n=o+x)+u<r&&m<n&&(h.style.height="".concat(n<p?n:p,"px"))}h.className=h.className.replace(/\s?is--drag/,"")+" is--drag",l&&a.savePosStorage(),a.dispatchEvent("resize",M,e)},document.onmouseup=function(){o.revertLocat=null,document.onmousemove=n,document.onmouseup=g,setTimeout(function(){h.className=h.className.replace(/\s?is--drag/,"")},50)}},renderTitles:function(e){var t=this,o=t.$scopedSlots,i=t.slots,i=void 0===i?{}:i,n=t.showClose,a=t.showZoom,l=t.showMaximize,r=t.showMinimize,s=t.title,u=t.reactData.zoomStatus,c=o.title||i.title,o=o.corner||i.corner,i=t.computeIsMinimizeStatus;return[e("div",{class:"vxe-modal--header-title"},c?t.callSlot(c,{$modal:t,minimized:i,maximized:t.computeIsMaximizeStatus},e):s?(0,_utils.getFuncText)(s):(0,_ui.getI18n)("vxe.alert.title")),e("div",{class:"vxe-modal--header-right"},[o&&!i?e("div",{class:"vxe-modal--corner-wrapper"},t.callSlot(o,{$modal:t},e)):(0,_ui.renderEmptyElement)(t),(_xeUtils.default.isBoolean(r)?r:a)?e("div",{class:["vxe-modal--zoom-btn","trigger--btn"],attrs:{title:(0,_ui.getI18n)("vxe.modal.zoom".concat("minimize"===u?"Out":"Min"))},on:{click:t.toggleZoomMinEvent}},[e("i",{class:"minimize"===u?(0,_ui.getIcon)().MODAL_ZOOM_REVERT:(0,_ui.getIcon)().MODAL_ZOOM_MIN})]):(0,_ui.renderEmptyElement)(t),(_xeUtils.default.isBoolean(l)?l:a)&&"minimize"!==u?e("div",{class:["vxe-modal--zoom-btn","trigger--btn"],attrs:{title:(0,_ui.getI18n)("vxe.modal.zoom".concat("maximize"===u?"Out":"In"))},on:{click:t.toggleZoomMaxEvent}},[e("i",{class:"maximize"===u?(0,_ui.getIcon)().MODAL_ZOOM_OUT:(0,_ui.getIcon)().MODAL_ZOOM_IN})]):(0,_ui.renderEmptyElement)(t),n?e("div",{class:["vxe-modal--close-btn","trigger--btn"],attrs:{title:(0,_ui.getI18n)("vxe.modal.close")},on:{click:t.closeEvent}},[e("i",{class:(0,_ui.getIcon)().MODAL_CLOSE})]):(0,_ui.renderEmptyElement)(t)])]},renderHeader:function(e){var t=this,o=t,i=t.$scopedSlots,n=o.slots,a=o.showZoom,l=o.showMaximize,r=t.computeIsMsg,i=i.header||(void 0===n?{}:n).header;return o.showHeader?(n={},o.draggable&&(n.mousedown=t.mousedownEvent),(_xeUtils.default.isBoolean(l)?l:a)&&o.dblclickZoom&&"modal"===o.type&&(n.dblclick=t.toggleZoomMaxEvent),e("div",{ref:"refHeaderElem",class:["vxe-modal--header",{"is--ellipsis":!r&&o.showTitleOverflow}],on:n},i?t.callSlot(i,{$modal:t},e):t.renderTitles(e))):(0,_ui.renderEmptyElement)(t)},renderBody:function(e){var t=this,o=t,i=t.$scopedSlots,n=o.slots,n=void 0===n?{}:n,a=o.status,l=o.iconStatus,r=o.content||o.message,s=t.computeIsMsg,u=i.default||n.default,c=i.left||n.left,i=i.right||n.right,n=[];return s||!a&&!l||n.push(e("div",{class:"vxe-modal--status-wrapper"},[e("i",{class:["vxe-modal--status-icon",l||(0,_ui.getIcon)()["MODAL_".concat(a).toLocaleUpperCase()]]})])),n.push(e("div",{class:"vxe-modal--content"},u?t.callSlot(u,{$modal:t},e):(0,_utils.getFuncText)(r))),e("div",{class:"vxe-modal--body"},[c?e("div",{class:"vxe-modal--body-left"},t.callSlot(c,{$modal:t},e)):(0,_ui.renderEmptyElement)(t),e("div",{class:"vxe-modal--body-default"},n),i?e("div",{class:"vxe-modal--body-right"},t.callSlot(i,{$modal:t},e)):(0,_ui.renderEmptyElement)(t),s?(0,_ui.renderEmptyElement)(t):e(_index.default,{class:"vxe-modal--loading",props:{value:o.loading}})])},renderDefaultFooter:function(e){var t=this,o=t,i=t.$scopedSlots,n=o.slots,n=void 0===n?{}:n,a=o.showCancelButton,l=o.showConfirmButton,r=o.type,s=o.loading,u=i.leftfoot||n.leftfoot,i=i.rightfoot||n.rightfoot,n=[];return(_xeUtils.default.isBoolean(a)?a:"confirm"===r)&&n.push(e(_button.default,{key:1,ref:"refCancelBtn",props:{content:o.cancelButtonText||(0,_ui.getI18n)("vxe.button.cancel")},on:{click:t.cancelEvent}})),(_xeUtils.default.isBoolean(l)?l:"confirm"===r||"alert"===r)&&n.push(e(_button.default,{key:2,ref:"refConfirmBtn",props:{status:"primary",loading:s,content:o.confirmButtonText||(0,_ui.getI18n)("vxe.button.confirm")},on:{click:t.confirmEvent}})),e("div",{class:"vxe-modal--footer-wrapper"},[e("div",{class:"vxe-modal--footer-left"},u?t.callSlot(u,{$modal:t},e):[]),e("div",{class:"vxe-modal--footer-right"},i?t.callSlot(i,{$modal:t},e):n)])},renderFooter:function(e){var t=this,o=t.$scopedSlots,i=t.slots,o=o.footer||(void 0===i?{}:i).footer;return t.showFooter?e("div",{class:"vxe-modal--footer"},o?t.callSlot(o,{$modal:t},e):[t.renderDefaultFooter(e)]):(0,_ui.renderEmptyElement)(t)},renderVN:function(t){var o=this,e=o.$scopedSlots,i=o.reactData,n=o.slots,a=o.className,l=o.type,r=o.animat,s=o.draggable,u=o.iconStatus,c=o.position,d=o.loading,m=o.destroyOnClose,f=o.status,p=o.lockScroll,h=o.padding,g=o.lockView,v=o.mask,x=o.resize,y=i.initialized,_=i.modalTop,b=i.contentVisible,S=i.visible,M=i.zoomStatus,e=e.aside||(void 0===n?{}:n).aside,n=o.computeSize,z=o.computeIsMsg,w=o.computeIsMinimizeStatus,E={};return z&&(E.mouseover=o.selfMouseoverEvent,E.mouseout=o.selfMouseoutEvent),t("div",{ref:"refElem",class:["vxe-modal--wrapper","type--".concat(l),"zoom--".concat(M||"revert"),a||"",c?"pos--".concat(c):"",(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(l={},"size--".concat(n),n),"status--".concat(f),f),"is--padding",h),"is--animat",r),"lock--scroll",p),"lock--view",g),"is--draggable",s),"is--resize",x),"is--mask",v),"is--visible",b),_defineProperty(_defineProperty(l,"is--active",S),"is--loading",d))],style:{zIndex:i.modalZindex,top:_?"".concat(_,"px"):null},on:Object.assign(Object.assign({},E),{click:o.selfClickEvent})},y?[t("div",{ref:"refModalBox",class:"vxe-modal--box",on:{mousedown:o.boxMousedownEvent}},[!z&&!e||w?(0,_ui.renderEmptyElement)(o):t("div",{class:"vxe-modal--aside"},e?o.callSlot(e,{$modal:o},t):[f||u?t("div",{class:"vxe-modal--status-wrapper"},[t("i",{class:["vxe-modal--status-icon",u||(0,_ui.getIcon)()["MODAL_".concat(f).toLocaleUpperCase()]]})]):(0,_ui.renderEmptyElement)(o)]),t("div",{class:"vxe-modal--container"},!i.initialized||m&&!i.visible?[]:[o.renderHeader(t),o.renderBody(t),o.renderFooter(t),!z&&x?t("span",{class:"vxe-modal--resize"},["wl","wr","swst","sest","st","swlb","selb","sb"].map(function(e){return t("span",{class:"".concat(e,"-resize"),attrs:{type:e},on:{mousedown:o.dragEvent}})})):(0,_ui.renderEmptyElement)(o)])])]:[])}},mounted:function(){var e=this,t=e.$scopedSlots,o=e;"development"===process.env.NODE_ENV&&"modal"===o.type&&o.showFooter&&!(o.showConfirmButton||o.showCancelButton||t.footer)&&(0,_log.warnLog)("vxe.modal.footPropErr"),e.$nextTick(function(){o.storage&&!o.id&&(0,_log.errLog)("vxe.error.reqProp",["modal.id"]),o.value&&e.openModal(),e.recalculate()}),o.escClosable&&_ui.globalEvents.on(e,"keydown",e.handleGlobalKeydownEvent)},beforeDestroy:function(){var e=this.$refs.refElem;e&&e.parentNode&&e.parentNode.removeChild(e),_ui.globalEvents.off(this,"keydown"),this.removeMsgQueue(),this.removeBodyLockScroll()},render:function(e){return this.renderVN(e)}});
|
|
1
|
+
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)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.allActiveModals=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"),_button=_interopRequireDefault(require("../../button/src/button")),_index=_interopRequireDefault(require("../../loading/index")),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default: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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=Array(t);o<t;o++)i[o]=e[o];return i}function _iterableToArrayLimit(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i,n,a,l,r=[],s=!0,u=!1;try{if(a=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;s=!1}else for(;!(s=(i=a.call(o)).done)&&(r.push(i.value),r.length!==t);s=!0);}catch(e){u=!0,n=e}finally{try{if(!s&&null!=o.return&&(l=o.return(),Object(l)!==l))return}finally{if(u)throw n}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}var allActiveModals=exports.allActiveModals=[],msgQueue=[],notifyQueue=[],lockScrollAttrKey="data-vxe-lock-scroll",lockScrollCssWidthKey="--vxe-ui-modal-lock-scroll-view-width",_default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeModal",mixins:[_ui.globalMixins.sizeMixin,_ui.globalMixins.permissionMixin],props:{value:Boolean,id:String,type:{type:String,default:"modal"},loading:{type:Boolean,default:null},status:String,iconStatus:String,className:String,top:{type:[Number,String],default:function(){return(0,_ui.getConfig)().modal.top}},position:[String,Object],title:String,duration:{type:[Number,String],default:function(){return(0,_ui.getConfig)().modal.duration}},content:[Number,String],showCancelButton:{type:Boolean,default:null},cancelButtonText:{type:String,default:function(){return(0,_ui.getConfig)().modal.cancelButtonText}},showConfirmButton:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.showConfirmButton}},confirmButtonText:{type:String,default:function(){return(0,_ui.getConfig)().modal.confirmButtonText}},lockView:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.lockView}},lockScroll:Boolean,mask:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.mask}},maskClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.maskClosable}},escClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.escClosable}},cancelClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.cancelClosable}},confirmClosable:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.confirmClosable}},resize:Boolean,showHeader:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.showHeader}},showFooter:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.showFooter}},showZoom:Boolean,zoomConfig:Object,showMaximize:{type:Boolean,default:function(){return(0,_utils.handleBooleanDefaultValue)((0,_ui.getConfig)().modal.showMaximize)}},showMinimize:{type:Boolean,default:function(){return(0,_utils.handleBooleanDefaultValue)((0,_ui.getConfig)().modal.showMinimize)}},showClose:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.showClose}},dblclickZoom:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.dblclickZoom}},width:[Number,String],height:[Number,String],minWidth:{type:[Number,String],default:function(){return(0,_ui.getConfig)().modal.minWidth}},minHeight:{type:[Number,String],default:function(){return(0,_ui.getConfig)().modal.minHeight}},zIndex:Number,marginSize:{type:[Number,String],default:function(){return(0,_ui.getConfig)().modal.marginSize}},fullscreen:Boolean,draggable:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.draggable}},remember:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.remember}},destroyOnClose:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.destroyOnClose}},showTitleOverflow:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.showTitleOverflow}},transfer:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.transfer}},storage:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.storage}},storageKey:{type:String,default:function(){return(0,_ui.getConfig)().modal.storageKey}},padding:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.padding}},size:{type:String,default:function(){return(0,_ui.getConfig)().modal.size||(0,_ui.getConfig)().size}},beforeHideMethod:Function,slots:Object,message:[Number,String],animat:{type:Boolean,default:function(){return(0,_ui.getConfig)().modal.animat}}},inject:{$xeParentModal:{from:"$xeModal",default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null}},provide:function(){return{$xeModal:this}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1,visible:!1,contentVisible:!1,modalTop:0,modalZindex:0,prevZoomStatus:"",zoomStatus:"",revertLocat:null,prevLocat:null,firstOpen:!0},internalData:{msgTimeout:void 0}}},computed:Object.assign(Object.assign({},{}),{computeBtnTransfer:function(){var e=this,t=e.$xeTable,o=e.$xeParentModal,i=e.$xeDrawer,n=e.$xeForm,e=e.transfer;if(null===e){var a=(0,_ui.getConfig)().select.transfer;if(_xeUtils.default.isBoolean(a))return a;if(t||o||i||n)return!0}return e},computeIsMsg:function(){return"message"===this.type||"notification"===this.type},computeIsMinimizeStatus:function(){return"minimize"===this.reactData.zoomStatus},computeIsMaximizeStatus:function(){return"maximize"===this.reactData.zoomStatus},computeZoomOpts:function(){return Object.assign({},(0,_ui.getConfig)().modal.zoomConfig,this.zoomConfig)}}),watch:{width:function(){this.recalculate()},height:function(){this.recalculate()},value:function(e){e?this.openModal():this.closeModal("model")}},methods:{dispatchEvent:function(e,t,o){this.$emit(e,(0,_ui.createEvent)(o,{$modal:this},t))},emitModel:function(e){var t=this._events;this.$emit("input",e),t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},callSlot:function(e,t,o){var i=this.$scopedSlots;return e&&(_xeUtils.default.isString(e)&&(e=i[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e.call(this,t,o)):[]},open:function(){return this.openModal()},close:function(){return this.closeModal("close")},getBox:function(){return this.$refs.refModalBox},getPosition:function(){if(!this.computeIsMsg){var e=this.getBox();if(e)return{top:e.offsetTop,left:e.offsetLeft}}return null},setPosition:function(e,t){var o;return this.computeIsMsg||(o=this.getBox())&&(_xeUtils.default.isNumber(e)&&(o.style.top="".concat(e,"px")),_xeUtils.default.isNumber(t))&&(o.style.left="".concat(t,"px")),this.$nextTick()},isMinimized:function(){return"minimize"===this.reactData.zoomStatus},isMaximized:function(){return"maximize"===this.reactData.zoomStatus},zoom:function(){return this.handleZoom()},minimize:function(){return this.reactData.visible?this.handleMinimize():Promise.resolve({status:!1})},maximize:function(){return this.reactData.visible?this.handleMaximize():Promise.resolve({status:!1})},revert:function(){return this.reactData.visible?this.handleRevert():Promise.resolve({status:!1})},recalculate:function(){var e=this.width,t=this.height,o=this.getBox();return o&&(o.style.width=e?(0,_dom.toCssUnit)(e):"",o.style.height=t?(0,_dom.toCssUnit)(t):""),this.$nextTick()},updateZindex:function(){var e=this.reactData,t=this.zIndex,o=e.modalZindex;t?e.modalZindex=t:o<(0,_utils.getLastZIndex)()&&(e.modalZindex=(0,_utils.nextZIndex)())},updatePosition:function(){var c=this,d=c;return c.$nextTick().then(function(){var e,t,o,i,n,a,l,r=d.position,s=_xeUtils.default.toNumber(d.marginSize),u=c.getBox();u&&(e=document.documentElement.clientWidth||document.body.clientWidth,t=document.documentElement.clientHeight||document.body.clientHeight,o="center"===r,i=(r=_xeUtils.default.isString(r)?{top:r,left:r}:Object.assign({},r)).top,n=o||"center"===i,a=l="",a=(r=r.left)&&!(o||"center"===r)?isNaN(r)?r:"".concat(r,"px"):"".concat(Math.max(s,e/2-u.offsetWidth/2),"px"),l=i&&!n?isNaN(i)?i:"".concat(i,"px"):"".concat(Math.max(s,t/2-u.offsetHeight/2),"px"),u.style.top=l,u.style.left=a)})},updateStyle:function(){var t=this;this.$nextTick(function(){var e=t.type,o=0;("notification"===e?notifyQueue:msgQueue).forEach(function(e){var t=e.getBox();t&&(o+=_xeUtils.default.toNumber(e.top),e.reactData.modalTop=o,o+=t.clientHeight)})})},removeMsgQueue:function(){var t=this,e="notification"===t.type?notifyQueue:msgQueue;-1<e.indexOf(t)&&_xeUtils.default.remove(e,function(e){return e===t}),t.updateStyle()},closeModal:function(e){var t=this,o=t.reactData,i=t.remember,n=o.visible,a=t.computeIsMsg,l=t.beforeHideMethod||(0,_ui.getConfig)().modal.beforeHideMethod,r={type:e};return n&&Promise.resolve(l?l(r):null).then(function(e){_xeUtils.default.isError(e)||(a&&t.removeMsgQueue(),o.contentVisible=!1,i||t.handleRevert(),_xeUtils.default.remove(allActiveModals,function(e){return e===t}),t.dispatchEvent("before-hide",r,null),setTimeout(function(){o.visible=!1,t.emitModel(!1),t.dispatchEvent("hide",r,null)},200),t.removeBodyLockScroll())}).catch(function(e){return e}),t.$nextTick()},closeEvent:function(e){var t="close";this.dispatchEvent(t,{type:t},e),this.closeModal(t)},confirmEvent:function(e){var t=this.confirmClosable,o="confirm";this.dispatchEvent(o,{type:o},e),t&&this.closeModal(o)},cancelEvent:function(e){var t=this.cancelClosable,o="cancel";this.dispatchEvent(o,{type:o},e),t&&this.closeModal(o)},getStorageMap:function(e){var t=(0,_ui.getConfig)().version,e=_xeUtils.default.toStringJSON(localStorage.getItem(e)||"");return e&&e._v===t?e:{_v:t}},hasPosStorage:function(){var e=this.id,t=this.storage,o=this.storageKey;return!!(e&&t&&this.getStorageMap(o)[e])},restorePosStorage:function(){var e,t,o,i,n,a,l=this.reactData,r=this.id,s=this.storage,u=this.storageKey;r&&s&&(s=this.getStorageMap(u)[r])&&(u=this.getBox(),s=(r=_slicedToArray(s.split(","),8))[0],e=r[1],t=r[2],o=r[3],i=r[4],n=r[5],a=r[6],r=r[7],u&&(s&&(u.style.left="".concat(s,"px")),e&&(u.style.top="".concat(e,"px")),t&&(u.style.width="".concat(t,"px")),o)&&(u.style.height="".concat(o,"px")),i)&&n&&(l.revertLocat={left:i,top:n,width:a,height:r})},addMsgQueue:function(){var e="notification"===this.type?notifyQueue:msgQueue;-1===e.indexOf(this)&&e.push(this),this.updateStyle()},savePosStorage:function(){var e=this.reactData,t=this.id,o=this.storage,i=this.storageKey,n=e.zoomStatus,e=e.revertLocat;n||t&&o&&(n=this.getBox())&&((o=this.getStorageMap(i))[t]=[n.style.left,n.style.top,n.style.width,n.style.height].concat(e?[e.left,e.top,e.width,e.height]:[]).map(function(e){return e?_xeUtils.default.toNumber(e):""}).join(","),localStorage.setItem(i,_xeUtils.default.toJSONString(o)))},handleMinimize:function(){var r=this,s=r.reactData,e=r.computeZoomOpts,t=e.minimizeLayout,o=e.minimizeMaxSize,u=e.minimizeHorizontalOffset,c=e.minimizeVerticalOffset,d=e.minimizeOffsetMethod,m="horizontal"===t,f=s.zoomStatus,i=[],n=[],h=(allActiveModals.forEach(function(e){e.xID!==r.xID&&"modal"===e.type&&"minimize"===e.reactData.zoomStatus&&("horizontal"===e.computeZoomOpts.minimizeLayout?i:n).push(e)}),m?i:n);return o&&o<=h.length?(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({status:"error",content:(0,_ui.getI18n)("vxe.modal.miniMaxSize",[o])}),Promise.resolve({status:!1})):(s.prevZoomStatus=f,s.zoomStatus="minimize",r.$nextTick().then(function(){var e,t,o,i,n,a,l=r.getBox();return l&&(e=r.$refs.refHeaderElem)?(a=(0,_dom.getDomNode)().visibleHeight,f||(s.revertLocat={top:l.offsetTop,left:l.offsetLeft,width:l.offsetWidth+(l.style.width?0:1),height:l.offsetHeight+(l.style.height?0:1)}),o=_xeUtils.default[m?"max":"min"](h,function(e){e=e.getBox();return e?_xeUtils.default.toNumber(e.style[m?"left":"top"]):0}),a=a-e.offsetHeight-16,n=16,o&&(o=o.getBox())&&(t=_xeUtils.default.toNumber(o.style.left),o=_xeUtils.default.toNumber(o.style.top),i={},i=m?Object.assign({},u):Object.assign({},c),n=t+_xeUtils.default.toNumber(i.left),a=o+_xeUtils.default.toNumber(i.top),d)&&(i=d({$modal:r,left:n,top:a}),n=_xeUtils.default.toNumber(i.left),a=_xeUtils.default.toNumber(i.top)),Object.assign(l.style,{top:"".concat(a,"px"),left:"".concat(n,"px"),width:"200px",height:"".concat(e.offsetHeight,"px")}),r.savePosStorage(),{status:!0}):{status:!1}}))},handleMaximize:function(){var n=this,a=n,l=n.reactData,r=l.zoomStatus;return l.prevZoomStatus=r,l.zoomStatus="maximize",n.$nextTick().then(function(){var e,t,o,i=n.getBox();i&&(r||(e=_xeUtils.default.toNumber(a.marginSize),t=document.documentElement.clientWidth||document.body.clientWidth,o=document.documentElement.clientHeight||document.body.clientHeight,l.revertLocat={top:Math.max(e,o/2-i.offsetHeight/2),left:Math.max(e,t/2-i.offsetWidth/2),width:i.offsetWidth+(i.style.width?0:1),height:i.offsetHeight+(i.style.height?0:1)}),Object.assign(i.style,{top:"0",left:"0",width:"100%",height:"100%"})),n.savePosStorage()})},handleMsgAutoClose:function(){var e=this,t=e.internalData,o=e.duration;-1!==o&&(t.msgTimeout=setTimeout(function(){return e.closeModal("close")},_xeUtils.default.toNumber(o)))},removeBodyLockScroll:function(){var t=this.xID,e=document.documentElement,o=e.getAttribute(lockScrollAttrKey);o&&((o=o.split(",").filter(function(e){return e!==t})).length?e.setAttribute(lockScrollAttrKey,o.join(",")):(e.removeAttribute(lockScrollAttrKey),e.style.removeProperty(lockScrollCssWidthKey)))},addBodyLockScroll:function(){var e,t=this.xID,o=this.lockScroll,i=this.computeIsMsg;o&&!i&&(o=document.documentElement,i=document.body.clientWidth,(e=(e=o.getAttribute(lockScrollAttrKey))?e.split(","):[]).includes(t)||(e.push(t),o.setAttribute(lockScrollAttrKey,e.join(","))),o.style.setProperty(lockScrollCssWidthKey,"".concat(i,"px")))},openModal:function(){var o=this,t=o,i=o.reactData,n=t.remember,a=t.showFooter,e=i.initialized,l=i.visible,r=o.computeIsMsg,s=o.computeBtnTransfer;return e||(i.initialized=!0,s&&(e=o.$refs.refElem,document.body.appendChild(e))),l||(o.addBodyLockScroll(),i.visible=!0,i.contentVisible=!1,o.updateZindex(),allActiveModals.push(o),setTimeout(function(){i.contentVisible=!0,o.$nextTick(function(){a&&(e=o.$refs.refConfirmBtn,t=o.$refs.refCancelBtn,e=e||t)&&e.focus();var e,t={type:""};o.emitModel(!0),o.dispatchEvent("show",t,null)})},10),r?(o.addMsgQueue(),o.handleMsgAutoClose()):o.$nextTick(function(){var e=t.fullscreen;i.firstOpen?(i.firstOpen=!1,o.hasPosStorage()?o.restorePosStorage():e?o.$nextTick(function(){return o.handleMaximize()}):(o.recalculate(),o.updatePosition().then(function(){setTimeout(function(){return o.updatePosition()},20)}))):n||(o.recalculate(),o.updatePosition().then(function(){setTimeout(function(){return o.updatePosition()},20)}))})),o.$nextTick()},selfClickEvent:function(e){var t=this.$refs.refElem;this.maskClosable&&e.target===t&&this.closeModal("mask")},selfMouseoverEvent:function(){var e=this.internalData,t=e.msgTimeout;t&&this.computeIsMsg&&(clearTimeout(t),e.msgTimeout=void 0)},selfMouseoutEvent:function(){this.internalData.msgTimeout||this.computeIsMsg&&this.handleMsgAutoClose()},handleGlobalKeydownEvent:function(e){var t,o=this;_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE)&&(t=_xeUtils.default.max(allActiveModals,function(e){return e.reactData.modalZindex}))&&setTimeout(function(){t===o&&t.escClosable&&(o.dispatchEvent("close",{type:"exit"},e),o.closeModal("exit"))},10)},handleRevert:function(){var o=this,i=o.reactData;return i.prevZoomStatus=i.zoomStatus,i.zoomStatus="",o.$nextTick().then(function(){var e,t=i.revertLocat;return t?(e=o.getBox(),i.revertLocat=null,e&&Object.assign(e.style,{top:"".concat(t.top,"px"),left:"".concat(t.left,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}),o.savePosStorage(),o.$nextTick().then(function(){return{status:!0}})):{status:!1}})},handleZoom:function(t){var o=this,e=o.reactData,i=e.zoomStatus;return new Promise(function(e){if(t)return"maximize"===t?void e(o.handleMaximize()):"minimize"===t?void e(o.handleMinimize()):void e(o.handleRevert());e(i?o.handleRevert():o.handleMaximize())}).then(function(){return e.zoomStatus||"revert"})},toggleZoomMinEvent:function(t){var o=this,e=o.reactData,i=e.zoomStatus;return o.handleZoom("minimize"===i?e.prevZoomStatus||"revert":"minimize").then(function(e){o.dispatchEvent("zoom",{type:e},t)})},toggleZoomMaxEvent:function(t){var o=this;return o.handleZoom().then(function(e){o.dispatchEvent("zoom",{type:e},t)})},boxMousedownEvent:function(){var t=this.reactData.modalZindex;allActiveModals.some(function(e){return e.reactData.visible&&e.reactData.modalZindex>t})&&this.updateZindex()},mousedownEvent:function(e){var t,o,a,l,r,s,u=this,i=u.reactData,n=u.storage,i=i.zoomStatus,c=_xeUtils.default.toNumber(u.marginSize),d=u.getBox();d&&"maximize"!==i&&0===e.button&&!(0,_dom.getEventTargetNode)(e,d,"trigger--btn").flag&&(e.preventDefault(),t=document.onmousemove,o=document.onmouseup,a=e.clientX-d.offsetLeft,l=e.clientY-d.offsetTop,i=(0,_dom.getDomNode)(),r=i.visibleHeight,s=i.visibleWidth,document.onmousemove=function(e){e.preventDefault();var t=d.offsetWidth,o=d.offsetHeight,t=s-t-c-1,o=r-o-c-1,i=e.clientX-a,n=e.clientY-l;(n=o<n?o:n)<c&&(n=c),d.style.left="".concat(i=(i=t<i?t:i)<c?c:i,"px"),d.style.top="".concat(n,"px"),d.className=d.className.replace(/\s?is--drag/,"")+" is--drag",u.$emit("move",(0,_ui.createEvent)(e,{type:"move"}))},document.onmouseup=function(){document.onmousemove=t,document.onmouseup=o,n&&u.$nextTick(function(){u.savePosStorage()}),setTimeout(function(){d.className=d.className.replace(/\s?is--drag/,"")},50)})},dragEvent:function(e){var a=this,t=a,o=a.reactData,l=(e.preventDefault(),t.storage),i=(0,_dom.getDomNode)(),r=i.visibleHeight,s=i.visibleWidth,u=_xeUtils.default.toNumber(t.marginSize),c=e.target.getAttribute("type"),d=_xeUtils.default.toNumber(t.minWidth),m=_xeUtils.default.toNumber(t.minHeight),f=s,h=r,p=a.getBox(),n=document.onmousemove,g=document.onmouseup,v=p.clientWidth,x=p.clientHeight,y=e.clientX,_=e.clientY,b=p.offsetTop,S=p.offsetLeft,M={type:"resize"};document.onmousemove=function(e){var t,o,i,n;switch(e.preventDefault(),c){case"wl":i=(t=y-e.clientX)+v,u<S-t&&d<i&&(p.style.width="".concat(i<f?i:f,"px"),p.style.left="".concat(S-t,"px"));break;case"swst":i=(t=y-e.clientX)+v,n=(o=_-e.clientY)+x,u<S-t&&d<i&&(p.style.width="".concat(i<f?i:f,"px"),p.style.left="".concat(S-t,"px")),u<b-o&&m<n&&(p.style.height="".concat(n<h?n:h,"px"),p.style.top="".concat(b-o,"px"));break;case"swlb":i=(t=y-e.clientX)+v,n=(o=e.clientY-_)+x,u<S-t&&d<i&&(p.style.width="".concat(i<f?i:f,"px"),p.style.left="".concat(S-t,"px")),b+n+u<r&&m<n&&(p.style.height="".concat(n<h?n:h,"px"));break;case"st":o=_-e.clientY,n=x+o,u<b-o&&m<n&&(p.style.height="".concat(n<h?n:h,"px"),p.style.top="".concat(b-o,"px"));break;case"wr":t=e.clientX-y,S+(i=t+v)+u<s&&d<i&&(p.style.width="".concat(i<f?i:f,"px"));break;case"sest":t=e.clientX-y,n=(o=_-e.clientY)+x,S+(i=t+v)+u<s&&d<i&&(p.style.width="".concat(i<f?i:f,"px")),u<b-o&&m<n&&(p.style.height="".concat(n<h?n:h,"px"),p.style.top="".concat(b-o,"px"));break;case"selb":t=e.clientX-y,n=(o=e.clientY-_)+x,S+(i=t+v)+u<s&&d<i&&(p.style.width="".concat(i<f?i:f,"px")),b+n+u<r&&m<n&&(p.style.height="".concat(n<h?n:h,"px"));break;case"sb":o=e.clientY-_,b+(n=o+x)+u<r&&m<n&&(p.style.height="".concat(n<h?n:h,"px"))}p.className=p.className.replace(/\s?is--drag/,"")+" is--drag",l&&a.savePosStorage(),a.dispatchEvent("resize",M,e)},document.onmouseup=function(){o.revertLocat=null,document.onmousemove=n,document.onmouseup=g,setTimeout(function(){p.className=p.className.replace(/\s?is--drag/,"")},50)}},renderTitles:function(e){var t=this,o=t.$scopedSlots,i=t.slots,i=void 0===i?{}:i,n=t.showClose,a=t.showZoom,l=t.showMaximize,r=t.showMinimize,s=t.title,u=t.reactData.zoomStatus,c=o.title||i.title,o=o.corner||i.corner,i=t.computeIsMinimizeStatus;return[e("div",{class:"vxe-modal--header-title"},c?t.callSlot(c,{$modal:t,minimized:i,maximized:t.computeIsMaximizeStatus},e):s?(0,_utils.getFuncText)(s):(0,_ui.getI18n)("vxe.alert.title")),e("div",{class:"vxe-modal--header-right"},[o&&!i?e("div",{class:"vxe-modal--corner-wrapper"},t.callSlot(o,{$modal:t},e)):(0,_ui.renderEmptyElement)(t),(_xeUtils.default.isBoolean(r)?r:a)?e("div",{class:["vxe-modal--zoom-btn","trigger--btn"],attrs:{title:(0,_ui.getI18n)("vxe.modal.zoom".concat("minimize"===u?"Out":"Min"))},on:{click:t.toggleZoomMinEvent}},[e("i",{class:"minimize"===u?(0,_ui.getIcon)().MODAL_ZOOM_REVERT:(0,_ui.getIcon)().MODAL_ZOOM_MIN})]):(0,_ui.renderEmptyElement)(t),(_xeUtils.default.isBoolean(l)?l:a)&&"minimize"!==u?e("div",{class:["vxe-modal--zoom-btn","trigger--btn"],attrs:{title:(0,_ui.getI18n)("vxe.modal.zoom".concat("maximize"===u?"Out":"In"))},on:{click:t.toggleZoomMaxEvent}},[e("i",{class:"maximize"===u?(0,_ui.getIcon)().MODAL_ZOOM_OUT:(0,_ui.getIcon)().MODAL_ZOOM_IN})]):(0,_ui.renderEmptyElement)(t),n?e("div",{class:["vxe-modal--close-btn","trigger--btn"],attrs:{title:(0,_ui.getI18n)("vxe.modal.close")},on:{click:t.closeEvent}},[e("i",{class:(0,_ui.getIcon)().MODAL_CLOSE})]):(0,_ui.renderEmptyElement)(t)])]},renderHeader:function(e){var t=this,o=t,i=t.$scopedSlots,n=o.slots,a=o.showZoom,l=o.showMaximize,r=t.computeIsMsg,i=i.header||(void 0===n?{}:n).header;return o.showHeader?(n={},o.draggable&&(n.mousedown=t.mousedownEvent),(_xeUtils.default.isBoolean(l)?l:a)&&o.dblclickZoom&&"modal"===o.type&&(n.dblclick=t.toggleZoomMaxEvent),e("div",{ref:"refHeaderElem",class:["vxe-modal--header",{"is--ellipsis":!r&&o.showTitleOverflow}],on:n},i?t.callSlot(i,{$modal:t},e):t.renderTitles(e))):(0,_ui.renderEmptyElement)(t)},renderBody:function(e){var t=this,o=t,i=t.$scopedSlots,n=o.slots,n=void 0===n?{}:n,a=o.status,l=o.iconStatus,r=o.content||o.message,s=t.computeIsMsg,u=i.default||n.default,c=i.left||n.left,i=i.right||n.right,n=[];return s||!a&&!l||n.push(e("div",{class:"vxe-modal--status-wrapper"},[e("i",{class:["vxe-modal--status-icon",l||(0,_ui.getIcon)()["MODAL_".concat(a).toLocaleUpperCase()]]})])),n.push(e("div",{class:"vxe-modal--content"},u?t.callSlot(u,{$modal:t},e):(0,_utils.getFuncText)(r))),e("div",{class:"vxe-modal--body"},[c?e("div",{class:"vxe-modal--body-left"},t.callSlot(c,{$modal:t},e)):(0,_ui.renderEmptyElement)(t),e("div",{class:"vxe-modal--body-default"},n),i?e("div",{class:"vxe-modal--body-right"},t.callSlot(i,{$modal:t},e)):(0,_ui.renderEmptyElement)(t),s?(0,_ui.renderEmptyElement)(t):e(_index.default,{class:"vxe-modal--loading",props:{value:o.loading}})])},renderDefaultFooter:function(e){var t=this,o=t,i=t.$scopedSlots,n=o.slots,n=void 0===n?{}:n,a=o.showCancelButton,l=o.showConfirmButton,r=o.type,s=o.loading,u=i.leftfoot||n.leftfoot,i=i.rightfoot||n.rightfoot,n=[];return(_xeUtils.default.isBoolean(a)?a:"confirm"===r)&&n.push(e(_button.default,{key:1,ref:"refCancelBtn",props:{content:o.cancelButtonText||(0,_ui.getI18n)("vxe.button.cancel")},on:{click:t.cancelEvent}})),(_xeUtils.default.isBoolean(l)?l:"confirm"===r||"alert"===r)&&n.push(e(_button.default,{key:2,ref:"refConfirmBtn",props:{status:"primary",loading:s,content:o.confirmButtonText||(0,_ui.getI18n)("vxe.button.confirm")},on:{click:t.confirmEvent}})),e("div",{class:"vxe-modal--footer-wrapper"},[e("div",{class:"vxe-modal--footer-left"},u?t.callSlot(u,{$modal:t},e):[]),e("div",{class:"vxe-modal--footer-right"},i?t.callSlot(i,{$modal:t},e):n)])},renderFooter:function(e){var t=this,o=t.$scopedSlots,i=t.slots,o=o.footer||(void 0===i?{}:i).footer;return t.showFooter?e("div",{class:"vxe-modal--footer"},o?t.callSlot(o,{$modal:t},e):[t.renderDefaultFooter(e)]):(0,_ui.renderEmptyElement)(t)},renderVN:function(t){var o=this,e=o.$scopedSlots,i=o.reactData,n=o.slots,a=o.className,l=o.type,r=o.animat,s=o.draggable,u=o.iconStatus,c=o.position,d=o.loading,m=o.destroyOnClose,f=o.status,h=o.lockScroll,p=o.padding,g=o.lockView,v=o.mask,x=o.resize,y=i.initialized,_=i.modalTop,b=i.contentVisible,S=i.visible,M=i.zoomStatus,e=e.aside||(void 0===n?{}:n).aside,n=o.computeSize,z=o.computeIsMsg,w=o.computeIsMinimizeStatus,E={};return z&&(E.mouseover=o.selfMouseoverEvent,E.mouseout=o.selfMouseoutEvent),t("div",{ref:"refElem",class:["vxe-modal--wrapper","type--".concat(l),"zoom--".concat(M||"revert"),a||"",c?"pos--".concat(c):"",(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(l={},"size--".concat(n),n),"status--".concat(f),f),"is--padding",p),"is--animat",r),"lock--scroll",h),"lock--view",g),"is--draggable",s),"is--resize",x),"is--mask",v),"is--visible",b),_defineProperty(_defineProperty(l,"is--active",S),"is--loading",d))],style:{zIndex:i.modalZindex,top:_?"".concat(_,"px"):null},on:Object.assign(Object.assign({},E),{click:o.selfClickEvent})},y?[t("div",{ref:"refModalBox",class:"vxe-modal--box",on:{mousedown:o.boxMousedownEvent}},[!z&&!e||w?(0,_ui.renderEmptyElement)(o):t("div",{class:"vxe-modal--aside"},e?o.callSlot(e,{$modal:o},t):[f||u?t("div",{class:"vxe-modal--status-wrapper"},[t("i",{class:["vxe-modal--status-icon",u||(0,_ui.getIcon)()["MODAL_".concat(f).toLocaleUpperCase()]]})]):(0,_ui.renderEmptyElement)(o)]),t("div",{class:"vxe-modal--container"},!i.initialized||m&&!i.visible?[]:[o.renderHeader(t),o.renderBody(t),o.renderFooter(t),!z&&x?t("span",{class:"vxe-modal--resize"},["wl","wr","swst","sest","st","swlb","selb","sb"].map(function(e){return t("span",{class:"".concat(e,"-resize"),attrs:{type:e},on:{mousedown:o.dragEvent}})})):(0,_ui.renderEmptyElement)(o)])])]:[])}},mounted:function(){var e=this,t=e.$scopedSlots,o=e;"development"===process.env.NODE_ENV&&"modal"===o.type&&o.showFooter&&!(o.showConfirmButton||o.showCancelButton||t.footer)&&(0,_log.warnLog)("vxe.modal.footPropErr"),e.$nextTick(function(){o.storage&&!o.id&&(0,_log.errLog)("vxe.error.reqProp",["modal.id"]),o.value&&e.openModal(),e.recalculate()}),o.escClosable&&_ui.globalEvents.on(e,"keydown",e.handleGlobalKeydownEvent)},beforeDestroy:function(){var e=this.$refs.refElem;e&&e.parentNode&&e.parentNode.removeChild(e),_ui.globalEvents.off(this,"keydown"),this.removeMsgQueue(),this.removeBodyLockScroll()},render:function(e){return this.renderVN(e)}});
|