vxe-table 4.23.0-beta.0 → 4.23.0-beta.1

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/dist/all.esm.js CHANGED
@@ -56,7 +56,7 @@ function getDefaultConfig(val1, def1) {
56
56
  return XEUtils.eqNull(val1) ? def1 : val1;
57
57
  }
58
58
 
59
- const version = "4.23.0-beta.0";
59
+ const version = "4.23.0-beta.1";
60
60
  VxeUI.version = version;
61
61
  VxeUI.tableVersion = version;
62
62
  VxeUI.setConfig({
@@ -318,16 +318,14 @@ VxeUI.setConfig({
318
318
  oSize: 0
319
319
  },
320
320
  scrollbarConfig: {
321
- // width: 14,
322
- // height: 14,
323
- x: {
324
- // position: 'bottom',
325
- visible: true
326
- },
327
- y: {
328
- // position: 'right',
329
- visible: true
330
- }
321
+ // xConfig: {
322
+ // // position: 'bottom',
323
+ // // visible: true
324
+ // },
325
+ // yConfig: {
326
+ // // position: 'right',
327
+ // // visible: true
328
+ // }
331
329
  },
332
330
  undoRedoHistoryConfig: {
333
331
  stackSize: 50
@@ -940,7 +938,7 @@ function getPopupWrapperElement(panelElem) {
940
938
  }
941
939
 
942
940
  const { log } = VxeUI;
943
- const tableVersion = `table v${"4.23.0-beta.0"}`;
941
+ const tableVersion = `table v${"4.23.0-beta.1"}`;
944
942
  function createComponentLog(name) {
945
943
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
946
944
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -4075,6 +4073,10 @@ const tableProps = {
4075
4073
  virtualXConfig: Object,
4076
4074
  // 纵向虚拟滚动配置项
4077
4075
  virtualYConfig: Object,
4076
+ useScrollbar: {
4077
+ type: Boolean,
4078
+ default: () => getConfig$7().table.useScrollbar
4079
+ },
4078
4080
  // 滚动条配置项
4079
4081
  scrollbarConfig: Object,
4080
4082
  // 撤销/恢复历史配置项
@@ -15989,6 +15991,7 @@ var VxeTableComponent = defineVxeComponent({
15989
15991
  const { slots, emit } = context;
15990
15992
  const xID = XEUtils.uniqueId();
15991
15993
  const browseObj = XEUtils.browse();
15994
+ const scrollDefaultConf = Object.assign({}, getConfig$2().scrollbar);
15992
15995
  // 使用已安装的组件,如果未安装则不渲染
15993
15996
  const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading');
15994
15997
  const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
@@ -16131,14 +16134,12 @@ var VxeTableComponent = defineVxeComponent({
16131
16134
  return Object.assign({}, getConfig$2().table.scrollbarConfig, props.scrollbarConfig);
16132
16135
  });
16133
16136
  const computeScrollbarXOpts = computed(() => {
16134
- var _a;
16135
16137
  const scrollbarOpts = computeScrollbarOpts.value;
16136
- return Object.assign({}, scrollbarOpts.x, ((_a = props.scrollbarConfig) === null || _a === void 0 ? void 0 : _a.x) || {});
16138
+ return scrollbarOpts.x ? Object.assign({}, scrollbarOpts.x, scrollbarOpts.xConfig) : (scrollbarOpts.xConfig || {});
16137
16139
  });
16138
16140
  const computeScrollbarYOpts = computed(() => {
16139
- var _a;
16140
16141
  const scrollbarOpts = computeScrollbarOpts.value;
16141
- return Object.assign({}, scrollbarOpts.y, ((_a = props.scrollbarConfig) === null || _a === void 0 ? void 0 : _a.y) || {});
16142
+ return scrollbarOpts.y ? Object.assign({}, scrollbarOpts.y, scrollbarOpts.yConfig) : (scrollbarOpts.yConfig || {});
16142
16143
  });
16143
16144
  const computeScrollbarXToTop = computed(() => {
16144
16145
  const scrollbarXOpts = computeScrollbarXOpts.value;
@@ -16477,15 +16478,18 @@ var VxeTableComponent = defineVxeComponent({
16477
16478
  });
16478
16479
  const computeTableStyle = computed(() => {
16479
16480
  const scrollbarOpts = computeScrollbarOpts.value;
16480
- const { width, height } = scrollbarOpts;
16481
- const tStys = {};
16482
- if (width) {
16483
- tStys['--vxe-ui-table-view-scrollbar-width'] = toCssUnit(width);
16484
- }
16485
- if (height) {
16486
- tStys['--vxe-ui-table-view-scrollbar-height'] = toCssUnit(height);
16481
+ const scrollbarXOpts = computeScrollbarXOpts.value;
16482
+ const scrollbarYOpts = computeScrollbarYOpts.value;
16483
+ const barWidth = getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width);
16484
+ const barHeight = getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height);
16485
+ const stys = {};
16486
+ if (barWidth || barHeight) {
16487
+ stys['--vxe-ui-table-view-scrollbar-width'] = toCssUnit(barWidth || barHeight);
16488
+ stys['--vxe-ui-scrollbar-y-width'] = toCssUnit(barWidth || barHeight);
16489
+ stys['--vxe-ui-table-view-scrollbar-height'] = toCssUnit(barHeight || barWidth);
16490
+ stys['--vxe-ui-scrollbar-x-height'] = toCssUnit(barHeight || barWidth);
16487
16491
  }
16488
- return tStys;
16492
+ return stys;
16489
16493
  });
16490
16494
  const computeTableRowExpandedList = computed(() => {
16491
16495
  const { tableData, rowExpandedFlag, expandColumn, rowGroupExpandedFlag, treeExpandedFlag } = reactData;
@@ -18391,7 +18395,6 @@ var VxeTableComponent = defineVxeComponent({
18391
18395
  const isHeaderRenderOptimize = computeIsHeaderRenderOptimize.value;
18392
18396
  const isBodyRenderOptimize = computeIsBodyRenderOptimize.value;
18393
18397
  const isFooterRenderOptimize = computeIsFooterRenderOptimize.value;
18394
- const scrollbarOpts = computeScrollbarOpts.value;
18395
18398
  const mouseOpts = computeMouseOpts.value;
18396
18399
  const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
18397
18400
  const bodyTableElem = getRefElem(elemStore['main-body-table']);
@@ -18399,24 +18402,26 @@ var VxeTableComponent = defineVxeComponent({
18399
18402
  emptyPlaceholderElem.style.top = `${tHeaderHeight}px`;
18400
18403
  emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
18401
18404
  }
18402
- const scrollbarXConf = scrollbarOpts.x || {};
18403
- const scrollbarYConf = scrollbarOpts.y || {};
18405
+ const scrollbarXOpts = computeScrollbarXOpts.value;
18406
+ const scrollbarYOpts = computeScrollbarYOpts.value;
18404
18407
  const scrollbarYToLeft = computeScrollbarYToLeft.value;
18405
18408
  let xScrollbarVisible = overflowX ? 'visible' : 'hidden';
18406
- if (scrollbarXConf.visible === 'visible' || $xeGanttView) {
18409
+ const hideXScroll = scrollbarXOpts.visible === false || scrollbarXOpts.visible === 'hidden';
18410
+ if (!hideXScroll || $xeGanttView) {
18407
18411
  osbHeight = scrollbarHeight;
18408
18412
  xScrollbarVisible = 'visible';
18409
18413
  }
18410
- else if (scrollbarXConf.visible === 'hidden' || scrollbarXConf.visible === false) {
18414
+ else if (hideXScroll) {
18411
18415
  osbHeight = 0;
18412
18416
  xScrollbarVisible = 'hidden';
18413
18417
  }
18414
18418
  let yScrollbarVisible = overflowY ? 'visible' : 'hidden';
18415
- if ((scrollbarYConf.visible === 'hidden' || scrollbarYConf.visible === false) || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
18419
+ const showYScroll = !(scrollbarYOpts.visible === false || scrollbarYOpts.visible === 'hidden');
18420
+ if (!showYScroll || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
18416
18421
  osbWidth = 0;
18417
18422
  yScrollbarVisible = 'hidden';
18418
18423
  }
18419
- else if (scrollbarYConf.visible === 'visible') {
18424
+ else if (showYScroll) {
18420
18425
  osbWidth = scrollbarWidth;
18421
18426
  yScrollbarVisible = 'visible';
18422
18427
  }
@@ -19237,14 +19242,18 @@ var VxeTableComponent = defineVxeComponent({
19237
19242
  let overflowY = false;
19238
19243
  let overflowX = false;
19239
19244
  if (bodyWrapperElem) {
19245
+ const scrollbarXOpts = computeScrollbarXOpts.value;
19246
+ const scrollbarYOpts = computeScrollbarYOpts.value;
19247
+ const barWidth = XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width));
19248
+ const barHeight = XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height));
19240
19249
  overflowY = scrollYHeight > bodyWrapperElem.clientHeight;
19241
19250
  if (yHandleEl) {
19242
- reactData.scrollbarWidth = scrollbarOpts.width || (yHandleEl.offsetWidth - yHandleEl.clientWidth) || 14;
19251
+ reactData.scrollbarWidth = (barWidth || barHeight) || (yHandleEl.offsetWidth - yHandleEl.clientWidth) || 14;
19243
19252
  }
19244
19253
  reactData.overflowY = overflowY;
19245
19254
  overflowX = scrollXWidth > bodyWrapperElem.clientWidth;
19246
19255
  if (xHandleEl) {
19247
- reactData.scrollbarHeight = scrollbarOpts.height || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14;
19256
+ reactData.scrollbarHeight = (barHeight || barWidth) || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14;
19248
19257
  }
19249
19258
  const hHeight = headerTableElem ? headerTableElem.clientHeight : 0;
19250
19259
  const fHeight = footerTableElem ? footerTableElem.clientHeight : 0;
@@ -28792,14 +28801,14 @@ var VxeTableComponent = defineVxeComponent({
28792
28801
  const isRollY = overflowY && scrollTop !== lastScrollTop;
28793
28802
  if (isRollX) {
28794
28803
  // 如果禁用滚动
28795
- if (scrollbarXOpts.visible === 'hidden') {
28804
+ if (scrollbarXOpts.visible === false || scrollbarXOpts.visible === 'hidden') {
28796
28805
  evnt.preventDefault();
28797
28806
  return;
28798
28807
  }
28799
28808
  }
28800
28809
  if (isRollY) {
28801
28810
  // 如果禁用滚动
28802
- if (scrollbarYOpts.visible === 'hidden') {
28811
+ if (scrollbarYOpts.visible === false || scrollbarYOpts.visible === 'hidden') {
28803
28812
  evnt.preventDefault();
28804
28813
  return;
28805
28814
  }
@@ -29396,10 +29405,15 @@ var VxeTableComponent = defineVxeComponent({
29396
29405
  const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior;
29397
29406
  return h('div', {
29398
29407
  ref: isFixedLeft ? refLeftContainer : refRightContainer,
29399
- class: [`vxe-table--fixed-${fixedType}-wrapper`, `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`, {
29408
+ class: [
29409
+ `vxe-table--fixed-${fixedType}-wrapper`,
29410
+ `sx--${(scrollbarXOpts.visible === false || scrollbarXOpts.visible === 'hidden') ? 'hidden' : 'visible'}`,
29411
+ `sy--${(scrollbarYOpts.visible === false || scrollbarYOpts.visible === 'hidden') ? 'hidden' : 'visible'}`,
29412
+ {
29400
29413
  [`x-ob--${osXBehavior}`]: osXBehavior,
29401
29414
  [`y-ob--${osYBehavior}`]: osYBehavior
29402
- }]
29415
+ }
29416
+ ]
29403
29417
  }, [
29404
29418
  showHeader
29405
29419
  ? h(TableHeaderComponent, {
@@ -29708,7 +29722,11 @@ var VxeTableComponent = defineVxeComponent({
29708
29722
  }]
29709
29723
  }, [
29710
29724
  h('div', {
29711
- class: ['vxe-table--main-wrapper', `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`]
29725
+ class: [
29726
+ 'vxe-table--main-wrapper',
29727
+ `sx--${(scrollbarXOpts.visible === false || scrollbarXOpts.visible === 'hidden') ? 'hidden' : 'visible'}`,
29728
+ `sy--${(scrollbarYOpts.visible === false || scrollbarYOpts.visible === 'hidden') ? 'hidden' : 'visible'}`
29729
+ ]
29712
29730
  }, [
29713
29731
  /**
29714
29732
  * 表头
@@ -29764,7 +29782,7 @@ var VxeTableComponent = defineVxeComponent({
29764
29782
  ]);
29765
29783
  };
29766
29784
  const renderVN = () => {
29767
- const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules, importConfig, exportConfig, printConfig } = props;
29785
+ const { loading, stripe, useScrollbar, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules, importConfig, exportConfig, printConfig } = props;
29768
29786
  const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore, tooltipStore } = reactData;
29769
29787
  const { teleportToWrapperElem, popupToWrapperElem, customPopupToElem } = internalData;
29770
29788
  const { leftList, rightList } = columnStore;
@@ -29807,7 +29825,7 @@ var VxeTableComponent = defineVxeComponent({
29807
29825
  if (isCrossTableDrag && !tableData.length) {
29808
29826
  tbOns.onDragover = $xeTable.handleCrossTableRowDragoverEmptyEvent;
29809
29827
  }
29810
- return h('div', Object.assign({ ref: refElem, class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
29828
+ return h('div', Object.assign({ ref: refElem, class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, useScrollbar ? 'is--virtual-scrollbar' : 'is--native-scrollbar', `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
29811
29829
  [`size--${vSize}`]: vSize,
29812
29830
  [`valid-msg--${validOpts.msgMode}`]: !!editRules,
29813
29831
  'vxe-editable': !!editConfig,
@@ -30398,6 +30416,7 @@ var VxeTableComponent = defineVxeComponent({
30398
30416
  const areaOpts = computeAreaOpts.value;
30399
30417
  const sortOpts = computeSortOpts.value;
30400
30418
  const filterOpts = computeFilterOpts.value;
30419
+ const scrollbarOpts = computeScrollbarOpts.value;
30401
30420
  const { groupFields } = aggregateOpts;
30402
30421
  if ($xeGantt) {
30403
30422
  const { refClassifyWrapperElem } = $xeGantt.getRefMaps();
@@ -30629,6 +30648,12 @@ var VxeTableComponent = defineVxeComponent({
30629
30648
  // if (hasEnableConf(printConfig, printOpts) || hasEnableConf(importConfig, importOpts) || hasEnableConf(exportConfig, exportOpts)) && !$xeTable.exportData) {
30630
30649
  // errLog('vxe.error.reqModule', ['Export'])
30631
30650
  // }
30651
+ if (scrollbarOpts.x) {
30652
+ warnLog$2('vxe.error.delProp', ['scrollbar-config.x', 'scrollbar-config.xConfig']);
30653
+ }
30654
+ if (scrollbarOpts.y) {
30655
+ warnLog$2('vxe.error.delProp', ['scrollbar-config.y', 'scrollbar-config.yConfig']);
30656
+ }
30632
30657
  Object.assign(scrollYStore, {
30633
30658
  startIndex: 0,
30634
30659
  endIndex: 0,