vxe-table 3.11.38 → 3.11.39
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/style.css +1 -1
- package/es/table/render/index.js +44 -11
- package/es/table/src/body.js +29 -26
- package/es/table/src/footer.js +29 -18
- package/es/table/src/header.js +25 -7
- package/es/table/src/methods.js +25 -16
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +192 -126
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/render/index.js +44 -11
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +47 -47
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +41 -32
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +35 -15
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +23 -19
- package/lib/table/src/methods.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/render/index.ts +45 -11
- package/packages/table/src/body.ts +32 -26
- package/packages/table/src/footer.ts +33 -18
- package/packages/table/src/header.ts +25 -7
- package/packages/table/src/methods.ts +25 -19
- /package/es/{iconfont.1735003904481.ttf → iconfont.1735027791418.ttf} +0 -0
- /package/es/{iconfont.1735003904481.woff → iconfont.1735027791418.woff} +0 -0
- /package/es/{iconfont.1735003904481.woff2 → iconfont.1735027791418.woff2} +0 -0
- /package/lib/{iconfont.1735003904481.ttf → iconfont.1735027791418.ttf} +0 -0
- /package/lib/{iconfont.1735003904481.woff → iconfont.1735027791418.woff} +0 -0
- /package/lib/{iconfont.1735003904481.woff2 → iconfont.1735027791418.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -498,46 +498,49 @@ export default {
|
|
|
498
498
|
elemStore[`${prefix}emptyBlock`] = null;
|
|
499
499
|
},
|
|
500
500
|
render(h) {
|
|
501
|
+
const props = this;
|
|
501
502
|
const $xeTable = this.$parent;
|
|
502
|
-
const
|
|
503
|
+
const tableProps = $xeTable;
|
|
504
|
+
const tableReactData = $xeTable;
|
|
505
|
+
const tableInternalData = $xeTable;
|
|
506
|
+
const { tId, $scopedSlots } = $xeTable;
|
|
507
|
+
const { fixedColumn, fixedType, tableColumn } = props;
|
|
508
|
+
const { showOverflow: allColumnOverflow, spanMethod, footerSpanMethod, mouseConfig } = tableProps;
|
|
509
|
+
const { tableData, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn } = tableReactData;
|
|
510
|
+
const { visibleColumn } = tableInternalData;
|
|
503
511
|
const rowOpts = $xeTable.computeRowOpts;
|
|
512
|
+
const sYOpts = $xeTable.computeSYOpts;
|
|
513
|
+
const emptyOpts = $xeTable.computeEmptyOpts;
|
|
514
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
504
515
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
505
|
-
let
|
|
506
|
-
// 如果是使用优化模式
|
|
516
|
+
let renderColumnList = tableColumn;
|
|
507
517
|
if (fixedType) {
|
|
508
|
-
//
|
|
509
|
-
if (
|
|
510
|
-
|
|
511
|
-
|
|
518
|
+
// 如果是使用优化模式
|
|
519
|
+
if (scrollXLoad || scrollYLoad || (allColumnOverflow && isAllOverflow)) {
|
|
520
|
+
// 如果不支持优化模式
|
|
521
|
+
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
522
|
+
renderColumnList = visibleColumn;
|
|
512
523
|
}
|
|
513
524
|
else {
|
|
514
|
-
|
|
515
|
-
// 检查固定列是否被合并,合并范围是否超出固定列
|
|
516
|
-
// if (mergeList.length && !isMergeLeftFixedExceeded && fixedType === 'left') {
|
|
517
|
-
// tableColumn = fixedColumn
|
|
518
|
-
// } else if (mergeList.length && !isMergeRightFixedExceeded && fixedType === 'right') {
|
|
519
|
-
// tableColumn = fixedColumn
|
|
520
|
-
// } else {
|
|
521
|
-
// tableColumn = visibleColumn
|
|
522
|
-
// }
|
|
525
|
+
renderColumnList = fixedColumn || [];
|
|
523
526
|
}
|
|
524
527
|
}
|
|
525
528
|
else {
|
|
526
|
-
|
|
529
|
+
renderColumnList = visibleColumn;
|
|
527
530
|
}
|
|
528
531
|
}
|
|
529
532
|
let emptyContent;
|
|
530
533
|
if ($scopedSlots.empty) {
|
|
531
|
-
emptyContent = $scopedSlots.empty.call(this, { $table: $
|
|
534
|
+
emptyContent = $scopedSlots.empty.call(this, { $table: $xeTable, $grid: $xeTable.xegrid }, h);
|
|
532
535
|
}
|
|
533
536
|
else {
|
|
534
537
|
const compConf = emptyOpts.name ? renderer.get(emptyOpts.name) : null;
|
|
535
538
|
const rtEmptyView = compConf ? (compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty) : null;
|
|
536
539
|
if (rtEmptyView) {
|
|
537
|
-
emptyContent = getSlotVNs(rtEmptyView.call(this, h, emptyOpts, { $table: $
|
|
540
|
+
emptyContent = getSlotVNs(rtEmptyView.call(this, h, emptyOpts, { $table: $xeTable }));
|
|
538
541
|
}
|
|
539
542
|
else {
|
|
540
|
-
emptyContent =
|
|
543
|
+
emptyContent = tableProps.emptyText || getI18n('vxe.table.emptyText');
|
|
541
544
|
}
|
|
542
545
|
}
|
|
543
546
|
const ons = {
|
|
@@ -555,7 +558,7 @@ export default {
|
|
|
555
558
|
on: ons
|
|
556
559
|
}, [
|
|
557
560
|
fixedType
|
|
558
|
-
?
|
|
561
|
+
? renderEmptyElement($xeTable)
|
|
559
562
|
: h('div', {
|
|
560
563
|
class: 'vxe-body--x-space',
|
|
561
564
|
ref: 'xSpace'
|
|
@@ -579,7 +582,7 @@ export default {
|
|
|
579
582
|
*/
|
|
580
583
|
h('colgroup', {
|
|
581
584
|
ref: 'colgroup'
|
|
582
|
-
},
|
|
585
|
+
}, renderColumnList.map((column, $columnIndex) => {
|
|
583
586
|
return h('col', {
|
|
584
587
|
attrs: {
|
|
585
588
|
name: column.id
|
|
@@ -596,10 +599,10 @@ export default {
|
|
|
596
599
|
tag: 'tbody',
|
|
597
600
|
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`
|
|
598
601
|
}
|
|
599
|
-
}, renderRows(h, this, $
|
|
602
|
+
}, renderRows(h, this, $xeTable, fixedType, tableData, renderColumnList))
|
|
600
603
|
: h('tbody', {
|
|
601
604
|
ref: 'tbody'
|
|
602
|
-
}, renderRows(h, this, $
|
|
605
|
+
}, renderRows(h, this, $xeTable, fixedType, tableData, renderColumnList))
|
|
603
606
|
]),
|
|
604
607
|
h('div', {
|
|
605
608
|
class: 'vxe-table--checkbox-range'
|
|
@@ -616,8 +619,8 @@ export default {
|
|
|
616
619
|
class: 'vxe-table--cell-main-area-btn',
|
|
617
620
|
on: {
|
|
618
621
|
mousedown(evnt) {
|
|
619
|
-
if ($
|
|
620
|
-
$
|
|
622
|
+
if ($xeTable.triggerCellAreaExtendMousedownEvent) {
|
|
623
|
+
$xeTable.triggerCellAreaExtendMousedownEvent(evnt, { $table: $xeTable, fixed: fixedType, type: renderType });
|
|
621
624
|
}
|
|
622
625
|
}
|
|
623
626
|
}
|
package/es/table/src/footer.js
CHANGED
|
@@ -3,7 +3,7 @@ import { VxeUI } from '../../ui';
|
|
|
3
3
|
import { getClass } from '../../ui/src/utils';
|
|
4
4
|
import { updateCellTitle, setScrollLeft } from '../../ui/src/dom';
|
|
5
5
|
const renderType = 'footer';
|
|
6
|
-
const { renderer } = VxeUI;
|
|
6
|
+
const { renderer, renderEmptyElement } = VxeUI;
|
|
7
7
|
function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
8
8
|
for (let mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
|
|
9
9
|
const { row: mergeRowIndex, col: mergeColIndex, rowspan: mergeRowspan, colspan: mergeColspan } = mergeFooterList[mIndex];
|
|
@@ -147,15 +147,16 @@ function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIn
|
|
|
147
147
|
]
|
|
148
148
|
: []);
|
|
149
149
|
}
|
|
150
|
-
function renderHeads(h, _vm,
|
|
150
|
+
function renderHeads(h, _vm, renderColumnList) {
|
|
151
151
|
const $xeTable = _vm.$parent;
|
|
152
|
+
const props = _vm;
|
|
152
153
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
153
154
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
154
|
-
const {
|
|
155
|
-
const { footerRowClassName, footerRowStyle, isDragColMove } = $
|
|
155
|
+
const { fixedType, footerTableData } = props;
|
|
156
|
+
const { footerRowClassName, footerRowStyle, isDragColMove } = $xeTable;
|
|
156
157
|
return footerTableData.map((row, $rowIndex) => {
|
|
157
158
|
const _rowIndex = $rowIndex;
|
|
158
|
-
const rowParams = { $table: $
|
|
159
|
+
const rowParams = { $table: $xeTable, row, _rowIndex, $rowIndex, fixed: fixedType, type: renderType };
|
|
159
160
|
if (columnOpts.drag && columnDragOpts.animation) {
|
|
160
161
|
return h('transition-group', {
|
|
161
162
|
key: $rowIndex,
|
|
@@ -168,7 +169,7 @@ function renderHeads(h, _vm, footerTableData) {
|
|
|
168
169
|
],
|
|
169
170
|
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) : null
|
|
170
171
|
}
|
|
171
|
-
}, renderRows(h, _vm,
|
|
172
|
+
}, renderRows(h, _vm, renderColumnList, footerTableData, row, $rowIndex, _rowIndex));
|
|
172
173
|
}
|
|
173
174
|
return h('tr', {
|
|
174
175
|
key: $rowIndex,
|
|
@@ -177,7 +178,7 @@ function renderHeads(h, _vm, footerTableData) {
|
|
|
177
178
|
footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''
|
|
178
179
|
],
|
|
179
180
|
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) : null
|
|
180
|
-
}, renderRows(h, _vm,
|
|
181
|
+
}, renderRows(h, _vm, renderColumnList, footerTableData, row, $rowIndex, _rowIndex));
|
|
181
182
|
});
|
|
182
183
|
}
|
|
183
184
|
export default {
|
|
@@ -210,21 +211,31 @@ export default {
|
|
|
210
211
|
elemStore[`${prefix}xSpace`] = null;
|
|
211
212
|
},
|
|
212
213
|
render(h) {
|
|
213
|
-
|
|
214
|
-
const
|
|
214
|
+
const props = this;
|
|
215
|
+
const $xeTable = this.$parent;
|
|
216
|
+
const tableProps = $xeTable;
|
|
217
|
+
const tableReactData = $xeTable;
|
|
218
|
+
const tableInternalData = $xeTable;
|
|
219
|
+
const { tId } = $xeTable;
|
|
220
|
+
const { fixedType, fixedColumn, tableColumn } = props;
|
|
221
|
+
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps;
|
|
222
|
+
const { visibleColumn } = tableInternalData;
|
|
223
|
+
const { scrollbarWidth } = tableReactData;
|
|
224
|
+
let renderColumnList = tableColumn;
|
|
215
225
|
// 如果是使用优化模式
|
|
216
226
|
if (fixedType) {
|
|
217
|
-
//
|
|
218
|
-
if (
|
|
219
|
-
|
|
220
|
-
|
|
227
|
+
// 如果是使用优化模式
|
|
228
|
+
if (allColumnFooterOverflow) {
|
|
229
|
+
// 如果不支持优化模式
|
|
230
|
+
if (spanMethod || footerSpanMethod) {
|
|
231
|
+
renderColumnList = visibleColumn;
|
|
221
232
|
}
|
|
222
233
|
else {
|
|
223
|
-
|
|
234
|
+
renderColumnList = fixedColumn || [];
|
|
224
235
|
}
|
|
225
236
|
}
|
|
226
237
|
else {
|
|
227
|
-
|
|
238
|
+
renderColumnList = visibleColumn;
|
|
228
239
|
}
|
|
229
240
|
}
|
|
230
241
|
const ons = {};
|
|
@@ -239,7 +250,7 @@ export default {
|
|
|
239
250
|
on: ons
|
|
240
251
|
}, [
|
|
241
252
|
fixedType
|
|
242
|
-
?
|
|
253
|
+
? renderEmptyElement($xeTable)
|
|
243
254
|
: h('div', {
|
|
244
255
|
class: 'vxe-body--x-space',
|
|
245
256
|
ref: 'xSpace'
|
|
@@ -259,7 +270,7 @@ export default {
|
|
|
259
270
|
*/
|
|
260
271
|
h('colgroup', {
|
|
261
272
|
ref: 'colgroup'
|
|
262
|
-
},
|
|
273
|
+
}, renderColumnList.map((column, $columnIndex) => {
|
|
263
274
|
return h('col', {
|
|
264
275
|
attrs: {
|
|
265
276
|
name: column.id
|
|
@@ -280,7 +291,7 @@ export default {
|
|
|
280
291
|
*/
|
|
281
292
|
h('tfoot', {
|
|
282
293
|
ref: 'tfoot'
|
|
283
|
-
}, renderHeads(h, this,
|
|
294
|
+
}, renderHeads(h, this, renderColumnList))
|
|
284
295
|
])
|
|
285
296
|
]);
|
|
286
297
|
},
|
package/es/table/src/header.js
CHANGED
|
@@ -3,7 +3,7 @@ import { VxeUI } from '../../ui';
|
|
|
3
3
|
import { getClass } from '../../ui/src/utils';
|
|
4
4
|
import { getOffsetPos, hasClass, addClass, removeClass } from '../../ui/src/dom';
|
|
5
5
|
import { convertHeaderColumnToRows, getColReMinWidth } from './util';
|
|
6
|
-
const { renderer } = VxeUI;
|
|
6
|
+
const { renderer, renderEmptyElement } = VxeUI;
|
|
7
7
|
const cellType = 'header';
|
|
8
8
|
const renderRows = (h, _vm, cols, $rowIndex) => {
|
|
9
9
|
const $xeTable = _vm.$parent;
|
|
@@ -193,18 +193,36 @@ export default {
|
|
|
193
193
|
elemStore[`${prefix}repair`] = null;
|
|
194
194
|
},
|
|
195
195
|
render(h) {
|
|
196
|
-
const
|
|
197
|
-
const
|
|
196
|
+
const props = this;
|
|
197
|
+
const $xeTable = this.$parent;
|
|
198
|
+
const tableProps = $xeTable;
|
|
199
|
+
const tableReactData = $xeTable;
|
|
200
|
+
const tableInternalData = $xeTable;
|
|
201
|
+
const { tId } = $xeTable;
|
|
202
|
+
const { fixedType, fixedColumn, tableColumn } = props;
|
|
203
|
+
const { headerColumn } = this;
|
|
204
|
+
const { showHeaderOverflow: allColumnHeaderOverflow, spanMethod, footerSpanMethod } = tableProps;
|
|
205
|
+
const { isGroup, scrollbarWidth } = tableReactData;
|
|
206
|
+
const { visibleColumn } = tableInternalData;
|
|
198
207
|
let headerGroups = headerColumn;
|
|
199
208
|
let renderColumnList = tableColumn;
|
|
200
209
|
if (isGroup) {
|
|
201
210
|
renderColumnList = visibleColumn;
|
|
202
211
|
}
|
|
203
212
|
else {
|
|
204
|
-
// 如果是使用优化模式
|
|
205
213
|
if (fixedType) {
|
|
206
|
-
|
|
207
|
-
|
|
214
|
+
// 如果是使用优化模式
|
|
215
|
+
if (allColumnHeaderOverflow) {
|
|
216
|
+
// 如果不支持优化模式
|
|
217
|
+
if (spanMethod || footerSpanMethod) {
|
|
218
|
+
renderColumnList = visibleColumn;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
renderColumnList = fixedColumn || [];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
renderColumnList = visibleColumn;
|
|
208
226
|
}
|
|
209
227
|
}
|
|
210
228
|
headerGroups = [renderColumnList];
|
|
@@ -216,7 +234,7 @@ export default {
|
|
|
216
234
|
}
|
|
217
235
|
}, [
|
|
218
236
|
fixedType
|
|
219
|
-
?
|
|
237
|
+
? renderEmptyElement($xeTable)
|
|
220
238
|
: h('div', {
|
|
221
239
|
class: 'vxe-body--x-space',
|
|
222
240
|
ref: 'xSpace'
|
package/es/table/src/methods.js
CHANGED
|
@@ -2930,7 +2930,7 @@ const Methods = {
|
|
|
2930
2930
|
},
|
|
2931
2931
|
updateStyle() {
|
|
2932
2932
|
const $xeTable = this;
|
|
2933
|
-
let { $refs, isGroup, fullColumnIdData, tableColumn, customHeight, customMinHeight, customMaxHeight, border, headerHeight, showFooter, showOverflow: allColumnOverflow, showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, footerHeight, tableHeight, tableWidth, scrollbarHeight, scrollbarWidth, scrollXLoad, scrollYLoad, overflowX, cellOffsetWidth, columnStore, elemStore, editStore, currentRow, mouseConfig,
|
|
2933
|
+
let { $refs, isGroup, fullColumnIdData, tableColumn, customHeight, customMinHeight, customMaxHeight, border, headerHeight, showFooter, showOverflow: allColumnOverflow, showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, footerHeight, tableHeight, tableWidth, scrollbarHeight, scrollbarWidth, scrollXLoad, scrollYLoad, overflowX, cellOffsetWidth, columnStore, elemStore, editStore, currentRow, mouseConfig, spanMethod, expandColumn, footerSpanMethod, isAllOverflow, visibleColumn } = $xeTable;
|
|
2934
2934
|
const containerList = ['main', 'left', 'right'];
|
|
2935
2935
|
const emptyPlaceholderElem = $refs.emptyPlaceholder;
|
|
2936
2936
|
const bodyWrapperElem = elemStore['main-body-wrapper'];
|
|
@@ -2984,10 +2984,19 @@ const Methods = {
|
|
|
2984
2984
|
renderColumnList = visibleColumn;
|
|
2985
2985
|
}
|
|
2986
2986
|
else {
|
|
2987
|
-
// 如果是使用优化模式
|
|
2988
2987
|
if (fixedType) {
|
|
2989
|
-
|
|
2990
|
-
|
|
2988
|
+
// 如果是使用优化模式
|
|
2989
|
+
if (allColumnHeaderOverflow) {
|
|
2990
|
+
// 如果不支持优化模式
|
|
2991
|
+
if (spanMethod || footerSpanMethod) {
|
|
2992
|
+
renderColumnList = visibleColumn;
|
|
2993
|
+
}
|
|
2994
|
+
else {
|
|
2995
|
+
renderColumnList = fixedColumn || [];
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
else {
|
|
2999
|
+
renderColumnList = visibleColumn;
|
|
2991
3000
|
}
|
|
2992
3001
|
}
|
|
2993
3002
|
}
|
|
@@ -3074,15 +3083,15 @@ const Methods = {
|
|
|
3074
3083
|
}
|
|
3075
3084
|
let tWidth = tableWidth;
|
|
3076
3085
|
let renderColumnList = tableColumn;
|
|
3077
|
-
// 如果是使用优化模式
|
|
3078
3086
|
if (fixedType) {
|
|
3079
|
-
//
|
|
3080
|
-
if (
|
|
3081
|
-
|
|
3082
|
-
|
|
3087
|
+
// 如果是使用优化模式
|
|
3088
|
+
if (scrollXLoad || scrollYLoad || (allColumnOverflow && isAllOverflow)) {
|
|
3089
|
+
// 如果不支持优化模式
|
|
3090
|
+
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
3091
|
+
renderColumnList = visibleColumn;
|
|
3083
3092
|
}
|
|
3084
3093
|
else {
|
|
3085
|
-
renderColumnList =
|
|
3094
|
+
renderColumnList = fixedColumn || [];
|
|
3086
3095
|
}
|
|
3087
3096
|
}
|
|
3088
3097
|
else {
|
|
@@ -3102,15 +3111,15 @@ const Methods = {
|
|
|
3102
3111
|
else if (layout === 'footer') {
|
|
3103
3112
|
let tWidth = tableWidth;
|
|
3104
3113
|
let renderColumnList = tableColumn;
|
|
3105
|
-
// 如果是使用优化模式
|
|
3106
3114
|
if (fixedType) {
|
|
3107
|
-
//
|
|
3108
|
-
if (
|
|
3109
|
-
|
|
3110
|
-
|
|
3115
|
+
// 如果是使用优化模式
|
|
3116
|
+
if (allColumnFooterOverflow) {
|
|
3117
|
+
// 如果不支持优化模式
|
|
3118
|
+
if (spanMethod || footerSpanMethod) {
|
|
3119
|
+
renderColumnList = visibleColumn;
|
|
3111
3120
|
}
|
|
3112
3121
|
else {
|
|
3113
|
-
renderColumnList =
|
|
3122
|
+
renderColumnList = fixedColumn || [];
|
|
3114
3123
|
}
|
|
3115
3124
|
}
|
|
3116
3125
|
else {
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED