@tmagic/table 1.5.12 → 1.5.14

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.
@@ -1,4 +1,4 @@
1
- import { defineComponent, openBlock, createBlock, unref, withCtx, createElementBlock, Fragment, renderList, withDirectives, createVNode, createElementVNode, vShow, createTextVNode, resolveDynamicComponent, mergeProps, toHandlers, createCommentVNode, normalizeProps, toDisplayString, resolveComponent, ref, computed, resolveDirective } from 'vue';
1
+ import { defineComponent, createBlock, openBlock, unref, withCtx, createElementBlock, withDirectives, Fragment, renderList, createVNode, createElementVNode, vShow, createTextVNode, resolveDynamicComponent, mergeProps, toHandlers, createCommentVNode, normalizeProps, toDisplayString, resolveComponent, ref, computed, resolveDirective } from 'vue';
2
2
  import { cloneDeep } from 'lodash-es';
3
3
  import { TMagicTableColumn, TMagicTooltip, TMagicButton, tMagicMessage, TMagicPopover, TMagicForm, TMagicTag, getDesignConfig, TMagicTable } from '@tmagic/design';
4
4
  import { MForm, datetimeFormatter } from '@tmagic/form';
@@ -54,13 +54,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
54
54
  if (res) {
55
55
  if (res.ret === 0) {
56
56
  tMagicMessage.success("保存成功");
57
- props.editState[index] = undefined;
57
+ props.editState[index] = void 0;
58
58
  emit("after-action");
59
59
  } else {
60
60
  tMagicMessage.error(res.msg || "保存失败");
61
61
  }
62
62
  } else {
63
- props.editState[index] = undefined;
63
+ props.editState[index] = void 0;
64
64
  emit("after-action");
65
65
  }
66
66
  };
@@ -128,7 +128,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
128
128
  link: "",
129
129
  type: "primary",
130
130
  size: "small",
