vxe-table 3.15.29 → 3.15.30

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 +65 -139
  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 +248 -556
  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 +78 -168
  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 +96 -158
  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.1747357311626.ttf} +0 -0
  41. /package/es/{iconfont.1747286367921.woff → iconfont.1747357311626.woff} +0 -0
  42. /package/es/{iconfont.1747286367921.woff2 → iconfont.1747357311626.woff2} +0 -0
  43. /package/lib/{iconfont.1747286367921.ttf → iconfont.1747357311626.ttf} +0 -0
  44. /package/lib/{iconfont.1747286367921.woff → iconfont.1747357311626.woff} +0 -0
  45. /package/lib/{iconfont.1747286367921.woff2 → iconfont.1747357311626.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.30";
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.30"}`;
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;
@@ -25242,7 +24867,7 @@ const convertToRows = originColumns => {
25242
24867
  mode = selectRecords.length ? 'selected' : 'current';
25243
24868
  }
25244
24869
  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;
24870
+ const isColGroup = column.children && column.children.length > 0;
25246
24871
  let isChecked = false;
25247
24872
  if (columns && columns.length) {
25248
24873
  isChecked = handleFilterColumns(opts, column, columns);
@@ -25263,7 +24888,7 @@ const convertToRows = originColumns => {
25263
24888
  });
25264
24889
  // 如果设置源数据,则默认导出设置了字段的列
25265
24890
  if (!customCols && !columnFilterMethod) {
25266
- handleOptions.columnFilterMethod = ({
24891
+ columnFilterMethod = ({
25267
24892
  column
25268
24893
  }) => {
25269
24894
  if (excludeFields) {
@@ -25277,8 +24902,9 @@ const convertToRows = originColumns => {
25277
24902
  }
25278
24903
  return false;
25279
24904
  }
25280
- return original ? column.field : defaultFilterExportColumn(column);
24905
+ return original ? !!column.field : defaultFilterExportColumn(column);
25281
24906
  };
24907
+ handleOptions.columnFilterMethod = columnFilterMethod;
25282
24908
  }
25283
24909
  if (customCols) {
25284
24910
  handleOptions._isCustomColumn = true;
@@ -25309,6 +24935,7 @@ const convertToRows = originColumns => {
25309
24935
  children: 'childNodes',
25310
24936
  mapChildren: '_children'
25311
24937
  }), (column, index) => isColumnInfo(column) && (!columnFilterMethod || columnFilterMethod({
24938
+ $table: $xeTable,
25312
24939
  column: column,
25313
24940
  $columnIndex: index
25314
24941
  })), {
@@ -25318,6 +24945,7 @@ const convertToRows = originColumns => {
25318
24945
  });
25319
24946
  } else {
25320
24947
  groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({
24948
+ $table: $xeTable,
25321
24949
  column,
25322
24950
  $columnIndex: index
25323
24951
  })), {
@@ -25370,10 +24998,8 @@ const convertToRows = originColumns => {
25370
24998
  // 检查类型,如果为自定义导出,则不需要校验类型
25371
24999
  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
25000
  errLog('vxe.error.notType', [type]);
25373
- if (true) {
25374
- if (['xlsx', 'pdf'].includes(type)) {
25375
- warnLog('vxe.error.reqPlugin', [4, 'plugin-export-xlsx']);
25376
- }
25001
+ if (['xlsx', 'pdf'].includes(type)) {
25002
+ warnLog('vxe.error.reqPlugin', [4, 'plugin-export-xlsx']);
25377
25003
  }
25378
25004
  const params = {
25379
25005
  status: false
@@ -25400,10 +25026,8 @@ const convertToRows = originColumns => {
25400
25026
  handleOptions.data = selectRecords;
25401
25027
  }
25402
25028
  } else if (mode === 'all') {
25403
- if (true) {
25404
- if (!$xeGrid) {
25405
- warnLog('vxe.error.errProp', ['all', 'mode=current,selected']);
25406
- }
25029
+ if (!$xeGrid) {
25030
+ errLog('vxe.error.errProp', ['all', 'mode=current,selected']);
25407
25031
  }
25408
25032
  if ($xeGrid && !handleOptions.remote) {
25409
25033
  const gridReactData = $xeGrid;
@@ -25420,10 +25044,8 @@ const convertToRows = originColumns => {
25420
25044
  const ajaxMethods = ajax.queryAll;
25421
25045
  const queryAllSuccessMethods = ajax.queryAllSuccess;
25422
25046
  const queryAllErrorMethods = ajax.queryAllError;
25423
- if (true) {
25424
- if (!ajaxMethods) {
25425
- warnLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll']);
25426
- }
25047
+ if (!ajaxMethods) {
25048
+ errLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll']);
25427
25049
  }
25428
25050
  if (ajaxMethods) {
25429
25051
  const params = {
@@ -25468,6 +25090,7 @@ const convertToRows = originColumns => {
25468
25090
  return handleExport($xeTable, handleOptions);
25469
25091
  },
25470
25092
  _importByFile(file, options) {
25093
+ const $xeTable = this;
25471
25094
  const opts = Object.assign({}, options);
25472
25095
  const {
25473
25096
  beforeImportMethod
@@ -25475,12 +25098,13 @@ const convertToRows = originColumns => {
25475
25098
  if (beforeImportMethod) {
25476
25099
  beforeImportMethod({
25477
25100
  options: opts,
25478
- $table: this
25101
+ $table: $xeTable
25479
25102
  });
25480
25103
  }
25481
- return handleFileImport(this, file, opts);
25104
+ return handleFileImport($xeTable, file, opts);
25482
25105
  },
25483
25106
  _importData(options) {
25107
+ const $xeTable = this;
25484
25108
  const {
25485
25109
  importOpts
25486
25110
  } = this;
@@ -25499,12 +25123,12 @@ const convertToRows = originColumns => {
25499
25123
  $table: this
25500
25124
  });
25501
25125
  }
25502
- return readLocalFile(opts).catch(e => {
25126
+ return core_.VxeUI.readFile(opts).catch(e => {
25503
25127
  if (afterImportMethod) {
25504
25128
  afterImportMethod({
25505
25129
  status: false,
25506
25130
  options: opts,
25507
- $table: this
25131
+ $table: $xeTable
25508
25132
  });
25509
25133
  }
25510
25134
  return Promise.reject(e);
@@ -25512,14 +25136,14 @@ const convertToRows = originColumns => {
25512
25136
  const {
25513
25137
  file
25514
25138
  } = params;
25515
- return handleFileImport(this, file, opts);
25139
+ return handleFileImport($xeTable, file, opts);
25516
25140
  });
25517
25141
  },
25518
25142
  _saveFile(options) {
25519
- return saveLocalFile(options);
25143
+ return core_.VxeUI.saveFile(options);
25520
25144
  },
25521
25145
  _readFile(options) {
25522
- return readLocalFile(options);
25146
+ return core_.VxeUI.readFile(options);
25523
25147
  },
25524
25148
  _print(options) {
25525
25149
  const $xeTable = this;
@@ -25627,18 +25251,28 @@ const convertToRows = originColumns => {
25627
25251
  return Promise.resolve();
25628
25252
  },
25629
25253
  _openImport(options) {
25254
+ const $xeTable = this;
25255
+ const props = $xeTable;
25256
+ const reactData = $xeTable;
25630
25257
  const {
25631
- importOpts
25632
- } = this;
25258
+ treeConfig,
25259
+ importConfig
25260
+ } = props;
25261
+ const {
25262
+ initStore,
25263
+ importStore,
25264
+ importParams
25265
+ } = reactData;
25266
+ const importOpts = $xeTable.computeImportOpts;
25633
25267
  const defOpts = Object.assign({
25634
25268
  mode: 'insertTop',
25635
25269
  message: true,
25636
25270
  types: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),
25637
25271
  modes: ['insertTop', 'covering']
25638
- }, options, importOpts);
25272
+ }, importOpts, options);
25639
25273
  const types = defOpts.types || [];
25640
25274
  const modes = defOpts.modes || [];
25641
- const isTree = !!this.getTreeStatus();
25275
+ const isTree = !!treeConfig;
25642
25276
  if (isTree) {
25643
25277
  if (defOpts.message) {
25644
25278
  core_.VxeUI.modal.message({
@@ -25648,7 +25282,7 @@ const convertToRows = originColumns => {
25648
25282
  }
25649
25283
  return;
25650
25284
  }
25651
- if (!this.importConfig) {
25285
+ if (!importConfig) {
25652
25286
  errLog('vxe.error.reqProp', ['import-config']);
25653
25287
  }
25654
25288
  // 处理类型
@@ -25670,7 +25304,7 @@ const convertToRows = originColumns => {
25670
25304
  label: export_mixin_getI18n(`vxe.import.modes.${item}`)
25671
25305
  };
25672
25306
  });
25673
- Object.assign(this.importStore, {
25307
+ Object.assign(importStore, {
25674
25308
  file: null,
25675
25309
  type: '',
25676
25310
  filename: '',
@@ -25678,31 +25312,38 @@ const convertToRows = originColumns => {
25678
25312
  typeList,
25679
25313
  visible: true
25680
25314
  });
25681
- Object.assign(this.importParams, defOpts);
25682
- if (!modeList.some(item => item.value === this.importParams.mode)) {
25683
- this.importParams.mode = modeList[0].value;
25315
+ Object.assign(importParams, defOpts);
25316
+ if (!modeList.some(item => item.value === importParams.mode)) {
25317
+ importParams.mode = modeList[0].value;
25684
25318
  }
25685
- this.initStore.import = true;
25319
+ initStore.import = true;
25686
25320
  },
25687
25321
  _closeExport: handleCloseExport,
25688
25322
  _openExport(options) {
25689
- const {
25690
- exportOpts
25691
- } = this;
25692
- if (!this.exportConfig) {
25323
+ const $xeTable = this;
25324
+ const props = $xeTable;
25325
+ const exportOpts = $xeTable.computeExportOpts;
25326
+ const defOpts = Object.assign({
25327
+ message: true,
25328
+ types: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps)
25329
+ }, exportOpts, options);
25330
+ if (!props.exportConfig) {
25693
25331
  errLog('vxe.error.reqProp', ['export-config']);
25694
25332
  }
25695
- return handleExportAndPrint(this, Object.assign({}, exportOpts, options));
25333
+ return handleExportAndPrint($xeTable, defOpts);
25696
25334
  },
25697
25335
  _closePrint: handleCloseExport,
25698
25336
  _openPrint(options) {
25699
- const {
25700
- printOpts
25701
- } = this;
25702
- if (!this.printConfig) {
25337
+ const $xeTable = this;
25338
+ const props = $xeTable;
25339
+ const printOpts = $xeTable.computePrintOpts;
25340
+ const defOpts = Object.assign({
25341
+ message: true
25342
+ }, printOpts, options);
25343
+ if (!props.printConfig) {
25703
25344
  errLog('vxe.error.reqProp', ['print-config']);
25704
25345
  }
25705
- return handleExportAndPrint(this, Object.assign({}, printOpts, options), true);
25346
+ return handleExportAndPrint($xeTable, defOpts, true);
25706
25347
  }
25707
25348
  }
25708
25349
  });
@@ -26364,32 +26005,107 @@ class Rule {
26364
26005
  return this.content;
26365
26006
  }
26366
26007
  }
26367
- function validErrorRuleValue(rule, val) {
26008
+ // 如果存在 pattern,判断正则
26009
+ function validREValue(pattern, val) {
26010
+ if (pattern && !(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
26011
+ return false;
26012
+ }
26013
+ return true;
26014
+ }
26015
+ // 如果存在 max,判断最大值
26016
+ function validMaxValue(max, num) {
26017
+ 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)) {
26018
+ return false;
26019
+ }
26020
+ return true;
26021
+ }
26022
+ // 如果存在 min,判断最小值
26023
+ function validMinValue(min, num) {
26024
+ 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)) {
26025
+ return false;
26026
+ }
26027
+ return true;
26028
+ }
26029
+ function validRuleValue(rule, val, required) {
26368
26030
  const {
26369
26031
  type,
26370
26032
  min,
26371
26033
  max,
26372
26034
  pattern
26373
26035
  } = rule;
26036
+ const isArrType = type === 'array';
26374
26037
  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;
26038
+ const isStrType = type === 'string';
26039
+ const strVal = `${val}`;
26040
+ if (!validREValue(pattern, strVal)) {
26041
+ return false;
26383
26042
  }
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;
26043
+ if (isArrType) {
26044
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(val)) {
26045
+ return false;
26046
+ }
26047
+ if (required) {
26048
+ if (!val.length) {
26049
+ return false;
26050
+ }
26051
+ }
26052
+ if (!validMinValue(min, val.length)) {
26053
+ return false;
26054
+ }
26055
+ if (!validMaxValue(max, val.length)) {
26056
+ return false;
26057
+ }
26058
+ } else if (isNumType) {
26059
+ const numVal = Number(val);
26060
+ if (isNaN(numVal)) {
26061
+ return false;
26062
+ }
26063
+ if (!validMinValue(min, numVal)) {
26064
+ return false;
26065
+ }
26066
+ if (!validMaxValue(max, numVal)) {
26067
+ return false;
26068
+ }
26069
+ } else {
26070
+ if (isStrType) {
26071
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val)) {
26072
+ return false;
26073
+ }
26074
+ }
26075
+ if (required) {
26076
+ if (!strVal) {
26077
+ return false;
26078
+ }
26079
+ }
26080
+ if (!validMinValue(min, strVal.length)) {
26081
+ return false;
26082
+ }
26083
+ if (!validMaxValue(max, strVal.length)) {
26084
+ return false;
26085
+ }
26387
26086
  }
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;
26087
+ return true;
26088
+ }
26089
+ function checkRuleStatus(rule, val) {
26090
+ const {
26091
+ required
26092
+ } = rule;
26093
+ const isEmptyVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(val);
26094
+ if (required) {
26095
+ if (isEmptyVal) {
26096
+ return false;
26097
+ }
26098
+ if (!validRuleValue(rule, val, required)) {
26099
+ return false;
26100
+ }
26101
+ } else {
26102
+ if (!isEmptyVal) {
26103
+ if (!validRuleValue(rule, val, required)) {
26104
+ return false;
26105
+ }
26106
+ }
26391
26107
  }
26392
- return false;
26108
+ return true;
26393
26109
  }
26394
26110
  /* harmony default export */ var validator_mixin = ({
26395
26111
  methods: {
@@ -26397,10 +26113,8 @@ function validErrorRuleValue(rule, val) {
26397
26113
  * 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
26398
26114
  */
26399
26115
  _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
- }
26116
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(cb)) {
26117
+ warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)']);
26404
26118
  }
26405
26119
  return this.beginValidate(rows, null, cb, true);
26406
26120
  },
@@ -26408,10 +26122,8 @@ function validErrorRuleValue(rule, val) {
26408
26122
  * 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
26409
26123
  */
26410
26124
  _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
- }
26125
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(cb)) {
26126
+ warnLog('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)']);
26415
26127
  }
26416
26128
  return this.beginValidate(rows, null, cb);
26417
26129
  },
@@ -26672,9 +26384,7 @@ function validErrorRuleValue(rule, val) {
26672
26384
  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
26385
  rules.forEach(rule => {
26674
26386
  const {
26675
- type,
26676
26387
  trigger,
26677
- required,
26678
26388
  validator
26679
26389
  } = rule;
26680
26390
  if (validType === 'all' || !trigger || validType === trigger) {
@@ -26698,9 +26408,7 @@ function validErrorRuleValue(rule, val) {
26698
26408
  if (tcvMethod) {
26699
26409
  customValid = tcvMethod(validParams);
26700
26410
  } else {
26701
- if (true) {
26702
- warnLog('vxe.error.notValidators', [validator]);
26703
- }
26411
+ errLog('vxe.error.notValidators', [validator]);
26704
26412
  }
26705
26413
  } else {
26706
26414
  errLog('vxe.error.notValidators', [validator]);
@@ -26731,17 +26439,7 @@ function validErrorRuleValue(rule, val) {
26731
26439
  }
26732
26440
  }
26733
26441
  } 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)) {
26442
+ if (!checkRuleStatus(rule, cellValue)) {
26745
26443
  this.validRuleErr = true;
26746
26444
  errorRules.push(new Rule(rule));
26747
26445
  }
@@ -29031,16 +28729,14 @@ function renderBody(h, $xeTable) {
29031
28729
  if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
29032
28730
  initTpImg();
29033
28731
  }
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
- }
28732
+ const {
28733
+ $listeners
28734
+ } = this;
28735
+ if (!this.menuConfig && ($listeners['menu-click'] || $listeners['cell-menu'] || $listeners['header-cell-menu'] || $listeners['footer-cell-menu'])) {
28736
+ warnLog('vxe.error.reqProp', ['menu-config']);
28737
+ }
28738
+ if (!this.tooltipConfig && ($listeners['cell-mouseenter'] || $listeners['cell-mouseleave'])) {
28739
+ warnLog('vxe.error.reqProp', ['tooltip-config']);
29044
28740
  }
29045
28741
  // 使用已安装的组件,如果未安装则不渲染
29046
28742
  const VxeUILoadingComponent = core_.VxeUI.getComponent('VxeLoading');
@@ -30313,13 +30009,11 @@ function getToolbarSlots(_vm) {
30313
30009
  let buttonsSlot;
30314
30010
  let toolsSlot;
30315
30011
  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
- }
30012
+ if ($scopedSlots.buttons && (!toolbarOptSlots || toolbarOptSlots.buttons !== 'buttons')) {
30013
+ warnLog('vxe.error.reqProp', ['toolbar-config.slots.buttons']);
30014
+ }
30015
+ if ($scopedSlots.tools && (!toolbarOptSlots || toolbarOptSlots.tools !== 'tools')) {
30016
+ warnLog('vxe.error.reqProp', ['toolbar-config.slots.tools']);
30323
30017
  }
30324
30018
  if (toolbarOptSlots) {
30325
30019
  buttonsSlot = getFuncSlot(_vm, toolbarOptSlots, 'buttons');
@@ -30823,17 +30517,15 @@ Object.keys(table.methods).forEach(name => {
30823
30517
  // if (proxyConfig && (data || (proxyOpts.form && formOpts.data))) {
30824
30518
  // errLog('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config'])
30825
30519
  // }
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
- // }
30520
+ if (this.toolbar) {
30521
+ warnLog('vxe.error.delProp', ['grid.toolbar', 'grid.toolbar-config']);
30522
+ }
30523
+ if (this.toolbarConfig && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isObject(this.toolbarConfig)) {
30524
+ warnLog('vxe.error.errProp', [`grid.toolbar-config=${this.toolbarConfig}`, 'grid.toolbar-config={}']);
30836
30525
  }
30526
+ // if (proxyOpts.props) {
30527
+ // warnLog('vxe.error.delProp', ['proxy-config.props', 'proxy-config.response'])
30528
+ // }
30837
30529
  // 使用已安装的组件,如果未安装则不渲染
30838
30530
  const VxeUIFormComponent = core_.VxeUI.getComponent('VxeForm');
30839
30531
  const VxeUIPagerComponent = core_.VxeUI.getComponent('VxePager');
@@ -31723,12 +31415,12 @@ Object.keys(table.methods).forEach(name => {
31723
31415
  });
31724
31416
  },
31725
31417
  getProxyInfo() {
31418
+ const $xeGrid = this;
31419
+ const $xeTable = $xeGrid.$refs.xTable;
31726
31420
  const {
31727
- $refs,
31728
31421
  sortData,
31729
31422
  proxyConfig
31730
31423
  } = this;
31731
- const $xeTable = $refs.xTable;
31732
31424
  if (proxyConfig) {
31733
31425
  return {
31734
31426
  data: $xeTable ? $xeTable.getFullData() : [],
@@ -31742,30 +31434,30 @@ Object.keys(table.methods).forEach(name => {
31742
31434
  }
31743
31435
  return null;
31744
31436
  },
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
- }
31437
+ loadColumn(columns) {
31438
+ const $xeGrid = this;
31439
+ const $xeTable = $xeGrid.$refs.xTable;
31440
+ const {
31441
+ $scopedSlots
31442
+ } = this;
31443
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(columns, column => {
31444
+ if (column.slots) {
31445
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(column.slots, func => {
31446
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(func)) {
31447
+ if (!$scopedSlots[func]) {
31448
+ errLog('vxe.error.notSlot', [func]);
31758
31449
  }
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)
31450
+ }
31451
+ });
31452
+ }
31453
+ });
31454
+ return $xeTable.loadColumn(columns);
31455
+ },
31456
+ reloadColumn(columns) {
31457
+ const $xeGrid = this;
31458
+ $xeGrid.clearAll();
31459
+ return $xeGrid.loadColumn(columns);
31460
+ }
31769
31461
  }
31770
31462
  });
31771
31463
  ;// CONCATENATED MODULE: ./packages/grid/index.ts