@fileverse-dev/fortune-react 1.0.2-mod-58 → 1.0.2-mod-60

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, locale, getStyleByCell, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, moveToEnd, isShowHidenCR, getrangeseleciton, cancelNormalSelected, moveHighlightCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, goToLink, replaceHtml, removeHyperlink, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, getRangetxt, setConditionRules, mergeBorder, setDropdownValue, onIframeMoveStart, onIframeResizeStart, onIframeMove, onIframeMoveEnd, onIframeResize, onIframeResizeEnd, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, insertRowCol, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem, update, sanitizeDuneUrl, normalizedCellAttr, updateFormat, handleTextSize, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, showImgChooser, insertImage, editComment, deleteComment, showHideComment, showHideAllComments, newComment, handleSum, autoSelectionFormula, handleMerge, handleBorder, handleFreeze, handleSort, createFilter, clearFilter, toolbarItemSelectedFunc, toolbarItemClickHandler, insertDuneChart, handleTextColor, handleTextBackground, getInlineStringNoStyle, rangeHightlightselected, updateCell, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, api, getFreezeState, toggleFreeze, jfrefreshgrid, handleCopy, removeActiveImage, deleteSelectedCellText, deleteRowCol, hideSelected, showSelected, sortSelection, handleLink, handlePasteByClick, deleteSheet, opToPatch, setCaretPosition, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, calcSelectionInfo, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePaste, groupValuesRefresh } from '@fileverse-dev/fortune-core';
1
+ import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, handleContextMenu, fixRowStyleOverflowInFreeze, locale, getStyleByCell, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, moveToEnd, isShowHidenCR, getrangeseleciton, cancelNormalSelected, moveHighlightCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, goToLink, replaceHtml, removeHyperlink, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, getRangetxt, setConditionRules, mergeBorder, setDropdownValue, onIframeMoveStart, onIframeResizeStart, onIframeMove, onIframeMoveEnd, onIframeResize, onIframeResizeEnd, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, insertRowCol, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem, update, sanitizeDuneUrl, normalizedCellAttr, updateFormat, handleTextSize, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, showImgChooser, insertImage, editComment, deleteComment, showHideComment, showHideAllComments, newComment, handleSum, autoSelectionFormula, handleMerge, handleBorder, handleFreeze, handleSort, createFilter, clearFilter, toolbarItemSelectedFunc, toolbarItemClickHandler, insertDuneChart, handleTextColor, handleTextBackground, getInlineStringNoStyle, rangeHightlightselected, updateCell, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, api, getFreezeState, toggleFreeze, jfrefreshgrid, handleCopy, removeActiveImage, deleteSelectedCellText, deleteRowCol, hideSelected, showSelected, sortSelection, handleLink, handlePasteByClick, deleteSheet, opToPatch, setCaretPosition, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, calcSelectionInfo, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePaste, groupValuesRefresh } from '@fileverse-dev/fortune-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';
@@ -340,7 +340,6 @@ var ColumnHeader = function ColumnHeader() {
340
340
  var _useContext = useContext(WorkbookContext),
341
341
  context = _useContext.context,
342
342
  setContext = _useContext.setContext,
343
- settings = _useContext.settings,
344
343
  refs = _useContext.refs;
345
344
  var containerRef = useRef(null);
346
345
  var colChangeSizeRef = useRef(null);
@@ -431,12 +430,6 @@ var ColumnHeader = function ColumnHeader() {
431
430
  });
432
431
  e.stopPropagation();
433
432
  }, [refs.cellArea, refs.globalCache, refs.workbookContainer, setContext]);
