vxe-table 4.23.1 → 4.23.2

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.
@@ -142,6 +142,44 @@ hooks.add('tableValidatorModule', {
142
142
  const { computeValidOpts, computeTreeOpts, computeEditOpts, computeAggregateOpts } = $xeTable.getComputeMaps();
143
143
  let validatorMethods = {};
144
144
  let validatorPrivateMethods = {};
145
+ const handleClearValid = (rows, fieldOrColumn) => {
146
+ const { validErrorMaps } = reactData;
147
+ const validOpts = computeValidOpts.value;
148
+ const rowList = XEUtils.isArray(rows) ? rows : (rows ? [rows] : []);
149
+ const colList = (XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : (fieldOrColumn ? [fieldOrColumn] : [])).map(column => handleFieldOrColumn($xeTable, column));
150
+ let validErrMaps = {};
151
+ // 如果是多个提示模式
152
+ if (validOpts.msgMode === 'full') {
153
+ validErrMaps = Object.assign({}, validErrorMaps);
154
+ if (rowList.length && colList.length) {
155
+ rowList.forEach(row => {
156
+ colList.forEach((column) => {
157
+ const validKey = `${getRowid($xeTable, row)}:${column.id}`;
158
+ if (validErrMaps[validKey]) {
159
+ delete validErrMaps[validKey];
160
+ }
161
+ });
162
+ });
163
+ }
164
+ else if (rowList.length) {
165
+ const rowIdList = rowList.map(row => `${getRowid($xeTable, row)}`);
166
+ XEUtils.each(validErrorMaps, (item, key) => {
167
+ if (rowIdList.indexOf(key.split(':')[0]) > -1) {
168
+ delete validErrMaps[key];
169
+ }
170
+ });
171
+ }
172
+ else if (colList.length) {
173
+ const colidList = colList.map(column => `${column.id}`);
174
+ XEUtils.each(validErrorMaps, (item, key) => {
175
+ if (colidList.indexOf(key.split(':')[1]) > -1) {
176
+ delete validErrMaps[key];
177
+ }
178
+ });
179
+ }
180
+ }
181
+ return validErrMaps;
182
+ };
145
183
  /**
146
184
  * 聚焦到校验通过的单元格并弹出校验错误提示
147
185
  */
@@ -278,7 +316,7 @@ hooks.add('tableValidatorModule', {
278
316
  }
279
317
  return Promise.all(rowValidErrs).then(() => {
280
318
  const ruleProps = Object.keys(validRest);
281
- reactData.validErrorMaps = handleErrMsgMode(validErrMaps);
319
+ reactData.validErrorMaps = Object.assign(handleClearValid(rows, columns), handleErrMsgMode(validErrMaps));
282
320
  return nextTick().then(() => {
283
321
  if (ruleProps.length) {
284
322
  return Promise.reject(validRest[ruleProps[0]][0]);
@@ -373,48 +411,11 @@ hooks.add('tableValidatorModule', {
373
411
  return nextTick();
374
412
  },
375
413
  clearValidate(rows, fieldOrColumn) {
376
- const { validErrorMaps } = reactData;
377
414
  const validTip = refValidTooltip.value;
378
- const validOpts = computeValidOpts.value;
379
- const rowList = XEUtils.isArray(rows) ? rows : (rows ? [rows] : []);
380
- const colList = (XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : (fieldOrColumn ? [fieldOrColumn] : [])).map(column => handleFieldOrColumn($xeTable, column));
381
- let validErrMaps = {};
382
415
  if (validTip && validTip.reactData.visible) {
383
416
  validTip.close();
384
417
  }
385
- // 如果是单个提示模式
386
- if (validOpts.msgMode === 'single') {
387
- reactData.validErrorMaps = {};
388
- return nextTick();
389
- }
390
- if (rowList.length && colList.length) {
391
- validErrMaps = Object.assign({}, validErrorMaps);
392
- rowList.forEach(row => {
393
- colList.forEach((column) => {
394
- const validKey = `${getRowid($xeTable, row)}:${column.id}`;
395
- if (validErrMaps[validKey]) {
396
- delete validErrMaps[validKey];
397
- }
398
- });
399
- });
400
- }
401
- else if (rowList.length) {
402
- const rowIdList = rowList.map(row => `${getRowid($xeTable, row)}`);
403
- XEUtils.each(validErrorMaps, (item, key) => {
404
- if (rowIdList.indexOf(key.split(':')[0]) > -1) {
405
- validErrMaps[key] = item;
406
- }
407
- });
408
- }
409
- else if (colList.length) {
410
- const colidList = colList.map(column => `${column.id}`);
411
- XEUtils.each(validErrorMaps, (item, key) => {
412
- if (colidList.indexOf(key.split(':')[1]) > -1) {
413
- validErrMaps[key] = item;
414
- }
415
- });
416
- }
417
- reactData.validErrorMaps = validErrMaps;
418
+ reactData.validErrorMaps = handleClearValid(rows, fieldOrColumn);
418
419
  return nextTick();
419
420
  }
420
421
  };
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "4.23.1";
3
+ export const version = "4.23.2";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const tableVersion = `table v${"4.23.1"}`;
3
+ const tableVersion = `table v${"4.23.2"}`;
4
4
  export function createComponentLog(name) {
5
5
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
6
6
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
package/lib/index.umd.js CHANGED
@@ -3322,7 +3322,7 @@ function getDefaultConfig(val1, def1) {
3322
3322
  /* unused harmony import specifier */ var VxeUI;
3323
3323
 
3324
3324
 
3325
- const version = "4.23.1";
3325
+ const version = "4.23.2";
3326
3326
  core_.VxeUI.version = version;
3327
3327
  core_.VxeUI.tableVersion = version;
3328
3328
  core_.VxeUI.setConfig({
@@ -4309,7 +4309,7 @@ function getPopupAppendElement(appendTo) {
4309
4309
  const {
4310
4310
  log: log_log
4311
4311
  } = core_.VxeUI;
4312
- const tableVersion = `table v${"4.23.1"}`;
4312
+ const tableVersion = `table v${"4.23.2"}`;
4313
4313
  function createComponentLog(name) {
4314
4314
  const uiVersion = core_.VxeUI.uiVersion ? `ui v${core_.VxeUI.uiVersion}` : '';
4315
4315
  const ganttVersion = core_.VxeUI.ganttVersion ? `gantt v${core_.VxeUI.ganttVersion}` : '';
@@ -18751,6 +18751,44 @@ validator_hook_hooks.add('tableValidatorModule', {
18751
18751
  } = $xeTable.getComputeMaps();
18752
18752
  let validatorMethods = {};
18753
18753
  let validatorPrivateMethods = {};
18754
+ const handleClearValid = (rows, fieldOrColumn) => {
18755
+ const {
18756
+ validErrorMaps
18757
+ } = reactData;
18758
+ const validOpts = computeValidOpts.value;
18759
+ const rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows) ? rows : rows ? [rows] : [];
18760
+ const colList = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : fieldOrColumn ? [fieldOrColumn] : []).map(column => handleFieldOrColumn($xeTable, column));
18761
+ let validErrMaps = {};
18762
+ // 如果是多个提示模式
18763
+ if (validOpts.msgMode === 'full') {
18764
+ validErrMaps = Object.assign({}, validErrorMaps);
18765
+ if (rowList.length && colList.length) {
18766
+ rowList.forEach(row => {
18767
+ colList.forEach(column => {
18768
+ const validKey = `${getRowid($xeTable, row)}:${column.id}`;
18769
+ if (validErrMaps[validKey]) {
18770
+ delete validErrMaps[validKey];
18771
+ }
18772
+ });
18773
+ });
18774
+ } else if (rowList.length) {
18775
+ const rowIdList = rowList.map(row => `${getRowid($xeTable, row)}`);
18776
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(validErrorMaps, (item, key) => {
18777
+ if (rowIdList.indexOf(key.split(':')[0]) > -1) {
18778
+ delete validErrMaps[key];
18779
+ }
18780
+ });
18781
+ } else if (colList.length) {
18782
+ const colidList = colList.map(column => `${column.id}`);
18783
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(validErrorMaps, (item, key) => {
18784
+ if (colidList.indexOf(key.split(':')[1]) > -1) {
18785
+ delete validErrMaps[key];
18786
+ }
18787
+ });
18788
+ }
18789
+ }
18790
+ return validErrMaps;
18791
+ };
18754
18792
  /**
18755
18793
  * 聚焦到校验通过的单元格并弹出校验错误提示
18756
18794
  */
@@ -18899,7 +18937,7 @@ validator_hook_hooks.add('tableValidatorModule', {
18899
18937
  }
18900
18938
  return Promise.all(rowValidErrs).then(() => {
18901
18939
  const ruleProps = Object.keys(validRest);
18902
- reactData.validErrorMaps = handleErrMsgMode(validErrMaps);
18940
+ reactData.validErrorMaps = Object.assign(handleClearValid(rows, columns), handleErrMsgMode(validErrMaps));
18903
18941
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
18904
18942
  if (ruleProps.length) {
18905
18943
  return Promise.reject(validRest[ruleProps[0]][0]);
@@ -18990,48 +19028,11 @@ validator_hook_hooks.add('tableValidatorModule', {
18990
19028
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
18991
19029
  },
18992
19030
  clearValidate(rows, fieldOrColumn) {
18993
- const {
18994
- validErrorMaps
18995
- } = reactData;
18996
19031
  const validTip = refValidTooltip.value;
18997
- const validOpts = computeValidOpts.value;
18998
- const rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows) ? rows : rows ? [rows] : [];
18999
- const colList = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : fieldOrColumn ? [fieldOrColumn] : []).map(column => handleFieldOrColumn($xeTable, column));
19000
- let validErrMaps = {};
19001
19032
  if (validTip && validTip.reactData.visible) {
19002
19033
  validTip.close();
19003
19034
  }
19004
- // 如果是单个提示模式
19005
- if (validOpts.msgMode === 'single') {
19006
- reactData.validErrorMaps = {};
19007
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
19008
- }
19009
- if (rowList.length && colList.length) {
19010
- validErrMaps = Object.assign({}, validErrorMaps);
19011
- rowList.forEach(row => {
19012
- colList.forEach(column => {
19013
- const validKey = `${getRowid($xeTable, row)}:${column.id}`;
19014
- if (validErrMaps[validKey]) {
19015
- delete validErrMaps[validKey];
19016
- }
19017
- });
19018
- });
19019
- } else if (rowList.length) {
19020
- const rowIdList = rowList.map(row => `${getRowid($xeTable, row)}`);
19021
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(validErrorMaps, (item, key) => {
19022
- if (rowIdList.indexOf(key.split(':')[0]) > -1) {
19023
- validErrMaps[key] = item;
19024
- }
19025
- });
19026
- } else if (colList.length) {
19027
- const colidList = colList.map(column => `${column.id}`);
19028
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(validErrorMaps, (item, key) => {
19029
- if (colidList.indexOf(key.split(':')[1]) > -1) {
19030
- validErrMaps[key] = item;
19031
- }
19032
- });
19033
- }
19034
- reactData.validErrorMaps = validErrMaps;
19035
+ reactData.validErrorMaps = handleClearValid(rows, fieldOrColumn);
19035
19036
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
19036
19037
  }
19037
19038
  };