@fileverse-dev/fortune-react 1.1.0 → 1.1.1
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,270 @@
|
|
|
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.default = void 0;
|
|
8
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _ui = require("@fileverse/ui");
|
|
11
|
+
var _constant = require("./constant");
|
|
12
|
+
var _context = _interopRequireDefault(require("../../../context"));
|
|
13
|
+
require("./index.css");
|
|
14
|
+
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); }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
17
|
+
__assign = Object.assign || function (t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
return __assign.apply(this, arguments);
|
|
25
|
+
};
|
|
26
|
+
var FormulaSearch = function FormulaSearch(props) {
|
|
27
|
+
var _a;
|
|
28
|
+
var _b = (0, _react.useContext)(_context.default),
|
|
29
|
+
context = _b.context,
|
|
30
|
+
isAuthorized = _b.settings.isAuthorized;
|
|
31
|
+
var authedFunction = ["COINGECKO", "ETHERSCAN", "DEFILLAMA", "GNOSIS", "BASE", "EOA", "PNL", "SAFE", "BLOCKSCOUT", "GNOSIS", "LENS", "FARCASTER", "Ethereum", "SMARTCONTRACT", "DUNESIM"];
|
|
32
|
+
var filteredDefaultCandidates = context.defaultCandidates.filter(function (item) {
|
|
33
|
+
return !authedFunction.includes(item.n);
|
|
34
|
+
});
|
|
35
|
+
var unfilteredDefaultCandidates = _constant.UNFilter.filter(function (item) {
|
|
36
|
+
return item.n !== "PNL";
|
|
37
|
+
});
|
|
38
|
+
var finalDefaultCandidates = !isAuthorized ? filteredDefaultCandidates : context.defaultCandidates.slice(0, 10);
|
|
39
|
+
var finalFunctionCandidates = isAuthorized ? context.functionCandidates : context.functionCandidates.filter(function (item) {
|
|
40
|
+
return item.t !== 20;
|
|
41
|
+
});
|
|
42
|
+
var firstSelection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
|
|
43
|
+
var hintRef = (0, _react.useRef)(null);
|
|
44
|
+
var _c = (0, _react.useState)(0),
|
|
45
|
+
top = _c[0],
|
|
46
|
+
setTop = _c[1];
|
|
47
|
+
var calcuatePopUpPlacement = function calcuatePopUpPlacement() {
|
|
48
|
+
var _a, _b, _c;
|
|
49
|
+
if (!((_a = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.top) === null || _a === void 0 ? void 0 : _a.toString()) || !((_b = firstSelection.height_move) === null || _b === void 0 ? void 0 : _b.toString()) || !hintRef.current) return;
|
|
50
|
+
var hintHeight = 360;
|
|
51
|
+
var inputBottom = firstSelection.top + firstSelection.height_move;
|
|
52
|
+
var availableBelow = window.innerHeight - inputBottom;
|
|
53
|
+
var hintAbove = hintHeight > availableBelow;
|
|
54
|
+
var selectionHeight = (firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0;
|
|
55
|
+
var divOffset = ((_c = hintRef.current) === null || _c === void 0 ? void 0 : _c.offsetHeight) || 0;
|
|
56
|
+
setTop(hintAbove ? selectionHeight - (divOffset + 30) : selectionHeight + 4);
|
|
57
|
+
};
|
|
58
|
+
(0, _react.useEffect)(function () {
|
|
59
|
+
calcuatePopUpPlacement();
|
|
60
|
+
});
|
|
61
|
+
if (_lodash.default.isEmpty(context.functionCandidates) && _lodash.default.isEmpty(context.defaultCandidates)) return null;
|
|
62
|
+
return /*#__PURE__*/_react.default.createElement("div", __assign({}, props, {
|
|
63
|
+
ref: hintRef,
|
|
64
|
+
id: "luckysheet-formula-search-c",
|
|
65
|
+
className: "luckysheet-formula-search-c",
|
|
66
|
+
style: {
|
|
67
|
+
top: top
|
|
68
|
+
}
|
|
69
|
+
}), context.defaultCandidates.length > 0 && (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
+
style: {
|
|
71
|
+
marginBottom: "4px"
|
|
72
|
+
},
|
|
73
|
+
className: "w-full flex flex-col p-2 gap-1"
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement("h4", {
|
|
75
|
+
className: "text-helper-sm-bold color-text-secondary"
|
|
76
|
+
}, "Onchain functions"), /*#__PURE__*/_react.default.createElement("p", {
|
|
77
|
+
className: "text-helper-text-sm color-text-secondary"
|
|
78
|
+
}, "Every onchain function is a native data structure allowing dSheets to read and structure data from smart contracts and APIs.")), !isAuthorized && (/*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
+
style: {
|
|
80
|
+
marginBottom: "8px",
|
|
81
|
+
backgroundColor: "#F8F9FA"
|
|
82
|
+
},
|
|
83
|
+
className: "w-full flex flex-col p-2 gap-1"
|
|
84
|
+
}, /*#__PURE__*/_react.default.createElement("h4", {
|
|
85
|
+
className: "font-semibold"
|
|
86
|
+
}, "dSheets account required"), /*#__PURE__*/_react.default.createElement("p", {
|
|
87
|
+
className: "text-helper-text-sm color-text-secondary"
|
|
88
|
+
}, "Use more onchain functions by creating a dSheets account.", " ", /*#__PURE__*/_react.default.createElement("span", {
|
|
89
|
+
className: "sign-fortune",
|
|
90
|
+
style: {
|
|
91
|
+
color: "#5C0AFF",
|
|
92
|
+
cursor: "pointer"
|
|
93
|
+
},
|
|
94
|
+
onClick: function onClick(e) {
|
|
95
|
+
var _a;
|
|
96
|
+
e.stopPropagation();
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
(_a = document.getElementById("triggerAuth")) === null || _a === void 0 ? void 0 : _a.click();
|
|
99
|
+
}
|
|
100
|
+
}, "Signup/Login")), /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
+
className: "flex gap-2 mt-2 mb-2"
|
|
102
|
+
}, unfilteredDefaultCandidates.map(function (v, index) {
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement("img", {
|
|
104
|
+
key: index,
|
|
105
|
+
src: v.LOGO,
|
|
106
|
+
alt: "Service Logo",
|
|
107
|
+
style: {
|
|
108
|
+
width: "16px",
|
|
109
|
+
height: "16px"
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
})))))), context.defaultCandidates.length > 0 ? (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, finalDefaultCandidates.map(function (v) {
|
|
113
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
114
|
+
key: v.n,
|
|
115
|
+
"data-func": v.n,
|
|
116
|
+
style: {
|
|
117
|
+
cursor: "pointer"
|
|
118
|
+
},
|
|
119
|
+
className: "luckysheet-formula-search-item"
|
|
120
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
+
style: {
|
|
122
|
+
display: "flex",
|
|
123
|
+
justifyContent: "space-between"
|
|
124
|
+
}
|
|
125
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
126
|
+
className: "luckysheet-formula-search-func color-text-default text-body-sm"
|
|
127
|
+
}, v.n), /*#__PURE__*/_react.default.createElement("div", {
|
|
128
|
+
style: {
|
|
129
|
+
display: "flex",
|
|
130
|
+
justifyContent: "end",
|
|
131
|
+
minWidth: "68px",
|
|
132
|
+
alignItems: "center",
|
|
133
|
+
gap: "6px"
|
|
134
|
+
}
|
|
135
|
+
}, v.LOGO && (/*#__PURE__*/_react.default.createElement("img", {
|
|
136
|
+
src: v.LOGO,
|
|
137
|
+
alt: "Service Logo",
|
|
138
|
+
style: {
|
|
139
|
+
width: "16px"
|
|
140
|
+
}
|
|
141
|
+
})), v.SECONDARY_LOGO && (/*#__PURE__*/_react.default.createElement("img", {
|
|
142
|
+
src: v.SECONDARY_LOGO,
|
|
143
|
+
alt: "Service Logo",
|
|
144
|
+
style: {
|
|
145
|
+
width: "16px"
|
|
146
|
+
}
|
|
147
|
+
})), v.API_KEY && (/*#__PURE__*/_react.default.createElement(_ui.Tooltip, {
|
|
148
|
+
text: localStorage.getItem(v.API_KEY) ? "API Key added" : "API key required"
|
|
149
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
150
|
+
style: {
|
|
151
|
+
borderRadius: "4px",
|
|
152
|
+
backgroundColor: "".concat(localStorage.getItem(v.API_KEY) ? "#177E23" : "#e8ebec"),
|
|
153
|
+
width: "16px",
|
|
154
|
+
height: "16px"
|
|
155
|
+
},
|
|
156
|
+
className: "flex justify-center"
|
|
157
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
158
|
+
name: "Key",
|
|
159
|
+
style: {
|
|
160
|
+
color: localStorage.getItem(v.API_KEY) ? "white" : "#77818A",
|
|
161
|
+
width: "12px",
|
|
162
|
+
height: "12px"
|
|
163
|
+
}
|
|
164
|
+
})))))), /*#__PURE__*/_react.default.createElement("div", {
|
|
165
|
+
className: "luckysheet-formula-search-detail mt-1 text-helper-text-sm color-text-default"
|
|
166
|
+
}, v.d));
|
|
167
|
+
}))) : (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, finalFunctionCandidates.length > 0 && finalFunctionCandidates.map(function (v) {
|
|
168
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
169
|
+
key: v.n,
|
|
170
|
+
"data-func": v.n,
|
|
171
|
+
className: "luckysheet-formula-search-item"
|
|
172
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
173
|
+
style: {
|
|
174
|
+
display: "flex",
|
|
175
|
+
justifyContent: "space-between"
|
|
176
|
+
}
|
|
177
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
178
|
+
className: "luckysheet-formula-search-func color-text-default text-body-sm"
|
|
179
|
+
}, v.n), /*#__PURE__*/_react.default.createElement("div", {
|
|
180
|
+
style: {
|
|
181
|
+
display: "flex",
|
|
182
|
+
justifyContent: "end",
|
|
183
|
+
width: "68px",
|
|
184
|
+
alignItems: "center",
|
|
185
|
+
gap: "6px"
|
|
186
|
+
}
|
|
187
|
+
}, v.LOGO && (/*#__PURE__*/_react.default.createElement("img", {
|
|
188
|
+
src: v.LOGO,
|
|
189
|
+
alt: "Service Logo",
|
|
190
|
+
style: {
|
|
191
|
+
width: "16px"
|
|
192
|
+
}
|
|
193
|
+
})), v.SECONDARY_LOGO && (/*#__PURE__*/_react.default.createElement("img", {
|
|
194
|
+
src: v.SECONDARY_LOGO,
|
|
195
|
+
alt: "Service Logo",
|
|
196
|
+
style: {
|
|
197
|
+
width: "16px"
|
|
198
|
+
}
|
|
199
|
+
})), v.API_KEY && (/*#__PURE__*/_react.default.createElement(_ui.Tooltip, {
|
|
200
|
+
text: localStorage.getItem(v.API_KEY) ? "API Key added" : "API Key required"
|
|
201
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
202
|
+
style: {
|
|
203
|
+
borderRadius: "4px",
|
|
204
|
+
backgroundColor: "".concat(localStorage.getItem(v.API_KEY) ? "#177E23" : "#e8ebec"),
|
|
205
|
+
width: "16px",
|
|
206
|
+
height: "16px"
|
|
207
|
+
},
|
|
208
|
+
className: "flex justify-center"
|
|
209
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
|
|
210
|
+
name: "Key",
|
|
211
|
+
style: {
|
|
212
|
+
color: localStorage.getItem(v.API_KEY) ? "white" : "#77818A",
|
|
213
|
+
width: "12px",
|
|
214
|
+
height: "12px"
|
|
215
|
+
}
|
|
216
|
+
})))))), /*#__PURE__*/_react.default.createElement("div", {
|
|
217
|
+
className: "luckysheet-formula-search-detail mt-1 text-helper-text-sm color-text-secondary"
|
|
218
|
+
}, v.d));
|
|
219
|
+
}), finalFunctionCandidates.length === 0 && (/*#__PURE__*/_react.default.createElement("span", null, !isAuthorized && (/*#__PURE__*/_react.default.createElement("div", {
|
|
220
|
+
style: {
|
|
221
|
+
marginBottom: "8px",
|
|
222
|
+
backgroundColor: "#F8F9FA"
|
|
223
|
+
},
|
|
224
|
+
className: "w-full flex flex-col p-2 gap-1"
|
|
225
|
+
}, /*#__PURE__*/_react.default.createElement("h4", {
|
|
226
|
+
className: "text-helper-sm-bold",
|
|
227
|
+
style: {
|
|
228
|
+
fontWeight: "bold"
|
|
229
|
+
}
|
|
230
|
+
}, "dSheets account required"), /*#__PURE__*/_react.default.createElement("p", {
|
|
231
|
+
className: "text-helper-text-sm color-text-secondary"
|
|
232
|
+
}, "Use more onchain functions by creating a dSheets account.", " ", /*#__PURE__*/_react.default.createElement("span", {
|
|
233
|
+
className: "sign-fortune",
|
|
234
|
+
style: {
|
|
235
|
+
color: "#5C0AFF",
|
|
236
|
+
cursor: "pointer"
|
|
237
|
+
},
|
|
238
|
+
onClick: function onClick(e) {
|
|
239
|
+
var _a;
|
|
240
|
+
e.stopPropagation();
|
|
241
|
+
e.preventDefault();
|
|
242
|
+
(_a = document.getElementById("triggerAuth")) === null || _a === void 0 ? void 0 : _a.click();
|
|
243
|
+
}
|
|
244
|
+
}, "Signup/Login")), /*#__PURE__*/_react.default.createElement("div", {
|
|
245
|
+
className: "flex gap-2 mt-2 mb-2"
|
|
246
|
+
}, unfilteredDefaultCandidates.map(function (v, index) {
|
|
247
|
+
return /*#__PURE__*/_react.default.createElement("img", {
|
|
248
|
+
key: index,
|
|
249
|
+
src: v.LOGO,
|
|
250
|
+
alt: "Service Logo",
|
|
251
|
+
style: {
|
|
252
|
+
width: "16px",
|
|
253
|
+
height: "16px"
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
})))))))), /*#__PURE__*/_react.default.createElement("hr", {
|
|
257
|
+
className: "color-border-default mb-2 mt-4 "
|
|
258
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
259
|
+
style: {
|
|
260
|
+
paddingLeft: "10px",
|
|
261
|
+
paddingRight: "10px"
|
|
262
|
+
},
|
|
263
|
+
className: "flex gap-1 items-center color-border-default text-helper-sm"
|
|
264
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
265
|
+
className: "border p-1 color-text-default rounded"
|
|
266
|
+
}, "Tab"), /*#__PURE__*/_react.default.createElement("p", {
|
|
267
|
+
className: "color-text-secondary"
|
|
268
|
+
}, "to insert")));
|
|
269
|
+
};
|
|
270
|
+
var _default = exports.default = FormulaSearch;
|
|
@@ -0,0 +1,404 @@
|
|
|
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.default = void 0;
|
|
8
|
+
var _fortuneCore = require("@fileverse-dev/fortune-core");
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
11
|
+
var _context = _interopRequireDefault(require("../../context"));
|
|
12
|
+
var _ContentEditable = _interopRequireDefault(require("./ContentEditable"));
|
|
13
|
+
var _FormulaSearch = _interopRequireDefault(require("./FormulaSearch"));
|
|
14
|
+
var _FormulaHint = _interopRequireDefault(require("./FormulaHint"));
|
|
15
|
+
var _usePrevious = _interopRequireDefault(require("../../hooks/usePrevious"));
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
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); }
|
|
18
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
19
|
+
__assign = Object.assign || function (t) {
|
|
20
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
21
|
+
s = arguments[i];
|
|
22
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var InputBox = function InputBox() {
|
|
29
|
+
var _a, _b, _c, _d, _e, _f;
|
|
30
|
+
var _g = (0, _react.useContext)(_context.default),
|
|
31
|
+
context = _g.context,
|
|
32
|
+
setContext = _g.setContext,
|
|
33
|
+
refs = _g.refs;
|
|
34
|
+
var inputRef = (0, _react.useRef)(null);
|
|
35
|
+
var lastKeyDownEventRef = (0, _react.useRef)(null);
|
|
36
|
+
var prevCellUpdate = (0, _usePrevious.default)(context.luckysheetCellUpdate);
|
|
37
|
+
var prevSheetId = (0, _usePrevious.default)(context.currentSheetId);
|
|
38
|
+
var _h = (0, _react.useState)(false),
|
|
39
|
+
isHidenRC = _h[0],
|
|
40
|
+
setIsHidenRC = _h[1];
|
|
41
|
+
var _j = (0, _react.useState)(false),
|
|
42
|
+
isInputBoxActive = _j[0],
|
|
43
|
+
setIsInputBoxActive = _j[1];
|
|
44
|
+
var _k = (0, _react.useState)({
|
|
45
|
+
left: 0,
|
|
46
|
+
top: 0
|
|
47
|
+
}),
|
|
48
|
+
frozenPosition = _k[0],
|
|
49
|
+
setFrozenPosition = _k[1];
|
|
50
|
+
var firstSelection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
|
|
51
|
+
var row_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.row_focus;
|
|
52
|
+
var col_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
|
|
53
|
+
var preText = (0, _react.useRef)("");
|
|
54
|
+
var inputBoxStyle = (0, _react.useMemo)(function () {
|
|
55
|
+
if (firstSelection && context.luckysheetCellUpdate.length > 0) {
|
|
56
|
+
var flowdata = (0, _fortuneCore.getFlowdata)(context);
|
|
57
|
+
if (!flowdata) return {};
|
|
58
|
+
return (0, _fortuneCore.getStyleByCell)(context, flowdata, firstSelection.row_focus, firstSelection.column_focus);
|
|
59
|
+
}
|
|
60
|
+
return {};
|
|
61
|
+
}, [context.luckysheetfile, context.currentSheetId, context.luckysheetCellUpdate, firstSelection]);
|
|
62
|
+
(0, _react.useLayoutEffect)(function () {
|
|
63
|
+
var _a;
|
|
64
|
+
if (!context.allowEdit) {
|
|
65
|
+
setContext(function (ctx) {
|
|
66
|
+
var flowdata = (0, _fortuneCore.getFlowdata)(ctx);
|
|
67
|
+
if (!_lodash.default.isNil(flowdata) && ctx.forceFormulaRef) {
|
|
68
|
+
var value = (0, _fortuneCore.getCellValue)(row_index, col_index, flowdata, "f");
|
|
69
|
+
(0, _fortuneCore.createRangeHightlight)(ctx, value);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
if (firstSelection && context.luckysheetCellUpdate.length > 0) {
|
|
74
|
+
if (refs.globalCache.doNotUpdateCell) {
|
|
75
|
+
delete refs.globalCache.doNotUpdateCell;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (_lodash.default.isEqual(prevCellUpdate, context.luckysheetCellUpdate) && prevSheetId === context.currentSheetId) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
var flowdata = (0, _fortuneCore.getFlowdata)(context);
|
|
82
|
+
var cell = (_a = flowdata === null || flowdata === void 0 ? void 0 : flowdata[row_index]) === null || _a === void 0 ? void 0 : _a[col_index];
|
|
83
|
+
var value_1 = "";
|
|
84
|
+
if (cell && !refs.globalCache.overwriteCell) {
|
|
85
|
+
if ((0, _fortuneCore.isInlineStringCell)(cell)) {
|
|
86
|
+
value_1 = (0, _fortuneCore.getInlineStringHTML)(row_index, col_index, flowdata);
|
|
87
|
+
} else if (cell.f) {
|
|
88
|
+
value_1 = (0, _fortuneCore.getCellValue)(row_index, col_index, flowdata, "f");
|
|
89
|
+
setContext(function (ctx) {
|
|
90
|
+
(0, _fortuneCore.createRangeHightlight)(ctx, value_1);
|
|
91
|
+
});
|
|
92
|
+
} else {
|
|
93
|
+
value_1 = (0, _fortuneCore.valueShowEs)(row_index, col_index, flowdata);
|
|
94
|
+
if (Number(cell.qp) === 1) {
|
|
95
|
+
value_1 = value_1 ? "".concat(value_1) : value_1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
refs.globalCache.overwriteCell = false;
|
|
100
|
+
if (!refs.globalCache.ignoreWriteCell) inputRef.current.innerHTML = (0, _fortuneCore.escapeHTMLTag)((0, _fortuneCore.escapeScriptTag)(value_1));
|
|
101
|
+
refs.globalCache.ignoreWriteCell = false;
|
|
102
|
+
if (!refs.globalCache.doNotFocus) {
|
|
103
|
+
setTimeout(function () {
|
|
104
|
+
(0, _fortuneCore.moveToEnd)(inputRef.current);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
delete refs.globalCache.doNotFocus;
|
|
108
|
+
}
|
|
109
|
+
}, [context.luckysheetCellUpdate, context.luckysheetfile, context.currentSheetId, firstSelection]);
|
|
110
|
+
(0, _react.useEffect)(function () {
|
|
111
|
+
if (_lodash.default.isEmpty(context.luckysheetCellUpdate)) {
|
|
112
|
+
if (inputRef.current) {
|
|
113
|
+
inputRef.current.innerHTML = "";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}, [context.luckysheetCellUpdate]);
|
|
117
|
+
(0, _react.useEffect)(function () {
|
|
118
|
+
setIsHidenRC((0, _fortuneCore.isShowHidenCR)(context));
|
|
119
|
+
}, [context.luckysheet_select_save]);
|
|
120
|
+
(0, _react.useEffect)(function () {
|
|
121
|
+
var _a;
|
|
122
|
+
if (!firstSelection || ((_a = context.rangeDialog) === null || _a === void 0 ? void 0 : _a.show) || _lodash.default.isEmpty(context.luckysheetCellUpdate)) {
|
|
123
|
+
setIsInputBoxActive(false);
|
|
124
|
+
}
|
|
125
|
+
}, [firstSelection, (_b = context.rangeDialog) === null || _b === void 0 ? void 0 : _b.show, context.luckysheetCellUpdate]);
|
|
126
|
+
var getActiveFormula = (0, _react.useCallback)(function () {
|
|
127
|
+
return document.querySelector(".luckysheet-formula-search-item-active");
|
|
128
|
+
}, []);
|
|
129
|
+
var insertSelectedFormula = (0, _react.useCallback)(function (formulaName) {
|
|
130
|
+
var _a;
|
|
131
|
+
var textEditor = document.getElementById("luckysheet-rich-text-editor");
|
|
132
|
+
if (!textEditor) return;
|
|
133
|
+
textEditor.focus();
|
|
134
|
+
var selection = window.getSelection();
|
|
135
|
+
var range = (selection === null || selection === void 0 ? void 0 : selection.rangeCount) ? selection.getRangeAt(0) : null;
|
|
136
|
+
if (!selection || !range || !textEditor.contains(range.startContainer)) {
|
|
137
|
+
range = document.createRange();
|
|
138
|
+
range.selectNodeContents(textEditor);
|
|
139
|
+
range.collapse(false);
|
|
140
|
+
selection = window.getSelection();
|
|
141
|
+
selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
|
|
142
|
+
selection === null || selection === void 0 ? void 0 : selection.addRange(range);
|
|
143
|
+
}
|
|
144
|
+
var searchTxt = ((_a = (0, _fortuneCore.getrangeseleciton)()) === null || _a === void 0 ? void 0 : _a.textContent) || "";
|
|
145
|
+
var deleteCount = searchTxt === "=" ? 0 : searchTxt.length;
|
|
146
|
+
if (deleteCount > 0 && range.startContainer.nodeType === Node.TEXT_NODE && textEditor.contains(range.startContainer)) {
|
|
147
|
+
var startOffset = Math.max(range.startOffset - deleteCount, 0);
|
|
148
|
+
var endOffset = range.startOffset;
|
|
149
|
+
range.setStart(range.startContainer, startOffset);
|
|
150
|
+
range.setEnd(range.startContainer, endOffset);
|
|
151
|
+
range.deleteContents();
|
|
152
|
+
}
|
|
153
|
+
textEditor.querySelectorAll(".luckysheet-formula-text-func, .luckysheet-formula-text-lpar").forEach(function (el) {
|
|
154
|
+
return el.remove();
|
|
155
|
+
});
|
|
156
|
+
var funcNode = new DOMParser().parseFromString("<span dir=\"auto\" class=\"luckysheet-formula-text-func\">".concat(formulaName, "</span>"), "text/html").body.firstChild;
|
|
157
|
+
var parNode = new DOMParser().parseFromString("<span dir=\"auto\" class=\"luckysheet-formula-text-lpar\">(</span>", "text/html").body.firstChild;
|
|
158
|
+
if (range && parNode && funcNode) {
|
|
159
|
+
range.insertNode(funcNode);
|
|
160
|
+
range.collapse(false);
|
|
161
|
+
range.insertNode(parNode);
|
|
162
|
+
range.collapse(false);
|
|
163
|
+
selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
|
|
164
|
+
selection === null || selection === void 0 ? void 0 : selection.addRange(range);
|
|
165
|
+
}
|
|
166
|
+
setContext(function (draftCtx) {
|
|
167
|
+
draftCtx.functionCandidates = [];
|
|
168
|
+
draftCtx.defaultCandidates = [];
|
|
169
|
+
draftCtx.functionHint = formulaName;
|
|
170
|
+
});
|
|
171
|
+
}, [setContext]);
|
|
172
|
+
var clearSearchItemActiveClass = (0, _react.useCallback)(function () {
|
|
173
|
+
var activeFormula = getActiveFormula();
|
|
174
|
+
if (activeFormula) {
|
|
175
|
+
activeFormula.classList.remove("luckysheet-formula-search-item-active");
|
|
176
|
+
}
|
|
177
|
+
}, [getActiveFormula]);
|
|
178
|
+
var selectActiveFormula = (0, _react.useCallback)(function (e) {
|
|
179
|
+
var _a, _b;
|
|
180
|
+
var formulaName = (_b = (_a = getActiveFormula()) === null || _a === void 0 ? void 0 : _a.querySelector(".luckysheet-formula-search-func")) === null || _b === void 0 ? void 0 : _b.textContent;
|
|
181
|
+
if (formulaName) {
|
|
182
|
+
insertSelectedFormula(formulaName);
|
|
183
|
+
e.preventDefault();
|
|
184
|
+
e.stopPropagation();
|
|
185
|
+
}
|
|
186
|
+
}, [getActiveFormula, insertSelectedFormula]);
|
|
187
|
+
var selectActiveFormulaOnClick = (0, _react.useCallback)(function (e) {
|
|
188
|
+
var _a, _b;
|
|
189
|
+
if (e.target.className.includes("sign-fortune")) return;
|
|
190
|
+
preText.current = inputRef.current.innerText;
|
|
191
|
+
var formulaName = (_b = (_a = getActiveFormula()) === null || _a === void 0 ? void 0 : _a.querySelector(".luckysheet-formula-search-func")) === null || _b === void 0 ? void 0 : _b.textContent;
|
|
192
|
+
if (formulaName) {
|
|
193
|
+
insertSelectedFormula(formulaName);
|
|
194
|
+
e.preventDefault();
|
|
195
|
+
e.stopPropagation();
|
|
196
|
+
}
|
|
197
|
+
}, [getActiveFormula, insertSelectedFormula]);
|
|
198
|
+
var onKeyDown = (0, _react.useCallback)(function (e) {
|
|
199
|
+
lastKeyDownEventRef.current = new KeyboardEvent(e.type, e.nativeEvent);
|
|
200
|
+
preText.current = inputRef.current.innerText;
|
|
201
|
+
if (e.key === "Escape" && context.luckysheetCellUpdate.length > 0) {
|
|
202
|
+
setContext(function (draftCtx) {
|
|
203
|
+
(0, _fortuneCore.cancelNormalSelected)(draftCtx);
|
|
204
|
+
(0, _fortuneCore.moveHighlightCell)(draftCtx, "down", 0, "rangeOfSelect");
|
|
205
|
+
});
|
|
206
|
+
e.preventDefault();
|
|
207
|
+
} else if (e.key === "Enter" && context.luckysheetCellUpdate.length > 0) {
|
|
208
|
+
if (e.altKey || e.metaKey) {
|
|
209
|
+
document.execCommand("insertHTML", false, "\n ");
|
|
210
|
+
document.execCommand("delete", false);
|
|
211
|
+
e.stopPropagation();
|
|
212
|
+
} else selectActiveFormula(e);
|
|
213
|
+
} else if (e.key === "Tab" && context.luckysheetCellUpdate.length > 0) {
|
|
214
|
+
selectActiveFormula(e);
|
|
215
|
+
e.preventDefault();
|
|
216
|
+
} else if (e.key === "F4" && context.luckysheetCellUpdate.length > 0) {
|
|
217
|
+
e.preventDefault();
|
|
218
|
+
} else if (e.key === "ArrowUp" && context.luckysheetCellUpdate.length > 0) {
|
|
219
|
+
if (document.getElementById("luckysheet-formula-search-c")) {
|
|
220
|
+
var formulaSearchContainer = document.getElementById("luckysheet-formula-search-c");
|
|
221
|
+
var activeItem = formulaSearchContainer === null || formulaSearchContainer === void 0 ? void 0 : formulaSearchContainer.querySelector(".luckysheet-formula-search-item-active");
|
|
222
|
+
var previousItem = activeItem ? activeItem.previousElementSibling : null;
|
|
223
|
+
while (previousItem && !previousItem.classList.contains("luckysheet-formula-search-item")) {
|
|
224
|
+
previousItem = previousItem.previousElementSibling;
|
|
225
|
+
}
|
|
226
|
+
if (!previousItem) {
|
|
227
|
+
var items = formulaSearchContainer === null || formulaSearchContainer === void 0 ? void 0 : formulaSearchContainer.querySelectorAll(".luckysheet-formula-search-item");
|
|
228
|
+
var lastItem = items === null || items === void 0 ? void 0 : items[items.length - 1];
|
|
229
|
+
previousItem = lastItem || null;
|
|
230
|
+
}
|
|
231
|
+
clearSearchItemActiveClass();
|
|
232
|
+
if (previousItem) {
|
|
233
|
+
previousItem.classList.add("luckysheet-formula-search-item-active");
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
e.preventDefault();
|
|
237
|
+
} else if (e.key === "ArrowDown" && context.luckysheetCellUpdate.length > 0) {
|
|
238
|
+
if (document.getElementById("luckysheet-formula-search-c")) {
|
|
239
|
+
var formulaSearchContainer = document.getElementById("luckysheet-formula-search-c");
|
|
240
|
+
var activeItem = formulaSearchContainer === null || formulaSearchContainer === void 0 ? void 0 : formulaSearchContainer.querySelector(".luckysheet-formula-search-item-active");
|
|
241
|
+
var nextItem = activeItem ? activeItem.nextElementSibling : null;
|
|
242
|
+
while (nextItem && !nextItem.classList.contains("luckysheet-formula-search-item")) {
|
|
243
|
+
nextItem = nextItem.nextElementSibling;
|
|
244
|
+
}
|
|
245
|
+
if (!nextItem) {
|
|
246
|
+
nextItem = (formulaSearchContainer === null || formulaSearchContainer === void 0 ? void 0 : formulaSearchContainer.querySelector(".luckysheet-formula-search-item")) || null;
|
|
247
|
+
}
|
|
248
|
+
clearSearchItemActiveClass();
|
|
249
|
+
if (nextItem) {
|
|
250
|
+
nextItem.classList.add("luckysheet-formula-search-item-active");
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
e.preventDefault();
|
|
254
|
+
}
|
|
255
|
+
}, [clearSearchItemActiveClass, context.luckysheetCellUpdate.length, selectActiveFormula, setContext, firstSelection]);
|
|
256
|
+
var onChange = (0, _react.useCallback)(function (__, isBlur) {
|
|
257
|
+
var e = lastKeyDownEventRef.current;
|
|
258
|
+
if (!e) return;
|
|
259
|
+
var kcode = e.keyCode;
|
|
260
|
+
if (!kcode) return;
|
|
261
|
+
if (!(kcode >= 112 && kcode <= 123 || kcode <= 46 || kcode === 144 || kcode === 108 || e.ctrlKey || e.altKey || e.shiftKey && (kcode === 37 || kcode === 38 || kcode === 39 || kcode === 40)) || kcode === 8 || kcode === 32 || kcode === 46 || e.ctrlKey && kcode === 86) {
|
|
262
|
+
setContext(function (draftCtx) {
|
|
263
|
+
if ((draftCtx.formulaCache.rangestart || draftCtx.formulaCache.rangedrag_column_start || draftCtx.formulaCache.rangedrag_row_start || (0, _fortuneCore.israngeseleciton)(draftCtx)) && isBlur) return;
|
|
264
|
+
if (!(0, _fortuneCore.isAllowEdit)(draftCtx, draftCtx.luckysheet_select_save)) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
(0, _fortuneCore.handleFormulaInput)(draftCtx, refs.fxInput.current, refs.cellInput.current, kcode, preText.current);
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}, [refs.cellInput, refs.fxInput, setContext]);
|
|
271
|
+
var onPaste = (0, _react.useCallback)(function (e) {
|
|
272
|
+
if (_lodash.default.isEmpty(context.luckysheetCellUpdate)) {
|
|
273
|
+
e.preventDefault();
|
|
274
|
+
}
|
|
275
|
+
}, [context.luckysheetCellUpdate]);
|
|
276
|
+
var cfg = context.config || {};
|
|
277
|
+
var rowReadOnly = cfg.rowReadOnly || {};
|
|
278
|
+
var colReadOnly = cfg.colReadOnly || {};
|
|
279
|
+
var edit = !((colReadOnly[col_index] || rowReadOnly[row_index]) && context.allowEdit === true);
|
|
280
|
+
var getInputBoxPosition = (0, _react.useCallback)(function () {
|
|
281
|
+
var _a;
|
|
282
|
+
if (!firstSelection || ((_a = context.rangeDialog) === null || _a === void 0 ? void 0 : _a.show)) {
|
|
283
|
+
return {
|
|
284
|
+
left: -10000,
|
|
285
|
+
top: -10000,
|
|
286
|
+
display: "block"
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
var canvasContainer = refs.cellArea.current;
|
|
290
|
+
if (!canvasContainer) {
|
|
291
|
+
return {
|
|
292
|
+
left: firstSelection.left || 0,
|
|
293
|
+
top: firstSelection.top || 0,
|
|
294
|
+
display: "block"
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
if (isInputBoxActive) {
|
|
298
|
+
return {
|
|
299
|
+
left: frozenPosition.left,
|
|
300
|
+
top: frozenPosition.top,
|
|
301
|
+
zIndex: _lodash.default.isEmpty(context.luckysheetCellUpdate) ? -1 : 19,
|
|
302
|
+
display: "block"
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
var containerRect = canvasContainer.getBoundingClientRect();
|
|
306
|
+
var initialLeft = containerRect.left + (firstSelection.left || 0) - context.scrollLeft;
|
|
307
|
+
var initialTop = containerRect.top + (firstSelection.top || 0) - context.scrollTop;
|
|
308
|
+
return {
|
|
309
|
+
left: initialLeft,
|
|
310
|
+
top: initialTop,
|
|
311
|
+
zIndex: _lodash.default.isEmpty(context.luckysheetCellUpdate) ? -1 : 19,
|
|
312
|
+
display: "block"
|
|
313
|
+
};
|
|
314
|
+
}, [firstSelection, (_c = context.rangeDialog) === null || _c === void 0 ? void 0 : _c.show, context.luckysheetCellUpdate, refs.cellArea, isInputBoxActive, frozenPosition, context.scrollLeft, context.scrollTop]);
|
|
315
|
+
(0, _react.useEffect)(function () {
|
|
316
|
+
var _a;
|
|
317
|
+
if (firstSelection && !((_a = context.rangeDialog) === null || _a === void 0 ? void 0 : _a.show) && !isInputBoxActive && !_lodash.default.isEmpty(context.luckysheetCellUpdate)) {
|
|
318
|
+
var canvasContainer = refs.cellArea.current;
|
|
319
|
+
if (canvasContainer) {
|
|
320
|
+
var containerRect = canvasContainer.getBoundingClientRect();
|
|
321
|
+
var initialLeft = containerRect.left + (firstSelection.left || 0) - context.scrollLeft;
|
|
322
|
+
var initialTop = containerRect.top + (firstSelection.top || 0) - context.scrollTop;
|
|
323
|
+
setFrozenPosition({
|
|
324
|
+
left: initialLeft,
|
|
325
|
+
top: initialTop
|
|
326
|
+
});
|
|
327
|
+
setIsInputBoxActive(true);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}, [firstSelection, (_d = context.rangeDialog) === null || _d === void 0 ? void 0 : _d.show, context.luckysheetCellUpdate, isInputBoxActive, context.scrollLeft, context.scrollTop, refs.cellArea]);
|
|
331
|
+
var getAddressIndicatorPosition = (0, _react.useCallback)(function () {
|
|
332
|
+
var _a;
|
|
333
|
+
if (!firstSelection || ((_a = context.rangeDialog) === null || _a === void 0 ? void 0 : _a.show)) {
|
|
334
|
+
return {
|
|
335
|
+
display: "none"
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
return {
|
|
339
|
+
top: "-18px",
|
|
340
|
+
left: "0",
|
|
341
|
+
display: "block"
|
|
342
|
+
};
|
|
343
|
+
}, [firstSelection, (_e = context.rangeDialog) === null || _e === void 0 ? void 0 : _e.show]);
|
|
344
|
+
var getCellAddress = (0, _react.useCallback)(function () {
|
|
345
|
+
if (!firstSelection) return "";
|
|
346
|
+
var rowIndex = firstSelection.row_focus || 0;
|
|
347
|
+
var colIndex = firstSelection.column_focus || 0;
|
|
348
|
+
var columnChar = (0, _fortuneCore.indexToColumnChar)(colIndex);
|
|
349
|
+
var rowNumber = rowIndex + 1;
|
|
350
|
+
return "".concat(columnChar).concat(rowNumber);
|
|
351
|
+
}, [firstSelection]);
|
|
352
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
353
|
+
className: "luckysheet-input-box",
|
|
354
|
+
style: getInputBoxPosition(),
|
|
355
|
+
onMouseDown: function onMouseDown(e) {
|
|
356
|
+
return e.stopPropagation();
|
|
357
|
+
},
|
|
358
|
+
onMouseUp: function onMouseUp(e) {
|
|
359
|
+
return e.stopPropagation();
|
|
360
|
+
}
|
|
361
|
+
}, firstSelection && !((_f = context.rangeDialog) === null || _f === void 0 ? void 0 : _f.show) && (/*#__PURE__*/_react.default.createElement("div", {
|
|
362
|
+
className: "luckysheet-cell-address-indicator",
|
|
363
|
+
style: getAddressIndicatorPosition()
|
|
364
|
+
}, getCellAddress())), /*#__PURE__*/_react.default.createElement("div", {
|
|
365
|
+
className: "luckysheet-input-box-inner",
|
|
366
|
+
style: firstSelection ? __assign({
|
|
367
|
+
minWidth: firstSelection.width,
|
|
368
|
+
minHeight: firstSelection.height
|
|
369
|
+
}, inputBoxStyle) : {}
|
|
370
|
+
}, /*#__PURE__*/_react.default.createElement(_ContentEditable.default, {
|
|
371
|
+
innerRef: function innerRef(e) {
|
|
372
|
+
inputRef.current = e;
|
|
373
|
+
refs.cellInput.current = e;
|
|
374
|
+
},
|
|
375
|
+
className: "luckysheet-cell-input",
|
|
376
|
+
id: "luckysheet-rich-text-editor",
|
|
377
|
+
style: {
|
|
378
|
+
transform: "scale(".concat(context.zoomRatio, ")"),
|
|
379
|
+
transformOrigin: "left top",
|
|
380
|
+
width: "".concat(100 / context.zoomRatio, "%"),
|
|
381
|
+
height: "".concat(100 / context.zoomRatio, "%"),
|
|
382
|
+
color: "black"
|
|
383
|
+
},
|
|
384
|
+
"aria-autocomplete": "list",
|
|
385
|
+
onChange: onChange,
|
|
386
|
+
onKeyDown: onKeyDown,
|
|
387
|
+
onPaste: onPaste,
|
|
388
|
+
allowEdit: edit ? !isHidenRC : edit
|
|
389
|
+
})), (context.functionCandidates.length > 0 || context.functionHint || context.defaultCandidates.length > 0) && (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_FormulaSearch.default, {
|
|
390
|
+
onMouseMove: function onMouseMove(e) {
|
|
391
|
+
if (document.getElementById("luckysheet-formula-search-c")) {
|
|
392
|
+
var hoveredItem = e.target.closest(".luckysheet-formula-search-item");
|
|
393
|
+
if (!hoveredItem) return;
|
|
394
|
+
clearSearchItemActiveClass();
|
|
395
|
+
hoveredItem.classList.add("luckysheet-formula-search-item-active");
|
|
396
|
+
}
|
|
397
|
+
e.preventDefault();
|
|
398
|
+
},
|
|
399
|
+
onMouseDown: function onMouseDown(e) {
|
|
400
|
+
selectActiveFormulaOnClick(e);
|
|
401
|
+
}
|
|
402
|
+
}), /*#__PURE__*/_react.default.createElement(_FormulaHint.default, null))));
|
|
403
|
+
};
|
|
404
|
+
var _default = exports.default = InputBox;
|