vxe-table 4.24.1 → 4.24.2
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/all.esm.js +48 -31
- package/dist/all.esm.min.js +3 -3
- package/es/table/src/cell.js +16 -12
- package/es/table/src/header.js +7 -2
- package/es/table/src/table.js +23 -15
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +48 -31
- package/lib/index.umd.min.js +3 -3
- package/lib/table/src/cell.js +16 -12
- package/lib/table/src/header.js +7 -2
- package/lib/table/src/table.js +23 -15
- package/lib/ui/index.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/package.json +2 -2
- package/packages/table/src/cell.ts +16 -12
- package/packages/table/src/header.ts +10 -2
- package/packages/table/src/table.ts +26 -17
- /package/dist/{iconfont.1794984013707.ttf → iconfont.1795010714767.ttf} +0 -0
- /package/dist/{iconfont.1794984013707.woff → iconfont.1795010714767.woff} +0 -0
- /package/dist/{iconfont.1794984013707.woff2 → iconfont.1795010714767.woff2} +0 -0
- /package/es/{iconfont.1794984013707.ttf → iconfont.1795010714767.ttf} +0 -0
- /package/es/{iconfont.1794984013707.woff → iconfont.1795010714767.woff} +0 -0
- /package/es/{iconfont.1794984013707.woff2 → iconfont.1795010714767.woff2} +0 -0
- /package/lib/{iconfont.1794984013707.ttf → iconfont.1795010714767.ttf} +0 -0
- /package/lib/{iconfont.1794984013707.woff → iconfont.1795010714767.woff} +0 -0
- /package/lib/{iconfont.1794984013707.woff2 → iconfont.1795010714767.woff2} +0 -0
package/lib/table/src/cell.js
CHANGED
|
@@ -947,7 +947,6 @@ const Cell = {
|
|
|
947
947
|
let isChecked = false;
|
|
948
948
|
let isVisible = true;
|
|
949
949
|
let isDisabled = false;
|
|
950
|
-
const ons = {};
|
|
951
950
|
if (!isHidden) {
|
|
952
951
|
const rowid = (0, import_util.getRowid)($table, row);
|
|
953
952
|
isChecked = !!updateCheckboxFlag && !!selectCheckboxMaps[rowid];
|
|
@@ -963,17 +962,20 @@ const Cell = {
|
|
|
963
962
|
if (treeConfig || isRowGroupStatus) {
|
|
964
963
|
indeterminate = !!treeIndeterminateRowMaps[rowid];
|
|
965
964
|
}
|
|
966
|
-
ons.onClick = (evnt) => {
|
|
967
|
-
if (!isDisabled && isVisible) {
|
|
968
|
-
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
969
|
-
}
|
|
970
|
-
};
|
|
971
965
|
}
|
|
972
966
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate };
|
|
973
967
|
if (checkboxSlot) {
|
|
974
968
|
return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams));
|
|
975
969
|
}
|
|
976
970
|
const checkVNs = [];
|
|
971
|
+
const ons = {};
|
|
972
|
+
if (!isHidden) {
|
|
973
|
+
ons.onClick = (evnt) => {
|
|
974
|
+
if (!isDisabled && isVisible) {
|
|
975
|
+
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
976
|
+
}
|
|
977
|
+
};
|
|
978
|
+
}
|
|
977
979
|
if (isVisible) {
|
|
978
980
|
checkVNs.push(
|
|
979
981
|
(0, import_vue.h)("span", {
|
|
@@ -1035,7 +1037,6 @@ const Cell = {
|
|
|
1035
1037
|
let isChecked = false;
|
|
1036
1038
|
let isVisible = true;
|
|
1037
1039
|
let isDisabled = false;
|
|
1038
|
-
const ons = {};
|
|
1039
1040
|
if (!isHidden) {
|
|
1040
1041
|
const rowid = (0, import_util.getRowid)($table, row);
|
|
1041
1042
|
isChecked = !!updateCheckboxFlag && import_xe_utils.default.get(row, checkField);
|
|
@@ -1051,17 +1052,20 @@ const Cell = {
|
|
|
1051
1052
|
if (treeConfig || isRowGroupStatus) {
|
|
1052
1053
|
indeterminate = !!treeIndeterminateRowMaps[rowid];
|
|
1053
1054
|
}
|
|
1054
|
-
ons.onClick = (evnt) => {
|
|
1055
|
-
if (!isDisabled && isVisible) {
|
|
1056
|
-
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
1057
|
-
}
|
|
1058
|
-
};
|
|
1059
1055
|
}
|
|
1060
1056
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate };
|
|
1061
1057
|
if (checkboxSlot) {
|
|
1062
1058
|
return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams));
|
|
1063
1059
|
}
|
|
1064
1060
|
const checkVNs = [];
|
|
1061
|
+
const ons = {};
|
|
1062
|
+
if (!isHidden) {
|
|
1063
|
+
ons.onClick = (evnt) => {
|
|
1064
|
+
if (!isDisabled && isVisible) {
|
|
1065
|
+
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
1066
|
+
}
|
|
1067
|
+
};
|
|
1068
|
+
}
|
|
1065
1069
|
if (isVisible) {
|
|
1066
1070
|
checkVNs.push(
|
|
1067
1071
|
(0, import_vue.h)("span", {
|
package/lib/table/src/header.js
CHANGED
|
@@ -58,7 +58,7 @@ var header_default = (
|
|
|
58
58
|
setup(props) {
|
|
59
59
|
const $xeTable = (0, import_vue.inject)("$xeTable", {});
|
|
60
60
|
const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
|
|
61
|
-
const { computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeMouseOpts, computeHeaderCellOpts, computeDefaultRowHeight, computeVirtualXOpts, computeFloatingFilterOpts, computeIsHeaderRenderOptimize, computeHeaderTooltipOpts, computeRendererOpts } = $xeTable.getComputeMaps();
|
|
61
|
+
const { computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeMouseOpts, computeHeaderCellOpts, computeDefaultRowHeight, computeVirtualXOpts, computeFloatingFilterOpts, computeIsHeaderRenderOptimize, computeHeaderTooltipOpts, computeRendererOpts, computeIsAllCheckboxDisabled } = $xeTable.getComputeMaps();
|
|
62
62
|
const headerColumn = (0, import_vue.ref)([]);
|
|
63
63
|
const refElem = (0, import_vue.ref)();
|
|
64
64
|
const refHeaderScroll = (0, import_vue.ref)();
|
|
@@ -88,7 +88,7 @@ var header_default = (
|
|
|
88
88
|
const $xeGantt = $xeTable.xeGantt;
|
|
89
89
|
const { fixedType } = props;
|
|
90
90
|
const { resizable: allResizable, columnKey, showCustomHeader, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps;
|
|
91
|
-
const { dragCol, scrollXLoad, scrollYLoad, overflowX, mergeHeadFlag, tableColumn, currColFlag } = tableReactData;
|
|
91
|
+
const { dragCol, scrollXLoad, scrollYLoad, overflowX, mergeHeadFlag, tableColumn, currColFlag, isAllSelected: isAllCheckboxSelected, isIndeterminate: isAllCheckboxIndeterminate } = tableReactData;
|
|
92
92
|
const { fullColumnIdData, scrollXStore, mergeHeaderList, mergeHeaderCellMaps, currentCol } = tableInternalData;
|
|
93
93
|
const virtualXOpts = computeVirtualXOpts.value;
|
|
94
94
|
const columnOpts = computeColumnOpts.value;
|
|
@@ -100,6 +100,7 @@ var header_default = (
|
|
|
100
100
|
const rendererOpts = computeRendererOpts.value;
|
|
101
101
|
const mouseOpts = computeMouseOpts.value;
|
|
102
102
|
const currCellHeight = (0, import_util.getCalcHeight)(headerCellOpts.height) || defaultRowHeight;
|
|
103
|
+
const isAllCheckboxDisabled = computeIsAllCheckboxDisabled.value;
|
|
103
104
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts;
|
|
104
105
|
const isLastRow = _rowIndex === headerGroups.length - 1;
|
|
105
106
|
return cols.map((column, $columnIndex) => {
|
|
@@ -143,6 +144,10 @@ var header_default = (
|
|
|
143
144
|
_columnIndex,
|
|
144
145
|
firstFilterOption,
|
|
145
146
|
fixed: fixedType,
|
|
147
|
+
// 复选框勾选状态
|
|
148
|
+
checked: isAllCheckboxSelected,
|
|
149
|
+
disabled: isAllCheckboxDisabled,
|
|
150
|
+
indeterminate: isAllCheckboxIndeterminate,
|
|
146
151
|
source: sourceType,
|
|
147
152
|
type: renderType,
|
|
148
153
|
isHidden: fixedHiddenColumn,
|
package/lib/table/src/table.js
CHANGED
|
@@ -3137,7 +3137,7 @@ var table_default = (
|
|
|
3137
3137
|
}
|
|
3138
3138
|
reactData.treeExpandedFlag++;
|
|
3139
3139
|
if (!checkStrictly && $xeTable.isCheckedByCheckboxRow(row)) {
|
|
3140
|
-
handleCheckedCheckboxRow(childRows, true);
|
|
3140
|
+
handleCheckedCheckboxRow(childRows, true, false);
|
|
3141
3141
|
}
|
|
3142
3142
|
return (0, import_vue.nextTick)().then(() => {
|
|
3143
3143
|
if (transform) {
|
|
@@ -4324,8 +4324,8 @@ var table_default = (
|
|
|
4324
4324
|
}
|
|
4325
4325
|
}
|
|
4326
4326
|
};
|
|
4327
|
-
const handleCheckAllEvent = (evnt, value) => {
|
|
4328
|
-
handleCheckedAllCheckboxRow(value);
|
|
4327
|
+
const handleCheckAllEvent = (evnt, value, isForce) => {
|
|
4328
|
+
handleCheckedAllCheckboxRow(value, isForce);
|
|
4329
4329
|
if (evnt) {
|
|
4330
4330
|
dispatchEvent(
|
|
4331
4331
|
"checkbox-all",
|
|
@@ -6327,13 +6327,15 @@ var table_default = (
|
|
|
6327
6327
|
* @param {Array/Row} rows 行数据
|
|
6328
6328
|
* @param {Boolean} value 是否选中
|
|
6329
6329
|
*/
|
|
6330
|
-
setCheckboxRow(rows,
|
|
6330
|
+
setCheckboxRow(rows, options) {
|
|
6331
|
+
const { checked, force } = Object.assign({ force: true }, import_xe_utils.default.isBoolean(options) ? { checked: options } : options);
|
|
6331
6332
|
if (rows && !import_xe_utils.default.isArray(rows)) {
|
|
6332
6333
|
rows = [rows];
|
|
6333
6334
|
}
|
|
6334
|
-
return handleCheckedCheckboxRow(rows, checked,
|
|
6335
|
+
return handleCheckedCheckboxRow(rows, checked, force);
|
|
6335
6336
|
},
|
|
6336
|
-
setCheckboxRowByKey(keys,
|
|
6337
|
+
setCheckboxRowByKey(keys, options) {
|
|
6338
|
+
const { checked, force } = Object.assign({ force: true }, import_xe_utils.default.isBoolean(options) ? { checked: options } : options);
|
|
6337
6339
|
const { fullAllDataRowIdData } = internalData;
|
|
6338
6340
|
if (!import_xe_utils.default.isArray(keys)) {
|
|
6339
6341
|
keys = [keys];
|
|
@@ -6346,8 +6348,12 @@ var table_default = (
|
|
|
6346
6348
|
rows.push(rowRest.row);
|
|
6347
6349
|
}
|
|
6348
6350
|
});
|
|
6349
|
-
return handleCheckedCheckboxRow(rows, checked,
|
|
6351
|
+
return handleCheckedCheckboxRow(rows, !!checked, force);
|
|
6350
6352
|
},
|
|
6353
|
+
/**
|
|
6354
|
+
* 请使用 setCheckboxRowByKey
|
|
6355
|
+
* @deprecated
|
|
6356
|
+
*/
|
|
6351
6357
|
setCheckboxRowKey(keys, checked) {
|
|
6352
6358
|
return $xeTable.setCheckboxRowByKey(keys, checked);
|
|
6353
6359
|
},
|
|
@@ -6388,21 +6394,22 @@ var table_default = (
|
|
|
6388
6394
|
/**
|
|
6389
6395
|
* 多选,切换某一行的选中状态
|
|
6390
6396
|
*/
|
|
6391
|
-
toggleCheckboxRow(row) {
|
|
6397
|
+
toggleCheckboxRow(row, options) {
|
|
6392
6398
|
const { selectCheckboxMaps } = internalData;
|
|
6393
6399
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
6394
6400
|
const { checkField } = checkboxOpts;
|
|
6401
|
+
const { force } = Object.assign({ force: true }, options);
|
|
6395
6402
|
const checked = checkField ? !import_xe_utils.default.get(row, checkField) : !selectCheckboxMaps[(0, import_util.getRowid)($xeTable, row)];
|
|
6396
|
-
$xeTable.handleBatchSelectRows([row], checked,
|
|
6403
|
+
$xeTable.handleBatchSelectRows([row], checked, force);
|
|
6397
6404
|
$xeTable.checkSelectionStatus();
|
|
6398
6405
|
return (0, import_vue.nextTick)();
|
|
6399
6406
|
},
|
|
6400
6407
|
/**
|
|
6401
6408
|
* 用于多选行,设置所有行的选中状态
|
|
6402
|
-
* @param {Boolean} value 是否选中
|
|
6403
6409
|
*/
|
|
6404
|
-
setAllCheckboxRow(
|
|
6405
|
-
|
|
6410
|
+
setAllCheckboxRow(options) {
|
|
6411
|
+
const { checked, force } = Object.assign({ force: true }, import_xe_utils.default.isBoolean(options) ? { checked: options } : options);
|
|
6412
|
+
return handleCheckedAllCheckboxRow(!!checked, force);
|
|
6406
6413
|
},
|
|
6407
6414
|
/**
|
|
6408
6415
|
* 获取单选框保留选中的行
|
|
@@ -6488,8 +6495,9 @@ var table_default = (
|
|
|
6488
6495
|
/**
|
|
6489
6496
|
* 多选,切换所有行的选中状态
|
|
6490
6497
|
*/
|
|
6491
|
-
toggleAllCheckboxRow() {
|
|
6492
|
-
|
|
6498
|
+
toggleAllCheckboxRow(options) {
|
|
6499
|
+
const { force } = Object.assign({ force: true }, options);
|
|
6500
|
+
handleCheckAllEvent(null, !reactData.isAllSelected, force);
|
|
6493
6501
|
return (0, import_vue.nextTick)();
|
|
6494
6502
|
},
|
|
6495
6503
|
/**
|
|
@@ -10858,7 +10866,7 @@ var table_default = (
|
|
|
10858
10866
|
if (evnt) {
|
|
10859
10867
|
evnt.stopPropagation();
|
|
10860
10868
|
}
|
|
10861
|
-
handleCheckAllEvent(evnt, value);
|
|
10869
|
+
handleCheckAllEvent(evnt, value, false);
|
|
10862
10870
|
},
|
|
10863
10871
|
/**
|
|
10864
10872
|
* 单选,行选中事件
|
package/lib/ui/index.js
CHANGED
|
@@ -26,7 +26,7 @@ __export(ui_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(ui_exports);
|
|
27
27
|
var import_core = require("@vxe-ui/core");
|
|
28
28
|
__reExport(ui_exports, require("./abandon"), module.exports);
|
|
29
|
-
const version = "4.24.
|
|
29
|
+
const version = "4.24.2";
|
|
30
30
|
import_core.VxeUI.tableVersion = version;
|
|
31
31
|
import_core.VxeUI.version = version;
|
|
32
32
|
import_core.VxeUI.setConfig({
|
package/lib/ui/src/log.js
CHANGED
|
@@ -25,7 +25,7 @@ __export(log_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(log_exports);
|
|
26
26
|
var import_core = require("@vxe-ui/core");
|
|
27
27
|
const { log } = import_core.VxeUI;
|
|
28
|
-
const tableVersion = `table v${"4.24.
|
|
28
|
+
const tableVersion = `table v${"4.24.2"}`;
|
|
29
29
|
function createComponentLog(name) {
|
|
30
30
|
const uiVersion = import_core.VxeUI.uiVersion ? `ui v${import_core.VxeUI.uiVersion}` : "";
|
|
31
31
|
const ganttVersion = import_core.VxeUI.ganttVersion ? `gantt v${import_core.VxeUI.ganttVersion}` : "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-table",
|
|
3
|
-
"version": "4.24.
|
|
3
|
+
"version": "4.24.2",
|
|
4
4
|
"description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"typescript": "~5.9.3",
|
|
76
76
|
"vue": "3.4.27",
|
|
77
77
|
"vue-router": "~4.5.1",
|
|
78
|
-
"vxe-pc-ui": "4.21.
|
|
78
|
+
"vxe-pc-ui": "4.21.4"
|
|
79
79
|
},
|
|
80
80
|
"allowScripts": {
|
|
81
81
|
"esbuild": true,
|
|
@@ -986,7 +986,6 @@ export const Cell = {
|
|
|
986
986
|
let isChecked = false
|
|
987
987
|
let isVisible = true
|
|
988
988
|
let isDisabled = false
|
|
989
|
-
const ons: Record<string, any> = {}
|
|
990
989
|
if (!isHidden) {
|
|
991
990
|
const rowid = getRowid($table, row)
|
|
992
991
|
isChecked = !!updateCheckboxFlag && !!selectCheckboxMaps[rowid]
|
|
@@ -1002,17 +1001,20 @@ export const Cell = {
|
|
|
1002
1001
|
if (treeConfig || isRowGroupStatus) {
|
|
1003
1002
|
indeterminate = !!treeIndeterminateRowMaps[rowid]
|
|
1004
1003
|
}
|
|
1005
|
-
ons.onClick = (evnt: MouseEvent) => {
|
|
1006
|
-
if (!isDisabled && isVisible) {
|
|
1007
|
-
$table.triggerCheckRowEvent(evnt, params, !isChecked)
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
1004
|
}
|
|
1011
1005
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
|
|
1012
1006
|
if (checkboxSlot) {
|
|
1013
1007
|
return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams))
|
|
1014
1008
|
}
|
|
1015
1009
|
const checkVNs: VNode[] = []
|
|
1010
|
+
const ons: Record<string, any> = {}
|
|
1011
|
+
if (!isHidden) {
|
|
1012
|
+
ons.onClick = (evnt: MouseEvent) => {
|
|
1013
|
+
if (!isDisabled && isVisible) {
|
|
1014
|
+
$table.triggerCheckRowEvent(evnt, params, !isChecked)
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1016
1018
|
if (isVisible) {
|
|
1017
1019
|
checkVNs.push(
|
|
1018
1020
|
h('span', {
|
|
@@ -1074,7 +1076,6 @@ export const Cell = {
|
|
|
1074
1076
|
let isChecked = false
|
|
1075
1077
|
let isVisible = true
|
|
1076
1078
|
let isDisabled = false
|
|
1077
|
-
const ons: Record<string, any> = {}
|
|
1078
1079
|
if (!isHidden) {
|
|
1079
1080
|
const rowid = getRowid($table, row)
|
|
1080
1081
|
isChecked = !!updateCheckboxFlag && XEUtils.get(row, checkField)
|
|
@@ -1090,17 +1091,20 @@ export const Cell = {
|
|
|
1090
1091
|
if (treeConfig || isRowGroupStatus) {
|
|
1091
1092
|
indeterminate = !!treeIndeterminateRowMaps[rowid]
|
|
1092
1093
|
}
|
|
1093
|
-
ons.onClick = (evnt: MouseEvent) => {
|
|
1094
|
-
if (!isDisabled && isVisible) {
|
|
1095
|
-
$table.triggerCheckRowEvent(evnt, params, !isChecked)
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
1094
|
}
|
|
1099
1095
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
|
|
1100
1096
|
if (checkboxSlot) {
|
|
1101
1097
|
return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams))
|
|
1102
1098
|
}
|
|
1103
1099
|
const checkVNs: VNode[] = []
|
|
1100
|
+
const ons: Record<string, any> = {}
|
|
1101
|
+
if (!isHidden) {
|
|
1102
|
+
ons.onClick = (evnt: MouseEvent) => {
|
|
1103
|
+
if (!isDisabled && isVisible) {
|
|
1104
|
+
$table.triggerCheckRowEvent(evnt, params, !isChecked)
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1104
1108
|
if (isVisible) {
|
|
1105
1109
|
checkVNs.push(
|
|
1106
1110
|
h('span', {
|
|
@@ -29,7 +29,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
29
29
|
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods)
|
|
30
30
|
|
|
31
31
|
const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable
|
|
32
|
-
const { computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeMouseOpts, computeHeaderCellOpts, computeDefaultRowHeight, computeVirtualXOpts, computeFloatingFilterOpts, computeIsHeaderRenderOptimize, computeHeaderTooltipOpts, computeRendererOpts } = $xeTable.getComputeMaps()
|
|
32
|
+
const { computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeMouseOpts, computeHeaderCellOpts, computeDefaultRowHeight, computeVirtualXOpts, computeFloatingFilterOpts, computeIsHeaderRenderOptimize, computeHeaderTooltipOpts, computeRendererOpts, computeIsAllCheckboxDisabled } = $xeTable.getComputeMaps()
|
|
33
33
|
|
|
34
34
|
const headerColumn = ref<VxeTableDefines.ColumnInfo[][]>([])
|
|
35
35
|
|
|
@@ -64,7 +64,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
64
64
|
|
|
65
65
|
const { fixedType } = props
|
|
66
66
|
const { resizable: allResizable, columnKey, showCustomHeader, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps
|
|
67
|
-
const { dragCol, scrollXLoad, scrollYLoad, overflowX, mergeHeadFlag, tableColumn, currColFlag } = tableReactData
|
|
67
|
+
const { dragCol, scrollXLoad, scrollYLoad, overflowX, mergeHeadFlag, tableColumn, currColFlag, isAllSelected: isAllCheckboxSelected, isIndeterminate: isAllCheckboxIndeterminate } = tableReactData
|
|
68
68
|
const { fullColumnIdData, scrollXStore, mergeHeaderList, mergeHeaderCellMaps, currentCol } = tableInternalData
|
|
69
69
|
const virtualXOpts = computeVirtualXOpts.value
|
|
70
70
|
const columnOpts = computeColumnOpts.value
|
|
@@ -76,6 +76,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
76
76
|
const rendererOpts = computeRendererOpts.value
|
|
77
77
|
const mouseOpts = computeMouseOpts.value
|
|
78
78
|
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight
|
|
79
|
+
const isAllCheckboxDisabled = computeIsAllCheckboxDisabled.value
|
|
79
80
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts
|
|
80
81
|
const isLastRow = _rowIndex === headerGroups.length - 1
|
|
81
82
|
|
|
@@ -109,6 +110,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
109
110
|
}
|
|
110
111
|
const columnIndex = colRest.index
|
|
111
112
|
const _columnIndex = colRest._index
|
|
113
|
+
|
|
112
114
|
const cellParams: VxeTableDefines.CellRenderHeaderParams & {
|
|
113
115
|
$table: VxeTableConstructor & VxeTablePrivateMethods
|
|
114
116
|
} = {
|
|
@@ -124,6 +126,12 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
124
126
|
_columnIndex,
|
|
125
127
|
firstFilterOption: firstFilterOption as VxeTableDefines.FilterOption,
|
|
126
128
|
fixed: fixedType,
|
|
129
|
+
|
|
130
|
+
// 复选框勾选状态
|
|
131
|
+
checked: isAllCheckboxSelected,
|
|
132
|
+
disabled: isAllCheckboxDisabled,
|
|
133
|
+
indeterminate: isAllCheckboxIndeterminate,
|
|
134
|
+
|
|
127
135
|
source: sourceType,
|
|
128
136
|
type: renderType,
|
|
129
137
|
isHidden: fixedHiddenColumn,
|
|
@@ -3368,7 +3368,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
3368
3368
|
return nextTick()
|
|
3369
3369
|
}
|
|
3370
3370
|
|
|
3371
|
-
const handleCheckedCheckboxRow = (rows: any[], value: boolean, isForce
|
|
3371
|
+
const handleCheckedCheckboxRow = (rows: any[], value: boolean, isForce: boolean) => {
|
|
3372
3372
|
if (rows && !XEUtils.isArray(rows)) {
|
|
3373
3373
|
rows = [rows]
|
|
3374
3374
|
}
|
|
@@ -3377,7 +3377,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
3377
3377
|
return nextTick()
|
|
3378
3378
|
}
|
|
3379
3379
|
|
|
3380
|
-
const handleCheckedAllCheckboxRow = (checked: boolean, isForce
|
|
3380
|
+
const handleCheckedAllCheckboxRow = (checked: boolean, isForce: boolean) => {
|
|
3381
3381
|
const { treeConfig } = props
|
|
3382
3382
|
const { isRowGroupStatus } = reactData
|
|
3383
3383
|
const { afterFullData, afterTreeFullData, afterGroupFullData, checkboxReserveRowMap, selectCheckboxMaps } = internalData
|
|
@@ -3644,7 +3644,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
3644
3644
|
reactData.treeExpandedFlag++
|
|
3645
3645
|
// 如果当前节点已选中,则展开后子节点也被选中
|
|
3646
3646
|
if (!checkStrictly && $xeTable.isCheckedByCheckboxRow(row)) {
|
|
3647
|
-
handleCheckedCheckboxRow(childRows, true)
|
|
3647
|
+
handleCheckedCheckboxRow(childRows, true, false)
|
|
3648
3648
|
}
|
|
3649
3649
|
return nextTick().then(() => {
|
|
3650
3650
|
if (transform) {
|
|
@@ -5026,8 +5026,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
5026
5026
|
}
|
|
5027
5027
|
}
|
|
5028
5028
|
|
|
5029
|
-
const handleCheckAllEvent = (evnt: Event | null, value: any) => {
|
|
5030
|
-
handleCheckedAllCheckboxRow(value)
|
|
5029
|
+
const handleCheckAllEvent = (evnt: Event | null, value: any, isForce: boolean) => {
|
|
5030
|
+
handleCheckedAllCheckboxRow(value, isForce)
|
|
5031
5031
|
if (evnt) {
|
|
5032
5032
|
dispatchEvent(
|
|
5033
5033
|
'checkbox-all',
|
|
@@ -7098,13 +7098,15 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
7098
7098
|
* @param {Array/Row} rows 行数据
|
|
7099
7099
|
* @param {Boolean} value 是否选中
|
|
7100
7100
|
*/
|
|
7101
|
-
setCheckboxRow(rows,
|
|
7101
|
+
setCheckboxRow(rows, options) {
|
|
7102
|
+
const { checked, force } = Object.assign({ force: true }, XEUtils.isBoolean(options) ? { checked: options } : options)
|
|
7102
7103
|
if (rows && !XEUtils.isArray(rows)) {
|
|
7103
7104
|
rows = [rows]
|
|
7104
7105
|
}
|
|
7105
|
-
return handleCheckedCheckboxRow(rows, checked,
|
|
7106
|
+
return handleCheckedCheckboxRow(rows, checked, force)
|
|
7106
7107
|
},
|
|
7107
|
-
setCheckboxRowByKey(keys: any,
|
|
7108
|
+
setCheckboxRowByKey(keys: any, options) {
|
|
7109
|
+
const { checked, force } = Object.assign({ force: true }, XEUtils.isBoolean(options) ? { checked: options } : options)
|
|
7108
7110
|
const { fullAllDataRowIdData } = internalData
|
|
7109
7111
|
if (!XEUtils.isArray(keys)) {
|
|
7110
7112
|
keys = [keys]
|
|
@@ -7117,9 +7119,14 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
7117
7119
|
rows.push(rowRest.row)
|
|
7118
7120
|
}
|
|
7119
7121
|
})
|
|
7120
|
-
return handleCheckedCheckboxRow(rows, checked,
|
|
7122
|
+
return handleCheckedCheckboxRow(rows, !!checked, force)
|
|
7121
7123
|
},
|
|
7124
|
+
/**
|
|
7125
|
+
* 请使用 setCheckboxRowByKey
|
|
7126
|
+
* @deprecated
|
|
7127
|
+
*/
|
|
7122
7128
|
setCheckboxRowKey(keys, checked) {
|
|
7129
|
+
// warnLog('vxe.error.delFunc', ['setCheckboxRowKey', 'setCheckboxRowByKey'])
|
|
7123
7130
|
return $xeTable.setCheckboxRowByKey(keys, checked)
|
|
7124
7131
|
},
|
|
7125
7132
|
isCheckedByCheckboxRow(row) {
|
|
@@ -7159,21 +7166,22 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
7159
7166
|
/**
|
|
7160
7167
|
* 多选,切换某一行的选中状态
|
|
7161
7168
|
*/
|
|
7162
|
-
toggleCheckboxRow(row) {
|
|
7169
|
+
toggleCheckboxRow(row, options) {
|
|
7163
7170
|
const { selectCheckboxMaps } = internalData
|
|
7164
7171
|
const checkboxOpts = computeCheckboxOpts.value
|
|
7165
7172
|
const { checkField } = checkboxOpts
|
|
7173
|
+
const { force } = Object.assign({ force: true }, options)
|
|
7166
7174
|
const checked = checkField ? !XEUtils.get(row, checkField) : !selectCheckboxMaps[getRowid($xeTable, row)]
|
|
7167
|
-
$xeTable.handleBatchSelectRows([row], checked,
|
|
7175
|
+
$xeTable.handleBatchSelectRows([row], checked, force)
|
|
7168
7176
|
$xeTable.checkSelectionStatus()
|
|
7169
7177
|
return nextTick()
|
|
7170
7178
|
},
|
|
7171
7179
|
/**
|
|
7172
7180
|
* 用于多选行,设置所有行的选中状态
|
|
7173
|
-
* @param {Boolean} value 是否选中
|
|
7174
7181
|
*/
|
|
7175
|
-
setAllCheckboxRow(
|
|
7176
|
-
|
|
7182
|
+
setAllCheckboxRow(options) {
|
|
7183
|
+
const { checked, force } = Object.assign({ force: true }, XEUtils.isBoolean(options) ? { checked: options } : options)
|
|
7184
|
+
return handleCheckedAllCheckboxRow(!!checked, force)
|
|
7177
7185
|
},
|
|
7178
7186
|
/**
|
|
7179
7187
|
* 获取单选框保留选中的行
|
|
@@ -7259,8 +7267,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
7259
7267
|
/**
|
|
7260
7268
|
* 多选,切换所有行的选中状态
|
|
7261
7269
|
*/
|
|
7262
|
-
toggleAllCheckboxRow() {
|
|
7263
|
-
|
|
7270
|
+
toggleAllCheckboxRow(options) {
|
|
7271
|
+
const { force } = Object.assign({ force: true }, options)
|
|
7272
|
+
handleCheckAllEvent(null, !reactData.isAllSelected, force)
|
|
7264
7273
|
return nextTick()
|
|
7265
7274
|
},
|
|
7266
7275
|
/**
|
|
@@ -11942,7 +11951,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
11942
11951
|
if (evnt) {
|
|
11943
11952
|
evnt.stopPropagation()
|
|
11944
11953
|
}
|
|
11945
|
-
handleCheckAllEvent(evnt, value)
|
|
11954
|
+
handleCheckAllEvent(evnt, value, false)
|
|
11946
11955
|
},
|
|
11947
11956
|
/**
|
|
11948
11957
|
* 单选,行选中事件
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|