vxe-table 4.2.2-beta.0 → 4.2.3-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/edit/src/hook.js +4 -2
- package/es/filter/src/hook.js +2 -1
- package/es/footer/src/footer.js +5 -5
- package/es/form/src/form.js +7 -4
- package/es/grid/src/grid.js +1 -1
- package/es/header/src/header.js +6 -6
- package/es/header/style.css +1 -5
- package/es/input/src/input.js +125 -27
- package/es/input/style.css +42 -13
- package/es/keyboard/src/hook.js +5 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +15 -11
- package/es/table/src/table.js +59 -48
- package/es/tools/log.js +1 -1
- package/es/v-x-e-table/index.js +1 -1
- package/helper/vetur/attributes.json +31 -19
- package/helper/vetur/tags.json +3 -0
- package/lib/edit/src/hook.js +6 -4
- package/lib/edit/src/hook.min.js +1 -1
- package/lib/filter/src/hook.js +2 -1
- package/lib/filter/src/hook.min.js +1 -1
- package/lib/footer/src/footer.js +5 -5
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/form/src/form.js +11 -9
- package/lib/form/src/form.min.js +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/src/header.js +6 -6
- package/lib/header/src/header.min.js +1 -1
- package/lib/header/style/style.css +1 -5
- package/lib/header/style/style.min.css +1 -1
- package/lib/index.umd.js +347 -128
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +166 -29
- package/lib/input/src/input.min.js +1 -1
- package/lib/input/style/style.css +42 -13
- package/lib/input/style/style.min.css +1 -1
- package/lib/keyboard/src/hook.js +7 -1
- package/lib/keyboard/src/hook.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +15 -11
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +66 -56
- package/lib/table/src/table.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/edit/src/hook.ts +4 -2
- package/packages/filter/src/hook.ts +3 -2
- package/packages/footer/src/footer.ts +5 -5
- package/packages/form/src/form.ts +7 -5
- package/packages/grid/src/grid.ts +1 -1
- package/packages/header/src/header.ts +6 -6
- package/packages/input/src/input.ts +128 -27
- package/packages/keyboard/src/hook.ts +6 -2
- package/packages/table/src/body.ts +15 -11
- package/packages/table/src/table.ts +58 -46
- package/packages/tools/dom.ts +1 -1
- package/styles/header.scss +1 -1
- package/styles/input.scss +16 -4
- package/types/input.d.ts +2 -0
- package/types/table.d.ts +3 -1
|
@@ -986,12 +986,17 @@ export default defineComponent({
|
|
|
986
986
|
* 支持 px、%、固定 混合分配
|
|
987
987
|
* 支持动态列表调整分配
|
|
988
988
|
* 支持自动分配偏移量
|
|
989
|
-
* @param {Element} headerElem
|
|
990
|
-
* @param {Element} bodyElem
|
|
991
|
-
* @param {Element} footerElem
|
|
992
|
-
* @param {Number} bodyWidth
|
|
993
989
|
*/
|
|
994
|
-
const autoCellWidth = (
|
|
990
|
+
const autoCellWidth = () => {
|
|
991
|
+
const tableHeader = refTableHeader.value
|
|
992
|
+
const tableBody = refTableBody.value
|
|
993
|
+
const tableFooter = refTableFooter.value
|
|
994
|
+
const bodyElem = tableBody ? tableBody.$el as HTMLDivElement : null
|
|
995
|
+
const headerElem = tableHeader ? tableHeader.$el as HTMLDivElement : null
|
|
996
|
+
const footerElem = tableFooter ? tableFooter.$el as HTMLDivElement : null
|
|
997
|
+
if (!bodyElem) {
|
|
998
|
+
return
|
|
999
|
+
}
|
|
995
1000
|
let tableWidth = 0
|
|
996
1001
|
const minCellWidth = 40 // 列宽最少限制 40px
|
|
997
1002
|
const bodyWidth = bodyElem.clientWidth - 1
|
|
@@ -1086,6 +1091,7 @@ export default defineComponent({
|
|
|
1086
1091
|
}
|
|
1087
1092
|
})
|
|
1088
1093
|
}
|
|
1094
|
+
console.log(headerHeight)
|
|
1089
1095
|
internalData.headerHeight = headerHeight
|
|
1090
1096
|
|
|
1091
1097
|
let overflowX = false
|
|
@@ -1331,7 +1337,8 @@ export default defineComponent({
|
|
|
1331
1337
|
const cellOffsetWidth = computeCellOffsetWidth.value
|
|
1332
1338
|
const mouseOpts = computeMouseOpts.value
|
|
1333
1339
|
const keyboardOpts = computeKeyboardOpts.value
|
|
1334
|
-
const
|
|
1340
|
+
const bodyWrapperRef = elemStore['main-body-wrapper']
|
|
1341
|
+
const bodyWrapperElem = bodyWrapperRef ? bodyWrapperRef.value : null
|
|
1335
1342
|
if (emptyPlaceholderElem) {
|
|
1336
1343
|
emptyPlaceholderElem.style.top = `${headerHeight}px`
|
|
1337
1344
|
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - scrollbarHeight}px` : ''
|
|
@@ -1352,8 +1359,10 @@ export default defineComponent({
|
|
|
1352
1359
|
fixedWrapperElem = isFixedLeft ? refLeftContainer.value : refRightContainer.value
|
|
1353
1360
|
}
|
|
1354
1361
|
layoutList.forEach(layout => {
|
|
1355
|
-
const
|
|
1356
|
-
const
|
|
1362
|
+
const wrapperRef = elemStore[`${name}-${layout}-wrapper`]
|
|
1363
|
+
const wrapperElem = wrapperRef ? wrapperRef.value : null
|
|
1364
|
+
const tableRef = elemStore[`${name}-${layout}-table`]
|
|
1365
|
+
const tableElem = tableRef ? tableRef.value : null
|
|
1357
1366
|
if (layout === 'header') {
|
|
1358
1367
|
// 表头体样式处理
|
|
1359
1368
|
// 横向滚动渲染
|
|
@@ -1383,12 +1392,14 @@ export default defineComponent({
|
|
|
1383
1392
|
}
|
|
1384
1393
|
}
|
|
1385
1394
|
|
|
1386
|
-
const
|
|
1395
|
+
const repairRef = elemStore[`${name}-${layout}-repair`]
|
|
1396
|
+
const repairElem = repairRef ? repairRef.value : null
|
|
1387
1397
|
if (repairElem) {
|
|
1388
1398
|
repairElem.style.width = `${tableWidth}px`
|
|
1389
1399
|
}
|
|
1390
1400
|
|
|
1391
|
-
const
|
|
1401
|
+
const listRef = elemStore[`${name}-${layout}-list`]
|
|
1402
|
+
const listElem = listRef ? listRef.value : null
|
|
1392
1403
|
if (isGroup && listElem) {
|
|
1393
1404
|
XEUtils.arrayEach(listElem.querySelectorAll('.col--group'), (thElem: any) => {
|
|
1394
1405
|
const colNode = tableMethods.getColumnNode(thElem)
|
|
@@ -1415,7 +1426,8 @@ export default defineComponent({
|
|
|
1415
1426
|
})
|
|
1416
1427
|
}
|
|
1417
1428
|
} else if (layout === 'body') {
|
|
1418
|
-
const
|
|
1429
|
+
const emptyBlockRef = elemStore[`${name}-${layout}-emptyBlock`]
|
|
1430
|
+
const emptyBlockElem = emptyBlockRef ? emptyBlockRef.value : null
|
|
1419
1431
|
if (isNodeElement(wrapperElem)) {
|
|
1420
1432
|
if (customMaxHeight) {
|
|
1421
1433
|
wrapperElem.style.maxHeight = `${fixedType ? customMaxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : customMaxHeight - headerHeight}px`
|
|
@@ -1489,7 +1501,8 @@ export default defineComponent({
|
|
|
1489
1501
|
tableElem.style.width = tWidth ? `${tWidth + scrollbarWidth}px` : ''
|
|
1490
1502
|
}
|
|
1491
1503
|
}
|
|
1492
|
-
const
|
|
1504
|
+
const colgroupRef = elemStore[`${name}-${layout}-colgroup`]
|
|
1505
|
+
const colgroupElem = colgroupRef ? colgroupRef.value : null
|
|
1493
1506
|
if (colgroupElem) {
|
|
1494
1507
|
XEUtils.arrayEach(colgroupElem.children, (colElem: any) => {
|
|
1495
1508
|
const colid = colElem.getAttribute('name')
|
|
@@ -1512,7 +1525,8 @@ export default defineComponent({
|
|
|
1512
1525
|
const showTitle = cellOverflow === 'title'
|
|
1513
1526
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip'
|
|
1514
1527
|
let hasEllipsis = showTitle || showTooltip || showEllipsis
|
|
1515
|
-
const
|
|
1528
|
+
const listRef = elemStore[`${name}-${layout}-list`]
|
|
1529
|
+
const listElem = listRef ? listRef.value : null
|
|
1516
1530
|
// 纵向虚拟滚动不支持动态行高
|
|
1517
1531
|
if (scrollYLoad && !hasEllipsis) {
|
|
1518
1532
|
hasEllipsis = true
|
|
@@ -1771,7 +1785,7 @@ export default defineComponent({
|
|
|
1771
1785
|
childRecords = []
|
|
1772
1786
|
}
|
|
1773
1787
|
if (childRecords) {
|
|
1774
|
-
tableMethods.loadTreeChildren(row, childRecords).then(childRows => {
|
|
1788
|
+
return tableMethods.loadTreeChildren(row, childRecords).then(childRows => {
|
|
1775
1789
|
if (childRows.length && $xetable.findRowIndexOf(treeExpandeds, row) === -1) {
|
|
1776
1790
|
treeExpandeds.push(row)
|
|
1777
1791
|
}
|
|
@@ -1779,17 +1793,18 @@ export default defineComponent({
|
|
|
1779
1793
|
if (!checkStrictly && tableMethods.isCheckedByCheckboxRow(row)) {
|
|
1780
1794
|
tableMethods.setCheckboxRow(childRows, true)
|
|
1781
1795
|
}
|
|
1782
|
-
nextTick().then(() => {
|
|
1796
|
+
return nextTick().then(() => {
|
|
1783
1797
|
if (transform) {
|
|
1784
1798
|
return tablePrivateMethods.handleTableData()
|
|
1785
1799
|
}
|
|
1786
|
-
})
|
|
1787
|
-
return tableMethods.recalculate()
|
|
1788
|
-
}).then(() => resolve())
|
|
1800
|
+
})
|
|
1789
1801
|
})
|
|
1790
|
-
} else {
|
|
1791
|
-
nextTick().then(() => tableMethods.recalculate()).then(() => resolve())
|
|
1792
1802
|
}
|
|
1803
|
+
}).catch(() => {
|
|
1804
|
+
rest.treeLoaded = false
|
|
1805
|
+
XEUtils.remove(treeLazyLoadeds, item => $xetable.eqRow(item, row))
|
|
1806
|
+
}).finally(() => {
|
|
1807
|
+
nextTick().then(() => tableMethods.recalculate()).then(() => resolve())
|
|
1793
1808
|
})
|
|
1794
1809
|
} else {
|
|
1795
1810
|
resolve()
|
|
@@ -1811,18 +1826,20 @@ export default defineComponent({
|
|
|
1811
1826
|
}
|
|
1812
1827
|
|
|
1813
1828
|
const handleAsyncRowExpand = (row: any): Promise<void> => {
|
|
1814
|
-
const { rowExpandeds, expandLazyLoadeds } = reactData
|
|
1815
1829
|
const { fullAllDataRowIdData } = internalData
|
|
1816
|
-
const rest = fullAllDataRowIdData[getRowid($xetable, row)]
|
|
1817
1830
|
return new Promise(resolve => {
|
|
1818
1831
|
const expandOpts = computeExpandOpts.value
|
|
1819
1832
|
const { loadMethod } = expandOpts
|
|
1820
1833
|
if (loadMethod) {
|
|
1821
|
-
|
|
1822
|
-
|
|
1834
|
+
const rest = fullAllDataRowIdData[getRowid($xetable, row)]
|
|
1835
|
+
reactData.expandLazyLoadeds.push(row)
|
|
1836
|
+
loadMethod({ $table: $xetable, row, rowIndex: tableMethods.getRowIndex(row), $rowIndex: tableMethods.getVMRowIndex(row) }).then(() => {
|
|
1823
1837
|
rest.expandLoaded = true
|
|
1824
|
-
|
|
1825
|
-
|
|
1838
|
+
reactData.rowExpandeds.push(row)
|
|
1839
|
+
}).catch(() => {
|
|
1840
|
+
rest.expandLoaded = false
|
|
1841
|
+
}).finally(() => {
|
|
1842
|
+
XEUtils.remove(reactData.expandLazyLoadeds, item => $xetable.eqRow(item, row))
|
|
1826
1843
|
resolve(nextTick().then(() => tableMethods.recalculate()))
|
|
1827
1844
|
})
|
|
1828
1845
|
} else {
|
|
@@ -2945,21 +2962,13 @@ export default defineComponent({
|
|
|
2945
2962
|
* 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
|
|
2946
2963
|
*/
|
|
2947
2964
|
recalculate (refull?: boolean) {
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
autoCellWidth(headerElem, bodyElem, footerElem)
|
|
2956
|
-
if (refull === true) {
|
|
2957
|
-
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
2958
|
-
return computeScrollLoad().then(() => {
|
|
2959
|
-
autoCellWidth(headerElem, bodyElem, footerElem)
|
|
2960
|
-
return computeScrollLoad()
|
|
2961
|
-
})
|
|
2962
|
-
}
|
|
2965
|
+
autoCellWidth()
|
|
2966
|
+
if (refull === true) {
|
|
2967
|
+
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
2968
|
+
return computeScrollLoad().then(() => {
|
|
2969
|
+
autoCellWidth()
|
|
2970
|
+
return computeScrollLoad()
|
|
2971
|
+
})
|
|
2963
2972
|
}
|
|
2964
2973
|
return computeScrollLoad()
|
|
2965
2974
|
},
|
|
@@ -5338,7 +5347,8 @@ export default defineComponent({
|
|
|
5338
5347
|
containerList.forEach(name => {
|
|
5339
5348
|
const layoutList = ['header', 'body', 'footer']
|
|
5340
5349
|
layoutList.forEach(layout => {
|
|
5341
|
-
const
|
|
5350
|
+
const xSpaceRef = elemStore[`${name}-${layout}-xSpace`]
|
|
5351
|
+
const xSpaceElem = xSpaceRef ? xSpaceRef.value : null
|
|
5342
5352
|
if (xSpaceElem) {
|
|
5343
5353
|
xSpaceElem.style.width = scrollXLoad ? `${tableWidth + (layout === 'header' ? scrollbarWidth : 0)}px` : ''
|
|
5344
5354
|
}
|
|
@@ -5363,12 +5373,14 @@ export default defineComponent({
|
|
|
5363
5373
|
}
|
|
5364
5374
|
containerList.forEach(name => {
|
|
5365
5375
|
const layoutList = ['header', 'body', 'footer']
|
|
5366
|
-
const
|
|
5376
|
+
const tableRef = elemStore[`${name}-body-table`]
|
|
5377
|
+
const tableElem = tableRef ? tableRef.value : null
|
|
5367
5378
|
if (tableElem) {
|
|
5368
5379
|
tableElem.style.marginTop = marginTop
|
|
5369
5380
|
}
|
|
5370
5381
|
layoutList.forEach(layout => {
|
|
5371
|
-
const
|
|
5382
|
+
const ySpaceRef = elemStore[`${name}-${layout}-ySpace`]
|
|
5383
|
+
const ySpaceElem = ySpaceRef ? ySpaceRef.value : null
|
|
5372
5384
|
if (ySpaceElem) {
|
|
5373
5385
|
ySpaceElem.style.height = ySpaceHeight
|
|
5374
5386
|
}
|
|
@@ -5377,14 +5389,14 @@ export default defineComponent({
|
|
|
5377
5389
|
nextTick(updateStyle)
|
|
5378
5390
|
},
|
|
5379
5391
|
updateScrollXData () {
|
|
5380
|
-
reactData.tableColumn = []
|
|
5392
|
+
// reactData.tableColumn = []
|
|
5381
5393
|
nextTick(() => {
|
|
5382
5394
|
handleTableColumn()
|
|
5383
5395
|
tablePrivateMethods.updateScrollXSpace()
|
|
5384
5396
|
})
|
|
5385
5397
|
},
|
|
5386
5398
|
updateScrollYData () {
|
|
5387
|
-
reactData.tableData = []
|
|
5399
|
+
// reactData.tableData = []
|
|
5388
5400
|
nextTick(() => {
|
|
5389
5401
|
tablePrivateMethods.handleTableData()
|
|
5390
5402
|
tablePrivateMethods.updateScrollYSpace()
|
package/packages/tools/dom.ts
CHANGED
package/styles/header.scss
CHANGED
package/styles/input.scss
CHANGED
|
@@ -380,6 +380,9 @@ $iconWidth: 1.6em;
|
|
|
380
380
|
position: absolute;
|
|
381
381
|
right: 0;
|
|
382
382
|
top: 0;
|
|
383
|
+
}
|
|
384
|
+
.vxe-input--time-picker-confirm,
|
|
385
|
+
.vxe-input--date-picker-confirm {
|
|
383
386
|
outline: 0;
|
|
384
387
|
border: 1px solid $vxe-input-border-color;
|
|
385
388
|
border-radius: $vxe-border-radius;
|
|
@@ -429,8 +432,6 @@ $iconWidth: 1.6em;
|
|
|
429
432
|
.vxe-input--date-picker-btn {
|
|
430
433
|
display: inline-block;
|
|
431
434
|
display: flex;
|
|
432
|
-
border-radius: $vxe-border-radius;
|
|
433
|
-
border: 1px solid $vxe-input-border-color;
|
|
434
435
|
align-items: center;
|
|
435
436
|
justify-content: center;
|
|
436
437
|
background-color: $vxe-button-default-background-color;
|
|
@@ -496,6 +497,10 @@ $iconWidth: 1.6em;
|
|
|
496
497
|
&.is--selected {
|
|
497
498
|
color: $vxe-input-date-picker-selected-color;
|
|
498
499
|
background-color: $vxe-primary-color;
|
|
500
|
+
&.is--prev,
|
|
501
|
+
&.is--next {
|
|
502
|
+
background-color: lighten($vxe-primary-color, 10%);
|
|
503
|
+
}
|
|
499
504
|
.vxe-input--date-label,
|
|
500
505
|
.vxe-input--date-festival {
|
|
501
506
|
color: $vxe-input-date-picker-festival-selected-color;
|
|
@@ -779,9 +784,15 @@ $iconWidth: 1.6em;
|
|
|
779
784
|
}
|
|
780
785
|
.vxe-input--date-picker-btn-wrapper {
|
|
781
786
|
.vxe-input--date-picker-btn {
|
|
782
|
-
width: 31px - $sizeIndex;
|
|
783
787
|
margin-left: 9px - $sizeIndex;
|
|
784
788
|
}
|
|
789
|
+
.vxe-input--date-picker-prev-btn,
|
|
790
|
+
.vxe-input--date-picker-current-btn,
|
|
791
|
+
.vxe-input--date-picker-next-btn {
|
|
792
|
+
width: 31px - $sizeIndex;
|
|
793
|
+
border-radius: $vxe-border-radius;
|
|
794
|
+
border: 1px solid $vxe-input-border-color;
|
|
795
|
+
}
|
|
785
796
|
}
|
|
786
797
|
.vxe-input--date-picker-type-wrapper {
|
|
787
798
|
.vxe-input--date-picker-label,
|
|
@@ -841,7 +852,8 @@ $iconWidth: 1.6em;
|
|
|
841
852
|
height: nth($titleRowHeightList, $sizeIndex);
|
|
842
853
|
}
|
|
843
854
|
}
|
|
844
|
-
.vxe-input--time-picker-confirm
|
|
855
|
+
.vxe-input--time-picker-confirm,
|
|
856
|
+
.vxe-input--date-picker-confirm {
|
|
845
857
|
height: 31px - $sizeIndex;
|
|
846
858
|
padding: 0 10px - $sizeIndex;
|
|
847
859
|
}
|
package/types/input.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export namespace VxeInputPropTypes {
|
|
|
55
55
|
export type Disabled = boolean
|
|
56
56
|
export type Placeholder = string
|
|
57
57
|
export type Maxlength = string | number
|
|
58
|
+
export type Multiple = boolean
|
|
58
59
|
export type Autocomplete = string
|
|
59
60
|
export type Align = string
|
|
60
61
|
export type Form = string
|
|
@@ -91,6 +92,7 @@ export type VxeInputProps = {
|
|
|
91
92
|
disabled?: VxeInputPropTypes.Disabled
|
|
92
93
|
placeholder?: VxeInputPropTypes.Placeholder
|
|
93
94
|
maxlength?: VxeInputPropTypes.Maxlength
|
|
95
|
+
multiple?: VxeInputPropTypes.Multiple
|
|
94
96
|
autocomplete?: VxeInputPropTypes.Autocomplete
|
|
95
97
|
align?: VxeInputPropTypes.Align
|
|
96
98
|
form?: VxeInputPropTypes.Form
|
package/types/table.d.ts
CHANGED
|
@@ -927,7 +927,9 @@ export interface TableReactData {
|
|
|
927
927
|
|
|
928
928
|
export interface TableInternalData {
|
|
929
929
|
tZindex: number
|
|
930
|
-
elemStore:
|
|
930
|
+
elemStore: {
|
|
931
|
+
[key: string]: Ref<HTMLElement> | null
|
|
932
|
+
}
|
|
931
933
|
// 存放横向 X 虚拟滚动相关的信息
|
|
932
934
|
scrollXStore: {
|
|
933
935
|
offsetSize: number
|