@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,1347 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getLucideIcon = exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _fortuneCore = require("@fileverse-dev/fortune-core");
|
|
10
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
|
11
|
-
var _ui = require("@fileverse/ui");
|
|
12
|
-
var _context = _interopRequireDefault(require("../../context"));
|
|
13
|
-
require("./index.css");
|
|
14
|
-
var _Button = _interopRequireDefault(require("./Button"));
|
|
15
|
-
var _Divider = _interopRequireWildcard(require("./Divider"));
|
|
16
|
-
var _Combo = _interopRequireDefault(require("./Combo"));
|
|
17
|
-
var _Select = _interopRequireWildcard(require("./Select"));
|
|
18
|
-
var _SVGIcon = _interopRequireDefault(require("../SVGIcon"));
|
|
19
|
-
var _useDialog = require("../../hooks/useDialog");
|
|
20
|
-
var _SplitColumn = require("../SplitColumn");
|
|
21
|
-
var _LocationCondition = require("../LocationCondition");
|
|
22
|
-
var _DataVerification = _interopRequireDefault(require("../DataVerification"));
|
|
23
|
-
var _ConditionFormat = _interopRequireDefault(require("../ConditionFormat"));
|
|
24
|
-
var _CustomButton = _interopRequireDefault(require("./CustomButton"));
|
|
25
|
-
var _CustomColor = require("./CustomColor");
|
|
26
|
-
var _FormatSearch = require("../FormatSearch");
|
|
27
|
-
var _DuneChartsInputModal = _interopRequireDefault(require("../DuneChartsInputModal/DuneChartsInputModal"));
|
|
28
|
-
var _MoreItemsContainer = _interopRequireDefault(require("./MoreItemsContainer"));
|
|
29
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
31
|
-
var getLucideIcon = exports.getLucideIcon = function getLucideIcon(title) {
|
|
32
|
-
switch (title) {
|
|
33
|
-
case "undo":
|
|
34
|
-
return "Undo";
|
|
35
|
-
case "redo":
|
|
36
|
-
return "Redo";
|
|
37
|
-
case "bold":
|
|
38
|
-
return "Bold";
|
|
39
|
-
case "italic":
|
|
40
|
-
return "Italic";
|
|
41
|
-
case "strike-through":
|
|
42
|
-
return "Strikethrough";
|
|
43
|
-
case "underline":
|
|
44
|
-
return "Underline";
|
|
45
|
-
case "align-left":
|
|
46
|
-
return "AlignLeft";
|
|
47
|
-
case "align-center":
|
|
48
|
-
return "AlignCenter";
|
|
49
|
-
case "align-right":
|
|
50
|
-
return "AlignRight";
|
|
51
|
-
case "align-top":
|
|
52
|
-
return "ArrowUpFromLine";
|
|
53
|
-
case "align-middle":
|
|
54
|
-
return "AlignVerticalMiddle";
|
|
55
|
-
case "align-bottom":
|
|
56
|
-
return "ArrowDownToLine";
|
|
57
|
-
case "text-overflow":
|
|
58
|
-
return "TextOverflow";
|
|
59
|
-
case "text-wrap":
|
|
60
|
-
return "WrapText";
|
|
61
|
-
case "text-clip":
|
|
62
|
-
return "TextClip";
|
|
63
|
-
case "font-color":
|
|
64
|
-
return "Baseline";
|
|
65
|
-
case "background":
|
|
66
|
-
return "PaintBucket";
|
|
67
|
-
case "border-all":
|
|
68
|
-
return "Border";
|
|
69
|
-
case "merge-all":
|
|
70
|
-
return "MergeHorizontal";
|
|
71
|
-
case "format":
|
|
72
|
-
return "DollarSign";
|
|
73
|
-
case "currency-format":
|
|
74
|
-
return "DollarSign";
|
|
75
|
-
case "percentage-format":
|
|
76
|
-
return "Percent";
|
|
77
|
-
case "number-decrease":
|
|
78
|
-
return "DecimalsArrowLeft";
|
|
79
|
-
case "number-increase":
|
|
80
|
-
return "DecimalsArrowRight";
|
|
81
|
-
case "conditionFormat":
|
|
82
|
-
return "PaintbrushVertical";
|
|
83
|
-
case "filter":
|
|
84
|
-
return "Filter";
|
|
85
|
-
case "link":
|
|
86
|
-
return "Link";
|
|
87
|
-
case "comment":
|
|
88
|
-
return "MessageSquarePlus";
|
|
89
|
-
case "image":
|
|
90
|
-
return "Image";
|
|
91
|
-
case "formula-sum":
|
|
92
|
-
return "Sigma";
|
|
93
|
-
case "dataVerification":
|
|
94
|
-
return "ShieldCheck";
|
|
95
|
-
case "search":
|
|
96
|
-
return "Search";
|
|
97
|
-
case "dune":
|
|
98
|
-
return "DuneChart";
|
|
99
|
-
case "Ellipsis":
|
|
100
|
-
return "Ellipsis";
|
|
101
|
-
default:
|
|
102
|
-
return "";
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
var Toolbar = function Toolbar(_a) {
|
|
106
|
-
var _b, _c, _d;
|
|
107
|
-
var setMoreItems = _a.setMoreItems,
|
|
108
|
-
moreItemsOpen = _a.moreItemsOpen,
|
|
109
|
-
onMoreToolbarItemsClose = _a.onMoreToolbarItemsClose,
|
|
110
|
-
moreToolbarItems = _a.moreToolbarItems;
|
|
111
|
-
var _e = (0, _react.useContext)(_context.default),
|
|
112
|
-
context = _e.context,
|
|
113
|
-
setContext = _e.setContext,
|
|
114
|
-
refs = _e.refs,
|
|
115
|
-
settings = _e.settings,
|
|
116
|
-
handleUndo = _e.handleUndo,
|
|
117
|
-
handleRedo = _e.handleRedo;
|
|
118
|
-
var contextRef = (0, _react.useRef)(context);
|
|
119
|
-
var containerRef = (0, _react.useRef)(null);
|
|
120
|
-
var _f = (0, _react.useState)(-1),
|
|
121
|
-
toolbarWrapIndex = _f[0],
|
|
122
|
-
setToolbarWrapIndex = _f[1];
|
|
123
|
-
var _g = (0, _react.useState)([]),
|
|
124
|
-
itemLocations = _g[0],
|
|
125
|
-
setItemLocations = _g[1];
|
|
126
|
-
var _h = (0, _react.useState)(false),
|
|
127
|
-
showDuneModal = _h[0],
|
|
128
|
-
setShowDuneModal = _h[1];
|
|
129
|
-
var _j = (0, _react.useState)(window.innerWidth >= 1280),
|
|
130
|
-
isDesktop = _j[0],
|
|
131
|
-
setIsDesktop = _j[1];
|
|
132
|
-
var _k = (0, _useDialog.useDialog)(),
|
|
133
|
-
showDialog = _k.showDialog,
|
|
134
|
-
hideDialog = _k.hideDialog;
|
|
135
|
-
var firstSelection = (_b = context.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b[0];
|
|
136
|
-
var flowdata = (0, _fortuneCore.getFlowdata)(context);
|
|
137
|
-
contextRef.current = context;
|
|
138
|
-
var row = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.row_focus;
|
|
139
|
-
var col = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
|
|
140
|
-
var cell = flowdata && row != null && col != null ? (_c = flowdata === null || flowdata === void 0 ? void 0 : flowdata[row]) === null || _c === void 0 ? void 0 : _c[col] : undefined;
|
|
141
|
-
var _l = (0, _fortuneCore.locale)(context),
|
|
142
|
-
toolbar = _l.toolbar,
|
|
143
|
-
merge = _l.merge,
|
|
144
|
-
border = _l.border,
|
|
145
|
-
freezen = _l.freezen,
|
|
146
|
-
defaultFmt = _l.defaultFmt,
|
|
147
|
-
formula = _l.formula,
|
|
148
|
-
sort = _l.sort,
|
|
149
|
-
align = _l.align,
|
|
150
|
-
textWrap = _l.textWrap,
|
|
151
|
-
rotation = _l.rotation,
|
|
152
|
-
screenshot = _l.screenshot,
|
|
153
|
-
filter = _l.filter,
|
|
154
|
-
splitText = _l.splitText,
|
|
155
|
-
findAndReplace = _l.findAndReplace,
|
|
156
|
-
comment = _l.comment,
|
|
157
|
-
fontarray = _l.fontarray;
|
|
158
|
-
var toolbarFormat = (0, _fortuneCore.locale)(context).format;
|
|
159
|
-
var sheetWidth = context.luckysheetTableContentHW[0];
|
|
160
|
-
var currency = settings.currency;
|
|
161
|
-
var defaultFormat = defaultFmt(currency);
|
|
162
|
-
var customColor = (0, _react.useState)("#000000")[0];
|
|
163
|
-
var customStyle = (0, _react.useState)("1")[0];
|
|
164
|
-
var showSubMenu = (0, _react.useCallback)(function (e, className) {
|
|
165
|
-
var target = e.target;
|
|
166
|
-
var menuItem = target.className === "fortune-toolbar-menu-line" ? target.parentElement : target;
|
|
167
|
-
var menuItemRect = menuItem.getBoundingClientRect();
|
|
168
|
-
var workbookContainerRect = refs.workbookContainer.current.getBoundingClientRect();
|
|
169
|
-
var subMenu = menuItem.querySelector(".".concat(className));
|
|
170
|
-
if (_lodash.default.isNil(subMenu)) return;
|
|
171
|
-
var menuItemStyle = window.getComputedStyle(menuItem);
|
|
172
|
-
var menuItemPaddingRight = parseFloat(menuItemStyle.getPropertyValue("padding-right").replace("px", ""));
|
|
173
|
-
if (workbookContainerRect.right - menuItemRect.right < parseFloat(subMenu.style.width.replace("px", ""))) {
|
|
174
|
-
subMenu.style.display = "block";
|
|
175
|
-
subMenu.style.right = "".concat(menuItemRect.width - menuItemPaddingRight, "px");
|
|
176
|
-
} else {
|
|
177
|
-
subMenu.style.display = "block";
|
|
178
|
-
subMenu.style.right = className === "more-format" ? "".concat(-(parseFloat(subMenu.style.width.replace("px", "")) + 0), "px") : "".concat(-(parseFloat(subMenu.style.width.replace("px", "")) + menuItemPaddingRight), "px");
|
|
179
|
-
}
|
|
180
|
-
}, [refs.workbookContainer]);
|
|
181
|
-
var hideSubMenu = (0, _react.useCallback)(function (e, className) {
|
|
182
|
-
var target = e.target;
|
|
183
|
-
if (target.className === "".concat(className)) {
|
|
184
|
-
target.style.display = "none";
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
var subMenu = target.className === "condition-format-item" ? target.parentElement : target.querySelector(".".concat(className));
|
|
188
|
-
if (_lodash.default.isNil(subMenu)) return;
|
|
189
|
-
subMenu.style.display = "none";
|
|
190
|
-
}, []);
|
|
191
|
-
(0, _react.useEffect)(function () {
|
|
192
|
-
var handleResize = function handleResize() {
|
|
193
|
-
setIsDesktop(window.innerWidth >= 1280);
|
|
194
|
-
};
|
|
195
|
-
window.addEventListener("resize", handleResize);
|
|
196
|
-
return function () {
|
|
197
|
-
return window.removeEventListener("resize", handleResize);
|
|
198
|
-
};
|
|
199
|
-
}, []);
|
|
200
|
-
(0, _react.useEffect)(function () {
|
|
201
|
-
setToolbarWrapIndex(-1);
|
|
202
|
-
}, [settings.toolbarItems, settings.customToolbarItems]);
|
|
203
|
-
(0, _react.useEffect)(function () {
|
|
204
|
-
if (toolbarWrapIndex === -1) {
|
|
205
|
-
var container = containerRef.current;
|
|
206
|
-
if (!container) return;
|
|
207
|
-
var items = container.querySelectorAll(".fortune-toolbar-item");
|
|
208
|
-
if (!items) return;
|
|
209
|
-
var locations = [];
|
|
210
|
-
var containerRect = container.getBoundingClientRect();
|
|
211
|
-
for (var i = 0; i < items.length; i += 1) {
|
|
212
|
-
var item = items[i];
|
|
213
|
-
var itemRect = item.getBoundingClientRect();
|
|
214
|
-
locations.push(itemRect.left - containerRect.left + itemRect.width);
|
|
215
|
-
}
|
|
216
|
-
setItemLocations(locations);
|
|
217
|
-
}
|
|
218
|
-
}, [toolbarWrapIndex, sheetWidth]);
|
|
219
|
-
(0, _react.useEffect)(function () {
|
|
220
|
-
if (isDesktop) {
|
|
221
|
-
setToolbarWrapIndex(-1);
|
|
222
|
-
setMoreItems(null);
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
if (itemLocations.length === 0) return;
|
|
226
|
-
var container = containerRef.current;
|
|
227
|
-
if (!container) return;
|
|
228
|
-
var moreButtonWidth = 50;
|
|
229
|
-
var containerWidth = container.getBoundingClientRect().width;
|
|
230
|
-
var availableWidth = containerWidth - 30;
|
|
231
|
-
for (var i = itemLocations.length - 1; i >= 0; i -= 1) {
|
|
232
|
-
var loc = itemLocations[i];
|
|
233
|
-
if (loc + moreButtonWidth < availableWidth) {
|
|
234
|
-
setToolbarWrapIndex(i - itemLocations.length + settings.toolbarItems.length);
|
|
235
|
-
if (i === itemLocations.length - 1) {
|
|
236
|
-
setMoreItems(null);
|
|
237
|
-
}
|
|
238
|
-
break;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}, [itemLocations, setMoreItems, settings.toolbarItems.length, sheetWidth, isDesktop]);
|
|
242
|
-
var getToolbarItem = (0, _react.useCallback)(function (name, i) {
|
|
243
|
-
var _a, _b, _c, _d, _e, _f;
|
|
244
|
-
var tooltip = toolbar[name];
|
|
245
|
-
if (name === "|") {
|
|
246
|
-
return /*#__PURE__*/_react.default.createElement(_Divider.default, {
|
|
247
|
-
key: i
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
if (["font-color", "background"].includes(name)) {
|
|
251
|
-
var pick_1 = function pick_1(color) {
|
|
252
|
-
setContext(function (draftCtx) {
|
|
253
|
-
return (name === "font-color" ? _fortuneCore.handleTextColor : _fortuneCore.handleTextBackground)(draftCtx, refs.cellInput.current, color);
|
|
254
|
-
});
|
|
255
|
-
if (name === "font-color") {
|
|
256
|
-
refs.globalCache.recentTextColor = color;
|
|
257
|
-
} else {
|
|
258
|
-
refs.globalCache.recentBackgroundColor = color;
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
262
|
-
style: {
|
|
263
|
-
position: "relative"
|
|
264
|
-
},
|
|
265
|
-
key: name
|
|
266
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
267
|
-
style: {
|
|
268
|
-
width: 24,
|
|
269
|
-
height: 4,
|
|
270
|
-
backgroundColor: name === "font-color" ? refs.globalCache.recentTextColor : refs.globalCache.recentBackgroundColor,
|
|
271
|
-
position: "absolute",
|
|
272
|
-
bottom: 2,
|
|
273
|
-
left: 3,
|
|
274
|
-
zIndex: 100
|
|
275
|
-
}
|
|
276
|
-
}), /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
277
|
-
iconId: name,
|
|
278
|
-
tooltip: tooltip,
|
|
279
|
-
showArrow: false,
|
|
280
|
-
fillColor: name === "font-color" ? refs.globalCache.recentTextColor : undefined,
|
|
281
|
-
onClick: function onClick() {
|
|
282
|
-
var color = name === "font-color" ? refs.globalCache.recentTextColor : refs.globalCache.recentBackgroundColor;
|
|
283
|
-
if (color) pick_1(color);
|
|
284
|
-
}
|
|
285
|
-
}, function (setOpen) {
|
|
286
|
-
return /*#__PURE__*/_react.default.createElement(_CustomColor.CustomColor, {
|
|
287
|
-
onCustomPick: function onCustomPick(color) {
|
|
288
|
-
pick_1(color);
|
|
289
|
-
setOpen(false);
|
|
290
|
-
},
|
|
291
|
-
onColorPick: pick_1
|
|
292
|
-
});
|
|
293
|
-
}));
|
|
294
|
-
}
|
|
295
|
-
if (name === "format") {
|
|
296
|
-
var currentFmt = defaultFormat[0].text;
|
|
297
|
-
if (cell) {
|
|
298
|
-
var curr_1 = (0, _fortuneCore.normalizedCellAttr)(cell, "ct");
|
|
299
|
-
var format = _lodash.default.find(defaultFormat, function (v) {
|
|
300
|
-
return v.value === (curr_1 === null || curr_1 === void 0 ? void 0 : curr_1.fa);
|
|
301
|
-
});
|
|
302
|
-
if ((curr_1 === null || curr_1 === void 0 ? void 0 : curr_1.fa) != null) {
|
|
303
|
-
if (format != null) {
|
|
304
|
-
currentFmt = format.text;
|
|
305
|
-
} else {
|
|
306
|
-
currentFmt = defaultFormat[defaultFormat.length - 1].text;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
311
|
-
text: currentFmt,
|
|
312
|
-
key: name,
|
|
313
|
-
tooltip: tooltip,
|
|
314
|
-
showArrow: false
|
|
315
|
-
}, function (setOpen) {
|
|
316
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, null, defaultFormat.map(function (_a, ii) {
|
|
317
|
-
var text = _a.text,
|
|
318
|
-
value = _a.value,
|
|
319
|
-
example = _a.example;
|
|
320
|
-
if (value === "split") {
|
|
321
|
-
return /*#__PURE__*/_react.default.createElement(_Divider.MenuDivider, {
|
|
322
|
-
key: ii
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
if (value === "fmtOtherSelf") {
|
|
326
|
-
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
327
|
-
key: value,
|
|
328
|
-
onClick: function onClick() {
|
|
329
|
-
showDialog(/*#__PURE__*/_react.default.createElement(_FormatSearch.FormatSearch, {
|
|
330
|
-
onCancel: hideDialog,
|
|
331
|
-
type: "currency"
|
|
332
|
-
}), undefined, "Currency Format");
|
|
333
|
-
setOpen(false);
|
|
334
|
-
}
|
|
335
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
336
|
-
className: "fortune-toolbar-menu-line"
|
|
337
|
-
}, /*#__PURE__*/_react.default.createElement("div", null, text), /*#__PURE__*/_react.default.createElement("div", {
|
|
338
|
-
className: "fortune-toolbar-subtext"
|
|
339
|
-
}, example)));
|
|
340
|
-
}
|
|
341
|
-
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
342
|
-
key: value,
|
|
343
|
-
onClick: function onClick() {
|
|
344
|
-
setOpen(false);
|
|
345
|
-
setContext(function (ctx) {
|
|
346
|
-
var d = (0, _fortuneCore.getFlowdata)(ctx);
|
|
347
|
-
if (d == null) return;
|
|
348
|
-
(0, _fortuneCore.updateFormat)(ctx, refs.cellInput.current, d, "ct", value);
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
352
|
-
className: "fortune-toolbar-menu-line"
|
|
353
|
-
}, /*#__PURE__*/_react.default.createElement("div", null, text), /*#__PURE__*/_react.default.createElement("div", {
|
|
354
|
-
className: "fortune-toolbar-subtext"
|
|
355
|
-
}, example)));
|
|
356
|
-
}));
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
if (name === "font") {
|
|
360
|
-
var current_1 = fontarray[0];
|
|
361
|
-
if ((cell === null || cell === void 0 ? void 0 : cell.ff) != null) {
|
|
362
|
-
if (_lodash.default.isNumber(cell.ff)) {
|
|
363
|
-
current_1 = fontarray[cell.ff];
|
|
364
|
-
} else {
|
|
365
|
-
current_1 = cell.ff;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
369
|
-
text: current_1,
|
|
370
|
-
key: name,
|
|
371
|
-
tooltip: tooltip,
|
|
372
|
-
showArrow: false
|
|
373
|
-
}, function (setOpen) {
|
|
374
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, null, fontarray.map(function (o) {
|
|
375
|
-
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
376
|
-
key: o,
|
|
377
|
-
onClick: function onClick() {
|
|
378
|
-
setContext(function (ctx) {
|
|
379
|
-
current_1 = o;
|
|
380
|
-
var d = (0, _fortuneCore.getFlowdata)(ctx);
|
|
381
|
-
if (!d) return;
|
|
382
|
-
(0, _fortuneCore.updateFormat)(ctx, refs.cellInput.current, d, "ff", o);
|
|
383
|
-
});
|
|
384
|
-
setOpen(false);
|
|
385
|
-
}
|
|
386
|
-
}, o);
|
|
387
|
-
}));
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
if (name === "font-size") {
|
|
391
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
392
|
-
text: cell ? (0, _fortuneCore.normalizedCellAttr)(cell, "fs", context.defaultFontSize) : context.defaultFontSize.toString(),
|
|
393
|
-
key: name,
|
|
394
|
-
tooltip: tooltip,
|
|
395
|
-
showArrow: false
|
|
396
|
-
}, function (setOpen) {
|
|
397
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
398
|
-
style: {
|
|
399
|
-
minWidth: "fit-content",
|
|
400
|
-
width: "50px"
|
|
401
|
-
}
|
|
402
|
-
}, [9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72].map(function (num) {
|
|
403
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
404
|
-
className: "fortune-toolbar-select-option text-body-sm text-center color-text-default",
|
|
405
|
-
style: {
|
|
406
|
-
minWidth: "fit-content",
|
|
407
|
-
padding: "0px",
|
|
408
|
-
width: "36px",
|
|
409
|
-
height: "36px",
|
|
410
|
-
display: "flex",
|
|
411
|
-
alignItems: "center",
|
|
412
|
-
justifyContent: "center",
|
|
413
|
-
fontSize: "14px"
|
|
414
|
-
},
|
|
415
|
-
key: num,
|
|
416
|
-
onClick: function onClick() {
|
|
417
|
-
setContext(function (draftContext) {
|
|
418
|
-
return (0, _fortuneCore.handleTextSize)(draftContext, refs.cellInput.current, num, refs.canvas.current.getContext("2d"));
|
|
419
|
-
});
|
|
420
|
-
setOpen(false);
|
|
421
|
-
}
|
|
422
|
-
}, num);
|
|
423
|
-
}));
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
if (name === "horizontal-align") {
|
|
427
|
-
var items_1 = [{
|
|
428
|
-
title: "align-left",
|
|
429
|
-
text: align.left,
|
|
430
|
-
value: 1
|
|
431
|
-
}, {
|
|
432
|
-
title: "align-center",
|
|
433
|
-
text: align.center,
|
|
434
|
-
value: 0
|
|
435
|
-
}, {
|
|
436
|
-
title: "align-right",
|
|
437
|
-
text: align.right,
|
|
438
|
-
value: 2
|
|
439
|
-
}];
|
|
440
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
441
|
-
iconId: ((_a = _lodash.default.find(items_1, function (item) {
|
|
442
|
-
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.ht);
|
|
443
|
-
})) === null || _a === void 0 ? void 0 : _a.title) || "align-left",
|
|
444
|
-
key: name,
|
|
445
|
-
tooltip: toolbar.horizontalAlign,
|
|
446
|
-
showArrow: false
|
|
447
|
-
}, function (setOpen) {
|
|
448
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
449
|
-
style: {
|
|
450
|
-
minWidth: "fit-content",
|
|
451
|
-
display: "flex",
|
|
452
|
-
flexDirection: "row",
|
|
453
|
-
alignItems: "center",
|
|
454
|
-
justifyContent: "center",
|
|
455
|
-
gap: 4
|
|
456
|
-
}
|
|
457
|
-
}, items_1.map(function (_a) {
|
|
458
|
-
var _b;
|
|
459
|
-
var title = _a.title;
|
|
460
|
-
return /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
|
|
461
|
-
key: title,
|
|
462
|
-
isActive: ((_b = _lodash.default.find(items_1, function (item) {
|
|
463
|
-
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.ht);
|
|
464
|
-
})) === null || _b === void 0 ? void 0 : _b.title) === title,
|
|
465
|
-
icon: getLucideIcon(title),
|
|
466
|
-
variant: "ghost",
|
|
467
|
-
onClick: function onClick() {
|
|
468
|
-
setContext(function (ctx) {
|
|
469
|
-
(0, _fortuneCore.handleHorizontalAlign)(ctx, refs.cellInput.current, title.replace("align-", ""));
|
|
470
|
-
});
|
|
471
|
-
setOpen(false);
|
|
472
|
-
},
|
|
473
|
-
tabIndex: 0
|
|
474
|
-
});
|
|
475
|
-
}));
|
|
476
|
-
});
|
|
477
|
-
}
|
|
478
|
-
if (name === "vertical-align") {
|
|
479
|
-
var items_2 = [{
|
|
480
|
-
title: "align-top",
|
|
481
|
-
text: align.top,
|
|
482
|
-
value: 1
|
|
483
|
-
}, {
|
|
484
|
-
title: "align-middle",
|
|
485
|
-
text: align.middle,
|
|
486
|
-
value: 0
|
|
487
|
-
}, {
|
|
488
|
-
title: "align-bottom",
|
|
489
|
-
text: align.bottom,
|
|
490
|
-
value: 2
|
|
491
|
-
}];
|
|
492
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
493
|
-
iconId: ((_b = _lodash.default.find(items_2, function (item) {
|
|
494
|
-
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
|
|
495
|
-
})) === null || _b === void 0 ? void 0 : _b.title) || "align-top",
|
|
496
|
-
key: name,
|
|
497
|
-
tooltip: toolbar.verticalAlign,
|
|
498
|
-
showArrow: false
|
|
499
|
-
}, function (setOpen) {
|
|
500
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
501
|
-
style: {
|
|
502
|
-
minWidth: "fit-content",
|
|
503
|
-
display: "flex",
|
|
504
|
-
flexDirection: "row",
|
|
505
|
-
alignItems: "center",
|
|
506
|
-
justifyContent: "center",
|
|
507
|
-
gap: 4
|
|
508
|
-
}
|
|
509
|
-
}, items_2.map(function (_a) {
|
|
510
|
-
var _b;
|
|
511
|
-
var title = _a.title;
|
|
512
|
-
return /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
|
|
513
|
-
key: title,
|
|
514
|
-
isActive: ((_b = _lodash.default.find(items_2, function (item) {
|
|
515
|
-
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
|
|
516
|
-
})) === null || _b === void 0 ? void 0 : _b.title) === title,
|
|
517
|
-
icon: getLucideIcon(title),
|
|
518
|
-
variant: "ghost",
|
|
519
|
-
onClick: function onClick() {
|
|
520
|
-
setContext(function (ctx) {
|
|
521
|
-
(0, _fortuneCore.handleVerticalAlign)(ctx, refs.cellInput.current, title.replace("align-", ""));
|
|
522
|
-
});
|
|
523
|
-
setOpen(false);
|
|
524
|
-
},
|
|
525
|
-
tabIndex: 0
|
|
526
|
-
});
|
|
527
|
-
}));
|
|
528
|
-
});
|
|
529
|
-
}
|
|
530
|
-
if (name === "undo") {
|
|
531
|
-
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
532
|
-
iconId: name,
|
|
533
|
-
tooltip: tooltip,
|
|
534
|
-
key: name,
|
|
535
|
-
disabled: refs.globalCache.undoList.length === 0,
|
|
536
|
-
onClick: function onClick() {
|
|
537
|
-
return handleUndo();
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
if (name === "redo") {
|
|
542
|
-
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
543
|
-
iconId: name,
|
|
544
|
-
tooltip: tooltip,
|
|
545
|
-
key: name,
|
|
546
|
-
disabled: refs.globalCache.redoList.length === 0,
|
|
547
|
-
onClick: function onClick() {
|
|
548
|
-
return handleRedo();
|
|
549
|
-
}
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
if (name === "screenshot") {
|
|
553
|
-
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
554
|
-
iconId: name,
|
|
555
|
-
tooltip: tooltip,
|
|
556
|
-
key: name,
|
|
557
|
-
onClick: function onClick() {
|
|
558
|
-
var imgsrc = (0, _fortuneCore.handleScreenShot)(contextRef.current);
|
|
559
|
-
if (imgsrc) {
|
|
560
|
-
showDialog(/*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", null, screenshot.screenshotTipSuccess), /*#__PURE__*/_react.default.createElement("img", {
|
|
561
|
-
src: imgsrc,
|
|
562
|
-
alt: "",
|
|
563
|
-
style: {
|
|
564
|
-
maxWidth: "100%",
|
|
565
|
-
maxHeight: "100%"
|
|
566
|
-
}
|
|
567
|
-
})));
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
|
-
}
|
|
572
|
-
if (name === "splitColumn") {
|
|
573
|
-
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
574
|
-
iconId: name,
|
|
575
|
-
tooltip: tooltip,
|
|
576
|
-
key: name,
|
|
577
|
-
onClick: function onClick() {
|
|
578
|
-
if (context.allowEdit === false) return;
|
|
579
|
-
if (_lodash.default.isUndefined(context.luckysheet_select_save)) {
|
|
580
|
-
showDialog(splitText.tipNoSelect, "ok");
|
|
581
|
-
} else {
|
|
582
|
-
var currentColumn = context.luckysheet_select_save[context.luckysheet_select_save.length - 1].column;
|
|
583
|
-
if (context.luckysheet_select_save.length > 1) {
|
|
584
|
-
showDialog(splitText.tipNoMulti, "ok");
|
|
585
|
-
} else if (currentColumn[0] !== currentColumn[1]) {
|
|
586
|
-
showDialog(splitText.tipNoMultiColumn, "ok");
|
|
587
|
-
} else {
|
|
588
|
-
showDialog(/*#__PURE__*/_react.default.createElement(_SplitColumn.SplitColumn, null));
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
if (name === "dataVerification") {
|
|
595
|
-
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
596
|
-
iconId: name,
|
|
597
|
-
tooltip: tooltip,
|
|
598
|
-
key: name,
|
|
599
|
-
onClick: function onClick() {
|
|
600
|
-
if (context.allowEdit === false) return;
|
|
601
|
-
showDialog(/*#__PURE__*/_react.default.createElement(_DataVerification.default, null), undefined, toolbar.dataVerification);
|
|
602
|
-
}
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
if (name === "locationCondition") {
|
|
606
|
-
var items_3 = [{
|
|
607
|
-
text: findAndReplace.location,
|
|
608
|
-
value: "location"
|
|
609
|
-
}, {
|
|
610
|
-
text: findAndReplace.locationFormula,
|
|
611
|
-
value: "locationFormula"
|
|
612
|
-
}, {
|
|
613
|
-
text: findAndReplace.locationDate,
|
|
614
|
-
value: "locationDate"
|
|
615
|
-
}, {
|
|
616
|
-
text: findAndReplace.locationDigital,
|
|
617
|
-
value: "locationDigital"
|
|
618
|
-
}, {
|
|
619
|
-
text: findAndReplace.locationString,
|
|
620
|
-
value: "locationString"
|
|
621
|
-
}, {
|
|
622
|
-
text: findAndReplace.locationError,
|
|
623
|
-
value: "locationError"
|
|
624
|
-
}, {
|
|
625
|
-
text: findAndReplace.locationRowSpan,
|
|
626
|
-
value: "locationRowSpan"
|
|
627
|
-
}, {
|
|
628
|
-
text: findAndReplace.columnSpan,
|
|
629
|
-
value: "locationColumnSpan"
|
|
630
|
-
}];
|
|
631
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
632
|
-
iconId: "locationCondition",
|
|
633
|
-
key: name,
|
|
634
|
-
tooltip: findAndReplace.location,
|
|
635
|
-
showArrow: false
|
|
636
|
-
}, function (setOpen) {
|
|
637
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, null, items_3.map(function (_a) {
|
|
638
|
-
var text = _a.text,
|
|
639
|
-
value = _a.value;
|
|
640
|
-
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
641
|
-
key: value,
|
|
642
|
-
onClick: function onClick() {
|
|
643
|
-
var _a, _b, _c, _d, _e, _f;
|
|
644
|
-
if (context.luckysheet_select_save == null) {
|
|
645
|
-
showDialog(freezen.noSelectionError, "ok");
|
|
646
|
-
return;
|
|
647
|
-
}
|
|
648
|
-
var last = context.luckysheet_select_save[0];
|
|
649
|
-
var range;
|
|
650
|
-
var rangeArr = [];
|
|
651
|
-
if (((_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a.length) === 0 || ((_b = context.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b.length) === 1 && last.row[0] === last.row[1] && last.column[0] === last.column[1]) {
|
|
652
|
-
range = [{
|
|
653
|
-
row: [0, flowdata.length - 1],
|
|
654
|
-
column: [0, flowdata[0].length - 1]
|
|
655
|
-
}];
|
|
656
|
-
} else {
|
|
657
|
-
range = _lodash.default.assignIn([], context.luckysheet_select_save);
|
|
658
|
-
}
|
|
659
|
-
if (value === "location") {
|
|
660
|
-
showDialog(/*#__PURE__*/_react.default.createElement(_LocationCondition.LocationCondition, null));
|
|
661
|
-
} else if (value === "locationFormula") {
|
|
662
|
-
setContext(function (ctx) {
|
|
663
|
-
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationFormula", "all", ctx);
|
|
664
|
-
});
|
|
665
|
-
} else if (value === "locationDate") {
|
|
666
|
-
setContext(function (ctx) {
|
|
667
|
-
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationConstant", "d", ctx);
|
|
668
|
-
});
|
|
669
|
-
} else if (value === "locationDigital") {
|
|
670
|
-
setContext(function (ctx) {
|
|
671
|
-
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationConstant", "n", ctx);
|
|
672
|
-
});
|
|
673
|
-
} else if (value === "locationString") {
|
|
674
|
-
setContext(function (ctx) {
|
|
675
|
-
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationConstant", "s,g", ctx);
|
|
676
|
-
});
|
|
677
|
-
} else if (value === "locationError") {
|
|
678
|
-
setContext(function (ctx) {
|
|
679
|
-
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationConstant", "e", ctx);
|
|
680
|
-
});
|
|
681
|
-
} else if (value === "locationCondition") {
|
|
682
|
-
setContext(function (ctx) {
|
|
683
|
-
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationCF", undefined, ctx);
|
|
684
|
-
});
|
|
685
|
-
} else if (value === "locationRowSpan") {
|
|
686
|
-
if (((_c = context.luckysheet_select_save) === null || _c === void 0 ? void 0 : _c.length) === 0 || ((_d = context.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d.length) === 1 && context.luckysheet_select_save[0].row[0] === context.luckysheet_select_save[0].row[1]) {
|
|
687
|
-
showDialog(findAndReplace.locationTiplessTwoRow, "ok");
|
|
688
|
-
return;
|
|
689
|
-
}
|
|
690
|
-
range = _lodash.default.assignIn([], context.luckysheet_select_save);
|
|
691
|
-
setContext(function (ctx) {
|
|
692
|
-
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationRowSpan", undefined, ctx);
|
|
693
|
-
});
|
|
694
|
-
} else if (value === "locationColumnSpan") {
|
|
695
|
-
if (((_e = context.luckysheet_select_save) === null || _e === void 0 ? void 0 : _e.length) === 0 || ((_f = context.luckysheet_select_save) === null || _f === void 0 ? void 0 : _f.length) === 1 && context.luckysheet_select_save[0].column[0] === context.luckysheet_select_save[0].column[1]) {
|
|
696
|
-
showDialog(findAndReplace.locationTiplessTwoColumn, "ok");
|
|
697
|
-
return;
|
|
698
|
-
}
|
|
699
|
-
range = _lodash.default.assignIn([], context.luckysheet_select_save);
|
|
700
|
-
setContext(function (ctx) {
|
|
701
|
-
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationColumnSpan", undefined, ctx);
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
if (rangeArr.length === 0 && value !== "location") showDialog(findAndReplace.locationTipNotFindCell, "ok");
|
|
705
|
-
setOpen(false);
|
|
706
|
-
}
|
|
707
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
708
|
-
className: "fortune-toolbar-menu-line"
|
|
709
|
-
}, text));
|
|
710
|
-
}));
|
|
711
|
-
});
|
|
712
|
-
}
|
|
713
|
-
if (name === "conditionFormat") {
|
|
714
|
-
var items_4 = ["highlightCellRules", "itemSelectionRules", "-", "deleteRule"];
|
|
715
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
716
|
-
iconId: "conditionFormat",
|
|
717
|
-
key: name,
|
|
718
|
-
tooltip: toolbar.conditionalFormat,
|
|
719
|
-
showArrow: false
|
|
720
|
-
}, function (setOpen) {
|
|
721
|
-
return /*#__PURE__*/_react.default.createElement(_ConditionFormat.default, {
|
|
722
|
-
items: items_4,
|
|
723
|
-
setOpen: setOpen
|
|
724
|
-
});
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
if (name === "image") {
|
|
728
|
-
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
729
|
-
iconId: name,
|
|
730
|
-
tooltip: toolbar.insertImage,
|
|
731
|
-
key: name,
|
|
732
|
-
onClick: function onClick() {
|
|
733
|
-
if (context.allowEdit === false) return;
|
|
734
|
-
(0, _fortuneCore.showImgChooser)();
|
|
735
|
-
}
|
|
736
|
-
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
737
|
-
id: "fortune-img-upload",
|
|
738
|
-
type: "file",
|
|
739
|
-
accept: "image/*",
|
|
740
|
-
style: {
|
|
741
|
-
display: "none"
|
|
742
|
-
},
|
|
743
|
-
onChange: function onChange(e) {
|
|
744
|
-
var _a;
|
|
745
|
-
var file = (_a = e.currentTarget.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
746
|
-
if (!file) return;
|
|
747
|
-
var render = new FileReader();
|
|
748
|
-
render.readAsDataURL(file);
|
|
749
|
-
render.onload = function (event) {
|
|
750
|
-
var _a;
|
|
751
|
-
if (event.target == null) return;
|
|
752
|
-
var src = (_a = event.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
753
|
-
var image = new Image();
|
|
754
|
-
image.onload = function () {
|
|
755
|
-
setContext(function (draftCtx) {
|
|
756
|
-
(0, _fortuneCore.insertImage)(draftCtx, image);
|
|
757
|
-
});
|
|
758
|
-
};
|
|
759
|
-
image.src = src;
|
|
760
|
-
};
|
|
761
|
-
e.currentTarget.value = "";
|
|
762
|
-
}
|
|
763
|
-
}));
|
|
764
|
-
}
|
|
765
|
-
if (name === "comment") {
|
|
766
|
-
var last = (_c = context.luckysheet_select_save) === null || _c === void 0 ? void 0 : _c[context.luckysheet_select_save.length - 1];
|
|
767
|
-
var row_index_1 = last === null || last === void 0 ? void 0 : last.row_focus;
|
|
768
|
-
var col_index_1 = last === null || last === void 0 ? void 0 : last.column_focus;
|
|
769
|
-
if (!last) {
|
|
770
|
-
row_index_1 = 0;
|
|
771
|
-
col_index_1 = 0;
|
|
772
|
-
} else {
|
|
773
|
-
if (row_index_1 == null) {
|
|
774
|
-
row_index_1 = last.row[0];
|
|
775
|
-
}
|
|
776
|
-
if (col_index_1 == null) {
|
|
777
|
-
col_index_1 = last.column[0];
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
var itemData_1;
|
|
781
|
-
if (((_e = (_d = flowdata === null || flowdata === void 0 ? void 0 : flowdata[row_index_1]) === null || _d === void 0 ? void 0 : _d[col_index_1]) === null || _e === void 0 ? void 0 : _e.ps) != null) {
|
|
782
|
-
itemData_1 = [{
|
|
783
|
-
key: "edit",
|
|
784
|
-
text: comment.edit,
|
|
785
|
-
onClick: _fortuneCore.editComment
|
|
786
|
-
}, {
|
|
787
|
-
key: "delete",
|
|
788
|
-
text: comment.delete,
|
|
789
|
-
onClick: _fortuneCore.deleteComment
|
|
790
|
-
}, {
|
|
791
|
-
key: "showOrHide",
|
|
792
|
-
text: comment.showOne,
|
|
793
|
-
onClick: _fortuneCore.showHideComment
|
|
794
|
-
}, {
|
|
795
|
-
key: "showOrHideAll",
|
|
796
|
-
text: comment.showAll,
|
|
797
|
-
onClick: _fortuneCore.showHideAllComments
|
|
798
|
-
}];
|
|
799
|
-
} else {
|
|
800
|
-
itemData_1 = [{
|
|
801
|
-
key: "new",
|
|
802
|
-
text: comment.insert,
|
|
803
|
-
onClick: _fortuneCore.newComment
|
|
804
|
-
}, {
|
|
805
|
-
key: "showOrHideAll",
|
|
806
|
-
text: comment.showAll,
|
|
807
|
-
onClick: _fortuneCore.showHideAllComments
|
|
808
|
-
}];
|
|
809
|
-
}
|
|
810
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
811
|
-
iconId: name,
|
|
812
|
-
key: name,
|
|
813
|
-
tooltip: tooltip,
|
|
814
|
-
showArrow: false
|
|
815
|
-
}, function (setOpen) {
|
|
816
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, null, itemData_1.map(function (_a) {
|
|
817
|
-
var key = _a.key,
|
|
818
|
-
text = _a.text,
|
|
819
|
-
_onClick = _a.onClick;
|
|
820
|
-
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
821
|
-
key: key,
|
|
822
|
-
onClick: function onClick() {
|
|
823
|
-
setContext(function (draftContext) {
|
|
824
|
-
return _onClick(draftContext, refs.globalCache, row_index_1, col_index_1);
|
|
825
|
-
});
|
|
826
|
-
setOpen(false);
|
|
827
|
-
}
|
|
828
|
-
}, text);
|
|
829
|
-
}));
|
|
830
|
-
});
|
|
831
|
-
}
|
|
832
|
-
if (name === "quick-formula") {
|
|
833
|
-
var itemData_2 = [{
|
|
834
|
-
text: formula.sum,
|
|
835
|
-
value: "SUM"
|
|
836
|
-
}, {
|
|
837
|
-
text: formula.average,
|
|
838
|
-
value: "AVERAGE"
|
|
839
|
-
}, {
|
|
840
|
-
text: formula.count,
|
|
841
|
-
value: "COUNT"
|
|
842
|
-
}, {
|
|
843
|
-
text: formula.max,
|
|
844
|
-
value: "MAX"
|
|
845
|
-
}, {
|
|
846
|
-
text: formula.min,
|
|
847
|
-
value: "MIN"
|
|
848
|
-
}];
|
|
849
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
850
|
-
iconId: "formula-sum",
|
|
851
|
-
key: name,
|
|
852
|
-
tooltip: toolbar.autoSum,
|
|
853
|
-
showArrow: false,
|
|
854
|
-
onClick: function onClick() {
|
|
855
|
-
return setContext(function (ctx) {
|
|
856
|
-
(0, _fortuneCore.handleSum)(ctx, refs.cellInput.current, refs.fxInput.current, refs.globalCache);
|
|
857
|
-
});
|
|
858
|
-
}
|
|
859
|
-
}, function (setOpen) {
|
|
860
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, null, itemData_2.map(function (_a) {
|
|
861
|
-
var value = _a.value,
|
|
862
|
-
text = _a.text;
|
|
863
|
-
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
864
|
-
key: value,
|
|
865
|
-
onClick: function onClick() {
|
|
866
|
-
setContext(function (ctx) {
|
|
867
|
-
(0, _fortuneCore.autoSelectionFormula)(ctx, refs.cellInput.current, refs.fxInput.current, value, refs.globalCache);
|
|
868
|
-
});
|
|
869
|
-
setOpen(false);
|
|
870
|
-
}
|
|
871
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
872
|
-
className: "fortune-toolbar-menu-line"
|
|
873
|
-
}, /*#__PURE__*/_react.default.createElement("div", null, text), /*#__PURE__*/_react.default.createElement("div", {
|
|
874
|
-
className: "fortune-toolbar-subtext"
|
|
875
|
-
}, value)));
|
|
876
|
-
}), /*#__PURE__*/_react.default.createElement(_Divider.MenuDivider, null), /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
877
|
-
key: "formula",
|
|
878
|
-
onClick: function onClick() {
|
|
879
|
-
var button = document.getElementById("function-button");
|
|
880
|
-
if (button) {
|
|
881
|
-
button.click();
|
|
882
|
-
}
|
|
883
|
-
setOpen(false);
|
|
884
|
-
}
|
|
885
|
-
}, "".concat(formula.find, "...")));
|
|
886
|
-
});
|
|
887
|
-
}
|
|
888
|
-
if (name === "merge-cell") {
|
|
889
|
-
var itemdata_1 = [{
|
|
890
|
-
text: merge.mergeAll,
|
|
891
|
-
value: "merge-all",
|
|
892
|
-
icon: "MergeAll"
|
|
893
|
-
}, {
|
|
894
|
-
text: merge.mergeV,
|
|
895
|
-
value: "merge-vertical",
|
|
896
|
-
icon: "MergeVertical"
|
|
897
|
-
}, {
|
|
898
|
-
text: merge.mergeH,
|
|
899
|
-
value: "merge-horizontal",
|
|
900
|
-
icon: "MergeHorizontal"
|
|
901
|
-
}, {
|
|
902
|
-
text: merge.mergeCancel,
|
|
903
|
-
value: "merge-cancel",
|
|
904
|
-
icon: "Unmerge"
|
|
905
|
-
}];
|
|
906
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
907
|
-
iconId: "merge-all",
|
|
908
|
-
key: name,
|
|
909
|
-
tooltip: tooltip,
|
|
910
|
-
text: "\u5408\u5E76\u5355\u5143\u683C",
|
|
911
|
-
onClick: function onClick() {
|
|
912
|
-
return setContext(function (ctx) {
|
|
913
|
-
(0, _fortuneCore.handleMerge)(ctx, "merge-all");
|
|
914
|
-
});
|
|
915
|
-
}
|
|
916
|
-
}, function (setOpen) {
|
|
917
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, null, itemdata_1.map(function (_a) {
|
|
918
|
-
var text = _a.text,
|
|
919
|
-
value = _a.value,
|
|
920
|
-
icon = _a.icon;
|
|
921
|
-
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
922
|
-
key: value,
|
|
923
|
-
onClick: function onClick() {
|
|
924
|
-
setContext(function (ctx) {
|
|
925
|
-
(0, _fortuneCore.handleMerge)(ctx, value);
|
|
926
|
-
});
|
|
927
|
-
setOpen(false);
|
|
928
|
-
}
|
|
929
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
930
|
-
style: {
|
|
931
|
-
display: "flex",
|
|
932
|
-
alignItems: "center",
|
|
933
|
-
gap: 6
|
|
934
|
-
}
|
|
935
|
-
}, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
936
|
-
name: icon,
|
|
937
|
-
width: 16,
|
|
938
|
-
height: 16
|
|
939
|
-
}), text));
|
|
940
|
-
}));
|
|
941
|
-
});
|
|
942
|
-
}
|
|
943
|
-
if (name === "border") {
|
|
944
|
-
var items_5 = [{
|
|
945
|
-
text: border.borderTop,
|
|
946
|
-
value: "border-top",
|
|
947
|
-
icon: "BorderTop"
|
|
948
|
-
}, {
|
|
949
|
-
text: border.borderBottom,
|
|
950
|
-
value: "border-bottom",
|
|
951
|
-
icon: "BorderBottom"
|
|
952
|
-
}, {
|
|
953
|
-
text: border.borderLeft,
|
|
954
|
-
value: "border-left",
|
|
955
|
-
icon: "BorderLeft"
|
|
956
|
-
}, {
|
|
957
|
-
text: border.borderRight,
|
|
958
|
-
value: "border-right",
|
|
959
|
-
icon: "BorderRight"
|
|
960
|
-
}, {
|
|
961
|
-
text: border.borderNone,
|
|
962
|
-
value: "border-none",
|
|
963
|
-
icon: "NoBorder"
|
|
964
|
-
}, {
|
|
965
|
-
text: border.borderAll,
|
|
966
|
-
value: "border-all",
|
|
967
|
-
icon: "Border"
|
|
968
|
-
}, {
|
|
969
|
-
text: border.borderOutside,
|
|
970
|
-
value: "border-outside",
|
|
971
|
-
icon: "BorderOutside"
|
|
972
|
-
}, {
|
|
973
|
-
text: border.borderInside,
|
|
974
|
-
value: "border-inside",
|
|
975
|
-
icon: "BorderInside"
|
|
976
|
-
}, {
|
|
977
|
-
text: border.borderHorizontal,
|
|
978
|
-
value: "border-horizontal",
|
|
979
|
-
icon: "BorderHorizontal"
|
|
980
|
-
}, {
|
|
981
|
-
text: border.borderVertical,
|
|
982
|
-
value: "border-vertical",
|
|
983
|
-
icon: "BorderVertical"
|
|
984
|
-
}];
|
|
985
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
986
|
-
iconId: "border-all",
|
|
987
|
-
key: name,
|
|
988
|
-
tooltip: tooltip,
|
|
989
|
-
text: "\u8FB9\u6846\u8BBE\u7F6E",
|
|
990
|
-
showArrow: false,
|
|
991
|
-
onClick: function onClick() {
|
|
992
|
-
return setContext(function (ctx) {
|
|
993
|
-
(0, _fortuneCore.handleBorder)(ctx, "border-all", customColor, customStyle);
|
|
994
|
-
});
|
|
995
|
-
}
|
|
996
|
-
}, function (setOpen) {
|
|
997
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
998
|
-
className: "fortune-toolbar-select fortune-border-grid"
|
|
999
|
-
}, items_5.map(function (_a) {
|
|
1000
|
-
var value = _a.value,
|
|
1001
|
-
icon = _a.icon;
|
|
1002
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1003
|
-
key: value,
|
|
1004
|
-
className: "fortune-border-grid-item",
|
|
1005
|
-
onClick: function onClick() {
|
|
1006
|
-
setContext(function (ctx) {
|
|
1007
|
-
(0, _fortuneCore.handleBorder)(ctx, value, customColor, customStyle);
|
|
1008
|
-
});
|
|
1009
|
-
setOpen(false);
|
|
1010
|
-
}
|
|
1011
|
-
}, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
1012
|
-
name: icon,
|
|
1013
|
-
width: 16,
|
|
1014
|
-
height: 16
|
|
1015
|
-
}));
|
|
1016
|
-
}));
|
|
1017
|
-
});
|
|
1018
|
-
}
|
|
1019
|
-
if (name === "freeze") {
|
|
1020
|
-
var items_6 = [{
|
|
1021
|
-
text: freezen.freezenRowRange,
|
|
1022
|
-
value: "freeze-row"
|
|
1023
|
-
}, {
|
|
1024
|
-
text: freezen.freezenColumnRange,
|
|
1025
|
-
value: "freeze-col"
|
|
1026
|
-
}, {
|
|
1027
|
-
text: freezen.freezenRCRange,
|
|
1028
|
-
value: "freeze-row-col"
|
|
1029
|
-
}, {
|
|
1030
|
-
text: freezen.freezenCancel,
|
|
1031
|
-
value: "freeze-cancel"
|
|
1032
|
-
}];
|
|
1033
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1034
|
-
iconId: "freeze-row-col",
|
|
1035
|
-
key: name,
|
|
1036
|
-
tooltip: tooltip,
|
|
1037
|
-
showArrow: false,
|
|
1038
|
-
onClick: function onClick() {
|
|
1039
|
-
return setContext(function (ctx) {
|
|
1040
|
-
(0, _fortuneCore.handleFreeze)(ctx, "freeze-row-col");
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
|
-
}, function (setOpen) {
|
|
1044
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, null, items_6.map(function (_a) {
|
|
1045
|
-
var text = _a.text,
|
|
1046
|
-
value = _a.value;
|
|
1047
|
-
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
1048
|
-
key: value,
|
|
1049
|
-
onClick: function onClick() {
|
|
1050
|
-
setContext(function (ctx) {
|
|
1051
|
-
(0, _fortuneCore.handleFreeze)(ctx, value);
|
|
1052
|
-
});
|
|
1053
|
-
setOpen(false);
|
|
1054
|
-
}
|
|
1055
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1056
|
-
className: "fortune-toolbar-menu-line"
|
|
1057
|
-
}, text, /*#__PURE__*/_react.default.createElement(_SVGIcon.default, {
|
|
1058
|
-
name: value,
|
|
1059
|
-
width: 16,
|
|
1060
|
-
height: 16
|
|
1061
|
-
})));
|
|
1062
|
-
}));
|
|
1063
|
-
});
|
|
1064
|
-
}
|
|
1065
|
-
if (name === "text-wrap") {
|
|
1066
|
-
var items_7 = [{
|
|
1067
|
-
text: textWrap.clip,
|
|
1068
|
-
iconId: "text-clip",
|
|
1069
|
-
value: "clip"
|
|
1070
|
-
}, {
|
|
1071
|
-
text: textWrap.overflow,
|
|
1072
|
-
iconId: "text-overflow",
|
|
1073
|
-
value: "overflow"
|
|
1074
|
-
}, {
|
|
1075
|
-
text: textWrap.wrap,
|
|
1076
|
-
iconId: "text-wrap",
|
|
1077
|
-
value: "wrap"
|
|
1078
|
-
}];
|
|
1079
|
-
var curr_2 = items_7[0];
|
|
1080
|
-
if ((cell === null || cell === void 0 ? void 0 : cell.tb) != null) {
|
|
1081
|
-
curr_2 = _lodash.default.get(items_7, cell.tb);
|
|
1082
|
-
}
|
|
1083
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1084
|
-
iconId: curr_2.iconId,
|
|
1085
|
-
key: name,
|
|
1086
|
-
tooltip: toolbar.textWrap,
|
|
1087
|
-
showArrow: false
|
|
1088
|
-
}, function (setOpen) {
|
|
1089
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
1090
|
-
style: {
|
|
1091
|
-
minWidth: "fit-content",
|
|
1092
|
-
display: "flex",
|
|
1093
|
-
flexDirection: "row",
|
|
1094
|
-
alignItems: "center",
|
|
1095
|
-
justifyContent: "center",
|
|
1096
|
-
gap: 4
|
|
1097
|
-
}
|
|
1098
|
-
}, items_7.map(function (_a) {
|
|
1099
|
-
var iconId = _a.iconId,
|
|
1100
|
-
value = _a.value;
|
|
1101
|
-
return /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
|
|
1102
|
-
key: value,
|
|
1103
|
-
isActive: curr_2.value === value,
|
|
1104
|
-
icon: getLucideIcon(iconId),
|
|
1105
|
-
variant: "ghost",
|
|
1106
|
-
onClick: function onClick() {
|
|
1107
|
-
setContext(function (ctx) {
|
|
1108
|
-
var d = (0, _fortuneCore.getFlowdata)(ctx);
|
|
1109
|
-
if (d == null) return;
|
|
1110
|
-
(0, _fortuneCore.updateFormat)(ctx, refs.cellInput.current, d, "tb", value);
|
|
1111
|
-
});
|
|
1112
|
-
setOpen(false);
|
|
1113
|
-
},
|
|
1114
|
-
tabIndex: 0
|
|
1115
|
-
});
|
|
1116
|
-
}));
|
|
1117
|
-
});
|
|
1118
|
-
}
|
|
1119
|
-
if (name === "text-rotation") {
|
|
1120
|
-
var items_8 = [{
|
|
1121
|
-
text: rotation.none,
|
|
1122
|
-
iconId: "text-rotation-none",
|
|
1123
|
-
value: "none"
|
|
1124
|
-
}, {
|
|
1125
|
-
text: rotation.angleup,
|
|
1126
|
-
iconId: "text-rotation-angleup",
|
|
1127
|
-
value: "angleup"
|
|
1128
|
-
}, {
|
|
1129
|
-
text: rotation.angledown,
|
|
1130
|
-
iconId: "text-rotation-angledown",
|
|
1131
|
-
value: "angledown"
|
|
1132
|
-
}, {
|
|
1133
|
-
text: rotation.vertical,
|
|
1134
|
-
iconId: "text-rotation-vertical",
|
|
1135
|
-
value: "vertical"
|
|
1136
|
-
}, {
|
|
1137
|
-
text: rotation.rotationUp,
|
|
1138
|
-
iconId: "text-rotation-up",
|
|
1139
|
-
value: "rotation-up"
|
|
1140
|
-
}, {
|
|
1141
|
-
text: rotation.rotationDown,
|
|
1142
|
-
iconId: "text-rotation-down",
|
|
1143
|
-
value: "rotation-down"
|
|
1144
|
-
}];
|
|
1145
|
-
var curr = items_8[0];
|
|
1146
|
-
if ((cell === null || cell === void 0 ? void 0 : cell.tr) != null) {
|
|
1147
|
-
curr = _lodash.default.get(items_8, cell.tr);
|
|
1148
|
-
}
|
|
1149
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1150
|
-
iconId: curr.iconId,
|
|
1151
|
-
key: name,
|
|
1152
|
-
tooltip: toolbar.textRotate,
|
|
1153
|
-
showArrow: false
|
|
1154
|
-
}, function (setOpen) {
|
|
1155
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, null, items_8.map(function (_a) {
|
|
1156
|
-
var text = _a.text,
|
|
1157
|
-
iconId = _a.iconId,
|
|
1158
|
-
value = _a.value;
|
|
1159
|
-
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
1160
|
-
key: value,
|
|
1161
|
-
onClick: function onClick() {
|
|
1162
|
-
setContext(function (ctx) {
|
|
1163
|
-
var d = (0, _fortuneCore.getFlowdata)(ctx);
|
|
1164
|
-
if (d == null) return;
|
|
1165
|
-
(0, _fortuneCore.updateFormat)(ctx, refs.cellInput.current, d, "tr", value);
|
|
1166
|
-
});
|
|
1167
|
-
setOpen(false);
|
|
1168
|
-
}
|
|
1169
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1170
|
-
className: "fortune-toolbar-menu-line"
|
|
1171
|
-
}, text, /*#__PURE__*/_react.default.createElement(_SVGIcon.default, {
|
|
1172
|
-
name: iconId,
|
|
1173
|
-
width: 16,
|
|
1174
|
-
height: 16
|
|
1175
|
-
})));
|
|
1176
|
-
}));
|
|
1177
|
-
});
|
|
1178
|
-
}
|
|
1179
|
-
if (name === "filter") {
|
|
1180
|
-
var items_9 = [{
|
|
1181
|
-
iconId: "sort-asc",
|
|
1182
|
-
value: "sort-asc",
|
|
1183
|
-
text: sort.asc,
|
|
1184
|
-
onClick: function onClick() {
|
|
1185
|
-
setContext(function (ctx) {
|
|
1186
|
-
(0, _fortuneCore.handleSort)(ctx, true);
|
|
1187
|
-
});
|
|
1188
|
-
}
|
|
1189
|
-
}, {
|
|
1190
|
-
iconId: "sort-desc",
|
|
1191
|
-
value: "sort-desc",
|
|
1192
|
-
text: sort.desc,
|
|
1193
|
-
onClick: function onClick() {
|
|
1194
|
-
setContext(function (ctx) {
|
|
1195
|
-
(0, _fortuneCore.handleSort)(ctx, false);
|
|
1196
|
-
});
|
|
1197
|
-
}
|
|
1198
|
-
}, {
|
|
1199
|
-
iconId: "",
|
|
1200
|
-
value: "divider"
|
|
1201
|
-
}, {
|
|
1202
|
-
iconId: "filter1",
|
|
1203
|
-
value: "filter",
|
|
1204
|
-
text: filter.filter,
|
|
1205
|
-
onClick: function onClick() {
|
|
1206
|
-
return setContext(function (draftCtx) {
|
|
1207
|
-
(0, _fortuneCore.createFilter)(draftCtx);
|
|
1208
|
-
});
|
|
1209
|
-
}
|
|
1210
|
-
}, {
|
|
1211
|
-
iconId: "eraser",
|
|
1212
|
-
value: "eraser",
|
|
1213
|
-
text: filter.clearFilter,
|
|
1214
|
-
onClick: function onClick() {
|
|
1215
|
-
return setContext(function (draftCtx) {
|
|
1216
|
-
(0, _fortuneCore.clearFilter)(draftCtx);
|
|
1217
|
-
});
|
|
1218
|
-
}
|
|
1219
|
-
}];
|
|
1220
|
-
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1221
|
-
iconId: "filter",
|
|
1222
|
-
key: name,
|
|
1223
|
-
tooltip: toolbar.sortAndFilter,
|
|
1224
|
-
showArrow: false
|
|
1225
|
-
}, function (setOpen) {
|
|
1226
|
-
return /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
1227
|
-
style: {
|
|
1228
|
-
minWidth: "11.25rem"
|
|
1229
|
-
}
|
|
1230
|
-
}, items_9.map(function (_a, index) {
|
|
1231
|
-
var text = _a.text,
|
|
1232
|
-
iconId = _a.iconId,
|
|
1233
|
-
value = _a.value,
|
|
1234
|
-
_onClick2 = _a.onClick;
|
|
1235
|
-
return value !== "divider" ? (/*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
1236
|
-
key: value,
|
|
1237
|
-
onClick: function onClick() {
|
|
1238
|
-
_onClick2 === null || _onClick2 === void 0 ? void 0 : _onClick2();
|
|
1239
|
-
setOpen(false);
|
|
1240
|
-
}
|
|
1241
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1242
|
-
className: "fortune-toolbar-menu-line gap-1",
|
|
1243
|
-
style: {
|
|
1244
|
-
justifyContent: "start"
|
|
1245
|
-
}
|
|
1246
|
-
}, /*#__PURE__*/_react.default.createElement(_SVGIcon.default, {
|
|
1247
|
-
name: iconId,
|
|
1248
|
-
width: 16,
|
|
1249
|
-
height: 16
|
|
1250
|
-
}), text))) : (/*#__PURE__*/_react.default.createElement(_Divider.MenuDivider, {
|
|
1251
|
-
key: "divider-".concat(index)
|
|
1252
|
-
}));
|
|
1253
|
-
}));
|
|
1254
|
-
});
|
|
1255
|
-
}
|
|
1256
|
-
return /*#__PURE__*/_react.default.createElement(_ui.Tooltip, {
|
|
1257
|
-
text: tooltip,
|
|
1258
|
-
placement: "bottom"
|
|
1259
|
-
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
1260
|
-
iconId: name,
|
|
1261
|
-
tooltip: tooltip,
|
|
1262
|
-
key: name,
|
|
1263
|
-
selected: (_f = (0, _fortuneCore.toolbarItemSelectedFunc)(name)) === null || _f === void 0 ? void 0 : _f(cell),
|
|
1264
|
-
onClick: function onClick() {
|
|
1265
|
-
return setContext(function (draftCtx) {
|
|
1266
|
-
var _a;
|
|
1267
|
-
(_a = (0, _fortuneCore.toolbarItemClickHandler)(name)) === null || _a === void 0 ? void 0 : _a(draftCtx, refs.cellInput.current, refs.globalCache);
|
|
1268
|
-
});
|
|
1269
|
-
}
|
|
1270
|
-
}));
|
|
1271
|
-
}, [toolbar, cell, setContext, refs.cellInput, refs.fxInput, refs.globalCache, defaultFormat, align, handleUndo, handleRedo, flowdata, formula, showDuneModal, merge, border, freezen, screenshot, sort, textWrap, rotation, filter, splitText, findAndReplace, context.luckysheet_select_save, context.defaultFontSize, context.allowEdit, comment, fontarray, hideSubMenu, showSubMenu, refs.canvas, customColor, customStyle, toolbarFormat.moreCurrency]);
|
|
1272
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1273
|
-
ref: containerRef,
|
|
1274
|
-
className: "fortune-toolbar",
|
|
1275
|
-
"aria-label": toolbar.toolbar
|
|
1276
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1277
|
-
className: "fortune-toolbar-left"
|
|
1278
|
-
}, settings.customToolbarItems.filter(function (n) {
|
|
1279
|
-
return n.key === "import-export";
|
|
1280
|
-
}).map(function (n) {
|
|
1281
|
-
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
1282
|
-
tooltip: n.tooltip,
|
|
1283
|
-
onClick: n.onClick,
|
|
1284
|
-
key: n.key,
|
|
1285
|
-
icon: n.icon,
|
|
1286
|
-
iconName: n.iconName
|
|
1287
|
-
}, n.children);
|
|
1288
|
-
}), ((_d = settings.customToolbarItems) === null || _d === void 0 ? void 0 : _d.length) > 0 ? (/*#__PURE__*/_react.default.createElement(_Divider.default, {
|
|
1289
|
-
key: "customDivider"
|
|
1290
|
-
})) : null, (toolbarWrapIndex === -1 || isDesktop ? settings.toolbarItems : settings.toolbarItems.slice(0, toolbarWrapIndex + 1)).map(function (name, i) {
|
|
1291
|
-
return getToolbarItem(name, i);
|
|
1292
|
-
}), !isDesktop && toolbarWrapIndex !== -1 && toolbarWrapIndex < settings.toolbarItems.length - 1 ? (/*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
1293
|
-
iconId: "Ellipsis",
|
|
1294
|
-
tooltip: toolbar.toolMore,
|
|
1295
|
-
onClick: function onClick() {
|
|
1296
|
-
if (moreItemsOpen) {
|
|
1297
|
-
setMoreItems(null);
|
|
1298
|
-
} else {
|
|
1299
|
-
setMoreItems(settings.toolbarItems.slice(toolbarWrapIndex + 1).map(function (name, i) {
|
|
1300
|
-
return getToolbarItem(name, i);
|
|
1301
|
-
}));
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
})) : null, moreToolbarItems && (/*#__PURE__*/_react.default.createElement(_MoreItemsContainer.default, {
|
|
1305
|
-
onClose: onMoreToolbarItemsClose
|
|
1306
|
-
}, moreToolbarItems))), /*#__PURE__*/_react.default.createElement("div", {
|
|
1307
|
-
className: "fortune-toolbar-right"
|
|
1308
|
-
}, settings.customToolbarItems.length > 0 && (/*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
1309
|
-
iconId: "dune",
|
|
1310
|
-
tooltip: "Insert Dune Chart",
|
|
1311
|
-
key: "dune-charts",
|
|
1312
|
-
onClick: function onClick() {
|
|
1313
|
-
if (context.allowEdit === false) return;
|
|
1314
|
-
setShowDuneModal(true);
|
|
1315
|
-
},
|
|
1316
|
-
style: {
|
|
1317
|
-
backgroundColor: "#F4603E2E",
|
|
1318
|
-
borderRadius: "8px"
|
|
1319
|
-
}
|
|
1320
|
-
})), settings.customToolbarItems.filter(function (n) {
|
|
1321
|
-
return n.key !== "import-export";
|
|
1322
|
-
}).map(function (n) {
|
|
1323
|
-
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
1324
|
-
tooltip: n.tooltip,
|
|
1325
|
-
onClick: n.onClick,
|
|
1326
|
-
key: n.key,
|
|
1327
|
-
icon: n.icon,
|
|
1328
|
-
iconName: n.iconName
|
|
1329
|
-
}, n.children);
|
|
1330
|
-
}), showDuneModal && (/*#__PURE__*/_react.default.createElement(_DuneChartsInputModal.default, {
|
|
1331
|
-
isOpen: showDuneModal,
|
|
1332
|
-
onSubmit: function onSubmit(url) {
|
|
1333
|
-
var _a;
|
|
1334
|
-
setContext(function (draftCtx) {
|
|
1335
|
-
(0, _fortuneCore.insertDuneChart)(draftCtx, url);
|
|
1336
|
-
});
|
|
1337
|
-
setShowDuneModal(false);
|
|
1338
|
-
(_a = settings.onDuneChartEmbed) === null || _a === void 0 ? void 0 : _a.call(settings);
|
|
1339
|
-
},
|
|
1340
|
-
onClose: function onClose() {
|
|
1341
|
-
return setShowDuneModal(false);
|
|
1342
|
-
},
|
|
1343
|
-
placeholder: "Paste here any Dune chart link for some magic",
|
|
1344
|
-
submitText: "Add Dune chart"
|
|
1345
|
-
}))));
|
|
1346
|
-
};
|
|
1347
|
-
var _default = exports.default = Toolbar;
|