@leankylin-sheet/react 5.1.15 → 5.1.18

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 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, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, 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, moveToEnd, 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';
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, 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, setNextSheet, 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, cancelActiveImgItem, 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';
@@ -7241,53 +7241,7 @@ var SheetItem = function SheetItem(_ref) {
7241
7241
  var onChangeSheet = useMemoizedFn(function () {
7242
7242
  if (isDropPlaceholder) return;
7243
7243
  setContext(function (draftCtx) {
7244
- var _luckysheetCellUpdate;
7245
- draftCtx.sheetScrollRecord[draftCtx.currentSheetId] = {
7246
- scrollLeft: draftCtx.scrollLeft,
7247
- scrollTop: draftCtx.scrollTop,
7248
- luckysheet_select_status: draftCtx.luckysheet_select_status,
7249
- luckysheet_select_save: draftCtx.luckysheet_select_save,
7250
- luckysheet_selection_range: draftCtx.luckysheet_selection_range
7251
- };
7252
- var isBack = false;
7253
- var luckysheetCellUpdate = [];
7254
- var sheetId = sheet.id;
7255
- if ((israngeseleciton(draftCtx) || draftCtx.formulaCache.rangestart) && !draftCtx.active_f) {
7256
- var _refs$fxInput$current, _draftCtx$sheetScroll;
7257
- draftCtx.active_f = {
7258
- r: draftCtx.luckysheet_select_save[0].row_focus,
7259
- c: draftCtx.luckysheet_select_save[0].column_focus,
7260
- sheetId: draftCtx.currentSheetId,
7261
- text: (_refs$fxInput$current = refs.fxInput.current) === null || _refs$fxInput$current === void 0 ? void 0 : _refs$fxInput$current.innerText
7262
- };
7263
- if ((_draftCtx$sheetScroll = draftCtx.sheetScrollRecord[sheet.id]) === null || _draftCtx$sheetScroll === void 0 ? void 0 : _draftCtx$sheetScroll.luckysheet_select_save) {
7264
- draftCtx.sheetScrollRecord[sheet.id].luckysheet_select_save = undefined;
7265
- }
7266
- moveToEnd(refs.fxInput.current);
7267
- } else if (draftCtx.active_f && draftCtx.active_f.sheetId === sheet.id) {
7268
- var _refs$fxInput$current2;
7269
- luckysheetCellUpdate = [draftCtx.active_f.r, draftCtx.active_f.c];
7270
- isBack = true;
7271
- if ((_refs$fxInput$current2 = refs.fxInput.current) === null || _refs$fxInput$current2 === void 0 ? void 0 : _refs$fxInput$current2.innerHTML) {
7272
- var _refs$fxInput$current3;
7273
- refs.cellInput.current.innerHTML = ((_refs$fxInput$current3 = refs.fxInput.current) === null || _refs$fxInput$current3 === void 0 ? void 0 : _refs$fxInput$current3.innerHTML) || "";
7274
- }
7275
- moveToEnd(refs.cellInput.current);
7276
- }
7277
- if (draftCtx.active_f) {
7278
- sheetId = draftCtx.active_f.sheetId;
7279
- }
7280
- var _update = ((_luckysheetCellUpdate = luckysheetCellUpdate) === null || _luckysheetCellUpdate === void 0 ? void 0 : _luckysheetCellUpdate.length) > 0 ? luckysheetCellUpdate : draftCtx.luckysheetCellUpdate;
7281
- draftCtx.currentSheetId = sheet.id;
7282
- if ((_update === null || _update === void 0 ? void 0 : _update.length) > 0) ;
7283
- draftCtx.dataVerificationDropDownList = false;
7284
- draftCtx.zoomRatio = sheet.zoomRatio || 1;
7285
- cancelActiveImgItem(draftCtx, refs.globalCache);
7286
- cancelNormalSelected(draftCtx);
7287
- if (isBack) {
7288
- draftCtx.luckysheetCellUpdate = luckysheetCellUpdate;
7289
- draftCtx.active_f = undefined;
7290
- }
7244
+ setNextSheet(draftCtx, sheet.id, refs);
7291
7245
  });
7292
7246
  });
7293
7247
  return /*#__PURE__*/React.createElement("div", {
@@ -11480,7 +11434,7 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
11480
11434
  return;
11481
11435
  }
11482
11436
  setContextWithProduce(function (draftCtx) {
11483
- handleGlobalKeyDown(draftCtx, cellInput.current, fxInput.current, nativeEvent, globalCache.current, handleUndo, handleRedo, canvas.current.getContext("2d"));
11437
+ handleGlobalKeyDown(draftCtx, cellInput.current, fxInput.current, nativeEvent, globalCache.current, handleUndo, handleRedo, canvas.current.getContext("2d"), refs);
11484
11438
  });
11485
11439
  }, [handleRedo, handleUndo, setContextWithProduce, mergedSettings.disabledKeyboardCodes]);
