bkui-vue 2.0.1-beta.26 → 2.0.1-beta.28
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 +37 -37
- package/dist/index.esm.js +9381 -9339
- package/dist/index.umd.js +51 -51
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/index.js +1 -1
- package/lib/scrollbar/index.js +38 -11
- package/lib/scrollbar/scrollbar-core/index.d.ts +17 -17
- package/lib/scrollbar/scrollbar.css +27 -8
- package/lib/scrollbar/scrollbar.less +35 -10
- package/lib/scrollbar/scrollbar.variable.css +27 -8
- package/lib/select/index.d.ts +6 -0
- package/lib/select/index.js +15 -2
- package/lib/select/select.d.ts +2 -0
- package/lib/table/const.d.ts +2 -2
- package/lib/table/hooks/use-column-template.d.ts +2 -2
- package/lib/table/hooks/use-columns.d.ts +15 -8
- package/lib/table/hooks/use-layout.d.ts +2 -2
- package/lib/table/hooks/use-rows.d.ts +7 -7
- package/lib/table/index.js +132 -97
- package/lib/table/props.d.ts +23 -20
- package/lib/table/table.css +52 -9
- package/lib/table/table.less +35 -2
- package/lib/table/table.variable.css +52 -9
- package/lib/table/utils.d.ts +8 -5
- package/lib/table-column/index.js +7 -6
- package/lib/tree/index.js +0 -3
- package/lib/tree/tree.css +27 -8
- package/lib/tree/tree.variable.css +27 -8
- package/lib/virtual-render/index.d.ts +8 -8
- package/lib/virtual-render/index.js +17289 -22
- package/lib/virtual-render/props.d.ts +1 -0
- package/lib/virtual-render/use-fix-top.d.ts +1 -1
- package/lib/virtual-render/v-virtual-render.d.ts +1 -1
- package/lib/virtual-render/virtual-render.css +27 -8
- package/lib/virtual-render/virtual-render.d.ts +4 -4
- package/lib/virtual-render/virtual-render.variable.css +27 -8
- package/package.json +1 -1
@@ -1,18 +1,18 @@
|
|
1
1
|
import { IEmptyObject } from '../const';
|
2
2
|
import { TablePropTypes } from '../props';
|
3
3
|
declare const useRows: (props: TablePropTypes) => {
|
4
|
-
setRowIndex: (row:
|
5
|
-
setRowExpand: (row:
|
6
|
-
isRowChecked: (row:
|
7
|
-
setPageRowList: (rowList:
|
4
|
+
setRowIndex: (row: Record<string, unknown>, index: number) => void;
|
5
|
+
setRowExpand: (row: Record<string, unknown>, isExpand: boolean) => void;
|
6
|
+
isRowChecked: (row: Record<string, unknown>, index: number) => any;
|
7
|
+
setPageRowList: (rowList: Record<string, unknown>[]) => void;
|
8
8
|
clearSelection: () => void;
|
9
9
|
formatDataSchema: () => void;
|
10
|
-
toggleRowSelection: (row:
|
10
|
+
toggleRowSelection: (row: Record<string, unknown>) => void;
|
11
11
|
setRowSelectionAll: (val: boolean) => void;
|
12
|
-
setRowSelection: (row:
|
12
|
+
setRowSelection: (row: Record<string, unknown>, isSelected: boolean, index?: number) => void;
|
13
13
|
setAllRowExpand: (value?: boolean) => void;
|
14
14
|
setTableIsNeedRowSpan: (val: boolean) => void;
|
15
|
-
getRowAttribute: (item: IEmptyObject |
|
15
|
+
getRowAttribute: (item: IEmptyObject | object, attrName: string) => any;
|
16
16
|
getRowSelection: () => any[];
|
17
17
|
getRowIndeterminate: () => any;
|
18
18
|
getRowCheckedAllValue: () => any;
|
package/lib/table/index.js
CHANGED
@@ -17324,6 +17324,8 @@ const shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODUL
|
|
17324
17324
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
17325
17325
|
var external_vue_y = x => () => x
|
17326
17326
|
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 });
|
17327
|
+
// EXTERNAL MODULE: ../../node_modules/lodash/lodash.js
|
17328
|
+
var lodash = __webpack_require__(6635);
|
17327
17329
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
17328
17330
|
function typeof_typeof(o) {
|
17329
17331
|
"@babel/helpers - typeof";
|
@@ -17465,7 +17467,7 @@ var COLUMN_ATTRIBUTE = {
|
|
17465
17467
|
/**
|
17466
17468
|
* Y 轴滚动条宽度
|
17467
17469
|
*/
|
17468
|
-
var SCROLLY_WIDTH =
|
17470
|
+
var SCROLLY_WIDTH = 8;
|
17469
17471
|
/**
|
17470
17472
|
* 默认行高
|
17471
17473
|
*/
|
@@ -17912,8 +17914,6 @@ var tableProps = {
|
|
17912
17914
|
}
|
17913
17915
|
}).def(null)
|
17914
17916
|
};
|
17915
|
-
// EXTERNAL MODULE: ../../node_modules/lodash/lodash.js
|
17916
|
-
var lodash = __webpack_require__(6635);
|
17917
17917
|
;// CONCATENATED MODULE: ../../packages/table/src/components/table-column.tsx
|
17918
17918
|
/*
|
17919
17919
|
* Tencent is pleased to support the open source community by making
|
@@ -17971,12 +17971,13 @@ var TableColumnProp = {
|
|
17971
17971
|
setup: function setup(props, _ref) {
|
17972
17972
|
var slots = _ref.slots;
|
17973
17973
|
var initTableColumns = (0,external_vue_namespaceObject.inject)(PROVIDE_KEY_INIT_COL, function () {});
|
17974
|
+
var lastPropsVal = {};
|
17974
17975
|
(0,external_vue_namespaceObject.watch)(function () {
|
17975
17976
|
return [props];
|
17976
|
-
}, function (
|
17977
|
-
|
17978
|
-
if (!(0,lodash.isEqual)((0,external_vue_namespaceObject.toRaw)(oldVal === null || oldVal === void 0 ? void 0 : oldVal[0]), (0,external_vue_namespaceObject.toRaw)((_newVal$ = newVal === null || newVal === void 0 ? void 0 : newVal[0]) !== null && _newVal$ !== void 0 ? _newVal$ : {}))) {
|
17977
|
+
}, function () {
|
17978
|
+
if (!(0,lodash.isEqual)(lastPropsVal, (0,external_vue_namespaceObject.toRaw)(props))) {
|
17979
17979
|
initTableColumns();
|
17980
|
+
Object.assign(lastPropsVal, (0,external_vue_namespaceObject.toRaw)(props));
|
17980
17981
|
}
|
17981
17982
|
}, {
|
17982
17983
|
immediate: true,
|
@@ -18124,7 +18125,8 @@ var CELL_EVENT_TYPES = defineProperty_defineProperty(defineProperty_defineProper
|
|
18124
18125
|
var afterResize = _ref.afterResize;
|
18125
18126
|
var getColumnAttribute = columns.getColumnAttribute,
|
18126
18127
|
getColumnOrderWidth = columns.getColumnOrderWidth,
|
18127
|
-
setColumnAttribute = columns.setColumnAttribute
|
18128
|
+
setColumnAttribute = columns.setColumnAttribute,
|
18129
|
+
setNextColumnWidth = columns.setNextColumnWidth;
|
18128
18130
|
var getColListener = function getColListener(col) {
|
18129
18131
|
return getColumnAttribute(col, COLUMN_ATTRIBUTE.LISTENERS);
|
18130
18132
|
};
|
@@ -18142,7 +18144,7 @@ var CELL_EVENT_TYPES = defineProperty_defineProperty(defineProperty_defineProper
|
|
18142
18144
|
var dragColumn = null;
|
18143
18145
|
var dragStartOffsetX = 0;
|
18144
18146
|
var dragOffsetX = (0,external_vue_namespaceObject.ref)(-1000);
|
18145
|
-
var ORDER_LIST = [COLUMN_ATTRIBUTE.
|
18147
|
+
var ORDER_LIST = [COLUMN_ATTRIBUTE.WIDTH];
|
18146
18148
|
var stopDefaultEvent = function stopDefaultEvent(e) {
|
18147
18149
|
e.stopImmediatePropagation();
|
18148
18150
|
e.stopPropagation();
|
@@ -18156,8 +18158,8 @@ var CELL_EVENT_TYPES = defineProperty_defineProperty(defineProperty_defineProper
|
|
18156
18158
|
var resolveWidth = getColumnOrderWidth(dragColumn, ORDER_LIST) + diff;
|
18157
18159
|
var minWidth = getColumnOrderWidth(dragColumn, [COLUMN_ATTRIBUTE.COL_MIN_WIDTH]);
|
18158
18160
|
var calcWidth = resolveWidth > minWidth ? resolveWidth : minWidth;
|
18159
|
-
|
18160
|
-
setColumnAttribute(dragColumn, COLUMN_ATTRIBUTE.
|
18161
|
+
setNextColumnWidth(dragColumn, calcWidth);
|
18162
|
+
setColumnAttribute(dragColumn, COLUMN_ATTRIBUTE.WIDTH, calcWidth);
|
18161
18163
|
document.removeEventListener('mouseup', handleMouseUp);
|
18162
18164
|
document.removeEventListener('mousemove', handleMouseMove);
|
18163
18165
|
startX = 0;
|
@@ -18191,7 +18193,7 @@ var CELL_EVENT_TYPES = defineProperty_defineProperty(defineProperty_defineProper
|
|
18191
18193
|
var removeCursor = function removeCursor(target) {
|
18192
18194
|
var _target$style2;
|
18193
18195
|
setNodeCursor.cancel();
|
18194
|
-
(_target$style2 = target.style) === null || _target$style2 === void 0 || _target$style2.removeProperty('cursor');
|
18196
|
+
target === null || target === void 0 || (_target$style2 = target.style) === null || _target$style2 === void 0 || _target$style2.removeProperty('cursor');
|
18195
18197
|
target === null || target === void 0 || target.classList.remove('col-resize-hover');
|
18196
18198
|
};
|
18197
18199
|
var handler = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, EVENTS.MOUSE_DOWN, function (e, column) {
|
@@ -18201,7 +18203,6 @@ var CELL_EVENT_TYPES = defineProperty_defineProperty(defineProperty_defineProper
|
|
18201
18203
|
isMouseDown = true;
|
18202
18204
|
var target = e.target.closest('th');
|
18203
18205
|
setColumnAttribute(column, COLUMN_ATTRIBUTE.COL_IS_DRAG, true);
|
18204
|
-
setColumnAttribute(column, COLUMN_ATTRIBUTE.CALC_WIDTH, target.scrollWidth);
|
18205
18206
|
setNodeCursor(target);
|
18206
18207
|
dragColumn = column;
|
18207
18208
|
startX = e.clientX;
|
@@ -18210,6 +18211,7 @@ var CELL_EVENT_TYPES = defineProperty_defineProperty(defineProperty_defineProper
|
|
18210
18211
|
updateOffsetX(e)();
|
18211
18212
|
document.addEventListener('mouseup', handleMouseUp);
|
18212
18213
|
document.addEventListener('mousemove', handleMouseMove);
|
18214
|
+
target === null || target === void 0 || target.classList.remove('col-resize-hover');
|
18213
18215
|
}), EVENTS.MOUSE_MOVE, function (e, _column) {
|
18214
18216
|
if (isMouseDown && !isDraging) {
|
18215
18217
|
isDraging = true;
|
@@ -18422,7 +18424,7 @@ function v4(options, buf, offset) {
|
|
18422
18424
|
return columnCache.get(ctx);
|
18423
18425
|
};
|
18424
18426
|
var resolveChildNode = function resolveChildNode(node) {
|
18425
|
-
var _node$type, _node$type2;
|
18427
|
+
var _node$type, _node$type2, _node$component;
|
18426
18428
|
if (!node || ((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'Table') {
|
18427
18429
|
return;
|
18428
18430
|
}
|
@@ -18443,35 +18445,45 @@ function v4(options, buf, offset) {
|
|
18443
18445
|
}
|
18444
18446
|
return;
|
18445
18447
|
}
|
18448
|
+
if (node !== null && node !== void 0 && (_node$component = node.component) !== null && _node$component !== void 0 && _node$component.subTree) {
|
18449
|
+
var _node$component2;
|
18450
|
+
resolveChildNode(node === null || node === void 0 || (_node$component2 = node.component) === null || _node$component2 === void 0 ? void 0 : _node$component2.subTree);
|
18451
|
+
return;
|
18452
|
+
}
|
18453
|
+
if (typeof node === 'function') {
|
18454
|
+
return node();
|
18455
|
+
}
|
18446
18456
|
if (Array.isArray(node)) {
|
18447
18457
|
node.forEach(resolveChildNode);
|
18458
|
+
return;
|
18448
18459
|
}
|
18449
18460
|
if (Array.isArray(node === null || node === void 0 ? void 0 : node.children)) {
|
18450
18461
|
node.children.forEach(resolveChildNode);
|
18462
|
+
return;
|
18451
18463
|
}
|
18452
18464
|
if ((0,external_vue_namespaceObject.isVNode)(node) && node !== null && node !== void 0 && node.children && typeof_typeof(node === null || node === void 0 ? void 0 : node.children) === 'object') {
|
18453
18465
|
Object.keys(node.children).forEach(function (key) {
|
18454
18466
|
return resolveChildNode(node.children[key]);
|
18455
18467
|
});
|
18468
|
+
return;
|
18456
18469
|
}
|
18457
|
-
if (typeof node === 'function') {
|
18458
|
-
return node();
|
18459
|
-
}
|
18460
|
-
// if (Array.isArray(node?.subTree)) {
|
18461
|
-
// node.subTree.forEach(resolveChildNode);
|
18462
|
-
// }
|
18463
|
-
return;
|
18464
18470
|
};
|
18465
18471
|
var resolveColumns = function resolveColumns(children) {
|
18466
18472
|
columns.length = 0;
|
18467
18473
|
columnIndex = 0;
|
18468
|
-
var ghostBody = children.find(function (node) {
|
18474
|
+
var ghostBody = children === null || children === void 0 ? void 0 : children.find(function (node) {
|
18469
18475
|
var _node$type3;
|
18470
18476
|
return ((_node$type3 = node.type) === null || _node$type3 === void 0 ? void 0 : _node$type3.name) === 'GhostBody';
|
18471
18477
|
});
|
18472
18478
|
if (ghostBody) {
|
18473
|
-
var _ghostBody$
|
18474
|
-
((_ghostBody$
|
18479
|
+
var _ghostBody$component;
|
18480
|
+
if ((_ghostBody$component = ghostBody.component) !== null && _ghostBody$component !== void 0 && _ghostBody$component.subTree) {
|
18481
|
+
var _ghostBody$component2;
|
18482
|
+
resolveChildNode((_ghostBody$component2 = ghostBody.component) === null || _ghostBody$component2 === void 0 ? void 0 : _ghostBody$component2.subTree);
|
18483
|
+
} else {
|
18484
|
+
var _ghostBody$children$d, _ghostBody$children, _ghostBody$children$d2;
|
18485
|
+
((_ghostBody$children$d = (_ghostBody$children = ghostBody.children) === null || _ghostBody$children === void 0 || (_ghostBody$children$d2 = _ghostBody$children["default"]) === null || _ghostBody$children$d2 === void 0 ? void 0 : _ghostBody$children$d2.call(_ghostBody$children)) !== null && _ghostBody$children$d !== void 0 ? _ghostBody$children$d : []).forEach(resolveChildNode);
|
18486
|
+
}
|
18475
18487
|
}
|
18476
18488
|
columns.sort(function (col1, col2) {
|
18477
18489
|
return col1.index - col2.index;
|
@@ -20061,7 +20073,7 @@ var useColumns = function useColumns(props) {
|
|
20061
20073
|
var colWidth = 0;
|
20062
20074
|
if (/^\d+\.?\d*(px)?$/.test("".concat(col[attrName]))) {
|
20063
20075
|
colWidth = Number("".concat(col[attrName]).replace(/px/, ''));
|
20064
|
-
setColumnAttribute(col, COLUMN_ATTRIBUTE.
|
20076
|
+
setColumnAttribute(col, COLUMN_ATTRIBUTE.WIDTH, colWidth);
|
20065
20077
|
setColumnRect(col, {
|
20066
20078
|
width: colWidth,
|
20067
20079
|
left: null,
|
@@ -20070,7 +20082,7 @@ var useColumns = function useColumns(props) {
|
|
20070
20082
|
}
|
20071
20083
|
if (/^\d+\.?\d*%$/.test("".concat(col[attrName]))) {
|
20072
20084
|
colWidth = Number("".concat(col[attrName]).replace(/%/, '')) / 100 * width;
|
20073
|
-
setColumnAttribute(col, COLUMN_ATTRIBUTE.
|
20085
|
+
setColumnAttribute(col, COLUMN_ATTRIBUTE.WIDTH, colWidth);
|
20074
20086
|
setColumnRect(col, {
|
20075
20087
|
width: colWidth,
|
20076
20088
|
left: null,
|
@@ -20106,7 +20118,7 @@ var useColumns = function useColumns(props) {
|
|
20106
20118
|
var autoWidthList = resolveColWidth(minWidthList, 'minWidth');
|
20107
20119
|
autoWidthList.forEach(function (col) {
|
20108
20120
|
var calcWidth = minColWidth > COL_MIN_WIDTH ? minColWidth : COL_MIN_WIDTH;
|
20109
|
-
setColumnAttribute(col, COLUMN_ATTRIBUTE.
|
20121
|
+
setColumnAttribute(col, COLUMN_ATTRIBUTE.WIDTH, calcWidth);
|
20110
20122
|
setColumnRect(col, {
|
20111
20123
|
width: calcWidth,
|
20112
20124
|
left: null,
|
@@ -20307,6 +20319,9 @@ var useColumns = function useColumns(props) {
|
|
20307
20319
|
var getColumnCalcWidth = function getColumnCalcWidth(column) {
|
20308
20320
|
return getColumnAttribute(column, COLUMN_ATTRIBUTE.CALC_WIDTH);
|
20309
20321
|
};
|
20322
|
+
var getColumnWidth = function getColumnWidth(column) {
|
20323
|
+
return getColumnAttribute(column, COLUMN_ATTRIBUTE.WIDTH);
|
20324
|
+
};
|
20310
20325
|
var setColumnRect = function setColumnRect(col, _ref2) {
|
20311
20326
|
var left = _ref2.left,
|
20312
20327
|
right = _ref2.right,
|
@@ -20351,7 +20366,7 @@ var useColumns = function useColumns(props) {
|
|
20351
20366
|
Object.assign(tableColumnSchema.get(column)[COLUMN_ATTRIBUTE.COL_FILTER_OBJ], option);
|
20352
20367
|
}
|
20353
20368
|
};
|
20354
|
-
var ORDER_LIST = [COLUMN_ATTRIBUTE.
|
20369
|
+
var ORDER_LIST = [COLUMN_ATTRIBUTE.WIDTH];
|
20355
20370
|
/**
|
20356
20371
|
* 获取当前列实际宽度
|
20357
20372
|
* width props中设置的默认宽度
|
@@ -20391,6 +20406,16 @@ var useColumns = function useColumns(props) {
|
|
20391
20406
|
setFilterColumns(column, defineProperty_defineProperty({}, attrName, attrValue));
|
20392
20407
|
}
|
20393
20408
|
};
|
20409
|
+
var setNextColumnWidth = function setNextColumnWidth(col, newWidth) {
|
20410
|
+
var index = visibleColumns.findIndex(function (item) {
|
20411
|
+
return item === col;
|
20412
|
+
});
|
20413
|
+
var diffWidth = getColumnOrderWidth(col) - newWidth;
|
20414
|
+
var nextColumn = visibleColumns[index + 1];
|
20415
|
+
if (nextColumn) {
|
20416
|
+
setColumnAttribute(nextColumn, COLUMN_ATTRIBUTE.WIDTH, getColumnOrderWidth(nextColumn) + diffWidth);
|
20417
|
+
}
|
20418
|
+
};
|
20394
20419
|
/**
|
20395
20420
|
* 设置表格列属性
|
20396
20421
|
* @param col 当前列
|
@@ -20508,6 +20533,7 @@ var useColumns = function useColumns(props) {
|
|
20508
20533
|
getColumnCustomClass: getColumnCustomClass,
|
20509
20534
|
getColumnRefAttribute: getColumnRefAttribute,
|
20510
20535
|
getColumnCalcWidth: getColumnCalcWidth,
|
20536
|
+
getColumnWidth: getColumnWidth,
|
20511
20537
|
resolveEventListener: resolveEventListener,
|
20512
20538
|
setColumnIsHidden: setColumnIsHidden,
|
20513
20539
|
setColumnResizeWidth: setColumnResizeWidth,
|
@@ -20519,6 +20545,7 @@ var useColumns = function useColumns(props) {
|
|
20519
20545
|
setFixedStyle: setFixedStyle,
|
20520
20546
|
setColumnRect: setColumnRect,
|
20521
20547
|
setVisibleColumns: setVisibleColumns,
|
20548
|
+
setNextColumnWidth: setNextColumnWidth,
|
20522
20549
|
resolveColsCalcWidth: resolveColsCalcWidth
|
20523
20550
|
};
|
20524
20551
|
};
|
@@ -20727,7 +20754,7 @@ var useColumns = function useColumns(props) {
|
|
20727
20754
|
var length = fixedRightColumns.value.length;
|
20728
20755
|
for (var i = length - 1; i >= 0; i--) {
|
20729
20756
|
var col = fixedRightColumns.value[i];
|
20730
|
-
var width = columns.
|
20757
|
+
var width = columns.getColumnWidth(col);
|
20731
20758
|
columns.setColumnRect(col, {
|
20732
20759
|
right: right,
|
20733
20760
|
width: width
|
@@ -20739,7 +20766,7 @@ var useColumns = function useColumns(props) {
|
|
20739
20766
|
}
|
20740
20767
|
var left = 0;
|
20741
20768
|
fixedLeftColumns.value.forEach(function (col) {
|
20742
|
-
var width = columns.
|
20769
|
+
var width = columns.getColumnWidth(col);
|
20743
20770
|
columns.setColumnRect(col, {
|
20744
20771
|
left: left,
|
20745
20772
|
width: width
|
@@ -20785,6 +20812,51 @@ const virtual_render_namespaceObject = virtual_render_x({ ["default"]: () => __W
|
|
20785
20812
|
var virtual_render_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
20786
20813
|
var virtual_render_less_y = x => () => x
|
20787
20814
|
const virtual_render_less_namespaceObject = virtual_render_less_x({ });
|
20815
|
+
;// CONCATENATED MODULE: ../../packages/table/src/components/ghost-body.tsx
|
20816
|
+
|
20817
|
+
/*
|
20818
|
+
* Tencent is pleased to support the open source community by making
|
20819
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
20820
|
+
*
|
20821
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
20822
|
+
*
|
20823
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
20824
|
+
*
|
20825
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
20826
|
+
*
|
20827
|
+
* ---------------------------------------------------
|
20828
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
20829
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
20830
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
20831
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
20832
|
+
*
|
20833
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
20834
|
+
* the Software.
|
20835
|
+
*
|
20836
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
20837
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20838
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
20839
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
20840
|
+
* IN THE SOFTWARE.
|
20841
|
+
*/
|
20842
|
+
|
20843
|
+
/* harmony default export */ const ghost_body = ((0,external_vue_namespaceObject.defineComponent)({
|
20844
|
+
name: 'GhostBody',
|
20845
|
+
setup: function setup(_, ctx) {
|
20846
|
+
var columnGhostStyle = {
|
20847
|
+
zIndex: -1,
|
20848
|
+
width: 0,
|
20849
|
+
height: 0,
|
20850
|
+
display: 'none'
|
20851
|
+
};
|
20852
|
+
return function () {
|
20853
|
+
var _ctx$slots$default, _ctx$slots;
|
20854
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
20855
|
+
"style": columnGhostStyle
|
20856
|
+
}, [(_ctx$slots$default = (_ctx$slots = ctx.slots)["default"]) === null || _ctx$slots$default === void 0 ? void 0 : _ctx$slots$default.call(_ctx$slots)]);
|
20857
|
+
};
|
20858
|
+
}
|
20859
|
+
}));
|
20788
20860
|
;// CONCATENATED MODULE: external "../loading"
|
20789
20861
|
var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
20790
20862
|
var loading_y = x => () => x
|
@@ -20869,51 +20941,6 @@ const loading_less_namespaceObject = loading_less_x({ });
|
|
20869
20941
|
renderScrollLoading: renderScrollLoading
|
20870
20942
|
};
|
20871
20943
|
});
|
20872
|
-
;// CONCATENATED MODULE: ../../packages/table/src/components/ghost-body.tsx
|
20873
|
-
|
20874
|
-
/*
|
20875
|
-
* Tencent is pleased to support the open source community by making
|
20876
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
20877
|
-
*
|
20878
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
20879
|
-
*
|
20880
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
20881
|
-
*
|
20882
|
-
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
20883
|
-
*
|
20884
|
-
* ---------------------------------------------------
|
20885
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
20886
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
20887
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
20888
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
20889
|
-
*
|
20890
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
20891
|
-
* the Software.
|
20892
|
-
*
|
20893
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
20894
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20895
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
20896
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
20897
|
-
* IN THE SOFTWARE.
|
20898
|
-
*/
|
20899
|
-
|
20900
|
-
/* harmony default export */ const ghost_body = ((0,external_vue_namespaceObject.defineComponent)({
|
20901
|
-
name: 'GhostBody',
|
20902
|
-
setup: function setup(_, ctx) {
|
20903
|
-
var columnGhostStyle = {
|
20904
|
-
zIndex: -1,
|
20905
|
-
width: 0,
|
20906
|
-
height: 0,
|
20907
|
-
display: 'none'
|
20908
|
-
};
|
20909
|
-
return function () {
|
20910
|
-
var _ctx$slots$default, _ctx$slots;
|
20911
|
-
return (0,external_vue_namespaceObject.createVNode)("div", {
|
20912
|
-
"style": columnGhostStyle
|
20913
|
-
}, [(_ctx$slots$default = (_ctx$slots = ctx.slots)["default"]) === null || _ctx$slots$default === void 0 ? void 0 : _ctx$slots$default.call(_ctx$slots)]);
|
20914
|
-
};
|
20915
|
-
}
|
20916
|
-
}));
|
20917
20944
|
;// CONCATENATED MODULE: ../../packages/table/src/hooks/use-layout.tsx
|
20918
20945
|
|
20919
20946
|
|
@@ -21035,10 +21062,11 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21035
21062
|
var _props$thead$color, _props$thead;
|
21036
21063
|
return {
|
21037
21064
|
'--row-height': "".concat(headHeight.value, "px"),
|
21038
|
-
'--background-color': DEF_COLOR[(_props$thead$color = (_props$thead = props.thead) === null || _props$thead === void 0 ? void 0 : _props$thead.color) !== null && _props$thead$color !== void 0 ? _props$thead$color : IHeadColor.DEF1]
|
21065
|
+
'--background-color': DEF_COLOR[(_props$thead$color = (_props$thead = props.thead) === null || _props$thead === void 0 ? void 0 : _props$thead.color) !== null && _props$thead$color !== void 0 ? _props$thead$color : IHeadColor.DEF1],
|
21066
|
+
paddingRight: props.scrollbar ? null : "".concat(SCROLLY_WIDTH, "px")
|
21039
21067
|
};
|
21040
21068
|
});
|
21041
|
-
var bodyClass = defineProperty_defineProperty({}, resolveClassName('table-body'), true);
|
21069
|
+
var bodyClass = defineProperty_defineProperty(defineProperty_defineProperty({}, resolveClassName('table-body'), true), 'is-bk-scrollbar', props.scrollbar);
|
21042
21070
|
var footerClass = (0,external_vue_namespaceObject.computed)(function () {
|
21043
21071
|
return (0,shared_namespaceObject.classes)(defineProperty_defineProperty(defineProperty_defineProperty({}, resolveClassName('table-footer'), true), 'is-hidden', footHeight.value === 0));
|
21044
21072
|
});
|
@@ -21182,12 +21210,12 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21182
21210
|
"enabled": props.virtualEnabled,
|
21183
21211
|
"lineHeight": lineHeight.value,
|
21184
21212
|
"list": list,
|
21213
|
+
"maxHeight": bodyMaxHeight.value,
|
21185
21214
|
"rowKey": props.rowKey,
|
21186
21215
|
"scrollEvent": true,
|
21187
21216
|
"scrollbar": {
|
21188
21217
|
enabled: props.scrollbar
|
21189
21218
|
},
|
21190
|
-
"maxHeight": bodyMaxHeight.value,
|
21191
21219
|
"throttleDelay": 120,
|
21192
21220
|
"onContentScroll": handleScrollChanged
|
21193
21221
|
}, {
|
@@ -23969,8 +23997,8 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
23969
23997
|
* 计算每一列的实际宽度
|
23970
23998
|
*/
|
23971
23999
|
var computedColumnRect = function computedColumnRect() {
|
23972
|
-
var
|
23973
|
-
var width = (
|
24000
|
+
var _ref, _refRoot$value;
|
24001
|
+
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;
|
23974
24002
|
columns.resolveColsCalcWidth(width);
|
23975
24003
|
resolveFixedColumnStyle();
|
23976
24004
|
};
|
@@ -24037,23 +24065,33 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24037
24065
|
setOffsetRight();
|
24038
24066
|
});
|
24039
24067
|
};
|
24068
|
+
var observerResizing = (0,external_vue_namespaceObject.ref)(false);
|
24069
|
+
var observerResizingTimer = null;
|
24040
24070
|
use_observer_resize(refRoot, function () {
|
24041
|
-
|
24042
|
-
|
24043
|
-
|
24044
|
-
|
24045
|
-
|
24046
|
-
|
24047
|
-
|
24071
|
+
if (!observerResizing.value) {
|
24072
|
+
var _refBody$value2;
|
24073
|
+
observerResizing.value = true;
|
24074
|
+
if ((props.height === '100%' || props.virtualEnabled) && (0,lodash.isElement)(refRoot.value)) {
|
24075
|
+
if (isResizeBodyHeight.value) {
|
24076
|
+
setTimeout(function () {
|
24077
|
+
isResizeBodyHeight.value = false;
|
24078
|
+
});
|
24079
|
+
return;
|
24080
|
+
}
|
24081
|
+
var tableHeight = refRoot.value.offsetHeight;
|
24082
|
+
isResizeBodyHeight.value = true;
|
24083
|
+
setBodyHeight(tableHeight);
|
24084
|
+
setOffsetRight();
|
24048
24085
|
}
|
24049
|
-
|
24050
|
-
isResizeBodyHeight.value = true;
|
24051
|
-
setBodyHeight(tableHeight);
|
24086
|
+
computedColumnRect();
|
24052
24087
|
setOffsetRight();
|
24088
|
+
(_refBody$value2 = refBody.value) === null || _refBody$value2 === void 0 || _refBody$value2.scrollTo(0, 0);
|
24089
|
+
return;
|
24053
24090
|
}
|
24054
|
-
|
24055
|
-
|
24056
|
-
|
24091
|
+
observerResizingTimer && clearTimeout(observerResizingTimer);
|
24092
|
+
observerResizingTimer = setTimeout(function () {
|
24093
|
+
observerResizing.value = false;
|
24094
|
+
});
|
24057
24095
|
});
|
24058
24096
|
(0,external_vue_namespaceObject.watch)(function () {
|
24059
24097
|
return [dragOffsetX.value];
|
@@ -24090,12 +24128,9 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24090
24128
|
return [pagination.options.count, pagination.options.limit, pagination.options.current, props.data];
|
24091
24129
|
}, function () {
|
24092
24130
|
setTableData();
|
24093
|
-
(0,external_vue_namespaceObject.nextTick)(function () {
|
24094
|
-
var _refBody$value3;
|
24095
|
-
(_refBody$value3 = refBody.value) === null || _refBody$value3 === void 0 || _refBody$value3.scrollTo(0, 1);
|
24096
|
-
});
|
24097
24131
|
}, {
|
24098
|
-
immediate: true
|
24132
|
+
immediate: true,
|
24133
|
+
deep: true
|
24099
24134
|
});
|
24100
24135
|
ctx.expose({
|
24101
24136
|
setRowExpand: rows.setRowExpand,
|
package/lib/table/props.d.ts
CHANGED
@@ -44,12 +44,12 @@ export declare enum FixedEnum {
|
|
44
44
|
}
|
45
45
|
export declare const fixedType: import("vue-types").VueTypeValidableDef<"left" | "right">;
|
46
46
|
export type IOverflowTooltipOption = {
|
47
|
-
content: ((col: Column, row:
|
48
|
-
disabled?: ((col: Column, row:
|
47
|
+
content: ((col: Column, row: Record<string, object>) => string) | string;
|
48
|
+
disabled?: ((col: Column, row: Record<string, object>) => boolean) | boolean;
|
49
49
|
allowHtml?: boolean;
|
50
50
|
watchCellResize?: boolean;
|
51
51
|
mode?: `${OverflowModeEnum}`;
|
52
|
-
popoverOption?:
|
52
|
+
popoverOption?: Record<string, object>;
|
53
53
|
resizerWay?: ResizerWay;
|
54
54
|
showHead?: boolean;
|
55
55
|
};
|
@@ -61,16 +61,19 @@ export type ISortOption = {
|
|
61
61
|
};
|
62
62
|
export declare const ISortType: import("vue-types").VueTypeDef<ISortPropShape>;
|
63
63
|
export type ISortShape = {
|
64
|
-
sortFn?:
|
64
|
+
sortFn?: (...args: any[]) => boolean;
|
65
65
|
sortScope?: SortScope;
|
66
66
|
value?: SORT_OPTION;
|
67
67
|
};
|
68
68
|
export type ISortPropShape = ISortShape | boolean | string;
|
69
69
|
export type IFilterShape = {
|
70
|
-
list:
|
71
|
-
|
70
|
+
list: {
|
71
|
+
label: string;
|
72
|
+
value: string;
|
73
|
+
}[];
|
74
|
+
filterFn?: (...args: any[]) => boolean;
|
72
75
|
match?: FullEnum;
|
73
|
-
checked?:
|
76
|
+
checked?: string[];
|
74
77
|
filterScope?: SortScope;
|
75
78
|
btnSave?: boolean | string;
|
76
79
|
btnReset?: boolean | string;
|
@@ -119,12 +122,12 @@ export type Field = {
|
|
119
122
|
export type LabelFunctionString = ((_column: any, _index: any) => JSX.Element | boolean | number | string) | boolean | number | string;
|
120
123
|
export declare const LabelFunctionStringType: import("vue-types").VueTypeDef<LabelFunctionString>;
|
121
124
|
export type HeadRenderArgs = {
|
122
|
-
cell?:
|
123
|
-
data?:
|
124
|
-
row?:
|
125
|
+
cell?: Record<string, object>;
|
126
|
+
data?: Record<string, object>[];
|
127
|
+
row?: Record<string, object>;
|
125
128
|
column: Column;
|
126
129
|
index: number;
|
127
|
-
rows?:
|
130
|
+
rows?: Record<string, object>[];
|
128
131
|
};
|
129
132
|
export type RenderFunctionString = (args: HeadRenderArgs) => JSX.Element | boolean | number | string;
|
130
133
|
export declare const RenderFunctionStringType: import("vue-types").VueTypeDef<RenderFunctionString>;
|
@@ -135,11 +138,11 @@ export type SpanFunctionString = (({ column, colIndex, row, rowIndex }: {
|
|
135
138
|
rowIndex: any;
|
136
139
|
}) => number) | number;
|
137
140
|
export declare const SpanFunctionStringType: import("vue-types").VueTypeDef<SpanFunctionString>;
|
138
|
-
export type RowClassFunctionString = ((row:
|
141
|
+
export type RowClassFunctionString = ((row: Record<string, object>) => string) | string;
|
139
142
|
export declare const RowClassFunctionStringType: import("vue-types").VueTypeDef<RowClassFunctionString>;
|
140
|
-
export type RowHeightFunctionNumber = ((
|
143
|
+
export type RowHeightFunctionNumber = ((type: string, row: Record<string, object>, rowIndex: number, size?: any) => number) | number;
|
141
144
|
export declare const RowHeightFunctionNumberType: import("vue-types").VueTypeDef<RowHeightFunctionNumber>;
|
142
|
-
type FunctionNumber =
|
145
|
+
type FunctionNumber = ((...args: any[]) => void) | number;
|
143
146
|
export declare const FunctionNumberType: import("vue-types").VueTypeDef<FunctionNumber>;
|
144
147
|
type StringNumber = number | string;
|
145
148
|
export declare const StringNumberType: (val: number | string) => import("vue-types").VueTypeDef<StringNumber> & {
|
@@ -186,7 +189,7 @@ export declare const IColumnProp: import("vue-types").VueTypeDef<Column>;
|
|
186
189
|
export type Thead = {
|
187
190
|
height?: number;
|
188
191
|
isShow?: boolean;
|
189
|
-
cellFn?:
|
192
|
+
cellFn?: (...args: any[]) => void;
|
190
193
|
color?: IHeadColor | string;
|
191
194
|
};
|
192
195
|
export type Columns = ReadonlyArray<Column>;
|
@@ -195,7 +198,7 @@ export type GroupColumn = {
|
|
195
198
|
calcWidth?: number;
|
196
199
|
resizeWidth?: number;
|
197
200
|
isHidden?: boolean;
|
198
|
-
listeners?: Map<string, any>;
|
201
|
+
listeners?: Map<string, (...args: any[]) => void>;
|
199
202
|
} & Column;
|
200
203
|
export type IColumnActive = {
|
201
204
|
index: number;
|
@@ -203,21 +206,21 @@ export type IColumnActive = {
|
|
203
206
|
};
|
204
207
|
export type IReactiveProp = {
|
205
208
|
activeColumns: IColumnActive[];
|
206
|
-
rowActions: Record<string,
|
209
|
+
rowActions: Record<string, object>;
|
207
210
|
scrollTranslateY: number;
|
208
211
|
scrollTranslateX: number;
|
209
|
-
pos: Record<string,
|
212
|
+
pos: Record<string, object>;
|
210
213
|
settings: Settings | boolean;
|
211
214
|
setting: {
|
212
215
|
size: string;
|
213
216
|
height: number;
|
214
217
|
};
|
215
|
-
defaultSort: Record<string,
|
218
|
+
defaultSort: Record<string, object>;
|
216
219
|
};
|
217
220
|
export type Colgroups = Column & {
|
218
221
|
calcWidth: number;
|
219
222
|
resizeWidth: number;
|
220
|
-
listeners: Map<string,
|
223
|
+
listeners: Map<string, (...args: any[]) => void>;
|
221
224
|
};
|
222
225
|
export declare enum IColSortBehavior {
|
223
226
|
/**
|