pro-design-vue 1.3.20 → 1.3.22

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 (145) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.full.js +1203 -1588
  3. package/dist/index.full.min.js +7 -9
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +7 -9
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +1204 -1589
  8. package/es/components/config-provider/src/typing.d.ts +3 -1
  9. package/es/components/table/src/components/Body/Body.vue.d.ts +270 -15
  10. package/es/components/table/src/components/Body/BodyCell.vue.d.ts +255 -0
  11. package/es/components/table/src/components/Body/BodyEditCell.d.ts +60 -0
  12. package/es/components/table/src/components/Body/BodyExtraCell.vue.d.ts +6 -1
  13. package/es/components/table/src/components/Body/BodyRow.vue.d.ts +270 -15
  14. package/es/components/table/src/components/Body/BodyRows.vue.d.ts +270 -15
  15. package/es/components/table/src/components/Body/{BodyCell.d.ts → BodyTextCell.d.ts} +1 -7
  16. package/es/components/table/src/components/ExpandIcon.vue.d.ts +3 -0
  17. package/es/components/table/src/components/InteralTable.vue.d.ts +332 -19
  18. package/es/components/table/src/components/Table.d.ts +60 -0
  19. package/es/components/table/src/components/context/TableContext.d.ts +6 -1
  20. package/es/components/table/src/components/interface.d.ts +308 -23
  21. package/es/components/table/src/hooks/useCellProps.d.ts +5 -1
  22. package/es/components/table/src/hooks/useEdit.d.ts +24 -7
  23. package/es/components/table/src/utils/form-model.d.ts +25 -0
  24. package/es/components/table/src/utils/util.d.ts +1 -0
  25. package/es/index.d.ts +291 -5
  26. package/es/packages/components/table/src/components/Body/BodyCell.vue.mjs +35 -0
  27. package/es/packages/components/table/src/components/Body/BodyCell.vue.mjs.map +1 -0
  28. package/es/packages/components/table/src/components/Body/BodyCell.vue2.mjs +129 -0
  29. package/es/packages/components/table/src/components/Body/BodyCell.vue2.mjs.map +1 -0
  30. package/es/packages/components/table/src/components/Body/BodyEditCell.mjs +256 -0
  31. package/es/packages/components/table/src/components/Body/BodyEditCell.mjs.map +1 -0
  32. package/es/packages/components/table/src/components/Body/BodyExtraCell.vue.mjs +2 -1
  33. package/es/packages/components/table/src/components/Body/BodyExtraCell.vue.mjs.map +1 -1
  34. package/es/packages/components/table/src/components/Body/BodyExtraCell.vue2.mjs +1 -0
  35. package/es/packages/components/table/src/components/Body/BodyExtraCell.vue2.mjs.map +1 -1
  36. package/es/packages/components/table/src/components/Body/BodyRow.vue.mjs +66 -9
  37. package/es/packages/components/table/src/components/Body/BodyRow.vue.mjs.map +1 -1
  38. package/es/packages/components/table/src/components/Body/BodyRow.vue2.mjs +26 -18
  39. package/es/packages/components/table/src/components/Body/BodyRow.vue2.mjs.map +1 -1
  40. package/es/packages/components/table/src/components/Body/{BodyCell.mjs → BodyTextCell.mjs} +25 -155
  41. package/es/packages/components/table/src/components/Body/BodyTextCell.mjs.map +1 -0
  42. package/es/packages/components/table/src/components/ExpandIcon.vue.mjs.map +1 -1
  43. package/es/packages/components/table/src/components/ExpandIcon.vue2.mjs +4 -2
  44. package/es/packages/components/table/src/components/ExpandIcon.vue2.mjs.map +1 -1
  45. package/es/packages/components/table/src/components/InteralTable.vue.mjs +24 -25
  46. package/es/packages/components/table/src/components/InteralTable.vue.mjs.map +1 -1
  47. package/es/packages/components/table/src/components/InteralTable.vue2.mjs +43 -97
  48. package/es/packages/components/table/src/components/InteralTable.vue2.mjs.map +1 -1
  49. package/es/packages/components/table/src/components/Table.mjs +24 -20
  50. package/es/packages/components/table/src/components/Table.mjs.map +1 -1
  51. package/es/packages/components/table/src/components/context/TableContext.mjs.map +1 -1
  52. package/es/packages/components/table/src/components/interface.mjs +28 -0
  53. package/es/packages/components/table/src/components/interface.mjs.map +1 -1
  54. package/es/packages/components/table/src/hooks/useCellProps.mjs +8 -0
  55. package/es/packages/components/table/src/hooks/useCellProps.mjs.map +1 -1
  56. package/es/packages/components/table/src/hooks/useEdit.mjs +293 -18
  57. package/es/packages/components/table/src/hooks/useEdit.mjs.map +1 -1
  58. package/es/packages/components/table/src/utils/form-model.mjs +98 -0
  59. package/es/packages/components/table/src/utils/form-model.mjs.map +1 -0
  60. package/es/packages/components/table/src/utils/util.mjs +4 -1
  61. package/es/packages/components/table/src/utils/util.mjs.map +1 -1
  62. package/es/packages/utils/dom.mjs +15 -1
  63. package/es/packages/utils/dom.mjs.map +1 -1
  64. package/es/packages/utils/index.mjs +1 -1
  65. package/es/utils/dom.d.ts +2 -0
  66. package/es/version.d.ts +1 -1
  67. package/es/version.mjs +1 -1
  68. package/es/version.mjs.map +1 -1
  69. package/lib/components/config-provider/src/typing.d.ts +3 -1
  70. package/lib/components/table/src/components/Body/Body.vue.d.ts +270 -15
  71. package/lib/components/table/src/components/Body/BodyCell.vue.d.ts +255 -0
  72. package/lib/components/table/src/components/Body/BodyEditCell.d.ts +60 -0
  73. package/lib/components/table/src/components/Body/BodyExtraCell.vue.d.ts +6 -1
  74. package/lib/components/table/src/components/Body/BodyRow.vue.d.ts +270 -15
  75. package/lib/components/table/src/components/Body/BodyRows.vue.d.ts +270 -15
  76. package/lib/components/table/src/components/Body/{BodyCell.d.ts → BodyTextCell.d.ts} +1 -7
  77. package/lib/components/table/src/components/ExpandIcon.vue.d.ts +3 -0
  78. package/lib/components/table/src/components/InteralTable.vue.d.ts +332 -19
  79. package/lib/components/table/src/components/Table.d.ts +60 -0
  80. package/lib/components/table/src/components/context/TableContext.d.ts +6 -1
  81. package/lib/components/table/src/components/interface.d.ts +308 -23
  82. package/lib/components/table/src/hooks/useCellProps.d.ts +5 -1
  83. package/lib/components/table/src/hooks/useEdit.d.ts +24 -7
  84. package/lib/components/table/src/utils/form-model.d.ts +25 -0
  85. package/lib/components/table/src/utils/util.d.ts +1 -0
  86. package/lib/index.d.ts +291 -5
  87. package/lib/packages/components/table/src/components/Body/BodyCell.vue.js +39 -0
  88. package/lib/packages/components/table/src/components/Body/BodyCell.vue.js.map +1 -0
  89. package/lib/packages/components/table/src/components/Body/BodyCell.vue2.js +133 -0
  90. package/lib/packages/components/table/src/components/Body/BodyCell.vue2.js.map +1 -0
  91. package/lib/packages/components/table/src/components/Body/BodyEditCell.js +260 -0
  92. package/lib/packages/components/table/src/components/Body/BodyEditCell.js.map +1 -0
  93. package/lib/packages/components/table/src/components/Body/BodyExtraCell.vue.js +2 -1
  94. package/lib/packages/components/table/src/components/Body/BodyExtraCell.vue.js.map +1 -1
  95. package/lib/packages/components/table/src/components/Body/BodyExtraCell.vue2.js +1 -0
  96. package/lib/packages/components/table/src/components/Body/BodyExtraCell.vue2.js.map +1 -1
  97. package/lib/packages/components/table/src/components/Body/BodyRow.vue.js +66 -9
  98. package/lib/packages/components/table/src/components/Body/BodyRow.vue.js.map +1 -1
  99. package/lib/packages/components/table/src/components/Body/BodyRow.vue2.js +24 -16
  100. package/lib/packages/components/table/src/components/Body/BodyRow.vue2.js.map +1 -1
  101. package/lib/packages/components/table/src/components/Body/{BodyCell.js → BodyTextCell.js} +24 -154
  102. package/lib/packages/components/table/src/components/Body/BodyTextCell.js.map +1 -0
  103. package/lib/packages/components/table/src/components/ExpandIcon.vue.js.map +1 -1
  104. package/lib/packages/components/table/src/components/ExpandIcon.vue2.js +4 -2
  105. package/lib/packages/components/table/src/components/ExpandIcon.vue2.js.map +1 -1
  106. package/lib/packages/components/table/src/components/InteralTable.vue.js +24 -25
  107. package/lib/packages/components/table/src/components/InteralTable.vue.js.map +1 -1
  108. package/lib/packages/components/table/src/components/InteralTable.vue2.js +43 -97
  109. package/lib/packages/components/table/src/components/InteralTable.vue2.js.map +1 -1
  110. package/lib/packages/components/table/src/components/Table.js +24 -20
  111. package/lib/packages/components/table/src/components/Table.js.map +1 -1
  112. package/lib/packages/components/table/src/components/context/TableContext.js.map +1 -1
  113. package/lib/packages/components/table/src/components/interface.js +28 -0
  114. package/lib/packages/components/table/src/components/interface.js.map +1 -1
  115. package/lib/packages/components/table/src/hooks/useCellProps.js +8 -0
  116. package/lib/packages/components/table/src/hooks/useCellProps.js.map +1 -1
  117. package/lib/packages/components/table/src/hooks/useEdit.js +292 -17
  118. package/lib/packages/components/table/src/hooks/useEdit.js.map +1 -1
  119. package/lib/packages/components/table/src/utils/form-model.js +102 -0
  120. package/lib/packages/components/table/src/utils/form-model.js.map +1 -0
  121. package/lib/packages/components/table/src/utils/util.js +4 -0
  122. package/lib/packages/components/table/src/utils/util.js.map +1 -1
  123. package/lib/packages/utils/dom.js +16 -0
  124. package/lib/packages/utils/dom.js.map +1 -1
  125. package/lib/packages/utils/index.js +2 -0
  126. package/lib/packages/utils/index.js.map +1 -1
  127. package/lib/utils/dom.d.ts +2 -0
  128. package/lib/version.d.ts +1 -1
  129. package/lib/version.js +1 -1
  130. package/lib/version.js.map +1 -1
  131. package/package.json +1 -1
  132. package/theme-chalk/index.css +1 -1
  133. package/theme-chalk/src/table/table.less +78 -25
  134. package/es/components/table/src/components/Body/EditInput.vue.d.ts +0 -102
  135. package/es/packages/components/table/src/components/Body/BodyCell.mjs.map +0 -1
  136. package/es/packages/components/table/src/components/Body/EditInput.vue.mjs +0 -48
  137. package/es/packages/components/table/src/components/Body/EditInput.vue.mjs.map +0 -1
  138. package/es/packages/components/table/src/components/Body/EditInput.vue2.mjs +0 -151
  139. package/es/packages/components/table/src/components/Body/EditInput.vue2.mjs.map +0 -1
  140. package/lib/components/table/src/components/Body/EditInput.vue.d.ts +0 -102
  141. package/lib/packages/components/table/src/components/Body/BodyCell.js.map +0 -1
  142. package/lib/packages/components/table/src/components/Body/EditInput.vue.js +0 -52
  143. package/lib/packages/components/table/src/components/Body/EditInput.vue.js.map +0 -1
  144. package/lib/packages/components/table/src/components/Body/EditInput.vue2.js +0 -155
  145. package/lib/packages/components/table/src/components/Body/EditInput.vue2.js.map +0 -1
@@ -1,4 +1,4 @@
1
- /*! Pro Design Vue v1.3.20 */
1
+ /*! Pro Design Vue v1.3.22 */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('ant-design-vue'), require('vue'), require('ant-design-vue/es/locale/zh_CN.js')) :
@@ -32,7 +32,7 @@
32
32
  const DEFAULT_NAMESPACE = "pro";
33
33
  const DEFAULT_LOCALE = "zh-CN";
34
34
 
35
- const version$1 = "1.3.20";
35
+ const version$1 = "1.3.22";
36
36
 
37
37
  const makeInstaller = (components = []) => {
38
38
  const install = (app) => {
@@ -766,7 +766,7 @@
766
766
  return newNode;
767
767
  }
768
768
 
769
- function _objectSpread$u(target) {
769
+ function _objectSpread$v(target) {
770
770
  for (var i = 1; i < arguments.length; i++) {
771
771
  var source = arguments[i] != null ? Object(arguments[i]) : {};
772
772
  var ownKeys = Object.keys(source);
@@ -776,12 +776,12 @@
776
776
  }));
777
777
  }
778
778
  ownKeys.forEach(function(key) {
779
- _defineProperty$v(target, key, source[key]);
779
+ _defineProperty$w(target, key, source[key]);
780
780
  });
781
781
  }
782
782
  return target;
783
783
  }
