vxe-table 3.15.29 → 3.15.31

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 (45) hide show
  1. package/es/grid/src/grid.js +39 -42
  2. package/es/style.css +1 -1
  3. package/es/table/module/edit/mixin.js +11 -27
  4. package/es/table/module/export/mixin.js +75 -143
  5. package/es/table/module/menu/mixin.js +2 -6
  6. package/es/table/module/validator/mixin.js +99 -41
  7. package/es/table/src/methods.js +12 -36
  8. package/es/table/src/table.js +6 -8
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/log.js +1 -1
  11. package/lib/grid/src/grid.js +24 -26
  12. package/lib/grid/src/grid.min.js +1 -1
  13. package/lib/index.umd.js +271 -572
  14. package/lib/index.umd.min.js +1 -1
  15. package/lib/style.css +1 -1
  16. package/lib/table/module/edit/mixin.js +11 -27
  17. package/lib/table/module/edit/mixin.min.js +1 -1
  18. package/lib/table/module/export/mixin.js +101 -184
  19. package/lib/table/module/export/mixin.min.js +1 -1
  20. package/lib/table/module/menu/mixin.js +2 -6
  21. package/lib/table/module/menu/mixin.min.js +1 -1
  22. package/lib/table/module/validator/mixin.js +97 -40
  23. package/lib/table/module/validator/mixin.min.js +1 -1
  24. package/lib/table/src/methods.js +12 -36
  25. package/lib/table/src/methods.min.js +1 -1
  26. package/lib/table/src/table.js +8 -10
  27. package/lib/table/src/table.min.js +1 -1
  28. package/lib/ui/index.js +1 -1
  29. package/lib/ui/index.min.js +1 -1
  30. package/lib/ui/src/log.js +1 -1
  31. package/lib/ui/src/log.min.js +1 -1
  32. package/package.json +1 -1
  33. package/packages/grid/src/grid.ts +39 -41
  34. package/packages/table/module/edit/mixin.ts +11 -27
  35. package/packages/table/module/export/mixin.ts +105 -162
  36. package/packages/table/module/menu/mixin.ts +2 -6
  37. package/packages/table/module/validator/mixin.ts +101 -40
  38. package/packages/table/src/methods.ts +12 -36
  39. package/packages/table/src/table.ts +6 -8
  40. /package/es/{iconfont.1747286367921.ttf → iconfont.1747621179042.ttf} +0 -0
  41. /package/es/{iconfont.1747286367921.woff → iconfont.1747621179042.woff} +0 -0
  42. /package/es/{iconfont.1747286367921.woff2 → iconfont.1747621179042.woff2} +0 -0
  43. /package/lib/{iconfont.1747286367921.ttf → iconfont.1747621179042.ttf} +0 -0
  44. /package/lib/{iconfont.1747286367921.woff → iconfont.1747621179042.woff} +0 -0
  45. /package/lib/{iconfont.1747286367921.woff2 → iconfont.1747621179042.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -158,43 +158,6 @@ module.exports = function (it) {
158
158
  };
159
159
 
160
160
 
161
- /***/ }),
162
-
163
- /***/ 6955:
164
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
165
-
166
-
167
- var TO_STRING_TAG_SUPPORT = __webpack_require__(2140);
168
- var isCallable = __webpack_require__(4901);
169
- var classofRaw = __webpack_require__(2195);
170
- var wellKnownSymbol = __webpack_require__(8227);
171
-
172
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
173
- var $Object = Object;
174
-
175
- // ES3 wrong here
176
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
177
-
178
- // fallback for IE11 Script Access Denied error
179
- var tryGet = function (it, key) {
180
- try {
181
- return it[key];
182
- } catch (error) { /* empty */ }
183
- };
184
-
185
- // getting tag from ES6+ `Object.prototype.toString`
186
- module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
187
- var O, tag, result;
188
- return it === undefined ? 'Undefined' : it === null ? 'Null'
189
- // @@toStringTag case
190
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
191
- // builtinTag case
192
- : CORRECT_ARGUMENTS ? classofRaw(O)
193
- // ES3 arguments fallback
194
- : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
195
- };
196
-
197
-
198
161
  /***/ }),
199
162
 
200
163
  /***/ 7740:
@@ -253,22 +216,6 @@ module.exports = function (bitmap, value) {
253
216
  };
254
217
 
255
218
 
256
- /***/ }),
257
-
258
- /***/ 2106:
259
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
260
-
261
-
262
- var makeBuiltIn = __webpack_require__(283);
263
- var defineProperty = __webpack_require__(4913);
264
-
265
- module.exports = function (target, name, descriptor) {
266
- if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
267
- if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
268
- return defineProperty.f(target, name, descriptor);
269
- };
270
-
271
-
272
219
  /***/ }),
273
220
 
274
221
  /***/ 6840:
@@ -1482,38 +1429,6 @@ module.exports = function (argument) {
1482
1429
  };
1483
1430
 
1484
1431
 
1485
- /***/ }),
1486
-
1487
- /***/ 2140:
1488
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1489
-
1490
-
1491
- var wellKnownSymbol = __webpack_require__(8227);
1492
-
1493
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1494
- var test = {};
1495
-
1496
- test[TO_STRING_TAG] = 'z';
1497
-
1498
- module.exports = String(test) === '[object z]';
1499
-
1500
-
1501
- /***/ }),
1502
-
1503
- /***/ 655:
1504
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1505
-
1506
-
1507
- var classof = __webpack_require__(6955);
1508
-
1509
- var $String = String;
1510
-
1511
- module.exports = function (argument) {
1512
- if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1513
- return $String(argument);
1514
- };
1515
-
1516
-
1517
1432
  /***/ }),
1518
1433
 
1519
1434
  /***/ 6823:
@@ -1582,20 +1497,6 @@ module.exports = DESCRIPTORS && fails(function () {
1582
1497
  });
1583
1498
 
1584
1499
 
1585
- /***/ }),
1586
-
1587
- /***/ 2812:
1588
- /***/ (function(module) {
1589
-
1590
-
1591
- var $TypeError = TypeError;
1592
-
1593
- module.exports = function (passed, required) {
1594
- if (passed < required) throw new $TypeError('Not enough arguments');
1595
- return passed;
1596
- };
1597
-
1598
-
1599
1500
  /***/ }),
1600
1501
 
1601
1502
  /***/ 8622:
@@ -1685,125 +1586,6 @@ $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
1685
1586
  });
1686
1587
 
1687
1588
 
