vxe-table 3.18.0-beta.7 → 3.18.0
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/es/locale/lang/ar-EG.js +30 -0
- package/es/locale/lang/de-DE.js +30 -0
- package/es/locale/lang/en-US.js +42 -12
- package/es/locale/lang/es-ES.js +30 -0
- package/es/locale/lang/fr-FR.js +30 -0
- package/es/locale/lang/hu-HU.js +30 -0
- package/es/locale/lang/hy-AM.js +30 -0
- package/es/locale/lang/id-ID.js +30 -0
- package/es/locale/lang/it-IT.js +30 -0
- package/es/locale/lang/ja-JP.js +30 -0
- package/es/locale/lang/ko-KR.js +30 -0
- package/es/locale/lang/ms-MY.js +30 -0
- package/es/locale/lang/nb-NO.js +30 -0
- package/es/locale/lang/pt-BR.js +30 -0
- package/es/locale/lang/ru-RU.js +30 -0
- package/es/locale/lang/th-TH.js +30 -0
- package/es/locale/lang/ug-CN.js +30 -0
- package/es/locale/lang/uk-UA.js +30 -0
- package/es/locale/lang/uz-UZ.js +30 -0
- package/es/locale/lang/vi-VN.js +30 -0
- package/es/locale/lang/zh-CHT.js +30 -0
- package/es/locale/lang/zh-CN.js +32 -0
- package/es/style.css +1 -1
- package/es/table/module/keyboard/mixin.js +175 -172
- package/es/table/src/footer.js +2 -2
- package/es/table/src/header.js +2 -2
- package/es/table/src/table.js +22 -3
- package/es/table/src/util.js +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +244 -192
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +30 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +30 -0
- package/lib/locale/lang/de-DE.js +30 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +30 -0
- package/lib/locale/lang/en-US.js +42 -12
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +42 -12
- package/lib/locale/lang/es-ES.js +30 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +30 -0
- package/lib/locale/lang/fr-FR.js +30 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +30 -0
- package/lib/locale/lang/hu-HU.js +30 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +30 -0
- package/lib/locale/lang/hy-AM.js +30 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +30 -0
- package/lib/locale/lang/id-ID.js +30 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +30 -0
- package/lib/locale/lang/it-IT.js +30 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +30 -0
- package/lib/locale/lang/ja-JP.js +30 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +30 -0
- package/lib/locale/lang/ko-KR.js +30 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +30 -0
- package/lib/locale/lang/ms-MY.js +30 -0
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +30 -0
- package/lib/locale/lang/nb-NO.js +30 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +30 -0
- package/lib/locale/lang/pt-BR.js +30 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +30 -0
- package/lib/locale/lang/ru-RU.js +30 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +30 -0
- package/lib/locale/lang/th-TH.js +30 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +30 -0
- package/lib/locale/lang/ug-CN.js +30 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +30 -0
- package/lib/locale/lang/uk-UA.js +30 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +30 -0
- package/lib/locale/lang/uz-UZ.js +30 -0
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +30 -0
- package/lib/locale/lang/vi-VN.js +30 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +30 -0
- package/lib/locale/lang/zh-CHT.js +30 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +30 -0
- package/lib/locale/lang/zh-CN.js +32 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +32 -0
- package/lib/style.css +1 -1
- package/lib/table/module/keyboard/mixin.js +184 -185
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/footer.js +1 -1
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +1 -1
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +23 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +2 -2
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/locale/lang/ar-EG.ts +30 -0
- package/packages/locale/lang/de-DE.ts +30 -0
- package/packages/locale/lang/en-US.ts +42 -12
- package/packages/locale/lang/es-ES.ts +30 -0
- package/packages/locale/lang/fr-FR.ts +30 -0
- package/packages/locale/lang/hu-HU.ts +30 -0
- package/packages/locale/lang/hy-AM.ts +30 -0
- package/packages/locale/lang/id-ID.ts +30 -0
- package/packages/locale/lang/it-IT.ts +30 -0
- package/packages/locale/lang/ja-JP.ts +30 -0
- package/packages/locale/lang/ko-KR.ts +30 -0
- package/packages/locale/lang/ms-MY.ts +30 -0
- package/packages/locale/lang/nb-NO.ts +30 -0
- package/packages/locale/lang/pt-BR.ts +30 -0
- package/packages/locale/lang/ru-RU.ts +30 -0
- package/packages/locale/lang/th-TH.ts +30 -0
- package/packages/locale/lang/ug-CN.ts +30 -0
- package/packages/locale/lang/uk-UA.ts +30 -0
- package/packages/locale/lang/uz-UZ.ts +30 -0
- package/packages/locale/lang/vi-VN.ts +30 -0
- package/packages/locale/lang/zh-CHT.ts +30 -0
- package/packages/locale/lang/zh-CN.ts +32 -0
- package/packages/table/module/keyboard/mixin.ts +169 -165
- package/packages/table/src/footer.ts +2 -2
- package/packages/table/src/header.ts +2 -2
- package/packages/table/src/table.ts +23 -3
- package/packages/table/src/util.ts +1 -1
- /package/es/{iconfont.1755650997091.ttf → iconfont.1756083626568.ttf} +0 -0
- /package/es/{iconfont.1755650997091.woff → iconfont.1756083626568.woff} +0 -0
- /package/es/{iconfont.1755650997091.woff2 → iconfont.1756083626568.woff2} +0 -0
- /package/lib/{iconfont.1755650997091.ttf → iconfont.1756083626568.ttf} +0 -0
- /package/lib/{iconfont.1755650997091.woff → iconfont.1756083626568.woff} +0 -0
- /package/lib/{iconfont.1755650997091.woff2 → iconfont.1756083626568.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -2002,7 +2002,7 @@ function getClass(property, params) {
|
|
|
2002
2002
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2003
2003
|
|
|
2004
2004
|
|
|
2005
|
-
const version = "3.18.0
|
|
2005
|
+
const version = "3.18.0";
|
|
2006
2006
|
core_.VxeUI.version = version;
|
|
2007
2007
|
core_.VxeUI.tableVersion = version;
|
|
2008
2008
|
core_.VxeUI.setConfig({
|
|
@@ -2678,7 +2678,7 @@ function isNodeElement(elem) {
|
|
|
2678
2678
|
const {
|
|
2679
2679
|
log: log_log
|
|
2680
2680
|
} = core_.VxeUI;
|
|
2681
|
-
const log_version = `table v${"3.18.0
|
|
2681
|
+
const log_version = `table v${"3.18.0"}`;
|
|
2682
2682
|
const warnLog = log_log.create('warn', log_version);
|
|
2683
2683
|
const errLog = log_log.create('error', log_version);
|
|
2684
2684
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -3185,7 +3185,7 @@ function getElementMarginAndWidth(elem) {
|
|
|
3185
3185
|
}
|
|
3186
3186
|
return 0;
|
|
3187
3187
|
}
|
|
3188
|
-
function
|
|
3188
|
+
function getCalcHeight(height) {
|
|
3189
3189
|
if (height === 'unset') {
|
|
3190
3190
|
return 0;
|
|
3191
3191
|
}
|
|
@@ -19721,7 +19721,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
19721
19721
|
const cellOpts = $xeTable.computeCellOpts;
|
|
19722
19722
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
19723
19723
|
const headerCellOpts = $xeTable.computeHeaderCellOpts;
|
|
19724
|
-
const currCellHeight =
|
|
19724
|
+
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight;
|
|
19725
19725
|
const {
|
|
19726
19726
|
disabledMethod: dragDisabledMethod,
|
|
19727
19727
|
isCrossDrag,
|
|
@@ -20173,7 +20173,7 @@ function footer_renderRows(h, _vm, isOptimizeMode, tableColumn, footerTableData,
|
|
|
20173
20173
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
20174
20174
|
const cellOpts = $xeTable.computeCellOpts;
|
|
20175
20175
|
const footerCellOpts = $xeTable.computeFooterCellOpts;
|
|
20176
|
-
const currCellHeight =
|
|
20176
|
+
const currCellHeight = getCalcHeight(footerCellOpts.height) || defaultRowHeight;
|
|
20177
20177
|
return tableColumn.map((column, $columnIndex) => {
|
|
20178
20178
|
const {
|
|
20179
20179
|
type,
|
|
@@ -27122,6 +27122,182 @@ function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRigh
|
|
|
27122
27122
|
});
|
|
27123
27123
|
return params;
|
|
27124
27124
|
}
|
|
27125
|
+
function handleCheckboxRangeEvent($xeTable, evnt, params) {
|
|
27126
|
+
const internalData = $xeTable;
|
|
27127
|
+
const {
|
|
27128
|
+
elemStore
|
|
27129
|
+
} = internalData;
|
|
27130
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
27131
|
+
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
27132
|
+
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
27133
|
+
const {
|
|
27134
|
+
column,
|
|
27135
|
+
cell
|
|
27136
|
+
} = params;
|
|
27137
|
+
if (column.type === 'checkbox') {
|
|
27138
|
+
let bodyWrapperElem = bodyScrollElem;
|
|
27139
|
+
if (leftScrollElem && column.fixed === 'left') {
|
|
27140
|
+
bodyWrapperElem = leftScrollElem;
|
|
27141
|
+
} else if (rightScrollElem && column.fixed === 'right') {
|
|
27142
|
+
bodyWrapperElem = rightScrollElem;
|
|
27143
|
+
}
|
|
27144
|
+
if (!bodyWrapperElem) {
|
|
27145
|
+
return;
|
|
27146
|
+
}
|
|
27147
|
+
const el = $xeTable.$refs.refElem;
|
|
27148
|
+
const disX = evnt.clientX;
|
|
27149
|
+
const disY = evnt.clientY;
|
|
27150
|
+
const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
|
|
27151
|
+
const trElem = cell.parentNode;
|
|
27152
|
+
const selectRecords = $xeTable.getCheckboxRecords();
|
|
27153
|
+
let lastRangeRows = [];
|
|
27154
|
+
const marginSize = 1;
|
|
27155
|
+
const offsetRest = getTargetOffset(evnt.target, bodyWrapperElem);
|
|
27156
|
+
const startTop = offsetRest.offsetTop + evnt.offsetY;
|
|
27157
|
+
const startLeft = offsetRest.offsetLeft + evnt.offsetX;
|
|
27158
|
+
const startScrollTop = bodyWrapperElem.scrollTop;
|
|
27159
|
+
const rowHeight = trElem.offsetHeight;
|
|
27160
|
+
const trRect = trElem.getBoundingClientRect();
|
|
27161
|
+
const offsetClientTop = disY - trRect.y;
|
|
27162
|
+
let mouseScrollTimeout = null;
|
|
27163
|
+
let isMouseScrollDown = false;
|
|
27164
|
+
let mouseScrollSpaceSize = 1;
|
|
27165
|
+
const triggerEvent = (type, evnt) => {
|
|
27166
|
+
$xeTable.dispatchEvent(`checkbox-range-${type}`, {
|
|
27167
|
+
records: () => $xeTable.getCheckboxRecords(),
|
|
27168
|
+
reserves: () => $xeTable.getCheckboxReserveRecords()
|
|
27169
|
+
}, evnt);
|
|
27170
|
+
};
|
|
27171
|
+
const handleChecked = evnt => {
|
|
27172
|
+
const {
|
|
27173
|
+
clientX,
|
|
27174
|
+
clientY
|
|
27175
|
+
} = evnt;
|
|
27176
|
+
const offsetLeft = clientX - disX;
|
|
27177
|
+
const offsetTop = clientY - disY + (bodyWrapperElem.scrollTop - startScrollTop);
|
|
27178
|
+
let rangeHeight = Math.abs(offsetTop);
|
|
27179
|
+
let rangeWidth = Math.abs(offsetLeft);
|
|
27180
|
+
let rangeTop = startTop;
|
|
27181
|
+
let rangeLeft = startLeft;
|
|
27182
|
+
if (offsetTop < marginSize) {
|
|
27183
|
+
// 向上
|
|
27184
|
+
rangeTop += offsetTop;
|
|
27185
|
+
if (rangeTop < marginSize) {
|
|
27186
|
+
rangeTop = marginSize;
|
|
27187
|
+
rangeHeight = startTop;
|
|
27188
|
+
}
|
|
27189
|
+
} else {
|
|
27190
|
+
// 向下
|
|
27191
|
+
rangeHeight = Math.min(rangeHeight, bodyWrapperElem.scrollHeight - startTop - marginSize);
|
|
27192
|
+
}
|
|
27193
|
+
if (offsetLeft < marginSize) {
|
|
27194
|
+
// 向左
|
|
27195
|
+
rangeLeft += offsetLeft;
|
|
27196
|
+
if (rangeWidth > startLeft) {
|
|
27197
|
+
rangeLeft = marginSize;
|
|
27198
|
+
rangeWidth = startLeft;
|
|
27199
|
+
}
|
|
27200
|
+
} else {
|
|
27201
|
+
// 向右
|
|
27202
|
+
rangeWidth = Math.min(rangeWidth, bodyWrapperElem.clientWidth - startLeft - marginSize);
|
|
27203
|
+
}
|
|
27204
|
+
checkboxRangeElem.style.height = `${rangeHeight}px`;
|
|
27205
|
+
checkboxRangeElem.style.width = `${rangeWidth}px`;
|
|
27206
|
+
checkboxRangeElem.style.left = `${rangeLeft}px`;
|
|
27207
|
+
checkboxRangeElem.style.top = `${rangeTop}px`;
|
|
27208
|
+
checkboxRangeElem.style.display = 'block';
|
|
27209
|
+
const rangeRows = getCheckboxRangeRows($xeTable, evnt, params, trElem, trRect, offsetClientTop, offsetTop < marginSize ? -rangeHeight : rangeHeight);
|
|
27210
|
+
// 至少滑动 10px 才能有效匹配
|
|
27211
|
+
if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
|
|
27212
|
+
const isControlKey = hasControlKey(evnt);
|
|
27213
|
+
lastRangeRows = rangeRows;
|
|
27214
|
+
if (isControlKey) {
|
|
27215
|
+
rangeRows.forEach(row => {
|
|
27216
|
+
$xeTable.handleBatchSelectRows([row], selectRecords.indexOf(row) === -1);
|
|
27217
|
+
});
|
|
27218
|
+
} else {
|
|
27219
|
+
$xeTable.setAllCheckboxRow(false);
|
|
27220
|
+
$xeTable.handleCheckedCheckboxRow(rangeRows, true, false);
|
|
27221
|
+
}
|
|
27222
|
+
triggerEvent('change', evnt);
|
|
27223
|
+
}
|
|
27224
|
+
};
|
|
27225
|
+
// 停止鼠标滚动
|
|
27226
|
+
const stopMouseScroll = () => {
|
|
27227
|
+
clearTimeout(mouseScrollTimeout);
|
|
27228
|
+
mouseScrollTimeout = null;
|
|
27229
|
+
};
|
|
27230
|
+
// 开始鼠标滚动
|
|
27231
|
+
const startMouseScroll = evnt => {
|
|
27232
|
+
stopMouseScroll();
|
|
27233
|
+
mouseScrollTimeout = setTimeout(() => {
|
|
27234
|
+
if (mouseScrollTimeout) {
|
|
27235
|
+
const {
|
|
27236
|
+
scrollLeft,
|
|
27237
|
+
scrollTop,
|
|
27238
|
+
clientHeight,
|
|
27239
|
+
scrollHeight
|
|
27240
|
+
} = bodyWrapperElem;
|
|
27241
|
+
const topSize = Math.ceil(mouseScrollSpaceSize * 50 / rowHeight);
|
|
27242
|
+
if (isMouseScrollDown) {
|
|
27243
|
+
if (scrollTop + clientHeight < scrollHeight) {
|
|
27244
|
+
$xeTable.scrollTo(scrollLeft, scrollTop + topSize);
|
|
27245
|
+
startMouseScroll(evnt);
|
|
27246
|
+
handleChecked(evnt);
|
|
27247
|
+
} else {
|
|
27248
|
+
stopMouseScroll();
|
|
27249
|
+
}
|
|
27250
|
+
} else {
|
|
27251
|
+
if (scrollTop) {
|
|
27252
|
+
$xeTable.scrollTo(scrollLeft, scrollTop - topSize);
|
|
27253
|
+
startMouseScroll(evnt);
|
|
27254
|
+
handleChecked(evnt);
|
|
27255
|
+
} else {
|
|
27256
|
+
stopMouseScroll();
|
|
27257
|
+
}
|
|
27258
|
+
}
|
|
27259
|
+
}
|
|
27260
|
+
}, 50);
|
|
27261
|
+
};
|
|
27262
|
+
addClass(el, 'drag--range');
|
|
27263
|
+
document.onmousemove = evnt => {
|
|
27264
|
+
evnt.preventDefault();
|
|
27265
|
+
evnt.stopPropagation();
|
|
27266
|
+
const {
|
|
27267
|
+
clientY
|
|
27268
|
+
} = evnt;
|
|
27269
|
+
const {
|
|
27270
|
+
boundingTop
|
|
27271
|
+
} = getAbsolutePos(bodyWrapperElem);
|
|
27272
|
+
// 如果超过可视区,触发滚动
|
|
27273
|
+
if (clientY < boundingTop) {
|
|
27274
|
+
isMouseScrollDown = false;
|
|
27275
|
+
mouseScrollSpaceSize = boundingTop - clientY;
|
|
27276
|
+
if (!mouseScrollTimeout) {
|
|
27277
|
+
startMouseScroll(evnt);
|
|
27278
|
+
}
|
|
27279
|
+
} else if (clientY > boundingTop + bodyWrapperElem.clientHeight) {
|
|
27280
|
+
isMouseScrollDown = true;
|
|
27281
|
+
mouseScrollSpaceSize = clientY - boundingTop - bodyWrapperElem.clientHeight;
|
|
27282
|
+
if (!mouseScrollTimeout) {
|
|
27283
|
+
startMouseScroll(evnt);
|
|
27284
|
+
}
|
|
27285
|
+
} else if (mouseScrollTimeout) {
|
|
27286
|
+
stopMouseScroll();
|
|
27287
|
+
}
|
|
27288
|
+
handleChecked(evnt);
|
|
27289
|
+
};
|
|
27290
|
+
document.onmouseup = evnt => {
|
|
27291
|
+
stopMouseScroll();
|
|
27292
|
+
removeClass(el, 'drag--range');
|
|
27293
|
+
checkboxRangeElem.removeAttribute('style');
|
|
27294
|
+
document.onmousemove = null;
|
|
27295
|
+
document.onmouseup = null;
|
|
27296
|
+
triggerEvent('end', evnt);
|
|
27297
|
+
};
|
|
27298
|
+
triggerEvent('start', evnt);
|
|
27299
|
+
}
|
|
27300
|
+
}
|
|
27125
27301
|
/* harmony default export */ var keyboard_mixin = ({
|
|
27126
27302
|
methods: {
|
|
27127
27303
|
// 处理 Tab 键移动
|
|
@@ -27352,204 +27528,27 @@ function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRigh
|
|
|
27352
27528
|
},
|
|
27353
27529
|
handleCellMousedownEvent(evnt, params) {
|
|
27354
27530
|
const $xeTable = this;
|
|
27531
|
+
const props = $xeTable;
|
|
27355
27532
|
const {
|
|
27356
27533
|
editConfig,
|
|
27357
|
-
editOpts,
|
|
27358
|
-
handleSelected,
|
|
27359
27534
|
checkboxConfig,
|
|
27360
|
-
|
|
27361
|
-
|
|
27362
|
-
|
|
27363
|
-
|
|
27535
|
+
mouseConfig
|
|
27536
|
+
} = props;
|
|
27537
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
27538
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
27539
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
27364
27540
|
if (mouseConfig && mouseOpts.area && $xeTable.triggerCellAreaModnEvent) {
|
|
27365
27541
|
return $xeTable.triggerCellAreaModnEvent(evnt, params);
|
|
27366
27542
|
} else {
|
|
27367
27543
|
if (checkboxConfig && checkboxOpts.range) {
|
|
27368
|
-
|
|
27544
|
+
handleCheckboxRangeEvent($xeTable, evnt, params);
|
|
27369
27545
|
}
|
|
27370
27546
|
if (mouseConfig && mouseOpts.selected) {
|
|
27371
27547
|
if (!editConfig || editOpts.mode === 'cell') {
|
|
27372
|
-
handleSelected(params, evnt);
|
|
27548
|
+
$xeTable.handleSelected(params, evnt);
|
|
27373
27549
|
}
|
|
27374
27550
|
}
|
|
27375
27551
|
}
|
|
27376
|
-
},
|
|
27377
|
-
handleCheckboxRangeEvent(evnt, params) {
|
|
27378
|
-
const $xeTable = this;
|
|
27379
|
-
const internalData = $xeTable;
|
|
27380
|
-
const {
|
|
27381
|
-
elemStore
|
|
27382
|
-
} = internalData;
|
|
27383
|
-
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
27384
|
-
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
27385
|
-
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
27386
|
-
const {
|
|
27387
|
-
column,
|
|
27388
|
-
cell
|
|
27389
|
-
} = params;
|
|
27390
|
-
if (column.type === 'checkbox') {
|
|
27391
|
-
let bodyWrapperElem = bodyScrollElem;
|
|
27392
|
-
if (leftScrollElem && column.fixed === 'left') {
|
|
27393
|
-
bodyWrapperElem = leftScrollElem;
|
|
27394
|
-
} else if (rightScrollElem && column.fixed === 'right') {
|
|
27395
|
-
bodyWrapperElem = rightScrollElem;
|
|
27396
|
-
}
|
|
27397
|
-
if (!bodyWrapperElem) {
|
|
27398
|
-
return;
|
|
27399
|
-
}
|
|
27400
|
-
const el = $xeTable.$refs.refElem;
|
|
27401
|
-
const disX = evnt.clientX;
|
|
27402
|
-
const disY = evnt.clientY;
|
|
27403
|
-
const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
|
|
27404
|
-
const trElem = cell.parentNode;
|
|
27405
|
-
const selectRecords = this.getCheckboxRecords();
|
|
27406
|
-
let lastRangeRows = [];
|
|
27407
|
-
const marginSize = 1;
|
|
27408
|
-
const offsetRest = getTargetOffset(evnt.target, bodyWrapperElem);
|
|
27409
|
-
const startTop = offsetRest.offsetTop + evnt.offsetY;
|
|
27410
|
-
const startLeft = offsetRest.offsetLeft + evnt.offsetX;
|
|
27411
|
-
const startScrollTop = bodyWrapperElem.scrollTop;
|
|
27412
|
-
const rowHeight = trElem.offsetHeight;
|
|
27413
|
-
const trRect = trElem.getBoundingClientRect();
|
|
27414
|
-
const offsetClientTop = disY - trRect.y;
|
|
27415
|
-
let mouseScrollTimeout = null;
|
|
27416
|
-
let isMouseScrollDown = false;
|
|
27417
|
-
let mouseScrollSpaceSize = 1;
|
|
27418
|
-
const triggerEvent = (type, evnt) => {
|
|
27419
|
-
this.emitEvent(`checkbox-range-${type}`, {
|
|
27420
|
-
records: () => this.getCheckboxRecords(),
|
|
27421
|
-
reserves: () => this.getCheckboxReserveRecords()
|
|
27422
|
-
}, evnt);
|
|
27423
|
-
};
|
|
27424
|
-
const handleChecked = evnt => {
|
|
27425
|
-
const {
|
|
27426
|
-
clientX,
|
|
27427
|
-
clientY
|
|
27428
|
-
} = evnt;
|
|
27429
|
-
const offsetLeft = clientX - disX;
|
|
27430
|
-
const offsetTop = clientY - disY + (bodyWrapperElem.scrollTop - startScrollTop);
|
|
27431
|
-
let rangeHeight = Math.abs(offsetTop);
|
|
27432
|
-
let rangeWidth = Math.abs(offsetLeft);
|
|
27433
|
-
let rangeTop = startTop;
|
|
27434
|
-
let rangeLeft = startLeft;
|
|
27435
|
-
if (offsetTop < marginSize) {
|
|
27436
|
-
// 向上
|
|
27437
|
-
rangeTop += offsetTop;
|
|
27438
|
-
if (rangeTop < marginSize) {
|
|
27439
|
-
rangeTop = marginSize;
|
|
27440
|
-
rangeHeight = startTop;
|
|
27441
|
-
}
|
|
27442
|
-
} else {
|
|
27443
|
-
// 向下
|
|
27444
|
-
rangeHeight = Math.min(rangeHeight, bodyWrapperElem.scrollHeight - startTop - marginSize);
|
|
27445
|
-
}
|
|
27446
|
-
if (offsetLeft < marginSize) {
|
|
27447
|
-
// 向左
|
|
27448
|
-
rangeLeft += offsetLeft;
|
|
27449
|
-
if (rangeWidth > startLeft) {
|
|
27450
|
-
rangeLeft = marginSize;
|
|
27451
|
-
rangeWidth = startLeft;
|
|
27452
|
-
}
|
|
27453
|
-
} else {
|
|
27454
|
-
// 向右
|
|
27455
|
-
rangeWidth = Math.min(rangeWidth, bodyWrapperElem.clientWidth - startLeft - marginSize);
|
|
27456
|
-
}
|
|
27457
|
-
checkboxRangeElem.style.height = `${rangeHeight}px`;
|
|
27458
|
-
checkboxRangeElem.style.width = `${rangeWidth}px`;
|
|
27459
|
-
checkboxRangeElem.style.left = `${rangeLeft}px`;
|
|
27460
|
-
checkboxRangeElem.style.top = `${rangeTop}px`;
|
|
27461
|
-
checkboxRangeElem.style.display = 'block';
|
|
27462
|
-
const rangeRows = getCheckboxRangeRows(this, evnt, params, trElem, trRect, offsetClientTop, offsetTop < marginSize ? -rangeHeight : rangeHeight);
|
|
27463
|
-
// 至少滑动 10px 才能有效匹配
|
|
27464
|
-
if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
|
|
27465
|
-
const isControlKey = hasControlKey(evnt);
|
|
27466
|
-
lastRangeRows = rangeRows;
|
|
27467
|
-
if (isControlKey) {
|
|
27468
|
-
rangeRows.forEach(row => {
|
|
27469
|
-
$xeTable.handleBatchSelectRows([row], selectRecords.indexOf(row) === -1);
|
|
27470
|
-
});
|
|
27471
|
-
} else {
|
|
27472
|
-
this.setAllCheckboxRow(false);
|
|
27473
|
-
this.handleCheckedCheckboxRow(rangeRows, true, false);
|
|
27474
|
-
}
|
|
27475
|
-
triggerEvent('change', evnt);
|
|
27476
|
-
}
|
|
27477
|
-
};
|
|
27478
|
-
// 停止鼠标滚动
|
|
27479
|
-
const stopMouseScroll = () => {
|
|
27480
|
-
clearTimeout(mouseScrollTimeout);
|
|
27481
|
-
mouseScrollTimeout = null;
|
|
27482
|
-
};
|
|
27483
|
-
// 开始鼠标滚动
|
|
27484
|
-
const startMouseScroll = evnt => {
|
|
27485
|
-
stopMouseScroll();
|
|
27486
|
-
mouseScrollTimeout = setTimeout(() => {
|
|
27487
|
-
if (mouseScrollTimeout) {
|
|
27488
|
-
const {
|
|
27489
|
-
scrollLeft,
|
|
27490
|
-
scrollTop,
|
|
27491
|
-
clientHeight,
|
|
27492
|
-
scrollHeight
|
|
27493
|
-
} = bodyWrapperElem;
|
|
27494
|
-
const topSize = Math.ceil(mouseScrollSpaceSize * 50 / rowHeight);
|
|
27495
|
-
if (isMouseScrollDown) {
|
|
27496
|
-
if (scrollTop + clientHeight < scrollHeight) {
|
|
27497
|
-
this.scrollTo(scrollLeft, scrollTop + topSize);
|
|
27498
|
-
startMouseScroll(evnt);
|
|
27499
|
-
handleChecked(evnt);
|
|
27500
|
-
} else {
|
|
27501
|
-
stopMouseScroll();
|
|
27502
|
-
}
|
|
27503
|
-
} else {
|
|
27504
|
-
if (scrollTop) {
|
|
27505
|
-
this.scrollTo(scrollLeft, scrollTop - topSize);
|
|
27506
|
-
startMouseScroll(evnt);
|
|
27507
|
-
handleChecked(evnt);
|
|
27508
|
-
} else {
|
|
27509
|
-
stopMouseScroll();
|
|
27510
|
-
}
|
|
27511
|
-
}
|
|
27512
|
-
}
|
|
27513
|
-
}, 50);
|
|
27514
|
-
};
|
|
27515
|
-
addClass(el, 'drag--range');
|
|
27516
|
-
document.onmousemove = evnt => {
|
|
27517
|
-
evnt.preventDefault();
|
|
27518
|
-
evnt.stopPropagation();
|
|
27519
|
-
const {
|
|
27520
|
-
clientY
|
|
27521
|
-
} = evnt;
|
|
27522
|
-
const {
|
|
27523
|
-
boundingTop
|
|
27524
|
-
} = getAbsolutePos(bodyWrapperElem);
|
|
27525
|
-
// 如果超过可视区,触发滚动
|
|
27526
|
-
if (clientY < boundingTop) {
|
|
27527
|
-
isMouseScrollDown = false;
|
|
27528
|
-
mouseScrollSpaceSize = boundingTop - clientY;
|
|
27529
|
-
if (!mouseScrollTimeout) {
|
|
27530
|
-
startMouseScroll(evnt);
|
|
27531
|
-
}
|
|
27532
|
-
} else if (clientY > boundingTop + bodyWrapperElem.clientHeight) {
|
|
27533
|
-
isMouseScrollDown = true;
|
|
27534
|
-
mouseScrollSpaceSize = clientY - boundingTop - bodyWrapperElem.clientHeight;
|
|
27535
|
-
if (!mouseScrollTimeout) {
|
|
27536
|
-
startMouseScroll(evnt);
|
|
27537
|
-
}
|
|
27538
|
-
} else if (mouseScrollTimeout) {
|
|
27539
|
-
stopMouseScroll();
|
|
27540
|
-
}
|
|
27541
|
-
handleChecked(evnt);
|
|
27542
|
-
};
|
|
27543
|
-
document.onmouseup = evnt => {
|
|
27544
|
-
stopMouseScroll();
|
|
27545
|
-
removeClass(el, 'drag--range');
|
|
27546
|
-
checkboxRangeElem.removeAttribute('style');
|
|
27547
|
-
document.onmousemove = null;
|
|
27548
|
-
document.onmouseup = null;
|
|
27549
|
-
triggerEvent('end', evnt);
|
|
27550
|
-
};
|
|
27551
|
-
triggerEvent('start', evnt);
|
|
27552
|
-
}
|
|
27553
27552
|
}
|
|
27554
27553
|
}
|
|
27555
27554
|
});
|
|
@@ -29557,10 +29556,20 @@ function renderBody(h, $xeTable) {
|
|
|
29557
29556
|
},
|
|
29558
29557
|
computeHeaderCellOpts() {
|
|
29559
29558
|
const $xeTable = this;
|
|
29559
|
+
const $xeGantt = $xeTable.$xeGantt;
|
|
29560
29560
|
const props = $xeTable;
|
|
29561
29561
|
const headerCellOpts = Object.assign({}, table_getConfig().table.headerCellConfig, props.headerCellConfig);
|
|
29562
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
29562
29563
|
const cellOpts = $xeTable.computeCellOpts;
|
|
29563
|
-
|
|
29564
|
+
let headCellHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCalcHeight(headerCellOpts.height || cellOpts.height));
|
|
29565
|
+
if ($xeGantt) {
|
|
29566
|
+
const taskScaleConfs = $xeGantt.computeTaskScaleConfs;
|
|
29567
|
+
if (taskScaleConfs && taskScaleConfs.length > 2) {
|
|
29568
|
+
const ganttMinHeadCellHeight = defaultRowHeight / 2 * taskScaleConfs.length;
|
|
29569
|
+
headCellHeight = Math.max(ganttMinHeadCellHeight, headCellHeight);
|
|
29570
|
+
}
|
|
29571
|
+
}
|
|
29572
|
+
headerCellOpts.height = headCellHeight;
|
|
29564
29573
|
return headerCellOpts;
|
|
29565
29574
|
},
|
|
29566
29575
|
computeFooterCellOpts() {
|
|
@@ -29568,7 +29577,7 @@ function renderBody(h, $xeTable) {
|
|
|
29568
29577
|
const props = $xeTable;
|
|
29569
29578
|
const footerCellOpts = Object.assign({}, table_getConfig().table.footerCellConfig, props.footerCellConfig);
|
|
29570
29579
|
const cellOpts = $xeTable.computeCellOpts;
|
|
29571
|
-
footerCellOpts.height = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(
|
|
29580
|
+
footerCellOpts.height = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCalcHeight(footerCellOpts.height || cellOpts.height));
|
|
29572
29581
|
return footerCellOpts;
|
|
29573
29582
|
},
|
|
29574
29583
|
rowOpts() {
|
|
@@ -30542,6 +30551,17 @@ function renderBody(h, $xeTable) {
|
|
|
30542
30551
|
this.preventEvent(null, 'activated');
|
|
30543
30552
|
},
|
|
30544
30553
|
deactivated() {
|
|
30554
|
+
const $xeTable = this;
|
|
30555
|
+
const reactData = $xeTable;
|
|
30556
|
+
const internalData = $xeTable;
|
|
30557
|
+
const {
|
|
30558
|
+
filterStore
|
|
30559
|
+
} = reactData;
|
|
30560
|
+
if (filterStore.visible) {
|
|
30561
|
+
$xeTable.clearFilter();
|
|
30562
|
+
}
|
|
30563
|
+
$xeTable.closeTooltip();
|
|
30564
|
+
internalData.isActivated = false;
|
|
30545
30565
|
this.preventEvent(null, 'deactivated');
|
|
30546
30566
|
},
|
|
30547
30567
|
beforeDestroy() {
|
|
@@ -35189,6 +35209,7 @@ const Toolbar = VxeToolbar;
|
|
|
35189
35209
|
coverProp: '"{0}" 的参数 "{1}" 重复定义,这可能会出现错误',
|
|
35190
35210
|
uniField: '字段名 "{0}" 重复定义,这可能会出现错误',
|
|
35191
35211
|
repeatKey: '主键重复 {0}="{1}",这可能会出现错误',
|
|
35212
|
+
repeatProp: '参数重复 {0}="{1}",这可能会出现错误',
|
|
35192
35213
|
delFunc: '方法 "{0}" 已废弃,请使用 "{1}"',
|
|
35193
35214
|
delProp: '参数 "{0}" 已废弃,请使用 "{1}"',
|
|
35194
35215
|
delEvent: '事件 "{0}" 已废弃,请使用 "{1}"',
|
|
@@ -35681,6 +35702,37 @@ const Toolbar = VxeToolbar;
|
|
|
35681
35702
|
ss: '秒'
|
|
35682
35703
|
}
|
|
35683
35704
|
},
|
|
35705
|
+
gantt: {
|
|
35706
|
+
tFullFormat: {
|
|
35707
|
+
year: '{yy}年',
|
|
35708
|
+
quarter: '{yy}年第{q}季度',
|
|
35709
|
+
month: '{yy}年{M}月',
|
|
35710
|
+
week: '{yy}年第{W}周',
|
|
35711
|
+
day: '{yy}年{M}月{E}日',
|
|
35712
|
+
date: '{yy}年{M}月{d}日',
|
|
35713
|
+
hour: '{yy}年 {M}月{d}日{H}时',
|
|
35714
|
+
minute: '{yy}年{M}月{d}日{H}时{m}分'
|
|
35715
|
+
},
|
|
35716
|
+
tSimpleFormat: {
|
|
35717
|
+
year: '{yy}年',
|
|
35718
|
+
quarter: '{q}季度',
|
|
35719
|
+
month: '{M}月',
|
|
35720
|
+
week: '{W}周',
|
|
35721
|
+
day: '{d}',
|
|
35722
|
+
date: '{d}',
|
|
35723
|
+
hour: '{H}时',
|
|
35724
|
+
minute: '{m}分'
|
|
35725
|
+
},
|
|
35726
|
+
dayss: {
|
|
35727
|
+
w0: '日',
|
|
35728
|
+
w1: '一',
|
|
35729
|
+
w2: '二',
|
|
35730
|
+
w3: '三',
|
|
35731
|
+
w4: '四',
|
|
35732
|
+
w5: '五',
|
|
35733
|
+
w6: '六'
|
|
35734
|
+
}
|
|
35735
|
+
},
|
|
35684
35736
|
plugins: {
|
|
35685
35737
|
extendCellArea: {
|
|
35686
35738
|
area: {
|