784
- function _defineProperty$v(obj, key, value) {
784
+ function _defineProperty$w(obj, key, value) {
785
785
  if (key in obj) {
786
786
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
787
787
  } else {
@@ -802,13 +802,13 @@
802
802
  }
803
803
  function generate(node, key, rootProps) {
804
804
  if (!rootProps) {
805
- return vue.h(node.tag, _objectSpread$u({
805
+ return vue.h(node.tag, _objectSpread$v({
806
806
  key
807
807
  }, node.attrs), (node.children || []).map(function(child, index) {
808
808
  return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
809
809
  }));
810
810
  }
811
- return vue.h(node.tag, _objectSpread$u({
811
+ return vue.h(node.tag, _objectSpread$v({
812
812
  key
813
813
  }, rootProps, node.attrs), (node.children || []).map(function(child, index) {
814
814
  return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
@@ -892,7 +892,7 @@
892
892
  }
893
893
  return target;
894
894
  }
895
- function _objectSpread$t(target) {
895
+ function _objectSpread$u(target) {
896
896
  for (var i = 1; i < arguments.length; i++) {
897
897
  var source = arguments[i] != null ? Object(arguments[i]) : {};
898
898
  var ownKeys = Object.keys(source);
@@ -902,12 +902,12 @@
902
902
  }));
903
903
  }
904
904
  ownKeys.forEach(function(key) {
905
- _defineProperty$u(target, key, source[key]);
905
+ _defineProperty$v(target, key, source[key]);
906
906
  });
907
907
  }
908
908
  return target;
909
909
  }
910
- function _defineProperty$u(obj, key, value) {
910
+ function _defineProperty$v(obj, key, value) {
911
911
  if (key in obj) {
912
912
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
913
913
  } else {
@@ -927,10 +927,10 @@
927
927
  twoToneColorPalette.calculated = !!secondaryColor;
928
928
  }
929
929
  function getTwoToneColors() {
930
- return _objectSpread$t({}, twoToneColorPalette);
930
+ return _objectSpread$u({}, twoToneColorPalette);
931
931
  }
932
932
  var IconBase = function IconBase2(props, context) {
933
- var _props$context$attrs = _objectSpread$t({}, props, context.attrs), icon = _props$context$attrs.icon, primaryColor = _props$context$attrs.primaryColor, secondaryColor = _props$context$attrs.secondaryColor, restProps = _objectWithoutProperties$2(_props$context$attrs, _excluded$2);
933
+ var _props$context$attrs = _objectSpread$u({}, props, context.attrs), icon = _props$context$attrs.icon, primaryColor = _props$context$attrs.primaryColor, secondaryColor = _props$context$attrs.secondaryColor, restProps = _objectWithoutProperties$2(_props$context$attrs, _excluded$2);
934
934
  var colors = twoToneColorPalette;
935
935
  if (primaryColor) {
936
936
  colors = {
@@ -944,11 +944,11 @@
944
944
  }
945
945
  var target = icon;
946
946
  if (target && typeof target.icon === "function") {
947
- target = _objectSpread$t({}, target, {
947
+ target = _objectSpread$u({}, target, {
948
948
  icon: target.icon(colors.primaryColor, colors.secondaryColor)
949
949
  });
950
950
  }
951
- return generate(target.icon, "svg-".concat(target.name), _objectSpread$t({}, restProps, {
951
+ return generate(target.icon, "svg-".concat(target.name), _objectSpread$u({}, restProps, {
952
952
  "data-icon": target.name,
953
953
  width: "1em",
954
954
  height: "1em",
@@ -1089,7 +1089,7 @@
1089
1089
  function _arrayWithHoles(arr) {
1090
1090
  if (Array.isArray(arr)) return arr;
1091
1091
  }
1092
- function _objectSpread$s(target) {
1092
+ function _objectSpread$t(target) {
1093
1093
  for (var i = 1; i < arguments.length; i++) {
1094
1094
  var source = arguments[i] != null ? Object(arguments[i]) : {};
1095
1095
  var ownKeys = Object.keys(source);
@@ -1099,12 +1099,12 @@
1099
1099
  }));
1100
1100
  }
1101
1101
  ownKeys.forEach(function(key) {
1102
- _defineProperty$t(target, key, source[key]);
1102
+ _defineProperty$u(target, key, source[key]);
1103
1103
  });
1104
1104
  }
1105
1105
  return target;
1106
1106
  }
1107
- function _defineProperty$t(obj, key, value) {
1107
+ function _defineProperty$u(obj, key, value) {
1108
1108
  if (key in obj) {
1109
1109
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
1110
1110
  } else {
@@ -1142,9 +1142,9 @@
1142
1142
  setTwoToneColor(blue.primary);
1143
1143
  var Icon$1 = function Icon2(props, context) {
1144
1144
  var _classObj;
1145
- var _props$context$attrs = _objectSpread$s({}, props, context.attrs), cls = _props$context$attrs["class"], icon = _props$context$attrs.icon, spin = _props$context$attrs.spin, rotate = _props$context$attrs.rotate, tabindex = _props$context$attrs.tabindex, twoToneColor = _props$context$attrs.twoToneColor, onClick = _props$context$attrs.onClick, restProps = _objectWithoutProperties$1(_props$context$attrs, _excluded$1);
1145
+ var _props$context$attrs = _objectSpread$t({}, props, context.attrs), cls = _props$context$attrs["class"], icon = _props$context$attrs.icon, spin = _props$context$attrs.spin, rotate = _props$context$attrs.rotate, tabindex = _props$context$attrs.tabindex, twoToneColor = _props$context$attrs.twoToneColor, onClick = _props$context$attrs.onClick, restProps = _objectWithoutProperties$1(_props$context$attrs, _excluded$1);
1146
1146
  var _useInjectIconContext = useInjectIconContext(), prefixCls = _useInjectIconContext.prefixCls, rootClassName = _useInjectIconContext.rootClassName;
1147
- var classObj = (_classObj = {}, _defineProperty$t(_classObj, rootClassName.value, !!rootClassName.value), _defineProperty$t(_classObj, prefixCls.value, true), _defineProperty$t(_classObj, "".concat(prefixCls.value, "-").concat(icon.name), Boolean(icon.name)), _defineProperty$t(_classObj, "".concat(prefixCls.value, "-spin"), !!spin || icon.name === "loading"), _classObj);
1147
+ var classObj = (_classObj = {}, _defineProperty$u(_classObj, rootClassName.value, !!rootClassName.value), _defineProperty$u(_classObj, prefixCls.value, true), _defineProperty$u(_classObj, "".concat(prefixCls.value, "-").concat(icon.name), Boolean(icon.name)), _defineProperty$u(_classObj, "".concat(prefixCls.value, "-spin"), !!spin || icon.name === "loading"), _classObj);
1148
1148
  var iconTabIndex = tabindex;
1149
1149
  if (iconTabIndex === void 0 && onClick) {
1150
1150
  iconTabIndex = -1;
@@ -1154,7 +1154,7 @@
1154
1154
  transform: "rotate(".concat(rotate, "deg)")
1155
1155
  } : void 0;
1156
1156
  var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
1157
- return vue.createVNode("span", _objectSpread$s({
1157
+ return vue.createVNode("span", _objectSpread$t({
1158
1158
  "role": "img",
1159
1159
  "aria-label": icon.name
1160
1160
  }, restProps, {
@@ -1181,7 +1181,7 @@
1181
1181
 
1182
1182
  var CaretDownOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" } }] }, "name": "caret-down", "theme": "outlined" };
1183
1183
 
1184
- function _objectSpread$r(target) {
1184
+ function _objectSpread$s(target) {
1185
1185
  for (var i = 1; i < arguments.length; i++) {
1186
1186
  var source = arguments[i] != null ? Object(arguments[i]) : {};
1187
1187
  var ownKeys = Object.keys(source);
@@ -1191,12 +1191,12 @@
1191
1191
  }));
1192
1192
  }
1193
1193
  ownKeys.forEach(function(key) {
1194
- _defineProperty$s(target, key, source[key]);
1194
+ _defineProperty$t(target, key, source[key]);
1195
1195
  });
1196
1196
  }
1197
1197
  return target;
1198
1198
  }
1199
- function _defineProperty$s(obj, key, value) {
1199
+ function _defineProperty$t(obj, key, value) {
1200
1200
  if (key in obj) {
1201
1201
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
1202
1202
  } else {
@@ -1205,8 +1205,8 @@
1205
1205
  return obj;
1206
1206
  }
1207
1207
  var CaretDownOutlined = function CaretDownOutlined2(props, context) {
1208
- var p = _objectSpread$r({}, props, context.attrs);
1209
- return vue.createVNode(Icon$1, _objectSpread$r({}, p, {
1208
+ var p = _objectSpread$s({}, props, context.attrs);
1209
+ return vue.createVNode(Icon$1, _objectSpread$s({}, p, {
1210
1210
  "icon": CaretDownOutlined$1
1211
1211
  }), null);
1212
1212
  };
@@ -1215,7 +1215,7 @@
1215
1215
 
1216
1216
  var CaretUpOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z" } }] }, "name": "caret-up", "theme": "outlined" };
1217
1217
 
1218
- function _objectSpread$q(target) {
1218
+ function _objectSpread$r(target) {
1219
1219
  for (var i = 1; i < arguments.length; i++) {
1220
1220
  var source = arguments[i] != null ? Object(arguments[i]) : {};
1221
1221
  var ownKeys = Object.keys(source);
@@ -1225,12 +1225,12 @@
1225
1225
  }));
1226
1226
  }
1227
1227
  ownKeys.forEach(function(key) {
1228
- _defineProperty$r(target, key, source[key]);
1228
+ _defineProperty$s(target, key, source[key]);
1229
1229
  });
1230
1230
  }
1231
1231
  return target;
1232
1232
  }
1233
- function _defineProperty$r(obj, key, value) {
1233
+ function _defineProperty$s(obj, key, value) {
1234
1234
  if (key in obj) {
1235
1235
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
1236
1236
  } else {
@@ -1239,8 +1239,8 @@
1239
1239
  return obj;
1240
1240
  }
1241
1241
  var CaretUpOutlined = function CaretUpOutlined2(props, context) {
1242
- var p = _objectSpread$q({}, props, context.attrs);
1243
- return vue.createVNode(Icon$1, _objectSpread$q({}, p, {
1242
+ var p = _objectSpread$r({}, props, context.attrs);
1243
+ return vue.createVNode(Icon$1, _objectSpread$r({}, p, {
1244
1244
  "icon": CaretUpOutlined$1
1245
1245
  }), null);
1246
1246
  };
@@ -1249,6 +1249,40 @@
1249
1249
 
1250
1250
  var CheckCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, "name": "check-circle", "theme": "filled" };
1251
1251
 
1252
+ function _objectSpread$q(target) {
1253
+ for (var i = 1; i < arguments.length; i++) {
1254
+ var source = arguments[i] != null ? Object(arguments[i]) : {};
1255
+ var ownKeys = Object.keys(source);
1256
+ if (typeof Object.getOwnPropertySymbols === "function") {
1257
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1258
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1259
+ }));
1260
+ }
1261
+ ownKeys.forEach(function(key) {
1262
+ _defineProperty$r(target, key, source[key]);
1263
+ });
1264
+ }
1265
+ return target;
1266
+ }
1267
+ function _defineProperty$r(obj, key, value) {
1268
+ if (key in obj) {
1269
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
1270
+ } else {
1271
+ obj[key] = value;
1272
+ }
1273
+ return obj;
1274
+ }
1275
+ var CheckCircleFilled = function CheckCircleFilled2(props, context) {
1276
+ var p = _objectSpread$q({}, props, context.attrs);
1277
+ return vue.createVNode(Icon$1, _objectSpread$q({}, p, {
1278
+ "icon": CheckCircleFilled$1
1279
+ }), null);
1280
+ };
1281
+ CheckCircleFilled.displayName = "CheckCircleFilled";
1282
+ CheckCircleFilled.inheritAttrs = false;
1283
+
1284
+ var CloseCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" } }] }, "name": "close-circle", "theme": "filled" };
1285
+
1252
1286
  function _objectSpread$p(target) {
1253
1287
  for (var i = 1; i < arguments.length; i++) {
1254
1288
  var source = arguments[i] != null ? Object(arguments[i]) : {};
@@ -1272,14 +1306,14 @@
1272
1306
  }
1273
1307
  return obj;
1274
1308
  }
1275
- var CheckCircleFilled = function CheckCircleFilled2(props, context) {
1309
+ var CloseCircleFilled = function CloseCircleFilled2(props, context) {
1276
1310
  var p = _objectSpread$p({}, props, context.attrs);
1277
1311
  return vue.createVNode(Icon$1, _objectSpread$p({}, p, {
1278
- "icon": CheckCircleFilled$1
1312
+ "icon": CloseCircleFilled$1
1279
1313
  }), null);
1280
1314
  };
1281
- CheckCircleFilled.displayName = "CheckCircleFilled";
1282
- CheckCircleFilled.inheritAttrs = false;
1315
+ CloseCircleFilled.displayName = "CloseCircleFilled";
1316
+ CloseCircleFilled.inheritAttrs = false;
1283
1317
 
1284
1318
  var CloseOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" };
1285
1319
 
@@ -2218,6 +2252,18 @@
2218
2252
  function isObject$4(val) {
2219
2253
  return val !== null && is$1(val, "Object");
2220
2254
  }
2255
+ function isEmpty(val) {
2256
+ if (isArray$2(val) || isString$1(val)) {
2257
+ return val.length === 0;
2258
+ }
2259
+ if (val instanceof Map || val instanceof Set) {
2260
+ return val.size === 0;
2261
+ }
2262
+ if (isObject$4(val)) {
2263
+ return Object.keys(val).length === 0;
2264
+ }
2265
+ return false;
2266
+ }
2221
2267
  const isNil = (value) => value === null || value === void 0;
2222
2268
  function isNumber$2(val) {
2223
2269
  return is$1(val, "Number");
@@ -2231,6 +2277,9 @@
2231
2277
  function isFunction$2(val) {
2232
2278
  return typeof val === "function";
2233
2279
  }
2280
+ function isBoolean(val) {
2281
+ return is$1(val, "Boolean");
2282
+ }
2234
2283
  function isArray$2(val) {
2235
2284
  return val && Array.isArray(val);
2236
2285
  }
@@ -23739,6 +23788,9 @@
23739
23788
  function getColumnPos(index, pos) {
23740
23789
  return pos ? `${pos}-${index}` : `${index}`;
23741
23790
  }
23791
+ function getCellKey(rowKey, colKey) {
23792
+ return [rowKey, colKey].join("_");
23793
+ }
23742
23794
  function objectToEmpty(obj) {
23743
23795
  for (const key in obj) Object.prototype.hasOwnProperty.call(obj, key) && delete obj[key];
23744
23796
  }
@@ -24059,10 +24111,18 @@
24059
24111
  type: Boolean,
24060
24112
  default: void 0
24061
24113
  },
24114
+ selectRowByClick: {
24115
+ type: Boolean,
24116
+ default: void 0
24117
+ },
24062
24118
  expandIcon: {
24063
24119
  type: Function,
24064
24120
  default: void 0
24065
24121
  },
24122
+ expandIconType: {
24123
+ type: String,
24124
+ default: void 0
24125
+ },
24066
24126
  onExpand: {
24067
24127
  type: Function,
24068
24128
  default: void 0
@@ -24117,6 +24177,14 @@
24117
24177
  type: Function,
24118
24178
  default: () => ({})
24119
24179
  },
24180
+ editableKeys: {
24181
+ type: Array,
24182
+ default: void 0
24183
+ },
24184
+ rowEditable: {
24185
+ type: Object,
24186
+ default: void 0
24187
+ },
24120
24188
  showHeader: {
24121
24189
  type: Boolean,
24122
24190
  default: true
@@ -24215,6 +24283,9 @@
24215
24283
  type: Boolean,
24216
24284
  default: void 0
24217
24285
  },
24286
+ editableCellState: {
24287
+ type: Function
24288
+ },
24218
24289
  paginationSticky: {
24219
24290
  type: [Boolean, Object],
24220
24291
  default: true
@@ -24268,6 +24339,15 @@
24268
24339
  type: Function,
24269
24340
  default: void 0
24270
24341
  },
24342
+ onDataChange: {
24343
+ type: Function
24344
+ },
24345
+ onRowValidate: {
24346
+ type: Function
24347
+ },
24348
+ onValidate: {
24349
+ type: Function
24350
+ },
24271
24351
  "onUpdate:pagination": {
24272
24352
  type: Function
24273
24353
  },
@@ -25020,41 +25100,305 @@
25020
25100
  const ICON_TYPE_FORBID$1 = "ICON_TYPE_FORBID";
25021
25101
 
25022
25102
  const EditKey = Symbol("edit");
25023
- const useEditProvider = () => {
25103
+ const useEditProvider = (props, {
25104
+ rawData,
25105
+ getRowKey,
25106
+ getIndexsByKey,
25107
+ getRecordByKey
25108
+ }) => {
25109
+ var _a;
25024
25110
  const editCellKeys = vue.shallowRef([]);
25025
- const oldValuesMap = vue.shallowRef({});
25026
- const openEditor = (key, values) => {
25111
+ const editRowsMap = vue.shallowRef({});
25112
+ const intl = useIntl();
25113
+ const editableType = vue.computed(() => {
25114
+ var _a2;
25115
+ return (_a2 = props.rowEditable) == null ? void 0 : _a2.type;
25116
+ });
25117
+ const [mergedEditableKeys, setMergedEditableKeys] = useMergedState$1([], {
25118
+ value: vue.computed(() => {
25119
+ var _a2;
25120
+ return props.editableKeys || ((_a2 = props.rowEditable) == null ? void 0 : _a2.editableKeys);
25121
+ }),
25122
+ onChange: ((_a = props.rowEditable) == null ? void 0 : _a.onChange) ? (keys) => {
25123
+ var _a2, _b, _c;
25124
+ (_c = (_a2 = props.rowEditable) == null ? void 0 : _a2.onChange) == null ? void 0 : _c.call(
25125
+ _a2,
25126
+ // 计算编辑的key
25127
+ keys != null ? keys : [],
25128
+ (_b = keys == null ? void 0 : keys.map((key) => editRowsMap.value[key])) != null ? _b : []
25129
+ );
25130
+ } : void 0
25131
+ });
25132
+ const editingCells = vue.ref({});
25133
+ const newLineRecordCache = vue.shallowRef({});
25134
+ const editableKeysSet = vue.computed(() => {
25135
+ var _a2;
25136
+ const keys = editableType.value === "single" ? (_a2 = mergedEditableKeys.value) == null ? void 0 : _a2.slice(0, 1) : mergedEditableKeys.value;
25137
+ return new Set(keys);
25138
+ });
25139
+ const isEditable = (recordKey) => {
25140
+ var _a2;
25141
+ if ((_a2 = mergedEditableKeys.value) == null ? void 0 : _a2.includes(recordKey)) return true;
25142
+ return false;
25143
+ };
25144
+ const isRowEdit = vue.computed(() => !!editableType.value);
25145
+ const openEditor = (key) => {
25027
25146
  if (key) {
25147
+ const newKeys = [...editCellKeys.value];
25028
25148
  if (Array.isArray(key)) {
25029
25149
  editCellKeys.value = key;
25030
25150
  } else {
25031
- editCellKeys.value.includes(key) || (editCellKeys.value = [key]);
25151
+ newKeys.includes(key) || newKeys.push(key);
25032
25152
  }
25033
- Object.assign(oldValuesMap.value, values || {});
25153
+ editCellKeys.value = newKeys;
25034
25154
  }
25035
25155
  };
25036
25156
  const closeEditor = (key) => {
25037
- if (typeof key === "undefined") {
25038
- editCellKeys.value = [];
25039
- oldValuesMap.value = {};
25040
- return;
25157
+ const closeKeys = editCellKeys.value.filter((cellKey) => cellKey !== key);
25158
+ const closeCells = closeKeys.map((key2) => editingCells.value[key2]).filter((cell) => {
25159
+ var _a2, _b;
25160
+ return !((_b = (_a2 = cell.column) == null ? void 0 : _a2.edit) == null ? void 0 : _b.keepEditMode);
25161
+ });
25162
+ const list = closeCells.map(
25163
+ (cell) => new Promise((resolve) => {
25164
+ cell == null ? void 0 : cell.validateEdit().then((r) => {
25165
+ if (r === true) {
25166
+ const cellKey = getCellKey(cell.rowKey, cell.columnKey);
25167
+ resolve(cellKey);
25168
+ } else {
25169
+ resolve(null);
25170
+ }
25171
+ });
25172
+ })
25173
+ );
25174
+ Promise.all(list).then((keys) => {
25175
+ const closeKeys2 = keys.filter((key2) => !!key2);
25176
+ editCellKeys.value = editCellKeys.value.filter((key2) => !closeKeys2.includes(key2));
25177
+ });
25178
+ };
25179
+ const setEditingCell = (params, isEdit) => {
25180
+ const cellKey = getCellKey(params.rowKey, params.columnKey);
25181
+ if (isEdit) {
25182
+ editingCells.value[cellKey] = params;
25183
+ } else {
25184
+ delete editingCells.value[cellKey];
25041
25185
  }
25042
- const keys = Array.isArray(key) ? key : [key];
25043
- editCellKeys.value = editCellKeys.value.filter((key2) => !keys.includes(key2));
25044
- keys.forEach((key2) => {
25045
- delete oldValuesMap.value[key2];
25186
+ };
25187
+ const getErrorListMapByErrors = (errors) => {
25188
+ const errorMap = {};
25189
+ errors.forEach(({ rowKey, columnKey, errorList }) => {
25190
+ const key = [rowKey, columnKey].join("__");
25191
+ if (errorList == null ? void 0 : errorList.length) {
25192
+ errorMap[key] = errorList;
25193
+ } else {
25194
+ delete errorMap[key];
25195
+ }
25046
25196
  });
25197
+ return errorMap;
25198
+ };
25199
+ const validateOneRowData = (recordKey) => {
25200
+ const cellKeys = Object.keys(editingCells.value);
25201
+ const rowCellKeys = cellKeys.filter((cellKey) => cellKey.startsWith(`${recordKey}_`));
25202
+ const list = rowCellKeys.map(
25203
+ (cellKey) => new Promise((resolve) => {
25204
+ const cell = editingCells.value[cellKey];
25205
+ cell == null ? void 0 : cell.validateEdit().then((r) => {
25206
+ if (r === true) {
25207
+ resolve({ ...cell, errorList: [] });
25208
+ } else {
25209
+ resolve({ ...cell, errorList: r });
25210
+ }
25211
+ });
25212
+ })
25213
+ );
25214
+ return new Promise((resolve, reject) => {
25215
+ Promise.all(list).then((errors) => {
25216
+ resolve({
25217
+ errors: errors.filter((t) => {
25218
+ var _a2;
25219
+ return (_a2 = t.errorList) == null ? void 0 : _a2.length;
25220
+ }),
25221
+ errorMap: getErrorListMapByErrors(errors)
25222
+ });
25223
+ }, reject);
25224
+ });
25225
+ };
25226
+ const validateRowData = (recordKey) => new Promise((resolve, reject) => {
25227
+ validateOneRowData(recordKey).then(({ errors, errorMap }) => {
25228
+ var _a2;
25229
+ (_a2 = props.onRowValidate) == null ? void 0 : _a2.call(props, { errors, errorMap });
25230
+ resolve({ errors, errorMap });
25231
+ }, reject);
25232
+ });
25233
+ const validateTableCellData = () => {
25234
+ const cellKeys = Object.keys(editingCells.value);
25235
+ const list = cellKeys.map(
25236
+ (cellKey) => new Promise((resolve) => {
25237
+ const cell = editingCells.value[cellKey];
25238
+ cell == null ? void 0 : cell.validateEdit().then((r) => {
25239
+ if (r === true) {
25240
+ resolve({ ...cell, errorList: [] });
25241
+ } else {
25242
+ resolve({ ...cell, errorList: r });
25243
+ }
25244
+ });
25245
+ })
25246
+ );
25247
+ return new Promise((resolve, reject) => {
25248
+ Promise.all(list).then((errors) => {
25249
+ resolve({
25250
+ errors: errors.filter((t) => {
25251
+ var _a2;
25252
+ return (_a2 = t.errorList) == null ? void 0 : _a2.length;
25253
+ }),
25254
+ errorMap: getErrorListMapByErrors(errors)
25255
+ });
25256
+ }, reject);
25257
+ });
25258
+ };
25259
+ const validateTableData = () => new Promise((resolve, reject) => {
25260
+ validateTableCellData().then(({ errors, errorMap }) => {
25261
+ var _a2;
25262
+ (_a2 = props.onValidate) == null ? void 0 : _a2.call(props, { errors, errorMap });
25263
+ resolve({ errors, errorMap, data: (errors == null ? void 0 : errors.length) ? void 0 : rawData.value });
25264
+ }, reject);
25265
+ });
25266
+ const addEditRecord = (recordValue, options) => {
25267
+ var _a2, _b, _c, _d;
25268
+ if (isRowEdit.value && ((_a2 = Object.keys(newLineRecordCache.value)) == null ? void 0 : _a2.length) && ((_b = props.rowEditable) == null ? void 0 : _b.onlyAddOneLineAlertMessage) !== false) {
25269
+ antDesignVue.message.warning(
25270
+ ((_c = props.rowEditable) == null ? void 0 : _c.onlyAddOneLineAlertMessage) || intl.getMessage("editableTable.onlyAddOneLine", "\u53EA\u80FD\u65B0\u589E\u4E00\u884C")
25271
+ );
25272
+ return false;
25273
+ }
25274
+ if (isRowEdit.value && editableKeysSet.value.size > 0 && editableType.value === "single") {
25275
+ antDesignVue.message.warning(
25276
+ ((_d = props.rowEditable) == null ? void 0 : _d.onlyOneLineEditorAlertMessage) || intl.getMessage("editableTable.onlyOneLineEditor", "\u53EA\u80FD\u540C\u65F6\u7F16\u8F91\u4E00\u884C")
25277
+ );
25278
+ return false;
25279
+ }
25280
+ const recordKey = getRowKey.value(recordValue, -1);
25281
+ if (!recordKey) {
25282
+ throw new Error("\u8BF7\u8BBE\u7F6E recordCreatorProps.record \u5E76\u8FD4\u56DE\u4E00\u4E2A\u552F\u4E00\u7684key");
25283
+ }
25284
+ if (isRowEdit.value) {
25285
+ editableKeysSet.value.add(recordKey);
25286
+ editRowsMap.value[recordKey] = cloneDeep(recordValue);
25287
+ setMergedEditableKeys(Array.from(editableKeysSet.value));
25288
+ vue.triggerRef(editRowsMap);
25289
+ }
25290
+ if ((options == null ? void 0 : options.position) === "top") {
25291
+ rawData.value.unshift(recordValue);
25292
+ } else {
25293
+ rawData.value.push(recordValue);
25294
+ }
25295
+ newLineRecordCache.value[recordKey] = {
25296
+ defaultValue: recordValue,
25297
+ options
25298
+ };
25299
+ vue.triggerRef(rawData);
25300
+ return true;
25301
+ };
25302
+ const startEditable = (recordKey, recordValue) => {
25303
+ var _a2;
25304
+ if (!isRowEdit.value) {
25305
+ return false;
25306
+ }
25307
+ if (editableKeysSet.value.size > 0 && editableType.value === "single") {
25308
+ antDesignVue.message.warning(
25309
+ ((_a2 = props.rowEditable) == null ? void 0 : _a2.onlyOneLineEditorAlertMessage) || intl.getMessage("editableTable.onlyOneLineEditor", "\u53EA\u80FD\u540C\u65F6\u7F16\u8F91\u4E00\u884C")
25310
+ );
25311
+ return false;
25312
+ }
25313
+ editableKeysSet.value.add(recordKey);
25314
+ editRowsMap.value[recordKey] = cloneDeep(recordValue != null ? recordValue : getRecordByKey(recordKey));
25315
+ setMergedEditableKeys(Array.from(editableKeysSet.value));
25316
+ vue.triggerRef(editRowsMap);
25317
+ return true;
25318
+ };
25319
+ const cancelEditable = (recordKey) => {
25320
+ if (!isRowEdit.value) {
25321
+ return false;
25322
+ }
25323
+ const newLineRecord = newLineRecordCache.value[recordKey];
25324
+ if (newLineRecord) {
25325
+ delete newLineRecordCache.value[recordKey];
25326
+ const rowIndex = rawData.value.findIndex((item) => getRowKey.value(item, -1) === recordKey);
25327
+ rawData.value.splice(rowIndex, 1);
25328
+ vue.triggerRef(rawData);
25329
+ }
25330
+ editableKeysSet.value.delete(recordKey);
25331
+ delete editRowsMap.value[recordKey];
25332
+ setMergedEditableKeys(Array.from(editableKeysSet.value));
25333
+ return true;
25334
+ };
25335
+ const saveEditable = async (recordKey) => {
25336
+ var _a2, _b;
25337
+ if (!isRowEdit.value) {
25338
+ return false;
25339
+ }
25340
+ const { errors } = await validateRowData(recordKey);
25341
+ if (!!errors.length) {
25342
+ return false;
25343
+ }
25344
+ const editRow = editRowsMap.value[recordKey];
25345
+ const originRow = getRecordByKey(recordKey);
25346
+ const success = await ((_b = (_a2 = props.rowEditable) == null ? void 0 : _a2.onSave) == null ? void 0 : _b.call(_a2, recordKey, editRow, originRow));
25347
+ if (success === false) {
25348
+ return false;
25349
+ }
25350
+ upadteRowData(recordKey, editRow);
25351
+ const newLineRecord = newLineRecordCache.value[recordKey];
25352
+ if (newLineRecord) {
25353
+ delete newLineRecordCache.value[recordKey];
25354
+ }
25355
+ await cancelEditable(recordKey);
25356
+ return true;
25357
+ };
25358
+ const upadteRowData = (recordKey, editRow) => {
25359
+ const recordIndexs = getIndexsByKey(recordKey);
25360
+ const indexsLen = recordIndexs.length;
25361
+ if (indexsLen === 1) {
25362
+ rawData.value.splice(recordIndexs[0], 1, editRow);
25363
+ }
25364
+ if (indexsLen > 1) {
25365
+ let copyData = rawData.value;
25366
+ let item;
25367
+ const childrenColumnName = props.childrenColumnName || "children";
25368
+ for (let i = 0; i < indexsLen; i++) {
25369
+ item = copyData[recordIndexs[i]];
25370
+ if (i === indexsLen - 2) {
25371
+ const currentData = (item == null ? void 0 : item[childrenColumnName]) || [];
25372
+ currentData.splice(recordIndexs[indexsLen - 1], 1, editRow);
25373
+ break;
25374
+ }
25375
+ copyData = (item == null ? void 0 : item[childrenColumnName]) || [];
25376
+ }
25377
+ }
25378
+ vue.triggerRef(rawData);
25047
25379
  };
25048
25380
  vue.provide(EditKey, {
25049
25381
  editCellKeys,
25050
25382
  openEditor,
25051
25383
  closeEditor,
25052
- oldValuesMap
25384
+ // oldValuesMap,
25385
+ editableType,
25386
+ mergedEditableKeys,
25387
+ isRowEdit,
25388
+ editRowsMap,
25389
+ setEditingCell
25053
25390
  });
25054
25391
  return {
25055
25392
  editCellKeys,
25056
25393
  openEditor,
25057
- closeEditor
25394
+ closeEditor,
25395
+ cancelEditable,
25396
+ startEditable,
25397
+ saveEditable,
25398
+ isEditable,
25399
+ validateTableData,
25400
+ validateRowData,
25401
+ addEditRecord
25058
25402
  };
25059
25403
  };
25060
25404
  const useEditInject = () => {
@@ -25064,7 +25408,13 @@
25064
25408
  },
25065
25409
  closeEditor: () => {
25066
25410
  },
25067
- oldValuesMap: vue.shallowRef({})
25411
+ // oldValuesMap: shallowRef({}),
25412
+ editRowsMap: vue.shallowRef({}),
25413
+ editableType: vue.computed(() => void 0),
25414
+ isRowEdit: vue.computed(() => false),
25415
+ mergedEditableKeys: vue.computed(() => []),
25416
+ setEditingCell: () => {
25417
+ }
25068
25418
  });
25069
25419
  };
25070
25420
 
@@ -25315,926 +25665,6 @@
25315
25665
  return vue.inject(TableContextKey, {});
25316
25666
  };
25317
25667
 
25318
- const KeyCode = {
25319
- TAB: 9,
25320
- ENTER: 13,
25321
- ESC: 27,
25322
- LEFT: 37,
25323
- UP: 38,
25324
- RIGHT: 39,
25325
- DOWN: 40,
25326
- A: 65,
25327
- C: 67};
25328
-
25329
- const useCellNavigation = (params) => {
25330
- const {
25331
- getDisplayedColBefore,
25332
- getDisplayedColAfter,
25333
- allDisplayedColumns,
25334
- setRangeToCell,
25335
- focusCell,
25336
- flattenData,
25337
- getRowByFlattenIndex,
25338
- allCellProps,
25339
- tabGuardTopRef,
25340
- tabGuardBottomRef
25341
- } = params;
25342
- const endFlattenIndex = vue.computed(
25343
- () => {
25344
- var _a;
25345
- return (_a = flattenData.value[flattenData.value.length - 1]) == null ? void 0 : _a.flattenIndex;
25346
- }
25347
- );
25348
- const startFlattenIndex = vue.computed(() => {
25349
- var _a;
25350
- return (_a = flattenData.value[0]) == null ? void 0 : _a.flattenIndex;
25351
- });
25352
- const getNextCellToFocus = (keyCode, focusedCell, ctrlPressed = false) => ctrlPressed ? h2(keyCode, focusedCell) : m(keyCode, focusedCell);
25353
- const h2 = (keyCode, focusedCell) => {
25354
- const isUp = keyCode === KeyCode.UP;
25355
- const isDown = keyCode === KeyCode.DOWN;
25356
- const isLeft = keyCode === KeyCode.LEFT;
25357
- let column, rowIndex;
25358
- if (isUp || isDown) {
25359
- rowIndex = isUp ? startFlattenIndex.value : endFlattenIndex.value;
25360
- column = focusedCell.column;
25361
- } else {
25362
- rowIndex = focusedCell.rowIndex;
25363
- column = isLeft !== false ? allDisplayedColumns.value[0] : allDisplayedColumns.value[allDisplayedColumns.value.length - 1];
25364
- }
25365
- return { rowIndex, rowPinned: null, column };
25366
- };
25367
- const m = (keyCode, focusedCell) => {
25368
- let cell = focusedCell;
25369
- let o2 = false;
25370
- for (; !o2; ) {
25371
- switch (keyCode) {
25372
- case KeyCode.UP:
25373
- cell = getCellAbove(cell);
25374
- break;
25375
- case KeyCode.DOWN:
25376
- case KeyCode.ENTER:
25377
- cell = x(cell);
25378
- break;
25379
- case KeyCode.RIGHT:
25380
- cell = w(cell);
25381
- break;
25382
- case KeyCode.LEFT:
25383
- cell = g(cell);
25384
- break;
25385
- default:
25386
- cell = null;
25387
- console.warn("Table: unknown key for navigation " + keyCode);
25388
- }
25389
- o2 = !cell || y(cell);
25390
- }
25391
- return cell;
25392
- }, y = (e3) => {
25393
- let t2;
25394
- switch (e3.rowPinned) {
25395
- case "top":
25396
- case "bottom":
25397
- break;
25398
- default:
25399
- t2 = getRowByFlattenIndex(e3.rowIndex);
25400
- }
25401
- return !!t2;
25402
- }, g = (e3) => {
25403
- if (!e3) return null;
25404
- const n2 = getDisplayedColBefore(e3.column);
25405
- return n2 ? { rowIndex: e3.rowIndex, column: n2, rowPinned: e3.rowPinned } : null;
25406
- }, w = (e3) => {
25407
- if (!e3) return null;
25408
- const t2 = getDisplayedColAfter(e3.column);
25409
- return t2 ? { rowIndex: e3.rowIndex, column: t2, rowPinned: e3.rowPinned } : null;
25410
- }, x = (e3) => {
25411
- if (!e3) return null;
25412
- const t2 = getRowBelow(e3);
25413
- return t2 ? { rowIndex: t2.rowIndex, column: e3.column, rowPinned: t2.rowPinned } : null;
25414
- }, getRowBelow = (e3) => {
25415
- const t2 = e3.rowIndex, n2 = e3.rowPinned;
25416
- return C(e3) ? null : { rowIndex: t2 + 1, rowPinned: n2 };
25417
- }, C = (e3) => {
25418
- const t2 = e3.rowIndex;
25419
- return endFlattenIndex.value <= t2;
25420
- }, getRowAbove = (e3) => {
25421
- const t2 = e3.rowIndex, n2 = e3.rowPinned;
25422
- return (n2 ? 0 === t2 : t2 === startFlattenIndex.value) ? null : { rowIndex: t2 - 1, rowPinned: n2 };
25423
- }, getCellAbove = (e3) => {
25424
- if (!e3) return null;
25425
- const t2 = getRowAbove({
25426
- rowIndex: e3.rowIndex,
25427
- rowPinned: e3.rowPinned
25428
- });
25429
- return t2 ? { rowIndex: t2.rowIndex, column: e3.column, rowPinned: t2.rowPinned } : null;
25430
- }, k = (e3) => e3.rowIndex >= startFlattenIndex.value && e3.rowIndex <= endFlattenIndex.value, getNextTabbedCell = (e3, t2) => t2 ? K(e3) : _(e3), _ = (e3) => {
25431
- const t2 = allDisplayedColumns.value;
25432
- let l2 = e3.rowIndex, r2 = e3.rowPinned, a2 = getDisplayedColAfter(e3.column);
25433
- if (!a2) {
25434
- a2 = t2[0];
25435
- const n2 = getRowBelow(e3);
25436
- if (!n2) return null;
25437
- if (!n2.rowPinned && !k(n2)) return null;
25438
- l2 = n2 ? n2.rowIndex : null, r2 = n2 ? n2.rowPinned : null;
25439
- }
25440
- return { rowIndex: l2, column: a2, rowPinned: r2 };
25441
- }, K = (e3) => {
25442
- const n2 = allDisplayedColumns.value;
25443
- let l2 = e3.rowIndex, r2 = e3.rowPinned, a2 = getDisplayedColBefore(e3.column);
25444
- if (!a2) {
25445
- a2 = n2[n2.length - 1];
25446
- const t2 = getRowAbove({
25447
- rowIndex: e3.rowIndex,
25448
- rowPinned: e3.rowPinned
25449
- });
25450
- if (!t2) return null;
25451
- if (!t2.rowPinned && !k(t2)) return null;
25452
- l2 = t2 ? t2.rowIndex : null, r2 = t2 ? t2.rowPinned : null;
25453
- }
25454
- return { rowIndex: l2, column: a2, rowPinned: r2 };
25455
- }, O = (e3) => {
25456
- const t2 = ((e4) => {
25457
- let t3, n2;
25458
- const l2 = null === (t3 = getRowByFlattenIndex(e4.rowIndex)) || void 0 === t3 ? void 0 : t3.rowKey, r2 = (((null === (n2 = allCellProps.value[l2]) || void 0 === n2 ? void 0 : n2[e4.column.columnKey]) || {}).props || {}).colSpan, a2 = [];
25459
- if (r2 > 1) {
25460
- const t4 = allDisplayedColumns.value.findIndex(
25461
- (t5) => t5.columnKey === e4.column.columnKey
25462
- );
25463
- for (let e5 = 0; e5 < r2; e5++) a2.push(allDisplayedColumns.value[t4 + e5]);
25464
- } else a2.push(e4.column);
25465
- return a2.filter((e5) => !!e5);
25466
- })(e3);
25467
- return 1 === t2.length ? e3 : {
25468
- rowIndex: e3.rowIndex,
25469
- column: t2[t2.length - 1],
25470
- rowPinned: e3.rowPinned
25471
- };
25472
- }, P = (e3) => {
25473
- let t2;
25474
- const n2 = getRowByFlattenIndex(e3.rowIndex), o2 = null == n2 ? void 0 : n2.rowKey, l2 = (((null === (t2 = allCellProps.value[o2]) || void 0 === t2 ? void 0 : t2[e3.column.columnKey]) || {}).props || {}).rowSpan;
25475
- return !!n2 && 0 !== l2 && !n2.isExpandRow;
25476
- }, tabToNextCellCommon = (e3, t2) => $(e3, t2), $ = (e3, t2) => {
25477
- const n2 = T(e3, t2);
25478
- return n2 && focusCell(n2), !!n2;
25479
- }, T = (t2, n2) => {
25480
- let o2 = t2;
25481
- for (; o2 && (o2 === t2 || !P(o2)); ) n2 || (o2 = O(o2)), o2 = getNextTabbedCell(o2, n2);
25482
- return o2 ? o2.rowIndex < 0 ? null : (params.ensureCellVisible(o2), setRangeToCell(o2), o2) : null;
25483
- };
25484
- return {
25485
- getNextCellToFocus,
25486
- getNextTabbedCell,
25487
- getLastBodyCell: () => ({ rowIndex: endFlattenIndex.value, rowPinned: null }),
25488
- navigateToNextCell: (t2, n2) => {
25489
- const o2 = t2.keyCode;
25490
- let r2 = n2, a2 = false;
25491
- for (; r2 && (r2 === n2 || !P(r2)); )
25492
- o2 === KeyCode.RIGHT && (r2 = O(r2)), r2 = getNextCellToFocus(o2, r2), a2 = !r2;
25493
- a2 && t2 && o2 === KeyCode.UP && (r2 = { rowIndex: -1, rowPinned: null, column: n2.column }), r2 && (r2.rowIndex < 0 || (params.ensureCellVisible(r2), setRangeToCell(r2)));
25494
- },
25495
- onTabKeyDown: (e3, t2) => {
25496
- let n2, o2;
25497
- const l2 = t2.shiftKey;
25498
- tabToNextCellCommon(e3, l2) || (l2 ? null === (n2 = tabGuardTopRef.value) || void 0 === n2 || n2.focus() : null === (o2 = tabGuardBottomRef.value) || void 0 === o2 || o2.focus()), t2.preventDefault();
25499
- },
25500
- tabToNextCellCommon,
25501
- getFirstCellToFocus: (t2) => {
25502
- const n2 = (() => {
25503
- const e3 = getRowByFlattenIndex(startFlattenIndex.value), t3 = allDisplayedColumns.value[0];
25504
- return e3 && t3 ? { rowIndex: e3.rowIndex, rowPinned: null, column: t3 } : null;
25505
- })();
25506
- P(n2) ? (params.ensureCellVisible(n2), setRangeToCell(n2)) : n2 && tabToNextCellCommon(n2, t2);
25507
- },
25508
- getLastCellToFocus: (t2) => {
25509
- const n2 = (() => {
25510
- const e3 = getRowByFlattenIndex(endFlattenIndex.value), t3 = allDisplayedColumns.value[allDisplayedColumns.value.length - 1];
25511
- return e3 && t3 ? { rowIndex: e3.rowIndex, rowPinned: null, column: t3 } : null;
25512
- })();
25513
- P(n2) ? (params.ensureCellVisible(n2), setRangeToCell(n2)) : n2 && tabToNextCellCommon(n2, t2);
25514
- },
25515
- getRowAbove,
25516
- getCellAbove,
25517
- getRowBelow
25518
- };
25519
- };
25520
-
25521
- const useAutoScroll = (params) => {
25522
- const {
25523
- scrollContainer,
25524
- scrollAxis,
25525
- onScrollCallback = () => {
25526
- },
25527
- showVerticalScrollbar,
25528
- showHorizontalScrollbar
25529
- } = params;
25530
- let timer = null;
25531
- let i = 0;
25532
- let hasLeft = false;
25533
- let hasRight = false;
25534
- let hasTop = false;
25535
- let hasBottom = false;
25536
- const isXAxis = -1 !== scrollAxis.indexOf("x");
25537
- const isYAxis = -1 !== scrollAxis.indexOf("y");
25538
- const scrollByTick = vue.computed(() => {
25539
- var _a, _b;
25540
- return (_b = (_a = params.scrollByTick) == null ? void 0 : _a.value) != null ? _b : 20;
25541
- });
25542
- const exec = () => {
25543
- if (null === timer) {
25544
- timer = window.setInterval(handle, 100);
25545
- i = 0;
25546
- }
25547
- };
25548
- const handle = () => {
25549
- i++;
25550
- const boundary = i > 20 ? 200 : i > 10 ? 80 : 40;
25551
- if (isYAxis) {
25552
- const position = params.getVerticalPosition();
25553
- hasTop && params.setVerticalPosition(position - boundary), hasBottom && params.setVerticalPosition(position + boundary);
25554
- }
25555
- if (isXAxis) {
25556
- const position = params.getHorizontalPosition();
25557
- hasLeft && params.setHorizontalPosition(position - boundary), hasRight && params.setHorizontalPosition(position + boundary);
25558
- }
25559
- onScrollCallback();
25560
- };
25561
- const clear = () => {
25562
- if (timer) {
25563
- window.clearInterval(timer);
25564
- timer = null;
25565
- }
25566
- };
25567
- return {
25568
- check: (mouseEvent, forceSkipVerticalScroll = false) => {
25569
- const hasVerticalScroll = forceSkipVerticalScroll || !showVerticalScrollbar.value;
25570
- if (hasVerticalScroll && !showHorizontalScrollbar.value) return;
25571
- const clientRect = scrollContainer.value.getBoundingClientRect();
25572
- const tick = scrollByTick.value;
25573
- hasLeft = mouseEvent.clientX < clientRect.left + tick;
25574
- hasRight = mouseEvent.clientX > clientRect.right - tick;
25575
- hasTop = mouseEvent.clientY < clientRect.top + tick && !hasVerticalScroll;
25576
- hasBottom = mouseEvent.clientY > clientRect.bottom - tick && !hasVerticalScroll;
25577
- return hasLeft || hasRight || hasTop || hasBottom ? exec() : clear();
25578
- },
25579
- ensureCleared: clear
25580
- };
25581
- };
25582
-
25583
- const isOverFormFieldElement = (mouseEvent) => {
25584
- var _a, _b;
25585
- const tagName = (_b = (_a = mouseEvent.target) == null ? void 0 : _a.tagName) == null ? void 0 : _b.toLocaleLowerCase();
25586
- return !!(tagName == null ? void 0 : tagName.match("^a$|textarea|input|select|button"));
25587
- };
25588
- const useDragSelection = (params) => {
25589
- let dragging = false;
25590
- let cacheStartTouch = null;
25591
- let startTarget = null;
25592
- let cacheTouch;
25593
- const destroyHandlers = [];
25594
- const batchEvent = (eventList) => {
25595
- eventList.forEach((config) => {
25596
- const { target, type, listener, options } = config;
25597
- target.addEventListener(type, listener, options);
25598
- });
25599
- destroyHandlers.push(() => {
25600
- eventList.forEach((config) => {
25601
- const { target, type, listener, options } = config;
25602
- target.removeEventListener(type, listener, options);
25603
- });
25604
- });
25605
- };
25606
- const getTouch = (touches) => {
25607
- for (let i = 0; i < touches.length; i++) {
25608
- if (touches[i].identifier === (cacheTouch == null ? void 0 : cacheTouch.identifier)) {
25609
- return touches[i];
25610
- }
25611
- }
25612
- return null;
25613
- };
25614
- const handleMouseMoveOrTouchMove = (event, cacheEvent) => {
25615
- if (!dragging) {
25616
- if (eventsClose(event, cacheEvent, DRAG_BUFF)) {
25617
- return;
25618
- }
25619
- dragging = true;
25620
- params.onDragStart(cacheEvent);
25621
- }
25622
- };
25623
- const handleMouseUpOrToucheEnd = () => {
25624
- if (dragging) {
25625
- dragging = false;
25626
- }
25627
- cacheStartTouch = null;
25628
- startTarget = null;
25629
- cacheTouch = null;
25630
- destroyHandlers.forEach((fn) => fn());
25631
- destroyHandlers.length = 0;
25632
- };
25633
- const isOverForm = (event) => !isOverFormFieldElement(event);
25634
- const mouseMoveHandler = (event) => {
25635
- if (isOverForm(event)) {
25636
- event.preventDefault();
25637
- }
25638
- handleMouseMoveOrTouchMove(event, cacheStartTouch);
25639
- };
25640
- const touchMoveHandler = (event) => {
25641
- getTouch(event.touches) && handleMouseMoveOrTouchMove(event, cacheStartTouch);
25642
- };
25643
- const touchEndHandler = (event) => {
25644
- getTouch(event.changedTouches) && handleMouseUpOrToucheEnd();
25645
- };
25646
- const onBodyMousedown = (e) => {
25647
- var _a, _b;
25648
- if (params.level !== ((_a = e.cellInfo) == null ? void 0 : _a.level)) return;
25649
- if (isOverForm(e)) {
25650
- e.preventDefault();
25651
- }
25652
- dragging = false;
25653
- cacheStartTouch = e;
25654
- startTarget = (_b = e.cellInfo) == null ? void 0 : _b.cellTarget;
25655
- params.bodyElementRef.value;
25656
- batchEvent([
25657
- {
25658
- target: document,
25659
- type: "mousemove",
25660
- listener: (e2) => mouseMoveHandler(e2)
25661
- },
25662
- {
25663
- target: document,
25664
- type: "mouseup",
25665
- listener: () => {
25666
- handleMouseUpOrToucheEnd();
25667
- }
25668
- },
25669
- {
25670
- target: document,
25671
- type: "contextmenu",
25672
- listener: (e2) => e2.preventDefault()
25673
- }
25674
- ]);
25675
- mouseMoveHandler(e);
25676
- };
25677
- let bodyTouchStartHandle;
25678
- vue.watch(
25679
- [() => params.bodyElementRef.value, params.enableRangeSelection],
25680
- ([bodyEl], [oldBodyEl]) => {
25681
- if (oldBodyEl) {
25682
- oldBodyEl.removeEventListener("mousedown", onBodyMousedown);
25683
- if (bodyTouchStartHandle) {
25684
- oldBodyEl.removeEventListener("touchstart", bodyTouchStartHandle);
25685
- bodyTouchStartHandle = null;
25686
- destroyHandlers.forEach((fn) => fn());
25687
- destroyHandlers.length = 0;
25688
- }
25689
- }
25690
- if (bodyEl && params.enableRangeSelection.value) {
25691
- bodyEl.addEventListener("mousedown", onBodyMousedown);
25692
- bodyTouchStartHandle = (e3) => {
25693
- e3.cancelable && (e3.preventDefault(), e3.stopPropagation());
25694
- };
25695
- }
25696
- }
25697
- );
25698
- return {
25699
- onBodyMousedown,
25700
- onBodyTouchstart: (touchEvent) => {
25701
- dragging = false;
25702
- const touch = touchEvent.touches[0];
25703
- cacheTouch = touch;
25704
- params.bodyElementRef.value;
25705
- const endHandle = (event) => touchEndHandler(event);
25706
- const target = touchEvent.target;
25707
- const body = document.body;
25708
- batchEvent([
25709
- {
25710
- target: body,
25711
- type: "touchmove",
25712
- listener: (e) => {
25713
- e.cancelable && e.preventDefault();
25714
- },
25715
- options: { passive: false }
25716
- },
25717
- {
25718
- target,
25719
- type: "touchmove",
25720
- listener: (e) => touchMoveHandler(e),
25721
- options: { passive: true }
25722
- },
25723
- {
25724
- target,
25725
- type: "touchend",
25726
- listener: endHandle,
25727
- options: { passive: true }
25728
- },
25729
- {
25730
- target,
25731
- type: "touchcancel",
25732
- listener: endHandle,
25733
- options: { passive: true }
25734
- }
25735
- ]);
25736
- },
25737
- getStartTarget: () => startTarget
25738
- };
25739
- };
25740
-
25741
- function classNames(...args) {
25742
- const classes = [];
25743
- for (let i = 0; i < args.length; i++) {
25744
- const value = args[i];
25745
- if (!value) continue;
25746
- if (isString(value)) {
25747
- classes.push(value);
25748
- } else if (isArray(value)) {
25749
- for (let i2 = 0; i2 < value.length; i2++) {
25750
- const inner = classNames(value[i2]);
25751
- if (inner) {
25752
- classes.push(inner);
25753
- }
25754
- }
25755
- } else if (isObject(value)) {
25756
- for (const name in value) {
25757
- if (value[name]) {
25758
- classes.push(name);
25759
- }
25760
- }
25761
- }
25762
- }
25763
- return classes.join(" ");
25764
- }
25765
-
25766
- const RangeSymbolKey = Symbol("rangeSymbolKey");
25767
- const useProvideRangeStore = (parmas) => {
25768
- const {
25769
- allColumns,
25770
- flattenData,
25771
- prefixCls,
25772
- rangeSelection,
25773
- getRowByFlattenIndex,
25774
- rootRef,
25775
- bodyRef,
25776
- latestRangeStartCell,
25777
- scrollLeft,
25778
- scrollTop,
25779
- scrollTo,
25780
- showVerticalScrollbar,
25781
- showHorizontalScrollbar,
25782
- getIndexsByKey,
25783
- formatRangeCellText,
25784
- copyDelimiter
25785
- } = parmas;
25786
- const level = useInjectLevel();
25787
- useAutoScroll({
25788
- scrollContainer: bodyRef,
25789
- scrollAxis: "xy",
25790
- getVerticalPosition: () => scrollTop.value,
25791
- setVerticalPosition: (pos) => {
25792
- scrollTo(pos);
25793
- },
25794
- getHorizontalPosition: () => scrollLeft.value,
25795
- setHorizontalPosition: (pos) => scrollTo({ left: pos }),
25796
- showVerticalScrollbar,
25797
- showHorizontalScrollbar
25798
- });
25799
- const enableRangeSelection = vue.computed(() => !!rangeSelection.value);
25800
- const singleRangeSelection = vue.computed(() => "single" === rangeSelection.value);
25801
- const rangeCellClass = vue.computed(() => `${prefixCls.value}-body-cell-range-selected`);
25802
- const RangeSingleCellClass = vue.computed(() => `${prefixCls.value}-body-cell-range-single-cell`);
25803
- const RangeTopClass = vue.computed(() => `${prefixCls.value}-body-cell-range-top`);
25804
- const RangeRIghtClass = vue.computed(() => `${prefixCls.value}-body-cell-range-right`);
25805
- const RangeBottomClass = vue.computed(() => `${prefixCls.value}-body-cell-range-bottom`);
25806
- const RangeLeftClass = vue.computed(() => `${prefixCls.value}-body-cell-range-left`);
25807
- const cellRanges = vue.shallowRef([]);
25808
- const allDisplayedColumns = vue.computed(
25809
- () => allColumns.value.filter((col) => !col.__Internal__Column__)
25810
- );
25811
- vue.watch(allDisplayedColumns, (newValue) => {
25812
- cellRanges.value.forEach((cellRange) => {
25813
- cellRange.columns = cellRange.columns.filter(
25814
- (column) => newValue.find((item) => item.columnKey === column.columnKey)
25815
- );
25816
- });
25817
- cellRanges.value = cellRanges.value.filter((cellRange) => cellRange.columns.length > 0);
25818
- });
25819
- vue.watch(flattenData, () => {
25820
- const lastIndex = flattenData.value.length - 1;
25821
- cellRanges.value.forEach((cellRange) => {
25822
- const { startRow, endRow } = cellRange;
25823
- if (startRow.rowIndex > lastIndex) {
25824
- cellRange.startRow = null;
25825
- }
25826
- if (endRow.rowIndex > lastIndex) {
25827
- cellRange.endRow = null;
25828
- }
25829
- });
25830
- cellRanges.value = cellRanges.value.filter(
25831
- (cellRange) => cellRange.startRow && cellRange.endRow
25832
- );
25833
- });
25834
- const onDragStart = (mouseEvent) => {
25835
- var _a;
25836
- (_a = mouseEvent.cellInfo) == null ? void 0 : _a.level;
25837
- if (!enableRangeSelection.value) return;
25838
- const { ctrlKey, metaKey, shiftKey } = mouseEvent;
25839
- const ctrlOrMetaKey = ctrlKey || metaKey;
25840
- const isMultiple = !singleRangeSelection.value && ctrlOrMetaKey;
25841
- const rangeLength = cellRanges.value.length;
25842
- const isRangeSelected = shiftKey && rangeLength > 0;
25843
- if (!(isMultiple || isRangeSelected)) {
25844
- clearAllSelectedRange();
25845
- }
25846
- mouseEvent.cellInfo.cellPosition;
25847
- return;
25848
- };
25849
- const onDragging = (mouseEvent) => {
25850
- return;
25851
- };
25852
- const onDragStop = () => {
25853
- };
25854
- const isSelectedEmpty = vue.computed(() => 0 === cellRanges.value.length);
25855
- const Y = vue.computed(() => {
25856
- const length = cellRanges.value.length;
25857
- if (0 === length) return false;
25858
- if (length > 1) return true;
25859
- const first = cellRanges.value[0];
25860
- const n = le(first);
25861
- const o = re2(first);
25862
- return n.rowPinned !== o.rowPinned || n.rowIndex !== o.rowIndex || 1 !== (first == null ? void 0 : first.columns.length);
25863
- });
25864
- useDragSelection({
25865
- onDragStart,
25866
- onDragging,
25867
- onDragStop,
25868
- rootElementRef: rootRef,
25869
- bodyElementRef: bodyRef,
25870
- level,
25871
- enableRangeSelection
25872
- });
25873
- const X = (startRow, endRow) => {
25874
- switch (startRow.rowPinned) {
25875
- case "top":
25876
- if ("top" !== endRow.rowPinned) return true;
25877
- break;
25878
- case "bottom":
25879
- if ("bottom" !== endRow.rowPinned) return false;
25880
- break;
25881
- default:
25882
- if (endRow.rowPinned) {
25883
- return "top" !== endRow.rowPinned;
25884
- }
25885
- }
25886
- return startRow.rowIndex < endRow.rowIndex;
25887
- };
25888
- const q = (e3) => {
25889
- let t2;
25890
- return e3.forEach((e4) => {
25891
- (void 0 === t2 || X(t2, e4)) && (t2 = e4);
25892
- }), t2;
25893
- };
25894
- const Q = (e3) => {
25895
- let t2;
25896
- return e3.forEach((e4) => {
25897
- (void 0 === t2 || X(e4, t2)) && (t2 = e4);
25898
- }), t2;
25899
- };
25900
- const Z = (e3, t2) => !e3 && !t2 || !(e3 && !t2 || !e3 && t2) && e3.rowIndex === t2.rowIndex && e3.rowPinned == t2.rowPinned;
25901
- const J = (e3, t2) => {
25902
- let n, o;
25903
- const l2 = e3 === t2 || e3.columnKey === t2.columnKey, r2 = allDisplayedColumns.value.findIndex((t3) => t3.columnKey === e3.columnKey);
25904
- if (r2 < 0)
25905
- return void console.warn(
25906
- `Table: column ${null !== (n = e3.originColumn.key) && void 0 !== n ? n : e3.originColumn.dataIndex} is not valid`
25907
- );
25908
- const a2 = l2 ? r2 : allDisplayedColumns.value.findIndex((e4) => e4.columnKey === t2.columnKey);
25909
- if (a2 < 0)
25910
- return void console.warn(
25911
- `Table: column ${null !== (o = t2.originColumn.key) && void 0 !== o ? o : t2.originColumn.dataIndex} is not valid`
25912
- );
25913
- if (l2) return [e3];
25914
- const i2 = Math.min(r2, a2), s2 = i2 === r2 ? a2 : r2, u2 = [];
25915
- for (let e4 = i2; e4 <= s2; e4++) u2.push(allDisplayedColumns.value[e4]);
25916
- return u2;
25917
- };
25918
- const setRangeToCell = (e3, t2 = false) => {
25919
- if (!enableRangeSelection.value) return;
25920
- const n = J(e3.column, e3.column);
25921
- if (!n) return;
25922
- if (latestRangeStartCell.value === e3) return;
25923
- !singleRangeSelection.value && t2 || (cellRanges.value = []);
25924
- const o = { rowIndex: e3.rowIndex, rowPinned: e3.rowPinned }, l2 = { startRow: o, endRow: o, columns: n, startColumn: e3.column };
25925
- cellRanges.value.push(l2), latestRangeStartCell.value = e3, vue.triggerRef(cellRanges);
25926
- };
25927
- const te = (e3, t2) => {
25928
- const n = t2.column, o = J(e3.startColumn, n);
25929
- o && !ne(e3, t2) && (e3.columns = o, e3.endRow = { rowIndex: t2.rowIndex, rowPinned: t2.rowPinned }, vue.triggerRef(cellRanges));
25930
- };
25931
- const ne = (e3, t2) => {
25932
- const { startRow: n, endRow: o } = e3, l2 = X(n, o) ? o : n, r2 = t2.rowIndex === l2.rowIndex && t2.rowPinned === l2.rowPinned, a2 = e3.columns[0], i2 = e3.columns[e3.columns.length - 1], s2 = e3.startColumn === a2 ? i2 : a2;
25933
- return t2.column === s2 && r2;
25934
- };
25935
- const oe = (e3, t2) => {
25936
- const n = null !== t2.columns && t2.columns.find((t3) => t3.columnKey === e3.column.columnKey), o = ae2(e3.rowIndex, e3.rowPinned, t2);
25937
- return n && o;
25938
- };
25939
- const le = (cellRange) => {
25940
- var _a;
25941
- if (cellRange.startRow && cellRange.endRow) {
25942
- return X(cellRange.startRow, cellRange.endRow) ? cellRange.startRow : cellRange.endRow;
25943
- }
25944
- return { rowIndex: (_a = flattenData.value[0]) == null ? void 0 : _a.rowIndex, rowPinned: null };
25945
- };
25946
- const re2 = (e3) => {
25947
- var _a;
25948
- return e3.startRow && e3.endRow ? X(e3.startRow, e3.endRow) ? e3.endRow : e3.startRow : {
25949
- rowIndex: (_a = flattenData.value[flattenData.value.length - 1]) == null ? void 0 : _a.rowIndex,
25950
- rowPinned: null
25951
- };
25952
- };
25953
- const ae2 = (e3, t2, n) => {
25954
- const o = le(n), l2 = re2(n), r2 = { rowIndex: e3, rowPinned: t2 }, a2 = r2.rowIndex === o.rowIndex && r2.rowPinned == o.rowPinned, i2 = r2.rowIndex === l2.rowIndex && r2.rowPinned == l2.rowPinned;
25955
- if (a2 || i2) return true;
25956
- const s2 = !X(r2, o), u2 = X(r2, l2);
25957
- return s2 && u2;
25958
- };
25959
- const getCellRangeCount = (cell2) => isSelectedEmpty.value ? 0 : cellRanges.value.filter((cellRange) => oe(cell2, cellRange)).length;
25960
- const getDisplayedColBefore = (e3) => {
25961
- const t2 = allDisplayedColumns.value, n = t2.findIndex((t3) => t3.columnKey === e3.columnKey);
25962
- return n > 0 ? t2[n - 1] : null;
25963
- };
25964
- const getDisplayedColAfter = (e3) => {
25965
- const t2 = allDisplayedColumns.value, n = t2.findIndex((t3) => t3.columnKey === e3.columnKey);
25966
- return n < t2.length - 1 ? t2[n + 1] : null;
25967
- };
25968
- const ce2 = (e3) => {
25969
- if (null == e3) return null;
25970
- const t2 = allDisplayedColumns.value.find((t3) => t3.columnKey === e3);
25971
- return t2 || console.warn("Table: could not find column " + e3), t2;
25972
- };
25973
- const de2 = () => cellRanges.value;
25974
- const clearAllSelectedRange = () => {
25975
- cellRanges.value = [];
25976
- };
25977
- const appendCellToSelectedRange = (e3) => {
25978
- if (!enableRangeSelection.value) return;
25979
- const t2 = ((e4) => {
25980
- let t3, n = false;
25981
- if (e4.columnsKey) t3 = e4.columnsKey.map((e5) => ce2(e5)).filter((e5) => e5);
25982
- else {
25983
- const o = ce2(e4.columnStartKey), l2 = ce2(e4.columnEndKey);
25984
- if (!o || !l2) return;
25985
- t3 = J(o, l2), t3 && t3.length && (n = t3[0] !== o);
25986
- }
25987
- if (!t3) return;
25988
- return {
25989
- startRow: null != e4.rowStartIndex ? { rowIndex: e4.rowStartIndex, rowPinned: null } : void 0,
25990
- endRow: null != e4.rowEndIndex ? { rowIndex: e4.rowEndIndex, rowPinned: null } : void 0,
25991
- columns: t3,
25992
- startColumn: n ? t3[t3.length - 1] : t3[0]
25993
- };
25994
- })(e3);
25995
- t2 && (t2.startRow && (latestRangeStartCell.value = {
25996
- rowIndex: t2.startRow.rowIndex,
25997
- rowPinned: t2.startRow.rowPinned,
25998
- column: t2.startColumn
25999
- }), cellRanges.value.push(t2));
26000
- };
26001
- const fe2 = (e3) => {
26002
- enableRangeSelection.value && (clearAllSelectedRange(), appendCellToSelectedRange(e3));
26003
- };
26004
- const focusCell = (e3) => {
26005
- let t2, n;
26006
- const o = null === (t2 = getRowByFlattenIndex(e3.rowIndex)) || void 0 === t2 ? void 0 : t2.rowKey, l2 = null === (n = e3.column) || void 0 === n ? void 0 : n.columnKey;
26007
- if (void 0 !== o && void 0 !== l2 && rootRef.value) {
26008
- const e4 = rootRef.value.querySelector(
26009
- `[data-row-key="${o}"] [data-column-key="${l2}"][data-level="${level}"]`
26010
- );
26011
- if (e4) {
26012
- const t4 = e4.getElementsByTagName("input")[0];
26013
- e4.focus();
26014
- t4 && t4.focus();
26015
- }
26016
- }
26017
- };
26018
- const intersectLastRange = (fromMouseClick = false) => {
26019
- if (singleRangeSelection.value) return;
26020
- if (isSelectedEmpty.value) return;
26021
- const lastCellRange2 = cellRanges.value[cellRanges.value.length - 1];
26022
- const n = le(lastCellRange2);
26023
- const o = re2(lastCellRange2);
26024
- const l2 = [];
26025
- cellRanges.value.slice(0, -1).forEach((e4) => {
26026
- const r2 = le(e4), a2 = re2(e4), i2 = e4.columns, s2 = i2.filter((e5) => -1 === (lastCellRange2 == null ? void 0 : lastCellRange2.columns.indexOf(e5)));
26027
- if (s2.length !== i2.length)
26028
- if (X(o, r2) || X(a2, n)) l2.push(e4);
26029
- else {
26030
- if (X(r2, n)) {
26031
- const e5 = {
26032
- columns: [...i2],
26033
- startColumn: lastCellRange2 == null ? void 0 : lastCellRange2.startColumn,
26034
- startRow: Object.assign({}, r2),
26035
- endRow: navigationService.getRowAbove(n)
26036
- };
26037
- l2.push(e5);
26038
- }
26039
- if (s2.length > 0) {
26040
- const e5 = {
26041
- columns: s2,
26042
- startColumn: s2.find((e6) => e6.columnKey === (lastCellRange2 == null ? void 0 : lastCellRange2.startColumn.columnKey)) ? lastCellRange2 == null ? void 0 : lastCellRange2.startColumn : s2[0],
26043
- startRow: q([Object.assign({}, n), Object.assign({}, r2)]),
26044
- endRow: Q([Object.assign({}, o), Object.assign({}, a2)])
26045
- };
26046
- l2.push(e5);
26047
- }
26048
- X(o, a2) && l2.push({
26049
- columns: [...i2],
26050
- startColumn: lastCellRange2 == null ? void 0 : lastCellRange2.startColumn,
26051
- startRow: navigationService.getRowBelow(o),
26052
- endRow: Object.assign({}, a2)
26053
- });
26054
- }
26055
- else l2.push(e4);
26056
- }), cellRanges.value = l2;
26057
- };
26058
- vue.watch(latestRangeStartCell, () => {
26059
- latestRangeStartCell.value && focusCell(latestRangeStartCell.value);
26060
- });
26061
- const ensureCellVisible = (cell2) => {
26062
- parmas.ensureCellRowVisible(cell2);
26063
- parmas.ensureCellColumnVisible(cell2);
26064
- };
26065
- const navigationService = useCellNavigation({
26066
- getDisplayedColBefore,
26067
- getDisplayedColAfter,
26068
- allDisplayedColumns,
26069
- setRangeToCell,
26070
- focusCell,
26071
- ensureCellVisible,
26072
- ...parmas
26073
- });
26074
- vue.provide(RangeSymbolKey, {
26075
- cellRanges,
26076
- extendLatestRangeToCell: (e3) => {
26077
- if (isSelectedEmpty.value || !latestRangeStartCell.value) return;
26078
- const t2 = cellRanges.value[cellRanges.value.length - 1];
26079
- te(t2, e3);
26080
- },
26081
- setRangeToCell,
26082
- onDragStart,
26083
- onDragging,
26084
- isCellInAnyRange: (cell2) => getCellRangeCount(cell2) > 0,
26085
- getRangeCellClass: (e3) => {
26086
- const t2 = getCellRangeCount(e3), n = ((e4) => {
26087
- let t3 = false, n2 = false, o2 = false, l3 = false;
26088
- const r3 = e4.column;
26089
- let a3, i3;
26090
- a3 = getDisplayedColBefore(r3), i3 = getDisplayedColAfter(r3);
26091
- const s2 = cellRanges.value.filter((t4) => oe(e4, t4));
26092
- a3 || (l3 = true), i3 || (n2 = true);
26093
- for (let r4 = 0; r4 < s2.length && !(t3 && n2 && o2 && l3); r4++) {
26094
- const u2 = s2[r4], c2 = le(u2), d = re2(u2);
26095
- !t3 && Z(c2, e4) && (t3 = true), !o2 && Z(d, e4) && (o2 = true), !l3 && a3 && u2.columns.findIndex((e5) => e5.columnKey === a3.columnKey) < 0 && (l3 = true), !n2 && i3 && u2.columns.findIndex((e5) => e5.columnKey === i3.columnKey) < 0 && (n2 = true);
26096
- }
26097
- return { top: t3, right: n2, bottom: o2, left: l3 };
26098
- })(e3), o = 1 === t2 && !Y.value, l2 = !o && n.top, r2 = !o && n.right, a2 = !o && n.bottom, i2 = !o && n.left;
26099
- return classNames({
26100
- [rangeCellClass.value]: 0 !== t2,
26101
- [`${rangeCellClass.value}-1`]: 1 === t2,
26102
- [`${rangeCellClass.value}-2`]: 2 === t2,
26103
- [`${rangeCellClass.value}-3`]: 3 === t2,
26104
- [`${rangeCellClass.value}-4`]: t2 >= 4,
26105
- [RangeSingleCellClass.value]: o,
26106
- [RangeTopClass.value]: l2,
26107
- [RangeRIghtClass.value]: r2,
26108
- [RangeBottomClass.value]: a2,
26109
- [RangeLeftClass.value]: i2
26110
- });
26111
- },
26112
- enableRangeSelection,
26113
- singleRangeSelection,
26114
- getDisplayedColBefore,
26115
- getDisplayedColAfter,
26116
- navigationService,
26117
- extendLatestRangeInDirection: (e3) => {
26118
- if (isSelectedEmpty.value || !latestRangeStartCell.value) return;
26119
- const t2 = e3.keyCode, n = e3.ctrlKey || e3.metaKey, o = cellRanges.value[cellRanges.value.length - 1], l2 = latestRangeStartCell.value, r2 = o.columns[0], a2 = o.columns[o.columns.length - 1], i2 = o.endRow.rowIndex, s2 = o.endRow.rowPinned, u2 = {
26120
- column: l2.column === r2 ? a2 : r2,
26121
- rowIndex: i2,
26122
- rowPinned: s2
26123
- }, d = navigationService.getNextCellToFocus(t2, u2, n);
26124
- return d ? (fe2({
26125
- rowStartIndex: l2.rowIndex,
26126
- rowEndIndex: d.rowIndex,
26127
- columnStartKey: l2.column.columnKey,
26128
- columnEndKey: d.column.columnKey
26129
- }), d) : void 0;
26130
- },
26131
- allDisplayedColumns,
26132
- focusCell,
26133
- ensureCellVisible,
26134
- getCellRangeCount,
26135
- intersectLastRange,
26136
- level
26137
- });
26138
- const copySelectedRange = () => {
26139
- const e3 = de2(), t2 = [];
26140
- let n = "";
26141
- e3.forEach((e4) => {
26142
- const { startRow: n2, endRow: o, columns: r2 } = e4, [a2, i2] = [n2.rowIndex, o.rowIndex].sort((e5, t3) => e5 - t3);
26143
- let s2 = allDisplayedColumns.value.findIndex((e5) => {
26144
- var _a;
26145
- return e5.columnKey === ((_a = r2[0]) == null ? void 0 : _a.columnKey);
26146
- }), u2 = allDisplayedColumns.value.findIndex(
26147
- (e5) => {
26148
- var _a;
26149
- return e5.columnKey === ((_a = r2[r2.length - 1]) == null ? void 0 : _a.columnKey);
26150
- }
26151
- );
26152
- [s2, u2] = [s2, u2].sort((e5, t3) => e5 - t3);
26153
- const c2 = [];
26154
- for (let e5 = a2; e5 <= i2; e5++) {
26155
- const t3 = flattenData.value[e5];
26156
- if (t3 && !t3.isExpandRow) {
26157
- const n3 = t3.rowKey, o2 = [], l2 = getIndexsByKey(n3);
26158
- for (let r3 = s2; r3 <= u2; r3++) {
26159
- const originColumn = allDisplayedColumns.value[r3].originColumn;
26160
- const i3 = originColumn.dataIndex ? getPathValue(t3.record, originColumn.dataIndex) : void 0;
26161
- if (originColumn) {
26162
- const r4 = {
26163
- record: t3.record,
26164
- column: originColumn,
26165
- index: e5,
26166
- recordIndexs: l2,
26167
- key: n3,
26168
- value: i3
26169
- };
26170
- o2.push(formatRangeCellText(r4));
26171
- }
26172
- }
26173
- c2.push(o2.join(copyDelimiter.value));
26174
- }
26175
- }
26176
- t2.push(c2);
26177
- }), n = t2.map((e4) => e4.join("prefixCls\n")).join("prefixCls\n"), ((e4) => {
26178
- let t3, n2;
26179
- const o = document.activeElement, l2 = document.createElement("textarea");
26180
- l2.style.position = "absolute", l2.style.opacity = "0", l2.style.width = "1px", l2.style.height = "1px", l2.value = e4 || " ", document.body.appendChild(l2), l2.select(), l2.focus({ preventScroll: true }), document.execCommand("copy") || console.warn("Table: copy failed, Browser did not allow document.execCommand('copy')"), document.body.removeChild(l2), null !== o && (null === (n2 = (t3 = o).focus) || void 0 === n2 || n2.call(t3, { preventScroll: true }));
26181
- })(n);
26182
- };
26183
- return {
26184
- getSelectedRange: () => {
26185
- const e3 = de2(), t2 = [];
26186
- return e3.forEach((e4) => {
26187
- const { startColumn: n, startRow: o, endRow: r2, columns: a2 } = e4, i2 = flattenData.value[o.rowIndex], s2 = flattenData.value[r2.rowIndex], u2 = {
26188
- startColumn: n.originColumn,
26189
- startRow: {
26190
- rowIndex: i2.rowIndex,
26191
- recordIndexs: getIndexsByKey(i2.rowKey)
26192
- },
26193
- endRow: {
26194
- rowIndex: s2.rowIndex,
26195
- recordIndexs: getIndexsByKey(s2.rowKey)
26196
- },
26197
- columns: a2.map((e5) => e5.originColumn),
26198
- flattenData: flattenData.value
26199
- };
26200
- t2.push(u2);
26201
- }), t2;
26202
- },
26203
- appendCellToSelectedRange,
26204
- clearAllSelectedRange,
26205
- setCellRanges: (e3) => {
26206
- enableRangeSelection.value && (cellRanges.value = e3);
26207
- },
26208
- getCellRangeCount,
26209
- navigationService,
26210
- copySelectedRange,
26211
- onBodyKeydown: (e3) => {
26212
- if (!e3.ctrlKey && !e3.metaKey || !enableRangeSelection.value) return;
26213
- if (isOverFormFieldElement(e3)) return;
26214
- switch (e3.keyCode) {
26215
- case KeyCode.C:
26216
- copySelectedRange();
26217
- break;
26218
- case KeyCode.A:
26219
- (() => {
26220
- if (!enableRangeSelection.value) return;
26221
- const e4 = allDisplayedColumns.value;
26222
- 0 !== e4.length && fe2({
26223
- rowStartIndex: 0,
26224
- rowEndIndex: flattenData.value.length - 1,
26225
- columnStartKey: e4[0].columnKey,
26226
- columnEndKey: e4[e4.length - 1].columnKey
26227
- });
26228
- })();
26229
- }
26230
- e3.preventDefault();
26231
- }
26232
- };
26233
- };
26234
- const useInjectRangeStore = () => {
26235
- return vue.inject(RangeSymbolKey, {});
26236
- };
26237
-
26238
25668
  var MapShim = (function() {
26239
25669
  if (typeof Map !== "undefined") {
26240
25670
  return Map;
@@ -28678,6 +28108,31 @@
28678
28108
  return { data, pos };
28679
28109
  }
28680
28110
 
28111
+ function classNames(...args) {
28112
+ const classes = [];
28113
+ for (let i = 0; i < args.length; i++) {
28114
+ const value = args[i];
28115
+ if (!value) continue;
28116
+ if (isString(value)) {
28117
+ classes.push(value);
28118
+ } else if (isArray(value)) {
28119
+ for (let i2 = 0; i2 < value.length; i2++) {
28120
+ const inner = classNames(value[i2]);
28121
+ if (inner) {
28122
+ classes.push(inner);
28123
+ }
28124
+ }
28125
+ } else if (isObject(value)) {
28126
+ for (const name in value) {
28127
+ if (value[name]) {
28128
+ classes.push(name);
28129
+ }
28130
+ }
28131
+ }
28132
+ }
28133
+ return classes.join(" ");
28134
+ }
28135
+
28681
28136
  const useCellProps = ({
28682
28137
  leftColumns,
28683
28138
  rightColumns,
@@ -28690,6 +28145,10 @@
28690
28145
  leftWidth,
28691
28146
  centerWidth,
28692
28147
  getRowHeight,
28148
+ cancelEditable,
28149
+ startEditable,
28150
+ saveEditable,
28151
+ isEditable,
28693
28152
  customCell: contextCustomCell
28694
28153
  }) => {
28695
28154
  const allCellProps = vue.shallowRef({});
@@ -28712,6 +28171,10 @@
28712
28171
  value,
28713
28172
  record,
28714
28173
  index: rowIndex,
28174
+ cancelEditable,
28175
+ startEditable,
28176
+ saveEditable,
28177
+ isEditable,
28715
28178
  column: originColumn
28716
28179
  });
28717
28180
  if (customCellRender && isObject$4(customCellRender) && !isArray$2(customCellRender) && !vue.isVNode(customCellRender)) {
@@ -32189,114 +31652,6 @@
32189
31652
  return vue.inject(BodyRowContextKey, {});
32190
31653
  };
32191
31654
 
32192
- const useCellSelection = () => {
32193
- const {
32194
- isCellInAnyRange,
32195
- cellRanges,
32196
- extendLatestRangeToCell,
32197
- setRangeToCell,
32198
- enableRangeSelection,
32199
- getCellRangeCount,
32200
- intersectLastRange,
32201
- level
32202
- } = useInjectRangeStore();
32203
- return {
32204
- onCellMousedown: (mouseEvent, cellPosition) => {
32205
- const { ctrlKey, metaKey, shiftKey } = mouseEvent;
32206
- if (!(!isCellInAnyRange(cellPosition) || 2 !== mouseEvent.button)) return;
32207
- const isRanges = !cellRanges.value.length;
32208
- if (shiftKey && isRanges) {
32209
- mouseEvent.preventDefault();
32210
- }
32211
- if (shiftKey) {
32212
- extendLatestRangeToCell(cellPosition);
32213
- } else {
32214
- setRangeToCell(cellPosition, ctrlKey || metaKey);
32215
- }
32216
- mouseEvent.cellInfo = {
32217
- cellPosition,
32218
- cellTarget: mouseEvent.currentTarget,
32219
- level
32220
- };
32221
- },
32222
- onCellMousemove: (mouseEvent, cellPosition) => {
32223
- mouseEvent.cellInfo = {
32224
- cellPosition,
32225
- cellTarget: mouseEvent.currentTarget,
32226
- level
32227
- };
32228
- },
32229
- onCellClick: (mouseEvent, cellPosition) => {
32230
- const mouseKey = mouseEvent.ctrlKey || mouseEvent.metaKey;
32231
- enableRangeSelection.value && mouseKey && getCellRangeCount(cellPosition) > 1 && intersectLastRange(true);
32232
- }
32233
- };
32234
- };
32235
-
32236
- const useCellKeyboard = () => {
32237
- const {
32238
- enableRangeSelection,
32239
- navigationService,
32240
- extendLatestRangeInDirection,
32241
- focusCell,
32242
- ensureCellVisible
32243
- } = useInjectRangeStore();
32244
- const directionOrEnterHandle = (event, payload) => {
32245
- if (!payload.isEditing) {
32246
- event.shiftKey && enableRangeSelection.value ? selectRange(event) : navigationService.navigateToNextCell(event, payload.cellPosition);
32247
- event.preventDefault();
32248
- }
32249
- };
32250
- const { props } = useInjectTable();
32251
- const selectRange = (event) => {
32252
- const latestRange = extendLatestRangeInDirection(event);
32253
- latestRange && ensureCellVisible(latestRange);
32254
- };
32255
- const escHandle = (_, payload) => {
32256
- payload.isEditing && focusCell(payload.cellPosition);
32257
- };
32258
- const tabHandle = (event, payload) => {
32259
- navigationService.onTabKeyDown(payload.cellPosition, event);
32260
- };
32261
- return {
32262
- onCellKeydown: (event, payload) => {
32263
- if (props.onCellKeydown && false === props.onCellKeydown(event, {
32264
- isEditing: payload.isEditing,
32265
- cellPosition: {
32266
- column: payload.cellPosition.column.originColumn,
32267
- rowIndex: payload.cellPosition.rowIndex
32268
- }
32269
- })) {
32270
- return;
32271
- }
32272
- const { keyCode } = event;
32273
- const target = event.target;
32274
- switch (keyCode) {
32275
- case KeyCode.RIGHT:
32276
- case KeyCode.LEFT:
32277
- if (!("INPUT" === (target == null ? void 0 : target.tagName) || "TEXTAREA" === (target == null ? void 0 : target.tagName) || (target == null ? void 0 : target.isContentEditable))) {
32278
- directionOrEnterHandle(event, payload);
32279
- }
32280
- break;
32281
- case KeyCode.DOWN:
32282
- case KeyCode.UP:
32283
- case KeyCode.ENTER:
32284
- if (!((target2) => "TEXTAREA" === target2.tagName || target2.isContentEditable)(
32285
- event.target
32286
- )) {
32287
- directionOrEnterHandle(event, payload);
32288
- }
32289
- break;
32290
- case KeyCode.ESC:
32291
- escHandle(event, payload);
32292
- break;
32293
- case KeyCode.TAB:
32294
- tabHandle(event, payload);
32295
- }
32296
- }
32297
- };
32298
- };
32299
-
32300
31655
  const eventCache = {};
32301
31656
  const eventMap = {
32302
31657
  select: "input",
@@ -32313,6 +31668,68 @@
32313
31668
  return eventCache[eventName = "on" + eventName] = eventName in dom;
32314
31669
  };
32315
31670
 
31671
+ const useAutoScroll = (params) => {
31672
+ const {
31673
+ scrollContainer,
31674
+ scrollAxis,
31675
+ onScrollCallback = () => {
31676
+ },
31677
+ showVerticalScrollbar,
31678
+ showHorizontalScrollbar
31679
+ } = params;
31680
+ let timer = null;
31681
+ let i = 0;
31682
+ let hasLeft = false;
31683
+ let hasRight = false;
31684
+ let hasTop = false;
31685
+ let hasBottom = false;
31686
+ const isXAxis = -1 !== scrollAxis.indexOf("x");
31687
+ const isYAxis = -1 !== scrollAxis.indexOf("y");
31688
+ const scrollByTick = vue.computed(() => {
31689
+ var _a, _b;
31690
+ return (_b = (_a = params.scrollByTick) == null ? void 0 : _a.value) != null ? _b : 20;
31691
+ });
31692
+ const exec = () => {
31693
+ if (null === timer) {
31694
+ timer = window.setInterval(handle, 100);
31695
+ i = 0;
31696
+ }
31697
+ };
31698
+ const handle = () => {
31699
+ i++;
31700
+ const boundary = i > 20 ? 200 : i > 10 ? 80 : 40;
31701
+ if (isYAxis) {
31702
+ const position = params.getVerticalPosition();
31703
+ hasTop && params.setVerticalPosition(position - boundary), hasBottom && params.setVerticalPosition(position + boundary);
31704
+ }
31705
+ if (isXAxis) {
31706
+ const position = params.getHorizontalPosition();
31707
+ hasLeft && params.setHorizontalPosition(position - boundary), hasRight && params.setHorizontalPosition(position + boundary);
31708
+ }
31709
+ onScrollCallback();
31710
+ };
31711
+ const clear = () => {
31712
+ if (timer) {
31713
+ window.clearInterval(timer);
31714
+ timer = null;
31715
+ }
31716
+ };
31717
+ return {
31718
+ check: (mouseEvent, forceSkipVerticalScroll = false) => {
31719
+ const hasVerticalScroll = forceSkipVerticalScroll || !showVerticalScrollbar.value;
31720
+ if (hasVerticalScroll && !showHorizontalScrollbar.value) return;
31721
+ const clientRect = scrollContainer.value.getBoundingClientRect();
31722
+ const tick = scrollByTick.value;
31723
+ hasLeft = mouseEvent.clientX < clientRect.left + tick;
31724
+ hasRight = mouseEvent.clientX > clientRect.right - tick;
31725
+ hasTop = mouseEvent.clientY < clientRect.top + tick && !hasVerticalScroll;
31726
+ hasBottom = mouseEvent.clientY > clientRect.bottom - tick && !hasVerticalScroll;
31727
+ return hasLeft || hasRight || hasTop || hasBottom ? exec() : clear();
31728
+ },
31729
+ ensureCleared: clear
31730
+ };
31731
+ };
31732
+
32316
31733
  var _sfc_main$o = vue.defineComponent({
32317
31734
  name: "RowDragHandler",
32318
31735
  props: {
@@ -32836,188 +32253,6 @@
32836
32253
  }
32837
32254
  });
32838
32255
 
32839
- var _sfc_main$n = vue.defineComponent({
32840
- inheritAttrs: false,
32841
- props: {
32842
- prefixCls: { type: String },
32843
- recordIndexs: { type: Array },
32844
- rowKey: { type: [Number, String] },
32845
- column: { type: Object, default: () => ({}) },
32846
- record: { type: Object, default: () => ({}) },
32847
- value: { validator: () => true },
32848
- customEditable: { type: Boolean, default: false },
32849
- multiple: { type: Boolean, default: false },
32850
- autoHeight: { type: Boolean, default: false },
32851
- cellKey: { type: String },
32852
- getPopupContainer: Function,
32853
- onCloseEditor: Function,
32854
- onKeydown: Function
32855
- },
32856
- emits: ["closeEditor", "keydown"],
32857
- setup(props, { expose, emit }) {
32858
- var _a, _b, _c;
32859
- const tableSlots = useInjectSlots();
32860
- const popup = useInjectPopup();
32861
- const oldValue = (_c = (_b = (_a = props.column) == null ? void 0 : _a.valueGetter) == null ? void 0 : _b.call(_a, {
32862
- value: props.value,
32863
- record: props.record,
32864
- column: props.column,
32865
- recordIndexs: props.recordIndexs
32866
- })) != null ? _c : props.value;
32867
- const modelValue = vue.ref(oldValue);
32868
- const inputRef = vue.shallowRef(null);
32869
- const tableContext = useInjectTable();
32870
- vue.onMounted(() => {
32871
- vue.nextTick(() => {
32872
- var _a2, _b2, _c2, _d;
32873
- if (inputRef.value && !props.multiple) {
32874
- (_b2 = (_a2 = inputRef.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b2.call(_a2);
32875
- (_d = (_c2 = inputRef.value) == null ? void 0 : _c2.select) == null ? void 0 : _d.call(_c2);
32876
- }
32877
- });
32878
- });
32879
- expose({ value: modelValue, inputRef });
32880
- const onInput = (e, val) => {
32881
- var _a2, _b2;
32882
- (_b2 = (_a2 = props.column).valueChange) == null ? void 0 : _b2.call(_a2, e, {
32883
- column: props.column,
32884
- record: props.record,
32885
- recordIndexs: props.recordIndexs,
32886
- newValue: val,
32887
- oldValue
32888
- });
32889
- };
32890
- const childrenColumnName = vue.computed(() => tableContext.props.childrenColumnName || "children");
32891
- const save = () => {
32892
- var _a2, _b2, _c2;
32893
- const recordIndexs = props.recordIndexs;
32894
- let dataSource = tableContext.props.dataSource || [];
32895
- let record = {};
32896
- recordIndexs.forEach((index) => {
32897
- record = dataSource[index];
32898
- dataSource = record[childrenColumnName.value] || [];
32899
- });
32900
- const value = (_c2 = (_b2 = (_a2 = props.column).valueParser) == null ? void 0 : _b2.call(_a2, {
32901
- column: props.column,
32902
- record,
32903
- recordIndexs,
32904
- newValue: modelValue.value,
32905
- oldValue
32906
- })) != null ? _c2 : modelValue.value;
32907
- const valueSetter = props.column.valueSetter;
32908
- if (valueSetter) {
32909
- const result = valueSetter({
32910
- column: props.column,
32911
- record,
32912
- recordIndexs,
32913
- newValue: modelValue.value,
32914
- oldValue
32915
- });
32916
- if (isPromise(result)) {
32917
- result.then((res) => {
32918
- res && emit("closeEditor", [props.cellKey]);
32919
- }).catch(() => {
32920
- });
32921
- return;
32922
- }
32923
- result && emit("closeEditor", [props.cellKey]);
32924
- } else {
32925
- devWarning(
32926
- void 0 !== props.column.dataIndex || null !== props.column.dataIndex,
32927
- "Editable",
32928
- "If not have column dataIndex, you should to set valueSetter for editable columns, otherwise the value cannot be modified."
32929
- );
32930
- set(record, props.column.dataIndex, value);
32931
- emit("closeEditor", [props.cellKey]);
32932
- }
32933
- };
32934
- let isKeyDown = false;
32935
- const closeEditor = (key) => {
32936
- emit("closeEditor", key != null ? key : [props.cellKey]);
32937
- };
32938
- return {
32939
- modelValue,
32940
- inputRef,
32941
- handleInput: (e) => {
32942
- var _a2;
32943
- onInput(e, (_a2 = e.target) == null ? void 0 : _a2.value);
32944
- },
32945
- handleKeyDown: (e) => {
32946
- const { which } = e;
32947
- if (which === KeyCode.ENTER) {
32948
- save();
32949
- } else {
32950
- if (which === KeyCode.ESC) {
32951
- isKeyDown = true;
32952
- emit("closeEditor", null);
32953
- }
32954
- emit("keydown", e);
32955
- }
32956
- },
32957
- handleBlur: () => {
32958
- isKeyDown || props.multiple || save();
32959
- },
32960
- tableSlots,
32961
- popup,
32962
- save,
32963
- closeEditor,
32964
- getCustomEditorProps: () => ({
32965
- modelValue,
32966
- save,
32967
- onInput,
32968
- closeEditor,
32969
- column: props.column.originColumn,
32970
- editorRef: inputRef,
32971
- getPopupContainer: props.getPopupContainer,
32972
- record: props.record,
32973
- recordIndexs: props.recordIndexs
32974
- })
32975
- };
32976
- }
32977
- });
32978
-
32979
- const _hoisted_1$8 = ["data-cell-auto"];
32980
- function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
32981
- return vue.openBlock(), vue.createElementBlock("div", {
32982
- class: vue.normalizeClass(`${_ctx.prefixCls}-cell-edit-inner`),
32983
- "data-cell-auto": _ctx.autoHeight
32984
- }, [
32985
- _ctx.customEditable ? (vue.openBlock(), vue.createElementBlock(
32986
- vue.Fragment,
32987
- { key: 0 },
32988
- [
32989
- _ctx.tableSlots.cellEditor ? (vue.openBlock(), vue.createBlock(
32990
- vue.resolveDynamicComponent(_ctx.tableSlots.cellEditor),
32991
- vue.normalizeProps(vue.mergeProps({ key: 0 }, _ctx.getCustomEditorProps())),
32992
- null,
32993
- 16
32994
- /* FULL_PROPS */
32995
- )) : vue.createCommentVNode("v-if", true)
32996
- ],
32997
- 64
32998
- /* STABLE_FRAGMENT */
32999
- )) : vue.withDirectives((vue.openBlock(), vue.createElementBlock(
33000
- "input",
33001
- {
33002
- key: 1,
33003
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.modelValue = $event),
33004
- ref: "inputRef",
33005
- class: vue.normalizeClass(`${_ctx.prefixCls}-cell-edit-input`),
33006
- type: "text",
33007
- onInput: _cache[1] || (_cache[1] = (...args) => _ctx.handleInput && _ctx.handleInput(...args)),
33008
- onKeydown: _cache[2] || (_cache[2] = (...args) => _ctx.handleKeyDown && _ctx.handleKeyDown(...args)),
33009
- onBlur: _cache[3] || (_cache[3] = (...args) => _ctx.handleBlur && _ctx.handleBlur(...args))
33010
- },
33011
- null,
33012
- 34
33013
- /* CLASS, NEED_HYDRATION */
33014
- )), [
33015
- [vue.vModelText, _ctx.modelValue]
33016
- ])
33017
- ], 10, _hoisted_1$8);
33018
- }
33019
- var EditInput = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$j]]);
33020
-
33021
32256
  const cellProps = {
33022
32257
  prefixCls: String,
33023
32258
  rowIndex: { type: Number, required: true },
@@ -33034,41 +32269,30 @@
33034
32269
  tooltipOpen: Boolean,
33035
32270
  getPopupContainer: Function,
33036
32271
  onCellLeave: Function,
33037
- editCellKeys: Array,
33038
- onOpenEditor: Function,
33039
- onCloseEditor: Function,
33040
- onMousedown: Function,
33041
- onMousemove: Function,
33042
- onKeydown: Function,
33043
32272
  onClick: Function
33044
32273
  };
33045
32274
  let lastClickTime = 0;
32275
+ const hasSupportedDblclick = () => {
32276
+ if (!isIOSUserAgent() || isEventSupported("dblclick")) return false;
32277
+ const now = (/* @__PURE__ */ new Date()).getTime();
32278
+ const is = now - lastClickTime < 200;
32279
+ lastClickTime = now;
32280
+ return is;
32281
+ };
33046
32282
  const ValueStatusEnum = {
33047
32283
  success: "#03bf64",
33048
32284
  processing: "#315efb",
33049
32285
  error: "#e8353e",
33050
32286
  warning: "#eb8903"
33051
32287
  };
33052
- const BodyCell = (props, { slots, emit }) => {
32288
+ const BodyCell$1 = (props, { slots, emit }) => {
33053
32289
  var _a, _b, _c, _d, _e, _f, _g, _h;
33054
32290
  const { table } = useProConfigInject();
33055
32291
  const tableSlotsContext = useInjectSlots();
33056
32292
  const tableContext = useInjectTable();
33057
32293
  const { onBodyCellContextmenu } = useInjectBody();
33058
- const { getRangeCellClass } = useInjectRangeStore();
33059
32294
  const level = useInjectLevel();
33060
- const { oldValuesMap } = useEditInject();
33061
- const {
33062
- prefixCls,
33063
- column,
33064
- wrapText,
33065
- rowKey,
33066
- item,
33067
- rowIndex,
33068
- hasAppendNode,
33069
- tooltipOpen,
33070
- editCellKeys
33071
- } = props;
32295
+ const { prefixCls, column, wrapText, rowKey, item, rowIndex, hasAppendNode, tooltipOpen } = props;
33072
32296
  const columnKey = column.columnKey;
33073
32297
  const valueEnum = runFunction(column == null ? void 0 : column.valueEnum, props.item);
33074
32298
  const rowDrag = typeof column.rowDrag == "function" ? column.rowDrag({ record: item, column: column.originColumn }) : !!column.rowDrag;
@@ -33078,22 +32302,8 @@
33078
32302
  const sorterInfo = { sorterOrder };
33079
32303
  const key = `${props.rowKey} ${columnKey}`;
33080
32304
  const value = column.dataIndex ? column.renderText ? column.renderText(get(item, column.dataIndex), item, rowIndex) : get(item, column.dataIndex) : void 0;
33081
- const valueStatus = runFunction(column == null ? void 0 : column.valueStatus, value, props.item);
32305
+ const valueStatus = runFunction(column == null ? void 0 : column.valueStatus, value, props.item, valueEnum == null ? void 0 : valueEnum[value]);
33082
32306
  const recordIndexs = tableContext.getIndexsByKey(rowKey);
33083
- let customEditable = false;
33084
- let isEditing = editCellKeys == null ? void 0 : editCellKeys.includes(key);
33085
- if (isEditing) {
33086
- const editable = "function" == typeof column.editable && column.editable({
33087
- record: item,
33088
- column: column.originColumn,
33089
- recordIndexs,
33090
- value
33091
- });
33092
- customEditable = "cellEditorSlot" === column.editable || "cellEditorSlot" === editable;
33093
- isEditing = isEditing && (customEditable && !!tableSlotsContext.cellEditor || true === column.editable || !!editable);
33094
- }
33095
- let { editableTrigger = ["dblClick"] } = column;
33096
- editableTrigger = Array.isArray(editableTrigger) ? editableTrigger : [editableTrigger];
33097
32307
  const cellInnerClass = { [`${prefixCls}-cell-inner`]: true };
33098
32308
  const cellContentClass = {
33099
32309
  [`${prefixCls}-cell-content`]: true,
@@ -33114,7 +32324,6 @@
33114
32324
  const cellRender = ((_b = (_a = tableContext.allCellProps.value) == null ? void 0 : _a[rowKey]) == null ? void 0 : _b[column.columnKey]) || {};
33115
32325
  const cellProps2 = cellRender.props || {};
33116
32326
  const cellRowSpan = cellProps2.rowSpan;
33117
- const cellPosition = { rowIndex: props.flattenRowIndex, rowPinned: null, column };
33118
32327
  const cellClass = {
33119
32328
  [`${prefixCls}-cell`]: true,
33120
32329
  [`${prefixCls}-first-cell`]: column.columnIndex === 0,
@@ -33122,60 +32331,7 @@
33122
32331
  [`${prefixCls}-cell-multi`]: cellRowSpan > 1,
33123
32332
  [`${prefixCls}-cell-hidden`]: cellRowSpan === 0,
33124
32333
  [`${prefixCls}-column-sort`]: sorterInfo.sorterOrder,
33125
- [`${prefixCls}-with-append`]: hasAppendNode,
33126
- [`${prefixCls}-cell-inline-edit`]: isEditing,
33127
- [getRangeCellClass(cellPosition)]: true
33128
- };
33129
- const openEditor = () => {
33130
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
33131
- const oldValue = (_c2 = (_b2 = (_a2 = props.column) == null ? void 0 : _a2.valueGetter) == null ? void 0 : _b2.call(_a2, {
33132
- value,
33133
- record: item,
33134
- column,
33135
- recordIndexs
33136
- })) != null ? _c2 : value;
33137
- const beforeOpen = (_e2 = (_d2 = tableContext.props) == null ? void 0 : _d2.onBeforeOpenEditor) == null ? void 0 : _e2.call(_d2, cellRenderArgs);
33138
- if (isPromise(beforeOpen)) {
33139
- beforeOpen.then((res) => {
33140
- var _a3, _b3;
33141
- if (res) {
33142
- emit("openEditor", key, { [key]: oldValue });
33143
- (_b3 = (_a3 = tableContext.props) == null ? void 0 : _a3.onOpenEditor) == null ? void 0 : _b3.call(_a3, cellRenderArgs);
33144
- }
33145
- });
33146
- } else {
33147
- if (false !== beforeOpen) {
33148
- emit("openEditor", key, { [key]: oldValue });
33149
- (_g2 = (_f2 = tableContext.props) == null ? void 0 : _f2.onOpenEditor) == null ? void 0 : _g2.call(_f2, cellRenderArgs);
33150
- }
33151
- }
33152
- };
33153
- const closeEditor = (currentKey) => {
33154
- var _a2, _b2, _c2, _d2;
33155
- const beforeClose = (_b2 = (_a2 = tableContext.props) == null ? void 0 : _a2.onBeforeCloseEditor) == null ? void 0 : _b2.call(_a2, {
33156
- ...cellRenderArgs,
33157
- oldValue: oldValuesMap.value[key]
33158
- });
33159
- if (isPromise(beforeClose)) {
33160
- beforeClose.then((res) => {
33161
- var _a3, _b3;
33162
- if (res) {
33163
- emit("closeEditor", currentKey != null ? currentKey : key);
33164
- (_b3 = (_a3 = tableContext.props) == null ? void 0 : _a3.onCloseEditor) == null ? void 0 : _b3.call(_a3, {
33165
- ...cellRenderArgs,
33166
- oldValue: oldValuesMap.value[key]
33167
- });
33168
- }
33169
- });
33170
- } else {
33171
- if (false !== beforeClose) {
33172
- emit("closeEditor", currentKey != null ? currentKey : key);
33173
- (_d2 = (_c2 = tableContext.props) == null ? void 0 : _c2.onCloseEditor) == null ? void 0 : _d2.call(_c2, {
33174
- ...cellRenderArgs,
33175
- oldValue: oldValuesMap.value[key]
33176
- });
33177
- }
33178
- }
32334
+ [`${prefixCls}-with-append`]: hasAppendNode
33179
32335
  };
33180
32336
  const cellRenderArgs = {
33181
32337
  record: item,
@@ -33186,8 +32342,10 @@
33186
32342
  recordIndexs: tableContext.getIndexsByKey(rowKey),
33187
32343
  key,
33188
32344
  valueStatus,
33189
- openEditor,
33190
- closeEditor
32345
+ cancelEditable: tableContext.cancelEditable,
32346
+ startEditable: tableContext.startEditable,
32347
+ saveEditable: tableContext.saveEditable,
32348
+ isEditable: tableContext.isEditable
33191
32349
  };
33192
32350
  let bodyCell = recordIndexs && ((_c = tableSlotsContext.bodyCell) == null ? void 0 : _c.call(tableSlotsContext, cellRenderArgs)) || [];
33193
32351
  const emptyText = tableContext.props.columnEmptyText !== false ? (_f = (_e = tableContext.props.columnEmptyText) != null ? _e : (_d = table == null ? void 0 : table.value) == null ? void 0 : _d.columnEmptyText) != null ? _f : "-" : "";
@@ -33306,27 +32464,6 @@
33306
32464
  } else {
33307
32465
  renderCellVNode = cellVNode;
33308
32466
  }
33309
- const onDblclick = () => {
33310
- editableTrigger.includes("dblClick") && openEditor();
33311
- };
33312
- const editInputRender = isEditing ? vue.createVNode(
33313
- EditInput,
33314
- {
33315
- prefixCls,
33316
- recordIndexs,
33317
- rowKey,
33318
- cellKey: key,
33319
- column,
33320
- record: item,
33321
- onCloseEditor: closeEditor,
33322
- value,
33323
- customEditable,
33324
- getPopupContainer: props.getPopupContainer,
33325
- multiple: editCellKeys.length > 1,
33326
- autoHeight
33327
- },
33328
- null
33329
- ) : null;
33330
32467
  return vue.createVNode(
33331
32468
  "div",
33332
32469
  vue.mergeProps(cellProps2, {
@@ -33338,39 +32475,25 @@
33338
32475
  "data-column-key": columnKey,
33339
32476
  class: cellClass,
33340
32477
  onContextmenu: (e) => {
33341
- if ((tableContext.props.hasContextmenuPopup || tableContext.props.rangeSelection) && 0 === e.button && e.ctrlKey) {
32478
+ if (tableContext.props.hasContextmenuPopup && 0 === e.button && e.ctrlKey) {
33342
32479
  e.preventDefault();
33343
32480
  } else {
33344
32481
  onBodyCellContextmenu(e, cellRenderArgs, props.type);
33345
- editableTrigger.includes("contextmenu") && openEditor();
32482
+ emit("contextmenu", e);
33346
32483
  }
33347
32484
  },
33348
- onDblclick,
32485
+ onDblclick: (e) => {
32486
+ emit("dblClick", e);
32487
+ },
33349
32488
  onClick: (e) => {
33350
32489
  var _a2, _b2;
33351
32490
  (_b2 = (_a2 = tableContext.props) == null ? void 0 : _a2.onCellClick) == null ? void 0 : _b2.call(_a2, e, cellRenderArgs);
33352
- if ((() => {
33353
- if (!isIOSUserAgent() || isEventSupported("dblclick")) return false;
33354
- const now = (/* @__PURE__ */ new Date()).getTime();
33355
- const is = now - lastClickTime < 200;
33356
- lastClickTime = now;
33357
- return is;
33358
- })()) {
33359
- onDblclick();
32491
+ if (hasSupportedDblclick()) {
32492
+ emit("dblclick", e);
33360
32493
  e.preventDefault();
33361
32494
  return;
33362
32495
  }
33363
- emit("click", e, cellPosition);
33364
- editableTrigger.includes("click") && openEditor();
33365
- },
33366
- onMousedown: (e) => {
33367
- emit("mousedown", e, cellPosition);
33368
- },
33369
- onMousemove: (e) => {
33370
- emit("mousemove", e, cellPosition);
33371
- },
33372
- onKeydown: (e) => {
33373
- emit("keydown", e, { cellPosition, isEditing });
32496
+ emit("click", e);
33374
32497
  },
33375
32498
  "data-level": level,
33376
32499
  "aria-selected": "true"
@@ -33385,26 +32508,497 @@
33385
32508
  },
33386
32509
  { label: () => bodyCell }
33387
32510
  ) : null,
33388
- renderCellVNode,
33389
- autoHeight && editInputRender ? vue.createVNode(
33390
- "label",
33391
- {
33392
- class: `${prefixCls}-cell-edit-wrapper`,
33393
- onMousedown: (e) => e.stopPropagation()
33394
- },
33395
- [vue.withDirectives(editInputRender, [[cellResize, cellResizeValue]])]
33396
- ) : editInputRender ? vue.createVNode(
33397
- "label",
33398
- {
33399
- class: `${prefixCls}-cell-edit-wrapper`,
33400
- onMousedown: (e) => e.stopPropagation()
33401
- },
33402
- [editInputRender]
33403
- ) : null
32511
+ renderCellVNode
33404
32512
  ]
33405
32513
  );
33406
32514
  };
33407
- BodyCell.props = cellProps;
32515
+ BodyCell$1.props = cellProps;
32516
+
32517
+ function getCharacterLength(str, maxCharacter) {
32518
+ const hasMaxCharacter = isNumber$2(maxCharacter);
32519
+ if (!str || str.length === 0) {
32520
+ if (hasMaxCharacter) {
32521
+ return {
32522
+ length: 0,
32523
+ characters: str
32524
+ };
32525
+ }
32526
+ return 0;
32527
+ }
32528
+ let len = 0;
32529
+ for (let i = 0; i < str.length; i++) {
32530
+ let currentStringLength = 0;
32531
+ if (str.charCodeAt(i) > 127) {
32532
+ currentStringLength = 2;
32533
+ } else {
32534
+ currentStringLength = 1;
32535
+ }
32536
+ if (hasMaxCharacter && len + currentStringLength > maxCharacter) {
32537
+ return {
32538
+ length: len,
32539
+ characters: str.slice(0, i)
32540
+ };
32541
+ }
32542
+ len += currentStringLength;
32543
+ }
32544
+ if (hasMaxCharacter) {
32545
+ return {
32546
+ length: len,
32547
+ characters: str
32548
+ };
32549
+ }
32550
+ return len;
32551
+ }
32552
+ function isValueEmpty(val) {
32553
+ const type = Object.prototype.toString.call(val);
32554
+ const typeMap = {
32555
+ Date: "[object Date]"
32556
+ };
32557
+ if (type === typeMap.Date) {
32558
+ return false;
32559
+ }
32560
+ return isObject$4(val) ? isEmpty(val) : ["", void 0, null].includes(val);
32561
+ }
32562
+ const VALIDATE_MAP = {
32563
+ required: (val) => !isValueEmpty(val),
32564
+ whitespace: (val) => !(/^\s+$/.test(val) || val === ""),
32565
+ boolean: (val) => isBoolean(val),
32566
+ max: (val, num) => isNumber$2(val) ? val <= num : getCharacterLength(val) <= num,
32567
+ min: (val, num) => isNumber$2(val) ? val >= num : getCharacterLength(val) >= num,
32568
+ len: (val, num) => getCharacterLength(String(val)) === num,
32569
+ number: (val) => isNumber$2(val),
32570
+ enum: (val, strs) => strs.includes(val),
32571
+ idcard: (val) => /^(\d{18,18}|\d{15,15}|\d{17,17}x)$/i.test(val),
32572
+ telnumber: (val) => /^1[3-9]\d{9}$/.test(val),
32573
+ pattern: (val, regexp) => regexp.test(val),
32574
+ // 自定义校验规则,可能是异步校验
32575
+ validator: (val, validate2) => validate2(val)
32576
+ };
32577
+ async function validateOneRule(value, rule) {
32578
+ let validateResult = { result: true };
32579
+ const keys = Object.keys(rule);
32580
+ let vOptions;
32581
+ let vValidateFun;
32582
+ for (let i = 0; i < keys.length; i++) {
32583
+ const key = keys[i];
32584
+ if (!rule.required && isValueEmpty(value) && !rule.validator) {
32585
+ return validateResult;
32586
+ }
32587
+ const validateRule = VALIDATE_MAP[key];
32588
+ if (validateRule && (rule[key] || rule[key] === 0)) {
32589
+ vOptions = rule[key] === true ? void 0 : rule[key];
32590
+ vValidateFun = validateRule;
32591
+ break;
32592
+ }
32593
+ }
32594
+ if (vValidateFun) {
32595
+ validateResult = await vValidateFun(value, vOptions);
32596
+ if (isBoolean(validateResult)) {
32597
+ return { ...rule, result: validateResult };
32598
+ }
32599
+ if (isObject$4(validateResult)) {
32600
+ return validateResult;
32601
+ }
32602
+ }
32603
+ return validateResult;
32604
+ }
32605
+ async function validate(value, rules) {
32606
+ const all = rules.map((rule) => validateOneRule(value, rule));
32607
+ const r = await Promise.all(all);
32608
+ return r;
32609
+ }
32610
+
32611
+ var BodyEditCell = /* @__PURE__ */ vue.defineComponent({
32612
+ inheritAttrs: false,
32613
+ props: {
32614
+ prefixCls: String,
32615
+ rowIndex: {
32616
+ type: Number,
32617
+ required: true
32618
+ },
32619
+ flattenRowIndex: {
32620
+ type: Number,
32621
+ required: true
32622
+ },
32623
+ rowKey: {
32624
+ type: [Number, String]
32625
+ },
32626
+ column: {
32627
+ type: Object,
32628
+ default: () => ({})
32629
+ },
32630
+ item: {
32631
+ type: Object,
32632
+ default: () => ({})
32633
+ },
32634
+ isRowEdit: Boolean,
32635
+ editRow: {
32636
+ type: Object
32637
+ }
32638
+ },
32639
+ emits: ["closeEditor", "keydown"],
32640
+ setup(props) {
32641
+ const tableContext = useInjectTable();
32642
+ const level = useInjectLevel();
32643
+ const columnKey = vue.computed(() => props.column.columnKey);
32644
+ const recordIndexs = vue.computed(() => tableContext.getIndexsByKey(props.rowKey));
32645
+ const childrenColumnName = vue.computed(() => tableContext.props.childrenColumnName || "children");
32646
+ const errorList = vue.ref();
32647
+ const {
32648
+ editRowsMap,
32649
+ setEditingCell
32650
+ } = useEditInject();
32651
+ const cellValue = vue.computed(() => props.column.dataIndex ? get(!props.isRowEdit ? props.item : props.editRow, props.column.dataIndex) : void 0);
32652
+ const cellRender = vue.computed(() => {
32653
+ var _a, _b;
32654
+ return ((_b = (_a = tableContext.allCellProps.value) == null ? void 0 : _a[props.rowKey]) == null ? void 0 : _b[props.column.columnKey]) || {};
32655
+ });
32656
+ const cellProps = vue.computed(() => cellRender.value.props || {});
32657
+ const cellRowSpan = vue.computed(() => cellProps.value.rowSpan);
32658
+ const sorterState = vue.computed(() => tableContext.sorterStates.value.find(({
32659
+ key
32660
+ }) => key === columnKey.value));
32661
+ const sorterOrder = vue.computed(() => {
32662
+ var _a;
32663
+ return sorterState.value ? (_a = sorterState.value) == null ? void 0 : _a.sortOrder : null;
32664
+ });
32665
+ const cellClass = vue.computed(() => ({
32666
+ [`${props.prefixCls}-cell`]: true,
32667
+ [`${props.prefixCls}-first-cell`]: props.column.columnIndex === 0,
32668
+ [`${props.prefixCls}-body-cell`]: true,
32669
+ [`${props.prefixCls}-cell-multi`]: cellRowSpan.value > 1,
32670
+ [`${props.prefixCls}-cell-hidden`]: cellRowSpan.value === 0,
32671
+ [`${props.prefixCls}-column-sort`]: sorterOrder.value
32672
+ }));
32673
+ const rules = vue.computed(() => {
32674
+ var _a, _b;
32675
+ return (_b = runFunction((_a = props.column.edit) == null ? void 0 : _a.rules, {
32676
+ column: props.column,
32677
+ record: props.isRowEdit ? props.editRow : props.item,
32678
+ recordIndexs: recordIndexs.value,
32679
+ newValue: cellValue.value
32680
+ })) != null ? _b : [];
32681
+ });
32682
+ const validateEnabled = vue.computed(() => rules.value.length > 0);
32683
+ const editValue = vue.ref();
32684
+ const cellParams = vue.computed(() => ({
32685
+ column: props.column,
32686
+ record: !props.isRowEdit ? props.item : props.editRow,
32687
+ recordIndexs: recordIndexs.value,
32688
+ value: editValue.value
32689
+ }));
32690
+ const editOnListeners = vue.computed(() => {
32691
+ var _a, _b;
32692
+ return ((_b = (_a = props.column.edit) == null ? void 0 : _a.on) == null ? void 0 : _b.call(_a, {
32693
+ ...cellParams.value
32694
+ })) || {};
32695
+ });
32696
+ const editProps = vue.computed(() => {
32697
+ const {
32698
+ edit = {}
32699
+ } = props.column;
32700
+ return isFunction$2(edit.props) ? edit.props(cellParams.value) : {
32701
+ ...edit.props
32702
+ };
32703
+ });
32704
+ const componentProps = vue.computed(() => {
32705
+ var _a;
32706
+ const {
32707
+ edit
32708
+ } = props.column;
32709
+ if (!edit) return {};
32710
+ const tmpProps = {
32711
+ ...editProps.value
32712
+ };
32713
+ delete tmpProps.onChange;
32714
+ delete tmpProps.value;
32715
+ (_a = edit.abortEditOnEvent) == null ? void 0 : _a.forEach((item) => {
32716
+ delete tmpProps[item];
32717
+ });
32718
+ return tmpProps;
32719
+ });
32720
+ const validateEdit = () => {
32721
+ return new Promise((resolve) => {
32722
+ if (!validateEnabled.value) {
32723
+ resolve(true);
32724
+ return true;
32725
+ }
32726
+ validate(editValue.value, rules.value).then((result) => {
32727
+ const list = result == null ? void 0 : result.filter((t) => !t.result);
32728
+ if (!list || !list.length) {
32729
+ errorList.value = [];
32730
+ resolve(true);
32731
+ } else {
32732
+ errorList.value = list;
32733
+ resolve(list);
32734
+ }
32735
+ });
32736
+ });
32737
+ };
32738
+ const onEditChange = (val, ...args) => {
32739
+ var _a, _b, _c, _d, _e, _f, _g, _h;
32740
+ const params = {
32741
+ column: props.column,
32742
+ record: props.isRowEdit ? props.editRow : props.item,
32743
+ recordIndexs: recordIndexs.value,
32744
+ newValue: cellValue.value
32745
+ };
32746
+ const value = (_c = (_b = (_a = props.column.edit) == null ? void 0 : _a.valueParser) == null ? void 0 : _b.call(_a, params)) != null ? _c : editValue.value;
32747
+ const valueSetter = (_d = props.column.edit) == null ? void 0 : _d.valueSetter;
32748
+ if (valueSetter) {
32749
+ valueSetter(params);
32750
+ } else {
32751
+ (_f = (_e = editProps.value) == null ? void 0 : _e.onChange) == null ? void 0 : _f.call(_e, val, ...args);
32752
+ (_h = (_g = editOnListeners.value) == null ? void 0 : _g.onChange) == null ? void 0 : _h.call(_g, params);
32753
+ if (props.isRowEdit) {
32754
+ const record = {
32755
+ ...props.editRow
32756
+ };
32757
+ set(record, props.column.dataIndex, value);
32758
+ editRowsMap.value[props.rowKey] = record;
32759
+ vue.triggerRef(editRowsMap);
32760
+ } else {
32761
+ let record = {};
32762
+ let dataSource = tableContext.rawData.value || [];
32763
+ recordIndexs.value.forEach((index) => {
32764
+ record = dataSource[index];
32765
+ dataSource = record[childrenColumnName.value] || [];
32766
+ });
32767
+ set(record, props.column.dataIndex, value);
32768
+ vue.triggerRef(tableContext.rawData);
32769
+ }
32770
+ }
32771
+ validateEdit();
32772
+ };
32773
+ vue.watch(cellValue, (value) => {
32774
+ var _a, _b, _c;
32775
+ editValue.value = (_c = (_b = (_a = props.column.edit) == null ? void 0 : _a.valueGetter) == null ? void 0 : _b.call(_a, cellParams.value)) != null ? _c : value;
32776
+ }, {
32777
+ immediate: true
32778
+ });
32779
+ vue.onMounted(() => {
32780
+ setEditingCell({
32781
+ recordIndexs: recordIndexs.value,
32782
+ column: props.column,
32783
+ rowKey: props.rowKey,
32784
+ originRecord: props.item,
32785
+ rowIndex: props.rowIndex,
32786
+ columnKey: props.column.columnKey,
32787
+ validateEdit
32788
+ }, true);
32789
+ });
32790
+ vue.onUnmounted(() => {
32791
+ var _a, _b, _c;
32792
+ setEditingCell({
32793
+ recordIndexs: recordIndexs.value,
32794
+ column: props.column,
32795
+ rowKey: props.rowKey,
32796
+ originRecord: props.item,
32797
+ rowIndex: props.rowIndex,
32798
+ columnKey: props.column.columnKey,
32799
+ validateEdit
32800
+ }, false);
32801
+ (_c = (_b = (_a = props.column) == null ? void 0 : _a.edit) == null ? void 0 : _b.onEdited) == null ? void 0 : _c.call(_b, {
32802
+ column: props.column,
32803
+ record: props.isRowEdit ? props.editRow : props.item,
32804
+ recordIndexs: recordIndexs.value,
32805
+ value: cellValue.value
32806
+ });
32807
+ });
32808
+ return () => {
32809
+ var _a, _b, _c;
32810
+ const Component = (_a = props.column.edit) == null ? void 0 : _a.component;
32811
+ const errorMessage = (_c = (_b = errorList.value) == null ? void 0 : _b[0]) == null ? void 0 : _c.message;
32812
+ return vue.createVNode("div", vue.mergeProps(cellProps.value, {
32813
+ "class": cellClass.value,
32814
+ "tabindex": "-1",
32815
+ "role": "cell",
32816
+ "data-column-key": columnKey.value,
32817
+ "data-level": level,
32818
+ "aria-selected": "true",
32819
+ "onClick": (e) => {
32820
+ e.stopPropagation();
32821
+ }
32822
+ }), [vue.createVNode("div", {
32823
+ "class": `${props.prefixCls}-cell-content`,
32824
+ "style": "width: 100%; position:relative"
32825
+ }, [vue.createVNode(Component, vue.mergeProps({
32826
+ "style": "width: 100%",
32827
+ "status": errorMessage ? "error" : void 0,
32828
+ "value": editValue.value,
32829
+ "onUpdate:value": ($event) => editValue.value = $event,
32830
+ "getPopupContainer": () => document.body
32831
+ }, componentProps.value, {
32832
+ "onChange": onEditChange
32833
+ }), null), errorMessage && vue.createVNode(antDesignVue.Popover, {
32834
+ "arrowPointAtCenter": true,
32835
+ "placement": "topRight",
32836
+ "getPopupContainer": () => document.body
32837
+ }, {
32838
+ default: () => [vue.createVNode("span", {
32839
+ "class": `${props.prefixCls}-cell-content-error`
32840
+ }, [vue.createVNode(CloseCircleFilled, null, null)])],
32841
+ content: () => {
32842
+ var _a2;
32843
+ return vue.createVNode("div", {
32844
+ "class": `${props.prefixCls}-cell-content-error-message`
32845
+ }, [(_a2 = errorList.value) == null ? void 0 : _a2.map((error) => vue.createVNode("div", {
32846
+ "key": error.message
32847
+ }, [error.message]))]);
32848
+ }
32849
+ })])]);
32850
+ };
32851
+ }
32852
+ });
32853
+
32854
+ var _sfc_main$n = vue.defineComponent({
32855
+ inheritAttrs: false,
32856
+ props: {
32857
+ prefixCls: String,
32858
+ rowIndex: { type: Number, required: true },
32859
+ flattenRowIndex: { type: Number, required: true },
32860
+ rowKey: { type: [Number, String] },
32861
+ column: { type: Object, default: () => ({}) },
32862
+ item: { type: Object, default: () => ({}) },
32863
+ wrapText: { type: Boolean, default: false },
32864
+ type: { type: String },
32865
+ height: Number,
32866
+ hasAppendNode: Boolean,
32867
+ resizeObserver: { type: Object },
32868
+ editRow: { type: Object },
32869
+ calMaxHeight: Function,
32870
+ editCellKeys: Array,
32871
+ editableKeys: Array,
32872
+ isRowEdit: Boolean,
32873
+ tooltipOpen: Boolean,
32874
+ getPopupContainer: Function,
32875
+ onOpenEditor: Function,
32876
+ onCloseEditor: Function,
32877
+ onCellLeave: Function,
32878
+ onMouseenter: Function
32879
+ },
32880
+ emits: ["mouseenter", "cellLeave"],
32881
+ components: { BodyTextCell: BodyCell$1, BodyEditCell },
32882
+ setup(props) {
32883
+ const tableContext = useInjectTable();
32884
+ const isKeepEditMode = vue.computed(() => {
32885
+ var _a;
32886
+ return (_a = props.column.edit) == null ? void 0 : _a.keepEditMode;
32887
+ });
32888
+ const cellValue = vue.computed(
32889
+ () => props.column.dataIndex ? get(props.item, props.column.dataIndex) : void 0
32890
+ );
32891
+ const key = vue.computed(() => getCellKey(props.rowKey, props.column.columnKey));
32892
+ const cellParams = vue.computed(() => ({
32893
+ column: props.column,
32894
+ record: props.isRowEdit ? props.editRow : props.item,
32895
+ recordIndexs: tableContext.getIndexsByKey(props.rowKey),
32896
+ value: cellValue.value
32897
+ }));
32898
+ const editable = vue.computed(() => {
32899
+ var _a, _b, _c, _d;
32900
+ if (!((_a = props.column.edit) == null ? void 0 : _a.component)) {
32901
+ return false;
32902
+ }
32903
+ if (props.isRowEdit && !((_b = props.editableKeys) == null ? void 0 : _b.includes(props.rowKey))) {
32904
+ return false;
32905
+ }
32906
+ if (!((_c = props.column.edit) == null ? void 0 : _c.editable)) {
32907
+ return true;
32908
+ }
32909
+ const cellEditable = (_d = props.column.edit) == null ? void 0 : _d.editable(cellParams.value);
32910
+ return cellEditable;
32911
+ });
32912
+ const isEditing = vue.computed(() => {
32913
+ var _a, _b;
32914
+ if (props.isRowEdit) {
32915
+ return editable.value && ((_a = props.editableKeys) == null ? void 0 : _a.includes(props.rowKey));
32916
+ }
32917
+ if (!editable.value) {
32918
+ return false;
32919
+ }
32920
+ if (isKeepEditMode.value) {
32921
+ return true;
32922
+ }
32923
+ if ((_b = props.editCellKeys) == null ? void 0 : _b.includes(key.value)) {
32924
+ return true;
32925
+ }
32926
+ return false;
32927
+ });
32928
+ const editableTrigger = vue.computed(() => {
32929
+ var _a;
32930
+ let { editableTrigger: editableTrigger2 = ["click"] } = (_a = props.column.edit) != null ? _a : {};
32931
+ editableTrigger2 = Array.isArray(editableTrigger2) ? editableTrigger2 : [editableTrigger2];
32932
+ return editableTrigger2;
32933
+ });
32934
+ const onCellEvent = (e, trigger) => {
32935
+ var _a;
32936
+ if (editable.value && ((_a = editableTrigger.value) == null ? void 0 : _a.includes(trigger)) && !props.isRowEdit) {
32937
+ openEditor();
32938
+ closeEditor();
32939
+ e.stopPropagation();
32940
+ e.preventDefault();
32941
+ }
32942
+ };
32943
+ const openEditor = () => {
32944
+ var _a, _b, _c, _d;
32945
+ const oldValue = (_c = (_b = (_a = props.column.edit) == null ? void 0 : _a.valueGetter) == null ? void 0 : _b.call(_a, cellParams.value)) != null ? _c : cellValue.value;
32946
+ (_d = props.onOpenEditor) == null ? void 0 : _d.call(props, key.value, { [key.value]: oldValue });
32947
+ };
32948
+ const closeEditor = () => {
32949
+ var _a;
32950
+ (_a = props.onCloseEditor) == null ? void 0 : _a.call(props, key.value);
32951
+ };
32952
+ vue.watch(key, () => {
32953
+ var _a;
32954
+ if (((_a = props.column.edit) == null ? void 0 : _a.defaultEditable) && !props.isRowEdit) {
32955
+ openEditor();
32956
+ }
32957
+ });
32958
+ vue.onMounted(() => {
32959
+ var _a;
32960
+ if (((_a = props.column.edit) == null ? void 0 : _a.defaultEditable) && !props.isRowEdit) {
32961
+ openEditor();
32962
+ }
32963
+ });
32964
+ return {
32965
+ props,
32966
+ key,
32967
+ isEditing,
32968
+ editable,
32969
+ onCellEvent
32970
+ };
32971
+ }
32972
+ });
32973
+
32974
+ function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
32975
+ const _component_BodyEditCell = vue.resolveComponent("BodyEditCell");
32976
+ const _component_BodyTextCell = vue.resolveComponent("BodyTextCell");
32977
+ return _ctx.isEditing ? (vue.openBlock(), vue.createBlock(_component_BodyEditCell, {
32978
+ key: _ctx.key,
32979
+ prefixCls: _ctx.prefixCls,
32980
+ rowIndex: _ctx.rowIndex,
32981
+ flattenRowIndex: _ctx.flattenRowIndex,
32982
+ rowKey: _ctx.rowKey,
32983
+ column: _ctx.column,
32984
+ item: _ctx.item,
32985
+ "edit-row": _ctx.editRow,
32986
+ "editable-keys": _ctx.editableKeys,
32987
+ "is-row-edit": _ctx.isRowEdit
32988
+ }, null, 8, ["prefixCls", "rowIndex", "flattenRowIndex", "rowKey", "column", "item", "edit-row", "editable-keys", "is-row-edit"])) : (vue.openBlock(), vue.createBlock(_component_BodyTextCell, vue.mergeProps({ key: 1 }, _ctx.props, {
32989
+ style: { cursor: _ctx.editable ? "poiner" : "" },
32990
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.onCellEvent($event, "click")),
32991
+ onDblClick: _cache[1] || (_cache[1] = ($event) => _ctx.onCellEvent($event, "dblClick")),
32992
+ onContextmenu: _cache[2] || (_cache[2] = ($event) => _ctx.onCellEvent($event, "contextmenu"))
32993
+ }), {
32994
+ appendNode: vue.withCtx(() => [
32995
+ vue.renderSlot(_ctx.$slots, "appendNode")
32996
+ ]),
32997
+ _: 3
32998
+ /* FORWARDED */
32999
+ }, 16, ["style"]));
33000
+ }
33001
+ var BodyCell = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$j]]);
33408
33002
 
33409
33003
  var _sfc_main$m = vue.defineComponent({
33410
33004
  name: "TableExpandedRow",
@@ -33484,7 +33078,7 @@
33484
33078
  }
33485
33079
  });
33486
33080
 
33487
- const _hoisted_1$7 = ["data-cell-auto"];
33081
+ const _hoisted_1$8 = ["data-cell-auto"];
33488
33082
  function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
33489
33083
  const _component_RenderVNode = vue.resolveComponent("RenderVNode");
33490
33084
  const _directive_cell_resize = vue.resolveDirective("cell-resize");
@@ -33516,7 +33110,7 @@
33516
33110
  2
33517
33111
  /* CLASS */
33518
33112
  )
33519
- ], 10, _hoisted_1$7)), [
33113
+ ], 10, _hoisted_1$8)), [
33520
33114
  [_directive_cell_resize, _ctx.cellResizeBind]
33521
33115
  ])
33522
33116
  ],
@@ -33534,16 +33128,18 @@
33534
33128
  expanded: Boolean,
33535
33129
  expandable: Boolean,
33536
33130
  disabled: Boolean,
33537
- onExpand: Function
33131
+ onExpand: Function,
33132
+ expandIconType: String
33538
33133
  },
33539
33134
  emits: ["expand"],
33540
33135
  setup(props, { emit }) {
33541
33136
  const tableContext = useInjectTable();
33542
33137
  const className = vue.computed(() => {
33543
- const { prefixCls, expanded, expandable, disabled } = props;
33138
+ const { prefixCls, expanded, expandable, disabled, expandIconType } = props;
33544
33139
  const expandIconClass = `${prefixCls}-row-expand-icon`;
33545
33140
  return {
33546
33141
  [expandIconClass]: true,
33142
+ [`${expandIconClass}-${expandIconType}`]: true,
33547
33143
  [`${expandIconClass}-spaced`]: !expandable,
33548
33144
  [`${expandIconClass}-expanded`]: expandable && expanded,
33549
33145
  [`${expandIconClass}-collapsed`]: expandable && !expanded,
@@ -33567,7 +33163,7 @@
33567
33163
  }
33568
33164
  });
33569
33165
 
33570
- const _hoisted_1$6 = ["aria-label"];
33166
+ const _hoisted_1$7 = ["aria-label"];
33571
33167
  function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
33572
33168
  return _ctx.expandIcon ? (vue.openBlock(), vue.createElementBlock("span", {
33573
33169
  key: 0,
@@ -33581,7 +33177,7 @@
33581
33177
  class: vue.normalizeClass(_ctx.className),
33582
33178
  "aria-label": _ctx.label,
33583
33179
  onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"]))
33584
- }, null, 10, _hoisted_1$6));
33180
+ }, null, 10, _hoisted_1$7));
33585
33181
  }
33586
33182
  var ExpandIcon = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$h]]);
33587
33183
 
@@ -33596,6 +33192,7 @@
33596
33192
  record: { type: Object },
33597
33193
  rowKey: { type: [Number, String] },
33598
33194
  expanded: Boolean,
33195
+ expandIconType: String,
33599
33196
  supportExpand: Boolean
33600
33197
  },
33601
33198
  setup(props) {
@@ -33779,8 +33376,8 @@
33779
33376
  }
33780
33377
  });
33781
33378
 
33782
- const _hoisted_1$5 = ["data-level"];
33783
- const _hoisted_2$1 = {
33379
+ const _hoisted_1$6 = ["data-level"];
33380
+ const _hoisted_2$2 = {
33784
33381
  key: 2,
33785
33382
  draggable: true
33786
33383
  };
@@ -33833,16 +33430,17 @@
33833
33430
  key: 1,
33834
33431
  "prefix-cls": _ctx.prefixCls,
33835
33432
  expandable: "",
33433
+ expandIconType: _ctx.expandIconType,
33836
33434
  expanded: _ctx.expanded,
33837
33435
  record: _ctx.record,
33838
33436
  disabled: !_ctx.supportExpand,
33839
33437
  onExpand: _ctx.onInternalTriggerExpand
33840
- }, null, 8, ["prefix-cls", "expanded", "record", "disabled", "onExpand"])) : _ctx.column.type === "draggable" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
33438
+ }, null, 8, ["prefix-cls", "expandIconType", "expanded", "record", "disabled", "onExpand"])) : _ctx.column.type === "draggable" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
33841
33439
  vue.renderSlot(_ctx.$slots, "draggable-handle", {}, () => [
33842
33440
  vue.createVNode(_component_MenuOutlined)
33843
33441
  ])
