vxe-pc-ui 3.3.40 → 3.3.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/es/color-picker/src/color-picker.js +10 -1
  2. package/es/form/src/render.js +3 -2
  3. package/es/icon/style.css +1 -1
  4. package/es/list/src/list.js +60 -12
  5. package/es/style.css +1 -1
  6. package/es/style.min.css +1 -1
  7. package/es/ui/index.js +2 -1
  8. package/es/ui/src/log.js +1 -1
  9. package/es/upload/src/upload.js +9 -2
  10. package/es/upload/style.css +9 -7
  11. package/es/upload/style.min.css +1 -1
  12. package/es/vxe-upload/style.css +9 -7
  13. package/es/vxe-upload/style.min.css +1 -1
  14. package/lib/color-picker/src/color-picker.js +10 -1
  15. package/lib/color-picker/src/color-picker.min.js +1 -1
  16. package/lib/form/src/render.js +2 -1
  17. package/lib/form/src/render.min.js +1 -1
  18. package/lib/icon/style/style.css +1 -1
  19. package/lib/icon/style/style.min.css +1 -1
  20. package/lib/index.umd.js +82 -16
  21. package/lib/index.umd.min.js +1 -1
  22. package/lib/list/src/list.js +58 -11
  23. package/lib/list/src/list.min.js +1 -1
  24. package/lib/style.css +1 -1
  25. package/lib/style.min.css +1 -1
  26. package/lib/ui/index.js +2 -1
  27. package/lib/ui/index.min.js +1 -1
  28. package/lib/ui/src/log.js +1 -1
  29. package/lib/ui/src/log.min.js +1 -1
  30. package/lib/upload/src/upload.js +9 -1
  31. package/lib/upload/src/upload.min.js +1 -1
  32. package/lib/upload/style/style.css +9 -7
  33. package/lib/upload/style/style.min.css +1 -1
  34. package/lib/vxe-upload/style/style.css +9 -7
  35. package/lib/vxe-upload/style/style.min.css +1 -1
  36. package/package.json +1 -1
  37. package/packages/color-picker/src/color-picker.ts +8 -0
  38. package/packages/form/src/render.ts +3 -2
  39. package/packages/list/src/list.ts +63 -13
  40. package/packages/ui/index.ts +1 -0
  41. package/packages/upload/src/upload.ts +10 -3
  42. package/styles/components/upload.scss +12 -11
  43. package/types/components/color-picker.d.ts +42 -2
  44. package/types/components/list.d.ts +3 -1
  45. package/types/components/table-module/edit.d.ts +26 -7
  46. /package/es/icon/{iconfont.1734517198871.ttf → iconfont.1734675929343.ttf} +0 -0
  47. /package/es/icon/{iconfont.1734517198871.woff → iconfont.1734675929343.woff} +0 -0
  48. /package/es/icon/{iconfont.1734517198871.woff2 → iconfont.1734675929343.woff2} +0 -0
  49. /package/es/{iconfont.1734517198871.ttf → iconfont.1734675929343.ttf} +0 -0
  50. /package/es/{iconfont.1734517198871.woff → iconfont.1734675929343.woff} +0 -0
  51. /package/es/{iconfont.1734517198871.woff2 → iconfont.1734675929343.woff2} +0 -0
  52. /package/lib/icon/style/{iconfont.1734517198871.ttf → iconfont.1734675929343.ttf} +0 -0
  53. /package/lib/icon/style/{iconfont.1734517198871.woff → iconfont.1734675929343.woff} +0 -0
  54. /package/lib/icon/style/{iconfont.1734517198871.woff2 → iconfont.1734675929343.woff2} +0 -0
  55. /package/lib/{iconfont.1734517198871.ttf → iconfont.1734675929343.ttf} +0 -0
  56. /package/lib/{iconfont.1734517198871.woff → iconfont.1734675929343.woff} +0 -0
  57. /package/lib/{iconfont.1734517198871.woff2 → iconfont.1734675929343.woff2} +0 -0
