bkui-vue 2.0.1-beta.15.table.3 → 2.0.1-beta.15.table.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/lib/index.js CHANGED
@@ -4,5 +4,5 @@ export { default } from './preset';
4
4
  export * from './config-provider';
5
5
  export * from './directives';
6
6
  export * as plugins from './plugins';
7
- export const version = "2.0.1-beta.15.table.3";
7
+ export const version = "2.0.1-beta.15.table.5";
8
8
  window.__bkui_vue_version__ = version;
@@ -929,7 +929,6 @@ var BkScrollbarCore = /*#__PURE__*/function () {
929
929
  value: function initListeners() {
930
930
  var _this$mouseWheelInsta,
931
931
  _this2 = this;
932
- console.log('initListeners');
933
932
  var elWindow = scrollbar_core_getElementWindow(this.el);
934
933
  // Event listeners
935
934
  (_this$mouseWheelInsta = this.mouseWheelInstance) === null || _this$mouseWheelInsta === void 0 || _this$mouseWheelInsta.addWheelEvent(this.el);
@@ -995,8 +994,8 @@ var BkScrollbarCore = /*#__PURE__*/function () {
995
994
  var wrapperOffsetHeight = this.wrapperEl.offsetHeight;
996
995
  var wrapperScrollHeight = this.getWrapperElScrollSize('scrollHeight'); // this.wrapperEl.scrollHeight;
997
996
  var wrapperScrollWidth = this.getWrapperElScrollSize('scrollWidth'); // this.wrapperEl.scrollWidth;
998
- this.axis.x.isOverflowing = wrapperOffsetWidth !== 0 && wrapperScrollWidth > wrapperOffsetWidth;
999
- this.axis.y.isOverflowing = wrapperScrollHeight > wrapperOffsetHeight;
997
+ this.axis.x.isOverflowing = wrapperOffsetWidth !== 0 && wrapperScrollWidth - wrapperOffsetWidth > 2;
998
+ this.axis.y.isOverflowing = wrapperScrollHeight - wrapperOffsetHeight > 2;
1000
999
  this.axis.x.forceVisible = this.options.forceVisible === 'x' || this.options.forceVisible === true;
1001
1000
  this.axis.y.forceVisible = this.options.forceVisible === 'y' || this.options.forceVisible === true;
1002
1001
  // Set isOverflowing to false if scrollbar is not necessary (content is shorter than offset)
@@ -113,6 +113,7 @@ declare const _default: import("vue").DefineComponent<{
113
113
  showOverflowTooltip?: boolean | {
114
114
  content: string | ((col: import("../props").Column, row: any) => string);
115
115
  disabled?: boolean | ((col: import("../props").Column, row: any) => boolean);
116
+ allowHtml?: boolean;
116
117
  watchCellResize?: boolean;
117
118
  mode?: "auto" | "static";
118
119
  popoverOption?: any;
@@ -1,5 +1,7 @@
1
1
  import { UseColumns } from './use-columns';
2
- declare const _default: (columns: UseColumns) => {
2
+ declare const _default: (columns: UseColumns, { afterResize }: {
3
+ afterResize: any;
4
+ }) => {
3
5
  dragOffsetX: import("vue").Ref<number>;
4
6
  };
5
7
  export default _default;
@@ -6,7 +6,7 @@ declare const useColumns: (props: TablePropTypes) => {
6
6
  headHeight: import("vue").ComputedRef<number>;
7
7
  tableColumnSchema: WeakMap<object, any> & Omit<WeakMap<object, any>, keyof WeakMap<any, any>>;
8
8
  tableColumnList: any[];
9
- visibleColumns: any[];
9
+ visibleColumns: Column[];
10
10
  debounceUpdateColumns: import("lodash").DebouncedFunc<(columns: any) => void>;
11
11
  sortColumns: any[];
12
12
  filterColumns: any[];
@@ -32,6 +32,7 @@ declare const useColumns: (props: TablePropTypes) => {
32
32
  getColumnRect: (column: Column) => any;
33
33
  getColumnCustomClass: (column: any, row?: any) => any;
34
34
  getColumnRefAttribute: (col: Column | IEmptyObject, attributeName: string) => any;
35
+ getColumnCalcWidth: (column: Column) => any;
35
36
  resolveEventListener: (col: Column) => any;
36
37
  setColumnIsHidden: (column: Column, value?: boolean) => void;
37
38
  setColumnResizeWidth: (column: Column, value: number) => void;
@@ -48,6 +49,7 @@ declare const useColumns: (props: TablePropTypes) => {
48
49
  height?: number;
49
50
  }) => void;
50
51
  setVisibleColumns: () => void;
52
+ resolveColsCalcWidth: (width: number) => void;
51
53
  };
52
54
  export type UseColumns = ReturnType<typeof useColumns>;
53
55
  export default useColumns;
@@ -1,7 +1,7 @@
1
1
  import { SetupContext } from 'vue';
2
2
  import { TablePropTypes } from '../props';
3
3
  import { UseColumns } from './use-columns';
4
- declare const useSettings: (props: TablePropTypes, ctx: SetupContext, columns: UseColumns) => {
4
+ declare const useSettings: (props: TablePropTypes, ctx: SetupContext, columns: UseColumns, afterSetting: any) => {
5
5
  options: {
6
6
  fields: any[];
7
7
  checked: any[];
@@ -896,6 +896,7 @@ declare const BkTable: {
896
896
  showOverflowTooltip?: boolean | {
897
897
  content: string | ((col: import("./props").Column, row: any) => string);
898
898
  disabled?: boolean | ((col: import("./props").Column, row: any) => boolean);
899
+ allowHtml?: boolean;
899
900
  watchCellResize?: boolean;
900
901
  mode?: "auto" | "static";
901
902
  popoverOption?: any;
@@ -17324,7 +17324,7 @@ const shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODUL
17324
17324
  ;// CONCATENATED MODULE: external "vue"
17325
17325
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
17326
17326
  var external_vue_y = x => () => x
17327
- const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentInstance"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isRef, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["onUpdated"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUpdated, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
17327
+ const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentInstance"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isRef, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
17328
17328
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
17329
17329
  function typeof_typeof(o) {
17330
17330
  "@babel/helpers - typeof";
@@ -17685,16 +17685,16 @@ var tableProps = {
17685
17685
  * 默认:auto 根据行数自动填充高度
17686
17686
  * 100%,依赖初始化时父级容器高度
17687
17687
  */
17688
- height: StringNumberType('100%'),
17688
+ height: StringNumberType('auto'),
17689
17689
  /**
17690
17690
  * 是否为斑马纹 Table
17691
17691
  */
17692
17692
  stripe: shared_namespaceObject.PropTypes.bool.def(false),
17693
17693
  /**
17694
17694
  * 设置表格最小高度
17695
- * 默认:300
17695
+ * 默认:LINE_HEIGHT * 4
17696
17696
  */
17697
- minHeight: StringNumberType(LINE_HEIGHT * 2),
17697
+ minHeight: StringNumberType(LINE_HEIGHT * 4),
17698
17698
  /**
17699
17699
  * 设置表格最d大高度
17700
17700
  * 默认:auto,依赖外层高度
@@ -17963,11 +17963,13 @@ var TableColumnProp = {
17963
17963
  var column = (0,external_vue_namespaceObject.reactive)(Object.assign({}, props, {
17964
17964
  field: props.prop || props.field
17965
17965
  }));
17966
- (0,external_vue_namespaceObject.onMounted)(function () {
17967
- initTableColumns();
17968
- });
17969
- (0,external_vue_namespaceObject.onUpdated)(function () {
17966
+ (0,external_vue_namespaceObject.watch)(function () {
17967
+ return [props];
17968
+ }, function () {
17970
17969
  initTableColumns();
17970
+ }, {
17971
+ immediate: true,
17972
+ deep: true
17971
17973
  });
17972
17974
  (0,external_vue_namespaceObject.onUnmounted)(function () {
17973
17975
  initTableColumns();
@@ -18116,7 +18118,8 @@ const isElement_namespaceObject = isElement_x({ ["default"]: () => __WEBPACK_EXT
18116
18118
 
18117
18119
 
18118
18120
 
18119
- /* harmony default export */ const use_column_resize = (function (columns) {
18121
+ /* harmony default export */ const use_column_resize = (function (columns, _ref) {
18122
+ var afterResize = _ref.afterResize;
18120
18123
  var getColumnAttribute = columns.getColumnAttribute,
18121
18124
  getColumnOrderWidth = columns.getColumnOrderWidth,
18122
18125
  setColumnAttribute = columns.setColumnAttribute;
@@ -18152,12 +18155,15 @@ const isElement_namespaceObject = isElement_x({ ["default"]: () => __WEBPACK_EXT
18152
18155
  var diff = e.clientX - startX;
18153
18156
  var resolveWidth = getColumnOrderWidth(dragColumn, ORDER_LIST) + diff;
18154
18157
  var minWidth = getColumnOrderWidth(dragColumn, [COLUMN_ATTRIBUTE.COL_MIN_WIDTH]);
18155
- setColumnAttribute(dragColumn, COLUMN_ATTRIBUTE.RESIZE_WIDTH, resolveWidth > minWidth ? resolveWidth : minWidth);
18158
+ var calcWidth = resolveWidth > minWidth ? resolveWidth : minWidth;
18159
+ setColumnAttribute(dragColumn, COLUMN_ATTRIBUTE.RESIZE_WIDTH, calcWidth);
18160
+ setColumnAttribute(dragColumn, COLUMN_ATTRIBUTE.CALC_WIDTH, calcWidth);
18156
18161
  document.removeEventListener('mouseup', handleMouseUp);
18157
18162
  document.removeEventListener('mousemove', handleMouseMove);
18158
18163
  startX = 0;
18159
18164
  dragOffsetX.value = -1000;
18160
18165
  dragColumn = null;
18166
+ afterResize === null || afterResize === void 0 || afterResize();
18161
18167
  };
18162
18168
  var updateOffsetX = function updateOffsetX(e) {
18163
18169
  return (0,shared_namespaceObject.throttle)(function () {
@@ -18177,13 +18183,8 @@ const isElement_namespaceObject = isElement_x({ ["default"]: () => __WEBPACK_EXT
18177
18183
  };
18178
18184
  var setChildrenNodeCursor = function setChildrenNodeCursor(root, cursor) {
18179
18185
  if ((0,isElement_namespaceObject["default"])(root)) {
18180
- var _root$style, _root$childNodes;
18186
+ var _root$style;
18181
18187
  (_root$style = root.style) === null || _root$style === void 0 || _root$style.setProperty('cursor', cursor);
18182
- if (((_root$childNodes = root.childNodes) === null || _root$childNodes === void 0 ? void 0 : _root$childNodes.length) > 0) {
18183
- root.childNodes.forEach(function (node) {
18184
- return setChildrenNodeCursor(node, cursor);
18185
- });
18186
- }
18187
18188
  }
18188
18189
  };
18189
18190
  var handler = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, EVENTS.MOUSE_DOWN, function (e, column) {
@@ -19962,6 +19963,21 @@ var getRawData = function getRawData(data) {
19962
19963
  }
19963
19964
  return data;
19964
19965
  };
19966
+ /**
19967
+ * 转换 px | % 为实际数值
19968
+ * @param val
19969
+ * @param parentVal
19970
+ * @returns
19971
+ */
19972
+ var getNumberOrPercentValue = function getNumberOrPercentValue(val, parentVal) {
19973
+ if (/^\d+\.?\d+(px)?$/.test("".concat(val))) {
19974
+ return Number("".concat(val).replace(/px/, ''));
19975
+ }
19976
+ if (/^\d+\.?\d+%$/.test("".concat(val))) {
19977
+ return Number("".concat(val).replace(/%/, '')) / 100 * (parentVal !== null && parentVal !== void 0 ? parentVal : 1);
19978
+ }
19979
+ return null;
19980
+ };
19965
19981
  ;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-columns.tsx
19966
19982
 
19967
19983
 
@@ -20033,6 +20049,63 @@ var useColumns = function useColumns(props) {
20033
20049
  active: true
20034
20050
  }));
20035
20051
  };
20052
+ var setColumnCalcWidth = function setColumnCalcWidth(col, attrName, width) {
20053
+ var colWidth = 0;
20054
+ if (/^\d+\.?\d*(px)?$/.test("".concat(col[attrName]))) {
20055
+ colWidth = Number("".concat(col[attrName]).replace(/px/, ''));
20056
+ setColumnAttribute(col, COLUMN_ATTRIBUTE.CALC_WIDTH, colWidth);
20057
+ setColumnRect(col, {
20058
+ width: colWidth,
20059
+ left: null,
20060
+ right: null
20061
+ });
20062
+ }
20063
+ if (/^\d+\.?\d*%$/.test("".concat(col[attrName]))) {
20064
+ colWidth = Number("".concat(col[attrName]).replace(/%/, '')) / 100 * width;
20065
+ setColumnAttribute(col, COLUMN_ATTRIBUTE.CALC_WIDTH, colWidth);
20066
+ setColumnRect(col, {
20067
+ width: colWidth,
20068
+ left: null,
20069
+ right: null
20070
+ });
20071
+ }
20072
+ return colWidth;
20073
+ };
20074
+ /**
20075
+ * 根据表格外层宽度和表格列配置
20076
+ * 计算每一列的宽度
20077
+ * @param width
20078
+ */
20079
+ var resolveColsCalcWidth = function resolveColsCalcWidth(width) {
20080
+ var diffWidth = width;
20081
+ var minColWidth = COL_MIN_WIDTH;
20082
+ var resolveColWidth = function resolveColWidth(colList) {
20083
+ var attrName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'width';
20084
+ var filterList = [];
20085
+ colList.forEach(function (col) {
20086
+ var calcWidth = setColumnCalcWidth(col, attrName, width);
20087
+ diffWidth = diffWidth - calcWidth;
20088
+ if ([undefined, null, 'auto', 'undefined', 'null', ''].includes(col[attrName])) {
20089
+ filterList.push(col);
20090
+ }
20091
+ });
20092
+ if (diffWidth > 0 && filterList.length) {
20093
+ minColWidth = diffWidth / filterList.length;
20094
+ }
20095
+ return filterList;
20096
+ };
20097
+ var minWidthList = resolveColWidth(visibleColumns);
20098
+ var autoWidthList = resolveColWidth(minWidthList, 'minWidth');
20099
+ autoWidthList.forEach(function (col) {
20100
+ var calcWidth = minColWidth > COL_MIN_WIDTH ? minColWidth : COL_MIN_WIDTH;
20101
+ setColumnAttribute(col, COLUMN_ATTRIBUTE.CALC_WIDTH, calcWidth);
20102
+ setColumnRect(col, {
20103
+ width: calcWidth,
20104
+ left: null,
20105
+ right: null
20106
+ });
20107
+ });
20108
+ };
20036
20109
  /**
20037
20110
  * 用来记录列的过滤状态
20038
20111
  * @param col
@@ -20228,6 +20301,9 @@ var useColumns = function useColumns(props) {
20228
20301
  var getColumnRect = function getColumnRect(column) {
20229
20302
  return getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_RECT);
20230
20303
  };
20304
+ var getColumnCalcWidth = function getColumnCalcWidth(column) {
20305
+ return getColumnAttribute(column, COLUMN_ATTRIBUTE.CALC_WIDTH);
20306
+ };
20231
20307
  var setColumnRect = function setColumnRect(col, _ref2) {
20232
20308
  var left = _ref2.left,
20233
20309
  right = _ref2.right,
@@ -20429,6 +20505,7 @@ var useColumns = function useColumns(props) {
20429
20505
  getColumnRect: getColumnRect,
20430
20506
  getColumnCustomClass: getColumnCustomClass,
20431
20507
  getColumnRefAttribute: getColumnRefAttribute,
20508
+ getColumnCalcWidth: getColumnCalcWidth,
20432
20509
  resolveEventListener: resolveEventListener,
20433
20510
  setColumnIsHidden: setColumnIsHidden,
20434
20511
  setColumnResizeWidth: setColumnResizeWidth,
@@ -20439,7 +20516,8 @@ var useColumns = function useColumns(props) {
20439
20516
  setColumnSortActive: setColumnSortActive,
20440
20517
  setFixedStyle: setFixedStyle,
20441
20518
  setColumnRect: setColumnRect,
20442
- setVisibleColumns: setVisibleColumns
20519
+ setVisibleColumns: setVisibleColumns,
20520
+ resolveColsCalcWidth: resolveColsCalcWidth
20443
20521
  };
20444
20522
  };
20445
20523
  /* harmony default export */ const use_columns = (useColumns);
@@ -20647,10 +20725,10 @@ var useColumns = function useColumns(props) {
20647
20725
  var length = fixedRightColumns.value.length;
20648
20726
  for (var i = length - 1; i >= 0; i--) {
20649
20727
  var col = fixedRightColumns.value[i];
20650
- var _columns$getColumnRec = columns.getColumnRect(col),
20651
- width = _columns$getColumnRec.width;
20728
+ var width = columns.getColumnCalcWidth(col);
20652
20729
  columns.setColumnRect(col, {
20653
- right: right
20730
+ right: right,
20731
+ width: width
20654
20732
  });
20655
20733
  columns.setFixedStyle(col, {
20656
20734
  right: "".concat(right, "px")
@@ -20659,10 +20737,10 @@ var useColumns = function useColumns(props) {
20659
20737
  }
20660
20738
  var left = 0;
20661
20739
  fixedLeftColumns.value.forEach(function (col) {
20662
- var _columns$getColumnRec2 = columns.getColumnRect(col),
20663
- width = _columns$getColumnRec2.width;
20740
+ var width = columns.getColumnCalcWidth(col);
20664
20741
  columns.setColumnRect(col, {
20665
- left: left
20742
+ left: left,
20743
+ width: width
20666
20744
  });
20667
20745
  columns.setFixedStyle(col, {
20668
20746
  left: "".concat(left, "px")
@@ -20766,7 +20844,9 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
20766
20844
  });
20767
20845
  var tableStyle = (0,external_vue_namespaceObject.computed)(function () {
20768
20846
  return {
20769
- height: resolveNumberOrStringToPix(props.height, '100%')
20847
+ height: resolveNumberOrStringToPix(props.height),
20848
+ maxHeight: resolveNumberOrStringToPix(props.maxHeight),
20849
+ minHeight: resolveNumberOrStringToPix(props.minHeight)
20770
20850
  };
20771
20851
  });
20772
20852
  var headClass = (0,external_vue_namespaceObject.computed)(function () {
@@ -20876,6 +20956,10 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
20876
20956
  }
20877
20957
  ctx.emit(EMIT_EVENTS.SCROLL_BOTTOM, use_layout_objectSpread({}, args));
20878
20958
  });
20959
+ /**
20960
+ * 设置横向滚动条距离右侧距离
20961
+ * 用于判定fix column的显示样式
20962
+ */
20879
20963
  var setOffsetRight = function setOffsetRight() {
20880
20964
  var _refBody$value$refRoo, _refBody$value, _refBody$value$refRoo2, _refBody$value2, _ref;
20881
20965
  var scrollWidth = (_refBody$value$refRoo = (_refBody$value = refBody.value) === null || _refBody$value === void 0 || (_refBody$value = _refBody$value.refRoot) === null || _refBody$value === void 0 ? void 0 : _refBody$value.scrollWidth) !== null && _refBody$value$refRoo !== void 0 ? _refBody$value$refRoo : 0;
@@ -21305,7 +21389,8 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
21305
21389
  var isTipsEnabled = (0,external_vue_namespaceObject.ref)(false);
21306
21390
  var cellStyle = (0,external_vue_namespaceObject.computed)(function () {
21307
21391
  return {
21308
- textAlign: props.column.textAlign
21392
+ textAlign: props.column.textAlign,
21393
+ minWidth: resolveNumberOrStringToPix(props.column.minWidth, null)
21309
21394
  };
21310
21395
  });
21311
21396
  var resolveSetting = function resolveSetting() {
@@ -21324,12 +21409,12 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
21324
21409
  mode: mode,
21325
21410
  resizerWay: undefined,
21326
21411
  watchCellResize: undefined,
21327
- popoverOption: popoverOption
21412
+ popoverOption: popoverOption,
21413
+ allowHtml: false
21328
21414
  }
21329
21415
  };
21330
21416
  if (props.parentSetting !== null && typeof_typeof(props.parentSetting) === 'object') {
21331
- Object.assign(result.showOverflowTooltip, props.parentSetting);
21332
- Object.assign(result.showOverflowTooltip, {
21417
+ Object.assign(result.showOverflowTooltip, props.parentSetting, {
21333
21418
  disabled: !props.column.showOverflowTooltip
21334
21419
  });
21335
21420
  if (typeof_typeof(props.column.showOverflowTooltip) === 'object') {
@@ -21343,14 +21428,23 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
21343
21428
  };
21344
21429
  };
21345
21430
  var bkEllipsisIns = null;
21431
+ var getContentValue = function getContentValue() {
21432
+ var _target$innerText;
21433
+ var allowHtml = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
21434
+ var target = getEllipsisTarget();
21435
+ if (allowHtml) {
21436
+ var _target$cloneNode, _target$cloneNode2;
21437
+ return (_target$cloneNode = target === null || target === void 0 || (_target$cloneNode2 = target.cloneNode) === null || _target$cloneNode2 === void 0 ? void 0 : _target$cloneNode2.call(target, true)) !== null && _target$cloneNode !== void 0 ? _target$cloneNode : '';
21438
+ }
21439
+ return (_target$innerText = target === null || target === void 0 ? void 0 : target.innerText) !== null && _target$innerText !== void 0 ? _target$innerText : '';
21440
+ };
21346
21441
  var resolveTooltipOption = function resolveTooltipOption() {
21347
- var _getEllipsisTarget$cl, _getEllipsisTarget, _getEllipsisTarget$cl2;
21348
21442
  var _resolveSetting = resolveSetting(),
21349
21443
  _resolveSetting$showO = _resolveSetting.showOverflowTooltip,
21350
21444
  showOverflowTooltip = _resolveSetting$showO === void 0 ? false : _resolveSetting$showO;
21351
21445
  var disabled = true;
21352
21446
  var resizerWay = props.resizerWay;
21353
- var defaultContent = (_getEllipsisTarget$cl = (_getEllipsisTarget = getEllipsisTarget()) === null || _getEllipsisTarget === void 0 || (_getEllipsisTarget$cl2 = _getEllipsisTarget.cloneNode) === null || _getEllipsisTarget$cl2 === void 0 ? void 0 : _getEllipsisTarget$cl2.call(_getEllipsisTarget, true)) !== null && _getEllipsisTarget$cl !== void 0 ? _getEllipsisTarget$cl : '';
21447
+ var defaultContent = getContentValue(showOverflowTooltip.allowHtml);
21354
21448
  var content = function content() {
21355
21449
  return defaultContent;
21356
21450
  };
@@ -21395,8 +21489,8 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
21395
21489
  disabled = !((_props$column$showOve5 = (_props$column = props.column) === null || _props$column === void 0 || (_props$column = _props$column.showOverflowTooltip) === null || _props$column === void 0 ? void 0 : _props$column.showHead) !== null && _props$column$showOve5 !== void 0 ? _props$column$showOve5 : true);
21396
21490
  mode = 'auto';
21397
21491
  content = function content() {
21398
- var _getEllipsisTarget$cl3, _getEllipsisTarget2, _getEllipsisTarget2$c;
21399
- return (_getEllipsisTarget$cl3 = (_getEllipsisTarget2 = getEllipsisTarget()) === null || _getEllipsisTarget2 === void 0 || (_getEllipsisTarget2$c = _getEllipsisTarget2.cloneNode) === null || _getEllipsisTarget2$c === void 0 ? void 0 : _getEllipsisTarget2$c.call(_getEllipsisTarget2, true)) !== null && _getEllipsisTarget$cl3 !== void 0 ? _getEllipsisTarget$cl3 : '';
21492
+ var _getEllipsisTarget$cl, _getEllipsisTarget, _getEllipsisTarget$cl2;
21493
+ return (_getEllipsisTarget$cl = (_getEllipsisTarget = getEllipsisTarget()) === null || _getEllipsisTarget === void 0 || (_getEllipsisTarget$cl2 = _getEllipsisTarget.cloneNode) === null || _getEllipsisTarget$cl2 === void 0 ? void 0 : _getEllipsisTarget$cl2.call(_getEllipsisTarget, true)) !== null && _getEllipsisTarget$cl !== void 0 ? _getEllipsisTarget$cl : '';
21400
21494
  };
21401
21495
  if (props.headExplain) {
21402
21496
  mode = 'static';
@@ -21646,7 +21740,8 @@ var ROW_HEIGHT = 32;
21646
21740
  var _filter$value$list = filter.value.list,
21647
21741
  list = _filter$value$list === void 0 ? [] : _filter$value$list;
21648
21742
  var filterList = list.filter(function (l) {
21649
- return getRegExp(searchValue.value).test(l.value);
21743
+ var reg = getRegExp(searchValue.value);
21744
+ return reg.test(l.label) || reg.test(l.value);
21650
21745
  });
21651
21746
  return filterList;
21652
21747
  });
@@ -22391,9 +22486,9 @@ function use_render_isSlot(s) {
22391
22486
  var minWidth = columns.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_MIN_WIDTH);
22392
22487
  return (0,external_vue_namespaceObject.createVNode)("col", {
22393
22488
  "style": {
22489
+ width: resolveNumberOrStringToPix(width, 'auto'),
22394
22490
  minWidth: resolveNumberOrStringToPix(minWidth, 'auto')
22395
- },
22396
- "width": width
22491
+ }
22397
22492
  }, null);
22398
22493
  })]);
22399
22494
  };
@@ -23337,7 +23432,7 @@ const loading_less_namespaceObject = loading_less_x({ });
23337
23432
  function use_settings_isSlot(s) {
23338
23433
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
23339
23434
  }
23340
- var useSettings = function useSettings(props, ctx, columns) {
23435
+ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
23341
23436
  var t = (0,config_provider_namespaceObject.useLocale)('table');
23342
23437
  var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
23343
23438
  resolveClassName = _usePrefix.resolveClassName;
@@ -23413,6 +23508,7 @@ var useSettings = function useSettings(props, ctx, columns) {
23413
23508
  Object.assign(options, result);
23414
23509
  columns.setColumnAttributeBySettings(options, result.checked);
23415
23510
  columns.setVisibleColumns();
23511
+ afterSetting === null || afterSetting === void 0 || afterSetting(result.checked);
23416
23512
  (_refSetting$value = refSetting.value) === null || _refSetting$value === void 0 || _refSetting$value.hide();
23417
23513
  ctx.emit(EMIT_EVENTS.SETTING_CHANGE, result);
23418
23514
  };
@@ -23675,7 +23771,28 @@ var useSettings = function useSettings(props, ctx, columns) {
23675
23771
  var columns = use_columns(props);
23676
23772
  var rows = use_rows(props);
23677
23773
  var pagination = use_pagination(props);
23678
- var settings = use_settings(props, ctx, columns);
23774
+ var _useLayout = use_layout(props, ctx),
23775
+ renderContainer = _useLayout.renderContainer,
23776
+ renderBody = _useLayout.renderBody,
23777
+ renderHeader = _useLayout.renderHeader,
23778
+ renderFooter = _useLayout.renderFooter,
23779
+ setBodyHeight = _useLayout.setBodyHeight,
23780
+ setFootHeight = _useLayout.setFootHeight,
23781
+ setDragOffsetX = _useLayout.setDragOffsetX,
23782
+ setOffsetRight = _useLayout.setOffsetRight,
23783
+ refBody = _useLayout.refBody,
23784
+ refRoot = _useLayout.refRoot;
23785
+ /**
23786
+ * 设置字段结束,展示字段改变,设置表格偏移量为0
23787
+ * 避免太长横向滚动导致数据不可见
23788
+ * @param fields
23789
+ */
23790
+ var afterSetting = function afterSetting(fields) {
23791
+ if ((fields === null || fields === void 0 ? void 0 : fields.length) > 0) {
23792
+ refBody.value.scrollTo(0, 0);
23793
+ }
23794
+ };
23795
+ var settings = use_settings(props, ctx, columns, afterSetting);
23679
23796
  var dragEvents = use_draggable(props, rows, ctx);
23680
23797
  var _useRender = use_render({
23681
23798
  props: props,
@@ -23690,8 +23807,6 @@ var useSettings = function useSettings(props, ctx, columns) {
23690
23807
  renderTFoot = _useRender.renderTFoot,
23691
23808
  setDragEvents = _useRender.setDragEvents;
23692
23809
  setDragEvents(dragEvents);
23693
- var _useColumnResize = use_column_resize(columns),
23694
- dragOffsetX = _useColumnResize.dragOffsetX;
23695
23810
  var _useColumnTemplate = use_column_template(),
23696
23811
  resolveColumns = _useColumnTemplate.resolveColumns;
23697
23812
  var instance = (0,external_vue_namespaceObject.getCurrentInstance)();
@@ -23699,43 +23814,26 @@ var useSettings = function useSettings(props, ctx, columns) {
23699
23814
  columns.debounceUpdateColumns(resolveColumns(instance));
23700
23815
  };
23701
23816
  (0,external_vue_namespaceObject.provide)(PROVIDE_KEY_INIT_COL, initTableColumns);
23702
- var _useLayout = use_layout(props, ctx),
23703
- renderContainer = _useLayout.renderContainer,
23704
- renderBody = _useLayout.renderBody,
23705
- renderHeader = _useLayout.renderHeader,
23706
- renderFooter = _useLayout.renderFooter,
23707
- setBodyHeight = _useLayout.setBodyHeight,
23708
- setFootHeight = _useLayout.setFootHeight,
23709
- setDragOffsetX = _useLayout.setDragOffsetX,
23710
- setOffsetRight = _useLayout.setOffsetRight,
23711
- refRoot = _useLayout.refRoot,
23712
- refHead = _useLayout.refHead;
23713
23817
  var _useFixedColumn = use_fixed_column(props, columns),
23714
23818
  renderFixedRows = _useFixedColumn.renderFixedRows,
23715
23819
  resolveFixedColumnStyle = _useFixedColumn.resolveFixedColumnStyle;
23716
23820
  var _useScrollLoading = use_scroll_loading(props, ctx),
23717
23821
  renderScrollLoading = _useScrollLoading.renderScrollLoading;
23718
- var isResizeBodyHeight = (0,external_vue_namespaceObject.ref)(false);
23822
+ /**
23823
+ * Column配置改变或者容器Resize之后,根据Columns配置
23824
+ * 计算每一列的实际宽度
23825
+ */
23719
23826
  var computedColumnRect = function computedColumnRect() {
23720
- var _refHead$value;
23721
- if ((0,lodash.isElement)((_refHead$value = refHead === null || refHead === void 0 ? void 0 : refHead.value) !== null && _refHead$value !== void 0 ? _refHead$value : null)) {
23722
- columns.visibleColumns.forEach(function (col) {
23723
- var _refHead$value2;
23724
- var id = columns.getColumnId(col);
23725
- var query = "[data-id=\"".concat(id, "\"]");
23726
- var target = refHead === null || refHead === void 0 || (_refHead$value2 = refHead.value) === null || _refHead$value2 === void 0 ? void 0 : _refHead$value2.querySelector(query);
23727
- if ((0,lodash.isElement)(target)) {
23728
- columns.setColumnRect(col, {
23729
- width: target.offsetWidth,
23730
- height: target.offsetHeight,
23731
- left: null,
23732
- right: null
23733
- });
23734
- }
23735
- });
23736
- resolveFixedColumnStyle();
23737
- }
23827
+ var _refRoot$value$offset, _refRoot$value;
23828
+ var width = (_refRoot$value$offset = (_refRoot$value = refRoot.value) === null || _refRoot$value === void 0 ? void 0 : _refRoot$value.offsetWidth) !== null && _refRoot$value$offset !== void 0 ? _refRoot$value$offset : 0;
23829
+ columns.resolveColsCalcWidth(width);
23830
+ resolveFixedColumnStyle();
23738
23831
  };
23832
+ var _useColumnResize = use_column_resize(columns, {
23833
+ afterResize: resolveFixedColumnStyle
23834
+ }),
23835
+ dragOffsetX = _useColumnResize.dragOffsetX;
23836
+ var isResizeBodyHeight = (0,external_vue_namespaceObject.ref)(false);
23739
23837
  /**
23740
23838
  * table 渲染行
23741
23839
  */
@@ -23780,9 +23878,11 @@ var useSettings = function useSettings(props, ctx, columns) {
23780
23878
  };
23781
23879
  var setTableData = function setTableData() {
23782
23880
  var filterOrderList = getFilterAndSortList();
23783
- pagination.setPagination({
23784
- count: filterOrderList.length
23785
- });
23881
+ if (!props.remotePagination) {
23882
+ pagination.setPagination({
23883
+ count: filterOrderList.length
23884
+ });
23885
+ }
23786
23886
  var renderList = getRenderRowList(filterOrderList);
23787
23887
  rows.setPageRowList(renderList);
23788
23888
  (0,external_vue_namespaceObject.nextTick)(function () {
@@ -46,6 +46,7 @@ export declare const fixedType: import("vue-types").VueTypeValidableDef<"left" |
46
46
  export type IOverflowTooltipOption = {
47
47
  content: ((col: Column, row: any) => string) | string;
48
48
  disabled?: ((col: Column, row: any) => boolean) | boolean;
49
+ allowHtml?: boolean;
49
50
  watchCellResize?: boolean;
50
51
  mode?: `${OverflowModeEnum}`;
51
52
  popoverOption?: any;
@@ -272,7 +273,7 @@ export declare const tableProps: {
272
273
  };
273
274
  /**
274
275
  * 设置表格最小高度
275
- * 默认:300
276
+ * 默认:LINE_HEIGHT * 4
276
277
  */
277
278
  minHeight: import("vue-types").VueTypeDef<StringNumber> & {
278
279
  default: StringNumber;
@@ -1208,7 +1208,6 @@
1208
1208
  width: 100%;
1209
1209
  height: 100%;
1210
1210
  overflow: hidden;
1211
- border-collapse: separate;
1212
1211
  border-spacing: 0;
1213
1212
  }
1214
1213
  .bk-table-flex {
@@ -1271,7 +1270,7 @@
1271
1270
  .bk-table .bk-table-head table,
1272
1271
  .bk-table .bk-table-body table {
1273
1272
  width: 100%;
1274
- border-collapse: collapse;
1273
+ border-collapse: separate;
1275
1274
  transform: translateZ(0);
1276
1275
  table-layout: fixed;
1277
1276
  align-self: flex-start;
@@ -1418,16 +1417,6 @@
1418
1417
  content: '';
1419
1418
  transform: translateX(50%);
1420
1419
  }
1421
- .bk-table .bk-table-head table thead th.column_fixed::after,
1422
- .bk-table .bk-table-body table thead th.column_fixed::after {
1423
- position: absolute;
1424
- content: '';
1425
- right: -2px;
1426
- top: 0;
1427
- bottom: 0;
1428
- width: 2px;
1429
- background-color: var(--table-head-bg-color);
1430
- }
1431
1420
  .bk-table .bk-table-head table thead th .cell,
1432
1421
  .bk-table .bk-table-body table thead th .cell {
1433
1422
  display: flex;
@@ -1442,12 +1431,6 @@
1442
1431
  cursor: pointer;
1443
1432
  background: var(--table-row-active-bg-color);
1444
1433
  }
1445
- .bk-table .bk-table-head table thead th.active.column_fixed::after,
1446
- .bk-table .bk-table-body table thead th.active.column_fixed::after,
1447
- .bk-table .bk-table-head table thead th:hover.column_fixed::after,
1448
- .bk-table .bk-table-body table thead th:hover.column_fixed::after {
1449
- background-color: var(--table-row-hover-bg-color);
1450
- }
1451
1434
  .bk-table .bk-table-head table thead th.column_fixed,
1452
1435
  .bk-table .bk-table-body table thead th.column_fixed {
1453
1436
  transform: translateX(var(--scroll-left));
@@ -1476,25 +1459,11 @@
1476
1459
  text-align: center;
1477
1460
  cursor: move;
1478
1461
  }
1479
- .bk-table .bk-table-head table tbody tr td.column_fixed::after,
1480
- .bk-table .bk-table-body table tbody tr td.column_fixed::after {
1481
- position: absolute;
1482
- content: '';
1483
- right: -2px;
1484
- top: 0;
1485
- bottom: 0;
1486
- width: 2px;
1487
- background-color: var(--table-bg-color);
1488
- }
1489
1462
  .bk-table .bk-table-head table tbody tr:hover.hover-highlight td:not(.empty-cell),
1490
1463
  .bk-table .bk-table-body table tbody tr:hover.hover-highlight td:not(.empty-cell) {
1491
1464
  background: var(--table-row-hover-bg-color);
1492
1465
  border-right-color: var(--table-row-hover-bg-color);
1493
1466
  }
1494
- .bk-table .bk-table-head table tbody tr:hover.hover-highlight td.column_fixed::after,
1495
- .bk-table .bk-table-body table tbody tr:hover.hover-highlight td.column_fixed::after {
1496
- background-color: var(--table-row-hover-bg-color);
1497
- }
1498
1467
  .bk-table .bk-table-head table tbody tr.--drag-start td,
1499
1468
  .bk-table .bk-table-body table tbody tr.--drag-start td {
1500
1469
  background: #fff !important;
@@ -1574,10 +1543,7 @@
1574
1543
  border-bottom: 1px solid var(--table-border-color);
1575
1544
  }
1576
1545
  .bk-table.bordered-col th {
1577
- border-right: 1px solid var(--table-border-color);
1578
- }
1579
- .bk-table.bordered-col th.column_fixed::after {
1580
- border-left: solid 1px var(--table-border-color);
1546
+ border-right: 1px solid var(--background-color);
1581
1547
  }
1582
1548
  .bk-table.bordered-col th:last-child {
1583
1549
  border-right: none;
@@ -1585,9 +1551,6 @@
1585
1551
  .bk-table.bordered-col .bk-table-body tbody tr td {
1586
1552
  border-right-color: var(--table-border-color);
1587
1553
  }
1588
- .bk-table.bordered-col .bk-table-body tbody tr td.column_fixed::after {
1589
- border-left: solid 1px var(--table-border-color);
1590
- }
1591
1554
  .bk-table th,
1592
1555
  .bk-table td {
1593
1556
  border-right: 1px solid var(--table-bg-color);