33844
33442
  ])) : vue.createCommentVNode("v-if", true)
33845
- ], 16, _hoisted_1$5);
33443
+ ], 16, _hoisted_1$6);
33846
33444
  }
33847
33445
  var BodyExtraCell = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$g]]);
33848
33446
 
@@ -33854,7 +33452,8 @@
33854
33452
  BodyCell,
33855
33453
  ExpandedRow,
33856
33454
  BodyExtraCell,
33857
- RenderSlot
33455
+ RenderSlot,
33456
+ BodyTextCell: BodyCell$1
33858
33457
  },
33859
33458
  inheritAttrs: false,
33860
33459
  props: {
@@ -33876,11 +33475,17 @@
33876
33475
  const tableContext = useInjectTable();
33877
33476
  const rowInstance = vue.getCurrentInstance();
33878
33477
  const { table } = useProConfigInject();
33879
- const { editCellKeys, closeEditor, openEditor } = useEditInject();
33478
+ const { editCellKeys, isRowEdit, mergedEditableKeys, editRowsMap, closeEditor, openEditor } = useEditInject();
33479
+ const editRow = vue.computed(() => editRowsMap.value[props.rowKey]);
33880
33480
  let isUnmount = false;
33881
33481
  const bodyRow = vue.ref();
33882
- const { onCellMousedown, onCellMousemove, onCellClick } = useCellSelection();
33883
- const { onCellKeydown } = useCellKeyboard();
33482
+ const isCurrentEditRow = vue.computed(() => {
33483
+ var _a;
33484
+ if (isRowEdit.value) {
33485
+ return (_a = mergedEditableKeys.value) == null ? void 0 : _a.includes(props.rowKey);
33486
+ }
33487
+ return true;
33488
+ });
33884
33489
  const calMaxHeight = () => {
33885
33490
  if (isUnmount) return;
33886
33491
  let rowHeight = 0;
@@ -33950,6 +33555,7 @@
33950
33555
  });
