vxe-table 3.15.0-beta.3 → 3.15.0-beta.4

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.
@@ -7441,13 +7441,14 @@ const Methods = {
7441
7441
  */
7442
7442
  triggerRadioRowEvent(evnt, params) {
7443
7443
  const $xeTable = this;
7444
+ const reactData = $xeTable;
7444
7445
  const {
7445
- selectRadioRow: oldValue,
7446
- radioOpts
7447
- } = this;
7446
+ selectRadioRow: oldValue
7447
+ } = reactData;
7448
7448
  const {
7449
7449
  row
7450
7450
  } = params;
7451
+ const radioOpts = $xeTable.computeRadioOpts;
7451
7452
  const {
7452
7453
  trigger
7453
7454
  } = radioOpts;
@@ -7463,11 +7464,11 @@ const Methods = {
7463
7464
  isChange = oldValue === newValue;
7464
7465
  if (isChange) {
7465
7466
  newValue = null;
7466
- this.clearRadioRow();
7467
+ $xeTable.clearRadioRow();
7467
7468
  }
7468
7469
  }
7469
7470
  if (isChange) {
7470
- this.emitEvent('radio-change', Object.assign({
7471
+ $xeTable.dispatchEvent('radio-change', Object.assign({
7471
7472
  oldValue,
7472
7473
  newValue
7473
7474
  }, params), evnt);
@@ -7475,17 +7476,30 @@ const Methods = {
7475
7476
  },
7476
7477
  triggerCurrentColumnEvent(evnt, params) {
7477
7478
  const $xeTable = this;
7478
- const columnOpts = $xeTable.computeColumnOpts;
7479
+ const reactData = $xeTable;
7479
7480
  const {
7480
- currentMethod
7481
- } = columnOpts;
7481
+ currentColumn: oldValue
7482
+ } = reactData;
7483
+ const columnOpts = $xeTable.computeColumnOpts;
7484
+ const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
7485
+ const beforeRowMethod = currentColumnOpts.beforeSelectMethod || columnOpts.currentMethod;
7482
7486
  const {
7483
- column
7487
+ column: newValue
7484
7488
  } = params;
7485
- if (!currentMethod || currentMethod({
7486
- column
7489
+ const isChange = oldValue !== newValue;
7490
+ if (!beforeRowMethod || beforeRowMethod({
7491
+ column: newValue,
7492
+ $table: $xeTable
7487
7493
  })) {
7488
- $xeTable.setCurrentColumn(column);
7494
+ $xeTable.setCurrentColumn(newValue);
7495
+ if (isChange) {
7496
+ $xeTable.dispatchEvent('current-column-change', Object.assign({
7497
+ oldValue,
7498
+ newValue
7499
+ }, params), evnt);
7500
+ }
7501
+ } else {
7502
+ $xeTable.dispatchEvent('current-column-disabled', params, evnt);
7489
7503
  }
7490
7504
  },
7491
7505
  triggerCurrentRowEvent(evnt, params) {
@@ -7495,23 +7509,30 @@ const Methods = {
7495
7509
  currentRow: oldValue
7496
7510
  } = reactData;
7497
7511
  const rowOpts = $xeTable.computeRowOpts;
7498
- const {
7499
- currentMethod
7500
- } = rowOpts;
7512
+ const currentRowOpts = $xeTable.computeCurrentRowOpts;
7513
+ const beforeRowMethod = currentRowOpts.beforeSelectMethod || rowOpts.currentMethod;
7501
7514
  const {
7502
7515
  row: newValue
7503
7516
  } = params;
7504
7517
  const isChange = oldValue !== newValue;
7505
- if (!currentMethod || currentMethod({
7506
- row: newValue
7518
+ if (!beforeRowMethod || beforeRowMethod({
7519
+ row: newValue,
7520
+ $table: $xeTable
7507
7521
  })) {
7508
7522
  $xeTable.setCurrentRow(newValue);
7509
7523
  if (isChange) {
7524
+ $xeTable.dispatchEvent('current-row-change', Object.assign({
7525
+ oldValue,
7526
+ newValue
7527
+ }, params), evnt);
7528
+ // 已废弃
7510
7529
  $xeTable.dispatchEvent('current-change', Object.assign({
7511
7530
  oldValue,
7512
7531
  newValue
7513
7532
  }, params), evnt);
7514
7533
  }
7534
+ } else {
7535
+ $xeTable.dispatchEvent('current-row-disabled', params, evnt);
7515
7536
  }
7516
7537
  },
7517
7538
  /**