@fileverse-dev/fortune-react 1.0.5 → 1.0.6

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.
Files changed (420) hide show
  1. package/es/components/ChangeColor/index.css +76 -0
  2. package/{dist/packages/react/src → es}/components/ChangeColor/index.d.ts +7 -7
  3. package/es/components/ChangeColor/index.js +41 -0
  4. package/{dist/packages/react/src → es}/components/ConditionFormat/ConditionRules.d.ts +6 -6
  5. package/es/components/ConditionFormat/ConditionRules.js +323 -0
  6. package/es/components/ConditionFormat/index.css +210 -0
  7. package/{dist/packages/react/src → es}/components/ConditionFormat/index.d.ts +7 -7
  8. package/es/components/ConditionFormat/index.js +252 -0
  9. package/{dist/packages/react/src → es}/components/ContextMenu/Divider.d.ts +3 -3
  10. package/es/components/ContextMenu/Divider.js +7 -0
  11. package/{dist/packages/react/src → es}/components/ContextMenu/FilterMenu.d.ts +3 -3
  12. package/es/components/ContextMenu/FilterMenu.js +612 -0
  13. package/{dist/packages/react/src → es}/components/ContextMenu/Menu.d.ts +8 -8
  14. package/es/components/ContextMenu/Menu.js +25 -0
  15. package/{dist/packages/react/src → es}/components/ContextMenu/SheetTab.d.ts +4 -4
  16. package/es/components/ContextMenu/SheetTab.js +223 -0
  17. package/es/components/ContextMenu/index.css +322 -0
  18. package/{dist/packages/react/src → es}/components/ContextMenu/index.d.ts +5 -5
  19. package/es/components/ContextMenu/index.js +1054 -0
  20. package/es/components/CustomSort/index.css +23 -0
  21. package/{dist/packages/react/src → es}/components/CustomSort/index.d.ts +4 -4
  22. package/es/components/CustomSort/index.js +113 -0
  23. package/{dist/packages/react/src → es}/components/DataVerification/DropdownList.d.ts +4 -4
  24. package/es/components/DataVerification/DropdownList.js +126 -0
  25. package/{dist/packages/react/src → es}/components/DataVerification/RangeDialog.d.ts +4 -4
  26. package/es/components/DataVerification/RangeDialog.js +105 -0
  27. package/{dist/packages/react/src → es}/components/DataVerification/getDisplayedRangeTxt.d.ts +2 -2
  28. package/es/components/DataVerification/getDisplayedRangeTxt.js +9 -0
  29. package/es/components/DataVerification/index.css +202 -0
  30. package/{dist/packages/react/src → es}/components/DataVerification/index.d.ts +4 -4
  31. package/es/components/DataVerification/index.js +398 -0
  32. package/es/components/Dialog/index.css +64 -0
  33. package/{dist/packages/react/src → es}/components/Dialog/index.d.ts +15 -15
  34. package/es/components/Dialog/index.js +60 -0
  35. package/{dist/packages/react/src → es}/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +11 -11
  36. package/es/components/DuneChartsInputModal/DuneChartsInputModal.js +95 -0
  37. package/es/components/DuneChartsInputModal/duneChartsInputModal.css +98 -0
  38. package/{dist/packages/react/src → es}/components/DunePreview/DunePreview.d.ts +13 -13
  39. package/es/components/DunePreview/DunePreview.js +46 -0
  40. package/es/components/DunePreview/index.css +57 -0
  41. package/{dist/packages/react/src → es}/components/FilterOption/index.d.ts +5 -5
  42. package/es/components/FilterOption/index.js +121 -0
  43. package/es/components/FormatSearch/index.css +19 -0
  44. package/{dist/packages/react/src → es}/components/FormatSearch/index.d.ts +6 -6
  45. package/es/components/FormatSearch/index.js +129 -0
  46. package/es/components/FormulaSearch/index.css +65 -0
  47. package/{dist/packages/react/src → es}/components/FormulaSearch/index.d.ts +5 -5
  48. package/es/components/FormulaSearch/index.js +198 -0
  49. package/{dist/packages/react/src → es}/components/FxEditor/NameBox.d.ts +3 -3
  50. package/es/components/FxEditor/NameBox.js +29 -0
  51. package/es/components/FxEditor/index.css +72 -0
  52. package/{dist/packages/react/src → es}/components/FxEditor/index.d.ts +4 -4
  53. package/es/components/FxEditor/index.js +167 -0
  54. package/es/components/IFrameBoxs/iFrameBoxs.css +16 -0
  55. package/{dist/packages/react/src → es}/components/IFrameBoxs/iFrameBoxs.d.ts +4 -4
  56. package/es/components/IFrameBoxs/iFrameBoxs.js +142 -0
  57. package/{dist/packages/react/src → es}/components/ImgBoxs/index.d.ts +3 -3
  58. package/es/components/ImgBoxs/index.js +219 -0
  59. package/es/components/LinkEidtCard/index.css +255 -0
  60. package/{dist/packages/react/src → es}/components/LinkEidtCard/index.d.ts +5 -5
  61. package/es/components/LinkEidtCard/index.js +238 -0
  62. package/es/components/LocationCondition/index.css +74 -0
  63. package/{dist/packages/react/src → es}/components/LocationCondition/index.d.ts +3 -3
  64. package/es/components/LocationCondition/index.js +195 -0
  65. package/{dist/packages/react/src → es}/components/MessageBox/index.d.ts +9 -9
  66. package/es/components/MessageBox/index.js +16 -0
  67. package/{dist/packages/react/src → es}/components/NotationBoxes/index.d.ts +3 -3
  68. package/es/components/NotationBoxes/index.js +105 -0
  69. package/{dist/packages/react/src → es}/components/ResetColumnWidth/index.d.ts +2 -2
  70. package/es/components/ResetColumnWidth/index.js +130 -0
  71. package/{dist/packages/react/src → es}/components/SVGDefines.d.ts +5 -5
  72. package/es/components/SVGDefines.js +1902 -0
  73. package/{dist/packages/react/src → es}/components/SVGIcon.d.ts +9 -9
  74. package/es/components/SVGIcon.js +18 -0
  75. package/es/components/SearchReplace/index.css +191 -0
  76. package/{dist/packages/react/src → es}/components/SearchReplace/index.d.ts +6 -6
  77. package/es/components/SearchReplace/index.js +294 -0
  78. package/es/components/Sheet/index.css +27 -0
  79. package/{dist/packages/react/src → es}/components/Sheet/index.d.ts +8 -8
  80. package/es/components/Sheet/index.js +173 -0
  81. package/{dist/packages/react/src → es}/components/SheetList/SheetHiddenButton.d.ts +8 -8
  82. package/es/components/SheetList/SheetHiddenButton.js +35 -0
  83. package/{dist/packages/react/src → es}/components/SheetList/SheetListItem.d.ts +9 -9
  84. package/es/components/SheetList/SheetListItem.js +72 -0
  85. package/es/components/SheetList/index.css +48 -0
  86. package/{dist/packages/react/src → es}/components/SheetList/index.d.ts +4 -4
  87. package/es/components/SheetList/index.js +30 -0
  88. package/{dist/packages/react/src → es}/components/SheetOverlay/ColumnHeader.d.ts +3 -3
  89. package/es/components/SheetOverlay/ColumnHeader.js +217 -0
  90. package/{dist/packages/react/src → es}/components/SheetOverlay/ContentEditable.d.ts +11 -11
  91. package/es/components/SheetOverlay/ContentEditable.js +74 -0
  92. package/es/components/SheetOverlay/FormulaHint/index.css +180 -0
  93. package/{dist/packages/react/src → es}/components/SheetOverlay/FormulaHint/index.d.ts +4 -4
  94. package/es/components/SheetOverlay/FormulaHint/index.js +348 -0
  95. package/{dist/packages/react/src → es}/components/SheetOverlay/FormulaSearch/constant.d.ts +63 -63
  96. package/es/components/SheetOverlay/FormulaSearch/constant.js +328 -0
  97. package/es/components/SheetOverlay/FormulaSearch/index.css +42 -0
  98. package/{dist/packages/react/src → es}/components/SheetOverlay/FormulaSearch/index.d.ts +4 -4
  99. package/es/components/SheetOverlay/FormulaSearch/index.js +261 -0
  100. package/{dist/packages/react/src → es}/components/SheetOverlay/InputBox.d.ts +3 -3
  101. package/es/components/SheetOverlay/InputBox.js +305 -0
  102. package/{dist/packages/react/src → es}/components/SheetOverlay/RowHeader.d.ts +3 -3
  103. package/es/components/SheetOverlay/RowHeader.js +187 -0
  104. package/es/components/SheetOverlay/ScrollBar/index.css +40 -0
  105. package/{dist/packages/react/src → es}/components/SheetOverlay/ScrollBar/index.d.ts +7 -7
  106. package/es/components/SheetOverlay/ScrollBar/index.js +47 -0
  107. package/es/components/SheetOverlay/index.css +939 -0
  108. package/{dist/packages/react/src → es}/components/SheetOverlay/index.d.ts +4 -4
  109. package/es/components/SheetOverlay/index.js +578 -0
  110. package/{dist/packages/react/src → es}/components/SheetTab/SheetItem.d.ts +8 -8
  111. package/es/components/SheetTab/SheetItem.js +228 -0
  112. package/es/components/SheetTab/index.css +280 -0
  113. package/{dist/packages/react/src → es}/components/SheetTab/index.d.ts +4 -4
  114. package/es/components/SheetTab/index.js +143 -0
  115. package/es/components/SplitColumn/index.css +121 -0
  116. package/{dist/packages/react/src → es}/components/SplitColumn/index.d.ts +3 -3
  117. package/es/components/SplitColumn/index.js +167 -0
  118. package/{dist/packages/react/src → es}/components/Toolbar/Button.d.ts +12 -12
  119. package/es/components/Toolbar/Button.js +32 -0
  120. package/{dist/packages/react/src → es}/components/Toolbar/ColorPicker.d.ts +6 -6
  121. package/es/components/Toolbar/ColorPicker.js +27 -0
  122. package/{dist/packages/react/src → es}/components/Toolbar/Combo.d.ts +12 -12
  123. package/es/components/Toolbar/Combo.js +102 -0
  124. package/{dist/packages/react/src → es}/components/Toolbar/CustomBorder.d.ts +7 -7
  125. package/es/components/Toolbar/CustomBorder.js +211 -0
  126. package/{dist/packages/react/src → es}/components/Toolbar/CustomButton.d.ts +11 -11
  127. package/es/components/Toolbar/CustomButton.js +29 -0
  128. package/{dist/packages/react/src → es}/components/Toolbar/CustomColor.d.ts +8 -8
  129. package/es/components/Toolbar/CustomColor.js +25 -0
  130. package/{dist/packages/react/src → es}/components/Toolbar/CustomIcon.d.ts +9 -9
  131. package/es/components/Toolbar/CustomIcon.js +38 -0
  132. package/{dist/packages/react/src → es}/components/Toolbar/Divider.d.ts +4 -4
  133. package/es/components/Toolbar/Divider.js +12 -0
  134. package/{dist/packages/react/src → es}/components/Toolbar/MoreItemsContainer.d.ts +6 -6
  135. package/es/components/Toolbar/MoreItemsContainer.js +17 -0
  136. package/{dist/packages/react/src → es}/components/Toolbar/Select.d.ts +14 -14
  137. package/es/components/Toolbar/Select.js +34 -0
  138. package/es/components/Toolbar/index.css +405 -0
  139. package/es/components/Toolbar/index.d.ts +10 -0
  140. package/es/components/Toolbar/index.js +1338 -0
  141. package/{dist/packages/react/src → es}/components/Workbook/api.d.ts +1177 -1177
  142. package/es/components/Workbook/api.js +395 -0
  143. package/es/components/Workbook/index.css +44 -0
  144. package/{dist/packages/react/src → es}/components/Workbook/index.d.ts +1185 -1185
  145. package/es/components/Workbook/index.js +586 -0
  146. package/es/components/ZoomControl/index.css +54 -0
  147. package/{dist/packages/react/src → es}/components/ZoomControl/index.d.ts +4 -4
  148. package/es/components/ZoomControl/index.js +111 -0
  149. package/{dist/packages/react/src → es}/components/index.d.ts +4 -4
  150. package/es/components/index.js +3 -0
  151. package/{dist/packages/react/src → es}/constants.d.ts +1 -1
  152. package/es/constants.js +4 -0
  153. package/{dist/packages/react/src → es}/context/index.d.ts +25 -25
  154. package/es/context/index.js +34 -0
  155. package/{dist/packages/react/src → es}/context/modal.d.ts +10 -10
  156. package/es/context/modal.js +43 -0
  157. package/{dist/packages/react/src → es}/hooks/useAlert.d.ts +4 -4
  158. package/es/hooks/useAlert.js +28 -0
  159. package/{dist/packages/react/src → es}/hooks/useDialog.d.ts +5 -5
  160. package/es/hooks/useDialog.js +28 -0
  161. package/{dist/packages/react/src → es}/hooks/useOutsideClick.d.ts +2 -2
  162. package/es/hooks/useOutsideClick.js +15 -0
  163. package/{dist/packages/react/src → es}/hooks/usePrevious.d.ts +2 -2
  164. package/es/hooks/usePrevious.js +9 -0
  165. package/{dist/packages/react/src → es}/index.d.ts +1 -1
  166. package/es/index.js +1 -0
  167. package/{dist/packages/react/src → es}/utils/datepickerStyles.d.ts +2 -2
  168. package/es/utils/datepickerStyles.js +8 -0
  169. package/lib/components/ChangeColor/index.css +76 -0
  170. package/lib/components/ChangeColor/index.d.ts +7 -0
  171. package/lib/components/ChangeColor/index.js +50 -0
  172. package/lib/components/ConditionFormat/ConditionRules.d.ts +6 -0
  173. package/lib/components/ConditionFormat/ConditionRules.js +332 -0
  174. package/lib/components/ConditionFormat/index.css +210 -0
  175. package/lib/components/ConditionFormat/index.d.ts +7 -0
  176. package/lib/components/ConditionFormat/index.js +261 -0
  177. package/lib/components/ContextMenu/Divider.d.ts +3 -0
  178. package/lib/components/ContextMenu/Divider.js +14 -0
  179. package/lib/components/ContextMenu/FilterMenu.d.ts +3 -0
  180. package/lib/components/ContextMenu/FilterMenu.js +621 -0
  181. package/lib/components/ContextMenu/Menu.d.ts +8 -0
  182. package/lib/components/ContextMenu/Menu.js +33 -0
  183. package/lib/components/ContextMenu/SheetTab.d.ts +4 -0
  184. package/lib/components/ContextMenu/SheetTab.js +232 -0
  185. package/lib/components/ContextMenu/index.css +322 -0
  186. package/lib/components/ContextMenu/index.d.ts +5 -0
  187. package/lib/components/ContextMenu/index.js +1063 -0
  188. package/lib/components/CustomSort/index.css +23 -0
  189. package/lib/components/CustomSort/index.d.ts +4 -0
  190. package/lib/components/CustomSort/index.js +122 -0
  191. package/lib/components/DataVerification/DropdownList.d.ts +4 -0
  192. package/lib/components/DataVerification/DropdownList.js +135 -0
  193. package/lib/components/DataVerification/RangeDialog.d.ts +4 -0
  194. package/lib/components/DataVerification/RangeDialog.js +114 -0
  195. package/lib/components/DataVerification/getDisplayedRangeTxt.d.ts +2 -0
  196. package/lib/components/DataVerification/getDisplayedRangeTxt.js +15 -0
  197. package/lib/components/DataVerification/index.css +202 -0
  198. package/lib/components/DataVerification/index.d.ts +4 -0
  199. package/lib/components/DataVerification/index.js +407 -0
  200. package/lib/components/Dialog/index.css +64 -0
  201. package/lib/components/Dialog/index.d.ts +15 -0
  202. package/lib/components/Dialog/index.js +69 -0
  203. package/lib/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +11 -0
  204. package/lib/components/DuneChartsInputModal/DuneChartsInputModal.js +104 -0
  205. package/lib/components/DuneChartsInputModal/duneChartsInputModal.css +98 -0
  206. package/lib/components/DunePreview/DunePreview.d.ts +13 -0
  207. package/lib/components/DunePreview/DunePreview.js +53 -0
  208. package/lib/components/DunePreview/index.css +57 -0
  209. package/lib/components/FilterOption/index.d.ts +5 -0
  210. package/lib/components/FilterOption/index.js +130 -0
  211. package/lib/components/FormatSearch/index.css +19 -0
  212. package/lib/components/FormatSearch/index.d.ts +6 -0
  213. package/lib/components/FormatSearch/index.js +138 -0
  214. package/lib/components/FormulaSearch/index.css +65 -0
  215. package/lib/components/FormulaSearch/index.d.ts +5 -0
  216. package/lib/components/FormulaSearch/index.js +207 -0
  217. package/lib/components/FxEditor/NameBox.d.ts +3 -0
  218. package/lib/components/FxEditor/NameBox.js +38 -0
  219. package/lib/components/FxEditor/index.css +72 -0
  220. package/lib/components/FxEditor/index.d.ts +4 -0
  221. package/lib/components/FxEditor/index.js +176 -0
  222. package/lib/components/IFrameBoxs/iFrameBoxs.css +16 -0
  223. package/lib/components/IFrameBoxs/iFrameBoxs.d.ts +4 -0
  224. package/lib/components/IFrameBoxs/iFrameBoxs.js +151 -0
  225. package/lib/components/ImgBoxs/index.d.ts +3 -0
  226. package/lib/components/ImgBoxs/index.js +228 -0
  227. package/lib/components/LinkEidtCard/index.css +255 -0
  228. package/lib/components/LinkEidtCard/index.d.ts +5 -0
  229. package/lib/components/LinkEidtCard/index.js +247 -0
  230. package/lib/components/LocationCondition/index.css +74 -0
  231. package/lib/components/LocationCondition/index.d.ts +3 -0
  232. package/lib/components/LocationCondition/index.js +204 -0
  233. package/lib/components/MessageBox/index.d.ts +9 -0
  234. package/lib/components/MessageBox/index.js +23 -0
  235. package/lib/components/NotationBoxes/index.d.ts +3 -0
  236. package/lib/components/NotationBoxes/index.js +114 -0
  237. package/lib/components/ResetColumnWidth/index.d.ts +2 -0
  238. package/lib/components/ResetColumnWidth/index.js +138 -0
  239. package/lib/components/SVGDefines.d.ts +5 -0
  240. package/lib/components/SVGDefines.js +1909 -0
  241. package/lib/components/SVGIcon.d.ts +9 -0
  242. package/lib/components/SVGIcon.js +25 -0
  243. package/lib/components/SearchReplace/index.css +191 -0
  244. package/lib/components/SearchReplace/index.d.ts +6 -0
  245. package/lib/components/SearchReplace/index.js +303 -0
  246. package/lib/components/Sheet/index.css +27 -0
  247. package/lib/components/Sheet/index.d.ts +8 -0
  248. package/lib/components/Sheet/index.js +182 -0
  249. package/lib/components/SheetList/SheetHiddenButton.d.ts +8 -0
  250. package/lib/components/SheetList/SheetHiddenButton.js +44 -0
  251. package/lib/components/SheetList/SheetListItem.d.ts +9 -0
  252. package/lib/components/SheetList/SheetListItem.js +81 -0
  253. package/lib/components/SheetList/index.css +48 -0
  254. package/lib/components/SheetList/index.d.ts +4 -0
  255. package/lib/components/SheetList/index.js +39 -0
  256. package/lib/components/SheetOverlay/ColumnHeader.d.ts +3 -0
  257. package/lib/components/SheetOverlay/ColumnHeader.js +226 -0
  258. package/lib/components/SheetOverlay/ContentEditable.d.ts +11 -0
  259. package/lib/components/SheetOverlay/ContentEditable.js +83 -0
  260. package/lib/components/SheetOverlay/FormulaHint/index.css +180 -0
  261. package/lib/components/SheetOverlay/FormulaHint/index.d.ts +4 -0
  262. package/lib/components/SheetOverlay/FormulaHint/index.js +357 -0
  263. package/lib/components/SheetOverlay/FormulaSearch/constant.d.ts +63 -0
  264. package/lib/components/SheetOverlay/FormulaSearch/constant.js +334 -0
  265. package/lib/components/SheetOverlay/FormulaSearch/index.css +42 -0
  266. package/lib/components/SheetOverlay/FormulaSearch/index.d.ts +4 -0
  267. package/lib/components/SheetOverlay/FormulaSearch/index.js +270 -0
  268. package/lib/components/SheetOverlay/InputBox.d.ts +3 -0
  269. package/lib/components/SheetOverlay/InputBox.js +314 -0
  270. package/lib/components/SheetOverlay/RowHeader.d.ts +3 -0
  271. package/lib/components/SheetOverlay/RowHeader.js +196 -0
  272. package/lib/components/SheetOverlay/ScrollBar/index.css +40 -0
  273. package/lib/components/SheetOverlay/ScrollBar/index.d.ts +7 -0
  274. package/lib/components/SheetOverlay/ScrollBar/index.js +56 -0
  275. package/lib/components/SheetOverlay/index.css +939 -0
  276. package/lib/components/SheetOverlay/index.d.ts +4 -0
  277. package/lib/components/SheetOverlay/index.js +587 -0
  278. package/lib/components/SheetTab/SheetItem.d.ts +8 -0
  279. package/lib/components/SheetTab/SheetItem.js +237 -0
  280. package/lib/components/SheetTab/index.css +280 -0
  281. package/lib/components/SheetTab/index.d.ts +4 -0
  282. package/lib/components/SheetTab/index.js +152 -0
  283. package/lib/components/SplitColumn/index.css +121 -0
  284. package/lib/components/SplitColumn/index.d.ts +3 -0
  285. package/lib/components/SplitColumn/index.js +176 -0
  286. package/lib/components/Toolbar/Button.d.ts +12 -0
  287. package/lib/components/Toolbar/Button.js +39 -0
  288. package/lib/components/Toolbar/ColorPicker.d.ts +6 -0
  289. package/lib/components/Toolbar/ColorPicker.js +34 -0
  290. package/lib/components/Toolbar/Combo.d.ts +12 -0
  291. package/lib/components/Toolbar/Combo.js +111 -0
  292. package/lib/components/Toolbar/CustomBorder.d.ts +7 -0
  293. package/lib/components/Toolbar/CustomBorder.js +220 -0
  294. package/lib/components/Toolbar/CustomButton.d.ts +11 -0
  295. package/lib/components/Toolbar/CustomButton.js +36 -0
  296. package/lib/components/Toolbar/CustomColor.d.ts +8 -0
  297. package/lib/components/Toolbar/CustomColor.js +32 -0
  298. package/lib/components/Toolbar/CustomIcon.d.ts +9 -0
  299. package/lib/components/Toolbar/CustomIcon.js +46 -0
  300. package/lib/components/Toolbar/Divider.d.ts +4 -0
  301. package/lib/components/Toolbar/Divider.js +19 -0
  302. package/lib/components/Toolbar/MoreItemsContainer.d.ts +6 -0
  303. package/lib/components/Toolbar/MoreItemsContainer.js +25 -0
  304. package/lib/components/Toolbar/Select.d.ts +14 -0
  305. package/lib/components/Toolbar/Select.js +40 -0
  306. package/lib/components/Toolbar/index.css +405 -0
  307. package/lib/components/Toolbar/index.d.ts +10 -0
  308. package/lib/components/Toolbar/index.js +1347 -0
  309. package/lib/components/Workbook/api.d.ts +1177 -0
  310. package/lib/components/Workbook/api.js +402 -0
  311. package/lib/components/Workbook/index.css +44 -0
  312. package/{dist/stories/API.stories.d.ts → lib/components/Workbook/index.d.ts} +1185 -1210
  313. package/lib/components/Workbook/index.js +595 -0
  314. package/lib/components/ZoomControl/index.css +54 -0
  315. package/lib/components/ZoomControl/index.d.ts +4 -0
  316. package/lib/components/ZoomControl/index.js +120 -0
  317. package/lib/components/index.d.ts +4 -0
  318. package/lib/components/index.js +28 -0
  319. package/lib/constants.d.ts +1 -0
  320. package/lib/constants.js +10 -0
  321. package/lib/context/index.d.ts +25 -0
  322. package/lib/context/index.js +41 -0
  323. package/lib/context/modal.d.ts +10 -0
  324. package/lib/context/modal.js +50 -0
  325. package/lib/hooks/useAlert.d.ts +4 -0
  326. package/lib/hooks/useAlert.js +37 -0
  327. package/lib/hooks/useDialog.d.ts +5 -0
  328. package/lib/hooks/useDialog.js +37 -0
  329. package/lib/hooks/useOutsideClick.d.ts +2 -0
  330. package/lib/hooks/useOutsideClick.js +21 -0
  331. package/lib/hooks/usePrevious.d.ts +2 -0
  332. package/lib/hooks/usePrevious.js +15 -0
  333. package/lib/index.d.ts +1 -0
  334. package/lib/index.js +16 -0
  335. package/lib/utils/datepickerStyles.d.ts +2 -0
  336. package/lib/utils/datepickerStyles.js +14 -0
  337. package/package.json +7 -6
  338. package/dist/index.css +0 -3915
  339. package/dist/index.esm.css +0 -3915
  340. package/dist/index.esm.js +0 -12972
  341. package/dist/index.js +0 -12992
  342. package/dist/index.umd.css +0 -3915
  343. package/dist/index.umd.js +0 -122442
  344. package/dist/index.umd.min.css +0 -1
  345. package/dist/index.umd.min.js +0 -50
  346. package/dist/packages/core/src/api/cell.d.ts +0 -10
  347. package/dist/packages/core/src/api/common.d.ts +0 -66
  348. package/dist/packages/core/src/api/errors.d.ts +0 -2
  349. package/dist/packages/core/src/api/index.d.ts +0 -9
  350. package/dist/packages/core/src/api/merge.d.ts +0 -5
  351. package/dist/packages/core/src/api/range.d.ts +0 -22
  352. package/dist/packages/core/src/api/rowcol.d.ts +0 -14
  353. package/dist/packages/core/src/api/sheet.d.ts +0 -10
  354. package/dist/packages/core/src/api/workbook.d.ts +0 -15
  355. package/dist/packages/core/src/canvas.d.ts +0 -46
  356. package/dist/packages/core/src/context.d.ts +0 -197
  357. package/dist/packages/core/src/events/copy.d.ts +0 -2
  358. package/dist/packages/core/src/events/index.d.ts +0 -4
  359. package/dist/packages/core/src/events/keyboard.d.ts +0 -6
  360. package/dist/packages/core/src/events/mouse.d.ts +0 -22
  361. package/dist/packages/core/src/events/paste.d.ts +0 -3
  362. package/dist/packages/core/src/index.d.ts +0 -10
  363. package/dist/packages/core/src/locale/en.d.ts +0 -992
  364. package/dist/packages/core/src/locale/es.d.ts +0 -1134
  365. package/dist/packages/core/src/locale/hi.d.ts +0 -1030
  366. package/dist/packages/core/src/locale/index.d.ts +0 -1049
  367. package/dist/packages/core/src/locale/zh.d.ts +0 -1048
  368. package/dist/packages/core/src/locale/zh_tw.d.ts +0 -1187
  369. package/dist/packages/core/src/modules/ConditionFormat.d.ts +0 -17
  370. package/dist/packages/core/src/modules/border.d.ts +0 -3
  371. package/dist/packages/core/src/modules/cell.d.ts +0 -32
  372. package/dist/packages/core/src/modules/clipboard.d.ts +0 -3
  373. package/dist/packages/core/src/modules/color.d.ts +0 -1
  374. package/dist/packages/core/src/modules/comment.d.ts +0 -97
  375. package/dist/packages/core/src/modules/conditionalFormat.d.ts +0 -2
  376. package/dist/packages/core/src/modules/cursor.d.ts +0 -3
  377. package/dist/packages/core/src/modules/dataVerification.d.ts +0 -11
  378. package/dist/packages/core/src/modules/dropCell.d.ts +0 -10
  379. package/dist/packages/core/src/modules/filter.d.ts +0 -45
  380. package/dist/packages/core/src/modules/format.d.ts +0 -6
  381. package/dist/packages/core/src/modules/formula.d.ts +0 -54
  382. package/dist/packages/core/src/modules/freeze.d.ts +0 -5
  383. package/dist/packages/core/src/modules/hyperlink.d.ts +0 -21
  384. package/dist/packages/core/src/modules/iframe.d.ts +0 -12
  385. package/dist/packages/core/src/modules/image.d.ts +0 -31
  386. package/dist/packages/core/src/modules/index.d.ts +0 -36
  387. package/dist/packages/core/src/modules/inline-string.d.ts +0 -36
  388. package/dist/packages/core/src/modules/location.d.ts +0 -6
  389. package/dist/packages/core/src/modules/locationCondition.d.ts +0 -21
  390. package/dist/packages/core/src/modules/merge.d.ts +0 -3
  391. package/dist/packages/core/src/modules/mobile.d.ts +0 -5
  392. package/dist/packages/core/src/modules/moveCells.d.ts +0 -5
  393. package/dist/packages/core/src/modules/protection.d.ts +0 -5
  394. package/dist/packages/core/src/modules/refresh.d.ts +0 -3
  395. package/dist/packages/core/src/modules/rowcol.d.ts +0 -19
  396. package/dist/packages/core/src/modules/screenshot.d.ts +0 -2
  397. package/dist/packages/core/src/modules/searchReplace.d.ts +0 -36
  398. package/dist/packages/core/src/modules/selection.d.ts +0 -46
  399. package/dist/packages/core/src/modules/sheet.d.ts +0 -10
  400. package/dist/packages/core/src/modules/sort.d.ts +0 -7
  401. package/dist/packages/core/src/modules/splitColumn.d.ts +0 -5
  402. package/dist/packages/core/src/modules/text.d.ts +0 -10
  403. package/dist/packages/core/src/modules/toolbar.d.ts +0 -32
  404. package/dist/packages/core/src/modules/validation.d.ts +0 -19
  405. package/dist/packages/core/src/modules/zoom.d.ts +0 -3
  406. package/dist/packages/core/src/settings.d.ts +0 -100
  407. package/dist/packages/core/src/types.d.ts +0 -371
  408. package/dist/packages/core/src/utils/freeze.d.ts +0 -7
  409. package/dist/packages/core/src/utils/index.d.ts +0 -18
  410. package/dist/packages/core/src/utils/patch.d.ts +0 -37
  411. package/dist/packages/react/src/components/Toolbar/index.d.ts +0 -10
  412. package/dist/stories/Collabration.stories.d.ts +0 -2359
  413. package/dist/stories/Features.stories.d.ts +0 -9430
  414. package/dist/stories/data/cell.d.ts +0 -983
  415. package/dist/stories/data/dataVerification.d.ts +0 -131
  416. package/dist/stories/data/empty.d.ts +0 -10
  417. package/dist/stories/data/formula.d.ts +0 -362
  418. package/dist/stories/data/freeze.d.ts +0 -34
  419. package/dist/stories/data/protected.d.ts +0 -40
  420. package/dist/stories/utils.d.ts +0 -1