33951
33556
  const isExpanded = vue.ref(false);
33952
33557
  const expandedRowKeys = vue.computed(() => tableContext.expandedRowKeys.value);
33558
+ const expandIconType = vue.computed(() => tableContext.expandIconType.value);
33953
33559
  const expanded = eagerComputed(() => {
33954
33560
  var _a, _b;
33955
33561
  return (_b = (_a = expandedRowKeys.value).has) == null ? void 0 : _b.call(_a, props.rowKey);
@@ -34081,6 +33687,7 @@
34081
33687
  rowStyle,
34082
33688
  cellClass,
34083
33689
  tableContext,
33690
+ isCurrentEditRow,
34084
33691
  mergedRowHeights,
34085
33692
  handleCellBlur,
34086
33693
  handleCellHover,
@@ -34096,6 +33703,7 @@
34096
33703
  expandIconColumnIndex,
34097
33704
  indentSize,
34098
33705
  expanded,
33706
+ expandIconType,
34099
33707
  onInternalTriggerExpand,
34100
33708
  customRowProps,
34101
33709
  expandColumnKey: ExpandColumnKey,
@@ -34107,29 +33715,29 @@
34107
33715
  resizeObserver,
34108
33716
  calMaxHeight,
34109
33717
  bodyRow,
33718
+ editCellKeys,
33719
+ isRowEdit,
33720
+ editRow,
33721
+ mergedEditableKeys,
33722
+ openEditor,
33723
+ closeEditor,
34110
33724
  hoverRowKey,
34111
33725
  hoverColumnKey,
34112
33726
  xVirtual: eagerComputed(() => tableContext.xVirtual.value),
34113
33727
  getPopupContainer: () => popupContainer.value,
34114
- editCellKeys,
34115
- closeEditor,
34116
- openEditor,
34117
- mergedTooltipOpen,
34118
- onCellMousedown,
34119
- onCellKeydown,
34120
- onCellMousemove,
34121
- onCellClick
33728
+ mergedTooltipOpen
34122
33729
  };
34123
33730
  }
