vxe-table 3.9.8 → 3.9.10
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/src/methods.js +61 -3
- package/es/table/src/util.js +6 -5
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +83 -13
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/methods.js +74 -5
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +6 -5
- package/lib/table/src/util.min.js +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/package.json +1 -1
- package/packages/table/src/methods.ts +58 -3
- package/packages/table/src/util.ts +6 -5
- /package/es/{iconfont.1729047519382.ttf → iconfont.1729062501514.ttf} +0 -0
- /package/es/{iconfont.1729047519382.woff → iconfont.1729062501514.woff} +0 -0
- /package/es/{iconfont.1729047519382.woff2 → iconfont.1729062501514.woff2} +0 -0
- /package/lib/{iconfont.1729047519382.ttf → iconfont.1729062501514.ttf} +0 -0
- /package/lib/{iconfont.1729047519382.woff → iconfont.1729062501514.woff} +0 -0
- /package/lib/{iconfont.1729047519382.woff2 → iconfont.1729062501514.woff2} +0 -0
package/package.json
CHANGED
|
@@ -338,7 +338,6 @@ const Methods = {
|
|
|
338
338
|
const { scrollXLoad, scrollYLoad } = this
|
|
339
339
|
return this.handleTableData(true).then(() => {
|
|
340
340
|
this.updateFooter()
|
|
341
|
-
this.checkSelectionStatus()
|
|
342
341
|
if (scrollXLoad || scrollYLoad) {
|
|
343
342
|
if (scrollXLoad) {
|
|
344
343
|
this.updateScrollXSpace()
|
|
@@ -3352,7 +3351,8 @@ const Methods = {
|
|
|
3352
3351
|
if (rows && !XEUtils.isArray(rows)) {
|
|
3353
3352
|
rows = [rows]
|
|
3354
3353
|
}
|
|
3355
|
-
|
|
3354
|
+
this.handleBatchSelectRows(rows, !!value, isForce)
|
|
3355
|
+
this.checkSelectionStatus()
|
|
3356
3356
|
return this.$nextTick()
|
|
3357
3357
|
},
|
|
3358
3358
|
/**
|
|
@@ -3361,6 +3361,9 @@ const Methods = {
|
|
|
3361
3361
|
* @param {Boolean} value 是否选中
|
|
3362
3362
|
*/
|
|
3363
3363
|
setCheckboxRow (rows: any, value: any) {
|
|
3364
|
+
if (rows && !XEUtils.isArray(rows)) {
|
|
3365
|
+
rows = [rows]
|
|
3366
|
+
}
|
|
3364
3367
|
return this.handleCheckedCheckboxRow(rows, value, true)
|
|
3365
3368
|
},
|
|
3366
3369
|
isCheckedByCheckboxRow (row: any) {
|
|
@@ -3375,6 +3378,56 @@ const Methods = {
|
|
|
3375
3378
|
const { treeIndeterminateMaps } = this
|
|
3376
3379
|
return !!treeIndeterminateMaps[getRowid(this, row)] && !this.isCheckedByCheckboxRow(row)
|
|
3377
3380
|
},
|
|
3381
|
+
/**
|
|
3382
|
+
* 多行
|
|
3383
|
+
* 多选,行选中事件
|
|
3384
|
+
* value 选中true 不选false 半选-1
|
|
3385
|
+
*/
|
|
3386
|
+
handleBatchSelectRows (rows: any[], value: any, isForce: any) {
|
|
3387
|
+
const $xeTable = this
|
|
3388
|
+
const { treeConfig } = $xeTable
|
|
3389
|
+
|
|
3390
|
+
const { selectCheckboxMaps, checkboxOpts } = this
|
|
3391
|
+
const { checkField, checkStrictly, checkMethod } = checkboxOpts
|
|
3392
|
+
if (checkField) {
|
|
3393
|
+
if (treeConfig && !checkStrictly) {
|
|
3394
|
+
rows.forEach(row => {
|
|
3395
|
+
this.handleSelectRow({ row }, value, isForce)
|
|
3396
|
+
})
|
|
3397
|
+
} else {
|
|
3398
|
+
rows.forEach(row => {
|
|
3399
|
+
if (isForce || (!checkMethod || checkMethod({ row }))) {
|
|
3400
|
+
XEUtils.set(row, checkField, value)
|
|
3401
|
+
this.handleCheckboxReserveRow(row, value)
|
|
3402
|
+
}
|
|
3403
|
+
})
|
|
3404
|
+
}
|
|
3405
|
+
} else {
|
|
3406
|
+
if (treeConfig && !checkStrictly) {
|
|
3407
|
+
rows.forEach(row => {
|
|
3408
|
+
this.handleSelectRow({ row }, value, isForce)
|
|
3409
|
+
})
|
|
3410
|
+
} else {
|
|
3411
|
+
const selectRowMaps = Object.assign({}, selectCheckboxMaps)
|
|
3412
|
+
rows.forEach(row => {
|
|
3413
|
+
const rowid = getRowid($xeTable, row)
|
|
3414
|
+
if (isForce || (!checkMethod || checkMethod({ row }))) {
|
|
3415
|
+
if (value) {
|
|
3416
|
+
if (!selectRowMaps[rowid]) {
|
|
3417
|
+
selectRowMaps[rowid] = row
|
|
3418
|
+
}
|
|
3419
|
+
} else {
|
|
3420
|
+
if (selectRowMaps[rowid]) {
|
|
3421
|
+
delete selectRowMaps[rowid]
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3424
|
+
this.handleCheckboxReserveRow(row, value)
|
|
3425
|
+
}
|
|
3426
|
+
})
|
|
3427
|
+
this.selectCheckboxMaps = selectRowMaps
|
|
3428
|
+
}
|
|
3429
|
+
}
|
|
3430
|
+
},
|
|
3378
3431
|
/**
|
|
3379
3432
|
* 多选,行选中事件
|
|
3380
3433
|
* value 选中true 不选false 半选-1
|
|
@@ -3536,7 +3589,6 @@ const Methods = {
|
|
|
3536
3589
|
}
|
|
3537
3590
|
}
|
|
3538
3591
|
this.selectCheckboxMaps = selectRowMaps
|
|
3539
|
-
this.checkSelectionStatus()
|
|
3540
3592
|
},
|
|
3541
3593
|
handleToggleCheckRowEvent (evnt: any, params: any) {
|
|
3542
3594
|
const { selectCheckboxMaps, checkboxOpts } = this
|
|
@@ -3555,6 +3607,7 @@ const Methods = {
|
|
|
3555
3607
|
this.triggerCheckRowEvent(evnt, params, value)
|
|
3556
3608
|
} else {
|
|
3557
3609
|
this.handleSelectRow(params, value)
|
|
3610
|
+
this.checkSelectionStatus()
|
|
3558
3611
|
}
|
|
3559
3612
|
},
|
|
3560
3613
|
triggerCheckRowEvent (evnt: any, params: any, value: any) {
|
|
@@ -3582,6 +3635,7 @@ const Methods = {
|
|
|
3582
3635
|
}
|
|
3583
3636
|
if (!checkMethod || checkMethod({ row })) {
|
|
3584
3637
|
this.handleSelectRow(params, value)
|
|
3638
|
+
this.checkSelectionStatus()
|
|
3585
3639
|
this.emitEvent('checkbox-change', Object.assign({
|
|
3586
3640
|
records: this.getCheckboxRecords(),
|
|
3587
3641
|
reserves: this.getCheckboxReserveRecords(),
|
|
@@ -3598,6 +3652,7 @@ const Methods = {
|
|
|
3598
3652
|
const { checkField } = checkboxOpts
|
|
3599
3653
|
const value = checkField ? !XEUtils.get(row, checkField) : !selectCheckboxMaps[getRowid(this, row)]
|
|
3600
3654
|
this.handleSelectRow({ row }, value, true)
|
|
3655
|
+
this.checkSelectionStatus()
|
|
3601
3656
|
return this.$nextTick()
|
|
3602
3657
|
},
|
|
3603
3658
|
handleCheckedAllCheckboxRow (value: any, isForce: any) {
|
|
@@ -393,17 +393,18 @@ export function colToVisible ($xeTable: any, column: any) {
|
|
|
393
393
|
const tdElem = bodyElem.querySelector(`.${column.id}`)
|
|
394
394
|
if (tdElem) {
|
|
395
395
|
const tdOffsetLeft = tdElem.offsetLeft + (tdElem.offsetParent ? tdElem.offsetParent.offsetLeft : 0)
|
|
396
|
-
const
|
|
397
|
-
//
|
|
396
|
+
const cellWidth = tdElem.clientWidth
|
|
397
|
+
// 检测是否在可视区中
|
|
398
398
|
if (tdOffsetLeft < (bodySrcollLeft + offsetFixedLeft)) {
|
|
399
399
|
return $xeTable.scrollTo(tdOffsetLeft - offsetFixedLeft - 1)
|
|
400
|
-
} else if ((tdOffsetLeft +
|
|
401
|
-
return $xeTable.scrollTo(tdOffsetLeft -
|
|
400
|
+
} else if ((tdOffsetLeft + cellWidth - bodySrcollLeft) > (bodyWidth - offsetFixedRight)) {
|
|
401
|
+
return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth - offsetFixedRight - 1))
|
|
402
402
|
}
|
|
403
403
|
} else {
|
|
404
404
|
// 检测是否在虚拟渲染可视区中
|
|
405
405
|
if (scrollXLoad) {
|
|
406
406
|
let scrollLeft = 0
|
|
407
|
+
const cellWidth = column.renderWidth
|
|
407
408
|
for (let index = 0; index < visibleColumn.length; index++) {
|
|
408
409
|
if (visibleColumn[index] === column) {
|
|
409
410
|
break
|
|
@@ -413,7 +414,7 @@ export function colToVisible ($xeTable: any, column: any) {
|
|
|
413
414
|
if (scrollLeft < bodySrcollLeft) {
|
|
414
415
|
return $xeTable.scrollTo(scrollLeft - offsetFixedLeft - 1)
|
|
415
416
|
}
|
|
416
|
-
return $xeTable.scrollTo(scrollLeft -
|
|
417
|
+
return $xeTable.scrollTo((scrollLeft + cellWidth) - (bodyWidth - offsetFixedRight - 1))
|
|
417
418
|
}
|
|
418
419
|
}
|
|
419
420
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|