1688
- /***/ }),
1689
-
1690
- /***/ 4603:
1691
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
1692
-
1693
-
1694
- var defineBuiltIn = __webpack_require__(6840);
1695
- var uncurryThis = __webpack_require__(9504);
1696
- var toString = __webpack_require__(655);
1697
- var validateArgumentsLength = __webpack_require__(2812);
1698
-
1699
- var $URLSearchParams = URLSearchParams;
1700
- var URLSearchParamsPrototype = $URLSearchParams.prototype;
1701
- var append = uncurryThis(URLSearchParamsPrototype.append);
1702
- var $delete = uncurryThis(URLSearchParamsPrototype['delete']);
1703
- var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
1704
- var push = uncurryThis([].push);
1705
- var params = new $URLSearchParams('a=1&a=2&b=3');
1706
-
1707
- params['delete']('a', 1);
1708
- // `undefined` case is a Chromium 117 bug
1709
- // https://bugs.chromium.org/p/v8/issues/detail?id=14222
1710
- params['delete']('b', undefined);
1711
-
1712
- if (params + '' !== 'a=2') {
1713
- defineBuiltIn(URLSearchParamsPrototype, 'delete', function (name /* , value */) {
1714
- var length = arguments.length;
1715
- var $value = length < 2 ? undefined : arguments[1];
1716
- if (length && $value === undefined) return $delete(this, name);
1717
- var entries = [];
1718
- forEach(this, function (v, k) { // also validates `this`
1719
- push(entries, { key: k, value: v });
1720
- });
1721
- validateArgumentsLength(length, 1);
1722
- var key = toString(name);
1723
- var value = toString($value);
1724
- var index = 0;
1725
- var dindex = 0;
1726
- var found = false;
1727
- var entriesLength = entries.length;
1728
- var entry;
1729
- while (index < entriesLength) {
1730
- entry = entries[index++];
1731
- if (found || entry.key === key) {
1732
- found = true;
1733
- $delete(this, entry.key);
1734
- } else dindex++;
1735
- }
1736
- while (dindex < entriesLength) {
1737
- entry = entries[dindex++];
1738
- if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value);
1739
- }
1740
- }, { enumerable: true, unsafe: true });
1741
- }
1742
-
1743
-
1744
- /***/ }),
1745
-
1746
- /***/ 7566:
1747
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
1748
-
1749
-
1750
- var defineBuiltIn = __webpack_require__(6840);
1751
- var uncurryThis = __webpack_require__(9504);
1752
- var toString = __webpack_require__(655);
1753
- var validateArgumentsLength = __webpack_require__(2812);
1754
-
1755
- var $URLSearchParams = URLSearchParams;
1756
- var URLSearchParamsPrototype = $URLSearchParams.prototype;
1757
- var getAll = uncurryThis(URLSearchParamsPrototype.getAll);
1758
- var $has = uncurryThis(URLSearchParamsPrototype.has);
1759
- var params = new $URLSearchParams('a=1');
1760
-
1761
- // `undefined` case is a Chromium 117 bug
1762
- // https://bugs.chromium.org/p/v8/issues/detail?id=14222
1763
- if (params.has('a', 2) || !params.has('a', undefined)) {
1764
- defineBuiltIn(URLSearchParamsPrototype, 'has', function has(name /* , value */) {
1765
- var length = arguments.length;
1766
- var $value = length < 2 ? undefined : arguments[1];
1767
- if (length && $value === undefined) return $has(this, name);
1768
- var values = getAll(this, name); // also validates `this`
1769
- validateArgumentsLength(length, 1);
1770
- var value = toString($value);
1771
- var index = 0;
1772
- while (index < values.length) {
1773
- if (values[index++] === value) return true;
1774
- } return false;
1775
- }, { enumerable: true, unsafe: true });
1776
- }
1777
-
1778
-
1779
- /***/ }),
1780
-
1781
- /***/ 8721:
1782
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
1783
-
1784
-
1785
- var DESCRIPTORS = __webpack_require__(3724);
1786
- var uncurryThis = __webpack_require__(9504);
1787
- var defineBuiltInAccessor = __webpack_require__(2106);
1788
-
1789
- var URLSearchParamsPrototype = URLSearchParams.prototype;
1790
- var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
1791
-
1792
- // `URLSearchParams.prototype.size` getter
1793
- // https://github.com/whatwg/url/pull/734
1794
- if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {
1795
- defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
1796
- get: function size() {
1797
- var count = 0;
1798
- forEach(this, function () { count++; });
1799
- return count;
1800
- },
1801
- configurable: true,
1802
- enumerable: true
1803
- });
1804
- }
1805
-
1806
-
1807
1589
  /***/ })
1808
1590
 
1809
1591
  /******/ });