34124
33731
  });
34125
33732
 
34126
- const _hoisted_1$4 = ["data-row-key"];
34127
- const _hoisted_2 = ["data-row-key"];
33733
+ const _hoisted_1$5 = ["data-row-key"];
33734
+ const _hoisted_2$1 = ["data-row-key"];
34128
33735
  function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
34129
33736
  const _component_ExpandedRow = vue.resolveComponent("ExpandedRow");
34130
33737
  const _component_BodyExtraCell = vue.resolveComponent("BodyExtraCell");
34131
33738
  const _component_ExpandIcon = vue.resolveComponent("ExpandIcon");
34132
33739
  const _component_BodyCell = vue.resolveComponent("BodyCell");
33740
+ const _component_BodyTextCell = vue.resolveComponent("BodyTextCell");
34133
33741
  const _component_RenderSlot = vue.resolveComponent("RenderSlot");
34134
33742
  return _ctx.isExpandRow ? (vue.openBlock(), vue.createElementBlock(
34135
33743
  vue.Fragment,
@@ -34151,7 +33759,7 @@
34151
33759
  "resize-observer": _ctx.resizeObserver,
34152
33760
  "cal-max-height": _ctx.calMaxHeight
34153
33761
  }, null, 8, ["prefix-cls", "item", "row-key", "row-index", "resize-observer", "cal-max-height"])