434
- var onContextMenu = useCallback(function (e) {
435
- var nativeEvent = e.nativeEvent;
436
- setContext(function (draftCtx) {
437
- handleContextMenu(draftCtx, settings, nativeEvent, refs.workbookContainer.current, refs.cellArea.current, "columnHeader");
438
- });
439
- }, [refs.workbookContainer, setContext, settings, refs.cellArea]);
440
433
  useEffect(function () {
441
434
  var s = context.luckysheet_select_save;
442
435
  if (_.isNil(s)) return;
@@ -478,7 +471,16 @@ var ColumnHeader = function ColumnHeader() {
478
471
  onMouseMove: onMouseMove,
479
472
  onMouseDown: onMouseDown,
480
473
  onMouseLeave: onMouseLeave,
481
- onContextMenu: onContextMenu
474
+ onContextMenu: function onContextMenu(e) {
475
+ e.preventDefault();
476
+ setContext(function (ctx) {
477
+ ctx.contextMenu = {
478
+ x: e.pageX,
479
+ y: 90,
480
+ headerMenu: true
481
+ };
482
+ });
483
+ }
482
484
  }, /*#__PURE__*/React.createElement("div", {
483
485
  className: "fortune-cols-freeze-handle",
484
486
  onMouseDown: onColFreezeHandleMouseDown,
@@ -7776,11 +7778,11 @@ var ContextMenu = function ContextMenu() {
7776
7778
  className: "context-item"
7777
7779
  }, /*#__PURE__*/React.createElement(SVGIcon, {
7778
7780
  name: "split-flv",
7779
- width: 16,
7780
- height: 16,
7781
+ width: 17,
7782
+ height: 17,
7781
7783
  style: {
7782
7784
  marginTop: "4px",
7783
- marginRight: "4px"
7785
+ marginRight: "8px"
7784
7786
  }
7785
7787
  }), "Split text to columns"));
7786
7788
  }
@@ -7860,7 +7862,7 @@ var ContextMenu = function ContextMenu() {
7860
7862
  height: 18,
7861
7863
  style: {
7862
7864
  marginTop: "4px",
7863
- marginRight: "4px"
7865
+ marginRight: "8px"
7864
7866
  }
7865
7867
  }), /*#__PURE__*/React.createElement("p", null, "Comment")));
7866
7868
  }
@@ -7878,8 +7880,10 @@ var ContextMenu = function ContextMenu() {
7878
7880
  className: "context-item"
7879
7881
  }, /*#__PURE__*/React.createElement(SVGIcon, {
7880
7882
  name: "dataVerification",
7883
+ width: 20,
7884
+ height: 20,
7881
7885
  style: {
7882
- marginRight: "4px"
7886
+ marginRight: "7px"
7883
7887
  }
7884
7888
  }), /*#__PURE__*/React.createElement("p", null, "Data Verification")));
7885
7889
  }
@@ -7898,8 +7902,10 @@ var ContextMenu = function ContextMenu() {
7898
7902
  className: "context-item"
7899
7903
  }, /*#__PURE__*/React.createElement(SVGIcon, {
7900
7904
  name: "search",
7905
+ width: 20,
7906
+ height: 20,
7901
7907
  style: {
7902
- marginRight: "4px"
7908
+ marginRight: "7px"
7903
7909
  }
7904
7910
  }), /*#__PURE__*/React.createElement("p", null, "Find and Replace")));
7905
7911
  }
@@ -7922,10 +7928,11 @@ var ContextMenu = function ContextMenu() {
7922
7928
  className: "context-item"
7923
7929
  }, /*#__PURE__*/React.createElement(SVGIcon, {
7924
7930
  name: "copy-flv",
7925
- width: 22,
7926
- height: 22,
7931
+ width: 21,
7932
+ height: 21,
7927
7933
  style: {
7928
- marginTop: "4px"
7934
+ marginTop: "4px",
7935
+ marginRight: "4px"
7929
7936
  }
7930
7937
  }), /*#__PURE__*/React.createElement("p", null, rightclick.copy)));
7931
7938
  }
