@fileverse-dev/fortune-react 1.0.26-patch-1 → 1.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 +3915 -0
- package/dist/index.esm.css +3915 -0
- package/dist/index.esm.js +12975 -0
- package/dist/index.js +12995 -0
- package/dist/index.umd.css +3915 -0
- package/dist/index.umd.js +122445 -0
- package/dist/index.umd.min.css +1 -0
- package/dist/index.umd.min.js +50 -0
- package/dist/packages/core/src/api/cell.d.ts +10 -0
- package/dist/packages/core/src/api/common.d.ts +66 -0
- package/dist/packages/core/src/api/errors.d.ts +2 -0
- package/dist/packages/core/src/api/index.d.ts +9 -0
- package/dist/packages/core/src/api/merge.d.ts +5 -0
- package/dist/packages/core/src/api/range.d.ts +22 -0
- package/dist/packages/core/src/api/rowcol.d.ts +14 -0
- package/dist/packages/core/src/api/sheet.d.ts +10 -0
- package/dist/packages/core/src/api/workbook.d.ts +15 -0
- package/dist/packages/core/src/canvas.d.ts +46 -0
- package/dist/packages/core/src/context.d.ts +197 -0
- package/dist/packages/core/src/events/copy.d.ts +2 -0
- package/dist/packages/core/src/events/index.d.ts +4 -0
- package/dist/packages/core/src/events/keyboard.d.ts +6 -0
- package/dist/packages/core/src/events/mouse.d.ts +22 -0
- package/dist/packages/core/src/events/paste.d.ts +3 -0
- package/dist/packages/core/src/index.d.ts +10 -0
- package/dist/packages/core/src/locale/en.d.ts +992 -0
- package/dist/packages/core/src/locale/es.d.ts +1134 -0
- package/dist/packages/core/src/locale/hi.d.ts +1030 -0
- package/dist/packages/core/src/locale/index.d.ts +1049 -0
- package/dist/packages/core/src/locale/zh.d.ts +1048 -0
- package/dist/packages/core/src/locale/zh_tw.d.ts +1187 -0
- package/dist/packages/core/src/modules/ConditionFormat.d.ts +17 -0
- package/dist/packages/core/src/modules/border.d.ts +3 -0
- package/dist/packages/core/src/modules/cell.d.ts +32 -0
- package/dist/packages/core/src/modules/clipboard.d.ts +3 -0
- package/dist/packages/core/src/modules/color.d.ts +1 -0
- package/dist/packages/core/src/modules/comment.d.ts +97 -0
- package/dist/packages/core/src/modules/conditionalFormat.d.ts +2 -0
- package/dist/packages/core/src/modules/cursor.d.ts +3 -0
- package/dist/packages/core/src/modules/dataVerification.d.ts +11 -0
- package/dist/packages/core/src/modules/dropCell.d.ts +10 -0
- package/dist/packages/core/src/modules/filter.d.ts +45 -0
- package/dist/packages/core/src/modules/format.d.ts +6 -0
- package/dist/packages/core/src/modules/formula.d.ts +54 -0
- package/dist/packages/core/src/modules/freeze.d.ts +5 -0
- package/dist/packages/core/src/modules/hyperlink.d.ts +21 -0
- package/dist/packages/core/src/modules/iframe.d.ts +12 -0
- package/dist/packages/core/src/modules/image.d.ts +31 -0
- package/dist/packages/core/src/modules/index.d.ts +36 -0
- package/dist/packages/core/src/modules/inline-string.d.ts +36 -0
- package/dist/packages/core/src/modules/location.d.ts +6 -0
- package/dist/packages/core/src/modules/locationCondition.d.ts +21 -0
- package/dist/packages/core/src/modules/merge.d.ts +3 -0
- package/dist/packages/core/src/modules/mobile.d.ts +5 -0
- package/dist/packages/core/src/modules/moveCells.d.ts +5 -0
- package/dist/packages/core/src/modules/protection.d.ts +5 -0
- package/dist/packages/core/src/modules/refresh.d.ts +3 -0
- package/dist/packages/core/src/modules/rowcol.d.ts +19 -0
- package/dist/packages/core/src/modules/screenshot.d.ts +2 -0
- package/dist/packages/core/src/modules/searchReplace.d.ts +36 -0
- package/dist/packages/core/src/modules/selection.d.ts +46 -0
- package/dist/packages/core/src/modules/sheet.d.ts +10 -0
- package/dist/packages/core/src/modules/sort.d.ts +7 -0
- package/dist/packages/core/src/modules/splitColumn.d.ts +5 -0
- package/dist/packages/core/src/modules/text.d.ts +10 -0
- package/dist/packages/core/src/modules/toolbar.d.ts +32 -0
- package/dist/packages/core/src/modules/validation.d.ts +19 -0
- package/dist/packages/core/src/modules/zoom.d.ts +3 -0
- package/dist/packages/core/src/settings.d.ts +100 -0
- package/dist/packages/core/src/types.d.ts +371 -0
- package/dist/packages/core/src/utils/freeze.d.ts +7 -0
- package/dist/packages/core/src/utils/index.d.ts +18 -0
- package/dist/packages/core/src/utils/patch.d.ts +37 -0
- package/{es → dist/packages/react/src}/components/ChangeColor/index.d.ts +7 -7
- package/{lib → dist/packages/react/src}/components/ConditionFormat/ConditionRules.d.ts +6 -6
- package/{es → dist/packages/react/src}/components/ConditionFormat/index.d.ts +7 -7
- package/{es → dist/packages/react/src}/components/ContextMenu/Divider.d.ts +3 -3
- package/{lib → dist/packages/react/src}/components/ContextMenu/FilterMenu.d.ts +3 -3
- package/{es → dist/packages/react/src}/components/ContextMenu/Menu.d.ts +8 -8
- package/{lib → dist/packages/react/src}/components/ContextMenu/SheetTab.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/ContextMenu/index.d.ts +5 -5
- package/{lib → dist/packages/react/src}/components/CustomSort/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/DataVerification/DropdownList.d.ts +4 -4
- package/{lib → dist/packages/react/src}/components/DataVerification/RangeDialog.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/DataVerification/getDisplayedRangeTxt.d.ts +2 -2
- package/{lib → dist/packages/react/src}/components/DataVerification/index.d.ts +4 -4
- package/{lib → dist/packages/react/src}/components/Dialog/index.d.ts +15 -15
- package/{lib → dist/packages/react/src}/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +11 -11
- package/{lib → dist/packages/react/src}/components/DunePreview/DunePreview.d.ts +13 -13
- package/{es → dist/packages/react/src}/components/FilterOption/index.d.ts +5 -5
- package/{es → dist/packages/react/src}/components/FormatSearch/index.d.ts +6 -6
- package/{lib → dist/packages/react/src}/components/FormulaSearch/index.d.ts +5 -5
- package/{lib → dist/packages/react/src}/components/FxEditor/NameBox.d.ts +3 -3
- package/{es → dist/packages/react/src}/components/FxEditor/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/IFrameBoxs/iFrameBoxs.d.ts +4 -4
- package/{lib → dist/packages/react/src}/components/ImgBoxs/index.d.ts +3 -3
- package/{es → dist/packages/react/src}/components/LinkEidtCard/index.d.ts +5 -5
- package/{lib → dist/packages/react/src}/components/LocationCondition/index.d.ts +3 -3
- package/{lib → dist/packages/react/src}/components/MessageBox/index.d.ts +9 -9
- package/{es → dist/packages/react/src}/components/NotationBoxes/index.d.ts +3 -3
- package/{lib → dist/packages/react/src}/components/ResetColumnWidth/index.d.ts +2 -2
- package/{es → dist/packages/react/src}/components/SVGDefines.d.ts +5 -5
- package/{es → dist/packages/react/src}/components/SVGIcon.d.ts +9 -9
- package/{lib → dist/packages/react/src}/components/SearchReplace/index.d.ts +6 -6
- package/{es → dist/packages/react/src}/components/Sheet/index.d.ts +8 -8
- package/{es → dist/packages/react/src}/components/SheetList/SheetHiddenButton.d.ts +8 -8
- package/{lib → dist/packages/react/src}/components/SheetList/SheetListItem.d.ts +9 -9
- package/{lib → dist/packages/react/src}/components/SheetList/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/SheetOverlay/ColumnHeader.d.ts +3 -3
- package/{es → dist/packages/react/src}/components/SheetOverlay/ContentEditable.d.ts +11 -11
- package/{es → dist/packages/react/src}/components/SheetOverlay/FormulaHint/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/SheetOverlay/FormulaSearch/constant.d.ts +63 -63
- package/{es → dist/packages/react/src}/components/SheetOverlay/FormulaSearch/index.d.ts +4 -4
- package/{lib → dist/packages/react/src}/components/SheetOverlay/InputBox.d.ts +3 -3
- package/{es → dist/packages/react/src}/components/SheetOverlay/RowHeader.d.ts +3 -3
- package/{es → dist/packages/react/src}/components/SheetOverlay/ScrollBar/index.d.ts +7 -7
- package/{es → dist/packages/react/src}/components/SheetOverlay/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/SheetTab/SheetItem.d.ts +8 -8
- package/{lib → dist/packages/react/src}/components/SheetTab/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/SplitColumn/index.d.ts +3 -3
- package/{lib → dist/packages/react/src}/components/Toolbar/Button.d.ts +12 -12
- package/{es → dist/packages/react/src}/components/Toolbar/ColorPicker.d.ts +6 -6
- package/{es → dist/packages/react/src}/components/Toolbar/Combo.d.ts +12 -12
- package/{es → dist/packages/react/src}/components/Toolbar/CustomBorder.d.ts +7 -7
- package/{lib → dist/packages/react/src}/components/Toolbar/CustomButton.d.ts +11 -11
- package/{es → dist/packages/react/src}/components/Toolbar/CustomColor.d.ts +8 -8
- package/{lib → dist/packages/react/src}/components/Toolbar/CustomIcon.d.ts +9 -9
- package/{es → dist/packages/react/src}/components/Toolbar/Divider.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/Toolbar/MoreItemsContainer.d.ts +6 -6
- package/{lib → dist/packages/react/src}/components/Toolbar/Select.d.ts +14 -14
- package/dist/packages/react/src/components/Toolbar/index.d.ts +10 -0
- package/{es → dist/packages/react/src}/components/Workbook/api.d.ts +1177 -1183
- package/{lib → dist/packages/react/src}/components/Workbook/index.d.ts +1185 -1191
- package/{es → dist/packages/react/src}/components/ZoomControl/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/constants.d.ts +1 -1
- package/{es → dist/packages/react/src}/context/index.d.ts +25 -25
- package/{es → dist/packages/react/src}/context/modal.d.ts +10 -10
- package/{es → dist/packages/react/src}/hooks/useAlert.d.ts +4 -4
- package/{es → dist/packages/react/src}/hooks/useDialog.d.ts +5 -5
- package/{es → dist/packages/react/src}/hooks/useOutsideClick.d.ts +2 -2
- package/{es → dist/packages/react/src}/hooks/usePrevious.d.ts +2 -2
- package/{es → dist/packages/react/src}/index.d.ts +1 -1
- package/{es → dist/packages/react/src}/utils/datepickerStyles.d.ts +2 -2
- package/{es/components/Workbook/index.d.ts → dist/stories/API.stories.d.ts} +1210 -1191
- package/dist/stories/Collabration.stories.d.ts +2359 -0
- package/dist/stories/Features.stories.d.ts +9430 -0
- package/dist/stories/data/cell.d.ts +983 -0
- package/dist/stories/data/dataVerification.d.ts +131 -0
- package/dist/stories/data/empty.d.ts +10 -0
- package/dist/stories/data/formula.d.ts +362 -0
- package/dist/stories/data/freeze.d.ts +34 -0
- package/dist/stories/data/protected.d.ts +40 -0
- package/dist/stories/utils.d.ts +1 -0
- package/package.json +6 -7
- package/es/components/ChangeColor/index.css +0 -76
- package/es/components/ChangeColor/index.js +0 -41
- package/es/components/ConditionFormat/ConditionRules.d.ts +0 -6
- package/es/components/ConditionFormat/ConditionRules.js +0 -323
- package/es/components/ConditionFormat/index.css +0 -210
- package/es/components/ConditionFormat/index.js +0 -252
- package/es/components/ContextMenu/Divider.js +0 -7
- package/es/components/ContextMenu/FilterMenu.d.ts +0 -3
- package/es/components/ContextMenu/FilterMenu.js +0 -612
- package/es/components/ContextMenu/Menu.js +0 -25
- package/es/components/ContextMenu/SheetTab.d.ts +0 -4
- package/es/components/ContextMenu/SheetTab.js +0 -223
- package/es/components/ContextMenu/index.css +0 -322
- package/es/components/ContextMenu/index.js +0 -1054
- package/es/components/CustomSort/index.css +0 -23
- package/es/components/CustomSort/index.d.ts +0 -4
- package/es/components/CustomSort/index.js +0 -113
- package/es/components/DataVerification/DropdownList.js +0 -126
- package/es/components/DataVerification/RangeDialog.d.ts +0 -4
- package/es/components/DataVerification/RangeDialog.js +0 -105
- package/es/components/DataVerification/getDisplayedRangeTxt.js +0 -9
- package/es/components/DataVerification/index.css +0 -202
- package/es/components/DataVerification/index.d.ts +0 -4
- package/es/components/DataVerification/index.js +0 -398
- package/es/components/Dialog/index.css +0 -64
- package/es/components/Dialog/index.d.ts +0 -15
- package/es/components/Dialog/index.js +0 -72
- package/es/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +0 -11
- package/es/components/DuneChartsInputModal/DuneChartsInputModal.js +0 -95
- package/es/components/DuneChartsInputModal/duneChartsInputModal.css +0 -98
- package/es/components/DunePreview/DunePreview.d.ts +0 -13
- package/es/components/DunePreview/DunePreview.js +0 -46
- package/es/components/DunePreview/index.css +0 -57
- package/es/components/FilterOption/index.js +0 -121
- package/es/components/FormatSearch/index.css +0 -19
- package/es/components/FormatSearch/index.js +0 -129
- package/es/components/FormulaSearch/index.css +0 -65
- package/es/components/FormulaSearch/index.d.ts +0 -5
- package/es/components/FormulaSearch/index.js +0 -198
- package/es/components/FxEditor/NameBox.d.ts +0 -3
- package/es/components/FxEditor/NameBox.js +0 -29
- package/es/components/FxEditor/index.css +0 -72
- package/es/components/FxEditor/index.js +0 -167
- package/es/components/IFrameBoxs/iFrameBoxs.css +0 -16
- package/es/components/IFrameBoxs/iFrameBoxs.js +0 -142
- package/es/components/ImgBoxs/index.d.ts +0 -3
- package/es/components/ImgBoxs/index.js +0 -219
- package/es/components/LinkEidtCard/index.css +0 -255
- package/es/components/LinkEidtCard/index.js +0 -238
- package/es/components/LocationCondition/index.css +0 -74
- package/es/components/LocationCondition/index.d.ts +0 -3
- package/es/components/LocationCondition/index.js +0 -195
- package/es/components/MessageBox/index.d.ts +0 -9
- package/es/components/MessageBox/index.js +0 -16
- package/es/components/NotationBoxes/index.js +0 -105
- package/es/components/ResetColumnWidth/index.d.ts +0 -2
- package/es/components/ResetColumnWidth/index.js +0 -130
- package/es/components/SVGDefines.js +0 -1902
- package/es/components/SVGIcon.js +0 -18
- package/es/components/SearchReplace/index.css +0 -191
- package/es/components/SearchReplace/index.d.ts +0 -6
- package/es/components/SearchReplace/index.js +0 -294
- package/es/components/Sheet/index.css +0 -27
- package/es/components/Sheet/index.js +0 -175
- package/es/components/SheetList/SheetHiddenButton.js +0 -35
- package/es/components/SheetList/SheetListItem.d.ts +0 -9
- package/es/components/SheetList/SheetListItem.js +0 -72
- package/es/components/SheetList/index.css +0 -48
- package/es/components/SheetList/index.d.ts +0 -4
- package/es/components/SheetList/index.js +0 -30
- package/es/components/SheetOverlay/ColumnHeader.js +0 -217
- package/es/components/SheetOverlay/ContentEditable.js +0 -74
- package/es/components/SheetOverlay/FormulaHint/index.css +0 -180
- package/es/components/SheetOverlay/FormulaHint/index.js +0 -348
- package/es/components/SheetOverlay/FormulaSearch/constant.js +0 -328
- package/es/components/SheetOverlay/FormulaSearch/index.css +0 -44
- package/es/components/SheetOverlay/FormulaSearch/index.js +0 -261
- package/es/components/SheetOverlay/InputBox.d.ts +0 -3
- package/es/components/SheetOverlay/InputBox.js +0 -394
- package/es/components/SheetOverlay/RowHeader.js +0 -187
- package/es/components/SheetOverlay/ScrollBar/index.css +0 -40
- package/es/components/SheetOverlay/ScrollBar/index.js +0 -47
- package/es/components/SheetOverlay/index.css +0 -954
- package/es/components/SheetOverlay/index.js +0 -578
- package/es/components/SheetTab/SheetItem.js +0 -230
- package/es/components/SheetTab/index.css +0 -280
- package/es/components/SheetTab/index.d.ts +0 -4
- package/es/components/SheetTab/index.js +0 -143
- package/es/components/SplitColumn/index.css +0 -121
- package/es/components/SplitColumn/index.js +0 -167
- package/es/components/Toolbar/Button.d.ts +0 -12
- package/es/components/Toolbar/Button.js +0 -32
- package/es/components/Toolbar/ColorPicker.js +0 -27
- package/es/components/Toolbar/Combo.js +0 -102
- package/es/components/Toolbar/CustomBorder.js +0 -211
- package/es/components/Toolbar/CustomButton.d.ts +0 -11
- package/es/components/Toolbar/CustomButton.js +0 -29
- package/es/components/Toolbar/CustomColor.js +0 -25
- package/es/components/Toolbar/CustomIcon.d.ts +0 -9
- package/es/components/Toolbar/CustomIcon.js +0 -38
- package/es/components/Toolbar/Divider.js +0 -12
- package/es/components/Toolbar/MoreItemsContainer.js +0 -17
- package/es/components/Toolbar/Select.d.ts +0 -14
- package/es/components/Toolbar/Select.js +0 -34
- package/es/components/Toolbar/index.css +0 -405
- package/es/components/Toolbar/index.d.ts +0 -10
- package/es/components/Toolbar/index.js +0 -1338
- package/es/components/Workbook/api.js +0 -398
- package/es/components/Workbook/index.css +0 -44
- package/es/components/Workbook/index.js +0 -588
- package/es/components/ZoomControl/index.css +0 -54
- package/es/components/ZoomControl/index.js +0 -111
- package/es/components/index.js +0 -3
- package/es/constants.js +0 -4
- package/es/context/index.js +0 -34
- package/es/context/modal.js +0 -43
- package/es/hooks/useAlert.js +0 -28
- package/es/hooks/useDialog.js +0 -28
- package/es/hooks/useOutsideClick.js +0 -15
- package/es/hooks/usePrevious.js +0 -9
- package/es/index.css +0 -27
- package/es/index.js +0 -1
- package/es/utils/datepickerStyles.js +0 -8
- package/lib/components/ChangeColor/index.css +0 -76
- package/lib/components/ChangeColor/index.d.ts +0 -7
- package/lib/components/ChangeColor/index.js +0 -50
- package/lib/components/ConditionFormat/ConditionRules.js +0 -332
- package/lib/components/ConditionFormat/index.css +0 -210
- package/lib/components/ConditionFormat/index.d.ts +0 -7
- package/lib/components/ConditionFormat/index.js +0 -261
- package/lib/components/ContextMenu/Divider.d.ts +0 -3
- package/lib/components/ContextMenu/Divider.js +0 -14
- package/lib/components/ContextMenu/FilterMenu.js +0 -621
- package/lib/components/ContextMenu/Menu.d.ts +0 -8
- package/lib/components/ContextMenu/Menu.js +0 -33
- package/lib/components/ContextMenu/SheetTab.js +0 -232
- package/lib/components/ContextMenu/index.css +0 -322
- package/lib/components/ContextMenu/index.d.ts +0 -5
- package/lib/components/ContextMenu/index.js +0 -1063
- package/lib/components/CustomSort/index.css +0 -23
- package/lib/components/CustomSort/index.js +0 -122
- package/lib/components/DataVerification/DropdownList.d.ts +0 -4
- package/lib/components/DataVerification/DropdownList.js +0 -135
- package/lib/components/DataVerification/RangeDialog.js +0 -114
- package/lib/components/DataVerification/getDisplayedRangeTxt.d.ts +0 -2
- package/lib/components/DataVerification/getDisplayedRangeTxt.js +0 -15
- package/lib/components/DataVerification/index.css +0 -202
- package/lib/components/DataVerification/index.js +0 -407
- package/lib/components/Dialog/index.css +0 -64
- package/lib/components/Dialog/index.js +0 -81
- package/lib/components/DuneChartsInputModal/DuneChartsInputModal.js +0 -104
- package/lib/components/DuneChartsInputModal/duneChartsInputModal.css +0 -98
- package/lib/components/DunePreview/DunePreview.js +0 -53
- package/lib/components/DunePreview/index.css +0 -57
- package/lib/components/FilterOption/index.d.ts +0 -5
- package/lib/components/FilterOption/index.js +0 -130
- package/lib/components/FormatSearch/index.css +0 -19
- package/lib/components/FormatSearch/index.d.ts +0 -6
- package/lib/components/FormatSearch/index.js +0 -138
- package/lib/components/FormulaSearch/index.css +0 -65
- package/lib/components/FormulaSearch/index.js +0 -207
- package/lib/components/FxEditor/NameBox.js +0 -38
- package/lib/components/FxEditor/index.css +0 -72
- package/lib/components/FxEditor/index.d.ts +0 -4
- package/lib/components/FxEditor/index.js +0 -176
- package/lib/components/IFrameBoxs/iFrameBoxs.css +0 -16
- package/lib/components/IFrameBoxs/iFrameBoxs.d.ts +0 -4
- package/lib/components/IFrameBoxs/iFrameBoxs.js +0 -151
- package/lib/components/ImgBoxs/index.js +0 -228
- package/lib/components/LinkEidtCard/index.css +0 -255
- package/lib/components/LinkEidtCard/index.d.ts +0 -5
- package/lib/components/LinkEidtCard/index.js +0 -247
- package/lib/components/LocationCondition/index.css +0 -74
- package/lib/components/LocationCondition/index.js +0 -204
- package/lib/components/MessageBox/index.js +0 -23
- package/lib/components/NotationBoxes/index.d.ts +0 -3
- package/lib/components/NotationBoxes/index.js +0 -114
- package/lib/components/ResetColumnWidth/index.js +0 -138
- package/lib/components/SVGDefines.d.ts +0 -5
- package/lib/components/SVGDefines.js +0 -1909
- package/lib/components/SVGIcon.d.ts +0 -9
- package/lib/components/SVGIcon.js +0 -25
- package/lib/components/SearchReplace/index.css +0 -191
- package/lib/components/SearchReplace/index.js +0 -303
- package/lib/components/Sheet/index.css +0 -27
- package/lib/components/Sheet/index.d.ts +0 -8
- package/lib/components/Sheet/index.js +0 -184
- package/lib/components/SheetList/SheetHiddenButton.d.ts +0 -8
- package/lib/components/SheetList/SheetHiddenButton.js +0 -44
- package/lib/components/SheetList/SheetListItem.js +0 -81
- package/lib/components/SheetList/index.css +0 -48
- package/lib/components/SheetList/index.js +0 -39
- package/lib/components/SheetOverlay/ColumnHeader.d.ts +0 -3
- package/lib/components/SheetOverlay/ColumnHeader.js +0 -226
- package/lib/components/SheetOverlay/ContentEditable.d.ts +0 -11
- package/lib/components/SheetOverlay/ContentEditable.js +0 -83
- package/lib/components/SheetOverlay/FormulaHint/index.css +0 -180
- package/lib/components/SheetOverlay/FormulaHint/index.d.ts +0 -4
- package/lib/components/SheetOverlay/FormulaHint/index.js +0 -357
- package/lib/components/SheetOverlay/FormulaSearch/constant.d.ts +0 -63
- package/lib/components/SheetOverlay/FormulaSearch/constant.js +0 -334
- package/lib/components/SheetOverlay/FormulaSearch/index.css +0 -44
- package/lib/components/SheetOverlay/FormulaSearch/index.d.ts +0 -4
- package/lib/components/SheetOverlay/FormulaSearch/index.js +0 -270
- package/lib/components/SheetOverlay/InputBox.js +0 -403
- package/lib/components/SheetOverlay/RowHeader.d.ts +0 -3
- package/lib/components/SheetOverlay/RowHeader.js +0 -196
- package/lib/components/SheetOverlay/ScrollBar/index.css +0 -40
- package/lib/components/SheetOverlay/ScrollBar/index.d.ts +0 -7
- package/lib/components/SheetOverlay/ScrollBar/index.js +0 -56
- package/lib/components/SheetOverlay/index.css +0 -954
- package/lib/components/SheetOverlay/index.d.ts +0 -4
- package/lib/components/SheetOverlay/index.js +0 -587
- package/lib/components/SheetTab/SheetItem.d.ts +0 -8
- package/lib/components/SheetTab/SheetItem.js +0 -239
- package/lib/components/SheetTab/index.css +0 -280
- package/lib/components/SheetTab/index.js +0 -152
- package/lib/components/SplitColumn/index.css +0 -121
- package/lib/components/SplitColumn/index.d.ts +0 -3
- package/lib/components/SplitColumn/index.js +0 -176
- package/lib/components/Toolbar/Button.js +0 -39
- package/lib/components/Toolbar/ColorPicker.d.ts +0 -6
- package/lib/components/Toolbar/ColorPicker.js +0 -34
- package/lib/components/Toolbar/Combo.d.ts +0 -12
- package/lib/components/Toolbar/Combo.js +0 -111
- package/lib/components/Toolbar/CustomBorder.d.ts +0 -7
- package/lib/components/Toolbar/CustomBorder.js +0 -220
- package/lib/components/Toolbar/CustomButton.js +0 -36
- package/lib/components/Toolbar/CustomColor.d.ts +0 -8
- package/lib/components/Toolbar/CustomColor.js +0 -32
- package/lib/components/Toolbar/CustomIcon.js +0 -46
- package/lib/components/Toolbar/Divider.d.ts +0 -4
- package/lib/components/Toolbar/Divider.js +0 -19
- package/lib/components/Toolbar/MoreItemsContainer.d.ts +0 -6
- package/lib/components/Toolbar/MoreItemsContainer.js +0 -25
- package/lib/components/Toolbar/Select.js +0 -40
- package/lib/components/Toolbar/index.css +0 -405
- package/lib/components/Toolbar/index.d.ts +0 -10
- package/lib/components/Toolbar/index.js +0 -1347
- package/lib/components/Workbook/api.d.ts +0 -1183
- package/lib/components/Workbook/api.js +0 -405
- package/lib/components/Workbook/index.css +0 -44
- package/lib/components/Workbook/index.js +0 -597
- package/lib/components/ZoomControl/index.css +0 -54
- package/lib/components/ZoomControl/index.d.ts +0 -4
- package/lib/components/ZoomControl/index.js +0 -120
- package/lib/components/index.d.ts +0 -4
- package/lib/components/index.js +0 -28
- package/lib/constants.d.ts +0 -1
- package/lib/constants.js +0 -10
- package/lib/context/index.d.ts +0 -25
- package/lib/context/index.js +0 -41
- package/lib/context/modal.d.ts +0 -10
- package/lib/context/modal.js +0 -50
- package/lib/hooks/useAlert.d.ts +0 -4
- package/lib/hooks/useAlert.js +0 -37
- package/lib/hooks/useDialog.d.ts +0 -5
- package/lib/hooks/useDialog.js +0 -37
- package/lib/hooks/useOutsideClick.d.ts +0 -2
- package/lib/hooks/useOutsideClick.js +0 -21
- package/lib/hooks/usePrevious.d.ts +0 -2
- package/lib/hooks/usePrevious.js +0 -15
- package/lib/index.css +0 -27
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -16
- package/lib/utils/datepickerStyles.d.ts +0 -2
- package/lib/utils/datepickerStyles.js +0 -14
|
@@ -1,1054 +0,0 @@
|
|
|
1
|
-
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) {
|
|
3
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
4
|
-
resolve(value);
|
|
5
|
-
});
|
|
6
|
-
}
|
|
7
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
-
function fulfilled(value) {
|
|
9
|
-
try {
|
|
10
|
-
step(generator.next(value));
|
|
11
|
-
} catch (e) {
|
|
12
|
-
reject(e);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function rejected(value) {
|
|
16
|
-
try {
|
|
17
|
-
step(generator["throw"](value));
|
|
18
|
-
} catch (e) {
|
|
19
|
-
reject(e);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function step(result) {
|
|
23
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
24
|
-
}
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
var __generator = this && this.__generator || function (thisArg, body) {
|
|
29
|
-
var _ = {
|
|
30
|
-
label: 0,
|
|
31
|
-
sent: function sent() {
|
|
32
|
-
if (t[0] & 1) throw t[1];
|
|
33
|
-
return t[1];
|
|
34
|
-
},
|
|
35
|
-
trys: [],
|
|
36
|
-
ops: []
|
|
37
|
-
},
|
|
38
|
-
f,
|
|
39
|
-
y,
|
|
40
|
-
t,
|
|
41
|
-
g;
|
|
42
|
-
return g = {
|
|
43
|
-
next: verb(0),
|
|
44
|
-
"throw": verb(1),
|
|
45
|
-
"return": verb(2)
|
|
46
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
47
|
-
return this;
|
|
48
|
-
}), g;
|
|
49
|
-
function verb(n) {
|
|
50
|
-
return function (v) {
|
|
51
|
-
return step([n, v]);
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function step(op) {
|
|
55
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
|
-
switch (op[0]) {
|
|
60
|
-
case 0:
|
|
61
|
-
case 1:
|
|
62
|
-
t = op;
|
|
63
|
-
break;
|
|
64
|
-
case 4:
|
|
65
|
-
_.label++;
|
|
66
|
-
return {
|
|
67
|
-
value: op[1],
|
|
68
|
-
done: false
|
|
69
|
-
};
|
|
70
|
-
case 5:
|
|
71
|
-
_.label++;
|
|
72
|
-
y = op[1];
|
|
73
|
-
op = [0];
|
|
74
|
-
continue;
|
|
75
|
-
case 7:
|
|
76
|
-
op = _.ops.pop();
|
|
77
|
-
_.trys.pop();
|
|
78
|
-
continue;
|
|
79
|
-
default:
|
|
80
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
81
|
-
_ = 0;
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
85
|
-
_.label = op[1];
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
89
|
-
_.label = t[1];
|
|
90
|
-
t = op;
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
if (t && _.label < t[2]) {
|
|
94
|
-
_.label = t[2];
|
|
95
|
-
_.ops.push(op);
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
if (t[2]) _.ops.pop();
|
|
99
|
-
_.trys.pop();
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
op = body.call(thisArg, _);
|
|
103
|
-
} catch (e) {
|
|
104
|
-
op = [6, e];
|
|
105
|
-
y = 0;
|
|
106
|
-
} finally {
|
|
107
|
-
f = t = 0;
|
|
108
|
-
}
|
|
109
|
-
if (op[0] & 5) throw op[1];
|
|
110
|
-
return {
|
|
111
|
-
value: op[0] ? op[1] : void 0,
|
|
112
|
-
done: true
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
import { locale, handleCopy, handlePasteByClick, deleteRowCol, insertRowCol, removeActiveImage, deleteSelectedCellText, sortSelection, createFilter, showImgChooser, handleLink, hideSelected, showSelected, getSheetIndex, api, isAllowEdit, jfrefreshgrid, newComment, getFreezeState, toggleFreeze, clearFilter } from "@fileverse-dev/fortune-core";
|
|
117
|
-
import _ from "lodash";
|
|
118
|
-
import React, { useContext, useRef, useCallback, useLayoutEffect } from "react";
|
|
119
|
-
import regeneratorRuntime from "regenerator-runtime";
|
|
120
|
-
import Tippy from "@tippyjs/react";
|
|
121
|
-
import { LucideIcon } from "@fileverse/ui";
|
|
122
|
-
import { SplitColumn } from "../SplitColumn";
|
|
123
|
-
import { ResetColumnWidth } from "../ResetColumnWidth";
|
|
124
|
-
import DataVerification from "../DataVerification";
|
|
125
|
-
import WorkbookContext from "../../context";
|
|
126
|
-
import { useAlert } from "../../hooks/useAlert";
|
|
127
|
-
import { useDialog } from "../../hooks/useDialog";
|
|
128
|
-
import Divider from "./Divider";
|
|
129
|
-
import "./index.css";
|
|
130
|
-
import Menu from "./Menu";
|
|
131
|
-
import "tippy.js/dist/tippy.css";
|
|
132
|
-
import ConditionalFormat from "../ConditionFormat";
|
|
133
|
-
import SVGIcon from "../SVGIcon";
|
|
134
|
-
var ContextMenu = function ContextMenu() {
|
|
135
|
-
var showDialog = useDialog().showDialog;
|
|
136
|
-
var containerRef = useRef(null);
|
|
137
|
-
var _a = useContext(WorkbookContext),
|
|
138
|
-
context = _a.context,
|
|
139
|
-
setContext = _a.setContext,
|
|
140
|
-
settings = _a.settings,
|
|
141
|
-
refs = _a.refs;
|
|
142
|
-
var contextMenu = context.contextMenu;
|
|
143
|
-
var showAlert = useAlert().showAlert;
|
|
144
|
-
var _b = locale(context),
|
|
145
|
-
rightclick = _b.rightclick,
|
|
146
|
-
drag = _b.drag,
|
|
147
|
-
generalDialog = _b.generalDialog,
|
|
148
|
-
info = _b.info,
|
|
149
|
-
toolbar = _b.toolbar,
|
|
150
|
-
splitText = _b.splitText;
|
|
151
|
-
var getMenuElement = useCallback(function (name, i) {
|
|
152
|
-
var _a, _b, _c, _d;
|
|
153
|
-
var selection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
|
|
154
|
-
if (name === "|") {
|
|
155
|
-
return /*#__PURE__*/React.createElement(Divider, {
|
|
156
|
-
key: "divider-".concat(i)
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
if (name === "split-text") {
|
|
160
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
161
|
-
key: "split-text",
|
|
162
|
-
onClick: function onClick() {
|
|
163
|
-
if (context.allowEdit === false) return;
|
|
164
|
-
if (_.isUndefined(context.luckysheet_select_save)) {
|
|
165
|
-
showDialog(splitText.tipNoSelect, "ok");
|
|
166
|
-
} else {
|
|
167
|
-
var currentColumn = context.luckysheet_select_save[context.luckysheet_select_save.length - 1].column;
|
|
168
|
-
if (context.luckysheet_select_save.length > 1) {
|
|
169
|
-
showDialog(splitText.tipNoMulti, "ok");
|
|
170
|
-
} else if (currentColumn[0] !== currentColumn[1]) {
|
|
171
|
-
showDialog(splitText.tipNoMultiColumn, "ok");
|
|
172
|
-
} else {
|
|
173
|
-
showDialog(/*#__PURE__*/React.createElement(SplitColumn, null), undefined, "Split text to columns");
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
setContext(function (draftCtx) {
|
|
177
|
-
draftCtx.contextMenu = {};
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
181
|
-
className: "context-item"
|
|
182
|
-
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
183
|
-
name: "split-flv",
|
|
184
|
-
width: 18,
|
|
185
|
-
height: 18
|
|
186
|
-
}), "Split text to columns"));
|
|
187
|
-
}
|
|
188
|
-
if (name === "freeze-row") {
|
|
189
|
-
var freezeState = getFreezeState(context);
|
|
190
|
-
var isFrozen_1 = freezeState.isRowFrozen;
|
|
191
|
-
var isEntireRowSelected = (selection === null || selection === void 0 ? void 0 : selection.row_select) === true;
|
|
192
|
-
if (!isEntireRowSelected) return null;
|
|
193
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
194
|
-
key: "freeze-row",
|
|
195
|
-
onClick: function onClick() {
|
|
196
|
-
setContext(function (draftCtx) {
|
|
197
|
-
if (isFrozen_1) {
|
|
198
|
-
toggleFreeze(draftCtx, "unfreeze-row");
|
|
199
|
-
} else {
|
|
200
|
-
toggleFreeze(draftCtx, "row");
|
|
201
|
-
}
|
|
202
|
-
draftCtx.contextMenu = {};
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
206
|
-
className: "context-item"
|
|
207
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
208
|
-
name: "Snowflake"
|
|
209
|
-
}), /*#__PURE__*/React.createElement("p", null, isFrozen_1 ? "Unfreeze row" : "Freeze upto current row")));
|
|
210
|
-
}
|
|
211
|
-
if (name === "freeze-column") {
|
|
212
|
-
var freezeState = getFreezeState(context);
|
|
213
|
-
var isFrozen_2 = freezeState.isColFrozen;
|
|
214
|
-
var isEntireColumnSelected = (selection === null || selection === void 0 ? void 0 : selection.column_select) === true;
|
|
215
|
-
if (!isEntireColumnSelected) return null;
|
|
216
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
217
|
-
key: "freeze-column",
|
|
218
|
-
onClick: function onClick() {
|
|
219
|
-
setContext(function (draftCtx) {
|
|
220
|
-
if (isFrozen_2) {
|
|
221
|
-
toggleFreeze(draftCtx, "unfreeze-column");
|
|
222
|
-
} else {
|
|
223
|
-
toggleFreeze(draftCtx, "column");
|
|
224
|
-
jfrefreshgrid(draftCtx, null, undefined, false);
|
|
225
|
-
}
|
|
226
|
-
draftCtx.contextMenu = {};
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
230
|
-
className: "context-item"
|
|
231
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
232
|
-
name: "Snowflake"
|
|
233
|
-
}), /*#__PURE__*/React.createElement("p", null, isFrozen_2 ? "Unfreeze column" : "Freeze upto current column")));
|
|
234
|
-
}
|
|
235
|
-
if (name === "comment") {
|
|
236
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
237
|
-
key: name,
|
|
238
|
-
onClick: function onClick() {
|
|
239
|
-
setContext(function (draftCtx) {
|
|
240
|
-
newComment(draftCtx, refs.globalCache, selection === null || selection === void 0 ? void 0 : selection.row_focus, selection === null || selection === void 0 ? void 0 : selection.column_focus);
|
|
241
|
-
draftCtx.contextMenu = {};
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
245
|
-
className: "context-item"
|
|
246
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
247
|
-
name: "MessageSquarePlus"
|
|
248
|
-
}), /*#__PURE__*/React.createElement("p", null, "Comment")));
|
|
249
|
-
}
|
|
250
|
-
if (name === "dataVerification") {
|
|
251
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
252
|
-
key: name,
|
|
253
|
-
onClick: function onClick() {
|
|
254
|
-
if (context.allowEdit === false) return;
|
|
255
|
-
setContext(function (draftCtx) {
|
|
256
|
-
draftCtx.contextMenu = {};
|
|
257
|
-
});
|
|
258
|
-
showDialog(/*#__PURE__*/React.createElement(DataVerification, null), undefined, toolbar.dataVerification);
|
|
259
|
-
}
|
|
260
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
261
|
-
className: "context-item"
|
|
262
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
263
|
-
name: "ShieldCheck"
|
|
264
|
-
}), /*#__PURE__*/React.createElement("p", null, "Data Verification")));
|
|
265
|
-
}
|
|
266
|
-
if (name === "searchReplace") {
|
|
267
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
268
|
-
key: name,
|
|
269
|
-
onClick: function onClick() {
|
|
270
|
-
if (context.allowEdit === false) return;
|
|
271
|
-
setContext(function (draftCtx) {
|
|
272
|
-
draftCtx.showSearch = true;
|
|
273
|
-
draftCtx.showReplace = true;
|
|
274
|
-
draftCtx.contextMenu = {};
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
278
|
-
className: "context-item"
|
|
279
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
280
|
-
name: "Search"
|
|
281
|
-
}), /*#__PURE__*/React.createElement("p", null, "Find and Replace")));
|
|
282
|
-
}
|
|
283
|
-
if (name === "copy") {
|
|
284
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
285
|
-
key: name,
|
|
286
|
-
onClick: function onClick() {
|
|
287
|
-
setContext(function (draftCtx) {
|
|
288
|
-
var _a;
|
|
289
|
-
if (((_a = draftCtx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a.length) > 1) {
|
|
290
|
-
showAlert(rightclick.noMulti, "ok");
|
|
291
|
-
draftCtx.contextMenu = {};
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
handleCopy(draftCtx);
|
|
295
|
-
draftCtx.contextMenu = {};
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
299
|
-
className: "context-item"
|
|
300
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
301
|
-
name: "Copy"
|
|
302
|
-
}), /*#__PURE__*/React.createElement("p", null, rightclick.copy)));
|
|
303
|
-
}
|
|
304
|
-
if (name === "cut") {
|
|
305
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
306
|
-
key: name,
|
|
307
|
-
onClick: function onClick() {
|
|
308
|
-
setContext(function (draftCtx) {
|
|
309
|
-
var _a;
|
|
310
|
-
if (((_a = draftCtx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a.length) > 1) {
|
|
311
|
-
showAlert(rightclick.noMulti, "ok");
|
|
312
|
-
draftCtx.contextMenu = {};
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
handleCopy(draftCtx);
|
|
316
|
-
if (draftCtx.activeImg != null) {
|
|
317
|
-
removeActiveImage(draftCtx);
|
|
318
|
-
} else {
|
|
319
|
-
var msg = deleteSelectedCellText(draftCtx);
|
|
320
|
-
if (msg === "partMC") {
|
|
321
|
-
showDialog(generalDialog.partiallyError, "ok");
|
|
322
|
-
} else if (msg === "allowEdit") {
|
|
323
|
-
showDialog(generalDialog.readOnlyError, "ok");
|
|
324
|
-
} else if (msg === "dataNullError") {
|
|
325
|
-
showDialog(generalDialog.dataNullError, "ok");
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
jfrefreshgrid(draftCtx, null, undefined);
|
|
329
|
-
draftCtx.contextMenu = {};
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
333
|
-
className: "context-item"
|
|
334
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
335
|
-
name: "Scissors"
|
|
336
|
-
}), /*#__PURE__*/React.createElement("p", null, "Cut")));
|
|
337
|
-
}
|
|
338
|
-
if (name === "paste" && regeneratorRuntime) {
|
|
339
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
340
|
-
key: name,
|
|
341
|
-
onClick: function onClick() {
|
|
342
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
343
|
-
var clipboardText;
|
|
344
|
-
return __generator(this, function (_a) {
|
|
345
|
-
switch (_a.label) {
|
|
346
|
-
case 0:
|
|
347
|
-
return [4, navigator.clipboard.readText()];
|
|
348
|
-
case 1:
|
|
349
|
-
clipboardText = _a.sent();
|
|
350
|
-
setContext(function (draftCtx) {
|
|
351
|
-
handlePasteByClick(draftCtx, clipboardText);
|
|
352
|
-
draftCtx.contextMenu = {};
|
|
353
|
-
});
|
|
354
|
-
return [2];
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
360
|
-
className: "context-item"
|
|
361
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
362
|
-
name: "Clipboard"
|
|
363
|
-
}), /*#__PURE__*/React.createElement("p", null, rightclick.paste)));
|
|
364
|
-
}
|
|
365
|
-
if (name === "insert-column") {
|
|
366
|
-
return (selection === null || selection === void 0 ? void 0 : selection.row_select) ? null : ["left"].map(function (dir) {
|
|
367
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
368
|
-
key: "add-col-".concat(dir),
|
|
369
|
-
onClick: function onClick() {
|
|
370
|
-
var _a, _b, _c;
|
|
371
|
-
var position = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.column) === null || _c === void 0 ? void 0 : _c[0];
|
|
372
|
-
if (position == null) return;
|
|
373
|
-
var count = 1;
|
|
374
|
-
if (count < 1) return;
|
|
375
|
-
var direction = dir === "left" ? "lefttop" : "rightbottom";
|
|
376
|
-
var insertRowColOp = {
|
|
377
|
-
type: "column",
|
|
378
|
-
index: position,
|
|
379
|
-
count: count,
|
|
380
|
-
direction: direction,
|
|
381
|
-
id: context.currentSheetId
|
|
382
|
-
};
|
|
383
|
-
setContext(function (draftCtx) {
|
|
384
|
-
try {
|
|
385
|
-
insertRowCol(draftCtx, insertRowColOp);
|
|
386
|
-
draftCtx.contextMenu = {};
|
|
387
|
-
} catch (err) {
|
|
388
|
-
if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
|
|
389
|
-
draftCtx.contextMenu = {};
|
|
390
|
-
}
|
|
391
|
-
}, {
|
|
392
|
-
insertRowColOp: insertRowColOp
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
396
|
-
className: "context-item"
|
|
397
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
398
|
-
name: "Plus"
|
|
399
|
-
}), /*#__PURE__*/React.createElement("div", null, "Insert column to the left")));
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
if (name === "insert-row") {
|
|
403
|
-
return (selection === null || selection === void 0 ? void 0 : selection.column_select) ? null : ["bottom"].map(function (dir) {
|
|
404
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
405
|
-
key: "add-row-".concat(dir),
|
|
406
|
-
onClick: function onClick() {
|
|
407
|
-
var _a, _b, _c;
|
|
408
|
-
var position = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.row) === null || _c === void 0 ? void 0 : _c[0];
|
|
409
|
-
if (position == null) return;
|
|
410
|
-
var count = 1;
|
|
411
|
-
if (count < 1) return;
|
|
412
|
-
var direction = dir === "top" ? "lefttop" : "rightbottom";
|
|
413
|
-
var insertRowColOp = {
|
|
414
|
-
type: "row",
|
|
415
|
-
index: position,
|
|
416
|
-
count: count,
|
|
417
|
-
direction: direction,
|
|
418
|
-
id: context.currentSheetId
|
|
419
|
-
};
|
|
420
|
-
setContext(function (draftCtx) {
|
|
421
|
-
try {
|
|
422
|
-
insertRowCol(draftCtx, insertRowColOp);
|
|
423
|
-
draftCtx.contextMenu = {};
|
|
424
|
-
} catch (err) {
|
|
425
|
-
if (err.message === "maxExceeded") showAlert(rightclick.rowOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnRowReadOnly, "ok");
|
|
426
|
-
draftCtx.contextMenu = {};
|
|
427
|
-
}
|
|
428
|
-
}, {
|
|
429
|
-
insertRowColOp: insertRowColOp
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
433
|
-
className: "context-item"
|
|
434
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
435
|
-
name: "Plus"
|
|
436
|
-
}), /*#__PURE__*/React.createElement("div", null, "Insert row below")));
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
if (name === "delete-column") {
|
|
440
|
-
return (selection === null || selection === void 0 ? void 0 : selection.column_select) && (/*#__PURE__*/React.createElement(Menu, {
|
|
441
|
-
key: "delete-col",
|
|
442
|
-
onClick: function onClick() {
|
|
443
|
-
if (!selection) return;
|
|
444
|
-
var _a = selection.column,
|
|
445
|
-
st_index = _a[0],
|
|
446
|
-
ed_index = _a[1];
|
|
447
|
-
var deleteRowColOp = {
|
|
448
|
-
type: "column",
|
|
449
|
-
start: st_index,
|
|
450
|
-
end: ed_index,
|
|
451
|
-
id: context.currentSheetId
|
|
452
|
-
};
|
|
453
|
-
setContext(function (draftCtx) {
|
|
454
|
-
var _a, _b, _c;
|
|
455
|
-
if (((_a = draftCtx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a.length) > 1) {
|
|
456
|
-
showAlert(rightclick.noMulti, "ok");
|
|
457
|
-
draftCtx.contextMenu = {};
|
|
458
|
-
draftCtx.dataVerificationDropDownList = false;
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
|
-
var slen = ed_index - st_index + 1;
|
|
462
|
-
var index = getSheetIndex(draftCtx, context.currentSheetId);
|
|
463
|
-
if (((_c = (_b = draftCtx.luckysheetfile[index].data) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.length) <= slen) {
|
|
464
|
-
showAlert(rightclick.cannotDeleteAllColumn, "ok");
|
|
465
|
-
draftCtx.contextMenu = {};
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
try {
|
|
469
|
-
deleteRowCol(draftCtx, deleteRowColOp);
|
|
470
|
-
} catch (e) {
|
|
471
|
-
if (e.message === "readOnly") {
|
|
472
|
-
showAlert(rightclick.cannotDeleteColumnReadOnly, "ok");
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
draftCtx.contextMenu = {};
|
|
476
|
-
}, {
|
|
477
|
-
deleteRowColOp: deleteRowColOp
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
481
|
-
className: "context-item"
|
|
482
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
483
|
-
name: "Trash2"
|
|
484
|
-
}), /*#__PURE__*/React.createElement("div", null, rightclick.deleteSelected, rightclick.column))));
|
|
485
|
-
}
|
|
486
|
-
if (name === "cell-delete-column") {
|
|
487
|
-
return !(selection === null || selection === void 0 ? void 0 : selection.row_select) && (/*#__PURE__*/React.createElement(Menu, {
|
|
488
|
-
key: "cell-delete-col",
|
|
489
|
-
onClick: function onClick() {
|
|
490
|
-
if (!selection) return;
|
|
491
|
-
var _a = selection.column,
|
|
492
|
-
st_index = _a[0],
|
|
493
|
-
ed_index = _a[1];
|
|
494
|
-
var deleteRowColOp = {
|
|
495
|
-
type: "column",
|
|
496
|
-
start: st_index,
|
|
497
|
-
end: ed_index,
|
|
498
|
-
id: context.currentSheetId
|
|
499
|
-
};
|
|
500
|
-
setContext(function (draftCtx) {
|
|
501
|
-
var _a, _b, _c;
|
|
502
|
-
if (((_a = draftCtx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a.length) > 1) {
|
|
503
|
-
showAlert(rightclick.noMulti, "ok");
|
|
504
|
-
draftCtx.contextMenu = {};
|
|
505
|
-
draftCtx.dataVerificationDropDownList = false;
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
var slen = ed_index - st_index + 1;
|
|
509
|
-
var index = getSheetIndex(draftCtx, context.currentSheetId);
|
|
510
|
-
if (((_c = (_b = draftCtx.luckysheetfile[index].data) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.length) <= slen) {
|
|
511
|
-
showAlert(rightclick.cannotDeleteAllColumn, "ok");
|
|
512
|
-
draftCtx.contextMenu = {};
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
try {
|
|
516
|
-
deleteRowCol(draftCtx, deleteRowColOp);
|
|
517
|
-
} catch (e) {
|
|
518
|
-
if (e.message === "readOnly") {
|
|
519
|
-
showAlert(rightclick.cannotDeleteColumnReadOnly, "ok");
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
draftCtx.contextMenu = {};
|
|
523
|
-
}, {
|
|
524
|
-
deleteRowColOp: deleteRowColOp
|
|
525
|
-
});
|
|
526
|
-
}
|
|
527
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
528
|
-
className: "context-item"
|
|
529
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
530
|
-
name: "Trash2"
|
|
531
|
-
}), /*#__PURE__*/React.createElement("div", null, rightclick.deleteSelected, rightclick.column))));
|
|
532
|
-
}
|
|
533
|
-
if (name === "delete-row") {
|
|
534
|
-
return (selection === null || selection === void 0 ? void 0 : selection.row_select) && (/*#__PURE__*/React.createElement(Menu, {
|
|
535
|
-
key: "delete-row",
|
|
536
|
-
onClick: function onClick() {
|
|
537
|
-
if (!selection) return;
|
|
538
|
-
var _a = selection.row,
|
|
539
|
-
st_index = _a[0],
|
|
540
|
-
ed_index = _a[1];
|
|
541
|
-
var deleteRowColOp = {
|
|
542
|
-
type: "row",
|
|
543
|
-
start: st_index,
|
|
544
|
-
end: ed_index,
|
|
545
|
-
id: context.currentSheetId
|
|
546
|
-
};
|
|
547
|
-
setContext(function (draftCtx) {
|
|
548
|
-
var _a, _b;
|
|
549
|
-
if (((_a = draftCtx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a.length) > 1) {
|
|
550
|
-
showAlert(rightclick.noMulti, "ok");
|
|
551
|
-
draftCtx.contextMenu = {};
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
var slen = ed_index - st_index + 1;
|
|
555
|
-
var index = getSheetIndex(draftCtx, context.currentSheetId);
|
|
556
|
-
if (((_b = draftCtx.luckysheetfile[index].data) === null || _b === void 0 ? void 0 : _b.length) <= slen) {
|
|
557
|
-
showAlert(rightclick.cannotDeleteAllRow, "ok");
|
|
558
|
-
draftCtx.contextMenu = {};
|
|
559
|
-
return;
|
|
560
|
-
}
|
|
561
|
-
try {
|
|
562
|
-
deleteRowCol(draftCtx, deleteRowColOp);
|
|
563
|
-
} catch (e) {
|
|
564
|
-
if (e.message === "readOnly") {
|
|
565
|
-
showAlert(rightclick.cannotDeleteRowReadOnly, "ok");
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
draftCtx.contextMenu = {};
|
|
569
|
-
}, {
|
|
570
|
-
deleteRowColOp: deleteRowColOp
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
574
|
-
className: "context-item"
|
|
575
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
576
|
-
name: "Trash2"
|
|
577
|
-
}), /*#__PURE__*/React.createElement("div", null, rightclick.deleteSelected, rightclick.row))));
|
|
578
|
-
}
|
|
579
|
-
if (name === "cell-delete-row") {
|
|
580
|
-
return !(selection === null || selection === void 0 ? void 0 : selection.column_select) && (/*#__PURE__*/React.createElement(Menu, {
|
|
581
|
-
key: "cell-delete-row",
|
|
582
|
-
onClick: function onClick() {
|
|
583
|
-
if (!selection) return;
|
|
584
|
-
var _a = selection.row,
|
|
585
|
-
st_index = _a[0],
|
|
586
|
-
ed_index = _a[1];
|
|
587
|
-
var deleteRowColOp = {
|
|
588
|
-
type: "row",
|
|
589
|
-
start: st_index,
|
|
590
|
-
end: ed_index,
|
|
591
|
-
id: context.currentSheetId
|
|
592
|
-
};
|
|
593
|
-
setContext(function (draftCtx) {
|
|
594
|
-
var _a, _b;
|
|
595
|
-
if (((_a = draftCtx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a.length) > 1) {
|
|
596
|
-
showAlert(rightclick.noMulti, "ok");
|
|
597
|
-
draftCtx.contextMenu = {};
|
|
598
|
-
return;
|
|
599
|
-
}
|
|
600
|
-
var slen = ed_index - st_index + 1;
|
|
601
|
-
var index = getSheetIndex(draftCtx, context.currentSheetId);
|
|
602
|
-
if (((_b = draftCtx.luckysheetfile[index].data) === null || _b === void 0 ? void 0 : _b.length) <= slen) {
|
|
603
|
-
showAlert(rightclick.cannotDeleteAllRow, "ok");
|
|
604
|
-
draftCtx.contextMenu = {};
|
|
605
|
-
return;
|
|
606
|
-
}
|
|
607
|
-
try {
|
|
608
|
-
deleteRowCol(draftCtx, deleteRowColOp);
|
|
609
|
-
} catch (e) {
|
|
610
|
-
if (e.message === "readOnly") {
|
|
611
|
-
showAlert(rightclick.cannotDeleteRowReadOnly, "ok");
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
draftCtx.contextMenu = {};
|
|
615
|
-
}, {
|
|
616
|
-
deleteRowColOp: deleteRowColOp
|
|
617
|
-
});
|
|
618
|
-
}
|
|
619
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
620
|
-
className: "context-item"
|
|
621
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
622
|
-
name: "Trash2"
|
|
623
|
-
}), /*#__PURE__*/React.createElement("div", null, rightclick.deleteSelected, rightclick.row))));
|
|
624
|
-
}
|
|
625
|
-
if (name === "hide-row") {
|
|
626
|
-
return (selection === null || selection === void 0 ? void 0 : selection.row_select) === true && ["hideSelected", "showHide"].map(function (item) {
|
|
627
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
628
|
-
key: item,
|
|
629
|
-
onClick: function onClick() {
|
|
630
|
-
setContext(function (draftCtx) {
|
|
631
|
-
var msg = "";
|
|
632
|
-
if (item === "hideSelected") {
|
|
633
|
-
msg = hideSelected(draftCtx, "row");
|
|
634
|
-
} else if (item === "showHide") {
|
|
635
|
-
showSelected(draftCtx, "row");
|
|
636
|
-
}
|
|
637
|
-
if (msg === "noMulti") {
|
|
638
|
-
showDialog(drag.noMulti);
|
|
639
|
-
}
|
|
640
|
-
draftCtx.contextMenu = {};
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
644
|
-
className: "context-item"
|
|
645
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
646
|
-
name: "EyeOff"
|
|
647
|
-
}), /*#__PURE__*/React.createElement("div", null, rightclick[item] + rightclick.row)));
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
if (name === "hide-column") {
|
|
651
|
-
return (selection === null || selection === void 0 ? void 0 : selection.column_select) === true && ["hideSelected", "showHide"].map(function (item) {
|
|
652
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
653
|
-
key: item,
|
|
654
|
-
onClick: function onClick() {
|
|
655
|
-
setContext(function (draftCtx) {
|
|
656
|
-
var msg = "";
|
|
657
|
-
if (item === "hideSelected") {
|
|
658
|
-
msg = hideSelected(draftCtx, "column");
|
|
659
|
-
} else if (item === "showHide") {
|
|
660
|
-
showSelected(draftCtx, "column");
|
|
661
|
-
}
|
|
662
|
-
if (msg === "noMulti") {
|
|
663
|
-
showDialog(drag.noMulti);
|
|
664
|
-
}
|
|
665
|
-
draftCtx.contextMenu = {};
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
669
|
-
className: "context-item"
|
|
670
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
671
|
-
name: "EyeOff"
|
|
672
|
-
}), /*#__PURE__*/React.createElement("div", null, rightclick[item] + rightclick.column)));
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
if (name === "set-row-height") {
|
|
676
|
-
var rowHeight_1 = (selection === null || selection === void 0 ? void 0 : selection.height) || context.defaultrowlen;
|
|
677
|
-
var shownRowHeight = ((_b = context.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b.some(function (section) {
|
|
678
|
-
return section.height_move !== (rowHeight_1 + 1) * (section.row[1] - section.row[0] + 1) - 1;
|
|
679
|
-
})) ? "" : rowHeight_1;
|
|
680
|
-
return ((_c = context.luckysheet_select_save) === null || _c === void 0 ? void 0 : _c.some(function (section) {
|
|
681
|
-
return section.row_select;
|
|
682
|
-
})) ? (/*#__PURE__*/React.createElement(Menu, {
|
|
683
|
-
key: "set-row-height",
|
|
684
|
-
onClick: function onClick(e, container) {
|
|
685
|
-
var _a;
|
|
686
|
-
var targetRowHeight = (_a = container.querySelector("input")) === null || _a === void 0 ? void 0 : _a.value;
|
|
687
|
-
setContext(function (draftCtx) {
|
|
688
|
-
if (_.isUndefined(targetRowHeight) || targetRowHeight === "" || parseInt(targetRowHeight, 10) <= 0 || parseInt(targetRowHeight, 10) > 545) {
|
|
689
|
-
showAlert(info.tipRowHeightLimit, "ok");
|
|
690
|
-
draftCtx.contextMenu = {};
|
|
691
|
-
return;
|
|
692
|
-
}
|
|
693
|
-
var numRowHeight = parseInt(targetRowHeight, 10);
|
|
694
|
-
var rowHeightList = {};
|
|
695
|
-
_.forEach(draftCtx.luckysheet_select_save, function (section) {
|
|
696
|
-
for (var rowNum = section.row[0]; rowNum <= section.row[1]; rowNum += 1) {
|
|
697
|
-
rowHeightList[rowNum] = numRowHeight;
|
|
698
|
-
}
|
|
699
|
-
});
|
|
700
|
-
api.setRowHeight(draftCtx, rowHeightList, {}, true);
|
|
701
|
-
draftCtx.contextMenu = {};
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
705
|
-
className: "context-item"
|
|
706
|
-
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
707
|
-
name: "resize-flv",
|
|
708
|
-
width: 16,
|
|
709
|
-
height: 16
|
|
710
|
-
}), /*#__PURE__*/React.createElement("div", null, "Resize row height", /*#__PURE__*/React.createElement("input", {
|
|
711
|
-
onClick: function onClick(e) {
|
|
712
|
-
return e.stopPropagation();
|
|
713
|
-
},
|
|
714
|
-
onKeyDown: function onKeyDown(e) {
|
|
715
|
-
return e.stopPropagation();
|
|
716
|
-
},
|
|
717
|
-
tabIndex: 0,
|
|
718
|
-
type: "number",
|
|
719
|
-
min: 1,
|
|
720
|
-
max: 545,
|
|
721
|
-
className: "luckysheet-mousedown-cancel",
|
|
722
|
-
placeholder: rightclick.number,
|
|
723
|
-
defaultValue: shownRowHeight,
|
|
724
|
-
style: {
|
|
725
|
-
width: "40px"
|
|
726
|
-
}
|
|
727
|
-
}), "px")))) : null;
|
|
728
|
-
}
|
|
729
|
-
if (name === "set-column-width") {
|
|
730
|
-
return ((_d = context.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d.some(function (section) {
|
|
731
|
-
return section.column_select;
|
|
732
|
-
})) ? (/*#__PURE__*/React.createElement(Menu, {
|
|
733
|
-
key: "set-column-width",
|
|
734
|
-
onClick: function onClick() {
|
|
735
|
-
showDialog(/*#__PURE__*/React.createElement(ResetColumnWidth, null), undefined, "Resize column");
|
|
736
|
-
setContext(function (draftCtx) {
|
|
737
|
-
draftCtx.contextMenu = {};
|
|
738
|
-
});
|
|
739
|
-
}
|
|
740
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
741
|
-
className: "context-item"
|
|
742
|
-
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
743
|
-
name: "resize-flv",
|
|
744
|
-
width: 16,
|
|
745
|
-
height: 16
|
|
746
|
-
}), /*#__PURE__*/React.createElement("div", null, "Resize column width")))) : null;
|
|
747
|
-
}
|
|
748
|
-
if (name === "clear") {
|
|
749
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
750
|
-
key: name,
|
|
751
|
-
onClick: function onClick() {
|
|
752
|
-
setContext(function (draftCtx) {
|
|
753
|
-
var allowEdit = isAllowEdit(draftCtx);
|
|
754
|
-
if (!allowEdit) return;
|
|
755
|
-
if (draftCtx.activeImg != null) {
|
|
756
|
-
removeActiveImage(draftCtx);
|
|
757
|
-
} else {
|
|
758
|
-
var msg = deleteSelectedCellText(draftCtx);
|
|
759
|
-
if (msg === "partMC") {
|
|
760
|
-
showDialog(generalDialog.partiallyError, "ok");
|
|
761
|
-
} else if (msg === "allowEdit") {
|
|
762
|
-
showDialog(generalDialog.readOnlyError, "ok");
|
|
763
|
-
} else if (msg === "dataNullError") {
|
|
764
|
-
showDialog(generalDialog.dataNullError, "ok");
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
draftCtx.contextMenu = {};
|
|
768
|
-
jfrefreshgrid(draftCtx, null, undefined);
|
|
769
|
-
});
|
|
770
|
-
}
|
|
771
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
772
|
-
className: "context-item"
|
|
773
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
774
|
-
name: "Eraser"
|
|
775
|
-
}), /*#__PURE__*/React.createElement("p", null, rightclick.clearContent)));
|
|
776
|
-
}
|
|
777
|
-
if (name === "ascSort") {
|
|
778
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
779
|
-
key: name,
|
|
780
|
-
onClick: function onClick() {
|
|
781
|
-
if (context.allowEdit === false) return;
|
|
782
|
-
setContext(function (draftCtx) {
|
|
783
|
-
sortSelection(draftCtx, true);
|
|
784
|
-
draftCtx.contextMenu = {};
|
|
785
|
-
draftCtx.contextMenu = {};
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
789
|
-
className: "context-item"
|
|
790
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
791
|
-
name: "ArrowDown01"
|
|
792
|
-
}), /*#__PURE__*/React.createElement("p", null, "Ascending sort")));
|
|
793
|
-
}
|
|
794
|
-
if (name === "desSort") {
|
|
795
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
796
|
-
key: name,
|
|
797
|
-
onClick: function onClick() {
|
|
798
|
-
if (context.allowEdit === false) return;
|
|
799
|
-
setContext(function (draftCtx) {
|
|
800
|
-
sortSelection(draftCtx, false);
|
|
801
|
-
draftCtx.contextMenu = {};
|
|
802
|
-
draftCtx.contextMenu = {};
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
806
|
-
className: "context-item"
|
|
807
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
808
|
-
name: "ArrowDown10"
|
|
809
|
-
}), /*#__PURE__*/React.createElement("p", null, "Descending sort")));
|
|
810
|
-
}
|
|
811
|
-
if (name === "sort") {
|
|
812
|
-
var sort = locale(context).sort;
|
|
813
|
-
return /*#__PURE__*/React.createElement(Tippy, {
|
|
814
|
-
key: name,
|
|
815
|
-
placement: "right-start",
|
|
816
|
-
interactive: true,
|
|
817
|
-
interactiveBorder: 50,
|
|
818
|
-
offset: [0, 0],
|
|
819
|
-
arrow: false,
|
|
820
|
-
zIndex: 3000,
|
|
821
|
-
appendTo: document.body,
|
|
822
|
-
content: /*#__PURE__*/React.createElement("div", {
|
|
823
|
-
className: "fortune-toolbar-select",
|
|
824
|
-
style: {
|
|
825
|
-
minWidth: "11.25rem"
|
|
826
|
-
}
|
|
827
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
828
|
-
className: "flex flex-col color-text-default text-body-sm"
|
|
829
|
-
}, /*#__PURE__*/React.createElement(Menu, {
|
|
830
|
-
onClick: function onClick() {
|
|
831
|
-
setContext(function (draftCtx) {
|
|
832
|
-
sortSelection(draftCtx, true);
|
|
833
|
-
draftCtx.contextMenu = {};
|
|
834
|
-
});
|
|
835
|
-
}
|
|
836
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
837
|
-
className: "context-item p-2 w-full",
|
|
838
|
-
style: {
|
|
839
|
-
height: "40px"
|
|
840
|
-
}
|
|
841
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
842
|
-
name: "ArrowUp"
|
|
843
|
-
}), /*#__PURE__*/React.createElement("p", null, sort.asc))), /*#__PURE__*/React.createElement(Menu, {
|
|
844
|
-
onClick: function onClick() {
|
|
845
|
-
setContext(function (draftCtx) {
|
|
846
|
-
sortSelection(draftCtx, false);
|
|
847
|
-
draftCtx.contextMenu = {};
|
|
848
|
-
});
|
|
849
|
-
}
|
|
850
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
851
|
-
className: "context-item p-2 w-full",
|
|
852
|
-
style: {
|
|
853
|
-
height: "40px"
|
|
854
|
-
}
|
|
855
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
856
|
-
name: "ArrowDown"
|
|
857
|
-
}), /*#__PURE__*/React.createElement("p", null, sort.desc))))),
|
|
858
|
-
trigger: "mouseenter focus",
|
|
859
|
-
hideOnClick: false
|
|
860
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement("div", {
|
|
861
|
-
className: "flex items-center justify-between w-full"
|
|
862
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
863
|
-
className: "context-item"
|
|
864
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
865
|
-
name: "ArrowDownUp"
|
|
866
|
-
}), /*#__PURE__*/React.createElement("p", null, rightclick.sortSelection)), /*#__PURE__*/React.createElement(LucideIcon, {
|
|
867
|
-
name: "ChevronRight",
|
|
868
|
-
width: 16,
|
|
869
|
-
height: 16
|
|
870
|
-
})))));
|
|
871
|
-
}
|
|
872
|
-
if (name === "filter") {
|
|
873
|
-
var filter = locale(context).filter;
|
|
874
|
-
return /*#__PURE__*/React.createElement(Tippy, {
|
|
875
|
-
key: name,
|
|
876
|
-
placement: "right-start",
|
|
877
|
-
interactive: true,
|
|
878
|
-
interactiveBorder: 50,
|
|
879
|
-
offset: [0, 0],
|
|
880
|
-
arrow: false,
|
|
881
|
-
zIndex: 3000,
|
|
882
|
-
appendTo: document.body,
|
|
883
|
-
content: /*#__PURE__*/React.createElement("div", {
|
|
884
|
-
className: "fortune-toolbar-select",
|
|
885
|
-
style: {
|
|
886
|
-
minWidth: "11.25rem"
|
|
887
|
-
}
|
|
888
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
889
|
-
className: "flex flex-col color-text-default text-body-sm"
|
|
890
|
-
}, /*#__PURE__*/React.createElement(Menu, {
|
|
891
|
-
onClick: function onClick() {
|
|
892
|
-
setContext(function (draftCtx) {
|
|
893
|
-
createFilter(draftCtx);
|
|
894
|
-
draftCtx.contextMenu = {};
|
|
895
|
-
});
|
|
896
|
-
}
|
|
897
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
898
|
-
className: "context-item p-2 w-full",
|
|
899
|
-
style: {
|
|
900
|
-
height: "40px"
|
|
901
|
-
}
|
|
902
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
903
|
-
name: "Filter",
|
|
904
|
-
className: "w-4 h-4"
|
|
905
|
-
}), /*#__PURE__*/React.createElement("p", null, filter.filter))), /*#__PURE__*/React.createElement(Menu, {
|
|
906
|
-
onClick: function onClick() {
|
|
907
|
-
setContext(function (draftCtx) {
|
|
908
|
-
clearFilter(draftCtx);
|
|
909
|
-
draftCtx.contextMenu = {};
|
|
910
|
-
});
|
|
911
|
-
}
|
|
912
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
913
|
-
className: "context-item p-2 w-full",
|
|
914
|
-
style: {
|
|
915
|
-
height: "40px"
|
|
916
|
-
}
|
|
917
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
918
|
-
name: "Eraser"
|
|
919
|
-
}), /*#__PURE__*/React.createElement("p", null, filter.clearFilter))))),
|
|
920
|
-
trigger: "mouseenter focus",
|
|
921
|
-
hideOnClick: false
|
|
922
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement("div", {
|
|
923
|
-
className: "flex items-center justify-between w-full"
|
|
924
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
925
|
-
className: "context-item"
|
|
926
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
927
|
-
name: "Filter"
|
|
928
|
-
}), /*#__PURE__*/React.createElement("p", null, rightclick.filterSelection)), /*#__PURE__*/React.createElement(LucideIcon, {
|
|
929
|
-
name: "ChevronRight",
|
|
930
|
-
width: 16,
|
|
931
|
-
height: 16,
|
|
932
|
-
className: "w-4 h-4 color-text-secondary"
|
|
933
|
-
})))));
|
|
934
|
-
}
|
|
935
|
-
if (name === "image") {
|
|
936
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
937
|
-
key: name,
|
|
938
|
-
onClick: function onClick() {
|
|
939
|
-
setContext(function (draftCtx) {
|
|
940
|
-
showImgChooser();
|
|
941
|
-
draftCtx.contextMenu = {};
|
|
942
|
-
});
|
|
943
|
-
}
|
|
944
|
-
}, rightclick.image);
|
|
945
|
-
}
|
|
946
|
-
if (name === "link") {
|
|
947
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
948
|
-
key: name,
|
|
949
|
-
onClick: function onClick() {
|
|
950
|
-
setContext(function (draftCtx) {
|
|
951
|
-
handleLink(draftCtx);
|
|
952
|
-
draftCtx.contextMenu = {};
|
|
953
|
-
});
|
|
954
|
-
}
|
|
955
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
956
|
-
className: "context-item"
|
|
957
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
958
|
-
name: "Link"
|
|
959
|
-
}), /*#__PURE__*/React.createElement("p", null, rightclick.link)));
|
|
960
|
-
}
|
|
961
|
-
if (name === "conditionFormat") {
|
|
962
|
-
var closeContextMenu = function closeContextMenu() {
|
|
963
|
-
return setContext(function (ctx) {
|
|
964
|
-
ctx.contextMenu = {};
|
|
965
|
-
});
|
|
966
|
-
};
|
|
967
|
-
return /*#__PURE__*/React.createElement(Tippy, {
|
|
968
|
-
key: name,
|
|
969
|
-
placement: "right-start",
|
|
970
|
-
interactive: true,
|
|
971
|
-
interactiveBorder: 50,
|
|
972
|
-
offset: [0, 0],
|
|
973
|
-
arrow: false,
|
|
974
|
-
zIndex: 3000,
|
|
975
|
-
appendTo: document.body,
|
|
976
|
-
content: /*#__PURE__*/React.createElement("div", {
|
|
977
|
-
style: {
|
|
978
|
-
minWidth: 220
|
|
979
|
-
}
|
|
980
|
-
}, /*#__PURE__*/React.createElement(ConditionalFormat, {
|
|
981
|
-
items: ["highlightCellRules", "itemSelectionRules", "-", "deleteRule"],
|
|
982
|
-
setOpen: closeContextMenu
|
|
983
|
-
})),
|
|
984
|
-
trigger: "mouseenter focus",
|
|
985
|
-
hideOnClick: false
|
|
986
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement("div", {
|
|
987
|
-
className: "flex items-center justify-between w-full"
|
|
988
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
989
|
-
className: "flex items-center gap-2 context-item"
|
|
990
|
-
}, /*#__PURE__*/React.createElement(LucideIcon, {
|
|
991
|
-
name: "PaintbrushVertical"
|
|
992
|
-
}), /*#__PURE__*/React.createElement("p", null, rightclick.conditionFormat || "Conditional Format")), /*#__PURE__*/React.createElement(LucideIcon, {
|
|
993
|
-
name: "ChevronRight",
|
|
994
|
-
width: 16,
|
|
995
|
-
height: 16,
|
|
996
|
-
className: "color-text-secondary w-4 h-4"
|
|
997
|
-
})))));
|
|
998
|
-
}
|
|
999
|
-
return null;
|
|
1000
|
-
}, [context, setContext, refs.globalCache, rightclick, showAlert, showDialog, drag.noMulti, info.tipRowHeightLimit, info.tipColumnWidthLimit, generalDialog.partiallyError, generalDialog.readOnlyError, generalDialog.dataNullError]);
|
|
1001
|
-
useLayoutEffect(function () {
|
|
1002
|
-
var _a;
|
|
1003
|
-
if (!containerRef.current) {
|
|
1004
|
-
return;
|
|
1005
|
-
}
|
|
1006
|
-
var winH = window.innerHeight;
|
|
1007
|
-
var winW = window.innerWidth;
|
|
1008
|
-
var rect = containerRef.current.getBoundingClientRect();
|
|
1009
|
-
var workbookRect = (_a = refs.workbookContainer.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
1010
|
-
if (!workbookRect) {
|
|
1011
|
-
return;
|
|
1012
|
-
}
|
|
1013
|
-
var menuW = rect.width;
|
|
1014
|
-
var menuH = rect.height;
|
|
1015
|
-
var top = contextMenu.y || 0;
|
|
1016
|
-
var left = contextMenu.x || 0;
|
|
1017
|
-
var hasOverflow = false;
|
|
1018
|
-
if (workbookRect.left + left + menuW > winW) {
|
|
1019
|
-
left -= menuW;
|
|
1020
|
-
hasOverflow = true;
|
|
1021
|
-
}
|
|
1022
|
-
if (workbookRect.top + top + menuH > winH) {
|
|
1023
|
-
top -= menuH;
|
|
1024
|
-
hasOverflow = true;
|
|
1025
|
-
}
|
|
1026
|
-
if (top < 0) {
|
|
1027
|
-
top = 0;
|
|
1028
|
-
hasOverflow = true;
|
|
1029
|
-
}
|
|
1030
|
-
if (hasOverflow) {
|
|
1031
|
-
setContext(function (draftCtx) {
|
|
1032
|
-
draftCtx.contextMenu.x = left;
|
|
1033
|
-
draftCtx.contextMenu.y = top;
|
|
1034
|
-
});
|
|
1035
|
-
}
|
|
1036
|
-
}, [contextMenu.x, contextMenu.y, refs.workbookContainer, setContext]);
|
|
1037
|
-
if (_.isEmpty(context.contextMenu)) return null;
|
|
1038
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1039
|
-
className: "fortune-context-menu luckysheet-cols-menu",
|
|
1040
|
-
ref: containerRef,
|
|
1041
|
-
onContextMenu: function onContextMenu(e) {
|
|
1042
|
-
return e.stopPropagation();
|
|
1043
|
-
},
|
|
1044
|
-
style: {
|
|
1045
|
-
left: contextMenu.x,
|
|
1046
|
-
top: contextMenu.y
|
|
1047
|
-
}
|
|
1048
|
-
}, context.contextMenu.headerMenu === true ? settings.headerContextMenu.map(function (menu, i) {
|
|
1049
|
-
return getMenuElement(menu, i);
|
|
1050
|
-
}) : settings.cellContextMenu.map(function (menu, i) {
|
|
1051
|
-
return getMenuElement(menu, i);
|
|
1052
|
-
}));
|
|
1053
|
-
};
|
|
1054
|
-
export default ContextMenu;
|