34154
- ], 14, _hoisted_1$4)) : vue.createCommentVNode("v-if", true)
33762
+ ], 14, _hoisted_1$5)) : vue.createCommentVNode("v-if", true)
34155
33763
  ],
34156
33764
  64
34157
33765
  /* STABLE_FRAGMENT */
@@ -34169,7 +33777,7 @@
34169
33777
  vue.Fragment,
34170
33778
  null,
34171
33779
  vue.renderList(_ctx.mergedColumns, (column, index) => {
34172
- var _a;
33780
+ var _a, _b;
34173
33781
  return vue.openBlock(), vue.createElementBlock(
34174
33782
  vue.Fragment,
34175
33783
  {
@@ -34184,11 +33792,12 @@
34184
33792
  type: _ctx.type,
34185
33793
  column: (_a = _ctx.mergedColumns) == null ? void 0 : _a[index],
34186
33794
  expanded: _ctx.expanded,
33795
+ expandIconType: _ctx.expandIconType,
34187
33796
  "support-expand": _ctx.mergedExpandable,
34188
33797
  record: _ctx.record,
34189
33798
  onMouseenter: ($event) => _ctx.handleCellHover(_ctx.rowKey, column.columnKey, _ctx.tableContext.draggingRowKey.value),
34190
33799
  onMouseleave: _ctx.handleCellBlur
34191
- }, null, 8, ["prefix-cls", "row-key", "row-index", "type", "column", "expanded", "support-expand", "record", "onMouseenter", "onMouseleave"])) : column ? (vue.openBlock(), vue.createBlock(_component_BodyCell, {
33800
+ }, null, 8, ["prefix-cls", "row-key", "row-index", "type", "column", "expanded", "expandIconType", "support-expand", "record", "onMouseenter", "onMouseleave"])) : column && ((_b = column.edit) == null ? void 0 : _b.component) && _ctx.isCurrentEditRow ? (vue.openBlock(), vue.createBlock(_component_BodyCell, {
34192
33801
  key: 1,
34193
33802
  "prefix-cls": _ctx.prefixCls,
34194
33803
  item: _ctx.record,
@@ -34205,14 +33814,13 @@
34205
33814
  "get-popup-container": _ctx.getPopupContainer,
34206
33815
  "tooltip-open": _ctx.mergedTooltipOpen && _ctx.hoverColumnKey === column.columnKey,
34207
33816
  "edit-cell-keys": _ctx.editCellKeys,
33817
+ "editable-keys": _ctx.mergedEditableKeys,
33818
+ "is-row-edit": _ctx.isRowEdit,
33819
+ "edit-row": _ctx.editRow,
34208
33820
  onCloseEditor: _ctx.closeEditor,
34209
33821
  onOpenEditor: _ctx.openEditor,
34210
33822
  onMouseenter: ($event) => _ctx.handleCellHover(_ctx.rowKey, column.columnKey, _ctx.tableContext.draggingRowKey.value),
34211
- onCellLeave: _ctx.handleCellBlur,
34212
- onMousedown: _ctx.onCellMousedown,
34213
- onMousemove: _ctx.onCellMousemove,
34214
- onKeydown: _ctx.onCellKeydown,
34215
- onClick: _ctx.onCellClick
33823
+ onCellLeave: _ctx.handleCellBlur
34216
33824
  }, {
34217
33825
  appendNode: vue.withCtx(() => [
34218
33826
  vue.createElementVNode(
@@ -34233,12 +33841,13 @@
34233
33841
  ),
34234
33842
  vue.createVNode(_component_ExpandIcon, {
34235
33843
  expanded: _ctx.expanded,
33844
+ expandIconType: _ctx.expandIconType,
34236
33845
  "prefix-cls": _ctx.prefixCls,
34237
33846
  expandable: _ctx.hasNestChildren,
34238
33847
  record: _ctx.record,
34239
33848
  disabled: !_ctx.mergedExpandable,
34240
33849
  onExpand: _ctx.onInternalTriggerExpand
34241
- }, null, 8, ["expanded", "prefix-cls", "expandable", "record", "disabled", "onExpand"])
33850
+ }, null, 8, ["expanded", "expandIconType", "prefix-cls", "expandable", "record", "disabled", "onExpand"])
34242
33851
  ],
34243
33852
  2
34244
33853
  /* CLASS */
@@ -34246,7 +33855,62 @@
34246
33855
  ]),
34247
33856
  _: 1
34248
33857
  /* STABLE */
34249
- }, 8, ["prefix-cls", "item", "row-key", "type", "row-index", "flatten-row-index", "wrap-text", "column", "resize-observer", "cal-max-height", "has-append-node", "height", "get-popup-container", "tooltip-open", "edit-cell-keys", "onCloseEditor", "onOpenEditor", "onMouseenter", "onCellLeave", "onMousedown", "onMousemove", "onKeydown", "onClick"])) : vue.createCommentVNode("v-if", true)
33858
+ }, 8, ["prefix-cls", "item", "row-key", "type", "row-index", "flatten-row-index", "wrap-text", "column", "resize-observer", "cal-max-height", "has-append-node", "height", "get-popup-container", "tooltip-open", "edit-cell-keys", "editable-keys", "is-row-edit", "edit-row", "onCloseEditor", "onOpenEditor", "onMouseenter", "onCellLeave"])) : column ? (vue.openBlock(), vue.createBlock(_component_BodyTextCell, {
33859
+ key: 2,
33860
+ "prefix-cls": _ctx.prefixCls,
33861
+ item: _ctx.record,
33862
+ "row-key": _ctx.rowKey,
33863
+ type: _ctx.type,
33864
+ "row-index": _ctx.rowIndex,
33865
+ "flatten-row-index": _ctx.flattenRowIndex,
33866
+ "wrap-text": _ctx.wrapText,
33867
+ column,
33868
+ "resize-observer": _ctx.resizeObserver,
33869
+ "cal-max-height": _ctx.calMaxHeight,
33870
+ "has-append-node": column.columnIndex === _ctx.expandIconColumnIndex && _ctx.nestExpandable,
33871
+ height: _ctx.cellHeight,
33872
+ "get-popup-container": _ctx.getPopupContainer,
33873
+ "tooltip-open": _ctx.mergedTooltipOpen && _ctx.hoverColumnKey === column.columnKey,
33874
+ "edit-cell-keys": _ctx.editCellKeys,
33875
+ onCloseEditor: _ctx.closeEditor,
33876
+ onOpenEditor: _ctx.openEditor,
33877
+ onMouseenter: ($event) => _ctx.handleCellHover(_ctx.rowKey, column.columnKey, _ctx.tableContext.draggingRowKey.value),
33878
+ onCellLeave: _ctx.handleCellBlur
33879
+ }, {
33880
+ appendNode: vue.withCtx(() => [
33881
+ vue.createElementVNode(
33882
+ "div",
33883
+ {
33884
+ class: vue.normalizeClass(`${_ctx.prefixCls}-append-node`)
33885
+ },
33886
+ [
33887
+ vue.createElementVNode(
33888
+ "span",
33889
+ {
33890
+ style: vue.normalizeStyle(`padding-left: ${(_ctx.indent || 0) * _ctx.indentSize}px`),
33891
+ class: vue.normalizeClass(`${_ctx.prefixCls}-row-indent indent-level-${_ctx.indent}`)
33892
+ },
33893
+ null,
33894
+ 6
33895
+ /* CLASS, STYLE */
33896
+ ),
33897
+ vue.createVNode(_component_ExpandIcon, {
33898
+ expanded: _ctx.expanded,
33899
+ expandIconType: _ctx.expandIconType,
33900
+ "prefix-cls": _ctx.prefixCls,
33901
+ expandable: _ctx.hasNestChildren,
33902
+ record: _ctx.record,
33903
+ disabled: !_ctx.mergedExpandable,
33904
+ onExpand: _ctx.onInternalTriggerExpand
33905
+ }, null, 8, ["expanded", "expandIconType", "prefix-cls", "expandable", "record", "disabled", "onExpand"])
33906
+ ],
33907
+ 2
33908
+ /* CLASS */
33909
+ )
33910
+ ]),
33911
+ _: 1
33912
+ /* STABLE */
33913
+ }, 8, ["prefix-cls", "item", "row-key", "type", "row-index", "flatten-row-index", "wrap-text", "column", "resize-observer", "cal-max-height", "has-append-node", "height", "get-popup-container", "tooltip-open", "edit-cell-keys", "onCloseEditor", "onOpenEditor", "onMouseenter", "onCellLeave"])) : vue.createCommentVNode("v-if", true)
34250
33914
  ],