@@ -7961,8 +7968,8 @@ var ContextMenu = function ContextMenu() {
7961
7968
  className: "context-item"
7962
7969
  }, /*#__PURE__*/React.createElement(SVGIcon, {
7963
7970
  name: "cut-flv",
7964
- width: 18,
7965
- height: 18,
7971
+ width: 17,
7972
+ height: 17,
7966
7973
  style: {
7967
7974
  marginRight: "8px"
7968
7975
  }
@@ -7999,8 +8006,8 @@ var ContextMenu = function ContextMenu() {
7999
8006
  className: "context-item"
8000
8007
  }, /*#__PURE__*/React.createElement(SVGIcon, {
8001
8008
  name: "paste-flv",
8002
- width: 16,
8003
- height: 16,
8009
+ width: 17,
8010
+ height: 17,
8004
8011
  style: {
8005
8012
  marginRight: "8px"
8006
8013
  }
@@ -8452,8 +8459,8 @@ var ContextMenu = function ContextMenu() {
8452
8459
  className: "context-item"
8453
8460
  }, /*#__PURE__*/React.createElement(SVGIcon, {
8454
8461
  name: "clear-flv",
8455
- width: 18,
8456
- height: 18,
8462
+ width: 17,
8463
+ height: 17,
8457
8464
  style: {
8458
8465
  marginRight: "8px"
8459
8466
  }
@@ -8614,7 +8621,8 @@ var ContextMenu = function ContextMenu() {
8614
8621
  }
8615
8622
  }, /*#__PURE__*/React.createElement(SVGIcon, {
8616
8623
  name: "filter",
8617
- width: 24,
8624
+ width: 22,
8625
+ height: 22,
8618
8626
  style: {
8619
8627
  marginRight: "4px"
8620
8628
  }
@@ -8632,7 +8640,7 @@ var ContextMenu = function ContextMenu() {
8632
8640
  }
8633
8641
  }, /*#__PURE__*/React.createElement(SVGIcon, {
8634
8642
  name: "eraser",
8635
- width: 24,
8643
+ width: 22,
8636
8644
  height: 22,
8637
8645
  style: {
8638
8646
  marginRight: "4px",
@@ -8647,9 +8655,11 @@ var ContextMenu = function ContextMenu() {
8647
8655
  className: "context-item"
8648
8656
  }, /*#__PURE__*/React.createElement(SVGIcon, {
8649
8657
  name: "filter",
8650
- width: 24,
8658
+ width: 22,
8659
+ height: 22,
8651
8660
  style: {
8652
- marginRight: "4px"
8661
+ marginRight: "4px",
8662
+ marginTop: "2px"
8653
8663
  }
8654
8664
  }), /*#__PURE__*/React.createElement("p", null, rightclick.filterSelection)), /*#__PURE__*/React.createElement(SVGIcon, {
8655
8665
  name: "rightArrow",
@@ -8680,8 +8690,10 @@ var ContextMenu = function ContextMenu() {
8680
8690
  className: "context-item"
8681
8691
  }, /*#__PURE__*/React.createElement(SVGIcon, {
8682
8692
  name: "link",
8693
+ width: 20,
8694
+ height: 20,
8683
8695
  style: {
8684
- marginRight: "4px"
8696
+ marginRight: "7px"
8685
8697
  }
8686
8698
  }), /*#__PURE__*/React.createElement("p", null, rightclick.link)));
8687
8699
  }
@@ -8717,7 +8729,10 @@ var ContextMenu = function ContextMenu() {
8717
8729
  }, /*#__PURE__*/React.createElement(SVGIcon, {
8718
8730
  name: "conditionFormat",
8719
8731
  width: 16,
8720
- height: 16
8732
+ height: 16,
8733
+ style: {
8734
+ marginRight: "2px"
8735
+ }
8721
8736
  }), /*#__PURE__*/React.createElement("p", null, rightclick.conditionFormat || "Conditional Format")), /*#__PURE__*/React.createElement(SVGIcon, {
8722
8737
  name: "rightArrow",
8723
8738
  width: 16,
package/dist/index.js CHANGED
@@ -352,7 +352,6 @@ var ColumnHeader = function ColumnHeader() {
352
352
  var _useContext = React.useContext(WorkbookContext),
353
353
  context = _useContext.context,
354
354
  setContext = _useContext.setContext,
355
- settings = _useContext.settings,
356
355
  refs = _useContext.refs;
357
356
  var containerRef = React.useRef(null);
358
357
  var colChangeSizeRef = React.useRef(null);
@@ -443,12 +442,6 @@ var ColumnHeader = function ColumnHeader() {
443
442
  });
444
443
  e.stopPropagation();
445
444
  }, [refs.cellArea, refs.globalCache, refs.workbookContainer, setContext]);
446
- var onContextMenu = React.useCallback(function (e) {
447
- var nativeEvent = e.nativeEvent;
448
- setContext(function (draftCtx) {
449
- fortuneCore.handleContextMenu(draftCtx, settings, nativeEvent, refs.workbookContainer.current, refs.cellArea.current, "columnHeader");
450
- });
451
- }, [refs.workbookContainer, setContext, settings, refs.cellArea]);
452
445
  React.useEffect(function () {
453
446
  var s = context.luckysheet_select_save;
454
447
  if (___default['default'].isNil(s)) return;
@@ -490,7 +483,16 @@ var ColumnHeader = function ColumnHeader() {
490
483
  onMouseMove: onMouseMove,
491
484
  onMouseDown: onMouseDown,
492
485
  onMouseLeave: onMouseLeave,
493
- onContextMenu: onContextMenu
486
+ onContextMenu: function onContextMenu(e) {
487
+ e.preventDefault();
488
+ setContext(function (ctx) {
489
+ ctx.contextMenu = {
490
+ x: e.pageX,
491
+ y: 90,
492
+ headerMenu: true
493
+ };
494
+ });
495
+ }
494
496
  }, /*#__PURE__*/React__default['default'].createElement("div", {
495
497
  className: "fortune-cols-freeze-handle",
496
498
  onMouseDown: onColFreezeHandleMouseDown,
@@ -7788,11 +7790,11 @@ var ContextMenu = function ContextMenu() {
7788
7790
  className: "context-item"
7789
7791
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
7790
7792
  name: "split-flv",
7791
- width: 16,
7792
- height: 16,
7793
+ width: 17,
7794
+ height: 17,
7793
7795
  style: {
7794
7796
  marginTop: "4px",
7795
- marginRight: "4px"
7797
+ marginRight: "8px"
7796
7798
  }
7797
7799
  }), "Split text to columns"));
7798
7800
  }
@@ -7872,7 +7874,7 @@ var ContextMenu = function ContextMenu() {
7872
7874
  height: 18,
7873
7875
  style: {
7874
7876
  marginTop: "4px",
7875
- marginRight: "4px"
7877
+ marginRight: "8px"
7876
7878
  }
7877
7879
  }), /*#__PURE__*/React__default['default'].createElement("p", null, "Comment")));
7878
7880
  }
@@ -7890,8 +7892,10 @@ var ContextMenu = function ContextMenu() {
7890
7892
  className: "context-item"
7891
7893
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
7892
7894
  name: "dataVerification",
7895
+ width: 20,
7896
+ height: 20,
7893
7897
  style: {
7894
- marginRight: "4px"
7898
+ marginRight: "7px"
7895
7899
  }
7896
7900
  }), /*#__PURE__*/React__default['default'].createElement("p", null, "Data Verification")));