@@ -0,0 +1,314 @@
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;
30
+ var _c = (0, _react.useContext)(_context.default),
31
+ context = _c.context,
32
+ setContext = _c.setContext,
33
+ refs = _c.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 _d = (0, _react.useState)(false),
39
+ isHidenRC = _d[0],
40
+ setIsHidenRC = _d[1];
41
+ var firstSelection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
42
+ var row_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.row_focus;
43
+ var col_index = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
44
+ var preText = (0, _react.useRef)("");
45
+ var inputBoxStyle = (0, _react.useMemo)(function () {
46
+ if (firstSelection && context.luckysheetCellUpdate.length > 0) {
47
+ var flowdata = (0, _fortuneCore.getFlowdata)(context);
48
+ if (!flowdata) return {};
49
+ return (0, _fortuneCore.getStyleByCell)(context, flowdata, firstSelection.row_focus, firstSelection.column_focus);
50
+ }
51
+ return {};
52
+ }, [context.luckysheetfile, context.currentSheetId, context.luckysheetCellUpdate, firstSelection]);
53
+ (0, _react.useLayoutEffect)(function () {
54
+ var _a;
55
+ if (!context.allowEdit) {
56
+ setContext(function (ctx) {
57
+ var flowdata = (0, _fortuneCore.getFlowdata)(ctx);
58
+ if (!_lodash.default.isNil(flowdata) && ctx.forceFormulaRef) {
59
+ var value = (0, _fortuneCore.getCellValue)(row_index, col_index, flowdata, "f");
60
+ (0, _fortuneCore.createRangeHightlight)(ctx, value);
61
+ }
62
+ });
63
+ }
64
+ if (firstSelection && context.luckysheetCellUpdate.length > 0) {
65
+ if (refs.globalCache.doNotUpdateCell) {
66
+ delete refs.globalCache.doNotUpdateCell;
67
+ return;
68
+ }
69
+ if (_lodash.default.isEqual(prevCellUpdate, context.luckysheetCellUpdate) && prevSheetId === context.currentSheetId) {
70
+ return;
71
+ }
72
+ var flowdata = (0, _fortuneCore.getFlowdata)(context);
73
+ var cell = (_a = flowdata === null || flowdata === void 0 ? void 0 : flowdata[row_index]) === null || _a === void 0 ? void 0 : _a[col_index];
74
+ var value_1 = "";
75
+ if (cell && !refs.globalCache.overwriteCell) {
76
+ if ((0, _fortuneCore.isInlineStringCell)(cell)) {
77
+ value_1 = (0, _fortuneCore.getInlineStringHTML)(row_index, col_index, flowdata);
78
+ } else if (cell.f) {
79
+ value_1 = (0, _fortuneCore.getCellValue)(row_index, col_index, flowdata, "f");
80
+ setContext(function (ctx) {
81
+ (0, _fortuneCore.createRangeHightlight)(ctx, value_1);
82
+ });
83
+ } else {
84
+ value_1 = (0, _fortuneCore.valueShowEs)(row_index, col_index, flowdata);
85
+ if (Number(cell.qp) === 1) {
86
+ value_1 = value_1 ? "".concat(value_1) : value_1;
87
+ }
88
+ }
89
+ }
90
+ refs.globalCache.overwriteCell = false;
91
+ if (!refs.globalCache.ignoreWriteCell) inputRef.current.innerHTML = (0, _fortuneCore.escapeHTMLTag)((0, _fortuneCore.escapeScriptTag)(value_1));
92
+ refs.globalCache.ignoreWriteCell = false;
93
+ if (!refs.globalCache.doNotFocus) {
94
+ setTimeout(function () {
95
+ (0, _fortuneCore.moveToEnd)(inputRef.current);
96
+ });
97
+ }
98
+ delete refs.globalCache.doNotFocus;
99
+ }
100
+ }, [context.luckysheetCellUpdate, context.luckysheetfile, context.currentSheetId, firstSelection]);
101
+ (0, _react.useEffect)(function () {
102
+ if (_lodash.default.isEmpty(context.luckysheetCellUpdate)) {
103
+ if (inputRef.current) {
104
+ inputRef.current.innerHTML = "";
105
+ }
106
+ }
107
+ }, [context.luckysheetCellUpdate]);
108
+ (0, _react.useEffect)(function () {
109
+ setIsHidenRC((0, _fortuneCore.isShowHidenCR)(context));
110
+ }, [context.luckysheet_select_save]);
111
+ var getActiveFormula = (0, _react.useCallback)(function () {
112
+ return document.querySelector(".luckysheet-formula-search-item-active");
113
+ }, []);
114
+ var insertSelectedFormula = (0, _react.useCallback)(function (formulaName) {
115
+ var _a;
116
+ var textEditor = document.getElementById("luckysheet-rich-text-editor");
117
+ if (!textEditor) return;
118
+ textEditor.focus();
119
+ var selection = window.getSelection();
120
+ var range = (selection === null || selection === void 0 ? void 0 : selection.rangeCount) ? selection.getRangeAt(0) : null;
121
+ if (!selection || !range || !textEditor.contains(range.startContainer)) {
122
+ range = document.createRange();
123
+ range.selectNodeContents(textEditor);
124
+ range.collapse(false);
125
+ selection = window.getSelection();
126
+ selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
127
+ selection === null || selection === void 0 ? void 0 : selection.addRange(range);
128
+ }
129
+ var searchTxt = ((_a = (0, _fortuneCore.getrangeseleciton)()) === null || _a === void 0 ? void 0 : _a.textContent) || "";
130
+ var deleteCount = searchTxt === "=" ? 0 : searchTxt.length;
131
+ if (deleteCount > 0 && range.startContainer.nodeType === Node.TEXT_NODE && textEditor.contains(range.startContainer)) {
132
+ var startOffset = Math.max(range.startOffset - deleteCount, 0);
133
+ var endOffset = range.startOffset;
134
+ range.setStart(range.startContainer, startOffset);
135
+ range.setEnd(range.startContainer, endOffset);
136
+ range.deleteContents();
137
+ }
138
+ textEditor.querySelectorAll(".luckysheet-formula-text-func, .luckysheet-formula-text-lpar").forEach(function (el) {
139
+ return el.remove();
140
+ });
141
+ var funcNode = new DOMParser().parseFromString("<span dir=\"auto\" class=\"luckysheet-formula-text-func\">".concat(formulaName, "</span>"), "text/html").body.firstChild;
142
+ var parNode = new DOMParser().parseFromString("<span dir=\"auto\" class=\"luckysheet-formula-text-lpar\">(</span>", "text/html").body.firstChild;
143
+ if (range && parNode && funcNode) {
144
+ range.insertNode(funcNode);
145
+ range.collapse(false);
146
+ range.insertNode(parNode);
147
+ range.collapse(false);
148
+ selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
149
+ selection === null || selection === void 0 ? void 0 : selection.addRange(range);
150
+ }
151
+ setContext(function (draftCtx) {
152
+ draftCtx.functionCandidates = [];
153
+ draftCtx.defaultCandidates = [];
154
+ draftCtx.functionHint = formulaName;
155
+ });
156
+ }, [setContext]);
157
+ var clearSearchItemActiveClass = (0, _react.useCallback)(function () {
158
+ var activeFormula = getActiveFormula();
159
+ if (activeFormula) {
160
+ activeFormula.classList.remove("luckysheet-formula-search-item-active");
161
+ }
162
+ }, [getActiveFormula]);
163
+ var selectActiveFormula = (0, _react.useCallback)(function (e) {
164
+ var _a, _b;
165
+ 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;
166
+ if (formulaName) {
167
+ insertSelectedFormula(formulaName);
168
+ e.preventDefault();
169
+ e.stopPropagation();
170
+ }
171
+ }, [getActiveFormula, insertSelectedFormula]);
172
+ var selectActiveFormulaOnClick = (0, _react.useCallback)(function (e) {
173
+ var _a, _b;
174
+ if (e.target.className.includes("sign-fortune")) return;
175
+ preText.current = inputRef.current.innerText;
176
+ 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;
177
+ if (formulaName) {
178
+ insertSelectedFormula(formulaName);
179
+ e.preventDefault();
180
+ e.stopPropagation();
181
+ }
182
+ }, [getActiveFormula, insertSelectedFormula]);
183
+ var onKeyDown = (0, _react.useCallback)(function (e) {
184
+ lastKeyDownEventRef.current = new KeyboardEvent(e.type, e.nativeEvent);
185
+ preText.current = inputRef.current.innerText;
186
+ if (e.key === "Escape" && context.luckysheetCellUpdate.length > 0) {
187
+ setContext(function (draftCtx) {
188
+ (0, _fortuneCore.cancelNormalSelected)(draftCtx);
189
+ (0, _fortuneCore.moveHighlightCell)(draftCtx, "down", 0, "rangeOfSelect");
190
+ });
191
+ e.preventDefault();
192
+ } else if (e.key === "Enter" && context.luckysheetCellUpdate.length > 0) {
193
+ if (e.altKey || e.metaKey) {
194
+ document.execCommand("insertHTML", false, "\n ");
195
+ document.execCommand("delete", false);
196
+ e.stopPropagation();
197
+ } else selectActiveFormula(e);
198
+ } else if (e.key === "Tab" && context.luckysheetCellUpdate.length > 0) {
199
+ selectActiveFormula(e);
200
+ e.preventDefault();
201
+ } else if (e.key === "F4" && context.luckysheetCellUpdate.length > 0) {
202
+ e.preventDefault();
203
+ } else if (e.key === "ArrowUp" && context.luckysheetCellUpdate.length > 0) {
204
+ if (document.getElementById("luckysheet-formula-search-c")) {
205
+ var formulaSearchContainer = document.getElementById("luckysheet-formula-search-c");
206
+ var activeItem = formulaSearchContainer === null || formulaSearchContainer === void 0 ? void 0 : formulaSearchContainer.querySelector(".luckysheet-formula-search-item-active");
207
+ var previousItem = activeItem ? activeItem.previousElementSibling : null;
208
+ if (!previousItem) {
209
+ previousItem = (formulaSearchContainer === null || formulaSearchContainer === void 0 ? void 0 : formulaSearchContainer.querySelector(".luckysheet-formula-search-item:last-child")) || null;
210
+ }
211
+ clearSearchItemActiveClass();
212
+ if (previousItem) {
213
+ previousItem.classList.add("luckysheet-formula-search-item-active");
214
+ }
215
+ }
216
+ e.preventDefault();
217
+ } else if (e.key === "ArrowDown" && context.luckysheetCellUpdate.length > 0) {
218
+ if (document.getElementById("luckysheet-formula-search-c")) {
219
+ var formulaSearchContainer = document.getElementById("luckysheet-formula-search-c");
220
+ var activeItem = formulaSearchContainer === null || formulaSearchContainer === void 0 ? void 0 : formulaSearchContainer.querySelector(".luckysheet-formula-search-item-active");
221
+ var nextItem = activeItem ? activeItem.nextElementSibling : null;
222
+ if (!nextItem) {
223
+ nextItem = (formulaSearchContainer === null || formulaSearchContainer === void 0 ? void 0 : formulaSearchContainer.querySelector(".luckysheet-formula-search-item:first-child")) || null;
224
+ }
225
+ clearSearchItemActiveClass();
226
+ if (nextItem) {
227
+ nextItem.classList.add("luckysheet-formula-search-item-active");
228
+ }
229
+ }
230
+ e.preventDefault();
231
+ }
232
+ }, [clearSearchItemActiveClass, context.luckysheetCellUpdate.length, selectActiveFormula, setContext, firstSelection]);
233
+ var onChange = (0, _react.useCallback)(function (__, isBlur) {
234
+ var e = lastKeyDownEventRef.current;
235
+ if (!e) return;
236
+ var kcode = e.keyCode;
237
+ if (!kcode) return;
238
+ 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) {
239
+ setContext(function (draftCtx) {
240
+ if ((draftCtx.formulaCache.rangestart || draftCtx.formulaCache.rangedrag_column_start || draftCtx.formulaCache.rangedrag_row_start || (0, _fortuneCore.israngeseleciton)(draftCtx)) && isBlur) return;
241
+ if (!(0, _fortuneCore.isAllowEdit)(draftCtx, draftCtx.luckysheet_select_save)) {
242
+ return;
243
+ }
244
+ (0, _fortuneCore.handleFormulaInput)(draftCtx, refs.fxInput.current, refs.cellInput.current, kcode, preText.current);
245
+ });
246
+ }
247
+ }, [refs.cellInput, refs.fxInput, setContext]);
248
+ var onPaste = (0, _react.useCallback)(function (e) {
249
+ if (_lodash.default.isEmpty(context.luckysheetCellUpdate)) {
250
+ e.preventDefault();
251
+ }
252
+ }, [context.luckysheetCellUpdate]);
253
+ var cfg = context.config || {};
254
+ var rowReadOnly = cfg.rowReadOnly || {};
255
+ var colReadOnly = cfg.colReadOnly || {};
256
+ var edit = !((colReadOnly[col_index] || rowReadOnly[row_index]) && context.allowEdit === true);
257
+ return /*#__PURE__*/_react.default.createElement("div", {
258
+ className: "luckysheet-input-box",
259
+ style: firstSelection && !((_b = context.rangeDialog) === null || _b === void 0 ? void 0 : _b.show) ? {
260
+ left: firstSelection.left,
261
+ top: firstSelection.top,
262
+ zIndex: _lodash.default.isEmpty(context.luckysheetCellUpdate) ? -1 : 19,
263
+ display: "block"
264
+ } : {
265
+ left: -10000,
266
+ top: -10000,
267
+ display: "block"
268
+ },
269
+ onMouseDown: function onMouseDown(e) {
270
+ return e.stopPropagation();
271
+ },
272
+ onMouseUp: function onMouseUp(e) {
273
+ return e.stopPropagation();
274
+ }
275
+ }, /*#__PURE__*/_react.default.createElement("div", {
276
+ className: "luckysheet-input-box-inner",
277
+ style: firstSelection ? __assign({
278
+ minWidth: firstSelection.width,
279
+ minHeight: firstSelection.height
280
+ }, inputBoxStyle) : {}
281
+ }, /*#__PURE__*/_react.default.createElement(_ContentEditable.default, {
282
+ innerRef: function innerRef(e) {
283
+ inputRef.current = e;
284
+ refs.cellInput.current = e;
285
+ },
286
+ className: "luckysheet-cell-input",
287
+ id: "luckysheet-rich-text-editor",
288
+ style: {
289
+ transform: "scale(".concat(context.zoomRatio, ")"),
290
+ transformOrigin: "left top",
291
+ width: "".concat(100 / context.zoomRatio, "%"),
292
+ height: "".concat(100 / context.zoomRatio, "%")
293
+ },
294
+ "aria-autocomplete": "list",
295
+ onChange: onChange,
296
+ onKeyDown: onKeyDown,
297
+ onPaste: onPaste,
298
+ allowEdit: edit ? !isHidenRC : edit
299
+ })), (context.functionCandidates.length > 0 || context.functionHint || context.defaultCandidates.length > 0) && (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_FormulaSearch.default, {
300
+ onMouseMove: function onMouseMove(e) {
301
+ if (document.getElementById("luckysheet-formula-search-c")) {
302
+ var hoveredItem = e.target.closest(".luckysheet-formula-search-item");
303
+ if (!hoveredItem) return;
304
+ clearSearchItemActiveClass();
305
+ hoveredItem.classList.add("luckysheet-formula-search-item-active");
306
+ }
307
+ e.preventDefault();
308
+ },
309
+ onMouseDown: function onMouseDown(e) {
310
+ selectActiveFormulaOnClick(e);
311
+ }
312
+ }), /*#__PURE__*/_react.default.createElement(_FormulaHint.default, null))));
313
+ };
314
+ var _default = exports.default = InputBox;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const RowHeader: React.FC;
3
+ export default RowHeader;
@@ -0,0 +1,196 @@
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 _lodash = _interopRequireDefault(require("lodash"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
+ var _context = _interopRequireDefault(require("../../context"));
12
+ 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); }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ var RowHeader = function RowHeader() {
15
+ var _a;
16
+ var _b = (0, _react.useContext)(_context.default),
17
+ context = _b.context,
18
+ setContext = _b.setContext,
19
+ settings = _b.settings,
20
+ refs = _b.refs;
21
+ var rowChangeSizeRef = (0, _react.useRef)(null);
22
+ var containerRef = (0, _react.useRef)(null);
23
+ var _c = (0, _react.useState)({
24
+ row: -1,
25
+ row_pre: -1,
26
+ row_index: -1
27
+ }),
28
+ hoverLocation = _c[0],
29
+ setHoverLocation = _c[1];
30
+ var _d = (0, _react.useState)(false),
31
+ hoverInFreeze = _d[0],
32
+ setHoverInFreeze = _d[1];
33
+ var _e = (0, _react.useState)([]),
34
+ selectedLocation = _e[0],
35
+ setSelectedLocation = _e[1];
36
+ var sheetIndex = (0, _fortuneCore.getSheetIndex)(context, context.currentSheetId);
37
+ var sheet = sheetIndex == null ? null : context.luckysheetfile[sheetIndex];
38
+ var freezeHandleTop = (0, _react.useMemo)(function () {
39
+ var _a, _b, _c, _d, _e, _f;
40
+ if (((_a = sheet === null || sheet === void 0 ? void 0 : sheet.frozen) === null || _a === void 0 ? void 0 : _a.type) === "row" || ((_b = sheet === null || sheet === void 0 ? void 0 : sheet.frozen) === null || _b === void 0 ? void 0 : _b.type) === "rangeRow" || ((_c = sheet === null || sheet === void 0 ? void 0 : sheet.frozen) === null || _c === void 0 ? void 0 : _c.type) === "rangeBoth" || ((_d = sheet === null || sheet === void 0 ? void 0 : sheet.frozen) === null || _d === void 0 ? void 0 : _d.type) === "both") {
41
+ return (0, _fortuneCore.rowLocationByIndex)(((_f = (_e = sheet === null || sheet === void 0 ? void 0 : sheet.frozen) === null || _e === void 0 ? void 0 : _e.range) === null || _f === void 0 ? void 0 : _f.row_focus) || 0, context.visibledatarow)[1] + context.scrollTop;
42
+ }
43
+ return context.scrollTop;
44
+ }, [context.visibledatarow, sheet === null || sheet === void 0 ? void 0 : sheet.frozen, context.scrollTop]);
45
+ var onMouseMove = (0, _react.useCallback)(function (e) {
46
+ var _a;
47
+ if (context.luckysheet_rows_change_size) {
48
+ return;
49
+ }
50
+ var mouseY = e.pageY - containerRef.current.getBoundingClientRect().top - window.scrollY;
51
+ var _y = mouseY + containerRef.current.scrollTop;
52
+ var freeze = (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[context.currentSheetId];
53
+ var _b = (0, _fortuneCore.fixPositionOnFrozenCells)(freeze, 0, _y, 0, mouseY),
54
+ y = _b.y,
55
+ inHorizontalFreeze = _b.inHorizontalFreeze;
56
+ var row_location = (0, _fortuneCore.rowLocation)(y, context.visibledatarow);
57
+ var row_pre = row_location[0],
58
+ row = row_location[1],
59
+ row_index = row_location[2];
60
+ if (row_pre !== hoverLocation.row_pre || row !== hoverLocation.row) {
61
+ setHoverLocation({
62
+ row_pre: row_pre,
63
+ row: row,
64
+ row_index: row_index
65
+ });
66
+ setHoverInFreeze(inHorizontalFreeze);
67
+ }
68
+ }, [context.luckysheet_rows_change_size, context.visibledatarow, hoverLocation.row, hoverLocation.row_pre, refs.globalCache.freezen, context.currentSheetId]);
69
+ var onMouseDown = (0, _react.useCallback)(function (e) {
70
+ var nativeEvent = e.nativeEvent;
71
+ setContext(function (draftCtx) {
72
+ (0, _fortuneCore.handleRowHeaderMouseDown)(draftCtx, refs.globalCache, nativeEvent, containerRef.current, refs.cellInput.current, refs.fxInput.current);
73
+ });
74
+ }, [refs.globalCache, refs.cellInput, refs.fxInput, setContext]);
75
+ var onMouseLeave = (0, _react.useCallback)(function () {
76
+ if (context.luckysheet_rows_change_size) {
77
+ return;
78
+ }
79
+ setHoverLocation({
80
+ row: -1,
81
+ row_pre: -1,
82
+ row_index: -1
83
+ });
84
+ }, [context.luckysheet_rows_change_size]);
85
+ var onRowSizeHandleMouseDown = (0, _react.useCallback)(function (e) {
86
+ var nativeEvent = e.nativeEvent;
87
+ setContext(function (draftCtx) {
88
+ (0, _fortuneCore.handleRowSizeHandleMouseDown)(draftCtx, refs.globalCache, nativeEvent, containerRef.current, refs.workbookContainer.current, refs.cellArea.current);
89
+ });
90
+ e.stopPropagation();
91
+ }, [refs.cellArea, refs.globalCache, refs.workbookContainer, setContext]);
92
+ var onRowFreezeHandleMouseDown = (0, _react.useCallback)(function (e) {
93
+ var nativeEvent = e.nativeEvent;
94
+ setContext(function (draftCtx) {
95
+ (0, _fortuneCore.handleRowFreezeHandleMouseDown)(draftCtx, refs.globalCache, nativeEvent, containerRef.current, refs.workbookContainer.current, refs.cellArea.current);
96
+ });
97
+ e.stopPropagation();
98
+ }, [refs.cellArea, refs.globalCache, refs.workbookContainer, setContext]);
99
+ var onContextMenu = (0, _react.useCallback)(function (e) {
100
+ var nativeEvent = e.nativeEvent;
101
+ setContext(function (draftCtx) {
102
+ (0, _fortuneCore.handleContextMenu)(draftCtx, settings, nativeEvent, refs.workbookContainer.current, refs.cellArea.current, "rowHeader");
103
+ });
104
+ }, [refs.workbookContainer, setContext, settings, refs.cellArea]);
105
+ (0, _react.useEffect)(function () {
106
+ var _a;
107
+ var s = context.luckysheet_select_save || [];
108
+ if (_lodash.default.isNil(s)) return;
109
+ setSelectedLocation([]);
110
+ if ((_a = s[0]) === null || _a === void 0 ? void 0 : _a.column_select) return;
111
+ var rowTitleMap = {};
112
+ for (var i = 0; i < s.length; i += 1) {
113
+ var r1 = s[i].row[0];
114
+ var r2 = s[i].row[1];
115
+ rowTitleMap = (0, _fortuneCore.selectTitlesMap)(rowTitleMap, r1, r2);
116
+ }
117
+ var rowTitleRange = (0, _fortuneCore.selectTitlesRange)(rowTitleMap);
118
+ var selects = [];
119
+ for (var i = 0; i < rowTitleRange.length; i += 1) {
120
+ var r1 = rowTitleRange[i][0];
121
+ var r2 = rowTitleRange[i][rowTitleRange[i].length - 1];
122
+ var row = (0, _fortuneCore.rowLocationByIndex)(r2, context.visibledatarow)[1];
123
+ var row_pre = (0, _fortuneCore.rowLocationByIndex)(r1, context.visibledatarow)[0];
124
+ if (_lodash.default.isNumber(row_pre) && _lodash.default.isNumber(row)) {
125
+ selects.push({
126
+ row: row,
127
+ row_pre: row_pre,
128
+ r1: r1,
129
+ r2: r2
130
+ });
131
+ }
132
+ }
133
+ setSelectedLocation(selects);
134
+ }, [context.luckysheet_select_save, context.visibledatarow]);
135
+ (0, _react.useEffect)(function () {
136
+ containerRef.current.scrollTop = context.scrollTop;
137
+ }, [context.scrollTop]);
138
+ return /*#__PURE__*/_react.default.createElement("div", {
139
+ ref: containerRef,
140
+ className: "fortune-row-header",
141
+ style: {
142
+ width: context.rowHeaderWidth - 1.5,
143
+ height: context.cellmainHeight
144
+ },
145
+ onMouseMove: onMouseMove,
146
+ onMouseDown: onMouseDown,
147
+ onMouseLeave: onMouseLeave,
148
+ onContextMenu: onContextMenu
149
+ }, /*#__PURE__*/_react.default.createElement("div", {
150
+ className: "fortune-rows-freeze-handle",
151
+ onMouseDown: onRowFreezeHandleMouseDown,
152
+ style: {
153
+ top: freezeHandleTop
154
+ }
155
+ }), /*#__PURE__*/_react.default.createElement("div", {
156
+ className: "fortune-rows-change-size",
157
+ ref: rowChangeSizeRef,
158
+ onMouseDown: onRowSizeHandleMouseDown,
159
+ style: {
160
+ top: hoverLocation.row - 3 + (hoverInFreeze ? context.scrollTop : 0),
161
+ opacity: context.luckysheet_rows_change_size ? 1 : 0
162
+ }
163
+ }), !context.luckysheet_rows_change_size && hoverLocation.row_index >= 0 ? (/*#__PURE__*/_react.default.createElement("div", {
164
+ className: "fortune-row-header-hover",
165
+ style: _lodash.default.assign({
166
+ top: hoverLocation.row_pre,
167
+ height: hoverLocation.row - hoverLocation.row_pre - 1,
168
+ display: "block"
169
+ }, (0, _fortuneCore.fixRowStyleOverflowInFreeze)(context, hoverLocation.row_index, hoverLocation.row_index, (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[context.currentSheetId]))
170
+ })) : null, selectedLocation.map(function (_a, i) {
171
+ var _b;
172
+ var row = _a.row,
173
+ row_pre = _a.row_pre,
174
+ r1 = _a.r1,
175
+ r2 = _a.r2;
176
+ return /*#__PURE__*/_react.default.createElement("div", {
177
+ className: "fortune-row-header-selected",
178
+ key: i,
179
+ style: _lodash.default.assign({
180
+ top: row_pre,
181
+ height: row - row_pre - 1,
182
+ display: "block",
183
+ backgroundColor: "#EFC703",
184
+ mixBlendMode: "multiply"
185
+ }, (0, _fortuneCore.fixRowStyleOverflowInFreeze)(context, r1, r2, (_b = refs.globalCache.freezen) === null || _b === void 0 ? void 0 : _b[context.currentSheetId]))
186
+ });
187
+ }), /*#__PURE__*/_react.default.createElement("div", {
188
+ style: {
189
+ height: context.rh_height,
190
+ width: 1
191
+ },
192
+ id: "luckysheetrowHeader_0",
193
+ className: "luckysheetsheetchange"
194
+ }));
195
+ };
196
+ var _default = exports.default = RowHeader;
@@ -0,0 +1,40 @@
1
+ .luckysheet-scrollbar-ltr {
2
+ position: absolute;
3
+ overflow: hidden;
4
+ z-index: 1003;
5
+ }
6
+
7
+ .luckysheet-scrollbar-ltr div {
8
+ height: 1px;
9
+ width: 1px;
10
+ }
11
+
12
+ .luckysheet-scrollbar-x {
13
+ bottom: 0px;
14
+ overflow-x: scroll;
15
+ }
16
+
17
+ .luckysheet-scrollbar-y {
18
+ right: 0px;
19
+ top: 0px;
20
+ overflow-y: scroll;
21
+ }
22
+
23
+ .luckysheet-scrollbar-ltr::-webkit-scrollbar {
24
+ background-color: transparent;
25
+ width: 8px;
26
+ height: 8px;
27
+ }
28
+
29
+ .luckysheet-scrollbar-ltr::-webkit-scrollbar-track {
30
+ background-color: transparent;
31
+ }
32
+
33
+ .luckysheet-scrollbar-ltr::-webkit-scrollbar-thumb {
34
+ background-color: #babac0;
35
+ border-radius: 16px;
36
+ }
37
+
38
+ .luckysheet-scrollbar-ltr::-webkit-scrollbar-button {
39
+ display: none;
40
+ }
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import "./index.css";
3
+ type Props = {
4
+ axis: "x" | "y";
5
+ };
6
+ declare const ScrollBar: React.FC<Props>;
7
+ export default ScrollBar;
@@ -0,0 +1,56 @@
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 _react = _interopRequireWildcard(require("react"));
9
+ var _context = _interopRequireDefault(require("../../../context"));
10
+ require("./index.css");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ 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); }
13
+ var ScrollBar = function ScrollBar(_a) {
14
+ var axis = _a.axis;
15
+ var _b = (0, _react.useContext)(_context.default),
16
+ context = _b.context,
17
+ refs = _b.refs,
18
+ setContext = _b.setContext;
19
+ (0, _react.useEffect)(function () {
20
+ if (axis === "x") {
21
+ refs.scrollbarX.current.scrollLeft = context.scrollLeft;
22
+ } else {
23
+ refs.scrollbarY.current.scrollTop = context.scrollTop;
24
+ }
25
+ }, [axis === "x" ? context.scrollLeft : context.scrollTop]);
26
+ return /*#__PURE__*/_react.default.createElement("div", {
27
+ ref: axis === "x" ? refs.scrollbarX : refs.scrollbarY,
28
+ style: axis === "x" ? {
29
+ left: context.rowHeaderWidth,
30
+ width: "calc(100% - ".concat(context.rowHeaderWidth, "px)")
31
+ } : {
32
+ height: "100%"
33
+ },
34
+ className: "luckysheet-scrollbars luckysheet-scrollbar-ltr luckysheet-scrollbar-".concat(axis),
35
+ onScroll: function onScroll() {
36
+ if (axis === "x") {
37
+ setContext(function (draftCtx) {
38
+ draftCtx.scrollLeft = refs.scrollbarX.current.scrollLeft;
39
+ });
40
+ } else {
41
+ setContext(function (draftCtx) {
42
+ draftCtx.scrollTop = refs.scrollbarY.current.scrollTop;
43
+ });
44
+ }
45
+ }
46
+ }, /*#__PURE__*/_react.default.createElement("div", {
47
+ style: axis === "x" ? {
48
+ width: context.ch_width,
49
+ height: 10
50
+ } : {
51
+ width: 10,
52
+ height: context.rh_height
53
+ }
54
+ }));
55
+ };
56
+ var _default = exports.default = ScrollBar;