131
- onClick: ($event) => _ctx.editState[scope.$index] = undefined
131
+ onClick: ($event) => _ctx.editState[scope.$index] = void 0
132
132
  }, {
133
133
  default: withCtx(() => _cache[1] || (_cache[1] = [
134
134
  createTextVNode("取消")
@@ -265,6 +265,7 @@ const formatter = (item, row, data) => {
265
265
  try {
266
266
  return item.formatter(row[item.prop], row, data);
267
267
  } catch (e) {
268
+ console.error("Formatter error:", e);
268
269
  return row[item.prop];
269
270
  }
270
271
  } else {
@@ -17,17 +17,17 @@
17
17
  var Symbol$1 = root.Symbol;
18
18
 
19
19
  /** Used for built-in method references. */
20
- var objectProto$c = Object.prototype;
20
+ var objectProto$b = Object.prototype;
21
21
 
22
22
  /** Used to check objects for own properties. */
23
- var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
23
+ var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
24
24
 
25
25
  /**
26
26
  * Used to resolve the
27
27
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
28
28
  * of values.
29
29
  */
30
- var nativeObjectToString$1 = objectProto$c.toString;
30
+ var nativeObjectToString$1 = objectProto$b.toString;
31
31
 
32
32
  /** Built-in value references. */
33
33
  var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
@@ -40,7 +40,7 @@
40
40
  * @returns {string} Returns the raw `toStringTag`.
41
41
  */
42
42
  function getRawTag(value) {
43
- var isOwn = hasOwnProperty$9.call(value, symToStringTag$1),
43
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
44
44
  tag = value[symToStringTag$1];
45
45
 
46
46
  try {
@@ -60,14 +60,14 @@
60
60
  }
61
61
 
62
62
  /** Used for built-in method references. */
63
- var objectProto$b = Object.prototype;
63
+ var objectProto$a = Object.prototype;
64
64
 
65
65
  /**
66
66
  * Used to resolve the
67
67
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
68
68
  * of values.
69
69
  */
70
- var nativeObjectToString = objectProto$b.toString;
70
+ var nativeObjectToString = objectProto$a.toString;
71
71
 
72
72
  /**
73
73
  * Converts `value` to a string using `Object.prototype.toString`.
@@ -275,17 +275,17 @@
275
275
 
276
276
  /** Used for built-in method references. */
277
277
  var funcProto = Function.prototype,
278
- objectProto$a = Object.prototype;
278
+ objectProto$9 = Object.prototype;
279
279
 
280
280
  /** Used to resolve the decompiled source of functions. */
281
281
  var funcToString = funcProto.toString;
282
282
 
283
283
  /** Used to check objects for own properties. */
284
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
284
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
285
285
 
286
286
  /** Used to detect if a method is native. */
287
287
  var reIsNative = RegExp('^' +
288
- funcToString.call(hasOwnProperty$8).replace(reRegExpChar, '\\$&')
288
+ funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
289
289
  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
290
290
  );
291
291
 
@@ -360,25 +360,6 @@
360
360
  };
361
361
  }());
362
362
 
363
- /**
364
- * Copies the values of `source` to `array`.
365
- *
366
- * @private
367
- * @param {Array} source The array to copy values from.
368
- * @param {Array} [array=[]] The array to copy values to.
369
- * @returns {Array} Returns `array`.
370
- */
371
- function copyArray(source, array) {
372
- var index = -1,
373
- length = source.length;
374
-
375
- array || (array = Array(length));
376
- while (++index < length) {
377
- array[index] = source[index];
378
- }
379
- return array;
380
- }
381
-
382
363
  var defineProperty = (function() {
383
364
  try {
384
365
  var func = getNative(Object, 'defineProperty');
@@ -491,10 +472,10 @@
491
472
  }
492
473
 
493
474
  /** Used for built-in method references. */
494
- var objectProto$9 = Object.prototype;
475
+ var objectProto$8 = Object.prototype;
495
476
 
496
477
  /** Used to check objects for own properties. */
497
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
478
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
498
479
 
499
480
  /**
500
481
  * Assigns `value` to `key` of `object` if the existing value is not equivalent
@@ -508,46 +489,12 @@
508
489
  */
509
490
  function assignValue(object, key, value) {
510
491
  var objValue = object[key];
511
- if (!(hasOwnProperty$7.call(object, key) && eq(objValue, value)) ||
492
+ if (!(hasOwnProperty$6.call(object, key) && eq(objValue, value)) ||
512
493
  (value === undefined && !(key in object))) {
513
494
  baseAssignValue(object, key, value);
514
495
  }
515
496
  }
516
497
 
517
- /**
518
- * Copies properties of `source` to `object`.
519
- *
520
- * @private
521
- * @param {Object} source The object to copy properties from.
522
- * @param {Array} props The property identifiers to copy.
523
- * @param {Object} [object={}] The object to copy properties to.
524
- * @param {Function} [customizer] The function to customize copied values.
525
- * @returns {Object} Returns `object`.
526
- */
527
- function copyObject(source, props, object, customizer) {
528
- var isNew = !object;
529
- object || (object = {});
530
-
531
- var index = -1,
532
- length = props.length;
533
-
534
- while (++index < length) {
535
- var key = props[index];
536
-
537
- var newValue = undefined;
538
-
539
- if (newValue === undefined) {
540
- newValue = source[key];
541
- }
542
- if (isNew) {
543
- baseAssignValue(object, key, newValue);
544
- } else {
545
- assignValue(object, key, newValue);
546
- }
547
- }
548
- return object;
549
- }
550
-
551
498
  /** Used as references for various `Number` constants. */
552
499
  var MAX_SAFE_INTEGER = 9007199254740991;
553
500
 
@@ -612,7 +559,7 @@
612
559
  }
613
560
 
614
561
  /** Used for built-in method references. */
615
- var objectProto$8 = Object.prototype;
562
+ var objectProto$7 = Object.prototype;
616
563
 
617
564
  /**
618
565
  * Checks if `value` is likely a prototype object.
@@ -623,7 +570,7 @@
623
570
  */
624
571
  function isPrototype(value) {
625
572
  var Ctor = value && value.constructor,
626
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$8;
573
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$7;
627
574
 
628
575
  return value === proto;
629
576
  }
@@ -662,13 +609,13 @@
662
609
  }
663
610
 
664
611
  /** Used for built-in method references. */
665
- var objectProto$7 = Object.prototype;
612
+ var objectProto$6 = Object.prototype;
666
613
 
667
614
  /** Used to check objects for own properties. */
668
- var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
615
+ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
669
616
 
670
617
  /** Built-in value references. */
671
- var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
618
+ var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
672
619
 
673
620
  /**
674
621
  * Checks if `value` is likely an `arguments` object.
@@ -689,7 +636,7 @@
689
636
  * // => false
690
637
  */
691
638
  var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
692
- return isObjectLike(value) && hasOwnProperty$6.call(value, 'callee') &&
639
+ return isObjectLike(value) && hasOwnProperty$5.call(value, 'callee') &&
693
640
  !propertyIsEnumerable$1.call(value, 'callee');
694
641
  };
695
642
 
@@ -862,10 +809,10 @@
862
809
  var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
863
810
 
864
811
  /** Used for built-in method references. */
865
- var objectProto$6 = Object.prototype;
812
+ var objectProto$5 = Object.prototype;
866
813
 
867
814
  /** Used to check objects for own properties. */
868
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
815
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
869
816
 
870
817
  /**
871
818
  * Creates an array of the enumerable property names of the array-like `value`.
@@ -885,7 +832,7 @@
885
832
  length = result.length;
886
833
 
887
834
  for (var key in value) {
888
- if ((inherited || hasOwnProperty$5.call(value, key)) &&
835
+ if ((hasOwnProperty$4.call(value, key)) &&
889
836
  !(skipIndexes && (
890
837
  // Safari 9 has enumerable `arguments.length` in strict mode.
891
838
  key == 'length' ||
@@ -920,10 +867,10 @@
920
867
  var nativeKeys = overArg(Object.keys, Object);
921
868
 
922
869
  /** Used for built-in method references. */
923
- var objectProto$5 = Object.prototype;
870
+ var objectProto$4 = Object.prototype;
924
871
 
925
872
  /** Used to check objects for own properties. */
926
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
873
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
927
874
 
928
875
  /**
929
876
  * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
@@ -938,7 +885,7 @@
938
885
  }
939
886
  var result = [];
940
887
  for (var key in Object(object)) {
941
- if (hasOwnProperty$4.call(object, key) && key != 'constructor') {
888
+ if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
942
889
  result.push(key);
943
890
  }
944
891
  }
@@ -977,80 +924,6 @@
977
924
  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
978
925
  }
979
926
 
980
- /**
981
- * This function is like
982
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
983
- * except that it includes inherited enumerable properties.
984
- *
985
- * @private
986
- * @param {Object} object The object to query.
987
- * @returns {Array} Returns the array of property names.
988
- */
989
- function nativeKeysIn(object) {
990
- var result = [];
991
- if (object != null) {
992
- for (var key in Object(object)) {
993
- result.push(key);
994
- }
995
- }
996
- return result;
997
- }
998
-
999
- /** Used for built-in method references. */
1000
- var objectProto$4 = Object.prototype;
1001
-
1002
- /** Used to check objects for own properties. */
1003
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1004
-
1005
- /**
1006
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
1007
- *
1008
- * @private
1009
- * @param {Object} object The object to query.
1010
- * @returns {Array} Returns the array of property names.
1011
- */
1012
- function baseKeysIn(object) {
1013
- if (!isObject(object)) {
1014
- return nativeKeysIn(object);
1015
- }
1016
- var isProto = isPrototype(object),
1017
- result = [];
1018
-
1019
- for (var key in object) {
1020
- if (!(key == 'constructor' && (isProto || !hasOwnProperty$3.call(object, key)))) {
1021
- result.push(key);
1022
- }
1023
- }
1024
- return result;
1025
- }
1026
-
1027
- /**
1028
- * Creates an array of the own and inherited enumerable property names of `object`.
1029
- *
1030
- * **Note:** Non-object values are coerced to objects.
1031
- *
1032
- * @static
1033
- * @memberOf _
1034
- * @since 3.0.0
1035
- * @category Object
1036
- * @param {Object} object The object to query.
1037
- * @returns {Array} Returns the array of property names.
1038
- * @example
1039
- *
1040
- * function Foo() {
1041
- * this.a = 1;
1042
- * this.b = 2;
1043
- * }
1044
- *
1045
- * Foo.prototype.c = 3;
1046
- *
1047
- * _.keysIn(new Foo);
1048
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
1049
- */
1050
- function keysIn(object) {
1051
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
1052
- }
1053
-
1054
927
  /* Built-in method references that are verified to be native. */
1055
928
  var nativeCreate = getNative(Object, 'create');
1056
929
 
@@ -1571,32 +1444,6 @@
1571
1444
  Stack.prototype.has = stackHas;
1572
1445
  Stack.prototype.set = stackSet;
1573
1446
 
1574
- /**
1575
- * The base implementation of `_.assign` without support for multiple sources
1576
- * or `customizer` functions.
1577
- *
1578
- * @private
1579
- * @param {Object} object The destination object.
1580
- * @param {Object} source The source object.
1581
- * @returns {Object} Returns `object`.
1582
- */
1583
- function baseAssign(object, source) {
1584
- return object && copyObject(source, keys(source), object);
1585
- }
1586
-
1587
- /**
1588
- * The base implementation of `_.assignIn` without support for multiple sources
1589
- * or `customizer` functions.
1590
- *
1591
- * @private
1592
- * @param {Object} object The destination object.
1593
- * @param {Object} source The source object.
1594
- * @returns {Object} Returns `object`.
1595
- */
1596
- function baseAssignIn(object, source) {
1597
- return object && copyObject(source, keysIn(source), object);
1598
- }
1599
-
1600
1447
  /** Detect free variable `exports`. */
1601
1448
  var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
1602
1449
 
@@ -1607,8 +1454,8 @@
1607
1454
  var moduleExports = freeModule && freeModule.exports === freeExports;
1608
1455
 
1609
1456
  /** Built-in value references. */
1610
- var Buffer = moduleExports ? root.Buffer : undefined,
1611
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
1457
+ var Buffer = moduleExports ? root.Buffer : undefined;
1458
+ Buffer ? Buffer.allocUnsafe : undefined;
1612
1459
 
1613
1460
  /**
1614
1461
  * Creates a clone of `buffer`.
@@ -1619,14 +1466,9 @@
1619
1466
  * @returns {Buffer} Returns the cloned buffer.
1620
1467
  */
1621
1468
  function cloneBuffer(buffer, isDeep) {
1622
- if (isDeep) {
1469
+ {
1623
1470
  return buffer.slice();
1624
1471
  }
1625
- var length = buffer.length,
1626
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1627
-
1628
- buffer.copy(result);
1629
- return result;
1630
1472
  }
1631
1473
 
1632
1474
  /**
@@ -1682,7 +1524,7 @@
1682
1524
  var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
1683
1525
 
1684
1526
  /* Built-in method references for those with the same name as other `lodash` methods. */
1685
- var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
1527
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
1686
1528
 
1687
1529
  /**
1688
1530
  * Creates an array of the own enumerable symbols of `object`.
@@ -1691,59 +1533,16 @@
1691
1533
  * @param {Object} object The object to query.
1692
1534
  * @returns {Array} Returns the array of symbols.
1693
1535
  */
1694
- var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) {
1536
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1695
1537
  if (object == null) {
1696
1538
  return [];
1697
1539
  }
1698
1540
  object = Object(object);
1699
- return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
1541
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
1700
1542
  return propertyIsEnumerable.call(object, symbol);
1701
1543
  });
1702
1544
  };
1703
1545
 
1704
- /**
1705
- * Copies own symbols of `source` to `object`.
1706
- *
1707
- * @private
1708
- * @param {Object} source The object to copy symbols from.
1709
- * @param {Object} [object={}] The object to copy symbols to.
1710
- * @returns {Object} Returns `object`.
1711
- */
1712
- function copySymbols(source, object) {
1713
- return copyObject(source, getSymbols(source), object);
1714
- }
1715
-
1716
- /* Built-in method references for those with the same name as other `lodash` methods. */
1717
- var nativeGetSymbols = Object.getOwnPropertySymbols;
1718
-
1719
- /**
1720
- * Creates an array of the own and inherited enumerable symbols of `object`.
1721
- *
1722
- * @private
1723
- * @param {Object} object The object to query.
1724
- * @returns {Array} Returns the array of symbols.
1725
- */
1726
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
1727
- var result = [];
1728
- while (object) {
1729
- arrayPush(result, getSymbols(object));
1730
- object = getPrototype(object);
1731
- }
1732
- return result;
1733
- };
1734
-
1735
- /**
1736
- * Copies own and inherited symbols of `source` to `object`.
1737
- *
1738
- * @private
1739
- * @param {Object} source The object to copy symbols from.
1740
- * @param {Object} [object={}] The object to copy symbols to.
1741
- * @returns {Object} Returns `object`.
1742
- */
1743
- function copySymbolsIn(source, object) {
1744
- return copyObject(source, getSymbolsIn(source), object);
1745
- }
1746
-
1747
1546
  /**
1748
1547
  * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1749
1548
  * `keysFunc` and `symbolsFunc` to get the enumerable property names and
@@ -1771,18 +1570,6 @@
1771
1570
  return baseGetAllKeys(object, keys, getSymbols);
1772
1571
  }
1773
1572
 
1774
- /**
1775
- * Creates an array of own and inherited enumerable property names and
1776
- * symbols of `object`.
1777
- *
1778
- * @private
1779
- * @param {Object} object The object to query.
1780
- * @returns {Array} Returns the array of property names and symbols.
1781
- */
1782
- function getAllKeysIn(object) {
1783
- return baseGetAllKeys(object, keysIn, getSymbolsIn);
1784
- }
1785
-
1786
1573
  /* Built-in method references that are verified to be native. */
