vxe-table 3.10.15 → 3.10.16

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/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.10.15";
2223
+ const version = "3.10.16";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2769,7 +2769,7 @@ function isNodeElement(elem) {
2769
2769
  const {
2770
2770
  log: log_log
2771
2771
  } = core_.VxeUI;
2772
- const log_version = `table v${"3.10.15"}`;
2772
+ const log_version = `table v${"3.10.16"}`;
2773
2773
  const warnLog = log_log.create('warn', log_version);
2774
2774
  const errLog = log_log.create('error', log_version);
2775
2775
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -8282,7 +8282,14 @@ const Methods = {
8282
8282
  if (isClear ||
8283
8283
  // 如果点击了当前表格之外
8284
8284
  !getEventTargetNode(evnt, $el).flag) {
8285
- setTimeout(() => this.clearEdit(evnt));
8285
+ setTimeout(() => {
8286
+ this.clearEdit(evnt).then(() => {
8287
+ // 如果存在校验,点击了表格之外则清除
8288
+ if (!this.isActivated && editRules && validOpts.autoClear) {
8289
+ this.validErrorMaps = {};
8290
+ }
8291
+ });
8292
+ });
8286
8293
  }
8287
8294
  });
8288
8295
  }
@@ -12390,7 +12397,7 @@ const Methods = {
12390
12397
  }
12391
12398
  };
12392
12399
  // Module methods
12393
- const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
12400
+ const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
12394
12401
  funcs.forEach(name => {
12395
12402
  Methods[name] = function (...args) {
12396
12403
  if (true) {
@@ -20361,7 +20368,7 @@ function validErrorRuleValue(rule, val) {
20361
20368
  warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)']);
20362
20369
  }
20363
20370
  }
20364
- return this.beginValidate(rows, cb, true);
20371
+ return this.beginValidate(rows, null, cb, true);
20365
20372
  },
20366
20373
  /**
20367
20374
  * 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
@@ -20372,7 +20379,27 @@ function validErrorRuleValue(rule, val) {
20372
20379
  warnLog('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)']);
20373
20380
  }
20374
20381
  }
20375
- return this.beginValidate(rows, cb);
20382
+ return this.beginValidate(rows, null, cb);
20383
+ },
20384
+ /**
20385
+ * 完整校验单元格,和 validateField 的区别就是会给有效数据中的每一行进行校验
20386
+ */
20387
+ _fullValidateField(rows, fieldOrColumn) {
20388
+ const colList = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : fieldOrColumn ? [fieldOrColumn] : []).map(column => handleFieldOrColumn(this, column));
20389
+ if (colList.length) {
20390
+ return this.beginValidate(rows, colList, null, true);
20391
+ }
20392
+ return this.$nextTick();
20393
+ },
20394
+ /**
20395
+ * 快速校验单元格,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
20396
+ */
20397
+ _validateField(rows, fieldOrColumn) {
20398
+ const colList = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : fieldOrColumn ? [fieldOrColumn] : []).map(column => handleFieldOrColumn(this, column));
20399
+ if (colList.length) {
20400
+ return this.beginValidate(rows, colList, null);
20401
+ }
20402
+ return this.$nextTick();
20376
20403
  },
20377
20404
  /**
20378
20405
  * 聚焦到校验通过的单元格并弹出校验错误提示
@@ -20421,7 +20448,7 @@ function validErrorRuleValue(rule, val) {
20421
20448
  * 如果只传 callback 否则默认验证整个表格数据
20422
20449
  * 返回 Promise 对象,或者使用回调方式
20423
20450
  */
20424
- beginValidate(rows, cb, isFull) {
20451
+ beginValidate(rows, cols, cb, isFull) {
20425
20452
  const validRest = {};
20426
20453
  const {
20427
20454
  editRules,
@@ -20450,12 +20477,13 @@ function validErrorRuleValue(rule, val) {
20450
20477
  this.clearValidate();
20451
20478
  const validErrMaps = {};
20452
20479
  if (editRules) {
20453
- const columns = this.getColumns();
20480
+ const columns = cols && cols.length ? cols : this.getColumns();
20454
20481
  const handleVaild = row => {
20455
20482
  if (isFull || !this.validRuleErr) {
20456
20483
  const colVailds = [];
20457
20484
  columns.forEach(column => {
20458
- if ((isFull || !this.validRuleErr) && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().has(editRules, column.property)) {
20485
+ const field = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(column) ? column : column.field;
20486
+ if ((isFull || !this.validRuleErr) && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().has(editRules, field)) {
20459
20487
  colVailds.push(this.validCellRules('all', row, column).catch(({
20460
20488
  rule,
20461
20489
  rules
@@ -20467,11 +20495,11 @@ function validErrorRuleValue(rule, val) {
20467
20495
  row,
20468
20496
  columnIndex: this.getColumnIndex(column),
20469
20497
  column,
20470
- field: column.property,
20498
+ field,
20471
20499
  $table: this
20472
20500
  };
20473
- if (!validRest[column.property]) {
20474
- validRest[column.property] = [];
20501
+ if (!validRest[field]) {
20502
+ validRest[field] = [];
20475
20503
  }
20476
20504
  validErrMaps[`${getRowid(this, row)}:${column.id}`] = {
20477
20505
  column,
@@ -20479,7 +20507,7 @@ function validErrorRuleValue(rule, val) {
20479
20507
  rule,
20480
20508
  content: rule.content
20481
20509
  };
20482
- validRest[column.property].push(rest);
20510
+ validRest[field].push(rest);
20483
20511
  if (!isFull) {
20484
20512
  this.validRuleErr = true;
20485
20513
  return Promise.reject(rest);
@@ -20696,7 +20724,7 @@ function validErrorRuleValue(rule, val) {
20696
20724
  } = this;
20697
20725
  const validTip = this.$refs.validTip;
20698
20726
  const rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows) ? rows : rows ? [rows] : [];
20699
- const colList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : (fieldOrColumn ? [fieldOrColumn] : []).map(column => handleFieldOrColumn(this, column));
20727
+ const colList = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : fieldOrColumn ? [fieldOrColumn] : []).map(column => handleFieldOrColumn(this, column));
20700
20728
  let validErrMaps = {};
20701
20729
  if (validTip && validTip.visible) {
20702
20730
  validTip.close();