bkui-vue 2.0.1-beta.54 → 2.0.1-beta.56

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.54";
7
+ export const version = "2.0.1-beta.56";
8
8
  window.__bkui_vue_version__ = version;
@@ -31,6 +31,7 @@ export declare const TABLE_ROW_ATTRIBUTE: {
31
31
  ROW_SOURCE_DATA: string;
32
32
  ROW_SKIP_CFG: string;
33
33
  ROW_SPAN: string;
34
+ ROW_HEIGHT: string;
34
35
  };
35
36
  export declare const COLUMN_ATTRIBUTE: {
36
37
  COL_UID: string;
@@ -1,7 +1,7 @@
1
1
  import { SetupContext } from 'vue';
2
2
  import { TablePropTypes } from '../props';
3
3
  import { UseRows } from './use-rows';
4
- declare const _default: (props: TablePropTypes, rows: UseRows, ctx: SetupContext<any>) => {
4
+ declare const _default: (props: TablePropTypes, rows: UseRows, ctx: SetupContext) => {
5
5
  onDragenter?: undefined;
6
6
  onDragleave?: undefined;
7
7
  onDragstart?: undefined;
@@ -13,7 +13,7 @@ declare const _default: (props: TablePropTypes, ctx: any) => {
13
13
  setDragOffsetX: (val: number) => void;
14
14
  setFixedColumns: (values: Column[]) => void;
15
15
  setOffsetRight: () => void;
16
- setLineHeight: (val: number) => void;
16
+ setLineHeight: (val: number | ((...args: any[]) => number)) => void;
17
17
  setHeaderRowCount: (val: number) => void;
18
18
  initRootStyleVars: () => void;
19
19
  refRoot: Ref<HTMLElement>;
@@ -3,16 +3,14 @@ import { TablePropTypes } from '../props';
3
3
  import { UseColumns } from './use-columns';
4
4
  import { UsePagination } from './use-pagination';
5
5
  import { UseRows } from './use-rows';
6
- import { UseSettings } from './use-settings';
7
6
  type RenderType = {
8
7
  props: TablePropTypes;
9
8
  ctx: SetupContext;
10
9
  columns: UseColumns;
11
10
  rows: UseRows;
12
11
  pagination: UsePagination;
13
- settings: UseSettings;
14
12
  };
15
- declare const _default: ({ props, ctx, columns, rows, pagination, settings }: RenderType) => {
13
+ declare const _default: ({ props, ctx, columns, rows, pagination }: RenderType) => {
16
14
  renderColumns: () => JSX.Element;
17
15
  renderTBody: (list?: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
18
16
  [key: string]: any;
@@ -12,6 +12,7 @@ declare const useRows: (props: TablePropTypes) => {
12
12
  setRowSelectionAll: (val: boolean) => void;
13
13
  setRowSelection: (row: Record<string, unknown>, isSelected: boolean, index?: number) => void;
14
14
  setAllRowExpand: (value?: boolean) => void;
15
+ setRowHeight: (height: number, row?: any) => void;
15
16
  setTableIsNeedRowSpan: (val: boolean) => void;
16
17
  getRowAttribute: (item: IEmptyObject | object, attrName: string) => any;
17
18
  getRowSelection: () => any[];
@@ -19,6 +20,7 @@ declare const useRows: (props: TablePropTypes) => {
19
20
  getRowCheckedAllValue: () => any;
20
21
  changePageRowIndex: (sourceIndex: any, targetIndex: any) => void;
21
22
  toggleAllSelection: (value?: boolean) => void;
23
+ getRowHeight: (row?: any, index?: any, type?: any) => any;
22
24
  tableRowList: import("vue").Ref<any[]>;
23
25
  tableRowSchema: WeakMap<object, any> & Omit<WeakMap<object, any>, keyof WeakMap<any, any>>;
24
26
  pageRowList: any[];
@@ -17436,7 +17436,8 @@ var TABLE_ROW_ATTRIBUTE = {
17436
17436
  ROW_SELECTION_INDETERMINATE: 'row_selection_indeterminate',
17437
17437
  ROW_SOURCE_DATA: 'row_source_data',
17438
17438
  ROW_SKIP_CFG: 'row_skip_config',
17439
- ROW_SPAN: 'row_span'
17439
+ ROW_SPAN: 'row_span',
17440
+ ROW_HEIGHT: 'row_height'
17440
17441
  };
17441
17442
  var COLUMN_ATTRIBUTE = {
17442
17443
  COL_UID: 'col_$uuid',
@@ -19965,11 +19966,12 @@ var getSortFn = function getSortFn(column, sortType) {
19965
19966
  return String.prototype.localeCompare.call(val0, val1);
19966
19967
  };
19967
19968
  var sortFn = typeof ((_column$sort = column.sort) === null || _column$sort === void 0 ? void 0 : _column$sort.sortFn) === 'function' ? (_column$sort2 = column.sort) === null || _column$sort2 === void 0 ? void 0 : _column$sort2.sortFn : sortFn0;
19968
- return sortType === SORT_OPTION.NULL ? function (_a, _b) {
19969
- return true;
19970
- } : function (a, b, index0, index1) {
19969
+ var userFn = function userFn(a, b, index0, index1) {
19971
19970
  return sortFn(a, b, index0, index1) * (sortType === SORT_OPTION.DESC ? -1 : 1);
19972
19971
  };
19972
+ return sortType === SORT_OPTION.NULL ? function (_a, _b) {
19973
+ return true;
19974
+ } : userFn;
19973
19975
  };
19974
19976
  var getNextSortType = function getNextSortType(sortType) {
19975
19977
  var steps = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, SORT_OPTION.NULL, 3), SORT_OPTION.ASC, 1), SORT_OPTION.DESC, 2);
@@ -20888,7 +20890,7 @@ var useColumns = function useColumns(props) {
20888
20890
  lastDragRowClass = '';
20889
20891
  ctx.emit(EMIT_EVENTS.DRAG_END, {
20890
20892
  sourceEvent: event,
20891
- data: rows.tableRowList
20893
+ data: rows.pageRowList
20892
20894
  });
20893
20895
  };
20894
20896
  return {
@@ -21186,7 +21188,6 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
21186
21188
 
21187
21189
 
21188
21190
  /* harmony default export */ const use_layout = (function (props, ctx) {
21189
- var _props$rowHeight;
21190
21191
  var refRoot = (0,external_vue_namespaceObject.ref)(null);
21191
21192
  var refHead = (0,external_vue_namespaceObject.ref)(null);
21192
21193
  var refBody = (0,external_vue_namespaceObject.ref)(null);
@@ -21198,7 +21199,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
21198
21199
  var offsetRight = (0,external_vue_namespaceObject.ref)(0);
21199
21200
  var layout = (0,external_vue_namespaceObject.reactive)({});
21200
21201
  var fixedColumns = (0,external_vue_namespaceObject.reactive)([]);
21201
- var lineHeight = (0,external_vue_namespaceObject.ref)((_props$rowHeight = props.rowHeight) !== null && _props$rowHeight !== void 0 ? _props$rowHeight : LINE_HEIGHT);
21202
+ var lineHeight = (0,external_vue_namespaceObject.ref)(LINE_HEIGHT);
21202
21203
  var headerRowCount = (0,external_vue_namespaceObject.ref)(1);
21203
21204
  var fixedBottomHeight = (0,external_vue_namespaceObject.computed)(function () {
21204
21205
  var _ctx$slots;
@@ -21395,11 +21396,11 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
21395
21396
  });
21396
21397
  var fixedBottomRow = resolveClassName('table-fixed-bottom');
21397
21398
  var fixedBottomLoadingStyle = (0,external_vue_namespaceObject.computed)(function () {
21398
- var _props$fixedBottom$po, _props$fixedBottom3, _props$fixedBottom$he2, _props$fixedBottom4;
21399
+ var _props$fixedBottom$mi, _props$fixedBottom3, _props$fixedBottom$po, _props$fixedBottom4, _props$fixedBottom$he2, _props$fixedBottom5;
21399
21400
  return {
21400
- minHeight: "".concat(lineHeight.value, "px"),
21401
- position: (_props$fixedBottom$po = (_props$fixedBottom3 = props.fixedBottom) === null || _props$fixedBottom3 === void 0 ? void 0 : _props$fixedBottom3.position) !== null && _props$fixedBottom$po !== void 0 ? _props$fixedBottom$po : 'absolute',
21402
- height: (_props$fixedBottom$he2 = (_props$fixedBottom4 = props.fixedBottom) === null || _props$fixedBottom4 === void 0 ? void 0 : _props$fixedBottom4.height) !== null && _props$fixedBottom$he2 !== void 0 ? _props$fixedBottom$he2 : null
21401
+ minHeight: "".concat((_props$fixedBottom$mi = (_props$fixedBottom3 = props.fixedBottom) === null || _props$fixedBottom3 === void 0 ? void 0 : _props$fixedBottom3.minHeight) !== null && _props$fixedBottom$mi !== void 0 ? _props$fixedBottom$mi : LINE_HEIGHT, "px"),
21402
+ position: (_props$fixedBottom$po = (_props$fixedBottom4 = props.fixedBottom) === null || _props$fixedBottom4 === void 0 ? void 0 : _props$fixedBottom4.position) !== null && _props$fixedBottom$po !== void 0 ? _props$fixedBottom$po : 'absolute',
21403
+ height: (_props$fixedBottom$he2 = (_props$fixedBottom5 = props.fixedBottom) === null || _props$fixedBottom5 === void 0 ? void 0 : _props$fixedBottom5.height) !== null && _props$fixedBottom$he2 !== void 0 ? _props$fixedBottom$he2 : null
21403
21404
  };
21404
21405
  });
21405
21406
  (0,external_vue_namespaceObject.onMounted)(function () {
@@ -23256,8 +23257,7 @@ function use_render_isSlot(s) {
23256
23257
  ctx = _ref.ctx,
23257
23258
  columns = _ref.columns,
23258
23259
  rows = _ref.rows,
23259
- pagination = _ref.pagination,
23260
- settings = _ref.settings;
23260
+ pagination = _ref.pagination;
23261
23261
  var t = (0,config_provider_namespaceObject.useLocale)('table');
23262
23262
  var uuid = esm_browser_v4();
23263
23263
  var dragEvents = {};
@@ -23377,23 +23377,7 @@ function use_render_isSlot(s) {
23377
23377
  return result;
23378
23378
  }), renderAppendLastRow()]);
23379
23379
  };
23380
- var getRowHeight = function getRowHeight(row, rowIndex, type) {
23381
- if (typeof props.rowHeight === 'function' || /^\d+/.test("".concat(props.rowHeight))) {
23382
- return resolvePropVal(props, 'rowHeight', [{
23383
- index: rowIndex,
23384
- type: type !== null && type !== void 0 ? type : 'tbody',
23385
- row: row
23386
- }]);
23387
- }
23388
- var _settings$options = settings.options,
23389
- size = _settings$options.size,
23390
- height = _settings$options.height,
23391
- enabled = _settings$options.enabled;
23392
- if (enabled && height !== null && height !== undefined) {
23393
- return resolvePropVal(settings.options, 'height', ['tbody', row, rowIndex, size]);
23394
- }
23395
- return LINE_HEIGHT;
23396
- };
23380
+ var getRowHeight = rows.getRowHeight;
23397
23381
  var setDragEvents = function setDragEvents(events) {
23398
23382
  dragEvents = events;
23399
23383
  };
@@ -23741,6 +23725,16 @@ var useRows = function useRows(props) {
23741
23725
  }
23742
23726
  return false;
23743
23727
  };
23728
+ var getSelfRowHeight = function getSelfRowHeight(row, rowIndex, type) {
23729
+ if (typeof props.rowHeight === 'function' || /^\d+/.test("".concat(props.rowHeight))) {
23730
+ return resolvePropVal(props, 'rowHeight', [{
23731
+ index: rowIndex,
23732
+ type: type !== null && type !== void 0 ? type : 'tbody',
23733
+ row: row
23734
+ }]);
23735
+ }
23736
+ return LINE_HEIGHT;
23737
+ };
23744
23738
  /**
23745
23739
  * 格式化传入数据配置
23746
23740
  * @param data
@@ -23765,6 +23759,7 @@ var useRows = function useRows(props) {
23765
23759
  var target = tableRowSchema.get(row);
23766
23760
  rowId = target[TABLE_ROW_ATTRIBUTE.ROW_UID];
23767
23761
  target[TABLE_ROW_ATTRIBUTE.ROW_INDEX] = index + 1;
23762
+ target[TABLE_ROW_ATTRIBUTE.ROW_HEIGHT] = getSelfRowHeight(item, index);
23768
23763
  });
23769
23764
  tableRowSchema.set(CHECK_ALL_OBJ, defineProperty_defineProperty(defineProperty_defineProperty({}, TABLE_ROW_ATTRIBUTE.ROW_SELECTION, hasSelectedRow), TABLE_ROW_ATTRIBUTE.ROW_SELECTION_INDETERMINATE, hasSelectedRow && hasUnSelectedRow));
23770
23765
  };
@@ -23858,6 +23853,21 @@ var useRows = function useRows(props) {
23858
23853
  var getRowCheckedAllValue = function getRowCheckedAllValue() {
23859
23854
  return getRowAttribute(CHECK_ALL_OBJ, TABLE_ROW_ATTRIBUTE.ROW_SELECTION);
23860
23855
  };
23856
+ var setRowHeight = function setRowHeight(height, row) {
23857
+ if (row) {
23858
+ setRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_HEIGHT, height);
23859
+ return;
23860
+ }
23861
+ tableRowList.value.forEach(function (row) {
23862
+ return setRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_HEIGHT, height);
23863
+ });
23864
+ };
23865
+ var getRowHeight = function getRowHeight(row, index, type) {
23866
+ if (row) {
23867
+ return getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_HEIGHT);
23868
+ }
23869
+ return getSelfRowHeight(row, index, type);
23870
+ };
23861
23871
  /**
23862
23872
  * 设置列属性
23863
23873
  * @param row
@@ -23975,6 +23985,7 @@ var useRows = function useRows(props) {
23975
23985
  setRowSelectionAll: setRowSelectionAll,
23976
23986
  setRowSelection: setRowSelection,
23977
23987
  setAllRowExpand: setAllRowExpand,
23988
+ setRowHeight: setRowHeight,
23978
23989
  setTableIsNeedRowSpan: setTableIsNeedRowSpan,
23979
23990
  getRowAttribute: getRowAttribute,
23980
23991
  getRowSelection: getRowSelection,
@@ -23982,6 +23993,7 @@ var useRows = function useRows(props) {
23982
23993
  getRowCheckedAllValue: getRowCheckedAllValue,
23983
23994
  changePageRowIndex: changePageRowIndex,
23984
23995
  toggleAllSelection: toggleAllSelection,
23996
+ getRowHeight: getRowHeight,
23985
23997
  tableRowList: tableRowList,
23986
23998
  tableRowSchema: tableRowSchema,
23987
23999
  pageRowList: pageRowList
@@ -24114,7 +24126,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
24114
24126
  Object.assign(options, result);
24115
24127
  columns.setColumnAttributeBySettings(options, result.checked);
24116
24128
  columns.setVisibleColumns();
24117
- afterSetting === null || afterSetting === void 0 || afterSetting(result.checked);
24129
+ afterSetting === null || afterSetting === void 0 || afterSetting(result);
24118
24130
  (_refSetting$value = refSetting.value) === null || _refSetting$value === void 0 || _refSetting$value.hide();
24119
24131
  ctx.emit(EMIT_EVENTS.SETTING_CHANGE, result);
24120
24132
  };
@@ -24390,6 +24402,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
24390
24402
  setDragOffsetX = _useLayout.setDragOffsetX,
24391
24403
  setOffsetRight = _useLayout.setOffsetRight,
24392
24404
  setHeaderRowCount = _useLayout.setHeaderRowCount,
24405
+ setLineHeight = _useLayout.setLineHeight,
24393
24406
  refBody = _useLayout.refBody,
24394
24407
  refRoot = _useLayout.refRoot;
24395
24408
  var scrollTo = function scrollTo() {
@@ -24399,15 +24412,28 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
24399
24412
  }
24400
24413
  return (_refBody$value = refBody.value) === null || _refBody$value === void 0 ? void 0 : _refBody$value.scrollTo.apply(_refBody$value, args);
24401
24414
  };
24415
+ if (typeof props.rowHeight === 'function') {
24416
+ setLineHeight(function (args) {
24417
+ return rows.getRowHeight(args.rows[0], args.index);
24418
+ });
24419
+ } else {
24420
+ setLineHeight(props.rowHeight);
24421
+ }
24402
24422
  /**
24403
24423
  * 设置字段结束,展示字段改变,设置表格偏移量为0
24404
24424
  * 避免太长横向滚动导致数据不可见
24405
24425
  * @param fields
24406
24426
  */
24407
- var afterSetting = function afterSetting(fields) {
24408
- if ((fields === null || fields === void 0 ? void 0 : fields.length) > 0) {
24427
+ var afterSetting = function afterSetting(_ref) {
24428
+ var checked = _ref.checked,
24429
+ height = _ref.height;
24430
+ if ((checked === null || checked === void 0 ? void 0 : checked.length) > 0) {
24409
24431
  scrollTo(0, 0);
24410
24432
  }
24433
+ if (typeof props.rowHeight !== 'function') {
24434
+ rows.setRowHeight(height);
24435
+ setLineHeight(height);
24436
+ }
24411
24437
  };
24412
24438
  var settings = use_settings(props, ctx, columns, afterSetting);
24413
24439
  var dragEvents = use_draggable(props, rows, ctx);
@@ -24416,8 +24442,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
24416
24442
  ctx: ctx,
24417
24443
  columns: columns,
24418
24444
  rows: rows,
24419
- pagination: pagination,
24420
- settings: settings
24445
+ pagination: pagination
24421
24446
  }),
24422
24447
  renderColumns = _useRender.renderColumns,
24423
24448
  renderTBody = _useRender.renderTBody,
@@ -24443,8 +24468,8 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
24443
24468
  * 计算每一列的实际宽度
24444
24469
  */
24445
24470
  var computedColumnRect = function computedColumnRect() {
24446
- var _ref, _refRoot$value;
24447
- var width = (_ref = ((_refRoot$value = refRoot.value) === null || _refRoot$value === void 0 ? void 0 : _refRoot$value.offsetWidth) - (props.scrollbar ? 1 : SCROLLY_WIDTH)) !== null && _ref !== void 0 ? _ref : 0;
24471
+ var _ref2, _refRoot$value;
24472
+ var width = (_ref2 = ((_refRoot$value = refRoot.value) === null || _refRoot$value === void 0 ? void 0 : _refRoot$value.offsetWidth) - (props.scrollbar ? 1 : SCROLLY_WIDTH)) !== null && _ref2 !== void 0 ? _ref2 : 0;
24448
24473
  columns.resolveColsCalcWidth(width);
24449
24474
  resolveFixedColumnStyle();
24450
24475
  };
@@ -249,6 +249,7 @@ export declare enum IColSortBehavior {
249
249
  export type FixedBottomOption = {
250
250
  position: 'absolute' | 'relative';
251
251
  height: number;
252
+ minHeight?: number;
252
253
  loading?: boolean;
253
254
  };
254
255
  export type AppendLastRowOption = {
@@ -17411,7 +17411,8 @@ var TABLE_ROW_ATTRIBUTE = {
17411
17411
  ROW_SELECTION_INDETERMINATE: 'row_selection_indeterminate',
17412
17412
  ROW_SOURCE_DATA: 'row_source_data',
17413
17413
  ROW_SKIP_CFG: 'row_skip_config',
17414
- ROW_SPAN: 'row_span'
17414
+ ROW_SPAN: 'row_span',
17415
+ ROW_HEIGHT: 'row_height'
17415
17416
  };
17416
17417
  var COLUMN_ATTRIBUTE = {
17417
17418
  COL_UID: 'col_$uuid',
package/lib/tree/index.js CHANGED
@@ -18320,10 +18320,13 @@ var getNodeItemStyle = function getNodeItemStyle(item, props, flatData) {
18320
18320
  var depth = (_schema$get = schema.get(item)) === null || _schema$get === void 0 ? void 0 : _schema$get[NODE_ATTRIBUTES.DEPTH];
18321
18321
  if (showTree) {
18322
18322
  var args = ['node'];
18323
+ var levelLine = function levelLine() {
18324
+ return getPropsOneOfBoolValueWithDefault(props, 'levelLine', item, DEFAULT_LEVLE_LINE, null, args);
18325
+ };
18323
18326
  return _objectSpread({
18324
18327
  '--depth': depth
18325
18328
  }, typeof props.levelLine === 'function' ? {
18326
- '--level-line': getPropsOneOfBoolValueWithDefault(props, 'levelLine', item, DEFAULT_LEVLE_LINE, null, args)
18329
+ '--level-line': levelLine()
18327
18330
  } : {});
18328
18331
  }
18329
18332
  return {};
@@ -1294,8 +1294,8 @@ var EThemes;
1294
1294
  })(EThemes || (EThemes = {}));
1295
1295
  var ETypes;
1296
1296
  (function (ETypes) {
1297
- ETypes["FORMDATA"] = "formdata";
1298
1297
  ETypes["BINARY"] = "binary";
1298
+ ETypes["FORMDATA"] = "formdata";
1299
1299
  })(ETypes || (ETypes = {}));
1300
1300
  var EUploadStatus;
1301
1301
  (function (EUploadStatus) {
@@ -1304,7 +1304,6 @@ var EUploadStatus;
1304
1304
  EUploadStatus["SUCCESS"] = "success";
1305
1305
  EUploadStatus["UPLOADING"] = "uploading";
1306
1306
  })(EUploadStatus || (EUploadStatus = {}));
1307
- ;
1308
1307
  ;// CONCATENATED MODULE: ../../packages/upload/src/props.ts
1309
1308
  /*
1310
1309
  * Tencent is pleased to support the open source community by making
@@ -8,8 +8,8 @@ export declare const enum EThemes {
8
8
  }
9
9
  export type Theme = Lowercase<keyof typeof EThemes>;
10
10
  export declare const enum ETypes {
11
- FORMDATA = "formdata",
12
- BINARY = "binary"
11
+ BINARY = "binary",
12
+ FORMDATA = "formdata"
13
13
  }
14
14
  export type Type = Lowercase<keyof typeof ETypes>;
15
15
  export declare const enum EUploadStatus {
@@ -66,7 +66,7 @@ export interface UploadRequestOptions {
66
66
  formDataAttributes?: FormDataAttr | FormDataAttr[];
67
67
  filename: string;
68
68
  file: File;
69
- headers?: Headers | Record<string, string | number | null | undefined>;
69
+ headers?: Headers | Record<string, null | number | string | undefined>;
70
70
  header?: HeaderDataAttr | HeaderDataAttr[];
71
71
  withCredentials: boolean;
72
72
  sliceUrl: string;
@@ -17705,16 +17705,14 @@ var lodash = __webpack_require__(6635);
17705
17705
  * Copyright © 2012-2019 Tencent BlueKing. All Rights Reserved. 蓝鲸智云 版权所有
17706
17706
  */
17707
17707
 
17708
- function getMatchedIndex(maxCount, maxHeight, groupItemCount, callback) {
17708
+ function getMatchedIndex(maxCount, maxHeight, callback) {
17709
17709
  var startIndex = 0;
17710
17710
  var height = 0;
17711
17711
  var diffHeight = 0;
17712
17712
  var lastHeight = 0;
17713
17713
  for (; startIndex < maxCount; startIndex++) {
17714
17714
  lastHeight = callback({
17715
- index: startIndex,
17716
- items: [startIndex * groupItemCount, (startIndex + 1) * groupItemCount],
17717
- type: 'virtual'
17715
+ index: startIndex
17718
17716
  });
17719
17717
  if (height + lastHeight > maxHeight) {
17720
17718
  diffHeight = maxHeight - height;
@@ -17748,10 +17746,11 @@ function computedVirtualIndex(lineHeight, callback, pagination, wrapper, event)
17748
17746
  translateY = elScrollTop % lineHeight;
17749
17747
  }
17750
17748
  if (typeof lineHeight === 'function') {
17751
- var startValue = getMatchedIndex(count, elScrollTop, groupItemCount, lineHeight);
17749
+ var maxCount = Math.ceil(count / groupItemCount);
17750
+ var startValue = getMatchedIndex(maxCount, elScrollTop, lineHeight);
17752
17751
  targetStartIndex = startValue.startIndex > 0 ? startValue.startIndex : 0;
17753
17752
  translateY = startValue.diffHeight;
17754
- var endValue = getMatchedIndex(count, elOffsetHeight, groupItemCount, lineHeight);
17753
+ var endValue = getMatchedIndex(maxCount, elOffsetHeight, lineHeight);
17755
17754
  targetEndIndex = endValue.startIndex + targetStartIndex + 1;
17756
17755
  }
17757
17756
  var bottom = elScrollHeight - elOffsetHeight - elScrollTop;
@@ -18074,9 +18073,28 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
18074
18073
  rendAsTag = _useTagRender.rendAsTag;
18075
18074
  return rendAsTag;
18076
18075
  }
18076
+ var getRowHeightArgs = function getRowHeightArgs(startIndex) {
18077
+ var start = startIndex * props.groupItemCount;
18078
+ var end = (startIndex + 1) * props.groupItemCount;
18079
+ return {
18080
+ index: startIndex,
18081
+ rows: props.list.slice(start, end),
18082
+ items: [start, end],
18083
+ type: 'virtual'
18084
+ };
18085
+ };
18086
+ var getLineHeight = function getLineHeight() {
18087
+ if (typeof props.lineHeight === 'function') {
18088
+ return function (_ref) {
18089
+ var index = _ref.index;
18090
+ return props.lineHeight(getRowHeightArgs(index));
18091
+ };
18092
+ }
18093
+ return props.lineHeight;
18094
+ };
18077
18095
  var binding = (0,external_vue_namespaceObject.computed)(function () {
18078
18096
  return {
18079
- lineHeight: props.lineHeight,
18097
+ lineHeight: getLineHeight(),
18080
18098
  handleScrollCallback: handleScrollCallback,
18081
18099
  pagination: pagination,
18082
18100
  throttleDelay: props.throttleDelay,
@@ -18110,16 +18128,12 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
18110
18128
  var getLastPageIndex = function getLastPageIndex() {
18111
18129
  // @ts-ignore
18112
18130
  var elHeight = virtualRoot.value.offsetHeight;
18113
- var startIndex = listLength.value;
18131
+ var startIndex = Math.ceil(listLength.value / props.groupItemCount);
18114
18132
  var rowsHeight = 0;
18115
18133
  var lastHeight = 0;
18116
18134
  var diffHeight = 0;
18117
18135
  for (; startIndex > 0; startIndex--) {
18118
- lastHeight = props.lineHeight({
18119
- index: startIndex,
18120
- items: [startIndex, startIndex * props.groupItemCount],
18121
- type: 'virtual'
18122
- });
18136
+ lastHeight = props.lineHeight(getRowHeightArgs(startIndex));
18123
18137
  rowsHeight = rowsHeight + lastHeight;
18124
18138
  if (rowsHeight > elHeight) {
18125
18139
  diffHeight = rowsHeight - elHeight;
@@ -18201,12 +18215,9 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
18201
18215
  if (typeof props.lineHeight === 'function') {
18202
18216
  innerHeight.value = 0;
18203
18217
  var fnValue = 0;
18204
- for (var i = 0; i < listLength.value; i++) {
18205
- var fnVal = props.lineHeight.apply(_this, [{
18206
- index: i,
18207
- type: 'virtual',
18208
- items: [i * props.groupItemCount, props.groupItemCount]
18209
- }]);
18218
+ var rowsLength = Math.ceil(listLength.value / props.groupItemCount);
18219
+ for (var i = 0; i < rowsLength; i++) {
18220
+ var fnVal = props.lineHeight.apply(_this, [getRowHeightArgs(i)]);
18210
18221
  fnValue += typeof fnVal === 'number' ? fnVal : 0;
18211
18222
  }
18212
18223
  innerHeight.value = fnValue;
@@ -1,7 +1,5 @@
1
- export declare function getMatchedIndex(maxCount: number, maxHeight: number, groupItemCount: number, callback: (agrs: {
1
+ export declare function getMatchedIndex(maxCount: number, maxHeight: number, callback: (agrs: {
2
2
  index: number;
3
- items: number[];
4
- type: string;
5
3
  }) => 0): {
6
4
  startIndex: number;
7
5
  height: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "2.0.1-beta.54",
3
+ "version": "2.0.1-beta.56",
4
4
  "workspaces": [
5
5
  "packages/**",
6
6
  "scripts/cli",