@fileverse-dev/fortune-react 1.1.0 → 1.1.2
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/es/assets/paint-roller.png +0 -0
- package/es/components/ChangeColor/index.css +76 -0
- package/{dist/packages/react/src → es}/components/ChangeColor/index.d.ts +7 -7
- package/es/components/ChangeColor/index.js +41 -0
- package/{dist/packages/react/src → es}/components/ConditionFormat/ConditionRules.d.ts +6 -6
- package/es/components/ConditionFormat/ConditionRules.js +323 -0
- package/es/components/ConditionFormat/index.css +210 -0
- package/{dist/packages/react/src → es}/components/ConditionFormat/index.d.ts +7 -7
- package/es/components/ConditionFormat/index.js +252 -0
- package/{dist/packages/react/src → es}/components/ContextMenu/Divider.d.ts +3 -3
- package/es/components/ContextMenu/Divider.js +7 -0
- package/{dist/packages/react/src → es}/components/ContextMenu/FilterMenu.d.ts +3 -3
- package/es/components/ContextMenu/FilterMenu.js +612 -0
- package/{dist/packages/react/src → es}/components/ContextMenu/Menu.d.ts +8 -8
- package/es/components/ContextMenu/Menu.js +25 -0
- package/{dist/packages/react/src → es}/components/ContextMenu/SheetTab.d.ts +4 -4
- package/es/components/ContextMenu/SheetTab.js +223 -0
- package/es/components/ContextMenu/index.css +322 -0
- package/{dist/packages/react/src → es}/components/ContextMenu/index.d.ts +5 -5
- package/es/components/ContextMenu/index.js +1054 -0
- package/es/components/CryptoDenominationSelector/index.css +67 -0
- package/es/components/CryptoDenominationSelector/index.d.ts +8 -0
- package/es/components/CryptoDenominationSelector/index.js +271 -0
- package/es/components/CustomSort/index.css +23 -0
- package/{dist/packages/react/src → es}/components/CustomSort/index.d.ts +4 -4
- package/es/components/CustomSort/index.js +113 -0
- package/{dist/packages/react/src → es}/components/DataVerification/DropdownList.d.ts +4 -4
- package/es/components/DataVerification/DropdownList.js +126 -0
- package/{dist/packages/react/src → es}/components/DataVerification/RangeDialog.d.ts +4 -4
- package/es/components/DataVerification/RangeDialog.js +105 -0
- package/{dist/packages/react/src → es}/components/DataVerification/getDisplayedRangeTxt.d.ts +2 -2
- package/es/components/DataVerification/getDisplayedRangeTxt.js +9 -0
- package/es/components/DataVerification/index.css +202 -0
- package/{dist/packages/react/src → es}/components/DataVerification/index.d.ts +4 -4
- package/es/components/DataVerification/index.js +398 -0
- package/es/components/Dialog/index.css +64 -0
- package/{dist/packages/react/src → es}/components/Dialog/index.d.ts +15 -15
- package/es/components/Dialog/index.js +72 -0
- package/{dist/packages/react/src → es}/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +11 -11
- package/es/components/DuneChartsInputModal/DuneChartsInputModal.js +95 -0
- package/es/components/DuneChartsInputModal/duneChartsInputModal.css +98 -0
- package/{dist/packages/react/src → es}/components/DunePreview/DunePreview.d.ts +13 -13
- package/es/components/DunePreview/DunePreview.js +46 -0
- package/es/components/DunePreview/index.css +57 -0
- package/{dist/packages/react/src → es}/components/FilterOption/index.d.ts +5 -5
- package/es/components/FilterOption/index.js +121 -0
- package/es/components/FormatSearch/index.css +19 -0
- package/{dist/packages/react/src → es}/components/FormatSearch/index.d.ts +6 -6
- package/es/components/FormatSearch/index.js +133 -0
- package/es/components/FormulaSearch/index.css +65 -0
- package/{dist/packages/react/src → es}/components/FormulaSearch/index.d.ts +5 -5
- package/es/components/FormulaSearch/index.js +198 -0
- package/{dist/packages/react/src → es}/components/FxEditor/NameBox.d.ts +3 -3
- package/es/components/FxEditor/NameBox.js +29 -0
- package/es/components/FxEditor/index.css +72 -0
- package/{dist/packages/react/src → es}/components/FxEditor/index.d.ts +4 -4
- package/es/components/FxEditor/index.js +167 -0
- package/es/components/IFrameBoxs/iFrameBoxs.css +16 -0
- package/{dist/packages/react/src → es}/components/IFrameBoxs/iFrameBoxs.d.ts +4 -4
- package/es/components/IFrameBoxs/iFrameBoxs.js +142 -0
- package/{dist/packages/react/src → es}/components/ImgBoxs/index.d.ts +3 -3
- package/es/components/ImgBoxs/index.js +219 -0
- package/es/components/LinkEidtCard/index.css +255 -0
- package/{dist/packages/react/src → es}/components/LinkEidtCard/index.d.ts +5 -5
- package/es/components/LinkEidtCard/index.js +238 -0
- package/es/components/LocationCondition/index.css +74 -0
- package/{dist/packages/react/src → es}/components/LocationCondition/index.d.ts +3 -3
- package/es/components/LocationCondition/index.js +195 -0
- package/{dist/packages/react/src → es}/components/MessageBox/index.d.ts +9 -9
- package/es/components/MessageBox/index.js +16 -0
- package/{dist/packages/react/src → es}/components/NotationBoxes/index.d.ts +3 -3
- package/es/components/NotationBoxes/index.js +105 -0
- package/{dist/packages/react/src → es}/components/ResetColumnWidth/index.d.ts +2 -2
- package/es/components/ResetColumnWidth/index.js +130 -0
- package/{dist/packages/react/src → es}/components/SVGDefines.d.ts +5 -5
- package/es/components/SVGDefines.js +1961 -0
- package/{dist/packages/react/src → es}/components/SVGIcon.d.ts +9 -9
- package/es/components/SVGIcon.js +18 -0
- package/es/components/SearchReplace/index.css +191 -0
- package/{dist/packages/react/src → es}/components/SearchReplace/index.d.ts +6 -6
- package/es/components/SearchReplace/index.js +285 -0
- package/es/components/Sheet/index.css +27 -0
- package/{dist/packages/react/src → es}/components/Sheet/index.d.ts +8 -8
- package/es/components/Sheet/index.js +176 -0
- package/{dist/packages/react/src → es}/components/SheetList/SheetHiddenButton.d.ts +8 -8
- package/es/components/SheetList/SheetHiddenButton.js +35 -0
- package/{dist/packages/react/src → es}/components/SheetList/SheetListItem.d.ts +9 -9
- package/es/components/SheetList/SheetListItem.js +72 -0
- package/es/components/SheetList/index.css +48 -0
- package/{dist/packages/react/src → es}/components/SheetList/index.d.ts +4 -4
- package/es/components/SheetList/index.js +30 -0
- package/{dist/packages/react/src → es}/components/SheetOverlay/ColumnHeader.d.ts +3 -3
- package/es/components/SheetOverlay/ColumnHeader.js +217 -0
- package/{dist/packages/react/src → es}/components/SheetOverlay/ContentEditable.d.ts +11 -11
- package/es/components/SheetOverlay/ContentEditable.js +74 -0
- package/es/components/SheetOverlay/FormulaHint/index.css +180 -0
- package/{dist/packages/react/src → es}/components/SheetOverlay/FormulaHint/index.d.ts +4 -4
- package/es/components/SheetOverlay/FormulaHint/index.js +348 -0
- package/{dist/packages/react/src → es}/components/SheetOverlay/FormulaSearch/constant.d.ts +63 -63
- package/es/components/SheetOverlay/FormulaSearch/constant.js +328 -0
- package/es/components/SheetOverlay/FormulaSearch/index.css +44 -0
- package/{dist/packages/react/src → es}/components/SheetOverlay/FormulaSearch/index.d.ts +4 -4
- package/es/components/SheetOverlay/FormulaSearch/index.js +261 -0
- package/{dist/packages/react/src → es}/components/SheetOverlay/InputBox.d.ts +3 -3
- package/es/components/SheetOverlay/InputBox.js +395 -0
- package/{dist/packages/react/src → es}/components/SheetOverlay/RowHeader.d.ts +3 -3
- package/es/components/SheetOverlay/RowHeader.js +187 -0
- package/es/components/SheetOverlay/ScrollBar/index.css +40 -0
- package/{dist/packages/react/src → es}/components/SheetOverlay/ScrollBar/index.d.ts +7 -7
- package/es/components/SheetOverlay/ScrollBar/index.js +47 -0
- package/es/components/SheetOverlay/index.css +952 -0
- package/{dist/packages/react/src → es}/components/SheetOverlay/index.d.ts +4 -4
- package/es/components/SheetOverlay/index.js +580 -0
- package/{dist/packages/react/src → es}/components/SheetTab/SheetItem.d.ts +8 -8
- package/es/components/SheetTab/SheetItem.js +230 -0
- package/es/components/SheetTab/index.css +278 -0
- package/{dist/packages/react/src → es}/components/SheetTab/index.d.ts +4 -4
- package/es/components/SheetTab/index.js +191 -0
- package/es/components/SplitColumn/index.css +121 -0
- package/{dist/packages/react/src → es}/components/SplitColumn/index.d.ts +3 -3
- package/es/components/SplitColumn/index.js +167 -0
- package/{dist/packages/react/src → es}/components/Toolbar/Button.d.ts +12 -12
- package/es/components/Toolbar/Button.js +32 -0
- package/{dist/packages/react/src → es}/components/Toolbar/ColorPicker.d.ts +6 -6
- package/es/components/Toolbar/ColorPicker.js +27 -0
- package/{dist/packages/react/src → es}/components/Toolbar/Combo.d.ts +13 -12
- package/es/components/Toolbar/Combo.js +123 -0
- package/{dist/packages/react/src → es}/components/Toolbar/CustomBorder.d.ts +7 -7
- package/es/components/Toolbar/CustomBorder.js +211 -0
- package/{dist/packages/react/src → es}/components/Toolbar/CustomButton.d.ts +11 -11
- package/es/components/Toolbar/CustomButton.js +29 -0
- package/{dist/packages/react/src → es}/components/Toolbar/CustomColor.d.ts +8 -8
- package/es/components/Toolbar/CustomColor.js +25 -0
- package/{dist/packages/react/src → es}/components/Toolbar/CustomIcon.d.ts +9 -9
- package/es/components/Toolbar/CustomIcon.js +38 -0
- package/{dist/packages/react/src → es}/components/Toolbar/Divider.d.ts +4 -4
- package/es/components/Toolbar/Divider.js +12 -0
- package/{dist/packages/react/src → es}/components/Toolbar/MoreItemsContainer.d.ts +6 -6
- package/es/components/Toolbar/MoreItemsContainer.js +17 -0
- package/{dist/packages/react/src → es}/components/Toolbar/Select.d.ts +14 -14
- package/es/components/Toolbar/Select.js +34 -0
- package/es/components/Toolbar/index.css +411 -0
- package/es/components/Toolbar/index.d.ts +16 -0
- package/es/components/Toolbar/index.js +1722 -0
- package/{dist/packages/react/src → es}/components/Workbook/api.d.ts +1186 -1177
- package/es/components/Workbook/api.js +405 -0
- package/es/components/Workbook/index.css +48 -0
- package/{dist/packages/react/src → es}/components/Workbook/index.d.ts +1194 -1185
- package/es/components/Workbook/index.js +749 -0
- package/es/components/ZoomControl/index.css +54 -0
- package/{dist/packages/react/src → es}/components/ZoomControl/index.d.ts +4 -4
- package/es/components/ZoomControl/index.js +111 -0
- package/es/components/index.d.ts +5 -0
- package/es/components/index.js +3 -0
- package/es/constants.d.ts +27 -0
- package/es/constants.js +45 -0
- package/{dist/packages/react/src → es}/context/index.d.ts +25 -25
- package/es/context/index.js +34 -0
- package/{dist/packages/react/src → es}/context/modal.d.ts +10 -10
- package/es/context/modal.js +43 -0
- package/{dist/packages/react/src → es}/hooks/useAlert.d.ts +4 -4
- package/es/hooks/useAlert.js +28 -0
- package/{dist/packages/react/src → es}/hooks/useDialog.d.ts +5 -5
- package/es/hooks/useDialog.js +28 -0
- package/{dist/packages/react/src → es}/hooks/useOutsideClick.d.ts +2 -2
- package/es/hooks/useOutsideClick.js +15 -0
- package/{dist/packages/react/src → es}/hooks/usePrevious.d.ts +2 -2
- package/es/hooks/usePrevious.js +9 -0
- package/es/index.css +27 -0
- package/{dist/packages/react/src → es}/index.d.ts +1 -1
- package/es/index.js +1 -0
- package/es/utils/convertCellsToCrypto.d.ts +8 -0
- package/es/utils/convertCellsToCrypto.js +307 -0
- package/es/utils/cryptoApi.d.ts +3 -0
- package/es/utils/cryptoApi.js +190 -0
- package/{dist/packages/react/src → es}/utils/datepickerStyles.d.ts +2 -2
- package/es/utils/datepickerStyles.js +8 -0
- package/es/utils/updateCellsDecimalFormat.d.ts +6 -0
- package/es/utils/updateCellsDecimalFormat.js +80 -0
- package/lib/assets/paint-roller.png +0 -0
- package/lib/components/ChangeColor/index.css +76 -0
- package/lib/components/ChangeColor/index.d.ts +7 -0
- package/lib/components/ChangeColor/index.js +50 -0
- package/lib/components/ConditionFormat/ConditionRules.d.ts +6 -0
- package/lib/components/ConditionFormat/ConditionRules.js +332 -0
- package/lib/components/ConditionFormat/index.css +210 -0
- package/lib/components/ConditionFormat/index.d.ts +7 -0
- package/lib/components/ConditionFormat/index.js +261 -0
- package/lib/components/ContextMenu/Divider.d.ts +3 -0
- package/lib/components/ContextMenu/Divider.js +14 -0
- package/lib/components/ContextMenu/FilterMenu.d.ts +3 -0
- package/lib/components/ContextMenu/FilterMenu.js +621 -0
- package/lib/components/ContextMenu/Menu.d.ts +8 -0
- package/lib/components/ContextMenu/Menu.js +33 -0
- package/lib/components/ContextMenu/SheetTab.d.ts +4 -0
- package/lib/components/ContextMenu/SheetTab.js +232 -0
- package/lib/components/ContextMenu/index.css +322 -0
- package/lib/components/ContextMenu/index.d.ts +5 -0
- package/lib/components/ContextMenu/index.js +1063 -0
- package/lib/components/CryptoDenominationSelector/index.css +67 -0
- package/lib/components/CryptoDenominationSelector/index.d.ts +8 -0
- package/lib/components/CryptoDenominationSelector/index.js +280 -0
- package/lib/components/CustomSort/index.css +23 -0
- package/lib/components/CustomSort/index.d.ts +4 -0
- package/lib/components/CustomSort/index.js +122 -0
- package/lib/components/DataVerification/DropdownList.d.ts +4 -0
- package/lib/components/DataVerification/DropdownList.js +135 -0
- package/lib/components/DataVerification/RangeDialog.d.ts +4 -0
- package/lib/components/DataVerification/RangeDialog.js +114 -0
- package/lib/components/DataVerification/getDisplayedRangeTxt.d.ts +2 -0
- package/lib/components/DataVerification/getDisplayedRangeTxt.js +15 -0
- package/lib/components/DataVerification/index.css +202 -0
- package/lib/components/DataVerification/index.d.ts +4 -0
- package/lib/components/DataVerification/index.js +407 -0
- package/lib/components/Dialog/index.css +64 -0
- package/lib/components/Dialog/index.d.ts +15 -0
- package/lib/components/Dialog/index.js +81 -0
- package/lib/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +11 -0
- package/lib/components/DuneChartsInputModal/DuneChartsInputModal.js +104 -0
- package/lib/components/DuneChartsInputModal/duneChartsInputModal.css +98 -0
- package/lib/components/DunePreview/DunePreview.d.ts +13 -0
- package/lib/components/DunePreview/DunePreview.js +53 -0
- package/lib/components/DunePreview/index.css +57 -0
- package/lib/components/FilterOption/index.d.ts +5 -0
- package/lib/components/FilterOption/index.js +130 -0
- package/lib/components/FormatSearch/index.css +19 -0
- package/lib/components/FormatSearch/index.d.ts +6 -0
- package/lib/components/FormatSearch/index.js +142 -0
- package/lib/components/FormulaSearch/index.css +65 -0
- package/lib/components/FormulaSearch/index.d.ts +5 -0
- package/lib/components/FormulaSearch/index.js +207 -0
- package/lib/components/FxEditor/NameBox.d.ts +3 -0
- package/lib/components/FxEditor/NameBox.js +38 -0
- package/lib/components/FxEditor/index.css +72 -0
- package/lib/components/FxEditor/index.d.ts +4 -0
- package/lib/components/FxEditor/index.js +176 -0
- package/lib/components/IFrameBoxs/iFrameBoxs.css +16 -0
- package/lib/components/IFrameBoxs/iFrameBoxs.d.ts +4 -0
- package/lib/components/IFrameBoxs/iFrameBoxs.js +151 -0
- package/lib/components/ImgBoxs/index.d.ts +3 -0
- package/lib/components/ImgBoxs/index.js +228 -0
- package/lib/components/LinkEidtCard/index.css +255 -0
- package/lib/components/LinkEidtCard/index.d.ts +5 -0
- package/lib/components/LinkEidtCard/index.js +247 -0
- package/lib/components/LocationCondition/index.css +74 -0
- package/lib/components/LocationCondition/index.d.ts +3 -0
- package/lib/components/LocationCondition/index.js +204 -0
- package/lib/components/MessageBox/index.d.ts +9 -0
- package/lib/components/MessageBox/index.js +23 -0
- package/lib/components/NotationBoxes/index.d.ts +3 -0
- package/lib/components/NotationBoxes/index.js +114 -0
- package/lib/components/ResetColumnWidth/index.d.ts +2 -0
- package/lib/components/ResetColumnWidth/index.js +138 -0
- package/lib/components/SVGDefines.d.ts +5 -0
- package/lib/components/SVGDefines.js +1968 -0
- package/lib/components/SVGIcon.d.ts +9 -0
- package/lib/components/SVGIcon.js +25 -0
- package/lib/components/SearchReplace/index.css +191 -0
- package/lib/components/SearchReplace/index.d.ts +6 -0
- package/lib/components/SearchReplace/index.js +294 -0
- package/lib/components/Sheet/index.css +27 -0
- package/lib/components/Sheet/index.d.ts +8 -0
- package/lib/components/Sheet/index.js +185 -0
- package/lib/components/SheetList/SheetHiddenButton.d.ts +8 -0
- package/lib/components/SheetList/SheetHiddenButton.js +44 -0
- package/lib/components/SheetList/SheetListItem.d.ts +9 -0
- package/lib/components/SheetList/SheetListItem.js +81 -0
- package/lib/components/SheetList/index.css +48 -0
- package/lib/components/SheetList/index.d.ts +4 -0
- package/lib/components/SheetList/index.js +39 -0
- package/lib/components/SheetOverlay/ColumnHeader.d.ts +3 -0
- package/lib/components/SheetOverlay/ColumnHeader.js +226 -0
- package/lib/components/SheetOverlay/ContentEditable.d.ts +11 -0
- package/lib/components/SheetOverlay/ContentEditable.js +83 -0
- package/lib/components/SheetOverlay/FormulaHint/index.css +180 -0
- package/lib/components/SheetOverlay/FormulaHint/index.d.ts +4 -0
- package/lib/components/SheetOverlay/FormulaHint/index.js +357 -0
- package/lib/components/SheetOverlay/FormulaSearch/constant.d.ts +63 -0
- package/lib/components/SheetOverlay/FormulaSearch/constant.js +334 -0
- package/lib/components/SheetOverlay/FormulaSearch/index.css +44 -0
- package/lib/components/SheetOverlay/FormulaSearch/index.d.ts +4 -0
- package/lib/components/SheetOverlay/FormulaSearch/index.js +270 -0
- package/lib/components/SheetOverlay/InputBox.d.ts +3 -0
- package/lib/components/SheetOverlay/InputBox.js +404 -0
- package/lib/components/SheetOverlay/RowHeader.d.ts +3 -0
- package/lib/components/SheetOverlay/RowHeader.js +196 -0
- package/lib/components/SheetOverlay/ScrollBar/index.css +40 -0
- package/lib/components/SheetOverlay/ScrollBar/index.d.ts +7 -0
- package/lib/components/SheetOverlay/ScrollBar/index.js +56 -0
- package/lib/components/SheetOverlay/index.css +952 -0
- package/lib/components/SheetOverlay/index.d.ts +4 -0
- package/lib/components/SheetOverlay/index.js +589 -0
- package/lib/components/SheetTab/SheetItem.d.ts +8 -0
- package/lib/components/SheetTab/SheetItem.js +239 -0
- package/lib/components/SheetTab/index.css +278 -0
- package/lib/components/SheetTab/index.d.ts +4 -0
- package/lib/components/SheetTab/index.js +200 -0
- package/lib/components/SplitColumn/index.css +121 -0
- package/lib/components/SplitColumn/index.d.ts +3 -0
- package/lib/components/SplitColumn/index.js +176 -0
- package/lib/components/Toolbar/Button.d.ts +12 -0
- package/lib/components/Toolbar/Button.js +39 -0
- package/lib/components/Toolbar/ColorPicker.d.ts +6 -0
- package/lib/components/Toolbar/ColorPicker.js +34 -0
- package/lib/components/Toolbar/Combo.d.ts +13 -0
- package/lib/components/Toolbar/Combo.js +132 -0
- package/lib/components/Toolbar/CustomBorder.d.ts +7 -0
- package/lib/components/Toolbar/CustomBorder.js +220 -0
- package/lib/components/Toolbar/CustomButton.d.ts +11 -0
- package/lib/components/Toolbar/CustomButton.js +36 -0
- package/lib/components/Toolbar/CustomColor.d.ts +8 -0
- package/lib/components/Toolbar/CustomColor.js +32 -0
- package/lib/components/Toolbar/CustomIcon.d.ts +9 -0
- package/lib/components/Toolbar/CustomIcon.js +46 -0
- package/lib/components/Toolbar/Divider.d.ts +4 -0
- package/lib/components/Toolbar/Divider.js +19 -0
- package/lib/components/Toolbar/MoreItemsContainer.d.ts +6 -0
- package/lib/components/Toolbar/MoreItemsContainer.js +25 -0
- package/lib/components/Toolbar/Select.d.ts +14 -0
- package/lib/components/Toolbar/Select.js +40 -0
- package/lib/components/Toolbar/index.css +411 -0
- package/lib/components/Toolbar/index.d.ts +16 -0
- package/lib/components/Toolbar/index.js +1731 -0
- package/lib/components/Workbook/api.d.ts +1186 -0
- package/lib/components/Workbook/api.js +412 -0
- package/lib/components/Workbook/index.css +48 -0
- package/{dist/stories/API.stories.d.ts → lib/components/Workbook/index.d.ts} +1194 -1210
- package/lib/components/Workbook/index.js +758 -0
- package/lib/components/ZoomControl/index.css +54 -0
- package/lib/components/ZoomControl/index.d.ts +4 -0
- package/lib/components/ZoomControl/index.js +120 -0
- package/lib/components/index.d.ts +5 -0
- package/lib/components/index.js +26 -0
- package/lib/constants.d.ts +27 -0
- package/lib/constants.js +52 -0
- package/lib/context/index.d.ts +25 -0
- package/lib/context/index.js +41 -0
- package/lib/context/modal.d.ts +10 -0
- package/lib/context/modal.js +50 -0
- package/lib/hooks/useAlert.d.ts +4 -0
- package/lib/hooks/useAlert.js +37 -0
- package/lib/hooks/useDialog.d.ts +5 -0
- package/lib/hooks/useDialog.js +37 -0
- package/lib/hooks/useOutsideClick.d.ts +2 -0
- package/lib/hooks/useOutsideClick.js +21 -0
- package/lib/hooks/usePrevious.d.ts +2 -0
- package/lib/hooks/usePrevious.js +15 -0
- package/lib/index.css +27 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +16 -0
- package/lib/utils/convertCellsToCrypto.d.ts +8 -0
- package/lib/utils/convertCellsToCrypto.js +314 -0
- package/lib/utils/cryptoApi.d.ts +3 -0
- package/lib/utils/cryptoApi.js +198 -0
- package/lib/utils/datepickerStyles.d.ts +2 -0
- package/lib/utils/datepickerStyles.js +14 -0
- package/lib/utils/updateCellsDecimalFormat.d.ts +6 -0
- package/lib/utils/updateCellsDecimalFormat.js +86 -0
- package/package.json +8 -7
- package/dist/index.css +0 -3915
- package/dist/index.esm.css +0 -3915
- package/dist/index.esm.js +0 -12975
- package/dist/index.js +0 -12995
- package/dist/index.umd.css +0 -3915
- package/dist/index.umd.js +0 -122445
- package/dist/index.umd.min.css +0 -1
- package/dist/index.umd.min.js +0 -50
- package/dist/packages/core/src/api/cell.d.ts +0 -10
- package/dist/packages/core/src/api/common.d.ts +0 -66
- package/dist/packages/core/src/api/errors.d.ts +0 -2
- package/dist/packages/core/src/api/index.d.ts +0 -9
- package/dist/packages/core/src/api/merge.d.ts +0 -5
- package/dist/packages/core/src/api/range.d.ts +0 -22
- package/dist/packages/core/src/api/rowcol.d.ts +0 -14
- package/dist/packages/core/src/api/sheet.d.ts +0 -10
- package/dist/packages/core/src/api/workbook.d.ts +0 -15
- package/dist/packages/core/src/canvas.d.ts +0 -46
- package/dist/packages/core/src/context.d.ts +0 -197
- package/dist/packages/core/src/events/copy.d.ts +0 -2
- package/dist/packages/core/src/events/index.d.ts +0 -4
- package/dist/packages/core/src/events/keyboard.d.ts +0 -6
- package/dist/packages/core/src/events/mouse.d.ts +0 -22
- package/dist/packages/core/src/events/paste.d.ts +0 -3
- package/dist/packages/core/src/index.d.ts +0 -10
- package/dist/packages/core/src/locale/en.d.ts +0 -992
- package/dist/packages/core/src/locale/es.d.ts +0 -1134
- package/dist/packages/core/src/locale/hi.d.ts +0 -1030
- package/dist/packages/core/src/locale/index.d.ts +0 -1049
- package/dist/packages/core/src/locale/zh.d.ts +0 -1048
- package/dist/packages/core/src/locale/zh_tw.d.ts +0 -1187
- package/dist/packages/core/src/modules/ConditionFormat.d.ts +0 -17
- package/dist/packages/core/src/modules/border.d.ts +0 -3
- package/dist/packages/core/src/modules/cell.d.ts +0 -32
- package/dist/packages/core/src/modules/clipboard.d.ts +0 -3
- package/dist/packages/core/src/modules/color.d.ts +0 -1
- package/dist/packages/core/src/modules/comment.d.ts +0 -97
- package/dist/packages/core/src/modules/conditionalFormat.d.ts +0 -2
- package/dist/packages/core/src/modules/cursor.d.ts +0 -3
- package/dist/packages/core/src/modules/dataVerification.d.ts +0 -11
- package/dist/packages/core/src/modules/dropCell.d.ts +0 -10
- package/dist/packages/core/src/modules/filter.d.ts +0 -45
- package/dist/packages/core/src/modules/format.d.ts +0 -6
- package/dist/packages/core/src/modules/formula.d.ts +0 -54
- package/dist/packages/core/src/modules/freeze.d.ts +0 -5
- package/dist/packages/core/src/modules/hyperlink.d.ts +0 -21
- package/dist/packages/core/src/modules/iframe.d.ts +0 -12
- package/dist/packages/core/src/modules/image.d.ts +0 -31
- package/dist/packages/core/src/modules/index.d.ts +0 -36
- package/dist/packages/core/src/modules/inline-string.d.ts +0 -36
- package/dist/packages/core/src/modules/location.d.ts +0 -6
- package/dist/packages/core/src/modules/locationCondition.d.ts +0 -21
- package/dist/packages/core/src/modules/merge.d.ts +0 -3
- package/dist/packages/core/src/modules/mobile.d.ts +0 -5
- package/dist/packages/core/src/modules/moveCells.d.ts +0 -5
- package/dist/packages/core/src/modules/protection.d.ts +0 -5
- package/dist/packages/core/src/modules/refresh.d.ts +0 -3
- package/dist/packages/core/src/modules/rowcol.d.ts +0 -19
- package/dist/packages/core/src/modules/screenshot.d.ts +0 -2
- package/dist/packages/core/src/modules/searchReplace.d.ts +0 -36
- package/dist/packages/core/src/modules/selection.d.ts +0 -46
- package/dist/packages/core/src/modules/sheet.d.ts +0 -10
- package/dist/packages/core/src/modules/sort.d.ts +0 -7
- package/dist/packages/core/src/modules/splitColumn.d.ts +0 -5
- package/dist/packages/core/src/modules/text.d.ts +0 -10
- package/dist/packages/core/src/modules/toolbar.d.ts +0 -32
- package/dist/packages/core/src/modules/validation.d.ts +0 -19
- package/dist/packages/core/src/modules/zoom.d.ts +0 -3
- package/dist/packages/core/src/settings.d.ts +0 -100
- package/dist/packages/core/src/types.d.ts +0 -371
- package/dist/packages/core/src/utils/freeze.d.ts +0 -7
- package/dist/packages/core/src/utils/index.d.ts +0 -18
- package/dist/packages/core/src/utils/patch.d.ts +0 -37
- package/dist/packages/react/src/components/Toolbar/index.d.ts +0 -10
- package/dist/packages/react/src/components/index.d.ts +0 -4
- package/dist/packages/react/src/constants.d.ts +0 -1
- package/dist/stories/Collabration.stories.d.ts +0 -2359
- package/dist/stories/Features.stories.d.ts +0 -9430
- package/dist/stories/data/cell.d.ts +0 -983
- package/dist/stories/data/dataVerification.d.ts +0 -131
- package/dist/stories/data/empty.d.ts +0 -10
- package/dist/stories/data/formula.d.ts +0 -362
- package/dist/stories/data/freeze.d.ts +0 -34
- package/dist/stories/data/protected.d.ts +0 -40
- package/dist/stories/utils.d.ts +0 -1
|
@@ -0,0 +1,1731 @@
|
|
|
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 = exports.CurrencySelector = 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
|
+
var _CryptoDenominationSelector = _interopRequireDefault(require("../CryptoDenominationSelector"));
|
|
30
|
+
var _constants = require("../../constants");
|
|
31
|
+
var _convertCellsToCrypto = require("../../utils/convertCellsToCrypto");
|
|
32
|
+
var _updateCellsDecimalFormat = require("../../utils/updateCellsDecimalFormat");
|
|
33
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
34
|
+
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); }
|
|
35
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) {
|
|
37
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
38
|
+
resolve(value);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
42
|
+
function fulfilled(value) {
|
|
43
|
+
try {
|
|
44
|
+
step(generator.next(value));
|
|
45
|
+
} catch (e) {
|
|
46
|
+
reject(e);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function rejected(value) {
|
|
50
|
+
try {
|
|
51
|
+
step(generator["throw"](value));
|
|
52
|
+
} catch (e) {
|
|
53
|
+
reject(e);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function step(result) {
|
|
57
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
58
|
+
}
|
|
59
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
63
|
+
var _ = {
|
|
64
|
+
label: 0,
|
|
65
|
+
sent: function sent() {
|
|
66
|
+
if (t[0] & 1) throw t[1];
|
|
67
|
+
return t[1];
|
|
68
|
+
},
|
|
69
|
+
trys: [],
|
|
70
|
+
ops: []
|
|
71
|
+
},
|
|
72
|
+
f,
|
|
73
|
+
y,
|
|
74
|
+
t,
|
|
75
|
+
g;
|
|
76
|
+
return g = {
|
|
77
|
+
next: verb(0),
|
|
78
|
+
"throw": verb(1),
|
|
79
|
+
"return": verb(2)
|
|
80
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
81
|
+
return this;
|
|
82
|
+
}), g;
|
|
83
|
+
function verb(n) {
|
|
84
|
+
return function (v) {
|
|
85
|
+
return step([n, v]);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function step(op) {
|
|
89
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
90
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
91
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
92
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
93
|
+
switch (op[0]) {
|
|
94
|
+
case 0:
|
|
95
|
+
case 1:
|
|
96
|
+
t = op;
|
|
97
|
+
break;
|
|
98
|
+
case 4:
|
|
99
|
+
_.label++;
|
|
100
|
+
return {
|
|
101
|
+
value: op[1],
|
|
102
|
+
done: false
|
|
103
|
+
};
|
|
104
|
+
case 5:
|
|
105
|
+
_.label++;
|
|
106
|
+
y = op[1];
|
|
107
|
+
op = [0];
|
|
108
|
+
continue;
|
|
109
|
+
case 7:
|
|
110
|
+
op = _.ops.pop();
|
|
111
|
+
_.trys.pop();
|
|
112
|
+
continue;
|
|
113
|
+
default:
|
|
114
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
115
|
+
_ = 0;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
119
|
+
_.label = op[1];
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
123
|
+
_.label = t[1];
|
|
124
|
+
t = op;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
if (t && _.label < t[2]) {
|
|
128
|
+
_.label = t[2];
|
|
129
|
+
_.ops.push(op);
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
if (t[2]) _.ops.pop();
|
|
133
|
+
_.trys.pop();
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
op = body.call(thisArg, _);
|
|
137
|
+
} catch (e) {
|
|
138
|
+
op = [6, e];
|
|
139
|
+
y = 0;
|
|
140
|
+
} finally {
|
|
141
|
+
f = t = 0;
|
|
142
|
+
}
|
|
143
|
+
if (op[0] & 5) throw op[1];
|
|
144
|
+
return {
|
|
145
|
+
value: op[0] ? op[1] : void 0,
|
|
146
|
+
done: true
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
var __spreadArray = void 0 && (void 0).__spreadArray || function (to, from, pack) {
|
|
151
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
152
|
+
if (ar || !(i in from)) {
|
|
153
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
154
|
+
ar[i] = from[i];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
158
|
+
};
|
|
159
|
+
var getLucideIcon = exports.getLucideIcon = function getLucideIcon(title) {
|
|
160
|
+
switch (title) {
|
|
161
|
+
case "undo":
|
|
162
|
+
return "Undo";
|
|
163
|
+
case "redo":
|
|
164
|
+
return "Redo";
|
|
165
|
+
case "format-painter":
|
|
166
|
+
return "PaintRoller";
|
|
167
|
+
case "bold":
|
|
168
|
+
return "Bold";
|
|
169
|
+
case "italic":
|
|
170
|
+
return "Italic";
|
|
171
|
+
case "strike-through":
|
|
172
|
+
return "Strikethrough";
|
|
173
|
+
case "underline":
|
|
174
|
+
return "Underline";
|
|
175
|
+
case "align-left":
|
|
176
|
+
return "AlignLeft";
|
|
177
|
+
case "align-center":
|
|
178
|
+
return "AlignCenter";
|
|
179
|
+
case "align-right":
|
|
180
|
+
return "AlignRight";
|
|
181
|
+
case "align-top":
|
|
182
|
+
return "ArrowUpFromLine";
|
|
183
|
+
case "align-middle":
|
|
184
|
+
return "AlignVerticalMiddle";
|
|
185
|
+
case "align-bottom":
|
|
186
|
+
return "ArrowDownToLine";
|
|
187
|
+
case "text-overflow":
|
|
188
|
+
return "TextOverflow";
|
|
189
|
+
case "text-wrap":
|
|
190
|
+
return "WrapText";
|
|
191
|
+
case "text-clip":
|
|
192
|
+
return "TextClip";
|
|
193
|
+
case "font-color":
|
|
194
|
+
return "Baseline";
|
|
195
|
+
case "background":
|
|
196
|
+
return "PaintBucket";
|
|
197
|
+
case "border-all":
|
|
198
|
+
return "Border";
|
|
199
|
+
case "merge-all":
|
|
200
|
+
return "MergeHorizontal";
|
|
201
|
+
case "format":
|
|
202
|
+
return "DollarSign";
|
|
203
|
+
case "currency-format":
|
|
204
|
+
return "DollarSign";
|
|
205
|
+
case "currency":
|
|
206
|
+
return "ChevronDown";
|
|
207
|
+
case "percentage-format":
|
|
208
|
+
return "Percent";
|
|
209
|
+
case "number-decrease":
|
|
210
|
+
return "DecimalsArrowLeft";
|
|
211
|
+
case "number-increase":
|
|
212
|
+
return "DecimalsArrowRight";
|
|
213
|
+
case "conditionFormat":
|
|
214
|
+
return "PaintbrushVertical";
|
|
215
|
+
case "filter":
|
|
216
|
+
return "Filter";
|
|
217
|
+
case "link":
|
|
218
|
+
return "Link";
|
|
219
|
+
case "comment":
|
|
220
|
+
return "MessageSquarePlus";
|
|
221
|
+
case "image":
|
|
222
|
+
return "Image";
|
|
223
|
+
case "formula-sum":
|
|
224
|
+
return "Sigma";
|
|
225
|
+
case "dataVerification":
|
|
226
|
+
return "ShieldCheck";
|
|
227
|
+
case "search":
|
|
228
|
+
return "Search";
|
|
229
|
+
case "dune":
|
|
230
|
+
return "DuneChart";
|
|
231
|
+
case "crypto":
|
|
232
|
+
return "Ethereum";
|
|
233
|
+
case "Ellipsis":
|
|
234
|
+
return "Ellipsis";
|
|
235
|
+
default:
|
|
236
|
+
return "";
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
var CurrencySelector = exports.CurrencySelector = function CurrencySelector(_a) {
|
|
240
|
+
var cell = _a.cell,
|
|
241
|
+
defaultTextFormat = _a.defaultTextFormat,
|
|
242
|
+
toolTipText = _a.toolTipText;
|
|
243
|
+
var _b = (0, _react.useContext)(_context.default),
|
|
244
|
+
context = _b.context,
|
|
245
|
+
setContext = _b.setContext,
|
|
246
|
+
refs = _b.refs;
|
|
247
|
+
var _c = (0, _react.useState)(""),
|
|
248
|
+
searchTerm = _c[0],
|
|
249
|
+
setSearchTerm = _c[1];
|
|
250
|
+
var _d = (0, _react.useState)(2),
|
|
251
|
+
decimals = _d[0],
|
|
252
|
+
setDecimals = _d[1];
|
|
253
|
+
var _e = (0, _react.useState)("USD"),
|
|
254
|
+
selectedFiat = _e[0],
|
|
255
|
+
setSelectedFiat = _e[1];
|
|
256
|
+
var currentFmt = defaultTextFormat;
|
|
257
|
+
var currentIcon = "currency";
|
|
258
|
+
if (cell) {
|
|
259
|
+
var curr_1 = (0, _fortuneCore.normalizedCellAttr)(cell, "ct");
|
|
260
|
+
if (curr_1 === null || curr_1 === void 0 ? void 0 : curr_1.fa) {
|
|
261
|
+
var allOptions = __spreadArray(__spreadArray([], _constants.CRYPTO_OPTIONS, true), (0, _fortuneCore.locale)(context).currencyDetail.map(function (c) {
|
|
262
|
+
return {
|
|
263
|
+
label: c.name,
|
|
264
|
+
value: c.value,
|
|
265
|
+
icon: undefined,
|
|
266
|
+
type: "fiat"
|
|
267
|
+
};
|
|
268
|
+
}), true);
|
|
269
|
+
var found = __spreadArray([], allOptions, true).sort(function (a, b) {
|
|
270
|
+
return b.value.length - a.value.length;
|
|
271
|
+
}).find(function (o) {
|
|
272
|
+
return curr_1.fa.includes(o.value);
|
|
273
|
+
});
|
|
274
|
+
if (found) {
|
|
275
|
+
currentFmt = found.label;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
var groupedOptions = (0, _constants.getGroupedCurrencyOptions)((0, _fortuneCore.locale)(context).currencyDetail);
|
|
280
|
+
var filterOptions = function filterOptions(options) {
|
|
281
|
+
if (!searchTerm.trim()) return options;
|
|
282
|
+
var query = searchTerm.trim().toLowerCase();
|
|
283
|
+
return options.filter(function (opt) {
|
|
284
|
+
return query.split(/\s+/).every(function (word) {
|
|
285
|
+
return opt.label.toLowerCase().includes(word) || opt.value.toLowerCase().includes(word);
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
var dedupeByValue = function dedupeByValue(options) {
|
|
290
|
+
var seen = new Set();
|
|
291
|
+
return options.filter(function (opt) {
|
|
292
|
+
if (seen.has(opt.value)) return false;
|
|
293
|
+
seen.add(opt.value);
|
|
294
|
+
return true;
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
var handleCurrencyDecimalsChange = function handleCurrencyDecimalsChange(newDecimals) {
|
|
298
|
+
setDecimals(newDecimals);
|
|
299
|
+
var isCrypto = false;
|
|
300
|
+
if (cell && cell.ct && typeof cell.ct.fa === "string") {
|
|
301
|
+
var _a = cell.ct.fa.match(/"([A-Z]+)"/) || [],
|
|
302
|
+
matchedDenom = _a[1];
|
|
303
|
+
if (matchedDenom) isCrypto = true;
|
|
304
|
+
}
|
|
305
|
+
(0, _updateCellsDecimalFormat.updateCellsDecimalFormat)({
|
|
306
|
+
context: context,
|
|
307
|
+
setContext: setContext,
|
|
308
|
+
decimals: newDecimals,
|
|
309
|
+
denomination: isCrypto ? undefined : selectedFiat
|
|
310
|
+
});
|
|
311
|
+
};
|
|
312
|
+
var triggerRef = (0, _react.useRef)(null);
|
|
313
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
314
|
+
style: {
|
|
315
|
+
padding: "0px"
|
|
316
|
+
},
|
|
317
|
+
className: "items-center fortune-toolbar-button"
|
|
318
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.Tooltip, {
|
|
319
|
+
text: toolTipText,
|
|
320
|
+
placement: "bottom"
|
|
321
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
322
|
+
className: "",
|
|
323
|
+
onClick: function onClick() {
|
|
324
|
+
var _a;
|
|
325
|
+
(_a = triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
326
|
+
},
|
|
327
|
+
tabIndex: 0,
|
|
328
|
+
role: "button"
|
|
329
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
330
|
+
name: getLucideIcon("currency-format"),
|
|
331
|
+
width: 16,
|
|
332
|
+
height: 16
|
|
333
|
+
}))), /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
334
|
+
iconId: currentIcon,
|
|
335
|
+
text: currentFmt,
|
|
336
|
+
key: "currency",
|
|
337
|
+
tooltip: "",
|
|
338
|
+
showArrow: true,
|
|
339
|
+
triggerRef: triggerRef
|
|
340
|
+
}, function (setOpen) {
|
|
341
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
342
|
+
style: {
|
|
343
|
+
minWidth: "20rem",
|
|
344
|
+
boxShadow: "2px 2px 10px rgba(0, 0, 0, 0.2)",
|
|
345
|
+
borderRadius: "8px"
|
|
346
|
+
}
|
|
347
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.Command, {
|
|
348
|
+
className: "border color-border-default rounded-lg"
|
|
349
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
350
|
+
id: "search-input-container"
|
|
351
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.CommandInput, {
|
|
352
|
+
placeholder: "Search by name or code",
|
|
353
|
+
value: searchTerm,
|
|
354
|
+
onValueChange: setSearchTerm
|
|
355
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
356
|
+
className: "px-4 py-2 border-b color-border-default flex items-center justify-between gap-2 text-body-sm color-text-default",
|
|
357
|
+
onClick: function onClick(e) {
|
|
358
|
+
return e.stopPropagation();
|
|
359
|
+
}
|
|
360
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, "Decimal places:"), /*#__PURE__*/_react.default.createElement("span", {
|
|
361
|
+
className: "cds-row flex items-center"
|
|
362
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
|
|
363
|
+
icon: "Minus",
|
|
364
|
+
variant: "ghost",
|
|
365
|
+
size: "sm",
|
|
366
|
+
className: "",
|
|
367
|
+
disabled: decimals === 1,
|
|
368
|
+
onClick: function onClick() {
|
|
369
|
+
return handleCurrencyDecimalsChange(Math.max(1, decimals - 1));
|
|
370
|
+
}
|
|
371
|
+
}), /*#__PURE__*/_react.default.createElement("input", {
|
|
372
|
+
type: "number",
|
|
373
|
+
min: 1,
|
|
374
|
+
max: 18,
|
|
375
|
+
value: decimals,
|
|
376
|
+
onChange: function onChange(e) {
|
|
377
|
+
return handleCurrencyDecimalsChange(Math.max(1, Math.min(18, Number(e.target.value))));
|
|
378
|
+
}
|
|
379
|
+
}), /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
|
|
380
|
+
icon: "Plus",
|
|
381
|
+
variant: "ghost",
|
|
382
|
+
size: "sm",
|
|
383
|
+
disabled: decimals === 18,
|
|
384
|
+
onClick: function onClick() {
|
|
385
|
+
return handleCurrencyDecimalsChange(Math.min(18, decimals + 1));
|
|
386
|
+
}
|
|
387
|
+
}))), /*#__PURE__*/_react.default.createElement(_ui.CommandList, null, /*#__PURE__*/_react.default.createElement(_ui.CommandEmpty, {
|
|
388
|
+
className: "text-center text-body-sm color-text-secondary flex items-center justify-center",
|
|
389
|
+
style: {
|
|
390
|
+
minHeight: "5rem"
|
|
391
|
+
}
|
|
392
|
+
}, "No results found."), groupedOptions.map(function (group) {
|
|
393
|
+
var filtered = dedupeByValue(filterOptions(group.options));
|
|
394
|
+
return /*#__PURE__*/_react.default.createElement(_ui.CommandGroup, {
|
|
395
|
+
key: group.group,
|
|
396
|
+
heading: group.group
|
|
397
|
+
}, filtered.map(function (opt) {
|
|
398
|
+
return /*#__PURE__*/_react.default.createElement(_ui.CommandItem, {
|
|
399
|
+
key: opt.value,
|
|
400
|
+
value: "".concat(opt.label, " ").concat(opt.value),
|
|
401
|
+
onSelect: function onSelect() {
|
|
402
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
403
|
+
return __generator(this, function (_a) {
|
|
404
|
+
switch (_a.label) {
|
|
405
|
+
case 0:
|
|
406
|
+
if (!(opt.type === "crypto")) return [3, 2];
|
|
407
|
+
return [4, (0, _convertCellsToCrypto.convertCellsToCrypto)({
|
|
408
|
+
context: context,
|
|
409
|
+
setContext: setContext,
|
|
410
|
+
denomination: opt.value,
|
|
411
|
+
decimals: decimals
|
|
412
|
+
})];
|
|
413
|
+
case 1:
|
|
414
|
+
_a.sent();
|
|
415
|
+
return [3, 3];
|
|
416
|
+
case 2:
|
|
417
|
+
setSelectedFiat(opt.value);
|
|
418
|
+
setContext(function (ctx) {
|
|
419
|
+
var d = (0, _fortuneCore.getFlowdata)(ctx);
|
|
420
|
+
if (d == null) return;
|
|
421
|
+
var formatString = "".concat((0, _convertCellsToCrypto.getFiatSymbol)(opt.value), " #,##0.").concat("0".repeat(decimals));
|
|
422
|
+
(0, _fortuneCore.updateFormat)(ctx, refs.cellInput.current, d, "ct", formatString);
|
|
423
|
+
});
|
|
424
|
+
_a.label = 3;
|
|
425
|
+
case 3:
|
|
426
|
+
setOpen(false);
|
|
427
|
+
return [2];
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
433
|
+
className: "fortune-toolbar-menu-line flex items-center justify-between w-full"
|
|
434
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
435
|
+
className: "flex items-center gap-2 w-[250px]"
|
|
436
|
+
}, currentFmt === opt.label ? (/*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
437
|
+
name: "Check",
|
|
438
|
+
className: "w-4 h-4"
|
|
439
|
+
})) : (/*#__PURE__*/_react.default.createElement("span", {
|
|
440
|
+
className: "w-4 h-4"
|
|
441
|
+
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
442
|
+
className: "truncate flex-1 overflow-hidden whitespace-nowrap"
|
|
443
|
+
}, opt.label)), opt.type === "crypto" ? (/*#__PURE__*/_react.default.createElement("span", {
|
|
444
|
+
className: "color-text-secondary"
|
|
445
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
446
|
+
name: opt.icon,
|
|
447
|
+
className: "cds-icon"
|
|
448
|
+
}), opt.value === "SOL" && (/*#__PURE__*/_react.default.createElement(_SVGIcon.default, {
|
|
449
|
+
name: "solana",
|
|
450
|
+
width: 16,
|
|
451
|
+
height: 16
|
|
452
|
+
})))) : (/*#__PURE__*/_react.default.createElement("span", {
|
|
453
|
+
className: "color-text-secondary"
|
|
454
|
+
}, opt.value))));
|
|
455
|
+
}));
|
|
456
|
+
}))));
|
|
457
|
+
}));
|
|
458
|
+
};
|
|
459
|
+
var Toolbar = function Toolbar(_a) {
|
|
460
|
+
var _b, _c, _d;
|
|
461
|
+
var setMoreItems = _a.setMoreItems,
|
|
462
|
+
moreItemsOpen = _a.moreItemsOpen,
|
|
463
|
+
onMoreToolbarItemsClose = _a.onMoreToolbarItemsClose,
|
|
464
|
+
moreToolbarItems = _a.moreToolbarItems;
|
|
465
|
+
var _e = (0, _react.useContext)(_context.default),
|
|
466
|
+
context = _e.context,
|
|
467
|
+
setContext = _e.setContext,
|
|
468
|
+
refs = _e.refs,
|
|
469
|
+
settings = _e.settings,
|
|
470
|
+
handleUndo = _e.handleUndo,
|
|
471
|
+
handleRedo = _e.handleRedo;
|
|
472
|
+
var contextRef = (0, _react.useRef)(context);
|
|
473
|
+
var containerRef = (0, _react.useRef)(null);
|
|
474
|
+
var _f = (0, _react.useState)(-1),
|
|
475
|
+
toolbarWrapIndex = _f[0],
|
|
476
|
+
setToolbarWrapIndex = _f[1];
|
|
477
|
+
var _g = (0, _react.useState)([]),
|
|
478
|
+
itemLocations = _g[0],
|
|
479
|
+
setItemLocations = _g[1];
|
|
480
|
+
var _h = (0, _react.useState)(false),
|
|
481
|
+
showDuneModal = _h[0],
|
|
482
|
+
setShowDuneModal = _h[1];
|
|
483
|
+
var _j = (0, _react.useState)(window.innerWidth >= 1280),
|
|
484
|
+
isDesktop = _j[0],
|
|
485
|
+
setIsDesktop = _j[1];
|
|
486
|
+
var _k = (0, _useDialog.useDialog)(),
|
|
487
|
+
showDialog = _k.showDialog,
|
|
488
|
+
hideDialog = _k.hideDialog;
|
|
489
|
+
var firstSelection = (_b = context.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b[0];
|
|
490
|
+
var flowdata = (0, _fortuneCore.getFlowdata)(context);
|
|
491
|
+
contextRef.current = context;
|
|
492
|
+
var row = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.row_focus;
|
|
493
|
+
var col = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
|
|
494
|
+
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;
|
|
495
|
+
var _l = (0, _fortuneCore.locale)(context),
|
|
496
|
+
toolbar = _l.toolbar,
|
|
497
|
+
merge = _l.merge,
|
|
498
|
+
border = _l.border,
|
|
499
|
+
freezen = _l.freezen,
|
|
500
|
+
defaultFmt = _l.defaultFmt,
|
|
501
|
+
formula = _l.formula,
|
|
502
|
+
sort = _l.sort,
|
|
503
|
+
align = _l.align,
|
|
504
|
+
textWrap = _l.textWrap,
|
|
505
|
+
rotation = _l.rotation,
|
|
506
|
+
screenshot = _l.screenshot,
|
|
507
|
+
filter = _l.filter,
|
|
508
|
+
splitText = _l.splitText,
|
|
509
|
+
findAndReplace = _l.findAndReplace,
|
|
510
|
+
comment = _l.comment,
|
|
511
|
+
fontarray = _l.fontarray;
|
|
512
|
+
var toolbarFormat = (0, _fortuneCore.locale)(context).format;
|
|
513
|
+
var sheetWidth = context.luckysheetTableContentHW[0];
|
|
514
|
+
var currency = settings.currency;
|
|
515
|
+
var defaultFormat = defaultFmt(currency);
|
|
516
|
+
var customColor = (0, _react.useState)("#000000")[0];
|
|
517
|
+
var customStyle = (0, _react.useState)("1")[0];
|
|
518
|
+
var showSubMenu = (0, _react.useCallback)(function (e, className) {
|
|
519
|
+
var target = e.target;
|
|
520
|
+
var menuItem = target.className === "fortune-toolbar-menu-line" ? target.parentElement : target;
|
|
521
|
+
var menuItemRect = menuItem.getBoundingClientRect();
|
|
522
|
+
var workbookContainerRect = refs.workbookContainer.current.getBoundingClientRect();
|
|
523
|
+
var subMenu = menuItem.querySelector(".".concat(className));
|
|
524
|
+
if (_lodash.default.isNil(subMenu)) return;
|
|
525
|
+
var menuItemStyle = window.getComputedStyle(menuItem);
|
|
526
|
+
var menuItemPaddingRight = parseFloat(menuItemStyle.getPropertyValue("padding-right").replace("px", ""));
|
|
527
|
+
if (workbookContainerRect.right - menuItemRect.right < parseFloat(subMenu.style.width.replace("px", ""))) {
|
|
528
|
+
subMenu.style.display = "block";
|
|
529
|
+
subMenu.style.right = "".concat(menuItemRect.width - menuItemPaddingRight, "px");
|
|
530
|
+
} else {
|
|
531
|
+
subMenu.style.display = "block";
|
|
532
|
+
subMenu.style.right = className === "more-format" ? "".concat(-(parseFloat(subMenu.style.width.replace("px", "")) + 0), "px") : "".concat(-(parseFloat(subMenu.style.width.replace("px", "")) + menuItemPaddingRight), "px");
|
|
533
|
+
}
|
|
534
|
+
}, [refs.workbookContainer]);
|
|
535
|
+
var hideSubMenu = (0, _react.useCallback)(function (e, className) {
|
|
536
|
+
var target = e.target;
|
|
537
|
+
if (target.className === "".concat(className)) {
|
|
538
|
+
target.style.display = "none";
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
var subMenu = target.className === "condition-format-item" ? target.parentElement : target.querySelector(".".concat(className));
|
|
542
|
+
if (_lodash.default.isNil(subMenu)) return;
|
|
543
|
+
subMenu.style.display = "none";
|
|
544
|
+
}, []);
|
|
545
|
+
(0, _react.useEffect)(function () {
|
|
546
|
+
var handleResize = function handleResize() {
|
|
547
|
+
setIsDesktop(window.innerWidth >= 1280);
|
|
548
|
+
};
|
|
549
|
+
window.addEventListener("resize", handleResize);
|
|
550
|
+
return function () {
|
|
551
|
+
return window.removeEventListener("resize", handleResize);
|
|
552
|
+
};
|
|
553
|
+
}, []);
|
|
554
|
+
(0, _react.useEffect)(function () {
|
|
555
|
+
setToolbarWrapIndex(-1);
|
|
556
|
+
}, [settings.toolbarItems, settings.customToolbarItems]);
|
|
557
|
+
(0, _react.useEffect)(function () {
|
|
558
|
+
if (toolbarWrapIndex === -1) {
|
|
559
|
+
var container = containerRef.current;
|
|
560
|
+
if (!container) return;
|
|
561
|
+
var items = container.querySelectorAll(".fortune-toolbar-item");
|
|
562
|
+
if (!items) return;
|
|
563
|
+
var locations = [];
|
|
564
|
+
var containerRect = container.getBoundingClientRect();
|
|
565
|
+
for (var i = 0; i < items.length; i += 1) {
|
|
566
|
+
var item = items[i];
|
|
567
|
+
var itemRect = item.getBoundingClientRect();
|
|
568
|
+
locations.push(itemRect.left - containerRect.left + itemRect.width);
|
|
569
|
+
}
|
|
570
|
+
setItemLocations(locations);
|
|
571
|
+
}
|
|
572
|
+
}, [toolbarWrapIndex, sheetWidth]);
|
|
573
|
+
(0, _react.useEffect)(function () {
|
|
574
|
+
if (isDesktop) {
|
|
575
|
+
setToolbarWrapIndex(-1);
|
|
576
|
+
setMoreItems(null);
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
if (itemLocations.length === 0) return;
|
|
580
|
+
var container = containerRef.current;
|
|
581
|
+
if (!container) return;
|
|
582
|
+
var moreButtonWidth = 50;
|
|
583
|
+
var containerWidth = container.getBoundingClientRect().width;
|
|
584
|
+
var availableWidth = containerWidth - 30;
|
|
585
|
+
for (var i = itemLocations.length - 1; i >= 0; i -= 1) {
|
|
586
|
+
var loc = itemLocations[i];
|
|
587
|
+
if (loc + moreButtonWidth < availableWidth) {
|
|
588
|
+
setToolbarWrapIndex(i - itemLocations.length + settings.toolbarItems.length);
|
|
589
|
+
if (i === itemLocations.length - 1) {
|
|
590
|
+
setMoreItems(null);
|
|
591
|
+
}
|
|
592
|
+
break;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}, [itemLocations, setMoreItems, settings.toolbarItems.length, sheetWidth, isDesktop]);
|
|
596
|
+
var getToolbarItem = (0, _react.useCallback)(function (name, i) {
|
|
597
|
+
var _a, _b, _c, _d, _e, _f;
|
|
598
|
+
var tooltip = toolbar[name];
|
|
599
|
+
if (name === "|") {
|
|
600
|
+
return /*#__PURE__*/_react.default.createElement(_Divider.default, {
|
|
601
|
+
key: i
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
if (["font-color", "background"].includes(name)) {
|
|
605
|
+
var pick_1 = function pick_1(color) {
|
|
606
|
+
setContext(function (draftCtx) {
|
|
607
|
+
return (name === "font-color" ? _fortuneCore.handleTextColor : _fortuneCore.handleTextBackground)(draftCtx, refs.cellInput.current, color);
|
|
608
|
+
});
|
|
609
|
+
if (name === "font-color") {
|
|
610
|
+
refs.globalCache.recentTextColor = color;
|
|
611
|
+
} else {
|
|
612
|
+
refs.globalCache.recentBackgroundColor = color;
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
616
|
+
style: {
|
|
617
|
+
position: "relative"
|
|
618
|
+
},
|
|
619
|
+
key: name
|
|
620
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
621
|
+
style: {
|
|
622
|
+
width: 24,
|
|
623
|
+
height: 4,
|
|
624
|
+
backgroundColor: name === "font-color" ? refs.globalCache.recentTextColor : refs.globalCache.recentBackgroundColor,
|
|
625
|
+
position: "absolute",
|
|
626
|
+
bottom: 2,
|
|
627
|
+
left: 3,
|
|
628
|
+
zIndex: 100
|
|
629
|
+
}
|
|
630
|
+
}), /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
631
|
+
iconId: name,
|
|
632
|
+
tooltip: tooltip,
|
|
633
|
+
showArrow: false,
|
|
634
|
+
fillColor: name === "font-color" ? refs.globalCache.recentTextColor : undefined,
|
|
635
|
+
onClick: function onClick() {
|
|
636
|
+
var color = name === "font-color" ? refs.globalCache.recentTextColor : refs.globalCache.recentBackgroundColor;
|
|
637
|
+
if (color) pick_1(color);
|
|
638
|
+
}
|
|
639
|
+
}, function (setOpen) {
|
|
640
|
+
return /*#__PURE__*/_react.default.createElement(_CustomColor.CustomColor, {
|
|
641
|
+
onCustomPick: function onCustomPick(color) {
|
|
642
|
+
pick_1(color);
|
|
643
|
+
setOpen(false);
|
|
644
|
+
},
|
|
645
|
+
onColorPick: pick_1
|
|
646
|
+
});
|
|
647
|
+
}));
|
|
648
|
+
}
|
|
649
|
+
if (name === "format") {
|
|
650
|
+
var currentFmt = defaultFormat[0].text;
|
|
651
|
+
if (cell) {
|
|
652
|
+
var curr_2 = (0, _fortuneCore.normalizedCellAttr)(cell, "ct");
|
|
653
|
+
var format = _lodash.default.find(defaultFormat, function (v) {
|
|
654
|
+
return v.value === (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa);
|
|
655
|
+
});
|
|
656
|
+
if ((curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) != null) {
|
|
657
|
+
if (format != null) {
|
|
658
|
+
currentFmt = format.text;
|
|
659
|
+
} else {
|
|
660
|
+
currentFmt = defaultFormat[defaultFormat.length - 1].text;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
665
|
+
text: currentFmt,
|
|
666
|
+
key: name,
|
|
667
|
+
tooltip: tooltip,
|
|
668
|
+
showArrow: false
|
|
669
|
+
}, function (setOpen) {
|
|
670
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, null, defaultFormat.map(function (_a, ii) {
|
|
671
|
+
var text = _a.text,
|
|
672
|
+
value = _a.value,
|
|
673
|
+
example = _a.example;
|
|
674
|
+
if (value === "split") {
|
|
675
|
+
return /*#__PURE__*/_react.default.createElement(_Divider.MenuDivider, {
|
|
676
|
+
key: ii
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
if (value === "fmtOtherSelf") {
|
|
680
|
+
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
681
|
+
key: value,
|
|
682
|
+
onClick: function onClick() {
|
|
683
|
+
showDialog(/*#__PURE__*/_react.default.createElement(_FormatSearch.FormatSearch, {
|
|
684
|
+
onCancel: hideDialog,
|
|
685
|
+
type: "currency"
|
|
686
|
+
}), undefined, "Currency Format");
|
|
687
|
+
setOpen(false);
|
|
688
|
+
}
|
|
689
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
690
|
+
className: "fortune-toolbar-menu-line"
|
|
691
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, text), /*#__PURE__*/_react.default.createElement("div", {
|
|
692
|
+
className: "fortune-toolbar-subtext"
|
|
693
|
+
}, example)));
|
|
694
|
+
}
|
|
695
|
+
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
696
|
+
key: value,
|
|
697
|
+
onClick: function onClick() {
|
|
698
|
+
setOpen(false);
|
|
699
|
+
setContext(function (ctx) {
|
|
700
|
+
var d = (0, _fortuneCore.getFlowdata)(ctx);
|
|
701
|
+
if (d == null) return;
|
|
702
|
+
(0, _fortuneCore.updateFormat)(ctx, refs.cellInput.current, d, "ct", value);
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
706
|
+
className: "fortune-toolbar-menu-line"
|
|
707
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, text), /*#__PURE__*/_react.default.createElement("div", {
|
|
708
|
+
className: "fortune-toolbar-subtext"
|
|
709
|
+
}, example)));
|
|
710
|
+
}));
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
if (name === "font") {
|
|
714
|
+
var current_1 = fontarray[0];
|
|
715
|
+
if ((cell === null || cell === void 0 ? void 0 : cell.ff) != null) {
|
|
716
|
+
if (_lodash.default.isNumber(cell.ff)) {
|
|
717
|
+
current_1 = fontarray[cell.ff];
|
|
718
|
+
} else {
|
|
719
|
+
current_1 = cell.ff;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
723
|
+
text: current_1,
|
|
724
|
+
key: name,
|
|
725
|
+
tooltip: tooltip,
|
|
726
|
+
showArrow: false
|
|
727
|
+
}, function (setOpen) {
|
|
728
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, null, fontarray.map(function (o) {
|
|
729
|
+
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
730
|
+
key: o,
|
|
731
|
+
onClick: function onClick() {
|
|
732
|
+
setContext(function (ctx) {
|
|
733
|
+
current_1 = o;
|
|
734
|
+
var d = (0, _fortuneCore.getFlowdata)(ctx);
|
|
735
|
+
if (!d) return;
|
|
736
|
+
(0, _fortuneCore.updateFormat)(ctx, refs.cellInput.current, d, "ff", o);
|
|
737
|
+
});
|
|
738
|
+
setOpen(false);
|
|
739
|
+
}
|
|
740
|
+
}, o);
|
|
741
|
+
}));
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
if (name === "font-size") {
|
|
745
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
746
|
+
text: cell ? (0, _fortuneCore.normalizedCellAttr)(cell, "fs", context.defaultFontSize) : context.defaultFontSize.toString(),
|
|
747
|
+
key: name,
|
|
748
|
+
tooltip: tooltip,
|
|
749
|
+
showArrow: false
|
|
750
|
+
}, function (setOpen) {
|
|
751
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
752
|
+
style: {
|
|
753
|
+
minWidth: "fit-content",
|
|
754
|
+
width: "50px"
|
|
755
|
+
}
|
|
756
|
+
}, [9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72].map(function (num) {
|
|
757
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
758
|
+
className: "fortune-toolbar-select-option text-body-sm text-center color-text-default",
|
|
759
|
+
style: {
|
|
760
|
+
minWidth: "fit-content",
|
|
761
|
+
padding: "0px",
|
|
762
|
+
width: "36px",
|
|
763
|
+
height: "36px",
|
|
764
|
+
display: "flex",
|
|
765
|
+
alignItems: "center",
|
|
766
|
+
justifyContent: "center",
|
|
767
|
+
fontSize: "14px"
|
|
768
|
+
},
|
|
769
|
+
key: num,
|
|
770
|
+
onClick: function onClick() {
|
|
771
|
+
setContext(function (draftContext) {
|
|
772
|
+
return (0, _fortuneCore.handleTextSize)(draftContext, refs.cellInput.current, num, refs.canvas.current.getContext("2d"));
|
|
773
|
+
});
|
|
774
|
+
setOpen(false);
|
|
775
|
+
}
|
|
776
|
+
}, num);
|
|
777
|
+
}));
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
if (name === "horizontal-align") {
|
|
781
|
+
var items_1 = [{
|
|
782
|
+
title: "align-left",
|
|
783
|
+
text: align.left,
|
|
784
|
+
value: 1
|
|
785
|
+
}, {
|
|
786
|
+
title: "align-center",
|
|
787
|
+
text: align.center,
|
|
788
|
+
value: 0
|
|
789
|
+
}, {
|
|
790
|
+
title: "align-right",
|
|
791
|
+
text: align.right,
|
|
792
|
+
value: 2
|
|
793
|
+
}];
|
|
794
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
795
|
+
iconId: ((_a = _lodash.default.find(items_1, function (item) {
|
|
796
|
+
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.ht);
|
|
797
|
+
})) === null || _a === void 0 ? void 0 : _a.title) || "align-left",
|
|
798
|
+
key: name,
|
|
799
|
+
tooltip: toolbar.horizontalAlign,
|
|
800
|
+
showArrow: false
|
|
801
|
+
}, function (setOpen) {
|
|
802
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
803
|
+
style: {
|
|
804
|
+
minWidth: "fit-content",
|
|
805
|
+
display: "flex",
|
|
806
|
+
flexDirection: "row",
|
|
807
|
+
alignItems: "center",
|
|
808
|
+
justifyContent: "center",
|
|
809
|
+
gap: 4
|
|
810
|
+
}
|
|
811
|
+
}, items_1.map(function (_a) {
|
|
812
|
+
var _b;
|
|
813
|
+
var title = _a.title;
|
|
814
|
+
return /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
|
|
815
|
+
key: title,
|
|
816
|
+
isActive: ((_b = _lodash.default.find(items_1, function (item) {
|
|
817
|
+
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.ht);
|
|
818
|
+
})) === null || _b === void 0 ? void 0 : _b.title) === title,
|
|
819
|
+
icon: getLucideIcon(title),
|
|
820
|
+
variant: "ghost",
|
|
821
|
+
onClick: function onClick() {
|
|
822
|
+
setContext(function (ctx) {
|
|
823
|
+
(0, _fortuneCore.handleHorizontalAlign)(ctx, refs.cellInput.current, title.replace("align-", ""));
|
|
824
|
+
});
|
|
825
|
+
setOpen(false);
|
|
826
|
+
},
|
|
827
|
+
tabIndex: 0
|
|
828
|
+
});
|
|
829
|
+
}));
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
if (name === "vertical-align") {
|
|
833
|
+
var items_2 = [{
|
|
834
|
+
title: "align-top",
|
|
835
|
+
text: align.top,
|
|
836
|
+
value: 1
|
|
837
|
+
}, {
|
|
838
|
+
title: "align-middle",
|
|
839
|
+
text: align.middle,
|
|
840
|
+
value: 0
|
|
841
|
+
}, {
|
|
842
|
+
title: "align-bottom",
|
|
843
|
+
text: align.bottom,
|
|
844
|
+
value: 2
|
|
845
|
+
}];
|
|
846
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
847
|
+
iconId: ((_b = _lodash.default.find(items_2, function (item) {
|
|
848
|
+
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
|
|
849
|
+
})) === null || _b === void 0 ? void 0 : _b.title) || "align-top",
|
|
850
|
+
key: name,
|
|
851
|
+
tooltip: toolbar.verticalAlign,
|
|
852
|
+
showArrow: false
|
|
853
|
+
}, function (setOpen) {
|
|
854
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
855
|
+
style: {
|
|
856
|
+
minWidth: "fit-content",
|
|
857
|
+
display: "flex",
|
|
858
|
+
flexDirection: "row",
|
|
859
|
+
alignItems: "center",
|
|
860
|
+
justifyContent: "center",
|
|
861
|
+
gap: 4
|
|
862
|
+
}
|
|
863
|
+
}, items_2.map(function (_a) {
|
|
864
|
+
var _b;
|
|
865
|
+
var title = _a.title;
|
|
866
|
+
return /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
|
|
867
|
+
key: title,
|
|
868
|
+
isActive: ((_b = _lodash.default.find(items_2, function (item) {
|
|
869
|
+
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
|
|
870
|
+
})) === null || _b === void 0 ? void 0 : _b.title) === title,
|
|
871
|
+
icon: getLucideIcon(title),
|
|
872
|
+
variant: "ghost",
|
|
873
|
+
onClick: function onClick() {
|
|
874
|
+
setContext(function (ctx) {
|
|
875
|
+
(0, _fortuneCore.handleVerticalAlign)(ctx, refs.cellInput.current, title.replace("align-", ""));
|
|
876
|
+
});
|
|
877
|
+
setOpen(false);
|
|
878
|
+
},
|
|
879
|
+
tabIndex: 0
|
|
880
|
+
});
|
|
881
|
+
}));
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
if (name === "undo") {
|
|
885
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
886
|
+
iconId: name,
|
|
887
|
+
tooltip: tooltip,
|
|
888
|
+
key: name,
|
|
889
|
+
disabled: refs.globalCache.undoList.length === 0,
|
|
890
|
+
onClick: function onClick() {
|
|
891
|
+
return handleUndo();
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
if (name === "redo") {
|
|
896
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
897
|
+
iconId: name,
|
|
898
|
+
tooltip: tooltip,
|
|
899
|
+
key: name,
|
|
900
|
+
disabled: refs.globalCache.redoList.length === 0,
|
|
901
|
+
onClick: function onClick() {
|
|
902
|
+
return handleRedo();
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
if (name === "screenshot") {
|
|
907
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
908
|
+
iconId: name,
|
|
909
|
+
tooltip: tooltip,
|
|
910
|
+
key: name,
|
|
911
|
+
onClick: function onClick() {
|
|
912
|
+
var imgsrc = (0, _fortuneCore.handleScreenShot)(contextRef.current);
|
|
913
|
+
if (imgsrc) {
|
|
914
|
+
showDialog(/*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", null, screenshot.screenshotTipSuccess), /*#__PURE__*/_react.default.createElement("img", {
|
|
915
|
+
src: imgsrc,
|
|
916
|
+
alt: "",
|
|
917
|
+
style: {
|
|
918
|
+
maxWidth: "100%",
|
|
919
|
+
maxHeight: "100%"
|
|
920
|
+
}
|
|
921
|
+
})));
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
if (name === "splitColumn") {
|
|
927
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
928
|
+
iconId: name,
|
|
929
|
+
tooltip: tooltip,
|
|
930
|
+
key: name,
|
|
931
|
+
onClick: function onClick() {
|
|
932
|
+
if (context.allowEdit === false) return;
|
|
933
|
+
if (_lodash.default.isUndefined(context.luckysheet_select_save)) {
|
|
934
|
+
showDialog(splitText.tipNoSelect, "ok");
|
|
935
|
+
} else {
|
|
936
|
+
var currentColumn = context.luckysheet_select_save[context.luckysheet_select_save.length - 1].column;
|
|
937
|
+
if (context.luckysheet_select_save.length > 1) {
|
|
938
|
+
showDialog(splitText.tipNoMulti, "ok");
|
|
939
|
+
} else if (currentColumn[0] !== currentColumn[1]) {
|
|
940
|
+
showDialog(splitText.tipNoMultiColumn, "ok");
|
|
941
|
+
} else {
|
|
942
|
+
showDialog(/*#__PURE__*/_react.default.createElement(_SplitColumn.SplitColumn, null));
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
if (name === "dataVerification") {
|
|
949
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
950
|
+
iconId: name,
|
|
951
|
+
tooltip: tooltip,
|
|
952
|
+
key: name,
|
|
953
|
+
onClick: function onClick() {
|
|
954
|
+
if (context.allowEdit === false) return;
|
|
955
|
+
showDialog(/*#__PURE__*/_react.default.createElement(_DataVerification.default, null), undefined, toolbar.dataVerification);
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
if (name === "locationCondition") {
|
|
960
|
+
var items_3 = [{
|
|
961
|
+
text: findAndReplace.location,
|
|
962
|
+
value: "location"
|
|
963
|
+
}, {
|
|
964
|
+
text: findAndReplace.locationFormula,
|
|
965
|
+
value: "locationFormula"
|
|
966
|
+
}, {
|
|
967
|
+
text: findAndReplace.locationDate,
|
|
968
|
+
value: "locationDate"
|
|
969
|
+
}, {
|
|
970
|
+
text: findAndReplace.locationDigital,
|
|
971
|
+
value: "locationDigital"
|
|
972
|
+
}, {
|
|
973
|
+
text: findAndReplace.locationString,
|
|
974
|
+
value: "locationString"
|
|
975
|
+
}, {
|
|
976
|
+
text: findAndReplace.locationError,
|
|
977
|
+
value: "locationError"
|
|
978
|
+
}, {
|
|
979
|
+
text: findAndReplace.locationRowSpan,
|
|
980
|
+
value: "locationRowSpan"
|
|
981
|
+
}, {
|
|
982
|
+
text: findAndReplace.columnSpan,
|
|
983
|
+
value: "locationColumnSpan"
|
|
984
|
+
}];
|
|
985
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
986
|
+
iconId: "locationCondition",
|
|
987
|
+
key: name,
|
|
988
|
+
tooltip: findAndReplace.location,
|
|
989
|
+
showArrow: false
|
|
990
|
+
}, function (setOpen) {
|
|
991
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, null, items_3.map(function (_a) {
|
|
992
|
+
var text = _a.text,
|
|
993
|
+
value = _a.value;
|
|
994
|
+
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
995
|
+
key: value,
|
|
996
|
+
onClick: function onClick() {
|
|
997
|
+
var _a, _b, _c, _d, _e, _f;
|
|
998
|
+
if (context.luckysheet_select_save == null) {
|
|
999
|
+
showDialog(freezen.noSelectionError, "ok");
|
|
1000
|
+
return;
|
|
1001
|
+
}
|
|
1002
|
+
var last = context.luckysheet_select_save[0];
|
|
1003
|
+
var range;
|
|
1004
|
+
var rangeArr = [];
|
|
1005
|
+
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]) {
|
|
1006
|
+
range = [{
|
|
1007
|
+
row: [0, flowdata.length - 1],
|
|
1008
|
+
column: [0, flowdata[0].length - 1]
|
|
1009
|
+
}];
|
|
1010
|
+
} else {
|
|
1011
|
+
range = _lodash.default.assignIn([], context.luckysheet_select_save);
|
|
1012
|
+
}
|
|
1013
|
+
if (value === "location") {
|
|
1014
|
+
showDialog(/*#__PURE__*/_react.default.createElement(_LocationCondition.LocationCondition, null));
|
|
1015
|
+
} else if (value === "locationFormula") {
|
|
1016
|
+
setContext(function (ctx) {
|
|
1017
|
+
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationFormula", "all", ctx);
|
|
1018
|
+
});
|
|
1019
|
+
} else if (value === "locationDate") {
|
|
1020
|
+
setContext(function (ctx) {
|
|
1021
|
+
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationConstant", "d", ctx);
|
|
1022
|
+
});
|
|
1023
|
+
} else if (value === "locationDigital") {
|
|
1024
|
+
setContext(function (ctx) {
|
|
1025
|
+
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationConstant", "n", ctx);
|
|
1026
|
+
});
|
|
1027
|
+
} else if (value === "locationString") {
|
|
1028
|
+
setContext(function (ctx) {
|
|
1029
|
+
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationConstant", "s,g", ctx);
|
|
1030
|
+
});
|
|
1031
|
+
} else if (value === "locationError") {
|
|
1032
|
+
setContext(function (ctx) {
|
|
1033
|
+
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationConstant", "e", ctx);
|
|
1034
|
+
});
|
|
1035
|
+
} else if (value === "locationCondition") {
|
|
1036
|
+
setContext(function (ctx) {
|
|
1037
|
+
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationCF", undefined, ctx);
|
|
1038
|
+
});
|
|
1039
|
+
} else if (value === "locationRowSpan") {
|
|
1040
|
+
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]) {
|
|
1041
|
+
showDialog(findAndReplace.locationTiplessTwoRow, "ok");
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
range = _lodash.default.assignIn([], context.luckysheet_select_save);
|
|
1045
|
+
setContext(function (ctx) {
|
|
1046
|
+
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationRowSpan", undefined, ctx);
|
|
1047
|
+
});
|
|
1048
|
+
} else if (value === "locationColumnSpan") {
|
|
1049
|
+
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]) {
|
|
1050
|
+
showDialog(findAndReplace.locationTiplessTwoColumn, "ok");
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
range = _lodash.default.assignIn([], context.luckysheet_select_save);
|
|
1054
|
+
setContext(function (ctx) {
|
|
1055
|
+
rangeArr = (0, _fortuneCore.applyLocation)(range, "locationColumnSpan", undefined, ctx);
|
|
1056
|
+
});
|
|
1057
|
+
}
|
|
1058
|
+
if (rangeArr.length === 0 && value !== "location") showDialog(findAndReplace.locationTipNotFindCell, "ok");
|
|
1059
|
+
setOpen(false);
|
|
1060
|
+
}
|
|
1061
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1062
|
+
className: "fortune-toolbar-menu-line"
|
|
1063
|
+
}, text));
|
|
1064
|
+
}));
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
if (name === "conditionFormat") {
|
|
1068
|
+
var items_4 = ["highlightCellRules", "itemSelectionRules", "-", "deleteRule"];
|
|
1069
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1070
|
+
iconId: "conditionFormat",
|
|
1071
|
+
key: name,
|
|
1072
|
+
tooltip: toolbar.conditionalFormat,
|
|
1073
|
+
showArrow: false
|
|
1074
|
+
}, function (setOpen) {
|
|
1075
|
+
return /*#__PURE__*/_react.default.createElement(_ConditionFormat.default, {
|
|
1076
|
+
items: items_4,
|
|
1077
|
+
setOpen: setOpen
|
|
1078
|
+
});
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
if (name === "image") {
|
|
1082
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
1083
|
+
iconId: name,
|
|
1084
|
+
tooltip: toolbar.insertImage,
|
|
1085
|
+
key: name,
|
|
1086
|
+
onClick: function onClick() {
|
|
1087
|
+
if (context.allowEdit === false) return;
|
|
1088
|
+
(0, _fortuneCore.showImgChooser)();
|
|
1089
|
+
}
|
|
1090
|
+
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
1091
|
+
id: "fortune-img-upload",
|
|
1092
|
+
type: "file",
|
|
1093
|
+
accept: "image/*",
|
|
1094
|
+
style: {
|
|
1095
|
+
display: "none"
|
|
1096
|
+
},
|
|
1097
|
+
onChange: function onChange(e) {
|
|
1098
|
+
var _a;
|
|
1099
|
+
var file = (_a = e.currentTarget.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
1100
|
+
if (!file) return;
|
|
1101
|
+
var render = new FileReader();
|
|
1102
|
+
render.readAsDataURL(file);
|
|
1103
|
+
render.onload = function (event) {
|
|
1104
|
+
var _a;
|
|
1105
|
+
if (event.target == null) return;
|
|
1106
|
+
var src = (_a = event.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
1107
|
+
var image = new Image();
|
|
1108
|
+
image.onload = function () {
|
|
1109
|
+
setContext(function (draftCtx) {
|
|
1110
|
+
(0, _fortuneCore.insertImage)(draftCtx, image);
|
|
1111
|
+
});
|
|
1112
|
+
};
|
|
1113
|
+
image.src = src;
|
|
1114
|
+
};
|
|
1115
|
+
e.currentTarget.value = "";
|
|
1116
|
+
}
|
|
1117
|
+
}));
|
|
1118
|
+
}
|
|
1119
|
+
if (name === "comment") {
|
|
1120
|
+
var last = (_c = context.luckysheet_select_save) === null || _c === void 0 ? void 0 : _c[context.luckysheet_select_save.length - 1];
|
|
1121
|
+
var row_index_1 = last === null || last === void 0 ? void 0 : last.row_focus;
|
|
1122
|
+
var col_index_1 = last === null || last === void 0 ? void 0 : last.column_focus;
|
|
1123
|
+
if (!last) {
|
|
1124
|
+
row_index_1 = 0;
|
|
1125
|
+
col_index_1 = 0;
|
|
1126
|
+
} else {
|
|
1127
|
+
if (row_index_1 == null) {
|
|
1128
|
+
row_index_1 = last.row[0];
|
|
1129
|
+
}
|
|
1130
|
+
if (col_index_1 == null) {
|
|
1131
|
+
col_index_1 = last.column[0];
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
var itemData_1;
|
|
1135
|
+
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) {
|
|
1136
|
+
itemData_1 = [{
|
|
1137
|
+
key: "edit",
|
|
1138
|
+
text: comment.edit,
|
|
1139
|
+
onClick: _fortuneCore.editComment
|
|
1140
|
+
}, {
|
|
1141
|
+
key: "delete",
|
|
1142
|
+
text: comment.delete,
|
|
1143
|
+
onClick: _fortuneCore.deleteComment
|
|
1144
|
+
}, {
|
|
1145
|
+
key: "showOrHide",
|
|
1146
|
+
text: comment.showOne,
|
|
1147
|
+
onClick: _fortuneCore.showHideComment
|
|
1148
|
+
}, {
|
|
1149
|
+
key: "showOrHideAll",
|
|
1150
|
+
text: comment.showAll,
|
|
1151
|
+
onClick: _fortuneCore.showHideAllComments
|
|
1152
|
+
}];
|
|
1153
|
+
} else {
|
|
1154
|
+
itemData_1 = [{
|
|
1155
|
+
key: "new",
|
|
1156
|
+
text: comment.insert,
|
|
1157
|
+
onClick: _fortuneCore.newComment
|
|
1158
|
+
}, {
|
|
1159
|
+
key: "showOrHideAll",
|
|
1160
|
+
text: comment.showAll,
|
|
1161
|
+
onClick: _fortuneCore.showHideAllComments
|
|
1162
|
+
}];
|
|
1163
|
+
}
|
|
1164
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1165
|
+
iconId: name,
|
|
1166
|
+
key: name,
|
|
1167
|
+
tooltip: tooltip,
|
|
1168
|
+
showArrow: false
|
|
1169
|
+
}, function (setOpen) {
|
|
1170
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, null, itemData_1.map(function (_a) {
|
|
1171
|
+
var key = _a.key,
|
|
1172
|
+
text = _a.text,
|
|
1173
|
+
_onClick = _a.onClick;
|
|
1174
|
+
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
1175
|
+
key: key,
|
|
1176
|
+
onClick: function onClick() {
|
|
1177
|
+
setContext(function (draftContext) {
|
|
1178
|
+
return _onClick(draftContext, refs.globalCache, row_index_1, col_index_1);
|
|
1179
|
+
});
|
|
1180
|
+
setOpen(false);
|
|
1181
|
+
}
|
|
1182
|
+
}, text);
|
|
1183
|
+
}));
|
|
1184
|
+
});
|
|
1185
|
+
}
|
|
1186
|
+
if (name === "quick-formula") {
|
|
1187
|
+
var itemData_2 = [{
|
|
1188
|
+
text: formula.sum,
|
|
1189
|
+
value: "SUM"
|
|
1190
|
+
}, {
|
|
1191
|
+
text: formula.average,
|
|
1192
|
+
value: "AVERAGE"
|
|
1193
|
+
}, {
|
|
1194
|
+
text: formula.count,
|
|
1195
|
+
value: "COUNT"
|
|
1196
|
+
}, {
|
|
1197
|
+
text: formula.max,
|
|
1198
|
+
value: "MAX"
|
|
1199
|
+
}, {
|
|
1200
|
+
text: formula.min,
|
|
1201
|
+
value: "MIN"
|
|
1202
|
+
}];
|
|
1203
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1204
|
+
iconId: "formula-sum",
|
|
1205
|
+
key: name,
|
|
1206
|
+
tooltip: toolbar.autoSum,
|
|
1207
|
+
showArrow: false,
|
|
1208
|
+
onClick: function onClick() {
|
|
1209
|
+
return setContext(function (ctx) {
|
|
1210
|
+
(0, _fortuneCore.handleSum)(ctx, refs.cellInput.current, refs.fxInput.current, refs.globalCache);
|
|
1211
|
+
});
|
|
1212
|
+
}
|
|
1213
|
+
}, function (setOpen) {
|
|
1214
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, null, itemData_2.map(function (_a) {
|
|
1215
|
+
var value = _a.value,
|
|
1216
|
+
text = _a.text;
|
|
1217
|
+
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
1218
|
+
key: value,
|
|
1219
|
+
onClick: function onClick() {
|
|
1220
|
+
setContext(function (ctx) {
|
|
1221
|
+
(0, _fortuneCore.autoSelectionFormula)(ctx, refs.cellInput.current, refs.fxInput.current, value, refs.globalCache);
|
|
1222
|
+
});
|
|
1223
|
+
setOpen(false);
|
|
1224
|
+
}
|
|
1225
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1226
|
+
className: "fortune-toolbar-menu-line"
|
|
1227
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, text), /*#__PURE__*/_react.default.createElement("div", {
|
|
1228
|
+
className: "fortune-toolbar-subtext"
|
|
1229
|
+
}, value)));
|
|
1230
|
+
}), /*#__PURE__*/_react.default.createElement(_Divider.MenuDivider, null), /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
1231
|
+
key: "formula",
|
|
1232
|
+
onClick: function onClick() {
|
|
1233
|
+
var button = document.getElementById("function-button");
|
|
1234
|
+
if (button) {
|
|
1235
|
+
button.click();
|
|
1236
|
+
}
|
|
1237
|
+
setOpen(false);
|
|
1238
|
+
}
|
|
1239
|
+
}, "".concat(formula.find, "...")));
|
|
1240
|
+
});
|
|
1241
|
+
}
|
|
1242
|
+
if (name === "merge-cell") {
|
|
1243
|
+
var itemdata_1 = [{
|
|
1244
|
+
text: merge.mergeAll,
|
|
1245
|
+
value: "merge-all",
|
|
1246
|
+
icon: "MergeAll"
|
|
1247
|
+
}, {
|
|
1248
|
+
text: merge.mergeV,
|
|
1249
|
+
value: "merge-vertical",
|
|
1250
|
+
icon: "MergeVertical"
|
|
1251
|
+
}, {
|
|
1252
|
+
text: merge.mergeH,
|
|
1253
|
+
value: "merge-horizontal",
|
|
1254
|
+
icon: "MergeHorizontal"
|
|
1255
|
+
}, {
|
|
1256
|
+
text: merge.mergeCancel,
|
|
1257
|
+
value: "merge-cancel",
|
|
1258
|
+
icon: "Unmerge"
|
|
1259
|
+
}];
|
|
1260
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1261
|
+
iconId: "merge-all",
|
|
1262
|
+
key: name,
|
|
1263
|
+
tooltip: tooltip,
|
|
1264
|
+
text: "\u5408\u5E76\u5355\u5143\u683C",
|
|
1265
|
+
onClick: function onClick() {
|
|
1266
|
+
return setContext(function (ctx) {
|
|
1267
|
+
(0, _fortuneCore.handleMerge)(ctx, "merge-all");
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
}, function (setOpen) {
|
|
1271
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, null, itemdata_1.map(function (_a) {
|
|
1272
|
+
var text = _a.text,
|
|
1273
|
+
value = _a.value,
|
|
1274
|
+
icon = _a.icon;
|
|
1275
|
+
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
1276
|
+
key: value,
|
|
1277
|
+
onClick: function onClick() {
|
|
1278
|
+
setContext(function (ctx) {
|
|
1279
|
+
(0, _fortuneCore.handleMerge)(ctx, value);
|
|
1280
|
+
});
|
|
1281
|
+
setOpen(false);
|
|
1282
|
+
}
|
|
1283
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1284
|
+
style: {
|
|
1285
|
+
display: "flex",
|
|
1286
|
+
alignItems: "center",
|
|
1287
|
+
gap: 6
|
|
1288
|
+
}
|
|
1289
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
1290
|
+
name: icon,
|
|
1291
|
+
width: 16,
|
|
1292
|
+
height: 16
|
|
1293
|
+
}), text));
|
|
1294
|
+
}));
|
|
1295
|
+
});
|
|
1296
|
+
}
|
|
1297
|
+
if (name === "border") {
|
|
1298
|
+
var items_5 = [{
|
|
1299
|
+
text: border.borderTop,
|
|
1300
|
+
value: "border-top",
|
|
1301
|
+
icon: "BorderTop"
|
|
1302
|
+
}, {
|
|
1303
|
+
text: border.borderBottom,
|
|
1304
|
+
value: "border-bottom",
|
|
1305
|
+
icon: "BorderBottom"
|
|
1306
|
+
}, {
|
|
1307
|
+
text: border.borderLeft,
|
|
1308
|
+
value: "border-left",
|
|
1309
|
+
icon: "BorderLeft"
|
|
1310
|
+
}, {
|
|
1311
|
+
text: border.borderRight,
|
|
1312
|
+
value: "border-right",
|
|
1313
|
+
icon: "BorderRight"
|
|
1314
|
+
}, {
|
|
1315
|
+
text: border.borderNone,
|
|
1316
|
+
value: "border-none",
|
|
1317
|
+
icon: "NoBorder"
|
|
1318
|
+
}, {
|
|
1319
|
+
text: border.borderAll,
|
|
1320
|
+
value: "border-all",
|
|
1321
|
+
icon: "Border"
|
|
1322
|
+
}, {
|
|
1323
|
+
text: border.borderOutside,
|
|
1324
|
+
value: "border-outside",
|
|
1325
|
+
icon: "BorderOutside"
|
|
1326
|
+
}, {
|
|
1327
|
+
text: border.borderInside,
|
|
1328
|
+
value: "border-inside",
|
|
1329
|
+
icon: "BorderInside"
|
|
1330
|
+
}, {
|
|
1331
|
+
text: border.borderHorizontal,
|
|
1332
|
+
value: "border-horizontal",
|
|
1333
|
+
icon: "BorderHorizontal"
|
|
1334
|
+
}, {
|
|
1335
|
+
text: border.borderVertical,
|
|
1336
|
+
value: "border-vertical",
|
|
1337
|
+
icon: "BorderVertical"
|
|
1338
|
+
}];
|
|
1339
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1340
|
+
iconId: "border-all",
|
|
1341
|
+
key: name,
|
|
1342
|
+
tooltip: tooltip,
|
|
1343
|
+
text: "\u8FB9\u6846\u8BBE\u7F6E",
|
|
1344
|
+
showArrow: false,
|
|
1345
|
+
onClick: function onClick() {
|
|
1346
|
+
return setContext(function (ctx) {
|
|
1347
|
+
(0, _fortuneCore.handleBorder)(ctx, "border-all", customColor, customStyle);
|
|
1348
|
+
});
|
|
1349
|
+
}
|
|
1350
|
+
}, function (setOpen) {
|
|
1351
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1352
|
+
className: "fortune-toolbar-select fortune-border-grid"
|
|
1353
|
+
}, items_5.map(function (_a) {
|
|
1354
|
+
var value = _a.value,
|
|
1355
|
+
icon = _a.icon;
|
|
1356
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1357
|
+
key: value,
|
|
1358
|
+
className: "fortune-border-grid-item",
|
|
1359
|
+
onClick: function onClick() {
|
|
1360
|
+
setContext(function (ctx) {
|
|
1361
|
+
(0, _fortuneCore.handleBorder)(ctx, value, customColor, customStyle);
|
|
1362
|
+
});
|
|
1363
|
+
setOpen(false);
|
|
1364
|
+
}
|
|
1365
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
1366
|
+
name: icon,
|
|
1367
|
+
width: 16,
|
|
1368
|
+
height: 16
|
|
1369
|
+
}));
|
|
1370
|
+
}));
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
if (name === "freeze") {
|
|
1374
|
+
var items_6 = [{
|
|
1375
|
+
text: freezen.freezenRowRange,
|
|
1376
|
+
value: "freeze-row"
|
|
1377
|
+
}, {
|
|
1378
|
+
text: freezen.freezenColumnRange,
|
|
1379
|
+
value: "freeze-col"
|
|
1380
|
+
}, {
|
|
1381
|
+
text: freezen.freezenRCRange,
|
|
1382
|
+
value: "freeze-row-col"
|
|
1383
|
+
}, {
|
|
1384
|
+
text: freezen.freezenCancel,
|
|
1385
|
+
value: "freeze-cancel"
|
|
1386
|
+
}];
|
|
1387
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1388
|
+
iconId: "freeze-row-col",
|
|
1389
|
+
key: name,
|
|
1390
|
+
tooltip: tooltip,
|
|
1391
|
+
showArrow: false,
|
|
1392
|
+
onClick: function onClick() {
|
|
1393
|
+
return setContext(function (ctx) {
|
|
1394
|
+
(0, _fortuneCore.handleFreeze)(ctx, "freeze-row-col");
|
|
1395
|
+
});
|
|
1396
|
+
}
|
|
1397
|
+
}, function (setOpen) {
|
|
1398
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, null, items_6.map(function (_a) {
|
|
1399
|
+
var text = _a.text,
|
|
1400
|
+
value = _a.value;
|
|
1401
|
+
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
1402
|
+
key: value,
|
|
1403
|
+
onClick: function onClick() {
|
|
1404
|
+
setContext(function (ctx) {
|
|
1405
|
+
(0, _fortuneCore.handleFreeze)(ctx, value);
|
|
1406
|
+
});
|
|
1407
|
+
setOpen(false);
|
|
1408
|
+
}
|
|
1409
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1410
|
+
className: "fortune-toolbar-menu-line"
|
|
1411
|
+
}, text, /*#__PURE__*/_react.default.createElement(_SVGIcon.default, {
|
|
1412
|
+
name: value,
|
|
1413
|
+
width: 16,
|
|
1414
|
+
height: 16
|
|
1415
|
+
})));
|
|
1416
|
+
}));
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
if (name === "text-wrap") {
|
|
1420
|
+
var items_7 = [{
|
|
1421
|
+
text: textWrap.clip,
|
|
1422
|
+
iconId: "text-clip",
|
|
1423
|
+
value: "clip"
|
|
1424
|
+
}, {
|
|
1425
|
+
text: textWrap.overflow,
|
|
1426
|
+
iconId: "text-overflow",
|
|
1427
|
+
value: "overflow"
|
|
1428
|
+
}, {
|
|
1429
|
+
text: textWrap.wrap,
|
|
1430
|
+
iconId: "text-wrap",
|
|
1431
|
+
value: "wrap"
|
|
1432
|
+
}];
|
|
1433
|
+
var curr_3 = items_7[0];
|
|
1434
|
+
if ((cell === null || cell === void 0 ? void 0 : cell.tb) != null) {
|
|
1435
|
+
curr_3 = _lodash.default.get(items_7, cell.tb);
|
|
1436
|
+
}
|
|
1437
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1438
|
+
iconId: curr_3.iconId,
|
|
1439
|
+
key: name,
|
|
1440
|
+
tooltip: toolbar.textWrap,
|
|
1441
|
+
showArrow: false
|
|
1442
|
+
}, function (setOpen) {
|
|
1443
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
1444
|
+
style: {
|
|
1445
|
+
minWidth: "fit-content",
|
|
1446
|
+
display: "flex",
|
|
1447
|
+
flexDirection: "row",
|
|
1448
|
+
alignItems: "center",
|
|
1449
|
+
justifyContent: "center",
|
|
1450
|
+
gap: 4
|
|
1451
|
+
}
|
|
1452
|
+
}, items_7.map(function (_a) {
|
|
1453
|
+
var iconId = _a.iconId,
|
|
1454
|
+
value = _a.value;
|
|
1455
|
+
return /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
|
|
1456
|
+
key: value,
|
|
1457
|
+
isActive: curr_3.value === value,
|
|
1458
|
+
icon: getLucideIcon(iconId),
|
|
1459
|
+
variant: "ghost",
|
|
1460
|
+
onClick: function onClick() {
|
|
1461
|
+
setContext(function (ctx) {
|
|
1462
|
+
var d = (0, _fortuneCore.getFlowdata)(ctx);
|
|
1463
|
+
if (d == null) return;
|
|
1464
|
+
(0, _fortuneCore.updateFormat)(ctx, refs.cellInput.current, d, "tb", value);
|
|
1465
|
+
});
|
|
1466
|
+
setOpen(false);
|
|
1467
|
+
},
|
|
1468
|
+
tabIndex: 0
|
|
1469
|
+
});
|
|
1470
|
+
}));
|
|
1471
|
+
});
|
|
1472
|
+
}
|
|
1473
|
+
if (name === "text-rotation") {
|
|
1474
|
+
var items_8 = [{
|
|
1475
|
+
text: rotation.none,
|
|
1476
|
+
iconId: "text-rotation-none",
|
|
1477
|
+
value: "none"
|
|
1478
|
+
}, {
|
|
1479
|
+
text: rotation.angleup,
|
|
1480
|
+
iconId: "text-rotation-angleup",
|
|
1481
|
+
value: "angleup"
|
|
1482
|
+
}, {
|
|
1483
|
+
text: rotation.angledown,
|
|
1484
|
+
iconId: "text-rotation-angledown",
|
|
1485
|
+
value: "angledown"
|
|
1486
|
+
}, {
|
|
1487
|
+
text: rotation.vertical,
|
|
1488
|
+
iconId: "text-rotation-vertical",
|
|
1489
|
+
value: "vertical"
|
|
1490
|
+
}, {
|
|
1491
|
+
text: rotation.rotationUp,
|
|
1492
|
+
iconId: "text-rotation-up",
|
|
1493
|
+
value: "rotation-up"
|
|
1494
|
+
}, {
|
|
1495
|
+
text: rotation.rotationDown,
|
|
1496
|
+
iconId: "text-rotation-down",
|
|
1497
|
+
value: "rotation-down"
|
|
1498
|
+
}];
|
|
1499
|
+
var curr = items_8[0];
|
|
1500
|
+
if ((cell === null || cell === void 0 ? void 0 : cell.tr) != null) {
|
|
1501
|
+
curr = _lodash.default.get(items_8, cell.tr);
|
|
1502
|
+
}
|
|
1503
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1504
|
+
iconId: curr.iconId,
|
|
1505
|
+
key: name,
|
|
1506
|
+
tooltip: toolbar.textRotate,
|
|
1507
|
+
showArrow: false
|
|
1508
|
+
}, function (setOpen) {
|
|
1509
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, null, items_8.map(function (_a) {
|
|
1510
|
+
var text = _a.text,
|
|
1511
|
+
iconId = _a.iconId,
|
|
1512
|
+
value = _a.value;
|
|
1513
|
+
return /*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
1514
|
+
key: value,
|
|
1515
|
+
onClick: function onClick() {
|
|
1516
|
+
setContext(function (ctx) {
|
|
1517
|
+
var d = (0, _fortuneCore.getFlowdata)(ctx);
|
|
1518
|
+
if (d == null) return;
|
|
1519
|
+
(0, _fortuneCore.updateFormat)(ctx, refs.cellInput.current, d, "tr", value);
|
|
1520
|
+
});
|
|
1521
|
+
setOpen(false);
|
|
1522
|
+
}
|
|
1523
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1524
|
+
className: "fortune-toolbar-menu-line"
|
|
1525
|
+
}, text, /*#__PURE__*/_react.default.createElement(_SVGIcon.default, {
|
|
1526
|
+
name: iconId,
|
|
1527
|
+
width: 16,
|
|
1528
|
+
height: 16
|
|
1529
|
+
})));
|
|
1530
|
+
}));
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1533
|
+
if (name === "filter") {
|
|
1534
|
+
var items_9 = [{
|
|
1535
|
+
iconId: "sort-asc",
|
|
1536
|
+
value: "sort-asc",
|
|
1537
|
+
text: sort.asc,
|
|
1538
|
+
onClick: function onClick() {
|
|
1539
|
+
setContext(function (ctx) {
|
|
1540
|
+
(0, _fortuneCore.handleSort)(ctx, true);
|
|
1541
|
+
});
|
|
1542
|
+
}
|
|
1543
|
+
}, {
|
|
1544
|
+
iconId: "sort-desc",
|
|
1545
|
+
value: "sort-desc",
|
|
1546
|
+
text: sort.desc,
|
|
1547
|
+
onClick: function onClick() {
|
|
1548
|
+
setContext(function (ctx) {
|
|
1549
|
+
(0, _fortuneCore.handleSort)(ctx, false);
|
|
1550
|
+
});
|
|
1551
|
+
}
|
|
1552
|
+
}, {
|
|
1553
|
+
iconId: "",
|
|
1554
|
+
value: "divider"
|
|
1555
|
+
}, {
|
|
1556
|
+
iconId: "filter1",
|
|
1557
|
+
value: "filter",
|
|
1558
|
+
text: filter.filter,
|
|
1559
|
+
onClick: function onClick() {
|
|
1560
|
+
return setContext(function (draftCtx) {
|
|
1561
|
+
(0, _fortuneCore.createFilter)(draftCtx);
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
}, {
|
|
1565
|
+
iconId: "eraser",
|
|
1566
|
+
value: "eraser",
|
|
1567
|
+
text: filter.clearFilter,
|
|
1568
|
+
onClick: function onClick() {
|
|
1569
|
+
return setContext(function (draftCtx) {
|
|
1570
|
+
(0, _fortuneCore.clearFilter)(draftCtx);
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
}];
|
|
1574
|
+
return /*#__PURE__*/_react.default.createElement(_Combo.default, {
|
|
1575
|
+
iconId: "filter",
|
|
1576
|
+
key: name,
|
|
1577
|
+
tooltip: toolbar.sortAndFilter,
|
|
1578
|
+
showArrow: false
|
|
1579
|
+
}, function (setOpen) {
|
|
1580
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
1581
|
+
style: {
|
|
1582
|
+
minWidth: "11.25rem"
|
|
1583
|
+
}
|
|
1584
|
+
}, items_9.map(function (_a, index) {
|
|
1585
|
+
var text = _a.text,
|
|
1586
|
+
iconId = _a.iconId,
|
|
1587
|
+
value = _a.value,
|
|
1588
|
+
_onClick2 = _a.onClick;
|
|
1589
|
+
return value !== "divider" ? (/*#__PURE__*/_react.default.createElement(_Select.Option, {
|
|
1590
|
+
key: value,
|
|
1591
|
+
onClick: function onClick() {
|
|
1592
|
+
_onClick2 === null || _onClick2 === void 0 ? void 0 : _onClick2();
|
|
1593
|
+
setOpen(false);
|
|
1594
|
+
}
|
|
1595
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1596
|
+
className: "fortune-toolbar-menu-line gap-1",
|
|
1597
|
+
style: {
|
|
1598
|
+
justifyContent: "start"
|
|
1599
|
+
}
|
|
1600
|
+
}, /*#__PURE__*/_react.default.createElement(_SVGIcon.default, {
|
|
1601
|
+
name: iconId,
|
|
1602
|
+
width: 16,
|
|
1603
|
+
height: 16
|
|
1604
|
+
}), text))) : (/*#__PURE__*/_react.default.createElement(_Divider.MenuDivider, {
|
|
1605
|
+
key: "divider-".concat(index)
|
|
1606
|
+
}));
|
|
1607
|
+
}));
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
if (name === "currency") {
|
|
1611
|
+
return /*#__PURE__*/_react.default.createElement(CurrencySelector, {
|
|
1612
|
+
cell: cell,
|
|
1613
|
+
defaultTextFormat: defaultFormat[0].text,
|
|
1614
|
+
toolTipText: toolbar["currency-format"]
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1617
|
+
return /*#__PURE__*/_react.default.createElement(_ui.Tooltip, {
|
|
1618
|
+
text: tooltip,
|
|
1619
|
+
placement: "bottom"
|
|
1620
|
+
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
1621
|
+
iconId: name,
|
|
1622
|
+
tooltip: tooltip,
|
|
1623
|
+
key: name,
|
|
1624
|
+
selected: (_f = (0, _fortuneCore.toolbarItemSelectedFunc)(name)) === null || _f === void 0 ? void 0 : _f(cell),
|
|
1625
|
+
onClick: function onClick() {
|
|
1626
|
+
return setContext(function (draftCtx) {
|
|
1627
|
+
var _a;
|
|
1628
|
+
(_a = (0, _fortuneCore.toolbarItemClickHandler)(name)) === null || _a === void 0 ? void 0 : _a(draftCtx, refs.cellInput.current, refs.globalCache);
|
|
1629
|
+
});
|
|
1630
|
+
}
|
|
1631
|
+
}));
|
|
1632
|
+
}, [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]);
|
|
1633
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1634
|
+
ref: containerRef,
|
|
1635
|
+
className: "fortune-toolbar",
|
|
1636
|
+
"aria-label": toolbar.toolbar
|
|
1637
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1638
|
+
className: "fortune-toolbar-left"
|
|
1639
|
+
}, settings.customToolbarItems.filter(function (n) {
|
|
1640
|
+
return n.key === "import-export";
|
|
1641
|
+
}).map(function (n) {
|
|
1642
|
+
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
1643
|
+
tooltip: n.tooltip,
|
|
1644
|
+
onClick: n.onClick,
|
|
1645
|
+
key: n.key,
|
|
1646
|
+
icon: n.icon,
|
|
1647
|
+
iconName: n.iconName
|
|
1648
|
+
}, n.children);
|
|
1649
|
+
}), ((_d = settings.customToolbarItems) === null || _d === void 0 ? void 0 : _d.length) > 0 ? (/*#__PURE__*/_react.default.createElement(_Divider.default, {
|
|
1650
|
+
key: "customDivider"
|
|
1651
|
+
})) : null, (toolbarWrapIndex === -1 || isDesktop ? settings.toolbarItems : settings.toolbarItems.slice(0, toolbarWrapIndex + 1)).map(function (name, i) {
|
|
1652
|
+
return getToolbarItem(name, i);
|
|
1653
|
+
}), !isDesktop && toolbarWrapIndex !== -1 && toolbarWrapIndex < settings.toolbarItems.length - 1 ? (/*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
1654
|
+
iconId: "Ellipsis",
|
|
1655
|
+
tooltip: toolbar.toolMore,
|
|
1656
|
+
onClick: function onClick() {
|
|
1657
|
+
if (moreItemsOpen) {
|
|
1658
|
+
setMoreItems(null);
|
|
1659
|
+
} else {
|
|
1660
|
+
setMoreItems(settings.toolbarItems.slice(toolbarWrapIndex + 1).map(function (name, i) {
|
|
1661
|
+
return getToolbarItem(name, i);
|
|
1662
|
+
}));
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
})) : null, moreToolbarItems && (/*#__PURE__*/_react.default.createElement(_MoreItemsContainer.default, {
|
|
1666
|
+
onClose: onMoreToolbarItemsClose
|
|
1667
|
+
}, moreToolbarItems))), /*#__PURE__*/_react.default.createElement("div", {
|
|
1668
|
+
className: "fortune-toolbar-right"
|
|
1669
|
+
}, settings.customToolbarItems.length > 0 && (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, settings.customToolbarItems.filter(function (t) {
|
|
1670
|
+
return t.key === "Smart Contract";
|
|
1671
|
+
}).map(function (n) {
|
|
1672
|
+
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
1673
|
+
tooltip: n.tooltip,
|
|
1674
|
+
onClick: n.onClick,
|
|
1675
|
+
key: n.key,
|
|
1676
|
+
icon: n.icon,
|
|
1677
|
+
iconName: n.iconName
|
|
1678
|
+
}, n.children);
|
|
1679
|
+
}), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
1680
|
+
iconId: "dune",
|
|
1681
|
+
tooltip: "Insert Dune Chart",
|
|
1682
|
+
key: "dune-charts",
|
|
1683
|
+
onClick: function onClick() {
|
|
1684
|
+
if (context.allowEdit === false) return;
|
|
1685
|
+
setShowDuneModal(true);
|
|
1686
|
+
},
|
|
1687
|
+
style: {
|
|
1688
|
+
backgroundColor: "#F4603E2E",
|
|
1689
|
+
borderRadius: "8px"
|
|
1690
|
+
}
|
|
1691
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
1692
|
+
style: {
|
|
1693
|
+
display: "inline-block",
|
|
1694
|
+
position: "relative"
|
|
1695
|
+
}
|
|
1696
|
+
}, /*#__PURE__*/_react.default.createElement(_CryptoDenominationSelector.default, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
1697
|
+
iconId: "crypto",
|
|
1698
|
+
tooltip: "Crypto denominations",
|
|
1699
|
+
key: "crypto-denominations",
|
|
1700
|
+
style: {
|
|
1701
|
+
backgroundColor: "#e8ebec",
|
|
1702
|
+
borderRadius: "8px"
|
|
1703
|
+
}
|
|
1704
|
+
}))))), settings.customToolbarItems.filter(function (n) {
|
|
1705
|
+
return n.key !== "import-export" && n.key !== "Smart Contract";
|
|
1706
|
+
}).map(function (n) {
|
|
1707
|
+
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
1708
|
+
tooltip: n.tooltip,
|
|
1709
|
+
onClick: n.onClick,
|
|
1710
|
+
key: n.key,
|
|
1711
|
+
icon: n.icon,
|
|
1712
|
+
iconName: n.iconName
|
|
1713
|
+
}, n.children);
|
|
1714
|
+
}), showDuneModal && (/*#__PURE__*/_react.default.createElement(_DuneChartsInputModal.default, {
|
|
1715
|
+
isOpen: showDuneModal,
|
|
1716
|
+
onSubmit: function onSubmit(url) {
|
|
1717
|
+
var _a;
|
|
1718
|
+
setContext(function (draftCtx) {
|
|
1719
|
+
(0, _fortuneCore.insertDuneChart)(draftCtx, url);
|
|
1720
|
+
});
|
|
1721
|
+
setShowDuneModal(false);
|
|
1722
|
+
(_a = settings.onDuneChartEmbed) === null || _a === void 0 ? void 0 : _a.call(settings);
|
|
1723
|
+
},
|
|
1724
|
+
onClose: function onClose() {
|
|
1725
|
+
return setShowDuneModal(false);
|
|
1726
|
+
},
|
|
1727
|
+
placeholder: "Paste here any Dune chart link for some magic",
|
|
1728
|
+
submitText: "Add Dune chart"
|
|
1729
|
+
}))));
|
|
1730
|
+
};
|
|
1731
|
+
var _default = exports.default = Toolbar;
|