1787
1574
  var DataView = getNative(root, 'DataView');
1788
1575
 
@@ -1891,7 +1678,7 @@
1891
1678
  * @returns {Object} Returns the cloned data view.
1892
1679
  */
1893
1680
  function cloneDataView(dataView, isDeep) {
1894
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
1681
+ var buffer = cloneArrayBuffer(dataView.buffer) ;
1895
1682
  return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
1896
1683
  }
1897
1684
 
@@ -1935,7 +1722,7 @@
1935
1722
  * @returns {Object} Returns the cloned typed array.
1936
1723
  */
1937
1724
  function cloneTypedArray(typedArray, isDeep) {
1938
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
1725
+ var buffer = cloneArrayBuffer(typedArray.buffer) ;
1939
1726
  return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1940
1727
  }
1941
1728
 
@@ -1984,12 +1771,12 @@
1984
1771
  return new Ctor(+object);
1985
1772
 
1986
1773
  case dataViewTag$1:
1987
- return cloneDataView(object, isDeep);
1774
+ return cloneDataView(object);
1988
1775
 
1989
1776
  case float32Tag$1: case float64Tag$1:
1990
1777
  case int8Tag$1: case int16Tag$1: case int32Tag$1:
1991
1778
  case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
1992
- return cloneTypedArray(object, isDeep);
1779
+ return cloneTypedArray(object);
1993
1780
 
