vxe-table 3.5.9-beta.2 → 3.5.9-beta.3
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/lib/form/src/form.js +12 -7
- package/lib/form/src/form.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +85 -30
- package/lib/index.umd.min.js +1 -1
- package/lib/list/src/list.js +12 -7
- package/lib/list/src/list.min.js +1 -1
- package/lib/loading/index.js +19 -0
- package/lib/loading/index.min.js +1 -0
- package/lib/loading/src/loading.js +36 -0
- package/lib/loading/src/loading.min.js +1 -0
- package/lib/locale/lang/en-US.js +3 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +3 -0
- package/lib/locale/lang/ja-JP.js +3 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +3 -0
- package/lib/locale/lang/zh-CN.js +3 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +3 -0
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +3 -0
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +3 -0
- package/lib/locale/lang/zh-TC.js +3 -0
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +3 -0
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +3 -0
- package/lib/modal/src/modal.js +12 -7
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/select/style/style.css +0 -69
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/table.js +8 -7
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +0 -68
- package/lib/table/style/style.min.css +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +4 -0
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/style/style.css +590 -0
- package/lib/v-x-e-table/style/style.min.css +1 -0
- package/package.json +1 -1
- package/packages/form/src/form.js +10 -9
- package/packages/list/src/list.js +10 -9
- package/packages/loading/index.js +9 -0
- package/packages/loading/src/loading.js +31 -0
- package/packages/locale/lang/en-US.js +3 -0
- package/packages/locale/lang/ja-JP.js +3 -0
- package/packages/locale/lang/zh-CN.js +3 -0
- package/packages/locale/lang/zh-TC.js +3 -0
- package/packages/modal/src/modal.js +10 -9
- package/packages/table/src/table.js +7 -9
- package/packages/v-x-e-table/src/conf.js +4 -0
- package/styles/{base/loading.scss → loading.scss} +17 -4
- package/styles/modules.scss +1 -0
- package/styles/select.scss +0 -1
- package/styles/table.scss +0 -1
- package/styles/v-x-e-table.scss +2 -0
package/lib/modal/src/modal.js
CHANGED
|
@@ -21,6 +21,8 @@ var _event = require("../../tools/event");
|
|
|
21
21
|
|
|
22
22
|
var _log = require("../../tools/log");
|
|
23
23
|
|
|
24
|
+
var _index = _interopRequireDefault(require("../../loading/index"));
|
|
25
|
+
|
|
24
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
27
|
|
|
26
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -410,13 +412,16 @@ var _default2 = {
|
|
|
410
412
|
class: 'vxe-modal--content'
|
|
411
413
|
}, defaultSlot ? !inited || destroyOnClose && !visible ? [] : defaultSlot.call(this, {
|
|
412
414
|
$modal: this
|
|
413
|
-
}, h) : (0, _utils.getFuncText)(content)),
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
class: 'vxe-loading
|
|
419
|
-
|
|
415
|
+
}, h) : (0, _utils.getFuncText)(content)),
|
|
416
|
+
/**
|
|
417
|
+
* 加载中
|
|
418
|
+
*/
|
|
419
|
+
!isMsg ? h(_index.default, {
|
|
420
|
+
class: 'vxe-modal--loading',
|
|
421
|
+
props: {
|
|
422
|
+
loading: loading
|
|
423
|
+
}
|
|
424
|
+
}) : null]), showFooter ? h('div', {
|
|
420
425
|
class: 'vxe-modal--footer'
|
|
421
426
|
}, footerSlot ? !inited || destroyOnClose && !visible ? [] : footerSlot.call(this, {
|
|
422
427
|
$modal: this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.msgQueue=exports.default=exports.allActivedModals=void 0;var _conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_xeUtils=_interopRequireDefault(require("xe-utils")),_utils=_interopRequireWildcard(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_event=require("../../tools/event"),_log=require("../../tools/log");function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function(t){return t?o:e})(t)}function _interopRequireWildcard(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==_typeof(t)&&"function"!=typeof t)return{default:t};e=_getRequireWildcardCache(e);if(e&&e.has(t))return e.get(t);var o,i,n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(o in t)"default"!==o&&Object.prototype.hasOwnProperty.call(t,o)&&((i=s?Object.getOwnPropertyDescriptor(t,o):null)&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=t[o]);return n.default=t,e&&e.set(t,n),n}function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_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(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(o="Object"===o&&t.constructor?t.constructor.name:o)||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,i=new Array(e);o<e;o++)i[o]=t[o];return i}function _iterableToArrayLimit(t,e){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i,n,s=[],a=!0,l=!1;try{for(o=o.call(t);!(a=(i=o.next()).done)&&(s.push(i.value),!e||s.length!==e);a=!0);}catch(t){l=!0,n=t}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return s}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _defineProperty(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var allActivedModals=[];exports.allActivedModals=allActivedModals;var msgQueue=[];exports.msgQueue=msgQueue;var _default2={name:"VxeModal",mixins:[_size.default],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 _conf.default.modal.top}},position:[String,Object],title:String,duration:{type:[Number,String],default:function(){return _conf.default.modal.duration}},message:[String,Function],content:[String,Function],cancelButtonText:{type:String,default:function(){return _conf.default.modal.cancelButtonText}},confirmButtonText:{type:String,default:function(){return _conf.default.modal.confirmButtonText}},lockView:{type:Boolean,default:function(){return _conf.default.modal.lockView}},lockScroll:Boolean,mask:{type:Boolean,default:function(){return _conf.default.modal.mask}},maskClosable:{type:Boolean,default:function(){return _conf.default.modal.maskClosable}},escClosable:{type:Boolean,default:function(){return _conf.default.modal.escClosable}},resize:{type:Boolean,default:function(){return _conf.default.modal.resize}},showHeader:{type:Boolean,default:function(){return _conf.default.modal.showHeader}},showFooter:{type:Boolean,default:function(){return _conf.default.modal.showFooter}},showZoom:{type:Boolean,default:null},showClose:{type:Boolean,default:function(){return _conf.default.modal.showClose}},dblclickZoom:{type:Boolean,default:function(){return _conf.default.modal.dblclickZoom}},width:[Number,String],height:[Number,String],minWidth:{type:[Number,String],default:function(){return _conf.default.modal.minWidth}},minHeight:{type:[Number,String],default:function(){return _conf.default.modal.minHeight}},zIndex:Number,marginSize:{type:[Number,String],default:function(){return _conf.default.modal.marginSize}},fullscreen:Boolean,draggable:{type:Boolean,default:function(){return _conf.default.modal.draggable}},remember:{type:Boolean,default:function(){return _conf.default.modal.remember}},destroyOnClose:{type:Boolean,default:function(){return _conf.default.modal.destroyOnClose}},showTitleOverflow:{type:Boolean,default:function(){return _conf.default.modal.showTitleOverflow}},transfer:{type:Boolean,default:function(){return _conf.default.modal.transfer}},storage:{type:Boolean,default:function(){return _conf.default.modal.storage}},storageKey:{type:String,default:function(){return _conf.default.modal.storageKey}},animat:{type:Boolean,default:function(){return _conf.default.modal.animat}},size:{type:String,default:function(){return _conf.default.modal.size||_conf.default.size}},beforeHideMethod:{type:Function,default:function(){return _conf.default.modal.beforeHideMethod}},slots:Object,events:Object},data:function(){return{inited:!1,visible:!1,contentVisible:!1,modalTop:0,modalZindex:0,zoomLocat:null,firstOpen:!0}},computed:{isMsg:function(){return"message"===this.type}},watch:{width:function(){this.recalculate()},height:function(){this.recalculate()},value:function(t){this[t?"open":"close"]("model")}},created:function(){this.storage&&!this.id&&(0,_log.errLog)("vxe.error.reqProp",["modal.id"])},mounted:function(){var t=this.$listeners,e=this.events,o=void 0===e?{}:e;this.value&&this.open(),this.recalculate(),this.escClosable&&_event.GlobalEvent.on(this,"keydown",this.handleGlobalKeydownEvent);e="inserted",e={type:e,$modal:this,$event:{type:e}};t.inserted?this.$emit("inserted",e):o.inserted&&o.inserted.call(this,e)},beforeDestroy:function(){var t=this.$el;_event.GlobalEvent.off(this,"keydown"),this.removeMsgQueue(),t.parentNode===document.body&&t.parentNode.removeChild(t)},render:function(e){var o=this,t=this._e,i=this.$scopedSlots,n=this.slots,s=void 0===n?{}:n,a=this.inited,l=this.vSize,r=this.className,c=this.type,u=this.resize,d=this.showClose,f=this.showZoom,h=this.animat,m=this.draggable,p=this.loading,g=this.status,v=this.iconStatus,y=this.showFooter,x=this.zoomLocat,b=this.modalTop,_=this.dblclickZoom,w=this.contentVisible,S=this.visible,z=this.title,k=this.lockScroll,$=this.lockView,T=this.mask,M=this.isMsg,B=this.showTitleOverflow,N=this.destroyOnClose,O=this.content||this.message,P=i.default||s.default,L=i.footer||s.footer,n=i.header||s.header,i=i.title||s.title,s={};return m&&(s.mousedown=this.mousedownEvent),f&&_&&"modal"===c&&(s.dblclick=this.toggleZoomEvent),e("div",{class:["vxe-modal--wrapper","type--".concat(c),r||"",(_defineProperty(r={},"size--".concat(l),l),_defineProperty(r,"status--".concat(g),g),_defineProperty(r,"is--animat",h),_defineProperty(r,"lock--scroll",k),_defineProperty(r,"lock--view",$),_defineProperty(r,"is--resize",u),_defineProperty(r,"is--mask",T),_defineProperty(r,"is--maximize",x),_defineProperty(r,"is--visible",w),_defineProperty(r,"is--active",S),_defineProperty(r,"is--loading",p),r)],style:{zIndex:this.modalZindex,top:b?"".concat(b,"px"):null},on:{click:this.selfClickEvent}},[e("div",{class:"vxe-modal--box",on:{mousedown:this.boxMousedownEvent},ref:"modalBox"},[this.showHeader?e("div",{class:["vxe-modal--header",{"is--draggable":m,"is--ellipsis":!M&&B}],on:s},n?!a||N&&!S?[]:n.call(this,{$modal:this},e):[i?i.call(this,{$modal:this},e):e("span",{class:"vxe-modal--title"},z?(0,_utils.getFuncText)(z):_conf.default.i18n("vxe.alert.title")),f?e("i",{class:["vxe-modal--zoom-btn","trigger--btn",x?_conf.default.icon.MODAL_ZOOM_OUT:_conf.default.icon.MODAL_ZOOM_IN],attrs:{title:_conf.default.i18n("vxe.modal.zoom".concat(x?"Out":"In"))},on:{click:this.toggleZoomEvent}}):t(),d?e("i",{class:["vxe-modal--close-btn","trigger--btn",_conf.default.icon.MODAL_CLOSE],attrs:{title:_conf.default.i18n("vxe.modal.close")},on:{click:this.closeEvent}}):t()]):null,e("div",{class:"vxe-modal--body"},[g?e("div",{class:"vxe-modal--status-wrapper"},[e("i",{class:["vxe-modal--status-icon",v||_conf.default.icon["MODAL_".concat(g).toLocaleUpperCase()]]})]):null,e("div",{class:"vxe-modal--content"},P?!a||N&&!S?[]:P.call(this,{$modal:this},e):(0,_utils.getFuncText)(O)),M?null:e("div",{class:["vxe-loading",{"is--visible":p}]},[e("div",{class:"vxe-loading--spinner"})])]),y?e("div",{class:"vxe-modal--footer"},L?!a||N&&!S?[]:L.call(this,{$modal:this},e):["confirm"===c?e("vxe-button",{ref:"cancelBtn",on:{click:this.cancelEvent}},this.cancelButtonText||_conf.default.i18n("vxe.button.cancel")):null,e("vxe-button",{ref:"confirmBtn",props:{status:"primary"},on:{click:this.confirmEvent}},this.confirmButtonText||_conf.default.i18n("vxe.button.confirm"))]):null,!M&&u?e("span",{class:"vxe-modal--resize"},["wl","wr","swst","sest","st","swlb","selb","sb"].map(function(t){return e("span",{class:"".concat(t,"-resize"),attrs:{type:t},on:{mousedown:o.dragEvent}})})):null])])},methods:{recalculate:function(){var t=this.width,e=this.height,o=this.getBox();return o.style.width=t?isNaN(t)?t:"".concat(t,"px"):null,o.style.height=e?isNaN(e)?e:"".concat(e,"px"):null,this.$nextTick()},selfClickEvent:function(t){this.maskClosable&&t.target===this.$el&&this.close("mask")},updateZindex:function(){var t=this.zIndex,e=this.modalZindex;t?this.modalZindex=t:e<_utils.default.getLastZIndex()&&(this.modalZindex=_utils.default.nextZIndex())},closeEvent:function(t){var e=this.events,o=void 0===e?{}:e,e="close",t={type:e,$modal:this,$event:t};o[e]?o[e].call(this,t):this.$emit(e,t),this.close(e)},confirmEvent:function(t){var e=this.events,o=void 0===e?{}:e,e="confirm",t={type:e,$modal:this,$event:t};o[e]?o[e].call(this,t):this.$emit(e,t),this.close(e)},cancelEvent:function(t){var e=this.events,o=void 0===e?{}:e,e="cancel",t={type:e,$modal:this,$event:t};o[e]?o[e].call(this,t):this.$emit(e,t),this.close(e)},open:function(){var o=this,e=this.$refs,t=this.events,i=void 0===t?{}:t,n=this.inited,s=this.duration,a=this.visible,t=this.isMsg,l=this.remember,r=this.showFooter;n||(this.inited=!0,this.transfer&&document.body.appendChild(this.$el)),a||(l||this.recalculate(),this.visible=!0,this.contentVisible=!1,this.updateZindex(),allActivedModals.push(this),setTimeout(function(){o.contentVisible=!0,o.$nextTick(function(){!r||(t=e.confirmBtn||e.cancelBtn)&&t.focus();var t={type:"",$modal:o};i.show?i.show.call(o,t):(o.$emit("input",!0),o.$emit("show",t))})},10),t?(this.addMsgQueue(),-1!==s&&setTimeout(function(){return o.close("close")},_xeUtils.default.toNumber(s))):this.$nextTick(function(){var t=o.firstOpen,e=o.fullscreen;l&&!t||o.updatePosition().then(function(){setTimeout(function(){return o.updatePosition()},20)}),t?(o.firstOpen=!1,o.hasPosStorage()?o.restorePosStorage():e&&o.$nextTick(function(){return o.maximize()})):e&&o.$nextTick(function(){return o.maximize()})}))},addMsgQueue:function(){-1===msgQueue.indexOf(this)&&msgQueue.push(this),this.updateStyle()},removeMsgQueue:function(){var e=this;-1<msgQueue.indexOf(this)&&_xeUtils.default.remove(msgQueue,function(t){return t===e}),this.updateStyle()},updateStyle:function(){this.$nextTick(function(){var e=0;msgQueue.forEach(function(t){e+=_xeUtils.default.toNumber(t.top),t.modalTop=e,e+=t.$refs.modalBox.clientHeight})})},updatePosition:function(){var u=this;return this.$nextTick().then(function(){var t=u.marginSize,e=u.position,o=u.getBox(),i=document.documentElement.clientWidth||document.body.clientWidth,n=document.documentElement.clientHeight||document.body.clientHeight,s="center"===e,a=s?{top:e,left:e}:Object.assign({},e),l=a.top,r=a.left,c=s||"center"===l,e="",a="",a=r&&!(s||"center"===r)?isNaN(r)?r:"".concat(r,"px"):"".concat(Math.max(t,i/2-o.offsetWidth/2),"px"),e=l&&!c?isNaN(l)?l:"".concat(l,"px"):"".concat(Math.max(t,n/2-o.offsetHeight/2),"px");o.style.top=e,o.style.left=a})},close:function(t){var e=this,o=this.events,i=void 0===o?{}:o,n=this.remember,s=this.visible,a=this.isMsg,o=this.beforeHideMethod,l={type:t,$modal:this};s&&Promise.resolve(o?o(l):null).then(function(t){_xeUtils.default.isError(t)||(a&&e.removeMsgQueue(),e.contentVisible=!1,n||(e.zoomLocat=null),_xeUtils.default.remove(allActivedModals,function(t){return t===e}),e.$emit("before-hide",l),setTimeout(function(){e.visible=!1,i.hide?i.hide.call(e,l):(e.$emit("input",!1),e.$emit("hide",l))},200))}).catch(function(t){return t})},handleGlobalKeydownEvent:function(t){var e,o=this;27===t.keyCode&&((e=_xeUtils.default.max(allActivedModals,function(t){return t.modalZindex}))&&setTimeout(function(){e===o&&e.escClosable&&o.close("exit")},10))},getBox:function(){return this.$refs.modalBox},isMaximized:function(){return!!this.zoomLocat},maximize:function(){var n=this;return this.$nextTick().then(function(){var t,e,o,i;n.zoomLocat||(t=Math.max(0,n.marginSize),e=n.getBox(),o=(i=_dom.default.getDomNode()).visibleHeight,i=i.visibleWidth,n.zoomLocat={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:"".concat(t,"px"),left:"".concat(t,"px"),width:"".concat(i-2*t,"px"),height:"".concat(o-2*t,"px")}),n.savePosStorage())})},revert:function(){var o=this;return this.$nextTick().then(function(){var t,e=o.zoomLocat;e&&(t=o.getBox(),o.zoomLocat=null,Object.assign(t.style,{top:"".concat(e.top,"px"),left:"".concat(e.left,"px"),width:"".concat(e.width,"px"),height:"".concat(e.height,"px")}),o.savePosStorage())})},zoom:function(){var t=this;return this[this.zoomLocat?"revert":"maximize"]().then(function(){return t.isMaximized()})},toggleZoomEvent:function(t){var e=this,o=this.$listeners,i=this.zoomLocat,n=this.events,s=void 0===n?{}:n,a={type:i?"revert":"max",$modal:this,$event:t};return this.zoom().then(function(){o.zoom?e.$emit("zoom",a):s.zoom&&s.zoom.call(e,a)})},getPosition:function(){if(!this.isMsg){var t=this.getBox();if(t)return{top:t.offsetTop,left:t.offsetLeft}}return null},setPosition:function(t,e){var o;return this.isMsg||(o=this.getBox(),_xeUtils.default.isNumber(t)&&(o.style.top="".concat(t,"px")),_xeUtils.default.isNumber(e)&&(o.style.left="".concat(e,"px"))),this.$nextTick()},boxMousedownEvent:function(){var e=this.modalZindex;allActivedModals.some(function(t){return t.visible&&t.modalZindex>e})&&this.updateZindex()},mousedownEvent:function(t){var e,o,n,s,a,l,i=this,r=this.remember,c=this.storage,u=this.marginSize,d=this.zoomLocat,f=this.getBox();d||0!==t.button||_dom.default.getEventTargetNode(t,f,"trigger--btn").flag||(t.preventDefault(),e=document.onmousemove,o=document.onmouseup,n=t.clientX-f.offsetLeft,s=t.clientY-f.offsetTop,t=_dom.default.getDomNode(),a=t.visibleHeight,l=t.visibleWidth,document.onmousemove=function(t){t.preventDefault();var e=f.offsetWidth,o=f.offsetHeight,i=l-e-u-1,e=a-o-u-1,o=t.clientX-n,t=t.clientY-s;(t=e<t?e:t)<u&&(t=u),f.style.left="".concat(o=(o=i<o?i:o)<u?u:o,"px"),f.style.top="".concat(t,"px"),f.className=f.className.replace(/\s?is--drag/,"")+" is--drag"},document.onmouseup=function(){document.onmousemove=e,document.onmouseup=o,r&&c&&i.$nextTick(function(){i.savePosStorage()}),setTimeout(function(){f.className=f.className.replace(/\s?is--drag/,"")},50)})},dragEvent:function(t){var s=this;t.preventDefault();var a=this.$listeners,l=this.marginSize,e=this.events,r=void 0===e?{}:e,c=this.remember,u=this.storage,e=_dom.default.getDomNode(),d=e.visibleHeight,f=e.visibleWidth,h=t.target.getAttribute("type"),m=_xeUtils.default.toNumber(this.minWidth),p=_xeUtils.default.toNumber(this.minHeight),g=f,v=d,y=this.getBox(),o=document.onmousemove,i=document.onmouseup,x=y.clientWidth,b=y.clientHeight,_=t.clientX,w=t.clientY,S=y.offsetTop,z=y.offsetLeft,k={type:"resize",$modal:this};document.onmousemove=function(t){var e,o,i,n;switch(t.preventDefault(),h){case"wl":i=(e=_-t.clientX)+x,l<z-e&&m<i&&(y.style.width="".concat(i<g?i:g,"px"),y.style.left="".concat(z-e,"px"));break;case"swst":e=_-t.clientX,o=w-t.clientY,i=e+x,n=o+b,l<z-e&&m<i&&(y.style.width="".concat(i<g?i:g,"px"),y.style.left="".concat(z-e,"px")),l<S-o&&p<n&&(y.style.height="".concat(n<v?n:v,"px"),y.style.top="".concat(S-o,"px"));break;case"swlb":e=_-t.clientX,o=t.clientY-w,i=e+x,n=o+b,l<z-e&&m<i&&(y.style.width="".concat(i<g?i:g,"px"),y.style.left="".concat(z-e,"px")),S+n+l<d&&p<n&&(y.style.height="".concat(n<v?n:v,"px"));break;case"st":o=w-t.clientY,n=b+o,l<S-o&&p<n&&(y.style.height="".concat(n<v?n:v,"px"),y.style.top="".concat(S-o,"px"));break;case"wr":e=t.clientX-_,z+(i=e+x)+l<f&&m<i&&(y.style.width="".concat(i<g?i:g,"px"));break;case"sest":e=t.clientX-_,n=(o=w-t.clientY)+b,z+(i=e+x)+l<f&&m<i&&(y.style.width="".concat(i<g?i:g,"px")),l<S-o&&p<n&&(y.style.height="".concat(n<v?n:v,"px"),y.style.top="".concat(S-o,"px"));break;case"selb":e=t.clientX-_,n=(o=t.clientY-w)+b,z+(i=e+x)+l<f&&m<i&&(y.style.width="".concat(i<g?i:g,"px")),S+n+l<d&&p<n&&(y.style.height="".concat(n<v?n:v,"px"));break;case"sb":o=t.clientY-w,S+(n=o+b)+l<d&&p<n&&(y.style.height="".concat(n<v?n:v,"px"))}y.className=y.className.replace(/\s?is--drag/,"")+" is--drag",c&&u&&s.savePosStorage(),a.zoom?s.$emit("zoom",k):r.zoom&&r.zoom.call(s,k)},document.onmouseup=function(){s.zoomLocat=null,document.onmousemove=o,document.onmouseup=i,setTimeout(function(){y.className=y.className.replace(/\s?is--drag/,"")},50)}},getStorageMap:function(t){var e=_conf.default.version,t=_xeUtils.default.toStringJSON(localStorage.getItem(t));return t&&t._v===e?t:{_v:e}},hasPosStorage:function(){var t=this.id,e=this.remember,o=this.storage,i=this.storageKey;return!!(e&&o&&this.getStorageMap(i)[t])},restorePosStorage:function(){var t,e,o,i,n,s=this.id,a=this.remember,l=this.storage,r=this.storageKey;a&&l&&((i=this.getStorageMap(r)[s])&&(t=this.getBox(),e=(n=_slicedToArray(i.split(","),8))[0],o=n[1],a=n[2],l=n[3],r=n[4],s=n[5],i=n[6],n=n[7],e&&(t.style.left="".concat(e,"px")),o&&(t.style.top="".concat(o,"px")),a&&(t.style.width="".concat(a,"px")),l&&(t.style.height="".concat(l,"px")),r&&s&&(this.zoomLocat={left:r,top:s,width:i,height:n})))},savePosStorage:function(){var t=this.id,e=this.remember,o=this.storage,i=this.storageKey,n=this.zoomLocat;e&&o&&(e=this.getBox(),(o=this.getStorageMap(i))[t]=[e.style.left,e.style.top,e.style.width,e.style.height].concat(n?[n.left,n.top,n.width,n.height]:[]).map(function(t){return t?_xeUtils.default.toNumber(t):""}).join(","),localStorage.setItem(i,_xeUtils.default.toJSONString(o)))}}};exports.default=_default2;
|
|
1
|
+
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.msgQueue=exports.default=exports.allActivedModals=void 0;var _conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_xeUtils=_interopRequireDefault(require("xe-utils")),_utils=_interopRequireWildcard(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_event=require("../../tools/event"),_log=require("../../tools/log"),_index=_interopRequireDefault(require("../../loading/index"));function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function(t){return t?o:e})(t)}function _interopRequireWildcard(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==_typeof(t)&&"function"!=typeof t)return{default:t};e=_getRequireWildcardCache(e);if(e&&e.has(t))return e.get(t);var o,i,n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(o in t)"default"!==o&&Object.prototype.hasOwnProperty.call(t,o)&&((i=s?Object.getOwnPropertyDescriptor(t,o):null)&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=t[o]);return n.default=t,e&&e.set(t,n),n}function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_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(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(o="Object"===o&&t.constructor?t.constructor.name:o)||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,i=new Array(e);o<e;o++)i[o]=t[o];return i}function _iterableToArrayLimit(t,e){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i,n,s=[],a=!0,l=!1;try{for(o=o.call(t);!(a=(i=o.next()).done)&&(s.push(i.value),!e||s.length!==e);a=!0);}catch(t){l=!0,n=t}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return s}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _defineProperty(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var allActivedModals=[];exports.allActivedModals=allActivedModals;var msgQueue=[];exports.msgQueue=msgQueue;var _default2={name:"VxeModal",mixins:[_size.default],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 _conf.default.modal.top}},position:[String,Object],title:String,duration:{type:[Number,String],default:function(){return _conf.default.modal.duration}},message:[String,Function],content:[String,Function],cancelButtonText:{type:String,default:function(){return _conf.default.modal.cancelButtonText}},confirmButtonText:{type:String,default:function(){return _conf.default.modal.confirmButtonText}},lockView:{type:Boolean,default:function(){return _conf.default.modal.lockView}},lockScroll:Boolean,mask:{type:Boolean,default:function(){return _conf.default.modal.mask}},maskClosable:{type:Boolean,default:function(){return _conf.default.modal.maskClosable}},escClosable:{type:Boolean,default:function(){return _conf.default.modal.escClosable}},resize:{type:Boolean,default:function(){return _conf.default.modal.resize}},showHeader:{type:Boolean,default:function(){return _conf.default.modal.showHeader}},showFooter:{type:Boolean,default:function(){return _conf.default.modal.showFooter}},showZoom:{type:Boolean,default:null},showClose:{type:Boolean,default:function(){return _conf.default.modal.showClose}},dblclickZoom:{type:Boolean,default:function(){return _conf.default.modal.dblclickZoom}},width:[Number,String],height:[Number,String],minWidth:{type:[Number,String],default:function(){return _conf.default.modal.minWidth}},minHeight:{type:[Number,String],default:function(){return _conf.default.modal.minHeight}},zIndex:Number,marginSize:{type:[Number,String],default:function(){return _conf.default.modal.marginSize}},fullscreen:Boolean,draggable:{type:Boolean,default:function(){return _conf.default.modal.draggable}},remember:{type:Boolean,default:function(){return _conf.default.modal.remember}},destroyOnClose:{type:Boolean,default:function(){return _conf.default.modal.destroyOnClose}},showTitleOverflow:{type:Boolean,default:function(){return _conf.default.modal.showTitleOverflow}},transfer:{type:Boolean,default:function(){return _conf.default.modal.transfer}},storage:{type:Boolean,default:function(){return _conf.default.modal.storage}},storageKey:{type:String,default:function(){return _conf.default.modal.storageKey}},animat:{type:Boolean,default:function(){return _conf.default.modal.animat}},size:{type:String,default:function(){return _conf.default.modal.size||_conf.default.size}},beforeHideMethod:{type:Function,default:function(){return _conf.default.modal.beforeHideMethod}},slots:Object,events:Object},data:function(){return{inited:!1,visible:!1,contentVisible:!1,modalTop:0,modalZindex:0,zoomLocat:null,firstOpen:!0}},computed:{isMsg:function(){return"message"===this.type}},watch:{width:function(){this.recalculate()},height:function(){this.recalculate()},value:function(t){this[t?"open":"close"]("model")}},created:function(){this.storage&&!this.id&&(0,_log.errLog)("vxe.error.reqProp",["modal.id"])},mounted:function(){var t=this.$listeners,e=this.events,o=void 0===e?{}:e;this.value&&this.open(),this.recalculate(),this.escClosable&&_event.GlobalEvent.on(this,"keydown",this.handleGlobalKeydownEvent);e="inserted",e={type:e,$modal:this,$event:{type:e}};t.inserted?this.$emit("inserted",e):o.inserted&&o.inserted.call(this,e)},beforeDestroy:function(){var t=this.$el;_event.GlobalEvent.off(this,"keydown"),this.removeMsgQueue(),t.parentNode===document.body&&t.parentNode.removeChild(t)},render:function(e){var o=this,t=this._e,i=this.$scopedSlots,n=this.slots,s=void 0===n?{}:n,a=this.inited,l=this.vSize,r=this.className,c=this.type,u=this.resize,d=this.showClose,f=this.showZoom,h=this.animat,m=this.draggable,p=this.loading,g=this.status,v=this.iconStatus,y=this.showFooter,x=this.zoomLocat,b=this.modalTop,_=this.dblclickZoom,w=this.contentVisible,S=this.visible,z=this.title,k=this.lockScroll,$=this.lockView,T=this.mask,M=this.isMsg,B=this.showTitleOverflow,N=this.destroyOnClose,O=this.content||this.message,P=i.default||s.default,L=i.footer||s.footer,n=i.header||s.header,i=i.title||s.title,s={};return m&&(s.mousedown=this.mousedownEvent),f&&_&&"modal"===c&&(s.dblclick=this.toggleZoomEvent),e("div",{class:["vxe-modal--wrapper","type--".concat(c),r||"",(_defineProperty(r={},"size--".concat(l),l),_defineProperty(r,"status--".concat(g),g),_defineProperty(r,"is--animat",h),_defineProperty(r,"lock--scroll",k),_defineProperty(r,"lock--view",$),_defineProperty(r,"is--resize",u),_defineProperty(r,"is--mask",T),_defineProperty(r,"is--maximize",x),_defineProperty(r,"is--visible",w),_defineProperty(r,"is--active",S),_defineProperty(r,"is--loading",p),r)],style:{zIndex:this.modalZindex,top:b?"".concat(b,"px"):null},on:{click:this.selfClickEvent}},[e("div",{class:"vxe-modal--box",on:{mousedown:this.boxMousedownEvent},ref:"modalBox"},[this.showHeader?e("div",{class:["vxe-modal--header",{"is--draggable":m,"is--ellipsis":!M&&B}],on:s},n?!a||N&&!S?[]:n.call(this,{$modal:this},e):[i?i.call(this,{$modal:this},e):e("span",{class:"vxe-modal--title"},z?(0,_utils.getFuncText)(z):_conf.default.i18n("vxe.alert.title")),f?e("i",{class:["vxe-modal--zoom-btn","trigger--btn",x?_conf.default.icon.MODAL_ZOOM_OUT:_conf.default.icon.MODAL_ZOOM_IN],attrs:{title:_conf.default.i18n("vxe.modal.zoom".concat(x?"Out":"In"))},on:{click:this.toggleZoomEvent}}):t(),d?e("i",{class:["vxe-modal--close-btn","trigger--btn",_conf.default.icon.MODAL_CLOSE],attrs:{title:_conf.default.i18n("vxe.modal.close")},on:{click:this.closeEvent}}):t()]):null,e("div",{class:"vxe-modal--body"},[g?e("div",{class:"vxe-modal--status-wrapper"},[e("i",{class:["vxe-modal--status-icon",v||_conf.default.icon["MODAL_".concat(g).toLocaleUpperCase()]]})]):null,e("div",{class:"vxe-modal--content"},P?!a||N&&!S?[]:P.call(this,{$modal:this},e):(0,_utils.getFuncText)(O)),M?null:e(_index.default,{class:"vxe-modal--loading",props:{loading:p}})]),y?e("div",{class:"vxe-modal--footer"},L?!a||N&&!S?[]:L.call(this,{$modal:this},e):["confirm"===c?e("vxe-button",{ref:"cancelBtn",on:{click:this.cancelEvent}},this.cancelButtonText||_conf.default.i18n("vxe.button.cancel")):null,e("vxe-button",{ref:"confirmBtn",props:{status:"primary"},on:{click:this.confirmEvent}},this.confirmButtonText||_conf.default.i18n("vxe.button.confirm"))]):null,!M&&u?e("span",{class:"vxe-modal--resize"},["wl","wr","swst","sest","st","swlb","selb","sb"].map(function(t){return e("span",{class:"".concat(t,"-resize"),attrs:{type:t},on:{mousedown:o.dragEvent}})})):null])])},methods:{recalculate:function(){var t=this.width,e=this.height,o=this.getBox();return o.style.width=t?isNaN(t)?t:"".concat(t,"px"):null,o.style.height=e?isNaN(e)?e:"".concat(e,"px"):null,this.$nextTick()},selfClickEvent:function(t){this.maskClosable&&t.target===this.$el&&this.close("mask")},updateZindex:function(){var t=this.zIndex,e=this.modalZindex;t?this.modalZindex=t:e<_utils.default.getLastZIndex()&&(this.modalZindex=_utils.default.nextZIndex())},closeEvent:function(t){var e=this.events,o=void 0===e?{}:e,e="close",t={type:e,$modal:this,$event:t};o[e]?o[e].call(this,t):this.$emit(e,t),this.close(e)},confirmEvent:function(t){var e=this.events,o=void 0===e?{}:e,e="confirm",t={type:e,$modal:this,$event:t};o[e]?o[e].call(this,t):this.$emit(e,t),this.close(e)},cancelEvent:function(t){var e=this.events,o=void 0===e?{}:e,e="cancel",t={type:e,$modal:this,$event:t};o[e]?o[e].call(this,t):this.$emit(e,t),this.close(e)},open:function(){var o=this,e=this.$refs,t=this.events,i=void 0===t?{}:t,n=this.inited,s=this.duration,a=this.visible,t=this.isMsg,l=this.remember,r=this.showFooter;n||(this.inited=!0,this.transfer&&document.body.appendChild(this.$el)),a||(l||this.recalculate(),this.visible=!0,this.contentVisible=!1,this.updateZindex(),allActivedModals.push(this),setTimeout(function(){o.contentVisible=!0,o.$nextTick(function(){!r||(t=e.confirmBtn||e.cancelBtn)&&t.focus();var t={type:"",$modal:o};i.show?i.show.call(o,t):(o.$emit("input",!0),o.$emit("show",t))})},10),t?(this.addMsgQueue(),-1!==s&&setTimeout(function(){return o.close("close")},_xeUtils.default.toNumber(s))):this.$nextTick(function(){var t=o.firstOpen,e=o.fullscreen;l&&!t||o.updatePosition().then(function(){setTimeout(function(){return o.updatePosition()},20)}),t?(o.firstOpen=!1,o.hasPosStorage()?o.restorePosStorage():e&&o.$nextTick(function(){return o.maximize()})):e&&o.$nextTick(function(){return o.maximize()})}))},addMsgQueue:function(){-1===msgQueue.indexOf(this)&&msgQueue.push(this),this.updateStyle()},removeMsgQueue:function(){var e=this;-1<msgQueue.indexOf(this)&&_xeUtils.default.remove(msgQueue,function(t){return t===e}),this.updateStyle()},updateStyle:function(){this.$nextTick(function(){var e=0;msgQueue.forEach(function(t){e+=_xeUtils.default.toNumber(t.top),t.modalTop=e,e+=t.$refs.modalBox.clientHeight})})},updatePosition:function(){var u=this;return this.$nextTick().then(function(){var t=u.marginSize,e=u.position,o=u.getBox(),i=document.documentElement.clientWidth||document.body.clientWidth,n=document.documentElement.clientHeight||document.body.clientHeight,s="center"===e,a=s?{top:e,left:e}:Object.assign({},e),l=a.top,r=a.left,c=s||"center"===l,e="",a="",a=r&&!(s||"center"===r)?isNaN(r)?r:"".concat(r,"px"):"".concat(Math.max(t,i/2-o.offsetWidth/2),"px"),e=l&&!c?isNaN(l)?l:"".concat(l,"px"):"".concat(Math.max(t,n/2-o.offsetHeight/2),"px");o.style.top=e,o.style.left=a})},close:function(t){var e=this,o=this.events,i=void 0===o?{}:o,n=this.remember,s=this.visible,a=this.isMsg,o=this.beforeHideMethod,l={type:t,$modal:this};s&&Promise.resolve(o?o(l):null).then(function(t){_xeUtils.default.isError(t)||(a&&e.removeMsgQueue(),e.contentVisible=!1,n||(e.zoomLocat=null),_xeUtils.default.remove(allActivedModals,function(t){return t===e}),e.$emit("before-hide",l),setTimeout(function(){e.visible=!1,i.hide?i.hide.call(e,l):(e.$emit("input",!1),e.$emit("hide",l))},200))}).catch(function(t){return t})},handleGlobalKeydownEvent:function(t){var e,o=this;27===t.keyCode&&((e=_xeUtils.default.max(allActivedModals,function(t){return t.modalZindex}))&&setTimeout(function(){e===o&&e.escClosable&&o.close("exit")},10))},getBox:function(){return this.$refs.modalBox},isMaximized:function(){return!!this.zoomLocat},maximize:function(){var n=this;return this.$nextTick().then(function(){var t,e,o,i;n.zoomLocat||(t=Math.max(0,n.marginSize),e=n.getBox(),o=(i=_dom.default.getDomNode()).visibleHeight,i=i.visibleWidth,n.zoomLocat={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:"".concat(t,"px"),left:"".concat(t,"px"),width:"".concat(i-2*t,"px"),height:"".concat(o-2*t,"px")}),n.savePosStorage())})},revert:function(){var o=this;return this.$nextTick().then(function(){var t,e=o.zoomLocat;e&&(t=o.getBox(),o.zoomLocat=null,Object.assign(t.style,{top:"".concat(e.top,"px"),left:"".concat(e.left,"px"),width:"".concat(e.width,"px"),height:"".concat(e.height,"px")}),o.savePosStorage())})},zoom:function(){var t=this;return this[this.zoomLocat?"revert":"maximize"]().then(function(){return t.isMaximized()})},toggleZoomEvent:function(t){var e=this,o=this.$listeners,i=this.zoomLocat,n=this.events,s=void 0===n?{}:n,a={type:i?"revert":"max",$modal:this,$event:t};return this.zoom().then(function(){o.zoom?e.$emit("zoom",a):s.zoom&&s.zoom.call(e,a)})},getPosition:function(){if(!this.isMsg){var t=this.getBox();if(t)return{top:t.offsetTop,left:t.offsetLeft}}return null},setPosition:function(t,e){var o;return this.isMsg||(o=this.getBox(),_xeUtils.default.isNumber(t)&&(o.style.top="".concat(t,"px")),_xeUtils.default.isNumber(e)&&(o.style.left="".concat(e,"px"))),this.$nextTick()},boxMousedownEvent:function(){var e=this.modalZindex;allActivedModals.some(function(t){return t.visible&&t.modalZindex>e})&&this.updateZindex()},mousedownEvent:function(t){var e,o,n,s,a,l,i=this,r=this.remember,c=this.storage,u=this.marginSize,d=this.zoomLocat,f=this.getBox();d||0!==t.button||_dom.default.getEventTargetNode(t,f,"trigger--btn").flag||(t.preventDefault(),e=document.onmousemove,o=document.onmouseup,n=t.clientX-f.offsetLeft,s=t.clientY-f.offsetTop,t=_dom.default.getDomNode(),a=t.visibleHeight,l=t.visibleWidth,document.onmousemove=function(t){t.preventDefault();var e=f.offsetWidth,o=f.offsetHeight,i=l-e-u-1,e=a-o-u-1,o=t.clientX-n,t=t.clientY-s;(t=e<t?e:t)<u&&(t=u),f.style.left="".concat(o=(o=i<o?i:o)<u?u:o,"px"),f.style.top="".concat(t,"px"),f.className=f.className.replace(/\s?is--drag/,"")+" is--drag"},document.onmouseup=function(){document.onmousemove=e,document.onmouseup=o,r&&c&&i.$nextTick(function(){i.savePosStorage()}),setTimeout(function(){f.className=f.className.replace(/\s?is--drag/,"")},50)})},dragEvent:function(t){var s=this;t.preventDefault();var a=this.$listeners,l=this.marginSize,e=this.events,r=void 0===e?{}:e,c=this.remember,u=this.storage,e=_dom.default.getDomNode(),d=e.visibleHeight,f=e.visibleWidth,h=t.target.getAttribute("type"),m=_xeUtils.default.toNumber(this.minWidth),p=_xeUtils.default.toNumber(this.minHeight),g=f,v=d,y=this.getBox(),o=document.onmousemove,i=document.onmouseup,x=y.clientWidth,b=y.clientHeight,_=t.clientX,w=t.clientY,S=y.offsetTop,z=y.offsetLeft,k={type:"resize",$modal:this};document.onmousemove=function(t){var e,o,i,n;switch(t.preventDefault(),h){case"wl":i=(e=_-t.clientX)+x,l<z-e&&m<i&&(y.style.width="".concat(i<g?i:g,"px"),y.style.left="".concat(z-e,"px"));break;case"swst":e=_-t.clientX,o=w-t.clientY,i=e+x,n=o+b,l<z-e&&m<i&&(y.style.width="".concat(i<g?i:g,"px"),y.style.left="".concat(z-e,"px")),l<S-o&&p<n&&(y.style.height="".concat(n<v?n:v,"px"),y.style.top="".concat(S-o,"px"));break;case"swlb":e=_-t.clientX,o=t.clientY-w,i=e+x,n=o+b,l<z-e&&m<i&&(y.style.width="".concat(i<g?i:g,"px"),y.style.left="".concat(z-e,"px")),S+n+l<d&&p<n&&(y.style.height="".concat(n<v?n:v,"px"));break;case"st":o=w-t.clientY,n=b+o,l<S-o&&p<n&&(y.style.height="".concat(n<v?n:v,"px"),y.style.top="".concat(S-o,"px"));break;case"wr":e=t.clientX-_,z+(i=e+x)+l<f&&m<i&&(y.style.width="".concat(i<g?i:g,"px"));break;case"sest":e=t.clientX-_,n=(o=w-t.clientY)+b,z+(i=e+x)+l<f&&m<i&&(y.style.width="".concat(i<g?i:g,"px")),l<S-o&&p<n&&(y.style.height="".concat(n<v?n:v,"px"),y.style.top="".concat(S-o,"px"));break;case"selb":e=t.clientX-_,n=(o=t.clientY-w)+b,z+(i=e+x)+l<f&&m<i&&(y.style.width="".concat(i<g?i:g,"px")),S+n+l<d&&p<n&&(y.style.height="".concat(n<v?n:v,"px"));break;case"sb":o=t.clientY-w,S+(n=o+b)+l<d&&p<n&&(y.style.height="".concat(n<v?n:v,"px"))}y.className=y.className.replace(/\s?is--drag/,"")+" is--drag",c&&u&&s.savePosStorage(),a.zoom?s.$emit("zoom",k):r.zoom&&r.zoom.call(s,k)},document.onmouseup=function(){s.zoomLocat=null,document.onmousemove=o,document.onmouseup=i,setTimeout(function(){y.className=y.className.replace(/\s?is--drag/,"")},50)}},getStorageMap:function(t){var e=_conf.default.version,t=_xeUtils.default.toStringJSON(localStorage.getItem(t));return t&&t._v===e?t:{_v:e}},hasPosStorage:function(){var t=this.id,e=this.remember,o=this.storage,i=this.storageKey;return!!(e&&o&&this.getStorageMap(i)[t])},restorePosStorage:function(){var t,e,o,i,n,s=this.id,a=this.remember,l=this.storage,r=this.storageKey;a&&l&&((i=this.getStorageMap(r)[s])&&(t=this.getBox(),e=(n=_slicedToArray(i.split(","),8))[0],o=n[1],a=n[2],l=n[3],r=n[4],s=n[5],i=n[6],n=n[7],e&&(t.style.left="".concat(e,"px")),o&&(t.style.top="".concat(o,"px")),a&&(t.style.width="".concat(a,"px")),l&&(t.style.height="".concat(l,"px")),r&&s&&(this.zoomLocat={left:r,top:s,width:i,height:n})))},savePosStorage:function(){var t=this.id,e=this.remember,o=this.storage,i=this.storageKey,n=this.zoomLocat;e&&o&&(e=this.getBox(),(o=this.getStorageMap(i))[t]=[e.style.left,e.style.top,e.style.width,e.style.height].concat(n?[n.left,n.top,n.width,n.height]:[]).map(function(t){return t?_xeUtils.default.toNumber(t):""}).join(","),localStorage.setItem(i,_xeUtils.default.toJSONString(o)))}}};exports.default=_default2;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@charset "UTF-8";
|
|
2
1
|
/*font*/
|
|
3
2
|
/*size*/
|
|
4
3
|
/*icon*/
|
|
@@ -24,74 +23,6 @@
|
|
|
24
23
|
/*select*/
|
|
25
24
|
/*switch*/
|
|
26
25
|
/*pulldown*/
|
|
27
|
-
/*加载中*/
|
|
28
|
-
.vxe-loading {
|
|
29
|
-
display: none;
|
|
30
|
-
position: absolute;
|
|
31
|
-
width: 100%;
|
|
32
|
-
height: 100%;
|
|
33
|
-
top: 0;
|
|
34
|
-
left: 0;
|
|
35
|
-
z-index: 99;
|
|
36
|
-
-webkit-user-select: none;
|
|
37
|
-
-moz-user-select: none;
|
|
38
|
-
-ms-user-select: none;
|
|
39
|
-
user-select: none;
|
|
40
|
-
background-color: rgba(0, 0, 0, 0.2); }
|
|
41
|
-
.vxe-loading.is--visible {
|
|
42
|
-
display: block; }
|
|
43
|
-
.vxe-loading .vxe-loading--spinner {
|
|
44
|
-
width: 56px;
|
|
45
|
-
height: 56px;
|
|
46
|
-
position: absolute;
|
|
47
|
-
top: 50%;
|
|
48
|
-
left: 50%;
|
|
49
|
-
-webkit-transform: translate(-50%, -50%);
|
|
50
|
-
transform: translate(-50%, -50%); }
|
|
51
|
-
.vxe-loading .vxe-loading--spinner:before, .vxe-loading .vxe-loading--spinner:after {
|
|
52
|
-
content: "";
|
|
53
|
-
width: 100%;
|
|
54
|
-
height: 100%;
|
|
55
|
-
border-radius: 50%;
|
|
56
|
-
background-color: #409eff;
|
|
57
|
-
opacity: 0.6;
|
|
58
|
-
position: absolute;
|
|
59
|
-
top: 0;
|
|
60
|
-
left: 0;
|
|
61
|
-
-webkit-animation: bounce 2.0s infinite ease-in-out;
|
|
62
|
-
animation: bounce 2.0s infinite ease-in-out; }
|
|
63
|
-
.vxe-loading .vxe-loading--spinner:after {
|
|
64
|
-
-webkit-animation-delay: -1.0s;
|
|
65
|
-
animation-delay: -1.0s; }
|
|
66
|
-
|
|
67
|
-
@-webkit-keyframes bounce {
|
|
68
|
-
0%, 100% {
|
|
69
|
-
-webkit-transform: scale(0);
|
|
70
|
-
transform: scale(0); }
|
|
71
|
-
50% {
|
|
72
|
-
-webkit-transform: scale(1);
|
|
73
|
-
transform: scale(1); } }
|
|
74
|
-
|
|
75
|
-
@keyframes bounce {
|
|
76
|
-
0%, 100% {
|
|
77
|
-
-webkit-transform: scale(0);
|
|
78
|
-
transform: scale(0); }
|
|
79
|
-
50% {
|
|
80
|
-
-webkit-transform: scale(1);
|
|
81
|
-
transform: scale(1); } }
|
|
82
|
-
|
|
83
|
-
.size--mini .vxe-loading .vxe-loading--spinner {
|
|
84
|
-
width: 38px;
|
|
85
|
-
height: 38px; }
|
|
86
|
-
|
|
87
|
-
.size--small .vxe-loading .vxe-loading--spinner {
|
|
88
|
-
width: 44px;
|
|
89
|
-
height: 44px; }
|
|
90
|
-
|
|
91
|
-
.size--medium .vxe-loading .vxe-loading--spinner {
|
|
92
|
-
width: 50px;
|
|
93
|
-
height: 50px; }
|
|
94
|
-
|
|
95
26
|
.vxe-select {
|
|
96
27
|
position: relative;
|
|
97
28
|
display: inline-block;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
.vxe-select{position:relative;display:inline-block;width:180px;color:#606266;text-align:left}.vxe-select>.vxe-input .vxe-input--inner{cursor:pointer}.vxe-select.is--disabled>.vxe-input .vxe-input--inner{cursor:no-drop}.vxe-select.is--loading>.vxe-input .vxe-input--inner{cursor:progress}.vxe-select>.vxe-input{width:100%}.vxe-select>.vxe-input .vxe-input--suffix-icon{-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out}.vxe-select.is--active>.vxe-input .vxe-input--inner{border:1px solid #409eff}.vxe-select-slots{display:none}.vxe-select--panel{display:none;position:absolute;left:0;padding:4px 0;color:#606266;text-align:left}.vxe-select--panel:not(.is--transfer){min-width:100%}.vxe-select--panel.is--transfer{position:fixed}.vxe-select--panel.animat--leave{display:block;opacity:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:center top;transform-origin:center top;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.vxe-select--panel.animat--leave[placement=top]{-webkit-transform-origin:center bottom;transform-origin:center bottom}.vxe-select--panel.animat--enter{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}.vxe-select-option--wrapper{overflow-x:hidden;overflow-y:auto;padding:4px 0;max-height:200px;border-radius:4px;border:1px solid #dadce0;-webkit-box-shadow:0 0 6px 2px rgba(0,0,0,.1);box-shadow:0 0 6px 2px rgba(0,0,0,.1);background-color:#fff}.vxe-optgroup .vxe-optgroup--title{padding:0 6px;color:#909399;font-size:12px}.vxe-optgroup--wrapper .vxe-select-option{padding:0 20px}.vxe-select-option{padding:0 10px;max-width:600px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vxe-select-option.is--selected{font-weight:700;color:#409eff}.vxe-select-option:not(.is--disabled){cursor:pointer}.vxe-select-option:not(.is--disabled).is--hover{background-color:#f5f7fa}.vxe-select-option.is--disabled{color:#bfbfbf;cursor:no-drop}.vxe-select--empty-placeholder{padding:0 10px;text-align:center;color:#c0c4cc}.vxe-select,.vxe-select--panel{font-size:14px}.vxe-select--panel.size--medium,.vxe-select.size--medium{font-size:14px}.vxe-select--panel.size--small,.vxe-select.size--small{font-size:13px}.vxe-select--panel.size--mini,.vxe-select.size--mini{font-size:12px}.vxe-select--panel .vxe-optgroup--title,.vxe-select--panel .vxe-select-option{height:30px}.vxe-select--panel .vxe-optgroup--title,.vxe-select--panel .vxe-select--empty-placeholder,.vxe-select--panel .vxe-select-option{line-height:30px}.vxe-select--panel.size--medium .vxe-optgroup--title,.vxe-select--panel.size--medium .vxe-select-option{height:28px}.vxe-select--panel.size--medium .vxe-optgroup--title,.vxe-select--panel.size--medium .vxe-select--empty-placeholder,.vxe-select--panel.size--medium .vxe-select-option{line-height:28px}.vxe-select--panel.size--small .vxe-optgroup--title,.vxe-select--panel.size--small .vxe-select-option{height:26px}.vxe-select--panel.size--small .vxe-optgroup--title,.vxe-select--panel.size--small .vxe-select--empty-placeholder,.vxe-select--panel.size--small .vxe-select-option{line-height:26px}.vxe-select--panel.size--mini .vxe-optgroup--title,.vxe-select--panel.size--mini .vxe-select-option{height:24px}.vxe-select--panel.size--mini .vxe-optgroup--title,.vxe-select--panel.size--mini .vxe-select--empty-placeholder,.vxe-select--panel.size--mini .vxe-select-option{line-height:24px}
|