vxe-table 3.11.4 → 3.11.6-beta.0
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/index.css +1 -0
- package/es/index.min.css +1 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/filter/mixin.js +23 -2
- package/es/table/module/filter/panel.js +3 -6
- package/es/table/src/body.js +55 -30
- package/es/table/src/footer.js +30 -22
- package/es/table/src/methods.js +253 -109
- package/es/table/src/table.js +11 -3
- package/es/table/style.css +48 -3
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +48 -3
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -0
- package/lib/index.min.css +1 -0
- package/lib/index.umd.js +436 -196
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/filter/mixin.js +25 -2
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +3 -7
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/src/body.js +65 -32
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +32 -23
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/methods.js +293 -127
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +16 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +48 -3
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +2 -2
- 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/lib/vxe-table/style/style.css +48 -3
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/filter/mixin.ts +26 -2
- package/packages/table/module/filter/panel.ts +3 -6
- package/packages/table/src/body.ts +66 -27
- package/packages/table/src/footer.ts +33 -21
- package/packages/table/src/methods.ts +266 -112
- package/packages/table/src/table.ts +11 -3
- package/packages/ui/index.ts +1 -1
- package/packages/ui/src/dom.ts +2 -2
- package/styles/components/table.scss +38 -3
- /package/es/{iconfont.1732091003142.ttf → iconfont.1732505453169.ttf} +0 -0
- /package/es/{iconfont.1732091003142.woff → iconfont.1732505453169.woff} +0 -0
- /package/es/{iconfont.1732091003142.woff2 → iconfont.1732505453169.woff2} +0 -0
- /package/lib/{iconfont.1732091003142.ttf → iconfont.1732505453169.ttf} +0 -0
- /package/lib/{iconfont.1732091003142.woff → iconfont.1732505453169.woff} +0 -0
- /package/lib/{iconfont.1732091003142.woff2 → iconfont.1732505453169.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -4,7 +4,7 @@ import { isEnableConf, getClass } from '../../ui/src/utils';
|
|
|
4
4
|
import { getOffsetSize, calcTreeLine, mergeBodyMethod, getRowid } from './util';
|
|
5
5
|
import { updateCellTitle, setScrollTop, setScrollLeft } from '../../ui/src/dom';
|
|
6
6
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
7
|
-
const { getI18n, renderer } = VxeUI;
|
|
7
|
+
const { getI18n, renderer, renderEmptyElement } = VxeUI;
|
|
8
8
|
const renderType = 'body';
|
|
9
9
|
// 滚动、拖动过程中不需要触发
|
|
10
10
|
function isVMScrollProcess($xetable) {
|
|
@@ -49,7 +49,8 @@ function renderLine(h, _vm, $xetable, params) {
|
|
|
49
49
|
* 渲染列
|
|
50
50
|
*/
|
|
51
51
|
function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
|
|
52
|
-
const { $listeners: tableListeners, fullAllDataRowIdData, afterFullData, tableData, height, columnKey, overflowX, sYOpts, scrollYLoad, highlightCurrentRow, showOverflow: allColumnOverflow, isAllOverflow, align: allAlign, currentColumn, cellClassName: allCellClassName, cellStyle, mergeList, spanMethod, radioOpts, checkboxOpts, expandOpts, treeOpts, tooltipOpts, mouseConfig, editConfig, editOpts, editRules, validOpts, editStore, tooltipConfig, rowOpts, columnOpts, validErrorMaps } = $xetable;
|
|
52
|
+
const { $listeners: tableListeners, fullAllDataRowIdData, afterFullData, tableData, height, columnKey, overflowX, sYOpts, scrollXLoad, scrollYLoad, highlightCurrentRow, showOverflow: allColumnOverflow, isAllOverflow, align: allAlign, currentColumn, cellClassName: allCellClassName, cellStyle, mergeList, spanMethod, radioOpts, checkboxOpts, expandOpts, treeOpts, tooltipOpts, mouseConfig, editConfig, editOpts, editRules, validOpts, editStore, tooltipConfig, rowOpts, columnOpts, mouseOpts, areaOpts, validErrorMaps } = $xetable;
|
|
53
|
+
const { selectCellToRow } = areaOpts;
|
|
53
54
|
const cellOpts = $xetable.computeCellOpts;
|
|
54
55
|
const { type, cellRender, editRender, align, showOverflow, className, treeNode, slots } = column;
|
|
55
56
|
const { verticalAlign } = cellOpts;
|
|
@@ -207,7 +208,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
207
208
|
if (showValidTip && errorValidItem) {
|
|
208
209
|
const errRule = errorValidItem.rule;
|
|
209
210
|
const validSlot = slots ? slots.valid : null;
|
|
210
|
-
const validParams = Object.assign(Object.assign({}, params), errorValidItem);
|
|
211
|
+
const validParams = Object.assign(Object.assign(Object.assign({}, params), errorValidItem), { rule: errorValidItem });
|
|
211
212
|
tdVNs.push(h('div', {
|
|
212
213
|
class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
|
|
213
214
|
style: errRule && errRule.maxWidth
|
|
@@ -234,11 +235,19 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
234
235
|
if (hasEllipsis && (scrollYRHeight || rowHeight)) {
|
|
235
236
|
cellHeight = `${scrollYRHeight || rowHeight}px`;
|
|
236
237
|
}
|
|
237
|
-
else if (scrollYLoad) {
|
|
238
|
+
else if (scrollXLoad || scrollYLoad) {
|
|
238
239
|
if (!hasEllipsis) {
|
|
239
240
|
cellHeight = `${rest.height || 24}px`;
|
|
240
241
|
}
|
|
241
242
|
}
|
|
243
|
+
if (mouseConfig && mouseOpts.area && selectCellToRow) {
|
|
244
|
+
if ((!$columnIndex && selectCellToRow === true) ||
|
|
245
|
+
(selectCellToRow === column.field)) {
|
|
246
|
+
tdVNs.push(h('div', {
|
|
247
|
+
class: 'vxe-cell--area-status'
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
242
251
|
return h('td', {
|
|
243
252
|
class: [
|
|
244
253
|
'vxe-body--column',
|
|
@@ -461,6 +470,7 @@ export default {
|
|
|
461
470
|
elemStore[`${prefix}emptyBlock`] = null;
|
|
462
471
|
},
|
|
463
472
|
render(h) {
|
|
473
|
+
const $xeTable = this.$parent;
|
|
464
474
|
const { _e, $parent: $xetable, fixedColumn, fixedType } = this;
|
|
465
475
|
let { $scopedSlots, tId, tableData, tableColumn, visibleColumn, expandColumn, showOverflow: allColumnOverflow, keyboardConfig, keyboardOpts, mergeList, spanMethod, scrollXLoad, scrollYLoad, isAllOverflow, emptyOpts, mouseConfig, mouseOpts, sYOpts, rowOpts, isDragRowMove } = $xetable;
|
|
466
476
|
// 如果是使用优化模式
|
|
@@ -500,14 +510,19 @@ export default {
|
|
|
500
510
|
emptyContent = $xetable.emptyText || getI18n('vxe.table.emptyText');
|
|
501
511
|
}
|
|
502
512
|
}
|
|
513
|
+
const ons = {
|
|
514
|
+
scroll: this.scrollEvent
|
|
515
|
+
};
|
|
516
|
+
if (sYOpts.mode === 'wheel') {
|
|
517
|
+
ons.wheel = this.wheelEvent;
|
|
518
|
+
}
|
|
503
519
|
return h('div', {
|
|
520
|
+
ref: 'refElem',
|
|
504
521
|
class: ['vxe-table--body-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],
|
|
505
522
|
attrs: {
|
|
506
523
|
xid: tId
|
|
507
524
|
},
|
|
508
|
-
on:
|
|
509
|
-
scroll: this.scrollEvent
|
|
510
|
-
}, scrollYLoad && sYOpts.mode === 'wheel' ? { wheel: this.wheelEvent } : null)
|
|
525
|
+
on: ons
|
|
511
526
|
}, [
|
|
512
527
|
fixedType
|
|
513
528
|
? _e()
|
|
@@ -590,7 +605,7 @@ export default {
|
|
|
590
605
|
class: 'vxe-table--cell-active-area'
|
|
591
606
|
})
|
|
592
607
|
])
|
|
593
|
-
:
|
|
608
|
+
: renderEmptyElement($xeTable),
|
|
594
609
|
!fixedType
|
|
595
610
|
? h('div', {
|
|
596
611
|
class: 'vxe-table--empty-block',
|
|
@@ -600,7 +615,7 @@ export default {
|
|
|
600
615
|
class: 'vxe-table--empty-content'
|
|
601
616
|
}, emptyContent)
|
|
602
617
|
])
|
|
603
|
-
:
|
|
618
|
+
: renderEmptyElement($xeTable)
|
|
604
619
|
]);
|
|
605
620
|
},
|
|
606
621
|
methods: {
|
|
@@ -610,24 +625,37 @@ export default {
|
|
|
610
625
|
* 如果存在列固定右侧,同步更新滚动状态
|
|
611
626
|
*/
|
|
612
627
|
scrollEvent(evnt) {
|
|
613
|
-
const
|
|
614
|
-
const
|
|
615
|
-
const {
|
|
628
|
+
const $xeTable = this.$parent;
|
|
629
|
+
const tableInternalData = $xeTable;
|
|
630
|
+
const { fixedType } = this;
|
|
631
|
+
const { lastScrollTop, lastScrollLeft, inVirtualScroll, inBodyScroll, bodyScrollType, inFooterScroll } = tableInternalData;
|
|
632
|
+
if (inVirtualScroll) {
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
if (inFooterScroll) {
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
if (inBodyScroll) {
|
|
639
|
+
if (bodyScrollType !== fixedType) {
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
const { tableHeader, tableBody, leftBody, rightBody, tableFooter } = $xeTable.$refs;
|
|
644
|
+
const scrollBodyElem = this.$el;
|
|
616
645
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
617
646
|
const footerElem = tableFooter ? tableFooter.$el : null;
|
|
618
647
|
const bodyElem = tableBody.$el;
|
|
619
648
|
const leftElem = leftBody ? leftBody.$el : null;
|
|
620
649
|
const rightElem = rightBody ? rightBody.$el : null;
|
|
650
|
+
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
651
|
+
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
621
652
|
const scrollTop = scrollBodyElem.scrollTop;
|
|
622
653
|
const scrollLeft = bodyElem.scrollLeft;
|
|
623
654
|
const isRollX = scrollLeft !== lastScrollLeft;
|
|
624
655
|
const isRollY = scrollTop !== lastScrollTop;
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
if (
|
|
628
|
-
yHandleEl.scrollTop = scrollTop;
|
|
629
|
-
}
|
|
630
|
-
else if (isRollY) {
|
|
656
|
+
tableInternalData.inBodyScroll = true;
|
|
657
|
+
tableInternalData.bodyScrollType = fixedType;
|
|
658
|
+
if (isRollY) {
|
|
631
659
|
if (leftElem && fixedType === 'left') {
|
|
632
660
|
setScrollTop(bodyElem, scrollTop);
|
|
633
661
|
setScrollTop(rightElem, scrollTop);
|
|
@@ -640,22 +668,19 @@ export default {
|
|
|
640
668
|
setScrollTop(leftElem, scrollTop);
|
|
641
669
|
setScrollTop(rightElem, scrollTop);
|
|
642
670
|
}
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
fixed: fixedType
|
|
646
|
-
});
|
|
647
|
-
}
|
|
648
|
-
if (xHandleEl) {
|
|
649
|
-
xHandleEl.scrollLeft = scrollLeft;
|
|
671
|
+
setScrollTop(yHandleEl, scrollTop);
|
|
672
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
650
673
|
}
|
|
651
|
-
|
|
674
|
+
if (isRollX) {
|
|
675
|
+
setScrollLeft(xHandleEl, scrollLeft);
|
|
652
676
|
setScrollLeft(headerElem, scrollLeft);
|
|
653
677
|
setScrollLeft(footerElem, scrollLeft);
|
|
654
|
-
$xeTable.
|
|
655
|
-
type: renderType,
|
|
656
|
-
fixed: fixedType
|
|
657
|
-
});
|
|
678
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
658
679
|
}
|
|
680
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
681
|
+
type: renderType,
|
|
682
|
+
fixed: fixedType
|
|
683
|
+
});
|
|
659
684
|
},
|
|
660
685
|
handleWheel(evnt, isTopWheel, deltaTop, isRollX, isRollY) {
|
|
661
686
|
const { $parent: $xetable } = this;
|
package/es/table/src/footer.js
CHANGED
|
@@ -221,14 +221,16 @@ export default {
|
|
|
221
221
|
tableColumn = visibleColumn;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
+
const ons = {};
|
|
225
|
+
if (!fixedType) {
|
|
226
|
+
ons.scroll = this.scrollEvent;
|
|
227
|
+
}
|
|
224
228
|
return h('div', {
|
|
225
229
|
class: ['vxe-table--footer-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],
|
|
226
230
|
attrs: {
|
|
227
231
|
xid: tId
|
|
228
232
|
},
|
|
229
|
-
on:
|
|
230
|
-
scroll: this.scrollEvent
|
|
231
|
-
}
|
|
233
|
+
on: ons
|
|
232
234
|
}, [
|
|
233
235
|
fixedType
|
|
234
236
|
? _e()
|
|
@@ -283,28 +285,34 @@ export default {
|
|
|
283
285
|
* 如果存在列固定右侧,同步更新滚动状态
|
|
284
286
|
*/
|
|
285
287
|
scrollEvent(evnt) {
|
|
286
|
-
const
|
|
287
|
-
const
|
|
288
|
-
const {
|
|
288
|
+
const $xeTable = this.$parent;
|
|
289
|
+
const tableInternalData = $xeTable;
|
|
290
|
+
const { inVirtualScroll, inBodyScroll } = tableInternalData;
|
|
291
|
+
if (inVirtualScroll) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
if (inBodyScroll) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const { fixedType } = this;
|
|
298
|
+
const { tableHeader, tableBody, tableFooter } = $xeTable.$refs;
|
|
289
299
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
290
300
|
const footerElem = tableFooter ? tableFooter.$el : null;
|
|
291
301
|
const bodyElem = tableBody.$el;
|
|
292
|
-
const
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
});
|
|
307
|
-
}
|
|
302
|
+
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
303
|
+
const scrollLeft = footerElem.scrollLeft;
|
|
304
|
+
const isRollX = true;
|
|
305
|
+
const isRollY = false;
|
|
306
|
+
const scrollTop = bodyElem.scrollTop;
|
|
307
|
+
tableInternalData.inFooterScroll = true;
|
|
308
|
+
setScrollLeft(xHandleEl, scrollLeft);
|
|
309
|
+
setScrollLeft(headerElem, scrollLeft);
|
|
310
|
+
setScrollLeft(bodyElem, scrollLeft);
|
|
311
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
312
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
313
|
+
type: renderType,
|
|
314
|
+
fixed: fixedType
|
|
315
|
+
});
|
|
308
316
|
}
|
|
309
317
|
}
|
|
310
318
|
};
|