@visactor/vtable-gantt 1.26.6 → 1.26.7
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/cjs/components/MenuElementStyle.js +1 -2
- package/cjs/event/touch.js +1 -0
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/timeline-header.js +1 -2
- package/cjs/state/gantt-table-sync.js +1 -0
- package/dist/vtable-gantt.js +841 -324
- package/dist/vtable-gantt.min.js +1 -1
- package/es/components/MenuElementStyle.js +1 -2
- package/es/event/touch.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/timeline-header.js +1 -2
- package/es/state/gantt-table-sync.js +2 -1
- package/package.json +3 -3
package/dist/vtable-gantt.js
CHANGED
|
@@ -44707,6 +44707,7 @@
|
|
|
44707
44707
|
MOUSELEAVE_CELL: "mouseleave_cell",
|
|
44708
44708
|
CONTEXTMENU_CELL: "contextmenu_cell",
|
|
44709
44709
|
CONTEXTMENU_CANVAS: "contextmenu_canvas",
|
|
44710
|
+
CONTEXT_MENU_CLICK: "context_menu_click",
|
|
44710
44711
|
RESIZE_COLUMN: "resize_column",
|
|
44711
44712
|
RESIZE_COLUMN_END: "resize_column_end",
|
|
44712
44713
|
RESIZE_ROW: "resize_row",
|
|
@@ -53942,7 +53943,61 @@
|
|
|
53942
53943
|
}
|
|
53943
53944
|
}
|
|
53944
53945
|
|
|
53945
|
-
|
|
53946
|
+
const CELL_MEDIA_KEY = "__vtable_cell_media__";
|
|
53947
|
+
const CELL_MEDIA_KIND_KEY = "__vtable_cell_media_kind__";
|
|
53948
|
+
function markCellMedia(graphic, kind) {
|
|
53949
|
+
return graphic[CELL_MEDIA_KEY] = !0, graphic[CELL_MEDIA_KIND_KEY] = kind, graphic;
|
|
53950
|
+
}
|
|
53951
|
+
function isCellMedia(graphic) {
|
|
53952
|
+
return !0 === (null == graphic ? void 0 : graphic[CELL_MEDIA_KEY]);
|
|
53953
|
+
}
|
|
53954
|
+
function getCellMediaChildren(cellGroup) {
|
|
53955
|
+
const mediaChildren = [];
|
|
53956
|
+
return cellGroup.forEachChildren(child => {
|
|
53957
|
+
isCellMedia(child) && mediaChildren.push(child);
|
|
53958
|
+
}), mediaChildren;
|
|
53959
|
+
}
|
|
53960
|
+
function getCellMediaByKind(cellGroup, kind) {
|
|
53961
|
+
let graphic;
|
|
53962
|
+
return cellGroup.forEachChildren(child => !(!isCellMedia(child) || child[CELL_MEDIA_KIND_KEY] !== kind) && (graphic = child, !0)), graphic;
|
|
53963
|
+
}
|
|
53964
|
+
function getCellMediaImage(cellGroup) {
|
|
53965
|
+
return getCellMediaByKind(cellGroup, "image");
|
|
53966
|
+
}
|
|
53967
|
+
function getCellMediaPlayIcon(cellGroup) {
|
|
53968
|
+
return getCellMediaByKind(cellGroup, "play-icon");
|
|
53969
|
+
}
|
|
53970
|
+
function releaseVideoResource(video) {
|
|
53971
|
+
try {
|
|
53972
|
+
video.pause();
|
|
53973
|
+
} catch (err) {}
|
|
53974
|
+
video.removeAttribute("src");
|
|
53975
|
+
try {
|
|
53976
|
+
video.load();
|
|
53977
|
+
} catch (err) {}
|
|
53978
|
+
}
|
|
53979
|
+
function releaseGraphicMediaResource(graphic) {
|
|
53980
|
+
var _a;
|
|
53981
|
+
const source = null === (_a = null == graphic ? void 0 : graphic.attribute) || void 0 === _a ? void 0 : _a.image;
|
|
53982
|
+
"undefined" != typeof HTMLVideoElement && source instanceof HTMLVideoElement && releaseVideoResource(source);
|
|
53983
|
+
}
|
|
53984
|
+
function removeCellMediaChildren(cellGroup) {
|
|
53985
|
+
getCellMediaChildren(cellGroup).forEach(child => {
|
|
53986
|
+
var _a;
|
|
53987
|
+
releaseGraphicMediaResource(child), cellGroup.removeChild(child), null === (_a = child.release) || void 0 === _a || _a.call(child);
|
|
53988
|
+
});
|
|
53989
|
+
}
|
|
53990
|
+
|
|
53991
|
+
function hasCellMedia(cellGroup) {
|
|
53992
|
+
return getCellMediaChildren(cellGroup).length > 0;
|
|
53993
|
+
}
|
|
53994
|
+
function getResizeImage(cellGroup) {
|
|
53995
|
+
return hasCellMedia(cellGroup) ? getCellMediaImage(cellGroup) : void 0;
|
|
53996
|
+
}
|
|
53997
|
+
function getResizePlayIcon(cellGroup) {
|
|
53998
|
+
return hasCellMedia(cellGroup) ? getCellMediaPlayIcon(cellGroup) : void 0;
|
|
53999
|
+
}
|
|
54000
|
+
function createImageCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync, cellValue) {
|
|
53946
54001
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
53947
54002
|
const headerStyle = table._getCellStyle(col, row),
|
|
53948
54003
|
functionalPadding = getFunctionalProp("padding", headerStyle, col, row, table);
|
|
@@ -53998,17 +54053,19 @@
|
|
|
53998
54053
|
"icon-left" === child.role ? child.setAttribute("x", child.attribute.x + padding[3]) : "icon-right" === child.role ? child.setAttribute("x", child.attribute.x + width - rightIconWidth - padding[1]) : "icon-absolute-right" === child.role && child.setAttribute("x", child.attribute.x + width - absoluteRightIconWidth - padding[1]);
|
|
53999
54054
|
}), cellGroup.forEachChildren(child => {
|
|
54000
54055
|
"middle" === textBaseline ? child.setAttribute("y", (height - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", height - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]);
|
|
54001
|
-
}), cellGroup._cellLeftIconWidth = cellLeftIconWidth, cellGroup._cellRightIconWidth = cellRightIconWidth;
|
|
54002
|
-
}
|
|
54003
|
-
const value = table.getCellValue(col, row),
|
|
54004
|
-
image = createImage({
|
|
54005
|
-
x: padding[3],
|
|
54006
|
-
y: padding[0],
|
|
54007
|
-
width: width - padding[1] - padding[3] - iconWidth,
|
|
54008
|
-
height: height - padding[0] - padding[2],
|
|
54009
|
-
image: value,
|
|
54010
|
-
cursor: "pointer"
|
|
54011
54056
|
});
|
|
54057
|
+
}
|
|
54058
|
+
cellGroup._cellLeftIconWidth = cellLeftIconWidth, cellGroup._cellRightIconWidth = cellRightIconWidth;
|
|
54059
|
+
const value = arguments.length >= 18 ? cellValue : table.getCellValue(col, row);
|
|
54060
|
+
removeCellMediaChildren(cellGroup);
|
|
54061
|
+
const image = markCellMedia(createImage({
|
|
54062
|
+
x: padding[3],
|
|
54063
|
+
y: padding[0],
|
|
54064
|
+
width: width - padding[1] - padding[3] - iconWidth,
|
|
54065
|
+
height: height - padding[0] - padding[2],
|
|
54066
|
+
image: value,
|
|
54067
|
+
cursor: "pointer"
|
|
54068
|
+
}), "image");
|
|
54012
54069
|
if (image.name = "image", image.keepAspectRatio = keepAspectRatio, image.textAlign = textAlign, image.textBaseline = textBaseline, keepAspectRatio || imageAutoSizing ? image.resources && image.resources.has(image.attribute.image) && "success" === image.resources.get(image.attribute.image).state ? (image.setAttribute("opacity", 0), setTimeout(() => {
|
|
54013
54070
|
image.setAttribute("opacity", 1), updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table), table.scenegraph.updateNextFrame();
|
|
54014
54071
|
}, 0)) : image.successCallback = () => {
|
|
@@ -54042,10 +54099,10 @@
|
|
|
54042
54099
|
}
|
|
54043
54100
|
function updateImageCellContentWhileResize(cellGroup, col, row, deltaX, deltaY, table) {
|
|
54044
54101
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
54045
|
-
const image = cellGroup
|
|
54102
|
+
const image = getResizeImage(cellGroup);
|
|
54046
54103
|
if (!image) return;
|
|
54047
54104
|
const originImage = "string" != typeof image.attribute.image && image.attribute.image || (null === (_a = image.resources) || void 0 === _a ? void 0 : _a.get(image.attribute.image).data);
|
|
54048
|
-
if (!originImage) return;
|
|
54105
|
+
if (!originImage && !image.isAudioIcon) return;
|
|
54049
54106
|
const headerStyle = table._getCellStyle(col, row),
|
|
54050
54107
|
textAlign = null !== (_b = getProp("textAlign", headerStyle, col, row, table)) && void 0 !== _b ? _b : "left",
|
|
54051
54108
|
textBaseline = null !== (_c = getProp("textBaseline", headerStyle, col, row, table)) && void 0 !== _c ? _c : "middle";
|
|
@@ -54059,17 +54116,31 @@
|
|
|
54059
54116
|
colStart = null !== (_g = cellGroup.mergeStartCol) && void 0 !== _g ? _g : cellGroup.col,
|
|
54060
54117
|
rowStart = null !== (_h = cellGroup.mergeStartRow) && void 0 !== _h ? _h : cellGroup.row,
|
|
54061
54118
|
colEnd = null !== (_j = cellGroup.mergeEndCol) && void 0 !== _j ? _j : cellGroup.col,
|
|
54062
|
-
rowEnd = null !== (_k = cellGroup.
|
|
54119
|
+
rowEnd = null !== (_k = cellGroup.mergeEndRow) && void 0 !== _k ? _k : cellGroup.row,
|
|
54063
54120
|
leftIconWidth = null !== (_l = cellGroup._cellLeftIconWidth) && void 0 !== _l ? _l : 0,
|
|
54064
54121
|
rightIconWidth = null !== (_m = cellGroup._cellRightIconWidth) && void 0 !== _m ? _m : 0;
|
|
54065
|
-
if (image.
|
|
54122
|
+
if (image.isAudioIcon) {
|
|
54123
|
+
const availableWidth = Math.max(1, cellWidth - padding[1] - padding[3] - leftIconWidth - rightIconWidth),
|
|
54124
|
+
availableHeight = Math.max(1, cellHeight - padding[0] - padding[2]),
|
|
54125
|
+
iconSize = Math.max(1, Math.min(availableWidth, availableHeight, 32)),
|
|
54126
|
+
pos = calcStartPosition(leftIconWidth, 0, cellWidth - leftIconWidth - rightIconWidth, cellHeight, iconSize, iconSize, textAlign, textBaseline, padding);
|
|
54127
|
+
for (let col = colStart; col <= colEnd; col++) for (let row = rowStart; row <= rowEnd; row++) {
|
|
54128
|
+
const image = getResizeImage(table.scenegraph.getCell(col, row));
|
|
54129
|
+
null == image || image.setAttributes({
|
|
54130
|
+
x: pos.x,
|
|
54131
|
+
y: pos.y,
|
|
54132
|
+
width: iconSize,
|
|
54133
|
+
height: iconSize
|
|
54134
|
+
});
|
|
54135
|
+
}
|
|
54136
|
+
} else if (image.keepAspectRatio || isDamagePic(image)) {
|
|
54066
54137
|
const {
|
|
54067
54138
|
width: imageWidth,
|
|
54068
54139
|
height: imageHeight
|
|
54069
54140
|
} = calcKeepAspectRatioSize(originImage.width || originImage.videoWidth, originImage.height || originImage.videoHeight, cellWidth - (padding[1] + padding[3]), cellHeight - (padding[0] + padding[2])),
|
|
54070
54141
|
pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
|
|
54071
54142
|
for (let col = colStart; col <= colEnd; col++) for (let row = rowStart; row <= rowEnd; row++) {
|
|
54072
|
-
const image = table.scenegraph.getCell(col, row)
|
|
54143
|
+
const image = getResizeImage(table.scenegraph.getCell(col, row));
|
|
54073
54144
|
null == image || image.setAttributes({
|
|
54074
54145
|
x: pos.x,
|
|
54075
54146
|
y: pos.y,
|
|
@@ -54078,7 +54149,7 @@
|
|
|
54078
54149
|
});
|
|
54079
54150
|
}
|
|
54080
54151
|
} else for (let col = colStart; col <= colEnd; col++) for (let row = rowStart; row <= rowEnd; row++) {
|
|
54081
|
-
const image = table.scenegraph.getCell(col, row)
|
|
54152
|
+
const image = getResizeImage(table.scenegraph.getCell(col, row));
|
|
54082
54153
|
null == image || image.setAttributes({
|
|
54083
54154
|
x: leftIconWidth + padding[3],
|
|
54084
54155
|
y: padding[0],
|
|
@@ -54086,7 +54157,7 @@
|
|
|
54086
54157
|
height: cellHeight - padding[0] - padding[2]
|
|
54087
54158
|
});
|
|
54088
54159
|
}
|
|
54089
|
-
if (cellGroup
|
|
54160
|
+
if (getResizePlayIcon(cellGroup)) {
|
|
54090
54161
|
const left = 0,
|
|
54091
54162
|
top = 0,
|
|
54092
54163
|
{
|
|
@@ -54097,7 +54168,8 @@
|
|
|
54097
54168
|
anchorX = left + (width > image.attribute.width ? image.attribute.x - left + image.attribute.width / 2 : width / 2),
|
|
54098
54169
|
anchorY = top + (height > image.attribute.height ? image.attribute.y - top + image.attribute.height / 2 : height / 2);
|
|
54099
54170
|
for (let col = colStart; col <= colEnd; col++) for (let row = rowStart; row <= rowEnd; row++) {
|
|
54100
|
-
table.scenegraph.getCell(col, row)
|
|
54171
|
+
const playIcon = getResizePlayIcon(table.scenegraph.getCell(col, row));
|
|
54172
|
+
null == playIcon || playIcon.setAttributes({
|
|
54101
54173
|
x: anchorX - iconSize / 2,
|
|
54102
54174
|
y: anchorY - iconSize / 2,
|
|
54103
54175
|
width: iconSize,
|
|
@@ -54126,12 +54198,12 @@
|
|
|
54126
54198
|
for (let col = startCol; col <= endCol; col++) for (let row = startRow; row <= endRow; row++) {
|
|
54127
54199
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
54128
54200
|
if (cellGroup) {
|
|
54129
|
-
const image = cellGroup
|
|
54201
|
+
const image = getResizeImage(cellGroup);
|
|
54130
54202
|
image && image.setAttributes({
|
|
54131
54203
|
dx: -table.getColsWidth(cellGroup.mergeStartCol, col - 1),
|
|
54132
54204
|
dy: -table.getRowsHeight(cellGroup.mergeStartRow, row - 1)
|
|
54133
54205
|
});
|
|
54134
|
-
const playIcon = cellGroup
|
|
54206
|
+
const playIcon = getResizePlayIcon(cellGroup);
|
|
54135
54207
|
playIcon && playIcon.setAttributes({
|
|
54136
54208
|
dx: -table.getColsWidth(cellGroup.mergeStartCol, col - 1),
|
|
54137
54209
|
dy: -table.getRowsHeight(cellGroup.mergeStartRow, row - 1)
|
|
@@ -54170,8 +54242,8 @@
|
|
|
54170
54242
|
}
|
|
54171
54243
|
|
|
54172
54244
|
function dealPromiseData(dataPromise, tabel, callback) {
|
|
54173
|
-
dataPromise.then(
|
|
54174
|
-
callback(), tabel.scenegraph.updateNextFrame();
|
|
54245
|
+
dataPromise.then(value => {
|
|
54246
|
+
callback(value), tabel.scenegraph.updateNextFrame();
|
|
54175
54247
|
}).catch(err => {});
|
|
54176
54248
|
}
|
|
54177
54249
|
|
|
@@ -54187,16 +54259,27 @@
|
|
|
54187
54259
|
}
|
|
54188
54260
|
}
|
|
54189
54261
|
|
|
54190
|
-
|
|
54262
|
+
const PROMISE_CELL_UPDATE_TOKEN_KEY = "__vtable_promise_cell_update_token__";
|
|
54263
|
+
function nextPromiseCellUpdateToken(cellGroup) {
|
|
54264
|
+
var _a;
|
|
54265
|
+
const token = (null !== (_a = cellGroup[PROMISE_CELL_UPDATE_TOKEN_KEY]) && void 0 !== _a ? _a : 0) + 1;
|
|
54266
|
+
return cellGroup[PROMISE_CELL_UPDATE_TOKEN_KEY] = token, token;
|
|
54267
|
+
}
|
|
54268
|
+
function isPromiseCellUpdateCurrent(table, col, row, cellGroup, token) {
|
|
54269
|
+
return table.scenegraph.highPerformanceGetCell(col, row, !0) === cellGroup && cellGroup[PROMISE_CELL_UPDATE_TOKEN_KEY] === token;
|
|
54270
|
+
}
|
|
54271
|
+
function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult, cellValue) {
|
|
54191
54272
|
var _a, _b;
|
|
54192
54273
|
let cellGroup,
|
|
54193
54274
|
isAsync = !1;
|
|
54275
|
+
const hasCellValue = arguments.length >= 19;
|
|
54276
|
+
let renderValue = hasCellValue ? cellValue : value;
|
|
54194
54277
|
if (isPromise(value)) {
|
|
54195
54278
|
if ("cell" !== table.scenegraph.highPerformanceGetCell(col, row).role) return cellGroup;
|
|
54196
|
-
|
|
54279
|
+
hasCellValue || (renderValue = table.getCellValue(col, row)), isAsync = !0;
|
|
54197
54280
|
}
|
|
54198
|
-
if ("checkbox" === type && define.tree) {
|
|
54199
|
-
cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !0);
|
|
54281
|
+
if (value = renderValue, "checkbox" === type && define.tree) {
|
|
54282
|
+
cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !0, value);
|
|
54200
54283
|
} else if ("text" === type || "link" === type || customResult) {
|
|
54201
54284
|
if ("link" === type) {
|
|
54202
54285
|
const cellValue = value,
|
|
@@ -54232,9 +54315,11 @@
|
|
|
54232
54315
|
stroke: !1
|
|
54233
54316
|
}), cellGroup.clear()) : table.internalProps.layoutMap.isAxisCell(col, row) && cellGroup.clear();
|
|
54234
54317
|
} else if ("image" === type) {
|
|
54235
|
-
cellGroup = Factory.getFunction("createImageCellGroup")(columnGroup, 0, y, col, row, cellWidth, cellHeight, define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync);
|
|
54318
|
+
cellGroup = Factory.getFunction("createImageCellGroup")(columnGroup, 0, y, col, row, cellWidth, cellHeight, define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync, value);
|
|
54319
|
+
} else if ("audio" === type) {
|
|
54320
|
+
cellGroup = Factory.getFunction("createAudioCellGroup")(columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync, value);
|
|
54236
54321
|
} else if ("video" === type) {
|
|
54237
|
-
cellGroup = Factory.getFunction("createVideoCellGroup")(columnGroup, 0, y, col, row, cellWidth, cellHeight, define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync);
|
|
54322
|
+
cellGroup = Factory.getFunction("createVideoCellGroup")(columnGroup, 0, y, col, row, cellWidth, cellHeight, define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync, value);
|
|
54238
54323
|
} else if ("chart" === type) {
|
|
54239
54324
|
const chartInstance = table.internalProps.layoutMap.getChartInstance(col, row);
|
|
54240
54325
|
cellGroup = Factory.getFunction("createChartCellGroup")(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, value, define.chartModule, table.internalProps.layoutMap.getChartSpec(col, row), chartInstance, null !== (_b = table.internalProps.layoutMap.getChartDataId(col, row)) && void 0 !== _b ? _b : "data", table, cellTheme, table.internalProps.layoutMap.isShareChartSpec(col, row), isAsync, table.internalProps.layoutMap.isNoChartDataRenderNothing(col, row));
|
|
@@ -54249,23 +54334,23 @@
|
|
|
54249
54334
|
const progressBarGroup = Factory.getFunction("createProgressBarCell")(define, style, colWidth, value, dataValue, col, row, padding, table, range);
|
|
54250
54335
|
cellGroup.firstChild ? cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild) : cellGroup.appendChild(progressBarGroup);
|
|
54251
54336
|
} else if ("sparkline" === type) {
|
|
54252
|
-
cellGroup = Factory.getFunction("createSparkLineCellGroup")(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync);
|
|
54337
|
+
cellGroup = Factory.getFunction("createSparkLineCellGroup")(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, table, cellTheme, isAsync, value);
|
|
54253
54338
|
} else if ("checkbox" === type) {
|
|
54254
54339
|
if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
|
|
54255
54340
|
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
|
|
54256
54341
|
} else {
|
|
54257
|
-
cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !1);
|
|
54342
|
+
cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !1, value);
|
|
54258
54343
|
}
|
|
54259
54344
|
} else if ("radio" === type) {
|
|
54260
54345
|
if ("isAggregation" in table.internalProps.layoutMap && table.internalProps.layoutMap.isAggregation(col, row)) {
|
|
54261
54346
|
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
|
|
54262
54347
|
} else {
|
|
54263
|
-
cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
|
|
54348
|
+
cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range, isAsync, value);
|
|
54264
54349
|
}
|
|
54265
54350
|
} else if ("switch" === type) {
|
|
54266
|
-
cellGroup = Factory.getFunction("createSwitchCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
|
|
54351
|
+
cellGroup = Factory.getFunction("createSwitchCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, value);
|
|
54267
54352
|
} else if ("button" === type) {
|
|
54268
|
-
cellGroup = Factory.getFunction("createButtonCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
|
|
54353
|
+
cellGroup = Factory.getFunction("createButtonCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, value);
|
|
54269
54354
|
}
|
|
54270
54355
|
return cellGroup.onBeforeAttributeUpdate = onBeforeAttributeUpdateForInvertHighlight, cellGroup;
|
|
54271
54356
|
}
|
|
@@ -54399,25 +54484,30 @@
|
|
|
54399
54484
|
textAlign = cellTheme.text.textAlign,
|
|
54400
54485
|
textBaseline = cellTheme.text.textBaseline;
|
|
54401
54486
|
let newCellGroup, cellWidth, cellHeight;
|
|
54402
|
-
if (range ? (cellWidth = table.getColsWidth(range.start.col, range.end.col), cellHeight = table.getRowsHeight(range.start.row, range.end.row)) : (cellWidth = table.getColWidth(col), cellHeight = table.getRowHeight(row)), isPromise(value)
|
|
54403
|
-
|
|
54404
|
-
|
|
54405
|
-
|
|
54406
|
-
|
|
54407
|
-
|
|
54408
|
-
|
|
54409
|
-
|
|
54410
|
-
|
|
54411
|
-
|
|
54412
|
-
|
|
54413
|
-
|
|
54414
|
-
|
|
54415
|
-
|
|
54416
|
-
|
|
54417
|
-
|
|
54418
|
-
|
|
54419
|
-
|
|
54420
|
-
|
|
54487
|
+
if (range ? (cellWidth = table.getColsWidth(range.start.col, range.end.col), cellHeight = table.getRowsHeight(range.start.row, range.end.row)) : (cellWidth = table.getColWidth(col), cellHeight = table.getRowHeight(row)), isPromise(value)) {
|
|
54488
|
+
const updateToken = nextPromiseCellUpdateToken(oldCellGroup);
|
|
54489
|
+
removeCellMediaChildren(oldCellGroup), oldCellGroup.removeAllChild(), dealPromiseData(value, table, callUpdateCellContentForPromiseValue.bind(null, {
|
|
54490
|
+
type: type,
|
|
54491
|
+
define: define,
|
|
54492
|
+
table: table,
|
|
54493
|
+
col: col,
|
|
54494
|
+
row: row,
|
|
54495
|
+
cellWidth: cellWidth,
|
|
54496
|
+
cellHeight: cellHeight,
|
|
54497
|
+
oldCellGroup: oldCellGroup,
|
|
54498
|
+
padding: padding,
|
|
54499
|
+
textAlign: textAlign,
|
|
54500
|
+
textBaseline: textBaseline,
|
|
54501
|
+
mayHaveIcon: mayHaveIcon,
|
|
54502
|
+
addNew: addNew,
|
|
54503
|
+
range: range,
|
|
54504
|
+
customResult: customResult,
|
|
54505
|
+
customStyle: customStyle,
|
|
54506
|
+
promiseValue: value,
|
|
54507
|
+
updateToken: updateToken
|
|
54508
|
+
}));
|
|
54509
|
+
} else newCellGroup = updateCellContent(type, value, define, table, col, row, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult);
|
|
54510
|
+
if (isMerge) {
|
|
54421
54511
|
const {
|
|
54422
54512
|
width: contentWidth
|
|
54423
54513
|
} = newCellGroup.attribute,
|
|
@@ -54428,9 +54518,10 @@
|
|
|
54428
54518
|
}
|
|
54429
54519
|
return newCellGroup;
|
|
54430
54520
|
}
|
|
54431
|
-
function updateCellContent(type, value, define, table, col, row, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult) {
|
|
54521
|
+
function updateCellContent(type, value, define, table, col, row, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult, cellValue) {
|
|
54432
54522
|
var _a, _b;
|
|
54433
|
-
|
|
54523
|
+
const hasCellValue = arguments.length >= 18;
|
|
54524
|
+
if (!addNew && (oldCellGroup.row !== row || oldCellGroup.col !== col)) return null;
|
|
54434
54525
|
if (!addNew && oldCellGroup.parent && table.reactCustomLayout) {
|
|
54435
54526
|
const reactGroup = oldCellGroup.getChildByName(CUSTOM_CONTAINER_NAME);
|
|
54436
54527
|
if (reactGroup) {
|
|
@@ -54441,8 +54532,10 @@
|
|
|
54441
54532
|
isNumber$3(col) && isNumber$3(row) && table.reactCustomLayout.removeCustomCell(col, row);
|
|
54442
54533
|
}
|
|
54443
54534
|
}
|
|
54444
|
-
const
|
|
54445
|
-
|
|
54535
|
+
const createCellArgs = [type, value, define, table, col, row, table.getColWidth(col), cellWidth, cellHeight, addNew ? table.scenegraph.getColGroup(col) : oldCellGroup.parent, addNew ? 0 : table.scenegraph.getCellGroupY(row), padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult];
|
|
54536
|
+
hasCellValue && createCellArgs.push(cellValue);
|
|
54537
|
+
const newCellGroup = createCell(...createCellArgs);
|
|
54538
|
+
return !addNew && oldCellGroup.parent && newCellGroup !== oldCellGroup && (oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup), oldCellGroup.parent.removeChild(oldCellGroup), removeCellMediaChildren(oldCellGroup), oldCellGroup.release(!0), (null === (_a = table.scenegraph) || void 0 === _a ? void 0 : _a.proxy.cellCache.get(col)) && (null === (_b = table.scenegraph) || void 0 === _b || _b.proxy.cellCache.set(col, newCellGroup))), newCellGroup;
|
|
54446
54539
|
}
|
|
54447
54540
|
function canUseFastUpdate(col, row, oldCellGroup, autoWrapText, mayHaveIcon, table) {
|
|
54448
54541
|
var _a;
|
|
@@ -54451,29 +54544,31 @@
|
|
|
54451
54544
|
value = table.getCellValue(col, row);
|
|
54452
54545
|
return !(table.isHeader(col, row) || "cell" !== oldCellGroup.role || "text" !== cellType || autoWrapText || autoRowHeight || mayHaveIcon || "text" !== (null === (_a = oldCellGroup.firstChild) || void 0 === _a ? void 0 : _a.type) || isPromise(value));
|
|
54453
54546
|
}
|
|
54454
|
-
function callUpdateCellContentForPromiseValue(updateCellArgs) {
|
|
54547
|
+
function callUpdateCellContentForPromiseValue(updateCellArgs, resolvedValue) {
|
|
54455
54548
|
const {
|
|
54456
|
-
|
|
54457
|
-
|
|
54458
|
-
|
|
54459
|
-
|
|
54460
|
-
|
|
54461
|
-
|
|
54462
|
-
|
|
54463
|
-
|
|
54464
|
-
|
|
54465
|
-
|
|
54466
|
-
|
|
54467
|
-
|
|
54468
|
-
|
|
54469
|
-
|
|
54470
|
-
|
|
54471
|
-
|
|
54472
|
-
|
|
54473
|
-
|
|
54474
|
-
|
|
54549
|
+
type: type,
|
|
54550
|
+
define: define,
|
|
54551
|
+
table: table,
|
|
54552
|
+
col: col,
|
|
54553
|
+
row: row,
|
|
54554
|
+
cellWidth: cellWidth,
|
|
54555
|
+
cellHeight: cellHeight,
|
|
54556
|
+
oldCellGroup: oldCellGroup,
|
|
54557
|
+
padding: padding,
|
|
54558
|
+
textAlign: textAlign,
|
|
54559
|
+
textBaseline: textBaseline,
|
|
54560
|
+
mayHaveIcon: mayHaveIcon,
|
|
54561
|
+
addNew: addNew,
|
|
54562
|
+
range: range,
|
|
54563
|
+
customResult: customResult,
|
|
54564
|
+
customStyle: customStyle,
|
|
54565
|
+
promiseValue: promiseValue,
|
|
54566
|
+
updateToken: updateToken
|
|
54567
|
+
} = updateCellArgs;
|
|
54568
|
+
if (!isPromiseCellUpdateCurrent(table, col, row, oldCellGroup, updateToken)) return;
|
|
54569
|
+
const cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row),
|
|
54475
54570
|
cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
|
|
54476
|
-
cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table), updateCellContent(type,
|
|
54571
|
+
cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table), updateCellContent(type, promiseValue, define, table, col, row, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult, resolvedValue);
|
|
54477
54572
|
}
|
|
54478
54573
|
function dealWithMergeCellSize(range, cellWidth, cellHeight, padding, textAlign, textBaseline, table) {
|
|
54479
54574
|
for (let col = range.start.col; col <= range.end.col; col++) for (let row = range.start.row; row <= range.end.row; row++) {
|
|
@@ -54900,17 +54995,18 @@
|
|
|
54900
54995
|
renderDefault = !1,
|
|
54901
54996
|
enableCellPadding = !1;
|
|
54902
54997
|
(table.isHeader(col, row) || (null === (_a = table.getBodyColumnDefine(col, row)) || void 0 === _a ? void 0 : _a.mergeCell) || table.hasCustomMerge()) && (cellRange = table.getCellRange(col, row), spanRow = cellRange.end.row - cellRange.start.row + 1);
|
|
54903
|
-
const
|
|
54904
|
-
|
|
54905
|
-
|
|
54906
|
-
|
|
54907
|
-
|
|
54908
|
-
|
|
54909
|
-
|
|
54910
|
-
|
|
54911
|
-
|
|
54912
|
-
|
|
54913
|
-
|
|
54998
|
+
const skipCellValue = shouldSkipCustomRenderCellValueForComputation$1(col, row, table),
|
|
54999
|
+
arg = {
|
|
55000
|
+
col: null !== (_b = null == cellRange ? void 0 : cellRange.start.col) && void 0 !== _b ? _b : col,
|
|
55001
|
+
row: null !== (_c = null == cellRange ? void 0 : cellRange.start.row) && void 0 !== _c ? _c : row,
|
|
55002
|
+
dataValue: skipCellValue ? void 0 : table.getCellOriginValue(col, row),
|
|
55003
|
+
value: skipCellValue ? void 0 : table.getCellValue(col, row),
|
|
55004
|
+
rect: getCellRect$1(col, row, table),
|
|
55005
|
+
table: table,
|
|
55006
|
+
originCol: col,
|
|
55007
|
+
originRow: row,
|
|
55008
|
+
forComputation: !0
|
|
55009
|
+
};
|
|
54914
55010
|
if ("react-custom-layout" === customLayout && (customLayout = (null === (_d = table.reactCustomLayout) || void 0 === _d ? void 0 : _d.getCustomLayoutFunc(col, row)) || emptyCustomLayout), isFunction$3(customLayout)) {
|
|
54915
55011
|
const customLayoutObj = customLayout(arg);
|
|
54916
55012
|
customLayoutObj.rootContainer ? (customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer), dealPercentCalc(customLayoutObj.rootContainer, table.getColWidth(col), 0), customLayoutObj.rootContainer.setStage(table.scenegraph.stage), height = null !== (_e = customLayoutObj.rootContainer.AABBBounds.height()) && void 0 !== _e ? _e : 0, renderDefault = customLayoutObj.renderDefault, enableCellPadding = customLayoutObj.enableCellPadding) : (height = 0, renderDefault = customLayoutObj.renderDefault, enableCellPadding = customLayoutObj.enableCellPadding);
|
|
@@ -54924,11 +55020,15 @@
|
|
|
54924
55020
|
height += padding[0] + padding[2];
|
|
54925
55021
|
}
|
|
54926
55022
|
return {
|
|
54927
|
-
height: height / spanRow,
|
|
55023
|
+
height: getMergedCellSingleRowHeight(height / spanRow, spanRow, table),
|
|
54928
55024
|
renderDefault: renderDefault
|
|
54929
55025
|
};
|
|
54930
55026
|
}
|
|
54931
55027
|
}
|
|
55028
|
+
function shouldSkipCustomRenderCellValueForComputation$1(col, row, table) {
|
|
55029
|
+
var _a, _b;
|
|
55030
|
+
return table.isListTable() && !table.isHeader(col, row) && !(null === (_b = null === (_a = table.internalProps.dataSource) || void 0 === _a ? void 0 : _a.dataSourceObj) || void 0 === _b ? void 0 : _b.records);
|
|
55031
|
+
}
|
|
54932
55032
|
function computeTextHeight(col, row, cellType, table) {
|
|
54933
55033
|
var _a, _b, _c, _d;
|
|
54934
55034
|
let maxHeight = 0;
|
|
@@ -55012,7 +55112,14 @@
|
|
|
55012
55112
|
maxHeight = (bounds.height() || ("number" == typeof lineHeight ? lineHeight : fontSize)) + (underline ? underlineOffset : 0);
|
|
55013
55113
|
} else maxHeight = (null === (_d = table.options.customConfig) || void 0 === _d ? void 0 : _d.multilinesForXTable) ? lineHeight : lines.length * lineHeight;
|
|
55014
55114
|
}
|
|
55015
|
-
return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;
|
|
55115
|
+
return getMergedCellSingleRowHeight((Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow, spanRow, table);
|
|
55116
|
+
}
|
|
55117
|
+
function getMergedCellSingleRowHeight(height, spanRow, table) {
|
|
55118
|
+
var _a;
|
|
55119
|
+
if (spanRow <= 1) return height;
|
|
55120
|
+
const configuredMinHeight = null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.minSingleRowHeight,
|
|
55121
|
+
minSingleRowHeight = isNumber$3(configuredMinHeight) && configuredMinHeight > 0 ? configuredMinHeight : 2;
|
|
55122
|
+
return Math.max(height, minSingleRowHeight);
|
|
55016
55123
|
}
|
|
55017
55124
|
function getCellRect$1(col, row, table) {
|
|
55018
55125
|
return {
|
|
@@ -55068,7 +55175,7 @@
|
|
|
55068
55175
|
const headerStyle = scene.table._getCellStyle(col, row),
|
|
55069
55176
|
padding = getQuadProps(getProp("padding", headerStyle, col, row, scene.table));
|
|
55070
55177
|
Factory.getFunction("createSparkLineCellGroup")(cell, cell.parent, cell.attribute.x, cell.attribute.y, col, row, cell.attribute.width, cell.attribute.height, padding, scene.table, getStyleTheme(headerStyle, scene.table, col, row, getProp).theme, !1);
|
|
55071
|
-
} else if ("image" === type || "video" === type) updateImageCellContentWhileResize(cell, col, row, 0, detaY, scene.table);else if ("axis" === (null === (_b = cell.firstChild) || void 0 === _b ? void 0 : _b.name)) null === (_c = cell.firstChild) || void 0 === _c || _c.originAxis.resize(cell.attribute.width, cell.attribute.height);else {
|
|
55178
|
+
} else if ("image" === type || "video" === type || "audio" === type) updateImageCellContentWhileResize(cell, col, row, 0, detaY, scene.table);else if ("axis" === (null === (_b = cell.firstChild) || void 0 === _b ? void 0 : _b.name)) null === (_c = cell.firstChild) || void 0 === _c || _c.originAxis.resize(cell.attribute.width, cell.attribute.height);else {
|
|
55072
55179
|
let renderDefault = !0;
|
|
55073
55180
|
const customContainer = cell.getChildByName(CUSTOM_CONTAINER_NAME) || cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME);
|
|
55074
55181
|
if (customContainer) {
|
|
@@ -55269,7 +55376,7 @@
|
|
|
55269
55376
|
const headerStyle = scene.table._getCellStyle(col, row),
|
|
55270
55377
|
padding = getQuadProps(getProp("padding", headerStyle, col, row, scene.table));
|
|
55271
55378
|
Factory.getFunction("createSparkLineCellGroup")(cellGroup, cellGroup.parent, cellGroup.attribute.x, cellGroup.attribute.y, col, row, cellGroup.attribute.width, cellGroup.attribute.height, padding, scene.table, getStyleTheme(headerStyle, scene.table, col, row, getProp).theme, !1);
|
|
55272
|
-
} else if ("image" === type || "video" === type) updateImageCellContentWhileResize(cellGroup, col, row, detaX, 0, scene.table);else if ("axis" === (null === (_b = cellGroup.firstChild) || void 0 === _b ? void 0 : _b.name)) {
|
|
55379
|
+
} else if ("image" === type || "video" === type || "audio" === type) updateImageCellContentWhileResize(cellGroup, col, row, detaX, 0, scene.table);else if ("axis" === (null === (_b = cellGroup.firstChild) || void 0 === _b ? void 0 : _b.name)) {
|
|
55273
55380
|
const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row),
|
|
55274
55381
|
cellStyle = scene.table._getCellStyle(col, row),
|
|
55275
55382
|
padding = getQuadProps(getProp("padding", cellStyle, col, row, scene.table));
|
|
@@ -56794,17 +56901,18 @@
|
|
|
56794
56901
|
renderDefault = !1,
|
|
56795
56902
|
enableCellPadding = !1;
|
|
56796
56903
|
(table.isHeader(col, row) || (null === (_a = table.getBodyColumnDefine(col, row)) || void 0 === _a ? void 0 : _a.mergeCell) || table.hasCustomMerge()) && (cellRange = table.getCellRange(col, row), spanCol = cellRange.end.col - cellRange.start.col + 1);
|
|
56797
|
-
const
|
|
56798
|
-
|
|
56799
|
-
|
|
56800
|
-
|
|
56801
|
-
|
|
56802
|
-
|
|
56803
|
-
|
|
56804
|
-
|
|
56805
|
-
|
|
56806
|
-
|
|
56807
|
-
|
|
56904
|
+
const skipCellValue = shouldSkipCustomRenderCellValueForComputation(col, row, table),
|
|
56905
|
+
arg = {
|
|
56906
|
+
col: null !== (_b = null == cellRange ? void 0 : cellRange.start.col) && void 0 !== _b ? _b : col,
|
|
56907
|
+
row: null !== (_c = null == cellRange ? void 0 : cellRange.start.row) && void 0 !== _c ? _c : row,
|
|
56908
|
+
dataValue: skipCellValue ? void 0 : table.getCellOriginValue(col, row),
|
|
56909
|
+
value: skipCellValue ? void 0 : table.getCellValue(col, row),
|
|
56910
|
+
rect: getCellRect(col, row, table),
|
|
56911
|
+
table: table,
|
|
56912
|
+
originCol: col,
|
|
56913
|
+
originRow: row,
|
|
56914
|
+
forComputation: !0
|
|
56915
|
+
};
|
|
56808
56916
|
if ("react-custom-layout" === customLayout && (customLayout = (null === (_d = table.reactCustomLayout) || void 0 === _d ? void 0 : _d.getCustomLayoutFunc(col, row)) || emptyCustomLayout), isFunction$3(customLayout)) {
|
|
56809
56917
|
const customLayoutObj = customLayout(arg);
|
|
56810
56918
|
if (customLayoutObj.rootContainer) {
|
|
@@ -56827,6 +56935,10 @@
|
|
|
56827
56935
|
};
|
|
56828
56936
|
}
|
|
56829
56937
|
}
|
|
56938
|
+
function shouldSkipCustomRenderCellValueForComputation(col, row, table) {
|
|
56939
|
+
var _a, _b;
|
|
56940
|
+
return table.isListTable() && !table.isHeader(col, row) && !(null === (_b = null === (_a = table.internalProps.dataSource) || void 0 === _a ? void 0 : _a.dataSourceObj) || void 0 === _b ? void 0 : _b.records);
|
|
56941
|
+
}
|
|
56830
56942
|
function computeTextWidth(col, row, cellType, table) {
|
|
56831
56943
|
var _a, _b, _c, _d;
|
|
56832
56944
|
let maxWidth = 0;
|
|
@@ -57082,9 +57194,10 @@
|
|
|
57082
57194
|
}
|
|
57083
57195
|
const type = isVtableMerge || isCustomMerge ? "text" : table.getCellType(col, row);
|
|
57084
57196
|
if (isPromise(value)) {
|
|
57085
|
-
createEmptyCellGroup(col, row, 0, y, cellWidth, cellHeight, columnGroup),
|
|
57197
|
+
const cellGroup = createEmptyCellGroup(col, row, 0, y, cellWidth, cellHeight, columnGroup),
|
|
57198
|
+
updateToken = nextPromiseCellUpdateToken(cellGroup);
|
|
57199
|
+
dealPromiseData(value, table, callCreateCellForPromiseValue.bind(null, {
|
|
57086
57200
|
type: type,
|
|
57087
|
-
value: value,
|
|
57088
57201
|
define: define,
|
|
57089
57202
|
table: table,
|
|
57090
57203
|
col: col,
|
|
@@ -57099,7 +57212,10 @@
|
|
|
57099
57212
|
cellLocation: cellLocation,
|
|
57100
57213
|
range: range,
|
|
57101
57214
|
customResult: customResult,
|
|
57102
|
-
defaultRowHeight: defaultRowHeight
|
|
57215
|
+
defaultRowHeight: defaultRowHeight,
|
|
57216
|
+
promiseValue: value,
|
|
57217
|
+
oldCellGroup: cellGroup,
|
|
57218
|
+
updateToken: updateToken
|
|
57103
57219
|
})), columnGroup.updateColumnRowNumber(row);
|
|
57104
57220
|
const height = table.getRowHeight(row);
|
|
57105
57221
|
columnGroup.updateColumnHeight(height), y += height;
|
|
@@ -57126,30 +57242,33 @@
|
|
|
57126
57242
|
height: y
|
|
57127
57243
|
};
|
|
57128
57244
|
}
|
|
57129
|
-
function callCreateCellForPromiseValue(createCellArgs) {
|
|
57245
|
+
function callCreateCellForPromiseValue(createCellArgs, resolvedValue) {
|
|
57130
57246
|
let padding, textAlign, textBaseline;
|
|
57131
57247
|
const {
|
|
57132
|
-
|
|
57133
|
-
|
|
57134
|
-
|
|
57135
|
-
|
|
57136
|
-
|
|
57137
|
-
|
|
57138
|
-
|
|
57139
|
-
|
|
57140
|
-
|
|
57141
|
-
|
|
57142
|
-
|
|
57143
|
-
|
|
57144
|
-
|
|
57145
|
-
|
|
57146
|
-
|
|
57147
|
-
|
|
57148
|
-
|
|
57149
|
-
|
|
57150
|
-
|
|
57248
|
+
type: type,
|
|
57249
|
+
define: define,
|
|
57250
|
+
table: table,
|
|
57251
|
+
col: col,
|
|
57252
|
+
row: row,
|
|
57253
|
+
colWidth: colWidth,
|
|
57254
|
+
cellWidth: cellWidth,
|
|
57255
|
+
cellHeight: cellHeight,
|
|
57256
|
+
columnGroup: columnGroup,
|
|
57257
|
+
y: y,
|
|
57258
|
+
cellLocation: cellLocation,
|
|
57259
|
+
mayHaveIcon: mayHaveIcon,
|
|
57260
|
+
customStyle: customStyle,
|
|
57261
|
+
range: range,
|
|
57262
|
+
customResult: customResult,
|
|
57263
|
+
defaultRowHeight: defaultRowHeight,
|
|
57264
|
+
promiseValue: promiseValue,
|
|
57265
|
+
oldCellGroup: oldCellGroup,
|
|
57266
|
+
updateToken: updateToken
|
|
57267
|
+
} = createCellArgs;
|
|
57268
|
+
if (!isPromiseCellUpdateCurrent(table, col, row, oldCellGroup, updateToken)) return;
|
|
57269
|
+
const cellStyle = customStyle || table._getCellStyle(range ? range.start.col : col, range ? range.start.row : row),
|
|
57151
57270
|
cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
|
|
57152
|
-
cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table), cellTheme.group.width = colWidth, cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight, cellTheme._vtable.padding && (padding = cellTheme._vtable.padding), cellTheme.text.textAlign && (textAlign = cellTheme.text.textAlign), cellTheme.text.textBaseline && (textBaseline = cellTheme.text.textBaseline), "body" === cellLocation || cellTheme.group.fill || (cellTheme.group.fill = "#fff"), createCell(type,
|
|
57271
|
+
cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table), cellTheme.group.width = colWidth, cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight, cellTheme._vtable.padding && (padding = cellTheme._vtable.padding), cellTheme.text.textAlign && (textAlign = cellTheme.text.textAlign), cellTheme.text.textBaseline && (textBaseline = cellTheme.text.textBaseline), "body" === cellLocation || cellTheme.group.fill || (cellTheme.group.fill = "#fff"), createCell(type, promiseValue, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult, resolvedValue);
|
|
57153
57272
|
}
|
|
57154
57273
|
function dealMerge(range, mergeMap, table, forceUpdate) {
|
|
57155
57274
|
let cellWidth = 0,
|
|
@@ -57175,7 +57294,7 @@
|
|
|
57175
57294
|
width: width,
|
|
57176
57295
|
height: height
|
|
57177
57296
|
});
|
|
57178
|
-
cellGroup.role = "cell", cellGroup.col = col, cellGroup.row = row, columnGroup.addChild(cellGroup);
|
|
57297
|
+
return cellGroup.role = "cell", cellGroup.col = col, cellGroup.row = row, columnGroup.addChild(cellGroup), cellGroup;
|
|
57179
57298
|
}
|
|
57180
57299
|
|
|
57181
57300
|
function createColGroup(containerGroup, xOrigin, yOrigin, colStart, colEnd, rowStart, rowEnd, cellLocation, table, rowLimit) {
|
|
@@ -57720,6 +57839,7 @@
|
|
|
57720
57839
|
});
|
|
57721
57840
|
}
|
|
57722
57841
|
|
|
57842
|
+
let stickTextUpdateId = 0;
|
|
57723
57843
|
function resetTextStick(table) {
|
|
57724
57844
|
const {
|
|
57725
57845
|
changedCells: changedCells
|
|
@@ -57735,6 +57855,8 @@
|
|
|
57735
57855
|
}
|
|
57736
57856
|
function handleTextStick(table) {
|
|
57737
57857
|
const changedCells = resetTextStick(table),
|
|
57858
|
+
horizontalUpdateId = ++stickTextUpdateId,
|
|
57859
|
+
verticalUpdateId = ++stickTextUpdateId,
|
|
57738
57860
|
{
|
|
57739
57861
|
scrollTop: scrollTop,
|
|
57740
57862
|
scrollLeft: scrollLeft,
|
|
@@ -57757,42 +57879,53 @@
|
|
|
57757
57879
|
for (let row = 0; row < frozenRowCount && !(colEnd < colStart); row++) [colStart, colEnd].forEach(col => {
|
|
57758
57880
|
const style = table._getCellStyle(col, row);
|
|
57759
57881
|
if ((null == style ? void 0 : style.textStick) && "vertical" !== (null == style ? void 0 : style.textStick)) {
|
|
57760
|
-
adjustCellContentHorizontalLayout(table.scenegraph.getCell(col, row), frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, null == style ? void 0 : style.textStickBaseOnAlign, table
|
|
57882
|
+
adjustCellContentHorizontalLayout(table.scenegraph.getCell(col, row), frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, null == style ? void 0 : style.textStickBaseOnAlign, table, horizontalUpdateId, {
|
|
57883
|
+
colStart: colStart,
|
|
57884
|
+
colEnd: colEnd,
|
|
57885
|
+
rowStart: row,
|
|
57886
|
+
rowEnd: row
|
|
57887
|
+
});
|
|
57761
57888
|
}
|
|
57762
57889
|
});
|
|
57763
57890
|
for (let col = 0; col < frozenColCount && !(rowEnd < rowStart); col++) [rowStart, rowEnd].forEach(row => {
|
|
57764
57891
|
const style = table._getCellStyle(col, row);
|
|
57765
57892
|
if ((null == style ? void 0 : style.textStick) && "horizontal" !== (null == style ? void 0 : style.textStick)) {
|
|
57766
|
-
adjustCellContentVerticalLayout(table.scenegraph.getCell(col, row), frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, null == style ? void 0 : style.textStickBaseOnAlign, table
|
|
57893
|
+
adjustCellContentVerticalLayout(table.scenegraph.getCell(col, row), frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, null == style ? void 0 : style.textStickBaseOnAlign, table, verticalUpdateId, {
|
|
57894
|
+
colStart: col,
|
|
57895
|
+
colEnd: col,
|
|
57896
|
+
rowStart: rowStart,
|
|
57897
|
+
rowEnd: rowEnd
|
|
57898
|
+
});
|
|
57767
57899
|
}
|
|
57768
57900
|
});
|
|
57769
57901
|
for (let col = colStart; col <= colEnd && !(rowEnd < rowStart); col++) [rowStart, rowEnd].forEach(row => {
|
|
57770
57902
|
const style = table._getCellStyle(col, row);
|
|
57771
57903
|
if ((null == style ? void 0 : style.textStick) && "horizontal" !== (null == style ? void 0 : style.textStick)) {
|
|
57772
|
-
adjustCellContentVerticalLayout(table.scenegraph.getCell(col, row), frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, null == style ? void 0 : style.textStickBaseOnAlign, table
|
|
57904
|
+
adjustCellContentVerticalLayout(table.scenegraph.getCell(col, row), frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, null == style ? void 0 : style.textStickBaseOnAlign, table, verticalUpdateId, {
|
|
57905
|
+
colStart: col,
|
|
57906
|
+
colEnd: col,
|
|
57907
|
+
rowStart: rowStart,
|
|
57908
|
+
rowEnd: rowEnd
|
|
57909
|
+
});
|
|
57773
57910
|
}
|
|
57774
57911
|
});
|
|
57775
57912
|
for (let row = rowStart; row <= rowEnd && !(colEnd < colStart); row++) [colStart, colEnd].forEach(col => {
|
|
57776
57913
|
const style = table._getCellStyle(col, row);
|
|
57777
57914
|
if ((null == style ? void 0 : style.textStick) && "vertical" !== (null == style ? void 0 : style.textStick)) {
|
|
57778
|
-
adjustCellContentHorizontalLayout(table.scenegraph.getCell(col, row), frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, null == style ? void 0 : style.textStickBaseOnAlign, table
|
|
57915
|
+
adjustCellContentHorizontalLayout(table.scenegraph.getCell(col, row), frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, null == style ? void 0 : style.textStickBaseOnAlign, table, horizontalUpdateId, {
|
|
57916
|
+
colStart: colStart,
|
|
57917
|
+
colEnd: colEnd,
|
|
57918
|
+
rowStart: row,
|
|
57919
|
+
rowEnd: row
|
|
57920
|
+
});
|
|
57779
57921
|
}
|
|
57780
57922
|
});
|
|
57781
57923
|
}
|
|
57782
57924
|
}
|
|
57783
|
-
function adjustCellContentVerticalLayout(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign, table) {
|
|
57784
|
-
|
|
57785
|
-
|
|
57786
|
-
|
|
57787
|
-
colEnd: colEnd,
|
|
57788
|
-
rowStart: rowStart,
|
|
57789
|
-
rowEnd: rowEnd
|
|
57790
|
-
} = getCellMergeRange(cellGroup, table.scenegraph);
|
|
57791
|
-
for (let col = colStart; col <= colEnd; col++) for (let row = rowStart; row <= rowEnd; row++) {
|
|
57792
|
-
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
57793
|
-
"cell" === singleCellGroup.role && dealVertical(singleCellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
|
|
57794
|
-
}
|
|
57795
|
-
} else dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
|
|
57925
|
+
function adjustCellContentVerticalLayout(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign, table, updateId, visibleRange) {
|
|
57926
|
+
dealMergedCellGroups(cellGroup, table, visibleRange, updateId, "verticalStickUpdateId", singleCellGroup => {
|
|
57927
|
+
dealVertical(singleCellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
|
|
57928
|
+
});
|
|
57796
57929
|
}
|
|
57797
57930
|
function dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign) {
|
|
57798
57931
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
@@ -57850,19 +57983,31 @@
|
|
|
57850
57983
|
});
|
|
57851
57984
|
}
|
|
57852
57985
|
}
|
|
57853
|
-
function adjustCellContentHorizontalLayout(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign, table) {
|
|
57986
|
+
function adjustCellContentHorizontalLayout(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign, table, updateId, visibleRange) {
|
|
57987
|
+
dealMergedCellGroups(cellGroup, table, visibleRange, updateId, "horizontalStickUpdateId", singleCellGroup => {
|
|
57988
|
+
dealHorizontal(singleCellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);
|
|
57989
|
+
});
|
|
57990
|
+
}
|
|
57991
|
+
function dealMergedCellGroups(cellGroup, table, visibleRange, updateId, updateIdKey, dealCell) {
|
|
57854
57992
|
if (isNumber$3(cellGroup.mergeStartCol) && isNumber$3(cellGroup.mergeStartRow) && isNumber$3(cellGroup.mergeEndCol) && isNumber$3(cellGroup.mergeEndRow)) {
|
|
57855
57993
|
const {
|
|
57856
|
-
|
|
57857
|
-
|
|
57858
|
-
|
|
57859
|
-
|
|
57860
|
-
|
|
57861
|
-
|
|
57994
|
+
colStart: colStart,
|
|
57995
|
+
colEnd: colEnd,
|
|
57996
|
+
rowStart: rowStart,
|
|
57997
|
+
rowEnd: rowEnd
|
|
57998
|
+
} = getCellMergeRange(cellGroup, table.scenegraph),
|
|
57999
|
+
visibleColStart = Math.max(colStart, visibleRange.colStart),
|
|
58000
|
+
visibleColEnd = Math.min(colEnd, visibleRange.colEnd),
|
|
58001
|
+
visibleRowStart = Math.max(rowStart, visibleRange.rowStart),
|
|
58002
|
+
visibleRowEnd = Math.min(rowEnd, visibleRange.rowEnd);
|
|
58003
|
+
for (let col = visibleColStart; col <= visibleColEnd; col++) for (let row = visibleRowStart; row <= visibleRowEnd; row++) {
|
|
57862
58004
|
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
57863
|
-
"cell" === singleCellGroup.role &&
|
|
58005
|
+
"cell" === singleCellGroup.role && singleCellGroup[updateIdKey] !== updateId && (singleCellGroup[updateIdKey] = updateId, dealCell(singleCellGroup));
|
|
57864
58006
|
}
|
|
57865
|
-
} else
|
|
58007
|
+
} else {
|
|
58008
|
+
if (cellGroup[updateIdKey] === updateId) return;
|
|
58009
|
+
cellGroup[updateIdKey] = updateId, dealCell(cellGroup);
|
|
58010
|
+
}
|
|
57866
58011
|
}
|
|
57867
58012
|
function dealHorizontal(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign) {
|
|
57868
58013
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
@@ -57962,7 +58107,9 @@
|
|
|
57962
58107
|
};
|
|
57963
58108
|
class SceneProxy {
|
|
57964
58109
|
constructor(table) {
|
|
57965
|
-
this.isRelease = !1, this.mode = "column", this.rowLimit = 200, this.currentRow = 0, this.rowStart = 0, this.rowEnd = 0, this.referenceRow = 0, this.screenTopRow = 0, this.deltaY = 0, this.deltaHeight = 0, this.colLimit = 100, this.screenLeftCol = 0, this.deltaX = 0, this.deltaWidth = 0, this.cellCache = new Map(), this.table = table
|
|
58110
|
+
this.isRelease = !1, this.mode = "column", this.rowLimit = 200, this.currentRow = 0, this.rowStart = 0, this.rowEnd = 0, this.referenceRow = 0, this.screenTopRow = 0, this.deltaY = 0, this.deltaHeight = 0, this.colLimit = 100, this.screenLeftCol = 0, this.deltaX = 0, this.deltaWidth = 0, this.cellCache = new Map(), this.table = table;
|
|
58111
|
+
const defaultRowHeight = this.getEstimatedRowHeightForProxy();
|
|
58112
|
+
this.table.isPivotChart() ? (this.rowLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameHeight / defaultRowHeight)), this.colLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameWidth / table.defaultColWidth))) : this.table.isAutoRowHeight(table.columnHeaderLevelCount) ? this.rowLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameHeight / defaultRowHeight)) : ("autoWidth" === this.table.widthMode || (this.rowLimit = Math.max(200, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight))), this.colLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameWidth / table.defaultColWidth))), this.table.internalProps.transpose ? this.mode = "row" : this.table.isPivotTable() && (this.mode = "pivot"), this.table.options.maintainedDataCount && (this.rowLimit = this.table.options.maintainedDataCount), this.table.options.maintainedColumnCount && (this.colLimit = this.table.options.maintainedColumnCount), "adaptive" === this.table.heightMode && (this.rowLimit = this.table.rowCount), "adaptive" === this.table.widthMode && (this.colLimit = this.table.colCount);
|
|
57966
58113
|
}
|
|
57967
58114
|
get bodyLeftCol() {
|
|
57968
58115
|
return this.table.frozenColCount;
|
|
@@ -57986,7 +58133,7 @@
|
|
|
57986
58133
|
this.bodyBottomRow = this.table.rowCount - 1 - this.table.bottomFrozenRowCount;
|
|
57987
58134
|
const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1);
|
|
57988
58135
|
this.totalActualBodyRowCount = totalActualBodyRowCount, this.totalRow = this.bodyTopRow + totalActualBodyRowCount - 1, this.rowStart = this.bodyTopRow, this.rowEnd = this.totalRow;
|
|
57989
|
-
const defaultRowHeight = this.
|
|
58136
|
+
const defaultRowHeight = this.getEstimatedRowHeightForProxy();
|
|
57990
58137
|
this.taskRowCount = 1 * Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);
|
|
57991
58138
|
const totalBodyHeight = defaultRowHeight * totalActualBodyRowCount,
|
|
57992
58139
|
totalHeight = defaultRowHeight * (this.bodyBottomRow - this.bodyTopRow + 1);
|
|
@@ -58009,11 +58156,16 @@
|
|
|
58009
58156
|
this.taskColCount = 1 * Math.ceil(this.table.tableNoFrameWidth / defaultColWidth);
|
|
58010
58157
|
const widthLimit = 5 * this.table.tableNoFrameWidth;
|
|
58011
58158
|
this.screenColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth), this.firstScreenColLimit = this.bodyLeftCol + Math.min(this.colLimit, Math.ceil(widthLimit / defaultColWidth));
|
|
58012
|
-
const defaultRowHeight = this.
|
|
58159
|
+
const defaultRowHeight = this.getEstimatedRowHeightForProxy();
|
|
58013
58160
|
this.taskRowCount = 1 * Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);
|
|
58014
58161
|
const heightLimit = 5 * this.table.tableNoFrameHeight;
|
|
58015
58162
|
this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight), this.firstScreenRowLimit = this.bodyTopRow + Math.min(this.rowLimit, Math.ceil(heightLimit / defaultRowHeight));
|
|
58016
58163
|
}
|
|
58164
|
+
getEstimatedRowHeightForProxy() {
|
|
58165
|
+
var _a;
|
|
58166
|
+
const minSingleRowHeight = null === (_a = this.table.options.customConfig) || void 0 === _a ? void 0 : _a.minSingleRowHeight;
|
|
58167
|
+
return "autoHeight" === this.table.heightMode ? isNumber$3(minSingleRowHeight) && minSingleRowHeight > 0 ? minSingleRowHeight : 2 : this.table.defaultRowHeight;
|
|
58168
|
+
}
|
|
58017
58169
|
createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin) {
|
|
58018
58170
|
createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin, this);
|
|
58019
58171
|
}
|
|
@@ -59610,6 +59762,7 @@
|
|
|
59610
59762
|
},
|
|
59611
59763
|
placement: baseIcon.tooltip.placement
|
|
59612
59764
|
},
|
|
59765
|
+
appearDelay: baseIcon.tooltip.appearDelay,
|
|
59613
59766
|
disappearDelay: baseIcon.tooltip.disappearDelay,
|
|
59614
59767
|
style: Object.assign({}, null === (_a = scene.table.internalProps.theme) || void 0 === _a ? void 0 : _a.tooltipStyle, null === (_b = baseIcon.tooltip) || void 0 === _b ? void 0 : _b.style)
|
|
59615
59768
|
};
|
|
@@ -60422,51 +60575,17 @@
|
|
|
60422
60575
|
this.proxy.resize(), ("adaptive" === this.table.widthMode || this.table.autoFillWidth) && (0 === this.table.internalProps._widthResizedColMap.size ? this.recalculateColWidths() : this.dealWidthMode()), "adaptive" === this.table.heightMode ? 0 === this.table.internalProps._heightResizedRowMap.size ? this.recalculateRowHeights() : this.dealHeightMode() : this.table.autoFillHeight && this.dealHeightMode(), this.resetFrozen(), this.updateTableSize(), this.updateBorderSizeAndPosition(), this.component.updateScrollBar(), ("adaptive" === this.table.widthMode || "adaptive" === this.table.heightMode || this.table.autoFillWidth || this.table.autoFillHeight || (null === (_a = this.table.containerFit) || void 0 === _a ? void 0 : _a.width) || (null === (_b = this.table.containerFit) || void 0 === _b ? void 0 : _b.height)) && this.updateChartSizeForResizeColWidth(-1), this.proxy.progress(), this.updateNextFrame();
|
|
60423
60576
|
}
|
|
60424
60577
|
updateTableSize() {
|
|
60425
|
-
var _a, _b, _c
|
|
60578
|
+
var _a, _b, _c;
|
|
60426
60579
|
const contentWidth = Math.max(this.colHeaderGroup.attribute.width, this.bodyGroup.attribute.width, this.bottomFrozenGroup.attribute.width, 0) + Math.max(this.cornerHeaderGroup.attribute.width, this.rowHeaderGroup.attribute.width, this.leftBottomCornerGroup.attribute.width, 0) + Math.max(this.rightTopCornerGroup.attribute.width, this.rightFrozenGroup.attribute.width, this.rightBottomCornerGroup.attribute.width, 0),
|
|
60427
60580
|
contentHeight = Math.max(this.colHeaderGroup.attribute.height, this.cornerHeaderGroup.attribute.height, this.rightTopCornerGroup.attribute.height, 0) + Math.max(this.rowHeaderGroup.attribute.height, this.bodyGroup.attribute.height, this.rightFrozenGroup.attribute.height, 0) + Math.max(this.leftBottomCornerGroup.attribute.height, this.bottomFrozenGroup.attribute.height, this.rightBottomCornerGroup.attribute.height, 0);
|
|
60428
60581
|
let tableWidth = contentWidth,
|
|
60429
60582
|
tableHeight = contentHeight;
|
|
60430
|
-
|
|
60583
|
+
tableWidth = (null === (_a = this.table.containerFit) || void 0 === _a ? void 0 : _a.width) ? this.table.tableNoFrameWidth : Math.min(this.table.tableNoFrameWidth, contentWidth), tableHeight = (null === (_b = this.table.containerFit) || void 0 === _b ? void 0 : _b.height) ? this.table.tableNoFrameHeight : Math.min(this.table.tableNoFrameHeight, contentHeight), this.tableGroup.setAttributes({
|
|
60431
60584
|
x: this.table.tableX,
|
|
60432
60585
|
y: this.table.tableY,
|
|
60433
60586
|
width: tableWidth,
|
|
60434
60587
|
height: tableHeight
|
|
60435
|
-
})
|
|
60436
|
-
const rectAttributes = null === (_c = this.tableGroup.border) || void 0 === _c ? void 0 : _c.attribute;
|
|
60437
|
-
let borderTop, borderRight, borderBottom, borderLeft;
|
|
60438
|
-
(null == rectAttributes ? void 0 : rectAttributes.strokeArrayWidth) ? (borderTop = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[0] : null !== (_d = rectAttributes.lineWidth) && void 0 !== _d ? _d : 0, borderRight = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[1] : null !== (_e = rectAttributes.lineWidth) && void 0 !== _e ? _e : 0, borderBottom = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[2] : null !== (_f = rectAttributes.lineWidth) && void 0 !== _f ? _f : 0, borderLeft = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[3] : null !== (_g = rectAttributes.lineWidth) && void 0 !== _g ? _g : 0) : (borderTop = null !== (_h = null == rectAttributes ? void 0 : rectAttributes.lineWidth) && void 0 !== _h ? _h : 0, borderRight = null !== (_j = null == rectAttributes ? void 0 : rectAttributes.lineWidth) && void 0 !== _j ? _j : 0, borderBottom = null !== (_k = null == rectAttributes ? void 0 : rectAttributes.lineWidth) && void 0 !== _k ? _k : 0, borderLeft = null !== (_l = null == rectAttributes ? void 0 : rectAttributes.lineWidth) && void 0 !== _l ? _l : 0), "rect" === this.tableGroup.border.type ? (null === (_m = this.table.theme.frameStyle) || void 0 === _m ? void 0 : _m.innerBorder) ? this.tableGroup.border.setAttributes({
|
|
60439
|
-
x: this.table.tableX + borderLeft / 2,
|
|
60440
|
-
y: this.table.tableY + borderTop / 2,
|
|
60441
|
-
width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
60442
|
-
height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
|
|
60443
|
-
}) : this.tableGroup.border.setAttributes({
|
|
60444
|
-
x: this.table.tableX - borderLeft / 2,
|
|
60445
|
-
y: this.table.tableY - borderTop / 2,
|
|
60446
|
-
width: this.tableGroup.attribute.width + borderLeft / 2 + borderRight / 2,
|
|
60447
|
-
height: this.tableGroup.attribute.height + borderTop / 2 + borderBottom / 2
|
|
60448
|
-
}) : "group" === this.tableGroup.border.type && ((null === (_o = this.table.theme.frameStyle) || void 0 === _o ? void 0 : _o.innerBorder) ? (this.tableGroup.border.setAttributes({
|
|
60449
|
-
x: this.table.tableX + borderLeft / 2,
|
|
60450
|
-
y: this.table.tableY + borderTop / 2,
|
|
60451
|
-
width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
60452
|
-
height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
|
|
60453
|
-
}), null === (_p = this.tableGroup.border.firstChild) || void 0 === _p || _p.setAttributes({
|
|
60454
|
-
x: 0,
|
|
60455
|
-
y: 0,
|
|
60456
|
-
width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
60457
|
-
height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
|
|
60458
|
-
})) : (this.tableGroup.border.setAttributes({
|
|
60459
|
-
x: this.table.tableX - borderLeft / 2,
|
|
60460
|
-
y: this.table.tableY - borderTop / 2,
|
|
60461
|
-
width: this.tableGroup.attribute.width + borderLeft / 2 + borderRight / 2,
|
|
60462
|
-
height: this.tableGroup.attribute.height + borderTop / 2 + borderBottom / 2
|
|
60463
|
-
}), null === (_q = this.tableGroup.border.firstChild) || void 0 === _q || _q.setAttributes({
|
|
60464
|
-
x: borderLeft / 2,
|
|
60465
|
-
y: borderTop / 2,
|
|
60466
|
-
width: this.tableGroup.attribute.width,
|
|
60467
|
-
height: this.tableGroup.attribute.height
|
|
60468
|
-
})));
|
|
60469
|
-
}
|
|
60588
|
+
});
|
|
60470
60589
|
const hasFrozenCols = this.table.frozenColCount > 0,
|
|
60471
60590
|
hasRightFrozenCols = this.table.rightFrozenColCount > 0,
|
|
60472
60591
|
hasFrozenRows = this.table.frozenRowCount > 0,
|
|
@@ -60517,7 +60636,48 @@
|
|
|
60517
60636
|
width: 0,
|
|
60518
60637
|
height: 0
|
|
60519
60638
|
});
|
|
60520
|
-
this.
|
|
60639
|
+
if (hasBottomFrozenRows && !(null === (_c = this.table.containerFit) || void 0 === _c ? void 0 : _c.height)) {
|
|
60640
|
+
const actualContentBottom = Math.max(this.colHeaderGroup.attribute.y + this.colHeaderGroup.attribute.height, this.cornerHeaderGroup.attribute.y + this.cornerHeaderGroup.attribute.height, this.rightTopCornerGroup.attribute.y + this.rightTopCornerGroup.attribute.height, this.rowHeaderGroup.attribute.y + this.rowHeaderGroup.attribute.height, this.bodyGroup.attribute.y + this.bodyGroup.attribute.height, this.rightFrozenGroup.attribute.y + this.rightFrozenGroup.attribute.height, this.leftBottomCornerGroup.attribute.y + this.leftBottomCornerGroup.attribute.height, this.bottomFrozenGroup.attribute.y + this.bottomFrozenGroup.attribute.height, this.rightBottomCornerGroup.attribute.y + this.rightBottomCornerGroup.attribute.height);
|
|
60641
|
+
actualContentBottom > 0 && actualContentBottom < this.tableGroup.attribute.height && this.tableGroup.setAttribute("height", actualContentBottom);
|
|
60642
|
+
}
|
|
60643
|
+
this.updateTableGroupBorder(), this.updateDomContainer();
|
|
60644
|
+
}
|
|
60645
|
+
updateTableGroupBorder() {
|
|
60646
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
60647
|
+
if (!this.tableGroup.border) return;
|
|
60648
|
+
const rectAttributes = null === (_a = this.tableGroup.border) || void 0 === _a ? void 0 : _a.attribute;
|
|
60649
|
+
let borderTop, borderRight, borderBottom, borderLeft;
|
|
60650
|
+
(null == rectAttributes ? void 0 : rectAttributes.strokeArrayWidth) ? (borderTop = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[0] : null !== (_b = rectAttributes.lineWidth) && void 0 !== _b ? _b : 0, borderRight = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[1] : null !== (_c = rectAttributes.lineWidth) && void 0 !== _c ? _c : 0, borderBottom = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[2] : null !== (_d = rectAttributes.lineWidth) && void 0 !== _d ? _d : 0, borderLeft = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[3] : null !== (_e = rectAttributes.lineWidth) && void 0 !== _e ? _e : 0) : (borderTop = null !== (_f = null == rectAttributes ? void 0 : rectAttributes.lineWidth) && void 0 !== _f ? _f : 0, borderRight = null !== (_g = null == rectAttributes ? void 0 : rectAttributes.lineWidth) && void 0 !== _g ? _g : 0, borderBottom = null !== (_h = null == rectAttributes ? void 0 : rectAttributes.lineWidth) && void 0 !== _h ? _h : 0, borderLeft = null !== (_j = null == rectAttributes ? void 0 : rectAttributes.lineWidth) && void 0 !== _j ? _j : 0), "rect" === this.tableGroup.border.type ? (null === (_k = this.table.theme.frameStyle) || void 0 === _k ? void 0 : _k.innerBorder) ? this.tableGroup.border.setAttributes({
|
|
60651
|
+
x: this.table.tableX + borderLeft / 2,
|
|
60652
|
+
y: this.table.tableY + borderTop / 2,
|
|
60653
|
+
width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
60654
|
+
height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
|
|
60655
|
+
}) : this.tableGroup.border.setAttributes({
|
|
60656
|
+
x: this.table.tableX - borderLeft / 2,
|
|
60657
|
+
y: this.table.tableY - borderTop / 2,
|
|
60658
|
+
width: this.tableGroup.attribute.width + borderLeft / 2 + borderRight / 2,
|
|
60659
|
+
height: this.tableGroup.attribute.height + borderTop / 2 + borderBottom / 2
|
|
60660
|
+
}) : "group" === this.tableGroup.border.type && ((null === (_l = this.table.theme.frameStyle) || void 0 === _l ? void 0 : _l.innerBorder) ? (this.tableGroup.border.setAttributes({
|
|
60661
|
+
x: this.table.tableX + borderLeft / 2,
|
|
60662
|
+
y: this.table.tableY + borderTop / 2,
|
|
60663
|
+
width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
60664
|
+
height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
|
|
60665
|
+
}), null === (_m = this.tableGroup.border.firstChild) || void 0 === _m || _m.setAttributes({
|
|
60666
|
+
x: 0,
|
|
60667
|
+
y: 0,
|
|
60668
|
+
width: this.tableGroup.attribute.width - borderLeft / 2 - borderRight / 2,
|
|
60669
|
+
height: this.tableGroup.attribute.height - borderTop / 2 - borderBottom / 2
|
|
60670
|
+
})) : (this.tableGroup.border.setAttributes({
|
|
60671
|
+
x: this.table.tableX - borderLeft / 2,
|
|
60672
|
+
y: this.table.tableY - borderTop / 2,
|
|
60673
|
+
width: this.tableGroup.attribute.width + borderLeft / 2 + borderRight / 2,
|
|
60674
|
+
height: this.tableGroup.attribute.height + borderTop / 2 + borderBottom / 2
|
|
60675
|
+
}), null === (_o = this.tableGroup.border.firstChild) || void 0 === _o || _o.setAttributes({
|
|
60676
|
+
x: borderLeft / 2,
|
|
60677
|
+
y: borderTop / 2,
|
|
60678
|
+
width: this.tableGroup.attribute.width,
|
|
60679
|
+
height: this.tableGroup.attribute.height
|
|
60680
|
+
})));
|
|
60521
60681
|
}
|
|
60522
60682
|
updateRowHeight(row, detaY, skipTableHeightMap) {
|
|
60523
60683
|
detaY = Math.round(detaY), updateRowHeight(this, row, detaY, skipTableHeightMap), this.updateContainerHeight(row, detaY);
|
|
@@ -60814,7 +60974,7 @@
|
|
|
60814
60974
|
var _a;
|
|
60815
60975
|
const type = (null === (_a = this.table.getCellRawRecord(col, row)) || void 0 === _a ? void 0 : _a.vtableMerge) ? "text" : this.table.getCellType(col, row),
|
|
60816
60976
|
cellGroup = this.getCell(col, row);
|
|
60817
|
-
"image" !== type && "video" !== type || updateImageCellContentWhileResize(cellGroup, col, row, 0, 0, this.table);
|
|
60977
|
+
"image" !== type && "video" !== type && "audio" !== type || updateImageCellContentWhileResize(cellGroup, col, row, 0, 0, this.table);
|
|
60818
60978
|
}
|
|
60819
60979
|
createFrameBorder() {
|
|
60820
60980
|
var _a, _b, _c, _d, _e;
|
|
@@ -61794,7 +61954,12 @@
|
|
|
61794
61954
|
colMax = Math.max(sourceMergeInfo.end.col, targetMergeInfo.end.col, oldSourceMergeInfo.end.col, oldTargetMergeInfo.end.col),
|
|
61795
61955
|
rowMin = Math.min(sourceMergeInfo.start.row, targetMergeInfo.start.row, oldSourceMergeInfo.start.row, oldTargetMergeInfo.start.row);
|
|
61796
61956
|
let rowMax = Math.max(sourceMergeInfo.end.row, targetMergeInfo.end.row, oldSourceMergeInfo.end.row, oldTargetMergeInfo.end.row);
|
|
61797
|
-
"row" === moveContext.moveType && "tree" === state.table.internalProps.layoutMap.rowHierarchyType && (rowMax = moveContext.targetIndex > moveContext.sourceIndex ? rowMax + moveContext.targetSize - 1 : rowMax + moveContext.sourceSize - 1), state.table.
|
|
61957
|
+
if ("row" === moveContext.moveType && "tree" === state.table.internalProps.layoutMap.rowHierarchyType && (rowMax = moveContext.targetIndex > moveContext.sourceIndex ? rowMax + moveContext.targetSize - 1 : rowMax + moveContext.sourceSize - 1), state.table.isListTable() && !state.table.transpose && (state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource) || "row" === state.columnMove.movingColumnOrRow)) {
|
|
61958
|
+
const sourceRecordPath = state.table.getRecordIndexByCell(0, moveContext.sourceIndex),
|
|
61959
|
+
targetRecordPath = state.table.getRecordIndexByCell(0, moveContext.targetIndex);
|
|
61960
|
+
state.table.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex), state.changeCheckboxOrder(sourceRecordPath, targetRecordPath), state.changeRadioOrder(sourceRecordPath, targetRecordPath);
|
|
61961
|
+
}
|
|
61962
|
+
"column" === moveContext.moveType ? clearWidthsAndHeightsCache(colMin, colMax, 0, -1, state.table) : clearWidthsAndHeightsCache(0, -1, rowMin, rowMax, state.table), state.table.clearCellStyleCache(), state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource) || "row" === state.columnMove.movingColumnOrRow ? state.table.scenegraph.updateHeaderPosition(state.table.scenegraph.proxy.colStart, state.table.scenegraph.proxy.colEnd, state.table.scenegraph.proxy.rowStart, state.table.scenegraph.proxy.rowEnd, moveContext.moveType) : "column" === moveContext.moveType ? state.table.scenegraph.updateHeaderPosition(colMin, colMax, 0, -1, moveContext.moveType) : state.table.scenegraph.updateHeaderPosition(0, -1, rowMin, rowMax, moveContext.moveType), "adjustFrozenCount" === state.table.internalProps.frozenColDragHeaderMode && state.table.isListTable() && (state.table.isLeftFrozenColumn(state.columnMove.colTarget) && !state.table.isLeftFrozenColumn(state.columnMove.colSource) ? state.table.frozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : state.table.isLeftFrozenColumn(state.columnMove.colSource) && !state.table.isLeftFrozenColumn(state.columnMove.colTarget) && (state.table.frozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1), state.table.isRightFrozenColumn(state.columnMove.colTarget) && !state.table.isRightFrozenColumn(state.columnMove.colSource) ? state.table.rightFrozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : state.table.isRightFrozenColumn(state.columnMove.colSource) && !state.table.isRightFrozenColumn(state.columnMove.colTarget) && (state.table.rightFrozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1)), moveColResult = !0;
|
|
61798
61963
|
}
|
|
61799
61964
|
}
|
|
61800
61965
|
return state.columnMove.moving = !1, setTimeout(() => {
|
|
@@ -61969,20 +62134,71 @@
|
|
|
61969
62134
|
null == radio || radio._handlePointerUp();
|
|
61970
62135
|
}
|
|
61971
62136
|
}
|
|
61972
|
-
function
|
|
61973
|
-
|
|
61974
|
-
|
|
61975
|
-
|
|
61976
|
-
|
|
61977
|
-
|
|
61978
|
-
|
|
61979
|
-
|
|
61980
|
-
|
|
61981
|
-
|
|
61982
|
-
|
|
61983
|
-
|
|
61984
|
-
|
|
62137
|
+
function normalizeRecordPath$1(recordPath) {
|
|
62138
|
+
return Array.isArray(recordPath) ? recordPath : [recordPath];
|
|
62139
|
+
}
|
|
62140
|
+
function parseRecordPathKey(key) {
|
|
62141
|
+
return isNumber$3(key) ? [key] : key.split(",").map(item => Number(item));
|
|
62142
|
+
}
|
|
62143
|
+
function isSameRecordPath$1(source, target) {
|
|
62144
|
+
return source.length === target.length && source.every((item, index) => item === target[index]);
|
|
62145
|
+
}
|
|
62146
|
+
function isSameParentPath$1(source, target) {
|
|
62147
|
+
return source.length === target.length && source.slice(0, -1).every((item, index) => item === target[index]);
|
|
62148
|
+
}
|
|
62149
|
+
function isDescendantPath$1(path, ancestor) {
|
|
62150
|
+
return ancestor.length <= path.length && ancestor.every((item, index) => item === path[index]);
|
|
62151
|
+
}
|
|
62152
|
+
function getMovedRecordPath$1(path, source, target) {
|
|
62153
|
+
return target.concat(path.slice(source.length));
|
|
62154
|
+
}
|
|
62155
|
+
function getShiftedSiblingPath$1(path, parent, sourceIndex, targetIndex) {
|
|
62156
|
+
if (path.length <= parent.length || !isDescendantPath$1(path.slice(0, parent.length), parent)) return path;
|
|
62157
|
+
const siblingIndex = path[parent.length];
|
|
62158
|
+
if (sourceIndex < targetIndex && siblingIndex > sourceIndex && siblingIndex <= targetIndex) {
|
|
62159
|
+
const shifted = [...path];
|
|
62160
|
+
return shifted[parent.length] = siblingIndex - 1, shifted;
|
|
62161
|
+
}
|
|
62162
|
+
if (sourceIndex > targetIndex && siblingIndex >= targetIndex && siblingIndex < sourceIndex) {
|
|
62163
|
+
const shifted = [...path];
|
|
62164
|
+
return shifted[parent.length] = siblingIndex + 1, shifted;
|
|
61985
62165
|
}
|
|
62166
|
+
return path;
|
|
62167
|
+
}
|
|
62168
|
+
function getChangedRecordPath(path, sourcePath, targetPath) {
|
|
62169
|
+
const parentPath = sourcePath.slice(0, -1),
|
|
62170
|
+
sourceIndex = sourcePath[sourcePath.length - 1],
|
|
62171
|
+
targetIndex = targetPath[targetPath.length - 1];
|
|
62172
|
+
return isDescendantPath$1(path, sourcePath) ? getMovedRecordPath$1(path, sourcePath, targetPath) : getShiftedSiblingPath$1(path, parentPath, sourceIndex, targetIndex);
|
|
62173
|
+
}
|
|
62174
|
+
function getRadioStateValue(recordPath) {
|
|
62175
|
+
return 1 === recordPath.length ? recordPath[0] : recordPath;
|
|
62176
|
+
}
|
|
62177
|
+
function getRadioStateKey(recordPath) {
|
|
62178
|
+
return recordPath.toString();
|
|
62179
|
+
}
|
|
62180
|
+
function changeRadioStateValue(value, sourcePath, targetPath) {
|
|
62181
|
+
if (isNumber$3(value)) return getRadioStateValue(getChangedRecordPath([value], sourcePath, targetPath));
|
|
62182
|
+
if (Array.isArray(value)) return getRadioStateValue(getChangedRecordPath(value, sourcePath, targetPath));
|
|
62183
|
+
if (isString$2(value)) return getRadioStateKey(getChangedRecordPath(parseRecordPathKey(value), sourcePath, targetPath));
|
|
62184
|
+
if (isObject$8(value)) {
|
|
62185
|
+
const nextValue = {};
|
|
62186
|
+
return Object.keys(value).forEach(key => {
|
|
62187
|
+
const nextPath = getChangedRecordPath(parseRecordPathKey(key), sourcePath, targetPath);
|
|
62188
|
+
nextValue[getRadioStateKey(nextPath)] = value[key];
|
|
62189
|
+
}), nextValue;
|
|
62190
|
+
}
|
|
62191
|
+
return value;
|
|
62192
|
+
}
|
|
62193
|
+
function changeRadioOrder(sourceRecordPath, targetRecordPath, state) {
|
|
62194
|
+
const {
|
|
62195
|
+
radioState: radioState
|
|
62196
|
+
} = state,
|
|
62197
|
+
sourcePath = normalizeRecordPath$1(sourceRecordPath),
|
|
62198
|
+
targetPath = normalizeRecordPath$1(targetRecordPath);
|
|
62199
|
+
!isSameRecordPath$1(sourcePath, targetPath) && isSameParentPath$1(sourcePath, targetPath) && Object.keys(radioState).forEach(field => {
|
|
62200
|
+
radioState[field] = changeRadioStateValue(radioState[field], sourcePath, targetPath);
|
|
62201
|
+
});
|
|
61986
62202
|
}
|
|
61987
62203
|
|
|
61988
62204
|
function setCheckedState(col, row, field, checked, state) {
|
|
@@ -62107,41 +62323,58 @@
|
|
|
62107
62323
|
checkbox = (null == cellGroup ? void 0 : cellGroup.getChildByName("checkbox")) || (null === (_b = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildByName("checkbox-content")) || void 0 === _a ? void 0 : _a._checkboxGroup) || void 0 === _b ? void 0 : _b.getChildByName("checkbox"));
|
|
62108
62324
|
checkbox && ("indeterminate" === checked ? (checkbox.setAttribute("indeterminate", !0), checkbox.setAttribute("checked", void 0)) : (checkbox.setAttribute("indeterminate", void 0), checkbox.setAttribute("checked", checked)));
|
|
62109
62325
|
}
|
|
62110
|
-
function
|
|
62111
|
-
|
|
62112
|
-
|
|
62113
|
-
|
|
62114
|
-
|
|
62115
|
-
|
|
62116
|
-
|
|
62117
|
-
|
|
62118
|
-
|
|
62119
|
-
|
|
62120
|
-
|
|
62121
|
-
|
|
62122
|
-
|
|
62123
|
-
|
|
62124
|
-
|
|
62125
|
-
|
|
62126
|
-
|
|
62127
|
-
|
|
62128
|
-
|
|
62129
|
-
|
|
62130
|
-
|
|
62131
|
-
|
|
62132
|
-
|
|
62133
|
-
|
|
62134
|
-
|
|
62135
|
-
|
|
62136
|
-
|
|
62137
|
-
|
|
62138
|
-
|
|
62139
|
-
|
|
62140
|
-
|
|
62141
|
-
next[next.length - 1] = i + 1, checkedState.set(now.toString(), checkedState.get(next.toString()));
|
|
62142
|
-
}
|
|
62143
|
-
checkedState.set(target.toString(), sourceRecord);
|
|
62326
|
+
function normalizeRecordPath(recordPath) {
|
|
62327
|
+
return isArray$5(recordPath) ? recordPath : [recordPath];
|
|
62328
|
+
}
|
|
62329
|
+
function parseCheckboxStateKey(key) {
|
|
62330
|
+
return isNumber$3(key) ? [key] : key.split(",").map(item => Number(item));
|
|
62331
|
+
}
|
|
62332
|
+
function stringifyRecordPath(recordPath) {
|
|
62333
|
+
return recordPath.toString();
|
|
62334
|
+
}
|
|
62335
|
+
function isSameRecordPath(source, target) {
|
|
62336
|
+
return source.length === target.length && source.every((item, index) => item === target[index]);
|
|
62337
|
+
}
|
|
62338
|
+
function isSameParentPath(source, target) {
|
|
62339
|
+
return source.length === target.length && source.slice(0, -1).every((item, index) => item === target[index]);
|
|
62340
|
+
}
|
|
62341
|
+
function isDescendantPath(path, ancestor) {
|
|
62342
|
+
return ancestor.length <= path.length && ancestor.every((item, index) => item === path[index]);
|
|
62343
|
+
}
|
|
62344
|
+
function getMovedRecordPath(path, source, target) {
|
|
62345
|
+
return target.concat(path.slice(source.length));
|
|
62346
|
+
}
|
|
62347
|
+
function getShiftedSiblingPath(path, parent, sourceIndex, targetIndex) {
|
|
62348
|
+
if (path.length <= parent.length || !isDescendantPath(path.slice(0, parent.length), parent)) return path;
|
|
62349
|
+
const siblingIndex = path[parent.length];
|
|
62350
|
+
if (sourceIndex < targetIndex && siblingIndex > sourceIndex && siblingIndex <= targetIndex) {
|
|
62351
|
+
const shifted = [...path];
|
|
62352
|
+
return shifted[parent.length] = siblingIndex - 1, shifted;
|
|
62353
|
+
}
|
|
62354
|
+
if (sourceIndex > targetIndex && siblingIndex >= targetIndex && siblingIndex < sourceIndex) {
|
|
62355
|
+
const shifted = [...path];
|
|
62356
|
+
return shifted[parent.length] = siblingIndex + 1, shifted;
|
|
62144
62357
|
}
|
|
62358
|
+
return path;
|
|
62359
|
+
}
|
|
62360
|
+
function changeCheckboxOrder(sourceRecordPath, targetRecordPath, state) {
|
|
62361
|
+
const {
|
|
62362
|
+
checkedState: checkedState
|
|
62363
|
+
} = state,
|
|
62364
|
+
sourcePath = normalizeRecordPath(sourceRecordPath),
|
|
62365
|
+
targetPath = normalizeRecordPath(targetRecordPath);
|
|
62366
|
+
if (isSameRecordPath(sourcePath, targetPath) || !isSameParentPath(sourcePath, targetPath)) return;
|
|
62367
|
+
const parentPath = sourcePath.slice(0, -1),
|
|
62368
|
+
sourceIndex = sourcePath[sourcePath.length - 1],
|
|
62369
|
+
targetIndex = targetPath[targetPath.length - 1],
|
|
62370
|
+
nextCheckedState = new Map();
|
|
62371
|
+
checkedState.forEach((value, key) => {
|
|
62372
|
+
const keyPath = parseCheckboxStateKey(key);
|
|
62373
|
+
let nextPath;
|
|
62374
|
+
nextPath = isDescendantPath(keyPath, sourcePath) ? getMovedRecordPath(keyPath, sourcePath, targetPath) : getShiftedSiblingPath(keyPath, parentPath, sourceIndex, targetIndex), nextCheckedState.set(stringifyRecordPath(nextPath), value);
|
|
62375
|
+
}), checkedState.clear(), nextCheckedState.forEach((value, key) => {
|
|
62376
|
+
checkedState.set(key, value);
|
|
62377
|
+
});
|
|
62145
62378
|
}
|
|
62146
62379
|
function getGroupCheckboxState(table) {
|
|
62147
62380
|
const result = [],
|
|
@@ -62694,6 +62927,7 @@
|
|
|
62694
62927
|
placement: inlineIcon.attribute.tooltip.placement
|
|
62695
62928
|
},
|
|
62696
62929
|
style: Object.assign({}, null === (_e = this.table.internalProps.theme) || void 0 === _e ? void 0 : _e.tooltipStyle, null === (_f = inlineIcon.tooltip) || void 0 === _f ? void 0 : _f.style, null === (_h = null === (_g = inlineIcon.attribute) || void 0 === _g ? void 0 : _g.tooltip) || void 0 === _h ? void 0 : _h.style),
|
|
62930
|
+
appearDelay: inlineIcon.attribute.tooltip.appearDelay,
|
|
62697
62931
|
disappearDelay: inlineIcon.attribute.tooltip.disappearDelay
|
|
62698
62932
|
};
|
|
62699
62933
|
this.table.internalProps.tooltipHandler.isBinded(tooltipOptions) || this.table.showTooltip(col, row, tooltipOptions);
|
|
@@ -63278,16 +63512,117 @@
|
|
|
63278
63512
|
syncRadioState(col, row, field, radioType, indexInCell, isChecked) {
|
|
63279
63513
|
return syncRadioState(col, row, field, radioType, indexInCell, isChecked, this);
|
|
63280
63514
|
}
|
|
63281
|
-
|
|
63282
|
-
this.checkedState.size && changeCheckboxOrder(
|
|
63515
|
+
changeCheckboxOrder(sourceRecordPath, targetRecordPath) {
|
|
63516
|
+
this.checkedState.size && changeCheckboxOrder(sourceRecordPath, targetRecordPath, this);
|
|
63517
|
+
}
|
|
63518
|
+
changeRadioOrder(sourceRecordPath, targetRecordPath) {
|
|
63519
|
+
Object.keys(this.radioState).length && changeRadioOrder(sourceRecordPath, targetRecordPath, this);
|
|
63283
63520
|
}
|
|
63284
63521
|
setCustomSelectRanges(customSelectRanges) {
|
|
63285
63522
|
deletaCustomSelectRanges(this), addCustomSelectRanges(customSelectRanges, this);
|
|
63286
63523
|
}
|
|
63287
63524
|
};
|
|
63288
63525
|
|
|
63526
|
+
const AUDIO_EXTENSIONS = new Set(["mp3", "wav", "oga", "m4a", "aac", "flac", "opus"]);
|
|
63527
|
+
function isAudioUrl(value) {
|
|
63528
|
+
if ("string" != typeof value) return !1;
|
|
63529
|
+
const trimmedValue = value.trim(),
|
|
63530
|
+
queryIndex = trimmedValue.indexOf("?"),
|
|
63531
|
+
hashIndex = trimmedValue.indexOf("#");
|
|
63532
|
+
let endIndex = trimmedValue.length;
|
|
63533
|
+
queryIndex >= 0 && (endIndex = queryIndex), hashIndex >= 0 && hashIndex < endIndex && (endIndex = hashIndex);
|
|
63534
|
+
const path = trimmedValue.slice(0, endIndex),
|
|
63535
|
+
dotIndex = path.lastIndexOf(".");
|
|
63536
|
+
return !(dotIndex < 0 || dotIndex === path.length - 1) && AUDIO_EXTENSIONS.has(path.slice(dotIndex + 1).toLowerCase());
|
|
63537
|
+
}
|
|
63538
|
+
|
|
63539
|
+
const MEDIA_PREVIEW_MANAGER_KEY = "__vtable_media_preview_manager__";
|
|
63540
|
+
function formatAudioTime(time) {
|
|
63541
|
+
if (!Number.isFinite(time) || time < 0) return "0:00";
|
|
63542
|
+
return `${Math.floor(time / 60)}:${Math.floor(time % 60).toString().padStart(2, "0")}`;
|
|
63543
|
+
}
|
|
63544
|
+
function updateAudioProgressStyle(progress, value) {
|
|
63545
|
+
progress.style.background = `linear-gradient(\n to right,\n #2563EB 0%,\n #2563EB ${value}%,\n #D1D5DB ${value}%,\n #D1D5DB 100%\n )`;
|
|
63546
|
+
}
|
|
63547
|
+
function ensureAudioPreviewStyle() {
|
|
63548
|
+
const styleId = "vtable-audio-preview-style";
|
|
63549
|
+
if (document.getElementById(styleId)) return;
|
|
63550
|
+
const style = document.createElement("style");
|
|
63551
|
+
style.id = styleId, style.textContent = "\n .vtable-audio-preview-progress {\n -webkit-appearance: none;\n appearance: none;\n }\n .vtable-audio-preview-progress::-webkit-slider-runnable-track {\n height: 4px;\n border-radius: 999px;\n background: transparent;\n }\n .vtable-audio-preview-progress::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 12px;\n height: 12px;\n margin-top: -4px;\n border-radius: 50%;\n border: 0;\n background: #2563EB;\n }\n .vtable-audio-preview-progress::-moz-range-track {\n height: 4px;\n border-radius: 999px;\n background: transparent;\n }\n .vtable-audio-preview-progress::-moz-range-thumb {\n width: 12px;\n height: 12px;\n border-radius: 50%;\n border: 0;\n background: #2563EB;\n }\n ", document.head.appendChild(style);
|
|
63552
|
+
}
|
|
63553
|
+
function createAudioPreview(cellValue) {
|
|
63554
|
+
ensureAudioPreviewStyle();
|
|
63555
|
+
const audio = document.createElement("audio");
|
|
63556
|
+
audio.src = cellValue, audio.preload = "auto";
|
|
63557
|
+
let released = !1;
|
|
63558
|
+
const wrapper = document.createElement("div");
|
|
63559
|
+
wrapper.style.width = "80%", wrapper.style.maxWidth = "640px", wrapper.style.height = "54px", wrapper.style.boxSizing = "border-box", wrapper.style.padding = "0 16px", wrapper.style.borderRadius = "27px", wrapper.style.background = "#F8FAFC", wrapper.style.display = "flex", wrapper.style.alignItems = "center", wrapper.style.gap = "10px", wrapper.style.boxShadow = "0 8px 24px rgba(15, 23, 42, 0.16)";
|
|
63560
|
+
const playButton = document.createElement("button");
|
|
63561
|
+
playButton.type = "button", playButton.textContent = "▶", playButton.style.width = "34px", playButton.style.height = "34px", playButton.style.border = "1px solid #CBD5E1", playButton.style.borderRadius = "8px", playButton.style.background = "#EFF6FF", playButton.style.color = "#0F172A", playButton.style.cursor = "pointer", playButton.style.flex = "0 0 auto", playButton.style.fontSize = "14px";
|
|
63562
|
+
const timeLabel = document.createElement("span");
|
|
63563
|
+
timeLabel.textContent = "0:00 / 0:00", timeLabel.style.color = "#0F172A", timeLabel.style.font = "14px sans-serif", timeLabel.style.whiteSpace = "nowrap";
|
|
63564
|
+
const progress = document.createElement("input");
|
|
63565
|
+
progress.className = "vtable-audio-preview-progress", progress.type = "range", progress.min = "0", progress.max = "100", progress.value = "0", progress.step = "0.1", progress.style.flex = "1 1 auto", progress.style.height = "4px", progress.style.borderRadius = "999px", progress.style.outline = "none", progress.style.cursor = "pointer", progress.style.accentColor = "#2563EB", updateAudioProgressStyle(progress, 0);
|
|
63566
|
+
const updateProgress = () => {
|
|
63567
|
+
const duration = Number.isFinite(audio.duration) ? audio.duration : 0,
|
|
63568
|
+
currentTime = audio.currentTime || 0,
|
|
63569
|
+
value = duration > 0 ? Math.min(100, currentTime / duration * 100) : 0;
|
|
63570
|
+
progress.disabled = duration <= 0, progress.style.cursor = duration > 0 ? "pointer" : "default", progress.value = `${value}`, timeLabel.textContent = `${formatAudioTime(currentTime)} / ${formatAudioTime(duration)}`, updateAudioProgressStyle(progress, value);
|
|
63571
|
+
};
|
|
63572
|
+
return playButton.addEventListener("click", e => {
|
|
63573
|
+
if (e.stopPropagation(), audio.paused) {
|
|
63574
|
+
const playPromise = audio.play();
|
|
63575
|
+
playPromise && playPromise.catch(error => {
|
|
63576
|
+
released || "AbortError" === (null == error ? void 0 : error.name) || (playButton.textContent = "▶");
|
|
63577
|
+
});
|
|
63578
|
+
} else audio.pause();
|
|
63579
|
+
}), progress.addEventListener("click", e => {
|
|
63580
|
+
e.stopPropagation();
|
|
63581
|
+
}), progress.addEventListener("input", () => {
|
|
63582
|
+
const duration = Number.isFinite(audio.duration) ? audio.duration : 0,
|
|
63583
|
+
value = Number(progress.value);
|
|
63584
|
+
duration > 0 && Number.isFinite(value) && (audio.currentTime = duration * value / 100), updateProgress();
|
|
63585
|
+
}), audio.addEventListener("loadedmetadata", updateProgress), audio.addEventListener("durationchange", updateProgress), audio.addEventListener("timeupdate", updateProgress), audio.addEventListener("play", () => {
|
|
63586
|
+
playButton.textContent = "❚❚";
|
|
63587
|
+
}), audio.addEventListener("pause", () => {
|
|
63588
|
+
playButton.textContent = "▶";
|
|
63589
|
+
}), audio.addEventListener("ended", () => {
|
|
63590
|
+
audio.currentTime = 0, playButton.textContent = "▶", updateProgress();
|
|
63591
|
+
}), wrapper.appendChild(playButton), wrapper.appendChild(timeLabel), wrapper.appendChild(progress), wrapper.appendChild(audio), {
|
|
63592
|
+
element: wrapper,
|
|
63593
|
+
destroy: () => {
|
|
63594
|
+
released = !0, audio.pause(), audio.removeAttribute("src"), audio.load();
|
|
63595
|
+
}
|
|
63596
|
+
};
|
|
63597
|
+
}
|
|
63598
|
+
function createMediaPreviewManager(table) {
|
|
63599
|
+
const manager = {
|
|
63600
|
+
closePreview: null,
|
|
63601
|
+
registered: !1,
|
|
63602
|
+
close() {
|
|
63603
|
+
const closePreview = manager.closePreview;
|
|
63604
|
+
manager.closePreview = null, null == closePreview || closePreview();
|
|
63605
|
+
},
|
|
63606
|
+
open(closePreview) {
|
|
63607
|
+
manager.close(), manager.closePreview = closePreview;
|
|
63608
|
+
},
|
|
63609
|
+
release() {
|
|
63610
|
+
manager.close(), manager.registered = !1;
|
|
63611
|
+
},
|
|
63612
|
+
ensureRegistered() {
|
|
63613
|
+
manager.registered || (table.addReleaseObj(manager), manager.registered = !0);
|
|
63614
|
+
}
|
|
63615
|
+
};
|
|
63616
|
+
return manager;
|
|
63617
|
+
}
|
|
63618
|
+
function getMediaPreviewManager(table) {
|
|
63619
|
+
const tableWithManager = table;
|
|
63620
|
+
tableWithManager[MEDIA_PREVIEW_MANAGER_KEY] || (tableWithManager[MEDIA_PREVIEW_MANAGER_KEY] = createMediaPreviewManager(table));
|
|
63621
|
+
const manager = tableWithManager[MEDIA_PREVIEW_MANAGER_KEY];
|
|
63622
|
+
return manager.ensureRegistered(), manager;
|
|
63623
|
+
}
|
|
63289
63624
|
function bindMediaClick(table) {
|
|
63290
|
-
"browser" === Env$1.mode && table.on(TABLE_EVENT_TYPE.CLICK_CELL, e => {
|
|
63625
|
+
"browser" === Env$1.mode && (getMediaPreviewManager(table), table.on(TABLE_EVENT_TYPE.CLICK_CELL, e => {
|
|
63291
63626
|
const {
|
|
63292
63627
|
col: col,
|
|
63293
63628
|
row: row
|
|
@@ -63343,25 +63678,57 @@
|
|
|
63343
63678
|
clickToPreview: clickToPreview
|
|
63344
63679
|
} = columnDefine;
|
|
63345
63680
|
if (!1 === clickToPreview) return;
|
|
63346
|
-
const
|
|
63347
|
-
|
|
63348
|
-
|
|
63681
|
+
const previewManager = getMediaPreviewManager(table),
|
|
63682
|
+
overlay = document.createElement("div");
|
|
63683
|
+
overlay.style.width = "100%", overlay.style.height = "100%", overlay.style.position = "fixed", overlay.style.top = "0", overlay.style.left = "0", overlay.style.backgroundColor = "rgba(30, 30, 30, 0.4)", overlay.style.display = "flex", overlay.style.justifyContent = "center", overlay.style.alignItems = "center", overlay.style.overflow = "hidden", overlay.style.zIndex = "9999";
|
|
63684
|
+
const closeOverlay = () => {
|
|
63685
|
+
overlay.parentNode && document.body.removeChild(overlay);
|
|
63686
|
+
};
|
|
63687
|
+
previewManager.open(closeOverlay), overlay.addEventListener("click", e => {
|
|
63688
|
+
e.target === overlay && previewManager.close();
|
|
63349
63689
|
});
|
|
63350
63690
|
const image = new Image();
|
|
63351
63691
|
image.src = cellValue, image.style.maxWidth = "80%", image.style.maxHeight = "80%", image.style.backgroundColor = "#FFF", overlay.appendChild(image), document.body.appendChild(overlay);
|
|
63692
|
+
} else if ("audio" === cellType || "video" === cellType && isAudioUrl(cellValue)) {
|
|
63693
|
+
const {
|
|
63694
|
+
clickToPreview: clickToPreview
|
|
63695
|
+
} = columnDefine;
|
|
63696
|
+
if (!1 === clickToPreview) return;
|
|
63697
|
+
const previewManager = getMediaPreviewManager(table),
|
|
63698
|
+
overlay = document.createElement("div");
|
|
63699
|
+
overlay.style.width = "100%", overlay.style.height = "100%", overlay.style.position = "fixed", overlay.style.top = "0", overlay.style.left = "0", overlay.style.backgroundColor = "rgba(30, 30, 30, 0.4)", overlay.style.display = "flex", overlay.style.justifyContent = "center", overlay.style.alignItems = "center", overlay.style.overflow = "hidden", overlay.style.zIndex = "9999";
|
|
63700
|
+
const audioPreview = createAudioPreview(cellValue),
|
|
63701
|
+
closeOverlay = () => {
|
|
63702
|
+
audioPreview.destroy(), overlay.parentNode && document.body.removeChild(overlay);
|
|
63703
|
+
};
|
|
63704
|
+
previewManager.open(closeOverlay), overlay.addEventListener("click", e => {
|
|
63705
|
+
e.target === overlay && previewManager.close();
|
|
63706
|
+
}), overlay.appendChild(audioPreview.element), document.body.appendChild(overlay);
|
|
63352
63707
|
} else if ("video" === cellType) {
|
|
63353
63708
|
const {
|
|
63354
63709
|
clickToPreview: clickToPreview
|
|
63355
63710
|
} = columnDefine;
|
|
63356
63711
|
if (!1 === clickToPreview) return;
|
|
63357
|
-
const
|
|
63358
|
-
|
|
63359
|
-
|
|
63360
|
-
});
|
|
63712
|
+
const previewManager = getMediaPreviewManager(table),
|
|
63713
|
+
overlay = document.createElement("div");
|
|
63714
|
+
overlay.style.width = "100%", overlay.style.height = "100%", overlay.style.position = "fixed", overlay.style.top = "0", overlay.style.left = "0", overlay.style.backgroundColor = "rgba(30, 30, 30, 0.4)", overlay.style.display = "flex", overlay.style.justifyContent = "center", overlay.style.alignItems = "center", overlay.style.overflow = "hidden", overlay.style.zIndex = "9999";
|
|
63361
63715
|
const video = document.createElement("video");
|
|
63362
|
-
video.src = cellValue, video.style.maxWidth = "80%", video.style.maxHeight = "80%", video.setAttribute("preload", "auto"), video.setAttribute("controls", "true")
|
|
63716
|
+
video.src = cellValue, video.style.maxWidth = "80%", video.style.maxHeight = "80%", video.setAttribute("preload", "auto"), video.setAttribute("controls", "true");
|
|
63717
|
+
const closeOverlay = () => {
|
|
63718
|
+
try {
|
|
63719
|
+
video.pause();
|
|
63720
|
+
} catch (err) {}
|
|
63721
|
+
video.removeAttribute("src");
|
|
63722
|
+
try {
|
|
63723
|
+
video.load();
|
|
63724
|
+
} catch (err) {}
|
|
63725
|
+
overlay.parentNode && document.body.removeChild(overlay);
|
|
63726
|
+
};
|
|
63727
|
+
previewManager.open(closeOverlay), overlay.appendChild(video), overlay.addEventListener("click", e => {
|
|
63728
|
+
e.target === overlay && previewManager.close();
|
|
63729
|
+
}), document.body.appendChild(overlay);
|
|
63363
63730
|
}
|
|
63364
|
-
});
|
|
63731
|
+
}));
|
|
63365
63732
|
}
|
|
63366
63733
|
|
|
63367
63734
|
function bindDrillEvent(table) {
|
|
@@ -65669,6 +66036,7 @@
|
|
|
65669
66036
|
return TextStyle;
|
|
65670
66037
|
case "image":
|
|
65671
66038
|
case "video":
|
|
66039
|
+
case "audio":
|
|
65672
66040
|
return ImageStyle$1;
|
|
65673
66041
|
case "chart":
|
|
65674
66042
|
case "sparkline":
|
|
@@ -66627,6 +66995,7 @@
|
|
|
66627
66995
|
return TextHeaderStyle;
|
|
66628
66996
|
case "image":
|
|
66629
66997
|
case "video":
|
|
66998
|
+
case "audio":
|
|
66630
66999
|
return ImageStyle;
|
|
66631
67000
|
case "checkbox":
|
|
66632
67001
|
return CheckboxStyle;
|
|
@@ -67677,7 +68046,7 @@
|
|
|
67677
68046
|
}
|
|
67678
68047
|
constructor(container, options = {}) {
|
|
67679
68048
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
67680
|
-
if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.26.
|
|
68049
|
+
if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.26.7", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
|
|
67681
68050
|
const g = window;
|
|
67682
68051
|
g[this.id] = this;
|
|
67683
68052
|
const registry = g.__vtable__ || (g.__vtable__ = {
|
|
@@ -69008,7 +69377,13 @@
|
|
|
69008
69377
|
colMax = Math.max(sourceMergeInfo.end.col, targetMergeInfo.end.col, oldSourceMergeInfo.end.col, oldTargetMergeInfo.end.col),
|
|
69009
69378
|
rowMin = Math.min(sourceMergeInfo.start.row, targetMergeInfo.start.row, oldSourceMergeInfo.start.row, oldTargetMergeInfo.start.row);
|
|
69010
69379
|
let rowMax = Math.max(sourceMergeInfo.end.row, targetMergeInfo.end.row, oldSourceMergeInfo.end.row, oldTargetMergeInfo.end.row);
|
|
69011
|
-
if ("row" === moveContext.moveType && "tree" === this.internalProps.layoutMap.rowHierarchyType && (rowMax = moveContext.targetIndex > moveContext.sourceIndex ? rowMax + moveContext.targetSize - 1 : rowMax + moveContext.sourceSize - 1), this.
|
|
69380
|
+
if ("row" === moveContext.moveType && "tree" === this.internalProps.layoutMap.rowHierarchyType && (rowMax = moveContext.targetIndex > moveContext.sourceIndex ? rowMax + moveContext.targetSize - 1 : rowMax + moveContext.sourceSize - 1), this.isListTable() && !this.transpose && (this.isSeriesNumberInBody(args.source.col, args.source.row) || "row" === args.movingColumnOrRow)) {
|
|
69381
|
+
const listTable = this,
|
|
69382
|
+
sourceRecordPath = listTable.getRecordIndexByCell(args.source.col, moveContext.sourceIndex),
|
|
69383
|
+
targetRecordPath = listTable.getRecordIndexByCell(args.target.col, moveContext.targetIndex);
|
|
69384
|
+
this.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex), this.stateManager.changeCheckboxOrder(sourceRecordPath, targetRecordPath), this.stateManager.changeRadioOrder(sourceRecordPath, targetRecordPath);
|
|
69385
|
+
}
|
|
69386
|
+
if ("column" === moveContext.moveType) for (let col = colMin; col <= colMax; col++) this._clearColRangeWidthsMap(col);else for (let row = rowMin; row <= rowMax; row++) this._clearRowRangeHeightsMap(row);
|
|
69012
69387
|
return this.clearCellStyleCache(), this.isSeriesNumberInBody(args.source.col, args.source.row) || "row" === args.movingColumnOrRow ? this.scenegraph.updateHeaderPosition(this.scenegraph.proxy.colStart, this.scenegraph.proxy.colEnd, this.scenegraph.proxy.rowStart, this.scenegraph.proxy.rowEnd, moveContext.moveType) : "column" === moveContext.moveType ? this.scenegraph.updateHeaderPosition(colMin, colMax, 0, -1, moveContext.moveType) : this.scenegraph.updateHeaderPosition(0, -1, rowMin, rowMax, moveContext.moveType), "adjustFrozenCount" === this.internalProps.frozenColDragHeaderMode && this.isListTable() && (this.isLeftFrozenColumn(args.target.col) && !this.isLeftFrozenColumn(args.source.col) ? this.frozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : this.isLeftFrozenColumn(args.source.col) && !this.isLeftFrozenColumn(args.target.col) && (this.frozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1), this.isRightFrozenColumn(args.target.col) && !this.isRightFrozenColumn(args.source.col) ? this.rightFrozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : this.isRightFrozenColumn(args.source.col) && !this.isRightFrozenColumn(args.target.col) && (this.rightFrozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1)), null === (_e = (_d = this.scenegraph).updateNextFrame) || void 0 === _e || _e.call(_d), !0;
|
|
69013
69388
|
} finally {
|
|
69014
69389
|
this.stateManager.columnMove.movingColumnOrRow = prevMoving;
|
|
@@ -73134,9 +73509,11 @@
|
|
|
73134
73509
|
this.stateManager.endResizeIfResizing(), clearChartRenderQueue(), null === (_a = this.internalProps.dataSource) || void 0 === _a || _a.release(), this.internalProps.releaseList = null === (_b = this.internalProps.releaseList) || void 0 === _b ? void 0 : _b.filter(item => !item.dataSourceObj), this.internalProps.dataSource = null, Array.isArray(option) || (null == option ? void 0 : option.order) ? sort = option : option ? sort = option.sortState : null === option && (sort = null);
|
|
73135
73510
|
"undefined" != typeof window && window.performance.now();
|
|
73136
73511
|
const oldHoverState = {
|
|
73137
|
-
|
|
73138
|
-
|
|
73139
|
-
|
|
73512
|
+
col: this.stateManager.hover.cellPos.col,
|
|
73513
|
+
row: this.stateManager.hover.cellPos.row
|
|
73514
|
+
},
|
|
73515
|
+
oldScrollLeft = this.stateManager.scroll.horizontalBarPos,
|
|
73516
|
+
oldScrollTop = this.stateManager.scroll.verticalBarPos;
|
|
73140
73517
|
if (this.scenegraph.clearCells(), void 0 !== sort && (null === sort || !Array.isArray(sort) && isValid$1(sort.field) || Array.isArray(sort)) && (this.internalProps.sortState = this.internalProps.multipleSort ? Array.isArray(sort) ? sort : [sort] : sort, this.stateManager.setSortState(this.sortState)), records) {
|
|
73141
73518
|
if (_setRecords(this, records), this.sortState) {
|
|
73142
73519
|
const sortState = Array.isArray(this.sortState) ? this.sortState : [this.sortState];
|
|
@@ -73152,13 +73529,13 @@
|
|
|
73152
73529
|
}
|
|
73153
73530
|
this.refreshRowColCount();
|
|
73154
73531
|
} else _setRecords(this, records);
|
|
73155
|
-
this.stateManager.initCheckedState(records), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this._updateSize();
|
|
73532
|
+
this.stateManager.initCheckedState(records), this.clearCellStyleCache(), this.stateManager.scroll.horizontalBarPos = 0, this.stateManager.scroll.verticalBarPos = 0, this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this._updateSize();
|
|
73156
73533
|
if ((null !== (_c = this.options.componentLayoutOrder) && void 0 !== _c ? _c : ["legend", "title"]).forEach(component => {
|
|
73157
73534
|
var _a, _b;
|
|
73158
73535
|
"legend" === component ? null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach(legend => {
|
|
73159
73536
|
null == legend || legend.resize();
|
|
73160
73537
|
}) : "title" === component && (null === (_b = this.internalProps.title) || void 0 === _b || _b.resize());
|
|
73161
|
-
}), this.scenegraph.resize(), this.options.emptyTip) if (this.internalProps.emptyTip) null === (_d = this.internalProps.emptyTip) || void 0 === _d || _d.resetVisible();else {
|
|
73538
|
+
}), this.scenegraph.resize(), oldScrollLeft && this.stateManager.setScrollLeft(oldScrollLeft, void 0, !1), oldScrollTop && this.stateManager.setScrollTop(oldScrollTop, void 0, !1), this.options.emptyTip) if (this.internalProps.emptyTip) null === (_d = this.internalProps.emptyTip) || void 0 === _d || _d.resetVisible();else {
|
|
73162
73539
|
const EmptyTip = Factory.getComponent("emptyTip");
|
|
73163
73540
|
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_e = this.internalProps.emptyTip) || void 0 === _e || _e.resetVisible();
|
|
73164
73541
|
}
|
|
@@ -75386,12 +75763,30 @@
|
|
|
75386
75763
|
}
|
|
75387
75764
|
release() {
|
|
75388
75765
|
var _a, _b;
|
|
75766
|
+
this._clearPendingBind();
|
|
75389
75767
|
const tooltipInstances = this._tooltipInstances;
|
|
75390
75768
|
for (const k in tooltipInstances) null === (_b = null === (_a = tooltipInstances[k]) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a);
|
|
75391
|
-
delete this._tooltipInstances, this._attachInfo = null;
|
|
75769
|
+
delete this._tooltipInstances, this._attachInfo = null, this._pendingInfo = null;
|
|
75392
75770
|
}
|
|
75393
75771
|
_bindToCell(col, row, tooltipOptions) {
|
|
75772
|
+
this._clearPendingBind();
|
|
75773
|
+
const appearDelay = null == tooltipOptions ? void 0 : tooltipOptions.appearDelay;
|
|
75774
|
+
if (tooltipOptions && appearDelay && appearDelay > 0) {
|
|
75775
|
+
this._unbindAttachedTooltip();
|
|
75776
|
+
const id = setTimeout(() => {
|
|
75777
|
+
this._pendingInfo = null, this._bindToCellImmediately(col, row, tooltipOptions);
|
|
75778
|
+
}, appearDelay);
|
|
75779
|
+
this._pendingInfo = {
|
|
75780
|
+
id: id,
|
|
75781
|
+
col: col,
|
|
75782
|
+
row: row,
|
|
75783
|
+
tooltipOptions: tooltipOptions
|
|
75784
|
+
};
|
|
75785
|
+
} else this._bindToCellImmediately(col, row, tooltipOptions);
|
|
75786
|
+
}
|
|
75787
|
+
_bindToCellImmediately(col, row, tooltipOptions) {
|
|
75394
75788
|
var _a;
|
|
75789
|
+
if (!tooltipOptions) return void this._unbindAttachedTooltip();
|
|
75395
75790
|
const info = this._attachInfo,
|
|
75396
75791
|
instance = this._getTooltipInstanceInfo(col, row);
|
|
75397
75792
|
if (!info || instance && info.instance === instance || (null === (_a = info.instance) || void 0 === _a || _a.unbindTooltipElement(), this._attachInfo = null), !instance) return;
|
|
@@ -75404,6 +75799,17 @@
|
|
|
75404
75799
|
};
|
|
75405
75800
|
}
|
|
75406
75801
|
}
|
|
75802
|
+
_clearPendingBind() {
|
|
75803
|
+
this._pendingInfo && (clearTimeout(this._pendingInfo.id), this._pendingInfo = null);
|
|
75804
|
+
}
|
|
75805
|
+
_unbindAttachedTooltip() {
|
|
75806
|
+
const info = this._attachInfo;
|
|
75807
|
+
if (!info) return;
|
|
75808
|
+
const {
|
|
75809
|
+
instance: instance
|
|
75810
|
+
} = info;
|
|
75811
|
+
null == instance || instance.unbindTooltipElement(), this._attachInfo = null;
|
|
75812
|
+
}
|
|
75407
75813
|
_move(col, row, tooltipOptions) {
|
|
75408
75814
|
const info = this._attachInfo;
|
|
75409
75815
|
if (!info || !cellInRange(info.range, col, row)) return;
|
|
@@ -75421,14 +75827,10 @@
|
|
|
75421
75827
|
this._attachInfo.tooltipOptions.position = position, this._attachInfo.tooltipOptions.referencePosition = referencePosition, null == instance || instance.locateTooltipElement(col, row, position, referencePosition, this.confine);
|
|
75422
75828
|
}
|
|
75423
75829
|
_unbindFromCell() {
|
|
75424
|
-
|
|
75425
|
-
if (!info) return;
|
|
75426
|
-
const {
|
|
75427
|
-
instance: instance
|
|
75428
|
-
} = info;
|
|
75429
|
-
null == instance || instance.unbindTooltipElement(), this._attachInfo = null;
|
|
75830
|
+
this._clearPendingBind(), this._unbindAttachedTooltip();
|
|
75430
75831
|
}
|
|
75431
75832
|
_isBindCell(col, row) {
|
|
75833
|
+
if (this._pendingInfo && this._pendingInfo.col === col && this._pendingInfo.row === row) return !0;
|
|
75432
75834
|
const info = this._attachInfo;
|
|
75433
75835
|
return !!info && cellInRange(info.range, col, row);
|
|
75434
75836
|
}
|
|
@@ -75519,8 +75921,8 @@
|
|
|
75519
75921
|
return tooltipInstances && tooltipInstances["bubble-tooltip"] || tooltipInstances && (tooltipInstances["bubble-tooltip"] = TOOLTIP_INSTANCE_FACTORY["bubble-tooltip"](table));
|
|
75520
75922
|
}
|
|
75521
75923
|
isBinded(tooltipOptions) {
|
|
75522
|
-
var _a;
|
|
75523
|
-
return JSON.stringify(tooltipOptions) === JSON.stringify(null === (_a = this._attachInfo) || void 0 === _a ? void 0 : _a.tooltipOptions);
|
|
75924
|
+
var _a, _b;
|
|
75925
|
+
return JSON.stringify(tooltipOptions) === JSON.stringify(null === (_a = this._attachInfo) || void 0 === _a ? void 0 : _a.tooltipOptions) || JSON.stringify(tooltipOptions) === JSON.stringify(null === (_b = this._pendingInfo) || void 0 === _b ? void 0 : _b.tooltipOptions);
|
|
75524
75926
|
}
|
|
75525
75927
|
}
|
|
75526
75928
|
|
|
@@ -75785,7 +76187,7 @@
|
|
|
75785
76187
|
cornerRadius: cellTheme.group.cornerRadius
|
|
75786
76188
|
})).role = "cell", cellGroup.col = col, cellGroup.row = row, cellGroup = null !== (_0 = null == columnGroup ? void 0 : columnGroup.addCellGroup(cellGroup)) && void 0 !== _0 ? _0 : cellGroup);
|
|
75787
76189
|
}
|
|
75788
|
-
if (cellGroup.AABBBounds.width(), isNoChartDataRenderNothing && Array.isArray(
|
|
76190
|
+
if (cellGroup.AABBBounds.width(), isNoChartDataRenderNothing && Array.isArray(dataValue) || !isNoChartDataRenderNothing) {
|
|
75789
76191
|
const chartGroup = new Chart(isShareChartSpec, {
|
|
75790
76192
|
stroke: !1,
|
|
75791
76193
|
x: padding[3],
|
|
@@ -75799,7 +76201,7 @@
|
|
|
75799
76201
|
height: height - padding[2] - padding[0],
|
|
75800
76202
|
chartInstance: chartInstance,
|
|
75801
76203
|
dataId: dataId,
|
|
75802
|
-
data:
|
|
76204
|
+
data: dataValue || [],
|
|
75803
76205
|
cellPadding: padding,
|
|
75804
76206
|
dpr: table.internalProps.pixelRatio,
|
|
75805
76207
|
detectPickChartItem: null === (_2 = table.options.customConfig) || void 0 === _2 ? void 0 : _2.detectPickChartItem,
|
|
@@ -75890,8 +76292,9 @@
|
|
|
75890
76292
|
}
|
|
75891
76293
|
}
|
|
75892
76294
|
|
|
75893
|
-
function createCheckboxCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, isCheckboxTree) {
|
|
76295
|
+
function createCheckboxCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, isCheckboxTree, cellValue) {
|
|
75894
76296
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
76297
|
+
const value = arguments.length >= 20 ? cellValue : table.getCellValue(col, row);
|
|
75895
76298
|
if (!cellGroup) {
|
|
75896
76299
|
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
75897
76300
|
isAsync && (cellGroup = table.scenegraph.highPerformanceGetCell(col, row, !0)) && "cell" === cellGroup.role && cellGroup.setAttributes({
|
|
@@ -75952,7 +76355,7 @@
|
|
|
75952
76355
|
"middle" === textBaseline ? child.setAttribute("y", (height - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", height - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]);
|
|
75953
76356
|
});
|
|
75954
76357
|
}
|
|
75955
|
-
const checkboxComponent = createCheckbox(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table, isCheckboxTree);
|
|
76358
|
+
const checkboxComponent = createCheckbox(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table, isCheckboxTree, value);
|
|
75956
76359
|
if (1 !== cellContentLeftIcons.length || cellContentLeftIcons[0].name !== InternalIconName.expandIconName && cellContentLeftIcons[0].name !== InternalIconName.collapseIconName) checkboxComponent && cellGroup.appendChild(checkboxComponent), checkboxComponent.render();else {
|
|
75957
76360
|
const checkContent = new CheckboxContent({
|
|
75958
76361
|
x: 0,
|
|
@@ -75987,7 +76390,7 @@
|
|
|
75987
76390
|
}
|
|
75988
76391
|
return width -= padding[1] + padding[3] + iconWidth, height -= padding[0] + padding[2], "center" === textAlign ? checkboxComponent.setAttribute("x", padding[3] + cellLeftIconWidth + (width - checkboxComponent.AABBBounds.width()) / 2) : "right" === textAlign ? checkboxComponent.setAttribute("x", padding[3] + cellLeftIconWidth + width - checkboxComponent.AABBBounds.width()) : checkboxComponent.setAttribute("x", padding[3] + cellLeftIconWidth), "middle" === textBaseline ? checkboxComponent.setAttribute("y", padding[0] + (height - checkboxComponent.AABBBounds.height()) / 2) : "bottom" === textBaseline ? checkboxComponent.setAttribute("y", padding[0] + height - checkboxComponent.AABBBounds.height()) : checkboxComponent.setAttribute("y", padding[0]), cellGroup;
|
|
75989
76392
|
}
|
|
75990
|
-
function createCheckbox(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table, isCheckboxTree) {
|
|
76393
|
+
function createCheckbox(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table, isCheckboxTree, cellValue) {
|
|
75991
76394
|
var _a, _b, _c, _d;
|
|
75992
76395
|
const style = table._getCellStyle(col, row),
|
|
75993
76396
|
size = getProp("size", style, col, row, table),
|
|
@@ -76001,7 +76404,7 @@
|
|
|
76001
76404
|
disableCheckedStroke = getProp("disableCheckedStroke", style, col, row, table),
|
|
76002
76405
|
checkIconImage = getProp("checkIconImage", style, col, row, table),
|
|
76003
76406
|
indeterminateIconImage = getProp("indeterminateIconImage", style, col, row, table),
|
|
76004
|
-
value =
|
|
76407
|
+
value = cellValue,
|
|
76005
76408
|
dataValue = table.getCellOriginValue(col, row);
|
|
76006
76409
|
let isChecked,
|
|
76007
76410
|
isDisabled,
|
|
@@ -76076,11 +76479,12 @@
|
|
|
76076
76479
|
return checkbox.name = "checkbox", checkbox;
|
|
76077
76480
|
}
|
|
76078
76481
|
|
|
76079
|
-
function createRadioCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, table, cellTheme, define, range) {
|
|
76080
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
76482
|
+
function createRadioCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, table, cellTheme, define, range, isAsync, cellValue) {
|
|
76483
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
76484
|
+
const value = arguments.length >= 18 ? cellValue : table.getCellValue(col, row);
|
|
76081
76485
|
if (!cellGroup) {
|
|
76082
76486
|
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
76083
|
-
(cellGroup =
|
|
76487
|
+
isAsync && (cellGroup = table.scenegraph.highPerformanceGetCell(col, row, !0)) && "cell" === cellGroup.role && cellGroup.setAttributes({
|
|
76084
76488
|
x: xOrigin,
|
|
76085
76489
|
y: yOrigin,
|
|
76086
76490
|
width: width,
|
|
@@ -76095,17 +76499,32 @@
|
|
|
76095
76499
|
lineCap: "butt",
|
|
76096
76500
|
clip: !0,
|
|
76097
76501
|
cornerRadius: cellTheme.group.cornerRadius
|
|
76098
|
-
})
|
|
76502
|
+
}), cellGroup && "cell" === cellGroup.role || ((cellGroup = new Group$1({
|
|
76503
|
+
x: xOrigin,
|
|
76504
|
+
y: yOrigin,
|
|
76505
|
+
width: width,
|
|
76506
|
+
height: height,
|
|
76507
|
+
lineWidth: null !== (_p = null === (_o = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _o ? void 0 : _o.lineWidth) && void 0 !== _p ? _p : void 0,
|
|
76508
|
+
fill: null !== (_r = null === (_q = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _q ? void 0 : _q.fill) && void 0 !== _r ? _r : void 0,
|
|
76509
|
+
stroke: null !== (_t = null === (_s = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _s ? void 0 : _s.stroke) && void 0 !== _t ? _t : void 0,
|
|
76510
|
+
strokeArrayWidth: strokeArrayWidth,
|
|
76511
|
+
strokeArrayColor: null !== (_v = null === (_u = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _u ? void 0 : _u.strokeArrayColor) && void 0 !== _v ? _v : void 0,
|
|
76512
|
+
cursor: null !== (_x = null === (_w = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _w ? void 0 : _w.cursor) && void 0 !== _x ? _x : void 0,
|
|
76513
|
+
lineDash: null !== (_z = null === (_y = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _y ? void 0 : _y.lineDash) && void 0 !== _z ? _z : void 0,
|
|
76514
|
+
lineCap: "butt",
|
|
76515
|
+
clip: !0,
|
|
76516
|
+
cornerRadius: cellTheme.group.cornerRadius
|
|
76517
|
+
})).role = "cell", cellGroup.col = col, cellGroup.row = row, cellGroup = null !== (_0 = null == columnGroup ? void 0 : columnGroup.addCellGroup(cellGroup)) && void 0 !== _0 ? _0 : cellGroup);
|
|
76099
76518
|
}
|
|
76100
76519
|
const {
|
|
76101
76520
|
width: radioWidth,
|
|
76102
76521
|
height: radioHeight
|
|
76103
|
-
} = createRadio(col, row, colWidth, width, height, padding, cellTheme, define, cellGroup, range, table);
|
|
76522
|
+
} = createRadio(col, row, colWidth, width, height, padding, cellTheme, define, cellGroup, range, table, value);
|
|
76104
76523
|
return width -= padding[1] + padding[3], height -= padding[0] + padding[2], cellGroup.forEachChildren(radioComponent => {
|
|
76105
76524
|
"center" === textAlign ? radioComponent.setAttribute("x", padding[3] + radioComponent.attribute.x + (width - radioWidth) / 2) : "right" === textAlign ? radioComponent.setAttribute("x", padding[3] + radioComponent.attribute.x + width - radioWidth) : radioComponent.setAttribute("x", padding[3] + radioComponent.attribute.x), "middle" === textBaseline ? radioComponent.setAttribute("y", padding[0] + radioComponent.attribute.y + (height - radioHeight) / 2) : "bottom" === textBaseline ? radioComponent.setAttribute("y", padding[0] + radioComponent.attribute.y + height - radioHeight) : radioComponent.setAttribute("y", padding[0] + radioComponent.attribute.y);
|
|
76106
76525
|
}), cellGroup;
|
|
76107
76526
|
}
|
|
76108
|
-
function createRadio(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, cellGroup, range, table) {
|
|
76527
|
+
function createRadio(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, cellGroup, range, table, cellValue) {
|
|
76109
76528
|
var _a, _b, _c, _d;
|
|
76110
76529
|
const style = table._getCellStyle(col, row);
|
|
76111
76530
|
let size = getProp("size", style, col, row, table),
|
|
@@ -76121,7 +76540,7 @@
|
|
|
76121
76540
|
disableCheckedFill = getProp("disableCheckedFill", style, col, row, table),
|
|
76122
76541
|
disableCheckedStroke = getProp("disableCheckedStroke", style, col, row, table);
|
|
76123
76542
|
isNumber$3(outerRadius) ? size = 2 * outerRadius : outerRadius = Math.round(size / 2), (!isNumber$3(innerRadius) || innerRadius < 0) && (innerRadius = Math.round(outerRadius / 7 * 3));
|
|
76124
|
-
const value =
|
|
76543
|
+
const value = cellValue,
|
|
76125
76544
|
dataValue = table.getCellOriginValue(col, row),
|
|
76126
76545
|
hierarchyOffset = getHierarchyOffset(col, row, table),
|
|
76127
76546
|
cellStyle = table._getCellStyle(col, row),
|
|
@@ -76217,8 +76636,9 @@
|
|
|
76217
76636
|
return null !== (_a = null != isDisabled ? isDisabled : globalDisable) && void 0 !== _a && _a;
|
|
76218
76637
|
}
|
|
76219
76638
|
|
|
76220
|
-
function createSwitchCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync) {
|
|
76639
|
+
function createSwitchCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, cellValue) {
|
|
76221
76640
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
76641
|
+
const value = arguments.length >= 19 ? cellValue : table.getCellValue(col, row);
|
|
76222
76642
|
if (!cellGroup) {
|
|
76223
76643
|
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
76224
76644
|
isAsync && (cellGroup = table.scenegraph.highPerformanceGetCell(col, row, !0)) && "cell" === cellGroup.role && cellGroup.setAttributes({
|
|
@@ -76274,10 +76694,10 @@
|
|
|
76274
76694
|
"middle" === textBaseline ? child.setAttribute("y", (height - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", height - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]);
|
|
76275
76695
|
});
|
|
76276
76696
|
}
|
|
76277
|
-
const switchComponent = createSwitch(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table);
|
|
76697
|
+
const switchComponent = createSwitch(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table, value);
|
|
76278
76698
|
return switchComponent && cellGroup.appendChild(switchComponent), switchComponent.render(), width -= padding[1] + padding[3] + iconWidth, height -= padding[0] + padding[2], "center" === textAlign ? switchComponent.setAttribute("x", padding[3] + cellLeftIconWidth + (width - switchComponent.AABBBounds.width()) / 2) : "right" === textAlign ? switchComponent.setAttribute("x", padding[3] + cellLeftIconWidth + width - switchComponent.AABBBounds.width()) : switchComponent.setAttribute("x", padding[3] + cellLeftIconWidth), "middle" === textBaseline ? switchComponent.setAttribute("y", padding[0] + (height - switchComponent.AABBBounds.height()) / 2) : "bottom" === textBaseline ? switchComponent.setAttribute("y", padding[0] + height - switchComponent.AABBBounds.height()) : switchComponent.setAttribute("y", padding[0]), cellGroup;
|
|
76279
76699
|
}
|
|
76280
|
-
function createSwitch(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table) {
|
|
76700
|
+
function createSwitch(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table, cellValue) {
|
|
76281
76701
|
var _a, _b, _c, _d;
|
|
76282
76702
|
const style = table._getCellStyle(col, row),
|
|
76283
76703
|
spaceBetweenTextAndCircle = getProp("spaceBetweenTextAndCircle", style, col, row, table),
|
|
@@ -76289,7 +76709,7 @@
|
|
|
76289
76709
|
disableCheckedFill = getProp("disableCheckedFill", style, col, row, table),
|
|
76290
76710
|
disableUncheckedFill = getProp("disableUncheckedFill", style, col, row, table),
|
|
76291
76711
|
circleFill = getProp("circleFill", style, col, row, table),
|
|
76292
|
-
value =
|
|
76712
|
+
value = cellValue,
|
|
76293
76713
|
dataValue = table.getCellOriginValue(col, row);
|
|
76294
76714
|
let isChecked,
|
|
76295
76715
|
isDisabled,
|
|
@@ -76380,8 +76800,9 @@
|
|
|
76380
76800
|
|
|
76381
76801
|
const xScale = new PointScale(),
|
|
76382
76802
|
yScale = new LinearScale();
|
|
76383
|
-
function createSparkLineCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, width, height, padding, table, cellTheme, isAsync) {
|
|
76803
|
+
function createSparkLineCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, width, height, padding, table, cellTheme, isAsync, cellValue) {
|
|
76384
76804
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
76805
|
+
const value = arguments.length >= 13 ? cellValue : table.getCellValue(col, row);
|
|
76385
76806
|
if (!cellGroup) {
|
|
76386
76807
|
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
76387
76808
|
isAsync && (cellGroup = table.scenegraph.highPerformanceGetCell(col, row, !0)) && "cell" === cellGroup.role && cellGroup.setAttributes({
|
|
@@ -76416,13 +76837,13 @@
|
|
|
76416
76837
|
cornerRadius: cellTheme.group.cornerRadius
|
|
76417
76838
|
})).role = "cell", cellGroup.col = col, cellGroup.row = row, cellGroup = null !== (_0 = null == columnGroup ? void 0 : columnGroup.addCellGroup(cellGroup)) && void 0 !== _0 ? _0 : cellGroup);
|
|
76418
76839
|
}
|
|
76419
|
-
const chartGroup = createSparkLine(col, row, width, height, padding, table);
|
|
76840
|
+
const chartGroup = createSparkLine(col, row, width, height, padding, table, value);
|
|
76420
76841
|
return chartGroup && cellGroup.appendChild(chartGroup), cellGroup;
|
|
76421
76842
|
}
|
|
76422
|
-
function createSparkLine(col, row, width, height, padding, table) {
|
|
76843
|
+
function createSparkLine(col, row, width, height, padding, table, cellValue) {
|
|
76423
76844
|
let sparklineSpec, chartGroup;
|
|
76424
76845
|
const chartSpecRaw = table.internalProps.layoutMap.getBody(col, row).sparklineSpec,
|
|
76425
|
-
dataValue =
|
|
76846
|
+
dataValue = cellValue;
|
|
76426
76847
|
if (!Array.isArray(dataValue)) return;
|
|
76427
76848
|
const x = padding[3],
|
|
76428
76849
|
y = padding[0];
|
|
@@ -76433,7 +76854,7 @@
|
|
|
76433
76854
|
col: col,
|
|
76434
76855
|
row: row,
|
|
76435
76856
|
dataValue: table.getCellOriginValue(col, row) || "",
|
|
76436
|
-
value:
|
|
76857
|
+
value: dataValue || "",
|
|
76437
76858
|
rect: table.getCellRangeRelativeRect(table.getCellRange(col, row)),
|
|
76438
76859
|
table: table
|
|
76439
76860
|
};
|
|
@@ -76576,15 +76997,91 @@
|
|
|
76576
76997
|
return numbers;
|
|
76577
76998
|
}
|
|
76578
76999
|
|
|
77000
|
+
const audioIconSvg = '<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="42" height="42" rx="10" fill="#F8FAFF" fill-opacity="0.92"/><rect x="3.75" y="3.75" width="40.5" height="40.5" rx="9.25" stroke="#1D4ED8" stroke-opacity="0.22" stroke-width="1.5"/><path d="M16 30H12C10.8954 30 10 29.1046 10 28V20C10 18.8954 10.8954 18 12 18H16L26 10V38L16 30Z" fill="#EAF1FF" stroke="#0F172A" stroke-opacity="0.24" stroke-width="5.5" stroke-linejoin="round"/><path d="M31.5 18.5C33.3 21.3 33.3 26.7 31.5 29.5" stroke="#0F172A" stroke-opacity="0.24" stroke-width="5.5" stroke-linecap="round"/><path d="M36 15C39.2 20.4 39.2 27.6 36 33" stroke="#0F172A" stroke-opacity="0.24" stroke-width="5.5" stroke-linecap="round"/><path d="M16 30H12C10.8954 30 10 29.1046 10 28V20C10 18.8954 10.8954 18 12 18H16L26 10V38L16 30Z" fill="#EAF1FF" stroke="#2563EB" stroke-width="3.2" stroke-linejoin="round"/><path d="M31.5 18.5C33.3 21.3 33.3 26.7 31.5 29.5" stroke="#2563EB" stroke-width="3.2" stroke-linecap="round"/><path d="M36 15C39.2 20.4 39.2 27.6 36 33" stroke="#2563EB" stroke-width="3.2" stroke-linecap="round"/></svg>';
|
|
77001
|
+
function createAudioCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync, _cellValue) {
|
|
77002
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
|
|
77003
|
+
const headerStyle = table._getCellStyle(col, row),
|
|
77004
|
+
functionalPadding = getFunctionalProp("padding", headerStyle, col, row, table);
|
|
77005
|
+
(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.imageMargin) ? padding = getQuadProps(null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.imageMargin) : isValid$1(functionalPadding) && (padding = functionalPadding), (null === (_c = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _c ? void 0 : _c.textAlign) && (textAlign = cellTheme.text.textAlign), (null === (_d = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _d ? void 0 : _d.textBaseline) && (textBaseline = cellTheme.text.textBaseline);
|
|
77006
|
+
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
77007
|
+
let cellGroup, cellIcons;
|
|
77008
|
+
if (isAsync && (cellGroup = table.scenegraph.highPerformanceGetCell(col, row, !0), cellGroup && "cell" === cellGroup.role && cellGroup.setAttributes({
|
|
77009
|
+
x: xOrigin,
|
|
77010
|
+
y: yOrigin,
|
|
77011
|
+
width: width,
|
|
77012
|
+
height: height,
|
|
77013
|
+
lineWidth: null !== (_f = null === (_e = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _e ? void 0 : _e.lineWidth) && void 0 !== _f ? _f : void 0,
|
|
77014
|
+
fill: null !== (_h = null === (_g = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _g ? void 0 : _g.fill) && void 0 !== _h ? _h : void 0,
|
|
77015
|
+
stroke: null !== (_k = null === (_j = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _j ? void 0 : _j.stroke) && void 0 !== _k ? _k : void 0,
|
|
77016
|
+
strokeArrayWidth: strokeArrayWidth,
|
|
77017
|
+
strokeArrayColor: null !== (_m = null === (_l = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _l ? void 0 : _l.strokeArrayColor) && void 0 !== _m ? _m : void 0,
|
|
77018
|
+
cursor: null !== (_p = null === (_o = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _o ? void 0 : _o.cursor) && void 0 !== _p ? _p : void 0,
|
|
77019
|
+
lineDash: null !== (_r = null === (_q = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _q ? void 0 : _q.lineDash) && void 0 !== _r ? _r : void 0,
|
|
77020
|
+
lineCap: "butt",
|
|
77021
|
+
clip: !0,
|
|
77022
|
+
cornerRadius: cellTheme.group.cornerRadius
|
|
77023
|
+
})), cellGroup && "cell" === cellGroup.role || (cellGroup = new Group$1({
|
|
77024
|
+
x: xOrigin,
|
|
77025
|
+
y: yOrigin,
|
|
77026
|
+
width: width,
|
|
77027
|
+
height: height,
|
|
77028
|
+
lineWidth: null !== (_t = null === (_s = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _s ? void 0 : _s.lineWidth) && void 0 !== _t ? _t : void 0,
|
|
77029
|
+
fill: null !== (_v = null === (_u = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _u ? void 0 : _u.fill) && void 0 !== _v ? _v : void 0,
|
|
77030
|
+
stroke: null !== (_x = null === (_w = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _w ? void 0 : _w.stroke) && void 0 !== _x ? _x : void 0,
|
|
77031
|
+
strokeArrayWidth: strokeArrayWidth,
|
|
77032
|
+
strokeArrayColor: null !== (_z = null === (_y = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _y ? void 0 : _y.strokeArrayColor) && void 0 !== _z ? _z : void 0,
|
|
77033
|
+
cursor: null !== (_1 = null === (_0 = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _0 ? void 0 : _0.cursor) && void 0 !== _1 ? _1 : void 0,
|
|
77034
|
+
lineDash: null !== (_3 = null === (_2 = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _2 ? void 0 : _2.lineDash) && void 0 !== _3 ? _3 : void 0,
|
|
77035
|
+
lineCap: "butt",
|
|
77036
|
+
clip: !0,
|
|
77037
|
+
cornerRadius: cellTheme.group.cornerRadius
|
|
77038
|
+
}), cellGroup.role = "cell", cellGroup.col = col, cellGroup.row = row, cellGroup = null !== (_4 = null == columnGroup ? void 0 : columnGroup.addCellGroup(cellGroup)) && void 0 !== _4 ? _4 : cellGroup), mayHaveIcon) {
|
|
77039
|
+
let iconCol = col,
|
|
77040
|
+
iconRow = row;
|
|
77041
|
+
range && (iconCol = range.start.col, iconRow = range.start.row), cellIcons = table.getCellIcons(iconCol, iconRow);
|
|
77042
|
+
}
|
|
77043
|
+
let cellLeftIconWidth = 0,
|
|
77044
|
+
cellRightIconWidth = 0;
|
|
77045
|
+
if (Array.isArray(cellIcons) && 0 !== cellIcons.length) {
|
|
77046
|
+
const {
|
|
77047
|
+
leftIconWidth: leftIconWidth,
|
|
77048
|
+
rightIconWidth: rightIconWidth,
|
|
77049
|
+
absoluteRightIconWidth: absoluteRightIconWidth
|
|
77050
|
+
} = dealWithIconLayout(cellIcons, cellGroup, range, table);
|
|
77051
|
+
cellLeftIconWidth = leftIconWidth, cellRightIconWidth = rightIconWidth, cellGroup.forEachChildren(child => {
|
|
77052
|
+
"icon-left" === child.role ? child.setAttribute("x", child.attribute.x + padding[3]) : "icon-right" === child.role ? child.setAttribute("x", child.attribute.x + width - rightIconWidth - padding[1]) : "icon-absolute-right" === child.role && child.setAttribute("x", child.attribute.x + width - absoluteRightIconWidth - padding[1]);
|
|
77053
|
+
}), cellGroup.forEachChildren(child => {
|
|
77054
|
+
"middle" === textBaseline ? child.setAttribute("y", (height - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", height - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]);
|
|
77055
|
+
});
|
|
77056
|
+
}
|
|
77057
|
+
cellGroup._cellLeftIconWidth = cellLeftIconWidth, cellGroup._cellRightIconWidth = cellRightIconWidth;
|
|
77058
|
+
const availableWidth = Math.max(1, width - padding[1] - padding[3] - cellLeftIconWidth - cellRightIconWidth),
|
|
77059
|
+
availableHeight = Math.max(1, height - padding[0] - padding[2]),
|
|
77060
|
+
iconSize = Math.max(1, Math.min(availableWidth, availableHeight, 32)),
|
|
77061
|
+
pos = calcStartPosition(cellLeftIconWidth, 0, width - cellLeftIconWidth - cellRightIconWidth, height, iconSize, iconSize, textAlign, textBaseline, padding);
|
|
77062
|
+
removeCellMediaChildren(cellGroup);
|
|
77063
|
+
const image = markCellMedia(createImage({
|
|
77064
|
+
x: pos.x,
|
|
77065
|
+
y: pos.y,
|
|
77066
|
+
width: iconSize,
|
|
77067
|
+
height: iconSize,
|
|
77068
|
+
image: audioIconSvg,
|
|
77069
|
+
cursor: "pointer"
|
|
77070
|
+
}), "image");
|
|
77071
|
+
return image.name = "image", image.keepAspectRatio = !0, image.isAudioIcon = !0, image.textAlign = textAlign, image.textBaseline = textBaseline, cellGroup.appendChild(image), cellGroup;
|
|
77072
|
+
}
|
|
77073
|
+
|
|
76579
77074
|
const regedIcons = get$4();
|
|
76580
|
-
function
|
|
76581
|
-
|
|
76582
|
-
|
|
76583
|
-
|
|
76584
|
-
|
|
76585
|
-
|
|
76586
|
-
|
|
76587
|
-
|
|
77075
|
+
function updateVideoMediaDxDy(startCol, endCol, startRow, endRow, table) {
|
|
77076
|
+
for (let col = startCol; col <= endCol; col++) for (let row = startRow; row <= endRow; row++) {
|
|
77077
|
+
const cellGroup = table.scenegraph.getCell(col, row);
|
|
77078
|
+
cellGroup && cellGroup.forEachChildren(child => {
|
|
77079
|
+
isCellMedia(child) && child.setAttributes({
|
|
77080
|
+
dx: -table.getColsWidth(cellGroup.mergeStartCol, col - 1),
|
|
77081
|
+
dy: -table.getRowsHeight(cellGroup.mergeStartRow, row - 1)
|
|
77082
|
+
});
|
|
77083
|
+
});
|
|
77084
|
+
}
|
|
76588
77085
|
}
|
|
76589
77086
|
function getVideoFirstFrameTimeout(table) {
|
|
76590
77087
|
var _a;
|
|
@@ -76599,7 +77096,7 @@
|
|
|
76599
77096
|
function snapshotVideoFirstFrame(video, image, table) {
|
|
76600
77097
|
const displayWidth = image.attribute.width,
|
|
76601
77098
|
displayHeight = image.attribute.height;
|
|
76602
|
-
if ("number" != typeof displayWidth || "number" != typeof displayHeight || displayWidth <= 0 || displayHeight <= 0) return !1;
|
|
77099
|
+
if (video.videoWidth <= 0 || video.videoHeight <= 0 || "number" != typeof displayWidth || "number" != typeof displayHeight || displayWidth <= 0 || displayHeight <= 0) return !1;
|
|
76603
77100
|
const canvas = document.createElement("canvas"),
|
|
76604
77101
|
context = canvas.getContext("2d");
|
|
76605
77102
|
if (!context) return !1;
|
|
@@ -76635,7 +77132,7 @@
|
|
|
76635
77132
|
height: viewBoxHeight
|
|
76636
77133
|
} : void 0;
|
|
76637
77134
|
}
|
|
76638
|
-
function createVideoCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync) {
|
|
77135
|
+
function createVideoCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, range, isAsync, cellValue) {
|
|
76639
77136
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
76640
77137
|
const headerStyle = table._getCellStyle(col, row),
|
|
76641
77138
|
functionalPadding = getFunctionalProp("padding", headerStyle, col, row, table);
|
|
@@ -76690,10 +77187,26 @@
|
|
|
76690
77187
|
"icon-left" === child.role ? child.setAttribute("x", child.attribute.x + padding[3]) : "icon-right" === child.role ? child.setAttribute("x", child.attribute.x + width - rightIconWidth - padding[1]) : "icon-absolute-right" === child.role && child.setAttribute("x", child.attribute.x + width - absoluteRightIconWidth - padding[1]);
|
|
76691
77188
|
}), cellGroup.forEachChildren(child => {
|
|
76692
77189
|
"middle" === textBaseline ? child.setAttribute("y", (height - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", height - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]);
|
|
76693
|
-
})
|
|
77190
|
+
});
|
|
76694
77191
|
}
|
|
76695
|
-
|
|
76696
|
-
|
|
77192
|
+
cellGroup._cellLeftIconWidth = cellLeftIconWidth, cellGroup._cellRightIconWidth = cellRightIconWidth;
|
|
77193
|
+
const value = arguments.length >= 18 ? cellValue : table.getCellValue(col, row);
|
|
77194
|
+
if (removeCellMediaChildren(cellGroup), isAudioUrl(value)) {
|
|
77195
|
+
const availableWidth = Math.max(1, width - padding[1] - padding[3] - cellLeftIconWidth - cellRightIconWidth),
|
|
77196
|
+
availableHeight = Math.max(1, height - padding[0] - padding[2]),
|
|
77197
|
+
iconSize = Math.max(1, Math.min(availableWidth, availableHeight, 32)),
|
|
77198
|
+
pos = calcStartPosition(cellLeftIconWidth, 0, width - cellLeftIconWidth - cellRightIconWidth, height, iconSize, iconSize, textAlign, textBaseline, padding),
|
|
77199
|
+
image = markCellMedia(createImage({
|
|
77200
|
+
x: pos.x,
|
|
77201
|
+
y: pos.y,
|
|
77202
|
+
width: iconSize,
|
|
77203
|
+
height: iconSize,
|
|
77204
|
+
image: audioIconSvg,
|
|
77205
|
+
cursor: "pointer"
|
|
77206
|
+
}), "image");
|
|
77207
|
+
return image.name = "image", image.keepAspectRatio = !0, image.isAudioIcon = !0, image.textAlign = textAlign, image.textBaseline = textBaseline, cellGroup.appendChild(image), cellGroup;
|
|
77208
|
+
}
|
|
77209
|
+
const video = document.createElement("video");
|
|
76697
77210
|
video.muted = !0, video.playsInline = !0;
|
|
76698
77211
|
const shouldSnapshot = !0 === (null === (_7 = table.options.customConfig) || void 0 === _7 ? void 0 : _7.videoFirstFrameSnapshot);
|
|
76699
77212
|
let loadTimer,
|
|
@@ -76704,7 +77217,7 @@
|
|
|
76704
77217
|
releaseCurrentVideo = () => {
|
|
76705
77218
|
videoReleased || (videoReleased = !0, clearVideoLoadTimer(), releaseVideoResource(video));
|
|
76706
77219
|
},
|
|
76707
|
-
isCurrentImage = () => cellGroup
|
|
77220
|
+
isCurrentImage = () => getCellMediaImage(cellGroup) === image,
|
|
76708
77221
|
handleVideoLoadFail = () => {
|
|
76709
77222
|
videoReleased || (isCurrentImage() && ((() => {
|
|
76710
77223
|
var _a, _b;
|
|
@@ -76736,7 +77249,7 @@
|
|
|
76736
77249
|
y: pos.y,
|
|
76737
77250
|
width: imageWidth,
|
|
76738
77251
|
height: imageHeight
|
|
76739
|
-
}), isMerge &&
|
|
77252
|
+
}), isMerge && updateVideoMediaDxDy(cellGroup.mergeStartCol, cellGroup.mergeEndCol, cellGroup.mergeStartRow, cellGroup.mergeEndRow, table);
|
|
76740
77253
|
}
|
|
76741
77254
|
})(), table.scenegraph.updateNextFrame()), shouldSnapshot && releaseCurrentVideo());
|
|
76742
77255
|
};
|
|
@@ -76745,6 +77258,7 @@
|
|
|
76745
77258
|
if (!isCurrentImage()) return void releaseCurrentVideo();
|
|
76746
77259
|
const scenegraph = table.scenegraph;
|
|
76747
77260
|
if (!scenegraph) return;
|
|
77261
|
+
if (video.videoWidth <= 0 || video.videoHeight <= 0) return void handleVideoLoadFail();
|
|
76748
77262
|
imageAutoSizing && _adjustWidthHeight(col, row, video.videoWidth, video.videoHeight, scenegraph, padding, cellGroup);
|
|
76749
77263
|
const {
|
|
76750
77264
|
width: cellWidth,
|
|
@@ -76771,7 +77285,7 @@
|
|
|
76771
77285
|
height: cellHeight - padding[2] - padding[0],
|
|
76772
77286
|
dy: 0
|
|
76773
77287
|
});
|
|
76774
|
-
isMerge &&
|
|
77288
|
+
isMerge && updateVideoMediaDxDy(cellGroup.mergeStartCol, cellGroup.mergeEndCol, cellGroup.mergeStartRow, cellGroup.mergeEndRow, table);
|
|
76775
77289
|
const {
|
|
76776
77290
|
width: width,
|
|
76777
77291
|
height: height
|
|
@@ -76779,11 +77293,10 @@
|
|
|
76779
77293
|
iconSize = Math.floor(Math.min(width - padding[1] - padding[3], height - padding[2] - padding[0]) / 2),
|
|
76780
77294
|
anchorX = 0 + (width > image.attribute.width ? image.attribute.x - 0 + image.attribute.width / 2 : width / 2),
|
|
76781
77295
|
anchorY = 0 + (height > image.attribute.height ? image.attribute.y - 0 + image.attribute.height / 2 : height / 2),
|
|
76782
|
-
imageGraphic = cellGroup.getChildByName("image", !0),
|
|
76783
77296
|
{
|
|
76784
77297
|
dx: dx,
|
|
76785
77298
|
dy: dy
|
|
76786
|
-
} =
|
|
77299
|
+
} = image.attribute,
|
|
76787
77300
|
playIcon = new Icon$1({
|
|
76788
77301
|
x: anchorX - iconSize / 2,
|
|
76789
77302
|
y: anchorY - iconSize / 2,
|
|
@@ -76794,16 +77307,16 @@
|
|
|
76794
77307
|
dx: dx,
|
|
76795
77308
|
dy: dy
|
|
76796
77309
|
});
|
|
76797
|
-
playIcon.name = "play-icon", cellGroup.appendChild(playIcon), shouldSnapshot && snapshotVideoFirstFrame(video, image, table) && releaseCurrentVideo(), scenegraph.updateNextFrame();
|
|
77310
|
+
markCellMedia(playIcon, "play-icon"), playIcon.name = "play-icon", cellGroup.appendChild(playIcon), shouldSnapshot && snapshotVideoFirstFrame(video, image, table) && releaseCurrentVideo(), scenegraph.updateNextFrame();
|
|
76798
77311
|
}), video.addEventListener("error", handleVideoLoadFail), video.addEventListener("abort", handleVideoLoadFail);
|
|
76799
|
-
const image = createImage({
|
|
77312
|
+
const image = markCellMedia(createImage({
|
|
76800
77313
|
x: padding[3],
|
|
76801
77314
|
y: padding[0],
|
|
76802
|
-
width: width - padding[1] - padding[3],
|
|
76803
|
-
height: height - padding[2] - padding[0],
|
|
77315
|
+
width: Math.max(1, width - padding[1] - padding[3]),
|
|
77316
|
+
height: Math.max(1, height - padding[2] - padding[0]),
|
|
76804
77317
|
image: video,
|
|
76805
77318
|
cursor: "pointer"
|
|
76806
|
-
});
|
|
77319
|
+
}), "image");
|
|
76807
77320
|
image.name = "image", image.keepAspectRatio = keepAspectRatio, image.textAlign = textAlign, image.textBaseline = textBaseline, cellGroup.appendChild(image), image.successCallback = () => {
|
|
76808
77321
|
const scenegraph = table.scenegraph;
|
|
76809
77322
|
scenegraph && isDamagePic(image) && (updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table), scenegraph.updateNextFrame());
|
|
@@ -77388,8 +77901,9 @@
|
|
|
77388
77901
|
scale.niceMax(target.targetTicks.length);
|
|
77389
77902
|
}
|
|
77390
77903
|
|
|
77391
|
-
function createButtonCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync) {
|
|
77904
|
+
function createButtonCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, cellValue) {
|
|
77392
77905
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
77906
|
+
const value = arguments.length >= 19 ? cellValue : table.getCellValue(col, row);
|
|
77393
77907
|
if (!cellGroup) {
|
|
77394
77908
|
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
77395
77909
|
isAsync && (cellGroup = table.scenegraph.highPerformanceGetCell(col, row, !0)) && "cell" === cellGroup.role && cellGroup.setAttributes({
|
|
@@ -77445,10 +77959,10 @@
|
|
|
77445
77959
|
"middle" === textBaseline ? child.setAttribute("y", (height - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", height - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]);
|
|
77446
77960
|
});
|
|
77447
77961
|
}
|
|
77448
|
-
const buttonComponent = createButton(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table);
|
|
77962
|
+
const buttonComponent = createButton(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table, value);
|
|
77449
77963
|
return buttonComponent && cellGroup.appendChild(buttonComponent), width -= padding[1] + padding[3] + iconWidth, height -= padding[0] + padding[2], "center" === textAlign ? buttonComponent.setAttribute("x", padding[3] + cellLeftIconWidth + (width - buttonComponent.AABBBounds.width()) / 2) : "right" === textAlign ? buttonComponent.setAttribute("x", padding[3] + cellLeftIconWidth + width - buttonComponent.AABBBounds.width()) : buttonComponent.setAttribute("x", padding[3] + cellLeftIconWidth), "middle" === textBaseline ? buttonComponent.setAttribute("y", padding[0] + (height - buttonComponent.AABBBounds.height()) / 2) : "bottom" === textBaseline ? buttonComponent.setAttribute("y", padding[0] + height - buttonComponent.AABBBounds.height()) : buttonComponent.setAttribute("y", padding[0]), cellGroup;
|
|
77450
77964
|
}
|
|
77451
|
-
function createButton(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table) {
|
|
77965
|
+
function createButton(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table, cellValue) {
|
|
77452
77966
|
var _a, _b;
|
|
77453
77967
|
const style = table._getCellStyle(col, row),
|
|
77454
77968
|
buttonColor = getProp("buttonColor", style, col, row, table),
|
|
@@ -77462,7 +77976,7 @@
|
|
|
77462
77976
|
buttonDisableColor = getProp("buttonDisableColor", style, col, row, table),
|
|
77463
77977
|
buttonDisableBorderColor = getProp("buttonDisableBorderColor", style, col, row, table),
|
|
77464
77978
|
buttonTextDisableColor = getProp("buttonTextDisableColor", style, col, row, table),
|
|
77465
|
-
value =
|
|
77979
|
+
value = cellValue,
|
|
77466
77980
|
dataValue = table.getCellOriginValue(col, row),
|
|
77467
77981
|
hierarchyOffset = getHierarchyOffset(col, row, table),
|
|
77468
77982
|
cellStyle = table._getCellStyle(col, row),
|
|
@@ -77573,8 +78087,11 @@
|
|
|
77573
78087
|
const registerVideoCell = () => {
|
|
77574
78088
|
Factory.registerFunction("createVideoCellGroup", createVideoCellGroup);
|
|
77575
78089
|
};
|
|
78090
|
+
const registerAudioCell = () => {
|
|
78091
|
+
Factory.registerFunction("createAudioCellGroup", createAudioCellGroup);
|
|
78092
|
+
};
|
|
77576
78093
|
|
|
77577
|
-
registerAxis(), registerEmptyTip(), registerLegend(), registerMenu(), registerTitle(), registerTooltip(), registerListTreeStickCellPlugin(), registerCustomCellStylePlugin(), registerAnimation(), registerChartCell(), registerCheckboxCell(), registerImageCell(), registerProgressBarCell(), registerRadioCell(), registerSwitchCell(), registerButtonCell(), registerSparkLineCell(), registerTextCell(), registerVideoCell();
|
|
78094
|
+
registerAxis(), registerEmptyTip(), registerLegend(), registerMenu(), registerTitle(), registerTooltip(), registerListTreeStickCellPlugin(), registerCustomCellStylePlugin(), registerAnimation(), registerAudioCell(), registerChartCell(), registerCheckboxCell(), registerImageCell(), registerProgressBarCell(), registerRadioCell(), registerSwitchCell(), registerButtonCell(), registerSparkLineCell(), registerTextCell(), registerVideoCell();
|
|
77578
78095
|
class ListTableAll extends ListTable {}
|
|
77579
78096
|
|
|
77580
78097
|
class Circle extends Circle$1 {
|
|
@@ -87912,7 +88429,7 @@
|
|
|
87912
88429
|
PluginManager: PluginManager
|
|
87913
88430
|
});
|
|
87914
88431
|
|
|
87915
|
-
const version = "1.26.
|
|
88432
|
+
const version = "1.26.7";
|
|
87916
88433
|
|
|
87917
88434
|
exports.Gantt = Gantt;
|
|
87918
88435
|
exports.TABLE_EVENT_TYPE = TABLE_EVENT_TYPE;
|