11486
11440
  var onPaste = useCallback(function (e) {
package/dist/index.js CHANGED
@@ -7251,53 +7251,7 @@ var SheetItem = function SheetItem(_ref) {
7251
7251
  var onChangeSheet = ahooks.useMemoizedFn(function () {
7252
7252
  if (isDropPlaceholder) return;
7253
7253
  setContext(function (draftCtx) {
7254
- var _luckysheetCellUpdate;
7255
- draftCtx.sheetScrollRecord[draftCtx.currentSheetId] = {
7256
- scrollLeft: draftCtx.scrollLeft,
7257
- scrollTop: draftCtx.scrollTop,
7258
- luckysheet_select_status: draftCtx.luckysheet_select_status,
7259
- luckysheet_select_save: draftCtx.luckysheet_select_save,
7260
- luckysheet_selection_range: draftCtx.luckysheet_selection_range
7261
- };
7262
- var isBack = false;
7263
- var luckysheetCellUpdate = [];
7264
- var sheetId = sheet.id;
7265
- if ((core.israngeseleciton(draftCtx) || draftCtx.formulaCache.rangestart) && !draftCtx.active_f) {
7266
- var _refs$fxInput$current, _draftCtx$sheetScroll;
7267
- draftCtx.active_f = {
7268
- r: draftCtx.luckysheet_select_save[0].row_focus,
7269
- c: draftCtx.luckysheet_select_save[0].column_focus,
7270
- sheetId: draftCtx.currentSheetId,
7271
- text: (_refs$fxInput$current = refs.fxInput.current) === null || _refs$fxInput$current === void 0 ? void 0 : _refs$fxInput$current.innerText
7272
- };
7273
- if ((_draftCtx$sheetScroll = draftCtx.sheetScrollRecord[sheet.id]) === null || _draftCtx$sheetScroll === void 0 ? void 0 : _draftCtx$sheetScroll.luckysheet_select_save) {
7274
- draftCtx.sheetScrollRecord[sheet.id].luckysheet_select_save = undefined;
7275
- }
7276
- core.moveToEnd(refs.fxInput.current);
7277
- } else if (draftCtx.active_f && draftCtx.active_f.sheetId === sheet.id) {
7278
- var _refs$fxInput$current2;
7279
- luckysheetCellUpdate = [draftCtx.active_f.r, draftCtx.active_f.c];
7280
- isBack = true;
7281
- if ((_refs$fxInput$current2 = refs.fxInput.current) === null || _refs$fxInput$current2 === void 0 ? void 0 : _refs$fxInput$current2.innerHTML) {
7282
- var _refs$fxInput$current3;
7283
- refs.cellInput.current.innerHTML = ((_refs$fxInput$current3 = refs.fxInput.current) === null || _refs$fxInput$current3 === void 0 ? void 0 : _refs$fxInput$current3.innerHTML) || "";
7284
- }
7285
- core.moveToEnd(refs.cellInput.current);
7286
- }
7287
- if (draftCtx.active_f) {
7288
- sheetId = draftCtx.active_f.sheetId;
7289
- }
7290
- var _update = ((_luckysheetCellUpdate = luckysheetCellUpdate) === null || _luckysheetCellUpdate === void 0 ? void 0 : _luckysheetCellUpdate.length) > 0 ? luckysheetCellUpdate : draftCtx.luckysheetCellUpdate;
7291
- draftCtx.currentSheetId = sheet.id;
7292
- if ((_update === null || _update === void 0 ? void 0 : _update.length) > 0) ;
7293
- draftCtx.dataVerificationDropDownList = false;
7294
- draftCtx.zoomRatio = sheet.zoomRatio || 1;
7295
- core.cancelActiveImgItem(draftCtx, refs.globalCache);
7296
- core.cancelNormalSelected(draftCtx);
7297
- if (isBack) {
7298
- draftCtx.luckysheetCellUpdate = luckysheetCellUpdate;
7299
- draftCtx.active_f = undefined;
7300
- }
7254
+ core.setNextSheet(draftCtx, sheet.id, refs);
7301
7255
  });
7302
7256
  });
7303
7257
  return /*#__PURE__*/React__default['default'].createElement("div", {
@@ -11490,7 +11444,7 @@ var Workbook = /*#__PURE__*/React__default['default'].forwardRef(function (_ref,
11490
11444
  return;
11491
11445
  }
11492
11446
  setContextWithProduce(function (draftCtx) {
11493
- core.handleGlobalKeyDown(draftCtx, cellInput.current, fxInput.current, nativeEvent, globalCache.current, handleUndo, handleRedo, canvas.current.getContext("2d"));
11447
+ core.handleGlobalKeyDown(draftCtx, cellInput.current, fxInput.current, nativeEvent, globalCache.current, handleUndo, handleRedo, canvas.current.getContext("2d"), refs);
11494
11448
  });
11495
11449
  }, [handleRedo, handleUndo, setContextWithProduce, mergedSettings.disabledKeyboardCodes]);
11496
11450
  var onPaste = React.useCallback(function (e) {