bkui-vue 2.0.1-beta.55 → 2.0.1-beta.57
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/index.cjs.js +46 -46
- package/dist/index.esm.js +10039 -10031
- package/dist/index.umd.js +60 -60
- package/lib/index.js +1 -1
- package/lib/table/const.d.ts +1 -0
- package/lib/table/hooks/use-layout.d.ts +1 -1
- package/lib/table/hooks/use-render.d.ts +1 -3
- package/lib/table/hooks/use-rows.d.ts +2 -0
- package/lib/table/index.js +57 -33
- package/lib/table/props.d.ts +1 -0
- package/lib/table-column/index.js +2 -1
- package/lib/tag-input/index.js +3 -1
- package/lib/tag-input/tag-input.d.ts +2 -14
- package/lib/upload/index.js +1 -2
- package/lib/upload/upload.type.d.ts +3 -3
- package/lib/virtual-render/index.js +30 -19
- package/lib/virtual-render/v-virtual-render.d.ts +1 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
package/lib/table/const.d.ts
CHANGED
@@ -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
|
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[];
|
package/lib/table/index.js
CHANGED
@@ -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',
|
@@ -21187,7 +21188,6 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21187
21188
|
|
21188
21189
|
|
21189
21190
|
/* harmony default export */ const use_layout = (function (props, ctx) {
|
21190
|
-
var _props$rowHeight;
|
21191
21191
|
var refRoot = (0,external_vue_namespaceObject.ref)(null);
|
21192
21192
|
var refHead = (0,external_vue_namespaceObject.ref)(null);
|
21193
21193
|
var refBody = (0,external_vue_namespaceObject.ref)(null);
|
@@ -21199,7 +21199,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21199
21199
|
var offsetRight = (0,external_vue_namespaceObject.ref)(0);
|
21200
21200
|
var layout = (0,external_vue_namespaceObject.reactive)({});
|
21201
21201
|
var fixedColumns = (0,external_vue_namespaceObject.reactive)([]);
|
21202
|
-
var lineHeight = (0,external_vue_namespaceObject.ref)(
|
21202
|
+
var lineHeight = (0,external_vue_namespaceObject.ref)(LINE_HEIGHT);
|
21203
21203
|
var headerRowCount = (0,external_vue_namespaceObject.ref)(1);
|
21204
21204
|
var fixedBottomHeight = (0,external_vue_namespaceObject.computed)(function () {
|
21205
21205
|
var _ctx$slots;
|
@@ -21396,11 +21396,11 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21396
21396
|
});
|
21397
21397
|
var fixedBottomRow = resolveClassName('table-fixed-bottom');
|
21398
21398
|
var fixedBottomLoadingStyle = (0,external_vue_namespaceObject.computed)(function () {
|
21399
|
-
var _props$fixedBottom$
|
21399
|
+
var _props$fixedBottom$mi, _props$fixedBottom3, _props$fixedBottom$po, _props$fixedBottom4, _props$fixedBottom$he2, _props$fixedBottom5;
|
21400
21400
|
return {
|
21401
|
-
minHeight: "".concat(
|
21402
|
-
position: (_props$fixedBottom$po = (_props$
|
21403
|
-
height: (_props$fixedBottom$he2 = (_props$
|
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
|
21404
21404
|
};
|
21405
21405
|
});
|
21406
21406
|
(0,external_vue_namespaceObject.onMounted)(function () {
|
@@ -23257,8 +23257,7 @@ function use_render_isSlot(s) {
|
|
23257
23257
|
ctx = _ref.ctx,
|
23258
23258
|
columns = _ref.columns,
|
23259
23259
|
rows = _ref.rows,
|
23260
|
-
pagination = _ref.pagination
|
23261
|
-
settings = _ref.settings;
|
23260
|
+
pagination = _ref.pagination;
|
23262
23261
|
var t = (0,config_provider_namespaceObject.useLocale)('table');
|
23263
23262
|
var uuid = esm_browser_v4();
|
23264
23263
|
var dragEvents = {};
|
@@ -23378,23 +23377,7 @@ function use_render_isSlot(s) {
|
|
23378
23377
|
return result;
|
23379
23378
|
}), renderAppendLastRow()]);
|
23380
23379
|
};
|
23381
|
-
var getRowHeight =
|
23382
|
-
if (typeof props.rowHeight === 'function' || /^\d+/.test("".concat(props.rowHeight))) {
|
23383
|
-
return resolvePropVal(props, 'rowHeight', [{
|
23384
|
-
index: rowIndex,
|
23385
|
-
type: type !== null && type !== void 0 ? type : 'tbody',
|
23386
|
-
row: row
|
23387
|
-
}]);
|
23388
|
-
}
|
23389
|
-
var _settings$options = settings.options,
|
23390
|
-
size = _settings$options.size,
|
23391
|
-
height = _settings$options.height,
|
23392
|
-
enabled = _settings$options.enabled;
|
23393
|
-
if (enabled && height !== null && height !== undefined) {
|
23394
|
-
return resolvePropVal(settings.options, 'height', ['tbody', row, rowIndex, size]);
|
23395
|
-
}
|
23396
|
-
return LINE_HEIGHT;
|
23397
|
-
};
|
23380
|
+
var getRowHeight = rows.getRowHeight;
|
23398
23381
|
var setDragEvents = function setDragEvents(events) {
|
23399
23382
|
dragEvents = events;
|
23400
23383
|
};
|
@@ -23742,6 +23725,16 @@ var useRows = function useRows(props) {
|
|
23742
23725
|
}
|
23743
23726
|
return false;
|
23744
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
|
+
};
|
23745
23738
|
/**
|
23746
23739
|
* 格式化传入数据配置
|
23747
23740
|
* @param data
|
@@ -23766,6 +23759,7 @@ var useRows = function useRows(props) {
|
|
23766
23759
|
var target = tableRowSchema.get(row);
|
23767
23760
|
rowId = target[TABLE_ROW_ATTRIBUTE.ROW_UID];
|
23768
23761
|
target[TABLE_ROW_ATTRIBUTE.ROW_INDEX] = index + 1;
|
23762
|
+
target[TABLE_ROW_ATTRIBUTE.ROW_HEIGHT] = getSelfRowHeight(item, index);
|
23769
23763
|
});
|
23770
23764
|
tableRowSchema.set(CHECK_ALL_OBJ, defineProperty_defineProperty(defineProperty_defineProperty({}, TABLE_ROW_ATTRIBUTE.ROW_SELECTION, hasSelectedRow), TABLE_ROW_ATTRIBUTE.ROW_SELECTION_INDETERMINATE, hasSelectedRow && hasUnSelectedRow));
|
23771
23765
|
};
|
@@ -23859,6 +23853,21 @@ var useRows = function useRows(props) {
|
|
23859
23853
|
var getRowCheckedAllValue = function getRowCheckedAllValue() {
|
23860
23854
|
return getRowAttribute(CHECK_ALL_OBJ, TABLE_ROW_ATTRIBUTE.ROW_SELECTION);
|
23861
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
|
+
};
|
23862
23871
|
/**
|
23863
23872
|
* 设置列属性
|
23864
23873
|
* @param row
|
@@ -23976,6 +23985,7 @@ var useRows = function useRows(props) {
|
|
23976
23985
|
setRowSelectionAll: setRowSelectionAll,
|
23977
23986
|
setRowSelection: setRowSelection,
|
23978
23987
|
setAllRowExpand: setAllRowExpand,
|
23988
|
+
setRowHeight: setRowHeight,
|
23979
23989
|
setTableIsNeedRowSpan: setTableIsNeedRowSpan,
|
23980
23990
|
getRowAttribute: getRowAttribute,
|
23981
23991
|
getRowSelection: getRowSelection,
|
@@ -23983,6 +23993,7 @@ var useRows = function useRows(props) {
|
|
23983
23993
|
getRowCheckedAllValue: getRowCheckedAllValue,
|
23984
23994
|
changePageRowIndex: changePageRowIndex,
|
23985
23995
|
toggleAllSelection: toggleAllSelection,
|
23996
|
+
getRowHeight: getRowHeight,
|
23986
23997
|
tableRowList: tableRowList,
|
23987
23998
|
tableRowSchema: tableRowSchema,
|
23988
23999
|
pageRowList: pageRowList
|
@@ -24115,7 +24126,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24115
24126
|
Object.assign(options, result);
|
24116
24127
|
columns.setColumnAttributeBySettings(options, result.checked);
|
24117
24128
|
columns.setVisibleColumns();
|
24118
|
-
afterSetting === null || afterSetting === void 0 || afterSetting(result
|
24129
|
+
afterSetting === null || afterSetting === void 0 || afterSetting(result);
|
24119
24130
|
(_refSetting$value = refSetting.value) === null || _refSetting$value === void 0 || _refSetting$value.hide();
|
24120
24131
|
ctx.emit(EMIT_EVENTS.SETTING_CHANGE, result);
|
24121
24132
|
};
|
@@ -24391,6 +24402,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24391
24402
|
setDragOffsetX = _useLayout.setDragOffsetX,
|
24392
24403
|
setOffsetRight = _useLayout.setOffsetRight,
|
24393
24404
|
setHeaderRowCount = _useLayout.setHeaderRowCount,
|
24405
|
+
setLineHeight = _useLayout.setLineHeight,
|
24394
24406
|
refBody = _useLayout.refBody,
|
24395
24407
|
refRoot = _useLayout.refRoot;
|
24396
24408
|
var scrollTo = function scrollTo() {
|
@@ -24400,15 +24412,28 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24400
24412
|
}
|
24401
24413
|
return (_refBody$value = refBody.value) === null || _refBody$value === void 0 ? void 0 : _refBody$value.scrollTo.apply(_refBody$value, args);
|
24402
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
|
+
}
|
24403
24422
|
/**
|
24404
24423
|
* 设置字段结束,展示字段改变,设置表格偏移量为0
|
24405
24424
|
* 避免太长横向滚动导致数据不可见
|
24406
24425
|
* @param fields
|
24407
24426
|
*/
|
24408
|
-
var afterSetting = function afterSetting(
|
24409
|
-
|
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) {
|
24410
24431
|
scrollTo(0, 0);
|
24411
24432
|
}
|
24433
|
+
if (typeof props.rowHeight !== 'function') {
|
24434
|
+
rows.setRowHeight(height);
|
24435
|
+
setLineHeight(height);
|
24436
|
+
}
|
24412
24437
|
};
|
24413
24438
|
var settings = use_settings(props, ctx, columns, afterSetting);
|
24414
24439
|
var dragEvents = use_draggable(props, rows, ctx);
|
@@ -24417,8 +24442,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24417
24442
|
ctx: ctx,
|
24418
24443
|
columns: columns,
|
24419
24444
|
rows: rows,
|
24420
|
-
pagination: pagination
|
24421
|
-
settings: settings
|
24445
|
+
pagination: pagination
|
24422
24446
|
}),
|
24423
24447
|
renderColumns = _useRender.renderColumns,
|
24424
24448
|
renderTBody = _useRender.renderTBody,
|
@@ -24444,8 +24468,8 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24444
24468
|
* 计算每一列的实际宽度
|
24445
24469
|
*/
|
24446
24470
|
var computedColumnRect = function computedColumnRect() {
|
24447
|
-
var
|
24448
|
-
var width = (
|
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;
|
24449
24473
|
columns.resolveColsCalcWidth(width);
|
24450
24474
|
resolveFixedColumnStyle();
|
24451
24475
|
};
|
package/lib/table/props.d.ts
CHANGED
@@ -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/tag-input/index.js
CHANGED
@@ -17973,6 +17973,7 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
17973
17973
|
emits: ['update:modelValue', 'change', 'select', 'focus', 'blur', 'remove', 'removeAll', 'input'],
|
17974
17974
|
setup: function setup(props, _ref) {
|
17975
17975
|
var emit = _ref.emit;
|
17976
|
+
var chineseInputTemporaryValue = '';
|
17976
17977
|
var formItem = (0,shared_namespaceObject.useFormItem)();
|
17977
17978
|
var t = (0,config_provider_namespaceObject.useLocale)('tagInput');
|
17978
17979
|
var state = (0,external_vue_namespaceObject.reactive)({
|
@@ -18320,6 +18321,7 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
18320
18321
|
if (maxData === -1 || maxData > tagList.value.length) {
|
18321
18322
|
var _ref5 = e !== null && e !== void 0 && e.target ? e.target : curInputValue,
|
18322
18323
|
value = _ref5.value;
|
18324
|
+
chineseInputTemporaryValue = value;
|
18323
18325
|
var charLen = getCharLength(value);
|
18324
18326
|
if (charLen) {
|
18325
18327
|
filterData(value);
|
@@ -18555,7 +18557,7 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
18555
18557
|
e.preventDefault();
|
18556
18558
|
break;
|
18557
18559
|
case 'Backspace':
|
18558
|
-
if (tagInputItemIndex !== 0 && !curInputValue.value) {
|
18560
|
+
if (tagInputItemIndex !== 0 && !curInputValue.value && !chineseInputTemporaryValue) {
|
18559
18561
|
target = listState.selectedTagList[tagInputItemIndex - 1];
|
18560
18562
|
backspaceHandler(tagInputItemIndex, target);
|
18561
18563
|
}
|
@@ -274,13 +274,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
274
274
|
default: boolean;
|
275
275
|
};
|
276
276
|
tagOverflowTips: {
|
277
|
-
type: import("vue").PropType<Partial<import("../directives/tooltips").IOptions>>;
|
278
|
-
* 不显示条件:
|
279
|
-
* 1. 设置不可清除
|
280
|
-
* 2. 禁用时
|
281
|
-
* 3. tag标签为空时
|
282
|
-
* 4. 设置了showClearOnlyHover,且没有hover的时候
|
283
|
-
*/
|
277
|
+
type: import("vue").PropType<Partial<import("../directives/tooltips").IOptions>>;
|
284
278
|
default: () => {};
|
285
279
|
};
|
286
280
|
}, {
|
@@ -614,13 +608,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
614
608
|
default: boolean;
|
615
609
|
};
|
616
610
|
tagOverflowTips: {
|
617
|
-
type: import("vue").PropType<Partial<import("../directives/tooltips").IOptions>>;
|
618
|
-
* 不显示条件:
|
619
|
-
* 1. 设置不可清除
|
620
|
-
* 2. 禁用时
|
621
|
-
* 3. tag标签为空时
|
622
|
-
* 4. 设置了showClearOnlyHover,且没有hover的时候
|
623
|
-
*/
|
611
|
+
type: import("vue").PropType<Partial<import("../directives/tooltips").IOptions>>;
|
624
612
|
default: () => {};
|
625
613
|
};
|
626
614
|
}>> & {
|
package/lib/upload/index.js
CHANGED
@@ -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
|
-
|
12
|
-
|
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,
|
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,
|
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
|
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(
|
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:
|
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
|
-
|
18205
|
-
|
18206
|
-
|
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,
|
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;
|