vxe-pc-ui 3.20.1 → 3.20.5
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/card/src/card.js +2 -1
- package/es/drawer/src/drawer.js +75 -16
- package/es/drawer/style.css +13 -6
- package/es/drawer/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/layout-aside/src/layout-aside.js +2 -1
- package/es/layout-body/src/layout-body.js +2 -1
- package/es/list/src/list.js +57 -25
- package/es/menu/src/menu.js +2 -2
- package/es/modal/src/modal.js +73 -14
- package/es/modal/style.css +4 -0
- package/es/modal/style.min.css +1 -1
- package/es/scrollbar/src/scrollbar.js +22 -6
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tabs/src/tabs.js +2 -2
- package/es/tree/src/tree.js +50 -27
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-drawer/style.css +13 -6
- package/es/vxe-drawer/style.min.css +1 -1
- package/es/vxe-modal/style.css +4 -0
- package/es/vxe-modal/style.min.css +1 -1
- package/lib/card/src/card.js +2 -1
- package/lib/card/src/card.min.js +1 -1
- package/lib/drawer/src/drawer.js +76 -12
- package/lib/drawer/src/drawer.min.js +1 -1
- package/lib/drawer/style/style.css +13 -6
- package/lib/drawer/style/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +425 -191
- package/lib/index.umd.min.js +1 -1
- package/lib/layout-aside/src/layout-aside.js +2 -1
- package/lib/layout-aside/src/layout-aside.min.js +1 -1
- package/lib/layout-body/src/layout-body.js +2 -1
- package/lib/layout-body/src/layout-body.min.js +1 -1
- package/lib/list/src/list.js +107 -64
- package/lib/list/src/list.min.js +1 -1
- package/lib/menu/src/menu.js +1 -1
- package/lib/menu/src/menu.min.js +1 -1
- package/lib/modal/src/modal.js +74 -12
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/modal/style/style.css +4 -0
- package/lib/modal/style/style.min.css +1 -1
- package/lib/scrollbar/src/scrollbar.js +35 -15
- package/lib/scrollbar/src/scrollbar.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tabs/src/tabs.js +1 -1
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/tree/src/tree.js +64 -36
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-drawer/style/style.css +13 -6
- package/lib/vxe-drawer/style/style.min.css +1 -1
- package/lib/vxe-modal/style/style.css +4 -0
- package/lib/vxe-modal/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/card/src/card.ts +2 -1
- package/packages/drawer/src/drawer.ts +80 -16
- package/packages/layout-aside/src/layout-aside.ts +2 -1
- package/packages/layout-body/src/layout-body.ts +2 -1
- package/packages/list/src/list.ts +66 -25
- package/packages/menu/src/menu.ts +2 -2
- package/packages/modal/src/modal.ts +83 -19
- package/packages/scrollbar/src/scrollbar.ts +27 -6
- package/packages/tabs/src/tabs.ts +2 -2
- package/packages/tree/src/tree.ts +60 -31
- package/styles/components/drawer.scss +13 -6
- package/styles/components/modal.scss +4 -0
- package/types/components/drawer.d.ts +20 -0
- package/types/components/gantt-module/gantt-view.d.ts +24 -1
- package/types/components/gantt-plugins/extend-gantt-chart.d.ts +1 -1
- package/types/components/gantt.d.ts +2 -0
- package/types/components/layout-aside.d.ts +15 -0
- package/types/components/layout-body.d.ts +3 -0
- package/types/components/list.d.ts +18 -1
- package/types/components/modal.d.ts +20 -0
- package/types/components/number-input.d.ts +12 -2
- package/types/components/table-plugins/extend-pivot-table.d.ts +1 -1
- package/types/components/table.d.ts +36 -2
- package/types/components/tree.d.ts +15 -1
- package/es/scrollbar/src/util.js +0 -54
- package/lib/scrollbar/src/util.js +0 -63
- package/lib/scrollbar/src/util.min.js +0 -1
- package/packages/scrollbar/src/util.ts +0 -57
- /package/es/icon/{iconfont.1791950618327.ttf → iconfont.1792048654011.ttf} +0 -0
- /package/es/icon/{iconfont.1791950618327.woff → iconfont.1792048654011.woff} +0 -0
- /package/es/icon/{iconfont.1791950618327.woff2 → iconfont.1792048654011.woff2} +0 -0
- /package/es/{iconfont.1791950618327.ttf → iconfont.1792048654011.ttf} +0 -0
- /package/es/{iconfont.1791950618327.woff → iconfont.1792048654011.woff} +0 -0
- /package/es/{iconfont.1791950618327.woff2 → iconfont.1792048654011.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1791950618327.ttf → iconfont.1792048654011.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1791950618327.woff → iconfont.1792048654011.woff} +0 -0
- /package/lib/icon/style/{iconfont.1791950618327.woff2 → iconfont.1792048654011.woff2} +0 -0
- /package/lib/{iconfont.1791950618327.ttf → iconfont.1792048654011.ttf} +0 -0
- /package/lib/{iconfont.1791950618327.woff → iconfont.1792048654011.woff} +0 -0
- /package/lib/{iconfont.1791950618327.woff2 → iconfont.1792048654011.woff2} +0 -0
package/lib/list/src/list.min.js
CHANGED
|
@@ -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=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_store=require("./store"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_anime=require("../../ui/src/anime"),_util=require("../../scrollbar/src/util"),_util2=require("./util"),_loading=_interopRequireDefault(require("../../loading"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,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 r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _createForOfIteratorHelper(e,t){var r,o,i,a,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return i=!(o=!0),{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){i=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw r}}};if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}var _createComponentLog=(0,_log.createComponentLog)("tree"),warnLog=_createComponentLog.warnLog,errLog=_createComponentLog.errLog,crossListDragRowObj=null;function eqRowKey(e,t){return""+e==""+t}function getRowKeyByField(e,t){return e?""+(e[t]||""):""}function getRowIdByField(e,t){return e?(e=getRowKeyByField(e,t),(0,_utils.enModelValue)(e)):""}function createReactData(){return{scrollYLoad:!1,bodyHeight:0,headHeight:0,footHeight:0,customHeight:0,customMaxHeight:0,parentHeight:0,topSpaceHeight:0,rowList:[],selectRadioRow:null,currRowFlag:1,updateCheckboxFlag:1,isAllChecked:!1,isAllIndeterminate:!1,yThumbHeight:0,xThumbWidth:0,insertRowFlag:1,removeRowFlag:1,dragRow:null,dragTipText:"",isCrossDragRow:!1}}function createInternalData(){return{fullData:[],afterList:[],fullKeyMaps:{},rowMaps:{},thumbDragOffset:0,yThumbTop:0,xThumbLeft:0,lastScrollTop:0,lastScrollLeft:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0},currentRow:null,selectCheckboxMaps:{},insertRowMaps:{},removeRowMaps:{}}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeList",mixins:[_ui.globalMixins.sizeMixin],props:{data:Array,height:[Number,String],maxHeight:[Number,String],loading:Boolean,className:[String,Function],size:{type:String,default:function(){return(0,_ui.getConfig)().list.size||(0,_ui.getConfig)().size}},autoResize:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.autoResize}},syncResize:[Boolean,String,Number],showSeq:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.showSeq}},showRadio:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.showRadio}},checkRowKey:[String,Number],radioConfig:Object,showCheckbox:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.showCheckbox}},checkRowKeys:Array,checkboxConfig:Object,rowConfig:Object,dragConfig:Object,menuConfig:Object,virtualYConfig:Object,scrollY:Object,useScrollbar:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.useScrollbar}},scrollbarConfig:Object},data:function(){var e=_xeUtils.default.uniqueId(),t=createReactData();return Object.assign(Object.assign({},{}),{xID:e,reactData:t,crossListDragRowInfo:_store.crossListDragRowGlobal,reFlag:0})},computed:Object.assign(Object.assign({},{}),{computeRowOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.rowConfig,this.rowConfig)},computeDragOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.dragConfig,this.dragConfig)},computeSYOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.virtualYConfig||(0,_ui.getConfig)().list.scrollY,this.virtualYConfig||this.scrollY)},computeKeyField:function(){return this.computeRowOpts.keyField||""},computeIsDrag:function(){var e=this.dragConfig,t=this.computeDragOpts;return e&&(0,_utils.isEnableConf)(t)},computeRowHeight:function(){return this.computeRowOpts.height},computeRadioOpts:function(){return Object.assign({showIcon:!0},(0,_ui.getConfig)().list.radioConfig,this.radioConfig)},computeCheckboxOpts:function(){return Object.assign({showIcon:!0},(0,_ui.getConfig)().list.checkboxConfig,this.checkboxConfig)},computeMenuOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.menuConfig,this.menuConfig)},computeWrapperStyles:function(){var e=this.computeRowHeight,t=this.computeScrollbarOpts,r=this.computeScrollbarXOpts,o=this.computeScrollbarYOpts,o=(0,_utils.getDefaultConfig)((0,_utils.getDefaultConfig)(o.width,t.width),(0,_ui.getConfig)().scrollbar.width),r=(0,_utils.getDefaultConfig)((0,_utils.getDefaultConfig)(r.height,t.height),(0,_ui.getConfig)().scrollbar.height),t={};return e&&(t["--vxe-ui-list-row-height"]=(0,_dom.toCssUnit)(e)),(o||r)&&(t["--vxe-ui-scrollbar-y-width"]=(0,_dom.toCssUnit)(o||r),t["--vxe-ui-scrollbar-x-height"]=(0,_dom.toCssUnit)(r||o)),t},computeVirtualStyles:function(){var e=this.reactData,t=this.height,r=this.maxHeight,o=e.customHeight,i=e.customMaxHeight,a=e.headHeight,e=e.footHeight,n={};return t?n.height=(0,_dom.toCssUnit)(Math.max(20,o-a-e)):r&&(n.height="auto",n.maxHeight=(0,_dom.toCssUnit)(Math.max(20,i-a-e))),n},computeScrollbarOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.scrollbarConfig,this.scrollbarConfig)},computeScrollbarXOpts:function(){var e=this.computeScrollbarOpts;return Object.assign({},(0,_ui.getConfig)().scrollbar.xConfig,e.xConfig)},computeScrollbarYOpts:function(){var e=this.computeScrollbarOpts;return Object.assign({},(0,_ui.getConfig)().scrollbar.yConfig,e.yConfig)},computeScrollXVisible:function(){var e=this.computeScrollbarOpts,t=this.computeScrollbarXOpts;return(0,_utils.getDefaultConfig)(t.visible,e.visible)},computeScrollYVisible:function(){var e=this.computeScrollbarOpts,t=this.computeScrollbarYOpts;return(0,_utils.getDefaultConfig)(t.visible,e.visible)},computeScrollXAutoHide:function(){var e=this.computeScrollbarOpts,t=this.computeScrollbarXOpts;return(0,_utils.getDefaultConfig)((0,_utils.getDefaultConfig)(t.autoHide,e.autoHide),(0,_ui.getConfig)().scrollbar.autoHide)},computeScrollYAutoHide:function(){var e=this.computeScrollbarOpts,t=this.computeScrollbarYOpts;return(0,_utils.getDefaultConfig)((0,_utils.getDefaultConfig)(t.autoHide,e.autoHide),(0,_ui.getConfig)().scrollbar.autoHide)},computeScrollbarWrapperClss:function(){var e=this,t=e.reactData,r=e.computeScrollbarOpts.padding,o=t.yThumbHeight,t=t.xThumbWidth,i=e.computeScrollbarXToTop,a=e.computeScrollbarYToLeft,n=e.computeScrollYVisible,s=e.computeScrollXAutoHide,l=e.computeScrollYAutoHide;return _ui.domUtils.buildClass(["vxe-scrollbar is--virtual","ov-x--".concat(!1===e.computeScrollXVisible?"hidden":"visible"),"ov-y--".concat(!1===n?"hidden":"visible"),"sx-pos--".concat(i?"top":"bottom"),"sy-pos--".concat(a?"left":"right")],{"is--padding":r,"ov-x--auto-hide":s,"ov-y--auto-hide":l,"overflow-y":o,"overflow-x":t})},computeScrollbarXToTop:function(){return"top"===this.computeScrollbarXOpts.position},computeScrollbarYToLeft:function(){return"left"===this.computeScrollbarYOpts.position}}),methods:{dispatchEvent:function(e,t,r){this.$emit(e,(0,_ui.createEvent)(r,{$list:this},t))},emitCheckboxMode:function(e){this.$emit("update:checkRowKeys",e)},emitRadioMode:function(e){this.$emit("update:checkRowKey",e)},callSlot:function(e,t,r){var o=this.$scopedSlots;return e&&(_xeUtils.default.isString(e)&&(e=o[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e.call(this,t,r)):[]},getRowId:function(e){return getRowIdByField(e,this.computeKeyField)},updateRadioModeValue:function(){var e=this.reactData,t=this.internalData,r=this.checkRowKey,t=t.fullKeyMaps;r?(t=t[r],e.selectRadioRow=t||null):e.selectRadioRow=null},updateCheckboxModeValue:function(){var e=this.internalData,t=this.checkRowKeys,r=e.fullKeyMaps,o=this.computeKeyField,i={};if(t&&t.length){var a,n=_createForOfIteratorHelper(t);try{for(n.s();!(a=n.n()).done;){var s=r[a.value];s&&(i[getRowIdByField(s,o)]=s)}}catch(e){n.e(e)}finally{n.f()}}e.selectCheckboxMaps=i,this.updateCheckboxStatus()},updateAfterDataIndex:function(){var e=this.internalData,t=e.afterList,i=e.rowMaps,a=this.computeKeyField,n=0;t.forEach(function(e,t){var r=getRowIdByField(e,a),o=i[r];o?o._index=n:(o={item:e,index:t,$index:-1,_index:n},i[r]=o),n++})},cacheRowMap:function(){var e=this.internalData,t=e.fullData,r=this.computeKeyField,o={};t.forEach(function(e){var t=getRowKeyByField(e,r);o[t]=e}),e.fullKeyMaps=o},loadData:function(e){var t=this,r=t.reactData,o=t.internalData,i=o.scrollYStore,a=t.computeSYOpts,e=e?e.slice(0):[];return Object.assign(i,{startIndex:0,endIndex:1,visibleSize:0}),o.fullData=e,o.insertRowMaps={},r.insertRowFlag++,o.removeRowMaps={},r.removeRowFlag++,r.scrollYLoad=!!a.enabled&&-1<a.gt&&(0===a.gt||a.gt<=e.length),t.cacheRowMap(),t.handleData(!0),t.updateRadioModeValue(),t.updateCheckboxModeValue(),t.computeScrollLoad().then(function(){t.refreshScroll()})},reloadData:function(e){return this.clearScroll(),this.loadData(e)},getFullData:function(){return this.internalData.fullData},calcTableHeight:function(e){var t=this.reactData.parentHeight,e=this[e],r=0;return r=e?"100%"===e||"auto"===e?t:(r=(0,_dom.isScale)(e)?Math.floor((_xeUtils.default.toInteger(e)||1)/100*t):_xeUtils.default.toNumber(e),Math.max(40,r)):r},updateHeight:function(){var e=this,t=e.reactData,r=e.$refs.refHeaderElem,o=e.$refs.refFooterElem;t.headHeight=r?Math.floor(r.offsetHeight):0,t.footHeight=o?Math.floor(o.offsetHeight):0,t.customHeight=e.calcTableHeight("height"),t.customMaxHeight=e.calcTableHeight("maxHeight")},updateYSpace:function(){var e=this.reactData,t=this.internalData,r=e.scrollYLoad,o=t.scrollYStore;e.bodyHeight=r?t.fullData.length*o.rowHeight:0,e.topSpaceHeight=r?Math.max(o.startIndex*o.rowHeight,0):0},updateAfterFullData:function(){var e=this.internalData,t=e.fullData;e.afterList=t.slice(0),this.updateAfterDataIndex()},handleData:function(e){var t=this,r=t.reactData,o=t.internalData,i=r.scrollYLoad,a=o.fullData,n=o.scrollYStore,s=o.rowMaps,l=t.computeKeyField,o=(e&&t.updateAfterFullData(),i?a.slice(n.startIndex,n.endIndex):a.slice(0));return l&&o.forEach(function(e,t){e=getRowIdByField(e,l),e=s[e];e&&(e.$index=t)}),r.rowList=o,t.$nextTick()},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var n=this,s=n.reactData,l=n.internalData,c=n.browseObj;return n.$nextTick().then(function(){var e,t=s.scrollYLoad,r=l.scrollYStore,o=n.$refs.refVirtualBody,i=n.computeSYOpts,a=0;(e=o?(e=i.sItem?o.querySelector(i.sItem):e)||o.children[0]:e)&&(a=e.offsetHeight),a=Math.max(12,a),r.rowHeight=a,t?(o=n.$refs.refVirtualWrapper,e=Math.max(8,Math.ceil(o.clientHeight/a)),t=i.oSize?_xeUtils.default.toNumber(i.oSize):c.edge?10:0,r.offsetSize=t,r.visibleSize=e,r.endIndex=Math.max(r.startIndex+e+t,r.endIndex),n.updateYData()):n.updateYSpace()})},clearScroll:function(){var e=this.$refs.refVirtualWrapper;return e&&(e.scrollTop=0),this.$nextTick()},scrollTo:function(e,t){var r=this,o=r.reactData,i=r.$refs.refVirtualWrapper;return e&&!_xeUtils.default.isNumber(e)&&(t=e.top,e=e.left),_xeUtils.default.isNumber(e)&&(i.scrollLeft=e),_xeUtils.default.isNumber(t)&&(i.scrollTop=t),o.scrollYLoad?new Promise(function(e){setTimeout(function(){r.$nextTick(function(){e()})},50)}):r.$nextTick()},refreshScroll:function(){var e=this.internalData,t=e.lastScrollLeft,r=e.lastScrollTop;return this.clearScroll().then(function(){if(t||r)return e.lastScrollLeft=0,e.lastScrollTop=0,scrollTo(t,r)})},updateScrollbar:function(){this.updateThumbSize(),this.updateThumbOffset()},recalculate:function(){var e=this,t=e.reactData,r=e.$refs.refElem;if(r){var o,i=r.parentElement,a=0;if((i=i&&(0,_dom.hasClass)(i,"vxe-scrollbar--view-inner")?i.parentElement:i)&&(o=getComputedStyle(i),a=i.clientHeight-Math.ceil(_xeUtils.default.toNumber(o.paddingLeft)+_xeUtils.default.toNumber(o.paddingRight))),t.parentHeight=a,e.updateScrollbar(),e.updateHeight(),r.clientWidth&&r.clientHeight)return e.computeScrollLoad()}return e.$nextTick()},loadYData:function(e){var t=this.internalData.scrollYStore,r=t.startIndex,o=t.endIndex,i=t.visibleSize,a=t.offsetSize,e=e.target.scrollTop,e=Math.floor(e/t.rowHeight),n=Math.max(0,e-1-a),a=e+i+a;!(e<=r||o-i-1<=e)||r===n&&o===a||(t.startIndex=n,t.endIndex=a,this.updateYData())},scrollEvent:function(e){var t=this,r=t.reactData,o=t.internalData,i=e.target,a=i.scrollTop,i=i.scrollLeft,n=i!==o.lastScrollLeft,s=a!==o.lastScrollTop;t.updateThumbOffset(),o.lastScrollTop=a,o.lastScrollLeft=i,r.scrollYLoad&&t.loadYData(e),t.dispatchEvent("scroll",{scrollLeft:i,scrollTop:a,isX:n,isY:s},e)},getRowKey:function(e){return getRowKeyByField(e,this.computeKeyField)},eqRowKey:eqRowKey,eqRow:function(e,t){return!(!e||!t)&&(e===t||eqRowKey(this.getRowId(e),this.getRowId(t)))},eqRowByKey:function(e,t){return e&&eqRowKey(this.getRowKey(e),t)},findRow:function(e,t){var r=this;return t?_xeUtils.default.find(e,function(e){return r.eqRow(e,t)}):null},findRowByKey:function(e,t){var r=this.computeKeyField;return _xeUtils.default.find(e,function(e){return eqRowKey(getRowIdByField(e,r),t)})},findRowIndexOf:function(e,t){var r=this;return t?_xeUtils.default.findIndexOf(e,function(e){return r.eqRow(e,t)}):-1},findRowIndexOfByKey:function(e,t){var r=this.computeKeyField;return _xeUtils.default.findIndexOf(e,function(e){return eqRowKey(getRowIdByField(e,r),t)})},isCheckedByRadioRowKey:function(e){var t=this.reactData.selectRadioRow;return this.getRowKey(t)===e},isCheckedByRadioRow:function(e){return this.isCheckedByRadioRowKey(this.getRowKey(e))},isCheckedByCheckboxRowKey:function(e){var t=this.reactData,r=this.internalData,t=t.updateCheckboxFlag,r=r.selectCheckboxMaps;return!(!t||!r[e])},isCheckedByCheckboxRow:function(e){return this.isCheckedByCheckboxRowKey(this.getRowKey(e))},setCurrentRow:function(e){var t=this.reactData;return this.internalData.currentRow=e,t.currRowFlag++,this.$nextTick()},setCurrentRowByKey:function(e){var t=this.reactData,r=this.internalData,o=r.fullData;return r.currentRow=this.findRowByKey(o,e),t.currRowFlag++,this.$nextTick()},getCurrentRow:function(){return this.internalData.currentRow},getCurrentRowKey:function(){var e=this.internalData.currentRow;return e?this.getRowKey(e):null},clearCurrentRow:function(){var e=this.reactData;return this.internalData.currentRow=null,e.currRowFlag++,this.$nextTick()},setRadioRow:function(e){this.reactData.selectRadioRow=e;e=this.getRowKey(e);return this.emitRadioMode(e),this.$nextTick()},setRadioRowByKey:function(e){var t=this,r=t.reactData,o=t.internalData.fullData,r=(r.selectRadioRow=t.findRowByKey(o,e),e);return t.emitRadioMode(r),t.$nextTick()},getRadioRow:function(){return this.reactData.selectRadioRow},getRadioRowKey:function(){var e=this.reactData.selectRadioRow;return e?this.getRowKey(e):null},clearRadioRow:function(){return this.reactData.selectRadioRow=null,this.emitRadioMode(null),this.$nextTick()},setCheckboxRow:function(e,t){var r=this,o=r.internalData.selectCheckboxMaps,i=r.computeKeyField,e=((e?_xeUtils.default.isArray(e)?e:[e]:[]).forEach(t?function(e){var t=getRowIdByField(e,i);o[t]||(o[t]=e)}:function(e){e=getRowIdByField(e,i);o[e]&&delete o[e]}),r.getCheckboxRowKeys());return r.emitCheckboxMode(e),r.updateCheckboxStatus()},setCheckboxRowByKey:function(e,t){var r=this,o=r.internalData,i=o.selectCheckboxMaps,a=o.fullKeyMaps,n=r.computeKeyField,o=((e?_xeUtils.default.isArray(e)?e:[e]:[]).forEach(t?function(e){var t,e=a[e||""];e&&(t=getRowIdByField(e,n),e)&&!i[t]&&(i[t]=e)}:function(e){var e=a[e||""];e&&(e=getRowIdByField(e,n),i[e])&&delete i[e]}),r.getCheckboxRowKeys());return r.emitCheckboxMode(o),r.updateCheckboxStatus()},getCheckboxRecords:function(){var e=this.reactData,t=this.internalData,e=e.updateCheckboxFlag,t=t.selectCheckboxMaps,r=[];return e&&_xeUtils.default.each(t,function(e){e&&r.push(e)}),r},getCheckboxRows:function(){return this.getCheckboxRecords()},getCheckboxRowKeys:function(){var e=this.reactData,t=this.internalData,e=e.updateCheckboxFlag,t=t.selectCheckboxMaps,r=this.computeKeyField,o=[];return e&&_xeUtils.default.each(t,function(e){e&&(e=getRowKeyByField(e,r),o.push(e))}),o},clearCheckboxRow:function(){var e=this.reactData;this.internalData.selectCheckboxMaps={},e.updateCheckboxFlag++,e.isAllChecked=!1,e.isAllIndeterminate=!1;return this.emitCheckboxMode([]),this.$nextTick()},setAllCheckboxRow:function(e){var t=this,r=t.internalData,o=r.fullData,i=r.selectCheckboxMaps,a=t.computeKeyField;if(e){var n,s=[],l=_createForOfIteratorHelper(o);try{for(l.s();!(n=l.n()).done;){var c=n.value,u=getRowKeyByField(c,a);i[getRowIdByField(c,a)]=c,s.push(u)}}catch(e){l.e(e)}finally{l.f()}return t.emitCheckboxMode(s),t.updateCheckboxStatus()}return t.clearCheckboxRow()},updateCheckboxStatus:function(){var e=this,t=e.reactData,r=e.internalData,o=r.selectCheckboxMaps,r=r.fullData,i=e.computeKeyField,a=e.computeCheckboxOpts.checkMethod,n=!1,s=!1;if(a){var l,c=_createForOfIteratorHelper(r);try{for(c.s();!(l=c.n()).done;){var u=l.value;if(a({row:u,$list:e}))if(o[getRowIdByField(u,i)])n=!0;else if(s=!0,n)break}}catch(e){c.e(e)}finally{c.f()}}else{var d,h=_createForOfIteratorHelper(r);try{for(h.s();!(d=h.n()).done;)if(o[getRowIdByField(d.value,i)])n=!0;else if(s=!0,n)break}catch(e){h.e(e)}finally{h.f()}}return t.isAllChecked=n&&!s,t.isAllIndeterminate=n&&s,t.updateCheckboxFlag++,e.$nextTick()},changeCheckboxAllEvent:function(e){var t=!this.reactData.isAllChecked;t?this.setAllCheckboxRow(!0):this.clearCheckboxRow(),this.dispatchEvent("checkbox-all",{checked:t},e)},changeCheckboxEvent:function(e,t){var r=this,o=r.reactData,i=r.internalData,i=(e.preventDefault(),e.stopPropagation(),i.selectCheckboxMaps),a=r.computeCheckboxOpts.checkMethod,n=r.getRowKey(t);(!a||a({$list:r,row:t}))&&(a=!1,i[n]?delete i[n]:(a=!0,i[n]=t),o.updateCheckboxFlag++,r.updateCheckboxStatus(),n=_xeUtils.default.keys(i).map(_utils.deModelValue),r.emitCheckboxMode(n),r.dispatchEvent("checkbox-change",{row:t,value:n,checked:a},e))},changeCurrentEvent:function(e,t){var r=this.reactData,o=this.internalData;e.preventDefault();var i=this.computeRowOpts.currentMethod,a=!1;(a=i?!i({row:t}):a)||(o.currentRow=t,r.currRowFlag++,this.dispatchEvent("current-change",{row:t,checked:!0},e))},changeRadioEvent:function(e,t){var r,o=this,i=o.reactData,a=(e.preventDefault(),e.stopPropagation(),i.selectRadioRow),n=o.computeRadioOpts,s=n.strict,n=n.checkMethod,l=o.getRowKey(t);(!n||n({$list:o,row:t}))&&(n=l,r=!0,s&&a&&l===o.getRowKey(a)?(r=!1,i.selectRadioRow=null):i.selectRadioRow=t,o.emitRadioMode(n),o.dispatchEvent("radio-change",{row:t,value:n,checked:r},e))},handleRowDragEndClearStatus:function(){this.clearRowDragData(),this.clearCrossListDragStatus(),this.recalculate()},clearRowDropOrigin:function(){var t,e=this.$refs.refElem;e&&_xeUtils.default.arrayEach(e.querySelectorAll(".".concat(t="row--drag-origin")),function(e){(e.draggable=!1,_dom.removeClass)(e,t)})},updateRowDropOrigin:function(e){var t=this.computeSYOpts.sItem,r=this.$refs.refElem;r&&(e=this.getRowId(e),_xeUtils.default.arrayEach(r.querySelectorAll('.vxe-list--row[rowid="'.concat(e,'"]')+(t?"".concat(t,'[rowid="').concat(e,'"]'):"")),function(e){(0,_dom.addClass)(e,"row--drag-origin")}))},updateRowDropTipContent:function(e){var t=this.reactData,r=t.dragRow,o=this.computeDragOpts.tooltipMethod,i="";i=o?"".concat(o({$list:this,row:r})||""):(0,_ui.getI18n)("vxe.list.dragTip",[e.textContent||""]),t.dragTipText=i},hideDropTip:function(){var e=this.$refs.refDragTipElem,t=this.$refs.refDragRowLineElem;e&&(e.style.display=""),t&&(t.style.display="")},clearCrossListDragStatus:function(){var e=(0,_store.getCrossListDragRowInfo)(this);crossListDragRowObj=null,e.row=null},clearDragStatus:function(){var e=this.reactData;e.dragRow&&(this.hideDropTip(),this.clearRowDropOrigin(),this.clearCrossListDragStatus(),e.dragRow=null)},handleRowDragMousedownEvent:function(e,t){var r=this,o=r.reactData,i=(0,_store.getCrossListDragRowInfo)(r),a=(e.stopPropagation(),t.row),n=r.computeDragOpts,s=n.isCrossListDrag,l=n.dragStartMethod,c=e.currentTarget,n="row"===n.trigger?c:c.parentElement.parentElement;r.clearRowDropOrigin(),l&&!l(t)?(n.draggable=!1,o.dragRow=null,r.hideDropTip()):(s&&(i.row=a,crossListDragRowObj={$oldList:r,$newList:null}),c={row:a},o.dragRow=a,n.draggable=!0,r.updateRowDropOrigin(a),r.updateRowDropTipContent(n),r.dispatchEvent("row-dragstart",c,e))},handleRowDragMouseupEvent:function(){this.clearDragStatus()},showDropTip:function(e,t,r,o){var i,a,n,s,l=this.$refs.refElem;l&&(i=l.getBoundingClientRect(),s=l.clientHeight,t&&(a=this.$refs.refDragRowLineElem)&&(r?(n=t.getBoundingClientRect(),t=t.clientHeight,s<(n=Math.max(1,n.y-i.y))+t&&(t=s-n),a.style.display="block",a.style.top="".concat(n,"px"),a.style.height="".concat(t,"px"),a.setAttribute("drag-pos",o)):a.style.display=""),s=this.$refs.refDragTipElem)&&(s.style.display="block",s.style.top="".concat(Math.min(l.clientHeight-l.scrollTop-s.clientHeight,e.clientY-i.y),"px"),s.style.left="".concat(Math.min(l.clientWidth-l.scrollLeft-s.clientWidth-1,e.clientX-i.x),"px"),s.setAttribute("drag-status",r?"normal":"disabled"))},clearRowDragData:function(){var e=this.reactData,t=this.$refs.refElem;this.hideDropTip(),this.clearRowDropOrigin(),(0,_anime.clearRowAnimate)(t,[".vxe-list--row"]),e.dragRow=null},handleRowDragSwapEvent:function(t,r,o,i){var e,u,d,h,f,a,n,s,l,g=this,p=g.reactData,w=g.internalData,c=w.fullData,m=g.computeDragOpts,v=m.animation,m=m.dragEndMethod||(m?m.dragEndMethod:null),R="bottom"===i?1:0,b=g.$refs.refElem,D={status:!1};if(b&&o&&r){if(o!==r)return e={oldRow:r,newRow:o,dragRow:r,dragPos:i,offsetIndex:R},u=g.getRowId(r),d=g.findRowIndexOfByKey(c,u),n=g.getRowKey(o),h=0,f=-1,v&&(n=b.querySelector('.vxe-list--row[rowid="'.concat(n,'"]')),a=b.querySelector('.vxe-list--row[rowid="'.concat(u,'"]')),(n=n||a)&&(h=n.offsetHeight),a)&&(f=a.offsetTop),l=s=-1,Promise.resolve(!m||m(e)).then(function(e){if(!e)return D;s=g.findRowIndexOf(c,r),c.splice(s,1);e=g.findRowIndexOf(c,o);return l=e+R,c.splice(l,0,r),g.handleData(),p.scrollYLoad&&g.updateYSpace(),t&&g.dispatchEvent("row-dragend",{oldRow:r,newRow:o,dragRow:r,dragPos:i,offsetIndex:R,_index:{newIndex:l,oldIndex:s}},t),g.$nextTick().then(function(){var e,t,r,o,i,a,n,s,l,c;v&&(n=p.rowList,c=w.fullData,l=g.findRowIndexOfByKey(c,u),s=c[0],s=g.findRowIndexOf(c,s),e=b,-1<s&&(i=s+c.length,r=t=-1,o=1,d<s?(t=0,r=l-s):i<d?(t=g.findRowIndexOfByKey(n,u)+1,r=c.length,o=-1):d<l?r=(t=d-s)+l-d:(r=(t=l-s)+d-l+1,o=-1),(i=c.slice(t,r)).length)&&(a=[],i.forEach(function(e){e=g.getRowId(e);a.push('.vxe-list--row[rowid="'.concat(e,'"]'))}),n=e.querySelectorAll(a.join(",")),(0,_anime.moveRowAnimateToTb)(n,o*h)),s=['.vxe-list--row[rowid="'.concat(u,'"]')],c=(l=e.querySelectorAll(s.join(",")))[0],-1<f)&&c&&(0,_anime.moveRowAnimateToTb)(l,f-c.offsetTop),g.recalculate()}).then(function(){return{status:!0}})}).catch(function(){return D}).then(function(e){return g.clearRowDragData(),g.clearCrossListDragStatus(),e});g.clearRowDragData(),g.clearCrossListDragStatus()}return Promise.resolve(D)},handleRowDragDragstartEvent:function(e){e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0)},handleRowDragDragendEvent:function(e){var t=this,r=t.reactData,o=t.internalData,r=r.dragRow,i=o.prevDragRow,o=o.prevDragPos;if(t.computeDragOpts.isCrossListDrag&&crossListDragRowObj){var a=crossListDragRowObj.$newList;if(a&&a.xID!==t.xID)return void a.handleCrossListRowDragInsertEvent(e)}t.handleRowDragSwapEvent(e,r,i,o)},handleRowDragDragoverEvent:function(e){var t,r=this,o=r.reactData,i=r.internalData,o=o.dragRow,a=i.fullData,n=(o||e.preventDefault(),e.currentTarget),s=n.getAttribute("rowid")||"",a=r.findRowByKey(a,s);a&&(e.preventDefault(),t=e.clientY-n.getBoundingClientRect().y<n.clientHeight/2?"top":"bottom",i.prevDragRow=a,i.prevDragPos=t,o&&r.getRowId(o)===s?r.showDropTip(e,n,!1,t):(i={oldRow:o,targetRow:a,dragPos:t,dragRow:o,offsetIndex:"bottom"==t?1:0},r.showDropTip(e,n,!0,t),r.dispatchEvent("row-dragover",i,e)))},handleRowMousedownEvent:function(e,t){var r=this.computeDragOpts,o=this.computeIsDrag,i=r.trigger,r=r.disabledMethod,a=!1,t={row:t,$list:this};!(a=o?"row"===i:a)||r&&r(t)||this.handleRowDragMousedownEvent(e,t)},handleRowClickEvent:function(e,t){var r=this,o=r.reactData,i=r.internalData,a=r.showRadio,n=r.showCheckbox,s=i.currentRow,l=r.computeRadioOpts,c=r.computeCheckboxOpts,u=!1,d=!1,h=!1;r.computeRowOpts.isCurrent?(u=!0,r.changeCurrentEvent(e,t)):s&&(i.currentRow=null,o.currRowFlag++),a&&"row"===l.trigger&&(d=!0,r.changeRadioEvent(e,t)),n&&"row"===c.trigger&&(h=!0,r.changeCheckboxEvent(e,t)),r.dispatchEvent("row-click",{row:t,triggerCurrent:u,triggerRadio:d,triggerCheckbox:h},e)},handleRowDblclickEvent:function(e,t){this.dispatchEvent("row-dblclick",{row:t},e)},insertListRow:function(e,t){var r=this.internalData,o=r.fullData,i=r.rowMaps,a=this.computeKeyField,n=t?"push":"unshift";e.forEach(function(e){var t=getRowIdByField(e,a),r=(0,_util2.getItemCacheObj)(e);o[n](e),i[t]=r})},handleInsertRowAt:function(e,t,r){var o=this,i=o.reactData,a=o.internalData,n=a.fullData,s=a.rowMaps,l=a.removeRowMaps,c=a.insertRowMaps,u=o.computeKeyField;if(!u)return errLog("vxe.error.reqSupportProp",["insert() | insertAt() | insertNextAt()","row-config.keyField"]),Promise.resolve({row:null,rows:[]});_xeUtils.default.isArray(e)||(e=[e]);var d,h=t;return(_xeUtils.default.isString(t)||_xeUtils.default.isNumber(t))&&(a=s[t])&&(h=a.item),e.length?(d=e.map(function(e){return _xeUtils.default.assign({},e)}),_xeUtils.default.eqNull(h)?o.insertListRow(d,!1):-1===h?o.insertListRow(d,!0):-1<(t=n.findIndex(function(e){return h[u]===e[u]}))?(d.forEach(function(e){var t=getRowIdByField(e,u),e=(0,_util2.getItemCacheObj)(e);s[t]=e}),a=t,r&&(a+=1),n.splice.apply(n,[a,0].concat(_toConsumableArray(d)))):(warnLog("vxe.error.unableInsert"),o.insertListRow(d,!0)),d.forEach(function(e){var t=getRowIdByField(e,u);l[t]?(delete l[t],c[t]&&delete c[t]):c[t]=e}),i.removeRowFlag++,i.insertRowFlag++,o.cacheRowMap(),o.handleData(!0),o.updateAfterDataIndex(),o.updateCheckboxStatus(),i.scrollYLoad&&o.updateYSpace(),o.$nextTick().then(function(){return{row:d.length?d[d.length-1]:null,rows:d}})):Promise.resolve({row:null,rows:[]})},insert:function(e){return this.handleInsertRowAt(e,null)},insertAt:function(e,t){return this.handleInsertRowAt(e,t)},insertNextAt:function(e,t){return this.handleInsertRowAt(e,t,!0)},getInsertRecords:function(){var e=this.internalData.insertRowMaps,t=[];return _xeUtils.default.each(e,function(e){t.push(e)}),t},isInsertByRow:function(e){var t=this.reactData,r=this.internalData,e=this.getRowId(e);return!!t.insertRowFlag&&!!r.insertRowMaps[e]},remove:function(e){var r,o=this,t=o.reactData,i=o.internalData,a=i.fullData,n=i.insertRowMaps,s=i.removeRowMaps;return o.computeKeyField?(r=[],e?_xeUtils.default.isArray(e)||(e=[e]):e=a,e.length?(e.forEach(function(e){var t;o.isInsertByRow(e)||(t=o.getRowId(e),s[t]=e)}),a===e?(e=r=a.slice(0),i.fullData=[]):e.forEach(function(e){var t=o.getRowId(e),e=_xeUtils.default.findIndexOf(a,function(e){return t===o.getRowId(e)});-1<e&&(e=a.splice(e,1),r.push(e[0]))}),e.forEach(function(e){e=o.getRowId(e);n[e]&&delete n[e]}),t.removeRowFlag++,t.insertRowFlag++,o.cacheRowMap(),o.handleData(!0),o.updateAfterDataIndex(),o.updateCheckboxStatus(),t.scrollYLoad&&o.updateYSpace(),o.$nextTick().then(function(){return o.recalculate()}).then(function(){return{row:r.length?r[r.length-1]:null,rows:r}})):Promise.resolve({row:null,rows:[]})):(errLog("vxe.error.reqSupportProp",["insert() | insertAt() | insertNextAt()","row-config.keyField"]),Promise.resolve({row:null,rows:[]}))},getRemoveRecords:function(){var e=this.internalData.removeRowMaps,t=[];return _xeUtils.default.each(e,function(e){t.push(e)}),t},isRemoveByRow:function(e){var t=this.reactData,r=this.internalData,e=this.getRowId(e);return!!t.removeRowFlag&&!!r.removeRowMaps[e]},getRecordset:function(){return{insertRecords:this.getInsertRecords(),removeRecords:this.getRemoveRecords()}},handleCrossListRowDragCancelEvent:function(){this.clearRowDragData(),this.clearCrossListDragStatus()},handleCrossListRowDragFinishEvent:function(e){var r,t,o,i=this,a=i.reactData,n=i.internalData,s=(0,_store.getCrossListDragRowInfo)(i),a=a.rowList,n=n.rowMaps,l=i.computeDragOpts,c=l.animation,u=i.$refs.refElem;u&&l.isCrossListDrag&&crossListDragRowObj&&s&&(l=s.row)&&(n=n[s=i.getRowId(l)],r=0,t=-1,n&&(c&&(s=u.querySelector('.vxe-list--row[rowid="'.concat(s,'"]')))&&(r=s.offsetHeight),t=n.$index),o=-1<t&&t<a.length-1?a.slice(t+1):[],i.remove([l]).then(function(){var t,e;c&&r&&o.length&&(e=u,t=[],o.forEach(function(e){e=i.getRowId(e);t.push('.vxe-list--row[rowid="'.concat(e,'"]'))}),e=e.querySelectorAll(t.join(",")),(0,_anime.moveRowAnimateToTb)(e,r))}),i.dispatchEvent("row-remove-dragend",{row:l},e),i.handleRowDragEndClearStatus())},handleCrossListRowDragoverEmptyEvent:function(e){var t,r,o=this,i=o.reactData,a=o.internalData,n=i.rowList;o.computeDragOpts.isCrossListDrag&&crossListDragRowObj&&!n.length&&(t=(n=crossListDragRowObj).$oldList,n=n.$newList,t)&&(r=t).xID!==o.xID&&(n&&n.xID!==o.xID&&n.hideCrossListRowDropClearStatus(),e.preventDefault(),t.hideCrossListRowDropClearStatus(),crossListDragRowObj.$newList=o,a.prevDragRow=null,i.dragTipText=r.dragTipText,o.showDropTip(e,e.currentTarget,!0,""))},handleCrossListRowDragInsertEvent:function(r){var o,i,n,s,a,l,c=this,u=c.reactData,d=c.internalData,e=(0,_store.getCrossListDragRowInfo)(c),h=d.prevDragRow,f=d.prevDragPos,t=c.computeDragOpts,g=t.animation,p=t.dragEndMethod;t.isCrossListDrag&&crossListDragRowObj&&e&&(o=e.row,i=crossListDragRowObj.$oldList,n=c.$refs.refElem)&&i&&o&&(a=-1,t={oldRow:s=o,newRow:h,dragRow:s,dragPos:f,offsetIndex:a=h?"bottom"===f?1:0:a},l={status:!1},Promise.resolve(!p||p(t)).then(function(e){if(!e)return i&&i.xID!==c.xID&&i.handleCrossListRowDragCancelEvent(r),c.handleRowDragEndClearStatus(),l;var e=Promise.resolve(),t=[s];i.handleCrossListRowDragFinishEvent(r),e=h?"bottom"===f?c.insertNextAt(t,h):c.insertAt(t,h):c.insert(t),c.dispatchEvent("row-insert-dragend",{oldRow:o,newRow:h,dragRow:s,dragPos:f,offsetIndex:a},r),c.clearRowDragData(),e.then(function(){var t,e=u.rowList,r=d.rowMaps,o=c.getRowId(s),r=r[o],i=0,a=-1,o=(r&&(g&&(o=n.querySelector('.vxe-list--row[rowid="'.concat(o,'"]')))&&(i=o.offsetHeight),a=r.$index),-1<a?e.slice(a):[]);g&&i&&o.length&&(r=n,t=[],o.forEach(function(e){e=c.getRowId(e);t.push('.vxe-list--row[rowid="'.concat(e,'"]'))}),e=r.querySelectorAll(t.join(",")),(0,_anime.moveRowAnimateToTb)(e,-i))})}))},hideCrossListRowDropClearStatus:function(){this.hideDropTip()},handleContextmenuEvent:function(o,i){var a=this,e=a.reactData,t=a.internalData,r=a.menuConfig,n=a.computeMenuOpts,s=a.computeRowOpts.isCurrent;(r?(0,_utils.isEnableConf)(n):n.enabled)&&(r=n.options,(n=n.visibleMethod)&&!n({$list:a,options:r,row:i})||(s?a.changeCurrentEvent(o,i):t.currentRow&&(t.currentRow=null,e.currRowFlag++),_ui.VxeUI.contextMenu&&_ui.VxeUI.contextMenu.openByEvent(o,{options:r,events:{optionClick:function(e){var t=e.option,r=_ui.menus.get(t.code),r=r?r.listMenuMethod:null,t={menu:t,row:i,$event:o,$list:a};r&&r(t,o),a.dispatchEvent("menu-click",t,e.$event)}}}))),a.dispatchEvent("row-menu",{row:i},o)},updateThumbSize:function(){var e,t,r=this,o=r.reactData,i=r.$refs.refVirtualWrapper;i&&i.clientHeight&&(t=(t=r.$refs.refTrackXElem)?(0,_util.getThumbSize)(i.clientWidth,i.scrollWidth,t.clientWidth):0,(e=r.$refs.refThumbXElem)&&(e.style.width=t+"px"),o.xThumbWidth=t,t=(e=r.$refs.refTrackYElem)?(0,_util.getThumbSize)(i.clientHeight,i.scrollHeight,e.clientHeight):0,(i=r.$refs.refThumbYElem)&&(i.style.height=t+"px"),o.yThumbHeight=t)},updateThumbOffset:function(){var e,t,r,o=this,i=o.reactData,a=o.internalData,n=o.$refs.refVirtualWrapper;n&&n.clientHeight&&(e=i.xThumbWidth,i=i.yThumbHeight,r=o.$refs.refTrackXElem,t=o.$refs.refThumbXElem,r=r&&e?(0,_util.getThumbOffsetSize)(n.scrollLeft,n.clientWidth,n.scrollWidth,r.clientWidth,e):0,a.xThumbLeft=r,t&&e&&(t.style.width=e+"px",t.style.transform="translateX(".concat(r,"px)")),e=o.$refs.refTrackYElem,t=o.$refs.refThumbYElem,r=e&&i?(0,_util.getThumbOffsetSize)(n.scrollTop,n.clientHeight,n.scrollHeight,e.clientHeight,i):0,a.yThumbTop=r,t)&&i&&(t.style.height=i+"px",t.style.transform="translateY(".concat(r,"px)"))},clickTrackXEvent:function(e){var t,r,o=this.reactData,i=e.currentTarget;i===e.target&&(t=this.$refs.refVirtualWrapper)&&(o=o.xThumbWidth,r=i.getBoundingClientRect(),t.scrollTo({left:(0,_util.getScrollFromClick)(e.clientX-r.left,t.clientWidth,t.scrollWidth,i.clientWidth,o),behavior:"auto"}))},clickTrackYEvent:function(e){var t,r,o=this.reactData,i=e.currentTarget;i===e.target&&(t=this.$refs.refVirtualWrapper)&&(o=o.yThumbHeight,r=i.getBoundingClientRect(),t.scrollTo({top:(0,_util.getScrollFromClick)(e.clientY-r.top,t.clientHeight,t.scrollHeight,i.clientHeight,o),behavior:"auto"}))},pointerdownThumbXEvent:function(e){var t,r=this.reactData,o=this.internalData,i=e.currentTarget,a=(o.isThumbDrag=!0,i.setPointerCapture(e.pointerId),this.$refs.refVirtualWrapper);a&&(r=r.xThumbWidth,t=(i=i.parentElement).getBoundingClientRect(),e=e.clientX-t.left,t=(0,_util.getThumbOffsetSize)(a.scrollLeft,a.clientWidth,a.scrollWidth,i.clientWidth,r),o.thumbDragOffset=e-t)},pointermoveThumbXEvent:function(e){var t,r,o,i=this.reactData,a=this.internalData;e.currentTarget.hasPointerCapture(e.pointerId)&&(t=a.isThumbDrag,a=a.thumbDragOffset,t)&&(t=this.$refs.refVirtualWrapper)&&(i=i.xThumbWidth,o=(r=e.currentTarget.parentElement).getBoundingClientRect(),t.scrollLeft=(0,_util.getScrollFromDrag)(e.clientX-o.left,a,t.clientWidth,t.scrollWidth,r.clientWidth,i))},cleatPointerThumbEvent:function(e){var t=this.internalData;e.currentTarget.releasePointerCapture(e.pointerId),t.isThumbDrag=!1},pointerdownThumbYEvent:function(e){var t,r=this.reactData,o=this.internalData,i=e.currentTarget,a=(o.isThumbDrag=!0,i.setPointerCapture(e.pointerId),this.$refs.refVirtualWrapper);a&&(r=r.yThumbHeight,t=(i=i.parentElement).getBoundingClientRect(),e=e.clientY-t.top,t=(0,_util.getThumbOffsetSize)(a.scrollTop,a.clientHeight,a.scrollHeight,i.clientHeight,r),o.thumbDragOffset=e-t)},pointermoveThumbYEvent:function(e){var t,r,o,i=this.reactData,a=this.internalData;e.currentTarget.hasPointerCapture(e.pointerId)&&(t=a.isThumbDrag,a=a.thumbDragOffset,t)&&(t=this.$refs.refVirtualWrapper)&&(i=i.yThumbHeight,o=(r=e.currentTarget.parentElement).getBoundingClientRect(),t.scrollTop=(0,_util.getScrollFromDrag)(e.clientY-o.top,a,t.clientHeight,t.scrollHeight,r.clientHeight,i))},renderDragTip:function(e){var t=this,r=t.reactData,o=r.dragRow,r=r.dragTipText,i=t.computeDragOpts;return t.computeIsDrag?e("div",{class:"vxe-list--drag-wrapper"},[e("div",{ref:"refDragRowLineElem",class:["vxe-list--drag-row-line",{"is--guides":i.showGuidesStatus}]}),o&&i.showDragTip?e("div",{ref:"refDragTipElem",class:"vxe-list--drag-sort-tip"},[e("div",{class:"vxe-list--drag-sort-tip-wrapper"},[e("div",{class:"vxe-list--drag-sort-tip-status"},[e("span",{class:["vxe-list--drag-sort-tip-normal-status",(0,_ui.getIcon)().LIST_DRAG_STATUS_NODE]}),e("span",{class:["vxe-list--drag-sort-tip-disabled-status",(0,_ui.getIcon)().LIST_DRAG_DISABLED]})]),e("div",{class:"vxe-list--drag-sort-tip-content"},r)])]):(0,_ui.renderEmptyElement)(t)]):(0,_ui.renderEmptyElement)(t)},renderRadio:function(e,t,r,o,i){var a=this,n=a.showRadio,s=a.computeRadioOpts,l=s.showIcon,s=s.visibleMethod,s=!s||s({$list:a,row:t});return n&&l&&s?e("div",{key:"ct2",class:["vxe-list--radio-option",{"is--checked":i,"is--disabled":o}],on:{click:function(e){o||a.changeRadioEvent(e,t)}}},[e("span",{class:["vxe-radio--icon",i?(0,_ui.getIcon)().RADIO_CHECKED:o?(0,_ui.getIcon)().RADIO_DISABLED_UNCHECKED:(0,_ui.getIcon)().RADIO_UNCHECKED]})]):(0,_ui.renderEmptyElement)(a)},renderCheckbox:function(e,t,r,o,i){var a=this,n=a.showCheckbox,s=a.computeCheckboxOpts,l=s.showIcon,s=s.visibleMethod,s=!s||s({$list:a,row:t});return n&&l&&s?e("div",{key:"ct3",class:["vxe-list--checkbox-option",{"is--checked":i,"is--disabled":o}],on:{click:function(e){o||a.changeCheckboxEvent(e,t)}}},[e("span",{class:["vxe-checkbox--icon",i?(0,_ui.getIcon)().CHECKBOX_CHECKED:o?(0,_ui.getIcon)().CHECKBOX_DISABLED_UNCHECKED:(0,_ui.getIcon)().CHECKBOX_UNCHECKED]})]):(0,_ui.renderEmptyElement)(a)},renderRow:function(e,t,r){var o=this,i=o.reactData,a=o.internalData,n=o.$scopedSlots,s=o.showRadio,l=o.showCheckbox,c=i.selectRadioRow,u=i.currRowFlag,i=i.updateCheckboxFlag,d=a.selectCheckboxMaps,a=a.currentRow,h=n.content,n=n.extra,f=o.computeDragOpts,g=f.trigger,p=f.icon,w=f.disabledMethod,f=f.visibleMethod,m=o.computeRadioOpts,v=o.computeCheckboxOpts,R=o.computeRowOpts,b=R.useKey,D=R.contentField,y=R.className,R=R.isCurrent,x=o.computeIsDrag,C=o.computeKeyField,_=y&&_xeUtils.default.isFunction(y),b=C||b||x||R||s||l,R=b&&C?getRowIdByField(t,C):"",E=(0,_utils.enModelValue)(R),S={row:t,$list:o},k=!1,T=!1,c=(s&&(k=c&&(t===c||o.eqRowByKey(c,R)),T=!!m.checkMethod&&!m.checkMethod({$list:o,row:t})),!1),m=!1,i=(l&&(c=!(!i||!d[E]),m=!!v.checkMethod&&!v.checkMethod({$list:o,row:t})),[]),I=(s&&i.push(o.renderRadio(e,t,E,T,k)),l&&i.push(o.renderCheckbox(e,t,E,m,c)),!1),v=(x&&C&&(!f||f(S))&&(d={},"row"!==g&&(I=!(!w||!w(S)),d.mousedown=function(e){I||o.handleRowDragMousedownEvent(e,S)},d.mouseup=o.handleRowDragMouseupEvent),i.push(e("div",{key:"ct1",class:"vxe-list--row-drag"},[e("span",{class:"vxe-list--drag-handle",on:d},[e("i",{class:p||(0,_ui.getIcon)().LIST_DRAG})])]))),i.push(e("div",{key:"ct5",class:"vxe-list--row-content"},h?h(S):D?(0,_utils.getText)(t[D]):"")),n&&i.push(e("div",{key:"ct7",class:"vxe-list--row-extra"},n(S))),{mousedown:function(e){o.handleRowMousedownEvent(e,t)},mouseup:o.handleRowDragMouseupEvent,click:function(e){o.handleRowClickEvent(e,t)},dblclick:function(e){o.handleRowDblclickEvent(e,t)},contextmenu:function(e){o.handleContextmenuEvent(e,t)}});return x&&(v.dragstart=o.handleRowDragDragstartEvent,v.dragend=o.handleRowDragDragendEvent,v.dragover=o.handleRowDragDragoverEvent),e("div",{key:b&&C?E:r,class:["vxe-list--row",_?y(S):y||"",{"is--drag-disabled":I,"is--current":u&&a&&o.eqRowByKey(a,R),"is-radio--disabled":T,"is-radio--checked":k,"is-checkbox--disabled":m,"is-checkbox--checked":c}],attrs:b&&C?{rowid:E}:void 0,on:v},i)},renderVN:function(r){var o=this,e=o.reactData,t=o.$scopedSlots,i=o.showCheckbox,a=o.className,n=o.loading,s=o.useScrollbar,l=e.bodyHeight,c=e.topSpaceHeight,u=e.rowList,d=e.isAllChecked,h=e.isAllIndeterminate,f=e.xThumbWidth,e=e.yThumbHeight,g=t.default,p=t.header,t=t.footer,w=o.computeSize,m=o.computeWrapperStyles,v=o.computeVirtualStyles,R=o.computeRadioOpts,b=o.computeCheckboxOpts,D=o.computeDragOpts,y=D.trigger,x=o.computeRowOpts,C=x.isHover,x=x.padding,_=o.computeIsDrag,E=o.computeScrollbarOpts,S=o.computeScrollXVisible,k=o.computeScrollYVisible,T=o.computeScrollbarXToTop,I=o.computeScrollbarYToLeft,O=o.computeScrollXAutoHide,L=o.computeScrollYAutoHide,M=o.computeScrollbarWrapperClss,i=i&&!1!==b.showHeader,H={};return D.isCrossListDrag&&!u.length&&(H.dragover=o.handleCrossListRowDragoverEmptyEvent),r("div",{ref:"refElem",class:["vxe-list",s?"ov-x--".concat(!1===S?"hidden":"visible"):"",s?"ov-y--".concat(!1===k?"hidden":"visible"):"",s?"sx-pos--".concat(T?"top":"bottom"):"",s?"sy-pos--".concat(I?"left":"right"):"",a?_xeUtils.default.isFunction(a)?a({$list:o}):a:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(w),w),"is--virtual-scrollbar",s),"ov-padding",s&&E.padding),"ov-x--auto-hide",s&&O),"ov-y--auto-hide",s&&L),"overflow-y",e),"overflow-x",f),"is--drag",_),"is--loading",n)],on:H,style:m},[p||i?r("div",{ref:"refHeaderElem",class:"vxe-list--header-wrapper"},[i?r("div",{class:"vxe-list--header-left"},[r("div",{class:["vxe-list--checkbox-header",{"is--checked":d,"is--indeterminate":h}],on:{click:o.changeCheckboxAllEvent}},[r("span",{class:["vxe-checkbox--icon",d?(0,_ui.getIcon)().CHECKBOX_CHECKED:h?(0,_ui.getIcon)().CHECKBOX_INDETERMINATE:(0,_ui.getIcon)().CHECKBOX_UNCHECKED]})])]):(0,_ui.renderEmptyElement)(o),p?r("div",{class:"vxe-list--header-content"},p({items:u,$list:o})):(0,_ui.renderEmptyElement)(o)]):(0,_ui.renderEmptyElement)(o),r("div",{ref:"refVirtualWrapper",class:"vxe-list--virtual-wrapper",style:v,on:{scroll:o.scrollEvent}},[r("div",{class:"vxe-list--y-space",style:{height:l?"".concat(l,"px"):""}}),r("div",{ref:"refVirtualBody",class:["vxe-list--body",{"trigger--row":"row"===y,"checkbox--highlight":b.highlight,"radio--highlight":R.highlight,"row--hover":C,"is--padding":x}],style:{marginTop:c?"".concat(c,"px"):""}},g?g({items:u,$list:o}):u.map(function(e,t){return o.renderRow(r,e,t)}))]),t?r("div",{ref:"refFooterElem",class:"vxe-list--footer-wrapper"},t({items:u,$list:o})):(0,_ui.renderEmptyElement)(o),s?r("div",{class:M},[!1===S?(0,_ui.renderEmptyElement)(o):r("div",{ref:"refTrackXElem",class:"vxe-scrollbar--track-x",on:{click:o.clickTrackXEvent}},[r("div",{ref:"refThumbXElem",class:"vxe-scrollbar--thumb-x",on:{pointerdown:o.pointerdownThumbXEvent,pointermove:o.pointermoveThumbXEvent,pointerup:o.cleatPointerThumbEvent,pointercancel:o.cleatPointerThumbEvent,lostpointercapture:o.cleatPointerThumbEvent}})]),!1===k?(0,_ui.renderEmptyElement)(o):r("div",{ref:"refTrackYElem",class:"vxe-scrollbar--track-y",on:{click:o.clickTrackYEvent}},[r("div",{ref:"refThumbYElem",class:"vxe-scrollbar--thumb-y",on:{pointerdown:o.pointerdownThumbYEvent,pointermove:o.pointermoveThumbYEvent,pointerup:o.cleatPointerThumbEvent,pointercancel:o.cleatPointerThumbEvent,lostpointercapture:o.cleatPointerThumbEvent}})])]):(0,_ui.renderEmptyElement)(o),o.renderDragTip(r),r(_loading.default,{class:"vxe-list--loading",props:{value:n}})])}},watch:{data:function(){this.loadData(this.data||[])},height:function(){this.reFlag++},maxHeight:function(){this.reFlag++},syncResize:function(){this.reFlag++},useScrollbar:function(){this.reFlag++},computeRowHeight:function(){this.reFlag++},computeScrollXVisible:function(){var e=this;e.$nextTick(function(){e.reFlag++})},computeScrollYVisible:function(){var e=this;e.$nextTick(function(){e.reFlag++})},reFlag:function(){var e=this;e.recalculate().then(function(){e.recalculate()})},checkRowKey:function(){this.updateRadioModeValue()},checkRowKeys:function(){this.updateCheckboxModeValue()}},created:function(){this.internalData=createInternalData(),this.browseObj=_xeUtils.default.browse(),this.loadData(this.data||[])},mounted:function(){var e=this,t=e.internalData,r=e.showSeq,o=e.showRadio,i=e.showCheckbox,a=e.autoResize,n=e.useScrollbar,s=e.computeRowOpts,l=s.useKey,s=s.keyField,c=e.computeIsDrag;s||(r&&errLog("vxe.error.reqSupportProp",["show-seq","row-config.keyField"]),o&&errLog("vxe.error.reqSupportProp",["show-radio","row-config.keyField"]),i&&errLog("vxe.error.reqSupportProp",["show-checkbox","row-config.keyField"]),c&&errLog("vxe.error.reqSupportProp",["drag-config","row-config.keyField"])),l&&!s&&errLog("vxe.error.reqSupportProp",["row-config.useKey","row-config.keyField"]),(n||a)&&(r=e.$refs.refElem,o=e.$refs.refVirtualBody,i=_ui.globalResize.create(function(){e.reFlag++}),r&&(i.observe(r),a)&&i.observe(r.parentElement),o&&i.observe(o),t.resizeObserver=i),e.reFlag++,_ui.globalEvents.on(e,"resize",function(){e.reFlag++})},activated:function(){var e=this;e.recalculate().then(function(){e.refreshScroll()})},beforeDestroy:function(){var e=this.reactData,t=this.internalData,r=t.resizeObserver;r&&r.disconnect(),_ui.globalEvents.off(this,"resize"),_xeUtils.default.assign(e,createReactData()),_xeUtils.default.assign(t,createInternalData())},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=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_store=require("./store"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_anime=require("../../ui/src/anime"),_util=require("./util"),_loading=_interopRequireDefault(require("../../loading"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,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 r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _createForOfIteratorHelper(e,t){var r,o,i,a,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return i=!(o=!0),{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){i=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw r}}};if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}var getConfig=_ui.VxeUI.getConfig,getIcon=_ui.VxeUI.getIcon,getI18n=_ui.VxeUI.getI18n,domUtils=_ui.VxeUI.domUtils,scrollbarUtils=_ui.VxeUI.scrollbarUtils,menus=_ui.VxeUI.menus,globalEvents=_ui.VxeUI.globalEvents,globalResize=_ui.VxeUI.globalResize,getThumbOffsetSize=scrollbarUtils.getThumbOffsetSize,getThumbSize=scrollbarUtils.getThumbSize,getScrollFromClick=scrollbarUtils.getScrollFromClick,getScrollFromDrag=scrollbarUtils.getScrollFromDrag,_createComponentLog=(0,_log.createComponentLog)("tree"),warnLog=_createComponentLog.warnLog,errLog=_createComponentLog.errLog,crossListDragRowObj=null;function eqRowKey(e,t){return""+e==""+t}function getRowKeyByField(e,t){return e?""+(e[t]||""):""}function getRowIdByField(e,t){return e?(e=getRowKeyByField(e,t),(0,_utils.enModelValue)(e)):""}function createReactData(){return{scrollYLoad:!1,bodyHeight:0,headHeight:0,footHeight:0,customHeight:0,customMaxHeight:0,parentHeight:0,topSpaceHeight:0,rowList:[],selectRadioRow:null,currRowFlag:1,updateCheckboxFlag:1,isAllChecked:!1,isAllIndeterminate:!1,yThumbHeight:0,xThumbWidth:0,insertRowFlag:1,removeRowFlag:1,dragRow:null,dragTipText:"",isCrossDragRow:!1}}function createInternalData(){return{fullData:[],afterList:[],fullKeyMaps:{},rowMaps:{},thumbDragOffset:0,yThumbTop:0,xThumbLeft:0,lastScrollTop:0,lastScrollLeft:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0},currentRow:null,selectCheckboxMaps:{},insertRowMaps:{},removeRowMaps:{}}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeList",mixins:[_ui.globalMixins.sizeMixin],props:{data:Array,height:[Number,String],maxHeight:[Number,String],loading:Boolean,className:[String,Function],size:{type:String,default:function(){return getConfig().list.size||getConfig().size}},autoResize:{type:Boolean,default:function(){return getConfig().list.autoResize}},syncResize:[Boolean,String,Number],showSeq:{type:Boolean,default:function(){return getConfig().list.showSeq}},showRadio:{type:Boolean,default:function(){return getConfig().list.showRadio}},checkRowKey:[String,Number],radioConfig:Object,showCheckbox:{type:Boolean,default:function(){return getConfig().list.showCheckbox}},checkRowKeys:Array,checkboxConfig:Object,rowConfig:Object,dragConfig:Object,menuConfig:Object,virtualYConfig:Object,scrollY:Object,useScrollbar:{type:Boolean,default:function(){return(0,_utils.getDefaultConfig)(getConfig().list.useScrollbar,getConfig().useScrollbar)}},scrollbarConfig:Object},data:function(){var e=_xeUtils.default.uniqueId(),t=createReactData();return Object.assign(Object.assign({},{}),{xID:e,reactData:t,crossListDragRowInfo:_store.crossListDragRowGlobal,reFlag:0})},computed:Object.assign(Object.assign({},{}),{computeRowOpts:function(){return Object.assign({},getConfig().list.rowConfig,this.rowConfig)},computeDragOpts:function(){return Object.assign({},getConfig().list.dragConfig,this.dragConfig)},computeSYOpts:function(){return Object.assign({},getConfig().list.virtualYConfig||getConfig().list.scrollY,this.virtualYConfig||this.scrollY)},computeKeyField:function(){return this.computeRowOpts.keyField||""},computeIsDrag:function(){var e=this.dragConfig,t=this.computeDragOpts;return e&&(0,_utils.isEnableConf)(t)},computeRowHeight:function(){return this.computeRowOpts.height},computeRadioOpts:function(){return Object.assign({showIcon:!0},getConfig().list.radioConfig,this.radioConfig)},computeCheckboxOpts:function(){return Object.assign({showIcon:!0},getConfig().list.checkboxConfig,this.checkboxConfig)},computeMenuOpts:function(){return Object.assign({},getConfig().list.menuConfig,this.menuConfig)},computeWrapperStyles:function(){var e=this.computeRowHeight,t=this.computeScrollYWidth,r=this.computeScrollXHeight,o={};return e&&(o["--vxe-ui-list-row-height"]=(0,_dom.toCssUnit)(e)),(t||r)&&(o["--vxe-ui-scrollbar-y-width"]=(0,_dom.toCssUnit)(t||r),o["--vxe-ui-scrollbar-x-height"]=(0,_dom.toCssUnit)(r||t)),o},computeVirtualStyles:function(){var e=this.reactData,t=this.height,r=this.maxHeight,o=e.customHeight,i=e.customMaxHeight,a=e.headHeight,e=e.footHeight,n={};return t?n.height=(0,_dom.toCssUnit)(Math.max(20,o-a-e)):r&&(n.height="auto",n.maxHeight=(0,_dom.toCssUnit)(Math.max(20,i-a-e))),n},computeScrollbarOpts:function(){return Object.assign({},getConfig().list.scrollbarConfig,this.scrollbarConfig)},computeScrollbarXOpts:function(){var e=this.computeScrollbarOpts;return Object.assign({},getConfig().scrollbar.xConfig,e.xConfig)},computeScrollbarYOpts:function(){var e=this.computeScrollbarOpts;return Object.assign({},getConfig().scrollbar.yConfig,e.yConfig)},computeScrollXHeight:function(){var e=this.computeScrollbarOpts,t=this.computeScrollbarXOpts;return(0,_utils.getDefaultConfig)((0,_utils.getDefaultConfig)(t.height,e.height),getConfig().scrollbar.height)},computeScrollYWidth:function(){var e=this.computeScrollbarOpts,t=this.computeScrollbarYOpts;return(0,_utils.getDefaultConfig)((0,_utils.getDefaultConfig)(t.width,e.width),getConfig().scrollbar.width)},computeScrollXVisible:function(){var e=this.computeScrollbarOpts,t=this.computeScrollbarXOpts;return(0,_utils.getDefaultConfig)(t.visible,e.visible)},computeScrollYVisible:function(){var e=this.computeScrollbarOpts,t=this.computeScrollbarYOpts;return(0,_utils.getDefaultConfig)(t.visible,e.visible)},computeScrollXAutoHide:function(){var e=this.computeScrollbarOpts,t=this.computeScrollbarXOpts;return(0,_utils.getDefaultConfig)((0,_utils.getDefaultConfig)(t.autoHide,e.autoHide),getConfig().scrollbar.autoHide)},computeScrollYAutoHide:function(){var e=this.computeScrollbarOpts,t=this.computeScrollbarYOpts;return(0,_utils.getDefaultConfig)((0,_utils.getDefaultConfig)(t.autoHide,e.autoHide),getConfig().scrollbar.autoHide)},computeScrollbarWrapperClss:function(){var e=this,t=e.reactData,r=t.yThumbHeight,t=t.xThumbWidth,o=e.computeScrollbarXToTop,i=e.computeScrollbarYToLeft,a=e.computeScrollYVisible;return domUtils.buildClass(["vxe-scrollbar is--virtual","ov-x--".concat(!1===e.computeScrollXVisible?"hidden":"visible"),"ov-y--".concat(!1===a?"hidden":"visible"),"sx-pos--".concat(o?"top":"bottom"),"sy-pos--".concat(i?"left":"right")],{"overflow-y":r,"overflow-x":t})},computeScrollbarXToTop:function(){return"top"===this.computeScrollbarXOpts.position},computeScrollbarYToLeft:function(){return"left"===this.computeScrollbarYOpts.position}}),methods:{dispatchEvent:function(e,t,r){this.$emit(e,(0,_ui.createEvent)(r,{$list:this},t))},emitCheckboxMode:function(e){this.$emit("update:checkRowKeys",e)},emitRadioMode:function(e){this.$emit("update:checkRowKey",e)},callSlot:function(e,t,r){var o=this.$scopedSlots;return e&&(_xeUtils.default.isString(e)&&(e=o[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e.call(this,t,r)):[]},getRowId:function(e){return getRowIdByField(e,this.computeKeyField)},updateRadioModeValue:function(){var e=this.reactData,t=this.internalData,r=this.checkRowKey,t=t.fullKeyMaps;r?(t=t[r],e.selectRadioRow=t||null):e.selectRadioRow=null},updateCheckboxModeValue:function(){var e=this.internalData,t=this.checkRowKeys,r=e.fullKeyMaps,o=this.computeKeyField,i={};if(t&&t.length){var a,n=_createForOfIteratorHelper(t);try{for(n.s();!(a=n.n()).done;){var l=r[a.value];l&&(i[getRowIdByField(l,o)]=l)}}catch(e){n.e(e)}finally{n.f()}}e.selectCheckboxMaps=i,this.updateCheckboxStatus()},updateAfterDataIndex:function(){var e=this.internalData,t=e.afterList,i=e.rowMaps,a=this.computeKeyField,n=0;t.forEach(function(e,t){var r=getRowIdByField(e,a),o=i[r];o?o._index=n:(o={item:e,index:t,$index:-1,_index:n},i[r]=o),n++})},cacheRowMap:function(){var e=this.internalData,t=e.fullData,r=this.computeKeyField,o={};t.forEach(function(e){var t=getRowKeyByField(e,r);o[t]=e}),e.fullKeyMaps=o},loadData:function(e){var t=this,r=t.reactData,o=t.internalData,i=o.scrollYStore,a=t.computeSYOpts,e=e?e.slice(0):[];return Object.assign(i,{startIndex:0,endIndex:1,visibleSize:0}),o.fullData=e,o.insertRowMaps={},r.insertRowFlag++,o.removeRowMaps={},r.removeRowFlag++,r.scrollYLoad=!!a.enabled&&-1<a.gt&&(0===a.gt||a.gt<=e.length),t.cacheRowMap(),t.handleData(!0),t.updateRadioModeValue(),t.updateCheckboxModeValue(),t.computeScrollLoad().then(function(){t.refreshScroll()})},reloadData:function(e){return this.clearScroll(),this.loadData(e)},getFullData:function(){return this.internalData.fullData},getParentElem:function(){var e=this.$refs.refElem;return e?e.parentElement:null},calcTableHeight:function(e){var t=this.reactData.parentHeight,e=this[e],r=0;return r=e?"100%"===e||"auto"===e?t:(r=(0,_dom.isScale)(e)?Math.floor((_xeUtils.default.toInteger(e)||1)/100*t):_xeUtils.default.toNumber(e),Math.max(40,r)):r},updateHeight:function(){var e=this,t=e.reactData,r=e.$refs.refHeaderElem,o=e.$refs.refFooterElem;t.headHeight=r?Math.floor(r.offsetHeight):0,t.footHeight=o?Math.floor(o.offsetHeight):0,t.customHeight=e.calcTableHeight("height"),t.customMaxHeight=e.calcTableHeight("maxHeight")},updateYSpace:function(){var e=this.reactData,t=this.internalData,r=e.scrollYLoad,o=t.scrollYStore;e.bodyHeight=r?t.fullData.length*o.rowHeight:0,e.topSpaceHeight=r?Math.max(o.startIndex*o.rowHeight,0):0},updateAfterFullData:function(){var e=this.internalData,t=e.fullData;e.afterList=t.slice(0),this.updateAfterDataIndex()},handleData:function(e){var t=this,r=t.reactData,o=t.internalData,i=r.scrollYLoad,a=o.fullData,n=o.scrollYStore,l=o.rowMaps,s=t.computeKeyField,o=(e&&t.updateAfterFullData(),i?a.slice(n.startIndex,n.endIndex):a.slice(0));return s&&o.forEach(function(e,t){e=getRowIdByField(e,s),e=l[e];e&&(e.$index=t)}),r.rowList=o,t.$nextTick()},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var n=this,l=n.reactData,s=n.internalData,c=n.browseObj;return n.$nextTick().then(function(){var e,t=l.scrollYLoad,r=s.scrollYStore,o=n.$refs.refVirtualBody,i=n.computeSYOpts,a=0;(e=o?(e=i.sItem?o.querySelector(i.sItem):e)||o.children[0]:e)&&(a=e.offsetHeight),a=Math.max(12,a),r.rowHeight=a,t?(o=n.$refs.refVirtualWrapper,e=Math.max(8,Math.ceil(o.clientHeight/a)),t=i.oSize?_xeUtils.default.toNumber(i.oSize):c.edge?10:0,r.offsetSize=t,r.visibleSize=e,r.endIndex=Math.max(r.startIndex+e+t,r.endIndex),n.updateYData()):n.updateYSpace()})},clearScroll:function(){var e=this.$refs.refVirtualWrapper;return e&&(e.scrollTop=0),this.$nextTick()},scrollTo:function(e,t){var r=this,o=r.reactData,i=r.$refs.refVirtualWrapper;return e&&!_xeUtils.default.isNumber(e)&&(t=e.top,e=e.left),_xeUtils.default.isNumber(e)&&(i.scrollLeft=e),_xeUtils.default.isNumber(t)&&(i.scrollTop=t),o.scrollYLoad?new Promise(function(e){setTimeout(function(){r.$nextTick(function(){e()})},50)}):r.$nextTick()},refreshScroll:function(){var e=this.internalData,t=e.lastScrollLeft,r=e.lastScrollTop;return this.clearScroll().then(function(){if(t||r)return e.lastScrollLeft=0,e.lastScrollTop=0,scrollTo(t,r)})},updateScrollbar:function(){this.updateThumbSize(),this.updateThumbOffset()},recalculate:function(){var e=this,t=e.reactData,r=e.$refs.refElem;if(r){var o,i=r.parentElement,a=0;if((i=i&&(0,_dom.hasClass)(i,"vxe-scrollbar--view-inner")?i.parentElement:i)&&(o=getComputedStyle(i),a=i.clientHeight-Math.ceil(_xeUtils.default.toNumber(o.paddingLeft)+_xeUtils.default.toNumber(o.paddingRight))),t.parentHeight=a,e.updateScrollbar(),e.updateHeight(),r.clientWidth&&r.clientHeight)return e.computeScrollLoad()}return e.$nextTick()},loadYData:function(e){var t=this.internalData.scrollYStore,r=t.startIndex,o=t.endIndex,i=t.visibleSize,a=t.offsetSize,e=e.target.scrollTop,e=Math.floor(e/t.rowHeight),n=Math.max(0,e-1-a),a=e+i+a;!(e<=r||o-i-1<=e)||r===n&&o===a||(t.startIndex=n,t.endIndex=a,this.updateYData())},scrollEvent:function(e){var t=this,r=t.reactData,o=t.internalData,i=e.target,a=i.scrollTop,i=i.scrollLeft,n=i!==o.lastScrollLeft,l=a!==o.lastScrollTop;t.updateThumbOffset(),o.lastScrollTop=a,o.lastScrollLeft=i,r.scrollYLoad&&t.loadYData(e),t.dispatchEvent("scroll",{scrollLeft:i,scrollTop:a,isX:n,isY:l},e)},getRowKey:function(e){return getRowKeyByField(e,this.computeKeyField)},eqRowKey:eqRowKey,eqRow:function(e,t){return!(!e||!t)&&(e===t||eqRowKey(this.getRowId(e),this.getRowId(t)))},eqRowByKey:function(e,t){return e&&eqRowKey(this.getRowKey(e),t)},findRow:function(e,t){var r=this;return t?_xeUtils.default.find(e,function(e){return r.eqRow(e,t)}):null},findRowByKey:function(e,t){var r=this.computeKeyField;return _xeUtils.default.find(e,function(e){return eqRowKey(getRowIdByField(e,r),t)})},findRowIndexOf:function(e,t){var r=this;return t?_xeUtils.default.findIndexOf(e,function(e){return r.eqRow(e,t)}):-1},findRowIndexOfByKey:function(e,t){var r=this.computeKeyField;return _xeUtils.default.findIndexOf(e,function(e){return eqRowKey(getRowIdByField(e,r),t)})},isCheckedByRadioRowKey:function(e){var t=this.reactData.selectRadioRow;return this.getRowKey(t)===e},isCheckedByRadioRow:function(e){return this.isCheckedByRadioRowKey(this.getRowKey(e))},isCheckedByCheckboxRowKey:function(e){var t=this.reactData,r=this.internalData,t=t.updateCheckboxFlag,r=r.selectCheckboxMaps;return!(!t||!r[e])},isCheckedByCheckboxRow:function(e){return this.isCheckedByCheckboxRowKey(this.getRowKey(e))},setCurrentRow:function(e){var t=this.reactData;return this.internalData.currentRow=e,t.currRowFlag++,this.$nextTick()},setCurrentRowByKey:function(e){var t=this.reactData,r=this.internalData,o=r.fullData;return r.currentRow=this.findRowByKey(o,e),t.currRowFlag++,this.$nextTick()},getCurrentRow:function(){return this.internalData.currentRow},getCurrentRowKey:function(){var e=this.internalData.currentRow;return e?this.getRowKey(e):null},clearCurrentRow:function(){var e=this.reactData;return this.internalData.currentRow=null,e.currRowFlag++,this.$nextTick()},setRadioRow:function(e){this.reactData.selectRadioRow=e;e=this.getRowKey(e);return this.emitRadioMode(e),this.$nextTick()},setRadioRowByKey:function(e){var t=this,r=t.reactData,o=t.internalData.fullData,r=(r.selectRadioRow=t.findRowByKey(o,e),e);return t.emitRadioMode(r),t.$nextTick()},getRadioRow:function(){return this.reactData.selectRadioRow},getRadioRowKey:function(){var e=this.reactData.selectRadioRow;return e?this.getRowKey(e):null},clearRadioRow:function(){return this.reactData.selectRadioRow=null,this.emitRadioMode(null),this.$nextTick()},setCheckboxRow:function(e,t){var r=this,o=r.internalData.selectCheckboxMaps,i=r.computeKeyField,e=((e?_xeUtils.default.isArray(e)?e:[e]:[]).forEach(t?function(e){var t=getRowIdByField(e,i);o[t]||(o[t]=e)}:function(e){e=getRowIdByField(e,i);o[e]&&delete o[e]}),r.getCheckboxRowKeys());return r.emitCheckboxMode(e),r.updateCheckboxStatus()},setCheckboxRowByKey:function(e,t){var r=this,o=r.internalData,i=o.selectCheckboxMaps,a=o.fullKeyMaps,n=r.computeKeyField,o=((e?_xeUtils.default.isArray(e)?e:[e]:[]).forEach(t?function(e){var t,e=a[e||""];e&&(t=getRowIdByField(e,n),e)&&!i[t]&&(i[t]=e)}:function(e){var e=a[e||""];e&&(e=getRowIdByField(e,n),i[e])&&delete i[e]}),r.getCheckboxRowKeys());return r.emitCheckboxMode(o),r.updateCheckboxStatus()},getCheckboxRecords:function(){var e=this.reactData,t=this.internalData,e=e.updateCheckboxFlag,t=t.selectCheckboxMaps,r=[];return e&&_xeUtils.default.each(t,function(e){e&&r.push(e)}),r},getCheckboxRows:function(){return this.getCheckboxRecords()},getCheckboxRowKeys:function(){var e=this.reactData,t=this.internalData,e=e.updateCheckboxFlag,t=t.selectCheckboxMaps,r=this.computeKeyField,o=[];return e&&_xeUtils.default.each(t,function(e){e&&(e=getRowKeyByField(e,r),o.push(e))}),o},clearCheckboxRow:function(){var e=this.reactData;this.internalData.selectCheckboxMaps={},e.updateCheckboxFlag++,e.isAllChecked=!1,e.isAllIndeterminate=!1;return this.emitCheckboxMode([]),this.$nextTick()},setAllCheckboxRow:function(e){var t=this,r=t.internalData,o=r.fullData,i=r.selectCheckboxMaps,a=t.computeKeyField;if(e){var n,l=[],s=_createForOfIteratorHelper(o);try{for(s.s();!(n=s.n()).done;){var c=n.value,u=getRowKeyByField(c,a);i[getRowIdByField(c,a)]=c,l.push(u)}}catch(e){s.e(e)}finally{s.f()}return t.emitCheckboxMode(l),t.updateCheckboxStatus()}return t.clearCheckboxRow()},updateCheckboxStatus:function(){var e=this,t=e.reactData,r=e.internalData,o=r.selectCheckboxMaps,r=r.fullData,i=e.computeKeyField,a=e.computeCheckboxOpts.checkMethod,n=!1,l=!1;if(a){var s,c=_createForOfIteratorHelper(r);try{for(c.s();!(s=c.n()).done;){var u=s.value;if(a({row:u,$list:e}))if(o[getRowIdByField(u,i)])n=!0;else if(l=!0,n)break}}catch(e){c.e(e)}finally{c.f()}}else{var h,d=_createForOfIteratorHelper(r);try{for(d.s();!(h=d.n()).done;)if(o[getRowIdByField(h.value,i)])n=!0;else if(l=!0,n)break}catch(e){d.e(e)}finally{d.f()}}return t.isAllChecked=n&&!l,t.isAllIndeterminate=n&&l,t.updateCheckboxFlag++,e.$nextTick()},changeCheckboxAllEvent:function(e){var t=!this.reactData.isAllChecked;t?this.setAllCheckboxRow(!0):this.clearCheckboxRow(),this.dispatchEvent("checkbox-all",{checked:t},e)},changeCheckboxEvent:function(e,t){var r=this,o=r.reactData,i=r.internalData,i=(e.preventDefault(),e.stopPropagation(),i.selectCheckboxMaps),a=r.computeCheckboxOpts.checkMethod,n=r.getRowKey(t);(!a||a({$list:r,row:t}))&&(a=!1,i[n]?delete i[n]:(a=!0,i[n]=t),o.updateCheckboxFlag++,r.updateCheckboxStatus(),n=_xeUtils.default.keys(i).map(_utils.deModelValue),r.emitCheckboxMode(n),r.dispatchEvent("checkbox-change",{row:t,value:n,checked:a},e))},changeCurrentEvent:function(e,t){var r=this.reactData,o=this.internalData;e.preventDefault();var i=this.computeRowOpts.currentMethod,a=!1;(a=i?!i({row:t}):a)||(o.currentRow=t,r.currRowFlag++,this.dispatchEvent("current-change",{row:t,checked:!0},e))},changeRadioEvent:function(e,t){var r,o=this,i=o.reactData,a=(e.preventDefault(),e.stopPropagation(),i.selectRadioRow),n=o.computeRadioOpts,l=n.strict,n=n.checkMethod,s=o.getRowKey(t);(!n||n({$list:o,row:t}))&&(n=s,r=!0,l&&a&&s===o.getRowKey(a)?(r=!1,i.selectRadioRow=null):i.selectRadioRow=t,o.emitRadioMode(n),o.dispatchEvent("radio-change",{row:t,value:n,checked:r},e))},handleRowDragEndClearStatus:function(){this.clearRowDragData(),this.clearCrossListDragStatus(),this.recalculate()},clearRowDropOrigin:function(){var t,e=this.$refs.refElem;e&&_xeUtils.default.arrayEach(e.querySelectorAll(".".concat(t="row--drag-origin")),function(e){(e.draggable=!1,_dom.removeClass)(e,t)})},updateRowDropOrigin:function(e){var t=this.computeSYOpts.sItem,r=this.$refs.refElem;r&&(e=this.getRowId(e),_xeUtils.default.arrayEach(r.querySelectorAll('.vxe-list--row[rowid="'.concat(e,'"]')+(t?"".concat(t,'[rowid="').concat(e,'"]'):"")),function(e){(0,_dom.addClass)(e,"row--drag-origin")}))},updateRowDropTipContent:function(e){var t=this.reactData,r=t.dragRow,o=this.computeDragOpts.tooltipMethod,i="";i=o?"".concat(o({$list:this,row:r})||""):getI18n("vxe.list.dragTip",[e.textContent||""]),t.dragTipText=i},hideDropTip:function(){var e=this.$refs.refDragTipElem,t=this.$refs.refDragRowLineElem;e&&(e.style.display=""),t&&(t.style.display="")},clearCrossListDragStatus:function(){var e=(0,_store.getCrossListDragRowInfo)(this);crossListDragRowObj=null,e.row=null},clearDragStatus:function(){var e=this.reactData;e.dragRow&&(this.hideDropTip(),this.clearRowDropOrigin(),this.clearCrossListDragStatus(),e.dragRow=null)},handleRowDragMousedownEvent:function(e,t){var r=this,o=r.reactData,i=(0,_store.getCrossListDragRowInfo)(r),a=(e.stopPropagation(),t.row),n=r.computeDragOpts,l=n.isCrossListDrag,s=n.dragStartMethod,c=e.currentTarget,n="row"===n.trigger?c:c.parentElement.parentElement;r.clearRowDropOrigin(),s&&!s(t)?(n.draggable=!1,o.dragRow=null,r.hideDropTip()):(l&&(i.row=a,crossListDragRowObj={$oldList:r,$newList:null}),c={row:a},o.dragRow=a,n.draggable=!0,r.updateRowDropOrigin(a),r.updateRowDropTipContent(n),r.dispatchEvent("row-dragstart",c,e))},handleRowDragMouseupEvent:function(){this.clearDragStatus()},showDropTip:function(e,t,r,o){var i,a,n,l,s=this.$refs.refElem;s&&(i=s.getBoundingClientRect(),l=s.clientHeight,t&&(a=this.$refs.refDragRowLineElem)&&(r?(n=t.getBoundingClientRect(),t=t.clientHeight,l<(n=Math.max(1,n.y-i.y))+t&&(t=l-n),a.style.display="block",a.style.top="".concat(n,"px"),a.style.height="".concat(t,"px"),a.setAttribute("drag-pos",o)):a.style.display=""),l=this.$refs.refDragTipElem)&&(l.style.display="block",l.style.top="".concat(Math.min(s.clientHeight-s.scrollTop-l.clientHeight,e.clientY-i.y),"px"),l.style.left="".concat(Math.min(s.clientWidth-s.scrollLeft-l.clientWidth-1,e.clientX-i.x),"px"),l.setAttribute("drag-status",r?"normal":"disabled"))},clearRowDragData:function(){var e=this.reactData,t=this.$refs.refElem;this.hideDropTip(),this.clearRowDropOrigin(),(0,_anime.clearRowAnimate)(t,[".vxe-list--row"]),e.dragRow=null},handleRowDragSwapEvent:function(t,r,o,i){var e,u,h,d,f,a,n,l,s,g=this,p=g.reactData,w=g.internalData,c=w.fullData,m=g.computeDragOpts,v=m.animation,m=m.dragEndMethod||(m?m.dragEndMethod:null),b="bottom"===i?1:0,R=g.$refs.refElem,D={status:!1};if(R&&o&&r){if(o!==r)return e={oldRow:r,newRow:o,dragRow:r,dragPos:i,offsetIndex:b},u=g.getRowId(r),h=g.findRowIndexOfByKey(c,u),n=g.getRowKey(o),d=0,f=-1,v&&(n=R.querySelector('.vxe-list--row[rowid="'.concat(n,'"]')),a=R.querySelector('.vxe-list--row[rowid="'.concat(u,'"]')),(n=n||a)&&(d=n.offsetHeight),a)&&(f=a.offsetTop),s=l=-1,Promise.resolve(!m||m(e)).then(function(e){if(!e)return D;l=g.findRowIndexOf(c,r),c.splice(l,1);e=g.findRowIndexOf(c,o);return s=e+b,c.splice(s,0,r),g.handleData(),p.scrollYLoad&&g.updateYSpace(),t&&g.dispatchEvent("row-dragend",{oldRow:r,newRow:o,dragRow:r,dragPos:i,offsetIndex:b,_index:{newIndex:s,oldIndex:l}},t),g.$nextTick().then(function(){var e,t,r,o,i,a,n,l,s,c;v&&(n=p.rowList,c=w.fullData,s=g.findRowIndexOfByKey(c,u),l=c[0],l=g.findRowIndexOf(c,l),e=R,-1<l&&(i=l+c.length,r=t=-1,o=1,h<l?(t=0,r=s-l):i<h?(t=g.findRowIndexOfByKey(n,u)+1,r=c.length,o=-1):h<s?r=(t=h-l)+s-h:(r=(t=s-l)+h-s+1,o=-1),(i=c.slice(t,r)).length)&&(a=[],i.forEach(function(e){e=g.getRowId(e);a.push('.vxe-list--row[rowid="'.concat(e,'"]'))}),n=e.querySelectorAll(a.join(",")),(0,_anime.moveRowAnimateToTb)(n,o*d)),l=['.vxe-list--row[rowid="'.concat(u,'"]')],c=(s=e.querySelectorAll(l.join(",")))[0],-1<f)&&c&&(0,_anime.moveRowAnimateToTb)(s,f-c.offsetTop),g.recalculate()}).then(function(){return{status:!0}})}).catch(function(){return D}).then(function(e){return g.clearRowDragData(),g.clearCrossListDragStatus(),e});g.clearRowDragData(),g.clearCrossListDragStatus()}return Promise.resolve(D)},handleRowDragDragstartEvent:function(e){e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0)},handleRowDragDragendEvent:function(e){var t=this,r=t.reactData,o=t.internalData,r=r.dragRow,i=o.prevDragRow,o=o.prevDragPos;if(t.computeDragOpts.isCrossListDrag&&crossListDragRowObj){var a=crossListDragRowObj.$newList;if(a&&a.xID!==t.xID)return void a.handleCrossListRowDragInsertEvent(e)}t.handleRowDragSwapEvent(e,r,i,o)},handleRowDragDragoverEvent:function(e){var t,r=this,o=r.reactData,i=r.internalData,o=o.dragRow,a=i.fullData,n=(o||e.preventDefault(),e.currentTarget),l=n.getAttribute("rowid")||"",a=r.findRowByKey(a,l);a&&(e.preventDefault(),t=e.clientY-n.getBoundingClientRect().y<n.clientHeight/2?"top":"bottom",i.prevDragRow=a,i.prevDragPos=t,o&&r.getRowId(o)===l?r.showDropTip(e,n,!1,t):(i={oldRow:o,targetRow:a,dragPos:t,dragRow:o,offsetIndex:"bottom"==t?1:0},r.showDropTip(e,n,!0,t),r.dispatchEvent("row-dragover",i,e)))},handleRowMousedownEvent:function(e,t){var r=this.computeDragOpts,o=this.computeIsDrag,i=r.trigger,r=r.disabledMethod,a=!1,t={row:t,$list:this};!(a=o?"row"===i:a)||r&&r(t)||this.handleRowDragMousedownEvent(e,t)},handleRowClickEvent:function(e,t){var r=this,o=r.reactData,i=r.internalData,a=r.showRadio,n=r.showCheckbox,l=i.currentRow,s=r.computeRadioOpts,c=r.computeCheckboxOpts,u=!1,h=!1,d=!1;r.computeRowOpts.isCurrent?(u=!0,r.changeCurrentEvent(e,t)):l&&(i.currentRow=null,o.currRowFlag++),a&&"row"===s.trigger&&(h=!0,r.changeRadioEvent(e,t)),n&&"row"===c.trigger&&(d=!0,r.changeCheckboxEvent(e,t)),r.dispatchEvent("row-click",{row:t,triggerCurrent:u,triggerRadio:h,triggerCheckbox:d},e)},handleRowDblclickEvent:function(e,t){this.dispatchEvent("row-dblclick",{row:t},e)},insertListRow:function(e,t){var r=this.internalData,o=r.fullData,i=r.rowMaps,a=this.computeKeyField,n=t?"push":"unshift";e.forEach(function(e){var t=getRowIdByField(e,a),r=(0,_util.getItemCacheObj)(e);o[n](e),i[t]=r})},handleInsertRowAt:function(e,t,r){var o=this,i=o.reactData,a=o.internalData,n=a.fullData,l=a.rowMaps,s=a.removeRowMaps,c=a.insertRowMaps,u=o.computeKeyField;if(!u)return errLog("vxe.error.reqSupportProp",["insert() | insertAt() | insertNextAt()","row-config.keyField"]),Promise.resolve({row:null,rows:[]});_xeUtils.default.isArray(e)||(e=[e]);var h,d=t;return(_xeUtils.default.isString(t)||_xeUtils.default.isNumber(t))&&(a=l[t])&&(d=a.item),e.length?(h=e.map(function(e){return _xeUtils.default.assign({},e)}),_xeUtils.default.eqNull(d)?o.insertListRow(h,!1):-1===d?o.insertListRow(h,!0):-1<(t=n.findIndex(function(e){return d[u]===e[u]}))?(h.forEach(function(e){var t=getRowIdByField(e,u),e=(0,_util.getItemCacheObj)(e);l[t]=e}),a=t,r&&(a+=1),n.splice.apply(n,[a,0].concat(_toConsumableArray(h)))):(warnLog("vxe.error.unableInsert"),o.insertListRow(h,!0)),h.forEach(function(e){var t=getRowIdByField(e,u);s[t]?(delete s[t],c[t]&&delete c[t]):c[t]=e}),i.removeRowFlag++,i.insertRowFlag++,o.cacheRowMap(),o.handleData(!0),o.updateAfterDataIndex(),o.updateCheckboxStatus(),i.scrollYLoad&&o.updateYSpace(),o.$nextTick().then(function(){return{row:h.length?h[h.length-1]:null,rows:h}})):Promise.resolve({row:null,rows:[]})},insert:function(e){return this.handleInsertRowAt(e,null)},insertAt:function(e,t){return this.handleInsertRowAt(e,t)},insertNextAt:function(e,t){return this.handleInsertRowAt(e,t,!0)},getInsertRecords:function(){var e=this.internalData.insertRowMaps,t=[];return _xeUtils.default.each(e,function(e){t.push(e)}),t},isInsertByRow:function(e){var t=this.reactData,r=this.internalData,e=this.getRowId(e);return!!t.insertRowFlag&&!!r.insertRowMaps[e]},remove:function(e){var r,o=this,t=o.reactData,i=o.internalData,a=i.fullData,n=i.insertRowMaps,l=i.removeRowMaps;return o.computeKeyField?(r=[],e?_xeUtils.default.isArray(e)||(e=[e]):e=a,e.length?(e.forEach(function(e){var t;o.isInsertByRow(e)||(t=o.getRowId(e),l[t]=e)}),a===e?(e=r=a.slice(0),i.fullData=[]):e.forEach(function(e){var t=o.getRowId(e),e=_xeUtils.default.findIndexOf(a,function(e){return t===o.getRowId(e)});-1<e&&(e=a.splice(e,1),r.push(e[0]))}),e.forEach(function(e){e=o.getRowId(e);n[e]&&delete n[e]}),t.removeRowFlag++,t.insertRowFlag++,o.cacheRowMap(),o.handleData(!0),o.updateAfterDataIndex(),o.updateCheckboxStatus(),t.scrollYLoad&&o.updateYSpace(),o.$nextTick().then(function(){return o.recalculate()}).then(function(){return{row:r.length?r[r.length-1]:null,rows:r}})):Promise.resolve({row:null,rows:[]})):(errLog("vxe.error.reqSupportProp",["insert() | insertAt() | insertNextAt()","row-config.keyField"]),Promise.resolve({row:null,rows:[]}))},getRemoveRecords:function(){var e=this.internalData.removeRowMaps,t=[];return _xeUtils.default.each(e,function(e){t.push(e)}),t},isRemoveByRow:function(e){var t=this.reactData,r=this.internalData,e=this.getRowId(e);return!!t.removeRowFlag&&!!r.removeRowMaps[e]},getRecordset:function(){return{insertRecords:this.getInsertRecords(),removeRecords:this.getRemoveRecords()}},handleCrossListRowDragCancelEvent:function(){this.clearRowDragData(),this.clearCrossListDragStatus()},handleCrossListRowDragFinishEvent:function(e){var r,t,o,i=this,a=i.reactData,n=i.internalData,l=(0,_store.getCrossListDragRowInfo)(i),a=a.rowList,n=n.rowMaps,s=i.computeDragOpts,c=s.animation,u=i.$refs.refElem;u&&s.isCrossListDrag&&crossListDragRowObj&&l&&(s=l.row)&&(n=n[l=i.getRowId(s)],r=0,t=-1,n&&(c&&(l=u.querySelector('.vxe-list--row[rowid="'.concat(l,'"]')))&&(r=l.offsetHeight),t=n.$index),o=-1<t&&t<a.length-1?a.slice(t+1):[],i.remove([s]).then(function(){var t,e;c&&r&&o.length&&(e=u,t=[],o.forEach(function(e){e=i.getRowId(e);t.push('.vxe-list--row[rowid="'.concat(e,'"]'))}),e=e.querySelectorAll(t.join(",")),(0,_anime.moveRowAnimateToTb)(e,r))}),i.dispatchEvent("row-remove-dragend",{row:s},e),i.handleRowDragEndClearStatus())},handleCrossListRowDragoverEmptyEvent:function(e){var t,r,o=this,i=o.reactData,a=o.internalData,n=i.rowList;o.computeDragOpts.isCrossListDrag&&crossListDragRowObj&&!n.length&&(t=(n=crossListDragRowObj).$oldList,n=n.$newList,t)&&(r=t).xID!==o.xID&&(n&&n.xID!==o.xID&&n.hideCrossListRowDropClearStatus(),e.preventDefault(),t.hideCrossListRowDropClearStatus(),crossListDragRowObj.$newList=o,a.prevDragRow=null,i.dragTipText=r.dragTipText,o.showDropTip(e,e.currentTarget,!0,""))},handleCrossListRowDragInsertEvent:function(r){var o,i,n,l,a,s,c=this,u=c.reactData,h=c.internalData,e=(0,_store.getCrossListDragRowInfo)(c),d=h.prevDragRow,f=h.prevDragPos,t=c.computeDragOpts,g=t.animation,p=t.dragEndMethod;t.isCrossListDrag&&crossListDragRowObj&&e&&(o=e.row,i=crossListDragRowObj.$oldList,n=c.$refs.refElem)&&i&&o&&(a=-1,t={oldRow:l=o,newRow:d,dragRow:l,dragPos:f,offsetIndex:a=d?"bottom"===f?1:0:a},s={status:!1},Promise.resolve(!p||p(t)).then(function(e){if(!e)return i&&i.xID!==c.xID&&i.handleCrossListRowDragCancelEvent(r),c.handleRowDragEndClearStatus(),s;var e=Promise.resolve(),t=[l];i.handleCrossListRowDragFinishEvent(r),e=d?"bottom"===f?c.insertNextAt(t,d):c.insertAt(t,d):c.insert(t),c.dispatchEvent("row-insert-dragend",{oldRow:o,newRow:d,dragRow:l,dragPos:f,offsetIndex:a},r),c.clearRowDragData(),e.then(function(){var t,e=u.rowList,r=h.rowMaps,o=c.getRowId(l),r=r[o],i=0,a=-1,o=(r&&(g&&(o=n.querySelector('.vxe-list--row[rowid="'.concat(o,'"]')))&&(i=o.offsetHeight),a=r.$index),-1<a?e.slice(a):[]);g&&i&&o.length&&(r=n,t=[],o.forEach(function(e){e=c.getRowId(e);t.push('.vxe-list--row[rowid="'.concat(e,'"]'))}),e=r.querySelectorAll(t.join(",")),(0,_anime.moveRowAnimateToTb)(e,-i))})}))},hideCrossListRowDropClearStatus:function(){this.hideDropTip()},handleContextmenuEvent:function(o,i){var a=this,e=a.reactData,t=a.internalData,r=a.menuConfig,n=a.computeMenuOpts,l=a.computeRowOpts.isCurrent;(r?(0,_utils.isEnableConf)(n):n.enabled)&&(r=n.options,(n=n.visibleMethod)&&!n({$list:a,options:r,row:i})||(l?a.changeCurrentEvent(o,i):t.currentRow&&(t.currentRow=null,e.currRowFlag++),_ui.VxeUI.contextMenu&&_ui.VxeUI.contextMenu.openByEvent(o,{options:r,events:{optionClick:function(e){var t=e.option,r=menus.get(t.code),r=r?r.listMenuMethod:null,t={menu:t,row:i,$event:o,$list:a};r&&r(t,o),a.dispatchEvent("menu-click",t,e.$event)}}}))),a.dispatchEvent("row-menu",{row:i},o)},updateThumbSize:function(){var e,t,r=this,o=r.reactData,i=r.$refs.refVirtualWrapper;i&&i.clientHeight&&(t=(t=r.$refs.refTrackXElem)?getThumbSize(i.clientWidth,i.scrollWidth,t.clientWidth):0,(e=r.$refs.refThumbXElem)&&(e.style.width=t+"px"),o.xThumbWidth=t,t=(e=r.$refs.refTrackYElem)?getThumbSize(i.clientHeight,i.scrollHeight,e.clientHeight):0,(i=r.$refs.refThumbYElem)&&(i.style.height=t+"px"),o.yThumbHeight=t)},updateThumbOffset:function(){var e,t,r,o=this,i=o.reactData,a=o.internalData,n=o.$refs.refVirtualWrapper;n&&n.clientHeight&&(e=i.xThumbWidth,i=i.yThumbHeight,r=o.$refs.refTrackXElem,t=o.$refs.refThumbXElem,r=r&&e?getThumbOffsetSize(n.scrollLeft,n.clientWidth,n.scrollWidth,r.clientWidth,e):0,a.xThumbLeft=r,t&&e&&(t.style.width=e+"px",t.style.transform="translateX(".concat(r,"px)")),e=o.$refs.refTrackYElem,t=o.$refs.refThumbYElem,r=e&&i?getThumbOffsetSize(n.scrollTop,n.clientHeight,n.scrollHeight,e.clientHeight,i):0,a.yThumbTop=r,t)&&i&&(t.style.height=i+"px",t.style.transform="translateY(".concat(r,"px)"))},clickTrackXEvent:function(e){var t,r,o=this.reactData,i=e.currentTarget;i===e.target&&(t=this.$refs.refVirtualWrapper)&&(o=o.xThumbWidth,r=i.getBoundingClientRect(),t.scrollTo({left:getScrollFromClick(e.clientX-r.left,t.clientWidth,t.scrollWidth,i.clientWidth,o),behavior:"auto"}))},clickTrackYEvent:function(e){var t,r,o=this.reactData,i=e.currentTarget;i===e.target&&(t=this.$refs.refVirtualWrapper)&&(o=o.yThumbHeight,r=i.getBoundingClientRect(),t.scrollTo({top:getScrollFromClick(e.clientY-r.top,t.clientHeight,t.scrollHeight,i.clientHeight,o),behavior:"auto"}))},pointerdownThumbXEvent:function(e){var t,r=this.reactData,o=this.internalData,i=e.currentTarget,a=(o.isThumbDrag=!0,i.setPointerCapture(e.pointerId),this.$refs.refVirtualWrapper);a&&(r=r.xThumbWidth,t=(i=i.parentElement).getBoundingClientRect(),e=e.clientX-t.left,t=getThumbOffsetSize(a.scrollLeft,a.clientWidth,a.scrollWidth,i.clientWidth,r),o.thumbDragOffset=e-t)},pointermoveThumbXEvent:function(e){var t,r,o,i=this.reactData,a=this.internalData;e.currentTarget.hasPointerCapture(e.pointerId)&&(t=a.isThumbDrag,a=a.thumbDragOffset,t)&&(t=this.$refs.refVirtualWrapper)&&(i=i.xThumbWidth,o=(r=e.currentTarget.parentElement).getBoundingClientRect(),t.scrollLeft=getScrollFromDrag(e.clientX-o.left,a,t.clientWidth,t.scrollWidth,r.clientWidth,i))},cleatPointerThumbEvent:function(e){var t=this.internalData;e.currentTarget.releasePointerCapture(e.pointerId),t.isThumbDrag=!1},pointerdownThumbYEvent:function(e){var t,r=this.reactData,o=this.internalData,i=e.currentTarget,a=(o.isThumbDrag=!0,i.setPointerCapture(e.pointerId),this.$refs.refVirtualWrapper);a&&(r=r.yThumbHeight,t=(i=i.parentElement).getBoundingClientRect(),e=e.clientY-t.top,t=getThumbOffsetSize(a.scrollTop,a.clientHeight,a.scrollHeight,i.clientHeight,r),o.thumbDragOffset=e-t)},pointermoveThumbYEvent:function(e){var t,r,o,i=this.reactData,a=this.internalData;e.currentTarget.hasPointerCapture(e.pointerId)&&(t=a.isThumbDrag,a=a.thumbDragOffset,t)&&(t=this.$refs.refVirtualWrapper)&&(i=i.yThumbHeight,o=(r=e.currentTarget.parentElement).getBoundingClientRect(),t.scrollTop=getScrollFromDrag(e.clientY-o.top,a,t.clientHeight,t.scrollHeight,r.clientHeight,i))},renderDragTip:function(e){var t=this,r=t.reactData,o=r.dragRow,r=r.dragTipText,i=t.computeDragOpts;return t.computeIsDrag?e("div",{class:"vxe-list--drag-wrapper"},[e("div",{ref:"refDragRowLineElem",class:["vxe-list--drag-row-line",{"is--guides":i.showGuidesStatus}]}),o&&i.showDragTip?e("div",{ref:"refDragTipElem",class:"vxe-list--drag-sort-tip"},[e("div",{class:"vxe-list--drag-sort-tip-wrapper"},[e("div",{class:"vxe-list--drag-sort-tip-status"},[e("span",{class:["vxe-list--drag-sort-tip-normal-status",getIcon().LIST_DRAG_STATUS_NODE]}),e("span",{class:["vxe-list--drag-sort-tip-disabled-status",getIcon().LIST_DRAG_DISABLED]})]),e("div",{class:"vxe-list--drag-sort-tip-content"},r)])]):(0,_ui.renderEmptyElement)(t)]):(0,_ui.renderEmptyElement)(t)},renderRadio:function(e,t,r,o,i){var a=this,n=a.showRadio,l=a.computeRadioOpts,s=l.showIcon,l=l.visibleMethod,l=!l||l({$list:a,row:t});return n&&s&&l?e("div",{key:"ct2",class:["vxe-list--radio-option",{"is--checked":i,"is--disabled":o}],on:{click:function(e){o||a.changeRadioEvent(e,t)}}},[e("span",{class:["vxe-radio--icon",i?getIcon().RADIO_CHECKED:o?getIcon().RADIO_DISABLED_UNCHECKED:getIcon().RADIO_UNCHECKED]})]):(0,_ui.renderEmptyElement)(a)},renderCheckbox:function(e,t,r,o,i){var a=this,n=a.showCheckbox,l=a.computeCheckboxOpts,s=l.showIcon,l=l.visibleMethod,l=!l||l({$list:a,row:t});return n&&s&&l?e("div",{key:"ct3",class:["vxe-list--checkbox-option",{"is--checked":i,"is--disabled":o}],on:{click:function(e){o||a.changeCheckboxEvent(e,t)}}},[e("span",{class:["vxe-checkbox--icon",i?getIcon().CHECKBOX_CHECKED:o?getIcon().CHECKBOX_DISABLED_UNCHECKED:getIcon().CHECKBOX_UNCHECKED]})]):(0,_ui.renderEmptyElement)(a)},renderRow:function(e,t,r){var o=this,i=o.reactData,a=o.internalData,n=o.$scopedSlots,l=o.showRadio,s=o.showCheckbox,c=i.selectRadioRow,u=i.currRowFlag,i=i.updateCheckboxFlag,h=a.selectCheckboxMaps,a=a.currentRow,d=n.content,n=n.extra,f=o.computeDragOpts,g=f.trigger,p=f.icon,w=f.disabledMethod,f=f.visibleMethod,m=o.computeRadioOpts,v=o.computeCheckboxOpts,b=o.computeRowOpts,R=b.useKey,D=b.contentField,x=b.className,b=b.isCurrent,y=o.computeIsDrag,C=o.computeKeyField,S=x&&_xeUtils.default.isFunction(x),R=C||R||y||b||l||s,b=R&&C?getRowIdByField(t,C):"",E=(0,_utils.enModelValue)(b),k={row:t,$list:o},T=!1,_=!1,c=(l&&(T=c&&(t===c||o.eqRowByKey(c,b)),_=!!m.checkMethod&&!m.checkMethod({$list:o,row:t})),!1),m=!1,i=(s&&(c=!(!i||!h[E]),m=!!v.checkMethod&&!v.checkMethod({$list:o,row:t})),[]),I=(l&&i.push(o.renderRadio(e,t,E,_,T)),s&&i.push(o.renderCheckbox(e,t,E,m,c)),!1),v=(y&&C&&(!f||f(k))&&(h={},"row"!==g&&(I=!(!w||!w(k)),h.mousedown=function(e){I||o.handleRowDragMousedownEvent(e,k)},h.mouseup=o.handleRowDragMouseupEvent),i.push(e("div",{key:"ct1",class:"vxe-list--row-drag"},[e("span",{class:"vxe-list--drag-handle",on:h},[e("i",{class:p||getIcon().LIST_DRAG})])]))),i.push(e("div",{key:"ct5",class:"vxe-list--row-content"},d?d(k):D?(0,_utils.getText)(t[D]):"")),n&&i.push(e("div",{key:"ct7",class:"vxe-list--row-extra"},n(k))),{mousedown:function(e){o.handleRowMousedownEvent(e,t)},mouseup:o.handleRowDragMouseupEvent,click:function(e){o.handleRowClickEvent(e,t)},dblclick:function(e){o.handleRowDblclickEvent(e,t)},contextmenu:function(e){o.handleContextmenuEvent(e,t)}});return y&&(v.dragstart=o.handleRowDragDragstartEvent,v.dragend=o.handleRowDragDragendEvent,v.dragover=o.handleRowDragDragoverEvent),e("div",{key:R&&C?E:r,class:["vxe-list--row",S?x(k):x||"",{"is--drag-disabled":I,"is--current":u&&a&&o.eqRowByKey(a,b),"is-radio--disabled":_,"is-radio--checked":T,"is-checkbox--disabled":m,"is-checkbox--checked":c}],attrs:R&&C?{rowid:E}:void 0,on:v},i)},renderVN:function(r){var o=this,e=o.reactData,t=o.$scopedSlots,i=o.showCheckbox,a=o.className,n=o.loading,l=o.useScrollbar,s=e.bodyHeight,c=e.topSpaceHeight,u=e.rowList,h=e.isAllChecked,d=e.isAllIndeterminate,f=e.xThumbWidth,e=e.yThumbHeight,g=t.default,p=t.header,t=t.footer,w=o.computeSize,m=o.computeWrapperStyles,v=o.computeVirtualStyles,b=o.computeRadioOpts,R=o.computeCheckboxOpts,D=o.computeDragOpts,x=D.trigger,y=o.computeRowOpts,C=y.isHover,y=y.padding,S=o.computeIsDrag,E=o.computeScrollbarOpts,k=o.computeScrollXVisible,T=o.computeScrollYVisible,_=o.computeScrollbarXToTop,I=o.computeScrollbarYToLeft,O=o.computeScrollXAutoHide,L=o.computeScrollYAutoHide,M=o.computeScrollbarWrapperClss,i=i&&!1!==R.showHeader,F={};return D.isCrossListDrag&&!u.length&&(F.dragover=o.handleCrossListRowDragoverEmptyEvent),r("div",{ref:"refElem",class:["vxe-list",l?"ov-x--".concat(!1===k?"hidden":"visible"):"",l?"ov-y--".concat(!1===T?"hidden":"visible"):"",l?"sx-pos--".concat(_?"top":"bottom"):"",l?"sy-pos--".concat(I?"left":"right"):"",a?_xeUtils.default.isFunction(a)?a({$list:o}):a:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(w),w),"is--virtual-scrollbar",l),"ov-padding",l&&E.padding),"ov-x--auto-hide",l&&O),"ov-y--auto-hide",l&&L),"overflow-y",e),"overflow-x",f),"is--drag",S),"is--loading",n)],on:F,style:m},[p||i?r("div",{ref:"refHeaderElem",class:"vxe-list--header-wrapper"},[i?r("div",{class:"vxe-list--header-left"},[r("div",{class:["vxe-list--checkbox-header",{"is--checked":h,"is--indeterminate":d}],on:{click:o.changeCheckboxAllEvent}},[r("span",{class:["vxe-checkbox--icon",h?getIcon().CHECKBOX_CHECKED:d?getIcon().CHECKBOX_INDETERMINATE:getIcon().CHECKBOX_UNCHECKED]})])]):(0,_ui.renderEmptyElement)(o),p?r("div",{class:"vxe-list--header-content"},p({items:u,$list:o})):(0,_ui.renderEmptyElement)(o)]):(0,_ui.renderEmptyElement)(o),r("div",{ref:"refVirtualWrapper",class:"vxe-list--virtual-wrapper",style:v,on:{scroll:o.scrollEvent}},[r("div",{class:"vxe-list--y-space",style:{height:s?"".concat(s,"px"):""}}),r("div",{ref:"refVirtualBody",class:["vxe-list--body",{"trigger--row":"row"===x,"checkbox--highlight":R.highlight,"radio--highlight":b.highlight,"row--hover":C,"is--padding":y}],style:{marginTop:c?"".concat(c,"px"):""}},g?g({items:u,$list:o}):u.map(function(e,t){return o.renderRow(r,e,t)}))]),t?r("div",{ref:"refFooterElem",class:"vxe-list--footer-wrapper"},t({items:u,$list:o})):(0,_ui.renderEmptyElement)(o),l?r("div",{class:M},[!1===k?(0,_ui.renderEmptyElement)(o):r("div",{ref:"refTrackXElem",class:"vxe-scrollbar--track-x",on:{click:o.clickTrackXEvent}},[r("div",{ref:"refThumbXElem",class:"vxe-scrollbar--thumb-x",on:{pointerdown:o.pointerdownThumbXEvent,pointermove:o.pointermoveThumbXEvent,pointerup:o.cleatPointerThumbEvent,pointercancel:o.cleatPointerThumbEvent,lostpointercapture:o.cleatPointerThumbEvent}})]),!1===T?(0,_ui.renderEmptyElement)(o):r("div",{ref:"refTrackYElem",class:"vxe-scrollbar--track-y",on:{click:o.clickTrackYEvent}},[r("div",{ref:"refThumbYElem",class:"vxe-scrollbar--thumb-y",on:{pointerdown:o.pointerdownThumbYEvent,pointermove:o.pointermoveThumbYEvent,pointerup:o.cleatPointerThumbEvent,pointercancel:o.cleatPointerThumbEvent,lostpointercapture:o.cleatPointerThumbEvent}})])]):(0,_ui.renderEmptyElement)(o),o.renderDragTip(r),r(_loading.default,{class:"vxe-list--loading",props:{value:n}})])}},watch:{data:function(){this.loadData(this.data||[])},height:function(){this.reFlag++},maxHeight:function(){this.reFlag++},syncResize:function(){this.reFlag++},useScrollbar:function(){this.reFlag++},computeRowHeight:function(){this.reFlag++},computeScrollYWidth:function(){this.reFlag++},computeScrollXHeight:function(){this.reFlag++},computeScrollXVisible:function(){var e=this;e.$nextTick(function(){e.reFlag++})},computeScrollYVisible:function(){var e=this;e.$nextTick(function(){e.reFlag++})},reFlag:function(){var e=this;e.recalculate().then(function(){e.recalculate()})},checkRowKey:function(){this.updateRadioModeValue()},checkRowKeys:function(){this.updateCheckboxModeValue()}},created:function(){this.internalData=createInternalData(),this.browseObj=_xeUtils.default.browse(),this.loadData(this.data||[])},mounted:function(){var e=this,t=e,r=e.internalData,o=t.showSeq,i=t.showRadio,a=t.showCheckbox,n=t.autoResize,l=t.useScrollbar,s=e.computeRowOpts,c=s.useKey,s=s.keyField,u=e.computeIsDrag,o=(s||(o&&errLog("vxe.error.reqSupportProp",["show-seq","row-config.keyField"]),i&&errLog("vxe.error.reqSupportProp",["show-radio","row-config.keyField"]),a&&errLog("vxe.error.reqSupportProp",["show-checkbox","row-config.keyField"]),u&&errLog("vxe.error.reqSupportProp",["drag-config","row-config.keyField"])),c&&!s&&errLog("vxe.error.reqSupportProp",["row-config.useKey","row-config.keyField"]),e.$refs.refElem);l&&(i=e.$refs.refVirtualBody,a=globalResize.create(function(){e.reFlag++}),o&&a.observe(o),i&&a.observe(i),r.scrollObserver=a),n&&(u=e.getParentElem(),c=globalResize.create(function(){t.autoResize&&e.reFlag++}),o&&c.observe(o),u&&c.observe(u),r.resizeObserver=c),e.reFlag++,globalEvents.on(e,"resize",function(){e.reFlag++})},activated:function(){var e=this;e.recalculate().then(function(){e.refreshScroll()})},beforeDestroy:function(){var e=this.reactData,t=this.internalData,r=t.scrollObserver,o=t.resizeObserver;o&&o.disconnect(),r&&r.disconnect(),globalEvents.off(this,"resize"),_xeUtils.default.assign(e,createReactData()),_xeUtils.default.assign(t,createInternalData())},render:function(e){return this.renderVN(e)}});
|
package/lib/menu/src/menu.js
CHANGED
|
@@ -91,7 +91,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
91
91
|
useScrollbar: {
|
|
92
92
|
type: Boolean,
|
|
93
93
|
default: function _default() {
|
|
94
|
-
return getConfig().menu.useScrollbar;
|
|
94
|
+
return (0, _utils.getDefaultConfig)(getConfig().menu.useScrollbar, getConfig().useScrollbar);
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
scrollbarConfig: Object,
|
package/lib/menu/src/menu.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_loading=_interopRequireDefault(require("../../loading")),_scrollbar=_interopRequireDefault(require("../../scrollbar"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}var _createComponentLog=(0,_log.createComponentLog)("menu"),errLog=_createComponentLog.errLog,menus=_ui.VxeUI.menus,getConfig=_ui.VxeUI.getConfig,getIcon=_ui.VxeUI.getIcon;function createInternalData(){return{lastActiveTime:0,menuInitMaps:{},menuCacheMaps:{},menuKeyMaps:{},menuEffectMaps:{}}}function createReactData(){return{initialized:!1,isEnterCollapse:!1,collapseStyle:{},collapseZindex:0,activeName:"",menuList:[],itemHeight:1}}var nemuUniqueKey=1e8,_default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeMenu",mixins:[_ui.globalMixins.sizeMixin,_ui.globalMixins.permissionMixin],props:{value:[String,Number],expandAll:Boolean,expandKeys:Array,accordion:{type:Boolean,default:function(){return getConfig().menu.accordion}},border:{type:[Boolean,String],default:function(){return getConfig().menu.border}},optionProps:{type:Object,default:function(){return getConfig().menu.optionProps}},collapsed:{type:Boolean,default:null},collapseFixed:Boolean,loading:Boolean,options:{type:Array,default:function(){return[]}},size:{type:String,default:function(){return getConfig().menu.size||getConfig().size}},menuConfig:Object,useScrollbar:{type:Boolean,default:function(){return getConfig().menu.useScrollbar}},scrollbarConfig:Object,appendTo:{type:[String,Function],default:function(){return getConfig().menu.appendTo}}},inject:{$xeLayoutAside:{default:null}},data:function(){var e=createReactData();return Object.assign(Object.assign({},{}),{xID:_xeUtils.default.uniqueId(),reactData:e})},computed:Object.assign(Object.assign({},{}),{computePropsOpts:function(){return Object.assign({},getConfig().menu.optionProps,this.optionProps)},computeTitleField:function(){return this.computePropsOpts.title||"title"},computeKeyField:function(){return this.computePropsOpts.name||"name"},computeChildrenField:function(){return this.computePropsOpts.children||"children"},computeLinkUrlField:function(){return this.computePropsOpts.linkUrl||"linkUrl"},computeRouterLinkField:function(){return this.computePropsOpts.routerLink||"routerLink"},computeScrollbarOpts:function(){return Object.assign({},getConfig().menu.scrollbarConfig,this.scrollbarConfig)},computeCurrBorder:function(){var e=this.border;return e?!0===e?"first-group":e:""},computeMenuOpts:function(){return Object.assign({},getConfig().tree.menuConfig,this.menuConfig)},computeIsCollapsed:function(){var e=this.$xeLayoutAside,t=this.collapsed;return _xeUtils.default.isBoolean(t)?t:!!e&&!!e.collapsed},computeVarStyle:function(){var e=this.$xeLayoutAside;return e?e.computeVarStyle:{}},computeCollapseEnterWidth:function(){var e=this.$xeLayoutAside,t="";return t=e?e.width||"":t}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$menu:this},t))},emitModel:function(e){var t=this,n=t.reactData,i=t._events;n.activeName=e,t.$emit("input",e),i&&i.modelValue?t.$emit("modelValue",e):t.$emit("model-value",e)},callSlot:function(e,t,n){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,n)):[]},setExpandByMenuKey:function(e,t){var n=this.internalData,i=n.menuKeyMaps,r=n.menuInitMaps;return e&&(e=_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){e=i[e];e&&(t&&(r[e.itemId]=!0),e.isExpand=!!t)}),this.$nextTick()},clearAllExpandMenu:function(){var e=this.reactData,t=this.internalData,e=e.menuList;return _xeUtils.default.eachTree(e,function(e){e.isExpand=!1},{children:"childList"}),t.menuInitMaps={},this.$nextTick()},handleScrollToView:function(e){var t=this.$refs.refElem,t=t?t.querySelector('.vxe-menu--item-wrapper[data-menu-id="'.concat(e,'"]')):null;return!!t&&((0,_dom.scrollToView)(t),!0)},scrollToMenuKey:function(e){var t,n=this,e=n.internalData.menuKeyMaps[e];return!e||(t=e.itemId,n.handleScrollToView(t))?n.$nextTick():n.$nextTick().then(function(){n.handleScrollToView(t)})},scrollToActiveMenu:function(){var t=this,n=t.reactData,e=n.activeName;return e?t.scrollToMenuKey(e):t.$nextTick().then(function(){var e=n.activeName;if(e)return t.scrollToMenuKey(e)})},getMenuTitle:function(e){return"".concat(e.title||e.name)},updateZindex:function(){var e=this.reactData;e.collapseZindex<(0,_utils.getLastZIndex)()&&(e.collapseZindex=(0,_utils.nextZIndex)())},updateActiveMenu:function(l){var e=this.reactData,t=this.internalData,a=e.activeName,u=t.menuInitMaps;_xeUtils.default.eachTree(e.menuList,function(e,t,n,i,r,o){e.itemKey===a?(o.forEach(function(e){e.isActive=!0,l&&(e.isExpand=!0,u[e.itemId]=!0)}),e.isExactActive=!0):(e.isExactActive=!1,e.isActive=!1)},{children:"childList"})},updateMenuConfig:function(){var e=this,t=e.reactData,n=e.internalData,i=e.options,c=e.expandAll,r=e.expandKeys,d={},p=e.computeTitleField,m=e.computeKeyField,f=e.computeChildrenField,v=e.computeLinkUrlField,h=e.computeRouterLinkField,x={},C=(r&&r.forEach(function(e){x[e]=!0}),{}),g={};t.menuList=_xeUtils.default.mapTree(i,function(e,t,n,i,r){var o=++nemuUniqueKey,l=e[m]||i.join(","),a=e[f],u=a&&0<a.length,s=!!u&&(_xeUtils.default.isBoolean(e.expanded)?e.expanded:x[l]||!!c),a=(s&&(d[o]=!0),{itemConf:e,title:e[p],name:e[m],icon:e.icon,linkUrl:e[v],linkTarget:e.linkTarget,routerLink:e[h],permissionCode:e.permissionCode,children:a,slots:e.slots,parentKey:r?r.name||i.slice(0,i.length-1).join(","):"",level:i.length,itemId:o,itemKey:l,isExactActive:!1,isActive:!1,isExpand:s,hasChild:u,childList:[]});return g[l]&&errLog("vxe.error.repeatKey",[m,e[m]]),g[l]=C[o]=a},{children:"children",mapChildren:"childList"}),n.menuInitMaps=d,n.menuCacheMaps=C,n.menuKeyMaps=g},updateCollapseStyle:function(){var i=this,r=i.reactData;i.collapseFixed&&i.$nextTick(function(){var e,t=i.computeIsCollapsed,n=i.$refs.refElem;n&&(e=n.getBoundingClientRect(),n=n.parentElement)&&(e.top<0&&(e=n.getBoundingClientRect()),r.collapseStyle=t?{top:(0,_dom.toCssUnit)(e.top),left:(0,_dom.toCssUnit)(e.left),height:(0,_dom.toCssUnit)(n.clientHeight),zIndex:r.collapseZindex}:{})})},handleCollapseMenu:function(){var t=this,e=t.reactData,n=t.collapseFixed,i=t.appendTo;n&&(n=e.initialized,t.computeIsCollapsed&&!n&&(e.initialized=!0,t.$nextTick(function(){var e=t.$refs.refCollapseElem;e&&(0,_dom.getPopupAppendElement)(i).appendChild(e)})),e.isEnterCollapse=!1,t.updateZindex(),t.updateCollapseStyle())},handleClickIconCollapse:function(e,t,n){var i,r=this,o=r.internalData,l=r.accordion,a=o.menuEffectMaps,o=o.menuInitMaps,u=t.itemId,s=r.computeIsCollapsed,c=!t.isExpand;t.hasChild&&(e.stopPropagation(),e.preventDefault(),a[u]&&clearTimeout(a[u]),l&&n.forEach(function(e){e!==t&&(e.isExpand=!1)}),t.isExpand=c,o[u]=!0,e=s?r.$refs.refCollapseElem:r.$refs.refElem)&&(l=e.querySelector('.vxe-menu--item-wrapper[data-menu-id="'.concat(u,'"]')),i=l?l.querySelector(".vxe-menu--item-group"):null)&&(c?(i.style.height="0",i.setAttribute("data-effect","y"),requestAnimationFrame(function(){i.style.height="".concat(i.scrollHeight,"px")})):(i.style.height="".concat(i.scrollHeight,"px"),i.setAttribute("data-effect","y"),requestAnimationFrame(function(){i.style.height="0"})),a[u]=setTimeout(function(){delete a[u],i.removeAttribute("data-effect"),i.style.height=""},350))},handleContextmenuEvent:function(i,r){var o=this,e=o.menuConfig,t=o.computeMenuOpts;(e?(0,_utils.isEnableConf)(t):t.enabled)&&(e=t.options,(t=t.visibleMethod)&&!t({$menu:o,options:e,currentMenu:r,currentOption:r.itemConf})||_ui.VxeUI.contextMenu&&_ui.VxeUI.contextMenu.openByEvent(i,{options:e,events:{optionClick:function(e){var t=e.option,n=menus.get(t.code),n=n?n.menuMenuMethod:null,t={menu:t,currentMenu:r,currentOption:r.itemConf,$event:i,$menu:o};n&&n(t,i),o.dispatchEvent("menu-click",t,e.$event)}}})),o.dispatchEvent("option-menu",{currentMenu:r},i)},handleClickMenu:function(e,t,n){var i=this,r=i.reactData,o=i.internalData,l=t.itemKey,n=(!t.linkUrl&&!t.routerLink&&t.hasChild?i.handleClickIconCollapse(e,t,n):(i.emitModel(l),r.isEnterCollapse=!1,o.lastActiveTime=Date.now()),{currentMenu:t,currentOption:t.itemConf,option:t.itemConf,menu:t});i.dispatchEvent("click",n,e)},handleMenuMouseenter:function(){var e=this.reactData;this.internalData.lastActiveTime<Date.now()-500&&(e.isEnterCollapse=!0)},handleMenuMouseleave:function(){var e=this.reactData,t=this.$refs.refCollapseBodyScrollbar,n=this.$refs.refCollapseBodyElem;n&&(n.scrollTop=0),t&&t.clearScroll(),e.isEnterCollapse=!1},renderMenuTitle:function(e,t,n){var i=this,r=i.$scopedSlots,o=t.icon,l=t.isExpand,a=t.hasChild,u=t.slots||{},s=u.default||r.option,c=u.title||r.optionTitle||r["option-title"],u=u.icon||r.optionIcon||r["option-icon"],r=i.getMenuTitle(t),d=i.computeIsCollapsed,d={currentMenu:t,currentOption:t.itemConf,option:t.itemConf,collapsed:d};return[s?(0,_ui.renderEmptyElement)(i):e("div",{class:"vxe-menu--item-link-icon"},u?i.callSlot(u,d,e):o?[e("i",{class:o})]:[]),s?e("div",{class:"vxe-menu--item-custom-title"},i.callSlot(s,d,e)):e("div",{class:"vxe-menu--item-link-title",attrs:{title:r}},c?i.callSlot(c,d,e):r),a?e("div",{class:"vxe-menu--item-link-collapse",on:{click:function(e){i.handleClickIconCollapse(e,t,n)}}},[e("i",{class:l?getIcon().MENU_ITEM_EXPAND_OPEN:getIcon().MENU_ITEM_EXPAND_CLOSE})]):(0,_ui.renderEmptyElement)(i)]},renderDefaultChildren:function(t,n,i){var r=this,e=r.reactData,o=n.itemId,l=n.itemKey,a=n.level,u=n.hasChild,s=n.isActive,c=n.isExactActive,d=n.isExpand,p=n.linkUrl,m=n.routerLink,f=n.linkTarget,v=n.childList,e=e.isEnterCollapse,h=r.internalData.menuInitMaps,x=r.computeIsCollapsed;return n.permissionCode&&!_ui.permission.checkVisible(n.permissionCode)?(0,_ui.renderEmptyElement)(r):(x=(!x||e)&&d,e={contextmenu:function(e){r.handleContextmenuEvent(e,n)},click:function(e){r.handleClickMenu(e,n,i)}},t("div",{key:l,class:["vxe-menu--item-wrapper","vxe-menu--item-level".concat(a),{"has--child":u,"is--exact-active":c,"is--active":s,"is--expand":x}],attrs:{"data-menu-id":o}},[p?t("a",{class:"vxe-menu--item-link is--link",attrs:{href:p,target:f},on:e},r.renderMenuTitle(t,n,i)):m?t("router-link",{class:"vxe-menu--item-link is--router",props:{custom:!0,to:m,target:f},nativeOn:e},r.renderMenuTitle(t,n,i)):t("div",{class:"vxe-menu--item-link is--default",on:e},r.renderMenuTitle(t,n,i)),u?t("div",{class:"vxe-menu--item-group"},x||h[o]?v.map(function(e){return r.renderDefaultChildren(t,e,v)}):[]):(0,_ui.renderEmptyElement)(r)]))},renderCollapseChildren:function(t,n,i){var e,r=this,o=n.itemId,l=n.itemKey,a=n.level,u=n.hasChild,s=n.isActive,c=n.isExactActive,d=n.routerLink,p=n.linkUrl,m=n.linkTarget,f=n.childList;return n.permissionCode&&!_ui.permission.checkVisible(n.permissionCode)?(0,_ui.renderEmptyElement)(r):(e={contextmenu:function(e){r.handleContextmenuEvent(e,n)},click:function(e){r.handleClickMenu(e,n,i)}},t("div",{key:l,class:["vxe-menu--item-wrapper","vxe-menu--item-level".concat(a),{"has--child":u,"is--exact-active":c,"is--active":s}],attrs:{"data-menu-id":o}},[p?t("a",{class:"vxe-menu--item-link is--link",attrs:{href:p,target:m},on:e},r.renderMenuTitle(t,n,i)):d?t("router-link",{class:"vxe-menu--item-link is--router",props:{custom:!0,to:d,target:m},nativeOn:e},r.renderMenuTitle(t,n,i)):t("div",{class:"vxe-menu--item-link is--default",on:e},r.renderMenuTitle(t,n,i)),u?t("div",{class:"vxe-menu--item-group"},f.map(function(e){return r.renderDefaultChildren(t,e,f)})):(0,_ui.renderEmptyElement)(r)]))},renderVN:function(t){var n=this,e=n.$scopedSlots,i=n.reactData,r=n.loading,o=n.useScrollbar,l=i.initialized,a=i.menuList,u=i.collapseStyle,i=i.isEnterCollapse,s=n.computeSize,c=n.computeIsCollapsed,d=n.computeCurrBorder,p=n.computeVarStyle,m=n.computeScrollbarOpts,f=m.viewClassName,v=m.viewInnerClassName,h=e.header,e=e.footer,x={},C=(n.collapseFixed&&(x={mouseenter:n.handleMenuMouseenter,mouseleave:n.handleMenuMouseleave}),{collapsed:c});return t("div",{ref:"refElem",class:["vxe-menu",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"border--".concat(d),d),"size--".concat(s),s),"is--collapsed",c),"is--loading",r)]},[h?t("div",{class:"vxe-menu--header"},h(C)):(0,_ui.renderEmptyElement)(n),t("div",{class:"vxe-menu--body"},a.map(function(e){return c?n.renderCollapseChildren(t,e,a):n.renderDefaultChildren(t,e,a)})),e?t("div",{class:"vxe-menu--footer"},e(C)):(0,_ui.renderEmptyElement)(n),l?t("div",{ref:"refCollapseElem",class:["vxe-menu--collapse-wrapper",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(s),s),"is--collapsed",c),"is--enter",i),"is--loading",r)],style:Object.assign({},p,u),on:x},c?[h?t("div",{class:"vxe-menu--header"},h(C)):(0,_ui.renderEmptyElement)(n),o&&i?t(_scrollbar.default,{ref:"refCollapseBodyScrollbar",class:"vxe-menu--scrollbar-body",props:Object.assign(Object.assign({},m),{viewClassName:"vxe-menu--scrollbar-body-view"+(f?" "+f:""),viewInnerClassName:"vxe-menu--scrollbar-body-inner"+(f?" "+v:"")}),scopedSlots:{default:function(){return a.map(function(e){return n.renderDefaultChildren(t,e,a)})}}}):t("div",{ref:"refCollapseBodyElem",class:"vxe-menu--body"},a.map(function(e){return n.renderDefaultChildren(t,e,a)})),e?t("div",{class:"vxe-menu--footer"},e(C)):(0,_ui.renderEmptyElement)(n)]:[]):(0,_ui.renderEmptyElement)(n),t(_loading.default,{class:"vxe-menu-view--loading",props:{value:r}})])}},watch:{value:function(e){this.reactData.activeName=e},options:function(){var e=this;e.updateMenuConfig(),e.updateActiveMenu(!0),e.$nextTick(function(){e.scrollToActiveMenu()})},"reactData.activeName":function(){this.updateActiveMenu(!0)},computeIsCollapsed:function(){this.handleCollapseMenu()}},created:function(){var e=this,t=e,n=(e.internalData=createInternalData(),e.reactData);n.initialized=!!t.collapsed,n.activeName=t.value,e.updateMenuConfig(),e.updateActiveMenu(!0)},mounted:function(){var e=this,t=e.menuConfig,n=_ui.VxeUI.getComponent("VxeContextMenu");t&&!n&&errLog("vxe.error.reqComp",["vxe-context-menu"]),e.updateCollapseStyle(),_ui.globalEvents.on(e,"resize",e.updateCollapseStyle),e.$nextTick(function(){e.scrollToActiveMenu()})},beforeDestroy:function(){var e,t=this.reactData,n=this.internalData,i=this.$refs.refCollapseElem;i&&(e=i.parentNode)&&e.removeChild(i),_ui.globalEvents.off(this,"resize"),_xeUtils.default.assign(t,createReactData()),_xeUtils.default.assign(n,createInternalData())},render:function(e){return this.renderVN(e)}});
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_loading=_interopRequireDefault(require("../../loading")),_scrollbar=_interopRequireDefault(require("../../scrollbar"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}var _createComponentLog=(0,_log.createComponentLog)("menu"),errLog=_createComponentLog.errLog,menus=_ui.VxeUI.menus,getConfig=_ui.VxeUI.getConfig,getIcon=_ui.VxeUI.getIcon;function createInternalData(){return{lastActiveTime:0,menuInitMaps:{},menuCacheMaps:{},menuKeyMaps:{},menuEffectMaps:{}}}function createReactData(){return{initialized:!1,isEnterCollapse:!1,collapseStyle:{},collapseZindex:0,activeName:"",menuList:[],itemHeight:1}}var nemuUniqueKey=1e8,_default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeMenu",mixins:[_ui.globalMixins.sizeMixin,_ui.globalMixins.permissionMixin],props:{value:[String,Number],expandAll:Boolean,expandKeys:Array,accordion:{type:Boolean,default:function(){return getConfig().menu.accordion}},border:{type:[Boolean,String],default:function(){return getConfig().menu.border}},optionProps:{type:Object,default:function(){return getConfig().menu.optionProps}},collapsed:{type:Boolean,default:null},collapseFixed:Boolean,loading:Boolean,options:{type:Array,default:function(){return[]}},size:{type:String,default:function(){return getConfig().menu.size||getConfig().size}},menuConfig:Object,useScrollbar:{type:Boolean,default:function(){return(0,_utils.getDefaultConfig)(getConfig().menu.useScrollbar,getConfig().useScrollbar)}},scrollbarConfig:Object,appendTo:{type:[String,Function],default:function(){return getConfig().menu.appendTo}}},inject:{$xeLayoutAside:{default:null}},data:function(){var e=createReactData();return Object.assign(Object.assign({},{}),{xID:_xeUtils.default.uniqueId(),reactData:e})},computed:Object.assign(Object.assign({},{}),{computePropsOpts:function(){return Object.assign({},getConfig().menu.optionProps,this.optionProps)},computeTitleField:function(){return this.computePropsOpts.title||"title"},computeKeyField:function(){return this.computePropsOpts.name||"name"},computeChildrenField:function(){return this.computePropsOpts.children||"children"},computeLinkUrlField:function(){return this.computePropsOpts.linkUrl||"linkUrl"},computeRouterLinkField:function(){return this.computePropsOpts.routerLink||"routerLink"},computeScrollbarOpts:function(){return Object.assign({},getConfig().menu.scrollbarConfig,this.scrollbarConfig)},computeCurrBorder:function(){var e=this.border;return e?!0===e?"first-group":e:""},computeMenuOpts:function(){return Object.assign({},getConfig().tree.menuConfig,this.menuConfig)},computeIsCollapsed:function(){var e=this.$xeLayoutAside,t=this.collapsed;return _xeUtils.default.isBoolean(t)?t:!!e&&!!e.collapsed},computeVarStyle:function(){var e=this.$xeLayoutAside;return e?e.computeVarStyle:{}},computeCollapseEnterWidth:function(){var e=this.$xeLayoutAside,t="";return t=e?e.width||"":t}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$menu:this},t))},emitModel:function(e){var t=this,n=t.reactData,i=t._events;n.activeName=e,t.$emit("input",e),i&&i.modelValue?t.$emit("modelValue",e):t.$emit("model-value",e)},callSlot:function(e,t,n){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,n)):[]},setExpandByMenuKey:function(e,t){var n=this.internalData,i=n.menuKeyMaps,r=n.menuInitMaps;return e&&(e=_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){e=i[e];e&&(t&&(r[e.itemId]=!0),e.isExpand=!!t)}),this.$nextTick()},clearAllExpandMenu:function(){var e=this.reactData,t=this.internalData,e=e.menuList;return _xeUtils.default.eachTree(e,function(e){e.isExpand=!1},{children:"childList"}),t.menuInitMaps={},this.$nextTick()},handleScrollToView:function(e){var t=this.$refs.refElem,t=t?t.querySelector('.vxe-menu--item-wrapper[data-menu-id="'.concat(e,'"]')):null;return!!t&&((0,_dom.scrollToView)(t),!0)},scrollToMenuKey:function(e){var t,n=this,e=n.internalData.menuKeyMaps[e];return!e||(t=e.itemId,n.handleScrollToView(t))?n.$nextTick():n.$nextTick().then(function(){n.handleScrollToView(t)})},scrollToActiveMenu:function(){var t=this,n=t.reactData,e=n.activeName;return e?t.scrollToMenuKey(e):t.$nextTick().then(function(){var e=n.activeName;if(e)return t.scrollToMenuKey(e)})},getMenuTitle:function(e){return"".concat(e.title||e.name)},updateZindex:function(){var e=this.reactData;e.collapseZindex<(0,_utils.getLastZIndex)()&&(e.collapseZindex=(0,_utils.nextZIndex)())},updateActiveMenu:function(l){var e=this.reactData,t=this.internalData,a=e.activeName,u=t.menuInitMaps;_xeUtils.default.eachTree(e.menuList,function(e,t,n,i,r,o){e.itemKey===a?(o.forEach(function(e){e.isActive=!0,l&&(e.isExpand=!0,u[e.itemId]=!0)}),e.isExactActive=!0):(e.isExactActive=!1,e.isActive=!1)},{children:"childList"})},updateMenuConfig:function(){var e=this,t=e.reactData,n=e.internalData,i=e.options,c=e.expandAll,r=e.expandKeys,d={},p=e.computeTitleField,m=e.computeKeyField,f=e.computeChildrenField,v=e.computeLinkUrlField,h=e.computeRouterLinkField,x={},C=(r&&r.forEach(function(e){x[e]=!0}),{}),g={};t.menuList=_xeUtils.default.mapTree(i,function(e,t,n,i,r){var o=++nemuUniqueKey,l=e[m]||i.join(","),a=e[f],u=a&&0<a.length,s=!!u&&(_xeUtils.default.isBoolean(e.expanded)?e.expanded:x[l]||!!c),a=(s&&(d[o]=!0),{itemConf:e,title:e[p],name:e[m],icon:e.icon,linkUrl:e[v],linkTarget:e.linkTarget,routerLink:e[h],permissionCode:e.permissionCode,children:a,slots:e.slots,parentKey:r?r.name||i.slice(0,i.length-1).join(","):"",level:i.length,itemId:o,itemKey:l,isExactActive:!1,isActive:!1,isExpand:s,hasChild:u,childList:[]});return g[l]&&errLog("vxe.error.repeatKey",[m,e[m]]),g[l]=C[o]=a},{children:"children",mapChildren:"childList"}),n.menuInitMaps=d,n.menuCacheMaps=C,n.menuKeyMaps=g},updateCollapseStyle:function(){var i=this,r=i.reactData;i.collapseFixed&&i.$nextTick(function(){var e,t=i.computeIsCollapsed,n=i.$refs.refElem;n&&(e=n.getBoundingClientRect(),n=n.parentElement)&&(e.top<0&&(e=n.getBoundingClientRect()),r.collapseStyle=t?{top:(0,_dom.toCssUnit)(e.top),left:(0,_dom.toCssUnit)(e.left),height:(0,_dom.toCssUnit)(n.clientHeight),zIndex:r.collapseZindex}:{})})},handleCollapseMenu:function(){var t=this,e=t.reactData,n=t.collapseFixed,i=t.appendTo;n&&(n=e.initialized,t.computeIsCollapsed&&!n&&(e.initialized=!0,t.$nextTick(function(){var e=t.$refs.refCollapseElem;e&&(0,_dom.getPopupAppendElement)(i).appendChild(e)})),e.isEnterCollapse=!1,t.updateZindex(),t.updateCollapseStyle())},handleClickIconCollapse:function(e,t,n){var i,r=this,o=r.internalData,l=r.accordion,a=o.menuEffectMaps,o=o.menuInitMaps,u=t.itemId,s=r.computeIsCollapsed,c=!t.isExpand;t.hasChild&&(e.stopPropagation(),e.preventDefault(),a[u]&&clearTimeout(a[u]),l&&n.forEach(function(e){e!==t&&(e.isExpand=!1)}),t.isExpand=c,o[u]=!0,e=s?r.$refs.refCollapseElem:r.$refs.refElem)&&(l=e.querySelector('.vxe-menu--item-wrapper[data-menu-id="'.concat(u,'"]')),i=l?l.querySelector(".vxe-menu--item-group"):null)&&(c?(i.style.height="0",i.setAttribute("data-effect","y"),requestAnimationFrame(function(){i.style.height="".concat(i.scrollHeight,"px")})):(i.style.height="".concat(i.scrollHeight,"px"),i.setAttribute("data-effect","y"),requestAnimationFrame(function(){i.style.height="0"})),a[u]=setTimeout(function(){delete a[u],i.removeAttribute("data-effect"),i.style.height=""},350))},handleContextmenuEvent:function(i,r){var o=this,e=o.menuConfig,t=o.computeMenuOpts;(e?(0,_utils.isEnableConf)(t):t.enabled)&&(e=t.options,(t=t.visibleMethod)&&!t({$menu:o,options:e,currentMenu:r,currentOption:r.itemConf})||_ui.VxeUI.contextMenu&&_ui.VxeUI.contextMenu.openByEvent(i,{options:e,events:{optionClick:function(e){var t=e.option,n=menus.get(t.code),n=n?n.menuMenuMethod:null,t={menu:t,currentMenu:r,currentOption:r.itemConf,$event:i,$menu:o};n&&n(t,i),o.dispatchEvent("menu-click",t,e.$event)}}})),o.dispatchEvent("option-menu",{currentMenu:r},i)},handleClickMenu:function(e,t,n){var i=this,r=i.reactData,o=i.internalData,l=t.itemKey,n=(!t.linkUrl&&!t.routerLink&&t.hasChild?i.handleClickIconCollapse(e,t,n):(i.emitModel(l),r.isEnterCollapse=!1,o.lastActiveTime=Date.now()),{currentMenu:t,currentOption:t.itemConf,option:t.itemConf,menu:t});i.dispatchEvent("click",n,e)},handleMenuMouseenter:function(){var e=this.reactData;this.internalData.lastActiveTime<Date.now()-500&&(e.isEnterCollapse=!0)},handleMenuMouseleave:function(){var e=this.reactData,t=this.$refs.refCollapseBodyScrollbar,n=this.$refs.refCollapseBodyElem;n&&(n.scrollTop=0),t&&t.clearScroll(),e.isEnterCollapse=!1},renderMenuTitle:function(e,t,n){var i=this,r=i.$scopedSlots,o=t.icon,l=t.isExpand,a=t.hasChild,u=t.slots||{},s=u.default||r.option,c=u.title||r.optionTitle||r["option-title"],u=u.icon||r.optionIcon||r["option-icon"],r=i.getMenuTitle(t),d=i.computeIsCollapsed,d={currentMenu:t,currentOption:t.itemConf,option:t.itemConf,collapsed:d};return[s?(0,_ui.renderEmptyElement)(i):e("div",{class:"vxe-menu--item-link-icon"},u?i.callSlot(u,d,e):o?[e("i",{class:o})]:[]),s?e("div",{class:"vxe-menu--item-custom-title"},i.callSlot(s,d,e)):e("div",{class:"vxe-menu--item-link-title",attrs:{title:r}},c?i.callSlot(c,d,e):r),a?e("div",{class:"vxe-menu--item-link-collapse",on:{click:function(e){i.handleClickIconCollapse(e,t,n)}}},[e("i",{class:l?getIcon().MENU_ITEM_EXPAND_OPEN:getIcon().MENU_ITEM_EXPAND_CLOSE})]):(0,_ui.renderEmptyElement)(i)]},renderDefaultChildren:function(t,n,i){var r=this,e=r.reactData,o=n.itemId,l=n.itemKey,a=n.level,u=n.hasChild,s=n.isActive,c=n.isExactActive,d=n.isExpand,p=n.linkUrl,m=n.routerLink,f=n.linkTarget,v=n.childList,e=e.isEnterCollapse,h=r.internalData.menuInitMaps,x=r.computeIsCollapsed;return n.permissionCode&&!_ui.permission.checkVisible(n.permissionCode)?(0,_ui.renderEmptyElement)(r):(x=(!x||e)&&d,e={contextmenu:function(e){r.handleContextmenuEvent(e,n)},click:function(e){r.handleClickMenu(e,n,i)}},t("div",{key:l,class:["vxe-menu--item-wrapper","vxe-menu--item-level".concat(a),{"has--child":u,"is--exact-active":c,"is--active":s,"is--expand":x}],attrs:{"data-menu-id":o}},[p?t("a",{class:"vxe-menu--item-link is--link",attrs:{href:p,target:f},on:e},r.renderMenuTitle(t,n,i)):m?t("router-link",{class:"vxe-menu--item-link is--router",props:{custom:!0,to:m,target:f},nativeOn:e},r.renderMenuTitle(t,n,i)):t("div",{class:"vxe-menu--item-link is--default",on:e},r.renderMenuTitle(t,n,i)),u?t("div",{class:"vxe-menu--item-group"},x||h[o]?v.map(function(e){return r.renderDefaultChildren(t,e,v)}):[]):(0,_ui.renderEmptyElement)(r)]))},renderCollapseChildren:function(t,n,i){var e,r=this,o=n.itemId,l=n.itemKey,a=n.level,u=n.hasChild,s=n.isActive,c=n.isExactActive,d=n.routerLink,p=n.linkUrl,m=n.linkTarget,f=n.childList;return n.permissionCode&&!_ui.permission.checkVisible(n.permissionCode)?(0,_ui.renderEmptyElement)(r):(e={contextmenu:function(e){r.handleContextmenuEvent(e,n)},click:function(e){r.handleClickMenu(e,n,i)}},t("div",{key:l,class:["vxe-menu--item-wrapper","vxe-menu--item-level".concat(a),{"has--child":u,"is--exact-active":c,"is--active":s}],attrs:{"data-menu-id":o}},[p?t("a",{class:"vxe-menu--item-link is--link",attrs:{href:p,target:m},on:e},r.renderMenuTitle(t,n,i)):d?t("router-link",{class:"vxe-menu--item-link is--router",props:{custom:!0,to:d,target:m},nativeOn:e},r.renderMenuTitle(t,n,i)):t("div",{class:"vxe-menu--item-link is--default",on:e},r.renderMenuTitle(t,n,i)),u?t("div",{class:"vxe-menu--item-group"},f.map(function(e){return r.renderDefaultChildren(t,e,f)})):(0,_ui.renderEmptyElement)(r)]))},renderVN:function(t){var n=this,e=n.$scopedSlots,i=n.reactData,r=n.loading,o=n.useScrollbar,l=i.initialized,a=i.menuList,u=i.collapseStyle,i=i.isEnterCollapse,s=n.computeSize,c=n.computeIsCollapsed,d=n.computeCurrBorder,p=n.computeVarStyle,m=n.computeScrollbarOpts,f=m.viewClassName,v=m.viewInnerClassName,h=e.header,e=e.footer,x={},C=(n.collapseFixed&&(x={mouseenter:n.handleMenuMouseenter,mouseleave:n.handleMenuMouseleave}),{collapsed:c});return t("div",{ref:"refElem",class:["vxe-menu",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"border--".concat(d),d),"size--".concat(s),s),"is--collapsed",c),"is--loading",r)]},[h?t("div",{class:"vxe-menu--header"},h(C)):(0,_ui.renderEmptyElement)(n),t("div",{class:"vxe-menu--body"},a.map(function(e){return c?n.renderCollapseChildren(t,e,a):n.renderDefaultChildren(t,e,a)})),e?t("div",{class:"vxe-menu--footer"},e(C)):(0,_ui.renderEmptyElement)(n),l?t("div",{ref:"refCollapseElem",class:["vxe-menu--collapse-wrapper",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(s),s),"is--collapsed",c),"is--enter",i),"is--loading",r)],style:Object.assign({},p,u),on:x},c?[h?t("div",{class:"vxe-menu--header"},h(C)):(0,_ui.renderEmptyElement)(n),o&&i?t(_scrollbar.default,{ref:"refCollapseBodyScrollbar",class:"vxe-menu--scrollbar-body",props:Object.assign(Object.assign({},m),{viewClassName:"vxe-menu--scrollbar-body-view"+(f?" "+f:""),viewInnerClassName:"vxe-menu--scrollbar-body-inner"+(f?" "+v:"")}),scopedSlots:{default:function(){return a.map(function(e){return n.renderDefaultChildren(t,e,a)})}}}):t("div",{ref:"refCollapseBodyElem",class:"vxe-menu--body"},a.map(function(e){return n.renderDefaultChildren(t,e,a)})),e?t("div",{class:"vxe-menu--footer"},e(C)):(0,_ui.renderEmptyElement)(n)]:[]):(0,_ui.renderEmptyElement)(n),t(_loading.default,{class:"vxe-menu-view--loading",props:{value:r}})])}},watch:{value:function(e){this.reactData.activeName=e},options:function(){var e=this;e.updateMenuConfig(),e.updateActiveMenu(!0),e.$nextTick(function(){e.scrollToActiveMenu()})},"reactData.activeName":function(){this.updateActiveMenu(!0)},computeIsCollapsed:function(){this.handleCollapseMenu()}},created:function(){var e=this,t=e,n=(e.internalData=createInternalData(),e.reactData);n.initialized=!!t.collapsed,n.activeName=t.value,e.updateMenuConfig(),e.updateActiveMenu(!0)},mounted:function(){var e=this,t=e.menuConfig,n=_ui.VxeUI.getComponent("VxeContextMenu");t&&!n&&errLog("vxe.error.reqComp",["vxe-context-menu"]),e.updateCollapseStyle(),_ui.globalEvents.on(e,"resize",e.updateCollapseStyle),e.$nextTick(function(){e.scrollToActiveMenu()})},beforeDestroy:function(){var e,t=this.reactData,n=this.internalData,i=this.$refs.refCollapseElem;i&&(e=i.parentNode)&&e.removeChild(i),_ui.globalEvents.off(this,"resize"),_xeUtils.default.assign(t,createReactData()),_xeUtils.default.assign(n,createInternalData())},render:function(e){return this.renderVN(e)}});
|
package/lib/modal/src/modal.js
CHANGED
|
@@ -15,6 +15,7 @@ var _log = require("../../ui/src/log");
|
|
|
15
15
|
var _store = require("./store");
|
|
16
16
|
var _button = _interopRequireDefault(require("../../button"));
|
|
17
17
|
var _loading = _interopRequireDefault(require("../../loading"));
|
|
18
|
+
var _scrollbar = _interopRequireDefault(require("../../scrollbar"));
|
|
18
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
20
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
20
21
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
@@ -307,6 +308,13 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
307
308
|
},
|
|
308
309
|
beforeHideMethod: Function,
|
|
309
310
|
slots: Object,
|
|
311
|
+
useScrollbar: {
|
|
312
|
+
type: Boolean,
|
|
313
|
+
default: function _default() {
|
|
314
|
+
return (0, _utils.getDefaultConfig)((0, _ui.getConfig)().modal.useScrollbar, (0, _ui.getConfig)().useScrollbar);
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
scrollbarConfig: Object,
|
|
310
318
|
/**
|
|
311
319
|
* 已废弃
|
|
312
320
|
* @deprecated
|
|
@@ -397,6 +405,29 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
397
405
|
var $xeModal = this;
|
|
398
406
|
var props = $xeModal;
|
|
399
407
|
return Object.assign({}, (0, _ui.getConfig)().modal.zoomConfig, props.zoomConfig);
|
|
408
|
+
},
|
|
409
|
+
computeScrollbarOpts: function computeScrollbarOpts() {
|
|
410
|
+
var $xeModal = this;
|
|
411
|
+
var props = $xeModal;
|
|
412
|
+
return Object.assign({}, (0, _ui.getConfig)().modal.scrollbarConfig, props.scrollbarConfig);
|
|
413
|
+
},
|
|
414
|
+
computeScrollbarProps: function computeScrollbarProps() {
|
|
415
|
+
var $xeModal = this;
|
|
416
|
+
var scrollbarOpts = $xeModal.computeScrollbarOpts;
|
|
417
|
+
var viewClassName = scrollbarOpts.viewClassName,
|
|
418
|
+
viewInnerClassName = scrollbarOpts.viewInnerClassName;
|
|
419
|
+
return {
|
|
420
|
+
width: scrollbarOpts.width,
|
|
421
|
+
height: scrollbarOpts.height,
|
|
422
|
+
autoHide: scrollbarOpts.autoHide,
|
|
423
|
+
visible: scrollbarOpts.visible,
|
|
424
|
+
xConfig: scrollbarOpts.xConfig,
|
|
425
|
+
yConfig: scrollbarOpts.yConfig,
|
|
426
|
+
className: scrollbarOpts.className,
|
|
427
|
+
viewAttrs: scrollbarOpts.viewAttrs,
|
|
428
|
+
viewClassName: 'vxe-modal--scrollbar-content-view' + (viewClassName ? ' ' + viewClassName : ''),
|
|
429
|
+
viewInnerClassName: 'vxe-modal--scrollbar-content-inner' + (viewClassName ? ' ' + viewInnerClassName : '')
|
|
430
|
+
};
|
|
400
431
|
}
|
|
401
432
|
}),
|
|
402
433
|
watch: {
|
|
@@ -1617,9 +1648,11 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
1617
1648
|
status = props.status,
|
|
1618
1649
|
message = props.message,
|
|
1619
1650
|
iconStatus = props.iconStatus,
|
|
1651
|
+
useScrollbar = props.useScrollbar,
|
|
1620
1652
|
useHtml = props.useHtml;
|
|
1621
1653
|
var content = props.content || message;
|
|
1622
1654
|
var isMsg = $xeModal.computeIsMsg;
|
|
1655
|
+
var scrollbarProps = $xeModal.computeScrollbarProps;
|
|
1623
1656
|
var defaultSlot = slots.default || propSlots.default;
|
|
1624
1657
|
var leftSlot = slots.left || propSlots.left;
|
|
1625
1658
|
var rightSlot = slots.right || propSlots.right;
|
|
@@ -1631,18 +1664,47 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
1631
1664
|
class: ['vxe-modal--status-icon', iconStatus || (0, _ui.getIcon)()["MODAL_".concat(status).toLocaleUpperCase()]]
|
|
1632
1665
|
})]));
|
|
1633
1666
|
}
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1667
|
+
if (useHtml && !defaultSlot) {
|
|
1668
|
+
contVNs.push(useScrollbar ? h(_scrollbar.default, {
|
|
1669
|
+
key: 'shc',
|
|
1670
|
+
class: 'vxe-modal--scrollbar-content',
|
|
1671
|
+
props: scrollbarProps,
|
|
1672
|
+
scopedSlots: {
|
|
1673
|
+
default: function _default() {
|
|
1674
|
+
return [h('div', {
|
|
1675
|
+
class: 'vxe-modal--scrollbar-content-html',
|
|
1676
|
+
domProps: {
|
|
1677
|
+
innerHTML: (0, _utils.getFuncText)(content)
|
|
1678
|
+
}
|
|
1679
|
+
})];
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
}) : h('div', {
|
|
1683
|
+
key: 'hc',
|
|
1684
|
+
class: 'vxe-modal--content',
|
|
1685
|
+
domProps: {
|
|
1686
|
+
innerHTML: (0, _utils.getFuncText)(content)
|
|
1687
|
+
}
|
|
1688
|
+
}));
|
|
1689
|
+
} else {
|
|
1690
|
+
contVNs.push(useScrollbar ? h(_scrollbar.default, {
|
|
1691
|
+
key: 'sdc',
|
|
1692
|
+
class: 'vxe-modal--scrollbar-content',
|
|
1693
|
+
props: scrollbarProps,
|
|
1694
|
+
scopedSlots: {
|
|
1695
|
+
default: function _default() {
|
|
1696
|
+
return defaultSlot ? $xeModal.callSlot(defaultSlot, {
|
|
1697
|
+
$modal: $xeModal
|
|
1698
|
+
}, h) : (0, _utils.getFuncText)(content);
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
}) : h('div', {
|
|
1702
|
+
key: 'dc',
|
|
1703
|
+
class: 'vxe-modal--content'
|
|
1704
|
+
}, defaultSlot ? $xeModal.callSlot(defaultSlot, {
|
|
1705
|
+
$modal: $xeModal
|
|
1706
|
+
}, h) : (0, _utils.getFuncText)(content)));
|
|
1707
|
+
}
|
|
1646
1708
|
return h('div', {
|
|
1647
1709
|
class: 'vxe-modal--body'
|
|
1648
1710
|
}, [leftSlot ? h('div', {
|