@leankylin-sheet/react 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +21 -2
- package/dist/index.js +20 -1
- package/dist/index.umd.css +1 -1
- package/dist/index.umd.js +892 -134
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/{components → react/src/components}/Workbook/index.d.ts +22 -22
- package/package.json +3 -2
- /package/dist/{components → react/src/components}/CellOptions/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/ChangeColor/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/ConditionFormat/ConditionRules.d.ts +0 -0
- /package/dist/{components → react/src/components}/ConditionFormat/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/ContextMenu/Divider.d.ts +0 -0
- /package/dist/{components → react/src/components}/ContextMenu/FilterMenu.d.ts +0 -0
- /package/dist/{components → react/src/components}/ContextMenu/Menu.d.ts +0 -0
- /package/dist/{components → react/src/components}/ContextMenu/SheetTab.d.ts +0 -0
- /package/dist/{components → react/src/components}/ContextMenu/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/CustomSort/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/DataVerification/DropdownList.d.ts +0 -0
- /package/dist/{components → react/src/components}/DataVerification/RangeDialog.d.ts +0 -0
- /package/dist/{components → react/src/components}/DataVerification/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/Dialog/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/FilterOption/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/FormatSearch/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/FormulaSearch/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/FxEditor/CalcInfo.d.ts +0 -0
- /package/dist/{components → react/src/components}/FxEditor/NameBox.d.ts +0 -0
- /package/dist/{components → react/src/components}/FxEditor/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/ImgBoxs/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/LinkEidtCard/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/LocationCondition/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/MessageBox/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/NotationBoxes/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/SVGDefines.d.ts +0 -0
- /package/dist/{components → react/src/components}/SVGIcon.d.ts +0 -0
- /package/dist/{components → react/src/components}/SearchReplace/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/Sheet/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetList/SheetHiddenButton.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetList/SheetListItem.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetList/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetOverlay/ColumnHeader.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetOverlay/ContentEditable.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetOverlay/FormulaHint/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetOverlay/FormulaSearch/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetOverlay/InputBox.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetOverlay/RowHeader.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetOverlay/ScrollBar/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetOverlay/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetTab/SheetItem.d.ts +0 -0
- /package/dist/{components → react/src/components}/SheetTab/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/SplitColumn/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/Toolbar/Button.d.ts +0 -0
- /package/dist/{components → react/src/components}/Toolbar/ColorPicker.d.ts +0 -0
- /package/dist/{components → react/src/components}/Toolbar/Combo.d.ts +0 -0
- /package/dist/{components → react/src/components}/Toolbar/CustomBorder.d.ts +0 -0
- /package/dist/{components → react/src/components}/Toolbar/CustomButton.d.ts +0 -0
- /package/dist/{components → react/src/components}/Toolbar/CustomColor.d.ts +0 -0
- /package/dist/{components → react/src/components}/Toolbar/CustomIcon.d.ts +0 -0
- /package/dist/{components → react/src/components}/Toolbar/Divider.d.ts +0 -0
- /package/dist/{components → react/src/components}/Toolbar/MoreItemsContainer.d.ts +0 -0
- /package/dist/{components → react/src/components}/Toolbar/Select.d.ts +0 -0
- /package/dist/{components → react/src/components}/Toolbar/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/Workbook/api.d.ts +0 -0
- /package/dist/{components → react/src/components}/ZoomControl/index.d.ts +0 -0
- /package/dist/{components → react/src/components}/index.d.ts +0 -0
- /package/dist/{context → react/src/context}/index.d.ts +0 -0
- /package/dist/{context → react/src/context}/modal.d.ts +0 -0
- /package/dist/{hooks → react/src/hooks}/useAlert.d.ts +0 -0
- /package/dist/{hooks → react/src/hooks}/useDialog.d.ts +0 -0
- /package/dist/{hooks → react/src/hooks}/useOutsideClick.d.ts +0 -0
- /package/dist/{hooks → react/src/hooks}/usePrevious.d.ts +0 -0
- /package/dist/{index.d.ts → react/src/index.d.ts} +0 -0
package/dist/index.umd.js
CHANGED
|
@@ -79380,10 +79380,16 @@
|
|
|
79380
79380
|
}
|
|
79381
79381
|
function format(fmt, v, o) {
|
|
79382
79382
|
if (fmt === null || fmt === void 0 ? void 0 : fmt.includes('leanky_n')) {
|
|
79383
|
+
if (isNaN(v) || Infinity == v || -Infinity == v) {
|
|
79384
|
+
return '#VALUE!';
|
|
79385
|
+
}
|
|
79383
79386
|
var precision = fmt.replace('leanky_n', '');
|
|
79384
79387
|
return numberThousands(v, ',', precision);
|
|
79385
79388
|
}
|
|
79386
79389
|
if (fmt === null || fmt === void 0 ? void 0 : fmt.includes('leanky_p')) {
|
|
79390
|
+
if (isNaN(v) || Infinity == v || -Infinity == v) {
|
|
79391
|
+
return '#VALUE!';
|
|
79392
|
+
}
|
|
79387
79393
|
var _precision = fmt.replace('leanky_p', '');
|
|
79388
79394
|
return numberThousands(v * 100, ',', _precision) + '%';
|
|
79389
79395
|
}
|
|
@@ -79564,9 +79570,6 @@
|
|
|
79564
79570
|
var groupSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';
|
|
79565
79571
|
var precision = arguments.length > 2 ? arguments[2] : undefined;
|
|
79566
79572
|
var number = Number(num).toFixed(precision);
|
|
79567
|
-
if (isNaN(number)) {
|
|
79568
|
-
return '';
|
|
79569
|
-
}
|
|
79570
79573
|
var _String$split = String(number).split('.'),
|
|
79571
79574
|
_String$split2 = _slicedToArray$3(_String$split, 2),
|
|
79572
79575
|
init = _String$split2[0],
|
|
@@ -84316,28 +84319,15 @@
|
|
|
84316
84319
|
if (cell.v === Infinity || cell.v === -Infinity) {
|
|
84317
84320
|
cell.m = cell.v.toString();
|
|
84318
84321
|
} else {
|
|
84319
|
-
|
|
84320
|
-
|
|
84321
|
-
|
|
84322
|
-
|
|
84323
|
-
|
|
84324
|
-
len = cell.v.toString().split(".")[1].split("e")[0].length;
|
|
84322
|
+
var v_p = Math.round(cell.v * 1000000000) / 1000000000;
|
|
84323
|
+
if (lodash.isNil(cell.ct)) {
|
|
84324
|
+
var mask = genarate(v_p);
|
|
84325
|
+
if (mask != null) {
|
|
84326
|
+
cell.m = mask[0].toString();
|
|
84325
84327
|
}
|
|
84326
|
-
if (len > 5) {
|
|
84327
|
-
len = 5;
|
|
84328
|
-
}
|
|
84329
|
-
cell.m = cell.v.toExponential(len).toString();
|
|
84330
84328
|
} else {
|
|
84331
|
-
var
|
|
84332
|
-
|
|
84333
|
-
var mask = genarate(v_p);
|
|
84334
|
-
if (mask != null) {
|
|
84335
|
-
cell.m = mask[0].toString();
|
|
84336
|
-
}
|
|
84337
|
-
} else {
|
|
84338
|
-
var _mask = update(cell.ct.fa, v_p);
|
|
84339
|
-
cell.m = _mask.toString();
|
|
84340
|
-
}
|
|
84329
|
+
var _mask = update(cell.ct.fa, v_p);
|
|
84330
|
+
cell.m = _mask.toString();
|
|
84341
84331
|
}
|
|
84342
84332
|
}
|
|
84343
84333
|
} else if (!lodash.isNil(cell.ct) && cell.ct.fa === "@") {
|
|
@@ -96775,7 +96765,7 @@
|
|
|
96775
96765
|
}, {
|
|
96776
96766
|
key: "nullCellRender",
|
|
96777
96767
|
value: function nullCellRender(r, c, startY, startX, endY, endX, renderCtx, afCompute, cfCompute, offsetLeft, offsetTop, dynamicArrayCompute, cellOverflowMap, colStart, colEnd, scrollHeight, scrollWidth, bodrder05) {
|
|
96778
|
-
var _this$sheetCtx$hooks$6, _this$sheetCtx$hooks6, _flowdata$r2, _flowdata$r3, _flowdata$
|
|
96768
|
+
var _this$sheetCtx$hooks$6, _this$sheetCtx$hooks6, _flowdata$r2, _flowdata$r3, _flowdata$r4, _flowdata$r4$c, _this$sheetCtx$hooks$7, _this$sheetCtx$hooks7;
|
|
96779
96769
|
var isMerge = arguments.length > 18 && arguments[18] !== undefined ? arguments[18] : false;
|
|
96780
96770
|
var checksCF = checkCF(r, c, cfCompute);
|
|
96781
96771
|
var flowdata = getFlowdata(this.sheetCtx);
|
|
@@ -96812,8 +96802,9 @@
|
|
|
96812
96802
|
renderCtx.textBaseline = "bottom";
|
|
96813
96803
|
renderCtx.fillText(lodash.isNil(value) ? "" : value, horizonAlignPos, verticalAlignPos);
|
|
96814
96804
|
}
|
|
96815
|
-
this.
|
|
96816
|
-
|
|
96805
|
+
this.renderDelLine(renderCtx, flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r2 = flowdata[r]) === null || _flowdata$r2 === void 0 ? void 0 : _flowdata$r2[c], startX, startY, endX, endY, offsetLeft, offsetTop);
|
|
96806
|
+
this.renderLyFlag(renderCtx, flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r3 = flowdata[r]) === null || _flowdata$r3 === void 0 ? void 0 : _flowdata$r3[c], startX, startY, offsetLeft, offsetTop);
|
|
96807
|
+
if (flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r4 = flowdata[r]) === null || _flowdata$r4 === void 0 ? void 0 : (_flowdata$r4$c = _flowdata$r4[c]) === null || _flowdata$r4$c === void 0 ? void 0 : _flowdata$r4$c.ps) {
|
|
96817
96808
|
var ps_w = 8 * this.sheetCtx.zoomRatio;
|
|
96818
96809
|
var ps_h = 8 * this.sheetCtx.zoomRatio;
|
|
96819
96810
|
renderCtx.beginPath();
|
|
@@ -96857,9 +96848,50 @@
|
|
|
96857
96848
|
endX: cellsize[2] + cellsize[0]
|
|
96858
96849
|
}, renderCtx);
|
|
96859
96850
|
}
|
|
96851
|
+
}, {
|
|
96852
|
+
key: "renderDelLine",
|
|
96853
|
+
value: function renderDelLine(renderCtx, cell, startX, startY, endX, endY, offsetLeft, offsetTop) {
|
|
96854
|
+
var delLineColor = cell === null || cell === void 0 ? void 0 : cell.delLineColor;
|
|
96855
|
+
if (!delLineColor) {
|
|
96856
|
+
return;
|
|
96857
|
+
}
|
|
96858
|
+
var delLineSpace = (cell === null || cell === void 0 ? void 0 : cell.delLineSpace) || 8;
|
|
96859
|
+
startX += offsetLeft;
|
|
96860
|
+
startY += offsetTop + 1;
|
|
96861
|
+
endX += offsetLeft;
|
|
96862
|
+
endY += offsetTop - 2;
|
|
96863
|
+
renderCtx.strokeStyle = delLineColor;
|
|
96864
|
+
renderCtx.lineWidth = 1;
|
|
96865
|
+
var rectWidth = endX - startX;
|
|
96866
|
+
var rectHeight = endY - startY;
|
|
96867
|
+
var tsPosition = function tsPosition(_ref2) {
|
|
96868
|
+
var _ref3 = _slicedToArray$3(_ref2, 2),
|
|
96869
|
+
x = _ref3[0],
|
|
96870
|
+
y = _ref3[1];
|
|
96871
|
+
if (y > startY + rectHeight) {
|
|
96872
|
+
var dis = y - (startY + rectHeight);
|
|
96873
|
+
y = startY + rectHeight;
|
|
96874
|
+
x += dis;
|
|
96875
|
+
}
|
|
96876
|
+
if (x > startX + rectWidth) {
|
|
96877
|
+
var _dis = x - (startX + rectWidth);
|
|
96878
|
+
x = startX + rectWidth;
|
|
96879
|
+
y += _dis;
|
|
96880
|
+
}
|
|
96881
|
+
return [x, y];
|
|
96882
|
+
};
|
|
96883
|
+
renderCtx.beginPath();
|
|
96884
|
+
for (var space = 0; space < rectWidth + rectHeight; space += delLineSpace) {
|
|
96885
|
+
var startP = tsPosition([startX, startY + space]);
|
|
96886
|
+
var endP = tsPosition([startX + space, startY]);
|
|
96887
|
+
renderCtx.moveTo(startP[0], startP[1]);
|
|
96888
|
+
renderCtx.lineTo(endP[0], endP[1]);
|
|
96889
|
+
}
|
|
96890
|
+
renderCtx.stroke();
|
|
96891
|
+
}
|
|
96860
96892
|
}, {
|
|
96861
96893
|
key: "renderLyFlag",
|
|
96862
|
-
value: function renderLyFlag(renderCtx, cell,
|
|
96894
|
+
value: function renderLyFlag(renderCtx, cell, startX, startY, offsetLeft, offsetTop) {
|
|
96863
96895
|
var lyFlagColor = cell === null || cell === void 0 ? void 0 : cell.lyFlagColor;
|
|
96864
96896
|
if (!lyFlagColor) {
|
|
96865
96897
|
return;
|
|
@@ -96867,9 +96899,9 @@
|
|
|
96867
96899
|
var ps_w = 8 * this.sheetCtx.zoomRatio;
|
|
96868
96900
|
var ps_h = 8 * this.sheetCtx.zoomRatio;
|
|
96869
96901
|
renderCtx.beginPath();
|
|
96870
|
-
renderCtx.moveTo(
|
|
96871
|
-
renderCtx.lineTo(
|
|
96872
|
-
renderCtx.lineTo(
|
|
96902
|
+
renderCtx.moveTo(startX + offsetLeft, startY + offsetTop);
|
|
96903
|
+
renderCtx.lineTo(startX + offsetLeft, startY + offsetTop + ps_h);
|
|
96904
|
+
renderCtx.lineTo(startX + offsetLeft + ps_w, startY + offsetTop);
|
|
96873
96905
|
renderCtx.fillStyle = lyFlagColor;
|
|
96874
96906
|
renderCtx.fill();
|
|
96875
96907
|
renderCtx.closePath();
|
|
@@ -96877,7 +96909,7 @@
|
|
|
96877
96909
|
}, {
|
|
96878
96910
|
key: "cellRender",
|
|
96879
96911
|
value: function cellRender(r, c, startY, startX, endY, endX, value, renderCtx, afCompute, cfCompute, offsetLeft, offsetTop, dynamicArrayCompute, cellOverflowMap, colStart, colEnd, scrollHeight, scrollWidth, bodrder05) {
|
|
96880
|
-
var _this$sheetCtx$hooks$8, _this$sheetCtx$hooks8,
|
|
96912
|
+
var _this$sheetCtx$hooks$8, _this$sheetCtx$hooks8, _this$sheetCtx$hooks$9, _this$sheetCtx$hooks9, _flowdata$r5;
|
|
96881
96913
|
var isMerge = arguments.length > 19 && arguments[19] !== undefined ? arguments[19] : false;
|
|
96882
96914
|
var flowdata = getFlowdata(this.sheetCtx);
|
|
96883
96915
|
if (!flowdata) {
|
|
@@ -96886,7 +96918,7 @@
|
|
|
96886
96918
|
var cell = flowdata[r][c];
|
|
96887
96919
|
var cellWidth = endX - startX - 2;
|
|
96888
96920
|
var cellHeight = endY - startY - 2;
|
|
96889
|
-
var space_width =
|
|
96921
|
+
var space_width = 4;
|
|
96890
96922
|
var space_height = 2;
|
|
96891
96923
|
var horizonAlign = Number(normalizedAttr(flowdata, r, c, "ht"));
|
|
96892
96924
|
var verticalAlign = Number(normalizedAttr(flowdata, r, c, "vt"));
|
|
@@ -96927,7 +96959,8 @@
|
|
|
96927
96959
|
renderCtx.fill();
|
|
96928
96960
|
renderCtx.closePath();
|
|
96929
96961
|
}
|
|
96930
|
-
this.
|
|
96962
|
+
this.renderDelLine(renderCtx, cell, startX, startY, endX, endY, offsetLeft, offsetTop);
|
|
96963
|
+
this.renderLyFlag(renderCtx, cell, startX, startY, offsetLeft, offsetTop);
|
|
96931
96964
|
if (cell === null || cell === void 0 ? void 0 : cell.ps) {
|
|
96932
96965
|
var ps_w = 8 * this.sheetCtx.zoomRatio;
|
|
96933
96966
|
var ps_h = 8 * this.sheetCtx.zoomRatio;
|
|
@@ -96958,53 +96991,6 @@
|
|
|
96958
96991
|
} else {
|
|
96959
96992
|
cellOverflow_bd_r_render = false;
|
|
96960
96993
|
}
|
|
96961
|
-
} else if ((dataVerification === null || dataVerification === void 0 ? void 0 : (_dataVerification = dataVerification["".concat(r, "_").concat(c)]) === null || _dataVerification === void 0 ? void 0 : _dataVerification.type) === "checkbox") {
|
|
96962
|
-
var pos_x = startX + offsetLeft;
|
|
96963
|
-
var pos_y = startY + offsetTop + 1;
|
|
96964
|
-
renderCtx.save();
|
|
96965
|
-
renderCtx.beginPath();
|
|
96966
|
-
renderCtx.rect(pos_x, pos_y, cellWidth, cellHeight);
|
|
96967
|
-
renderCtx.clip();
|
|
96968
|
-
renderCtx.scale(this.sheetCtx.zoomRatio, this.sheetCtx.zoomRatio);
|
|
96969
|
-
var measureText = getMeasureText(value, renderCtx, this.sheetCtx);
|
|
96970
|
-
var textMetrics = measureText.width + 14;
|
|
96971
|
-
var oneLineTextHeight = measureText.actualBoundingBoxDescent + measureText.actualBoundingBoxAscent;
|
|
96972
|
-
var horizonAlignPos = pos_x + space_width;
|
|
96973
|
-
if (horizonAlign === 0) {
|
|
96974
|
-
horizonAlignPos = pos_x + cellWidth / 2 - textMetrics / 2;
|
|
96975
|
-
} else if (horizonAlign === 2) {
|
|
96976
|
-
horizonAlignPos = pos_x + cellWidth - space_width - textMetrics;
|
|
96977
|
-
}
|
|
96978
|
-
var verticalCellHeight = cellHeight > oneLineTextHeight ? cellHeight : oneLineTextHeight;
|
|
96979
|
-
var verticalAlignPos_text = pos_y + verticalCellHeight - space_height;
|
|
96980
|
-
renderCtx.textBaseline = "bottom";
|
|
96981
|
-
var verticalAlignPos_checkbox = verticalAlignPos_text - 13 * this.sheetCtx.zoomRatio;
|
|
96982
|
-
if (verticalAlign === 0) {
|
|
96983
|
-
verticalAlignPos_text = pos_y + verticalCellHeight / 2;
|
|
96984
|
-
renderCtx.textBaseline = "middle";
|
|
96985
|
-
verticalAlignPos_checkbox = verticalAlignPos_text - 6 * this.sheetCtx.zoomRatio;
|
|
96986
|
-
} else if (verticalAlign === 1) {
|
|
96987
|
-
verticalAlignPos_text = pos_y + space_height;
|
|
96988
|
-
renderCtx.textBaseline = "top";
|
|
96989
|
-
verticalAlignPos_checkbox = verticalAlignPos_text + 1 * this.sheetCtx.zoomRatio;
|
|
96990
|
-
}
|
|
96991
|
-
horizonAlignPos /= this.sheetCtx.zoomRatio;
|
|
96992
|
-
verticalAlignPos_text /= this.sheetCtx.zoomRatio;
|
|
96993
|
-
verticalAlignPos_checkbox /= this.sheetCtx.zoomRatio;
|
|
96994
|
-
renderCtx.lineWidth = 1;
|
|
96995
|
-
renderCtx.strokeStyle = "#000";
|
|
96996
|
-
renderCtx.strokeRect(horizonAlignPos, verticalAlignPos_checkbox, 10, 10);
|
|
96997
|
-
if (dataVerification["".concat(r, "_").concat(c)].checked) {
|
|
96998
|
-
renderCtx.beginPath();
|
|
96999
|
-
renderCtx.lineTo(horizonAlignPos + 1, verticalAlignPos_checkbox + 6);
|
|
97000
|
-
renderCtx.lineTo(horizonAlignPos + 4, verticalAlignPos_checkbox + 9);
|
|
97001
|
-
renderCtx.lineTo(horizonAlignPos + 9, verticalAlignPos_checkbox + 2);
|
|
97002
|
-
renderCtx.stroke();
|
|
97003
|
-
renderCtx.closePath();
|
|
97004
|
-
}
|
|
97005
|
-
renderCtx.fillStyle = normalizedAttr(flowdata, r, c, "fc");
|
|
97006
|
-
renderCtx.fillText(lodash.isNil(value) ? "" : value, horizonAlignPos + 14, verticalAlignPos_text);
|
|
97007
|
-
renderCtx.restore();
|
|
97008
96994
|
} else {
|
|
97009
96995
|
var _checksCF$dataBar, _checksCF$dataBar2, _checksCF$dataBar2$va, _cell$ct$fa$indexOf, _cell$ct, _cell$ct$fa, _cell$ct2;
|
|
97010
96996
|
if ((checksCF === null || checksCF === void 0 ? void 0 : (_checksCF$dataBar = checksCF.dataBar) === null || _checksCF$dataBar === void 0 ? void 0 : _checksCF$dataBar.valueLen) && (checksCF === null || checksCF === void 0 ? void 0 : (_checksCF$dataBar2 = checksCF.dataBar) === null || _checksCF$dataBar2 === void 0 ? void 0 : (_checksCF$dataBar2$va = _checksCF$dataBar2.valueLen) === null || _checksCF$dataBar2$va === void 0 ? void 0 : _checksCF$dataBar2$va.toString()) !== "NaN") {
|
|
@@ -97086,11 +97072,11 @@
|
|
|
97086
97072
|
}
|
|
97087
97073
|
}
|
|
97088
97074
|
}
|
|
97089
|
-
var
|
|
97090
|
-
var
|
|
97075
|
+
var pos_x = startX + offsetLeft;
|
|
97076
|
+
var pos_y = startY + offsetTop + 1;
|
|
97091
97077
|
renderCtx.save();
|
|
97092
97078
|
renderCtx.beginPath();
|
|
97093
|
-
renderCtx.rect(
|
|
97079
|
+
renderCtx.rect(pos_x, pos_y, cellWidth, cellHeight);
|
|
97094
97080
|
renderCtx.clip();
|
|
97095
97081
|
renderCtx.scale(this.sheetCtx.zoomRatio, this.sheetCtx.zoomRatio);
|
|
97096
97082
|
var textInfo = cell ? getCellTextInfo(cell, renderCtx, this.sheetCtx, {
|
|
@@ -97105,16 +97091,16 @@
|
|
|
97105
97091
|
var l = checksCF.icons.left;
|
|
97106
97092
|
var t = checksCF.icons.top;
|
|
97107
97093
|
var _value = textInfo.values[0];
|
|
97108
|
-
var verticalAlignPos =
|
|
97094
|
+
var verticalAlignPos = pos_y + _value.top - textInfo.textHeightAll;
|
|
97109
97095
|
if (verticalAlign === 0) {
|
|
97110
|
-
verticalAlignPos =
|
|
97096
|
+
verticalAlignPos = pos_y + cellHeight / 2 - textInfo.textHeightAll / 2;
|
|
97111
97097
|
} else if (verticalAlign === 1) {
|
|
97112
|
-
verticalAlignPos =
|
|
97098
|
+
verticalAlignPos = pos_y;
|
|
97113
97099
|
} else if (verticalAlign === 2) {
|
|
97114
97100
|
verticalAlignPos -= textInfo.desc;
|
|
97115
97101
|
}
|
|
97116
97102
|
verticalAlignPos /= this.sheetCtx.zoomRatio;
|
|
97117
|
-
renderCtx.drawImage(getCfIconsImg(), l * 42, t * 32, 32, 32,
|
|
97103
|
+
renderCtx.drawImage(getCfIconsImg(), l * 42, t * 32, 32, 32, pos_x / this.sheetCtx.zoomRatio, verticalAlignPos, textInfo.textHeightAll / this.sheetCtx.zoomRatio, textInfo.textHeightAll / this.sheetCtx.zoomRatio);
|
|
97118
97104
|
}
|
|
97119
97105
|
renderCtx.fillStyle = normalizedAttr(flowdata, r, c, "fc");
|
|
97120
97106
|
if (checksAF === null || checksAF === void 0 ? void 0 : checksAF[0]) {
|
|
@@ -97128,8 +97114,8 @@
|
|
|
97128
97114
|
renderCtx.fillStyle = "#ff0000";
|
|
97129
97115
|
}
|
|
97130
97116
|
this.cellTextRender(textInfo, renderCtx, {
|
|
97131
|
-
pos_x:
|
|
97132
|
-
pos_y:
|
|
97117
|
+
pos_x: pos_x,
|
|
97118
|
+
pos_y: pos_y
|
|
97133
97119
|
});
|
|
97134
97120
|
renderCtx.restore();
|
|
97135
97121
|
}
|
|
@@ -97153,7 +97139,7 @@
|
|
|
97153
97139
|
renderCtx.stroke();
|
|
97154
97140
|
renderCtx.closePath();
|
|
97155
97141
|
}
|
|
97156
|
-
(_this$sheetCtx$hooks$9 = (_this$sheetCtx$hooks9 = this.sheetCtx.hooks).afterRenderCell) === null || _this$sheetCtx$hooks$9 === void 0 ? void 0 : _this$sheetCtx$hooks$9.call(_this$sheetCtx$hooks9, (_flowdata$
|
|
97142
|
+
(_this$sheetCtx$hooks$9 = (_this$sheetCtx$hooks9 = this.sheetCtx.hooks).afterRenderCell) === null || _this$sheetCtx$hooks$9 === void 0 ? void 0 : _this$sheetCtx$hooks$9.call(_this$sheetCtx$hooks9, (_flowdata$r5 = flowdata[r]) === null || _flowdata$r5 === void 0 ? void 0 : _flowdata$r5[c], {
|
|
97157
97143
|
row: r,
|
|
97158
97144
|
column: c,
|
|
97159
97145
|
startX: cellsize[0],
|
|
@@ -97393,9 +97379,9 @@
|
|
|
97393
97379
|
}
|
|
97394
97380
|
}, {
|
|
97395
97381
|
key: "drawFreezeLine",
|
|
97396
|
-
value: function drawFreezeLine(
|
|
97397
|
-
var horizontalTop =
|
|
97398
|
-
verticalLeft =
|
|
97382
|
+
value: function drawFreezeLine(_ref4) {
|
|
97383
|
+
var horizontalTop = _ref4.horizontalTop,
|
|
97384
|
+
verticalLeft = _ref4.verticalLeft;
|
|
97399
97385
|
}
|
|
97400
97386
|
}]);
|
|
97401
97387
|
}();
|
|
@@ -100936,8 +100922,60 @@
|
|
|
100936
100922
|
});
|
|
100937
100923
|
}
|
|
100938
100924
|
}
|
|
100925
|
+
function handleCellAreaMouseMove(ctx, globalCache, e, container) {
|
|
100926
|
+
var _globalCache$freezen2, _flowdata$row_index3;
|
|
100927
|
+
var afterCellMouseMove = ctx.hooks.afterCellMouseMove;
|
|
100928
|
+
if (!afterCellMouseMove) {
|
|
100929
|
+
return;
|
|
100930
|
+
}
|
|
100931
|
+
ctx.contextMenu = {};
|
|
100932
|
+
ctx.filterContextMenu = undefined;
|
|
100933
|
+
var flowdata = getFlowdata(ctx);
|
|
100934
|
+
if (!flowdata) return;
|
|
100935
|
+
var rect = container.getBoundingClientRect();
|
|
100936
|
+
var mouseX = e.pageX - rect.left - window.scrollX;
|
|
100937
|
+
var mouseY = e.pageY - rect.top - window.scrollY;
|
|
100938
|
+
var _x = mouseX + ctx.scrollLeft;
|
|
100939
|
+
var _y = mouseY + ctx.scrollTop;
|
|
100940
|
+
if (_x >= rect.width + ctx.scrollLeft || _y >= rect.height + ctx.scrollTop) {
|
|
100941
|
+
return;
|
|
100942
|
+
}
|
|
100943
|
+
var freeze = (_globalCache$freezen2 = globalCache.freezen) === null || _globalCache$freezen2 === void 0 ? void 0 : _globalCache$freezen2[ctx.currentSheetId];
|
|
100944
|
+
var _fixPositionOnFrozenC2 = fixPositionOnFrozenCells(freeze, _x, _y, mouseX, mouseY),
|
|
100945
|
+
x = _fixPositionOnFrozenC2.x,
|
|
100946
|
+
y = _fixPositionOnFrozenC2.y;
|
|
100947
|
+
var row_location = rowLocation(y, ctx.visibledatarow);
|
|
100948
|
+
var row_pre = row_location[0];
|
|
100949
|
+
var row_index = row_location[2];
|
|
100950
|
+
var col_location = colLocation(x, ctx.visibledatacolumn);
|
|
100951
|
+
var col_pre = col_location[0];
|
|
100952
|
+
var col_index = col_location[2];
|
|
100953
|
+
var currentCellValue = JSON.parse(JSON.stringify((_flowdata$row_index3 = flowdata[row_index]) === null || _flowdata$row_index3 === void 0 ? void 0 : _flowdata$row_index3[col_index]));
|
|
100954
|
+
var box = document.querySelector(".leankylin-cell-area");
|
|
100955
|
+
if (box) {
|
|
100956
|
+
var _currentCellValue$cu;
|
|
100957
|
+
box.style.cursor = (_currentCellValue$cu = currentCellValue === null || currentCellValue === void 0 ? void 0 : currentCellValue.cu) !== null && _currentCellValue$cu !== void 0 ? _currentCellValue$cu : "default";
|
|
100958
|
+
}
|
|
100959
|
+
var yOut = y < 0 || y > ctx.visibledatarow[ctx.visibledatarow.length - 1];
|
|
100960
|
+
var xOut = x < 0 || x > ctx.visibledatacolumn[ctx.visibledatacolumn.length - 1];
|
|
100961
|
+
if (yOut || xOut) {
|
|
100962
|
+
afterCellMouseMove(null, {
|
|
100963
|
+
rowIndex: -1,
|
|
100964
|
+
colIndex: -1,
|
|
100965
|
+
startRow: 0,
|
|
100966
|
+
startColumn: 0
|
|
100967
|
+
});
|
|
100968
|
+
return;
|
|
100969
|
+
}
|
|
100970
|
+
afterCellMouseMove(currentCellValue, {
|
|
100971
|
+
rowIndex: row_index,
|
|
100972
|
+
startRow: row_pre,
|
|
100973
|
+
startColumn: col_pre,
|
|
100974
|
+
colIndex: col_index
|
|
100975
|
+
});
|
|
100976
|
+
}
|
|
100939
100977
|
function handleCellAreaDoubleClick(ctx, globalCache, settings, e, container) {
|
|
100940
|
-
var _globalCache$
|
|
100978
|
+
var _globalCache$freezen3;
|
|
100941
100979
|
var flowdata = getFlowdata(ctx);
|
|
100942
100980
|
if (!flowdata) return;
|
|
100943
100981
|
if (ctx.luckysheetCellUpdate.length > 0 && ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) {
|
|
@@ -100950,10 +100988,10 @@
|
|
|
100950
100988
|
var mouseY = e.pageY - rect.top;
|
|
100951
100989
|
var _x = mouseX + ctx.scrollLeft;
|
|
100952
100990
|
var _y = mouseY + ctx.scrollTop;
|
|
100953
|
-
var freeze = (_globalCache$
|
|
100954
|
-
var
|
|
100955
|
-
x =
|
|
100956
|
-
y =
|
|
100991
|
+
var freeze = (_globalCache$freezen3 = globalCache.freezen) === null || _globalCache$freezen3 === void 0 ? void 0 : _globalCache$freezen3[ctx.currentSheetId];
|
|
100992
|
+
var _fixPositionOnFrozenC3 = fixPositionOnFrozenCells(freeze, _x, _y, mouseX, mouseY),
|
|
100993
|
+
x = _fixPositionOnFrozenC3.x,
|
|
100994
|
+
y = _fixPositionOnFrozenC3.y;
|
|
100957
100995
|
var row_location = rowLocation(y, ctx.visibledatarow);
|
|
100958
100996
|
var row_index = row_location[2];
|
|
100959
100997
|
var col_location = colLocation(x, ctx.visibledatacolumn);
|
|
@@ -101008,9 +101046,9 @@
|
|
|
101008
101046
|
var mouseY = e.pageY - rect.top - window.scrollY;
|
|
101009
101047
|
var _selected_x = mouseX + ctx.scrollLeft;
|
|
101010
101048
|
var _selected_y = mouseY + ctx.scrollTop;
|
|
101011
|
-
var
|
|
101012
|
-
selected_x =
|
|
101013
|
-
selected_y =
|
|
101049
|
+
var _fixPositionOnFrozenC4 = fixPositionOnFrozenCells((_ctx$getRefs$globalCa = ctx.getRefs().globalCache.freezen) === null || _ctx$getRefs$globalCa === void 0 ? void 0 : _ctx$getRefs$globalCa[ctx.currentSheetId], _selected_x, _selected_y, mouseX, mouseY),
|
|
101050
|
+
selected_x = _fixPositionOnFrozenC4.x,
|
|
101051
|
+
selected_y = _fixPositionOnFrozenC4.y;
|
|
101014
101052
|
var row_location = rowLocation(selected_y, ctx.visibledatarow);
|
|
101015
101053
|
var row = row_location[1];
|
|
101016
101054
|
var row_pre = row_location[0];
|
|
@@ -101124,14 +101162,15 @@
|
|
|
101124
101162
|
var _rect = container.getBoundingClientRect();
|
|
101125
101163
|
var _mouseY = e.pageY - _rect.top - window.scrollY;
|
|
101126
101164
|
var _selected_y2 = _mouseY + ctx.scrollTop;
|
|
101127
|
-
var
|
|
101128
|
-
_selected_y3 =
|
|
101165
|
+
var _fixPositionOnFrozenC5 = fixPositionOnFrozenCells((_ctx$getRefs$globalCa2 = ctx.getRefs().globalCache.freezen) === null || _ctx$getRefs$globalCa2 === void 0 ? void 0 : _ctx$getRefs$globalCa2[ctx.currentSheetId], 0, _selected_y2, 0, _mouseY),
|
|
101166
|
+
_selected_y3 = _fixPositionOnFrozenC5.y;
|
|
101129
101167
|
var _row_location = rowLocation(_selected_y3, ctx.visibledatarow);
|
|
101130
101168
|
var _row = _row_location[1];
|
|
101131
101169
|
var _row_pre = _row_location[0];
|
|
101132
101170
|
var _row_index = _row_location[2];
|
|
101133
101171
|
var _isInSelection = lodash.some(ctx.luckysheet_select_save, function (obj_s) {
|
|
101134
|
-
|
|
101172
|
+
var _flowdata$0$length, _flowdata$;
|
|
101173
|
+
return obj_s.row != null && _row_index >= obj_s.row[0] && _row_index <= obj_s.row[1] && obj_s.column[0] === 0 && obj_s.column[1] === ((_flowdata$0$length = flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$ = flowdata[0]) === null || _flowdata$ === void 0 ? void 0 : _flowdata$.length) !== null && _flowdata$0$length !== void 0 ? _flowdata$0$length : 0) - 1;
|
|
101135
101174
|
});
|
|
101136
101175
|
if (_isInSelection) return;
|
|
101137
101176
|
var _col_index = ctx.visibledatacolumn.length - 1;
|
|
@@ -101162,8 +101201,8 @@
|
|
|
101162
101201
|
var _rect2 = container.getBoundingClientRect();
|
|
101163
101202
|
var _mouseX = e.pageX - _rect2.left - window.scrollX;
|
|
101164
101203
|
var _selected_x2 = _mouseX + ctx.scrollLeft;
|
|
101165
|
-
var
|
|
101166
|
-
_selected_x3 =
|
|
101204
|
+
var _fixPositionOnFrozenC6 = fixPositionOnFrozenCells((_ctx$getRefs$globalCa3 = ctx.getRefs().globalCache.freezen) === null || _ctx$getRefs$globalCa3 === void 0 ? void 0 : _ctx$getRefs$globalCa3[ctx.currentSheetId], _selected_x2, 0, _mouseX, 0),
|
|
101205
|
+
_selected_x3 = _fixPositionOnFrozenC6.x;
|
|
101167
101206
|
var _row_index2 = ctx.visibledatarow.length - 1;
|
|
101168
101207
|
var _row2 = ctx.visibledatarow[_row_index2];
|
|
101169
101208
|
var _row_pre2 = 0;
|
|
@@ -101172,7 +101211,8 @@
|
|
|
101172
101211
|
var _col_pre2 = _col_location[0];
|
|
101173
101212
|
var _col_index2 = _col_location[2];
|
|
101174
101213
|
var _isInSelection2 = lodash.some(ctx.luckysheet_select_save, function (obj_s) {
|
|
101175
|
-
|
|
101214
|
+
var _flowdata$length;
|
|
101215
|
+
return obj_s.column != null && _col_index2 >= obj_s.column[0] && _col_index2 <= obj_s.column[1] && obj_s.row[0] === 0 && obj_s.row[1] === ((_flowdata$length = flowdata === null || flowdata === void 0 ? void 0 : flowdata.length) !== null && _flowdata$length !== void 0 ? _flowdata$length : 0) - 1;
|
|
101176
101216
|
});
|
|
101177
101217
|
if (_isInSelection2) return;
|
|
101178
101218
|
var _left4 = _col_pre2;
|
|
@@ -101229,15 +101269,15 @@
|
|
|
101229
101269
|
return;
|
|
101230
101270
|
}
|
|
101231
101271
|
if (ctx.luckysheet_select_status) {
|
|
101232
|
-
var _globalCache$
|
|
101272
|
+
var _globalCache$freezen4, _ctx$luckysheet_selec6, _globalCache$freezen5;
|
|
101233
101273
|
var mouseX = e.pageX - rect.left - window.scrollX;
|
|
101234
101274
|
var mouseY = e.pageY - rect.top - window.scrollY;
|
|
101235
101275
|
var _x = mouseX - ctx.rowHeaderWidth + ctx.scrollLeft;
|
|
101236
101276
|
var _y = mouseY - ctx.columnHeaderHeight + ctx.scrollTop;
|
|
101237
|
-
var freeze = (_globalCache$
|
|
101238
|
-
var
|
|
101239
|
-
_x2 =
|
|
101240
|
-
_y2 =
|
|
101277
|
+
var freeze = (_globalCache$freezen4 = globalCache.freezen) === null || _globalCache$freezen4 === void 0 ? void 0 : _globalCache$freezen4[ctx.currentSheetId];
|
|
101278
|
+
var _fixPositionOnFrozenC7 = fixPositionOnFrozenCells(freeze, _x, _y, mouseX - ctx.rowHeaderWidth, mouseY - ctx.columnHeaderHeight),
|
|
101279
|
+
_x2 = _fixPositionOnFrozenC7.x,
|
|
101280
|
+
_y2 = _fixPositionOnFrozenC7.y;
|
|
101241
101281
|
var row_location = rowLocation(_y2, ctx.visibledatarow);
|
|
101242
101282
|
var row = row_location[1];
|
|
101243
101283
|
var row_pre = row_location[0];
|
|
@@ -101327,7 +101367,7 @@
|
|
|
101327
101367
|
last.height_move = ctx.visibledatarow[rowMax] - 1;
|
|
101328
101368
|
}
|
|
101329
101369
|
ctx.luckysheet_select_save[ctx.luckysheet_select_save.length - 1] = last;
|
|
101330
|
-
scrollToFrozenRowCol(ctx, (_globalCache$
|
|
101370
|
+
scrollToFrozenRowCol(ctx, (_globalCache$freezen5 = globalCache.freezen) === null || _globalCache$freezen5 === void 0 ? void 0 : _globalCache$freezen5[ctx.currentSheetId]);
|
|
101331
101371
|
} else if (ctx.formulaCache.rangestart) {
|
|
101332
101372
|
rangeDrag(ctx, e, cellInput, scrollX.scrollLeft, scrollY.scrollTop, container, fxInput);
|
|
101333
101373
|
} else if (ctx.formulaCache.rangedrag_row_start) {
|
|
@@ -101671,7 +101711,7 @@
|
|
|
101671
101711
|
}
|
|
101672
101712
|
}
|
|
101673
101713
|
function handleRowHeaderMouseDown(ctx, globalCache, e, container, cellInput, fxInput) {
|
|
101674
|
-
var _globalCache$
|
|
101714
|
+
var _globalCache$freezen6;
|
|
101675
101715
|
if (!checkProtectionAllSelected(ctx, ctx.currentSheetId)) {
|
|
101676
101716
|
return;
|
|
101677
101717
|
}
|
|
@@ -101680,9 +101720,9 @@
|
|
|
101680
101720
|
var rect = container.getBoundingClientRect();
|
|
101681
101721
|
var mouseY = e.pageY - rect.top - window.scrollY;
|
|
101682
101722
|
var _y = mouseY + ctx.scrollTop;
|
|
101683
|
-
var freeze = (_globalCache$
|
|
101684
|
-
var
|
|
101685
|
-
y =
|
|
101723
|
+
var freeze = (_globalCache$freezen6 = globalCache.freezen) === null || _globalCache$freezen6 === void 0 ? void 0 : _globalCache$freezen6[ctx.currentSheetId];
|
|
101724
|
+
var _fixPositionOnFrozenC8 = fixPositionOnFrozenCells(freeze, 0, _y, 0, mouseY),
|
|
101725
|
+
y = _fixPositionOnFrozenC8.y;
|
|
101686
101726
|
var row_location = rowLocation(y, ctx.visibledatarow);
|
|
101687
101727
|
var row = row_location[1];
|
|
101688
101728
|
var row_pre = row_location[0];
|
|
@@ -101693,8 +101733,8 @@
|
|
|
101693
101733
|
if (e.button === 2) {
|
|
101694
101734
|
var flowdata = getFlowdata(ctx);
|
|
101695
101735
|
var isInSelection = lodash.some(ctx.luckysheet_select_save, function (obj_s) {
|
|
101696
|
-
var _flowdata$0$
|
|
101697
|
-
return obj_s.row != null && row_index >= obj_s.row[0] && row_index <= obj_s.row[1] && obj_s.column[0] === 0 && obj_s.column[1] === ((_flowdata$0$
|
|
101736
|
+
var _flowdata$0$length2, _flowdata$2;
|
|
101737
|
+
return obj_s.row != null && row_index >= obj_s.row[0] && row_index <= obj_s.row[1] && obj_s.column[0] === 0 && obj_s.column[1] === ((_flowdata$0$length2 = flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$2 = flowdata[0]) === null || _flowdata$2 === void 0 ? void 0 : _flowdata$2.length) !== null && _flowdata$0$length2 !== void 0 ? _flowdata$0$length2 : 0) - 1;
|
|
101698
101738
|
});
|
|
101699
101739
|
if (isInSelection) return;
|
|
101700
101740
|
}
|
|
@@ -101908,7 +101948,7 @@
|
|
|
101908
101948
|
}
|
|
101909
101949
|
}
|
|
101910
101950
|
function handleColumnHeaderMouseDown(ctx, globalCache, e, container, cellInput, fxInput) {
|
|
101911
|
-
var _globalCache$
|
|
101951
|
+
var _globalCache$freezen7;
|
|
101912
101952
|
if (!checkProtectionAllSelected(ctx, ctx.currentSheetId)) {
|
|
101913
101953
|
return;
|
|
101914
101954
|
}
|
|
@@ -101917,9 +101957,9 @@
|
|
|
101917
101957
|
var rect = container.getBoundingClientRect();
|
|
101918
101958
|
var mouseX = e.pageX - rect.left - window.scrollX;
|
|
101919
101959
|
var _x = mouseX + ctx.scrollLeft;
|
|
101920
|
-
var freeze = (_globalCache$
|
|
101921
|
-
var
|
|
101922
|
-
x =
|
|
101960
|
+
var freeze = (_globalCache$freezen7 = globalCache.freezen) === null || _globalCache$freezen7 === void 0 ? void 0 : _globalCache$freezen7[ctx.currentSheetId];
|
|
101961
|
+
var _fixPositionOnFrozenC9 = fixPositionOnFrozenCells(freeze, _x, 0, mouseX, 0),
|
|
101962
|
+
x = _fixPositionOnFrozenC9.x;
|
|
101923
101963
|
var row_index = ctx.visibledatarow.length - 1;
|
|
101924
101964
|
var row = ctx.visibledatarow[row_index];
|
|
101925
101965
|
var row_pre = 0;
|
|
@@ -101931,8 +101971,8 @@
|
|
|
101931
101971
|
if (e.button === 2) {
|
|
101932
101972
|
var flowdata = getFlowdata(ctx);
|
|
101933
101973
|
var isInSelection = lodash.some(ctx.luckysheet_select_save, function (obj_s) {
|
|
101934
|
-
var _flowdata$
|
|
101935
|
-
return obj_s.column != null && col_index >= obj_s.column[0] && col_index <= obj_s.column[1] && obj_s.row[0] === 0 && obj_s.row[1] === ((_flowdata$
|
|
101974
|
+
var _flowdata$length2;
|
|
101975
|
+
return obj_s.column != null && col_index >= obj_s.column[0] && col_index <= obj_s.column[1] && obj_s.row[0] === 0 && obj_s.row[1] === ((_flowdata$length2 = flowdata === null || flowdata === void 0 ? void 0 : flowdata.length) !== null && _flowdata$length2 !== void 0 ? _flowdata$length2 : 0) - 1;
|
|
101936
101976
|
});
|
|
101937
101977
|
if (isInSelection) return;
|
|
101938
101978
|
}
|
|
@@ -102148,7 +102188,7 @@
|
|
|
102148
102188
|
}
|
|
102149
102189
|
}
|
|
102150
102190
|
function handleColSizeHandleMouseDown(ctx, globalCache, e, headerContainer, workbookContainer, cellArea) {
|
|
102151
|
-
var _globalCache$
|
|
102191
|
+
var _globalCache$freezen8;
|
|
102152
102192
|
removeEditingComment(ctx, globalCache);
|
|
102153
102193
|
cancelActiveImgItem(ctx, globalCache);
|
|
102154
102194
|
ctx.luckysheetCellUpdate = [];
|
|
@@ -102156,9 +102196,9 @@
|
|
|
102156
102196
|
var scrollTop = ctx.scrollTop;
|
|
102157
102197
|
var mouseX = e.pageX - headerContainer.getBoundingClientRect().left - window.scrollX;
|
|
102158
102198
|
var _x = mouseX + scrollLeft;
|
|
102159
|
-
var freeze = (_globalCache$
|
|
102160
|
-
var
|
|
102161
|
-
x =
|
|
102199
|
+
var freeze = (_globalCache$freezen8 = globalCache.freezen) === null || _globalCache$freezen8 === void 0 ? void 0 : _globalCache$freezen8[ctx.currentSheetId];
|
|
102200
|
+
var _fixPositionOnFrozenC10 = fixPositionOnFrozenCells(freeze, _x, 0, mouseX, 0),
|
|
102201
|
+
x = _fixPositionOnFrozenC10.x;
|
|
102162
102202
|
var col_location = colLocation(x, ctx.visibledatacolumn);
|
|
102163
102203
|
var col = col_location[1];
|
|
102164
102204
|
var col_index = col_location[2];
|
|
@@ -102177,7 +102217,7 @@
|
|
|
102177
102217
|
e.stopPropagation();
|
|
102178
102218
|
}
|
|
102179
102219
|
function handleRowSizeHandleMouseDown(ctx, globalCache, e, headerContainer, workbookContainer, cellArea) {
|
|
102180
|
-
var _globalCache$
|
|
102220
|
+
var _globalCache$freezen9;
|
|
102181
102221
|
removeEditingComment(ctx, globalCache);
|
|
102182
102222
|
cancelActiveImgItem(ctx, globalCache);
|
|
102183
102223
|
if (ctx.formulaCache.rangestart || ctx.formulaCache.rangedrag_column_start || ctx.formulaCache.rangedrag_row_start || israngeseleciton(ctx)) return;
|
|
@@ -102186,9 +102226,9 @@
|
|
|
102186
102226
|
var scrollTop = ctx.scrollTop;
|
|
102187
102227
|
var mouseY = e.pageY - headerContainer.getBoundingClientRect().top - window.scrollY;
|
|
102188
102228
|
var _y = mouseY + scrollTop;
|
|
102189
|
-
var freeze = (_globalCache$
|
|
102190
|
-
var
|
|
102191
|
-
y =
|
|
102229
|
+
var freeze = (_globalCache$freezen9 = globalCache.freezen) === null || _globalCache$freezen9 === void 0 ? void 0 : _globalCache$freezen9[ctx.currentSheetId];
|
|
102230
|
+
var _fixPositionOnFrozenC11 = fixPositionOnFrozenCells(freeze, 0, _y, 0, mouseY),
|
|
102231
|
+
y = _fixPositionOnFrozenC11.y;
|
|
102192
102232
|
var row_location = rowLocation(y, ctx.visibledatarow);
|
|
102193
102233
|
var row = row_location[1];
|
|
102194
102234
|
var row_index = row_location[2];
|
|
@@ -102387,6 +102427,706 @@
|
|
|
102387
102427
|
}
|
|
102388
102428
|
});
|
|
102389
102429
|
|
|
102430
|
+
/******************************************************************************
|
|
102431
|
+
Copyright (c) Microsoft Corporation.
|
|
102432
|
+
|
|
102433
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
102434
|
+
purpose with or without fee is hereby granted.
|
|
102435
|
+
|
|
102436
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
102437
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
102438
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
102439
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
102440
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
102441
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
102442
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
102443
|
+
***************************************************************************** */
|
|
102444
|
+
|
|
102445
|
+
function __read(o, n) {
|
|
102446
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
102447
|
+
if (!m) return o;
|
|
102448
|
+
var i = m.call(o), r, ar = [], e;
|
|
102449
|
+
try {
|
|
102450
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
102451
|
+
}
|
|
102452
|
+
catch (error) { e = { error: error }; }
|
|
102453
|
+
finally {
|
|
102454
|
+
try {
|
|
102455
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
102456
|
+
}
|
|
102457
|
+
finally { if (e) throw e.error; }
|
|
102458
|
+
}
|
|
102459
|
+
return ar;
|
|
102460
|
+
}
|
|
102461
|
+
|
|
102462
|
+
function __spreadArray(to, from, pack) {
|
|
102463
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
102464
|
+
if (ar || !(i in from)) {
|
|
102465
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
102466
|
+
ar[i] = from[i];
|
|
102467
|
+
}
|
|
102468
|
+
}
|
|
102469
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
102470
|
+
}
|
|
102471
|
+
|
|
102472
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
102473
|
+
var e = new Error(message);
|
|
102474
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
102475
|
+
};
|
|
102476
|
+
|
|
102477
|
+
var isFunction = function (value) {
|
|
102478
|
+
return typeof value === 'function';
|
|
102479
|
+
};
|
|
102480
|
+
|
|
102481
|
+
function useMemoizedFn(fn) {
|
|
102482
|
+
{
|
|
102483
|
+
if (!isFunction(fn)) {
|
|
102484
|
+
console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof fn));
|
|
102485
|
+
}
|
|
102486
|
+
}
|
|
102487
|
+
var fnRef = React.useRef(fn);
|
|
102488
|
+
// why not write `fnRef.current = fn`?
|
|
102489
|
+
// https://github.com/alibaba/hooks/issues/728
|
|
102490
|
+
fnRef.current = React.useMemo(function () {
|
|
102491
|
+
return fn;
|
|
102492
|
+
}, [fn]);
|
|
102493
|
+
var memoizedFn = React.useRef();
|
|
102494
|
+
if (!memoizedFn.current) {
|
|
102495
|
+
memoizedFn.current = function () {
|
|
102496
|
+
var args = [];
|
|
102497
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
102498
|
+
args[_i] = arguments[_i];
|
|
102499
|
+
}
|
|
102500
|
+
return fnRef.current.apply(this, args);
|
|
102501
|
+
};
|
|
102502
|
+
}
|
|
102503
|
+
return memoizedFn.current;
|
|
102504
|
+
}
|
|
102505
|
+
|
|
102506
|
+
function useLatest(value) {
|
|
102507
|
+
var ref = React.useRef(value);
|
|
102508
|
+
ref.current = value;
|
|
102509
|
+
return ref;
|
|
102510
|
+
}
|
|
102511
|
+
|
|
102512
|
+
var useUnmount = function (fn) {
|
|
102513
|
+
{
|
|
102514
|
+
if (!isFunction(fn)) {
|
|
102515
|
+
console.error("useUnmount expected parameter is a function, got ".concat(typeof fn));
|
|
102516
|
+
}
|
|
102517
|
+
}
|
|
102518
|
+
var fnRef = useLatest(fn);
|
|
102519
|
+
React.useEffect(function () {
|
|
102520
|
+
return function () {
|
|
102521
|
+
fnRef.current();
|
|
102522
|
+
};
|
|
102523
|
+
}, []);
|
|
102524
|
+
};
|
|
102525
|
+
|
|
102526
|
+
/**
|
|
102527
|
+
* Checks if `value` is the
|
|
102528
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
102529
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
102530
|
+
*
|
|
102531
|
+
* @static
|
|
102532
|
+
* @memberOf _
|
|
102533
|
+
* @since 0.1.0
|
|
102534
|
+
* @category Lang
|
|
102535
|
+
* @param {*} value The value to check.
|
|
102536
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
102537
|
+
* @example
|
|
102538
|
+
*
|
|
102539
|
+
* _.isObject({});
|
|
102540
|
+
* // => true
|
|
102541
|
+
*
|
|
102542
|
+
* _.isObject([1, 2, 3]);
|
|
102543
|
+
* // => true
|
|
102544
|
+
*
|
|
102545
|
+
* _.isObject(_.noop);
|
|
102546
|
+
* // => true
|
|
102547
|
+
*
|
|
102548
|
+
* _.isObject(null);
|
|
102549
|
+
* // => false
|
|
102550
|
+
*/
|
|
102551
|
+
function isObject(value) {
|
|
102552
|
+
var type = typeof value;
|
|
102553
|
+
return value != null && (type == 'object' || type == 'function');
|
|
102554
|
+
}
|
|
102555
|
+
|
|
102556
|
+
var isObject_1 = isObject;
|
|
102557
|
+
|
|
102558
|
+
/** Detect free variable `global` from Node.js. */
|
|
102559
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
102560
|
+
|
|
102561
|
+
var _freeGlobal = freeGlobal;
|
|
102562
|
+
|
|
102563
|
+
/** Detect free variable `self`. */
|
|
102564
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
102565
|
+
|
|
102566
|
+
/** Used as a reference to the global object. */
|
|
102567
|
+
var root = _freeGlobal || freeSelf || Function('return this')();
|
|
102568
|
+
|
|
102569
|
+
var _root = root;
|
|
102570
|
+
|
|
102571
|
+
/**
|
|
102572
|
+
* Gets the timestamp of the number of milliseconds that have elapsed since
|
|
102573
|
+
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
|
102574
|
+
*
|
|
102575
|
+
* @static
|
|
102576
|
+
* @memberOf _
|
|
102577
|
+
* @since 2.4.0
|
|
102578
|
+
* @category Date
|
|
102579
|
+
* @returns {number} Returns the timestamp.
|
|
102580
|
+
* @example
|
|
102581
|
+
*
|
|
102582
|
+
* _.defer(function(stamp) {
|
|
102583
|
+
* console.log(_.now() - stamp);
|
|
102584
|
+
* }, _.now());
|
|
102585
|
+
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
102586
|
+
*/
|
|
102587
|
+
var now = function() {
|
|
102588
|
+
return _root.Date.now();
|
|
102589
|
+
};
|
|
102590
|
+
|
|
102591
|
+
var now_1 = now;
|
|
102592
|
+
|
|
102593
|
+
/** Used to match a single whitespace character. */
|
|
102594
|
+
var reWhitespace = /\s/;
|
|
102595
|
+
|
|
102596
|
+
/**
|
|
102597
|
+
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
|
|
102598
|
+
* character of `string`.
|
|
102599
|
+
*
|
|
102600
|
+
* @private
|
|
102601
|
+
* @param {string} string The string to inspect.
|
|
102602
|
+
* @returns {number} Returns the index of the last non-whitespace character.
|
|
102603
|
+
*/
|
|
102604
|
+
function trimmedEndIndex(string) {
|
|
102605
|
+
var index = string.length;
|
|
102606
|
+
|
|
102607
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {}
|
|
102608
|
+
return index;
|
|
102609
|
+
}
|
|
102610
|
+
|
|
102611
|
+
var _trimmedEndIndex = trimmedEndIndex;
|
|
102612
|
+
|
|
102613
|
+
/** Used to match leading whitespace. */
|
|
102614
|
+
var reTrimStart = /^\s+/;
|
|
102615
|
+
|
|
102616
|
+
/**
|
|
102617
|
+
* The base implementation of `_.trim`.
|
|
102618
|
+
*
|
|
102619
|
+
* @private
|
|
102620
|
+
* @param {string} string The string to trim.
|
|
102621
|
+
* @returns {string} Returns the trimmed string.
|
|
102622
|
+
*/
|
|
102623
|
+
function baseTrim(string) {
|
|
102624
|
+
return string
|
|
102625
|
+
? string.slice(0, _trimmedEndIndex(string) + 1).replace(reTrimStart, '')
|
|
102626
|
+
: string;
|
|
102627
|
+
}
|
|
102628
|
+
|
|
102629
|
+
var _baseTrim = baseTrim;
|
|
102630
|
+
|
|
102631
|
+
/** Built-in value references. */
|
|
102632
|
+
var Symbol$1 = _root.Symbol;
|
|
102633
|
+
|
|
102634
|
+
var _Symbol = Symbol$1;
|
|
102635
|
+
|
|
102636
|
+
/** Used for built-in method references. */
|
|
102637
|
+
var objectProto = Object.prototype;
|
|
102638
|
+
|
|
102639
|
+
/** Used to check objects for own properties. */
|
|
102640
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
102641
|
+
|
|
102642
|
+
/**
|
|
102643
|
+
* Used to resolve the
|
|
102644
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
102645
|
+
* of values.
|
|
102646
|
+
*/
|
|
102647
|
+
var nativeObjectToString = objectProto.toString;
|
|
102648
|
+
|
|
102649
|
+
/** Built-in value references. */
|
|
102650
|
+
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
|
102651
|
+
|
|
102652
|
+
/**
|
|
102653
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
102654
|
+
*
|
|
102655
|
+
* @private
|
|
102656
|
+
* @param {*} value The value to query.
|
|
102657
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
102658
|
+
*/
|
|
102659
|
+
function getRawTag(value) {
|
|
102660
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag),
|
|
102661
|
+
tag = value[symToStringTag];
|
|
102662
|
+
|
|
102663
|
+
try {
|
|
102664
|
+
value[symToStringTag] = undefined;
|
|
102665
|
+
var unmasked = true;
|
|
102666
|
+
} catch (e) {}
|
|
102667
|
+
|
|
102668
|
+
var result = nativeObjectToString.call(value);
|
|
102669
|
+
if (unmasked) {
|
|
102670
|
+
if (isOwn) {
|
|
102671
|
+
value[symToStringTag] = tag;
|
|
102672
|
+
} else {
|
|
102673
|
+
delete value[symToStringTag];
|
|
102674
|
+
}
|
|
102675
|
+
}
|
|
102676
|
+
return result;
|
|
102677
|
+
}
|
|
102678
|
+
|
|
102679
|
+
var _getRawTag = getRawTag;
|
|
102680
|
+
|
|
102681
|
+
/** Used for built-in method references. */
|
|
102682
|
+
var objectProto$1 = Object.prototype;
|
|
102683
|
+
|
|
102684
|
+
/**
|
|
102685
|
+
* Used to resolve the
|
|
102686
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
102687
|
+
* of values.
|
|
102688
|
+
*/
|
|
102689
|
+
var nativeObjectToString$1 = objectProto$1.toString;
|
|
102690
|
+
|
|
102691
|
+
/**
|
|
102692
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
102693
|
+
*
|
|
102694
|
+
* @private
|
|
102695
|
+
* @param {*} value The value to convert.
|
|
102696
|
+
* @returns {string} Returns the converted string.
|
|
102697
|
+
*/
|
|
102698
|
+
function objectToString(value) {
|
|
102699
|
+
return nativeObjectToString$1.call(value);
|
|
102700
|
+
}
|
|
102701
|
+
|
|
102702
|
+
var _objectToString = objectToString;
|
|
102703
|
+
|
|
102704
|
+
/** `Object#toString` result references. */
|
|
102705
|
+
var nullTag = '[object Null]',
|
|
102706
|
+
undefinedTag = '[object Undefined]';
|
|
102707
|
+
|
|
102708
|
+
/** Built-in value references. */
|
|
102709
|
+
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
102710
|
+
|
|
102711
|
+
/**
|
|
102712
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
102713
|
+
*
|
|
102714
|
+
* @private
|
|
102715
|
+
* @param {*} value The value to query.
|
|
102716
|
+
* @returns {string} Returns the `toStringTag`.
|
|
102717
|
+
*/
|
|
102718
|
+
function baseGetTag(value) {
|
|
102719
|
+
if (value == null) {
|
|
102720
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
102721
|
+
}
|
|
102722
|
+
return (symToStringTag$1 && symToStringTag$1 in Object(value))
|
|
102723
|
+
? _getRawTag(value)
|
|
102724
|
+
: _objectToString(value);
|
|
102725
|
+
}
|
|
102726
|
+
|
|
102727
|
+
var _baseGetTag = baseGetTag;
|
|
102728
|
+
|
|
102729
|
+
/**
|
|
102730
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
102731
|
+
* and has a `typeof` result of "object".
|
|
102732
|
+
*
|
|
102733
|
+
* @static
|
|
102734
|
+
* @memberOf _
|
|
102735
|
+
* @since 4.0.0
|
|
102736
|
+
* @category Lang
|
|
102737
|
+
* @param {*} value The value to check.
|
|
102738
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
102739
|
+
* @example
|
|
102740
|
+
*
|
|
102741
|
+
* _.isObjectLike({});
|
|
102742
|
+
* // => true
|
|
102743
|
+
*
|
|
102744
|
+
* _.isObjectLike([1, 2, 3]);
|
|
102745
|
+
* // => true
|
|
102746
|
+
*
|
|
102747
|
+
* _.isObjectLike(_.noop);
|
|
102748
|
+
* // => false
|
|
102749
|
+
*
|
|
102750
|
+
* _.isObjectLike(null);
|
|
102751
|
+
* // => false
|
|
102752
|
+
*/
|
|
102753
|
+
function isObjectLike(value) {
|
|
102754
|
+
return value != null && typeof value == 'object';
|
|
102755
|
+
}
|
|
102756
|
+
|
|
102757
|
+
var isObjectLike_1 = isObjectLike;
|
|
102758
|
+
|
|
102759
|
+
/** `Object#toString` result references. */
|
|
102760
|
+
var symbolTag = '[object Symbol]';
|
|
102761
|
+
|
|
102762
|
+
/**
|
|
102763
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
102764
|
+
*
|
|
102765
|
+
* @static
|
|
102766
|
+
* @memberOf _
|
|
102767
|
+
* @since 4.0.0
|
|
102768
|
+
* @category Lang
|
|
102769
|
+
* @param {*} value The value to check.
|
|
102770
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
102771
|
+
* @example
|
|
102772
|
+
*
|
|
102773
|
+
* _.isSymbol(Symbol.iterator);
|
|
102774
|
+
* // => true
|
|
102775
|
+
*
|
|
102776
|
+
* _.isSymbol('abc');
|
|
102777
|
+
* // => false
|
|
102778
|
+
*/
|
|
102779
|
+
function isSymbol(value) {
|
|
102780
|
+
return typeof value == 'symbol' ||
|
|
102781
|
+
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
102782
|
+
}
|
|
102783
|
+
|
|
102784
|
+
var isSymbol_1 = isSymbol;
|
|
102785
|
+
|
|
102786
|
+
/** Used as references for various `Number` constants. */
|
|
102787
|
+
var NAN = 0 / 0;
|
|
102788
|
+
|
|
102789
|
+
/** Used to detect bad signed hexadecimal string values. */
|
|
102790
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
102791
|
+
|
|
102792
|
+
/** Used to detect binary string values. */
|
|
102793
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
102794
|
+
|
|
102795
|
+
/** Used to detect octal string values. */
|
|
102796
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
102797
|
+
|
|
102798
|
+
/** Built-in method references without a dependency on `root`. */
|
|
102799
|
+
var freeParseInt = parseInt;
|
|
102800
|
+
|
|
102801
|
+
/**
|
|
102802
|
+
* Converts `value` to a number.
|
|
102803
|
+
*
|
|
102804
|
+
* @static
|
|
102805
|
+
* @memberOf _
|
|
102806
|
+
* @since 4.0.0
|
|
102807
|
+
* @category Lang
|
|
102808
|
+
* @param {*} value The value to process.
|
|
102809
|
+
* @returns {number} Returns the number.
|
|
102810
|
+
* @example
|
|
102811
|
+
*
|
|
102812
|
+
* _.toNumber(3.2);
|
|
102813
|
+
* // => 3.2
|
|
102814
|
+
*
|
|
102815
|
+
* _.toNumber(Number.MIN_VALUE);
|
|
102816
|
+
* // => 5e-324
|
|
102817
|
+
*
|
|
102818
|
+
* _.toNumber(Infinity);
|
|
102819
|
+
* // => Infinity
|
|
102820
|
+
*
|
|
102821
|
+
* _.toNumber('3.2');
|
|
102822
|
+
* // => 3.2
|
|
102823
|
+
*/
|
|
102824
|
+
function toNumber$1(value) {
|
|
102825
|
+
if (typeof value == 'number') {
|
|
102826
|
+
return value;
|
|
102827
|
+
}
|
|
102828
|
+
if (isSymbol_1(value)) {
|
|
102829
|
+
return NAN;
|
|
102830
|
+
}
|
|
102831
|
+
if (isObject_1(value)) {
|
|
102832
|
+
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
102833
|
+
value = isObject_1(other) ? (other + '') : other;
|
|
102834
|
+
}
|
|
102835
|
+
if (typeof value != 'string') {
|
|
102836
|
+
return value === 0 ? value : +value;
|
|
102837
|
+
}
|
|
102838
|
+
value = _baseTrim(value);
|
|
102839
|
+
var isBinary = reIsBinary.test(value);
|
|
102840
|
+
return (isBinary || reIsOctal.test(value))
|
|
102841
|
+
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
|
102842
|
+
: (reIsBadHex.test(value) ? NAN : +value);
|
|
102843
|
+
}
|
|
102844
|
+
|
|
102845
|
+
var toNumber_1 = toNumber$1;
|
|
102846
|
+
|
|
102847
|
+
/** Error message constants. */
|
|
102848
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
102849
|
+
|
|
102850
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
102851
|
+
var nativeMax = Math.max,
|
|
102852
|
+
nativeMin = Math.min;
|
|
102853
|
+
|
|
102854
|
+
/**
|
|
102855
|
+
* Creates a debounced function that delays invoking `func` until after `wait`
|
|
102856
|
+
* milliseconds have elapsed since the last time the debounced function was
|
|
102857
|
+
* invoked. The debounced function comes with a `cancel` method to cancel
|
|
102858
|
+
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
|
102859
|
+
* Provide `options` to indicate whether `func` should be invoked on the
|
|
102860
|
+
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
|
102861
|
+
* with the last arguments provided to the debounced function. Subsequent
|
|
102862
|
+
* calls to the debounced function return the result of the last `func`
|
|
102863
|
+
* invocation.
|
|
102864
|
+
*
|
|
102865
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
102866
|
+
* invoked on the trailing edge of the timeout only if the debounced function
|
|
102867
|
+
* is invoked more than once during the `wait` timeout.
|
|
102868
|
+
*
|
|
102869
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
102870
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
102871
|
+
*
|
|
102872
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
102873
|
+
* for details over the differences between `_.debounce` and `_.throttle`.
|
|
102874
|
+
*
|
|
102875
|
+
* @static
|
|
102876
|
+
* @memberOf _
|
|
102877
|
+
* @since 0.1.0
|
|
102878
|
+
* @category Function
|
|
102879
|
+
* @param {Function} func The function to debounce.
|
|
102880
|
+
* @param {number} [wait=0] The number of milliseconds to delay.
|
|
102881
|
+
* @param {Object} [options={}] The options object.
|
|
102882
|
+
* @param {boolean} [options.leading=false]
|
|
102883
|
+
* Specify invoking on the leading edge of the timeout.
|
|
102884
|
+
* @param {number} [options.maxWait]
|
|
102885
|
+
* The maximum time `func` is allowed to be delayed before it's invoked.
|
|
102886
|
+
* @param {boolean} [options.trailing=true]
|
|
102887
|
+
* Specify invoking on the trailing edge of the timeout.
|
|
102888
|
+
* @returns {Function} Returns the new debounced function.
|
|
102889
|
+
* @example
|
|
102890
|
+
*
|
|
102891
|
+
* // Avoid costly calculations while the window size is in flux.
|
|
102892
|
+
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
|
102893
|
+
*
|
|
102894
|
+
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
|
102895
|
+
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
|
102896
|
+
* 'leading': true,
|
|
102897
|
+
* 'trailing': false
|
|
102898
|
+
* }));
|
|
102899
|
+
*
|
|
102900
|
+
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
|
102901
|
+
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
|
102902
|
+
* var source = new EventSource('/stream');
|
|
102903
|
+
* jQuery(source).on('message', debounced);
|
|
102904
|
+
*
|
|
102905
|
+
* // Cancel the trailing debounced invocation.
|
|
102906
|
+
* jQuery(window).on('popstate', debounced.cancel);
|
|
102907
|
+
*/
|
|
102908
|
+
function debounce(func, wait, options) {
|
|
102909
|
+
var lastArgs,
|
|
102910
|
+
lastThis,
|
|
102911
|
+
maxWait,
|
|
102912
|
+
result,
|
|
102913
|
+
timerId,
|
|
102914
|
+
lastCallTime,
|
|
102915
|
+
lastInvokeTime = 0,
|
|
102916
|
+
leading = false,
|
|
102917
|
+
maxing = false,
|
|
102918
|
+
trailing = true;
|
|
102919
|
+
|
|
102920
|
+
if (typeof func != 'function') {
|
|
102921
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
102922
|
+
}
|
|
102923
|
+
wait = toNumber_1(wait) || 0;
|
|
102924
|
+
if (isObject_1(options)) {
|
|
102925
|
+
leading = !!options.leading;
|
|
102926
|
+
maxing = 'maxWait' in options;
|
|
102927
|
+
maxWait = maxing ? nativeMax(toNumber_1(options.maxWait) || 0, wait) : maxWait;
|
|
102928
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
102929
|
+
}
|
|
102930
|
+
|
|
102931
|
+
function invokeFunc(time) {
|
|
102932
|
+
var args = lastArgs,
|
|
102933
|
+
thisArg = lastThis;
|
|
102934
|
+
|
|
102935
|
+
lastArgs = lastThis = undefined;
|
|
102936
|
+
lastInvokeTime = time;
|
|
102937
|
+
result = func.apply(thisArg, args);
|
|
102938
|
+
return result;
|
|
102939
|
+
}
|
|
102940
|
+
|
|
102941
|
+
function leadingEdge(time) {
|
|
102942
|
+
// Reset any `maxWait` timer.
|
|
102943
|
+
lastInvokeTime = time;
|
|
102944
|
+
// Start the timer for the trailing edge.
|
|
102945
|
+
timerId = setTimeout(timerExpired, wait);
|
|
102946
|
+
// Invoke the leading edge.
|
|
102947
|
+
return leading ? invokeFunc(time) : result;
|
|
102948
|
+
}
|
|
102949
|
+
|
|
102950
|
+
function remainingWait(time) {
|
|
102951
|
+
var timeSinceLastCall = time - lastCallTime,
|
|
102952
|
+
timeSinceLastInvoke = time - lastInvokeTime,
|
|
102953
|
+
timeWaiting = wait - timeSinceLastCall;
|
|
102954
|
+
|
|
102955
|
+
return maxing
|
|
102956
|
+
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
|
|
102957
|
+
: timeWaiting;
|
|
102958
|
+
}
|
|
102959
|
+
|
|
102960
|
+
function shouldInvoke(time) {
|
|
102961
|
+
var timeSinceLastCall = time - lastCallTime,
|
|
102962
|
+
timeSinceLastInvoke = time - lastInvokeTime;
|
|
102963
|
+
|
|
102964
|
+
// Either this is the first call, activity has stopped and we're at the
|
|
102965
|
+
// trailing edge, the system time has gone backwards and we're treating
|
|
102966
|
+
// it as the trailing edge, or we've hit the `maxWait` limit.
|
|
102967
|
+
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
|
102968
|
+
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
|
102969
|
+
}
|
|
102970
|
+
|
|
102971
|
+
function timerExpired() {
|
|
102972
|
+
var time = now_1();
|
|
102973
|
+
if (shouldInvoke(time)) {
|
|
102974
|
+
return trailingEdge(time);
|
|
102975
|
+
}
|
|
102976
|
+
// Restart the timer.
|
|
102977
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
102978
|
+
}
|
|
102979
|
+
|
|
102980
|
+
function trailingEdge(time) {
|
|
102981
|
+
timerId = undefined;
|
|
102982
|
+
|
|
102983
|
+
// Only invoke if we have `lastArgs` which means `func` has been
|
|
102984
|
+
// debounced at least once.
|
|
102985
|
+
if (trailing && lastArgs) {
|
|
102986
|
+
return invokeFunc(time);
|
|
102987
|
+
}
|
|
102988
|
+
lastArgs = lastThis = undefined;
|
|
102989
|
+
return result;
|
|
102990
|
+
}
|
|
102991
|
+
|
|
102992
|
+
function cancel() {
|
|
102993
|
+
if (timerId !== undefined) {
|
|
102994
|
+
clearTimeout(timerId);
|
|
102995
|
+
}
|
|
102996
|
+
lastInvokeTime = 0;
|
|
102997
|
+
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
|
102998
|
+
}
|
|
102999
|
+
|
|
103000
|
+
function flush() {
|
|
103001
|
+
return timerId === undefined ? result : trailingEdge(now_1());
|
|
103002
|
+
}
|
|
103003
|
+
|
|
103004
|
+
function debounced() {
|
|
103005
|
+
var time = now_1(),
|
|
103006
|
+
isInvoking = shouldInvoke(time);
|
|
103007
|
+
|
|
103008
|
+
lastArgs = arguments;
|
|
103009
|
+
lastThis = this;
|
|
103010
|
+
lastCallTime = time;
|
|
103011
|
+
|
|
103012
|
+
if (isInvoking) {
|
|
103013
|
+
if (timerId === undefined) {
|
|
103014
|
+
return leadingEdge(lastCallTime);
|
|
103015
|
+
}
|
|
103016
|
+
if (maxing) {
|
|
103017
|
+
// Handle invocations in a tight loop.
|
|
103018
|
+
clearTimeout(timerId);
|
|
103019
|
+
timerId = setTimeout(timerExpired, wait);
|
|
103020
|
+
return invokeFunc(lastCallTime);
|
|
103021
|
+
}
|
|
103022
|
+
}
|
|
103023
|
+
if (timerId === undefined) {
|
|
103024
|
+
timerId = setTimeout(timerExpired, wait);
|
|
103025
|
+
}
|
|
103026
|
+
return result;
|
|
103027
|
+
}
|
|
103028
|
+
debounced.cancel = cancel;
|
|
103029
|
+
debounced.flush = flush;
|
|
103030
|
+
return debounced;
|
|
103031
|
+
}
|
|
103032
|
+
|
|
103033
|
+
var debounce_1 = debounce;
|
|
103034
|
+
|
|
103035
|
+
/** Error message constants. */
|
|
103036
|
+
var FUNC_ERROR_TEXT$1 = 'Expected a function';
|
|
103037
|
+
|
|
103038
|
+
/**
|
|
103039
|
+
* Creates a throttled function that only invokes `func` at most once per
|
|
103040
|
+
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
|
103041
|
+
* method to cancel delayed `func` invocations and a `flush` method to
|
|
103042
|
+
* immediately invoke them. Provide `options` to indicate whether `func`
|
|
103043
|
+
* should be invoked on the leading and/or trailing edge of the `wait`
|
|
103044
|
+
* timeout. The `func` is invoked with the last arguments provided to the
|
|
103045
|
+
* throttled function. Subsequent calls to the throttled function return the
|
|
103046
|
+
* result of the last `func` invocation.
|
|
103047
|
+
*
|
|
103048
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
103049
|
+
* invoked on the trailing edge of the timeout only if the throttled function
|
|
103050
|
+
* is invoked more than once during the `wait` timeout.
|
|
103051
|
+
*
|
|
103052
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
103053
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
103054
|
+
*
|
|
103055
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
103056
|
+
* for details over the differences between `_.throttle` and `_.debounce`.
|
|
103057
|
+
*
|
|
103058
|
+
* @static
|
|
103059
|
+
* @memberOf _
|
|
103060
|
+
* @since 0.1.0
|
|
103061
|
+
* @category Function
|
|
103062
|
+
* @param {Function} func The function to throttle.
|
|
103063
|
+
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
|
103064
|
+
* @param {Object} [options={}] The options object.
|
|
103065
|
+
* @param {boolean} [options.leading=true]
|
|
103066
|
+
* Specify invoking on the leading edge of the timeout.
|
|
103067
|
+
* @param {boolean} [options.trailing=true]
|
|
103068
|
+
* Specify invoking on the trailing edge of the timeout.
|
|
103069
|
+
* @returns {Function} Returns the new throttled function.
|
|
103070
|
+
* @example
|
|
103071
|
+
*
|
|
103072
|
+
* // Avoid excessively updating the position while scrolling.
|
|
103073
|
+
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
|
103074
|
+
*
|
|
103075
|
+
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
|
|
103076
|
+
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
|
|
103077
|
+
* jQuery(element).on('click', throttled);
|
|
103078
|
+
*
|
|
103079
|
+
* // Cancel the trailing throttled invocation.
|
|
103080
|
+
* jQuery(window).on('popstate', throttled.cancel);
|
|
103081
|
+
*/
|
|
103082
|
+
function throttle(func, wait, options) {
|
|
103083
|
+
var leading = true,
|
|
103084
|
+
trailing = true;
|
|
103085
|
+
|
|
103086
|
+
if (typeof func != 'function') {
|
|
103087
|
+
throw new TypeError(FUNC_ERROR_TEXT$1);
|
|
103088
|
+
}
|
|
103089
|
+
if (isObject_1(options)) {
|
|
103090
|
+
leading = 'leading' in options ? !!options.leading : leading;
|
|
103091
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
103092
|
+
}
|
|
103093
|
+
return debounce_1(func, wait, {
|
|
103094
|
+
'leading': leading,
|
|
103095
|
+
'maxWait': wait,
|
|
103096
|
+
'trailing': trailing
|
|
103097
|
+
});
|
|
103098
|
+
}
|
|
103099
|
+
|
|
103100
|
+
var throttle_1 = throttle;
|
|
103101
|
+
|
|
103102
|
+
function useThrottleFn(fn, options) {
|
|
103103
|
+
var _a;
|
|
103104
|
+
{
|
|
103105
|
+
if (!isFunction(fn)) {
|
|
103106
|
+
console.error("useThrottleFn expected parameter is a function, got ".concat(typeof fn));
|
|
103107
|
+
}
|
|
103108
|
+
}
|
|
103109
|
+
var fnRef = useLatest(fn);
|
|
103110
|
+
var wait = (_a = options === null || options === void 0 ? void 0 : options.wait) !== null && _a !== void 0 ? _a : 1000;
|
|
103111
|
+
var throttled = React.useMemo(function () {
|
|
103112
|
+
return throttle_1(function () {
|
|
103113
|
+
var args = [];
|
|
103114
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
103115
|
+
args[_i] = arguments[_i];
|
|
103116
|
+
}
|
|
103117
|
+
return fnRef.current.apply(fnRef, __spreadArray([], __read(args), false));
|
|
103118
|
+
}, wait, options);
|
|
103119
|
+
}, []);
|
|
103120
|
+
useUnmount(function () {
|
|
103121
|
+
throttled.cancel();
|
|
103122
|
+
});
|
|
103123
|
+
return {
|
|
103124
|
+
run: throttled,
|
|
103125
|
+
cancel: throttled.cancel,
|
|
103126
|
+
flush: throttled.flush
|
|
103127
|
+
};
|
|
103128
|
+
}
|
|
103129
|
+
|
|
102390
103130
|
var SVGIcon = function SVGIcon(_ref) {
|
|
102391
103131
|
var _ref$width = _ref.width,
|
|
102392
103132
|
width = _ref$width === void 0 ? 24 : _ref$width,
|
|
@@ -105469,6 +106209,22 @@
|
|
|
105469
106209
|
});
|
|
105470
106210
|
}
|
|
105471
106211
|
}, [setContext, refs.globalCache, refs.cellInput, refs.cellArea, refs.fxInput, refs.canvas]);
|
|
106212
|
+
var debounceMouseMove = useMemoizedFn(function (e) {
|
|
106213
|
+
var nativeEvent = e.nativeEvent;
|
|
106214
|
+
setContext(function (draftCtx) {
|
|
106215
|
+
handleCellAreaMouseMove(draftCtx, refs.globalCache, nativeEvent, refs.cellArea.current);
|
|
106216
|
+
});
|
|
106217
|
+
});
|
|
106218
|
+
var _useThrottleFn = useThrottleFn(debounceMouseMove, {
|
|
106219
|
+
wait: 100
|
|
106220
|
+
}),
|
|
106221
|
+
cellAreaMouseMove = _useThrottleFn.run;
|
|
106222
|
+
var cellAreaMouseLeave = React.useCallback(function () {
|
|
106223
|
+
setTimeout(function () {
|
|
106224
|
+
var _context$hooks$afterC, _context$hooks;
|
|
106225
|
+
(_context$hooks$afterC = (_context$hooks = context.hooks).afterCellMouseLeave) === null || _context$hooks$afterC === void 0 ? void 0 : _context$hooks$afterC.call(_context$hooks);
|
|
106226
|
+
}, 100);
|
|
106227
|
+
}, [context]);
|
|
105472
106228
|
var cellAreaContextMenu = React.useCallback(function (e) {
|
|
105473
106229
|
var nativeEvent = e.nativeEvent;
|
|
105474
106230
|
setContext(function (draftCtx) {
|
|
@@ -105619,12 +106375,14 @@
|
|
|
105619
106375
|
ref: refs.cellArea,
|
|
105620
106376
|
className: "leankylin-cell-area",
|
|
105621
106377
|
onMouseDown: cellAreaMouseDown,
|
|
106378
|
+
onMouseMove: cellAreaMouseMove,
|
|
106379
|
+
onMouseLeave: cellAreaMouseLeave,
|
|
105622
106380
|
onDoubleClick: cellAreaDoubleClick,
|
|
105623
106381
|
onContextMenu: cellAreaContextMenu,
|
|
105624
106382
|
style: {
|
|
105625
106383
|
width: context.cellmainWidth,
|
|
105626
106384
|
height: context.cellmainHeight,
|
|
105627
|
-
cursor: context.luckysheet_cell_selected_extend ? "crosshair" : "
|
|
106385
|
+
cursor: context.luckysheet_cell_selected_extend ? "crosshair" : "auto"
|
|
105628
106386
|
}
|
|
105629
106387
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
105630
106388
|
id: "leankylin-formula-functionrange"
|