1994
1781
  case mapTag$2:
1995
1782
  return new Ctor;
@@ -2094,11 +1881,6 @@
2094
1881
  */
2095
1882
  var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
2096
1883
 
2097
- /** Used to compose bitmasks for cloning. */
2098
- var CLONE_DEEP_FLAG$1 = 1,
2099
- CLONE_FLAT_FLAG = 2,
2100
- CLONE_SYMBOLS_FLAG$1 = 4;
2101
-
2102
1884
  /** `Object#toString` result references. */
2103
1885
  var argsTag = '[object Arguments]',
2104
1886
  arrayTag = '[object Array]',
@@ -2161,10 +1943,7 @@
2161
1943
  * @returns {*} Returns the cloned value.
2162
1944
  */
2163
1945
  function baseClone(value, bitmask, customizer, key, object, stack) {
2164
- var result,
2165
- isDeep = bitmask & CLONE_DEEP_FLAG$1,
2166
- isFlat = bitmask & CLONE_FLAT_FLAG,
2167
- isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
1946
+ var result;
2168
1947
  if (result !== undefined) {
2169
1948
  return result;
2170
1949
  }
@@ -2174,28 +1953,20 @@
2174
1953
  var isArr = isArray(value);
2175
1954
  if (isArr) {
2176
1955
  result = initCloneArray(value);
2177
- if (!isDeep) {
2178
- return copyArray(value, result);
2179
- }
2180
1956
  } else {
2181
1957
  var tag = getTag(value),
2182
1958
  isFunc = tag == funcTag || tag == genTag;
2183
1959
 
2184
1960
  if (isBuffer(value)) {
2185
- return cloneBuffer(value, isDeep);
1961
+ return cloneBuffer(value);
2186
1962
  }
2187
1963
  if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2188
- result = (isFlat || isFunc) ? {} : initCloneObject(value);
2189
- if (!isDeep) {
2190
- return isFlat
2191
- ? copySymbolsIn(value, baseAssignIn(result, value))
2192
- : copySymbols(value, baseAssign(result, value));
2193
- }
1964
+ result = (isFunc) ? {} : initCloneObject(value);
2194
1965
  } else {
2195
1966
  if (!cloneableTags[tag]) {
2196
1967
  return object ? value : {};
2197
1968
  }
2198
- result = initCloneByTag(value, tag, isDeep);
1969
+ result = initCloneByTag(value, tag);
2199
1970
  }
2200
1971
  }