34251
33915
  64
34252
33916
  /* STABLE_FRAGMENT */
@@ -34269,7 +33933,7 @@
34269
33933
  2
34270
33934
  /* CLASS */
34271
33935
  )) : vue.createCommentVNode("v-if", true)
34272
- ], 16, _hoisted_2));
33936
+ ], 16, _hoisted_2$1));
34273
33937
  }
34274
33938
  var Row = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$f]]);
34275
33939
 
@@ -34912,7 +34576,7 @@
34912
34576
  }
34913
34577
  });
34914
34578
 
34915
- const _hoisted_1$3 = { style: {
34579
+ const _hoisted_1$4 = { style: {
34916
34580
  width: "100%",
34917
34581
  overflow: "hidden",
34918
34582
  position: "relative",
@@ -35024,7 +34688,7 @@
35024
34688
  onKeydown: _cache[9] || (_cache[9] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args))
35025
34689
  },
35026
34690
  [
35027
- vue.createElementVNode("div", _hoisted_1$3, [
34691
+ vue.createElementVNode("div", _hoisted_1$4, [
35028
34692
  vue.createElementVNode(
35029
34693
  "div",
35030
34694
  {
@@ -35496,7 +35160,8 @@
35496
35160
  "expandedRowsChange",
35497
35161
  "resizeColumn",
35498
35162
  "update:dataSource",
35499
- "cellKeydown"
35163
+ "cellKeydown",
35164
+ "data-change"
35500
35165
  ],
35501
35166
  slots: {},
35502
35167
  setup(props, { expose, emit, slots }) {
@@ -35508,7 +35173,6 @@
35508
35173
  });
35509
35174
  const popupContainer = vue.shallowRef(null);
35510
35175
  const customUiCls = usePrefixCls("custom-ui");
35511
- const { editCellKeys, openEditor, closeEditor } = useEditProvider();
35512
35176
  useProvidePopup();
35513
35177
  const getPopupContainer = vue.computed(() => props.getPopupContainer);
35514
35178
  const { status, watermarkMsg } = useLicense();
@@ -35615,12 +35279,21 @@
35615
35279
  },
35616
35280
  { immediate: true, deep: !!props.deepWatchColumns }
35617
35281
  );
35282
+ vue.watch(rawData, (newData) => {
35283
+ emit("data-change", newData);
35284
+ });
35618
35285
  const childrenColumnName = vue.computed(
35619
35286
  () => {
35620
35287
  var _a, _b, _c;
35621
35288
  return (_c = (_b = props.childrenColumnName) != null ? _b : (_a = table == null ? void 0 : table.value) == null ? void 0 : _a.childrenColumnName) != null ? _c : "children";
35622
35289
  }
35623
35290
  );
35291
+ const expandIconType = vue.computed(
35292
+ () => {
35293
+ var _a, _b, _c;
35294
+ return (_c = (_b = props.expandIconType) != null ? _b : (_a = table == null ? void 0 : table.value) == null ? void 0 : _a.expandIconType) != null ? _c : "default";
35295
+ }
35296
+ );
35624
35297
  const { getRecordByKey, getIndexsByKey, getKeyByIndexs, allDataRowKeys, allDataRootRowKeys } = useKVMap(rawData, childrenColumnName, getRowKey);
35625
35298
  const defaultExpandedRowKeys = vue.shallowRef([]);
35626
35299
  vue.watchEffect(() => {
@@ -35644,6 +35317,20 @@
35644
35317
  return { spinning: false };
35645
35318
  }
35646
35319
  });
35320
+ const {
35321
+ validateRowData,
35322
+ addEditRecord,
35323
+ cancelEditable,
35324
+ startEditable,
35325
+ saveEditable,
35326
+ isEditable,
35327
+ validateTableData
35328
+ } = useEditProvider(props, {
35329
+ getIndexsByKey,
35330
+ getRecordByKey,
35331
+ rawData,
35332
+ getRowKey
35333
+ });
35647
35334
  vue.onActivated(() => {
35648
35335
  scrollTo({ left: 0, top: 0 });
35649
35336
  });
@@ -35953,7 +35640,11 @@
35953
35640
  leftWidth,
35954
35641
  centerWidth,
35955
35642
  getRowHeight: cal.getRowHeight,
35956
- customCell: vue.toRef(props, "customCell")
35643
+ customCell: vue.toRef(props, "customCell"),
35644
+ cancelEditable,
35645
+ startEditable,
35646
+ saveEditable,
35647
+ isEditable
35957
35648
  });
35958
35649
  vue.watch(
35959
35650
  [realHeaderHeight, scrollLeft],
@@ -35967,6 +35658,10 @@
35967
35658
  ...cal,
35968
35659
  ...columns,
35969
35660
  ...cellProps,
35661
+ cancelEditable,
35662
+ startEditable,
35663
+ saveEditable,
35664
+ isEditable,
35970
35665
  rootRef,
35971
35666
  rawData,
35972
35667
  getRowFlattenIndexByKey,
@@ -35976,6 +35671,7 @@
35976
35671
  status,
35977
35672
  useAnimate,
35978
35673
  animateRows,
35674
+ expandIconType,
35979
35675
  watermarkMsg,
35980
35676
  onResizeColumn: (w, col, action) => {
35981
35677
  var _a;
@@ -36183,99 +35879,22 @@
36183
35879
  });
36184
35880
  const tabGuardTopRef = vue.ref();
36185
35881
  const tabGuardBottomRef = vue.ref();
36186
- const {
36187
- navigationService,
36188
- getSelectedRange,
36189
- clearAllSelectedRange,
36190
- copySelectedRange,
36191
- appendCellToSelectedRange,
36192
- onBodyKeydown
36193
- } = useProvideRangeStore({
36194
- allColumns: columns.allColumns,
36195
- flattenData,
36196
- rangeSelection: vue.computed(() => props.rangeSelection),
36197
- getRowByFlattenIndex,
36198
- rootRef,
36199
- prefixCls: vue.computed(() => props.prefixCls),
36200
- allCellProps: cellProps.allCellProps,
36201
- tabGuardTopRef,
36202
- tabGuardBottomRef,
36203
- ensureCellColumnVisible: (cell) => {
36204
- if (!cell.column || cell.column.fixed) return;
36205
- const sl = scrollLeft.value;
36206
- const pos2 = columns.getColumnPositionByKey(cell.column.columnKey);
36207
- if (pos2) {
36208
- const { width, left } = pos2;
36209
- const lw = leftWidth.value;
36210
- const rw = rightWidth.value;
36211
- left - lw < sl ? scrollLeft.value = left - lw : left + width > sl + bodyWidth.value - rw && (scrollLeft.value = left + width - bodyWidth.value + rw);
36212
- }
36213
- },
36214
- ensureCellRowVisible: (cell) => {
36215
- var _a;
36216
- const { rowIndex } = cell;
36217
- const st = scrollTop.value;
36218
- const row = getRowByFlattenIndex(rowIndex);
36219
- const pos2 = cal.getRowPositionByKey(row.rowKey);
36220
- const cprops = (((_a = cellProps.allCellProps.value[row.rowKey]) == null ? void 0 : _a[cell.column.columnKey]) || {}).props || {};
36221
- const height = cal.getRowHeight(rowIndex, cprops.rowSpan);
36222
- if (pos2 !== void 0) {
36223
- updateAnimate();
36224
- if (pos2 < st) {
36225
- scrollTop.value = pos2;
36226
- } else {
36227
- if (pos2 + height > st + bodyHeight.value) {
36228
- scrollTop.value = pos2 + height - bodyHeight.value;
36229
- }
36230
- }
36231
- }
36232
- },
36233
- latestRangeStartCell,
36234
- bodyRef: vue.computed(() => {
36235
- var _a;
36236
- return (_a = bodyRef.value) == null ? void 0 : _a.bodyRef;
36237
- }),
36238
- scrollLeft,
36239
- scrollTop,
36240
- scrollTo,
36241
- showVerticalScrollbar,
36242
- showHorizontalScrollbar,
36243
- getIndexsByKey,
36244
- formatRangeCellText: (parmas) => {
36245
- if (props.formatRangeCellText) {
36246
- return props.formatRangeCellText(parmas);
36247
- } else if (parmas.value) {
36248
- return parmas.value;
36249
- }
36250
- return "";
36251
- },
36252
- editCellKeys,
36253
- copyDelimiter: vue.computed(() => props.copyDelimiter)
36254
- });
36255
35882
  expose({
36256
35883
  scrollTo,
36257
35884
  scrollLeft,
36258
35885
  scrollTop,
36259
35886
  rootRef,
36260
35887
  paginationRef,
35888
+ validateRowData,
35889
+ addEditRecord,
35890
+ cancelEditable,
35891
+ startEditable,
35892
+ saveEditable,
35893
+ validateTableData,
36261
35894
  bodyRef: vue.computed(() => {
36262
35895
  var _a;
36263
35896
  return (_a = bodyRef.value) == null ? void 0 : _a.bodyRef;
36264
- }),
36265
- getSelectedRange,
36266
- clearAllSelectedRange,
36267
- copySelectedRange,
36268
- appendCellToSelectedRange,
36269
- openEditor: (cellInfos) => {
36270
- openEditor(cellInfos.map((info) => `${info.rowKey} ${info.columnKey}`));
36271
- },
36272
- closeEditor: (cellInfos) => {
36273
- if (cellInfos) {
36274
- closeEditor(cellInfos.map((info) => `${info.rowKey} ${info.columnKey}`));
36275
- } else {
36276
- closeEditor();
36277
- }
36278
- }
35897
+ })
36279
35898
  });
