vxe-table 3.6.10-beta.0 → 3.6.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.
Files changed (36) hide show
  1. package/lib/grid/src/grid.js +89 -22
  2. package/lib/grid/src/grid.min.js +1 -1
  3. package/lib/icon/style/{iconfont.1673016554584.ttf → iconfont.1676471822832.ttf} +0 -0
  4. package/lib/icon/style/{iconfont.1673016554584.woff → iconfont.1676471822832.woff} +0 -0
  5. package/lib/icon/style/{iconfont.1673016554584.woff2 → iconfont.1676471822832.woff2} +0 -0
  6. package/lib/icon/style/style.css +1 -1
  7. package/lib/icon/style/style.min.css +1 -1
  8. package/lib/{iconfont.1673016554584.ttf → iconfont.1676471822832.ttf} +0 -0
  9. package/lib/{iconfont.1673016554584.woff → iconfont.1676471822832.woff} +0 -0
  10. package/lib/{iconfont.1673016554584.woff2 → iconfont.1676471822832.woff2} +0 -0
  11. package/lib/index.css +1 -1
  12. package/lib/index.umd.js +194 -103
  13. package/lib/index.umd.min.js +1 -1
  14. package/lib/input/src/input.js +4 -4
  15. package/lib/input/src/input.min.js +1 -1
  16. package/lib/list/src/list.js +22 -16
  17. package/lib/list/src/list.min.js +1 -1
  18. package/lib/pager/src/pager.js +12 -11
  19. package/lib/pager/src/pager.min.js +1 -1
  20. package/lib/style.css +1 -1
  21. package/lib/style.min.css +1 -1
  22. package/lib/table/src/methods.js +59 -45
  23. package/lib/table/src/methods.min.js +1 -1
  24. package/lib/toolbar/src/toolbar.js +4 -2
  25. package/lib/toolbar/src/toolbar.min.js +1 -1
  26. package/lib/tools/log.js +1 -1
  27. package/lib/tools/log.min.js +1 -1
  28. package/lib/v-x-e-table/index.js +1 -1
  29. package/lib/v-x-e-table/index.min.js +1 -1
  30. package/package.json +2 -1
  31. package/packages/grid/src/grid.js +41 -15
  32. package/packages/input/src/input.js +4 -4
  33. package/packages/list/src/list.js +3 -0
  34. package/packages/pager/src/pager.js +8 -7
  35. package/packages/table/src/methods.js +54 -41
  36. package/packages/toolbar/src/toolbar.js +2 -2
@@ -3250,7 +3250,7 @@ var Methods = {
3250
3250
  var checkAll = checkboxOpts.checkAll,
3251
3251
  checkRowKeys = checkboxOpts.checkRowKeys;
3252
3252
  if (checkAll) {
3253
- this.setAllCheckboxRow(true);
3253
+ this.handleCheckedAllCheckboxRow(true, true);
3254
3254
  } else if (checkRowKeys) {
3255
3255
  var defSelection = [];
3256
3256
  checkRowKeys.forEach(function (rowid) {
@@ -3258,15 +3258,10 @@ var Methods = {
3258
3258
  defSelection.push(fullDataRowIdData[rowid].row);
3259
3259
  }
3260
3260
  });
3261
- this.setCheckboxRow(defSelection, true);
3261
+ this.handleCheckedCheckboxRow(defSelection, true, true);
3262
3262
  }
3263
3263
  },
