@fileverse-dev/fortune-react 1.0.26-patch-1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +3915 -0
- package/dist/index.esm.css +3915 -0
- package/dist/index.esm.js +12975 -0
- package/dist/index.js +12995 -0
- package/dist/index.umd.css +3915 -0
- package/dist/index.umd.js +122445 -0
- package/dist/index.umd.min.css +1 -0
- package/dist/index.umd.min.js +50 -0
- package/dist/packages/core/src/api/cell.d.ts +10 -0
- package/dist/packages/core/src/api/common.d.ts +66 -0
- package/dist/packages/core/src/api/errors.d.ts +2 -0
- package/dist/packages/core/src/api/index.d.ts +9 -0
- package/dist/packages/core/src/api/merge.d.ts +5 -0
- package/dist/packages/core/src/api/range.d.ts +22 -0
- package/dist/packages/core/src/api/rowcol.d.ts +14 -0
- package/dist/packages/core/src/api/sheet.d.ts +10 -0
- package/dist/packages/core/src/api/workbook.d.ts +15 -0
- package/dist/packages/core/src/canvas.d.ts +46 -0
- package/dist/packages/core/src/context.d.ts +197 -0
- package/dist/packages/core/src/events/copy.d.ts +2 -0
- package/dist/packages/core/src/events/index.d.ts +4 -0
- package/dist/packages/core/src/events/keyboard.d.ts +6 -0
- package/dist/packages/core/src/events/mouse.d.ts +22 -0
- package/dist/packages/core/src/events/paste.d.ts +3 -0
- package/dist/packages/core/src/index.d.ts +10 -0
- package/dist/packages/core/src/locale/en.d.ts +992 -0
- package/dist/packages/core/src/locale/es.d.ts +1134 -0
- package/dist/packages/core/src/locale/hi.d.ts +1030 -0
- package/dist/packages/core/src/locale/index.d.ts +1049 -0
- package/dist/packages/core/src/locale/zh.d.ts +1048 -0
- package/dist/packages/core/src/locale/zh_tw.d.ts +1187 -0
- package/dist/packages/core/src/modules/ConditionFormat.d.ts +17 -0
- package/dist/packages/core/src/modules/border.d.ts +3 -0
- package/dist/packages/core/src/modules/cell.d.ts +32 -0
- package/dist/packages/core/src/modules/clipboard.d.ts +3 -0
- package/dist/packages/core/src/modules/color.d.ts +1 -0
- package/dist/packages/core/src/modules/comment.d.ts +97 -0
- package/dist/packages/core/src/modules/conditionalFormat.d.ts +2 -0
- package/dist/packages/core/src/modules/cursor.d.ts +3 -0
- package/dist/packages/core/src/modules/dataVerification.d.ts +11 -0
- package/dist/packages/core/src/modules/dropCell.d.ts +10 -0
- package/dist/packages/core/src/modules/filter.d.ts +45 -0
- package/dist/packages/core/src/modules/format.d.ts +6 -0
- package/dist/packages/core/src/modules/formula.d.ts +54 -0
- package/dist/packages/core/src/modules/freeze.d.ts +5 -0
- package/dist/packages/core/src/modules/hyperlink.d.ts +21 -0
- package/dist/packages/core/src/modules/iframe.d.ts +12 -0
- package/dist/packages/core/src/modules/image.d.ts +31 -0
- package/dist/packages/core/src/modules/index.d.ts +36 -0
- package/dist/packages/core/src/modules/inline-string.d.ts +36 -0
- package/dist/packages/core/src/modules/location.d.ts +6 -0
- package/dist/packages/core/src/modules/locationCondition.d.ts +21 -0
- package/dist/packages/core/src/modules/merge.d.ts +3 -0
- package/dist/packages/core/src/modules/mobile.d.ts +5 -0
- package/dist/packages/core/src/modules/moveCells.d.ts +5 -0
- package/dist/packages/core/src/modules/protection.d.ts +5 -0
- package/dist/packages/core/src/modules/refresh.d.ts +3 -0
- package/dist/packages/core/src/modules/rowcol.d.ts +19 -0
- package/dist/packages/core/src/modules/screenshot.d.ts +2 -0
- package/dist/packages/core/src/modules/searchReplace.d.ts +36 -0
- package/dist/packages/core/src/modules/selection.d.ts +46 -0
- package/dist/packages/core/src/modules/sheet.d.ts +10 -0
- package/dist/packages/core/src/modules/sort.d.ts +7 -0
- package/dist/packages/core/src/modules/splitColumn.d.ts +5 -0
- package/dist/packages/core/src/modules/text.d.ts +10 -0
- package/dist/packages/core/src/modules/toolbar.d.ts +32 -0
- package/dist/packages/core/src/modules/validation.d.ts +19 -0
- package/dist/packages/core/src/modules/zoom.d.ts +3 -0
- package/dist/packages/core/src/settings.d.ts +100 -0
- package/dist/packages/core/src/types.d.ts +371 -0
- package/dist/packages/core/src/utils/freeze.d.ts +7 -0
- package/dist/packages/core/src/utils/index.d.ts +18 -0
- package/dist/packages/core/src/utils/patch.d.ts +37 -0
- package/{es → dist/packages/react/src}/components/ChangeColor/index.d.ts +7 -7
- package/{lib → dist/packages/react/src}/components/ConditionFormat/ConditionRules.d.ts +6 -6
- package/{es → dist/packages/react/src}/components/ConditionFormat/index.d.ts +7 -7
- package/{es → dist/packages/react/src}/components/ContextMenu/Divider.d.ts +3 -3
- package/{lib → dist/packages/react/src}/components/ContextMenu/FilterMenu.d.ts +3 -3
- package/{es → dist/packages/react/src}/components/ContextMenu/Menu.d.ts +8 -8
- package/{lib → dist/packages/react/src}/components/ContextMenu/SheetTab.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/ContextMenu/index.d.ts +5 -5
- package/{lib → dist/packages/react/src}/components/CustomSort/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/DataVerification/DropdownList.d.ts +4 -4
- package/{lib → dist/packages/react/src}/components/DataVerification/RangeDialog.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/DataVerification/getDisplayedRangeTxt.d.ts +2 -2
- package/{lib → dist/packages/react/src}/components/DataVerification/index.d.ts +4 -4
- package/{lib → dist/packages/react/src}/components/Dialog/index.d.ts +15 -15
- package/{lib → dist/packages/react/src}/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +11 -11
- package/{lib → dist/packages/react/src}/components/DunePreview/DunePreview.d.ts +13 -13
- package/{es → dist/packages/react/src}/components/FilterOption/index.d.ts +5 -5
- package/{es → dist/packages/react/src}/components/FormatSearch/index.d.ts +6 -6
- package/{lib → dist/packages/react/src}/components/FormulaSearch/index.d.ts +5 -5
- package/{lib → dist/packages/react/src}/components/FxEditor/NameBox.d.ts +3 -3
- package/{es → dist/packages/react/src}/components/FxEditor/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/IFrameBoxs/iFrameBoxs.d.ts +4 -4
- package/{lib → dist/packages/react/src}/components/ImgBoxs/index.d.ts +3 -3
- package/{es → dist/packages/react/src}/components/LinkEidtCard/index.d.ts +5 -5
- package/{lib → dist/packages/react/src}/components/LocationCondition/index.d.ts +3 -3
- package/{lib → dist/packages/react/src}/components/MessageBox/index.d.ts +9 -9
- package/{es → dist/packages/react/src}/components/NotationBoxes/index.d.ts +3 -3
- package/{lib → dist/packages/react/src}/components/ResetColumnWidth/index.d.ts +2 -2
- package/{es → dist/packages/react/src}/components/SVGDefines.d.ts +5 -5
- package/{es → dist/packages/react/src}/components/SVGIcon.d.ts +9 -9
- package/{lib → dist/packages/react/src}/components/SearchReplace/index.d.ts +6 -6
- package/{es → dist/packages/react/src}/components/Sheet/index.d.ts +8 -8
- package/{es → dist/packages/react/src}/components/SheetList/SheetHiddenButton.d.ts +8 -8
- package/{lib → dist/packages/react/src}/components/SheetList/SheetListItem.d.ts +9 -9
- package/{lib → dist/packages/react/src}/components/SheetList/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/SheetOverlay/ColumnHeader.d.ts +3 -3
- package/{es → dist/packages/react/src}/components/SheetOverlay/ContentEditable.d.ts +11 -11
- package/{es → dist/packages/react/src}/components/SheetOverlay/FormulaHint/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/SheetOverlay/FormulaSearch/constant.d.ts +63 -63
- package/{es → dist/packages/react/src}/components/SheetOverlay/FormulaSearch/index.d.ts +4 -4
- package/{lib → dist/packages/react/src}/components/SheetOverlay/InputBox.d.ts +3 -3
- package/{es → dist/packages/react/src}/components/SheetOverlay/RowHeader.d.ts +3 -3
- package/{es → dist/packages/react/src}/components/SheetOverlay/ScrollBar/index.d.ts +7 -7
- package/{es → dist/packages/react/src}/components/SheetOverlay/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/SheetTab/SheetItem.d.ts +8 -8
- package/{lib → dist/packages/react/src}/components/SheetTab/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/SplitColumn/index.d.ts +3 -3
- package/{lib → dist/packages/react/src}/components/Toolbar/Button.d.ts +12 -12
- package/{es → dist/packages/react/src}/components/Toolbar/ColorPicker.d.ts +6 -6
- package/{es → dist/packages/react/src}/components/Toolbar/Combo.d.ts +12 -12
- package/{es → dist/packages/react/src}/components/Toolbar/CustomBorder.d.ts +7 -7
- package/{lib → dist/packages/react/src}/components/Toolbar/CustomButton.d.ts +11 -11
- package/{es → dist/packages/react/src}/components/Toolbar/CustomColor.d.ts +8 -8
- package/{lib → dist/packages/react/src}/components/Toolbar/CustomIcon.d.ts +9 -9
- package/{es → dist/packages/react/src}/components/Toolbar/Divider.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/Toolbar/MoreItemsContainer.d.ts +6 -6
- package/{lib → dist/packages/react/src}/components/Toolbar/Select.d.ts +14 -14
- package/dist/packages/react/src/components/Toolbar/index.d.ts +10 -0
- package/{es → dist/packages/react/src}/components/Workbook/api.d.ts +1177 -1183
- package/{lib → dist/packages/react/src}/components/Workbook/index.d.ts +1185 -1191
- package/{es → dist/packages/react/src}/components/ZoomControl/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/components/index.d.ts +4 -4
- package/{es → dist/packages/react/src}/constants.d.ts +1 -1
- package/{es → dist/packages/react/src}/context/index.d.ts +25 -25
- package/{es → dist/packages/react/src}/context/modal.d.ts +10 -10
- package/{es → dist/packages/react/src}/hooks/useAlert.d.ts +4 -4
- package/{es → dist/packages/react/src}/hooks/useDialog.d.ts +5 -5
- package/{es → dist/packages/react/src}/hooks/useOutsideClick.d.ts +2 -2
- package/{es → dist/packages/react/src}/hooks/usePrevious.d.ts +2 -2
- package/{es → dist/packages/react/src}/index.d.ts +1 -1
- package/{es → dist/packages/react/src}/utils/datepickerStyles.d.ts +2 -2
- package/{es/components/Workbook/index.d.ts → dist/stories/API.stories.d.ts} +1210 -1191
- package/dist/stories/Collabration.stories.d.ts +2359 -0
- package/dist/stories/Features.stories.d.ts +9430 -0
- package/dist/stories/data/cell.d.ts +983 -0
- package/dist/stories/data/dataVerification.d.ts +131 -0
- package/dist/stories/data/empty.d.ts +10 -0
- package/dist/stories/data/formula.d.ts +362 -0
- package/dist/stories/data/freeze.d.ts +34 -0
- package/dist/stories/data/protected.d.ts +40 -0
- package/dist/stories/utils.d.ts +1 -0
- package/package.json +6 -7
- package/es/components/ChangeColor/index.css +0 -76
- package/es/components/ChangeColor/index.js +0 -41
- package/es/components/ConditionFormat/ConditionRules.d.ts +0 -6
- package/es/components/ConditionFormat/ConditionRules.js +0 -323
- package/es/components/ConditionFormat/index.css +0 -210
- package/es/components/ConditionFormat/index.js +0 -252
- package/es/components/ContextMenu/Divider.js +0 -7
- package/es/components/ContextMenu/FilterMenu.d.ts +0 -3
- package/es/components/ContextMenu/FilterMenu.js +0 -612
- package/es/components/ContextMenu/Menu.js +0 -25
- package/es/components/ContextMenu/SheetTab.d.ts +0 -4
- package/es/components/ContextMenu/SheetTab.js +0 -223
- package/es/components/ContextMenu/index.css +0 -322
- package/es/components/ContextMenu/index.js +0 -1054
- package/es/components/CustomSort/index.css +0 -23
- package/es/components/CustomSort/index.d.ts +0 -4
- package/es/components/CustomSort/index.js +0 -113
- package/es/components/DataVerification/DropdownList.js +0 -126
- package/es/components/DataVerification/RangeDialog.d.ts +0 -4
- package/es/components/DataVerification/RangeDialog.js +0 -105
- package/es/components/DataVerification/getDisplayedRangeTxt.js +0 -9
- package/es/components/DataVerification/index.css +0 -202
- package/es/components/DataVerification/index.d.ts +0 -4
- package/es/components/DataVerification/index.js +0 -398
- package/es/components/Dialog/index.css +0 -64
- package/es/components/Dialog/index.d.ts +0 -15
- package/es/components/Dialog/index.js +0 -72
- package/es/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +0 -11
- package/es/components/DuneChartsInputModal/DuneChartsInputModal.js +0 -95
- package/es/components/DuneChartsInputModal/duneChartsInputModal.css +0 -98
- package/es/components/DunePreview/DunePreview.d.ts +0 -13
- package/es/components/DunePreview/DunePreview.js +0 -46
- package/es/components/DunePreview/index.css +0 -57
- package/es/components/FilterOption/index.js +0 -121
- package/es/components/FormatSearch/index.css +0 -19
- package/es/components/FormatSearch/index.js +0 -129
- package/es/components/FormulaSearch/index.css +0 -65
- package/es/components/FormulaSearch/index.d.ts +0 -5
- package/es/components/FormulaSearch/index.js +0 -198
- package/es/components/FxEditor/NameBox.d.ts +0 -3
- package/es/components/FxEditor/NameBox.js +0 -29
- package/es/components/FxEditor/index.css +0 -72
- package/es/components/FxEditor/index.js +0 -167
- package/es/components/IFrameBoxs/iFrameBoxs.css +0 -16
- package/es/components/IFrameBoxs/iFrameBoxs.js +0 -142
- package/es/components/ImgBoxs/index.d.ts +0 -3
- package/es/components/ImgBoxs/index.js +0 -219
- package/es/components/LinkEidtCard/index.css +0 -255
- package/es/components/LinkEidtCard/index.js +0 -238
- package/es/components/LocationCondition/index.css +0 -74
- package/es/components/LocationCondition/index.d.ts +0 -3
- package/es/components/LocationCondition/index.js +0 -195
- package/es/components/MessageBox/index.d.ts +0 -9
- package/es/components/MessageBox/index.js +0 -16
- package/es/components/NotationBoxes/index.js +0 -105
- package/es/components/ResetColumnWidth/index.d.ts +0 -2
- package/es/components/ResetColumnWidth/index.js +0 -130
- package/es/components/SVGDefines.js +0 -1902
- package/es/components/SVGIcon.js +0 -18
- package/es/components/SearchReplace/index.css +0 -191
- package/es/components/SearchReplace/index.d.ts +0 -6
- package/es/components/SearchReplace/index.js +0 -294
- package/es/components/Sheet/index.css +0 -27
- package/es/components/Sheet/index.js +0 -175
- package/es/components/SheetList/SheetHiddenButton.js +0 -35
- package/es/components/SheetList/SheetListItem.d.ts +0 -9
- package/es/components/SheetList/SheetListItem.js +0 -72
- package/es/components/SheetList/index.css +0 -48
- package/es/components/SheetList/index.d.ts +0 -4
- package/es/components/SheetList/index.js +0 -30
- package/es/components/SheetOverlay/ColumnHeader.js +0 -217
- package/es/components/SheetOverlay/ContentEditable.js +0 -74
- package/es/components/SheetOverlay/FormulaHint/index.css +0 -180
- package/es/components/SheetOverlay/FormulaHint/index.js +0 -348
- package/es/components/SheetOverlay/FormulaSearch/constant.js +0 -328
- package/es/components/SheetOverlay/FormulaSearch/index.css +0 -44
- package/es/components/SheetOverlay/FormulaSearch/index.js +0 -261
- package/es/components/SheetOverlay/InputBox.d.ts +0 -3
- package/es/components/SheetOverlay/InputBox.js +0 -394
- package/es/components/SheetOverlay/RowHeader.js +0 -187
- package/es/components/SheetOverlay/ScrollBar/index.css +0 -40
- package/es/components/SheetOverlay/ScrollBar/index.js +0 -47
- package/es/components/SheetOverlay/index.css +0 -954
- package/es/components/SheetOverlay/index.js +0 -578
- package/es/components/SheetTab/SheetItem.js +0 -230
- package/es/components/SheetTab/index.css +0 -280
- package/es/components/SheetTab/index.d.ts +0 -4
- package/es/components/SheetTab/index.js +0 -143
- package/es/components/SplitColumn/index.css +0 -121
- package/es/components/SplitColumn/index.js +0 -167
- package/es/components/Toolbar/Button.d.ts +0 -12
- package/es/components/Toolbar/Button.js +0 -32
- package/es/components/Toolbar/ColorPicker.js +0 -27
- package/es/components/Toolbar/Combo.js +0 -102
- package/es/components/Toolbar/CustomBorder.js +0 -211
- package/es/components/Toolbar/CustomButton.d.ts +0 -11
- package/es/components/Toolbar/CustomButton.js +0 -29
- package/es/components/Toolbar/CustomColor.js +0 -25
- package/es/components/Toolbar/CustomIcon.d.ts +0 -9
- package/es/components/Toolbar/CustomIcon.js +0 -38
- package/es/components/Toolbar/Divider.js +0 -12
- package/es/components/Toolbar/MoreItemsContainer.js +0 -17
- package/es/components/Toolbar/Select.d.ts +0 -14
- package/es/components/Toolbar/Select.js +0 -34
- package/es/components/Toolbar/index.css +0 -405
- package/es/components/Toolbar/index.d.ts +0 -10
- package/es/components/Toolbar/index.js +0 -1338
- package/es/components/Workbook/api.js +0 -398
- package/es/components/Workbook/index.css +0 -44
- package/es/components/Workbook/index.js +0 -588
- package/es/components/ZoomControl/index.css +0 -54
- package/es/components/ZoomControl/index.js +0 -111
- package/es/components/index.js +0 -3
- package/es/constants.js +0 -4
- package/es/context/index.js +0 -34
- package/es/context/modal.js +0 -43
- package/es/hooks/useAlert.js +0 -28
- package/es/hooks/useDialog.js +0 -28
- package/es/hooks/useOutsideClick.js +0 -15
- package/es/hooks/usePrevious.js +0 -9
- package/es/index.css +0 -27
- package/es/index.js +0 -1
- package/es/utils/datepickerStyles.js +0 -8
- package/lib/components/ChangeColor/index.css +0 -76
- package/lib/components/ChangeColor/index.d.ts +0 -7
- package/lib/components/ChangeColor/index.js +0 -50
- package/lib/components/ConditionFormat/ConditionRules.js +0 -332
- package/lib/components/ConditionFormat/index.css +0 -210
- package/lib/components/ConditionFormat/index.d.ts +0 -7
- package/lib/components/ConditionFormat/index.js +0 -261
- package/lib/components/ContextMenu/Divider.d.ts +0 -3
- package/lib/components/ContextMenu/Divider.js +0 -14
- package/lib/components/ContextMenu/FilterMenu.js +0 -621
- package/lib/components/ContextMenu/Menu.d.ts +0 -8
- package/lib/components/ContextMenu/Menu.js +0 -33
- package/lib/components/ContextMenu/SheetTab.js +0 -232
- package/lib/components/ContextMenu/index.css +0 -322
- package/lib/components/ContextMenu/index.d.ts +0 -5
- package/lib/components/ContextMenu/index.js +0 -1063
- package/lib/components/CustomSort/index.css +0 -23
- package/lib/components/CustomSort/index.js +0 -122
- package/lib/components/DataVerification/DropdownList.d.ts +0 -4
- package/lib/components/DataVerification/DropdownList.js +0 -135
- package/lib/components/DataVerification/RangeDialog.js +0 -114
- package/lib/components/DataVerification/getDisplayedRangeTxt.d.ts +0 -2
- package/lib/components/DataVerification/getDisplayedRangeTxt.js +0 -15
- package/lib/components/DataVerification/index.css +0 -202
- package/lib/components/DataVerification/index.js +0 -407
- package/lib/components/Dialog/index.css +0 -64
- package/lib/components/Dialog/index.js +0 -81
- package/lib/components/DuneChartsInputModal/DuneChartsInputModal.js +0 -104
- package/lib/components/DuneChartsInputModal/duneChartsInputModal.css +0 -98
- package/lib/components/DunePreview/DunePreview.js +0 -53
- package/lib/components/DunePreview/index.css +0 -57
- package/lib/components/FilterOption/index.d.ts +0 -5
- package/lib/components/FilterOption/index.js +0 -130
- package/lib/components/FormatSearch/index.css +0 -19
- package/lib/components/FormatSearch/index.d.ts +0 -6
- package/lib/components/FormatSearch/index.js +0 -138
- package/lib/components/FormulaSearch/index.css +0 -65
- package/lib/components/FormulaSearch/index.js +0 -207
- package/lib/components/FxEditor/NameBox.js +0 -38
- package/lib/components/FxEditor/index.css +0 -72
- package/lib/components/FxEditor/index.d.ts +0 -4
- package/lib/components/FxEditor/index.js +0 -176
- package/lib/components/IFrameBoxs/iFrameBoxs.css +0 -16
- package/lib/components/IFrameBoxs/iFrameBoxs.d.ts +0 -4
- package/lib/components/IFrameBoxs/iFrameBoxs.js +0 -151
- package/lib/components/ImgBoxs/index.js +0 -228
- package/lib/components/LinkEidtCard/index.css +0 -255
- package/lib/components/LinkEidtCard/index.d.ts +0 -5
- package/lib/components/LinkEidtCard/index.js +0 -247
- package/lib/components/LocationCondition/index.css +0 -74
- package/lib/components/LocationCondition/index.js +0 -204
- package/lib/components/MessageBox/index.js +0 -23
- package/lib/components/NotationBoxes/index.d.ts +0 -3
- package/lib/components/NotationBoxes/index.js +0 -114
- package/lib/components/ResetColumnWidth/index.js +0 -138
- package/lib/components/SVGDefines.d.ts +0 -5
- package/lib/components/SVGDefines.js +0 -1909
- package/lib/components/SVGIcon.d.ts +0 -9
- package/lib/components/SVGIcon.js +0 -25
- package/lib/components/SearchReplace/index.css +0 -191
- package/lib/components/SearchReplace/index.js +0 -303
- package/lib/components/Sheet/index.css +0 -27
- package/lib/components/Sheet/index.d.ts +0 -8
- package/lib/components/Sheet/index.js +0 -184
- package/lib/components/SheetList/SheetHiddenButton.d.ts +0 -8
- package/lib/components/SheetList/SheetHiddenButton.js +0 -44
- package/lib/components/SheetList/SheetListItem.js +0 -81
- package/lib/components/SheetList/index.css +0 -48
- package/lib/components/SheetList/index.js +0 -39
- package/lib/components/SheetOverlay/ColumnHeader.d.ts +0 -3
- package/lib/components/SheetOverlay/ColumnHeader.js +0 -226
- package/lib/components/SheetOverlay/ContentEditable.d.ts +0 -11
- package/lib/components/SheetOverlay/ContentEditable.js +0 -83
- package/lib/components/SheetOverlay/FormulaHint/index.css +0 -180
- package/lib/components/SheetOverlay/FormulaHint/index.d.ts +0 -4
- package/lib/components/SheetOverlay/FormulaHint/index.js +0 -357
- package/lib/components/SheetOverlay/FormulaSearch/constant.d.ts +0 -63
- package/lib/components/SheetOverlay/FormulaSearch/constant.js +0 -334
- package/lib/components/SheetOverlay/FormulaSearch/index.css +0 -44
- package/lib/components/SheetOverlay/FormulaSearch/index.d.ts +0 -4
- package/lib/components/SheetOverlay/FormulaSearch/index.js +0 -270
- package/lib/components/SheetOverlay/InputBox.js +0 -403
- package/lib/components/SheetOverlay/RowHeader.d.ts +0 -3
- package/lib/components/SheetOverlay/RowHeader.js +0 -196
- package/lib/components/SheetOverlay/ScrollBar/index.css +0 -40
- package/lib/components/SheetOverlay/ScrollBar/index.d.ts +0 -7
- package/lib/components/SheetOverlay/ScrollBar/index.js +0 -56
- package/lib/components/SheetOverlay/index.css +0 -954
- package/lib/components/SheetOverlay/index.d.ts +0 -4
- package/lib/components/SheetOverlay/index.js +0 -587
- package/lib/components/SheetTab/SheetItem.d.ts +0 -8
- package/lib/components/SheetTab/SheetItem.js +0 -239
- package/lib/components/SheetTab/index.css +0 -280
- package/lib/components/SheetTab/index.js +0 -152
- package/lib/components/SplitColumn/index.css +0 -121
- package/lib/components/SplitColumn/index.d.ts +0 -3
- package/lib/components/SplitColumn/index.js +0 -176
- package/lib/components/Toolbar/Button.js +0 -39
- package/lib/components/Toolbar/ColorPicker.d.ts +0 -6
- package/lib/components/Toolbar/ColorPicker.js +0 -34
- package/lib/components/Toolbar/Combo.d.ts +0 -12
- package/lib/components/Toolbar/Combo.js +0 -111
- package/lib/components/Toolbar/CustomBorder.d.ts +0 -7
- package/lib/components/Toolbar/CustomBorder.js +0 -220
- package/lib/components/Toolbar/CustomButton.js +0 -36
- package/lib/components/Toolbar/CustomColor.d.ts +0 -8
- package/lib/components/Toolbar/CustomColor.js +0 -32
- package/lib/components/Toolbar/CustomIcon.js +0 -46
- package/lib/components/Toolbar/Divider.d.ts +0 -4
- package/lib/components/Toolbar/Divider.js +0 -19
- package/lib/components/Toolbar/MoreItemsContainer.d.ts +0 -6
- package/lib/components/Toolbar/MoreItemsContainer.js +0 -25
- package/lib/components/Toolbar/Select.js +0 -40
- package/lib/components/Toolbar/index.css +0 -405
- package/lib/components/Toolbar/index.d.ts +0 -10
- package/lib/components/Toolbar/index.js +0 -1347
- package/lib/components/Workbook/api.d.ts +0 -1183
- package/lib/components/Workbook/api.js +0 -405
- package/lib/components/Workbook/index.css +0 -44
- package/lib/components/Workbook/index.js +0 -597
- package/lib/components/ZoomControl/index.css +0 -54
- package/lib/components/ZoomControl/index.d.ts +0 -4
- package/lib/components/ZoomControl/index.js +0 -120
- package/lib/components/index.d.ts +0 -4
- package/lib/components/index.js +0 -28
- package/lib/constants.d.ts +0 -1
- package/lib/constants.js +0 -10
- package/lib/context/index.d.ts +0 -25
- package/lib/context/index.js +0 -41
- package/lib/context/modal.d.ts +0 -10
- package/lib/context/modal.js +0 -50
- package/lib/hooks/useAlert.d.ts +0 -4
- package/lib/hooks/useAlert.js +0 -37
- package/lib/hooks/useDialog.d.ts +0 -5
- package/lib/hooks/useDialog.js +0 -37
- package/lib/hooks/useOutsideClick.d.ts +0 -2
- package/lib/hooks/useOutsideClick.js +0 -21
- package/lib/hooks/usePrevious.d.ts +0 -2
- package/lib/hooks/usePrevious.js +0 -15
- package/lib/index.css +0 -27
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -16
- package/lib/utils/datepickerStyles.d.ts +0 -2
- package/lib/utils/datepickerStyles.js +0 -14
|
@@ -1,612 +0,0 @@
|
|
|
1
|
-
var __assign = this && this.__assign || function () {
|
|
2
|
-
__assign = Object.assign || function (t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
-
}
|
|
7
|
-
return t;
|
|
8
|
-
};
|
|
9
|
-
return __assign.apply(this, arguments);
|
|
10
|
-
};
|
|
11
|
-
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
12
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
13
|
-
if (ar || !(i in from)) {
|
|
14
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
15
|
-
ar[i] = from[i];
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
19
|
-
};
|
|
20
|
-
import { clearFilter, locale, getFilterColumnValues, getFilterColumnColors, orderbydatafiler, saveFilter } from "@fileverse-dev/fortune-core";
|
|
21
|
-
import React, { useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
22
|
-
import _ from "lodash";
|
|
23
|
-
import produce from "immer";
|
|
24
|
-
import { Button, Checkbox, Divider, LucideIcon, TextField } from "@fileverse/ui";
|
|
25
|
-
import WorkbookContext from "../../context";
|
|
26
|
-
import Menu from "./Menu";
|
|
27
|
-
import SVGIcon from "../SVGIcon";
|
|
28
|
-
import { useAlert } from "../../hooks/useAlert";
|
|
29
|
-
import { useOutsideClick } from "../../hooks/useOutsideClick";
|
|
30
|
-
var SelectItem = function SelectItem(_a) {
|
|
31
|
-
var item = _a.item,
|
|
32
|
-
isChecked = _a.isChecked,
|
|
33
|
-
onChange = _a.onChange,
|
|
34
|
-
isItemVisible = _a.isItemVisible;
|
|
35
|
-
var checked = useMemo(function () {
|
|
36
|
-
return isChecked(item.key);
|
|
37
|
-
}, [isChecked, item.key]);
|
|
38
|
-
return isItemVisible(item) ? (/*#__PURE__*/React.createElement("div", {
|
|
39
|
-
className: "select-item"
|
|
40
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
className: "flex items-center gap-2"
|
|
42
|
-
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
43
|
-
className: "border-2",
|
|
44
|
-
checked: checked,
|
|
45
|
-
onCheckedChange: function onCheckedChange(e) {
|
|
46
|
-
onChange(item, e.target.checked);
|
|
47
|
-
}
|
|
48
|
-
}), /*#__PURE__*/React.createElement("span", null, item.text)), /*#__PURE__*/React.createElement("span", {
|
|
49
|
-
className: "count"
|
|
50
|
-
}, "".concat(item.rows.length)))) : null;
|
|
51
|
-
};
|
|
52
|
-
var _DateSelectTreeItem = function DateSelectTreeItem(_a) {
|
|
53
|
-
var item = _a.item,
|
|
54
|
-
_b = _a.depth,
|
|
55
|
-
depth = _b === void 0 ? 0 : _b,
|
|
56
|
-
initialExpand = _a.initialExpand,
|
|
57
|
-
onExpand = _a.onExpand,
|
|
58
|
-
isChecked = _a.isChecked,
|
|
59
|
-
onChange = _a.onChange,
|
|
60
|
-
isItemVisible = _a.isItemVisible;
|
|
61
|
-
var _c = useState(initialExpand(item.key)),
|
|
62
|
-
expand = _c[0],
|
|
63
|
-
setExpand = _c[1];
|
|
64
|
-
var checked = useMemo(function () {
|
|
65
|
-
return isChecked(item.key);
|
|
66
|
-
}, [isChecked, item.key]);
|
|
67
|
-
return isItemVisible(item) ? (/*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className: "flex flex-col gap-2"
|
|
69
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
70
|
-
className: "select-item",
|
|
71
|
-
style: {
|
|
72
|
-
marginLeft: -2 + depth * 20
|
|
73
|
-
},
|
|
74
|
-
tabIndex: 0
|
|
75
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
className: "flex items-center gap-2",
|
|
77
|
-
style: {
|
|
78
|
-
flex: 1
|
|
79
|
-
},
|
|
80
|
-
onClick: function onClick(e) {
|
|
81
|
-
return e.stopPropagation();
|
|
82
|
-
}
|
|
83
|
-
}, _.isEmpty(item.children) ? (/*#__PURE__*/React.createElement("div", {
|
|
84
|
-
style: {
|
|
85
|
-
width: 10
|
|
86
|
-
}
|
|
87
|
-
})) : (/*#__PURE__*/React.createElement(LucideIcon, {
|
|
88
|
-
name: expand ? "ChevronDown" : "ChevronRight",
|
|
89
|
-
className: "cursor-pointer",
|
|
90
|
-
size: "sm",
|
|
91
|
-
onClick: function onClick() {
|
|
92
|
-
onExpand === null || onExpand === void 0 ? void 0 : onExpand(item.key, !expand);
|
|
93
|
-
setExpand(!expand);
|
|
94
|
-
}
|
|
95
|
-
})), /*#__PURE__*/React.createElement(Checkbox, {
|
|
96
|
-
className: "border-2",
|
|
97
|
-
checked: checked,
|
|
98
|
-
onCheckedChange: function onCheckedChange(e) {
|
|
99
|
-
onChange(item, e.target.checked);
|
|
100
|
-
}
|
|
101
|
-
}), /*#__PURE__*/React.createElement("span", null, item.text)), /*#__PURE__*/React.createElement("span", {
|
|
102
|
-
className: "count"
|
|
103
|
-
}, "".concat(item.rows.length))), expand && item.children.map(function (v) {
|
|
104
|
-
return /*#__PURE__*/React.createElement(_DateSelectTreeItem, __assign({
|
|
105
|
-
key: v.key,
|
|
106
|
-
item: v,
|
|
107
|
-
depth: depth + 1
|
|
108
|
-
}, {
|
|
109
|
-
initialExpand: initialExpand,
|
|
110
|
-
onExpand: onExpand,
|
|
111
|
-
isChecked: isChecked,
|
|
112
|
-
onChange: onChange,
|
|
113
|
-
isItemVisible: isItemVisible
|
|
114
|
-
}));
|
|
115
|
-
}))) : null;
|
|
116
|
-
};
|
|
117
|
-
var DateSelectTree = function DateSelectTree(_a) {
|
|
118
|
-
var dates = _a.dates,
|
|
119
|
-
initialExpand = _a.initialExpand,
|
|
120
|
-
onExpand = _a.onExpand,
|
|
121
|
-
isChecked = _a.isChecked,
|
|
122
|
-
onChange = _a.onChange,
|
|
123
|
-
isItemVisible = _a.isItemVisible;
|
|
124
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, dates.map(function (v) {
|
|
125
|
-
return /*#__PURE__*/React.createElement(_DateSelectTreeItem, __assign({
|
|
126
|
-
key: v.key,
|
|
127
|
-
item: v
|
|
128
|
-
}, {
|
|
129
|
-
initialExpand: initialExpand,
|
|
130
|
-
onExpand: onExpand,
|
|
131
|
-
isChecked: isChecked,
|
|
132
|
-
onChange: onChange,
|
|
133
|
-
isItemVisible: isItemVisible
|
|
134
|
-
}));
|
|
135
|
-
}));
|
|
136
|
-
};
|
|
137
|
-
var FilterMenu = function FilterMenu() {
|
|
138
|
-
var _a;
|
|
139
|
-
var _b = useContext(WorkbookContext),
|
|
140
|
-
context = _b.context,
|
|
141
|
-
setContext = _b.setContext,
|
|
142
|
-
settings = _b.settings,
|
|
143
|
-
refs = _b.refs;
|
|
144
|
-
var containerRef = useRef(null);
|
|
145
|
-
var contextRef = useRef(context);
|
|
146
|
-
var byColorMenuRef = useRef(null);
|
|
147
|
-
var subMenuRef = useRef(null);
|
|
148
|
-
var filterContextMenu = context.filterContextMenu;
|
|
149
|
-
var _c = filterContextMenu || {
|
|
150
|
-
startRow: null,
|
|
151
|
-
startCol: null,
|
|
152
|
-
endRow: null,
|
|
153
|
-
endCol: null,
|
|
154
|
-
col: null,
|
|
155
|
-
listBoxMaxHeight: 400
|
|
156
|
-
},
|
|
157
|
-
startRow = _c.startRow,
|
|
158
|
-
startCol = _c.startCol,
|
|
159
|
-
endRow = _c.endRow,
|
|
160
|
-
endCol = _c.endCol,
|
|
161
|
-
col = _c.col;
|
|
162
|
-
var filter = locale(context).filter;
|
|
163
|
-
var _d = useState({
|
|
164
|
-
dates: [],
|
|
165
|
-
dateRowMap: {},
|
|
166
|
-
values: [],
|
|
167
|
-
valueRowMap: {},
|
|
168
|
-
visibleRows: [],
|
|
169
|
-
flattenValues: []
|
|
170
|
-
}),
|
|
171
|
-
data = _d[0],
|
|
172
|
-
setData = _d[1];
|
|
173
|
-
var _e = useState([]),
|
|
174
|
-
datesUncheck = _e[0],
|
|
175
|
-
setDatesUncheck = _e[1];
|
|
176
|
-
var _f = useState([]),
|
|
177
|
-
valuesUncheck = _f[0],
|
|
178
|
-
setValuesUncheck = _f[1];
|
|
179
|
-
var dateTreeExpandState = useRef({});
|
|
180
|
-
var hiddenRows = useRef([]);
|
|
181
|
-
var _g = useState([]),
|
|
182
|
-
showValues = _g[0],
|
|
183
|
-
setShowValues = _g[1];
|
|
184
|
-
var _h = useState(""),
|
|
185
|
-
searchText = _h[0],
|
|
186
|
-
setSearchText = _h[1];
|
|
187
|
-
var _j = useState(),
|
|
188
|
-
subMenuPos = _j[0],
|
|
189
|
-
setSubMenuPos = _j[1];
|
|
190
|
-
var _k = useState({
|
|
191
|
-
bgColors: [],
|
|
192
|
-
fcColors: []
|
|
193
|
-
}),
|
|
194
|
-
filterColors = _k[0],
|
|
195
|
-
setFilterColors = _k[1];
|
|
196
|
-
var _l = useState(false),
|
|
197
|
-
showSubMenu = _l[0],
|
|
198
|
-
setShowSubMenu = _l[1];
|
|
199
|
-
var showAlert = useAlert().showAlert;
|
|
200
|
-
var mouseHoverSubMenu = useRef(false);
|
|
201
|
-
contextRef.current = context;
|
|
202
|
-
var close = useCallback(function () {
|
|
203
|
-
setContext(function (ctx) {
|
|
204
|
-
ctx.filterContextMenu = undefined;
|
|
205
|
-
});
|
|
206
|
-
}, [setContext]);
|
|
207
|
-
useOutsideClick(containerRef, close, [close]);
|
|
208
|
-
var initialExpand = useCallback(function (key) {
|
|
209
|
-
var expand = dateTreeExpandState.current[key];
|
|
210
|
-
if (expand == null) {
|
|
211
|
-
dateTreeExpandState.current[key] = true;
|
|
212
|
-
return true;
|
|
213
|
-
}
|
|
214
|
-
return expand;
|
|
215
|
-
}, []);
|
|
216
|
-
var onExpand = useCallback(function (key, expand) {
|
|
217
|
-
dateTreeExpandState.current[key] = expand;
|
|
218
|
-
}, []);
|
|
219
|
-
var searchValues = useMemo(function () {
|
|
220
|
-
return _.debounce(function (text) {
|
|
221
|
-
setShowValues(_.filter(data.flattenValues, function (v) {
|
|
222
|
-
return v.toLowerCase().indexOf(text.toLowerCase()) > -1;
|
|
223
|
-
}));
|
|
224
|
-
}, 300);
|
|
225
|
-
}, [data.flattenValues]);
|
|
226
|
-
var onColorSelectChange = useCallback(function (key, color, checked) {
|
|
227
|
-
setFilterColors(produce(function (draft) {
|
|
228
|
-
var colorData = _.find(_.get(draft, key), function (v) {
|
|
229
|
-
return v.color === color;
|
|
230
|
-
});
|
|
231
|
-
colorData.checked = checked;
|
|
232
|
-
}));
|
|
233
|
-
}, []);
|
|
234
|
-
var delayHideSubMenu = useMemo(function () {
|
|
235
|
-
return _.debounce(function () {
|
|
236
|
-
if (mouseHoverSubMenu.current) return;
|
|
237
|
-
setShowSubMenu(false);
|
|
238
|
-
}, 200);
|
|
239
|
-
}, []);
|
|
240
|
-
var sortData = useCallback(function (asc) {
|
|
241
|
-
if (col == null) return;
|
|
242
|
-
setContext(function (draftCtx) {
|
|
243
|
-
var errMsg = orderbydatafiler(draftCtx, startRow, startCol, endRow, endCol, col, asc);
|
|
244
|
-
if (errMsg != null) showAlert(errMsg);
|
|
245
|
-
});
|
|
246
|
-
}, [col, setContext, startRow, startCol, endRow, endCol, showAlert]);
|
|
247
|
-
var renderColorList = useCallback(function (key, title, colors, onSelectChange) {
|
|
248
|
-
return colors.length > 1 ? (/*#__PURE__*/React.createElement("div", {
|
|
249
|
-
key: key
|
|
250
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
251
|
-
className: "title"
|
|
252
|
-
}, title), /*#__PURE__*/React.createElement("div", {
|
|
253
|
-
className: "color-list"
|
|
254
|
-
}, colors.map(function (v) {
|
|
255
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
256
|
-
key: v.color,
|
|
257
|
-
className: "item",
|
|
258
|
-
onClick: function onClick() {
|
|
259
|
-
return onSelectChange(key, v.color, !v.checked);
|
|
260
|
-
},
|
|
261
|
-
tabIndex: 0
|
|
262
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
263
|
-
className: "color-label",
|
|
264
|
-
style: {
|
|
265
|
-
backgroundColor: v.color
|
|
266
|
-
}
|
|
267
|
-
}), /*#__PURE__*/React.createElement("input", {
|
|
268
|
-
className: "luckysheet-mousedown-cancel",
|
|
269
|
-
type: "checkbox",
|
|
270
|
-
checked: v.checked,
|
|
271
|
-
onChange: function onChange() {}
|
|
272
|
-
}));
|
|
273
|
-
})))) : null;
|
|
274
|
-
}, []);
|
|
275
|
-
useLayoutEffect(function () {
|
|
276
|
-
var _a;
|
|
277
|
-
if (!containerRef.current || !filterContextMenu) {
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
var winH = window.innerHeight;
|
|
281
|
-
var winW = window.innerWidth;
|
|
282
|
-
var rect = containerRef.current.getBoundingClientRect();
|
|
283
|
-
var workbookRect = (_a = refs.workbookContainer.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
284
|
-
if (!workbookRect) {
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
var menuW = rect.width;
|
|
288
|
-
var menuH = 350;
|
|
289
|
-
var top = filterContextMenu.y;
|
|
290
|
-
var left = filterContextMenu.x;
|
|
291
|
-
var hasOverflow = false;
|
|
292
|
-
if (workbookRect.left + left + menuW > winW) {
|
|
293
|
-
left -= menuW;
|
|
294
|
-
hasOverflow = true;
|
|
295
|
-
}
|
|
296
|
-
if (workbookRect.top + top + menuH > winH) {
|
|
297
|
-
top -= menuH;
|
|
298
|
-
hasOverflow = true;
|
|
299
|
-
}
|
|
300
|
-
if (top < 0) {
|
|
301
|
-
top = 0;
|
|
302
|
-
hasOverflow = true;
|
|
303
|
-
}
|
|
304
|
-
var containerH = winH - rect.top - 350;
|
|
305
|
-
if (containerH < 0) {
|
|
306
|
-
containerH = 100;
|
|
307
|
-
}
|
|
308
|
-
if (filterContextMenu.x === left && filterContextMenu.y === top && filterContextMenu.listBoxMaxHeight === containerH) {
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
setContext(function (draftCtx) {
|
|
312
|
-
if (hasOverflow) {
|
|
313
|
-
_.set(draftCtx, "filterContextMenu.x", left);
|
|
314
|
-
_.set(draftCtx, "filterContextMenu.y", top);
|
|
315
|
-
}
|
|
316
|
-
_.set(draftCtx, "filterContextMenu.listBoxMaxHeight", containerH);
|
|
317
|
-
});
|
|
318
|
-
}, [filterContextMenu, refs.workbookContainer, setContext]);
|
|
319
|
-
useLayoutEffect(function () {
|
|
320
|
-
var _a, _b;
|
|
321
|
-
if (!subMenuPos) return;
|
|
322
|
-
var rect = (_a = byColorMenuRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
323
|
-
var subMenuRect = (_b = subMenuRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
324
|
-
if (rect == null || subMenuRect == null) return;
|
|
325
|
-
var winW = window.innerWidth;
|
|
326
|
-
var pos = _.cloneDeep(subMenuPos);
|
|
327
|
-
if (subMenuRect.left + subMenuRect.width > winW) {
|
|
328
|
-
pos.left -= subMenuRect.width;
|
|
329
|
-
setSubMenuPos(pos);
|
|
330
|
-
}
|
|
331
|
-
}, [subMenuPos]);
|
|
332
|
-
useEffect(function () {
|
|
333
|
-
if (col == null) return;
|
|
334
|
-
setSearchText("");
|
|
335
|
-
setShowSubMenu(false);
|
|
336
|
-
dateTreeExpandState.current = {};
|
|
337
|
-
hiddenRows.current = (filterContextMenu === null || filterContextMenu === void 0 ? void 0 : filterContextMenu.hiddenRows) || [];
|
|
338
|
-
var res = getFilterColumnValues(contextRef.current, col, startRow, endRow, startCol);
|
|
339
|
-
setData(_.omit(res, ["datesUncheck", "valuesUncheck"]));
|
|
340
|
-
setDatesUncheck(res.datesUncheck);
|
|
341
|
-
setValuesUncheck(res.valuesUncheck);
|
|
342
|
-
setShowValues(res.flattenValues);
|
|
343
|
-
}, [col, endRow, startRow, startCol, hiddenRows, filterContextMenu === null || filterContextMenu === void 0 ? void 0 : filterContextMenu.hiddenRows]);
|
|
344
|
-
useEffect(function () {
|
|
345
|
-
if (col == null) return;
|
|
346
|
-
setFilterColors(getFilterColumnColors(contextRef.current, col, startRow, endRow));
|
|
347
|
-
}, [col, endRow, startRow]);
|
|
348
|
-
if (filterContextMenu == null) return null;
|
|
349
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
350
|
-
className: "fortune-context-menu luckysheet-cols-menu fortune-filter-menu",
|
|
351
|
-
id: "luckysheet-\\${menuid}-menu",
|
|
352
|
-
ref: containerRef,
|
|
353
|
-
style: {
|
|
354
|
-
left: filterContextMenu.x,
|
|
355
|
-
top: filterContextMenu.y,
|
|
356
|
-
minWidth: "280px !important"
|
|
357
|
-
}
|
|
358
|
-
}, (_a = settings.filterContextMenu) === null || _a === void 0 ? void 0 : _a.map(function (name, i) {
|
|
359
|
-
if (name === "|") {
|
|
360
|
-
return /*#__PURE__*/React.createElement(Divider, {
|
|
361
|
-
key: "divider-".concat(i)
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
if (name === "sort-by-asc") {
|
|
365
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
366
|
-
key: name,
|
|
367
|
-
onClick: function onClick() {
|
|
368
|
-
return sortData(true);
|
|
369
|
-
}
|
|
370
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
371
|
-
className: "context-item w-full"
|
|
372
|
-
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
373
|
-
name: "sort-asc",
|
|
374
|
-
width: 24,
|
|
375
|
-
height: 18,
|
|
376
|
-
style: {
|
|
377
|
-
marginRight: "4px"
|
|
378
|
-
}
|
|
379
|
-
}), /*#__PURE__*/React.createElement("p", null, filter.sortByAsc)));
|
|
380
|
-
}
|
|
381
|
-
if (name === "sort-by-desc") {
|
|
382
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
383
|
-
key: name,
|
|
384
|
-
onClick: function onClick() {
|
|
385
|
-
return sortData(false);
|
|
386
|
-
}
|
|
387
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
388
|
-
className: "context-item w-full"
|
|
389
|
-
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
390
|
-
name: "sort-desc",
|
|
391
|
-
width: 24,
|
|
392
|
-
height: 18,
|
|
393
|
-
style: {
|
|
394
|
-
marginRight: "4px"
|
|
395
|
-
}
|
|
396
|
-
}), /*#__PURE__*/React.createElement("p", null, filter.sortByDesc)));
|
|
397
|
-
}
|
|
398
|
-
if (name === "filter-by-color") {
|
|
399
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
400
|
-
key: name,
|
|
401
|
-
ref: byColorMenuRef,
|
|
402
|
-
onMouseEnter: function onMouseEnter() {
|
|
403
|
-
var _a;
|
|
404
|
-
if (!containerRef.current || !filterContextMenu) {
|
|
405
|
-
return;
|
|
406
|
-
}
|
|
407
|
-
setShowSubMenu(true);
|
|
408
|
-
var rect = (_a = byColorMenuRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
409
|
-
if (rect == null) return;
|
|
410
|
-
setSubMenuPos({
|
|
411
|
-
top: rect.top - 5,
|
|
412
|
-
left: rect.right
|
|
413
|
-
});
|
|
414
|
-
},
|
|
415
|
-
onMouseLeave: delayHideSubMenu
|
|
416
|
-
}, /*#__PURE__*/React.createElement(Menu, {
|
|
417
|
-
onClick: function onClick() {}
|
|
418
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
419
|
-
className: "filter-bycolor-container"
|
|
420
|
-
}, filter.filterByColor, /*#__PURE__*/React.createElement("div", {
|
|
421
|
-
className: "filter-caret right"
|
|
422
|
-
}))));
|
|
423
|
-
}
|
|
424
|
-
if (name === "filter-by-value") {
|
|
425
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
426
|
-
key: name
|
|
427
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
428
|
-
className: "luckysheet-filter-byvalue flex flex-col gap-2 mt-2"
|
|
429
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
430
|
-
className: "filtermenu-input-container"
|
|
431
|
-
}, /*#__PURE__*/React.createElement(TextField, {
|
|
432
|
-
leftIcon: /*#__PURE__*/React.createElement(LucideIcon, {
|
|
433
|
-
name: "Search",
|
|
434
|
-
size: "sm"
|
|
435
|
-
}),
|
|
436
|
-
onKeyDown: function onKeyDown(e) {
|
|
437
|
-
return e.stopPropagation();
|
|
438
|
-
},
|
|
439
|
-
placeholder: filter.filterValueByTip,
|
|
440
|
-
id: "luckysheet-\\${menuid}-byvalue-input",
|
|
441
|
-
value: searchText,
|
|
442
|
-
onChange: function onChange(e) {
|
|
443
|
-
setSearchText(e.target.value);
|
|
444
|
-
searchValues(e.target.value);
|
|
445
|
-
}
|
|
446
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
447
|
-
id: "luckysheet-filter-byvalue-select"
|
|
448
|
-
}, /*#__PURE__*/React.createElement(DateSelectTree, {
|
|
449
|
-
dates: data.dates,
|
|
450
|
-
onExpand: onExpand,
|
|
451
|
-
initialExpand: initialExpand,
|
|
452
|
-
isChecked: function isChecked(key) {
|
|
453
|
-
return _.find(datesUncheck, function (v) {
|
|
454
|
-
return v.match(key) != null;
|
|
455
|
-
}) == null;
|
|
456
|
-
},
|
|
457
|
-
onChange: function onChange(item, checked) {
|
|
458
|
-
var rows = hiddenRows.current;
|
|
459
|
-
hiddenRows.current = checked ? _.without.apply(_, __spreadArray([rows], item.rows, false)) : _.union(rows, item.rows);
|
|
460
|
-
setDatesUncheck(produce(function (draft) {
|
|
461
|
-
return checked ? _.without.apply(_, __spreadArray([draft], item.dateValues, false)) : _.union(draft, item.dateValues);
|
|
462
|
-
}));
|
|
463
|
-
},
|
|
464
|
-
isItemVisible: function isItemVisible(item) {
|
|
465
|
-
return showValues.length === data.flattenValues.length ? true : _.findIndex(showValues, function (v) {
|
|
466
|
-
return v.match(item.key) != null;
|
|
467
|
-
}) > -1;
|
|
468
|
-
}
|
|
469
|
-
}), /*#__PURE__*/React.createElement(SelectItem, {
|
|
470
|
-
item: {
|
|
471
|
-
key: "all",
|
|
472
|
-
text: filter.filterValueByAllBtn,
|
|
473
|
-
value: "",
|
|
474
|
-
mask: "",
|
|
475
|
-
rows: data.values.filter(function (v) {
|
|
476
|
-
return showValues.includes(v.text);
|
|
477
|
-
}).flatMap(function (v) {
|
|
478
|
-
return v.rows;
|
|
479
|
-
})
|
|
480
|
-
},
|
|
481
|
-
isChecked: function isChecked() {
|
|
482
|
-
var allDatesChecked = datesUncheck.length === 0;
|
|
483
|
-
var allValuesChecked = valuesUncheck.length === 0;
|
|
484
|
-
return allDatesChecked && allValuesChecked;
|
|
485
|
-
},
|
|
486
|
-
onChange: function onChange(item, checked) {
|
|
487
|
-
if (checked) {
|
|
488
|
-
setDatesUncheck([]);
|
|
489
|
-
setValuesUncheck([]);
|
|
490
|
-
hiddenRows.current = [];
|
|
491
|
-
} else {
|
|
492
|
-
setDatesUncheck(_.keys(data.dateRowMap));
|
|
493
|
-
setValuesUncheck(_.keys(data.valueRowMap));
|
|
494
|
-
hiddenRows.current = data.visibleRows;
|
|
495
|
-
}
|
|
496
|
-
},
|
|
497
|
-
isItemVisible: function isItemVisible() {
|
|
498
|
-
return true;
|
|
499
|
-
}
|
|
500
|
-
}), data.values.map(function (v) {
|
|
501
|
-
return /*#__PURE__*/React.createElement(SelectItem, {
|
|
502
|
-
key: v.key,
|
|
503
|
-
item: v,
|
|
504
|
-
isChecked: function isChecked(key) {
|
|
505
|
-
return !_.includes(valuesUncheck, key);
|
|
506
|
-
},
|
|
507
|
-
onChange: function onChange(item, checked) {
|
|
508
|
-
var rows = hiddenRows.current;
|
|
509
|
-
if (checked) {
|
|
510
|
-
hiddenRows.current = _.without.apply(_, __spreadArray([rows], item.rows, false));
|
|
511
|
-
setValuesUncheck(produce(function (draft) {
|
|
512
|
-
_.pull(draft, item.key);
|
|
513
|
-
}));
|
|
514
|
-
} else {
|
|
515
|
-
hiddenRows.current = _.concat(rows, item.rows);
|
|
516
|
-
setValuesUncheck(produce(function (draft) {
|
|
517
|
-
draft.push(item.key);
|
|
518
|
-
}));
|
|
519
|
-
}
|
|
520
|
-
},
|
|
521
|
-
isItemVisible: function isItemVisible(item) {
|
|
522
|
-
return showValues.length === data.flattenValues.length ? true : _.includes(showValues, item.text);
|
|
523
|
-
}
|
|
524
|
-
});
|
|
525
|
-
}))));
|
|
526
|
-
}
|
|
527
|
-
return null;
|
|
528
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
529
|
-
className: "fortune-menuitem-row mt-2"
|
|
530
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
531
|
-
variant: "ghost",
|
|
532
|
-
style: {
|
|
533
|
-
minWidth: "80px"
|
|
534
|
-
},
|
|
535
|
-
onClick: function onClick() {
|
|
536
|
-
setContext(function (draftCtx) {
|
|
537
|
-
clearFilter(draftCtx);
|
|
538
|
-
});
|
|
539
|
-
},
|
|
540
|
-
tabIndex: 0
|
|
541
|
-
}, filter.clearFilter), /*#__PURE__*/React.createElement(Button, {
|
|
542
|
-
variant: "secondary",
|
|
543
|
-
style: {
|
|
544
|
-
minWidth: "80px"
|
|
545
|
-
},
|
|
546
|
-
onClick: function onClick() {
|
|
547
|
-
setContext(function (draftCtx) {
|
|
548
|
-
draftCtx.filterContextMenu = undefined;
|
|
549
|
-
});
|
|
550
|
-
},
|
|
551
|
-
tabIndex: 0
|
|
552
|
-
}, filter.filterCancel), /*#__PURE__*/React.createElement(Button, {
|
|
553
|
-
variant: "default",
|
|
554
|
-
style: {
|
|
555
|
-
minWidth: "80px"
|
|
556
|
-
},
|
|
557
|
-
onClick: function onClick() {
|
|
558
|
-
if (col == null) return;
|
|
559
|
-
setContext(function (draftCtx) {
|
|
560
|
-
var rowHidden = _.reduce(hiddenRows.current, function (pre, curr) {
|
|
561
|
-
pre[curr] = 0;
|
|
562
|
-
return pre;
|
|
563
|
-
}, {});
|
|
564
|
-
saveFilter(draftCtx, hiddenRows.current.length > 0, rowHidden, {}, startRow, endRow, col, startCol, endCol);
|
|
565
|
-
hiddenRows.current = [];
|
|
566
|
-
draftCtx.filterContextMenu = undefined;
|
|
567
|
-
});
|
|
568
|
-
},
|
|
569
|
-
tabIndex: 0
|
|
570
|
-
}, filter.filterConfirm))), showSubMenu && (/*#__PURE__*/React.createElement("div", {
|
|
571
|
-
ref: subMenuRef,
|
|
572
|
-
className: "luckysheet-filter-bycolor-submenu",
|
|
573
|
-
style: subMenuPos,
|
|
574
|
-
onMouseEnter: function onMouseEnter() {
|
|
575
|
-
mouseHoverSubMenu.current = true;
|
|
576
|
-
},
|
|
577
|
-
onMouseLeave: function onMouseLeave() {
|
|
578
|
-
mouseHoverSubMenu.current = false;
|
|
579
|
-
setShowSubMenu(false);
|
|
580
|
-
}
|
|
581
|
-
}, filterColors.bgColors.length < 2 && filterColors.fcColors.length < 2 ? (/*#__PURE__*/React.createElement("div", {
|
|
582
|
-
className: "one-color-tip"
|
|
583
|
-
}, filter.filterContainerOneColorTip)) : (/*#__PURE__*/React.createElement(React.Fragment, null, [{
|
|
584
|
-
key: "bgColors",
|
|
585
|
-
title: filter.filiterByColorTip,
|
|
586
|
-
colors: filterColors.bgColors
|
|
587
|
-
}, {
|
|
588
|
-
key: "fcColors",
|
|
589
|
-
title: filter.filiterByTextColorTip,
|
|
590
|
-
colors: filterColors.fcColors
|
|
591
|
-
}].map(function (v) {
|
|
592
|
-
return renderColorList(v.key, v.title, v.colors, onColorSelectChange);
|
|
593
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
594
|
-
className: "button-basic button-primary",
|
|
595
|
-
onClick: function onClick() {
|
|
596
|
-
if (col == null) return;
|
|
597
|
-
setContext(function (draftCtx) {
|
|
598
|
-
var rowHidden = _.reduce(_(filterColors).values().flatten().map(function (v) {
|
|
599
|
-
return v.checked ? [] : v.rows;
|
|
600
|
-
}).flatten().valueOf(), function (pre, curr) {
|
|
601
|
-
pre[curr] = 0;
|
|
602
|
-
return pre;
|
|
603
|
-
}, {});
|
|
604
|
-
saveFilter(draftCtx, !_.isEmpty(rowHidden), rowHidden, {}, startRow, endRow, col, startCol, endCol);
|
|
605
|
-
hiddenRows.current = [];
|
|
606
|
-
draftCtx.filterContextMenu = undefined;
|
|
607
|
-
});
|
|
608
|
-
},
|
|
609
|
-
tabIndex: 0
|
|
610
|
-
}, filter.filterConfirm))))));
|
|
611
|
-
};
|
|
612
|
-
export default FilterMenu;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from "react";
|
|
2
|
-
var Menu = function Menu(_a) {
|
|
3
|
-
var _onClick = _a.onClick,
|
|
4
|
-
_onMouseLeave = _a.onMouseLeave,
|
|
5
|
-
_onMouseEnter = _a.onMouseEnter,
|
|
6
|
-
children = _a.children;
|
|
7
|
-
var containerRef = useRef(null);
|
|
8
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
ref: containerRef,
|
|
10
|
-
className: "luckysheet-cols-menuitem luckysheet-mousedown-cancel",
|
|
11
|
-
onClick: function onClick(e) {
|
|
12
|
-
return _onClick === null || _onClick === void 0 ? void 0 : _onClick(e, containerRef.current);
|
|
13
|
-
},
|
|
14
|
-
onMouseLeave: function onMouseLeave(e) {
|
|
15
|
-
return _onMouseLeave === null || _onMouseLeave === void 0 ? void 0 : _onMouseLeave(e, containerRef.current);
|
|
16
|
-
},
|
|
17
|
-
onMouseEnter: function onMouseEnter(e) {
|
|
18
|
-
return _onMouseEnter === null || _onMouseEnter === void 0 ? void 0 : _onMouseEnter(e, containerRef.current);
|
|
19
|
-
},
|
|
20
|
-
tabIndex: 0
|
|
21
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
22
|
-
className: "luckysheet-cols-menuitem-content luckysheet-mousedown-cancel"
|
|
23
|
-
}, children));
|
|
24
|
-
};
|
|
25
|
-
export default Menu;
|