@@ -2220,7 +2002,7 @@ function getClass(property, params) {
2220
2002
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2003
 
2222
2004
 
2223
- const version = "3.15.29";
2005
+ const version = "3.15.31";
2224
2006
  core_.VxeUI.version = version;
2225
2007
  core_.VxeUI.tableVersion = version;
2226
2008
  core_.VxeUI.setConfig({
@@ -2864,7 +2646,7 @@ function isNodeElement(elem) {
2864
2646
  const {
2865
2647
  log: log_log
2866
2648
  } = core_.VxeUI;
2867
- const log_version = `table v${"3.15.29"}`;
2649
+ const log_version = `table v${"3.15.31"}`;
2868
2650
  const warnLog = log_log.create('warn', log_version);
2869
2651
  const errLog = log_log.create('error', log_version);
2870
2652
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -8876,7 +8658,6 @@ function parseColumns($xeTable, isReset) {
8876
8658
  // }
8877
8659
  // }
8878
8660
  // }
8879
- // if (process.env.VUE_APP_VXE_ENV === 'development') {
8880
8661
  // if (props.showHeader && !props.showHeaderOverflow) {
8881
8662
  // warnLog('vxe.error.reqProp', ['show-header-overflow'])
8882
8663
  // }
@@ -8889,7 +8670,6 @@ function parseColumns($xeTable, isReset) {
8889
8670
  if (props.footerSpanMethod) {
8890
8671
  warnLog('vxe.error.scrollErrProp', ['footer-span-method']);
8891
8672
  }
8892
- // }
8893
8673
  if (isReset) {
8894
8674
  const {
8895
8675
  visibleSize
@@ -9623,9 +9403,7 @@ const Methods = {
9623
9403
  }
9624
9404
  this.tableData = tableData.slice(0);
9625
9405
  } else {
9626
- if (true) {
9627
- warnLog('vxe.error.reqProp', ['keep-source']);
9628
- }
9406
+ errLog('vxe.error.reqProp', ['keep-source']);
9629
9407
  }
9630
9408
  return this.$nextTick();
9631
9409
  },
@@ -9934,16 +9712,12 @@ const Methods = {
9934
9712
  getVMRowIndex: createGetRowCacheProp('$index'),
9935
9713
  // 在 v3 中废弃
9936
9714
  _getRowIndex(row) {
9937
- if (true) {
9938
- warnLog('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex']);
9939
- }
9715
+ warnLog('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex']);
9940
9716
  return this.getVTRowIndex(row);
9941
9717
  },
9942
9718
  // 在 v3 中废弃
9943
9719
  $getRowIndex(row) {
9944
- if (true) {
9945
- warnLog('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex']);
9946
- }
9720
+ warnLog('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex']);
9947
9721
  return this.getVMRowIndex(row);
9948
9722
  },
9949
9723
  /**
@@ -9963,16 +9737,12 @@ const Methods = {
9963
9737
  getVMColumnIndex: createGetColumnCacheProp('$index'),
9964
9738
  // 在 v3 中废弃
9965
9739
  _getColumnIndex(column) {
9966
- if (true) {
9967
- warnLog('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex']);
9968
- }
9740
+ warnLog('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex']);
9969
9741
  return this.getVTColumnIndex(column);
9970
9742
  },
9971
9743
  // 在 v3 中废弃
9972
9744
  $getColumnIndex(column) {
9973
- if (true) {
9974
- warnLog('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex']);
9975
- }
9745
+ warnLog('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex']);
9976
9746
  return this.getVMColumnIndex(column);
9977
9747
  },
9978
9748
  /**
@@ -10098,9 +9868,7 @@ const Methods = {
10098
9868
  handleGetRowId
10099
9869
  } = createHandleGetRowId($xeTable);
10100
9870
  if (!keepSource) {
10101
- if (true) {
10102
- errLog('vxe.error.reqProp', ['keep-source']);
10103
- }
9871
+ errLog('vxe.error.reqProp', ['keep-source']);
10104
9872
  return $xeTable.$nextTick();
10105
9873
  }
10106
9874
  let targetRows = rows;
@@ -11828,10 +11596,8 @@ const Methods = {
11828
11596
  // 兼容老版本
11829
11597
  if (!evntList.length && type === 'event.clearEdit') {
11830
11598
  evntList = methods_interceptor.get('event.clearActived');
11831
- if (true) {
11832
- if (evntList.length) {
11833
- warnLog('vxe.error.delEvent', ['event.clearActived', 'event.clearEdit']);
11834
- }
11599
+ if (evntList.length) {
11600
+ warnLog('vxe.error.delEvent', ['event.clearActived', 'event.clearEdit']);
11835
11601
  }
11836
11602
  }
11837
11603
  // 兼容老版本
@@ -15131,9 +14897,7 @@ const Methods = {
15131
14897
  },
15132
14898
  // 在 v3 中废弃
15133
14899
  getSortColumn() {
15134
- if (true) {
15135
- warnLog('vxe.error.delFunc', ['getSortColumn', 'getSortColumns']);
15136
- }
14900
+ warnLog('vxe.error.delFunc', ['getSortColumn', 'getSortColumns']);
15137
14901
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().find(this.tableFullColumn, column => (column.sortable || column.remoteSort) && column.order);
15138
14902
  },
15139
14903
  isSort(fieldOrColumn) {
@@ -15333,9 +15097,7 @@ const Methods = {
15333
15097
  return $xeTable.$nextTick();
15334
15098
  },
15335
15099
  reloadExpandContent(row) {
15336
- if (true) {
15337
- warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand']);
15338
- }
15100
+ warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand']);
15339
15101
  // 即将废弃
15340
15102
  return this.reloadRowExpand(row);
15341
15103
  },
@@ -15514,9 +15276,7 @@ const Methods = {
15514
15276
  return !!rowExpandedFlag && !!rowExpandedMaps[rowid];
15515
15277
  },
15516
15278
  isExpandByRow(row) {
15517
- if (true) {
15518
- warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow']);
15519
- }
15279
+ warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow']);
15520
15280
  // 即将废弃
15521
15281
  return this.isRowExpandByRow(row);
15522
15282
  },
@@ -15775,9 +15535,7 @@ const Methods = {
15775
15535
  },
15776
15536
  reloadTreeChilds(row) {
15777
15537
  const $xeTable = this;
15778
- if (true) {
15779
- warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand']);
15780
- }
15538
+ warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand']);
15781
15539
  // 即将废弃
15782
15540
  return $xeTable.reloadTreeExpand(row);
15783
15541
  },
@@ -22310,9 +22068,7 @@ const {
22310
22068
  this.handleOpenMenuEvent(evnt, layout, params);
22311
22069
  // 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
22312
22070
  if (this.$listeners[`${typePrefix}cell-context-menu`]) {
22313
- if (true) {
22314
- warnLog('vxe.error.delEvent', [`${typePrefix}cell-context-menu`, `${typePrefix}cell-menu`]);
22315
- }
22071
+ warnLog('vxe.error.delEvent', [`${typePrefix}cell-context-menu`, `${typePrefix}cell-menu`]);
22316
22072
  this.emitEvent(`${typePrefix}cell-context-menu`, params, evnt);
22317
22073
  } else {
22318
22074
  this.emitEvent(`${typePrefix}cell-menu`, params, evnt);
@@ -22495,9 +22251,7 @@ const {
22495
22251
  }
22496
22252
  // 在 v4 中废弃事件 context-menu-click
22497
22253
  if (this.$listeners['context-menu-click']) {
22498
- if (true) {
22499
- warnLog('vxe.error.delEvent', ['context-menu-click', 'menu-click']);
22500
- }
22254
+ warnLog('vxe.error.delEvent', ['context-menu-click', 'menu-click']);
22501
22255
  this.emitEvent('context-menu-click', params, evnt);
22502
22256
  } else {
22503
22257
  this.emitEvent('menu-click', params, evnt);
@@ -22630,10 +22384,8 @@ function insertTreeRow($xeTable, newRecords, isAppend) {
22630
22384
  fullDataRowIdData[rowid] = rest;
22631
22385
  fullAllDataRowIdData[rowid] = rest;
22632
22386
  } else {
22633
- if (true) {
22634
- if (parentRowId) {
22635
- warnLog('vxe.error.unableInsert');
22636
- }
22387
+ if (parentRowId) {
22388
+ warnLog('vxe.error.unableInsert');
22637
22389
  }
22638
22390
  afterFullData[funcName](item);
22639
22391
  tableFullTreeData[funcName](item);
@@ -22781,11 +22533,9 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
22781
22533
  const parentLevel = parentRest ? parentRest.level : 0;
22782
22534
  newRecords.forEach((item, i) => {
22783
22535
  const rowid = getRowid($xeTable, item);
22784
- if (true) {
22785
- if (item[treeOpts.parentField]) {
22786
- if (parentRow && item[treeOpts.parentField] !== parentRow[rowField]) {
22787
- errLog('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`]);
22788
- }
22536
+ if (item[treeOpts.parentField]) {
22537
+ if (parentRow && item[treeOpts.parentField] !== parentRow[rowField]) {
22538
+ errLog('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`]);
22789
22539
  }
22790
22540
  }
22791
22541
  if (parentRow) {
@@ -22830,9 +22580,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
22830
22580
  }
22831
22581
  }
22832
22582
  } else {
22833
- if (true) {
22834
- warnLog('vxe.error.unableInsert');
22835
- }
22583
+ warnLog('vxe.error.unableInsert');
22836
22584
  insertTreeRow($xeTable, newRecords, true);
22837
22585
  }
22838
22586
  } else {
@@ -23452,9 +23200,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
23452
23200
  syncActivedCell($xeTable);
23453
23201
  },
23454
23202
  _clearActived(row) {
23455
- if (true) {
23456
- warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit']);
23457
- }
23203
+ warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit']);
23458
23204
  // 即将废弃
23459
23205
  return this.clearEdit(row);
23460
23206
  },
@@ -23474,9 +23220,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
23474
23220
  },
23475
23221
  _getActiveRecord() {
23476
23222
  const $xeTable = this;
23477
- if (true) {
23478
- warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord']);
23479
- }
23223
+ warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord']);
23480
23224
  // 即将废弃
23481
23225
  return $xeTable.getEditRecord();
23482
23226
  },
@@ -23502,9 +23246,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
23502
23246
  },
23503
23247
  _isActiveByRow(row) {
23504
23248
  const $xeTable = this;
23505
- if (true) {
23506
- warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow']);
23507
- }
23249
+ warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow']);
23508
23250
  // 即将废弃
23509
23251
  return $xeTable.isEditByRow(row);
23510
23252
  },
@@ -23586,9 +23328,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
23586
23328
  },
23587
23329
  _setActiveRow(row) {
23588
23330
  const $xeTable = this;
23589
- if (true) {
23590
- warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow']);
23591
- }
23331
+ warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow']);
23592
23332
  // 即将废弃
23593
23333
  return $xeTable.setEditRow(row);
23594
23334
  },
@@ -23608,9 +23348,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
23608
23348
  return handleEditCell($xeTable, row, column, isPos);
23609
23349
  },
23610
23350
  _setActiveCell(row, fieldOrColumn) {
23611
- if (true) {
23612
- warnLog('vxe.error.delFunc', ['setActiveCell', 'setEditCell']);
23613
- }
23351
+ warnLog('vxe.error.delFunc', ['setActiveCell', 'setEditCell']);
23614
23352
  // 即将废弃
23615
23353
  return this.setEditCell(row, fieldOrColumn);
23616
23354
  },
@@ -23761,12 +23499,6 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
23761
23499
  }
23762
23500
  }
23763
23501
  });
23764
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.delete.js
23765
- var web_url_search_params_delete = __webpack_require__(4603);
23766
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.has.js
23767
- var web_url_search_params_has = __webpack_require__(7566);
23768
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.size.js
23769
- var web_url_search_params_size = __webpack_require__(8721);
23770
23502
  ;// CONCATENATED MODULE: ./packages/table/module/export/util.ts
23771
23503
  // 默认导出或打印的 HTML 样式
23772
23504
  const defaultHtmlStyle = 'body{margin:0;padding: 0 1px;color:#333333;font-size:14px;font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu}body *{-webkit-box-sizing:border-box;box-sizing:border-box}.vxe-table{border-collapse:collapse;text-align:left;border-spacing:0}.vxe-table:not(.is--print){table-layout:fixed}.vxe-table,.vxe-table th,.vxe-table td,.vxe-table td{border-color:#D0D0D0;border-style:solid;border-width:0}.vxe-table.is--print{width:100%}.border--default,.border--full,.border--outer{border-top-width:1px}.border--default,.border--full,.border--outer{border-left-width:1px}.border--outer,.border--default th,.border--default td,.border--full th,.border--full td,.border--outer th,.border--inner th,.border--inner td{border-bottom-width:1px}.border--default,.border--outer,.border--full th,.border--full td{border-right-width:1px}.border--default th,.border--full th,.border--outer th{background-color:#f8f8f9}.vxe-table td>div,.vxe-table th>div{padding:.5em .4em}.col--center{text-align:center}.col--right{text-align:right}.vxe-table:not(.is--print) .col--ellipsis>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.vxe-table--tree-node{text-align:left}.vxe-table--tree-node-wrapper{position:relative}.vxe-table--tree-icon-wrapper{position:absolute;top:50%;width:1em;height:1em;text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.vxe-table--tree-unfold-icon,.vxe-table--tree-fold-icon{position:absolute;width:0;height:0;border-style:solid;border-width:.5em;border-right-color:transparent;border-bottom-color:transparent}.vxe-table--tree-unfold-icon{left:.3em;top:0;border-left-color:#939599;border-top-color:transparent}.vxe-table--tree-fold-icon{left:0;top:.3em;border-left-color:transparent;border-top-color:#939599}.vxe-table--tree-cell{display:block;padding-left:1.5em}.vxe-table input[type="checkbox"]{margin:0}.vxe-table input[type="checkbox"],.vxe-table input[type="radio"],.vxe-table input[type="checkbox"]+span,.vxe-table input[type="radio"]+span{vertical-align:middle;padding-left:0.4em}';
@@ -23790,17 +23522,11 @@ function createHtmlPage(opts, content) {
23790
23522
 
23791
23523
 
23792
23524
 
23793
-
23794
-
23795
-
23796
23525
  const {
23797
23526
  getI18n: export_mixin_getI18n,
23798
23527
  renderer: export_mixin_renderer
23799
23528
  } = core_.VxeUI;
23800
23529
  let htmlCellElem;
23801
- // 导入
23802
- let fileForm;
23803
- let fileInput;
23804
23530
  const csvBOM = '\ufeff';
23805
23531
  const enterSymbol = '\r\n';
23806
23532
  function hasTreeChildren($xeTable, row) {
@@ -23825,7 +23551,7 @@ function getSeq($xeTable, cellValue, row, $rowIndex, column, $columnIndex) {
23825
23551
  return cellValue;
23826
23552
  }
23827
23553
  function defaultFilterExportColumn(column) {
23828
- return column.field || ['seq', 'checkbox', 'radio'].indexOf(column.type) > -1;
23554
+ return !!column.field || ['seq', 'checkbox', 'radio'].indexOf(column.type || '') === -1;
23829
23555
  }
23830
23556
  function toTableBorder(border) {
23831
23557
  if (border === true) {
@@ -24380,41 +24106,6 @@ function getContent($xeTable, opts, columns, datas) {
24380
24106
  }
24381
24107
  return '';
24382
24108
  }
24383
- /**
24384
- * 保存文件到本地
24385
- * @param {*} options 参数
24386
- */
24387
- function saveLocalFile(options) {
24388
- const {
24389
- filename,
24390
- type,
24391
- content
24392
- } = options;
24393
- const name = `${filename}.${type}`;
24394
- if (window.Blob) {
24395
- const blob = content instanceof Blob ? content : getExportBlobByContent(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(content), options);
24396
- if (navigator.msSaveBlob) {
24397
- navigator.msSaveBlob(blob, name);
24398
- } else {
24399
- const url = URL.createObjectURL(blob);
24400
- const linkElem = document.createElement('a');
24401
- linkElem.target = '_blank';
24402
- linkElem.download = name;
24403
- linkElem.href = url;
24404
- document.body.appendChild(linkElem);
24405
- linkElem.click();
24406
- document.body.removeChild(linkElem);
24407
- requestAnimationFrame(() => {
24408
- if (linkElem.parentNode) {
24409
- linkElem.parentNode.removeChild(linkElem);
24410
- }
24411
- URL.revokeObjectURL(url);
24412
- });
24413
- }
24414
- return Promise.resolve();
24415
- }
24416
- return Promise.reject(new Error(export_mixin_getI18n('vxe.error.notExp')));
24417
- }
24418
24109
  function downloadFile($xeTable, opts, content) {
24419
24110
  const {
24420
24111
  filename,
@@ -24429,22 +24120,22 @@ function downloadFile($xeTable, opts, content) {
24429
24120
  blob
24430
24121
  });
24431
24122
  }
24432
- saveLocalFile({
24433
- filename,
24434
- type,
24435
- content
24436
- }).then(() => {
24437
- if (opts.message !== false) {
24438
- // 检测弹窗模块
24439
- if (!core_.VxeUI.modal) {
24440
- errLog('vxe.error.reqModule', ['Modal']);
24123
+ if (core_.VxeUI.saveFile) {
24124
+ core_.VxeUI.saveFile({
24125
+ filename,
24126
+ type,
24127
+ content
24128
+ }).then(() => {
24129
+ if (opts.message !== false) {
24130
+ if (core_.VxeUI.modal) {
24131
+ core_.VxeUI.modal.message({
24132
+ content: export_mixin_getI18n('vxe.table.expSuccess'),
24133
+ status: 'success'
24134
+ });
24135
+ }
24441
24136
  }
24442
- core_.VxeUI.modal.message({
24443
- content: export_mixin_getI18n('vxe.table.expSuccess'),
24444
- status: 'success'
24445
- });
24446
- }
24447
- });
24137
+ });
24138
+ }
24448
24139
  }
24449
24140
  function clearColumnConvert(columns) {
24450
24141
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(columns, column => {
@@ -24873,72 +24564,6 @@ function handleCloseExport() {
24873
24564
  }
24874
24565
  return Promise.resolve();
24875
24566
  }
24876
- /**
24877
- * 读取本地文件
24878
- * @param {*} options 参数
24879
- */
24880
- function readLocalFile(options = {}) {
24881
- if (!fileForm) {
24882
- fileForm = document.createElement('form');
24883
- fileInput = document.createElement('input');
24884
- fileForm.className = 'vxe-table--file-form';
24885
- fileInput.name = 'file';
24886
- fileInput.type = 'file';
24887
- fileForm.appendChild(fileInput);
24888
- document.body.appendChild(fileForm);
24889
- }
24890
- return new Promise((resolve, reject) => {
24891
- const types = options.types || [];
24892
- const isAllType = !types.length || types.some(type => type === '*');
24893
- fileInput.multiple = !!options.multiple;
24894
- fileInput.accept = isAllType ? '' : `.${types.join(', .')}`;
24895
- fileInput.onchange = evnt => {
24896
- const {
24897
- files
24898
- } = evnt.target;
24899
- const file = files[0];
24900
- let errType;
24901
- // 校验类型
24902
- if (!isAllType) {
24903
- for (let fIndex = 0; fIndex < files.length; fIndex++) {
24904
- const {
24905
- type
24906
- } = parseFile(files[fIndex]);
24907
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(types, type)) {
24908
- errType = type;
24909
- break;
24910
- }
24911
- }
24912
- }
24913
- if (!errType) {
24914
- resolve({
24915
- status: true,
24916
- files,
24917
- file
24918
- });
24919
- } else {
24920
- if (options.message !== false) {
24921
- // 检测弹窗模块
24922
- if (!core_.VxeUI.modal) {
24923
- errLog('vxe.error.reqModule', ['Modal']);
24924
- }
24925
- core_.VxeUI.modal.message({
24926
- content: export_mixin_getI18n('vxe.error.notType', [errType]),
24927
- status: 'error'
24928
- });
24929
- }
24930
- const params = {
24931
- status: false,
24932
- files,
24933
- file
24934
- };
24935
- reject(params);
24936
- }
24937
- };
24938
- fileForm.reset();
24939
- fileInput.click();
24940
- });
24941
- }
24942
24567
  function handleFilterColumns(exportOpts, column, columns) {
24943
24568
  return columns.some(item => {
24944
24569
  if (isColumnInfo(item)) {
@@ -24974,7 +24599,7 @@ function handleFilterFields(exportOpts, column, includeFields, excludeFields) {
24974
24599
  }
24975
24600
  return false;
24976
24601
  }
24977
- return exportOpts.original ? column.field : defaultFilterExportColumn(column);
24602
+ return exportOpts.original ? !!column.field : defaultFilterExportColumn(column);
24978
24603
  }
24979
24604
  function handleExportAndPrint($xeTable, options, isPrint) {
24980
24605
  const props = $xeTable;
@@ -25046,7 +24671,7 @@ function handleExportAndPrint($xeTable, options, isPrint) {
25046
24671
  });
25047
24672
  // 默认选中
25048
24673
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(exportColumns, (column, index, items, path, parent) => {
25049
- const isColGroup = column.children && column.children.length;
24674
+ const isColGroup = column.children && column.children.length > 0;
25050
24675
  let isChecked = false;
25051
24676
  if (columns && columns.length) {
25052
24677
  isChecked = handleFilterColumns(defOpts, column, columns);
@@ -25186,14 +24811,14 @@ const convertToRows = originColumns => {
25186
24811
  showFooter
25187
24812
  } = props;
25188
24813
  const {
25189
- mergeFooterList,
25190
24814
  isGroup
25191
24815
  } = reactData;
25192
24816
  const {
25193
24817
  tableFullColumn,
25194
24818
  afterFullData,
24819
+ collectColumn,
25195
24820
  mergeBodyList,
25196
- collectColumn
24821
+ mergeFooterList
25197
24822
  } = internalData;
25198
24823
  const exportOpts = $xeTable.computeExportOpts;
25199
24824
  const treeOpts = $xeTable.computeTreeOpts;
@@ -25241,29 +24866,36 @@ const convertToRows = originColumns => {
25241
24866
  if (!mode) {
25242
24867
  mode = selectRecords.length ? 'selected' : 'current';
25243
24868
  }
25244
- const customCols = columns && columns.length ? columns : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(collectColumn, column => {
25245
- const isColGroup = column.children && column.children.length;
25246
- let isChecked = false;
25247
- if (columns && columns.length) {
25248
- isChecked = handleFilterColumns(opts, column, columns);
25249
- } else if (excludeFields || includeFields) {
25250
- isChecked = handleFilterFields(opts, column, includeFields, excludeFields);
25251
- } else {
25252
- isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
25253
- }
25254
- return isChecked;
25255
- }, {
25256
- children: 'children',
25257
- mapChildren: 'childNodes',
25258
- original: true
25259
- });
24869
+ let isCustomCol = false;
24870
+ let customCols = [];
24871
+ if (columns && columns.length) {
24872
+ isCustomCol = true;
24873
+ customCols = columns;
24874
+ } else {
24875
+ customCols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(collectColumn, column => {
24876
+ const isColGroup = column.children && column.children.length > 0;
24877
+ let isChecked = false;
24878
+ if (columns && columns.length) {
24879
+ isChecked = handleFilterColumns(opts, column, columns);
24880
+ } else if (excludeFields || includeFields) {
24881
+ isChecked = handleFilterFields(opts, column, includeFields, excludeFields);
24882
+ } else {
24883
+ isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
24884
+ }
24885
+ return isChecked;
24886
+ }, {
24887
+ children: 'children',
24888
+ mapChildren: 'childNodes',
24889
+ original: true
24890
+ });
24891
+ }
25260
24892
  const handleOptions = Object.assign({}, opts, {
25261
24893
  filename: '',
25262
24894
  sheetName: ''
25263
24895
  });
25264
24896
  // 如果设置源数据,则默认导出设置了字段的列
25265
- if (!customCols && !columnFilterMethod) {
25266
- handleOptions.columnFilterMethod = ({
24897
+ if (!isCustomCol && !columnFilterMethod) {
24898
+ columnFilterMethod = ({
25267
24899
  column
25268
24900
  }) => {
25269
24901
  if (excludeFields) {
@@ -25277,8 +24909,9 @@ const convertToRows = originColumns => {
25277
24909
  }
25278
24910
  return false;
25279
24911
  }
25280
- return original ? column.field : defaultFilterExportColumn(column);
24912
+ return original ? !!column.field : defaultFilterExportColumn(column);
25281
24913
  };
24914
+ handleOptions.columnFilterMethod = columnFilterMethod;
25282
24915
  }
25283
24916
  if (customCols) {
25284
24917
  handleOptions._isCustomColumn = true;
@@ -25309,6 +24942,7 @@ const convertToRows = originColumns => {
25309
24942
  children: 'childNodes',
25310
24943
  mapChildren: '_children'
25311
24944
  }), (column, index) => isColumnInfo(column) && (!columnFilterMethod || columnFilterMethod({
24945
+ $table: $xeTable,
25312
24946
  column: column,
25313
24947
  $columnIndex: index
25314
24948
  })), {
@@ -25318,6 +24952,7 @@ const convertToRows = originColumns => {
25318
24952
  });
25319
24953
  } else {
25320
24954
  groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({
24955
+ $table: $xeTable,
25321
24956
  column,
25322
24957
  $columnIndex: index
25323
24958
  })), {
@@ -25370,10 +25005,8 @@ const convertToRows = originColumns => {
25370
25005
  // 检查类型,如果为自定义导出,则不需要校验类型
25371
25006
  if (!handleOptions.exportMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps), type)) {
25372
25007
  errLog('vxe.error.notType', [type]);
25373
- if (true) {
25374
- if (['xlsx', 'pdf'].includes(type)) {
25375
- warnLog('vxe.error.reqPlugin', [4, 'plugin-export-xlsx']);
25376
- }
25008
+ if (['xlsx', 'pdf'].includes(type)) {
25009
+ warnLog('vxe.error.reqPlugin', [4, 'plugin-export-xlsx']);
25377
25010
  }
25378
25011
  const params = {
25379
25012
  status: false
@@ -25400,10 +25033,8 @@ const convertToRows = originColumns => {
25400
25033
  handleOptions.data = selectRecords;
25401
25034
  }
25402
25035
  } else if (mode === 'all') {
25403
- if (true) {
25404
- if (!$xeGrid) {
25405
- warnLog('vxe.error.errProp', ['all', 'mode=current,selected']);
25406
- }
25036
+ if (!$xeGrid) {
25037
+ errLog('vxe.error.errProp', ['all', 'mode=current,selected']);
25407
25038
  }
25408
25039
  if ($xeGrid && !handleOptions.remote) {
25409
25040
  const gridReactData = $xeGrid;
@@ -25420,10 +25051,8 @@ const convertToRows = originColumns => {
25420
25051
  const ajaxMethods = ajax.queryAll;
25421
25052
  const queryAllSuccessMethods = ajax.queryAllSuccess;
25422
25053
  const queryAllErrorMethods = ajax.queryAllError;
25423
- if (true) {
25424
- if (!ajaxMethods) {
25425
- warnLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll']);
25426
- }
25054
+ if (!ajaxMethods) {
25055
+ errLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll']);
25427
25056
  }
25428
25057
  if (ajaxMethods) {
25429
25058
  const params = {
@@ -25468,6 +25097,7 @@ const convertToRows = originColumns => {
25468
25097
  return handleExport($xeTable, handleOptions);
25469
25098
  },
25470
25099
  _importByFile(file, options) {
25100
+ const $xeTable = this;
25471
25101
  const opts = Object.assign({}, options);
25472
25102
  const {
25473
25103
  beforeImportMethod
@@ -25475,12 +25105,13 @@ const convertToRows = originColumns => {
25475
25105
  if (beforeImportMethod) {
25476
25106
  beforeImportMethod({
25477
25107
  options: opts,
25478
- $table: this
25108
+ $table: $xeTable
25479
25109
  });
25480
25110
  }
25481
- return handleFileImport(this, file, opts);
25111
+ return handleFileImport($xeTable, file, opts);
25482
25112
  },
25483
25113
  _importData(options) {
25114
+ const $xeTable = this;
25484
25115
  const {
25485
25116
  importOpts
25486
25117
  } = this;
@@ -25499,12 +25130,12 @@ const convertToRows = originColumns => {
25499
25130
  $table: this
25500
25131
  });
25501
25132
  }
25502
- return readLocalFile(opts).catch(e => {
25133
+ return core_.VxeUI.readFile(opts).catch(e => {
25503
25134
  if (afterImportMethod) {
25504
25135
  afterImportMethod({
25505
25136
  status: false,
25506
25137
  options: opts,
25507
- $table: this
25138
+ $table: $xeTable
25508
25139
  });
25509
25140
  }
25510
25141
  return Promise.reject(e);
@@ -25512,14 +25143,14 @@ const convertToRows = originColumns => {
25512
25143
  const {
25513
25144
  file
25514
25145
  } = params;
25515
- return handleFileImport(this, file, opts);
25146
+ return handleFileImport($xeTable, file, opts);
25516
25147
  });
25517
25148
  },
25518
25149
  _saveFile(options) {
25519
- return saveLocalFile(options);
25150
+ return core_.VxeUI.saveFile(options);
25520
25151
  },
25521
25152
  _readFile(options) {
25522
- return readLocalFile(options);
25153
+ return core_.VxeUI.readFile(options);
25523
25154
  },
25524
25155
  _print(options) {
25525
25156
  const $xeTable = this;
@@ -25627,18 +25258,28 @@ const convertToRows = originColumns => {
25627
25258
  return Promise.resolve();
25628
25259
  },
25629
25260
  _openImport(options) {
25261
+ const $xeTable = this;
25262
+ const props = $xeTable;
25263
+ const reactData = $xeTable;
25630
25264
  const {
25631
- importOpts
25632
- } = this;
25265
+ treeConfig,
25266
+ importConfig
25267
+ } = props;
25268
+ const {
25269
+ initStore,
25270
+ importStore,
25271
+ importParams
25272
+ } = reactData;
25273
+ const importOpts = $xeTable.computeImportOpts;
25633
25274
  const defOpts = Object.assign({
25634
25275
  mode: 'insertTop',
25635
25276
  message: true,
25636
25277
  types: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),
25637
25278
  modes: ['insertTop', 'covering']
25638
- }, options, importOpts);
25279
+ }, importOpts, options);
25639
25280
  const types = defOpts.types || [];
25640
25281
  const modes = defOpts.modes || [];
25641
- const isTree = !!this.getTreeStatus();
25282
+ const isTree = !!treeConfig;
25642
25283
  if (isTree) {
25643
25284
  if (defOpts.message) {
25644
25285
  core_.VxeUI.modal.message({
@@ -25648,7 +25289,7 @@ const convertToRows = originColumns => {
25648
25289
  }
25649
25290
  return;
25650
25291
  }
25651
- if (!this.importConfig) {
25292
+ if (!importConfig) {
25652
25293
  errLog('vxe.error.reqProp', ['import-config']);
25653
25294
  }
25654
25295
  // 处理类型
@@ -25670,7 +25311,7 @@ const convertToRows = originColumns => {
25670
25311
  label: export_mixin_getI18n(`vxe.import.modes.${item}`)
25671
25312
  };
25672
25313
  });
25673
- Object.assign(this.importStore, {
25314
+ Object.assign(importStore, {
25674
25315
  file: null,
25675
25316
  type: '',
25676
25317
  filename: '',
@@ -25678,31 +25319,38 @@ const convertToRows = originColumns => {
25678
25319
  typeList,
25679
25320
  visible: true
25680
25321
  });
25681
- Object.assign(this.importParams, defOpts);
25682
- if (!modeList.some(item => item.value === this.importParams.mode)) {
25683
- this.importParams.mode = modeList[0].value;
25322
+ Object.assign(importParams, defOpts);
25323
+ if (!modeList.some(item => item.value === importParams.mode)) {
25324
+ importParams.mode = modeList[0].value;
25684
25325
  }
25685
- this.initStore.import = true;
25326
+ initStore.import = true;
25686
25327
  },
25687
25328
  _closeExport: handleCloseExport,
25688
25329
  _openExport(options) {
25689
- const {
25690
- exportOpts
25691
- } = this;
25692
- if (!this.exportConfig) {
25330
+ const $xeTable = this;
25331
+ const props = $xeTable;
25332
+ const exportOpts = $xeTable.computeExportOpts;
25333
+ const defOpts = Object.assign({
25334
+ message: true,
25335
+ types: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps)
25336
+ }, exportOpts, options);
25337
+ if (!props.exportConfig) {
25693
25338
  errLog('vxe.error.reqProp', ['export-config']);
25694
25339
  }
25695
- return handleExportAndPrint(this, Object.assign({}, exportOpts, options));
25340
+ return handleExportAndPrint($xeTable, defOpts);
25696
25341
  },
25697
25342
  _closePrint: handleCloseExport,
25698
25343
  _openPrint(options) {
25699
- const {
25700
- printOpts
25701
- } = this;
25702
- if (!this.printConfig) {
25344
+ const $xeTable = this;
25345
+ const props = $xeTable;
25346
+ const printOpts = $xeTable.computePrintOpts;
25347
+ const defOpts = Object.assign({
25348
+ message: true
25349
+ }, printOpts, options);
25350
+ if (!props.printConfig) {
25703
25351
  errLog('vxe.error.reqProp', ['print-config']);
25704
25352
  }
25705
- return handleExportAndPrint(this, Object.assign({}, printOpts, options), true);
25353
+ return handleExportAndPrint($xeTable, defOpts, true);
25706
25354
  }
25707
25355
  }
25708
25356
  });
@@ -26364,32 +26012,107 @@ class Rule {
26364
26012
  return this.content;
26365
26013
  }
26366
26014
  }
26367
- function validErrorRuleValue(rule, val) {
26015
+ // 如果存在 pattern,判断正则
26016
+ function validREValue(pattern, val) {
26017
+ if (pattern && !(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
26018
+ return false;
26019
+ }
26020
+ return true;
26021
+ }
26022
+ // 如果存在 max,判断最大值
26023
+ function validMaxValue(max, num) {
26024
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(max) && num > external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(max)) {
26025
+ return false;
26026
+ }
26027
+ return true;
26028
+ }
26029
+ // 如果存在 min,判断最小值
26030
+ function validMinValue(min, num) {
26031
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(min) && num < external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(min)) {
26032
+ return false;
26033
+ }
26034
+ return true;
26035
+ }
26036
+ function validRuleValue(rule, val, required) {
26368
26037
  const {
26369
26038
  type,
26370
26039
  min,
26371
26040
  max,
26372
26041
  pattern
26373
26042
  } = rule;
26043
+ const isArrType = type === 'array';
26374
26044
  const isNumType = type === 'number';
26375
- const numVal = isNumType ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(val) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getSize(val);
26376
- // 判断数值
26377
- if (isNumType && isNaN(val)) {
26378
- return true;
26379
- }
26380
- // 如果存在 min,判断最小值
26381
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(min) && numVal < external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(min)) {
26382
- return true;
26045
+ const isStrType = type === 'string';
26046
+ const strVal = `${val}`;
26047
+ if (!validREValue(pattern, strVal)) {
26048
+ return false;
26383
26049
  }
26384
- // 如果存在 max,判断最大值
26385
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(max) && numVal > external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(max)) {
26386
- return true;
26050
+ if (isArrType) {
26051
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(val)) {
26052
+ return false;
26053
+ }
26054
+ if (required) {
26055
+ if (!val.length) {
26056
+ return false;
26057
+ }
26058
+ }
26059
+ if (!validMinValue(min, val.length)) {
26060
+ return false;
26061
+ }
26062
+ if (!validMaxValue(max, val.length)) {
26063
+ return false;
26064
+ }
26065
+ } else if (isNumType) {
26066
+ const numVal = Number(val);
26067
+ if (isNaN(numVal)) {
26068
+ return false;
26069
+ }
26070
+ if (!validMinValue(min, numVal)) {
26071
+ return false;
26072
+ }
26073
+ if (!validMaxValue(max, numVal)) {
26074
+ return false;
26075
+ }
26076
+ } else {
26077
+ if (isStrType) {
26078
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val)) {
26079
+ return false;
26080
+ }
26081
+ }
26082
+ if (required) {
26083
+ if (!strVal) {
26084
+ return false;
26085
+ }
26086
+ }
26087
+ if (!validMinValue(min, strVal.length)) {
26088
+ return false;
26089
+ }
26090
+ if (!validMaxValue(max, strVal.length)) {
26091
+ return false;
26092
+ }
26387
26093
  }
26388
- // 如果存在 pattern,正则校验
26389
- if (pattern && !(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
26390
- return true;
26094
+ return true;
26095
+ }
26096
+ function checkRuleStatus(rule, val) {
26097
+ const {
26098
+ required
26099
+ } = rule;
26100
+ const isEmptyVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(val);
26101
+ if (required) {
26102
+ if (isEmptyVal) {
26103
+ return false;
26104
+ }
26105
+ if (!validRuleValue(rule, val, required)) {
26106
+ return false;
26107
+ }
26108
+ } else {
26109
+ if (!isEmptyVal) {
26110
+ if (!validRuleValue(rule, val, required)) {
26111
+ return false;
26112
+ }
26113
+ }
26391
26114
  }
26392
- return false;
26115
+ return true;
26393
26116
  }
26394
26117
  /* harmony default export */ var validator_mixin = ({
26395
26118
  methods: {
@@ -26397,10 +26120,8 @@ function validErrorRuleValue(rule, val) {
26397
26120
  * 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
26398
26121
  */
26399
26122
  _fullValidate(rows, cb) {
26400
- if (true) {
26401
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(cb)) {
26402
- warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)']);
26403
- }
26123
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(cb)) {
26124
+ warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)']);
26404
26125
  }
26405
26126
  return this.beginValidate(rows, null, cb, true);
26406
26127
  },
@@ -26408,10 +26129,8 @@ function validErrorRuleValue(rule, val) {
26408
26129
  * 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
26409
26130
  */
26410
26131
  _validate(rows, cb) {
26411
- if (true) {
26412
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(cb)) {
26413
- warnLog('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)']);
26414
- }
26132
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(cb)) {
26133
+ warnLog('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)']);
26415
26134
  }
26416
26135
  return this.beginValidate(rows, null, cb);
26417
26136
  },
@@ -26672,9 +26391,7 @@ function validErrorRuleValue(rule, val) {
26672
26391
  const cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(val) ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, property) : val;
26673
26392
  rules.forEach(rule => {
26674
26393
  const {
26675
- type,
26676
26394
  trigger,
26677
- required,
26678
26395
  validator
26679
26396
  } = rule;
26680
26397
  if (validType === 'all' || !trigger || validType === trigger) {
@@ -26698,9 +26415,7 @@ function validErrorRuleValue(rule, val) {
26698
26415
  if (tcvMethod) {
26699
26416
  customValid = tcvMethod(validParams);
26700
26417
  } else {
26701
- if (true) {
26702
- warnLog('vxe.error.notValidators', [validator]);
26703
- }
26418
+ errLog('vxe.error.notValidators', [validator]);
26704
26419
  }
26705
26420
  } else {
26706
26421
  errLog('vxe.error.notValidators', [validator]);
@@ -26731,17 +26446,7 @@ function validErrorRuleValue(rule, val) {
26731
26446
  }
26732
26447
  }
26733
26448
  } else {
26734
- const isArrType = type === 'array';
26735
- const isArrVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(cellValue);
26736
- let hasEmpty = true;
26737
- if (isArrType || isArrVal) {
26738
- hasEmpty = !isArrVal || !cellValue.length;
26739
- } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(cellValue)) {
26740
- hasEmpty = eqEmptyValue(cellValue.trim());
26741
- } else {
26742
- hasEmpty = eqEmptyValue(cellValue);
26743
- }
26744
- if (required ? hasEmpty || validErrorRuleValue(rule, cellValue) : !hasEmpty && validErrorRuleValue(rule, cellValue)) {
26449
+ if (!checkRuleStatus(rule, cellValue)) {
26745
26450
  this.validRuleErr = true;
26746
26451
  errorRules.push(new Rule(rule));
26747
26452
  }
@@ -29031,16 +28736,14 @@ function renderBody(h, $xeTable) {
29031
28736
  if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
29032
28737
  initTpImg();
29033
28738
  }
29034
- if (true) {
29035
- const {
29036
- $listeners
29037
- } = this;
29038
- if (!this.menuConfig && ($listeners['menu-click'] || $listeners['cell-menu'] || $listeners['header-cell-menu'] || $listeners['footer-cell-menu'])) {
29039
- warnLog('vxe.error.reqProp', ['menu-config']);
29040
- }
29041
- if (!this.tooltipConfig && ($listeners['cell-mouseenter'] || $listeners['cell-mouseleave'])) {
29042
- warnLog('vxe.error.reqProp', ['tooltip-config']);
29043
- }
28739
+ const {
28740
+ $listeners
28741
+ } = this;
28742
+ if (!this.menuConfig && ($listeners['menu-click'] || $listeners['cell-menu'] || $listeners['header-cell-menu'] || $listeners['footer-cell-menu'])) {
28743
+ warnLog('vxe.error.reqProp', ['menu-config']);
28744
+ }
28745
+ if (!this.tooltipConfig && ($listeners['cell-mouseenter'] || $listeners['cell-mouseleave'])) {
28746
+ warnLog('vxe.error.reqProp', ['tooltip-config']);
29044
28747
  }
29045
28748
  // 使用已安装的组件,如果未安装则不渲染
29046
28749
  const VxeUILoadingComponent = core_.VxeUI.getComponent('VxeLoading');
@@ -30313,13 +30016,11 @@ function getToolbarSlots(_vm) {
30313
30016
  let buttonsSlot;
30314
30017
  let toolsSlot;
30315
30018
  const slots = {};
30316
- if (true) {
30317
- if ($scopedSlots.buttons && (!toolbarOptSlots || toolbarOptSlots.buttons !== 'buttons')) {
30318
- warnLog('vxe.error.reqProp', ['toolbar-config.slots.buttons']);
30319
- }
30320
- if ($scopedSlots.tools && (!toolbarOptSlots || toolbarOptSlots.tools !== 'tools')) {
30321
- warnLog('vxe.error.reqProp', ['toolbar-config.slots.tools']);
30322
- }
30019
+ if ($scopedSlots.buttons && (!toolbarOptSlots || toolbarOptSlots.buttons !== 'buttons')) {
30020
+ warnLog('vxe.error.reqProp', ['toolbar-config.slots.buttons']);
30021
+ }
30022
+ if ($scopedSlots.tools && (!toolbarOptSlots || toolbarOptSlots.tools !== 'tools')) {
30023
+ warnLog('vxe.error.reqProp', ['toolbar-config.slots.tools']);
30323
30024
  }
30324
30025
  if (toolbarOptSlots) {
30325
30026
  buttonsSlot = getFuncSlot(_vm, toolbarOptSlots, 'buttons');
@@ -30823,17 +30524,15 @@ Object.keys(table.methods).forEach(name => {
30823
30524
  // if (proxyConfig && (data || (proxyOpts.form && formOpts.data))) {
30824
30525
  // errLog('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config'])
30825
30526
  // }
30826
- if (true) {
30827
- if (this.toolbar) {
30828
- warnLog('vxe.error.delProp', ['grid.toolbar', 'grid.toolbar-config']);
30829
- }
30830
- if (this.toolbarConfig && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isObject(this.toolbarConfig)) {
30831
- warnLog('vxe.error.errProp', [`grid.toolbar-config=${this.toolbarConfig}`, 'grid.toolbar-config={}']);
30832
- }
30833
- // if (proxyOpts.props) {
30834
- // warnLog('vxe.error.delProp', ['proxy-config.props', 'proxy-config.response'])
30835
- // }
30527
+ if (this.toolbar) {
30528
+ warnLog('vxe.error.delProp', ['grid.toolbar', 'grid.toolbar-config']);
30529
+ }
30530
+ if (this.toolbarConfig && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isObject(this.toolbarConfig)) {
30531
+ warnLog('vxe.error.errProp', [`grid.toolbar-config=${this.toolbarConfig}`, 'grid.toolbar-config={}']);
30836
30532
  }
30533
+ // if (proxyOpts.props) {
30534
+ // warnLog('vxe.error.delProp', ['proxy-config.props', 'proxy-config.response'])
30535
+ // }
30837
30536
  // 使用已安装的组件,如果未安装则不渲染
30838
30537
  const VxeUIFormComponent = core_.VxeUI.getComponent('VxeForm');
30839
30538
  const VxeUIPagerComponent = core_.VxeUI.getComponent('VxePager');
@@ -31723,12 +31422,12 @@ Object.keys(table.methods).forEach(name => {
31723
31422
  });
31724
31423
  },
31725
31424
  getProxyInfo() {
31425
+ const $xeGrid = this;
31426
+ const $xeTable = $xeGrid.$refs.xTable;
31726
31427
  const {
31727
- $refs,
31728
31428
  sortData,
31729
31429
  proxyConfig
31730
31430
  } = this;
31731
- const $xeTable = $refs.xTable;
31732
31431
  if (proxyConfig) {
31733
31432
  return {
31734
31433
  data: $xeTable ? $xeTable.getFullData() : [],
@@ -31742,30 +31441,30 @@ Object.keys(table.methods).forEach(name => {
31742
31441
  }
31743
31442
  return null;
31744
31443
  },
31745
- // 检查插槽
31746
- ...( true ? {
31747
- loadColumn(columns) {
31748
- const {
31749
- $scopedSlots
31750
- } = this;
31751
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(columns, column => {
31752
- if (column.slots) {
31753
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(column.slots, func => {
31754
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(func)) {
31755
- if (!$scopedSlots[func]) {
31756
- errLog('vxe.error.notSlot', [func]);
31757
- }
31444
+ loadColumn(columns) {
31445
+ const $xeGrid = this;
31446
+ const $xeTable = $xeGrid.$refs.xTable;
31447
+ const {
31448
+ $scopedSlots
31449
+ } = this;
31450
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(columns, column => {
31451
+ if (column.slots) {
31452
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(column.slots, func => {
31453
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(func)) {
31454
+ if (!$scopedSlots[func]) {
31455
+ errLog('vxe.error.notSlot', [func]);
31758
31456
  }
31759
- });
31760
- }
31761
- });
31762
- return this.$refs.xTable.loadColumn(columns);
31763
- },
31764
- reloadColumn(columns) {
31765
- this.clearAll();
31766
- return this.loadColumn(columns);
31767
- }
31768
- } : 0)
31457
+ }
31458
+ });
31459
+ }
31460
+ });
31461
+ return $xeTable.loadColumn(columns);
31462
+ },
31463
+ reloadColumn(columns) {
31464
+ const $xeGrid = this;
31465
+ $xeGrid.clearAll();
31466
+ return $xeGrid.loadColumn(columns);
31467
+ }
31769
31468
  }
31770
31469
  });
31771
31470
  ;// CONCATENATED MODULE: ./packages/grid/index.ts