@koi-design/uxd-ui 14.0.44 → 14.0.46
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/README.md +190 -1
- package/es/components/Table/BaseTable.vue.d.ts +2 -0
- package/es/components/Table/BodyTable.vue.d.ts +2 -0
- package/es/components/Table/HeadTable.vue.d.ts +2 -0
- package/es/components/Table/Table.mjs +15 -1
- package/es/components/Table/Table.mjs.map +1 -1
- package/es/components/Table/Table.type.d.ts +5 -0
- package/es/components/Table/Table.type.mjs +4 -0
- package/es/components/Table/Table.type.mjs.map +1 -1
- package/es/components/Table/Table.vue.d.ts +13 -0
- package/es/components/Table/TableBox.vue.d.ts +4 -0
- package/es/components/Table/hooks/useDraggable.mjs +37 -6
- package/es/components/Table/hooks/useDraggable.mjs.map +1 -1
- package/es/components/Table/tableUnits/DraggableIcon.mjs +17 -3
- package/es/components/Table/tableUnits/DraggableIcon.mjs.map +1 -1
- package/es/components/Table/tableUnits/DraggableIcon.vue.d.ts +1 -0
- package/es/components/Table/tableUnits/ExpandRows.vue.d.ts +1 -0
- package/es/components/Table/tableUnits/TableBody.vue.d.ts +2 -0
- package/es/components/Table/tableUnits/TableCell.mjs +4 -3
- package/es/components/Table/tableUnits/TableCell.mjs.map +1 -1
- package/es/components/Table/tableUnits/TableCell.vue.d.ts +1 -0
- package/es/components/Table/tableUnits/TableRow.vue.d.ts +1 -0
- package/lib/components/Table/BaseTable.vue.d.ts +2 -0
- package/lib/components/Table/BodyTable.vue.d.ts +2 -0
- package/lib/components/Table/HeadTable.vue.d.ts +2 -0
- package/lib/components/Table/Table.js +15 -1
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Table/Table.type.d.ts +5 -0
- package/lib/components/Table/Table.type.js +4 -0
- package/lib/components/Table/Table.type.js.map +1 -1
- package/lib/components/Table/Table.vue.d.ts +13 -0
- package/lib/components/Table/TableBox.vue.d.ts +4 -0
- package/lib/components/Table/hooks/useDraggable.js +37 -6
- package/lib/components/Table/hooks/useDraggable.js.map +1 -1
- package/lib/components/Table/tableUnits/DraggableIcon.js +17 -3
- package/lib/components/Table/tableUnits/DraggableIcon.js.map +1 -1
- package/lib/components/Table/tableUnits/DraggableIcon.vue.d.ts +1 -0
- package/lib/components/Table/tableUnits/ExpandRows.vue.d.ts +1 -0
- package/lib/components/Table/tableUnits/TableBody.vue.d.ts +2 -0
- package/lib/components/Table/tableUnits/TableCell.js +4 -3
- package/lib/components/Table/tableUnits/TableCell.js.map +1 -1
- package/lib/components/Table/tableUnits/TableCell.vue.d.ts +1 -0
- package/lib/components/Table/tableUnits/TableRow.vue.d.ts +1 -0
- package/package.json +1 -1
- package/types/components/Table/BaseTable.vue.d.ts +2 -0
- package/types/components/Table/BodyTable.vue.d.ts +2 -0
- package/types/components/Table/HeadTable.vue.d.ts +2 -0
- package/types/components/Table/Table.type.d.ts +5 -0
- package/types/components/Table/Table.vue.d.ts +13 -0
- package/types/components/Table/TableBox.vue.d.ts +4 -0
- package/types/components/Table/tableUnits/DraggableIcon.vue.d.ts +1 -0
- package/types/components/Table/tableUnits/ExpandRows.vue.d.ts +1 -0
- package/types/components/Table/tableUnits/TableBody.vue.d.ts +2 -0
- package/types/components/Table/tableUnits/TableCell.vue.d.ts +1 -0
- package/types/components/Table/tableUnits/TableRow.vue.d.ts +1 -0
- package/uxd-ui.esm.min.mjs +6 -6
- package/uxd-ui.esm.mjs +78 -14
- package/uxd-ui.umd.js +78 -14
- package/uxd-ui.umd.min.js +6 -6
package/uxd-ui.esm.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @koi-design/uxd-ui@14.0.
|
|
1
|
+
/*! @koi-design/uxd-ui@14.0.46 */
|
|
2
2
|
|
|
3
3
|
import { defineComponent, reactive, watch, provide, inject, computed, onMounted, ref, onBeforeUnmount, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, renderSlot, withDirectives, vShow, createBlock, resolveDynamicComponent, createCommentVNode, toRaw, resolveComponent, Transition, withCtx, createVNode, toDisplayString, isVNode, Comment as Comment$1, Fragment, Text as Text$1, h, shallowRef, toRef, nextTick, onUpdated, onUnmounted, cloneVNode, Teleport, toRefs, withModifiers, mergeProps, renderList, onBeforeUpdate, createTextVNode, createStaticVNode, normalizeProps, guardReactiveProps, watchEffect, onActivated, onDeactivated, withKeys, TransitionGroup, createApp, onBeforeMount, unref } from 'vue';
|
|
4
4
|
import { X, Terminal, CircleAlert, Info, CircleCheck, LoaderCircle, CircleX, Search, Eye, EyeOff, Check, CornerDownLeft, ChevronUp, ChevronDown, ChevronRight, MenuIcon, Minus, ChevronLeft, CheckIcon, ChevronsLeft, ChevronsRight, Calendar as Calendar$1, ZoomIn, ZoomOut, RotateCcw, RotateCw, PanelLeft, PanelRight, Image as Image$2, CheckCircle, XCircle, Star as Star$1, XIcon, FilterIcon, GripVertical, Plus, Clock, FileIcon, HelpCircle, CircleHelp, AlertCircle, SearchIcon } from 'lucide-vue-next';
|
|
@@ -33217,7 +33217,7 @@ const _sfc_main$G = defineComponent({
|
|
|
33217
33217
|
setup(props) {
|
|
33218
33218
|
const {
|
|
33219
33219
|
prefixCls: tablePrefixCls,
|
|
33220
|
-
props: { indentSize },
|
|
33220
|
+
props: { indentSize, cellEmptyText },
|
|
33221
33221
|
expand: { handleExpandChange, isRowExpanded },
|
|
33222
33222
|
filterAndSorter: { hasAction, hasSorters, hasFilters, isSortColumn },
|
|
33223
33223
|
size: { syncColumnWidth },
|
|
@@ -33332,7 +33332,8 @@ const _sfc_main$G = defineComponent({
|
|
|
33332
33332
|
cellRef,
|
|
33333
33333
|
ellipsisSpanRef,
|
|
33334
33334
|
isOverflow,
|
|
33335
|
-
checkWidth
|
|
33335
|
+
checkWidth,
|
|
33336
|
+
cellEmptyText
|
|
33336
33337
|
};
|
|
33337
33338
|
}
|
|
33338
33339
|
});
|
|
@@ -33422,7 +33423,7 @@ function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
33422
33423
|
]),
|
|
33423
33424
|
_: 1
|
|
33424
33425
|
}, 8, ["title", "disabled"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
33425
|
-
createTextVNode(toDisplayString(_ctx.displayCell), 1)
|
|
33426
|
+
createTextVNode(toDisplayString(_ctx.displayCell || _ctx.cellEmptyText), 1)
|
|
33426
33427
|
], 64))
|
|
33427
33428
|
], 64))
|
|
33428
33429
|
], 64))
|
|
@@ -34961,9 +34962,22 @@ const _sfc_main$v = defineComponent({
|
|
|
34961
34962
|
const handleDragStart = (e) => {
|
|
34962
34963
|
emit("dragStart", e);
|
|
34963
34964
|
};
|
|
34965
|
+
const handleTouchStart = (e) => {
|
|
34966
|
+
e.preventDefault();
|
|
34967
|
+
const touch = e.touches[0];
|
|
34968
|
+
const syntheticEvent = {
|
|
34969
|
+
...e,
|
|
34970
|
+
clientY: touch.clientY,
|
|
34971
|
+
clientX: touch.clientX,
|
|
34972
|
+
preventDefault: () => e.preventDefault(),
|
|
34973
|
+
stopPropagation: () => e.stopPropagation()
|
|
34974
|
+
};
|
|
34975
|
+
emit("dragStart", syntheticEvent);
|
|
34976
|
+
};
|
|
34964
34977
|
return {
|
|
34965
34978
|
prefixCls,
|
|
34966
|
-
handleDragStart
|
|
34979
|
+
handleDragStart,
|
|
34980
|
+
handleTouchStart
|
|
34967
34981
|
};
|
|
34968
34982
|
}
|
|
34969
34983
|
});
|
|
@@ -34972,13 +34986,14 @@ function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
34972
34986
|
const _component_UIcon = resolveComponent("UIcon");
|
|
34973
34987
|
return openBlock(), createBlock(_component_UIcon, {
|
|
34974
34988
|
class: normalizeClass([`${_ctx.prefixCls}-draggable-icon`]),
|
|
34975
|
-
onMousedown: _ctx.handleDragStart
|
|
34989
|
+
onMousedown: _ctx.handleDragStart,
|
|
34990
|
+
onTouchstart: _ctx.handleTouchStart
|
|
34976
34991
|
}, {
|
|
34977
34992
|
default: withCtx(() => [
|
|
34978
34993
|
createVNode(_component_GripVertical)
|
|
34979
34994
|
]),
|
|
34980
34995
|
_: 1
|
|
34981
|
-
}, 8, ["class", "onMousedown"]);
|
|
34996
|
+
}, 8, ["class", "onMousedown", "onTouchstart"]);
|
|
34982
34997
|
}
|
|
34983
34998
|
var DraggableIcon = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$t], ["__file", "DraggableIcon.vue"]]);
|
|
34984
34999
|
|
|
@@ -35022,12 +35037,22 @@ function useDraggable(props, tableRefs) {
|
|
|
35022
35037
|
}, {
|
|
35023
35038
|
flush: "post"
|
|
35024
35039
|
});
|
|
35040
|
+
const getClientY = (event) => {
|
|
35041
|
+
if ("touches" in event && event.touches.length > 0) {
|
|
35042
|
+
return event.touches[0].clientY;
|
|
35043
|
+
}
|
|
35044
|
+
if ("clientY" in event) {
|
|
35045
|
+
return event.clientY;
|
|
35046
|
+
}
|
|
35047
|
+
return 0;
|
|
35048
|
+
};
|
|
35025
35049
|
const setRowRefsTranslate = (event) => {
|
|
35026
35050
|
const currentRowData = rowDataMap.value[sourceRowKey];
|
|
35027
35051
|
const {
|
|
35028
35052
|
height: currentHeight
|
|
35029
35053
|
} = currentRowData.rowRef[0].value.getBoundingClientRect();
|
|
35030
|
-
const
|
|
35054
|
+
const clientY = getClientY(event);
|
|
35055
|
+
const realClientY = clientY + tableRefs.bodyTable.wrapRef.scrollTop;
|
|
35031
35056
|
const safeTranslateY = Math.max(relativeMinY, Math.min(realClientY - dragStartPosition, relativeMaxY));
|
|
35032
35057
|
currentRowData.rowRef.forEach((currentItem) => {
|
|
35033
35058
|
currentItem.value.style.transform = `translateY(${safeTranslateY}px)`;
|
|
@@ -35043,7 +35068,7 @@ function useDraggable(props, tableRefs) {
|
|
|
35043
35068
|
height,
|
|
35044
35069
|
top
|
|
35045
35070
|
} = rowData.rowRef[0].value.getBoundingClientRect();
|
|
35046
|
-
const position = top + Number((height / 2).toFixed(2)) <
|
|
35071
|
+
const position = top + Number((height / 2).toFixed(2)) < clientY ? 1 : -1;
|
|
35047
35072
|
if (!(sort + position)) {
|
|
35048
35073
|
let translateY = currentHeight;
|
|
35049
35074
|
let index = Math.min(targetIndex, rowData.index);
|
|
@@ -35076,10 +35101,11 @@ function useDraggable(props, tableRefs) {
|
|
|
35076
35101
|
}
|
|
35077
35102
|
};
|
|
35078
35103
|
const handleBodyScrollY = (event) => {
|
|
35079
|
-
|
|
35104
|
+
const clientY = getClientY(event);
|
|
35105
|
+
if (bodyTop + bodyHeight > clientY && clientY > bodyTop) {
|
|
35080
35106
|
clearBodyScrollY();
|
|
35081
35107
|
} else if (!scrollTimer) {
|
|
35082
|
-
const px =
|
|
35108
|
+
const px = clientY < bodyTop ? -3 : 3;
|
|
35083
35109
|
scrollTimer = setInterval(() => {
|
|
35084
35110
|
tableRefs.bodyTable.setScrollTop(Math.max(0, Math.min(tableRefs.bodyTable.wrapRef.scrollTop + px, tableHeight - bodyHeight)));
|
|
35085
35111
|
setRowRefsTranslate(event);
|
|
@@ -35092,6 +35118,13 @@ function useDraggable(props, tableRefs) {
|
|
|
35092
35118
|
setRowRefsTranslate(event);
|
|
35093
35119
|
}
|
|
35094
35120
|
};
|
|
35121
|
+
const handleTouchmove = (event) => {
|
|
35122
|
+
event.preventDefault();
|
|
35123
|
+
handleBodyScrollY(event);
|
|
35124
|
+
if (!scrollTimer) {
|
|
35125
|
+
setRowRefsTranslate(event);
|
|
35126
|
+
}
|
|
35127
|
+
};
|
|
35095
35128
|
const disableWheel = (e) => {
|
|
35096
35129
|
e.preventDefault();
|
|
35097
35130
|
};
|
|
@@ -35118,11 +35151,15 @@ function useDraggable(props, tableRefs) {
|
|
|
35118
35151
|
window.removeEventListener("mousemove", handleMousemove);
|
|
35119
35152
|
window.removeEventListener("mouseup", clearDrag);
|
|
35120
35153
|
window.removeEventListener("mousewheel", disableWheel);
|
|
35154
|
+
window.removeEventListener("touchmove", handleTouchmove);
|
|
35155
|
+
window.removeEventListener("touchend", clearDrag);
|
|
35156
|
+
window.removeEventListener("touchcancel", clearDrag);
|
|
35121
35157
|
};
|
|
35122
35158
|
const handleDragStart = (event, param) => {
|
|
35123
35159
|
const bodyTable = tableRefs.bodyTable.wrapRef;
|
|
35124
35160
|
sourceRowKey = param.rowKey.toString();
|
|
35125
|
-
|
|
35161
|
+
const clientY = getClientY(event);
|
|
35162
|
+
dragStartPosition = clientY + bodyTable.scrollTop;
|
|
35126
35163
|
const sortRowData = Object.values(rowDataMap.value).sort((a, b) => a.index - b.index);
|
|
35127
35164
|
const {
|
|
35128
35165
|
top
|
|
@@ -35139,12 +35176,21 @@ function useDraggable(props, tableRefs) {
|
|
|
35139
35176
|
bodyTop = bodyTopInner;
|
|
35140
35177
|
bodyHeight = bodyHeightInner;
|
|
35141
35178
|
tableHeight = tableHeightInner;
|
|
35142
|
-
|
|
35179
|
+
if ("touches" in event) {
|
|
35180
|
+
handleTouchmove(event);
|
|
35181
|
+
} else {
|
|
35182
|
+
handleMousemove(event);
|
|
35183
|
+
}
|
|
35143
35184
|
window.addEventListener("mousemove", handleMousemove);
|
|
35144
35185
|
window.addEventListener("mouseup", clearDrag);
|
|
35145
35186
|
window.addEventListener("mousewheel", disableWheel, {
|
|
35146
35187
|
passive: false
|
|
35147
35188
|
});
|
|
35189
|
+
window.addEventListener("touchmove", handleTouchmove, {
|
|
35190
|
+
passive: false
|
|
35191
|
+
});
|
|
35192
|
+
window.addEventListener("touchend", clearDrag);
|
|
35193
|
+
window.addEventListener("touchcancel", clearDrag);
|
|
35148
35194
|
event.preventDefault();
|
|
35149
35195
|
};
|
|
35150
35196
|
const draggableColumn = computed(() => {
|
|
@@ -35519,6 +35565,10 @@ const tableProps = {
|
|
|
35519
35565
|
skeletonRows: {
|
|
35520
35566
|
type: Number,
|
|
35521
35567
|
default: 3
|
|
35568
|
+
},
|
|
35569
|
+
cellEmptyText: {
|
|
35570
|
+
type: String,
|
|
35571
|
+
default: ""
|
|
35522
35572
|
}
|
|
35523
35573
|
};
|
|
35524
35574
|
const rowEmitFn = (data, index, e) => typeof data === "object" && typeof index === "number" && e instanceof Event;
|
|
@@ -35688,7 +35738,20 @@ const _sfc_main$u = defineComponent({
|
|
|
35688
35738
|
const handleColumnResize = (columnWidth, changeWidth, column, event) => {
|
|
35689
35739
|
emit("column-resize", columnWidth, changeWidth, column, event);
|
|
35690
35740
|
};
|
|
35691
|
-
const {
|
|
35741
|
+
const {
|
|
35742
|
+
showHeader,
|
|
35743
|
+
maxHeight,
|
|
35744
|
+
expandIcon,
|
|
35745
|
+
rowClassName,
|
|
35746
|
+
indentSize,
|
|
35747
|
+
showSummary,
|
|
35748
|
+
disabledHover,
|
|
35749
|
+
expandIndent,
|
|
35750
|
+
headerSticky,
|
|
35751
|
+
loading,
|
|
35752
|
+
width,
|
|
35753
|
+
cellEmptyText
|
|
35754
|
+
} = toRefs(props);
|
|
35692
35755
|
provide("tableContext", {
|
|
35693
35756
|
prefixCls,
|
|
35694
35757
|
locale,
|
|
@@ -35703,6 +35766,7 @@ const _sfc_main$u = defineComponent({
|
|
|
35703
35766
|
rowClassName,
|
|
35704
35767
|
indentSize,
|
|
35705
35768
|
emptyText,
|
|
35769
|
+
cellEmptyText,
|
|
35706
35770
|
showSummary,
|
|
35707
35771
|
disabledHover,
|
|
35708
35772
|
expandIndent,
|
package/uxd-ui.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @koi-design/uxd-ui@14.0.
|
|
1
|
+
/*! @koi-design/uxd-ui@14.0.46 */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('lucide-vue-next')) :
|
|
@@ -33220,7 +33220,7 @@
|
|
|
33220
33220
|
setup(props) {
|
|
33221
33221
|
const {
|
|
33222
33222
|
prefixCls: tablePrefixCls,
|
|
33223
|
-
props: { indentSize },
|
|
33223
|
+
props: { indentSize, cellEmptyText },
|
|
33224
33224
|
expand: { handleExpandChange, isRowExpanded },
|
|
33225
33225
|
filterAndSorter: { hasAction, hasSorters, hasFilters, isSortColumn },
|
|
33226
33226
|
size: { syncColumnWidth },
|
|
@@ -33335,7 +33335,8 @@
|
|
|
33335
33335
|
cellRef,
|
|
33336
33336
|
ellipsisSpanRef,
|
|
33337
33337
|
isOverflow,
|
|
33338
|
-
checkWidth
|
|
33338
|
+
checkWidth,
|
|
33339
|
+
cellEmptyText
|
|
33339
33340
|
};
|
|
33340
33341
|
}
|
|
33341
33342
|
});
|
|
@@ -33425,7 +33426,7 @@
|
|
|
33425
33426
|
]),
|
|
33426
33427
|
_: 1
|
|
33427
33428
|
}, 8, ["title", "disabled"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
33428
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.displayCell), 1)
|
|
33429
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.displayCell || _ctx.cellEmptyText), 1)
|
|
33429
33430
|
], 64))
|
|
33430
33431
|
], 64))
|
|
33431
33432
|
], 64))
|
|
@@ -34964,9 +34965,22 @@
|
|
|
34964
34965
|
const handleDragStart = (e) => {
|
|
34965
34966
|
emit("dragStart", e);
|
|
34966
34967
|
};
|
|
34968
|
+
const handleTouchStart = (e) => {
|
|
34969
|
+
e.preventDefault();
|
|
34970
|
+
const touch = e.touches[0];
|
|
34971
|
+
const syntheticEvent = {
|
|
34972
|
+
...e,
|
|
34973
|
+
clientY: touch.clientY,
|
|
34974
|
+
clientX: touch.clientX,
|
|
34975
|
+
preventDefault: () => e.preventDefault(),
|
|
34976
|
+
stopPropagation: () => e.stopPropagation()
|
|
34977
|
+
};
|
|
34978
|
+
emit("dragStart", syntheticEvent);
|
|
34979
|
+
};
|
|
34967
34980
|
return {
|
|
34968
34981
|
prefixCls,
|
|
34969
|
-
handleDragStart
|
|
34982
|
+
handleDragStart,
|
|
34983
|
+
handleTouchStart
|
|
34970
34984
|
};
|
|
34971
34985
|
}
|
|
34972
34986
|
});
|
|
@@ -34975,13 +34989,14 @@
|
|
|
34975
34989
|
const _component_UIcon = vue.resolveComponent("UIcon");
|
|
34976
34990
|
return vue.openBlock(), vue.createBlock(_component_UIcon, {
|
|
34977
34991
|
class: vue.normalizeClass([`${_ctx.prefixCls}-draggable-icon`]),
|
|
34978
|
-
onMousedown: _ctx.handleDragStart
|
|
34992
|
+
onMousedown: _ctx.handleDragStart,
|
|
34993
|
+
onTouchstart: _ctx.handleTouchStart
|
|
34979
34994
|
}, {
|
|
34980
34995
|
default: vue.withCtx(() => [
|
|
34981
34996
|
vue.createVNode(_component_GripVertical)
|
|
34982
34997
|
]),
|
|
34983
34998
|
_: 1
|
|
34984
|
-
}, 8, ["class", "onMousedown"]);
|
|
34999
|
+
}, 8, ["class", "onMousedown", "onTouchstart"]);
|
|
34985
35000
|
}
|
|
34986
35001
|
var DraggableIcon = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$t], ["__file", "DraggableIcon.vue"]]);
|
|
34987
35002
|
|
|
@@ -35025,12 +35040,22 @@
|
|
|
35025
35040
|
}, {
|
|
35026
35041
|
flush: "post"
|
|
35027
35042
|
});
|
|
35043
|
+
const getClientY = (event) => {
|
|
35044
|
+
if ("touches" in event && event.touches.length > 0) {
|
|
35045
|
+
return event.touches[0].clientY;
|
|
35046
|
+
}
|
|
35047
|
+
if ("clientY" in event) {
|
|
35048
|
+
return event.clientY;
|
|
35049
|
+
}
|
|
35050
|
+
return 0;
|
|
35051
|
+
};
|
|
35028
35052
|
const setRowRefsTranslate = (event) => {
|
|
35029
35053
|
const currentRowData = rowDataMap.value[sourceRowKey];
|
|
35030
35054
|
const {
|
|
35031
35055
|
height: currentHeight
|
|
35032
35056
|
} = currentRowData.rowRef[0].value.getBoundingClientRect();
|
|
35033
|
-
const
|
|
35057
|
+
const clientY = getClientY(event);
|
|
35058
|
+
const realClientY = clientY + tableRefs.bodyTable.wrapRef.scrollTop;
|
|
35034
35059
|
const safeTranslateY = Math.max(relativeMinY, Math.min(realClientY - dragStartPosition, relativeMaxY));
|
|
35035
35060
|
currentRowData.rowRef.forEach((currentItem) => {
|
|
35036
35061
|
currentItem.value.style.transform = `translateY(${safeTranslateY}px)`;
|
|
@@ -35046,7 +35071,7 @@
|
|
|
35046
35071
|
height,
|
|
35047
35072
|
top
|
|
35048
35073
|
} = rowData.rowRef[0].value.getBoundingClientRect();
|
|
35049
|
-
const position = top + Number((height / 2).toFixed(2)) <
|
|
35074
|
+
const position = top + Number((height / 2).toFixed(2)) < clientY ? 1 : -1;
|
|
35050
35075
|
if (!(sort + position)) {
|
|
35051
35076
|
let translateY = currentHeight;
|
|
35052
35077
|
let index = Math.min(targetIndex, rowData.index);
|
|
@@ -35079,10 +35104,11 @@
|
|
|
35079
35104
|
}
|
|
35080
35105
|
};
|
|
35081
35106
|
const handleBodyScrollY = (event) => {
|
|
35082
|
-
|
|
35107
|
+
const clientY = getClientY(event);
|
|
35108
|
+
if (bodyTop + bodyHeight > clientY && clientY > bodyTop) {
|
|
35083
35109
|
clearBodyScrollY();
|
|
35084
35110
|
} else if (!scrollTimer) {
|
|
35085
|
-
const px =
|
|
35111
|
+
const px = clientY < bodyTop ? -3 : 3;
|
|
35086
35112
|
scrollTimer = setInterval(() => {
|
|
35087
35113
|
tableRefs.bodyTable.setScrollTop(Math.max(0, Math.min(tableRefs.bodyTable.wrapRef.scrollTop + px, tableHeight - bodyHeight)));
|
|
35088
35114
|
setRowRefsTranslate(event);
|
|
@@ -35095,6 +35121,13 @@
|
|
|
35095
35121
|
setRowRefsTranslate(event);
|
|
35096
35122
|
}
|
|
35097
35123
|
};
|
|
35124
|
+
const handleTouchmove = (event) => {
|
|
35125
|
+
event.preventDefault();
|
|
35126
|
+
handleBodyScrollY(event);
|
|
35127
|
+
if (!scrollTimer) {
|
|
35128
|
+
setRowRefsTranslate(event);
|
|
35129
|
+
}
|
|
35130
|
+
};
|
|
35098
35131
|
const disableWheel = (e) => {
|
|
35099
35132
|
e.preventDefault();
|
|
35100
35133
|
};
|
|
@@ -35121,11 +35154,15 @@
|
|
|
35121
35154
|
window.removeEventListener("mousemove", handleMousemove);
|
|
35122
35155
|
window.removeEventListener("mouseup", clearDrag);
|
|
35123
35156
|
window.removeEventListener("mousewheel", disableWheel);
|
|
35157
|
+
window.removeEventListener("touchmove", handleTouchmove);
|
|
35158
|
+
window.removeEventListener("touchend", clearDrag);
|
|
35159
|
+
window.removeEventListener("touchcancel", clearDrag);
|
|
35124
35160
|
};
|
|
35125
35161
|
const handleDragStart = (event, param) => {
|
|
35126
35162
|
const bodyTable = tableRefs.bodyTable.wrapRef;
|
|
35127
35163
|
sourceRowKey = param.rowKey.toString();
|
|
35128
|
-
|
|
35164
|
+
const clientY = getClientY(event);
|
|
35165
|
+
dragStartPosition = clientY + bodyTable.scrollTop;
|
|
35129
35166
|
const sortRowData = Object.values(rowDataMap.value).sort((a, b) => a.index - b.index);
|
|
35130
35167
|
const {
|
|
35131
35168
|
top
|
|
@@ -35142,12 +35179,21 @@
|
|
|
35142
35179
|
bodyTop = bodyTopInner;
|
|
35143
35180
|
bodyHeight = bodyHeightInner;
|
|
35144
35181
|
tableHeight = tableHeightInner;
|
|
35145
|
-
|
|
35182
|
+
if ("touches" in event) {
|
|
35183
|
+
handleTouchmove(event);
|
|
35184
|
+
} else {
|
|
35185
|
+
handleMousemove(event);
|
|
35186
|
+
}
|
|
35146
35187
|
window.addEventListener("mousemove", handleMousemove);
|
|
35147
35188
|
window.addEventListener("mouseup", clearDrag);
|
|
35148
35189
|
window.addEventListener("mousewheel", disableWheel, {
|
|
35149
35190
|
passive: false
|
|
35150
35191
|
});
|
|
35192
|
+
window.addEventListener("touchmove", handleTouchmove, {
|
|
35193
|
+
passive: false
|
|
35194
|
+
});
|
|
35195
|
+
window.addEventListener("touchend", clearDrag);
|
|
35196
|
+
window.addEventListener("touchcancel", clearDrag);
|
|
35151
35197
|
event.preventDefault();
|
|
35152
35198
|
};
|
|
35153
35199
|
const draggableColumn = vue.computed(() => {
|
|
@@ -35522,6 +35568,10 @@
|
|
|
35522
35568
|
skeletonRows: {
|
|
35523
35569
|
type: Number,
|
|
35524
35570
|
default: 3
|
|
35571
|
+
},
|
|
35572
|
+
cellEmptyText: {
|
|
35573
|
+
type: String,
|
|
35574
|
+
default: ""
|
|
35525
35575
|
}
|
|
35526
35576
|
};
|
|
35527
35577
|
const rowEmitFn = (data, index, e) => typeof data === "object" && typeof index === "number" && e instanceof Event;
|
|
@@ -35691,7 +35741,20 @@
|
|
|
35691
35741
|
const handleColumnResize = (columnWidth, changeWidth, column, event) => {
|
|
35692
35742
|
emit("column-resize", columnWidth, changeWidth, column, event);
|
|
35693
35743
|
};
|
|
35694
|
-
const {
|
|
35744
|
+
const {
|
|
35745
|
+
showHeader,
|
|
35746
|
+
maxHeight,
|
|
35747
|
+
expandIcon,
|
|
35748
|
+
rowClassName,
|
|
35749
|
+
indentSize,
|
|
35750
|
+
showSummary,
|
|
35751
|
+
disabledHover,
|
|
35752
|
+
expandIndent,
|
|
35753
|
+
headerSticky,
|
|
35754
|
+
loading,
|
|
35755
|
+
width,
|
|
35756
|
+
cellEmptyText
|
|
35757
|
+
} = vue.toRefs(props);
|
|
35695
35758
|
vue.provide("tableContext", {
|
|
35696
35759
|
prefixCls,
|
|
35697
35760
|
locale,
|
|
@@ -35706,6 +35769,7 @@
|
|
|
35706
35769
|
rowClassName,
|
|
35707
35770
|
indentSize,
|
|
35708
35771
|
emptyText,
|
|
35772
|
+
cellEmptyText,
|
|
35709
35773
|
showSummary,
|
|
35710
35774
|
disabledHover,
|
|
35711
35775
|
expandIndent,
|