@fileverse-dev/fortune-react 1.0.26 → 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,588 +0,0 @@
|
|
|
1
|
-
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
-
}
|
|
7
|
-
return t;
|
|
8
|
-
};
|
|
9
|
-
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
10
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
11
|
-
if (ar || !(i in from)) {
|
|
12
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
13
|
-
ar[i] = from[i];
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
17
|
-
};
|
|
18
|
-
import { defaultContext, defaultSettings, initSheetIndex, handleGlobalKeyDown, getSheetIndex, handlePaste, filterPatch, patchToOp, inverseRowColOptions, ensureSheetIndex, insertRowCol, locale, calcSelectionInfo, groupValuesRefresh, insertDuneChart } from "@fileverse-dev/fortune-core";
|
|
19
|
-
import React, { useMemo, useState, useCallback, useEffect, useRef, useImperativeHandle } from "react";
|
|
20
|
-
import "./index.css";
|
|
21
|
-
import produce, { applyPatches, enablePatches, produceWithPatches } from "immer";
|
|
22
|
-
import _ from "lodash";
|
|
23
|
-
import Sheet from "../Sheet";
|
|
24
|
-
import WorkbookContext from "../../context";
|
|
25
|
-
import Toolbar from "../Toolbar";
|
|
26
|
-
import FxEditor from "../FxEditor";
|
|
27
|
-
import SheetTab from "../SheetTab";
|
|
28
|
-
import ContextMenu from "../ContextMenu";
|
|
29
|
-
import SVGDefines from "../SVGDefines";
|
|
30
|
-
import SheetTabContextMenu from "../ContextMenu/SheetTab";
|
|
31
|
-
import { generateAPIs } from "./api";
|
|
32
|
-
import { ModalProvider } from "../../context/modal";
|
|
33
|
-
import FilterMenu from "../ContextMenu/FilterMenu";
|
|
34
|
-
import SheetList from "../SheetList";
|
|
35
|
-
import DunePreview from "../DunePreview/DunePreview";
|
|
36
|
-
enablePatches();
|
|
37
|
-
var triggerGroupValuesRefresh = function triggerGroupValuesRefresh(ctx) {
|
|
38
|
-
if (ctx.groupValuesRefreshData.length > 0) {
|
|
39
|
-
groupValuesRefresh(ctx);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
var concatProducer = function concatProducer() {
|
|
43
|
-
var producers = [];
|
|
44
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
45
|
-
producers[_i] = arguments[_i];
|
|
46
|
-
}
|
|
47
|
-
return function (ctx) {
|
|
48
|
-
producers.forEach(function (producer) {
|
|
49
|
-
producer(ctx);
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
54
|
-
var _b;
|
|
55
|
-
var onChange = _a.onChange,
|
|
56
|
-
onOp = _a.onOp,
|
|
57
|
-
originalData = _a.data,
|
|
58
|
-
isFlvReadOnly = _a.isFlvReadOnly,
|
|
59
|
-
props = __rest(_a, ["onChange", "onOp", "data", "isFlvReadOnly"]);
|
|
60
|
-
var globalCache = useRef({
|
|
61
|
-
undoList: [],
|
|
62
|
-
redoList: []
|
|
63
|
-
});
|
|
64
|
-
var cellInput = useRef(null);
|
|
65
|
-
var fxInput = useRef(null);
|
|
66
|
-
var canvas = useRef(null);
|
|
67
|
-
var scrollbarX = useRef(null);
|
|
68
|
-
var scrollbarY = useRef(null);
|
|
69
|
-
var cellArea = useRef(null);
|
|
70
|
-
var workbookContainer = useRef(null);
|
|
71
|
-
var refs = useMemo(function () {
|
|
72
|
-
return {
|
|
73
|
-
globalCache: globalCache.current,
|
|
74
|
-
cellInput: cellInput,
|
|
75
|
-
fxInput: fxInput,
|
|
76
|
-
canvas: canvas,
|
|
77
|
-
scrollbarX: scrollbarX,
|
|
78
|
-
scrollbarY: scrollbarY,
|
|
79
|
-
cellArea: cellArea,
|
|
80
|
-
workbookContainer: workbookContainer
|
|
81
|
-
};
|
|
82
|
-
}, []);
|
|
83
|
-
var _c = useState(defaultContext(refs)),
|
|
84
|
-
context = _c[0],
|
|
85
|
-
setContext = _c[1];
|
|
86
|
-
var formula = locale(context).formula;
|
|
87
|
-
var _d = useState(null),
|
|
88
|
-
moreToolbarItems = _d[0],
|
|
89
|
-
setMoreToolbarItems = _d[1];
|
|
90
|
-
var _e = useState({
|
|
91
|
-
numberC: 0,
|
|
92
|
-
count: 0,
|
|
93
|
-
sum: 0,
|
|
94
|
-
max: 0,
|
|
95
|
-
min: 0,
|
|
96
|
-
average: ""
|
|
97
|
-
}),
|
|
98
|
-
calInfo = _e[0],
|
|
99
|
-
setCalInfo = _e[1];
|
|
100
|
-
var mergedSettings = useMemo(function () {
|
|
101
|
-
return _.assign(_.cloneDeep(defaultSettings), props);
|
|
102
|
-
}, __spreadArray([], _.values(props), true));
|
|
103
|
-
useEffect(function () {
|
|
104
|
-
var selection = context.luckysheet_select_save;
|
|
105
|
-
var lang = props.lang;
|
|
106
|
-
if (selection) {
|
|
107
|
-
var re = calcSelectionInfo(context, lang);
|
|
108
|
-
setCalInfo(re);
|
|
109
|
-
}
|
|
110
|
-
}, [context.luckysheet_select_save]);
|
|
111
|
-
var initSheetData = useCallback(function (draftCtx, newData, index) {
|
|
112
|
-
var _a, _b;
|
|
113
|
-
var celldata = newData.celldata,
|
|
114
|
-
row = newData.row,
|
|
115
|
-
column = newData.column;
|
|
116
|
-
var lastRow = _.maxBy(celldata, "r");
|
|
117
|
-
var lastCol = _.maxBy(celldata, "c");
|
|
118
|
-
var lastRowNum = ((_a = lastRow === null || lastRow === void 0 ? void 0 : lastRow.r) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
119
|
-
var lastColNum = ((_b = lastCol === null || lastCol === void 0 ? void 0 : lastCol.c) !== null && _b !== void 0 ? _b : 0) + 1;
|
|
120
|
-
if (row != null && column != null && row > 0 && column > 0) {
|
|
121
|
-
lastRowNum = Math.max(lastRowNum, row);
|
|
122
|
-
lastColNum = Math.max(lastColNum, column);
|
|
123
|
-
} else {
|
|
124
|
-
lastRowNum = Math.max(lastRowNum, draftCtx.defaultrowNum);
|
|
125
|
-
lastColNum = Math.max(lastColNum, draftCtx.defaultcolumnNum);
|
|
126
|
-
}
|
|
127
|
-
if (lastRowNum && lastColNum) {
|
|
128
|
-
var expandedData_1 = _.times(lastRowNum, function () {
|
|
129
|
-
return _.times(lastColNum, function () {
|
|
130
|
-
return null;
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
celldata === null || celldata === void 0 ? void 0 : celldata.forEach(function (d) {
|
|
134
|
-
expandedData_1[d.r][d.c] = d.v;
|
|
135
|
-
});
|
|
136
|
-
draftCtx.luckysheetfile = produce(draftCtx.luckysheetfile, function (d) {
|
|
137
|
-
d[index].data = expandedData_1;
|
|
138
|
-
delete d[index].celldata;
|
|
139
|
-
return d;
|
|
140
|
-
});
|
|
141
|
-
return expandedData_1;
|
|
142
|
-
}
|
|
143
|
-
return null;
|
|
144
|
-
}, []);
|
|
145
|
-
var emitOp = useCallback(function (ctx, patches, options, undo) {
|
|
146
|
-
if (undo === void 0) {
|
|
147
|
-
undo = false;
|
|
148
|
-
}
|
|
149
|
-
if (onOp) {
|
|
150
|
-
onOp(patchToOp(ctx, patches, options, undo));
|
|
151
|
-
}
|
|
152
|
-
}, [onOp]);
|
|
153
|
-
function reduceUndoList(ctx, ctxBefore) {
|
|
154
|
-
var sheetsId = ctx.luckysheetfile.map(function (sheet) {
|
|
155
|
-
return sheet.id;
|
|
156
|
-
});
|
|
157
|
-
var sheetDeletedByMe = globalCache.current.undoList.filter(function (undo) {
|
|
158
|
-
var _a;
|
|
159
|
-
return (_a = undo.options) === null || _a === void 0 ? void 0 : _a.deleteSheetOp;
|
|
160
|
-
}).map(function (item) {
|
|
161
|
-
var _a, _b;
|
|
162
|
-
return (_b = (_a = item.options) === null || _a === void 0 ? void 0 : _a.deleteSheetOp) === null || _b === void 0 ? void 0 : _b.id;
|
|
163
|
-
});
|
|
164
|
-
globalCache.current.undoList = globalCache.current.undoList.filter(function (undo) {
|
|
165
|
-
var _a, _b, _c, _d;
|
|
166
|
-
return ((_a = undo.options) === null || _a === void 0 ? void 0 : _a.deleteSheetOp) || ((_b = undo.options) === null || _b === void 0 ? void 0 : _b.id) === undefined || _.indexOf(sheetsId, (_c = undo.options) === null || _c === void 0 ? void 0 : _c.id) !== -1 || _.indexOf(sheetDeletedByMe, (_d = undo.options) === null || _d === void 0 ? void 0 : _d.id) !== -1;
|
|
167
|
-
});
|
|
168
|
-
if (ctxBefore.luckysheetfile.length > ctx.luckysheetfile.length) {
|
|
169
|
-
var sheetDeleted = ctxBefore.luckysheetfile.filter(function (oneSheet) {
|
|
170
|
-
return _.indexOf(ctx.luckysheetfile.map(function (item) {
|
|
171
|
-
return item.id;
|
|
172
|
-
}), oneSheet.id) === -1;
|
|
173
|
-
}).map(function (item) {
|
|
174
|
-
return getSheetIndex(ctxBefore, item.id);
|
|
175
|
-
});
|
|
176
|
-
var deletedIndex_1 = sheetDeleted[0];
|
|
177
|
-
globalCache.current.undoList = globalCache.current.undoList.map(function (oneStep) {
|
|
178
|
-
oneStep.patches = oneStep.patches.map(function (onePatch) {
|
|
179
|
-
if (typeof onePatch.path[1] === "number" && onePatch.path[1] > deletedIndex_1) {
|
|
180
|
-
onePatch.path[1] -= 1;
|
|
181
|
-
}
|
|
182
|
-
return onePatch;
|
|
183
|
-
});
|
|
184
|
-
oneStep.inversePatches = oneStep.inversePatches.map(function (onePatch) {
|
|
185
|
-
if (typeof onePatch.path[1] === "number" && onePatch.path[1] > deletedIndex_1) {
|
|
186
|
-
onePatch.path[1] -= 1;
|
|
187
|
-
}
|
|
188
|
-
return onePatch;
|
|
189
|
-
});
|
|
190
|
-
return oneStep;
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
function dataToCelldata(data) {
|
|
195
|
-
var _a;
|
|
196
|
-
var cellData = [];
|
|
197
|
-
for (var row = 0; row < (data === null || data === void 0 ? void 0 : data.length); row += 1) {
|
|
198
|
-
for (var col = 0; col < ((_a = data[row]) === null || _a === void 0 ? void 0 : _a.length); col += 1) {
|
|
199
|
-
if (data[row][col] !== null) {
|
|
200
|
-
cellData.push({
|
|
201
|
-
r: row,
|
|
202
|
-
c: col,
|
|
203
|
-
v: data[row][col]
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
return cellData;
|
|
209
|
-
}
|
|
210
|
-
var setContextWithProduce = useCallback(function (recipe, options) {
|
|
211
|
-
if (options === void 0) {
|
|
212
|
-
options = {};
|
|
213
|
-
}
|
|
214
|
-
setContext(function (ctx_) {
|
|
215
|
-
var _a, _b, _c;
|
|
216
|
-
var _d = produceWithPatches(ctx_, concatProducer(recipe, triggerGroupValuesRefresh)),
|
|
217
|
-
result = _d[0],
|
|
218
|
-
patches = _d[1],
|
|
219
|
-
inversePatches = _d[2];
|
|
220
|
-
if (patches.length > 0 && !options.noHistory) {
|
|
221
|
-
if (options.logPatch) {
|
|
222
|
-
console.info("patch", patches);
|
|
223
|
-
}
|
|
224
|
-
var filteredPatches = filterPatch(patches);
|
|
225
|
-
var filteredInversePatches = filterPatch(inversePatches);
|
|
226
|
-
if (filteredInversePatches.length > 0) {
|
|
227
|
-
options.id = ctx_.currentSheetId;
|
|
228
|
-
if (options.deleteSheetOp) {
|
|
229
|
-
var target = ctx_.luckysheetfile.filter(function (sheet) {
|
|
230
|
-
var _a;
|
|
231
|
-
return sheet.id === ((_a = options.deleteSheetOp) === null || _a === void 0 ? void 0 : _a.id);
|
|
232
|
-
});
|
|
233
|
-
if (target) {
|
|
234
|
-
var index = getSheetIndex(ctx_, options.deleteSheetOp.id);
|
|
235
|
-
options.deletedSheet = {
|
|
236
|
-
id: options.deleteSheetOp.id,
|
|
237
|
-
index: index,
|
|
238
|
-
value: _.cloneDeep(ctx_.luckysheetfile[index])
|
|
239
|
-
};
|
|
240
|
-
options.deletedSheet.value.celldata = dataToCelldata(options.deletedSheet.value.data);
|
|
241
|
-
delete options.deletedSheet.value.data;
|
|
242
|
-
options.deletedSheet.value.status = 0;
|
|
243
|
-
filteredInversePatches = [{
|
|
244
|
-
op: "add",
|
|
245
|
-
path: ["luckysheetfile", 0],
|
|
246
|
-
value: options.deletedSheet.value
|
|
247
|
-
}];
|
|
248
|
-
}
|
|
249
|
-
} else if (options.addSheetOp) {
|
|
250
|
-
options.addSheet = {};
|
|
251
|
-
options.addSheet.id = result.luckysheetfile[result.luckysheetfile.length - 1].id;
|
|
252
|
-
}
|
|
253
|
-
globalCache.current.undoList.push({
|
|
254
|
-
patches: filteredPatches,
|
|
255
|
-
inversePatches: filteredInversePatches,
|
|
256
|
-
options: options
|
|
257
|
-
});
|
|
258
|
-
globalCache.current.redoList = [];
|
|
259
|
-
emitOp(result, filteredPatches, options);
|
|
260
|
-
}
|
|
261
|
-
} else {
|
|
262
|
-
if (((_b = (_a = patches === null || patches === void 0 ? void 0 : patches[0]) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.length) < ((_c = ctx_ === null || ctx_ === void 0 ? void 0 : ctx_.luckysheetfile) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
263
|
-
reduceUndoList(result, ctx_);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
return result;
|
|
267
|
-
});
|
|
268
|
-
}, [emitOp]);
|
|
269
|
-
var handleUndo = useCallback(function () {
|
|
270
|
-
var history = globalCache.current.undoList.pop();
|
|
271
|
-
if (history) {
|
|
272
|
-
setContext(function (ctx_) {
|
|
273
|
-
var _a, _b, _c, _d, _e;
|
|
274
|
-
if ((_a = history.options) === null || _a === void 0 ? void 0 : _a.deleteSheetOp) {
|
|
275
|
-
history.inversePatches[0].path[1] = ctx_.luckysheetfile.length;
|
|
276
|
-
var order_1 = (_c = (_b = history.options.deletedSheet) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.order;
|
|
277
|
-
var sheetsRight = ctx_.luckysheetfile.filter(function (sheet) {
|
|
278
|
-
var _a, _b;
|
|
279
|
-
return (sheet === null || sheet === void 0 ? void 0 : sheet.order) >= order_1 && sheet.id !== ((_b = (_a = history === null || history === void 0 ? void 0 : history.options) === null || _a === void 0 ? void 0 : _a.deleteSheetOp) === null || _b === void 0 ? void 0 : _b.id);
|
|
280
|
-
});
|
|
281
|
-
_.forEach(sheetsRight, function (sheet) {
|
|
282
|
-
history.inversePatches.push({
|
|
283
|
-
op: "replace",
|
|
284
|
-
path: ["luckysheetfile", getSheetIndex(ctx_, sheet.id), "order"],
|
|
285
|
-
value: (sheet === null || sheet === void 0 ? void 0 : sheet.order) + 1
|
|
286
|
-
});
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
var newContext = applyPatches(ctx_, history.inversePatches);
|
|
290
|
-
globalCache.current.redoList.push(history);
|
|
291
|
-
var inversedOptions = inverseRowColOptions(history.options);
|
|
292
|
-
if (inversedOptions === null || inversedOptions === void 0 ? void 0 : inversedOptions.insertRowColOp) {
|
|
293
|
-
inversedOptions.restoreDeletedCells = true;
|
|
294
|
-
}
|
|
295
|
-
if ((_d = history.options) === null || _d === void 0 ? void 0 : _d.addSheetOp) {
|
|
296
|
-
var index = getSheetIndex(ctx_, history.options.addSheet.id);
|
|
297
|
-
inversedOptions.addSheet = {
|
|
298
|
-
id: history.options.addSheet.id,
|
|
299
|
-
index: index,
|
|
300
|
-
value: _.cloneDeep(ctx_.luckysheetfile[index])
|
|
301
|
-
};
|
|
302
|
-
inversedOptions.addSheet.value.celldata = dataToCelldata((_e = inversedOptions.addSheet.value) === null || _e === void 0 ? void 0 : _e.data);
|
|
303
|
-
delete inversedOptions.addSheet.value.data;
|
|
304
|
-
}
|
|
305
|
-
emitOp(newContext, history.inversePatches, inversedOptions, true);
|
|
306
|
-
return newContext;
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
}, [emitOp]);
|
|
310
|
-
var handleRedo = useCallback(function () {
|
|
311
|
-
var history = globalCache.current.redoList.pop();
|
|
312
|
-
if (history) {
|
|
313
|
-
setContext(function (ctx_) {
|
|
314
|
-
var newContext = applyPatches(ctx_, history.patches);
|
|
315
|
-
globalCache.current.undoList.push(history);
|
|
316
|
-
emitOp(newContext, history.patches, history.options);
|
|
317
|
-
return newContext;
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
}, [emitOp]);
|
|
321
|
-
useEffect(function () {
|
|
322
|
-
var _a, _b;
|
|
323
|
-
if (context.luckysheet_select_save != null) {
|
|
324
|
-
(_b = (_a = mergedSettings.hooks) === null || _a === void 0 ? void 0 : _a.afterSelectionChange) === null || _b === void 0 ? void 0 : _b.call(_a, context.currentSheetId, context.luckysheet_select_save[0]);
|
|
325
|
-
}
|
|
326
|
-
}, [context.currentSheetId, context.luckysheet_select_save, mergedSettings.hooks]);
|
|
327
|
-
var providerValue = useMemo(function () {
|
|
328
|
-
return {
|
|
329
|
-
context: context,
|
|
330
|
-
setContext: setContextWithProduce,
|
|
331
|
-
settings: mergedSettings,
|
|
332
|
-
handleUndo: handleUndo,
|
|
333
|
-
handleRedo: handleRedo,
|
|
334
|
-
refs: refs
|
|
335
|
-
};
|
|
336
|
-
}, [context, handleRedo, handleUndo, mergedSettings, refs, setContextWithProduce]);
|
|
337
|
-
useEffect(function () {
|
|
338
|
-
if (!_.isEmpty(context.luckysheetfile)) {
|
|
339
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(context.luckysheetfile);
|
|
340
|
-
}
|
|
341
|
-
}, [context.luckysheetfile, onChange]);
|
|
342
|
-
useEffect(function () {
|
|
343
|
-
setContextWithProduce(function (draftCtx) {
|
|
344
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
345
|
-
draftCtx.defaultcolumnNum = mergedSettings.column;
|
|
346
|
-
draftCtx.defaultrowNum = mergedSettings.row;
|
|
347
|
-
draftCtx.defaultFontSize = mergedSettings.defaultFontSize;
|
|
348
|
-
if (_.isEmpty(draftCtx.luckysheetfile)) {
|
|
349
|
-
var newData = produce(originalData, function (draftData) {
|
|
350
|
-
ensureSheetIndex(draftData, mergedSettings.generateSheetId);
|
|
351
|
-
});
|
|
352
|
-
draftCtx.luckysheetfile = newData;
|
|
353
|
-
newData.forEach(function (newDatum) {
|
|
354
|
-
var _a;
|
|
355
|
-
var index = getSheetIndex(draftCtx, newDatum.id);
|
|
356
|
-
var sheet = (_a = draftCtx.luckysheetfile) === null || _a === void 0 ? void 0 : _a[index];
|
|
357
|
-
initSheetData(draftCtx, sheet, index);
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
if (mergedSettings.devicePixelRatio > 0) {
|
|
361
|
-
draftCtx.devicePixelRatio = mergedSettings.devicePixelRatio;
|
|
362
|
-
}
|
|
363
|
-
draftCtx.lang = mergedSettings.lang;
|
|
364
|
-
draftCtx.allowEdit = mergedSettings.allowEdit;
|
|
365
|
-
draftCtx.isFlvReadOnly = isFlvReadOnly !== null && isFlvReadOnly !== void 0 ? isFlvReadOnly : false;
|
|
366
|
-
draftCtx.hooks = mergedSettings.hooks;
|
|
367
|
-
if (_.isEmpty(draftCtx.currentSheetId)) {
|
|
368
|
-
initSheetIndex(draftCtx);
|
|
369
|
-
}
|
|
370
|
-
var sheetIdx = getSheetIndex(draftCtx, draftCtx.currentSheetId);
|
|
371
|
-
if (sheetIdx == null) {
|
|
372
|
-
if (((_b = (_a = draftCtx.luckysheetfile) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0) {
|
|
373
|
-
sheetIdx = 0;
|
|
374
|
-
draftCtx.currentSheetId = draftCtx.luckysheetfile[0].id;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
if (sheetIdx == null) return;
|
|
378
|
-
var sheet = (_c = draftCtx.luckysheetfile) === null || _c === void 0 ? void 0 : _c[sheetIdx];
|
|
379
|
-
if (!sheet) return;
|
|
380
|
-
var data = sheet.data;
|
|
381
|
-
if (_.isEmpty(data)) {
|
|
382
|
-
var temp = initSheetData(draftCtx, sheet, sheetIdx);
|
|
383
|
-
if (!_.isNull(temp)) {
|
|
384
|
-
data = temp;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
if (_.isEmpty(draftCtx.luckysheet_select_save) && !_.isEmpty(sheet.luckysheet_select_save)) {
|
|
388
|
-
draftCtx.luckysheet_select_save = sheet.luckysheet_select_save;
|
|
389
|
-
}
|
|
390
|
-
if (((_d = draftCtx.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d.length) === 0) {
|
|
391
|
-
if (((_f = (_e = data === null || data === void 0 ? void 0 : data[0]) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.mc) && !_.isNil((_j = (_h = (_g = data === null || data === void 0 ? void 0 : data[0]) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.mc) === null || _j === void 0 ? void 0 : _j.rs) && !_.isNil((_m = (_l = (_k = data === null || data === void 0 ? void 0 : data[0]) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.mc) === null || _m === void 0 ? void 0 : _m.cs)) {
|
|
392
|
-
draftCtx.luckysheet_select_save = [{
|
|
393
|
-
row: [0, data[0][0].mc.rs - 1],
|
|
394
|
-
column: [0, data[0][0].mc.cs - 1]
|
|
395
|
-
}];
|
|
396
|
-
} else {
|
|
397
|
-
draftCtx.luckysheet_select_save = [{
|
|
398
|
-
row: [0, 0],
|
|
399
|
-
column: [0, 0]
|
|
400
|
-
}];
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
draftCtx.config = _.isNil(sheet.config) ? {} : sheet.config;
|
|
404
|
-
draftCtx.insertedImgs = sheet.images;
|
|
405
|
-
draftCtx.insertedIframes = sheet.iframes;
|
|
406
|
-
draftCtx.currency = mergedSettings.currency || "¥";
|
|
407
|
-
draftCtx.zoomRatio = _.isNil(sheet.zoomRatio) ? 1 : sheet.zoomRatio;
|
|
408
|
-
draftCtx.rowHeaderWidth = mergedSettings.rowHeaderWidth * draftCtx.zoomRatio;
|
|
409
|
-
draftCtx.columnHeaderHeight = mergedSettings.columnHeaderHeight * draftCtx.zoomRatio;
|
|
410
|
-
if (!_.isNil(sheet.defaultRowHeight)) {
|
|
411
|
-
draftCtx.defaultrowlen = Number(sheet.defaultRowHeight);
|
|
412
|
-
} else {
|
|
413
|
-
draftCtx.defaultrowlen = mergedSettings.defaultRowHeight;
|
|
414
|
-
}
|
|
415
|
-
if (!_.isNil(sheet.addRows)) {
|
|
416
|
-
draftCtx.addDefaultRows = Number(sheet.addRows);
|
|
417
|
-
} else {
|
|
418
|
-
draftCtx.addDefaultRows = mergedSettings.addRows;
|
|
419
|
-
}
|
|
420
|
-
if (!_.isNil(sheet.defaultColWidth)) {
|
|
421
|
-
draftCtx.defaultcollen = Number(sheet.defaultColWidth);
|
|
422
|
-
} else {
|
|
423
|
-
draftCtx.defaultcollen = mergedSettings.defaultColWidth;
|
|
424
|
-
}
|
|
425
|
-
if (!_.isNil(sheet.showGridLines)) {
|
|
426
|
-
var showGridLines = sheet.showGridLines;
|
|
427
|
-
if (showGridLines === 0 || showGridLines === false) {
|
|
428
|
-
draftCtx.showGridLines = false;
|
|
429
|
-
} else {
|
|
430
|
-
draftCtx.showGridLines = true;
|
|
431
|
-
}
|
|
432
|
-
} else {
|
|
433
|
-
draftCtx.showGridLines = true;
|
|
434
|
-
}
|
|
435
|
-
if (_.isNil(mergedSettings.lang)) {
|
|
436
|
-
var lang = navigator.languages && navigator.languages[0] || navigator.language || navigator.userLanguage;
|
|
437
|
-
draftCtx.lang = lang;
|
|
438
|
-
}
|
|
439
|
-
}, {
|
|
440
|
-
noHistory: true
|
|
441
|
-
});
|
|
442
|
-
}, [context.currentSheetId, context.luckysheetfile.length, originalData, mergedSettings.defaultRowHeight, mergedSettings.defaultColWidth, mergedSettings.column, mergedSettings.row, mergedSettings.defaultFontSize, mergedSettings.devicePixelRatio, mergedSettings.lang, mergedSettings.allowEdit, mergedSettings.hooks, mergedSettings.generateSheetId, setContextWithProduce, initSheetData, mergedSettings.rowHeaderWidth, mergedSettings.columnHeaderHeight, mergedSettings.addRows, mergedSettings.currency]);
|
|
443
|
-
var onKeyDown = useCallback(function (e) {
|
|
444
|
-
var nativeEvent = e.nativeEvent;
|
|
445
|
-
if ((e.ctrlKey || e.metaKey) && e.code === "KeyZ") {
|
|
446
|
-
if (e.shiftKey) {
|
|
447
|
-
handleRedo();
|
|
448
|
-
} else {
|
|
449
|
-
handleUndo();
|
|
450
|
-
}
|
|
451
|
-
e.stopPropagation();
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
454
|
-
if ((e.ctrlKey || e.metaKey) && e.code === "KeyY") {
|
|
455
|
-
handleRedo();
|
|
456
|
-
e.stopPropagation();
|
|
457
|
-
e.preventDefault();
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
setContextWithProduce(function (draftCtx) {
|
|
461
|
-
handleGlobalKeyDown(draftCtx, cellInput.current, fxInput.current, nativeEvent, globalCache.current, handleUndo, handleRedo, canvas.current.getContext("2d"));
|
|
462
|
-
});
|
|
463
|
-
}, [handleRedo, handleUndo, setContextWithProduce]);
|
|
464
|
-
var onPaste = useCallback(function (e) {
|
|
465
|
-
var _a;
|
|
466
|
-
if (cellInput.current === document.activeElement || ((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.className) === "fortune-sheet-overlay") {
|
|
467
|
-
var clipboardData = e.clipboardData;
|
|
468
|
-
if (!clipboardData) {
|
|
469
|
-
clipboardData = window.clipboardData;
|
|
470
|
-
}
|
|
471
|
-
var txtdata = clipboardData.getData("text/html") || clipboardData.getData("text/plain");
|
|
472
|
-
var ele = document.createElement("div");
|
|
473
|
-
ele.innerHTML = txtdata;
|
|
474
|
-
var trList = ele.querySelectorAll("table tr");
|
|
475
|
-
var maxRow = trList.length + context.luckysheet_select_save[0].row[0];
|
|
476
|
-
var rowToBeAdded = maxRow - context.luckysheetfile[getSheetIndex(context, context.currentSheetId)].data.length;
|
|
477
|
-
var range_1 = context.luckysheet_select_save;
|
|
478
|
-
if (rowToBeAdded > 0) {
|
|
479
|
-
var insertRowColOp_1 = {
|
|
480
|
-
type: "row",
|
|
481
|
-
index: context.luckysheetfile[getSheetIndex(context, context.currentSheetId)].data.length - 1,
|
|
482
|
-
count: rowToBeAdded,
|
|
483
|
-
direction: "rightbottom",
|
|
484
|
-
id: context.currentSheetId
|
|
485
|
-
};
|
|
486
|
-
setContextWithProduce(function (draftCtx) {
|
|
487
|
-
insertRowCol(draftCtx, insertRowColOp_1);
|
|
488
|
-
draftCtx.luckysheet_select_save = range_1;
|
|
489
|
-
}, {
|
|
490
|
-
insertRowColOp: insertRowColOp_1
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
setContextWithProduce(function (draftCtx) {
|
|
494
|
-
try {
|
|
495
|
-
handlePaste(draftCtx, e);
|
|
496
|
-
} catch (err) {
|
|
497
|
-
console.error(err);
|
|
498
|
-
}
|
|
499
|
-
});
|
|
500
|
-
}
|
|
501
|
-
}, [context, setContextWithProduce]);
|
|
502
|
-
var onMoreToolbarItemsClose = useCallback(function () {
|
|
503
|
-
setMoreToolbarItems(null);
|
|
504
|
-
}, []);
|
|
505
|
-
useEffect(function () {
|
|
506
|
-
document.addEventListener("paste", onPaste);
|
|
507
|
-
return function () {
|
|
508
|
-
document.removeEventListener("paste", onPaste);
|
|
509
|
-
};
|
|
510
|
-
}, [onPaste]);
|
|
511
|
-
useImperativeHandle(ref, function () {
|
|
512
|
-
return generateAPIs(context, setContextWithProduce, handleUndo, handleRedo, mergedSettings, cellInput.current, scrollbarX.current, scrollbarY.current, globalCache.current);
|
|
513
|
-
}, [context, setContextWithProduce, handleUndo, handleRedo, mergedSettings, globalCache]);
|
|
514
|
-
var i = getSheetIndex(context, context.currentSheetId);
|
|
515
|
-
if (i == null) {
|
|
516
|
-
return null;
|
|
517
|
-
}
|
|
518
|
-
var sheet = (_b = context.luckysheetfile) === null || _b === void 0 ? void 0 : _b[i];
|
|
519
|
-
if (!sheet) {
|
|
520
|
-
return null;
|
|
521
|
-
}
|
|
522
|
-
return /*#__PURE__*/React.createElement(WorkbookContext.Provider, {
|
|
523
|
-
value: providerValue
|
|
524
|
-
}, /*#__PURE__*/React.createElement(ModalProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
525
|
-
className: "fortune-container",
|
|
526
|
-
ref: workbookContainer,
|
|
527
|
-
onKeyDown: onKeyDown
|
|
528
|
-
}, /*#__PURE__*/React.createElement(SVGDefines, {
|
|
529
|
-
currency: mergedSettings.currency
|
|
530
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
531
|
-
className: "fortune-workarea"
|
|
532
|
-
}, mergedSettings.showToolbar && (/*#__PURE__*/React.createElement(Toolbar, {
|
|
533
|
-
moreItemsOpen: moreToolbarItems !== null,
|
|
534
|
-
setMoreItems: setMoreToolbarItems,
|
|
535
|
-
onMoreToolbarItemsClose: onMoreToolbarItemsClose,
|
|
536
|
-
moreToolbarItems: moreToolbarItems
|
|
537
|
-
})), mergedSettings.showFormulaBar && /*#__PURE__*/React.createElement(FxEditor, null)), /*#__PURE__*/React.createElement(Sheet, {
|
|
538
|
-
sheet: sheet
|
|
539
|
-
}), mergedSettings.showSheetTabs && /*#__PURE__*/React.createElement(SheetTab, null), /*#__PURE__*/React.createElement(ContextMenu, null), /*#__PURE__*/React.createElement(FilterMenu, null), /*#__PURE__*/React.createElement(SheetTabContextMenu, null), context.showSheetList && /*#__PURE__*/React.createElement(SheetList, null), !_.isEmpty(context.contextMenu) && (/*#__PURE__*/React.createElement("div", {
|
|
540
|
-
onMouseDown: function onMouseDown() {
|
|
541
|
-
setContextWithProduce(function (draftCtx) {
|
|
542
|
-
draftCtx.contextMenu = {};
|
|
543
|
-
draftCtx.filterContextMenu = undefined;
|
|
544
|
-
draftCtx.showSheetList = undefined;
|
|
545
|
-
});
|
|
546
|
-
},
|
|
547
|
-
onMouseMove: function onMouseMove(e) {
|
|
548
|
-
return e.stopPropagation();
|
|
549
|
-
},
|
|
550
|
-
onMouseUp: function onMouseUp(e) {
|
|
551
|
-
return e.stopPropagation();
|
|
552
|
-
},
|
|
553
|
-
onContextMenu: function onContextMenu(e) {
|
|
554
|
-
e.preventDefault();
|
|
555
|
-
e.stopPropagation();
|
|
556
|
-
},
|
|
557
|
-
className: "fortune-popover-backdrop"
|
|
558
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
559
|
-
className: "fortune-stat-area"
|
|
560
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
561
|
-
className: "luckysheet-sheet-selection-calInfo"
|
|
562
|
-
}, !!calInfo.count && (/*#__PURE__*/React.createElement("div", {
|
|
563
|
-
style: {
|
|
564
|
-
width: "60px"
|
|
565
|
-
}
|
|
566
|
-
}, formula.count, ": ", calInfo.count)), !!calInfo.numberC && !!calInfo.sum && (/*#__PURE__*/React.createElement("div", null, formula.sum, ": ", calInfo.sum)), !!calInfo.numberC && !!calInfo.average && (/*#__PURE__*/React.createElement("div", null, formula.average, ": ", calInfo.average)), !!calInfo.numberC && !!calInfo.max && (/*#__PURE__*/React.createElement("div", null, formula.max, ": ", calInfo.max)), !!calInfo.numberC && !!calInfo.min && (/*#__PURE__*/React.createElement("div", null, formula.min, ": ", calInfo.min)))), context.showDunePreview && (/*#__PURE__*/React.createElement(DunePreview, {
|
|
567
|
-
url: context.showDunePreview.url,
|
|
568
|
-
position: context.showDunePreview.position,
|
|
569
|
-
onKeepAsLink: function onKeepAsLink() {
|
|
570
|
-
setContextWithProduce(function (draftCtx) {
|
|
571
|
-
draftCtx.showDunePreview = undefined;
|
|
572
|
-
}, {
|
|
573
|
-
noHistory: true
|
|
574
|
-
});
|
|
575
|
-
},
|
|
576
|
-
onEmbed: function onEmbed() {
|
|
577
|
-
var _a;
|
|
578
|
-
setContextWithProduce(function (draftCtx) {
|
|
579
|
-
insertDuneChart(draftCtx, context.showDunePreview.url);
|
|
580
|
-
draftCtx.showDunePreview = undefined;
|
|
581
|
-
}, {
|
|
582
|
-
noHistory: true
|
|
583
|
-
});
|
|
584
|
-
(_a = mergedSettings.onDuneChartEmbed) === null || _a === void 0 ? void 0 : _a.call(mergedSettings);
|
|
585
|
-
}
|
|
586
|
-
})))));
|
|
587
|
-
});
|
|
588
|
-
export default Workbook;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
.fortune-zoom-container {
|
|
2
|
-
white-space: nowrap;
|
|
3
|
-
overflow: visible;
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
user-select: none;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.fortune-zoom-button {
|
|
10
|
-
display: flex;
|
|
11
|
-
cursor: pointer;
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
width: 24px;
|
|
15
|
-
height: 24px;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.fortune-zoom-button:hover {
|
|
19
|
-
background: #efefef;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.fortune-zoom-ratio {
|
|
23
|
-
position: relative;
|
|
24
|
-
display: flex;
|
|
25
|
-
justify-content: center;
|
|
26
|
-
width: 48px;
|
|
27
|
-
color: #1e1e1f;
|
|
28
|
-
font-size: 12px;
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.fortune-zoom-ratio-current {
|
|
33
|
-
width: 100%;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.fortune-zoom-ratio-item:hover {
|
|
37
|
-
background: #efefef;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.fortune-zoom-ratio-menu {
|
|
41
|
-
position: absolute;
|
|
42
|
-
bottom: 30px;
|
|
43
|
-
left: 0;
|
|
44
|
-
line-height: 24px;
|
|
45
|
-
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
|
|
46
|
-
padding: 10px 0px 10px 0px;
|
|
47
|
-
border-radius: 6px;
|
|
48
|
-
background: white;
|
|
49
|
-
z-index: 1004;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.fortune-zoom-ratio-text {
|
|
53
|
-
padding: 0px 10px 0px 10px;
|
|
54
|
-
}
|