36280
35899
  return {
36281
35900
  bodyRef,
@@ -36287,7 +35906,6 @@
36287
35906
  watermarkMsg,
36288
35907
  rootStyle,
36289
35908
  rootClass,
36290
- onBodyKeydown,
36291
35909
  watermarkStyle: vue.computed(() => ({
36292
35910
  minWidth: "100px!important",
36293
35911
  minHeight: "40px!important",
@@ -36332,12 +35950,6 @@
36332
35950
  bottomPaginationHeight.value = e.detail.height;
36333
35951
  },
36334
35952
  popupContainer,
36335
- handleGuardTopKeydown: (e) => {
36336
- e.keyCode !== KeyCode.TAB || e.shiftKey || (navigationService.getFirstCellToFocus(e.shiftKey), e.preventDefault());
36337
- },
36338
- handleGuardBottomKeydown: (e) => {
36339
- e.keyCode === KeyCode.TAB && e.shiftKey && (navigationService.getLastCellToFocus(e.shiftKey), e.preventDefault());
36340
- },
36341
35953
  tabGuardTopRef,
36342
35954
  tabGuardBottomRef,
36343
35955
  onShowSizeChange,
@@ -36348,6 +35960,18 @@
36348
35960
  }
36349
35961
  });
36350
35962
 
35963
+ const _hoisted_1$3 = {
35964
+ ref: "tabGuardTopRef",
35965
+ role: "presentation",
35966
+ tabindex: "0",
35967
+ style: { position: "absolute", width: "0", height: "0" }
35968
+ };
35969
+ const _hoisted_2 = {
35970
+ ref: "tabGuardBottomRef",
35971
+ role: "presentation",
35972
+ tabindex: "0",
35973
+ style: { position: "absolute", width: "0", height: "0" }
35974
+ };
36351
35975
  function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
36352
35976
  const _component_Pagination = vue.resolveComponent("Pagination");
36353
35977
  const _component_AutoHeightHeader = vue.resolveComponent("AutoHeightHeader");
@@ -36377,16 +36001,10 @@
36377
36001
  }), null, 16, ["class", "onChange", "onShowSizeChange"])) : vue.createCommentVNode("v-if", true),
36378
36002
  vue.createElementVNode(
36379
36003
  "div",
36380
- {
36381
- ref: "tabGuardTopRef",
36382
- role: "presentation",
36383
- tabindex: "0",
36384
- style: { position: "absolute", width: "0", height: "0" },
36385
- onKeydown: _cache[0] || (_cache[0] = (...args) => _ctx.handleGuardTopKeydown && _ctx.handleGuardTopKeydown(...args))
36386
- },
36004
+ _hoisted_1$3,
36387
36005
  null,
36388
- 544
36389
- /* NEED_HYDRATION, NEED_PATCH */
36006
+ 512
36007
+ /* NEED_PATCH */
36390
36008
  ),
36391
36009
  vue.createElementVNode(
36392
36010
  "div",
@@ -36419,20 +36037,19 @@
36419
36037
  vue.createVNode(_component_ProBody, {
36420
36038
  ref: "bodyRef",
36421
36039
  bodyScrollWidth: _ctx.bodyScrollWidth,
36422
- "onUpdate:bodyScrollWidth": _cache[1] || (_cache[1] = ($event) => _ctx.bodyScrollWidth = $event),
36040
+ "onUpdate:bodyScrollWidth": _cache[0] || (_cache[0] = ($event) => _ctx.bodyScrollWidth = $event),
36423
36041
  bodyWidth: _ctx.bodyWidth,
36424
- "onUpdate:bodyWidth": _cache[2] || (_cache[2] = ($event) => _ctx.bodyWidth = $event),
36042
+ "onUpdate:bodyWidth": _cache[1] || (_cache[1] = ($event) => _ctx.bodyWidth = $event),
36425
36043
  bodyHeight: _ctx.bodyHeight,
36426
- "onUpdate:bodyHeight": _cache[3] || (_cache[3] = ($event) => _ctx.bodyHeight = $event),
36044
+ "onUpdate:bodyHeight": _cache[2] || (_cache[2] = ($event) => _ctx.bodyHeight = $event),
36427
36045
  "prefix-cls": _ctx.prefixCls,
36428
36046
  "wrap-text": _ctx.wrapText,
36429
36047
  "scroll-x": _ctx.mergedScrollX,
36430
36048
  height: _ctx.mergedScrollY,
36431
36049
  "summary-fixed": _ctx.mergedSummaryFixed,
36432
36050
  summary: _ctx.$slots.summary,
36433
- "empty-text": _ctx.$slots.emptyText,
36434
- onKeydown: _ctx.onBodyKeydown
36435
- }, null, 8, ["bodyScrollWidth", "bodyWidth", "bodyHeight", "prefix-cls", "wrap-text", "scroll-x", "height", "summary-fixed", "summary", "empty-text", "onKeydown"])
36051
+ "empty-text": _ctx.$slots.emptyText
36052
+ }, null, 8, ["bodyScrollWidth", "bodyWidth", "bodyHeight", "prefix-cls", "wrap-text", "scroll-x", "height", "summary-fixed", "summary", "empty-text"])
36436
36053
  ],
36437
36054
  6
36438
36055
  /* CLASS, STYLE */
@@ -36440,16 +36057,10 @@
36440
36057
  vue.createVNode(_component_HorizontalScroll),
36441
36058
  vue.createElementVNode(
36442
36059
  "div",
36443
- {
36444
- ref: "tabGuardBottomRef",
36445
- role: "presentation",
36446
- tabindex: "0",
36447
- style: { position: "absolute", width: "0", height: "0" },
36448
- onKeydown: _cache[4] || (_cache[4] = (...args) => _ctx.handleGuardBottomKeydown && _ctx.handleGuardBottomKeydown(...args))
36449
- },
36060
+ _hoisted_2,
36450
36061
  null,
36451
- 544
36452
- /* NEED_HYDRATION, NEED_PATCH */
36062
+ 512
36063
+ /* NEED_PATCH */
36453
36064
  ),
36454
36065
  _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock(
36455
36066
  "div",
@@ -36474,7 +36085,7 @@
36474
36085
  ref: "paginationRef",
36475
36086
  style: vue.normalizeStyle(_ctx.bottomPaginationStyle),
36476
36087
  class: vue.normalizeClass(`${_ctx.prefixCls}-pagination-wrap ${_ctx.prefixCls}-pagination-wrap-${_ctx.size}`),
36477
- onResizeheight: _cache[5] || (_cache[5] = (...args) => _ctx.handlePaginationResize && _ctx.handlePaginationResize(...args))
36088
+ onResizeheight: _cache[3] || (_cache[3] = (...args) => _ctx.handlePaginationResize && _ctx.handlePaginationResize(...args))
36478
36089
  },
36479
36090
  [
36480
36091
  vue.createVNode(_component_Pagination, vue.mergeProps({ class: _ctx.paginationClass }, _ctx.paginationProps, {
@@ -38259,6 +37870,30 @@
38259
37870
  var _a2;
38260
37871
  (_a2 = tableRef.value) == null ? void 0 : _a2.scrollTo(pos, behavior);
38261
37872
  },
37873
+ validateRowData: (recordKey) => {
37874
+ var _a2;
37875
+ return (_a2 = tableRef.value) == null ? void 0 : _a2.validateRowData(recordKey);
37876
+ },
37877
+ validateTableData: () => {
37878
+ var _a2;
37879
+ return (_a2 = tableRef.value) == null ? void 0 : _a2.validateTableData();
37880
+ },
37881
+ addEditRecord: (recordValue, options) => {
37882
+ var _a2;
37883
+ return (_a2 = tableRef.value) == null ? void 0 : _a2.addEditRecord(recordValue, options);
37884
+ },
37885
+ startEditable: (recordKey, recordValue) => {
37886
+ var _a2;
37887
+ return (_a2 = tableRef.value) == null ? void 0 : _a2.startEditable(recordKey, recordValue);
37888
+ },
37889
+ cancelEditable: (recordValue, options) => {
37890
+ var _a2;
37891
+ return (_a2 = tableRef.value) == null ? void 0 : _a2.cancelEditable(recordValue, options);
37892
+ },
37893
+ saveEditable: (recordKey) => {
37894
+ var _a2;
37895
+ return (_a2 = tableRef.value) == null ? void 0 : _a2.saveEditable(recordKey);
37896
+ },
38262
37897
  scrollLeft: vue.computed(() => {
38263
37898
  var _a2;
38264
37899
  return vue.unref((_a2 = tableRef.value) == null ? void 0 : _a2.scrollLeft);
@@ -38279,18 +37914,6 @@
38279
37914
  var _a2;
38280
37915
  return vue.unref((_a2 = tableRef.value) == null ? void 0 : _a2.paginationRef);
38281
37916
  }),
38282
- copySelectedRange: () => {
38283
- var _a2;
38284
- return (_a2 = tableRef.value) == null ? void 0 : _a2.copySelectedRange();
38285
- },
38286
- getSelectedRange: () => {
38287
- var _a2;
38288
- return (_a2 = tableRef.value) == null ? void 0 : _a2.getSelectedRange();
38289
- },
38290
- clearAllSelectedRange: () => {
38291
- var _a2;
38292
- return (_a2 = tableRef.value) == null ? void 0 : _a2.clearAllSelectedRange();
38293
- },
38294
37917
  clearDataSource: () => {
38295
37918
  dataSource.value = [];
38296
37919
  },
@@ -38300,14 +37923,6 @@
38300
37923
  var _a2;
38301
37924
  return (_a2 = tableRef.value) == null ? void 0 : _a2.appendCellToSelectedRange(params);
38302
37925
  },
38303
- openEditor: (cellInfos) => {
38304
- var _a2;
38305
- return (_a2 = tableRef.value) == null ? void 0 : _a2.openEditor(cellInfos);
38306
- },
38307
- closeEditor: (cellInfos) => {
38308
- var _a2;
38309
- return (_a2 = tableRef.value) == null ? void 0 : _a2.closeEditor(cellInfos);
38310
- },
38311
37926
  reload,
38312
37927
  reset,
38313
37928
  calcTableHeight,