@@ -44,7 +44,9 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
44
44
  var reactData = {
45
45
  scrollYLoad: false,
46
46
  bodyHeight: 0,
47
- rowHeight: 0,
47
+ customHeight: 0,
48
+ customMaxHeight: 0,
49
+ parentHeight: 0,
48
50
  topSpaceHeight: 0,
49
51
  items: []
50
52
  };
@@ -76,14 +78,17 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
76
78
  computeStyles: function computeStyles() {
77
79
  var $xeList = this;
78
80
  var props = $xeList;
81
+ var reactData = $xeList.reactData;
79
82
  var height = props.height,
80
83
  maxHeight = props.maxHeight;
84
+ var customHeight = reactData.customHeight,
85
+ customMaxHeight = reactData.customMaxHeight;
81
86
  var style = {};
82
87
  if (height) {
83
- style.height = "".concat(isNaN(height) ? height : "".concat(height, "px"));
88
+ style.height = "".concat(customHeight, "px");
84
89
  } else if (maxHeight) {
85
90
  style.height = 'auto';
86
- style.maxHeight = "".concat(isNaN(maxHeight) ? maxHeight : "".concat(maxHeight, "px"));
91
+ style.maxHeight = "".concat(customMaxHeight, "px");
87
92
  }
88
93
  return style;
89
94
  }
@@ -144,6 +149,33 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
144
149
  $xeList.clearScroll();
145
150
  return $xeList.loadData(datas);
146
151
  },
152
+ calcTableHeight: function calcTableHeight(key) {
153
+ var $xeList = this;
154
+ var props = $xeList;
155
+ var reactData = $xeList.reactData;
156
+ var parentHeight = reactData.parentHeight;
157
+ var val = props[key];
158
+ var num = 0;
159
+ if (val) {
160
+ if (val === '100%' || val === 'auto') {
161
+ num = parentHeight;
162
+ } else {
163
+ if ((0, _dom.isScale)(val)) {
164
+ num = Math.floor((_xeUtils.default.toInteger(val) || 1) / 100 * parentHeight);
165
+ } else {
166
+ num = _xeUtils.default.toNumber(val);
167
+ }
168
+ num = Math.max(40, num);
169
+ }
170
+ }
171
+ return num;
172
+ },
173
+ updateHeight: function updateHeight() {
174
+ var $xeList = this;
175
+ var reactData = $xeList.reactData;
176
+ reactData.customHeight = $xeList.calcTableHeight('height');
177
+ reactData.customMaxHeight = $xeList.calcTableHeight('maxHeight');
178
+ },
147
179
  updateYSpace: function updateYSpace() {
148
180
  var $xeList = this;
149
181
  var reactData = $xeList.reactData;
@@ -200,12 +232,11 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
200
232
  var offsetYSize = sYOpts.oSize ? _xeUtils.default.toNumber(sYOpts.oSize) : _dom.browse.edge ? 10 : 0;
201
233
  scrollYStore.offsetSize = offsetYSize;
202
234
  scrollYStore.visibleSize = visibleYSize;
203
- scrollYStore.endIndex = Math.max(scrollYStore.startIndex, visibleYSize + offsetYSize, scrollYStore.endIndex);
235
+ scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
204
236
  $xeList.updateYData();
205
237
  } else {
206
238
  $xeList.updateYSpace();
207
239
  }
208
- reactData.rowHeight = rowHeight;
209
240
  });
210
241
  },
211
242
  /**
@@ -266,11 +297,17 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
266
297
  */
