@leankylin-sheet/react 4.0.17 → 4.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -19
- package/dist/index.css +3364 -3364
- package/dist/index.esm.css +3364 -3364
- package/dist/index.esm.js +4 -1
- package/dist/index.js +4 -1
- package/dist/index.umd.css +3364 -3364
- package/dist/index.umd.js +69 -55
- package/dist/index.umd.min.js +1 -1
- package/package.json +3 -3
package/dist/index.umd.js
CHANGED
|
@@ -75897,7 +75897,6 @@
|
|
|
75897
75897
|
y: moveY
|
|
75898
75898
|
};
|
|
75899
75899
|
normalizeSelection(ctx, ctx.luckysheet_select_save);
|
|
75900
|
-
scrollToHighlightCell(ctx, row_index, col_index);
|
|
75901
75900
|
} else if (type === "rangeOfFormula") {
|
|
75902
75901
|
var _last = ctx.formulaCache.func_selectedrange;
|
|
75903
75902
|
if (!_last) return;
|
|
@@ -76715,6 +76714,11 @@
|
|
|
76715
76714
|
}
|
|
76716
76715
|
return "<table data-type=\"leankylin-copy-action-table\">".concat(colgroup).concat(cpdata, "</table>");
|
|
76717
76716
|
}
|
|
76717
|
+
function ptToPx(pt) {
|
|
76718
|
+
var ppi = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 96;
|
|
76719
|
+
var px = pt * (ppi / 72);
|
|
76720
|
+
return parseFloat(px.toFixed(2));
|
|
76721
|
+
}
|
|
76718
76722
|
function cellAttrToDomStyle(cell, cellBorderInfo) {
|
|
76719
76723
|
var _ref = cell || {},
|
|
76720
76724
|
bg = _ref.bg,
|
|
@@ -76735,7 +76739,7 @@
|
|
|
76735
76739
|
2: "bottom"
|
|
76736
76740
|
}[String(vt)] || "middle";
|
|
76737
76741
|
var fontWeight = bl === 1 ? "bold" : "normal";
|
|
76738
|
-
var fontSize = "".concat(parseInt(fs, 10), "px");
|
|
76742
|
+
var fontSize = typeof fs === "number" ? ptToPx(fs) : "".concat(parseInt(fs, 10), "px");
|
|
76739
76743
|
var result = {
|
|
76740
76744
|
background: bg || "#fff",
|
|
76741
76745
|
color: fc || "#000",
|
|
@@ -76776,6 +76780,7 @@
|
|
|
76776
76780
|
var data = flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r = flowdata[r]) === null || _flowdata$r === void 0 ? void 0 : _flowdata$r[c];
|
|
76777
76781
|
var value = (_ref2 = (_data$m = data === null || data === void 0 ? void 0 : data.m) !== null && _data$m !== void 0 ? _data$m : data === null || data === void 0 ? void 0 : data.v) !== null && _ref2 !== void 0 ? _ref2 : "";
|
|
76778
76782
|
var realValue = (_ref3 = (_data$v = data === null || data === void 0 ? void 0 : data.v) !== null && _data$v !== void 0 ? _data$v : data === null || data === void 0 ? void 0 : data.m) !== null && _ref3 !== void 0 ? _ref3 : "";
|
|
76783
|
+
var f = (data === null || data === void 0 ? void 0 : data.f) || "";
|
|
76779
76784
|
var rowspan = (_data$mc$rs = data === null || data === void 0 ? void 0 : (_data$mc = data.mc) === null || _data$mc === void 0 ? void 0 : _data$mc.rs) !== null && _data$mc$rs !== void 0 ? _data$mc$rs : 1;
|
|
76780
76785
|
var colspan = (_data$mc$cs = data === null || data === void 0 ? void 0 : (_data$mc2 = data.mc) === null || _data$mc2 === void 0 ? void 0 : _data$mc2.cs) !== null && _data$mc$cs !== void 0 ? _data$mc$cs : 1;
|
|
76781
76786
|
if (!(data === null || data === void 0 ? void 0 : data.mc) || (data === null || data === void 0 ? void 0 : data.mc) && (data === null || data === void 0 ? void 0 : data.mc.r) === r && data.mc.c === c) {
|
|
@@ -76784,7 +76789,7 @@
|
|
|
76784
76789
|
var styleStr = (_Object$keys = Object.keys(style)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.map(function (item) {
|
|
76785
76790
|
return "".concat(item, ":").concat(style[item], ";");
|
|
76786
76791
|
}).join("");
|
|
76787
|
-
cpString += "<td x:num='".concat(realValue, "' style='").concat(styleStr, "' rowspan=").concat(rowspan, " colspan=").concat(colspan, ">").concat(value, "</td>");
|
|
76792
|
+
cpString += "<td x:num='".concat(realValue, "' f='").concat(f, "' style='").concat(styleStr, "' rowspan=").concat(rowspan, " colspan=").concat(colspan, ">").concat(value, "</td>");
|
|
76788
76793
|
}
|
|
76789
76794
|
};
|
|
76790
76795
|
for (var c = columns[0]; c <= columns[1]; c += 1) {
|
|
@@ -76970,6 +76975,7 @@
|
|
|
76970
76975
|
|
|
76971
76976
|
function defaultContext(refs) {
|
|
76972
76977
|
return {
|
|
76978
|
+
headerBgColor: "#fff",
|
|
76973
76979
|
cellOptions: [],
|
|
76974
76980
|
luckysheetfile: [],
|
|
76975
76981
|
defaultcolumnNum: 60,
|
|
@@ -78722,7 +78728,6 @@
|
|
|
78722
78728
|
if (freezenverticaldata != null && column != null) {
|
|
78723
78729
|
var freezen_colindex = freezenverticaldata[1];
|
|
78724
78730
|
var offset = lodash.sortedIndex(freezenverticaldata[3], ctx.scrollLeft);
|
|
78725
|
-
var top = freezenverticaldata[4];
|
|
78726
78731
|
freezen_colindex += offset;
|
|
78727
78732
|
if (column >= ctx.visibledatacolumn.length) {
|
|
78728
78733
|
column = ctx.visibledatacolumn.length - 1;
|
|
@@ -78730,16 +78735,10 @@
|
|
|
78730
78735
|
if (freezen_colindex >= ctx.visibledatacolumn.length) {
|
|
78731
78736
|
freezen_colindex = ctx.visibledatacolumn.length - 1;
|
|
78732
78737
|
}
|
|
78733
|
-
var column_px = ctx.visibledatacolumn[column];
|
|
78734
|
-
var freezen_px = ctx.visibledatacolumn[freezen_colindex];
|
|
78735
|
-
if (column_px <= freezen_px + top) {
|
|
78736
|
-
ctx.scrollLeft = 0;
|
|
78737
|
-
}
|
|
78738
78738
|
}
|
|
78739
78739
|
if (freezenhorizontaldata != null && row != null) {
|
|
78740
78740
|
var freezen_rowindex = freezenhorizontaldata[1];
|
|
78741
78741
|
var _offset = lodash.sortedIndex(freezenhorizontaldata[3], ctx.scrollTop);
|
|
78742
|
-
var left = freezenhorizontaldata[4];
|
|
78743
78742
|
freezen_rowindex += _offset;
|
|
78744
78743
|
if (row >= ctx.visibledatarow.length) {
|
|
78745
78744
|
row = ctx.visibledatarow.length - 1;
|
|
@@ -78747,11 +78746,6 @@
|
|
|
78747
78746
|
if (freezen_rowindex >= ctx.visibledatarow.length) {
|
|
78748
78747
|
freezen_rowindex = ctx.visibledatarow.length - 1;
|
|
78749
78748
|
}
|
|
78750
|
-
var row_px = ctx.visibledatarow[row];
|
|
78751
|
-
var _freezen_px = ctx.visibledatarow[freezen_rowindex];
|
|
78752
|
-
if (row_px <= _freezen_px + left) {
|
|
78753
|
-
ctx.scrollTop = 0;
|
|
78754
|
-
}
|
|
78755
78749
|
}
|
|
78756
78750
|
}
|
|
78757
78751
|
function getFrozenHandleTop(ctx) {
|
|
@@ -80768,7 +80762,8 @@
|
|
|
80768
80762
|
} while (sheetNames.indexOf(sheetCopyName) !== -1);
|
|
80769
80763
|
return sheetCopyName;
|
|
80770
80764
|
}
|
|
80771
|
-
function copySheet(ctx, sheetId) {
|
|
80765
|
+
function copySheet(ctx, sheetId, hooks) {
|
|
80766
|
+
var _hooks$onCopySheet;
|
|
80772
80767
|
var index$1 = getSheetIndex(ctx, sheetId);
|
|
80773
80768
|
var order = ctx.luckysheetfile[index$1].order + 1;
|
|
80774
80769
|
var sheetName = generateCopySheetName(ctx, sheetId);
|
|
@@ -80777,10 +80772,13 @@
|
|
|
80777
80772
|
delete sheetData.status;
|
|
80778
80773
|
sheetData.celldata = dataToCelldata(sheetData.data);
|
|
80779
80774
|
delete sheetData.data;
|
|
80780
|
-
|
|
80775
|
+
var copyId = v4();
|
|
80776
|
+
sheetData.id = copyId;
|
|
80777
|
+
addSheet$1(ctx, undefined, copyId, ctx.luckysheetfile[index$1].isPivotTable, sheetName, sheetData);
|
|
80781
80778
|
var sheetOrderList = {};
|
|
80782
80779
|
sheetOrderList[ctx.luckysheetfile[ctx.luckysheetfile.length - 1].id] = order;
|
|
80783
80780
|
setSheetOrder(ctx, sheetOrderList);
|
|
80781
|
+
(_hooks$onCopySheet = hooks.onCopySheet) === null || _hooks$onCopySheet === void 0 ? void 0 : _hooks$onCopySheet.call(hooks, sheetId, copyId);
|
|
80784
80782
|
}
|
|
80785
80783
|
function calculateSheetFromula(ctx, id) {
|
|
80786
80784
|
var index$1 = getSheetIndex(ctx, id);
|
|
@@ -80792,7 +80790,9 @@
|
|
|
80792
80790
|
continue;
|
|
80793
80791
|
}
|
|
80794
80792
|
var result = execfunction(ctx, (_ctx$luckysheetfile$i2 = ctx.luckysheetfile[index$1].data[r][c]) === null || _ctx$luckysheetfile$i2 === void 0 ? void 0 : _ctx$luckysheetfile$i2.f, r, c, id);
|
|
80795
|
-
setCellValue$1(ctx, r, c, result[1], null
|
|
80793
|
+
setCellValue$1(ctx, r, c, result[1], null, {
|
|
80794
|
+
id: id
|
|
80795
|
+
});
|
|
80796
80796
|
insertUpdateFunctionGroup(ctx, r, c, id);
|
|
80797
80797
|
}
|
|
80798
80798
|
}
|
|
@@ -86253,7 +86253,7 @@
|
|
|
86253
86253
|
continue;
|
|
86254
86254
|
}
|
|
86255
86255
|
if (((_this$sheetCtx$config = this.sheetCtx.config) === null || _this$sheetCtx$config === void 0 ? void 0 : (_this$sheetCtx$config2 = _this$sheetCtx$config.rowhidden) === null || _this$sheetCtx$config2 === void 0 ? void 0 : _this$sheetCtx$config2[r]) == null) {
|
|
86256
|
-
renderCtx.fillStyle = "#
|
|
86256
|
+
renderCtx.fillStyle = this.sheetCtx.headerBgColor || "#fff";
|
|
86257
86257
|
renderCtx.fillRect(0, start_r + offsetTop + firstOffset, this.sheetCtx.rowHeaderWidth - 1, end_r - start_r + 1 + lastOffset - firstOffset);
|
|
86258
86258
|
renderCtx.fillStyle = "#000000";
|
|
86259
86259
|
renderCtx.save();
|
|
@@ -86346,7 +86346,7 @@
|
|
|
86346
86346
|
continue;
|
|
86347
86347
|
}
|
|
86348
86348
|
if (((_this$sheetCtx$config5 = this.sheetCtx.config) === null || _this$sheetCtx$config5 === void 0 ? void 0 : (_this$sheetCtx$config6 = _this$sheetCtx$config5.colhidden) === null || _this$sheetCtx$config6 === void 0 ? void 0 : _this$sheetCtx$config6[c]) == null) {
|
|
86349
|
-
renderCtx.fillStyle = "#
|
|
86349
|
+
renderCtx.fillStyle = this.sheetCtx.headerBgColor || "#fff";
|
|
86350
86350
|
renderCtx.fillRect(start_c + offsetLeft - 1, 0, end_c - start_c, this.sheetCtx.columnHeaderHeight - 1);
|
|
86351
86351
|
renderCtx.fillStyle = "#000000";
|
|
86352
86352
|
renderCtx.save();
|
|
@@ -88099,10 +88099,6 @@
|
|
|
88099
88099
|
if (lodash.size(ctx.luckysheet_select_save) > 1) {
|
|
88100
88100
|
return;
|
|
88101
88101
|
}
|
|
88102
|
-
if (lodash.size(ctx.luckysheet_filter_save) > 0) {
|
|
88103
|
-
clearFilter(ctx);
|
|
88104
|
-
return;
|
|
88105
|
-
}
|
|
88106
88102
|
var sheetIndex = getSheetIndex(ctx, ctx.currentSheetId);
|
|
88107
88103
|
if (sheetIndex == null || ctx.luckysheetfile[sheetIndex].isPivotTable) {
|
|
88108
88104
|
return;
|
|
@@ -90172,7 +90168,6 @@
|
|
|
90172
90168
|
}
|
|
90173
90169
|
}
|
|
90174
90170
|
function setCellValues(ctx, data, cellInput) {
|
|
90175
|
-
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
90176
90171
|
if (data == null) {
|
|
90177
90172
|
throw INVALID_PARAMS;
|
|
90178
90173
|
}
|
|
@@ -90180,8 +90175,9 @@
|
|
|
90180
90175
|
var _data$j = data[j],
|
|
90181
90176
|
r = _data$j.r,
|
|
90182
90177
|
c = _data$j.c,
|
|
90183
|
-
v = _data$j.v
|
|
90184
|
-
|
|
90178
|
+
v = _data$j.v,
|
|
90179
|
+
ops = _data$j.ops;
|
|
90180
|
+
setCellValue$1(ctx, r, c, v, cellInput, ops);
|
|
90185
90181
|
}
|
|
90186
90182
|
}
|
|
90187
90183
|
function setCellFormatByRange(ctx, attr, value, range) {
|
|
@@ -90329,6 +90325,7 @@
|
|
|
90329
90325
|
});
|
|
90330
90326
|
|
|
90331
90327
|
var defaultSettings = {
|
|
90328
|
+
headerBgColor: "#fff",
|
|
90332
90329
|
toolbarRightRender: undefined,
|
|
90333
90330
|
onClickContentEditable: undefined,
|
|
90334
90331
|
renderCustomColor: undefined,
|
|
@@ -90373,7 +90370,7 @@
|
|
|
90373
90370
|
},
|
|
90374
90371
|
headerContextMenu: ["copy", "paste", "|", "insert-row", "insert-column", "delete-row", "delete-column", "delete-cell", "hide-row", "hide-column", "set-row-height", "set-column-width", "|", "clear", "sort", "orderAZ", "orderZA"],
|
|
90375
90372
|
sheetTabContextMenu: ["delete", "copy", "rename", "color", "hide", "|", "move"],
|
|
90376
|
-
filterContextMenu: ["sort-by-asc", "sort-by-desc", "|", "filter-by-
|
|
90373
|
+
filterContextMenu: ["sort-by-asc", "sort-by-desc", "|", "filter-by-value"],
|
|
90377
90374
|
generateSheetId: function generateSheetId() {
|
|
90378
90375
|
return v4();
|
|
90379
90376
|
},
|
|
@@ -90699,7 +90696,6 @@
|
|
|
90699
90696
|
function handleGlobalWheel(ctx, e, cache, scrollbarX, scrollbarY) {
|
|
90700
90697
|
var _cache$searchDialog;
|
|
90701
90698
|
if (((_cache$searchDialog = cache.searchDialog) === null || _cache$searchDialog === void 0 ? void 0 : _cache$searchDialog.mouseEnter) && ctx.showSearch && ctx.showReplace) return;
|
|
90702
|
-
if (ctx.filterContextMenu != null) return;
|
|
90703
90699
|
var scrollLeft = scrollbarX.scrollLeft;
|
|
90704
90700
|
var scrollTop = scrollbarY.scrollTop;
|
|
90705
90701
|
if (e.deltaY !== 0) {
|
|
@@ -90739,7 +90735,7 @@
|
|
|
90739
90735
|
};
|
|
90740
90736
|
}
|
|
90741
90737
|
function handleCellAreaMouseDown(ctx, globalCache, e, cellInput, container, fxInput, canvas) {
|
|
90742
|
-
var _globalCache$freezen, _ctx$hooks$beforeCell, _ctx$hooks, _flowdata$row_index
|
|
90738
|
+
var _globalCache$freezen, _ctx$hooks$beforeCell, _ctx$hooks, _flowdata$row_index, _flowdata$row_index2, _flowdata$row_index2$;
|
|
90743
90739
|
ctx.contextMenu = {};
|
|
90744
90740
|
ctx.filterContextMenu = undefined;
|
|
90745
90741
|
var flowdata = getFlowdata(ctx);
|
|
@@ -90909,7 +90905,6 @@
|
|
|
90909
90905
|
}
|
|
90910
90906
|
cellInput.innerHTML = vText;
|
|
90911
90907
|
cancelFunctionrangeSelected(ctx);
|
|
90912
|
-
createRangeHightlight(ctx, vText);
|
|
90913
90908
|
}
|
|
90914
90909
|
ctx.formulaCache.rangestart = false;
|
|
90915
90910
|
ctx.formulaCache.rangedrag_column_start = false;
|
|
@@ -90955,9 +90950,6 @@
|
|
|
90955
90950
|
ctx.formulaCache.rangedrag_column_start = false;
|
|
90956
90951
|
ctx.formulaCache.rangedrag_row_start = false;
|
|
90957
90952
|
ctx.formulaCache.selectingRangeIndex = ctx.formulaCache.rangechangeindex;
|
|
90958
|
-
if (ctx.formulaCache.rangechangeindex > ctx.formulaRangeHighlight.length) {
|
|
90959
|
-
createRangeHightlight(ctx, cellInput.innerHTML, ctx.formulaCache.rangechangeindex);
|
|
90960
|
-
}
|
|
90961
90953
|
createFormulaRangeSelect(ctx, {
|
|
90962
90954
|
rangeIndex: ctx.formulaCache.rangechangeindex || 0,
|
|
90963
90955
|
left: left,
|
|
@@ -91075,10 +91067,12 @@
|
|
|
91075
91067
|
}
|
|
91076
91068
|
}
|
|
91077
91069
|
ctx.luckysheet_select_save = normalizeSelection(ctx, ctx.luckysheet_select_save);
|
|
91070
|
+
var f = ((_flowdata$row_index2 = flowdata[row_index]) === null || _flowdata$row_index2 === void 0 ? void 0 : (_flowdata$row_index2$ = _flowdata$row_index2[col_index]) === null || _flowdata$row_index2$ === void 0 ? void 0 : _flowdata$row_index2$.f) || "";
|
|
91071
|
+
createRangeHightlight(ctx, functionHTMLGenerate(f));
|
|
91078
91072
|
if (ctx.hooks.afterCellMouseDown) {
|
|
91079
91073
|
setTimeout(function () {
|
|
91080
|
-
var _ctx$hooks$afterCellM, _ctx$hooks2, _flowdata$
|
|
91081
|
-
(_ctx$hooks$afterCellM = (_ctx$hooks2 = ctx.hooks).afterCellMouseDown) === null || _ctx$hooks$afterCellM === void 0 ? void 0 : _ctx$hooks$afterCellM.call(_ctx$hooks2, (_flowdata$
|
|
91074
|
+
var _ctx$hooks$afterCellM, _ctx$hooks2, _flowdata$row_index3;
|
|
91075
|
+
(_ctx$hooks$afterCellM = (_ctx$hooks2 = ctx.hooks).afterCellMouseDown) === null || _ctx$hooks$afterCellM === void 0 ? void 0 : _ctx$hooks$afterCellM.call(_ctx$hooks2, (_flowdata$row_index3 = flowdata[row_index]) === null || _flowdata$row_index3 === void 0 ? void 0 : _flowdata$row_index3[col_index], {
|
|
91082
91076
|
row: row_index,
|
|
91083
91077
|
column: col_index,
|
|
91084
91078
|
startRow: row_pre,
|
|
@@ -91090,7 +91084,7 @@
|
|
|
91090
91084
|
}
|
|
91091
91085
|
}
|
|
91092
91086
|
function handleCellDrop(ctx, globalCache, e, container) {
|
|
91093
|
-
var _globalCache$freezen2, _flowdata$
|
|
91087
|
+
var _globalCache$freezen2, _flowdata$row_index4;
|
|
91094
91088
|
var afterCellDrop = ctx.hooks.afterCellDrop;
|
|
91095
91089
|
if (!afterCellDrop) {
|
|
91096
91090
|
return;
|
|
@@ -91117,7 +91111,7 @@
|
|
|
91117
91111
|
var col_location = colLocation(x, ctx.visibledatacolumn);
|
|
91118
91112
|
var col_pre = col_location[0];
|
|
91119
91113
|
var col_index = col_location[2];
|
|
91120
|
-
var currentCellValue = JSON.parse(JSON.stringify((_flowdata$
|
|
91114
|
+
var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index4 = flowdata[row_index]) === null || _flowdata$row_index4 === void 0 ? void 0 : _flowdata$row_index4[col_index]));
|
|
91121
91115
|
var box = document.querySelector(".leankylin-cell-area");
|
|
91122
91116
|
if (box) {
|
|
91123
91117
|
var _currentCellValue$cu;
|
|
@@ -91153,7 +91147,7 @@
|
|
|
91153
91147
|
});
|
|
91154
91148
|
}
|
|
91155
91149
|
function handleCellAreaDragOver(ctx, globalCache, e, container) {
|
|
91156
|
-
var _globalCache$freezen3, _flowdata$
|
|
91150
|
+
var _globalCache$freezen3, _flowdata$row_index5;
|
|
91157
91151
|
var canDrop = ctx.hooks.afterCellDrop;
|
|
91158
91152
|
if (!canDrop) {
|
|
91159
91153
|
return;
|
|
@@ -91182,7 +91176,7 @@
|
|
|
91182
91176
|
var col_pre = col_location[0];
|
|
91183
91177
|
var col_end = col_location[1];
|
|
91184
91178
|
var col_index = col_location[2];
|
|
91185
|
-
var currentCellValue = JSON.parse(JSON.stringify((_flowdata$
|
|
91179
|
+
var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index5 = flowdata[row_index]) === null || _flowdata$row_index5 === void 0 ? void 0 : _flowdata$row_index5[col_index]));
|
|
91186
91180
|
var box = document.querySelector(".leankylin-cell-area");
|
|
91187
91181
|
if (box) {
|
|
91188
91182
|
var _currentCellValue$cu2;
|
|
@@ -91213,13 +91207,11 @@
|
|
|
91213
91207
|
};
|
|
91214
91208
|
}
|
|
91215
91209
|
function handleCellAreaMouseMove(ctx, globalCache, e, container) {
|
|
91216
|
-
var _globalCache$freezen4, _flowdata$
|
|
91210
|
+
var _globalCache$freezen4, _flowdata$row_index6;
|
|
91217
91211
|
var afterCellMouseMove = ctx.hooks.afterCellMouseMove;
|
|
91218
91212
|
if (!afterCellMouseMove) {
|
|
91219
91213
|
return;
|
|
91220
91214
|
}
|
|
91221
|
-
ctx.contextMenu = {};
|
|
91222
|
-
ctx.filterContextMenu = undefined;
|
|
91223
91215
|
var flowdata = getFlowdata(ctx);
|
|
91224
91216
|
if (!flowdata) return;
|
|
91225
91217
|
var rect = container.getBoundingClientRect();
|
|
@@ -91240,7 +91232,7 @@
|
|
|
91240
91232
|
var col_location = colLocation(x, ctx.visibledatacolumn);
|
|
91241
91233
|
var col_pre = col_location[0];
|
|
91242
91234
|
var col_index = col_location[2];
|
|
91243
|
-
var currentCellValue = JSON.parse(JSON.stringify((_flowdata$
|
|
91235
|
+
var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index6 = flowdata[row_index]) === null || _flowdata$row_index6 === void 0 ? void 0 : _flowdata$row_index6[col_index]));
|
|
91244
91236
|
var box = document.querySelector(".leankylin-cell-area");
|
|
91245
91237
|
if (box) {
|
|
91246
91238
|
var _currentCellValue$cu3;
|
|
@@ -92693,7 +92685,13 @@
|
|
|
92693
92685
|
};
|
|
92694
92686
|
}
|
|
92695
92687
|
function getClipboardData(ctx, e, copyRich, startRow, startCol) {
|
|
92688
|
+
var _ctx$luckysheetfile, _currentSheet$data, _currentSheet$data2, _currentSheet$data2$, _Array$from;
|
|
92696
92689
|
var clipboardData = e.clipboardData;
|
|
92690
|
+
var currentSheet = (_ctx$luckysheetfile = ctx.luckysheetfile) === null || _ctx$luckysheetfile === void 0 ? void 0 : _ctx$luckysheetfile.find(function (item) {
|
|
92691
|
+
return item.id === ctx.currentSheetId;
|
|
92692
|
+
});
|
|
92693
|
+
var currentRowLen = (currentSheet === null || currentSheet === void 0 ? void 0 : (_currentSheet$data = currentSheet.data) === null || _currentSheet$data === void 0 ? void 0 : _currentSheet$data.length) || 1000;
|
|
92694
|
+
var currentColLen = (currentSheet === null || currentSheet === void 0 ? void 0 : (_currentSheet$data2 = currentSheet.data) === null || _currentSheet$data2 === void 0 ? void 0 : (_currentSheet$data2$ = _currentSheet$data2[0]) === null || _currentSheet$data2$ === void 0 ? void 0 : _currentSheet$data2$.length) || 200;
|
|
92697
92695
|
var txtdata = clipboardData.getData("text/html");
|
|
92698
92696
|
var iframe = document.createElement("iframe");
|
|
92699
92697
|
iframe.style.display = "none";
|
|
@@ -92701,19 +92699,22 @@
|
|
|
92701
92699
|
var iframeDoc = iframe.contentDocument;
|
|
92702
92700
|
iframeDoc.documentElement.innerHTML = txtdata;
|
|
92703
92701
|
var htmlDoc = iframeDoc === null || iframeDoc === void 0 ? void 0 : iframeDoc.documentElement;
|
|
92704
|
-
var rows = htmlDoc.querySelectorAll("tbody tr");
|
|
92702
|
+
var rows = (_Array$from = Array.from(htmlDoc.querySelectorAll("tbody tr"))) === null || _Array$from === void 0 ? void 0 : _Array$from.slice(0, currentRowLen);
|
|
92705
92703
|
if (!rows || rows.length < 1) {
|
|
92706
92704
|
return {
|
|
92707
|
-
data: [[clipboardData.getData("text")]]
|
|
92705
|
+
data: [[clipboardData.getData("text")]],
|
|
92706
|
+
borderInfo: [],
|
|
92707
|
+
merge: {}
|
|
92708
92708
|
};
|
|
92709
92709
|
}
|
|
92710
92710
|
var result = [];
|
|
92711
92711
|
var borderInfo = [];
|
|
92712
|
+
var merge = {};
|
|
92712
92713
|
var startOffColIndexMap = {};
|
|
92713
92714
|
for (var index = 0; index < (rows === null || rows === void 0 ? void 0 : rows.length); index += 1) {
|
|
92714
92715
|
var row = rows[index];
|
|
92715
92716
|
var isFirstNoRs = false;
|
|
92716
|
-
var cells = row.querySelectorAll("td");
|
|
92717
|
+
var cells = Array.from(row.querySelectorAll("td")).slice(0, currentColLen);
|
|
92717
92718
|
if (!result[index]) {
|
|
92718
92719
|
result[index] = [];
|
|
92719
92720
|
}
|
|
@@ -92723,13 +92724,15 @@
|
|
|
92723
92724
|
var cell = cells[cIndex];
|
|
92724
92725
|
var m = cell === null || cell === void 0 ? void 0 : cell.textContent;
|
|
92725
92726
|
var v = cell.getAttribute("x:num");
|
|
92727
|
+
var f = cell.getAttribute("f");
|
|
92726
92728
|
if (copyRich) {
|
|
92727
92729
|
var style = iframe.contentWindow.getComputedStyle(cell);
|
|
92728
92730
|
var rowspan = Number(cell.getAttribute("rowspan")) || 1;
|
|
92729
92731
|
var colspan = Number(cell.getAttribute("colspan")) || 1;
|
|
92730
92732
|
var mainCell = _objectSpread2$1({
|
|
92731
92733
|
v: v || m,
|
|
92732
|
-
m: m || v
|
|
92734
|
+
m: m || v,
|
|
92735
|
+
f: f || undefined
|
|
92733
92736
|
}, domStyleToCellAttr(style));
|
|
92734
92737
|
if (colspan > 1 || rowspan > 1) {
|
|
92735
92738
|
mainCell.mc = {
|
|
@@ -92738,6 +92741,7 @@
|
|
|
92738
92741
|
r: index + startRow,
|
|
92739
92742
|
c: _colIndex
|
|
92740
92743
|
};
|
|
92744
|
+
merge["".concat(index + startRow, "_").concat(_colIndex)] = mainCell.mc;
|
|
92741
92745
|
borderInfo.push.apply(borderInfo, _toConsumableArray$2(getCellMcBorder(ctx, style, index + startRow, _colIndex, mainCell.mc)));
|
|
92742
92746
|
} else {
|
|
92743
92747
|
isFirstNoRs = true;
|
|
@@ -92784,7 +92788,8 @@
|
|
|
92784
92788
|
}
|
|
92785
92789
|
return {
|
|
92786
92790
|
data: result,
|
|
92787
|
-
borderInfo: borderInfo
|
|
92791
|
+
borderInfo: borderInfo,
|
|
92792
|
+
merge: merge
|
|
92788
92793
|
};
|
|
92789
92794
|
}
|
|
92790
92795
|
function handlePasteByLeanklin(_x2, _x3, _x4) {
|
|
@@ -92793,7 +92798,7 @@
|
|
|
92793
92798
|
function _handlePasteByLeanklin() {
|
|
92794
92799
|
_handlePasteByLeanklin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ctx, e, copyRich) {
|
|
92795
92800
|
var _ctx$luckysheet_selec8, _data$0$;
|
|
92796
|
-
var allowEdit, selectRange, rows, columns, _getClipboardData, copyData, borderInfo, _ctx$config$borderInf, index, data, copyOne, pasteData, r, rIndex, c, row, column, range;
|
|
92801
|
+
var allowEdit, selectRange, rows, columns, _getClipboardData, copyData, borderInfo, merge, _ctx$config$borderInf, index, data, copyOne, pasteData, r, rIndex, c, row, column, range;
|
|
92797
92802
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
92798
92803
|
while (1) switch (_context2.prev = _context2.next) {
|
|
92799
92804
|
case 0:
|
|
@@ -92813,13 +92818,19 @@
|
|
|
92813
92818
|
case 6:
|
|
92814
92819
|
rows = selectRange.row;
|
|
92815
92820
|
columns = selectRange.column;
|
|
92816
|
-
_getClipboardData = getClipboardData(ctx, e, copyRich, rows[0], columns[0]), copyData = _getClipboardData.data, borderInfo = _getClipboardData.borderInfo;
|
|
92821
|
+
_getClipboardData = getClipboardData(ctx, e, copyRich, rows[0], columns[0]), copyData = _getClipboardData.data, borderInfo = _getClipboardData.borderInfo, merge = _getClipboardData.merge;
|
|
92817
92822
|
if (!ctx.config.borderInfo) {
|
|
92818
92823
|
ctx.config.borderInfo = [];
|
|
92819
92824
|
}
|
|
92820
92825
|
if (copyRich) {
|
|
92821
92826
|
(_ctx$config$borderInf = ctx.config.borderInfo).push.apply(_ctx$config$borderInf, _toConsumableArray$2(borderInfo));
|
|
92822
92827
|
}
|
|
92828
|
+
if (!ctx.config.merge) {
|
|
92829
|
+
ctx.config.merge = {};
|
|
92830
|
+
}
|
|
92831
|
+
if (copyRich) {
|
|
92832
|
+
ctx.config.merge = Object.assign(ctx.config.merge, merge);
|
|
92833
|
+
}
|
|
92823
92834
|
index = getSheetIndex(ctx, ctx.currentSheetId);
|
|
92824
92835
|
ctx.luckysheetfile[index].config = ctx.config;
|
|
92825
92836
|
data = copyData;
|
|
@@ -92841,14 +92852,14 @@
|
|
|
92841
92852
|
column: column
|
|
92842
92853
|
};
|
|
92843
92854
|
if (isAllowEdit(ctx, [range])) {
|
|
92844
|
-
_context2.next =
|
|
92855
|
+
_context2.next = 24;
|
|
92845
92856
|
break;
|
|
92846
92857
|
}
|
|
92847
92858
|
return _context2.abrupt("return");
|
|
92848
|
-
case
|
|
92859
|
+
case 24:
|
|
92849
92860
|
setCellValuesByRange(ctx, pasteData, range, null);
|
|
92850
92861
|
ctx.luckysheet_select_save = [range];
|
|
92851
|
-
case
|
|
92862
|
+
case 26:
|
|
92852
92863
|
case "end":
|
|
92853
92864
|
return _context2.stop();
|
|
92854
92865
|
}
|
|
@@ -98116,6 +98127,9 @@
|
|
|
98116
98127
|
setContext = _useContext.setContext,
|
|
98117
98128
|
settings = _useContext.settings,
|
|
98118
98129
|
refs = _useContext.refs;
|
|
98130
|
+
var _useInViewport = useInViewport(refs.cellArea),
|
|
98131
|
+
_useInViewport2 = _slicedToArray(_useInViewport, 1),
|
|
98132
|
+
inViewport = _useInViewport2[0];
|
|
98119
98133
|
var _useDialog = useDialog(),
|
|
98120
98134
|
showDialog = _useDialog.showDialog;
|
|
98121
98135
|
var containerRef = React.useRef(null);
|
|
@@ -98261,7 +98275,7 @@
|
|
|
98261
98275
|
React.useEffect(function () {
|
|
98262
98276
|
refs.cellArea.current.scrollLeft = context.scrollLeft;
|
|
98263
98277
|
refs.cellArea.current.scrollTop = context.scrollTop;
|
|
98264
|
-
}, [context.scrollLeft, context.scrollTop, refs.cellArea, (_refs$cellArea$curren = refs.cellArea.current) === null || _refs$cellArea$curren === void 0 ? void 0 : _refs$cellArea$curren.scrollLeft, (_refs$cellArea$curren2 = refs.cellArea.current) === null || _refs$cellArea$curren2 === void 0 ? void 0 : _refs$cellArea$curren2.scrollTop]);
|
|
98278
|
+
}, [context.scrollLeft, context.scrollTop, refs.cellArea, (_refs$cellArea$curren = refs.cellArea.current) === null || _refs$cellArea$curren === void 0 ? void 0 : _refs$cellArea$curren.scrollLeft, (_refs$cellArea$curren2 = refs.cellArea.current) === null || _refs$cellArea$curren2 === void 0 ? void 0 : _refs$cellArea$curren2.scrollTop, inViewport]);
|
|
98265
98279
|
React.useEffect(function () {
|
|
98266
98280
|
document.addEventListener("mousemove", onMouseMove);
|
|
98267
98281
|
return function () {
|