@leankylin-sheet/react 4.0.9 → 4.0.10
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.esm.js +25 -32
- package/dist/index.js +24 -31
- package/dist/index.umd.js +24 -31
- package/dist/index.umd.min.js +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, functionHTMLGenerate, locale,
|
|
1
|
+
import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, functionHTMLGenerate, locale, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, moveToEnd, isShowHidenCR, cancelNormalSelected, moveHighlightCell, updateCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, getRangetxt, goToLink, replaceHtml, removeHyperlink, onRangeSelectionModalMoveStart, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, onCommentBoxResizeStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaMouseMove, handleCellAreaDragOver, handleCellDrop, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, setCaretPosition, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem, update, normalizedCellAttr, updateFormat, handleTextSize, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, showImgChooser, insertImage, editComment, deleteComment, showHideComment, showHideAllComments, newComment, handleSum, autoSelectionFormula, handleMerge, handleBorder, handleFreeze, handleSort, createFilter, clearFilter, toolbarItemSelectedFunc, toolbarItemClickHandler, handleTextColor, handleTextBackground, getDataBySelectionNoCopy, getInlineStringNoStyle, rangeHightlightselected, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, indexToColumnChar, sortSelection, handleCopy, insertRowCol, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, jfrefreshgrid, handleLink, deleteSheet, opToPatch, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePasteByLeanklin, groupValuesRefresh } from '@leankylin-sheet/core';
|
|
2
2
|
import React, { useContext, useRef, useState, useMemo, useCallback, useEffect, useLayoutEffect, useImperativeHandle } from 'react';
|
|
3
3
|
import produce, { applyPatches, enablePatches, produceWithPatches } from 'immer';
|
|
4
4
|
import _ from 'lodash';
|
|
@@ -1166,11 +1166,6 @@ var InputBox = function InputBox() {
|
|
|
1166
1166
|
var col_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
|
|
1167
1167
|
var preText = useRef("");
|
|
1168
1168
|
var inputBoxStyle = useMemo(function () {
|
|
1169
|
-
if (firstSelection && context.luckysheetCellUpdate.length > 0) {
|
|
1170
|
-
var flowdata = getFlowdata(context);
|
|
1171
|
-
if (!flowdata) return {};
|
|
1172
|
-
return getStyleByCell(context, flowdata, firstSelection.row_focus, firstSelection.column_focus);
|
|
1173
|
-
}
|
|
1174
1169
|
return {};
|
|
1175
1170
|
}, [context.luckysheetfile, context.currentSheetId, context.luckysheetCellUpdate, firstSelection]);
|
|
1176
1171
|
useLayoutEffect(function () {
|
|
@@ -1296,6 +1291,9 @@ var InputBox = function InputBox() {
|
|
|
1296
1291
|
},
|
|
1297
1292
|
onMouseUp: function onMouseUp(e) {
|
|
1298
1293
|
return e.stopPropagation();
|
|
1294
|
+
},
|
|
1295
|
+
onContextMenu: function onContextMenu(e) {
|
|
1296
|
+
return e.stopPropagation();
|
|
1299
1297
|
}
|
|
1300
1298
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1301
1299
|
className: "luckysheet-input-box-inner",
|
|
@@ -3820,7 +3818,8 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3820
3818
|
onClick: onLeftTopClick,
|
|
3821
3819
|
style: {
|
|
3822
3820
|
width: context.rowHeaderWidth - 1.5,
|
|
3823
|
-
height: context.columnHeaderHeight - 1.5
|
|
3821
|
+
height: context.columnHeaderHeight - 1.5,
|
|
3822
|
+
background: context.headerBgColor
|
|
3824
3823
|
}
|
|
3825
3824
|
}), /*#__PURE__*/React.createElement(ColumnHeader, null)), (context.showSearch || context.showReplace) && /*#__PURE__*/React.createElement(SearchReplace, null), /*#__PURE__*/React.createElement("div", {
|
|
3826
3825
|
className: "leankylin-row-body"
|
|
@@ -3875,36 +3874,29 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3875
3874
|
}
|
|
3876
3875
|
})), context.formulaRangeHighlight.map(function (v) {
|
|
3877
3876
|
var rangeIndex = v.rangeIndex,
|
|
3878
|
-
backgroundColor = v.backgroundColor
|
|
3877
|
+
backgroundColor = v.backgroundColor,
|
|
3878
|
+
height = v.height,
|
|
3879
|
+
left = v.left,
|
|
3880
|
+
top = v.top,
|
|
3881
|
+
width = v.width;
|
|
3879
3882
|
return /*#__PURE__*/React.createElement("div", {
|
|
3880
3883
|
key: rangeIndex,
|
|
3881
3884
|
id: "leankylin-formula-functionrange-highlight",
|
|
3882
3885
|
className: "leankylin-selection-highlight leankylin-formula-functionrange-highlight",
|
|
3883
|
-
style: _.
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
style: {
|
|
3896
|
-
backgroundColor: backgroundColor
|
|
3886
|
+
style: _.isEmpty(context.luckysheetCellUpdate) ? {
|
|
3887
|
+
height: height - 2,
|
|
3888
|
+
left: left,
|
|
3889
|
+
top: top,
|
|
3890
|
+
width: width - 2,
|
|
3891
|
+
border: "1px dashed ".concat(backgroundColor)
|
|
3892
|
+
} : {
|
|
3893
|
+
height: height - 4,
|
|
3894
|
+
left: left,
|
|
3895
|
+
top: top,
|
|
3896
|
+
width: width - 4,
|
|
3897
|
+
border: "2px solid ".concat(backgroundColor)
|
|
3897
3898
|
}
|
|
3898
|
-
})
|
|
3899
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3900
|
-
key: d,
|
|
3901
|
-
"data-type": d,
|
|
3902
|
-
className: "leankylin-selection-highlight-".concat(d, " luckysheet-highlight"),
|
|
3903
|
-
style: {
|
|
3904
|
-
backgroundColor: backgroundColor
|
|
3905
|
-
}
|
|
3906
|
-
});
|
|
3907
|
-
}));
|
|
3899
|
+
});
|
|
3908
3900
|
}), /*#__PURE__*/React.createElement("div", {
|
|
3909
3901
|
className: "luckysheet-row-count-show luckysheet-count-show",
|
|
3910
3902
|
id: "luckysheet-row-count-show"
|
|
@@ -11379,6 +11371,7 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
11379
11371
|
} else {
|
|
11380
11372
|
draftCtx.addDefaultRows = mergedSettings.addRows;
|
|
11381
11373
|
}
|
|
11374
|
+
draftCtx.headerBgColor = mergedSettings.headerBgColor || "#fff";
|
|
11382
11375
|
if (!_.isNil(sheet.defaultColWidth)) {
|
|
11383
11376
|
draftCtx.defaultcollen = Number(sheet.defaultColWidth);
|
|
11384
11377
|
} else {
|
package/dist/index.js
CHANGED
|
@@ -1176,11 +1176,6 @@ var InputBox = function InputBox() {
|
|
|
1176
1176
|
var col_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
|
|
1177
1177
|
var preText = React.useRef("");
|
|
1178
1178
|
var inputBoxStyle = React.useMemo(function () {
|
|
1179
|
-
if (firstSelection && context.luckysheetCellUpdate.length > 0) {
|
|
1180
|
-
var flowdata = core.getFlowdata(context);
|
|
1181
|
-
if (!flowdata) return {};
|
|
1182
|
-
return core.getStyleByCell(context, flowdata, firstSelection.row_focus, firstSelection.column_focus);
|
|
1183
|
-
}
|
|
1184
1179
|
return {};
|
|
1185
1180
|
}, [context.luckysheetfile, context.currentSheetId, context.luckysheetCellUpdate, firstSelection]);
|
|
1186
1181
|
React.useLayoutEffect(function () {
|
|
@@ -1306,6 +1301,9 @@ var InputBox = function InputBox() {
|
|
|
1306
1301
|
},
|
|
1307
1302
|
onMouseUp: function onMouseUp(e) {
|
|
1308
1303
|
return e.stopPropagation();
|
|
1304
|
+
},
|
|
1305
|
+
onContextMenu: function onContextMenu(e) {
|
|
1306
|
+
return e.stopPropagation();
|
|
1309
1307
|
}
|
|
1310
1308
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1311
1309
|
className: "luckysheet-input-box-inner",
|
|
@@ -3830,7 +3828,8 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3830
3828
|
onClick: onLeftTopClick,
|
|
3831
3829
|
style: {
|
|
3832
3830
|
width: context.rowHeaderWidth - 1.5,
|
|
3833
|
-
height: context.columnHeaderHeight - 1.5
|
|
3831
|
+
height: context.columnHeaderHeight - 1.5,
|
|
3832
|
+
background: context.headerBgColor
|
|
3834
3833
|
}
|
|
3835
3834
|
}), /*#__PURE__*/React__default['default'].createElement(ColumnHeader, null)), (context.showSearch || context.showReplace) && /*#__PURE__*/React__default['default'].createElement(SearchReplace, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3836
3835
|
className: "leankylin-row-body"
|
|
@@ -3885,36 +3884,29 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3885
3884
|
}
|
|
3886
3885
|
})), context.formulaRangeHighlight.map(function (v) {
|
|
3887
3886
|
var rangeIndex = v.rangeIndex,
|
|
3888
|
-
backgroundColor = v.backgroundColor
|
|
3887
|
+
backgroundColor = v.backgroundColor,
|
|
3888
|
+
height = v.height,
|
|
3889
|
+
left = v.left,
|
|
3890
|
+
top = v.top,
|
|
3891
|
+
width = v.width;
|
|
3889
3892
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3890
3893
|
key: rangeIndex,
|
|
3891
3894
|
id: "leankylin-formula-functionrange-highlight",
|
|
3892
3895
|
className: "leankylin-selection-highlight leankylin-formula-functionrange-highlight",
|
|
3893
|
-
style: ___default['default'].
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
style: {
|
|
3906
|
-
backgroundColor: backgroundColor
|
|
3896
|
+
style: ___default['default'].isEmpty(context.luckysheetCellUpdate) ? {
|
|
3897
|
+
height: height - 2,
|
|
3898
|
+
left: left,
|
|
3899
|
+
top: top,
|
|
3900
|
+
width: width - 2,
|
|
3901
|
+
border: "1px dashed ".concat(backgroundColor)
|
|
3902
|
+
} : {
|
|
3903
|
+
height: height - 4,
|
|
3904
|
+
left: left,
|
|
3905
|
+
top: top,
|
|
3906
|
+
width: width - 4,
|
|
3907
|
+
border: "2px solid ".concat(backgroundColor)
|
|
3907
3908
|
}
|
|
3908
|
-
})
|
|
3909
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3910
|
-
key: d,
|
|
3911
|
-
"data-type": d,
|
|
3912
|
-
className: "leankylin-selection-highlight-".concat(d, " luckysheet-highlight"),
|
|
3913
|
-
style: {
|
|
3914
|
-
backgroundColor: backgroundColor
|
|
3915
|
-
}
|
|
3916
|
-
});
|
|
3917
|
-
}));
|
|
3909
|
+
});
|
|
3918
3910
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3919
3911
|
className: "luckysheet-row-count-show luckysheet-count-show",
|
|
3920
3912
|
id: "luckysheet-row-count-show"
|
|
@@ -11389,6 +11381,7 @@ var Workbook = /*#__PURE__*/React__default['default'].forwardRef(function (_ref,
|
|
|
11389
11381
|
} else {
|
|
11390
11382
|
draftCtx.addDefaultRows = mergedSettings.addRows;
|
|
11391
11383
|
}
|
|
11384
|
+
draftCtx.headerBgColor = mergedSettings.headerBgColor || "#fff";
|
|
11392
11385
|
if (!___default['default'].isNil(sheet.defaultColWidth)) {
|
|
11393
11386
|
draftCtx.defaultcollen = Number(sheet.defaultColWidth);
|
|
11394
11387
|
} else {
|
package/dist/index.umd.js
CHANGED
|
@@ -94514,11 +94514,6 @@
|
|
|
94514
94514
|
var col_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
|
|
94515
94515
|
var preText = React.useRef("");
|
|
94516
94516
|
var inputBoxStyle = React.useMemo(function () {
|
|
94517
|
-
if (firstSelection && context.luckysheetCellUpdate.length > 0) {
|
|
94518
|
-
var flowdata = getFlowdata(context);
|
|
94519
|
-
if (!flowdata) return {};
|
|
94520
|
-
return getStyleByCell(context, flowdata, firstSelection.row_focus, firstSelection.column_focus);
|
|
94521
|
-
}
|
|
94522
94517
|
return {};
|
|
94523
94518
|
}, [context.luckysheetfile, context.currentSheetId, context.luckysheetCellUpdate, firstSelection]);
|
|
94524
94519
|
React.useLayoutEffect(function () {
|
|
@@ -94644,6 +94639,9 @@
|
|
|
94644
94639
|
},
|
|
94645
94640
|
onMouseUp: function onMouseUp(e) {
|
|
94646
94641
|
return e.stopPropagation();
|
|
94642
|
+
},
|
|
94643
|
+
onContextMenu: function onContextMenu(e) {
|
|
94644
|
+
return e.stopPropagation();
|
|
94647
94645
|
}
|
|
94648
94646
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
94649
94647
|
className: "luckysheet-input-box-inner",
|
|
@@ -97168,7 +97166,8 @@
|
|
|
97168
97166
|
onClick: onLeftTopClick,
|
|
97169
97167
|
style: {
|
|
97170
97168
|
width: context.rowHeaderWidth - 1.5,
|
|
97171
|
-
height: context.columnHeaderHeight - 1.5
|
|
97169
|
+
height: context.columnHeaderHeight - 1.5,
|
|
97170
|
+
background: context.headerBgColor
|
|
97172
97171
|
}
|
|
97173
97172
|
}), /*#__PURE__*/React__default['default'].createElement(ColumnHeader, null)), (context.showSearch || context.showReplace) && /*#__PURE__*/React__default['default'].createElement(SearchReplace, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
97174
97173
|
className: "leankylin-row-body"
|
|
@@ -97223,36 +97222,29 @@
|
|
|
97223
97222
|
}
|
|
97224
97223
|
})), context.formulaRangeHighlight.map(function (v) {
|
|
97225
97224
|
var rangeIndex = v.rangeIndex,
|
|
97226
|
-
backgroundColor = v.backgroundColor
|
|
97225
|
+
backgroundColor = v.backgroundColor,
|
|
97226
|
+
height = v.height,
|
|
97227
|
+
left = v.left,
|
|
97228
|
+
top = v.top,
|
|
97229
|
+
width = v.width;
|
|
97227
97230
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
97228
97231
|
key: rangeIndex,
|
|
97229
97232
|
id: "leankylin-formula-functionrange-highlight",
|
|
97230
97233
|
className: "leankylin-selection-highlight leankylin-formula-functionrange-highlight",
|
|
97231
|
-
style: lodash.
|
|
97232
|
-
|
|
97233
|
-
|
|
97234
|
-
|
|
97235
|
-
|
|
97236
|
-
|
|
97237
|
-
|
|
97238
|
-
|
|
97239
|
-
|
|
97240
|
-
|
|
97241
|
-
|
|
97242
|
-
|
|
97243
|
-
style: {
|
|
97244
|
-
backgroundColor: backgroundColor
|
|
97234
|
+
style: lodash.isEmpty(context.luckysheetCellUpdate) ? {
|
|
97235
|
+
height: height - 2,
|
|
97236
|
+
left: left,
|
|
97237
|
+
top: top,
|
|
97238
|
+
width: width - 2,
|
|
97239
|
+
border: "1px dashed ".concat(backgroundColor)
|
|
97240
|
+
} : {
|
|
97241
|
+
height: height - 4,
|
|
97242
|
+
left: left,
|
|
97243
|
+
top: top,
|
|
97244
|
+
width: width - 4,
|
|
97245
|
+
border: "2px solid ".concat(backgroundColor)
|
|
97245
97246
|
}
|
|
97246
|
-
})
|
|
97247
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
97248
|
-
key: d,
|
|
97249
|
-
"data-type": d,
|
|
97250
|
-
className: "leankylin-selection-highlight-".concat(d, " luckysheet-highlight"),
|
|
97251
|
-
style: {
|
|
97252
|
-
backgroundColor: backgroundColor
|
|
97253
|
-
}
|
|
97254
|
-
});
|
|
97255
|
-
}));
|
|
97247
|
+
});
|
|
97256
97248
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
97257
97249
|
className: "luckysheet-row-count-show luckysheet-count-show",
|
|
97258
97250
|
id: "luckysheet-row-count-show"
|
|
@@ -104727,6 +104719,7 @@
|
|
|
104727
104719
|
} else {
|
|
104728
104720
|
draftCtx.addDefaultRows = mergedSettings.addRows;
|
|
104729
104721
|
}
|
|
104722
|
+
draftCtx.headerBgColor = mergedSettings.headerBgColor || "#fff";
|
|
104730
104723
|
if (!lodash.isNil(sheet.defaultColWidth)) {
|
|
104731
104724
|
draftCtx.defaultcollen = Number(sheet.defaultColWidth);
|
|
104732
104725
|
} else {
|