267
298
  recalculate: function recalculate() {
268
299
  var $xeList = this;
300
+ var reactData = $xeList.reactData;
269
301
  var el = $xeList.$refs.refElem;
270
- if (el.clientWidth && el.clientHeight) {
271
- return $xeList.computeScrollLoad();
302
+ if (el) {
303
+ var parentEl = el.parentElement;
304
+ reactData.parentHeight = parentEl ? parentEl.clientHeight : 0;
305
+ $xeList.updateHeight();
306
+ if (el.clientWidth && el.clientHeight) {
307
+ return $xeList.computeScrollLoad();
308
+ }
272
309
  }
273
- return Promise.resolve();
310
+ return $xeList.$nextTick();
274
311
  },
275
312
  loadYData: function loadYData(evnt) {
276
313
  var $xeList = this;
@@ -374,6 +411,14 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
374
411
  var props = $xeList;
375
412
  $xeList.loadData(props.data || []);
376
413
  },
414
+ height: function height() {
415
+ var $xeList = this;
416
+ $xeList.recalculate();
417
+ },
418
+ maxHeight: function maxHeight() {
419
+ var $xeList = this;
420
+ $xeList.recalculate();
421
+ },
377
422
  syncResize: function syncResize(val) {
378
423
  var $xeList = this;
379
424
  if (val) {
@@ -389,23 +434,25 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
389
434
  created: function created() {
390
435
  var $xeList = this;
391
436
  var props = $xeList;
392
- _ui.globalEvents.on($xeList, 'resize', function () {
393
- $xeList.recalculate();
394
- });
395
437
  $xeList.loadData(props.data || []);
396
438
  },
397
439
  mounted: function mounted() {
398
440
  var $xeList = this;
399
441
  var props = $xeList;
400
442
  var internalData = $xeList.internalData;
443
+ $xeList.recalculate();
401
444
  if (props.autoResize) {
402
445
  var el = $xeList.$refs.refElem;
403
446
  var resizeObserver = _ui.globalResize.create(function () {
404
447
  return $xeList.recalculate();
405
448
  });
406
449
  resizeObserver.observe(el);
450
+ if (el) {
451
+ resizeObserver.observe(el.parentElement);
452
+ }
407
453
  internalData.resizeObserver = resizeObserver;
408
454
  }
455
+ _ui.globalEvents.on($xeList, 'resize', $xeList.recalculate);
409
456
  },
410
457
  activated: function activated() {
411
458
  var $xeList = this;
@@ -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"),_vn=require("../../ui/src/vn"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}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],scrollY:Object},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{scrollYLoad:!1,bodyHeight:0,rowHeight:0,topSpaceHeight:0,items:[]},internalData:{resizeObserver:void 0,fullData:[],lastScrollLeft:0,lastScrollTop:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0}}}},computed:Object.assign(Object.assign({},{}),{computeSYOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.scrollY,this.scrollY)},computeStyles:function(){var t=this.height,e=this.maxHeight,r={};return t?r.height="".concat(isNaN(t)?t:"".concat(t,"px")):e&&(r.height="auto",r.maxHeight="".concat(isNaN(e)?e:"".concat(e,"px"))),r}}),methods:{dispatchEvent:function(t,e,r){this.$emit(t,(0,_ui.createEvent)(r,{$list:this},e))},callSlot:function(t,e,r){var i=this.$scopedSlots;return t&&(_xeUtils.default.isString(t)&&(t=i[t]||null),_xeUtils.default.isFunction(t))?(0,_vn.getSlotVNs)(t.call(this,e,r)):[]},loadData:function(t){var e=this,r=e.reactData,i=e.internalData,a=i.scrollYStore,o=e.computeSYOpts,t=t||[];return Object.assign(a,{startIndex:0,endIndex:1,visibleSize:0}),i.fullData=t,r.scrollYLoad=!!o.enabled&&-1<o.gt&&(0===o.gt||o.gt<=t.length),e.handleData(),e.computeScrollLoad().then(function(){e.refreshScroll()})},reloadData:function(t){return this.clearScroll(),this.loadData(t)},updateYSpace:function(){var t=this.reactData,e=this.internalData,r=t.scrollYLoad,i=e.scrollYStore;t.bodyHeight=r?e.fullData.length*i.rowHeight:0,t.topSpaceHeight=r?Math.max(i.startIndex*i.rowHeight,0):0},handleData:function(){var t=this.reactData,e=this.internalData,r=t.scrollYLoad,i=e.fullData,e=e.scrollYStore;return t.items=r?i.slice(e.startIndex,e.endIndex):i.slice(0),this.$nextTick()},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var l=this,n=l.reactData,s=l.internalData;return l.$nextTick().then(function(){var t,e=n.scrollYLoad,r=s.scrollYStore,i=l.$refs.refVirtualBody,a=l.computeSYOpts,o=0;(t=i?(t=a.sItem?i.querySelector(a.sItem):t)||i.children[0]:t)&&(o=t.offsetHeight),o=Math.max(20,o),r.rowHeight=o,e?(i=l.$refs.refVirtualWrapper,t=Math.max(8,Math.ceil(i.clientHeight/o)),e=a.oSize?_xeUtils.default.toNumber(a.oSize):_dom.browse.edge?10:0,r.offsetSize=e,r.visibleSize=t,r.endIndex=Math.max(r.startIndex,t+e,r.endIndex),l.updateYData()):l.updateYSpace(),n.rowHeight=o})},clearScroll:function(){var t=this.$refs.refVirtualWrapper;return t&&(t.scrollTop=0),this.$nextTick()},scrollTo:function(t,e){var r=this,i=r.reactData,a=r.$refs.refVirtualWrapper;return _xeUtils.default.isNumber(t)&&(a.scrollLeft=t),_xeUtils.default.isNumber(e)&&(a.scrollTop=e),i.scrollYLoad?new Promise(function(t){setTimeout(function(){r.$nextTick(function(){t()})},50)}):r.$nextTick()},refreshScroll:function(){var t=this.internalData,e=t.lastScrollLeft,r=t.lastScrollTop;return this.clearScroll().then(function(){if(e||r)return t.lastScrollLeft=0,t.lastScrollTop=0,scrollTo(e,r)})},recalculate:function(){var t=this.$refs.refElem;return t.clientWidth&&t.clientHeight?this.computeScrollLoad():Promise.resolve()},loadYData:function(t){var e=this.internalData.scrollYStore,r=e.startIndex,i=e.endIndex,a=e.visibleSize,o=e.offsetSize,t=t.target.scrollTop,t=Math.floor(t/e.rowHeight),l=Math.max(0,t-1-o),o=t+a+o;!(t<=r||i-a-1<=t)||r===l&&i===o||(e.startIndex=l,e.endIndex=o,this.updateYData())},scrollEvent:function(t){var e=this.reactData,r=this.internalData,i=t.target,a=i.scrollTop,i=i.scrollLeft,o=i!==r.lastScrollLeft,l=a!==r.lastScrollTop;r.lastScrollTop=a,r.lastScrollLeft=i,e.scrollYLoad&&this.loadYData(t),this.dispatchEvent("scroll",{scrollLeft:i,scrollTop:a,isX:o,isY:l},t)},renderVN:function(t){var e=this,r=e.reactData,i=e.className,a=e.loading,o=r.bodyHeight,l=r.topSpaceHeight,r=r.items,n=e.$scopedSlots.default,s=e.computeSize,c=e.computeStyles;return t("div",{ref:"refElem",class:["vxe-list",i?_xeUtils.default.isFunction(i)?i({$list:e}):i:"",_defineProperty(_defineProperty({},"size--".concat(s),s),"is--loading",a)]},[t("div",{ref:"refVirtualWrapper",class:"vxe-list--virtual-wrapper",style:c,on:{scroll:e.scrollEvent}},[t("div",{class:"vxe-list--y-space",style:{height:o?"".concat(o,"px"):""}}),t("div",{ref:"refVirtualBody",class:"vxe-list--body",style:{marginTop:l?"".concat(l,"px"):""}},n?e.callSlot(n,{items:r},t):[])]),t(_loading.default,{class:"vxe-list--loading",props:{value:a}})])}},watch:{data:function(){this.loadData(this.data||[])},syncResize:function(t){var e=this;t&&(e.recalculate(),e.$nextTick(function(){return setTimeout(function(){return e.recalculate()})}))}},created:function(){var t=this,e=t;_ui.globalEvents.on(t,"resize",function(){t.recalculate()}),t.loadData(e.data||[])},mounted:function(){var t,e,r=this,i=r.internalData;r.autoResize&&(t=r.$refs.refElem,(e=_ui.globalResize.create(function(){return r.recalculate()})).observe(t),i.resizeObserver=e)},activated:function(){var t=this;t.recalculate().then(function(){return t.refreshScroll()})},beforeDestroy:function(){var t=this.internalData.resizeObserver;t&&t.disconnect(),_ui.globalEvents.off(this,"resize")},render:function(t){return this.renderVN(t)}});
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"),_vn=require("../../ui/src/vn"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _defineProperty(t,e,i){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0===i)return("string"===e?String:Number)(t);i=i.call(t,e||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}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],scrollY:Object},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{scrollYLoad:!1,bodyHeight:0,customHeight:0,customMaxHeight:0,parentHeight:0,topSpaceHeight:0,items:[]},internalData:{resizeObserver:void 0,fullData:[],lastScrollLeft:0,lastScrollTop:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0}}}},computed:Object.assign(Object.assign({},{}),{computeSYOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.scrollY,this.scrollY)},computeStyles:function(){var t=this.reactData,e=this.height,i=this.maxHeight,r=t.customHeight,t=t.customMaxHeight,a={};return e?a.height="".concat(r,"px"):i&&(a.height="auto",a.maxHeight="".concat(t,"px")),a}}),methods:{dispatchEvent:function(t,e,i){this.$emit(t,(0,_ui.createEvent)(i,{$list:this},e))},callSlot:function(t,e,i){var r=this.$scopedSlots;return t&&(_xeUtils.default.isString(t)&&(t=r[t]||null),_xeUtils.default.isFunction(t))?(0,_vn.getSlotVNs)(t.call(this,e,i)):[]},loadData:function(t){var e=this,i=e.reactData,r=e.internalData,a=r.scrollYStore,l=e.computeSYOpts,t=t||[];return Object.assign(a,{startIndex:0,endIndex:1,visibleSize:0}),r.fullData=t,i.scrollYLoad=!!l.enabled&&-1<l.gt&&(0===l.gt||l.gt<=t.length),e.handleData(),e.computeScrollLoad().then(function(){e.refreshScroll()})},reloadData:function(t){return this.clearScroll(),this.loadData(t)},calcTableHeight:function(t){var e=this.reactData.parentHeight,t=this[t],i=0;return i=t?"100%"===t||"auto"===t?e:(i=(0,_dom.isScale)(t)?Math.floor((_xeUtils.default.toInteger(t)||1)/100*e):_xeUtils.default.toNumber(t),Math.max(40,i)):i},updateHeight:function(){var t=this.reactData;t.customHeight=this.calcTableHeight("height"),t.customMaxHeight=this.calcTableHeight("maxHeight")},updateYSpace:function(){var t=this.reactData,e=this.internalData,i=t.scrollYLoad,r=e.scrollYStore;t.bodyHeight=i?e.fullData.length*r.rowHeight:0,t.topSpaceHeight=i?Math.max(r.startIndex*r.rowHeight,0):0},handleData:function(){var t=this.reactData,e=this.internalData,i=t.scrollYLoad,r=e.fullData,e=e.scrollYStore;return t.items=i?r.slice(e.startIndex,e.endIndex):r.slice(0),this.$nextTick()},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var o=this,n=o.reactData,s=o.internalData;return o.$nextTick().then(function(){var t,e=n.scrollYLoad,i=s.scrollYStore,r=o.$refs.refVirtualBody,a=o.computeSYOpts,l=0;(t=r?(t=a.sItem?r.querySelector(a.sItem):t)||r.children[0]:t)&&(l=t.offsetHeight),l=Math.max(20,l),i.rowHeight=l,e?(r=o.$refs.refVirtualWrapper,t=Math.max(8,Math.ceil(r.clientHeight/l)),e=a.oSize?_xeUtils.default.toNumber(a.oSize):_dom.browse.edge?10:0,i.offsetSize=e,i.visibleSize=t,i.endIndex=Math.max(i.startIndex+t+e,i.endIndex),o.updateYData()):o.updateYSpace()})},clearScroll:function(){var t=this.$refs.refVirtualWrapper;return t&&(t.scrollTop=0),this.$nextTick()},scrollTo:function(t,e){var i=this,r=i.reactData,a=i.$refs.refVirtualWrapper;return _xeUtils.default.isNumber(t)&&(a.scrollLeft=t),_xeUtils.default.isNumber(e)&&(a.scrollTop=e),r.scrollYLoad?new Promise(function(t){setTimeout(function(){i.$nextTick(function(){t()})},50)}):i.$nextTick()},refreshScroll:function(){var t=this.internalData,e=t.lastScrollLeft,i=t.lastScrollTop;return this.clearScroll().then(function(){if(e||i)return t.lastScrollLeft=0,t.lastScrollTop=0,scrollTo(e,i)})},recalculate:function(){var t=this,e=t.reactData,i=t.$refs.refElem;if(i){var r=i.parentElement;if(e.parentHeight=r?r.clientHeight:0,t.updateHeight(),i.clientWidth&&i.clientHeight)return t.computeScrollLoad()}return t.$nextTick()},loadYData:function(t){var e=this.internalData.scrollYStore,i=e.startIndex,r=e.endIndex,a=e.visibleSize,l=e.offsetSize,t=t.target.scrollTop,t=Math.floor(t/e.rowHeight),o=Math.max(0,t-1-l),l=t+a+l;!(t<=i||r-a-1<=t)||i===o&&r===l||(e.startIndex=o,e.endIndex=l,this.updateYData())},scrollEvent:function(t){var e=this.reactData,i=this.internalData,r=t.target,a=r.scrollTop,r=r.scrollLeft,l=r!==i.lastScrollLeft,o=a!==i.lastScrollTop;i.lastScrollTop=a,i.lastScrollLeft=r,e.scrollYLoad&&this.loadYData(t),this.dispatchEvent("scroll",{scrollLeft:r,scrollTop:a,isX:l,isY:o},t)},renderVN:function(t){var e=this,i=e.reactData,r=e.className,a=e.loading,l=i.bodyHeight,o=i.topSpaceHeight,i=i.items,n=e.$scopedSlots.default,s=e.computeSize,c=e.computeStyles;return t("div",{ref:"refElem",class:["vxe-list",r?_xeUtils.default.isFunction(r)?r({$list:e}):r:"",_defineProperty(_defineProperty({},"size--".concat(s),s),"is--loading",a)]},[t("div",{ref:"refVirtualWrapper",class:"vxe-list--virtual-wrapper",style:c,on:{scroll:e.scrollEvent}},[t("div",{class:"vxe-list--y-space",style:{height:l?"".concat(l,"px"):""}}),t("div",{ref:"refVirtualBody",class:"vxe-list--body",style:{marginTop:o?"".concat(o,"px"):""}},n?e.callSlot(n,{items:i},t):[])]),t(_loading.default,{class:"vxe-list--loading",props:{value:a}})])}},watch:{data:function(){this.loadData(this.data||[])},height:function(){this.recalculate()},maxHeight:function(){this.recalculate()},syncResize:function(t){var e=this;t&&(e.recalculate(),e.$nextTick(function(){return setTimeout(function(){return e.recalculate()})}))}},created:function(){this.loadData(this.data||[])},mounted:function(){var t,e=this,i=e,r=e.internalData;e.recalculate(),i.autoResize&&(i=e.$refs.refElem,(t=_ui.globalResize.create(function(){return e.recalculate()})).observe(i),i&&t.observe(i.parentElement),r.resizeObserver=t),_ui.globalEvents.on(e,"resize",e.recalculate)},activated:function(){var t=this;t.recalculate().then(function(){return t.refreshScroll()})},beforeDestroy:function(){var t=this.internalData.resizeObserver;t&&t.disconnect(),_ui.globalEvents.off(this,"resize")},render:function(t){return this.renderVN(t)}});