pro-design-vue 1.3.21 → 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.
- package/dist/index.css +1 -1
- package/dist/index.full.js +1181 -1585
- package/dist/index.full.min.js +7 -9
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +7 -9
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +1182 -1586
- package/es/components/config-provider/src/typing.d.ts +1 -0
- package/es/components/table/src/components/Body/Body.vue.d.ts +261 -15
- package/es/components/table/src/components/Body/BodyCell.vue.d.ts +255 -0
- package/es/components/table/src/components/Body/BodyEditCell.d.ts +60 -0
- package/es/components/table/src/components/Body/BodyRow.vue.d.ts +261 -15
- package/es/components/table/src/components/Body/BodyRows.vue.d.ts +261 -15
- package/es/components/table/src/components/Body/{BodyCell.d.ts → BodyTextCell.d.ts} +1 -7
- package/es/components/table/src/components/InteralTable.vue.d.ts +314 -19
- package/es/components/table/src/components/Table.d.ts +51 -0
- package/es/components/table/src/components/context/TableContext.d.ts +4 -0
- package/es/components/table/src/components/interface.d.ts +295 -23
- package/es/components/table/src/hooks/useCellProps.d.ts +5 -1
- package/es/components/table/src/hooks/useEdit.d.ts +24 -7
- package/es/components/table/src/utils/form-model.d.ts +25 -0
- package/es/components/table/src/utils/util.d.ts +1 -0
- package/es/index.d.ts +276 -5
- package/es/packages/components/table/src/components/Body/BodyCell.vue.mjs +35 -0
- package/es/packages/components/table/src/components/Body/BodyCell.vue.mjs.map +1 -0
- package/es/packages/components/table/src/components/Body/BodyCell.vue2.mjs +129 -0
- package/es/packages/components/table/src/components/Body/BodyCell.vue2.mjs.map +1 -0
- package/es/packages/components/table/src/components/Body/BodyEditCell.mjs +256 -0
- package/es/packages/components/table/src/components/Body/BodyEditCell.mjs.map +1 -0
- package/es/packages/components/table/src/components/Body/BodyRow.vue.mjs +63 -8
- package/es/packages/components/table/src/components/Body/BodyRow.vue.mjs.map +1 -1
- package/es/packages/components/table/src/components/Body/BodyRow.vue2.mjs +24 -18
- package/es/packages/components/table/src/components/Body/BodyRow.vue2.mjs.map +1 -1
- package/es/packages/components/table/src/components/Body/{BodyCell.mjs → BodyTextCell.mjs} +25 -155
- package/es/packages/components/table/src/components/Body/BodyTextCell.mjs.map +1 -0
- package/es/packages/components/table/src/components/InteralTable.vue.mjs +24 -25
- package/es/packages/components/table/src/components/InteralTable.vue.mjs.map +1 -1
- package/es/packages/components/table/src/components/InteralTable.vue2.mjs +36 -97
- package/es/packages/components/table/src/components/InteralTable.vue2.mjs.map +1 -1
- package/es/packages/components/table/src/components/Table.mjs +24 -20
- package/es/packages/components/table/src/components/Table.mjs.map +1 -1
- package/es/packages/components/table/src/components/context/TableContext.mjs.map +1 -1
- package/es/packages/components/table/src/components/interface.mjs +24 -0
- package/es/packages/components/table/src/components/interface.mjs.map +1 -1
- package/es/packages/components/table/src/hooks/useCellProps.mjs +8 -0
- package/es/packages/components/table/src/hooks/useCellProps.mjs.map +1 -1
- package/es/packages/components/table/src/hooks/useEdit.mjs +293 -18
- package/es/packages/components/table/src/hooks/useEdit.mjs.map +1 -1
- package/es/packages/components/table/src/utils/form-model.mjs +98 -0
- package/es/packages/components/table/src/utils/form-model.mjs.map +1 -0
- package/es/packages/components/table/src/utils/util.mjs +4 -1
- package/es/packages/components/table/src/utils/util.mjs.map +1 -1
- package/es/packages/utils/dom.mjs +15 -1
- package/es/packages/utils/dom.mjs.map +1 -1
- package/es/packages/utils/index.mjs +1 -1
- package/es/utils/dom.d.ts +2 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/config-provider/src/typing.d.ts +1 -0
- package/lib/components/table/src/components/Body/Body.vue.d.ts +261 -15
- package/lib/components/table/src/components/Body/BodyCell.vue.d.ts +255 -0
- package/lib/components/table/src/components/Body/BodyEditCell.d.ts +60 -0
- package/lib/components/table/src/components/Body/BodyRow.vue.d.ts +261 -15
- package/lib/components/table/src/components/Body/BodyRows.vue.d.ts +261 -15
- package/lib/components/table/src/components/Body/{BodyCell.d.ts → BodyTextCell.d.ts} +1 -7
- package/lib/components/table/src/components/InteralTable.vue.d.ts +314 -19
- package/lib/components/table/src/components/Table.d.ts +51 -0
- package/lib/components/table/src/components/context/TableContext.d.ts +4 -0
- package/lib/components/table/src/components/interface.d.ts +295 -23
- package/lib/components/table/src/hooks/useCellProps.d.ts +5 -1
- package/lib/components/table/src/hooks/useEdit.d.ts +24 -7
- package/lib/components/table/src/utils/form-model.d.ts +25 -0
- package/lib/components/table/src/utils/util.d.ts +1 -0
- package/lib/index.d.ts +276 -5
- package/lib/packages/components/table/src/components/Body/BodyCell.vue.js +39 -0
- package/lib/packages/components/table/src/components/Body/BodyCell.vue.js.map +1 -0
- package/lib/packages/components/table/src/components/Body/BodyCell.vue2.js +133 -0
- package/lib/packages/components/table/src/components/Body/BodyCell.vue2.js.map +1 -0
- package/lib/packages/components/table/src/components/Body/BodyEditCell.js +260 -0
- package/lib/packages/components/table/src/components/Body/BodyEditCell.js.map +1 -0
- package/lib/packages/components/table/src/components/Body/BodyRow.vue.js +63 -8
- package/lib/packages/components/table/src/components/Body/BodyRow.vue.js.map +1 -1
- package/lib/packages/components/table/src/components/Body/BodyRow.vue2.js +22 -16
- package/lib/packages/components/table/src/components/Body/BodyRow.vue2.js.map +1 -1
- package/lib/packages/components/table/src/components/Body/{BodyCell.js → BodyTextCell.js} +24 -154
- package/lib/packages/components/table/src/components/Body/BodyTextCell.js.map +1 -0
- package/lib/packages/components/table/src/components/InteralTable.vue.js +24 -25
- package/lib/packages/components/table/src/components/InteralTable.vue.js.map +1 -1
- package/lib/packages/components/table/src/components/InteralTable.vue2.js +36 -97
- package/lib/packages/components/table/src/components/InteralTable.vue2.js.map +1 -1
- package/lib/packages/components/table/src/components/Table.js +24 -20
- package/lib/packages/components/table/src/components/Table.js.map +1 -1
- package/lib/packages/components/table/src/components/context/TableContext.js.map +1 -1
- package/lib/packages/components/table/src/components/interface.js +24 -0
- package/lib/packages/components/table/src/components/interface.js.map +1 -1
- package/lib/packages/components/table/src/hooks/useCellProps.js +8 -0
- package/lib/packages/components/table/src/hooks/useCellProps.js.map +1 -1
- package/lib/packages/components/table/src/hooks/useEdit.js +292 -17
- package/lib/packages/components/table/src/hooks/useEdit.js.map +1 -1
- package/lib/packages/components/table/src/utils/form-model.js +102 -0
- package/lib/packages/components/table/src/utils/form-model.js.map +1 -0
- package/lib/packages/components/table/src/utils/util.js +4 -0
- package/lib/packages/components/table/src/utils/util.js.map +1 -1
- package/lib/packages/utils/dom.js +16 -0
- package/lib/packages/utils/dom.js.map +1 -1
- package/lib/packages/utils/index.js +2 -0
- package/lib/packages/utils/index.js.map +1 -1
- package/lib/utils/dom.d.ts +2 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/table/table.less +29 -2
- package/es/components/table/src/components/Body/EditInput.vue.d.ts +0 -102
- package/es/packages/components/table/src/components/Body/BodyCell.mjs.map +0 -1
- package/es/packages/components/table/src/components/Body/EditInput.vue.mjs +0 -48
- package/es/packages/components/table/src/components/Body/EditInput.vue.mjs.map +0 -1
- package/es/packages/components/table/src/components/Body/EditInput.vue2.mjs +0 -151
- package/es/packages/components/table/src/components/Body/EditInput.vue2.mjs.map +0 -1
- package/lib/components/table/src/components/Body/EditInput.vue.d.ts +0 -102
- package/lib/packages/components/table/src/components/Body/BodyCell.js.map +0 -1
- package/lib/packages/components/table/src/components/Body/EditInput.vue.js +0 -52
- package/lib/packages/components/table/src/components/Body/EditInput.vue.js.map +0 -1
- package/lib/packages/components/table/src/components/Body/EditInput.vue2.js +0 -155
- package/lib/packages/components/table/src/components/Body/EditInput.vue2.js.map +0 -1
package/dist/index.full.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Pro Design Vue v1.3.
|
|
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.
|
|
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$
|
|
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$
|
|
779
|
+
_defineProperty$w(target, key, source[key]);
|
|
780
780
|
});
|
|
781
781
|
}
|
|
782
782
|
return target;
|
|
783
783
|
}
|
|
784
|
-
function _defineProperty$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
905
|
+
_defineProperty$v(target, key, source[key]);
|
|
906
906
|
});
|
|
907
907
|
}
|
|
908
908
|
return target;
|
|
909
909
|
}
|
|
910
|
-
function _defineProperty$
|
|
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$
|
|
930
|
+
return _objectSpread$u({}, twoToneColorPalette);
|
|
931
931
|
}
|
|
932
932
|
var IconBase = function IconBase2(props, context) {
|
|
933
|
-
var _props$context$attrs = _objectSpread$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
1102
|
+
_defineProperty$u(target, key, source[key]);
|
|
1103
1103
|
});
|
|
1104
1104
|
}
|
|
1105
1105
|
return target;
|
|
1106
1106
|
}
|
|
1107
|
-
function _defineProperty$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
1194
|
+
_defineProperty$t(target, key, source[key]);
|
|
1195
1195
|
});
|
|
1196
1196
|
}
|
|
1197
1197
|
return target;
|
|
1198
1198
|
}
|
|
1199
|
-
function _defineProperty$
|
|
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$
|
|
1209
|
-
return vue.createVNode(Icon$1, _objectSpread$
|
|
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$
|
|
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$
|
|
1228
|
+
_defineProperty$s(target, key, source[key]);
|
|
1229
1229
|
});
|
|
1230
1230
|
}
|
|
1231
1231
|
return target;
|
|
1232
1232
|
}
|
|
1233
|
-
function _defineProperty$
|
|
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$
|
|
1243
|
-
return vue.createVNode(Icon$1, _objectSpread$
|
|
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
|
|
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":
|
|
1312
|
+
"icon": CloseCircleFilled$1
|
|
1279
1313
|
}), null);
|
|
1280
1314
|
};
|
|
1281
|
-
|
|
1282
|
-
|
|
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,6 +24111,10 @@
|
|
|
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
|
|
@@ -24121,6 +24177,14 @@
|
|
|
24121
24177
|
type: Function,
|
|
24122
24178
|
default: () => ({})
|
|
24123
24179
|
},
|
|
24180
|
+
editableKeys: {
|
|
24181
|
+
type: Array,
|
|
24182
|
+
default: void 0
|
|
24183
|
+
},
|
|
24184
|
+
rowEditable: {
|
|
24185
|
+
type: Object,
|
|
24186
|
+
default: void 0
|
|
24187
|
+
},
|
|
24124
24188
|
showHeader: {
|
|
24125
24189
|
type: Boolean,
|
|
24126
24190
|
default: true
|
|
@@ -24219,6 +24283,9 @@
|
|
|
24219
24283
|
type: Boolean,
|
|
24220
24284
|
default: void 0
|
|
24221
24285
|
},
|
|
24286
|
+
editableCellState: {
|
|
24287
|
+
type: Function
|
|
24288
|
+
},
|
|
24222
24289
|
paginationSticky: {
|
|
24223
24290
|
type: [Boolean, Object],
|
|
24224
24291
|
default: true
|
|
@@ -24272,6 +24339,15 @@
|
|
|
24272
24339
|
type: Function,
|
|
24273
24340
|
default: void 0
|
|
24274
24341
|
},
|
|
24342
|
+
onDataChange: {
|
|
24343
|
+
type: Function
|
|
24344
|
+
},
|
|
24345
|
+
onRowValidate: {
|
|
24346
|
+
type: Function
|
|
24347
|
+
},
|
|
24348
|
+
onValidate: {
|
|
24349
|
+
type: Function
|
|
24350
|
+
},
|
|
24275
24351
|
"onUpdate:pagination": {
|
|
24276
24352
|
type: Function
|
|
24277
24353
|
},
|
|
@@ -25024,41 +25100,305 @@
|
|
|
25024
25100
|
const ICON_TYPE_FORBID$1 = "ICON_TYPE_FORBID";
|
|
25025
25101
|
|
|
25026
25102
|
const EditKey = Symbol("edit");
|
|
25027
|
-
const useEditProvider = (
|
|
25103
|
+
const useEditProvider = (props, {
|
|
25104
|
+
rawData,
|
|
25105
|
+
getRowKey,
|
|
25106
|
+
getIndexsByKey,
|
|
25107
|
+
getRecordByKey
|
|
25108
|
+
}) => {
|
|
25109
|
+
var _a;
|
|
25028
25110
|
const editCellKeys = vue.shallowRef([]);
|
|
25029
|
-
const
|
|
25030
|
-
const
|
|
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) => {
|
|
25031
25146
|
if (key) {
|
|
25147
|
+
const newKeys = [...editCellKeys.value];
|
|
25032
25148
|
if (Array.isArray(key)) {
|
|
25033
25149
|
editCellKeys.value = key;
|
|
25034
25150
|
} else {
|
|
25035
|
-
|
|
25151
|
+
newKeys.includes(key) || newKeys.push(key);
|
|
25036
25152
|
}
|
|
25037
|
-
|
|
25153
|
+
editCellKeys.value = newKeys;
|
|
25038
25154
|
}
|
|
25039
25155
|
};
|
|
25040
25156
|
const closeEditor = (key) => {
|
|
25041
|
-
|
|
25042
|
-
|
|
25043
|
-
|
|
25044
|
-
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];
|
|
25045
25185
|
}
|
|
25046
|
-
|
|
25047
|
-
|
|
25048
|
-
|
|
25049
|
-
|
|
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
|
+
}
|
|
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);
|
|
25050
25257
|
});
|
|
25051
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);
|
|
25379
|
+
};
|
|
25052
25380
|
vue.provide(EditKey, {
|
|
25053
25381
|
editCellKeys,
|
|
25054
25382
|
openEditor,
|
|
25055
25383
|
closeEditor,
|
|
25056
|
-
oldValuesMap
|
|
25384
|
+
// oldValuesMap,
|
|
25385
|
+
editableType,
|
|
25386
|
+
mergedEditableKeys,
|
|
25387
|
+
isRowEdit,
|
|
25388
|
+
editRowsMap,
|
|
25389
|
+
setEditingCell
|
|
25057
25390
|
});
|
|
25058
25391
|
return {
|
|
25059
25392
|
editCellKeys,
|
|
25060
25393
|
openEditor,
|
|
25061
|
-
closeEditor
|
|
25394
|
+
closeEditor,
|
|
25395
|
+
cancelEditable,
|
|
25396
|
+
startEditable,
|
|
25397
|
+
saveEditable,
|
|
25398
|
+
isEditable,
|
|
25399
|
+
validateTableData,
|
|
25400
|
+
validateRowData,
|
|
25401
|
+
addEditRecord
|
|
25062
25402
|
};
|
|
25063
25403
|
};
|
|
25064
25404
|
const useEditInject = () => {
|
|
@@ -25068,7 +25408,13 @@
|
|
|
25068
25408
|
},
|
|
25069
25409
|
closeEditor: () => {
|
|
25070
25410
|
},
|
|
25071
|
-
oldValuesMap:
|
|
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
|
+
}
|
|
25072
25418
|
});
|
|
25073
25419
|
};
|
|
25074
25420
|
|
|
@@ -25319,926 +25665,6 @@
|
|
|
25319
25665
|
return vue.inject(TableContextKey, {});
|
|
25320
25666
|
};
|
|
25321
25667
|
|
|
25322
|
-
const KeyCode = {
|
|
25323
|
-
TAB: 9,
|
|
25324
|
-
ENTER: 13,
|
|
25325
|
-
ESC: 27,
|
|
25326
|
-
LEFT: 37,
|
|
25327
|
-
UP: 38,
|
|
25328
|
-
RIGHT: 39,
|
|
25329
|
-
DOWN: 40,
|
|
25330
|
-
A: 65,
|
|
25331
|
-
C: 67};
|
|
25332
|
-
|
|
25333
|
-
const useCellNavigation = (params) => {
|
|
25334
|
-
const {
|
|
25335
|
-
getDisplayedColBefore,
|
|
25336
|
-
getDisplayedColAfter,
|
|
25337
|
-
allDisplayedColumns,
|
|
25338
|
-
setRangeToCell,
|
|
25339
|
-
focusCell,
|
|
25340
|
-
flattenData,
|
|
25341
|
-
getRowByFlattenIndex,
|
|
25342
|
-
allCellProps,
|
|
25343
|
-
tabGuardTopRef,
|
|
25344
|
-
tabGuardBottomRef
|
|
25345
|
-
} = params;
|
|
25346
|
-
const endFlattenIndex = vue.computed(
|
|
25347
|
-
() => {
|
|
25348
|
-
var _a;
|
|
25349
|
-
return (_a = flattenData.value[flattenData.value.length - 1]) == null ? void 0 : _a.flattenIndex;
|
|
25350
|
-
}
|
|
25351
|
-
);
|
|
25352
|
-
const startFlattenIndex = vue.computed(() => {
|
|
25353
|
-
var _a;
|
|
25354
|
-
return (_a = flattenData.value[0]) == null ? void 0 : _a.flattenIndex;
|
|
25355
|
-
});
|
|
25356
|
-
const getNextCellToFocus = (keyCode, focusedCell, ctrlPressed = false) => ctrlPressed ? h2(keyCode, focusedCell) : m(keyCode, focusedCell);
|
|
25357
|
-
const h2 = (keyCode, focusedCell) => {
|
|
25358
|
-
const isUp = keyCode === KeyCode.UP;
|
|
25359
|
-
const isDown = keyCode === KeyCode.DOWN;
|
|
25360
|
-
const isLeft = keyCode === KeyCode.LEFT;
|
|
25361
|
-
let column, rowIndex;
|
|
25362
|
-
if (isUp || isDown) {
|
|
25363
|
-
rowIndex = isUp ? startFlattenIndex.value : endFlattenIndex.value;
|
|
25364
|
-
column = focusedCell.column;
|
|
25365
|
-
} else {
|
|
25366
|
-
rowIndex = focusedCell.rowIndex;
|
|
25367
|
-
column = isLeft !== false ? allDisplayedColumns.value[0] : allDisplayedColumns.value[allDisplayedColumns.value.length - 1];
|
|
25368
|
-
}
|
|
25369
|
-
return { rowIndex, rowPinned: null, column };
|
|
25370
|
-
};
|
|
25371
|
-
const m = (keyCode, focusedCell) => {
|
|
25372
|
-
let cell = focusedCell;
|
|
25373
|
-
let o2 = false;
|
|
25374
|
-
for (; !o2; ) {
|
|
25375
|
-
switch (keyCode) {
|
|
25376
|
-
case KeyCode.UP:
|
|
25377
|
-
cell = getCellAbove(cell);
|
|
25378
|
-
break;
|
|
25379
|
-
case KeyCode.DOWN:
|
|
25380
|
-
case KeyCode.ENTER:
|
|
25381
|
-
cell = x(cell);
|
|
25382
|
-
break;
|
|
25383
|
-
case KeyCode.RIGHT:
|
|
25384
|
-
cell = w(cell);
|
|
25385
|
-
break;
|
|
25386
|
-
case KeyCode.LEFT:
|
|
25387
|
-
cell = g(cell);
|
|
25388
|
-
break;
|
|
25389
|
-
default:
|
|
25390
|
-
cell = null;
|
|
25391
|
-
console.warn("Table: unknown key for navigation " + keyCode);
|
|
25392
|
-
}
|
|
25393
|
-
o2 = !cell || y(cell);
|
|
25394
|
-
}
|
|
25395
|
-
return cell;
|
|
25396
|
-
}, y = (e3) => {
|
|
25397
|
-
let t2;
|
|
25398
|
-
switch (e3.rowPinned) {
|
|
25399
|
-
case "top":
|
|
25400
|
-
case "bottom":
|
|
25401
|
-
break;
|
|
25402
|
-
default:
|
|
25403
|
-
t2 = getRowByFlattenIndex(e3.rowIndex);
|
|
25404
|
-
}
|
|
25405
|
-
return !!t2;
|
|
25406
|
-
}, g = (e3) => {
|
|
25407
|
-
if (!e3) return null;
|
|
25408
|
-
const n2 = getDisplayedColBefore(e3.column);
|
|
25409
|
-
return n2 ? { rowIndex: e3.rowIndex, column: n2, rowPinned: e3.rowPinned } : null;
|
|
25410
|
-
}, w = (e3) => {
|
|
25411
|
-
if (!e3) return null;
|
|
25412
|
-
const t2 = getDisplayedColAfter(e3.column);
|
|
25413
|
-
return t2 ? { rowIndex: e3.rowIndex, column: t2, rowPinned: e3.rowPinned } : null;
|
|
25414
|
-
}, x = (e3) => {
|
|
25415
|
-
if (!e3) return null;
|
|
25416
|
-
const t2 = getRowBelow(e3);
|
|
25417
|
-
return t2 ? { rowIndex: t2.rowIndex, column: e3.column, rowPinned: t2.rowPinned } : null;
|
|
25418
|
-
}, getRowBelow = (e3) => {
|
|
25419
|
-
const t2 = e3.rowIndex, n2 = e3.rowPinned;
|
|
25420
|
-
return C(e3) ? null : { rowIndex: t2 + 1, rowPinned: n2 };
|
|
25421
|
-
}, C = (e3) => {
|
|
25422
|
-
const t2 = e3.rowIndex;
|
|
25423
|
-
return endFlattenIndex.value <= t2;
|
|
25424
|
-
}, getRowAbove = (e3) => {
|
|
25425
|
-
const t2 = e3.rowIndex, n2 = e3.rowPinned;
|
|
25426
|
-
return (n2 ? 0 === t2 : t2 === startFlattenIndex.value) ? null : { rowIndex: t2 - 1, rowPinned: n2 };
|
|
25427
|
-
}, getCellAbove = (e3) => {
|
|
25428
|
-
if (!e3) return null;
|
|
25429
|
-
const t2 = getRowAbove({
|
|
25430
|
-
rowIndex: e3.rowIndex,
|
|
25431
|
-
rowPinned: e3.rowPinned
|
|
25432
|
-
});
|
|
25433
|
-
return t2 ? { rowIndex: t2.rowIndex, column: e3.column, rowPinned: t2.rowPinned } : null;
|
|
25434
|
-
}, k = (e3) => e3.rowIndex >= startFlattenIndex.value && e3.rowIndex <= endFlattenIndex.value, getNextTabbedCell = (e3, t2) => t2 ? K(e3) : _(e3), _ = (e3) => {
|
|
25435
|
-
const t2 = allDisplayedColumns.value;
|
|
25436
|
-
let l2 = e3.rowIndex, r2 = e3.rowPinned, a2 = getDisplayedColAfter(e3.column);
|
|
25437
|
-
if (!a2) {
|
|
25438
|
-
a2 = t2[0];
|
|
25439
|
-
const n2 = getRowBelow(e3);
|
|
25440
|
-
if (!n2) return null;
|
|
25441
|
-
if (!n2.rowPinned && !k(n2)) return null;
|
|
25442
|
-
l2 = n2 ? n2.rowIndex : null, r2 = n2 ? n2.rowPinned : null;
|
|
25443
|
-
}
|
|
25444
|
-
return { rowIndex: l2, column: a2, rowPinned: r2 };
|
|
25445
|
-
}, K = (e3) => {
|
|
25446
|
-
const n2 = allDisplayedColumns.value;
|
|
25447
|
-
let l2 = e3.rowIndex, r2 = e3.rowPinned, a2 = getDisplayedColBefore(e3.column);
|
|
25448
|
-
if (!a2) {
|
|
25449
|
-
a2 = n2[n2.length - 1];
|
|
25450
|
-
const t2 = getRowAbove({
|
|
25451
|
-
rowIndex: e3.rowIndex,
|
|
25452
|
-
rowPinned: e3.rowPinned
|
|
25453
|
-
});
|
|
25454
|
-
if (!t2) return null;
|
|
25455
|
-
if (!t2.rowPinned && !k(t2)) return null;
|
|
25456
|
-
l2 = t2 ? t2.rowIndex : null, r2 = t2 ? t2.rowPinned : null;
|
|
25457
|
-
}
|
|
25458
|
-
return { rowIndex: l2, column: a2, rowPinned: r2 };
|
|
25459
|
-
}, O = (e3) => {
|
|
25460
|
-
const t2 = ((e4) => {
|
|
25461
|
-
let t3, n2;
|
|
25462
|
-
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 = [];
|
|
25463
|
-
if (r2 > 1) {
|
|
25464
|
-
const t4 = allDisplayedColumns.value.findIndex(
|
|
25465
|
-
(t5) => t5.columnKey === e4.column.columnKey
|
|
25466
|
-
);
|
|
25467
|
-
for (let e5 = 0; e5 < r2; e5++) a2.push(allDisplayedColumns.value[t4 + e5]);
|
|
25468
|
-
} else a2.push(e4.column);
|
|
25469
|
-
return a2.filter((e5) => !!e5);
|
|
25470
|
-
})(e3);
|
|
25471
|
-
return 1 === t2.length ? e3 : {
|
|
25472
|
-
rowIndex: e3.rowIndex,
|
|
25473
|
-
column: t2[t2.length - 1],
|
|
25474
|
-
rowPinned: e3.rowPinned
|
|
25475
|
-
};
|
|
25476
|
-
}, P = (e3) => {
|
|
25477
|
-
let t2;
|
|
25478
|
-
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;
|
|
25479
|
-
return !!n2 && 0 !== l2 && !n2.isExpandRow;
|
|
25480
|
-
}, tabToNextCellCommon = (e3, t2) => $(e3, t2), $ = (e3, t2) => {
|
|
25481
|
-
const n2 = T(e3, t2);
|
|
25482
|
-
return n2 && focusCell(n2), !!n2;
|
|
25483
|
-
}, T = (t2, n2) => {
|
|
25484
|
-
let o2 = t2;
|
|
25485
|
-
for (; o2 && (o2 === t2 || !P(o2)); ) n2 || (o2 = O(o2)), o2 = getNextTabbedCell(o2, n2);
|
|
25486
|
-
return o2 ? o2.rowIndex < 0 ? null : (params.ensureCellVisible(o2), setRangeToCell(o2), o2) : null;
|
|
25487
|
-
};
|
|
25488
|
-
return {
|
|
25489
|
-
getNextCellToFocus,
|
|
25490
|
-
getNextTabbedCell,
|
|
25491
|
-
getLastBodyCell: () => ({ rowIndex: endFlattenIndex.value, rowPinned: null }),
|
|
25492
|
-
navigateToNextCell: (t2, n2) => {
|
|
25493
|
-
const o2 = t2.keyCode;
|
|
25494
|
-
let r2 = n2, a2 = false;
|
|
25495
|
-
for (; r2 && (r2 === n2 || !P(r2)); )
|
|
25496
|
-
o2 === KeyCode.RIGHT && (r2 = O(r2)), r2 = getNextCellToFocus(o2, r2), a2 = !r2;
|
|
25497
|
-
a2 && t2 && o2 === KeyCode.UP && (r2 = { rowIndex: -1, rowPinned: null, column: n2.column }), r2 && (r2.rowIndex < 0 || (params.ensureCellVisible(r2), setRangeToCell(r2)));
|
|
25498
|
-
},
|
|
25499
|
-
onTabKeyDown: (e3, t2) => {
|
|
25500
|
-
let n2, o2;
|
|
25501
|
-
const l2 = t2.shiftKey;
|
|
25502
|
-
tabToNextCellCommon(e3, l2) || (l2 ? null === (n2 = tabGuardTopRef.value) || void 0 === n2 || n2.focus() : null === (o2 = tabGuardBottomRef.value) || void 0 === o2 || o2.focus()), t2.preventDefault();
|
|
25503
|
-
},
|
|
25504
|
-
tabToNextCellCommon,
|
|
25505
|
-
getFirstCellToFocus: (t2) => {
|
|
25506
|
-
const n2 = (() => {
|
|
25507
|
-
const e3 = getRowByFlattenIndex(startFlattenIndex.value), t3 = allDisplayedColumns.value[0];
|
|
25508
|
-
return e3 && t3 ? { rowIndex: e3.rowIndex, rowPinned: null, column: t3 } : null;
|
|
25509
|
-
})();
|
|
25510
|
-
P(n2) ? (params.ensureCellVisible(n2), setRangeToCell(n2)) : n2 && tabToNextCellCommon(n2, t2);
|
|
25511
|
-
},
|
|
25512
|
-
getLastCellToFocus: (t2) => {
|
|
25513
|
-
const n2 = (() => {
|
|
25514
|
-
const e3 = getRowByFlattenIndex(endFlattenIndex.value), t3 = allDisplayedColumns.value[allDisplayedColumns.value.length - 1];
|
|
25515
|
-
return e3 && t3 ? { rowIndex: e3.rowIndex, rowPinned: null, column: t3 } : null;
|
|
25516
|
-
})();
|
|
25517
|
-
P(n2) ? (params.ensureCellVisible(n2), setRangeToCell(n2)) : n2 && tabToNextCellCommon(n2, t2);
|
|
25518
|
-
},
|
|
25519
|
-
getRowAbove,
|
|
25520
|
-
getCellAbove,
|
|
25521
|
-
getRowBelow
|
|
25522
|
-
};
|
|
25523
|
-
};
|
|
25524
|
-
|
|
25525
|
-
const useAutoScroll = (params) => {
|
|
25526
|
-
const {
|
|
25527
|
-
scrollContainer,
|
|
25528
|
-
scrollAxis,
|
|
25529
|
-
onScrollCallback = () => {
|
|
25530
|
-
},
|
|
25531
|
-
showVerticalScrollbar,
|
|
25532
|
-
showHorizontalScrollbar
|
|
25533
|
-
} = params;
|
|
25534
|
-
let timer = null;
|
|
25535
|
-
let i = 0;
|
|
25536
|
-
let hasLeft = false;
|
|
25537
|
-
let hasRight = false;
|
|
25538
|
-
let hasTop = false;
|
|
25539
|
-
let hasBottom = false;
|
|
25540
|
-
const isXAxis = -1 !== scrollAxis.indexOf("x");
|
|
25541
|
-
const isYAxis = -1 !== scrollAxis.indexOf("y");
|
|
25542
|
-
const scrollByTick = vue.computed(() => {
|
|
25543
|
-
var _a, _b;
|
|
25544
|
-
return (_b = (_a = params.scrollByTick) == null ? void 0 : _a.value) != null ? _b : 20;
|
|
25545
|
-
});
|
|
25546
|
-
const exec = () => {
|
|
25547
|
-
if (null === timer) {
|
|
25548
|
-
timer = window.setInterval(handle, 100);
|
|
25549
|
-
i = 0;
|
|
25550
|
-
}
|
|
25551
|
-
};
|
|
25552
|
-
const handle = () => {
|
|
25553
|
-
i++;
|
|
25554
|
-
const boundary = i > 20 ? 200 : i > 10 ? 80 : 40;
|
|
25555
|
-
if (isYAxis) {
|
|
25556
|
-
const position = params.getVerticalPosition();
|
|
25557
|
-
hasTop && params.setVerticalPosition(position - boundary), hasBottom && params.setVerticalPosition(position + boundary);
|
|
25558
|
-
}
|
|
25559
|
-
if (isXAxis) {
|
|
25560
|
-
const position = params.getHorizontalPosition();
|
|
25561
|
-
hasLeft && params.setHorizontalPosition(position - boundary), hasRight && params.setHorizontalPosition(position + boundary);
|
|
25562
|
-
}
|
|
25563
|
-
onScrollCallback();
|
|
25564
|
-
};
|
|
25565
|
-
const clear = () => {
|
|
25566
|
-
if (timer) {
|
|
25567
|
-
window.clearInterval(timer);
|
|
25568
|
-
timer = null;
|
|
25569
|
-
}
|
|
25570
|
-
};
|
|
25571
|
-
return {
|
|
25572
|
-
check: (mouseEvent, forceSkipVerticalScroll = false) => {
|
|
25573
|
-
const hasVerticalScroll = forceSkipVerticalScroll || !showVerticalScrollbar.value;
|
|
25574
|
-
if (hasVerticalScroll && !showHorizontalScrollbar.value) return;
|
|
25575
|
-
const clientRect = scrollContainer.value.getBoundingClientRect();
|
|
25576
|
-
const tick = scrollByTick.value;
|
|
25577
|
-
hasLeft = mouseEvent.clientX < clientRect.left + tick;
|
|
25578
|
-
hasRight = mouseEvent.clientX > clientRect.right - tick;
|
|
25579
|
-
hasTop = mouseEvent.clientY < clientRect.top + tick && !hasVerticalScroll;
|
|
25580
|
-
hasBottom = mouseEvent.clientY > clientRect.bottom - tick && !hasVerticalScroll;
|
|
25581
|
-
return hasLeft || hasRight || hasTop || hasBottom ? exec() : clear();
|
|
25582
|
-
},
|
|
25583
|
-
ensureCleared: clear
|
|
25584
|
-
};
|
|
25585
|
-
};
|
|
25586
|
-
|
|
25587
|
-
const isOverFormFieldElement = (mouseEvent) => {
|
|
25588
|
-
var _a, _b;
|
|
25589
|
-
const tagName = (_b = (_a = mouseEvent.target) == null ? void 0 : _a.tagName) == null ? void 0 : _b.toLocaleLowerCase();
|
|
25590
|
-
return !!(tagName == null ? void 0 : tagName.match("^a$|textarea|input|select|button"));
|
|
25591
|
-
};
|
|
25592
|
-
const useDragSelection = (params) => {
|
|
25593
|
-
let dragging = false;
|
|
25594
|
-
let cacheStartTouch = null;
|
|
25595
|
-
let startTarget = null;
|
|
25596
|
-
let cacheTouch;
|
|
25597
|
-
const destroyHandlers = [];
|
|
25598
|
-
const batchEvent = (eventList) => {
|
|
25599
|
-
eventList.forEach((config) => {
|
|
25600
|
-
const { target, type, listener, options } = config;
|
|
25601
|
-
target.addEventListener(type, listener, options);
|
|
25602
|
-
});
|
|
25603
|
-
destroyHandlers.push(() => {
|
|
25604
|
-
eventList.forEach((config) => {
|
|
25605
|
-
const { target, type, listener, options } = config;
|
|
25606
|
-
target.removeEventListener(type, listener, options);
|
|
25607
|
-
});
|
|
25608
|
-
});
|
|
25609
|
-
};
|
|
25610
|
-
const getTouch = (touches) => {
|
|
25611
|
-
for (let i = 0; i < touches.length; i++) {
|
|
25612
|
-
if (touches[i].identifier === (cacheTouch == null ? void 0 : cacheTouch.identifier)) {
|
|
25613
|
-
return touches[i];
|
|
25614
|
-
}
|
|
25615
|
-
}
|
|
25616
|
-
return null;
|
|
25617
|
-
};
|
|
25618
|
-
const handleMouseMoveOrTouchMove = (event, cacheEvent) => {
|
|
25619
|
-
if (!dragging) {
|
|
25620
|
-
if (eventsClose(event, cacheEvent, DRAG_BUFF)) {
|
|
25621
|
-
return;
|
|
25622
|
-
}
|
|
25623
|
-
dragging = true;
|
|
25624
|
-
params.onDragStart(cacheEvent);
|
|
25625
|
-
}
|
|
25626
|
-
};
|
|
25627
|
-
const handleMouseUpOrToucheEnd = () => {
|
|
25628
|
-
if (dragging) {
|
|
25629
|
-
dragging = false;
|
|
25630
|
-
}
|
|
25631
|
-
cacheStartTouch = null;
|
|
25632
|
-
startTarget = null;
|
|
25633
|
-
cacheTouch = null;
|
|
25634
|
-
destroyHandlers.forEach((fn) => fn());
|
|
25635
|
-
destroyHandlers.length = 0;
|
|
25636
|
-
};
|
|
25637
|
-
const isOverForm = (event) => !isOverFormFieldElement(event);
|
|
25638
|
-
const mouseMoveHandler = (event) => {
|
|
25639
|
-
if (isOverForm(event)) {
|
|
25640
|
-
event.preventDefault();
|
|
25641
|
-
}
|
|
25642
|
-
handleMouseMoveOrTouchMove(event, cacheStartTouch);
|
|
25643
|
-
};
|
|
25644
|
-
const touchMoveHandler = (event) => {
|
|
25645
|
-
getTouch(event.touches) && handleMouseMoveOrTouchMove(event, cacheStartTouch);
|
|
25646
|
-
};
|
|
25647
|
-
const touchEndHandler = (event) => {
|
|
25648
|
-
getTouch(event.changedTouches) && handleMouseUpOrToucheEnd();
|
|
25649
|
-
};
|
|
25650
|
-
const onBodyMousedown = (e) => {
|
|
25651
|
-
var _a, _b;
|
|
25652
|
-
if (params.level !== ((_a = e.cellInfo) == null ? void 0 : _a.level)) return;
|
|
25653
|
-
if (isOverForm(e)) {
|
|
25654
|
-
e.preventDefault();
|
|
25655
|
-
}
|
|
25656
|
-
dragging = false;
|
|
25657
|
-
cacheStartTouch = e;
|
|
25658
|
-
startTarget = (_b = e.cellInfo) == null ? void 0 : _b.cellTarget;
|
|
25659
|
-
params.bodyElementRef.value;
|
|
25660
|
-
batchEvent([
|
|
25661
|
-
{
|
|
25662
|
-
target: document,
|
|
25663
|
-
type: "mousemove",
|
|
25664
|
-
listener: (e2) => mouseMoveHandler(e2)
|
|
25665
|
-
},
|
|
25666
|
-
{
|
|
25667
|
-
target: document,
|
|
25668
|
-
type: "mouseup",
|
|
25669
|
-
listener: () => {
|
|
25670
|
-
handleMouseUpOrToucheEnd();
|
|
25671
|
-
}
|
|
25672
|
-
},
|
|
25673
|
-
{
|
|
25674
|
-
target: document,
|
|
25675
|
-
type: "contextmenu",
|
|
25676
|
-
listener: (e2) => e2.preventDefault()
|
|
25677
|
-
}
|
|
25678
|
-
]);
|
|
25679
|
-
mouseMoveHandler(e);
|
|
25680
|
-
};
|
|
25681
|
-
let bodyTouchStartHandle;
|
|
25682
|
-
vue.watch(
|
|
25683
|
-
[() => params.bodyElementRef.value, params.enableRangeSelection],
|
|
25684
|
-
([bodyEl], [oldBodyEl]) => {
|
|
25685
|
-
if (oldBodyEl) {
|
|
25686
|
-
oldBodyEl.removeEventListener("mousedown", onBodyMousedown);
|
|
25687
|
-
if (bodyTouchStartHandle) {
|
|
25688
|
-
oldBodyEl.removeEventListener("touchstart", bodyTouchStartHandle);
|
|
25689
|
-
bodyTouchStartHandle = null;
|
|
25690
|
-
destroyHandlers.forEach((fn) => fn());
|
|
25691
|
-
destroyHandlers.length = 0;
|
|
25692
|
-
}
|
|
25693
|
-
}
|
|
25694
|
-
if (bodyEl && params.enableRangeSelection.value) {
|
|
25695
|
-
bodyEl.addEventListener("mousedown", onBodyMousedown);
|
|
25696
|
-
bodyTouchStartHandle = (e3) => {
|
|
25697
|
-
e3.cancelable && (e3.preventDefault(), e3.stopPropagation());
|
|
25698
|
-
};
|
|
25699
|
-
}
|
|
25700
|
-
}
|
|
25701
|
-
);
|
|
25702
|
-
return {
|
|
25703
|
-
onBodyMousedown,
|
|
25704
|
-
onBodyTouchstart: (touchEvent) => {
|
|
25705
|
-
dragging = false;
|
|
25706
|
-
const touch = touchEvent.touches[0];
|
|
25707
|
-
cacheTouch = touch;
|
|
25708
|
-
params.bodyElementRef.value;
|
|
25709
|
-
const endHandle = (event) => touchEndHandler(event);
|
|
25710
|
-
const target = touchEvent.target;
|
|
25711
|
-
const body = document.body;
|
|
25712
|
-
batchEvent([
|
|
25713
|
-
{
|
|
25714
|
-
target: body,
|
|
25715
|
-
type: "touchmove",
|
|
25716
|
-
listener: (e) => {
|
|
25717
|
-
e.cancelable && e.preventDefault();
|
|
25718
|
-
},
|
|
25719
|
-
options: { passive: false }
|
|
25720
|
-
},
|
|
25721
|
-
{
|
|
25722
|
-
target,
|
|
25723
|
-
type: "touchmove",
|
|
25724
|
-
listener: (e) => touchMoveHandler(e),
|
|
25725
|
-
options: { passive: true }
|
|
25726
|
-
},
|
|
25727
|
-
{
|
|
25728
|
-
target,
|
|
25729
|
-
type: "touchend",
|
|
25730
|
-
listener: endHandle,
|
|
25731
|
-
options: { passive: true }
|
|
25732
|
-
},
|
|
25733
|
-
{
|
|
25734
|
-
target,
|
|
25735
|
-
type: "touchcancel",
|
|
25736
|
-
listener: endHandle,
|
|
25737
|
-
options: { passive: true }
|
|
25738
|
-
}
|
|
25739
|
-
]);
|
|
25740
|
-
},
|
|
25741
|
-
getStartTarget: () => startTarget
|
|
25742
|
-
};
|
|
25743
|
-
};
|
|
25744
|
-
|
|
25745
|
-
function classNames(...args) {
|
|
25746
|
-
const classes = [];
|
|
25747
|
-
for (let i = 0; i < args.length; i++) {
|
|
25748
|
-
const value = args[i];
|
|
25749
|
-
if (!value) continue;
|
|
25750
|
-
if (isString(value)) {
|
|
25751
|
-
classes.push(value);
|
|
25752
|
-
} else if (isArray(value)) {
|
|
25753
|
-
for (let i2 = 0; i2 < value.length; i2++) {
|
|
25754
|
-
const inner = classNames(value[i2]);
|
|
25755
|
-
if (inner) {
|
|
25756
|
-
classes.push(inner);
|
|
25757
|
-
}
|
|
25758
|
-
}
|
|
25759
|
-
} else if (isObject(value)) {
|
|
25760
|
-
for (const name in value) {
|
|
25761
|
-
if (value[name]) {
|
|
25762
|
-
classes.push(name);
|
|
25763
|
-
}
|
|
25764
|
-
}
|
|
25765
|
-
}
|
|
25766
|
-
}
|
|
25767
|
-
return classes.join(" ");
|
|
25768
|
-
}
|
|
25769
|
-
|
|
25770
|
-
const RangeSymbolKey = Symbol("rangeSymbolKey");
|
|
25771
|
-
const useProvideRangeStore = (parmas) => {
|
|
25772
|
-
const {
|
|
25773
|
-
allColumns,
|
|
25774
|
-
flattenData,
|
|
25775
|
-
prefixCls,
|
|
25776
|
-
rangeSelection,
|
|
25777
|
-
getRowByFlattenIndex,
|
|
25778
|
-
rootRef,
|
|
25779
|
-
bodyRef,
|
|
25780
|
-
latestRangeStartCell,
|
|
25781
|
-
scrollLeft,
|
|
25782
|
-
scrollTop,
|
|
25783
|
-
scrollTo,
|
|
25784
|
-
showVerticalScrollbar,
|
|
25785
|
-
showHorizontalScrollbar,
|
|
25786
|
-
getIndexsByKey,
|
|
25787
|
-
formatRangeCellText,
|
|
25788
|
-
copyDelimiter
|
|
25789
|
-
} = parmas;
|
|
25790
|
-
const level = useInjectLevel();
|
|
25791
|
-
useAutoScroll({
|
|
25792
|
-
scrollContainer: bodyRef,
|
|
25793
|
-
scrollAxis: "xy",
|
|
25794
|
-
getVerticalPosition: () => scrollTop.value,
|
|
25795
|
-
setVerticalPosition: (pos) => {
|
|
25796
|
-
scrollTo(pos);
|
|
25797
|
-
},
|
|
25798
|
-
getHorizontalPosition: () => scrollLeft.value,
|
|
25799
|
-
setHorizontalPosition: (pos) => scrollTo({ left: pos }),
|
|
25800
|
-
showVerticalScrollbar,
|
|
25801
|
-
showHorizontalScrollbar
|
|
25802
|
-
});
|
|
25803
|
-
const enableRangeSelection = vue.computed(() => !!rangeSelection.value);
|
|
25804
|
-
const singleRangeSelection = vue.computed(() => "single" === rangeSelection.value);
|
|
25805
|
-
const rangeCellClass = vue.computed(() => `${prefixCls.value}-body-cell-range-selected`);
|
|
25806
|
-
const RangeSingleCellClass = vue.computed(() => `${prefixCls.value}-body-cell-range-single-cell`);
|
|
25807
|
-
const RangeTopClass = vue.computed(() => `${prefixCls.value}-body-cell-range-top`);
|
|
25808
|
-
const RangeRIghtClass = vue.computed(() => `${prefixCls.value}-body-cell-range-right`);
|
|
25809
|
-
const RangeBottomClass = vue.computed(() => `${prefixCls.value}-body-cell-range-bottom`);
|
|
25810
|
-
const RangeLeftClass = vue.computed(() => `${prefixCls.value}-body-cell-range-left`);
|
|
25811
|
-
const cellRanges = vue.shallowRef([]);
|
|
25812
|
-
const allDisplayedColumns = vue.computed(
|
|
25813
|
-
() => allColumns.value.filter((col) => !col.__Internal__Column__)
|
|
25814
|
-
);
|
|
25815
|
-
vue.watch(allDisplayedColumns, (newValue) => {
|
|
25816
|
-
cellRanges.value.forEach((cellRange) => {
|
|
25817
|
-
cellRange.columns = cellRange.columns.filter(
|
|
25818
|
-
(column) => newValue.find((item) => item.columnKey === column.columnKey)
|
|
25819
|
-
);
|
|
25820
|
-
});
|
|
25821
|
-
cellRanges.value = cellRanges.value.filter((cellRange) => cellRange.columns.length > 0);
|
|
25822
|
-
});
|
|
25823
|
-
vue.watch(flattenData, () => {
|
|
25824
|
-
const lastIndex = flattenData.value.length - 1;
|
|
25825
|
-
cellRanges.value.forEach((cellRange) => {
|
|
25826
|
-
const { startRow, endRow } = cellRange;
|
|
25827
|
-
if (startRow.rowIndex > lastIndex) {
|
|
25828
|
-
cellRange.startRow = null;
|
|
25829
|
-
}
|
|
25830
|
-
if (endRow.rowIndex > lastIndex) {
|
|
25831
|
-
cellRange.endRow = null;
|
|
25832
|
-
}
|
|
25833
|
-
});
|
|
25834
|
-
cellRanges.value = cellRanges.value.filter(
|
|
25835
|
-
(cellRange) => cellRange.startRow && cellRange.endRow
|
|
25836
|
-
);
|
|
25837
|
-
});
|
|
25838
|
-
const onDragStart = (mouseEvent) => {
|
|
25839
|
-
var _a;
|
|
25840
|
-
(_a = mouseEvent.cellInfo) == null ? void 0 : _a.level;
|
|
25841
|
-
if (!enableRangeSelection.value) return;
|
|
25842
|
-
const { ctrlKey, metaKey, shiftKey } = mouseEvent;
|
|
25843
|
-
const ctrlOrMetaKey = ctrlKey || metaKey;
|
|
25844
|
-
const isMultiple = !singleRangeSelection.value && ctrlOrMetaKey;
|
|
25845
|
-
const rangeLength = cellRanges.value.length;
|
|
25846
|
-
const isRangeSelected = shiftKey && rangeLength > 0;
|
|
25847
|
-
if (!(isMultiple || isRangeSelected)) {
|
|
25848
|
-
clearAllSelectedRange();
|
|
25849
|
-
}
|
|
25850
|
-
mouseEvent.cellInfo.cellPosition;
|
|
25851
|
-
return;
|
|
25852
|
-
};
|
|
25853
|
-
const onDragging = (mouseEvent) => {
|
|
25854
|
-
return;
|
|
25855
|
-
};
|
|
25856
|
-
const onDragStop = () => {
|
|
25857
|
-
};
|
|
25858
|
-
const isSelectedEmpty = vue.computed(() => 0 === cellRanges.value.length);
|
|
25859
|
-
const Y = vue.computed(() => {
|
|
25860
|
-
const length = cellRanges.value.length;
|
|
25861
|
-
if (0 === length) return false;
|
|
25862
|
-
if (length > 1) return true;
|
|
25863
|
-
const first = cellRanges.value[0];
|
|
25864
|
-
const n = le(first);
|
|
25865
|
-
const o = re2(first);
|
|
25866
|
-
return n.rowPinned !== o.rowPinned || n.rowIndex !== o.rowIndex || 1 !== (first == null ? void 0 : first.columns.length);
|
|
25867
|
-
});
|
|
25868
|
-
useDragSelection({
|
|
25869
|
-
onDragStart,
|
|
25870
|
-
onDragging,
|
|
25871
|
-
onDragStop,
|
|
25872
|
-
rootElementRef: rootRef,
|
|
25873
|
-
bodyElementRef: bodyRef,
|
|
25874
|
-
level,
|
|
25875
|
-
enableRangeSelection
|
|
25876
|
-
});
|
|
25877
|
-
const X = (startRow, endRow) => {
|
|
25878
|
-
switch (startRow.rowPinned) {
|
|
25879
|
-
case "top":
|
|
25880
|
-
if ("top" !== endRow.rowPinned) return true;
|
|
25881
|
-
break;
|
|
25882
|
-
case "bottom":
|
|
25883
|
-
if ("bottom" !== endRow.rowPinned) return false;
|
|
25884
|
-
break;
|
|
25885
|
-
default:
|
|
25886
|
-
if (endRow.rowPinned) {
|
|
25887
|
-
return "top" !== endRow.rowPinned;
|
|
25888
|
-
}
|
|
25889
|
-
}
|
|
25890
|
-
return startRow.rowIndex < endRow.rowIndex;
|
|
25891
|
-
};
|
|
25892
|
-
const q = (e3) => {
|
|
25893
|
-
let t2;
|
|
25894
|
-
return e3.forEach((e4) => {
|
|
25895
|
-
(void 0 === t2 || X(t2, e4)) && (t2 = e4);
|
|
25896
|
-
}), t2;
|
|
25897
|
-
};
|
|
25898
|
-
const Q = (e3) => {
|
|
25899
|
-
let t2;
|
|
25900
|
-
return e3.forEach((e4) => {
|
|
25901
|
-
(void 0 === t2 || X(e4, t2)) && (t2 = e4);
|
|
25902
|
-
}), t2;
|
|
25903
|
-
};
|
|
25904
|
-
const Z = (e3, t2) => !e3 && !t2 || !(e3 && !t2 || !e3 && t2) && e3.rowIndex === t2.rowIndex && e3.rowPinned == t2.rowPinned;
|
|
25905
|
-
const J = (e3, t2) => {
|
|
25906
|
-
let n, o;
|
|
25907
|
-
const l2 = e3 === t2 || e3.columnKey === t2.columnKey, r2 = allDisplayedColumns.value.findIndex((t3) => t3.columnKey === e3.columnKey);
|
|
25908
|
-
if (r2 < 0)
|
|
25909
|
-
return void console.warn(
|
|
25910
|
-
`Table: column ${null !== (n = e3.originColumn.key) && void 0 !== n ? n : e3.originColumn.dataIndex} is not valid`
|
|
25911
|
-
);
|
|
25912
|
-
const a2 = l2 ? r2 : allDisplayedColumns.value.findIndex((e4) => e4.columnKey === t2.columnKey);
|
|
25913
|
-
if (a2 < 0)
|
|
25914
|
-
return void console.warn(
|
|
25915
|
-
`Table: column ${null !== (o = t2.originColumn.key) && void 0 !== o ? o : t2.originColumn.dataIndex} is not valid`
|
|
25916
|
-
);
|
|
25917
|
-
if (l2) return [e3];
|
|
25918
|
-
const i2 = Math.min(r2, a2), s2 = i2 === r2 ? a2 : r2, u2 = [];
|
|
25919
|
-
for (let e4 = i2; e4 <= s2; e4++) u2.push(allDisplayedColumns.value[e4]);
|
|
25920
|
-
return u2;
|
|
25921
|
-
};
|
|
25922
|
-
const setRangeToCell = (e3, t2 = false) => {
|
|
25923
|
-
if (!enableRangeSelection.value) return;
|
|
25924
|
-
const n = J(e3.column, e3.column);
|
|
25925
|
-
if (!n) return;
|
|
25926
|
-
if (latestRangeStartCell.value === e3) return;
|
|
25927
|
-
!singleRangeSelection.value && t2 || (cellRanges.value = []);
|
|
25928
|
-
const o = { rowIndex: e3.rowIndex, rowPinned: e3.rowPinned }, l2 = { startRow: o, endRow: o, columns: n, startColumn: e3.column };
|
|
25929
|
-
cellRanges.value.push(l2), latestRangeStartCell.value = e3, vue.triggerRef(cellRanges);
|
|
25930
|
-
};
|
|
25931
|
-
const te = (e3, t2) => {
|
|
25932
|
-
const n = t2.column, o = J(e3.startColumn, n);
|
|
25933
|
-
o && !ne(e3, t2) && (e3.columns = o, e3.endRow = { rowIndex: t2.rowIndex, rowPinned: t2.rowPinned }, vue.triggerRef(cellRanges));
|
|
25934
|
-
};
|
|
25935
|
-
const ne = (e3, t2) => {
|
|
25936
|
-
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;
|
|
25937
|
-
return t2.column === s2 && r2;
|
|
25938
|
-
};
|
|
25939
|
-
const oe = (e3, t2) => {
|
|
25940
|
-
const n = null !== t2.columns && t2.columns.find((t3) => t3.columnKey === e3.column.columnKey), o = ae2(e3.rowIndex, e3.rowPinned, t2);
|
|
25941
|
-
return n && o;
|
|
25942
|
-
};
|
|
25943
|
-
const le = (cellRange) => {
|
|
25944
|
-
var _a;
|
|
25945
|
-
if (cellRange.startRow && cellRange.endRow) {
|
|
25946
|
-
return X(cellRange.startRow, cellRange.endRow) ? cellRange.startRow : cellRange.endRow;
|
|
25947
|
-
}
|
|
25948
|
-
return { rowIndex: (_a = flattenData.value[0]) == null ? void 0 : _a.rowIndex, rowPinned: null };
|
|
25949
|
-
};
|
|
25950
|
-
const re2 = (e3) => {
|
|
25951
|
-
var _a;
|
|
25952
|
-
return e3.startRow && e3.endRow ? X(e3.startRow, e3.endRow) ? e3.endRow : e3.startRow : {
|
|
25953
|
-
rowIndex: (_a = flattenData.value[flattenData.value.length - 1]) == null ? void 0 : _a.rowIndex,
|
|
25954
|
-
rowPinned: null
|
|
25955
|
-
};
|
|
25956
|
-
};
|
|
25957
|
-
const ae2 = (e3, t2, n) => {
|
|
25958
|
-
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;
|
|
25959
|
-
if (a2 || i2) return true;
|
|
25960
|
-
const s2 = !X(r2, o), u2 = X(r2, l2);
|
|
25961
|
-
return s2 && u2;
|
|
25962
|
-
};
|
|
25963
|
-
const getCellRangeCount = (cell2) => isSelectedEmpty.value ? 0 : cellRanges.value.filter((cellRange) => oe(cell2, cellRange)).length;
|
|
25964
|
-
const getDisplayedColBefore = (e3) => {
|
|
25965
|
-
const t2 = allDisplayedColumns.value, n = t2.findIndex((t3) => t3.columnKey === e3.columnKey);
|
|
25966
|
-
return n > 0 ? t2[n - 1] : null;
|
|
25967
|
-
};
|
|
25968
|
-
const getDisplayedColAfter = (e3) => {
|
|
25969
|
-
const t2 = allDisplayedColumns.value, n = t2.findIndex((t3) => t3.columnKey === e3.columnKey);
|
|
25970
|
-
return n < t2.length - 1 ? t2[n + 1] : null;
|
|
25971
|
-
};
|
|
25972
|
-
const ce2 = (e3) => {
|
|
25973
|
-
if (null == e3) return null;
|
|
25974
|
-
const t2 = allDisplayedColumns.value.find((t3) => t3.columnKey === e3);
|
|
25975
|
-
return t2 || console.warn("Table: could not find column " + e3), t2;
|
|
25976
|
-
};
|
|
25977
|
-
const de2 = () => cellRanges.value;
|
|
25978
|
-
const clearAllSelectedRange = () => {
|
|
25979
|
-
cellRanges.value = [];
|
|
25980
|
-
};
|
|
25981
|
-
const appendCellToSelectedRange = (e3) => {
|
|
25982
|
-
if (!enableRangeSelection.value) return;
|
|
25983
|
-
const t2 = ((e4) => {
|
|
25984
|
-
let t3, n = false;
|
|
25985
|
-
if (e4.columnsKey) t3 = e4.columnsKey.map((e5) => ce2(e5)).filter((e5) => e5);
|
|
25986
|
-
else {
|
|
25987
|
-
const o = ce2(e4.columnStartKey), l2 = ce2(e4.columnEndKey);
|
|
25988
|
-
if (!o || !l2) return;
|
|
25989
|
-
t3 = J(o, l2), t3 && t3.length && (n = t3[0] !== o);
|
|
25990
|
-
}
|
|
25991
|
-
if (!t3) return;
|
|
25992
|
-
return {
|
|
25993
|
-
startRow: null != e4.rowStartIndex ? { rowIndex: e4.rowStartIndex, rowPinned: null } : void 0,
|
|
25994
|
-
endRow: null != e4.rowEndIndex ? { rowIndex: e4.rowEndIndex, rowPinned: null } : void 0,
|
|
25995
|
-
columns: t3,
|
|
25996
|
-
startColumn: n ? t3[t3.length - 1] : t3[0]
|
|
25997
|
-
};
|
|
25998
|
-
})(e3);
|
|
25999
|
-
t2 && (t2.startRow && (latestRangeStartCell.value = {
|
|
26000
|
-
rowIndex: t2.startRow.rowIndex,
|
|
26001
|
-
rowPinned: t2.startRow.rowPinned,
|
|
26002
|
-
column: t2.startColumn
|
|
26003
|
-
}), cellRanges.value.push(t2));
|
|
26004
|
-
};
|
|
26005
|
-
const fe2 = (e3) => {
|
|
26006
|
-
enableRangeSelection.value && (clearAllSelectedRange(), appendCellToSelectedRange(e3));
|
|
26007
|
-
};
|
|
26008
|
-
const focusCell = (e3) => {
|
|
26009
|
-
let t2, n;
|
|
26010
|
-
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;
|
|
26011
|
-
if (void 0 !== o && void 0 !== l2 && rootRef.value) {
|
|
26012
|
-
const e4 = rootRef.value.querySelector(
|
|
26013
|
-
`[data-row-key="${o}"] [data-column-key="${l2}"][data-level="${level}"]`
|
|
26014
|
-
);
|
|
26015
|
-
if (e4) {
|
|
26016
|
-
const t4 = e4.getElementsByTagName("input")[0];
|
|
26017
|
-
e4.focus();
|
|
26018
|
-
t4 && t4.focus();
|
|
26019
|
-
}
|
|
26020
|
-
}
|
|
26021
|
-
};
|
|
26022
|
-
const intersectLastRange = (fromMouseClick = false) => {
|
|
26023
|
-
if (singleRangeSelection.value) return;
|
|
26024
|
-
if (isSelectedEmpty.value) return;
|
|
26025
|
-
const lastCellRange2 = cellRanges.value[cellRanges.value.length - 1];
|
|
26026
|
-
const n = le(lastCellRange2);
|
|
26027
|
-
const o = re2(lastCellRange2);
|
|
26028
|
-
const l2 = [];
|
|
26029
|
-
cellRanges.value.slice(0, -1).forEach((e4) => {
|
|
26030
|
-
const r2 = le(e4), a2 = re2(e4), i2 = e4.columns, s2 = i2.filter((e5) => -1 === (lastCellRange2 == null ? void 0 : lastCellRange2.columns.indexOf(e5)));
|
|
26031
|
-
if (s2.length !== i2.length)
|
|
26032
|
-
if (X(o, r2) || X(a2, n)) l2.push(e4);
|
|
26033
|
-
else {
|
|
26034
|
-
if (X(r2, n)) {
|
|
26035
|
-
const e5 = {
|
|
26036
|
-
columns: [...i2],
|
|
26037
|
-
startColumn: lastCellRange2 == null ? void 0 : lastCellRange2.startColumn,
|
|
26038
|
-
startRow: Object.assign({}, r2),
|
|
26039
|
-
endRow: navigationService.getRowAbove(n)
|
|
26040
|
-
};
|
|
26041
|
-
l2.push(e5);
|
|
26042
|
-
}
|
|
26043
|
-
if (s2.length > 0) {
|
|
26044
|
-
const e5 = {
|
|
26045
|
-
columns: s2,
|
|
26046
|
-
startColumn: s2.find((e6) => e6.columnKey === (lastCellRange2 == null ? void 0 : lastCellRange2.startColumn.columnKey)) ? lastCellRange2 == null ? void 0 : lastCellRange2.startColumn : s2[0],
|
|
26047
|
-
startRow: q([Object.assign({}, n), Object.assign({}, r2)]),
|
|
26048
|
-
endRow: Q([Object.assign({}, o), Object.assign({}, a2)])
|
|
26049
|
-
};
|
|
26050
|
-
l2.push(e5);
|
|
26051
|
-
}
|
|
26052
|
-
X(o, a2) && l2.push({
|
|
26053
|
-
columns: [...i2],
|
|
26054
|
-
startColumn: lastCellRange2 == null ? void 0 : lastCellRange2.startColumn,
|
|
26055
|
-
startRow: navigationService.getRowBelow(o),
|
|
26056
|
-
endRow: Object.assign({}, a2)
|
|
26057
|
-
});
|
|
26058
|
-
}
|
|
26059
|
-
else l2.push(e4);
|
|
26060
|
-
}), cellRanges.value = l2;
|
|
26061
|
-
};
|
|
26062
|
-
vue.watch(latestRangeStartCell, () => {
|
|
26063
|
-
latestRangeStartCell.value && focusCell(latestRangeStartCell.value);
|
|
26064
|
-
});
|
|
26065
|
-
const ensureCellVisible = (cell2) => {
|
|
26066
|
-
parmas.ensureCellRowVisible(cell2);
|
|
26067
|
-
parmas.ensureCellColumnVisible(cell2);
|
|
26068
|
-
};
|
|
26069
|
-
const navigationService = useCellNavigation({
|
|
26070
|
-
getDisplayedColBefore,
|
|
26071
|
-
getDisplayedColAfter,
|
|
26072
|
-
allDisplayedColumns,
|
|
26073
|
-
setRangeToCell,
|
|
26074
|
-
focusCell,
|
|
26075
|
-
ensureCellVisible,
|
|
26076
|
-
...parmas
|
|
26077
|
-
});
|
|
26078
|
-
vue.provide(RangeSymbolKey, {
|
|
26079
|
-
cellRanges,
|
|
26080
|
-
extendLatestRangeToCell: (e3) => {
|
|
26081
|
-
if (isSelectedEmpty.value || !latestRangeStartCell.value) return;
|
|
26082
|
-
const t2 = cellRanges.value[cellRanges.value.length - 1];
|
|
26083
|
-
te(t2, e3);
|
|
26084
|
-
},
|
|
26085
|
-
setRangeToCell,
|
|
26086
|
-
onDragStart,
|
|
26087
|
-
onDragging,
|
|
26088
|
-
isCellInAnyRange: (cell2) => getCellRangeCount(cell2) > 0,
|
|
26089
|
-
getRangeCellClass: (e3) => {
|
|
26090
|
-
const t2 = getCellRangeCount(e3), n = ((e4) => {
|
|
26091
|
-
let t3 = false, n2 = false, o2 = false, l3 = false;
|
|
26092
|
-
const r3 = e4.column;
|
|
26093
|
-
let a3, i3;
|
|
26094
|
-
a3 = getDisplayedColBefore(r3), i3 = getDisplayedColAfter(r3);
|
|
26095
|
-
const s2 = cellRanges.value.filter((t4) => oe(e4, t4));
|
|
26096
|
-
a3 || (l3 = true), i3 || (n2 = true);
|
|
26097
|
-
for (let r4 = 0; r4 < s2.length && !(t3 && n2 && o2 && l3); r4++) {
|
|
26098
|
-
const u2 = s2[r4], c2 = le(u2), d = re2(u2);
|
|
26099
|
-
!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);
|
|
26100
|
-
}
|
|
26101
|
-
return { top: t3, right: n2, bottom: o2, left: l3 };
|
|
26102
|
-
})(e3), o = 1 === t2 && !Y.value, l2 = !o && n.top, r2 = !o && n.right, a2 = !o && n.bottom, i2 = !o && n.left;
|
|
26103
|
-
return classNames({
|
|
26104
|
-
[rangeCellClass.value]: 0 !== t2,
|
|
26105
|
-
[`${rangeCellClass.value}-1`]: 1 === t2,
|
|
26106
|
-
[`${rangeCellClass.value}-2`]: 2 === t2,
|
|
26107
|
-
[`${rangeCellClass.value}-3`]: 3 === t2,
|
|
26108
|
-
[`${rangeCellClass.value}-4`]: t2 >= 4,
|
|
26109
|
-
[RangeSingleCellClass.value]: o,
|
|
26110
|
-
[RangeTopClass.value]: l2,
|
|
26111
|
-
[RangeRIghtClass.value]: r2,
|
|
26112
|
-
[RangeBottomClass.value]: a2,
|
|
26113
|
-
[RangeLeftClass.value]: i2
|
|
26114
|
-
});
|
|
26115
|
-
},
|
|
26116
|
-
enableRangeSelection,
|
|
26117
|
-
singleRangeSelection,
|
|
26118
|
-
getDisplayedColBefore,
|
|
26119
|
-
getDisplayedColAfter,
|
|
26120
|
-
navigationService,
|
|
26121
|
-
extendLatestRangeInDirection: (e3) => {
|
|
26122
|
-
if (isSelectedEmpty.value || !latestRangeStartCell.value) return;
|
|
26123
|
-
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 = {
|
|
26124
|
-
column: l2.column === r2 ? a2 : r2,
|
|
26125
|
-
rowIndex: i2,
|
|
26126
|
-
rowPinned: s2
|
|
26127
|
-
}, d = navigationService.getNextCellToFocus(t2, u2, n);
|
|
26128
|
-
return d ? (fe2({
|
|
26129
|
-
rowStartIndex: l2.rowIndex,
|
|
26130
|
-
rowEndIndex: d.rowIndex,
|
|
26131
|
-
columnStartKey: l2.column.columnKey,
|
|
26132
|
-
columnEndKey: d.column.columnKey
|
|
26133
|
-
}), d) : void 0;
|
|
26134
|
-
},
|
|
26135
|
-
allDisplayedColumns,
|
|
26136
|
-
focusCell,
|
|
26137
|
-
ensureCellVisible,
|
|
26138
|
-
getCellRangeCount,
|
|
26139
|
-
intersectLastRange,
|
|
26140
|
-
level
|
|
26141
|
-
});
|
|
26142
|
-
const copySelectedRange = () => {
|
|
26143
|
-
const e3 = de2(), t2 = [];
|
|
26144
|
-
let n = "";
|
|
26145
|
-
e3.forEach((e4) => {
|
|
26146
|
-
const { startRow: n2, endRow: o, columns: r2 } = e4, [a2, i2] = [n2.rowIndex, o.rowIndex].sort((e5, t3) => e5 - t3);
|
|
26147
|
-
let s2 = allDisplayedColumns.value.findIndex((e5) => {
|
|
26148
|
-
var _a;
|
|
26149
|
-
return e5.columnKey === ((_a = r2[0]) == null ? void 0 : _a.columnKey);
|
|
26150
|
-
}), u2 = allDisplayedColumns.value.findIndex(
|
|
26151
|
-
(e5) => {
|
|
26152
|
-
var _a;
|
|
26153
|
-
return e5.columnKey === ((_a = r2[r2.length - 1]) == null ? void 0 : _a.columnKey);
|
|
26154
|
-
}
|
|
26155
|
-
);
|
|
26156
|
-
[s2, u2] = [s2, u2].sort((e5, t3) => e5 - t3);
|
|
26157
|
-
const c2 = [];
|
|
26158
|
-
for (let e5 = a2; e5 <= i2; e5++) {
|
|
26159
|
-
const t3 = flattenData.value[e5];
|
|
26160
|
-
if (t3 && !t3.isExpandRow) {
|
|
26161
|
-
const n3 = t3.rowKey, o2 = [], l2 = getIndexsByKey(n3);
|
|
26162
|
-
for (let r3 = s2; r3 <= u2; r3++) {
|
|
26163
|
-
const originColumn = allDisplayedColumns.value[r3].originColumn;
|
|
26164
|
-
const i3 = originColumn.dataIndex ? getPathValue(t3.record, originColumn.dataIndex) : void 0;
|
|
26165
|
-
if (originColumn) {
|
|
26166
|
-
const r4 = {
|
|
26167
|
-
record: t3.record,
|
|
26168
|
-
column: originColumn,
|
|
26169
|
-
index: e5,
|
|
26170
|
-
recordIndexs: l2,
|
|
26171
|
-
key: n3,
|
|
26172
|
-
value: i3
|
|
26173
|
-
};
|
|
26174
|
-
o2.push(formatRangeCellText(r4));
|
|
26175
|
-
}
|
|
26176
|
-
}
|
|
26177
|
-
c2.push(o2.join(copyDelimiter.value));
|
|
26178
|
-
}
|
|
26179
|
-
}
|
|
26180
|
-
t2.push(c2);
|
|
26181
|
-
}), n = t2.map((e4) => e4.join("prefixCls\n")).join("prefixCls\n"), ((e4) => {
|
|
26182
|
-
let t3, n2;
|
|
26183
|
-
const o = document.activeElement, l2 = document.createElement("textarea");
|
|
26184
|
-
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 }));
|
|
26185
|
-
})(n);
|
|
26186
|
-
};
|
|
26187
|
-
return {
|
|
26188
|
-
getSelectedRange: () => {
|
|
26189
|
-
const e3 = de2(), t2 = [];
|
|
26190
|
-
return e3.forEach((e4) => {
|
|
26191
|
-
const { startColumn: n, startRow: o, endRow: r2, columns: a2 } = e4, i2 = flattenData.value[o.rowIndex], s2 = flattenData.value[r2.rowIndex], u2 = {
|
|
26192
|
-
startColumn: n.originColumn,
|
|
26193
|
-
startRow: {
|
|
26194
|
-
rowIndex: i2.rowIndex,
|
|
26195
|
-
recordIndexs: getIndexsByKey(i2.rowKey)
|
|
26196
|
-
},
|
|
26197
|
-
endRow: {
|
|
26198
|
-
rowIndex: s2.rowIndex,
|
|
26199
|
-
recordIndexs: getIndexsByKey(s2.rowKey)
|
|
26200
|
-
},
|
|
26201
|
-
columns: a2.map((e5) => e5.originColumn),
|
|
26202
|
-
flattenData: flattenData.value
|
|
26203
|
-
};
|
|
26204
|
-
t2.push(u2);
|
|
26205
|
-
}), t2;
|
|
26206
|
-
},
|
|
26207
|
-
appendCellToSelectedRange,
|
|
26208
|
-
clearAllSelectedRange,
|
|
26209
|
-
setCellRanges: (e3) => {
|
|
26210
|
-
enableRangeSelection.value && (cellRanges.value = e3);
|
|
26211
|
-
},
|
|
26212
|
-
getCellRangeCount,
|
|
26213
|
-
navigationService,
|
|
26214
|
-
copySelectedRange,
|
|
26215
|
-
onBodyKeydown: (e3) => {
|
|
26216
|
-
if (!e3.ctrlKey && !e3.metaKey || !enableRangeSelection.value) return;
|
|
26217
|
-
if (isOverFormFieldElement(e3)) return;
|
|
26218
|
-
switch (e3.keyCode) {
|
|
26219
|
-
case KeyCode.C:
|
|
26220
|
-
copySelectedRange();
|
|
26221
|
-
break;
|
|
26222
|
-
case KeyCode.A:
|
|
26223
|
-
(() => {
|
|
26224
|
-
if (!enableRangeSelection.value) return;
|
|
26225
|
-
const e4 = allDisplayedColumns.value;
|
|
26226
|
-
0 !== e4.length && fe2({
|
|
26227
|
-
rowStartIndex: 0,
|
|
26228
|
-
rowEndIndex: flattenData.value.length - 1,
|
|
26229
|
-
columnStartKey: e4[0].columnKey,
|
|
26230
|
-
columnEndKey: e4[e4.length - 1].columnKey
|
|
26231
|
-
});
|
|
26232
|
-
})();
|
|
26233
|
-
}
|
|
26234
|
-
e3.preventDefault();
|
|
26235
|
-
}
|
|
26236
|
-
};
|
|
26237
|
-
};
|
|
26238
|
-
const useInjectRangeStore = () => {
|
|
26239
|
-
return vue.inject(RangeSymbolKey, {});
|
|
26240
|
-
};
|
|
26241
|
-
|
|
26242
25668
|
var MapShim = (function() {
|
|
26243
25669
|
if (typeof Map !== "undefined") {
|
|
26244
25670
|
return Map;
|
|
@@ -28682,6 +28108,31 @@
|
|
|
28682
28108
|
return { data, pos };
|
|
28683
28109
|
}
|
|
28684
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
|
+
|
|
28685
28136
|
const useCellProps = ({
|
|
28686
28137
|
leftColumns,
|
|
28687
28138
|
rightColumns,
|
|
@@ -28694,6 +28145,10 @@
|
|
|
28694
28145
|
leftWidth,
|
|
28695
28146
|
centerWidth,
|
|
28696
28147
|
getRowHeight,
|
|
28148
|
+
cancelEditable,
|
|
28149
|
+
startEditable,
|
|
28150
|
+
saveEditable,
|
|
28151
|
+
isEditable,
|
|
28697
28152
|
customCell: contextCustomCell
|
|
28698
28153
|
}) => {
|
|
28699
28154
|
const allCellProps = vue.shallowRef({});
|
|
@@ -28716,6 +28171,10 @@
|
|
|
28716
28171
|
value,
|
|
28717
28172
|
record,
|
|
28718
28173
|
index: rowIndex,
|
|
28174
|
+
cancelEditable,
|
|
28175
|
+
startEditable,
|
|
28176
|
+
saveEditable,
|
|
28177
|
+
isEditable,
|
|
28719
28178
|
column: originColumn
|
|
28720
28179
|
});
|
|
28721
28180
|
if (customCellRender && isObject$4(customCellRender) && !isArray$2(customCellRender) && !vue.isVNode(customCellRender)) {
|
|
@@ -32193,114 +31652,6 @@
|
|
|
32193
31652
|
return vue.inject(BodyRowContextKey, {});
|
|
32194
31653
|
};
|
|
32195
31654
|
|
|
32196
|
-
const useCellSelection = () => {
|
|
32197
|
-
const {
|
|
32198
|
-
isCellInAnyRange,
|
|
32199
|
-
cellRanges,
|
|
32200
|
-
extendLatestRangeToCell,
|
|
32201
|
-
setRangeToCell,
|
|
32202
|
-
enableRangeSelection,
|
|
32203
|
-
getCellRangeCount,
|
|
32204
|
-
intersectLastRange,
|
|
32205
|
-
level
|
|
32206
|
-
} = useInjectRangeStore();
|
|
32207
|
-
return {
|
|
32208
|
-
onCellMousedown: (mouseEvent, cellPosition) => {
|
|
32209
|
-
const { ctrlKey, metaKey, shiftKey } = mouseEvent;
|
|
32210
|
-
if (!(!isCellInAnyRange(cellPosition) || 2 !== mouseEvent.button)) return;
|
|
32211
|
-
const isRanges = !cellRanges.value.length;
|
|
32212
|
-
if (shiftKey && isRanges) {
|
|
32213
|
-
mouseEvent.preventDefault();
|
|
32214
|
-
}
|
|
32215
|
-
if (shiftKey) {
|
|
32216
|
-
extendLatestRangeToCell(cellPosition);
|
|
32217
|
-
} else {
|
|
32218
|
-
setRangeToCell(cellPosition, ctrlKey || metaKey);
|
|
32219
|
-
}
|
|
32220
|
-
mouseEvent.cellInfo = {
|
|
32221
|
-
cellPosition,
|
|
32222
|
-
cellTarget: mouseEvent.currentTarget,
|
|
32223
|
-
level
|
|
32224
|
-
};
|
|
32225
|
-
},
|
|
32226
|
-
onCellMousemove: (mouseEvent, cellPosition) => {
|
|
32227
|
-
mouseEvent.cellInfo = {
|
|
32228
|
-
cellPosition,
|
|
32229
|
-
cellTarget: mouseEvent.currentTarget,
|
|
32230
|
-
level
|
|
32231
|
-
};
|
|
32232
|
-
},
|
|
32233
|
-
onCellClick: (mouseEvent, cellPosition) => {
|
|
32234
|
-
const mouseKey = mouseEvent.ctrlKey || mouseEvent.metaKey;
|
|
32235
|
-
enableRangeSelection.value && mouseKey && getCellRangeCount(cellPosition) > 1 && intersectLastRange(true);
|
|
32236
|
-
}
|
|
32237
|
-
};
|
|
32238
|
-
};
|
|
32239
|
-
|
|
32240
|
-
const useCellKeyboard = () => {
|
|
32241
|
-
const {
|
|
32242
|
-
enableRangeSelection,
|
|
32243
|
-
navigationService,
|
|
32244
|
-
extendLatestRangeInDirection,
|
|
32245
|
-
focusCell,
|
|
32246
|
-
ensureCellVisible
|
|
32247
|
-
} = useInjectRangeStore();
|
|
32248
|
-
const directionOrEnterHandle = (event, payload) => {
|
|
32249
|
-
if (!payload.isEditing) {
|
|
32250
|
-
event.shiftKey && enableRangeSelection.value ? selectRange(event) : navigationService.navigateToNextCell(event, payload.cellPosition);
|
|
32251
|
-
event.preventDefault();
|
|
32252
|
-
}
|
|
32253
|
-
};
|
|
32254
|
-
const { props } = useInjectTable();
|
|
32255
|
-
const selectRange = (event) => {
|
|
32256
|
-
const latestRange = extendLatestRangeInDirection(event);
|
|
32257
|
-
latestRange && ensureCellVisible(latestRange);
|
|
32258
|
-
};
|
|
32259
|
-
const escHandle = (_, payload) => {
|
|
32260
|
-
payload.isEditing && focusCell(payload.cellPosition);
|
|
32261
|
-
};
|
|
32262
|
-
const tabHandle = (event, payload) => {
|
|
32263
|
-
navigationService.onTabKeyDown(payload.cellPosition, event);
|
|
32264
|
-
};
|
|
32265
|
-
return {
|
|
32266
|
-
onCellKeydown: (event, payload) => {
|
|
32267
|
-
if (props.onCellKeydown && false === props.onCellKeydown(event, {
|
|
32268
|
-
isEditing: payload.isEditing,
|
|
32269
|
-
cellPosition: {
|
|
32270
|
-
column: payload.cellPosition.column.originColumn,
|
|
32271
|
-
rowIndex: payload.cellPosition.rowIndex
|
|
32272
|
-
}
|
|
32273
|
-
})) {
|
|
32274
|
-
return;
|
|
32275
|
-
}
|
|
32276
|
-
const { keyCode } = event;
|
|
32277
|
-
const target = event.target;
|
|
32278
|
-
switch (keyCode) {
|
|
32279
|
-
case KeyCode.RIGHT:
|
|
32280
|
-
case KeyCode.LEFT:
|
|
32281
|
-
if (!("INPUT" === (target == null ? void 0 : target.tagName) || "TEXTAREA" === (target == null ? void 0 : target.tagName) || (target == null ? void 0 : target.isContentEditable))) {
|
|
32282
|
-
directionOrEnterHandle(event, payload);
|
|
32283
|
-
}
|
|
32284
|
-
break;
|
|
32285
|
-
case KeyCode.DOWN:
|
|
32286
|
-
case KeyCode.UP:
|
|
32287
|
-
case KeyCode.ENTER:
|
|
32288
|
-
if (!((target2) => "TEXTAREA" === target2.tagName || target2.isContentEditable)(
|
|
32289
|
-
event.target
|
|
32290
|
-
)) {
|
|
32291
|
-
directionOrEnterHandle(event, payload);
|
|
32292
|
-
}
|
|
32293
|
-
break;
|
|
32294
|
-
case KeyCode.ESC:
|
|
32295
|
-
escHandle(event, payload);
|
|
32296
|
-
break;
|
|
32297
|
-
case KeyCode.TAB:
|
|
32298
|
-
tabHandle(event, payload);
|
|
32299
|
-
}
|
|
32300
|
-
}
|
|
32301
|
-
};
|
|
32302
|
-
};
|
|
32303
|
-
|
|
32304
31655
|
const eventCache = {};
|
|
32305
31656
|
const eventMap = {
|
|
32306
31657
|
select: "input",
|
|
@@ -32317,6 +31668,68 @@
|
|
|
32317
31668
|
return eventCache[eventName = "on" + eventName] = eventName in dom;
|
|
32318
31669
|
};
|
|
32319
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
|
+
|
|
32320
31733
|
var _sfc_main$o = vue.defineComponent({
|
|
32321
31734
|
name: "RowDragHandler",
|
|
32322
31735
|
props: {
|
|
@@ -32840,188 +32253,6 @@
|
|
|
32840
32253
|
}
|
|
32841
32254
|
});
|
|
32842
32255
|
|
|
32843
|
-
var _sfc_main$n = vue.defineComponent({
|
|
32844
|
-
inheritAttrs: false,
|
|
32845
|
-
props: {
|
|
32846
|
-
prefixCls: { type: String },
|
|
32847
|
-
recordIndexs: { type: Array },
|
|
32848
|
-
rowKey: { type: [Number, String] },
|
|
32849
|
-
column: { type: Object, default: () => ({}) },
|
|
32850
|
-
record: { type: Object, default: () => ({}) },
|
|
32851
|
-
value: { validator: () => true },
|
|
32852
|
-
customEditable: { type: Boolean, default: false },
|
|
32853
|
-
multiple: { type: Boolean, default: false },
|
|
32854
|
-
autoHeight: { type: Boolean, default: false },
|
|
32855
|
-
cellKey: { type: String },
|
|
32856
|
-
getPopupContainer: Function,
|
|
32857
|
-
onCloseEditor: Function,
|
|
32858
|
-
onKeydown: Function
|
|
32859
|
-
},
|
|
32860
|
-
emits: ["closeEditor", "keydown"],
|
|
32861
|
-
setup(props, { expose, emit }) {
|
|
32862
|
-
var _a, _b, _c;
|
|
32863
|
-
const tableSlots = useInjectSlots();
|
|
32864
|
-
const popup = useInjectPopup();
|
|
32865
|
-
const oldValue = (_c = (_b = (_a = props.column) == null ? void 0 : _a.valueGetter) == null ? void 0 : _b.call(_a, {
|
|
32866
|
-
value: props.value,
|
|
32867
|
-
record: props.record,
|
|
32868
|
-
column: props.column,
|
|
32869
|
-
recordIndexs: props.recordIndexs
|
|
32870
|
-
})) != null ? _c : props.value;
|
|
32871
|
-
const modelValue = vue.ref(oldValue);
|
|
32872
|
-
const inputRef = vue.shallowRef(null);
|
|
32873
|
-
const tableContext = useInjectTable();
|
|
32874
|
-
vue.onMounted(() => {
|
|
32875
|
-
vue.nextTick(() => {
|
|
32876
|
-
var _a2, _b2, _c2, _d;
|
|
32877
|
-
if (inputRef.value && !props.multiple) {
|
|
32878
|
-
(_b2 = (_a2 = inputRef.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b2.call(_a2);
|
|
32879
|
-
(_d = (_c2 = inputRef.value) == null ? void 0 : _c2.select) == null ? void 0 : _d.call(_c2);
|
|
32880
|
-
}
|
|
32881
|
-
});
|
|
32882
|
-
});
|
|
32883
|
-
expose({ value: modelValue, inputRef });
|
|
32884
|
-
const onInput = (e, val) => {
|
|
32885
|
-
var _a2, _b2;
|
|
32886
|
-
(_b2 = (_a2 = props.column).valueChange) == null ? void 0 : _b2.call(_a2, e, {
|
|
32887
|
-
column: props.column,
|
|
32888
|
-
record: props.record,
|
|
32889
|
-
recordIndexs: props.recordIndexs,
|
|
32890
|
-
newValue: val,
|
|
32891
|
-
oldValue
|
|
32892
|
-
});
|
|
32893
|
-
};
|
|
32894
|
-
const childrenColumnName = vue.computed(() => tableContext.props.childrenColumnName || "children");
|
|
32895
|
-
const save = () => {
|
|
32896
|
-
var _a2, _b2, _c2;
|
|
32897
|
-
const recordIndexs = props.recordIndexs;
|
|
32898
|
-
let dataSource = tableContext.props.dataSource || [];
|
|
32899
|
-
let record = {};
|
|
32900
|
-
recordIndexs.forEach((index) => {
|
|
32901
|
-
record = dataSource[index];
|
|
32902
|
-
dataSource = record[childrenColumnName.value] || [];
|
|
32903
|
-
});
|
|
32904
|
-
const value = (_c2 = (_b2 = (_a2 = props.column).valueParser) == null ? void 0 : _b2.call(_a2, {
|
|
32905
|
-
column: props.column,
|
|
32906
|
-
record,
|
|
32907
|
-
recordIndexs,
|
|
32908
|
-
newValue: modelValue.value,
|
|
32909
|
-
oldValue
|
|
32910
|
-
})) != null ? _c2 : modelValue.value;
|
|
32911
|
-
const valueSetter = props.column.valueSetter;
|
|
32912
|
-
if (valueSetter) {
|
|
32913
|
-
const result = valueSetter({
|
|
32914
|
-
column: props.column,
|
|
32915
|
-
record,
|
|
32916
|
-
recordIndexs,
|
|
32917
|
-
newValue: modelValue.value,
|
|
32918
|
-
oldValue
|
|
32919
|
-
});
|
|
32920
|
-
if (isPromise(result)) {
|
|
32921
|
-
result.then((res) => {
|
|
32922
|
-
res && emit("closeEditor", [props.cellKey]);
|
|
32923
|
-
}).catch(() => {
|
|
32924
|
-
});
|
|
32925
|
-
return;
|
|
32926
|
-
}
|
|
32927
|
-
result && emit("closeEditor", [props.cellKey]);
|
|
32928
|
-
} else {
|
|
32929
|
-
devWarning(
|
|
32930
|
-
void 0 !== props.column.dataIndex || null !== props.column.dataIndex,
|
|
32931
|
-
"Editable",
|
|
32932
|
-
"If not have column dataIndex, you should to set valueSetter for editable columns, otherwise the value cannot be modified."
|
|
32933
|
-
);
|
|
32934
|
-
set(record, props.column.dataIndex, value);
|
|
32935
|
-
emit("closeEditor", [props.cellKey]);
|
|
32936
|
-
}
|
|
32937
|
-
};
|
|
32938
|
-
let isKeyDown = false;
|
|
32939
|
-
const closeEditor = (key) => {
|
|
32940
|
-
emit("closeEditor", key != null ? key : [props.cellKey]);
|
|
32941
|
-
};
|
|
32942
|
-
return {
|
|
32943
|
-
modelValue,
|
|
32944
|
-
inputRef,
|
|
32945
|
-
handleInput: (e) => {
|
|
32946
|
-
var _a2;
|
|
32947
|
-
onInput(e, (_a2 = e.target) == null ? void 0 : _a2.value);
|
|
32948
|
-
},
|
|
32949
|
-
handleKeyDown: (e) => {
|
|
32950
|
-
const { which } = e;
|
|
32951
|
-
if (which === KeyCode.ENTER) {
|
|
32952
|
-
save();
|
|
32953
|
-
} else {
|
|
32954
|
-
if (which === KeyCode.ESC) {
|
|
32955
|
-
isKeyDown = true;
|
|
32956
|
-
emit("closeEditor", null);
|
|
32957
|
-
}
|
|
32958
|
-
emit("keydown", e);
|
|
32959
|
-
}
|
|
32960
|
-
},
|
|
32961
|
-
handleBlur: () => {
|
|
32962
|
-
isKeyDown || props.multiple || save();
|
|
32963
|
-
},
|
|
32964
|
-
tableSlots,
|
|
32965
|
-
popup,
|
|
32966
|
-
save,
|
|
32967
|
-
closeEditor,
|
|
32968
|
-
getCustomEditorProps: () => ({
|
|
32969
|
-
modelValue,
|
|
32970
|
-
save,
|
|
32971
|
-
onInput,
|
|
32972
|
-
closeEditor,
|
|
32973
|
-
column: props.column.originColumn,
|
|
32974
|
-
editorRef: inputRef,
|
|
32975
|
-
getPopupContainer: props.getPopupContainer,
|
|
32976
|
-
record: props.record,
|
|
32977
|
-
recordIndexs: props.recordIndexs
|
|
32978
|
-
})
|
|
32979
|
-
};
|
|
32980
|
-
}
|
|
32981
|
-
});
|
|
32982
|
-
|
|
32983
|
-
const _hoisted_1$8 = ["data-cell-auto"];
|
|
32984
|
-
function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
|
|
32985
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
32986
|
-
class: vue.normalizeClass(`${_ctx.prefixCls}-cell-edit-inner`),
|
|
32987
|
-
"data-cell-auto": _ctx.autoHeight
|
|
32988
|
-
}, [
|
|
32989
|
-
_ctx.customEditable ? (vue.openBlock(), vue.createElementBlock(
|
|
32990
|
-
vue.Fragment,
|
|
32991
|
-
{ key: 0 },
|
|
32992
|
-
[
|
|
32993
|
-
_ctx.tableSlots.cellEditor ? (vue.openBlock(), vue.createBlock(
|
|
32994
|
-
vue.resolveDynamicComponent(_ctx.tableSlots.cellEditor),
|
|
32995
|
-
vue.normalizeProps(vue.mergeProps({ key: 0 }, _ctx.getCustomEditorProps())),
|
|
32996
|
-
null,
|
|
32997
|
-
16
|
|
32998
|
-
/* FULL_PROPS */
|
|
32999
|
-
)) : vue.createCommentVNode("v-if", true)
|
|
33000
|
-
],
|
|
33001
|
-
64
|
|
33002
|
-
/* STABLE_FRAGMENT */
|
|
33003
|
-
)) : vue.withDirectives((vue.openBlock(), vue.createElementBlock(
|
|
33004
|
-
"input",
|
|
33005
|
-
{
|
|
33006
|
-
key: 1,
|
|
33007
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.modelValue = $event),
|
|
33008
|
-
ref: "inputRef",
|
|
33009
|
-
class: vue.normalizeClass(`${_ctx.prefixCls}-cell-edit-input`),
|
|
33010
|
-
type: "text",
|
|
33011
|
-
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.handleInput && _ctx.handleInput(...args)),
|
|
33012
|
-
onKeydown: _cache[2] || (_cache[2] = (...args) => _ctx.handleKeyDown && _ctx.handleKeyDown(...args)),
|
|
33013
|
-
onBlur: _cache[3] || (_cache[3] = (...args) => _ctx.handleBlur && _ctx.handleBlur(...args))
|
|
33014
|
-
},
|
|
33015
|
-
null,
|
|
33016
|
-
34
|
|
33017
|
-
/* CLASS, NEED_HYDRATION */
|
|
33018
|
-
)), [
|
|
33019
|
-
[vue.vModelText, _ctx.modelValue]
|
|
33020
|
-
])
|
|
33021
|
-
], 10, _hoisted_1$8);
|
|
33022
|
-
}
|
|
33023
|
-
var EditInput = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$j]]);
|
|
33024
|
-
|
|
33025
32256
|
const cellProps = {
|
|
33026
32257
|
prefixCls: String,
|
|
33027
32258
|
rowIndex: { type: Number, required: true },
|
|
@@ -33038,41 +32269,30 @@
|
|
|
33038
32269
|
tooltipOpen: Boolean,
|
|
33039
32270
|
getPopupContainer: Function,
|
|
33040
32271
|
onCellLeave: Function,
|
|
33041
|
-
editCellKeys: Array,
|
|
33042
|
-
onOpenEditor: Function,
|
|
33043
|
-
onCloseEditor: Function,
|
|
33044
|
-
onMousedown: Function,
|
|
33045
|
-
onMousemove: Function,
|
|
33046
|
-
onKeydown: Function,
|
|
33047
32272
|
onClick: Function
|
|
33048
32273
|
};
|
|
33049
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
|
+
};
|
|
33050
32282
|
const ValueStatusEnum = {
|
|
33051
32283
|
success: "#03bf64",
|
|
33052
32284
|
processing: "#315efb",
|
|
33053
32285
|
error: "#e8353e",
|
|
33054
32286
|
warning: "#eb8903"
|
|
33055
32287
|
};
|
|
33056
|
-
const BodyCell = (props, { slots, emit }) => {
|
|
32288
|
+
const BodyCell$1 = (props, { slots, emit }) => {
|
|
33057
32289
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
33058
32290
|
const { table } = useProConfigInject();
|
|
33059
32291
|
const tableSlotsContext = useInjectSlots();
|
|
33060
32292
|
const tableContext = useInjectTable();
|
|
33061
32293
|
const { onBodyCellContextmenu } = useInjectBody();
|
|
33062
|
-
const { getRangeCellClass } = useInjectRangeStore();
|
|
33063
32294
|
const level = useInjectLevel();
|
|
33064
|
-
const {
|
|
33065
|
-
const {
|
|
33066
|
-
prefixCls,
|
|
33067
|
-
column,
|
|
33068
|
-
wrapText,
|
|
33069
|
-
rowKey,
|
|
33070
|
-
item,
|
|
33071
|
-
rowIndex,
|
|
33072
|
-
hasAppendNode,
|
|
33073
|
-
tooltipOpen,
|
|
33074
|
-
editCellKeys
|
|
33075
|
-
} = props;
|
|
32295
|
+
const { prefixCls, column, wrapText, rowKey, item, rowIndex, hasAppendNode, tooltipOpen } = props;
|
|
33076
32296
|
const columnKey = column.columnKey;
|
|
33077
32297
|
const valueEnum = runFunction(column == null ? void 0 : column.valueEnum, props.item);
|
|
33078
32298
|
const rowDrag = typeof column.rowDrag == "function" ? column.rowDrag({ record: item, column: column.originColumn }) : !!column.rowDrag;
|
|
@@ -33082,22 +32302,8 @@
|
|
|
33082
32302
|
const sorterInfo = { sorterOrder };
|
|
33083
32303
|
const key = `${props.rowKey} ${columnKey}`;
|
|
33084
32304
|
const value = column.dataIndex ? column.renderText ? column.renderText(get(item, column.dataIndex), item, rowIndex) : get(item, column.dataIndex) : void 0;
|
|
33085
|
-
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]);
|
|
33086
32306
|
const recordIndexs = tableContext.getIndexsByKey(rowKey);
|
|
33087
|
-
let customEditable = false;
|
|
33088
|
-
let isEditing = editCellKeys == null ? void 0 : editCellKeys.includes(key);
|
|
33089
|
-
if (isEditing) {
|
|
33090
|
-
const editable = "function" == typeof column.editable && column.editable({
|
|
33091
|
-
record: item,
|
|
33092
|
-
column: column.originColumn,
|
|
33093
|
-
recordIndexs,
|
|
33094
|
-
value
|
|
33095
|
-
});
|
|
33096
|
-
customEditable = "cellEditorSlot" === column.editable || "cellEditorSlot" === editable;
|
|
33097
|
-
isEditing = isEditing && (customEditable && !!tableSlotsContext.cellEditor || true === column.editable || !!editable);
|
|
33098
|
-
}
|
|
33099
|
-
let { editableTrigger = ["dblClick"] } = column;
|
|
33100
|
-
editableTrigger = Array.isArray(editableTrigger) ? editableTrigger : [editableTrigger];
|
|
33101
32307
|
const cellInnerClass = { [`${prefixCls}-cell-inner`]: true };
|
|
33102
32308
|
const cellContentClass = {
|
|
33103
32309
|
[`${prefixCls}-cell-content`]: true,
|
|
@@ -33118,7 +32324,6 @@
|
|
|
33118
32324
|
const cellRender = ((_b = (_a = tableContext.allCellProps.value) == null ? void 0 : _a[rowKey]) == null ? void 0 : _b[column.columnKey]) || {};
|
|
33119
32325
|
const cellProps2 = cellRender.props || {};
|
|
33120
32326
|
const cellRowSpan = cellProps2.rowSpan;
|
|
33121
|
-
const cellPosition = { rowIndex: props.flattenRowIndex, rowPinned: null, column };
|
|
33122
32327
|
const cellClass = {
|
|
33123
32328
|
[`${prefixCls}-cell`]: true,
|
|
33124
32329
|
[`${prefixCls}-first-cell`]: column.columnIndex === 0,
|
|
@@ -33126,60 +32331,7 @@
|
|
|
33126
32331
|
[`${prefixCls}-cell-multi`]: cellRowSpan > 1,
|
|
33127
32332
|
[`${prefixCls}-cell-hidden`]: cellRowSpan === 0,
|
|
33128
32333
|
[`${prefixCls}-column-sort`]: sorterInfo.sorterOrder,
|
|
33129
|
-
[`${prefixCls}-with-append`]: hasAppendNode
|
|
33130
|
-
[`${prefixCls}-cell-inline-edit`]: isEditing,
|
|
33131
|
-
[getRangeCellClass(cellPosition)]: true
|
|
33132
|
-
};
|
|
33133
|
-
const openEditor = () => {
|
|
33134
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
33135
|
-
const oldValue = (_c2 = (_b2 = (_a2 = props.column) == null ? void 0 : _a2.valueGetter) == null ? void 0 : _b2.call(_a2, {
|
|
33136
|
-
value,
|
|
33137
|
-
record: item,
|
|
33138
|
-
column,
|
|
33139
|
-
recordIndexs
|
|
33140
|
-
})) != null ? _c2 : value;
|
|
33141
|
-
const beforeOpen = (_e2 = (_d2 = tableContext.props) == null ? void 0 : _d2.onBeforeOpenEditor) == null ? void 0 : _e2.call(_d2, cellRenderArgs);
|
|
33142
|
-
if (isPromise(beforeOpen)) {
|
|
33143
|
-
beforeOpen.then((res) => {
|
|
33144
|
-
var _a3, _b3;
|
|
33145
|
-
if (res) {
|
|
33146
|
-
emit("openEditor", key, { [key]: oldValue });
|
|
33147
|
-
(_b3 = (_a3 = tableContext.props) == null ? void 0 : _a3.onOpenEditor) == null ? void 0 : _b3.call(_a3, cellRenderArgs);
|
|
33148
|
-
}
|
|
33149
|
-
});
|
|
33150
|
-
} else {
|
|
33151
|
-
if (false !== beforeOpen) {
|
|
33152
|
-
emit("openEditor", key, { [key]: oldValue });
|
|
33153
|
-
(_g2 = (_f2 = tableContext.props) == null ? void 0 : _f2.onOpenEditor) == null ? void 0 : _g2.call(_f2, cellRenderArgs);
|
|
33154
|
-
}
|
|
33155
|
-
}
|
|
33156
|
-
};
|
|
33157
|
-
const closeEditor = (currentKey) => {
|
|
33158
|
-
var _a2, _b2, _c2, _d2;
|
|
33159
|
-
const beforeClose = (_b2 = (_a2 = tableContext.props) == null ? void 0 : _a2.onBeforeCloseEditor) == null ? void 0 : _b2.call(_a2, {
|
|
33160
|
-
...cellRenderArgs,
|
|
33161
|
-
oldValue: oldValuesMap.value[key]
|
|
33162
|
-
});
|
|
33163
|
-
if (isPromise(beforeClose)) {
|
|
33164
|
-
beforeClose.then((res) => {
|
|
33165
|
-
var _a3, _b3;
|
|
33166
|
-
if (res) {
|
|
33167
|
-
emit("closeEditor", currentKey != null ? currentKey : key);
|
|
33168
|
-
(_b3 = (_a3 = tableContext.props) == null ? void 0 : _a3.onCloseEditor) == null ? void 0 : _b3.call(_a3, {
|
|
33169
|
-
...cellRenderArgs,
|
|
33170
|
-
oldValue: oldValuesMap.value[key]
|
|
33171
|
-
});
|
|
33172
|
-
}
|
|
33173
|
-
});
|
|
33174
|
-
} else {
|
|
33175
|
-
if (false !== beforeClose) {
|
|
33176
|
-
emit("closeEditor", currentKey != null ? currentKey : key);
|
|
33177
|
-
(_d2 = (_c2 = tableContext.props) == null ? void 0 : _c2.onCloseEditor) == null ? void 0 : _d2.call(_c2, {
|
|
33178
|
-
...cellRenderArgs,
|
|
33179
|
-
oldValue: oldValuesMap.value[key]
|
|
33180
|
-
});
|
|
33181
|
-
}
|
|
33182
|
-
}
|
|
32334
|
+
[`${prefixCls}-with-append`]: hasAppendNode
|
|
33183
32335
|
};
|
|
33184
32336
|
const cellRenderArgs = {
|
|
33185
32337
|
record: item,
|
|
@@ -33190,8 +32342,10 @@
|
|
|
33190
32342
|
recordIndexs: tableContext.getIndexsByKey(rowKey),
|
|
33191
32343
|
key,
|
|
33192
32344
|
valueStatus,
|
|
33193
|
-
|
|
33194
|
-
|
|
32345
|
+
cancelEditable: tableContext.cancelEditable,
|
|
32346
|
+
startEditable: tableContext.startEditable,
|
|
32347
|
+
saveEditable: tableContext.saveEditable,
|
|
32348
|
+
isEditable: tableContext.isEditable
|
|
33195
32349
|
};
|
|
33196
32350
|
let bodyCell = recordIndexs && ((_c = tableSlotsContext.bodyCell) == null ? void 0 : _c.call(tableSlotsContext, cellRenderArgs)) || [];
|
|
33197
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 : "-" : "";
|
|
@@ -33310,27 +32464,6 @@
|
|
|
33310
32464
|
} else {
|
|
33311
32465
|
renderCellVNode = cellVNode;
|
|
33312
32466
|
}
|
|
33313
|
-
const onDblclick = () => {
|
|
33314
|
-
editableTrigger.includes("dblClick") && openEditor();
|
|
33315
|
-
};
|
|
33316
|
-
const editInputRender = isEditing ? vue.createVNode(
|
|
33317
|
-
EditInput,
|
|
33318
|
-
{
|
|
33319
|
-
prefixCls,
|
|
33320
|
-
recordIndexs,
|
|
33321
|
-
rowKey,
|
|
33322
|
-
cellKey: key,
|
|
33323
|
-
column,
|
|
33324
|
-
record: item,
|
|
33325
|
-
onCloseEditor: closeEditor,
|
|
33326
|
-
value,
|
|
33327
|
-
customEditable,
|
|
33328
|
-
getPopupContainer: props.getPopupContainer,
|
|
33329
|
-
multiple: editCellKeys.length > 1,
|
|
33330
|
-
autoHeight
|
|
33331
|
-
},
|
|
33332
|
-
null
|
|
33333
|
-
) : null;
|
|
33334
32467
|
return vue.createVNode(
|
|
33335
32468
|
"div",
|
|
33336
32469
|
vue.mergeProps(cellProps2, {
|
|
@@ -33342,39 +32475,25 @@
|
|
|
33342
32475
|
"data-column-key": columnKey,
|
|
33343
32476
|
class: cellClass,
|
|
33344
32477
|
onContextmenu: (e) => {
|
|
33345
|
-
if (
|
|
32478
|
+
if (tableContext.props.hasContextmenuPopup && 0 === e.button && e.ctrlKey) {
|
|
33346
32479
|
e.preventDefault();
|
|
33347
32480
|
} else {
|
|
33348
32481
|
onBodyCellContextmenu(e, cellRenderArgs, props.type);
|
|
33349
|
-
|
|
32482
|
+
emit("contextmenu", e);
|
|
33350
32483
|
}
|
|
33351
32484
|
},
|
|
33352
|
-
onDblclick
|
|
32485
|
+
onDblclick: (e) => {
|
|
32486
|
+
emit("dblClick", e);
|
|
32487
|
+
},
|
|
33353
32488
|
onClick: (e) => {
|
|
33354
32489
|
var _a2, _b2;
|
|
33355
32490
|
(_b2 = (_a2 = tableContext.props) == null ? void 0 : _a2.onCellClick) == null ? void 0 : _b2.call(_a2, e, cellRenderArgs);
|
|
33356
|
-
if ((
|
|
33357
|
-
|
|
33358
|
-
const now = (/* @__PURE__ */ new Date()).getTime();
|
|
33359
|
-
const is = now - lastClickTime < 200;
|
|
33360
|
-
lastClickTime = now;
|
|
33361
|
-
return is;
|
|
33362
|
-
})()) {
|
|
33363
|
-
onDblclick();
|
|
32491
|
+
if (hasSupportedDblclick()) {
|
|
32492
|
+
emit("dblclick", e);
|
|
33364
32493
|
e.preventDefault();
|
|
33365
32494
|
return;
|
|
33366
32495
|
}
|
|
33367
|
-
emit("click", e
|
|
33368
|
-
editableTrigger.includes("click") && openEditor();
|
|
33369
|
-
},
|
|
33370
|
-
onMousedown: (e) => {
|
|
33371
|
-
emit("mousedown", e, cellPosition);
|
|
33372
|
-
},
|
|
33373
|
-
onMousemove: (e) => {
|
|
33374
|
-
emit("mousemove", e, cellPosition);
|
|
33375
|
-
},
|
|
33376
|
-
onKeydown: (e) => {
|
|
33377
|
-
emit("keydown", e, { cellPosition, isEditing });
|
|
32496
|
+
emit("click", e);
|
|
33378
32497
|
},
|
|
33379
32498
|
"data-level": level,
|
|
33380
32499
|
"aria-selected": "true"
|
|
@@ -33389,26 +32508,497 @@
|
|
|
33389
32508
|
},
|
|
33390
32509
|
{ label: () => bodyCell }
|
|
33391
32510
|
) : null,
|
|
33392
|
-
renderCellVNode
|
|
33393
|
-
autoHeight && editInputRender ? vue.createVNode(
|
|
33394
|
-
"label",
|
|
33395
|
-
{
|
|
33396
|
-
class: `${prefixCls}-cell-edit-wrapper`,
|
|
33397
|
-
onMousedown: (e) => e.stopPropagation()
|
|
33398
|
-
},
|
|
33399
|
-
[vue.withDirectives(editInputRender, [[cellResize, cellResizeValue]])]
|
|
33400
|
-
) : editInputRender ? vue.createVNode(
|
|
33401
|
-
"label",
|
|
33402
|
-
{
|
|
33403
|
-
class: `${prefixCls}-cell-edit-wrapper`,
|
|
33404
|
-
onMousedown: (e) => e.stopPropagation()
|
|
33405
|
-
},
|
|
33406
|
-
[editInputRender]
|
|
33407
|
-
) : null
|
|
32511
|
+
renderCellVNode
|
|
33408
32512
|
]
|
|
33409
32513
|
);
|
|
33410
32514
|
};
|
|
33411
|
-
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]]);
|
|
33412
33002
|
|
|
33413
33003
|
var _sfc_main$m = vue.defineComponent({
|
|
33414
33004
|
name: "TableExpandedRow",
|
|
@@ -33488,7 +33078,7 @@
|
|
|
33488
33078
|
}
|
|
33489
33079
|
});
|
|
33490
33080
|
|
|
33491
|
-
const _hoisted_1$
|
|
33081
|
+
const _hoisted_1$8 = ["data-cell-auto"];
|
|
33492
33082
|
function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
33493
33083
|
const _component_RenderVNode = vue.resolveComponent("RenderVNode");
|
|
33494
33084
|
const _directive_cell_resize = vue.resolveDirective("cell-resize");
|
|
@@ -33520,7 +33110,7 @@
|
|
|
33520
33110
|
2
|
|
33521
33111
|
/* CLASS */
|
|
33522
33112
|
)
|
|
33523
|
-
], 10, _hoisted_1$
|
|
33113
|
+
], 10, _hoisted_1$8)), [
|
|
33524
33114
|
[_directive_cell_resize, _ctx.cellResizeBind]
|
|
33525
33115
|
])
|
|
33526
33116
|
],
|
|
@@ -33573,7 +33163,7 @@
|
|
|
33573
33163
|
}
|
|
33574
33164
|
});
|
|
33575
33165
|
|
|
33576
|
-
const _hoisted_1$
|
|
33166
|
+
const _hoisted_1$7 = ["aria-label"];
|
|
33577
33167
|
function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
|
|
33578
33168
|
return _ctx.expandIcon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
33579
33169
|
key: 0,
|
|
@@ -33587,7 +33177,7 @@
|
|
|
33587
33177
|
class: vue.normalizeClass(_ctx.className),
|
|
33588
33178
|
"aria-label": _ctx.label,
|
|
33589
33179
|
onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"]))
|
|
33590
|
-
}, null, 10, _hoisted_1$
|
|
33180
|
+
}, null, 10, _hoisted_1$7));
|
|
33591
33181
|
}
|
|
33592
33182
|
var ExpandIcon = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$h]]);
|
|
33593
33183
|
|
|
@@ -33786,8 +33376,8 @@
|
|
|
33786
33376
|
}
|
|
33787
33377
|
});
|
|
33788
33378
|
|
|
33789
|
-
const _hoisted_1$
|
|
33790
|
-
const _hoisted_2$
|
|
33379
|
+
const _hoisted_1$6 = ["data-level"];
|
|
33380
|
+
const _hoisted_2$2 = {
|
|
33791
33381
|
key: 2,
|
|
33792
33382
|
draggable: true
|
|
33793
33383
|
};
|
|
@@ -33845,12 +33435,12 @@
|
|
|
33845
33435
|
record: _ctx.record,
|
|
33846
33436
|
disabled: !_ctx.supportExpand,
|
|
33847
33437
|
onExpand: _ctx.onInternalTriggerExpand
|
|
33848
|
-
}, null, 8, ["prefix-cls", "expandIconType", "expanded", "record", "disabled", "onExpand"])) : _ctx.column.type === "draggable" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
33438
|
+
}, null, 8, ["prefix-cls", "expandIconType", "expanded", "record", "disabled", "onExpand"])) : _ctx.column.type === "draggable" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
|
|
33849
33439
|
vue.renderSlot(_ctx.$slots, "draggable-handle", {}, () => [
|
|
33850
33440
|
vue.createVNode(_component_MenuOutlined)
|
|
33851
33441
|
])
|
|
33852
33442
|
])) : vue.createCommentVNode("v-if", true)
|
|
33853
|
-
], 16, _hoisted_1$
|
|
33443
|
+
], 16, _hoisted_1$6);
|
|
33854
33444
|
}
|
|
33855
33445
|
var BodyExtraCell = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$g]]);
|
|
33856
33446
|
|
|
@@ -33862,7 +33452,8 @@
|
|
|
33862
33452
|
BodyCell,
|
|
33863
33453
|
ExpandedRow,
|
|
33864
33454
|
BodyExtraCell,
|
|
33865
|
-
RenderSlot
|
|
33455
|
+
RenderSlot,
|
|
33456
|
+
BodyTextCell: BodyCell$1
|
|
33866
33457
|
},
|
|
33867
33458
|
inheritAttrs: false,
|
|
33868
33459
|
props: {
|
|
@@ -33884,11 +33475,17 @@
|
|
|
33884
33475
|
const tableContext = useInjectTable();
|
|
33885
33476
|
const rowInstance = vue.getCurrentInstance();
|
|
33886
33477
|
const { table } = useProConfigInject();
|
|
33887
|
-
const { editCellKeys, closeEditor, openEditor } = useEditInject();
|
|
33478
|
+
const { editCellKeys, isRowEdit, mergedEditableKeys, editRowsMap, closeEditor, openEditor } = useEditInject();
|
|
33479
|
+
const editRow = vue.computed(() => editRowsMap.value[props.rowKey]);
|
|
33888
33480
|
let isUnmount = false;
|
|
33889
33481
|
const bodyRow = vue.ref();
|
|
33890
|
-
const
|
|
33891
|
-
|
|
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
|
+
});
|
|
33892
33489
|
const calMaxHeight = () => {
|
|
33893
33490
|
if (isUnmount) return;
|
|
33894
33491
|
let rowHeight = 0;
|
|
@@ -34090,6 +33687,7 @@
|
|
|
34090
33687
|
rowStyle,
|
|
34091
33688
|
cellClass,
|
|
34092
33689
|
tableContext,
|
|
33690
|
+
isCurrentEditRow,
|
|
34093
33691
|
mergedRowHeights,
|
|
34094
33692
|
handleCellBlur,
|
|
34095
33693
|
handleCellHover,
|
|
@@ -34117,29 +33715,29 @@
|
|
|
34117
33715
|
resizeObserver,
|
|
34118
33716
|
calMaxHeight,
|
|
34119
33717
|
bodyRow,
|
|
33718
|
+
editCellKeys,
|
|
33719
|
+
isRowEdit,
|
|
33720
|
+
editRow,
|
|
33721
|
+
mergedEditableKeys,
|
|
33722
|
+
openEditor,
|
|
33723
|
+
closeEditor,
|
|
34120
33724
|
hoverRowKey,
|
|
34121
33725
|
hoverColumnKey,
|
|
34122
33726
|
xVirtual: eagerComputed(() => tableContext.xVirtual.value),
|
|
34123
33727
|
getPopupContainer: () => popupContainer.value,
|
|
34124
|
-
|
|
34125
|
-
closeEditor,
|
|
34126
|
-
openEditor,
|
|
34127
|
-
mergedTooltipOpen,
|
|
34128
|
-
onCellMousedown,
|
|
34129
|
-
onCellKeydown,
|
|
34130
|
-
onCellMousemove,
|
|
34131
|
-
onCellClick
|
|
33728
|
+
mergedTooltipOpen
|
|
34132
33729
|
};
|
|
34133
33730
|
}
|
|
34134
33731
|
});
|
|
34135
33732
|
|
|
34136
|
-
const _hoisted_1$
|
|
34137
|
-
const _hoisted_2 = ["data-row-key"];
|
|
33733
|
+
const _hoisted_1$5 = ["data-row-key"];
|
|
33734
|
+
const _hoisted_2$1 = ["data-row-key"];
|
|
34138
33735
|
function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
34139
33736
|
const _component_ExpandedRow = vue.resolveComponent("ExpandedRow");
|
|
34140
33737
|
const _component_BodyExtraCell = vue.resolveComponent("BodyExtraCell");
|
|
34141
33738
|
const _component_ExpandIcon = vue.resolveComponent("ExpandIcon");
|
|
34142
33739
|
const _component_BodyCell = vue.resolveComponent("BodyCell");
|
|
33740
|
+
const _component_BodyTextCell = vue.resolveComponent("BodyTextCell");
|
|
34143
33741
|
const _component_RenderSlot = vue.resolveComponent("RenderSlot");
|
|
34144
33742
|
return _ctx.isExpandRow ? (vue.openBlock(), vue.createElementBlock(
|
|
34145
33743
|
vue.Fragment,
|
|
@@ -34161,7 +33759,7 @@
|
|
|
34161
33759
|
"resize-observer": _ctx.resizeObserver,
|
|
34162
33760
|
"cal-max-height": _ctx.calMaxHeight
|
|
34163
33761
|
}, null, 8, ["prefix-cls", "item", "row-key", "row-index", "resize-observer", "cal-max-height"])
|
|
34164
|
-
], 14, _hoisted_1$
|
|
33762
|
+
], 14, _hoisted_1$5)) : vue.createCommentVNode("v-if", true)
|
|
34165
33763
|
],
|
|
34166
33764
|
64
|
|
34167
33765
|
/* STABLE_FRAGMENT */
|
|
@@ -34179,7 +33777,7 @@
|
|
|
34179
33777
|
vue.Fragment,
|
|
34180
33778
|
null,
|
|
34181
33779
|
vue.renderList(_ctx.mergedColumns, (column, index) => {
|
|
34182
|
-
var _a;
|
|
33780
|
+
var _a, _b;
|
|
34183
33781
|
return vue.openBlock(), vue.createElementBlock(
|
|
34184
33782
|
vue.Fragment,
|
|
34185
33783
|
{
|
|
@@ -34199,7 +33797,7 @@
|
|
|
34199
33797
|
record: _ctx.record,
|
|
34200
33798
|
onMouseenter: ($event) => _ctx.handleCellHover(_ctx.rowKey, column.columnKey, _ctx.tableContext.draggingRowKey.value),
|
|
34201
33799
|
onMouseleave: _ctx.handleCellBlur
|
|
34202
|
-
}, null, 8, ["prefix-cls", "row-key", "row-index", "type", "column", "expanded", "expandIconType", "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, {
|
|
34203
33801
|
key: 1,
|
|
34204
33802
|
"prefix-cls": _ctx.prefixCls,
|
|
34205
33803
|
item: _ctx.record,
|
|
@@ -34216,14 +33814,68 @@
|
|
|
34216
33814
|
"get-popup-container": _ctx.getPopupContainer,
|
|
34217
33815
|
"tooltip-open": _ctx.mergedTooltipOpen && _ctx.hoverColumnKey === column.columnKey,
|
|
34218
33816
|
"edit-cell-keys": _ctx.editCellKeys,
|
|
33817
|
+
"editable-keys": _ctx.mergedEditableKeys,
|
|
33818
|
+
"is-row-edit": _ctx.isRowEdit,
|
|
33819
|
+
"edit-row": _ctx.editRow,
|
|
33820
|
+
onCloseEditor: _ctx.closeEditor,
|
|
33821
|
+
onOpenEditor: _ctx.openEditor,
|
|
33822
|
+
onMouseenter: ($event) => _ctx.handleCellHover(_ctx.rowKey, column.columnKey, _ctx.tableContext.draggingRowKey.value),
|
|
33823
|
+
onCellLeave: _ctx.handleCellBlur
|
|
33824
|
+
}, {
|
|
33825
|
+
appendNode: vue.withCtx(() => [
|
|
33826
|
+
vue.createElementVNode(
|
|
33827
|
+
"div",
|
|
33828
|
+
{
|
|
33829
|
+
class: vue.normalizeClass(`${_ctx.prefixCls}-append-node`)
|
|
33830
|
+
},
|
|
33831
|
+
[
|
|
33832
|
+
vue.createElementVNode(
|
|
33833
|
+
"span",
|
|
33834
|
+
{
|
|
33835
|
+
style: vue.normalizeStyle(`padding-left: ${(_ctx.indent || 0) * _ctx.indentSize}px`),
|
|
33836
|
+
class: vue.normalizeClass(`${_ctx.prefixCls}-row-indent indent-level-${_ctx.indent}`)
|
|
33837
|
+
},
|
|
33838
|
+
null,
|
|
33839
|
+
6
|
|
33840
|
+
/* CLASS, STYLE */
|
|
33841
|
+
),
|
|
33842
|
+
vue.createVNode(_component_ExpandIcon, {
|
|
33843
|
+
expanded: _ctx.expanded,
|
|
33844
|
+
expandIconType: _ctx.expandIconType,
|
|
33845
|
+
"prefix-cls": _ctx.prefixCls,
|
|
33846
|
+
expandable: _ctx.hasNestChildren,
|
|
33847
|
+
record: _ctx.record,
|
|
33848
|
+
disabled: !_ctx.mergedExpandable,
|
|
33849
|
+
onExpand: _ctx.onInternalTriggerExpand
|
|
33850
|
+
}, null, 8, ["expanded", "expandIconType", "prefix-cls", "expandable", "record", "disabled", "onExpand"])
|
|
33851
|
+
],
|
|
33852
|
+
2
|
|
33853
|
+
/* CLASS */
|
|
33854
|
+
)
|
|
33855
|
+
]),
|
|
33856
|
+
_: 1
|
|
33857
|
+
/* STABLE */
|
|
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,
|
|
34219
33875
|
onCloseEditor: _ctx.closeEditor,
|
|
34220
33876
|
onOpenEditor: _ctx.openEditor,
|
|
34221
33877
|
onMouseenter: ($event) => _ctx.handleCellHover(_ctx.rowKey, column.columnKey, _ctx.tableContext.draggingRowKey.value),
|
|
34222
|
-
onCellLeave: _ctx.handleCellBlur
|
|
34223
|
-
onMousedown: _ctx.onCellMousedown,
|
|
34224
|
-
onMousemove: _ctx.onCellMousemove,
|
|
34225
|
-
onKeydown: _ctx.onCellKeydown,
|
|
34226
|
-
onClick: _ctx.onCellClick
|
|
33878
|
+
onCellLeave: _ctx.handleCellBlur
|
|
34227
33879
|
}, {
|
|
34228
33880
|
appendNode: vue.withCtx(() => [
|
|
34229
33881
|
vue.createElementVNode(
|
|
@@ -34258,7 +33910,7 @@
|
|
|
34258
33910
|
]),
|
|
34259
33911
|
_: 1
|
|
34260
33912
|
/* STABLE */
|
|
34261
|
-
}, 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"
|
|
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)
|
|
34262
33914
|
],
|
|
34263
33915
|
64
|
|
34264
33916
|
/* STABLE_FRAGMENT */
|
|
@@ -34281,7 +33933,7 @@
|
|
|
34281
33933
|
2
|
|
34282
33934
|
/* CLASS */
|
|
34283
33935
|
)) : vue.createCommentVNode("v-if", true)
|
|
34284
|
-
], 16, _hoisted_2));
|
|
33936
|
+
], 16, _hoisted_2$1));
|
|
34285
33937
|
}
|
|
34286
33938
|
var Row = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$f]]);
|
|
34287
33939
|
|
|
@@ -34924,7 +34576,7 @@
|
|
|
34924
34576
|
}
|
|
34925
34577
|
});
|
|
34926
34578
|
|
|
34927
|
-
const _hoisted_1$
|
|
34579
|
+
const _hoisted_1$4 = { style: {
|
|
34928
34580
|
width: "100%",
|
|
34929
34581
|
overflow: "hidden",
|
|
34930
34582
|
position: "relative",
|
|
@@ -35036,7 +34688,7 @@
|
|
|
35036
34688
|
onKeydown: _cache[9] || (_cache[9] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args))
|
|
35037
34689
|
},
|
|
35038
34690
|
[
|
|
35039
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
34691
|
+
vue.createElementVNode("div", _hoisted_1$4, [
|
|
35040
34692
|
vue.createElementVNode(
|
|
35041
34693
|
"div",
|
|
35042
34694
|
{
|
|
@@ -35508,7 +35160,8 @@
|
|
|
35508
35160
|
"expandedRowsChange",
|
|
35509
35161
|
"resizeColumn",
|
|
35510
35162
|
"update:dataSource",
|
|
35511
|
-
"cellKeydown"
|
|
35163
|
+
"cellKeydown",
|
|
35164
|
+
"data-change"
|
|
35512
35165
|
],
|
|
35513
35166
|
slots: {},
|
|
35514
35167
|
setup(props, { expose, emit, slots }) {
|
|
@@ -35520,7 +35173,6 @@
|
|
|
35520
35173
|
});
|
|
35521
35174
|
const popupContainer = vue.shallowRef(null);
|
|
35522
35175
|
const customUiCls = usePrefixCls("custom-ui");
|
|
35523
|
-
const { editCellKeys, openEditor, closeEditor } = useEditProvider();
|
|
35524
35176
|
useProvidePopup();
|
|
35525
35177
|
const getPopupContainer = vue.computed(() => props.getPopupContainer);
|
|
35526
35178
|
const { status, watermarkMsg } = useLicense();
|
|
@@ -35627,6 +35279,9 @@
|
|
|
35627
35279
|
},
|
|
35628
35280
|
{ immediate: true, deep: !!props.deepWatchColumns }
|
|
35629
35281
|
);
|
|
35282
|
+
vue.watch(rawData, (newData) => {
|
|
35283
|
+
emit("data-change", newData);
|
|
35284
|
+
});
|
|
35630
35285
|
const childrenColumnName = vue.computed(
|
|
35631
35286
|
() => {
|
|
35632
35287
|
var _a, _b, _c;
|
|
@@ -35662,6 +35317,20 @@
|
|
|
35662
35317
|
return { spinning: false };
|
|
35663
35318
|
}
|
|
35664
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
|
+
});
|
|
35665
35334
|
vue.onActivated(() => {
|
|
35666
35335
|
scrollTo({ left: 0, top: 0 });
|
|
35667
35336
|
});
|
|
@@ -35971,7 +35640,11 @@
|
|
|
35971
35640
|
leftWidth,
|
|
35972
35641
|
centerWidth,
|
|
35973
35642
|
getRowHeight: cal.getRowHeight,
|
|
35974
|
-
customCell: vue.toRef(props, "customCell")
|
|
35643
|
+
customCell: vue.toRef(props, "customCell"),
|
|
35644
|
+
cancelEditable,
|
|
35645
|
+
startEditable,
|
|
35646
|
+
saveEditable,
|
|
35647
|
+
isEditable
|
|
35975
35648
|
});
|
|
35976
35649
|
vue.watch(
|
|
35977
35650
|
[realHeaderHeight, scrollLeft],
|
|
@@ -35985,6 +35658,10 @@
|
|
|
35985
35658
|
...cal,
|
|
35986
35659
|
...columns,
|
|
35987
35660
|
...cellProps,
|
|
35661
|
+
cancelEditable,
|
|
35662
|
+
startEditable,
|
|
35663
|
+
saveEditable,
|
|
35664
|
+
isEditable,
|
|
35988
35665
|
rootRef,
|
|
35989
35666
|
rawData,
|
|
35990
35667
|
getRowFlattenIndexByKey,
|
|
@@ -36202,99 +35879,22 @@
|
|
|
36202
35879
|
});
|
|
36203
35880
|
const tabGuardTopRef = vue.ref();
|
|
36204
35881
|
const tabGuardBottomRef = vue.ref();
|
|
36205
|
-
const {
|
|
36206
|
-
navigationService,
|
|
36207
|
-
getSelectedRange,
|
|
36208
|
-
clearAllSelectedRange,
|
|
36209
|
-
copySelectedRange,
|
|
36210
|
-
appendCellToSelectedRange,
|
|
36211
|
-
onBodyKeydown
|
|
36212
|
-
} = useProvideRangeStore({
|
|
36213
|
-
allColumns: columns.allColumns,
|
|
36214
|
-
flattenData,
|
|
36215
|
-
rangeSelection: vue.computed(() => props.rangeSelection),
|
|
36216
|
-
getRowByFlattenIndex,
|
|
36217
|
-
rootRef,
|
|
36218
|
-
prefixCls: vue.computed(() => props.prefixCls),
|
|
36219
|
-
allCellProps: cellProps.allCellProps,
|
|
36220
|
-
tabGuardTopRef,
|
|
36221
|
-
tabGuardBottomRef,
|
|
36222
|
-
ensureCellColumnVisible: (cell) => {
|
|
36223
|
-
if (!cell.column || cell.column.fixed) return;
|
|
36224
|
-
const sl = scrollLeft.value;
|
|
36225
|
-
const pos2 = columns.getColumnPositionByKey(cell.column.columnKey);
|
|
36226
|
-
if (pos2) {
|
|
36227
|
-
const { width, left } = pos2;
|
|
36228
|
-
const lw = leftWidth.value;
|
|
36229
|
-
const rw = rightWidth.value;
|
|
36230
|
-
left - lw < sl ? scrollLeft.value = left - lw : left + width > sl + bodyWidth.value - rw && (scrollLeft.value = left + width - bodyWidth.value + rw);
|
|
36231
|
-
}
|
|
36232
|
-
},
|
|
36233
|
-
ensureCellRowVisible: (cell) => {
|
|
36234
|
-
var _a;
|
|
36235
|
-
const { rowIndex } = cell;
|
|
36236
|
-
const st = scrollTop.value;
|
|
36237
|
-
const row = getRowByFlattenIndex(rowIndex);
|
|
36238
|
-
const pos2 = cal.getRowPositionByKey(row.rowKey);
|
|
36239
|
-
const cprops = (((_a = cellProps.allCellProps.value[row.rowKey]) == null ? void 0 : _a[cell.column.columnKey]) || {}).props || {};
|
|
36240
|
-
const height = cal.getRowHeight(rowIndex, cprops.rowSpan);
|
|
36241
|
-
if (pos2 !== void 0) {
|
|
36242
|
-
updateAnimate();
|
|
36243
|
-
if (pos2 < st) {
|
|
36244
|
-
scrollTop.value = pos2;
|
|
36245
|
-
} else {
|
|
36246
|
-
if (pos2 + height > st + bodyHeight.value) {
|
|
36247
|
-
scrollTop.value = pos2 + height - bodyHeight.value;
|
|
36248
|
-
}
|
|
36249
|
-
}
|
|
36250
|
-
}
|
|
36251
|
-
},
|
|
36252
|
-
latestRangeStartCell,
|
|
36253
|
-
bodyRef: vue.computed(() => {
|
|
36254
|
-
var _a;
|
|
36255
|
-
return (_a = bodyRef.value) == null ? void 0 : _a.bodyRef;
|
|
36256
|
-
}),
|
|
36257
|
-
scrollLeft,
|
|
36258
|
-
scrollTop,
|
|
36259
|
-
scrollTo,
|
|
36260
|
-
showVerticalScrollbar,
|
|
36261
|
-
showHorizontalScrollbar,
|
|
36262
|
-
getIndexsByKey,
|
|
36263
|
-
formatRangeCellText: (parmas) => {
|
|
36264
|
-
if (props.formatRangeCellText) {
|
|
36265
|
-
return props.formatRangeCellText(parmas);
|
|
36266
|
-
} else if (parmas.value) {
|
|
36267
|
-
return parmas.value;
|
|
36268
|
-
}
|
|
36269
|
-
return "";
|
|
36270
|
-
},
|
|
36271
|
-
editCellKeys,
|
|
36272
|
-
copyDelimiter: vue.computed(() => props.copyDelimiter)
|
|
36273
|
-
});
|
|
36274
35882
|
expose({
|
|
36275
35883
|
scrollTo,
|
|
36276
35884
|
scrollLeft,
|
|
36277
35885
|
scrollTop,
|
|
36278
35886
|
rootRef,
|
|
36279
35887
|
paginationRef,
|
|
35888
|
+
validateRowData,
|
|
35889
|
+
addEditRecord,
|
|
35890
|
+
cancelEditable,
|
|
35891
|
+
startEditable,
|
|
35892
|
+
saveEditable,
|
|
35893
|
+
validateTableData,
|
|
36280
35894
|
bodyRef: vue.computed(() => {
|
|
36281
35895
|
var _a;
|
|
36282
35896
|
return (_a = bodyRef.value) == null ? void 0 : _a.bodyRef;
|
|
36283
|
-
})
|
|
36284
|
-
getSelectedRange,
|
|
36285
|
-
clearAllSelectedRange,
|
|
36286
|
-
copySelectedRange,
|
|
36287
|
-
appendCellToSelectedRange,
|
|
36288
|
-
openEditor: (cellInfos) => {
|
|
36289
|
-
openEditor(cellInfos.map((info) => `${info.rowKey} ${info.columnKey}`));
|
|
36290
|
-
},
|
|
36291
|
-
closeEditor: (cellInfos) => {
|
|
36292
|
-
if (cellInfos) {
|
|
36293
|
-
closeEditor(cellInfos.map((info) => `${info.rowKey} ${info.columnKey}`));
|
|
36294
|
-
} else {
|
|
36295
|
-
closeEditor();
|
|
36296
|
-
}
|
|
36297
|
-
}
|
|
35897
|
+
})
|
|
36298
35898
|
});
|
|
36299
35899
|
return {
|
|
36300
35900
|
bodyRef,
|
|
@@ -36306,7 +35906,6 @@
|
|
|
36306
35906
|
watermarkMsg,
|
|
36307
35907
|
rootStyle,
|
|
36308
35908
|
rootClass,
|
|
36309
|
-
onBodyKeydown,
|
|
36310
35909
|
watermarkStyle: vue.computed(() => ({
|
|
36311
35910
|
minWidth: "100px!important",
|
|
36312
35911
|
minHeight: "40px!important",
|
|
@@ -36351,12 +35950,6 @@
|
|
|
36351
35950
|
bottomPaginationHeight.value = e.detail.height;
|
|
36352
35951
|
},
|
|
36353
35952
|
popupContainer,
|
|
36354
|
-
handleGuardTopKeydown: (e) => {
|
|
36355
|
-
e.keyCode !== KeyCode.TAB || e.shiftKey || (navigationService.getFirstCellToFocus(e.shiftKey), e.preventDefault());
|
|
36356
|
-
},
|
|
36357
|
-
handleGuardBottomKeydown: (e) => {
|
|
36358
|
-
e.keyCode === KeyCode.TAB && e.shiftKey && (navigationService.getLastCellToFocus(e.shiftKey), e.preventDefault());
|
|
36359
|
-
},
|
|
36360
35953
|
tabGuardTopRef,
|
|
36361
35954
|
tabGuardBottomRef,
|
|
36362
35955
|
onShowSizeChange,
|
|
@@ -36367,6 +35960,18 @@
|
|
|
36367
35960
|
}
|
|
36368
35961
|
});
|
|
36369
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
|
+
};
|
|
36370
35975
|
function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
36371
35976
|
const _component_Pagination = vue.resolveComponent("Pagination");
|
|
36372
35977
|
const _component_AutoHeightHeader = vue.resolveComponent("AutoHeightHeader");
|
|
@@ -36396,16 +36001,10 @@
|
|
|
36396
36001
|
}), null, 16, ["class", "onChange", "onShowSizeChange"])) : vue.createCommentVNode("v-if", true),
|
|
36397
36002
|
vue.createElementVNode(
|
|
36398
36003
|
"div",
|
|
36399
|
-
|
|
36400
|
-
ref: "tabGuardTopRef",
|
|
36401
|
-
role: "presentation",
|
|
36402
|
-
tabindex: "0",
|
|
36403
|
-
style: { position: "absolute", width: "0", height: "0" },
|
|
36404
|
-
onKeydown: _cache[0] || (_cache[0] = (...args) => _ctx.handleGuardTopKeydown && _ctx.handleGuardTopKeydown(...args))
|
|
36405
|
-
},
|
|
36004
|
+
_hoisted_1$3,
|
|
36406
36005
|
null,
|
|
36407
|
-
|
|
36408
|
-
/*
|
|
36006
|
+
512
|
|
36007
|
+
/* NEED_PATCH */
|
|
36409
36008
|
),
|
|
36410
36009
|
vue.createElementVNode(
|
|
36411
36010
|
"div",
|
|
@@ -36438,20 +36037,19 @@
|
|
|
36438
36037
|
vue.createVNode(_component_ProBody, {
|
|
36439
36038
|
ref: "bodyRef",
|
|
36440
36039
|
bodyScrollWidth: _ctx.bodyScrollWidth,
|
|
36441
|
-
"onUpdate:bodyScrollWidth": _cache[
|
|
36040
|
+
"onUpdate:bodyScrollWidth": _cache[0] || (_cache[0] = ($event) => _ctx.bodyScrollWidth = $event),
|
|
36442
36041
|
bodyWidth: _ctx.bodyWidth,
|
|
36443
|
-
"onUpdate:bodyWidth": _cache[
|
|
36042
|
+
"onUpdate:bodyWidth": _cache[1] || (_cache[1] = ($event) => _ctx.bodyWidth = $event),
|
|
36444
36043
|
bodyHeight: _ctx.bodyHeight,
|
|
36445
|
-
"onUpdate:bodyHeight": _cache[
|
|
36044
|
+
"onUpdate:bodyHeight": _cache[2] || (_cache[2] = ($event) => _ctx.bodyHeight = $event),
|
|
36446
36045
|
"prefix-cls": _ctx.prefixCls,
|
|
36447
36046
|
"wrap-text": _ctx.wrapText,
|
|
36448
36047
|
"scroll-x": _ctx.mergedScrollX,
|
|
36449
36048
|
height: _ctx.mergedScrollY,
|
|
36450
36049
|
"summary-fixed": _ctx.mergedSummaryFixed,
|
|
36451
36050
|
summary: _ctx.$slots.summary,
|
|
36452
|
-
"empty-text": _ctx.$slots.emptyText
|
|
36453
|
-
|
|
36454
|
-
}, 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"])
|
|
36455
36053
|
],
|
|
36456
36054
|
6
|
|
36457
36055
|
/* CLASS, STYLE */
|
|
@@ -36459,16 +36057,10 @@
|
|
|
36459
36057
|
vue.createVNode(_component_HorizontalScroll),
|
|
36460
36058
|
vue.createElementVNode(
|
|
36461
36059
|
"div",
|
|
36462
|
-
|
|
36463
|
-
ref: "tabGuardBottomRef",
|
|
36464
|
-
role: "presentation",
|
|
36465
|
-
tabindex: "0",
|
|
36466
|
-
style: { position: "absolute", width: "0", height: "0" },
|
|
36467
|
-
onKeydown: _cache[4] || (_cache[4] = (...args) => _ctx.handleGuardBottomKeydown && _ctx.handleGuardBottomKeydown(...args))
|
|
36468
|
-
},
|
|
36060
|
+
_hoisted_2,
|
|
36469
36061
|
null,
|
|
36470
|
-
|
|
36471
|
-
/*
|
|
36062
|
+
512
|
|
36063
|
+
/* NEED_PATCH */
|
|
36472
36064
|
),
|
|
36473
36065
|
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock(
|
|
36474
36066
|
"div",
|
|
@@ -36493,7 +36085,7 @@
|
|
|
36493
36085
|
ref: "paginationRef",
|
|
36494
36086
|
style: vue.normalizeStyle(_ctx.bottomPaginationStyle),
|
|
36495
36087
|
class: vue.normalizeClass(`${_ctx.prefixCls}-pagination-wrap ${_ctx.prefixCls}-pagination-wrap-${_ctx.size}`),
|
|
36496
|
-
onResizeheight: _cache[
|
|
36088
|
+
onResizeheight: _cache[3] || (_cache[3] = (...args) => _ctx.handlePaginationResize && _ctx.handlePaginationResize(...args))
|
|
36497
36089
|
},
|
|
36498
36090
|
[
|
|
36499
36091
|
vue.createVNode(_component_Pagination, vue.mergeProps({ class: _ctx.paginationClass }, _ctx.paginationProps, {
|
|
@@ -38278,6 +37870,30 @@
|
|
|
38278
37870
|
var _a2;
|
|
38279
37871
|
(_a2 = tableRef.value) == null ? void 0 : _a2.scrollTo(pos, behavior);
|
|
38280
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
|
+
},
|
|
38281
37897
|
scrollLeft: vue.computed(() => {
|
|
38282
37898
|
var _a2;
|
|
38283
37899
|
return vue.unref((_a2 = tableRef.value) == null ? void 0 : _a2.scrollLeft);
|
|
@@ -38298,18 +37914,6 @@
|
|
|
38298
37914
|
var _a2;
|
|
38299
37915
|
return vue.unref((_a2 = tableRef.value) == null ? void 0 : _a2.paginationRef);
|
|
38300
37916
|
}),
|
|
38301
|
-
copySelectedRange: () => {
|
|
38302
|
-
var _a2;
|
|
38303
|
-
return (_a2 = tableRef.value) == null ? void 0 : _a2.copySelectedRange();
|
|
38304
|
-
},
|
|
38305
|
-
getSelectedRange: () => {
|
|
38306
|
-
var _a2;
|
|
38307
|
-
return (_a2 = tableRef.value) == null ? void 0 : _a2.getSelectedRange();
|
|
38308
|
-
},
|
|
38309
|
-
clearAllSelectedRange: () => {
|
|
38310
|
-
var _a2;
|
|
38311
|
-
return (_a2 = tableRef.value) == null ? void 0 : _a2.clearAllSelectedRange();
|
|
38312
|
-
},
|
|
38313
37917
|
clearDataSource: () => {
|
|
38314
37918
|
dataSource.value = [];
|
|
38315
37919
|
},
|
|
@@ -38319,14 +37923,6 @@
|
|
|
38319
37923
|
var _a2;
|
|
38320
37924
|
return (_a2 = tableRef.value) == null ? void 0 : _a2.appendCellToSelectedRange(params);
|
|
38321
37925
|
},
|
|
38322
|
-
openEditor: (cellInfos) => {
|
|
38323
|
-
var _a2;
|
|
38324
|
-
return (_a2 = tableRef.value) == null ? void 0 : _a2.openEditor(cellInfos);
|
|
38325
|
-
},
|
|
38326
|
-
closeEditor: (cellInfos) => {
|
|
38327
|
-
var _a2;
|
|
38328
|
-
return (_a2 = tableRef.value) == null ? void 0 : _a2.closeEditor(cellInfos);
|
|
38329
|
-
},
|
|
38330
37926
|
reload,
|
|
38331
37927
|
reset,
|
|
38332
37928
|
calcTableHeight,
|