bkui-vue 2.0.1-beta.28.table.1 → 2.0.1-beta.29
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 +60 -60
- package/dist/index.esm.js +9949 -10013
- package/dist/index.umd.js +60 -60
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/index.js +1 -1
- package/lib/table/hooks/use-columns.d.ts +2 -6
- package/lib/table/hooks/use-head.d.ts +0 -1
- package/lib/table/hooks/use-layout.d.ts +0 -1
- package/lib/table/hooks/use-rows.d.ts +3 -1
- package/lib/table/index.js +84 -208
- package/lib/table/props.d.ts +1 -10
- package/lib/table/table.css +1 -12
- package/lib/table/table.less +1 -17
- package/lib/table/table.variable.css +1 -12
- package/lib/table/utils.d.ts +2 -2
- package/lib/tree/index.d.ts +12 -4
- package/lib/tree/index.js +3 -3
- package/lib/tree/props.d.ts +9 -5
- package/lib/tree/tree.d.ts +6 -2
- package/lib/tree/use-node-action.d.ts +8 -8
- package/lib/tree/use-node-attribute.d.ts +42 -34
- package/package.json +1 -1
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.
|
7
|
+
export const version = "2.0.1-beta.29";
|
8
8
|
window.__bkui_vue_version__ = version;
|
@@ -1,19 +1,16 @@
|
|
1
1
|
import { IEmptyObject } from '../const';
|
2
|
-
import { Column,
|
2
|
+
import { Column, Settings, TablePropTypes } from '../props';
|
3
3
|
declare const useColumns: (props: TablePropTypes) => {
|
4
4
|
needColSpan: import("vue").ComputedRef<boolean>;
|
5
5
|
needRowSpan: import("vue").ComputedRef<boolean>;
|
6
6
|
tableColumnSchema: WeakMap<object, any> & Omit<WeakMap<object, any>, keyof WeakMap<any, any>>;
|
7
7
|
tableColumnList: any[];
|
8
8
|
visibleColumns: Column[];
|
9
|
-
debounceUpdateColumns: import("lodash").DebouncedFunc<(columns: any
|
9
|
+
debounceUpdateColumns: import("lodash").DebouncedFunc<(columns: any) => void>;
|
10
10
|
sortColumns: any[];
|
11
11
|
filterColumns: any[];
|
12
|
-
columnGroup: Column[][];
|
13
|
-
columnGroupMap: WeakMap<Column, IHeadGroup>;
|
14
12
|
clearColumnSort: () => void;
|
15
13
|
formatColumns: () => void;
|
16
|
-
flatColumnTemplate: (cols: Column[]) => any[];
|
17
14
|
isHiddenColumn: (col: Column) => any;
|
18
15
|
getColumnId: (col: Column) => any;
|
19
16
|
getColumnOrderWidth: (col: Column, orders?: string[]) => number;
|
@@ -36,7 +33,6 @@ declare const useColumns: (props: TablePropTypes) => {
|
|
36
33
|
getColumnRefAttribute: (col: Column | IEmptyObject, attributeName: string) => any;
|
37
34
|
getColumnCalcWidth: (column: Column) => any;
|
38
35
|
getColumnWidth: (column: Column) => any;
|
39
|
-
getGroupAttribute: (group: Column) => IHeadGroup;
|
40
36
|
resolveEventListener: (col: Column) => Record<string, (...args: any[]) => void> & {
|
41
37
|
[x: string]: (e: MouseEvent) => void;
|
42
38
|
};
|
@@ -13,7 +13,6 @@ declare const _default: (props: TablePropTypes, ctx: any) => {
|
|
13
13
|
setFixedColumns: (values: Column[]) => void;
|
14
14
|
setOffsetRight: () => void;
|
15
15
|
setLineHeight: (val: number) => void;
|
16
|
-
setHeaderRowCount: (val: number) => void;
|
17
16
|
initRootStyleVars: () => void;
|
18
17
|
refRoot: Ref<HTMLElement>;
|
19
18
|
refHead: Ref<HTMLElement>;
|
@@ -5,6 +5,7 @@ declare const useRows: (props: TablePropTypes) => {
|
|
5
5
|
setRowExpand: (row: Record<string, unknown>, isExpand: boolean) => void;
|
6
6
|
isRowChecked: (row: Record<string, unknown>, index: number) => any;
|
7
7
|
setPageRowList: (rowList: Record<string, unknown>[]) => void;
|
8
|
+
setTableRowList: (data: unknown[]) => void;
|
8
9
|
clearSelection: () => void;
|
9
10
|
formatDataSchema: () => void;
|
10
11
|
toggleRowSelection: (row: Record<string, unknown>) => void;
|
@@ -18,7 +19,8 @@ declare const useRows: (props: TablePropTypes) => {
|
|
18
19
|
getRowCheckedAllValue: () => any;
|
19
20
|
changePageRowIndex: (sourceIndex: any, targetIndex: any) => void;
|
20
21
|
toggleAllSelection: (value?: boolean) => void;
|
21
|
-
tableRowList: import("vue").
|
22
|
+
tableRowList: import("vue").Ref<any[]>;
|
23
|
+
tableRowSchema: WeakMap<object, any> & Omit<WeakMap<object, any>, keyof WeakMap<any, any>>;
|
22
24
|
pageRowList: any[];
|
23
25
|
};
|
24
26
|
export type UseRows = ReturnType<typeof useRows>;
|
package/lib/table/index.js
CHANGED
@@ -18423,65 +18423,51 @@ function v4(options, buf, offset) {
|
|
18423
18423
|
}
|
18424
18424
|
return columnCache.get(ctx);
|
18425
18425
|
};
|
18426
|
-
var
|
18427
|
-
var _node$component;
|
18426
|
+
var resolveChildNode = function resolveChildNode(node) {
|
18427
|
+
var _node$type, _node$type2, _node$component;
|
18428
|
+
if (!node || ((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'Table') {
|
18429
|
+
return;
|
18430
|
+
}
|
18431
|
+
if (((_node$type2 = node.type) === null || _node$type2 === void 0 ? void 0 : _node$type2.name) === 'TableColumn') {
|
18432
|
+
var _node$props$render, _node$children;
|
18433
|
+
var resolveProp = Object.assign({
|
18434
|
+
index: columnIndex
|
18435
|
+
}, copyProps(node.props), {
|
18436
|
+
field: node.props.prop || node.props.field,
|
18437
|
+
render: (_node$props$render = node.props.render) !== null && _node$props$render !== void 0 ? _node$props$render : (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"],
|
18438
|
+
uniqueId: getNodeCtxUid(node)
|
18439
|
+
});
|
18440
|
+
if (!columns.some(function (col) {
|
18441
|
+
return col.uniqueId === resolveProp.uniqueId;
|
18442
|
+
})) {
|
18443
|
+
columns.push((0,external_vue_namespaceObject.unref)(resolveProp));
|
18444
|
+
columnIndex = columnIndex + 1;
|
18445
|
+
}
|
18446
|
+
return;
|
18447
|
+
}
|
18428
18448
|
if (node !== null && node !== void 0 && (_node$component = node.component) !== null && _node$component !== void 0 && _node$component.subTree) {
|
18429
18449
|
var _node$component2;
|
18430
|
-
resolveChildNode(node === null || node === void 0 || (_node$component2 = node.component) === null || _node$component2 === void 0 ? void 0 : _node$component2.subTree
|
18450
|
+
resolveChildNode(node === null || node === void 0 || (_node$component2 = node.component) === null || _node$component2 === void 0 ? void 0 : _node$component2.subTree);
|
18431
18451
|
return;
|
18432
18452
|
}
|
18433
18453
|
if (typeof node === 'function') {
|
18434
18454
|
return node();
|
18435
18455
|
}
|
18436
18456
|
if (Array.isArray(node)) {
|
18437
|
-
node.forEach(
|
18438
|
-
return resolveChildNode(c, rootNode);
|
18439
|
-
});
|
18457
|
+
node.forEach(resolveChildNode);
|
18440
18458
|
return;
|
18441
18459
|
}
|
18442
18460
|
if (Array.isArray(node === null || node === void 0 ? void 0 : node.children)) {
|
18443
|
-
node.children.forEach(
|
18444
|
-
return resolveChildNode(c, rootNode);
|
18445
|
-
});
|
18461
|
+
node.children.forEach(resolveChildNode);
|
18446
18462
|
return;
|
18447
18463
|
}
|
18448
|
-
if (
|
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') {
|
18449
18465
|
Object.keys(node.children).forEach(function (key) {
|
18450
|
-
return resolveChildNode(node.children[key]
|
18466
|
+
return resolveChildNode(node.children[key]);
|
18451
18467
|
});
|
18452
18468
|
return;
|
18453
18469
|
}
|
18454
18470
|
};
|
18455
|
-
var resolveChildNode = function resolveChildNode(node, parent) {
|
18456
|
-
var _node$type, _node$type2;
|
18457
|
-
var rootNode = parent;
|
18458
|
-
if (!node || ((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'Table') {
|
18459
|
-
return;
|
18460
|
-
}
|
18461
|
-
if (((_node$type2 = node.type) === null || _node$type2 === void 0 ? void 0 : _node$type2.name) === 'TableColumn') {
|
18462
|
-
var _node$props$render, _node$children, _parent$children;
|
18463
|
-
var resolveProp = Object.assign({
|
18464
|
-
index: columnIndex
|
18465
|
-
}, copyProps(node.props), {
|
18466
|
-
field: node.props.prop || node.props.field,
|
18467
|
-
render: (_node$props$render = node.props.render) !== null && _node$props$render !== void 0 ? _node$props$render : (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"],
|
18468
|
-
uniqueId: getNodeCtxUid(node),
|
18469
|
-
children: []
|
18470
|
-
});
|
18471
|
-
var targetColumns = (_parent$children = parent === null || parent === void 0 ? void 0 : parent.children) !== null && _parent$children !== void 0 ? _parent$children : columns;
|
18472
|
-
if (!targetColumns.some(function (col) {
|
18473
|
-
return col.uniqueId === resolveProp.uniqueId;
|
18474
|
-
})) {
|
18475
|
-
targetColumns.push(resolveProp);
|
18476
|
-
columnIndex = columnIndex + 1;
|
18477
|
-
if (node.children) {
|
18478
|
-
resolveNodeChilren(node, resolveProp, true);
|
18479
|
-
}
|
18480
|
-
}
|
18481
|
-
return;
|
18482
|
-
}
|
18483
|
-
resolveNodeChilren(node, rootNode);
|
18484
|
-
};
|
18485
18471
|
var resolveColumns = function resolveColumns(children) {
|
18486
18472
|
columns.length = 0;
|
18487
18473
|
columnIndex = 0;
|
@@ -18496,9 +18482,7 @@ function v4(options, buf, offset) {
|
|
18496
18482
|
resolveChildNode((_ghostBody$component2 = ghostBody.component) === null || _ghostBody$component2 === void 0 ? void 0 : _ghostBody$component2.subTree);
|
18497
18483
|
} else {
|
18498
18484
|
var _ghostBody$children$d, _ghostBody$children, _ghostBody$children$d2;
|
18499
|
-
((_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(
|
18500
|
-
return resolveChildNode(c);
|
18501
|
-
});
|
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);
|
18502
18486
|
}
|
18503
18487
|
}
|
18504
18488
|
columns.sort(function (col1, col2) {
|
@@ -20059,8 +20043,6 @@ var useColumns = function useColumns(props) {
|
|
20059
20043
|
var uuid = esm_browser_v4();
|
20060
20044
|
var sortColumns = (0,external_vue_namespaceObject.reactive)([]);
|
20061
20045
|
var filterColumns = (0,external_vue_namespaceObject.reactive)([]);
|
20062
|
-
var columnGroup = (0,external_vue_namespaceObject.reactive)([]);
|
20063
|
-
var columnGroupMap = new WeakMap();
|
20064
20046
|
/**
|
20065
20047
|
* 用来记录列的排序状态
|
20066
20048
|
* @param col
|
@@ -20270,81 +20252,6 @@ var useColumns = function useColumns(props) {
|
|
20270
20252
|
};
|
20271
20253
|
return filterFn;
|
20272
20254
|
};
|
20273
|
-
/**
|
20274
|
-
* 格式化Column嵌套配置,支持多表头设置
|
20275
|
-
* @param cols
|
20276
|
-
*/
|
20277
|
-
var flatColumnTemplate = function flatColumnTemplate(cols) {
|
20278
|
-
columnGroup.length = 0;
|
20279
|
-
var maxDepth = 0;
|
20280
|
-
var targetColumns = [];
|
20281
|
-
var getMaxDepth = function getMaxDepth(root) {
|
20282
|
-
var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
20283
|
-
if (root.length && maxDepth < depth) {
|
20284
|
-
maxDepth = depth;
|
20285
|
-
}
|
20286
|
-
root.forEach(function (col) {
|
20287
|
-
var _col$children;
|
20288
|
-
return getMaxDepth((_col$children = col.children) !== null && _col$children !== void 0 ? _col$children : [], depth + 1);
|
20289
|
-
});
|
20290
|
-
};
|
20291
|
-
getMaxDepth(cols);
|
20292
|
-
var updateParentThColspan = function updateParentThColspan(col, count) {
|
20293
|
-
if (col) {
|
20294
|
-
var colMap = columnGroupMap.get(col);
|
20295
|
-
colMap.thColspan = colMap.thColspan + count;
|
20296
|
-
colMap.offsetLeft = colMap.offsetLeft + count;
|
20297
|
-
updateParentThColspan(colMap.parent, count);
|
20298
|
-
}
|
20299
|
-
};
|
20300
|
-
var foreachAllColumns = function foreachAllColumns(column, depth, parent, left) {
|
20301
|
-
var _col$children$length, _col$children2, _col$children$length2, _col$children3, _col$children$length3, _col$children4, _col$children$length4, _col$children5, _col$children6;
|
20302
|
-
var col = (0,external_vue_namespaceObject.toRaw)(column);
|
20303
|
-
var leftColumnCount = left;
|
20304
|
-
if (columnGroup[depth] === undefined) {
|
20305
|
-
columnGroup[depth] = [];
|
20306
|
-
}
|
20307
|
-
var isGroup = !!((_col$children$length = (_col$children2 = col.children) === null || _col$children2 === void 0 ? void 0 : _col$children2.length) !== null && _col$children$length !== void 0 ? _col$children$length : false);
|
20308
|
-
if (!((_col$children$length2 = (_col$children3 = col.children) === null || _col$children3 === void 0 ? void 0 : _col$children3.length) !== null && _col$children$length2 !== void 0 ? _col$children$length2 : false)) {
|
20309
|
-
targetColumns.push(col);
|
20310
|
-
}
|
20311
|
-
if (!columnGroupMap.has(col)) {
|
20312
|
-
columnGroupMap.set(col, {
|
20313
|
-
thColspan: 1,
|
20314
|
-
thRowspan: 1,
|
20315
|
-
isGroup: isGroup,
|
20316
|
-
offsetLeft: left
|
20317
|
-
});
|
20318
|
-
}
|
20319
|
-
var colMap = columnGroupMap.get(col);
|
20320
|
-
var childLength = (_col$children$length3 = (_col$children4 = col.children) === null || _col$children4 === void 0 ? void 0 : _col$children4.length) !== null && _col$children$length3 !== void 0 ? _col$children$length3 : 0;
|
20321
|
-
var thColspan = (_col$children$length4 = (_col$children5 = col.children) === null || _col$children5 === void 0 ? void 0 : _col$children5.length) !== null && _col$children$length4 !== void 0 ? _col$children$length4 : 1;
|
20322
|
-
var thRowspan = childLength > 0 ? 1 : maxDepth - depth;
|
20323
|
-
var offsetLeft = leftColumnCount + (childLength > 0 ? childLength - 1 : 0);
|
20324
|
-
Object.assign(colMap, {
|
20325
|
-
thColspan: thColspan > 0 ? thColspan : 1,
|
20326
|
-
parent: parent,
|
20327
|
-
thRowspan: thRowspan,
|
20328
|
-
offsetLeft: offsetLeft
|
20329
|
-
});
|
20330
|
-
columnGroup[depth].push(col);
|
20331
|
-
if (thColspan > 1) {
|
20332
|
-
updateParentThColspan(parent, thColspan - 1);
|
20333
|
-
}
|
20334
|
-
(_col$children6 = col.children) === null || _col$children6 === void 0 || _col$children6.forEach(function (c, index) {
|
20335
|
-
leftColumnCount = leftColumnCount + foreachAllColumns(c, depth + 1, col, leftColumnCount + index);
|
20336
|
-
});
|
20337
|
-
return childLength > 0 ? childLength - 1 : 0;
|
20338
|
-
};
|
20339
|
-
var leftColumnCount = 0;
|
20340
|
-
cols.forEach(function (col, index) {
|
20341
|
-
leftColumnCount = leftColumnCount + foreachAllColumns(col, 0, null, leftColumnCount + index);
|
20342
|
-
});
|
20343
|
-
return targetColumns;
|
20344
|
-
};
|
20345
|
-
var getGroupAttribute = function getGroupAttribute(group) {
|
20346
|
-
return columnGroupMap.get(group);
|
20347
|
-
};
|
20348
20255
|
/**
|
20349
20256
|
* Format columns
|
20350
20257
|
* @param columns
|
@@ -20429,12 +20336,11 @@ var useColumns = function useColumns(props) {
|
|
20429
20336
|
};
|
20430
20337
|
setColumnAttribute(col, COLUMN_ATTRIBUTE.COL_RECT, target);
|
20431
20338
|
};
|
20432
|
-
var debounceUpdateColumns = (0,lodash.debounce)(function (columns
|
20339
|
+
var debounceUpdateColumns = (0,lodash.debounce)(function (columns) {
|
20433
20340
|
tableColumnList.length = 0;
|
20434
|
-
tableColumnList.push.apply(tableColumnList, _toConsumableArray(
|
20341
|
+
tableColumnList.push.apply(tableColumnList, _toConsumableArray(columns));
|
20435
20342
|
formatColumns();
|
20436
20343
|
setVisibleColumns();
|
20437
|
-
onComplete === null || onComplete === void 0 || onComplete();
|
20438
20344
|
});
|
20439
20345
|
var setColumnIsHidden = function setColumnIsHidden(column) {
|
20440
20346
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
@@ -20588,6 +20494,13 @@ var useColumns = function useColumns(props) {
|
|
20588
20494
|
}
|
20589
20495
|
setColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_ACTIVE, active);
|
20590
20496
|
};
|
20497
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
20498
|
+
return [props.columns];
|
20499
|
+
}, function () {
|
20500
|
+
debounceUpdateColumns(props.columns);
|
20501
|
+
}, {
|
20502
|
+
immediate: true
|
20503
|
+
});
|
20591
20504
|
/**
|
20592
20505
|
* 清理列排序
|
20593
20506
|
* @param reset 是否重置表格数据
|
@@ -20607,11 +20520,8 @@ var useColumns = function useColumns(props) {
|
|
20607
20520
|
debounceUpdateColumns: debounceUpdateColumns,
|
20608
20521
|
sortColumns: sortColumns,
|
20609
20522
|
filterColumns: filterColumns,
|
20610
|
-
columnGroup: columnGroup,
|
20611
|
-
columnGroupMap: columnGroupMap,
|
20612
20523
|
clearColumnSort: clearColumnSort,
|
20613
20524
|
formatColumns: formatColumns,
|
20614
|
-
flatColumnTemplate: flatColumnTemplate,
|
20615
20525
|
isHiddenColumn: isHiddenColumn,
|
20616
20526
|
getColumnId: getColumnId,
|
20617
20527
|
getColumnOrderWidth: getColumnOrderWidth,
|
@@ -20624,7 +20534,6 @@ var useColumns = function useColumns(props) {
|
|
20624
20534
|
getColumnRefAttribute: getColumnRefAttribute,
|
20625
20535
|
getColumnCalcWidth: getColumnCalcWidth,
|
20626
20536
|
getColumnWidth: getColumnWidth,
|
20627
|
-
getGroupAttribute: getGroupAttribute,
|
20628
20537
|
resolveEventListener: resolveEventListener,
|
20629
20538
|
setColumnIsHidden: setColumnIsHidden,
|
20630
20539
|
setColumnResizeWidth: setColumnResizeWidth,
|
@@ -21088,7 +20997,6 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21088
20997
|
var layout = (0,external_vue_namespaceObject.reactive)({});
|
21089
20998
|
var fixedColumns = (0,external_vue_namespaceObject.reactive)([]);
|
21090
20999
|
var lineHeight = (0,external_vue_namespaceObject.ref)((_props$rowHeight = props.rowHeight) !== null && _props$rowHeight !== void 0 ? _props$rowHeight : LINE_HEIGHT);
|
21091
|
-
var headerRowCount = (0,external_vue_namespaceObject.ref)(1);
|
21092
21000
|
var fixedBottomHeight = (0,external_vue_namespaceObject.computed)(function () {
|
21093
21001
|
var _props$fixedBottom, _props$fixedBottom$he, _props$fixedBottom2, _props$fixedBottom$he2, _props$fixedBottom3;
|
21094
21002
|
return ((_props$fixedBottom = props.fixedBottom) === null || _props$fixedBottom === void 0 ? void 0 : _props$fixedBottom.position) === 'relative' ? (_props$fixedBottom$he = (_props$fixedBottom2 = props.fixedBottom) === null || _props$fixedBottom2 === void 0 ? void 0 : _props$fixedBottom2.height) !== null && _props$fixedBottom$he !== void 0 ? _props$fixedBottom$he : LINE_HEIGHT : (_props$fixedBottom$he2 = (_props$fixedBottom3 = props.fixedBottom) === null || _props$fixedBottom3 === void 0 ? void 0 : _props$fixedBottom3.height) !== null && _props$fixedBottom$he2 !== void 0 ? _props$fixedBottom$he2 : 0;
|
@@ -21108,7 +21016,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21108
21016
|
};
|
21109
21017
|
});
|
21110
21018
|
var headClass = (0,external_vue_namespaceObject.computed)(function () {
|
21111
|
-
return (0,shared_namespaceObject.classes)(defineProperty_defineProperty(defineProperty_defineProperty(
|
21019
|
+
return (0,shared_namespaceObject.classes)(defineProperty_defineProperty(defineProperty_defineProperty({}, resolveClassName('table-head'), true), 'has-settings', !!props.settings));
|
21112
21020
|
});
|
21113
21021
|
var setFixedColumnShawdow = function setFixedColumnShawdow() {
|
21114
21022
|
var _refRoot$value, _refRoot$value2;
|
@@ -21130,9 +21038,6 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21130
21038
|
translateX.value = val;
|
21131
21039
|
setRootStyleVars();
|
21132
21040
|
};
|
21133
|
-
var setHeaderRowCount = function setHeaderRowCount(val) {
|
21134
|
-
headerRowCount.value = val;
|
21135
|
-
};
|
21136
21041
|
var setTranslateY = function setTranslateY(val) {
|
21137
21042
|
translateY.value = val;
|
21138
21043
|
setRootStyleVars();
|
@@ -21151,7 +21056,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21151
21056
|
};
|
21152
21057
|
var config = resolveHeadConfig(props);
|
21153
21058
|
var headHeight = (0,external_vue_namespaceObject.computed)(function () {
|
21154
|
-
return resolvePropVal(config, 'height', ['thead'])
|
21059
|
+
return resolvePropVal(config, 'height', ['thead']);
|
21155
21060
|
});
|
21156
21061
|
var headStyle = (0,external_vue_namespaceObject.computed)(function () {
|
21157
21062
|
var _props$thead$color, _props$thead;
|
@@ -21357,7 +21262,6 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21357
21262
|
setFixedColumns: setFixedColumns,
|
21358
21263
|
setOffsetRight: setOffsetRight,
|
21359
21264
|
setLineHeight: setLineHeight,
|
21360
|
-
setHeaderRowCount: setHeaderRowCount,
|
21361
21265
|
initRootStyleVars: initRootStyleVars,
|
21362
21266
|
refRoot: refRoot,
|
21363
21267
|
refHead: refHead,
|
@@ -22652,7 +22556,6 @@ function use_head_isSlot(s) {
|
|
22652
22556
|
index = _ref.index;
|
22653
22557
|
var sortType = (0,external_vue_namespaceObject.ref)(columns.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_TYPE));
|
22654
22558
|
var sortActive = (0,external_vue_namespaceObject.ref)(columns.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_ACTIVE));
|
22655
|
-
var rawColumn = (0,external_vue_namespaceObject.toRaw)(column);
|
22656
22559
|
/**
|
22657
22560
|
* 点击排序事件
|
22658
22561
|
* @param sortFn 排序函数
|
@@ -22829,36 +22732,14 @@ function use_head_isSlot(s) {
|
|
22829
22732
|
var headStyle = Object.assign(columns.getFixedStlye(column), {
|
22830
22733
|
'--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]
|
22831
22734
|
});
|
22832
|
-
var
|
22833
|
-
var classList = (0,external_vue_namespaceObject.computed)(function () {
|
22834
|
-
return [columns.getHeadColumnClass(column, index), columns.getColumnCustomClass(column), column.align || props.headerAlign || props.align, {
|
22835
|
-
'is-last-child': (group === null || group === void 0 ? void 0 : group.offsetLeft) + 1 === columns.visibleColumns.length
|
22836
|
-
}];
|
22837
|
-
});
|
22838
|
-
var groupClass = (0,external_vue_namespaceObject.computed)(function () {
|
22839
|
-
return classList.value.concat([{
|
22840
|
-
'is-head-group': group === null || group === void 0 ? void 0 : group.isGroup,
|
22841
|
-
'is-head-group-child': !!(group !== null && group !== void 0 && group.parent)
|
22842
|
-
}]);
|
22843
|
-
});
|
22844
|
-
var getGroupRender = function getGroupRender() {
|
22845
|
-
return resolvePropVal(column, 'label', [index, column]);
|
22846
|
-
};
|
22735
|
+
var classList = [columns.getHeadColumnClass(column, index), columns.getColumnCustomClass(column), column.align || props.headerAlign || props.align];
|
22847
22736
|
var getTH = function getTH() {
|
22848
|
-
if (group !== null && group !== void 0 && group.isGroup) {
|
22849
|
-
return (0,external_vue_namespaceObject.createVNode)("th", {
|
22850
|
-
"style": headStyle,
|
22851
|
-
"class": groupClass.value,
|
22852
|
-
"colspan": group === null || group === void 0 ? void 0 : group.thColspan,
|
22853
|
-
"rowspan": group === null || group === void 0 ? void 0 : group.thRowspan
|
22854
|
-
}, [getGroupRender()]);
|
22855
|
-
}
|
22856
22737
|
return (0,external_vue_namespaceObject.createVNode)("th", (0,external_vue_namespaceObject.mergeProps)({
|
22857
22738
|
"style": headStyle,
|
22858
|
-
"class": classList
|
22859
|
-
"colspan":
|
22739
|
+
"class": classList,
|
22740
|
+
"colspan": 1,
|
22860
22741
|
"data-id": columns.getColumnId(column),
|
22861
|
-
"rowspan":
|
22742
|
+
"rowspan": 1,
|
22862
22743
|
"onClick": function onClick() {
|
22863
22744
|
return handleColumnHeadClick();
|
22864
22745
|
}
|
@@ -23049,20 +22930,21 @@ function use_render_isSlot(s) {
|
|
23049
22930
|
};
|
23050
22931
|
return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)("thead", {
|
23051
22932
|
"style": rowStyle
|
23052
|
-
}, [
|
23053
|
-
|
23054
|
-
|
23055
|
-
|
23056
|
-
|
23057
|
-
|
23058
|
-
|
23059
|
-
|
23060
|
-
|
23061
|
-
|
23062
|
-
|
23063
|
-
|
23064
|
-
|
23065
|
-
|
22933
|
+
}, [(0,external_vue_namespaceObject.createVNode)(table_row, null, {
|
22934
|
+
"default": function _default() {
|
22935
|
+
return [(0,external_vue_namespaceObject.createVNode)("tr", null, [columns.visibleColumns.map(function (column, index) {
|
22936
|
+
var _useHead = use_head({
|
22937
|
+
props: props,
|
22938
|
+
ctx: ctx,
|
22939
|
+
columns: columns,
|
22940
|
+
column: column,
|
22941
|
+
index: index,
|
22942
|
+
rows: rows
|
22943
|
+
}),
|
22944
|
+
getTH = _useHead.getTH;
|
22945
|
+
return getTH();
|
22946
|
+
})])];
|
22947
|
+
}
|
23066
22948
|
})])]);
|
23067
22949
|
};
|
23068
22950
|
var renderColumns = function renderColumns() {
|
@@ -23415,10 +23297,7 @@ var useRows = function useRows(props) {
|
|
23415
23297
|
/**
|
23416
23298
|
* 全量数据
|
23417
23299
|
*/
|
23418
|
-
var tableRowList = (0,external_vue_namespaceObject.
|
23419
|
-
var _props$data;
|
23420
|
-
return (_props$data = props.data) !== null && _props$data !== void 0 ? _props$data : [];
|
23421
|
-
});
|
23300
|
+
var tableRowList = (0,external_vue_namespaceObject.ref)([]);
|
23422
23301
|
/**
|
23423
23302
|
* 分页数据
|
23424
23303
|
* 当前页数据
|
@@ -23477,13 +23356,6 @@ var useRows = function useRows(props) {
|
|
23477
23356
|
});
|
23478
23357
|
tableRowSchema.set(CHECK_ALL_OBJ, defineProperty_defineProperty(defineProperty_defineProperty({}, TABLE_ROW_ATTRIBUTE.ROW_SELECTION, hasSelectedRow), TABLE_ROW_ATTRIBUTE.ROW_SELECTION_INDETERMINATE, hasSelectedRow && hasUnSelectedRow));
|
23479
23358
|
};
|
23480
|
-
(0,external_vue_namespaceObject.watch)(function () {
|
23481
|
-
return [tableRowList];
|
23482
|
-
}, function () {
|
23483
|
-
formatDataSchema();
|
23484
|
-
}, {
|
23485
|
-
immediate: true
|
23486
|
-
});
|
23487
23359
|
var getSelectionRowArgs = function getSelectionRowArgs(row, index) {
|
23488
23360
|
return {
|
23489
23361
|
row: row,
|
@@ -23649,11 +23521,18 @@ var useRows = function useRows(props) {
|
|
23649
23521
|
return getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION);
|
23650
23522
|
});
|
23651
23523
|
};
|
23524
|
+
var setTableRowList = function setTableRowList(data) {
|
23525
|
+
var _tableRowList$value;
|
23526
|
+
tableRowList.value.length = 0;
|
23527
|
+
(_tableRowList$value = tableRowList.value).push.apply(_tableRowList$value, _toConsumableArray(data));
|
23528
|
+
formatDataSchema();
|
23529
|
+
};
|
23652
23530
|
return {
|
23653
23531
|
setRowIndex: setRowIndex,
|
23654
23532
|
setRowExpand: setRowExpand,
|
23655
23533
|
isRowChecked: isRowChecked,
|
23656
23534
|
setPageRowList: setPageRowList,
|
23535
|
+
setTableRowList: setTableRowList,
|
23657
23536
|
clearSelection: clearSelection,
|
23658
23537
|
formatDataSchema: formatDataSchema,
|
23659
23538
|
toggleRowSelection: toggleRowSelection,
|
@@ -23668,6 +23547,7 @@ var useRows = function useRows(props) {
|
|
23668
23547
|
changePageRowIndex: changePageRowIndex,
|
23669
23548
|
toggleAllSelection: toggleAllSelection,
|
23670
23549
|
tableRowList: tableRowList,
|
23550
|
+
tableRowSchema: tableRowSchema,
|
23671
23551
|
pageRowList: pageRowList
|
23672
23552
|
};
|
23673
23553
|
};
|
@@ -24070,7 +23950,6 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24070
23950
|
setFootHeight = _useLayout.setFootHeight,
|
24071
23951
|
setDragOffsetX = _useLayout.setDragOffsetX,
|
24072
23952
|
setOffsetRight = _useLayout.setOffsetRight,
|
24073
|
-
setHeaderRowCount = _useLayout.setHeaderRowCount,
|
24074
23953
|
refBody = _useLayout.refBody,
|
24075
23954
|
refRoot = _useLayout.refRoot;
|
24076
23955
|
/**
|
@@ -24105,9 +23984,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24105
23984
|
var initTableColumns = function initTableColumns() {
|
24106
23985
|
var _instance$subTree$chi, _instance$subTree;
|
24107
23986
|
var children = (_instance$subTree$chi = (_instance$subTree = instance.subTree) === null || _instance$subTree === void 0 ? void 0 : _instance$subTree.children) !== null && _instance$subTree$chi !== void 0 ? _instance$subTree$chi : [];
|
24108
|
-
columns.debounceUpdateColumns(resolveColumns(children)
|
24109
|
-
setHeaderRowCount(columns.columnGroup.length);
|
24110
|
-
});
|
23987
|
+
columns.debounceUpdateColumns(resolveColumns(children));
|
24111
23988
|
};
|
24112
23989
|
(0,external_vue_namespaceObject.provide)(PROVIDE_KEY_INIT_COL, initTableColumns);
|
24113
23990
|
var _useFixedColumn = use_fixed_column(props, columns),
|
@@ -24173,7 +24050,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24173
24050
|
setBodyHeight(Number("".concat(props.height).replace('px', '')));
|
24174
24051
|
}
|
24175
24052
|
};
|
24176
|
-
var setTableData = function
|
24053
|
+
var setTableData = (0,lodash.debounce)(function () {
|
24177
24054
|
var filterOrderList = getFilterAndSortList();
|
24178
24055
|
if (!props.remotePagination) {
|
24179
24056
|
pagination.setPagination({
|
@@ -24183,14 +24060,16 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24183
24060
|
var renderList = getRenderRowList(filterOrderList);
|
24184
24061
|
rows.setPageRowList(renderList);
|
24185
24062
|
(0,external_vue_namespaceObject.nextTick)(function () {
|
24063
|
+
var _refBody$value2;
|
24186
24064
|
setOffsetRight();
|
24065
|
+
(_refBody$value2 = refBody.value) === null || _refBody$value2 === void 0 || _refBody$value2.scrollTo(0, 0);
|
24187
24066
|
});
|
24188
|
-
};
|
24067
|
+
}, 64);
|
24189
24068
|
var observerResizing = (0,external_vue_namespaceObject.ref)(false);
|
24190
24069
|
var observerResizingTimer = null;
|
24191
24070
|
use_observer_resize(refRoot, function () {
|
24192
24071
|
if (!observerResizing.value) {
|
24193
|
-
var _refBody$
|
24072
|
+
var _refBody$value3;
|
24194
24073
|
observerResizing.value = true;
|
24195
24074
|
if ((props.height === '100%' || props.virtualEnabled) && (0,lodash.isElement)(refRoot.value)) {
|
24196
24075
|
if (isResizeBodyHeight.value) {
|
@@ -24206,7 +24085,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24206
24085
|
}
|
24207
24086
|
computedColumnRect();
|
24208
24087
|
setOffsetRight();
|
24209
|
-
(_refBody$
|
24088
|
+
(_refBody$value3 = refBody.value) === null || _refBody$value3 === void 0 || _refBody$value3.scrollTo(0, 0);
|
24210
24089
|
return;
|
24211
24090
|
}
|
24212
24091
|
observerResizingTimer && clearTimeout(observerResizingTimer);
|
@@ -24214,15 +24093,6 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24214
24093
|
observerResizing.value = false;
|
24215
24094
|
});
|
24216
24095
|
});
|
24217
|
-
(0,external_vue_namespaceObject.watch)(function () {
|
24218
|
-
return [props.columns];
|
24219
|
-
}, function () {
|
24220
|
-
columns.debounceUpdateColumns(props.columns, function () {
|
24221
|
-
setHeaderRowCount(columns.columnGroup.length);
|
24222
|
-
});
|
24223
|
-
}, {
|
24224
|
-
immediate: true
|
24225
|
-
});
|
24226
24096
|
(0,external_vue_namespaceObject.watch)(function () {
|
24227
24097
|
return [dragOffsetX.value];
|
24228
24098
|
}, function () {
|
@@ -24241,9 +24111,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24241
24111
|
(0,external_vue_namespaceObject.watch)(function () {
|
24242
24112
|
return [columns.sortColumns, columns.filterColumns];
|
24243
24113
|
}, function () {
|
24244
|
-
(
|
24245
|
-
setTableData();
|
24246
|
-
});
|
24114
|
+
setTableData();
|
24247
24115
|
}, {
|
24248
24116
|
deep: true
|
24249
24117
|
});
|
@@ -24255,13 +24123,21 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24255
24123
|
immediate: true
|
24256
24124
|
});
|
24257
24125
|
(0,external_vue_namespaceObject.watch)(function () {
|
24258
|
-
return [
|
24126
|
+
return [props.data];
|
24259
24127
|
}, function () {
|
24128
|
+
rows.setTableRowList(props.data);
|
24260
24129
|
setTableData();
|
24261
24130
|
}, {
|
24262
24131
|
immediate: true,
|
24263
24132
|
deep: true
|
24264
24133
|
});
|
24134
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
24135
|
+
return [pagination.options.count, pagination.options.limit, pagination.options.current];
|
24136
|
+
}, function () {
|
24137
|
+
setTableData();
|
24138
|
+
}, {
|
24139
|
+
immediate: true
|
24140
|
+
});
|
24265
24141
|
ctx.expose({
|
24266
24142
|
setRowExpand: rows.setRowExpand,
|
24267
24143
|
setAllRowExpand: rows.setAllRowExpand,
|
package/lib/table/props.d.ts
CHANGED
@@ -162,16 +162,8 @@ export type IDraggableRowOption = {
|
|
162
162
|
icon?: JSX.Element;
|
163
163
|
width?: number;
|
164
164
|
};
|
165
|
-
export type IHeadGroup = {
|
166
|
-
thColspan: number;
|
167
|
-
thRowspan: number;
|
168
|
-
isGroup: boolean;
|
169
|
-
parent?: IHeadGroup;
|
170
|
-
label?: string;
|
171
|
-
offsetLeft?: number;
|
172
|
-
};
|
173
165
|
export type Column = {
|
174
|
-
label
|
166
|
+
label: LabelFunctionString;
|
175
167
|
field?: LabelFunctionString;
|
176
168
|
render?: RenderFunctionString;
|
177
169
|
renderHead?: RenderFunctionString;
|
@@ -192,7 +184,6 @@ export type Column = {
|
|
192
184
|
prop?: LabelFunctionString;
|
193
185
|
index?: number;
|
194
186
|
explain?: IColumnExplain;
|
195
|
-
children?: Column[];
|
196
187
|
};
|
197
188
|
export declare const IColumnProp: import("vue-types").VueTypeDef<Column>;
|
198
189
|
export type Thead = {
|
package/lib/table/table.css
CHANGED
@@ -1358,6 +1358,7 @@
|
|
1358
1358
|
display: flex;
|
1359
1359
|
align-items: center;
|
1360
1360
|
justify-content: center;
|
1361
|
+
height: 100%;
|
1361
1362
|
}
|
1362
1363
|
.bk-table .bk-table-head table th .cell.expand-cell,
|
1363
1364
|
.bk-table .bk-table-body table th .cell.expand-cell,
|
@@ -1504,15 +1505,6 @@
|
|
1504
1505
|
background-color: var(--background-color);
|
1505
1506
|
height: var(--row-height);
|
1506
1507
|
}
|
1507
|
-
.bk-table .bk-table-head.has-group .is-head-group {
|
1508
|
-
border-bottom: 1px solid var(--table-border-color);
|
1509
|
-
}
|
1510
|
-
.bk-table .bk-table-head.has-group th {
|
1511
|
-
border-right: 1px solid var(--table-border-color);
|
1512
|
-
}
|
1513
|
-
.bk-table .bk-table-head.has-group th.is-last-child {
|
1514
|
-
border-right: none;
|
1515
|
-
}
|
1516
1508
|
.bk-table .bk-table-head .col-resize-drag {
|
1517
1509
|
position: absolute;
|
1518
1510
|
top: 0;
|
@@ -1585,9 +1577,6 @@
|
|
1585
1577
|
.bk-table.bordered-col .bk-table-head {
|
1586
1578
|
border-right: 1px solid var(--table-border-color);
|
1587
1579
|
}
|
1588
|
-
.bk-table.bordered-col .bk-table-head .is-head-group {
|
1589
|
-
border-bottom: 1px solid var(--table-border-color);
|
1590
|
-
}
|
1591
1580
|
.bk-table.bordered-col th {
|
1592
1581
|
border-right: 1px solid var(--table-border-color);
|
1593
1582
|
}
|