2201
1972
  // Check for circular references and return its corresponding clone.
@@ -2216,9 +1987,8 @@
2216
1987
  });
2217
1988
  }
2218
1989
 
2219
- var keysFunc = isFull
2220
- ? (isFlat ? getAllKeysIn : getAllKeys)
2221
- : (isFlat ? keysIn : keys);
1990
+ var keysFunc = (getAllKeys)
1991
+ ;
2222
1992
 
2223
1993
  var props = isArr ? undefined : keysFunc(value);
2224
1994
  arrayEach(props || value, function(subValue, key) {
@@ -2309,13 +2079,13 @@
2309
2079
  if (res) {
2310
2080
  if (res.ret === 0) {
2311
2081
  design.tMagicMessage.success("保存成功");
2312
- props.editState[index] = undefined;
2082
+ props.editState[index] = void 0;
2313
2083
  emit("after-action");
2314
2084
  } else {
2315
2085
  design.tMagicMessage.error(res.msg || "保存失败");
2316
2086
  }
2317
2087
  } else {
2318
- props.editState[index] = undefined;
2088
+ props.editState[index] = void 0;
2319
2089
  emit("after-action");
2320
2090
  }
2321
2091
  };
@@ -2383,7 +2153,7 @@
2383
2153
  link: "",
2384
2154
  type: "primary",
2385
2155
  size: "small",
2386
- onClick: ($event) => _ctx.editState[scope.$index] = undefined
2156
+ onClick: ($event) => _ctx.editState[scope.$index] = void 0
2387
2157
  }, {
2388
2158
  default: vue.withCtx(() => _cache[1] || (_cache[1] = [
2389
2159
  vue.createTextVNode("取消")
@@ -2520,6 +2290,7 @@
2520
2290
  try {
2521
2291
  return item.formatter(row[item.prop], row, data);
2522
2292
  } catch (e) {
2293
+ console.error("Formatter error:", e);
2523
2294
  return row[item.prop];
2524
2295
  }
2525
2296
  } else {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.12",
2
+ "version": "1.5.14",
3
3
  "name": "@tmagic/table",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -44,8 +44,8 @@
44
44
  "peerDependencies": {
45
45
  "vue": ">=3.5.0",
46
46
  "typescript": "*",
47
- "@tmagic/design": "1.5.12",
48
- "@tmagic/form": "1.5.12"
47
+ "@tmagic/design": "1.5.14",
48
+ "@tmagic/form": "1.5.14"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "typescript": {
package/src/Table.vue CHANGED
@@ -84,7 +84,7 @@ const props = withDefaults(
84
84
  data: any[];
85
85
  columns?: ColumnConfig[];
86
86
  /** 合并行或列的计算方法 */
87
- spanMethod?: (data: { row: any; column: any; rowIndex: number; columnIndex: number }) => [number, number];
87
+ spanMethod?: (_data: { row: any; column: any; rowIndex: number; columnIndex: number }) => [number, number];
88
88
  loading?: boolean;
89
89
  /** Table 的最大高度。合法的值为数字或者单位为 px 的高度 */
90
90
  bodyHeight?: string | number;
package/src/utils.ts CHANGED
@@ -25,12 +25,12 @@ export const formatter = (item: ColumnConfig, row: any, data: { index: number })
25
25
 
26
26
  if (item.formatter) {
27
27
  if (item.formatter === 'datetime') {
28
- // eslint-disable-next-line no-param-reassign
29
28
  item.formatter = (value: string) => datetimeFormatter(value);
30
29
  }
31
30
  try {
32
31
  return item.formatter(row[item.prop], row, data);
33
32
  } catch (e) {
33
+ console.error('Formatter error:', e);
34
34
  return row[item.prop];
35
35
  }
36
36
  } else {
package/types/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import * as vue from 'vue';
2
2
  import { App } from 'vue';
3
- import * as _vue_reactivity from '@vue/reactivity';
4
- import * as _tmagic_design from '@tmagic/design';
5
3
  import { FormConfig, FormValue } from '@tmagic/form';
6
4
 
7
5
  interface ColumnActionConfig {
@@ -67,7 +65,7 @@ type __VLS_Props = {
67
65
  data: any[];
68
66
  columns?: ColumnConfig[];
69
67
  /** 合并行或列的计算方法 */
70
- spanMethod?: (data: {
68
+ spanMethod?: (_data: {
71
69
  row: any;
72
70
  column: any;
73
71
  rowIndex: number;
@@ -112,93 +110,7 @@ declare const _default$1: vue.DefineComponent<__VLS_Props, {
112
110
  defaultExpandAll: boolean;
113
111
  columns: ColumnConfig[];
114
112
  showHeader: boolean;
115
- }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {
116
- tMagicTable: ({
117
- $: vue.ComponentInternalInstance;
118
- $data: {};
119
- $props: {
120
- readonly data?: any[] | undefined;
121
- readonly border?: boolean | undefined;
122
- readonly maxHeight?: number | string | undefined;
123
- readonly defaultExpandAll?: boolean | undefined;
124
- readonly onSelect?: ((...args: any[]) => any) | undefined;
125
- readonly "onSort-change"?: ((...args: any[]) => any) | undefined;
126
- readonly "onExpand-change"?: ((...args: any[]) => any) | undefined;
127
- readonly "onCell-click"?: ((...args: any[]) => any) | undefined;
128
- } & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps;
129
- $attrs: {
130
- [x: string]: unknown;
131
- };
132
- $refs: {
133
- [x: string]: unknown;
134
- } & {
135
- table: unknown;
136
- };
137
- $slots: Readonly<{
138
- [name: string]: vue.Slot<any> | undefined;
139
- }>;
140
- $root: vue.ComponentPublicInstance | null;
141
- $parent: vue.ComponentPublicInstance | null;
142
- $host: Element | null;
143
- $emit: ((event: "select", ...args: any[]) => void) & ((event: "sort-change", ...args: any[]) => void) & ((event: "expand-change", ...args: any[]) => void) & ((event: "cell-click", ...args: any[]) => void);
144
- $el: any;
145
- $options: vue.ComponentOptionsBase<Readonly<_tmagic_design.TableProps> & Readonly<{
146
- onSelect?: ((...args: any[]) => any) | undefined;
147
- "onSort-change"?: ((...args: any[]) => any) | undefined;
148
- "onExpand-change"?: ((...args: any[]) => any) | undefined;
149
- "onCell-click"?: ((...args: any[]) => any) | undefined;
150
- }>, {
151
- instance: vue.Ref<any, any>;
152
- $el: HTMLDivElement | undefined;
153
- clearSelection(...args: any[]): any;
154
- toggleRowSelection(...args: any[]): any;
155
- toggleRowExpansion(...args: any[]): any;
156
- }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
157
- select: (...args: any[]) => void;
158
- "sort-change": (...args: any[]) => void;
159
- "expand-change": (...args: any[]) => void;
160
- "cell-click": (...args: any[]) => void;
161
- }, string, {
162
- data: any[];
163
- }, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & {
164
- beforeCreate?: (() => void) | (() => void)[];
165
- created?: (() => void) | (() => void)[];
166
- beforeMount?: (() => void) | (() => void)[];
167
- mounted?: (() => void) | (() => void)[];
168
- beforeUpdate?: (() => void) | (() => void)[];
169
- updated?: (() => void) | (() => void)[];
170
- activated?: (() => void) | (() => void)[];
171
- deactivated?: (() => void) | (() => void)[];
172
- beforeDestroy?: (() => void) | (() => void)[];
173
- beforeUnmount?: (() => void) | (() => void)[];
174
- destroyed?: (() => void) | (() => void)[];
175
- unmounted?: (() => void) | (() => void)[];
176
- renderTracked?: ((e: vue.DebuggerEvent) => void) | ((e: vue.DebuggerEvent) => void)[];
177
- renderTriggered?: ((e: vue.DebuggerEvent) => void) | ((e: vue.DebuggerEvent) => void)[];
178
- errorCaptured?: ((err: unknown, instance: vue.ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: vue.ComponentPublicInstance | null, info: string) => boolean | void)[];
179
- };
180
- $forceUpdate: () => void;
181
- $nextTick: typeof vue.nextTick;
182
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, _vue_reactivity.OnCleanup]) => any : (...args: [any, any, _vue_reactivity.OnCleanup]) => any, options?: vue.WatchOptions): vue.WatchStopHandle;
183
- } & Readonly<{
184
- data: any[];
185
- }> & Omit<Readonly<_tmagic_design.TableProps> & Readonly<{
186
- onSelect?: ((...args: any[]) => any) | undefined;
187
- "onSort-change"?: ((...args: any[]) => any) | undefined;
188
- "onExpand-change"?: ((...args: any[]) => any) | undefined;
189
- "onCell-click"?: ((...args: any[]) => any) | undefined;
190
- }>, "instance" | "data" | "$el" | "clearSelection" | "toggleRowSelection" | "toggleRowExpansion"> & vue.ShallowUnwrapRef<{
191
- instance: vue.Ref<any, any>;
192
- $el: HTMLDivElement | undefined;
193
- clearSelection(...args: any[]): any;
194
- toggleRowSelection(...args: any[]): any;
195
- toggleRowExpansion(...args: any[]): any;
196
- }> & {} & vue.ComponentCustomProperties & {} & {
197
- $slots: {
198
- default?(_: {}): any;
199
- };
200
- }) | null;
201
- }, any>;
113
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
202
114
 
203
115
  declare const formatter: (item: ColumnConfig, row: any, data: {
204
116
  index: number;
@@ -209,4 +121,5 @@ declare const _default: {
209
121
  install(app: App): void;
210
122
  };
211
123
 
212
- export { type ColumnActionConfig, type ColumnConfig, _default$1 as MagicTable, createColumns, _default as default, formatter };
124
+ export { _default$1 as MagicTable, createColumns, _default as default, formatter };
125
+ export type { ColumnActionConfig, ColumnConfig };