bkui-vue 2.1.0-dev-beta.1 → 2.1.0-dev-beta.2

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.js CHANGED
@@ -3,5 +3,5 @@ export * from './hooks';
3
3
  export { default } from './preset';
4
4
  export * from './config-provider';
5
5
  export * from './directives';
6
- export const version = "2.1.0-dev-beta.1";
6
+ export const version = "2.1.0-dev-beta.2";
7
7
  window.__bkui_vue_version__ = version;
@@ -8748,8 +8748,11 @@ function use_render_isSlot(s) {
8748
8748
  var getRowRender = function getRowRender(row, rowIndex, preRow, rowList, rowSpanMap, needRowSpan) {
8749
8749
  var isChild = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
8750
8750
  var rowLength = rowList.length;
8751
- var rowStyle = [].concat(_toConsumableArray(_formatPropAsArray(props.rowStyle, [row, rowIndex])), [{
8752
- '--row-height': "".concat(getRowHeight(row, rowIndex), "px")
8751
+ var rowHeightPx = "".concat(getRowHeight(row, rowIndex), "px");
8752
+ var rowStyle = [].concat(_toConsumableArray(_formatPropAsArray(props.rowStyle, [row, rowIndex])), [props.rowHeight === 'auto' ? {
8753
+ '--row-min-height': rowHeightPx
8754
+ } : {
8755
+ '--row-height': rowHeightPx
8753
8756
  }]);
8754
8757
  var rowClass = [].concat(_toConsumableArray(_formatPropAsArray(props.rowClass, [row, rowIndex])), ["hover-".concat(props.rowHover), rowIndex % 2 === 1 && props.stripe ? 'stripe-row' : '', props.rowHeight === 'auto' ? 'row-height-auto' : '']);
8755
8758
  var rowId = rows.getRowAttribute(row, const_TABLE_ROW_ATTRIBUTE.ROW_UID);
@@ -9742,6 +9745,9 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
9742
9745
  }
9743
9746
  return (_refBody$value = refBody.value) === null || _refBody$value === void 0 ? void 0 : _refBody$value.scrollTo.apply(_refBody$value, args);
9744
9747
  };
9748
+ if (props.rowHeight === 'auto' && props.virtualEnabled) {
9749
+ console.warn('[BkTable] rowHeight="auto" 与 virtualEnabled 不兼容:虚拟滚动依赖固定行高计算,auto 模式下行高由内容决定,滚动位置将不准确。请勿同时使用。');
9750
+ }
9745
9751
  if (typeof props.rowHeight === 'function') {
9746
9752
  setLineHeight(function (args) {
9747
9753
  return rows.getRowHeight(args.rows[0], args.index);
@@ -9899,14 +9905,22 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
9899
9905
  * 滚动容器 (.bk-table-body) 内包含:
9900
9906
  * 1. 表头 — 由 showHead 控制是否展示,高度 = headHeight(受 headHeight/thead props) × headerRowCount(多级表头)
9901
9907
  * 2. 数据行 — 高度 = 各行行高之和(受 rowHeight prop 和行数据影响)
9908
+ *
9909
+ * rowHeight='auto' 时每行 schema 存储的是估算值(LINE_HEIGHT=42),
9910
+ * 不反映实际渲染高度,故改为从 DOM 读取 scrollHeight 获得真实内容高度。
9902
9911
  */
9903
9912
  var getScrollContentHeight = function getScrollContentHeight() {
9913
+ var _refBody$value3;
9914
+ var scrollEl = (_refBody$value3 = refBody.value) === null || _refBody$value3 === void 0 ? void 0 : _refBody$value3.refRoot;
9915
+ if (props.rowHeight === 'auto') {
9916
+ if (scrollEl && scrollEl.scrollHeight > 0) {
9917
+ return scrollEl.scrollHeight;
9918
+ }
9919
+ }
9904
9920
  var rowsHeight = rows.getCurrentPageRowsHeight();
9905
9921
  var scrollHeaderHeight = props.showHead ? headHeight.value : 0;
9906
9922
  var calculatedHeight = rowsHeight + scrollHeaderHeight;
9907
9923
  if (rows.pageRowList.length === 0) {
9908
- var _refBody$value3;
9909
- var scrollEl = (_refBody$value3 = refBody.value) === null || _refBody$value3 === void 0 ? void 0 : _refBody$value3.refRoot;
9910
9924
  if (scrollEl && scrollEl.scrollHeight > calculatedHeight) {
9911
9925
  return scrollEl.scrollHeight;
9912
9926
  }
@@ -1449,14 +1449,18 @@
1449
1449
  .bk-table .bk-table-head table tbody tr.row-height-auto td,
1450
1450
  .bk-table .bk-table-body table tbody tr.row-height-auto td {
1451
1451
  height: auto !important;
1452
- min-height: var(--row-height);
1452
+ min-height: var(--row-min-height, 42px);
1453
1453
  }
1454
1454
  .bk-table .bk-table-head table tbody tr.row-height-auto td .cell,
1455
1455
  .bk-table .bk-table-body table tbody tr.row-height-auto td .cell {
1456
1456
  display: flex;
1457
1457
  align-items: center;
1458
1458
  height: auto;
1459
- min-height: calc(var(--row-height) - 4px);
1459
+ min-height: calc(var(--row-min-height, 42px) - 4px);
1460
+ white-space: normal;
1461
+ overflow: visible;
1462
+ text-overflow: unset;
1463
+ word-break: break-word;
1460
1464
  line-height: normal;
1461
1465
  }
1462
1466
  .bk-table .bk-table-head table tbody tr:hover.hover-highlight td:not(.empty-cell),
@@ -406,14 +406,20 @@
406
406
  &.row-height-auto {
407
407
  td {
408
408
  // 覆盖全局 th, td { height: var(--row-height) },让内容撑起行高
409
+ // auto 模式使用独立的 --row-min-height 变量,语义上明确表示最小高度而非固定高度
409
410
  height: auto !important;
410
- min-height: var(--row-height);
411
+ min-height: var(--row-min-height, 42px);
411
412
 
412
413
  .cell {
413
414
  display: flex;
414
415
  align-items: center;
415
416
  height: auto;
416
- min-height: calc(var(--row-height) - 4px);
417
+ min-height: calc(var(--row-min-height, 42px) - 4px);
418
+ // 允许文字换行,覆盖全局 white-space: nowrap / overflow: hidden / text-overflow: ellipsis
419
+ white-space: normal;
420
+ overflow: visible;
421
+ text-overflow: unset;
422
+ word-break: break-word;
417
423
  line-height: normal;
418
424
  }
419
425
  }
@@ -1580,14 +1580,18 @@
1580
1580
  .bk-table .bk-table-head table tbody tr.row-height-auto td,
1581
1581
  .bk-table .bk-table-body table tbody tr.row-height-auto td {
1582
1582
  height: auto !important;
1583
- min-height: var(--row-height);
1583
+ min-height: var(--row-min-height, 42px);
1584
1584
  }
1585
1585
  .bk-table .bk-table-head table tbody tr.row-height-auto td .cell,
1586
1586
  .bk-table .bk-table-body table tbody tr.row-height-auto td .cell {
1587
1587
  display: flex;
1588
1588
  align-items: center;
1589
1589
  height: auto;
1590
- min-height: calc(var(--row-height) - 4px);
1590
+ min-height: calc(var(--row-min-height, 42px) - 4px);
1591
+ white-space: normal;
1592
+ overflow: visible;
1593
+ text-overflow: unset;
1594
+ word-break: break-word;
1591
1595
  line-height: normal;
1592
1596
  }
1593
1597
  .bk-table .bk-table-head table tbody tr:hover.hover-highlight td:not(.empty-cell),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "2.1.0-dev-beta.1",
3
+ "version": "2.1.0-dev-beta.2",
4
4
  "workspaces": [
5
5
  "packages/**",
6
6
  "scripts/cli",