vxe-table 4.7.63 → 4.7.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.umd.js CHANGED
@@ -1951,9 +1951,9 @@ function eqEmptyValue(cellValue) {
1951
1951
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
1952
1952
 
1953
1953
 
1954
- const version = "4.7.63";
1954
+ const version = "4.7.64";
1955
1955
  core_.VxeUI.version = version;
1956
- core_.VxeUI.tableVersion = "4.7.63";
1956
+ core_.VxeUI.tableVersion = "4.7.64";
1957
1957
  core_.VxeUI.setConfig({
1958
1958
  emptyCell: ' ',
1959
1959
  table: {
@@ -2332,7 +2332,7 @@ var es_array_push = __webpack_require__(4114);
2332
2332
  const {
2333
2333
  log: log_log
2334
2334
  } = core_.VxeUI;
2335
- const log_version = `table v${"4.7.63"}`;
2335
+ const log_version = `table v${"4.7.64"}`;
2336
2336
  const warnLog = log_log.create('warn', log_version);
2337
2337
  const errLog = log_log.create('error', log_version);
2338
2338
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -8345,6 +8345,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
8345
8345
  resizeList: [],
8346
8346
  pxList: [],
8347
8347
  pxMinList: [],
8348
+ autoMinList: [],
8348
8349
  scaleList: [],
8349
8350
  scaleMinList: [],
8350
8351
  autoList: [],
@@ -8712,7 +8713,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
8712
8713
  const {
8713
8714
  visibleColumn
8714
8715
  } = internalData;
8715
- return visibleColumn.filter(column => column.width === 'auto');
8716
+ const {
8717
+ tableColumn
8718
+ } = reactData;
8719
+ return tableColumn.length || visibleColumn.length ? visibleColumn.filter(column => column.width === 'auto' || column.minWidth === 'auto') : [];
8716
8720
  });
8717
8721
  const computeFixedColumnSize = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
8718
8722
  const {
@@ -9350,11 +9354,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
9350
9354
  const cellStyle = getComputedStyle(firstCellEl);
9351
9355
  paddingSize = Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingLeft) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingRight)) + 2;
9352
9356
  }
9353
- let colWidth = column.renderAutoWidth - paddingSize + 2;
9357
+ let colWidth = column.renderAutoWidth - paddingSize;
9354
9358
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(cellElList, cellEl => {
9355
9359
  const labelEl = cellEl.firstChild;
9356
9360
  if (labelEl) {
9357
- colWidth = Math.max(colWidth, labelEl.offsetWidth);
9361
+ colWidth = Math.max(colWidth, Math.ceil(labelEl.offsetWidth) + 4);
9358
9362
  }
9359
9363
  });
9360
9364
  column.renderAutoWidth = colWidth + paddingSize;
@@ -9394,6 +9398,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
9394
9398
  const {
9395
9399
  resizeList,
9396
9400
  pxMinList,
9401
+ autoMinList,
9397
9402
  pxList,
9398
9403
  scaleList,
9399
9404
  scaleMinList,
@@ -9406,6 +9411,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
9406
9411
  tableWidth += minWidth;
9407
9412
  column.renderWidth = minWidth;
9408
9413
  });
9414
+ // 最小自适应
9415
+ autoMinList.forEach(column => {
9416
+ const scaleWidth = Math.max(60, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.renderAutoWidth));
9417
+ tableWidth += scaleWidth;
9418
+ column.renderWidth = scaleWidth;
9419
+ });
9409
9420
  // 最小百分比
9410
9421
  scaleMinList.forEach(column => {
9411
9422
  const scaleWidth = Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.minWidth) * meanWidth);
@@ -9437,10 +9448,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
9437
9448
  column.renderWidth = width;
9438
9449
  });
9439
9450
  remainWidth -= tableWidth;
9440
- meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + remainList.length)) : 0;
9451
+ meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoMinList.length + remainList.length)) : 0;
9441
9452
  if (fit) {
9442
9453
  if (remainWidth > 0) {
9443
- scaleMinList.concat(pxMinList).forEach(column => {
9454
+ scaleMinList.concat(pxMinList).concat(autoMinList).forEach(column => {
9444
9455
  tableWidth += meanWidth;
9445
9456
  column.renderWidth += meanWidth;
9446
9457
  });
@@ -9459,7 +9470,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
9459
9470
  * 偏移量算法
9460
9471
  * 如果所有列足够放的情况下,从最后动态列开始分配
9461
9472
  */
9462
- const dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(remainList);
9473
+ const dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList);
9463
9474
  let dynamicSize = dynamicList.length - 1;
9464
9475
  if (dynamicSize > 0) {
9465
9476
  let odiffer = bodyWidth - tableWidth;
@@ -14510,6 +14521,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14510
14521
  const resizeList = [];
14511
14522
  const pxList = [];
14512
14523
  const pxMinList = [];
14524
+ const autoMinList = [];
14513
14525
  const scaleList = [];
14514
14526
  const scaleMinList = [];
14515
14527
  const autoList = [];
@@ -14532,6 +14544,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14532
14544
  scaleList.push(column);
14533
14545
  } else if (isPx(column.minWidth)) {
14534
14546
  pxMinList.push(column);
14547
+ } else if (column.minWidth === 'auto') {
14548
+ autoMinList.push(column);
14535
14549
  } else if (isScale(column.minWidth)) {
14536
14550
  scaleMinList.push(column);
14537
14551
  } else {
@@ -14543,6 +14557,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14543
14557
  resizeList,
14544
14558
  pxList,
14545
14559
  pxMinList,
14560
+ autoMinList,
14546
14561
  scaleList,
14547
14562
  scaleMinList,
14548
14563
  autoList,