3264
- /**
3265
- * 用于多选行,设置行为选中状态,第二个参数为选中与否
3266
- * @param {Array/Row} rows 行数据
3267
- * @param {Boolean} value 是否选中
3268
- */
3269
- setCheckboxRow: function setCheckboxRow(rows, value) {
3264
+ handleCheckedCheckboxRow: function handleCheckedCheckboxRow(rows, value, isForce) {
3270
3265
  var _this32 = this;
3271
3266
  if (rows && !_xeUtils.default.isArray(rows)) {
3272
3267
  rows = [rows];
@@ -3274,10 +3269,18 @@ var Methods = {
3274
3269
  rows.forEach(function (row) {
3275
3270
  return _this32.handleSelectRow({
3276
3271
  row: row
3277
- }, !!value);
3272
+ }, !!value, isForce);
3278
3273
  });
3279
3274
  return this.$nextTick();
3280
3275
  },
3276
+ /**
3277
+ * 用于多选行,设置行为选中状态,第二个参数为选中与否
3278
+ * @param {Array/Row} rows 行数据
3279
+ * @param {Boolean} value 是否选中
3280
+ */
3281
+ setCheckboxRow: function setCheckboxRow(rows, value) {
3282
+ return this.handleCheckedCheckboxRow(rows, value, true);
3283
+ },
3281
3284
  isCheckedByCheckboxRow: function isCheckedByCheckboxRow(row) {
3282
3285
  var selection = this.selection;
3283
3286
  var checkField = this.checkboxOpts.checkField;
@@ -3294,7 +3297,7 @@ var Methods = {
3294
3297
  * 多选,行选中事件
3295
3298
  * value 选中true 不选false 半选-1
3296
3299
  */
3297
- handleSelectRow: function handleSelectRow(_ref6, value) {
3300
+ handleSelectRow: function handleSelectRow(_ref6, value, isForce) {
3298
3301
  var _this33 = this;
3299
3302
  var row = _ref6.row;
3300
3303
  var selection = this.selection,
@@ -3316,7 +3319,7 @@ var Methods = {
3316
3319
  } else {
3317
3320
  // 更新子节点状态
3318
3321
  _xeUtils.default.eachTree([row], function (item) {
3319
- if (_this33.eqRow(item, row) || !checkMethod || checkMethod({
3322
+ if (_this33.eqRow(item, row) || isForce || !checkMethod || checkMethod({
3320
3323
  row: item
3321
3324
  })) {
3322
3325
  _xeUtils.default.set(item, checkField, value);
@@ -3333,7 +3336,7 @@ var Methods = {
3333
3336
  }, treeOpts);
3334
3337
  if (matchObj && matchObj.parent) {
3335
3338
  var parentStatus;
3336
- var vItems = checkMethod ? matchObj.items.filter(function (item) {
3339
+ var vItems = !isForce && checkMethod ? matchObj.items.filter(function (item) {
3337
3340
  return checkMethod({
3338
3341
  row: item
3339
3342
  });
@@ -3353,10 +3356,10 @@ var Methods = {
3353
3356
  }
3354
3357
  return this.handleSelectRow({
3355
3358
  row: matchObj.parent
3356
- }, parentStatus);
3359
+ }, parentStatus, isForce);
3357
3360
  }
3358
3361
  } else {
3359
- if (!checkMethod || checkMethod({
3362
+ if (isForce || !checkMethod || checkMethod({
3360
3363
  row: row
3361
3364
  })) {
3362
3365
  _xeUtils.default.set(row, checkField, value);
@@ -3375,9 +3378,9 @@ var Methods = {
3375
3378
  } else {
3376
3379
  // 更新子节点状态
3377
3380
  _xeUtils.default.eachTree([row], function (item) {
3378
- if (_this33.eqRow(item, row) || !checkMethod || checkMethod({
3381
+ if (_this33.eqRow(item, row) || isForce && (!checkMethod || checkMethod({
3379
3382
  row: item
3380
- })) {
3383
+ }))) {
3381
3384
  if (value) {
3382
3385
  selection.push(item);
3383
3386
  } else {
@@ -3398,7 +3401,7 @@ var Methods = {
3398
3401
  }, treeOpts);
3399
3402
  if (_matchObj && _matchObj.parent) {
3400
3403
  var _parentStatus;
3401
- var _vItems = checkMethod ? _matchObj.items.filter(function (item) {
3404
+ var _vItems = !isForce && checkMethod ? _matchObj.items.filter(function (item) {
3402
3405
  return checkMethod({
3403
3406
  row: item
3404
3407
  });
@@ -3418,10 +3421,10 @@ var Methods = {
3418
3421
  }
3419
3422
  return this.handleSelectRow({
3420
3423
  row: _matchObj.parent
3421
- }, _parentStatus);
3424
+ }, _parentStatus, isForce);
3422
3425
  }
3423
3426
  } else {
3424
- if (!checkMethod || checkMethod({
3427
+ if (isForce || !checkMethod || checkMethod({
3425
3428
  row: row
3426
3429
  })) {
3427
3430
  if (value) {
@@ -3469,16 +3472,16 @@ var Methods = {
3469
3472
  * 多选,切换某一行的选中状态
3470
3473
  */
3471
3474
  toggleCheckboxRow: function toggleCheckboxRow(row) {
3472
- this.handleToggleCheckRowEvent(null, {
3475
+ var selection = this.selection,
3476
+ checkboxOpts = this.checkboxOpts;
3477
+ var checkField = checkboxOpts.checkField;
3478
+ var value = checkField ? !_xeUtils.default.get(row, checkField) : this.findRowIndexOf(selection, row) === -1;
3479
+ this.handleSelectRow({
3473
3480
  row: row
3474
- });
3481
+ }, value, true);
3475
3482
  return this.$nextTick();
3476
3483
  },
3477
- /**
3478
- * 用于多选行,设置所有行的选中状态
3479
- * @param {Boolean} value 是否选中
3480
- */
3481
- setAllCheckboxRow: function setAllCheckboxRow(value) {
3484
+ handleCheckedAllCheckboxRow: function handleCheckedAllCheckboxRow(value, isForce) {
3482
3485
  var _this34 = this;
3483
3486
  var afterFullData = this.afterFullData,
3484
3487
  treeConfig = this.treeConfig,
@@ -3503,7 +3506,7 @@ var Methods = {
3503
3506
  */
3504
3507
  if (checkField) {
3505
3508
  var checkValFn = function checkValFn(row) {
3506
- if (!checkMethod || checkMethod({
3509
+ if (isForce || !checkMethod || checkMethod({
3507
3510
  row: row
3508
3511
  })) {
3509
3512
  if (value) {
@@ -3531,7 +3534,7 @@ var Methods = {
3531
3534
  * 如果方法成立,则添加到临时集合中
3532
3535
  */
3533
3536
  _xeUtils.default.eachTree(afterFullData, function (row) {
3534
- if (!checkMethod || checkMethod({
3537
+ if (isForce || !checkMethod || checkMethod({
3535
3538
  row: row
3536
3539
  })) {
3537
3540
  selectRows.push(row);
@@ -3542,7 +3545,7 @@ var Methods = {
3542
3545
  * 如果是树取消
3543
3546
  * 如果方法成立,则不添加到临时集合中
3544
3547
  */
3545
- if (checkMethod) {
3548
+ if (!isForce && checkMethod) {
3546
3549
  _xeUtils.default.eachTree(afterFullData, function (row) {
3547
3550
  if (checkMethod({
3548
3551
  row: row
@@ -3559,7 +3562,7 @@ var Methods = {
3559
3562
  * 如果存在选中方法且成立或者本身已勾选,则添加到临时集合中
3560
3563
  * 如果不存在选中方法,则添加所有数据到临时集合中
3561
3564
  */
3562
- if (checkMethod) {
3565
+ if (!isForce && checkMethod) {
3563
3566
  selectRows = afterFullData.filter(function (row) {
3564
3567
  return _this34.findRowIndexOf(selection, row) > -1 || checkMethod({
3565
3568
  row: row
@@ -3574,7 +3577,7 @@ var Methods = {
3574
3577
  * 如果方法成立,则不添加到临时集合中;如果方法不成立则判断当前是否已勾选,如果已被勾选则添加到新集合中
3575
3578
  * 如果不存在选中方法,无需处理,临时集合默认为空
3576
3579
  */
3577
- if (checkMethod) {
3580
+ if (!isForce && checkMethod) {
3578
3581
  selectRows = afterFullData.filter(function (row) {
3579
3582
  return checkMethod({
3580
3583
  row: row
@@ -3599,6 +3602,14 @@ var Methods = {
3599
3602
  }
3600
3603
  this.treeIndeterminates = [];
3601
3604
  this.checkSelectionStatus();
3605
+ return this.$nextTick();
3606
+ },
3607
+ /**
3608
+ * 用于多选行,设置所有行的选中状态
3609
+ * @param {Boolean} value 是否选中
3610
+ */
3611
+ setAllCheckboxRow: function setAllCheckboxRow(value) {
3612
+ return this.handleCheckedAllCheckboxRow(value, true);
3602
3613
  },
3603
3614
  checkSelectionStatus: function checkSelectionStatus() {
3604
3615
  var _this35 = this;
@@ -3710,14 +3721,14 @@ var Methods = {
3710
3721
  if (radioOpts.reserve && radioReserveRow) {
3711
3722
  var rowid = (0, _util.getRowid)(this, radioReserveRow);
3712
3723
  if (fullDataRowIdData[rowid]) {
3713
- this.setRadioRow(fullDataRowIdData[rowid].row);
3724
+ this.handleCheckedRadioRow(fullDataRowIdData[rowid].row, true);
3714
3725
  }
3715
3726
  }
3716
3727
  // 复选框
3717
3728
  this.selection = getRecoverRow(this, selection); // 刷新多选行状态
3718
3729
  // 还原保留选中状态
3719
3730
  if (checkboxOpts.reserve) {
3720
- this.setCheckboxRow(handleReserveRow(this, this.checkboxReserveRowMap), true);
3731
+ this.handleCheckedCheckboxRow(handleReserveRow(this, this.checkboxReserveRowMap), true, true);
3721
3732
  }
3722
3733
  if (currentRow && !fullAllDataRowMap.has(currentRow)) {
3723
3734
  this.currentRow = null; // 刷新当前行状态
@@ -3839,7 +3850,7 @@ var Methods = {
3839
3850
  * 多选,选中所有事件
3840
3851
  */
3841
3852
  triggerCheckAllEvent: function triggerCheckAllEvent(evnt, value) {
3842
- this.setAllCheckboxRow(value);
3853
+ this.handleCheckedAllCheckboxRow(value);
3843
3854
  this.emitEvent('checkbox-all', {
3844
3855
  records: this.getCheckboxRecords(),
3845
3856
  reserves: this.getCheckboxReserveRecords(),
@@ -3898,7 +3909,7 @@ var Methods = {
3898
3909
  reserve = radioOpts.reserve;
3899
3910
  if (rowid) {
3900
3911
  if (fullDataRowIdData[rowid]) {
3901
- this.setRadioRow(fullDataRowIdData[rowid].row);
3912
+ this.handleCheckedRadioRow(fullDataRowIdData[rowid].row, true);
3902
3913
  }
3903
3914
  if (reserve) {
3904
3915
  var rowkey = (0, _util.getRowkey)(this);
@@ -3916,7 +3927,7 @@ var Methods = {
3916
3927
  var newValue = row;
3917
3928
  var isChange = oldValue !== newValue;
3918
3929
  if (isChange) {
3919
- this.setRadioRow(newValue);
3930
+ this.handleCheckedRadioRow(newValue);
3920
3931
  } else if (!radioOpts.strict) {
3921
3932
  isChange = oldValue === newValue;
3922
3933
  if (isChange) {
@@ -3951,7 +3962,7 @@ var Methods = {
3951
3962
  var $el = this.$el,
3952
3963
  rowOpts = this.rowOpts;
3953
3964
  this.clearCurrentRow();
3954
- this.clearCurrentColumn();
3965
+ // this.clearCurrentColumn()
3955
3966
  this.currentRow = row;
3956
3967
  if (rowOpts.isCurrent || this.highlightCurrentRow) {
3957
3968
  if ($el) {
@@ -3965,14 +3976,10 @@ var Methods = {
3965
3976
  isCheckedByRadioRow: function isCheckedByRadioRow(row) {
3966
3977
  return this.selectRow === row;
3967
3978
  },
3968
- /**
3969
- * 用于单选行,设置某一行为选中状态
3970
- * @param {Row} row 行对象
3971
- */
3972
- setRadioRow: function setRadioRow(row) {
3979
+ handleCheckedRadioRow: function handleCheckedRadioRow(row, isForce) {
3973
3980
  var radioOpts = this.radioOpts;
3974
3981
  var checkMethod = radioOpts.checkMethod;
3975
- if (row && (!checkMethod || checkMethod({
3982
+ if (row && (isForce || !checkMethod || checkMethod({
3976
3983
  row: row
3977
3984
  }))) {
3978
3985
  this.selectRow = row;
@@ -3980,6 +3987,13 @@ var Methods = {
3980
3987
  }
3981
3988
  return this.$nextTick();
3982
3989
  },
3990
+ /**
3991
+ * 用于单选行,设置某一行为选中状态
3992
+ * @param {Row} row 行对象
3993
+ */
3994
+ setRadioRow: function setRadioRow(row) {
3995
+ return this.handleCheckedRadioRow(row, true);
3996
+ },
3983
3997
  /**
3984
3998
  * 用于当前行,手动清空当前高亮的状态
3985
3999
  */
@@ -4104,7 +4118,7 @@ var Methods = {
4104
4118
  setCurrentColumn: function setCurrentColumn(fieldOrColumn) {
4105
4119
  var column = (0, _util.handleFieldOrColumn)(this, fieldOrColumn);
4106
4120
  if (column) {
4107
- this.clearCurrentRow();
4121
+ // this.clearCurrentRow()
4108
4122
  this.clearCurrentColumn();
4109
4123
  this.currentColumn = column;
4110
4124
  }
@@ -4863,7 +4877,7 @@ var Methods = {
4863
4877
  }
4864
4878
  // 如果当前节点已选中,则展开后子节点也被选中
4865
4879
  if (!checkStrictly && _this48.isCheckedByCheckboxRow(row)) {
4866
- _this48.setCheckboxRow(childRows, true);
4880
+ _this48.handleCheckedCheckboxRow(childRows, true, true);
4867
4881
  }
4868
4882
  return _this48.$nextTick().then(function () {
4869
4883
  if (transform) {