7897
7901
  }
@@ -7910,8 +7914,10 @@ var ContextMenu = function ContextMenu() {
7910
7914
  className: "context-item"
7911
7915
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
7912
7916
  name: "search",
7917
+ width: 20,
7918
+ height: 20,
7913
7919
  style: {
7914
- marginRight: "4px"
7920
+ marginRight: "7px"
7915
7921
  }
7916
7922
  }), /*#__PURE__*/React__default['default'].createElement("p", null, "Find and Replace")));
7917
7923
  }
@@ -7934,10 +7940,11 @@ var ContextMenu = function ContextMenu() {
7934
7940
  className: "context-item"
7935
7941
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
7936
7942
  name: "copy-flv",
7937
- width: 22,
7938
- height: 22,
7943
+ width: 21,
7944
+ height: 21,
7939
7945
  style: {
7940
- marginTop: "4px"
7946
+ marginTop: "4px",
7947
+ marginRight: "4px"
7941
7948
  }
7942
7949
  }), /*#__PURE__*/React__default['default'].createElement("p", null, rightclick.copy)));
7943
7950
  }
@@ -7973,8 +7980,8 @@ var ContextMenu = function ContextMenu() {
7973
7980
  className: "context-item"
7974
7981
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
7975
7982
  name: "cut-flv",
7976
- width: 18,
7977
- height: 18,
7983
+ width: 17,
7984
+ height: 17,
7978
7985
  style: {
7979
7986
  marginRight: "8px"
7980
7987
  }
@@ -8011,8 +8018,8 @@ var ContextMenu = function ContextMenu() {
8011
8018
  className: "context-item"
8012
8019
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
8013
8020
  name: "paste-flv",
8014
- width: 16,
8015
- height: 16,
8021
+ width: 17,
8022
+ height: 17,
8016
8023
  style: {
8017
8024
  marginRight: "8px"
8018
8025
  }
@@ -8464,8 +8471,8 @@ var ContextMenu = function ContextMenu() {
8464
8471
  className: "context-item"
8465
8472
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
8466
8473
  name: "clear-flv",
8467
- width: 18,
8468
- height: 18,
8474
+ width: 17,
8475
+ height: 17,
8469
8476
  style: {
8470
8477
  marginRight: "8px"
8471
8478
  }
@@ -8626,7 +8633,8 @@ var ContextMenu = function ContextMenu() {
8626
8633
  }
8627
8634
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
8628
8635
  name: "filter",
8629
- width: 24,
8636
+ width: 22,
8637
+ height: 22,
8630
8638
  style: {
8631
8639
  marginRight: "4px"
8632
8640
  }
@@ -8644,7 +8652,7 @@ var ContextMenu = function ContextMenu() {
8644
8652
  }
8645
8653
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
8646
8654
  name: "eraser",
8647
- width: 24,
8655
+ width: 22,
8648
8656
  height: 22,
8649
8657
  style: {
8650
8658
  marginRight: "4px",
@@ -8659,9 +8667,11 @@ var ContextMenu = function ContextMenu() {
8659
8667
  className: "context-item"
8660
8668
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
8661
8669
  name: "filter",
8662
- width: 24,
8670
+ width: 22,
8671
+ height: 22,
8663
8672
  style: {
8664
- marginRight: "4px"
8673
+ marginRight: "4px",
8674
+ marginTop: "2px"
8665
8675
  }
8666
8676
  }), /*#__PURE__*/React__default['default'].createElement("p", null, rightclick.filterSelection)), /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
8667
8677
  name: "rightArrow",
@@ -8692,8 +8702,10 @@ var ContextMenu = function ContextMenu() {
8692
8702
  className: "context-item"
8693
8703
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
8694
8704
  name: "link",
8705
+ width: 20,
8706
+ height: 20,
8695
8707
  style: {
8696
- marginRight: "4px"
8708
+ marginRight: "7px"
8697
8709
  }
8698
8710
  }), /*#__PURE__*/React__default['default'].createElement("p", null, rightclick.link)));
8699
8711
  }
@@ -8729,7 +8741,10 @@ var ContextMenu = function ContextMenu() {
8729
8741
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
8730
8742
  name: "conditionFormat",
8731
8743
  width: 16,
8732
- height: 16
8744
+ height: 16,
8745
+ style: {
8746
+ marginRight: "2px"
8747
+ }
8733
8748
  }), /*#__PURE__*/React__default['default'].createElement("p", null, rightclick.conditionFormat || "Conditional Format")), /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
8734
8749
  name: "rightArrow",
8735
8750
  width: 16,