vxe-table 4.13.5 → 4.13.7
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/es/grid/src/grid.js +1 -1
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +3 -2
- package/es/locale/lang/de-DE.js +3 -2
- package/es/locale/lang/en-US.js +2 -1
- package/es/locale/lang/es-ES.js +3 -2
- package/es/locale/lang/fr-FR.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +2 -1
- package/es/locale/lang/id-ID.js +2 -1
- package/es/locale/lang/it-IT.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +2 -1
- package/es/locale/lang/th-TH.js +2 -1
- package/es/locale/lang/ug-CN.js +2 -1
- package/es/locale/lang/uk-UA.js +2 -1
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/hook.js +11 -8
- package/es/table/module/custom/panel.js +7 -7
- package/es/table/module/export/hook.js +21 -20
- package/es/table/module/keyboard/hook.js +3 -2
- package/es/table/src/body.js +45 -10
- package/es/table/src/cell.js +159 -69
- package/es/table/src/column.js +2 -0
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/emits.js +1 -0
- package/es/table/src/props.js +9 -7
- package/es/table/src/table.js +659 -171
- package/es/table/style.css +70 -40
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +13 -1
- package/es/ui/src/dom.js +3 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +70 -40
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +419 -179
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +3 -2
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +3 -2
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -1
- package/lib/locale/lang/es-ES.js +3 -2
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +3 -2
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +2 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +2 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +2 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +2 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +2 -1
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +2 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +2 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +2 -1
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/hook.js +11 -1
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +6 -2
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/hook.js +21 -11
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +2 -1
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/body.js +35 -9
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +177 -52
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/props.js +9 -7
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +134 -91
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +70 -40
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +13 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +4 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +70 -40
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +1 -1
- package/packages/locale/lang/ar-EG.ts +3 -2
- package/packages/locale/lang/de-DE.ts +3 -2
- package/packages/locale/lang/en-US.ts +2 -1
- package/packages/locale/lang/es-ES.ts +3 -2
- package/packages/locale/lang/fr-FR.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +2 -1
- package/packages/locale/lang/id-ID.ts +2 -1
- package/packages/locale/lang/it-IT.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +2 -1
- package/packages/locale/lang/th-TH.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +2 -1
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/module/custom/hook.ts +14 -8
- package/packages/table/module/custom/panel.ts +7 -7
- package/packages/table/module/export/hook.ts +28 -27
- package/packages/table/module/keyboard/hook.ts +3 -2
- package/packages/table/src/body.ts +46 -10
- package/packages/table/src/cell.ts +162 -73
- package/packages/table/src/column.ts +2 -0
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/emits.ts +1 -0
- package/packages/table/src/props.ts +9 -7
- package/packages/table/src/table.ts +664 -176
- package/packages/ui/index.ts +12 -0
- package/packages/ui/src/dom.ts +4 -0
- package/styles/components/table.scss +131 -92
- /package/es/{iconfont.1744880866629.ttf → iconfont.1745290253213.ttf} +0 -0
- /package/es/{iconfont.1744880866629.woff → iconfont.1745290253213.woff} +0 -0
- /package/es/{iconfont.1744880866629.woff2 → iconfont.1745290253213.woff2} +0 -0
- /package/lib/{iconfont.1744880866629.ttf → iconfont.1745290253213.ttf} +0 -0
- /package/lib/{iconfont.1744880866629.woff → iconfont.1745290253213.woff} +0 -0
- /package/lib/{iconfont.1744880866629.woff2 → iconfont.1745290253213.woff2} +0 -0
|
@@ -131,10 +131,10 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
131
131
|
const isAll = !!checked;
|
|
132
132
|
if (customOpts.immediate) {
|
|
133
133
|
XEUtils.eachTree(customColumnList, (column) => {
|
|
134
|
-
if (visibleMethod && !visibleMethod({ column })) {
|
|
134
|
+
if (visibleMethod && !visibleMethod({ $table: $xeTable, column })) {
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
if (checkMethod && !checkMethod({ column })) {
|
|
137
|
+
if (checkMethod && !checkMethod({ $table: $xeTable, column })) {
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
column.visible = isAll;
|
|
@@ -148,10 +148,10 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
148
148
|
}
|
|
149
149
|
else {
|
|
150
150
|
XEUtils.eachTree(customColumnList, (column) => {
|
|
151
|
-
if (visibleMethod && !visibleMethod({ column })) {
|
|
151
|
+
if (visibleMethod && !visibleMethod({ $table: $xeTable, column })) {
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
if (checkMethod && !checkMethod({ column })) {
|
|
154
|
+
if (checkMethod && !checkMethod({ $table: $xeTable, column })) {
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
157
|
column.renderVisible = isAll;
|
|
@@ -187,7 +187,7 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
187
187
|
if (opts.sort) {
|
|
188
188
|
column.renderSortNumber = column.sortNumber;
|
|
189
189
|
}
|
|
190
|
-
if (!checkMethod || checkMethod({ column })) {
|
|
190
|
+
if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
|
|
191
191
|
column.visible = column.defaultVisible;
|
|
192
192
|
}
|
|
193
193
|
column.renderResizeWidth = column.renderWidth;
|
|
@@ -208,8 +208,8 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
208
208
|
const { collectColumn } = internalData;
|
|
209
209
|
const customOpts = computeCustomOpts.value;
|
|
210
210
|
const { checkMethod } = customOpts;
|
|
211
|
-
customStore.isAll = collectColumn.every((column) => (checkMethod ? !checkMethod({ column }) : false) || column.renderVisible);
|
|
212
|
-
customStore.isIndeterminate = !customStore.isAll && collectColumn.some((column) => (!checkMethod || checkMethod({ column })) && (column.renderVisible || column.halfVisible));
|
|
211
|
+
customStore.isAll = collectColumn.every((column) => (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false) || column.renderVisible);
|
|
212
|
+
customStore.isIndeterminate = !customStore.isAll && collectColumn.some((column) => (!checkMethod || checkMethod({ $table: $xeTable, column })) && (column.renderVisible || column.halfVisible));
|
|
213
213
|
};
|
|
214
214
|
const emitCustomEvent = (type, evnt) => {
|
|
215
215
|
const comp = $xeGrid || $xeTable;
|
|
@@ -219,7 +219,8 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
219
219
|
checkCustomStatus,
|
|
220
220
|
emitCustomEvent,
|
|
221
221
|
triggerCustomEvent(evnt) {
|
|
222
|
-
const
|
|
222
|
+
const reactData = $xeTable.reactData;
|
|
223
|
+
const { customStore } = reactData;
|
|
223
224
|
if (customStore.visible) {
|
|
224
225
|
closeCustom();
|
|
225
226
|
emitCustomEvent('close', evnt);
|
|
@@ -231,6 +232,7 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
231
232
|
}
|
|
232
233
|
},
|
|
233
234
|
customOpenEvent(evnt) {
|
|
235
|
+
const reactData = $xeTable.reactData;
|
|
234
236
|
const { customStore } = reactData;
|
|
235
237
|
if (!customStore.visible) {
|
|
236
238
|
customStore.activeBtn = true;
|
|
@@ -240,6 +242,7 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
240
242
|
}
|
|
241
243
|
},
|
|
242
244
|
customCloseEvent(evnt) {
|
|
245
|
+
const reactData = $xeTable.reactData;
|
|
243
246
|
const { customStore } = reactData;
|
|
244
247
|
if (customStore.visible) {
|
|
245
248
|
customStore.activeBtn = false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, h, inject, ref, nextTick, TransitionGroup, createCommentVNode } from 'vue';
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import { formatText } from '../../../ui/src/utils';
|
|
4
|
-
import { getTpImg, addClass, removeClass } from '../../../ui/src/dom';
|
|
4
|
+
import { getTpImg, addClass, removeClass, hasControlKey } from '../../../ui/src/dom';
|
|
5
5
|
import { errLog } from '../../../ui/src/log';
|
|
6
6
|
import XEUtils from 'xe-utils';
|
|
7
7
|
const { getI18n, getIcon, renderEmptyElement } = VxeUI;
|
|
@@ -409,7 +409,7 @@ export default defineComponent({
|
|
|
409
409
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
410
410
|
const { isCrossDrag, isToChildDrag } = columnDragOpts;
|
|
411
411
|
const optEl = evnt.currentTarget;
|
|
412
|
-
const
|
|
412
|
+
const isControlKey = hasControlKey(evnt);
|
|
413
413
|
const colid = optEl.getAttribute('colid');
|
|
414
414
|
const column = $xeTable.getColumnById(colid);
|
|
415
415
|
const dragCol = dragColumnRef.value;
|
|
@@ -425,7 +425,7 @@ export default defineComponent({
|
|
|
425
425
|
showDropTip(evnt, optEl, false, dragPos);
|
|
426
426
|
return;
|
|
427
427
|
}
|
|
428
|
-
prevDragToChild = !!((isCrossDrag && isToChildDrag) &&
|
|
428
|
+
prevDragToChild = !!((isCrossDrag && isToChildDrag) && isControlKey && immediate);
|
|
429
429
|
prevDragCol = column;
|
|
430
430
|
prevDragPos = dragPos;
|
|
431
431
|
showDropTip(evnt, optEl, true, dragPos);
|
|
@@ -503,13 +503,13 @@ export default defineComponent({
|
|
|
503
503
|
isCustomStatus
|
|
504
504
|
};
|
|
505
505
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
506
|
-
const isVisible = visibleMethod ? visibleMethod({ column }) : true;
|
|
506
|
+
const isVisible = visibleMethod ? visibleMethod({ $table: $xeTable, column }) : true;
|
|
507
507
|
if (isVisible) {
|
|
508
508
|
const isChecked = column.renderVisible;
|
|
509
509
|
const isIndeterminate = column.halfVisible;
|
|
510
510
|
const isColGroup = column.children && column.children.length;
|
|
511
511
|
const colTitle = formatText(column.getTitle(), 1);
|
|
512
|
-
const isDisabled = checkMethod ? !checkMethod({ column }) : false;
|
|
512
|
+
const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false;
|
|
513
513
|
const isHidden = !isChecked;
|
|
514
514
|
colVNs.push(h('li', {
|
|
515
515
|
key: column.id,
|
|
@@ -758,7 +758,7 @@ export default defineComponent({
|
|
|
758
758
|
isCustomStatus
|
|
759
759
|
};
|
|
760
760
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
761
|
-
const isVisible = visibleMethod ? visibleMethod({ column }) : true;
|
|
761
|
+
const isVisible = visibleMethod ? visibleMethod({ $table: $xeTable, column }) : true;
|
|
762
762
|
if (isVisible) {
|
|
763
763
|
// 默认继承调整宽度
|
|
764
764
|
let customMinWidth = 0;
|
|
@@ -782,7 +782,7 @@ export default defineComponent({
|
|
|
782
782
|
const isIndeterminate = column.halfVisible;
|
|
783
783
|
const colTitle = formatText(column.getTitle(), 1);
|
|
784
784
|
const isColGroup = column.children && column.children.length;
|
|
785
|
-
const isDisabled = checkMethod ? !checkMethod({ column }) : false;
|
|
785
|
+
const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false;
|
|
786
786
|
const isHidden = !isChecked;
|
|
787
787
|
trVNs.push(h('tr', {
|
|
788
788
|
key: column.id,
|
|
@@ -79,9 +79,9 @@ function toTableBorder(border) {
|
|
|
79
79
|
function getBooleanValue(cellValue) {
|
|
80
80
|
return cellValue === 'TRUE' || cellValue === 'true' || cellValue === true;
|
|
81
81
|
}
|
|
82
|
-
function getFooterData(opts, footerTableData) {
|
|
82
|
+
function getFooterData($xeTable, opts, footerTableData) {
|
|
83
83
|
const { footerFilterMethod } = opts;
|
|
84
|
-
return footerFilterMethod ? footerTableData.filter((items, index) => footerFilterMethod({ items, $rowIndex: index })) : footerTableData;
|
|
84
|
+
return footerFilterMethod ? footerTableData.filter((items, index) => footerFilterMethod({ $table: $xeTable, items, $rowIndex: index })) : footerTableData;
|
|
85
85
|
}
|
|
86
86
|
function getCsvCellTypeLabel(column, cellValue) {
|
|
87
87
|
if (cellValue) {
|
|
@@ -266,6 +266,7 @@ hooks.add('tableExportModule', {
|
|
|
266
266
|
const seqMethod = seqOpts.seqMethod || column.seqMethod;
|
|
267
267
|
if (seqMethod) {
|
|
268
268
|
return seqMethod({
|
|
269
|
+
$table: $xeTable,
|
|
269
270
|
row,
|
|
270
271
|
rowIndex: $xeTable.getRowIndex(row),
|
|
271
272
|
$rowIndex,
|
|
@@ -339,12 +340,12 @@ hooks.add('tableExportModule', {
|
|
|
339
340
|
case 'checkbox':
|
|
340
341
|
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
|
|
341
342
|
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : '';
|
|
342
|
-
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ row });
|
|
343
|
+
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row });
|
|
343
344
|
break;
|
|
344
345
|
case 'radio':
|
|
345
346
|
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
|
|
346
347
|
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : '';
|
|
347
|
-
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ row });
|
|
348
|
+
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row });
|
|
348
349
|
break;
|
|
349
350
|
default:
|
|
350
351
|
if (opts.original) {
|
|
@@ -400,12 +401,12 @@ hooks.add('tableExportModule', {
|
|
|
400
401
|
case 'checkbox':
|
|
401
402
|
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
|
|
402
403
|
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : '';
|
|
403
|
-
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ row });
|
|
404
|
+
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row });
|
|
404
405
|
break;
|
|
405
406
|
case 'radio':
|
|
406
407
|
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
|
|
407
408
|
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : '';
|
|
408
|
-
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ row });
|
|
409
|
+
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row });
|
|
409
410
|
break;
|
|
410
411
|
default:
|
|
411
412
|
if (opts.original) {
|
|
@@ -435,7 +436,7 @@ hooks.add('tableExportModule', {
|
|
|
435
436
|
const { columns, dataFilterMethod } = opts;
|
|
436
437
|
let datas = opts.data;
|
|
437
438
|
if (dataFilterMethod) {
|
|
438
|
-
datas = datas.filter((row, index) => dataFilterMethod({ row, $rowIndex: index }));
|
|
439
|
+
datas = datas.filter((row, index) => dataFilterMethod({ $table: $xeTable, row, $rowIndex: index }));
|
|
439
440
|
}
|
|
440
441
|
return getBodyLabelData(opts, columns, datas);
|
|
441
442
|
};
|
|
@@ -462,7 +463,7 @@ hooks.add('tableExportModule', {
|
|
|
462
463
|
}
|
|
463
464
|
return XEUtils.get(row, column.field);
|
|
464
465
|
};
|
|
465
|
-
const toCsv = (opts, columns, datas) => {
|
|
466
|
+
const toCsv = ($xeTable, opts, columns, datas) => {
|
|
466
467
|
let content = csvBOM;
|
|
467
468
|
if (opts.isHeader) {
|
|
468
469
|
content += columns.map((column) => toTxtCellLabel(getHeaderTitle(opts, column))).join(',') + enterSymbol;
|
|
@@ -472,14 +473,14 @@ hooks.add('tableExportModule', {
|
|
|
472
473
|
});
|
|
473
474
|
if (opts.isFooter) {
|
|
474
475
|
const { footerTableData } = reactData;
|
|
475
|
-
const footers = getFooterData(opts, footerTableData);
|
|
476
|
+
const footers = getFooterData($xeTable, opts, footerTableData);
|
|
476
477
|
footers.forEach((row) => {
|
|
477
478
|
content += columns.map((column) => toTxtCellLabel(getFooterCellValue(opts, row, column))).join(',') + enterSymbol;
|
|
478
479
|
});
|
|
479
480
|
}
|
|
480
481
|
return content;
|
|
481
482
|
};
|
|
482
|
-
const toTxt = (opts, columns, datas) => {
|
|
483
|
+
const toTxt = ($xeTable, opts, columns, datas) => {
|
|
483
484
|
let content = '';
|
|
484
485
|
if (opts.isHeader) {
|
|
485
486
|
content += columns.map((column) => toTxtCellLabel(getHeaderTitle(opts, column))).join('\t') + enterSymbol;
|
|
@@ -489,7 +490,7 @@ hooks.add('tableExportModule', {
|
|
|
489
490
|
});
|
|
490
491
|
if (opts.isFooter) {
|
|
491
492
|
const { footerTableData } = reactData;
|
|
492
|
-
const footers = getFooterData(opts, footerTableData);
|
|
493
|
+
const footers = getFooterData($xeTable, opts, footerTableData);
|
|
493
494
|
footers.forEach((row) => {
|
|
494
495
|
content += columns.map((column) => toTxtCellLabel(getFooterCellValue(opts, row, column))).join('\t') + enterSymbol;
|
|
495
496
|
});
|
|
@@ -648,7 +649,7 @@ hooks.add('tableExportModule', {
|
|
|
648
649
|
}
|
|
649
650
|
if (isFooter) {
|
|
650
651
|
const { footerTableData } = reactData;
|
|
651
|
-
const footers = getFooterData(opts, footerTableData);
|
|
652
|
+
const footers = getFooterData($xeTable, opts, footerTableData);
|
|
652
653
|
if (footers.length) {
|
|
653
654
|
tables.push('<tfoot>');
|
|
654
655
|
footers.forEach((row) => {
|
|
@@ -698,20 +699,20 @@ hooks.add('tableExportModule', {
|
|
|
698
699
|
});
|
|
699
700
|
if (opts.isFooter) {
|
|
700
701
|
const { footerTableData } = reactData;
|
|
701
|
-
const footers = getFooterData(opts, footerTableData);
|
|
702
|
+
const footers = getFooterData($xeTable, opts, footerTableData);
|
|
702
703
|
footers.forEach((row) => {
|
|
703
704
|
xml += `<Row>${columns.map((column) => `<Cell><Data ss:Type="String">${getFooterCellValue(opts, row, column)}</Data></Cell>`).join('')}</Row>`;
|
|
704
705
|
});
|
|
705
706
|
}
|
|
706
707
|
return `${xml}</Table></Worksheet></Workbook>`;
|
|
707
708
|
};
|
|
708
|
-
const getContent = (opts, columns, datas) => {
|
|
709
|
+
const getContent = ($xeTable, opts, columns, datas) => {
|
|
709
710
|
if (columns.length) {
|
|
710
711
|
switch (opts.type) {
|
|
711
712
|
case 'csv':
|
|
712
|
-
return toCsv(opts, columns, datas);
|
|
713
|
+
return toCsv($xeTable, opts, columns, datas);
|
|
713
714
|
case 'txt':
|
|
714
|
-
return toTxt(opts, columns, datas);
|
|
715
|
+
return toTxt($xeTable, opts, columns, datas);
|
|
715
716
|
case 'html':
|
|
716
717
|
return toHtml(opts, columns, datas);
|
|
717
718
|
case 'xml':
|
|
@@ -746,7 +747,7 @@ hooks.add('tableExportModule', {
|
|
|
746
747
|
else {
|
|
747
748
|
const datas = getExportData(opts);
|
|
748
749
|
resolve($xeTable.preventEvent(null, 'event.export', { options: opts, columns, colgroups, datas }, () => {
|
|
749
|
-
return downloadFile(opts, getContent(opts, columns, datas));
|
|
750
|
+
return downloadFile(opts, getContent($xeTable, opts, columns, datas));
|
|
750
751
|
}));
|
|
751
752
|
}
|
|
752
753
|
}).then((params) => {
|
|
@@ -1013,7 +1014,7 @@ hooks.add('tableExportModule', {
|
|
|
1013
1014
|
}
|
|
1014
1015
|
column.checked = isChecked;
|
|
1015
1016
|
column.halfChecked = false;
|
|
1016
|
-
column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ column }) : false);
|
|
1017
|
+
column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false);
|
|
1017
1018
|
});
|
|
1018
1019
|
// 更新条件
|
|
1019
1020
|
Object.assign(exportStore, {
|
|
@@ -1184,14 +1185,14 @@ hooks.add('tableExportModule', {
|
|
|
1184
1185
|
}, {
|
|
1185
1186
|
children: 'childNodes',
|
|
1186
1187
|
mapChildren: '_children'
|
|
1187
|
-
}), (column, index) => isColumnInfo(column) && (!columnFilterMethod || columnFilterMethod({ column: column, $columnIndex: index })), {
|
|
1188
|
+
}), (column, index) => isColumnInfo(column) && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, column: column, $columnIndex: index })), {
|
|
1188
1189
|
children: '_children',
|
|
1189
1190
|
mapChildren: 'childNodes',
|
|
1190
1191
|
original: true
|
|
1191
1192
|
});
|
|
1192
1193
|
}
|
|
1193
1194
|
else {
|
|
1194
|
-
groups = XEUtils.searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({ column, $columnIndex: index })), { children: 'children', mapChildren: 'childNodes', original: true });
|
|
1195
|
+
groups = XEUtils.searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, column, $columnIndex: index })), { children: 'children', mapChildren: 'childNodes', original: true });
|
|
1195
1196
|
}
|
|
1196
1197
|
// 获取所有列
|
|
1197
1198
|
const cols = [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import { getRefElem } from '../../src/util';
|
|
4
|
-
import { hasClass, getAbsolutePos, addClass, removeClass } from '../../../ui/src/dom';
|
|
4
|
+
import { hasClass, getAbsolutePos, addClass, removeClass, hasControlKey } from '../../../ui/src/dom';
|
|
5
5
|
const { hooks } = VxeUI;
|
|
6
6
|
const browseObj = XEUtils.browse();
|
|
7
7
|
function getTargetOffset(target, container) {
|
|
@@ -178,8 +178,9 @@ hooks.add('tableKeyboardModule', {
|
|
|
178
178
|
const rangeRows = getCheckboxRangeRows(evnt, params, trElem, trRect, offsetClientTop, offsetTop < marginSize ? -rangeHeight : rangeHeight);
|
|
179
179
|
// 至少滑动 10px 才能有效匹配
|
|
180
180
|
if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
|
|
181
|
+
const isControlKey = hasControlKey(evnt);
|
|
181
182
|
lastRangeRows = rangeRows;
|
|
182
|
-
if (
|
|
183
|
+
if (isControlKey) {
|
|
183
184
|
rangeRows.forEach((row) => {
|
|
184
185
|
$xeTable.handleBatchSelectRows([row], selectRecords.indexOf(row) === -1);
|
|
185
186
|
});
|
package/es/table/src/body.js
CHANGED
|
@@ -399,9 +399,10 @@ export default defineComponent({
|
|
|
399
399
|
], key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex }, tdAttrs), { style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle) }), tdOns), isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
|
|
400
400
|
};
|
|
401
401
|
const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
|
|
402
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
402
403
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
|
|
403
|
-
const { hasFixedColumn, treeExpandedFlag, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, isDragColMove, rowExpandHeightFlag } = tableReactData;
|
|
404
|
-
const { fullAllDataRowIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData;
|
|
404
|
+
const { hasFixedColumn, treeExpandedFlag, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, isDragColMove, rowExpandHeightFlag, isRowGroupStatus } = tableReactData;
|
|
405
|
+
const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData;
|
|
405
406
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
406
407
|
const radioOpts = computeRadioOpts.value;
|
|
407
408
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -413,6 +414,7 @@ export default defineComponent({
|
|
|
413
414
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
414
415
|
const rows = [];
|
|
415
416
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
417
|
+
const isDeepRow = treeConfig || isRowGroupStatus;
|
|
416
418
|
tableData.forEach((row, $rowIndex) => {
|
|
417
419
|
const rowid = handleGetRowId(row);
|
|
418
420
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
@@ -420,6 +422,7 @@ export default defineComponent({
|
|
|
420
422
|
let rowLevel = 0;
|
|
421
423
|
let seq = -1;
|
|
422
424
|
let _rowIndex = -1;
|
|
425
|
+
const hasRowGroupAggregate = isRowGroupStatus && row.isAggregate;
|
|
423
426
|
const trOn = {};
|
|
424
427
|
// 当前行事件
|
|
425
428
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
@@ -438,7 +441,7 @@ export default defineComponent({
|
|
|
438
441
|
}
|
|
439
442
|
if (rowRest) {
|
|
440
443
|
rowLevel = rowRest.level;
|
|
441
|
-
if (treeConfig && transform && seqMode === 'increasing') {
|
|
444
|
+
if (hasRowGroupAggregate || (treeConfig && transform && seqMode === 'increasing')) {
|
|
442
445
|
seq = rowRest._index + 1;
|
|
443
446
|
}
|
|
444
447
|
else {
|
|
@@ -462,14 +465,14 @@ export default defineComponent({
|
|
|
462
465
|
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
463
466
|
}
|
|
464
467
|
// 拖拽行事件
|
|
465
|
-
if (rowOpts.drag && (!treeConfig || transform)) {
|
|
468
|
+
if (rowOpts.drag && !isRowGroupStatus && (!treeConfig || transform)) {
|
|
466
469
|
trOn.onDragstart = $xeTable.handleRowDragDragstartEvent;
|
|
467
470
|
trOn.onDragend = $xeTable.handleRowDragDragendEvent;
|
|
468
471
|
trOn.onDragover = $xeTable.handleRowDragDragoverEvent;
|
|
469
472
|
}
|
|
470
473
|
const trClass = [
|
|
471
474
|
'vxe-body--row',
|
|
472
|
-
|
|
475
|
+
isDeepRow ? `row--level-${rowLevel}` : '',
|
|
473
476
|
{
|
|
474
477
|
'row--stripe': stripe && (_rowIndex + 1) % 2 === 0,
|
|
475
478
|
'is--new': isNewRow,
|
|
@@ -478,7 +481,8 @@ export default defineComponent({
|
|
|
478
481
|
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
479
482
|
'row--radio': radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
|
|
480
483
|
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
481
|
-
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid]
|
|
484
|
+
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
|
|
485
|
+
'row--group': hasRowGroupAggregate
|
|
482
486
|
},
|
|
483
487
|
getPropClass(rowClassName, params)
|
|
484
488
|
];
|
|
@@ -486,10 +490,10 @@ export default defineComponent({
|
|
|
486
490
|
return renderTdColumn(seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
487
491
|
});
|
|
488
492
|
rows.push(!isColLoading && (columnOpts.drag && columnDragOpts.animation)
|
|
489
|
-
? h(TransitionGroup, Object.assign({ name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`, tag: 'tr', class: trClass, rowid: rowid, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null, key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex }, trOn), {
|
|
493
|
+
? h(TransitionGroup, Object.assign({ name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`, tag: 'tr', class: trClass, rowid: rowid, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null, key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex }, trOn), {
|
|
490
494
|
default: () => tdVNs
|
|
491
495
|
})
|
|
492
|
-
: h('tr', Object.assign({ class: trClass, rowid: rowid, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null, key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex }, trOn), tdVNs));
|
|
496
|
+
: h('tr', Object.assign({ class: trClass, rowid: rowid, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null, key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex }, trOn), tdVNs));
|
|
493
497
|
// 如果行被展开了
|
|
494
498
|
if (isExpandRow) {
|
|
495
499
|
const expandOpts = computeExpandOpts.value;
|
|
@@ -517,9 +521,40 @@ export default defineComponent({
|
|
|
517
521
|
if (treeConfig) {
|
|
518
522
|
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`;
|
|
519
523
|
}
|
|
520
|
-
const { showOverflow } = expandColumn;
|
|
524
|
+
const { showOverflow } = expandColumn || {};
|
|
525
|
+
const colid = expandColumn.id;
|
|
526
|
+
const colRest = fullColumnIdData[colid] || {};
|
|
521
527
|
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow;
|
|
522
|
-
|
|
528
|
+
let columnIndex = -1;
|
|
529
|
+
let $columnIndex = -1;
|
|
530
|
+
let _columnIndex = -1;
|
|
531
|
+
if (colRest) {
|
|
532
|
+
columnIndex = colRest.index;
|
|
533
|
+
$columnIndex = colRest.$index;
|
|
534
|
+
_columnIndex = colRest._index;
|
|
535
|
+
}
|
|
536
|
+
const expandParams = {
|
|
537
|
+
$grid: $xeGrid,
|
|
538
|
+
$table: $xeTable,
|
|
539
|
+
seq,
|
|
540
|
+
column: expandColumn,
|
|
541
|
+
columnIndex,
|
|
542
|
+
$columnIndex,
|
|
543
|
+
_columnIndex,
|
|
544
|
+
fixed: fixedType,
|
|
545
|
+
type: renderType,
|
|
546
|
+
level: rowLevel,
|
|
547
|
+
row,
|
|
548
|
+
rowid,
|
|
549
|
+
rowIndex,
|
|
550
|
+
$rowIndex,
|
|
551
|
+
_rowIndex,
|
|
552
|
+
isHidden: false,
|
|
553
|
+
isEdit: false,
|
|
554
|
+
visibleData: [],
|
|
555
|
+
data: [],
|
|
556
|
+
items: []
|
|
557
|
+
};
|
|
523
558
|
rows.push(h('tr', {
|
|
524
559
|
class: ['vxe-body--expanded-row', {
|
|
525
560
|
'is--padding': padding
|