@fileverse-dev/fortune-core 1.0.26 → 2.0.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.
Files changed (346) hide show
  1. package/dist/index.esm.js +80254 -0
  2. package/dist/index.js +80600 -0
  3. package/{es → dist/packages/core/src}/api/cell.d.ts +10 -10
  4. package/{lib → dist/packages/core/src}/api/common.d.ts +66 -71
  5. package/{es → dist/packages/core/src}/api/errors.d.ts +2 -2
  6. package/{es → dist/packages/core/src}/api/index.d.ts +9 -9
  7. package/{es → dist/packages/core/src}/api/merge.d.ts +5 -5
  8. package/{lib → dist/packages/core/src}/api/range.d.ts +22 -22
  9. package/{lib → dist/packages/core/src}/api/rowcol.d.ts +14 -14
  10. package/{lib → dist/packages/core/src}/api/sheet.d.ts +10 -10
  11. package/{lib → dist/packages/core/src}/api/workbook.d.ts +15 -15
  12. package/{lib → dist/packages/core/src}/canvas.d.ts +46 -46
  13. package/{es → dist/packages/core/src}/context.d.ts +197 -198
  14. package/{es → dist/packages/core/src}/events/copy.d.ts +2 -2
  15. package/{lib → dist/packages/core/src}/events/index.d.ts +4 -4
  16. package/{lib → dist/packages/core/src}/events/keyboard.d.ts +6 -6
  17. package/{es → dist/packages/core/src}/events/mouse.d.ts +22 -22
  18. package/{es → dist/packages/core/src}/events/paste.d.ts +3 -3
  19. package/{lib → dist/packages/core/src}/index.d.ts +10 -10
  20. package/{lib → dist/packages/core/src}/locale/en.d.ts +992 -992
  21. package/{lib → dist/packages/core/src}/locale/es.d.ts +1134 -1134
  22. package/{lib → dist/packages/core/src}/locale/hi.d.ts +1030 -1030
  23. package/{lib → dist/packages/core/src}/locale/index.d.ts +1049 -1049
  24. package/{es → dist/packages/core/src}/locale/zh.d.ts +1048 -1048
  25. package/{lib → dist/packages/core/src}/locale/zh_tw.d.ts +1187 -1187
  26. package/{lib → dist/packages/core/src}/modules/ConditionFormat.d.ts +17 -17
  27. package/{lib → dist/packages/core/src}/modules/border.d.ts +3 -3
  28. package/{lib → dist/packages/core/src}/modules/cell.d.ts +32 -32
  29. package/{es → dist/packages/core/src}/modules/clipboard.d.ts +3 -3
  30. package/{es → dist/packages/core/src}/modules/color.d.ts +1 -1
  31. package/{lib → dist/packages/core/src}/modules/comment.d.ts +97 -97
  32. package/{es → dist/packages/core/src}/modules/conditionalFormat.d.ts +2 -2
  33. package/{es → dist/packages/core/src}/modules/cursor.d.ts +3 -3
  34. package/{es → dist/packages/core/src}/modules/dataVerification.d.ts +11 -11
  35. package/{es → dist/packages/core/src}/modules/dropCell.d.ts +10 -10
  36. package/{lib → dist/packages/core/src}/modules/filter.d.ts +45 -45
  37. package/{es → dist/packages/core/src}/modules/format.d.ts +6 -6
  38. package/{lib → dist/packages/core/src}/modules/formula.d.ts +54 -54
  39. package/{es → dist/packages/core/src}/modules/freeze.d.ts +5 -5
  40. package/{es → dist/packages/core/src}/modules/hyperlink.d.ts +21 -21
  41. package/{lib → dist/packages/core/src}/modules/iframe.d.ts +12 -12
  42. package/{es → dist/packages/core/src}/modules/image.d.ts +31 -31
  43. package/{es → dist/packages/core/src}/modules/index.d.ts +36 -36
  44. package/{lib → dist/packages/core/src}/modules/inline-string.d.ts +36 -36
  45. package/{es → dist/packages/core/src}/modules/location.d.ts +6 -6
  46. package/{es → dist/packages/core/src}/modules/locationCondition.d.ts +21 -21
  47. package/{es → dist/packages/core/src}/modules/merge.d.ts +3 -3
  48. package/{es → dist/packages/core/src}/modules/mobile.d.ts +5 -5
  49. package/{lib → dist/packages/core/src}/modules/moveCells.d.ts +5 -5
  50. package/{lib → dist/packages/core/src}/modules/protection.d.ts +5 -5
  51. package/{lib → dist/packages/core/src}/modules/refresh.d.ts +3 -3
  52. package/{es → dist/packages/core/src}/modules/rowcol.d.ts +19 -19
  53. package/{lib → dist/packages/core/src}/modules/screenshot.d.ts +2 -2
  54. package/{es → dist/packages/core/src}/modules/searchReplace.d.ts +36 -36
  55. package/{lib → dist/packages/core/src}/modules/selection.d.ts +46 -46
  56. package/{es → dist/packages/core/src}/modules/sheet.d.ts +10 -10
  57. package/{es → dist/packages/core/src}/modules/sort.d.ts +7 -7
  58. package/{es → dist/packages/core/src}/modules/splitColumn.d.ts +5 -5
  59. package/{es → dist/packages/core/src}/modules/text.d.ts +10 -10
  60. package/{lib → dist/packages/core/src}/modules/toolbar.d.ts +32 -32
  61. package/{es → dist/packages/core/src}/modules/validation.d.ts +19 -19
  62. package/{es → dist/packages/core/src}/modules/zoom.d.ts +3 -3
  63. package/{es → dist/packages/core/src}/settings.d.ts +100 -100
  64. package/{es → dist/packages/core/src}/types.d.ts +371 -376
  65. package/{es → dist/packages/core/src}/utils/freeze.d.ts +7 -7
  66. package/{es → dist/packages/core/src}/utils/index.d.ts +18 -19
  67. package/{lib → dist/packages/core/src}/utils/patch.d.ts +37 -37
  68. package/dist/packages/react/src/components/ChangeColor/index.d.ts +7 -0
  69. package/dist/packages/react/src/components/ConditionFormat/ConditionRules.d.ts +6 -0
  70. package/dist/packages/react/src/components/ConditionFormat/index.d.ts +7 -0
  71. package/dist/packages/react/src/components/ContextMenu/Divider.d.ts +3 -0
  72. package/dist/packages/react/src/components/ContextMenu/FilterMenu.d.ts +3 -0
  73. package/dist/packages/react/src/components/ContextMenu/Menu.d.ts +8 -0
  74. package/dist/packages/react/src/components/ContextMenu/SheetTab.d.ts +4 -0
  75. package/dist/packages/react/src/components/ContextMenu/index.d.ts +5 -0
  76. package/dist/packages/react/src/components/CustomSort/index.d.ts +4 -0
  77. package/dist/packages/react/src/components/DataVerification/DropdownList.d.ts +4 -0
  78. package/dist/packages/react/src/components/DataVerification/RangeDialog.d.ts +4 -0
  79. package/dist/packages/react/src/components/DataVerification/getDisplayedRangeTxt.d.ts +2 -0
  80. package/dist/packages/react/src/components/DataVerification/index.d.ts +4 -0
  81. package/dist/packages/react/src/components/Dialog/index.d.ts +15 -0
  82. package/dist/packages/react/src/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +11 -0
  83. package/dist/packages/react/src/components/DunePreview/DunePreview.d.ts +13 -0
  84. package/dist/packages/react/src/components/FilterOption/index.d.ts +5 -0
  85. package/dist/packages/react/src/components/FormatSearch/index.d.ts +6 -0
  86. package/dist/packages/react/src/components/FormulaSearch/index.d.ts +5 -0
  87. package/dist/packages/react/src/components/FxEditor/NameBox.d.ts +3 -0
  88. package/dist/packages/react/src/components/FxEditor/index.d.ts +4 -0
  89. package/dist/packages/react/src/components/IFrameBoxs/iFrameBoxs.d.ts +4 -0
  90. package/dist/packages/react/src/components/ImgBoxs/index.d.ts +3 -0
  91. package/dist/packages/react/src/components/LinkEidtCard/index.d.ts +5 -0
  92. package/dist/packages/react/src/components/LocationCondition/index.d.ts +3 -0
  93. package/dist/packages/react/src/components/MessageBox/index.d.ts +9 -0
  94. package/dist/packages/react/src/components/NotationBoxes/index.d.ts +3 -0
  95. package/dist/packages/react/src/components/ResetColumnWidth/index.d.ts +2 -0
  96. package/dist/packages/react/src/components/SVGDefines.d.ts +5 -0
  97. package/dist/packages/react/src/components/SVGIcon.d.ts +9 -0
  98. package/dist/packages/react/src/components/SearchReplace/index.d.ts +6 -0
  99. package/dist/packages/react/src/components/Sheet/index.d.ts +8 -0
  100. package/dist/packages/react/src/components/SheetList/SheetHiddenButton.d.ts +8 -0
  101. package/dist/packages/react/src/components/SheetList/SheetListItem.d.ts +9 -0
  102. package/dist/packages/react/src/components/SheetList/index.d.ts +4 -0
  103. package/dist/packages/react/src/components/SheetOverlay/ColumnHeader.d.ts +3 -0
  104. package/dist/packages/react/src/components/SheetOverlay/ContentEditable.d.ts +11 -0
  105. package/dist/packages/react/src/components/SheetOverlay/FormulaHint/index.d.ts +4 -0
  106. package/dist/packages/react/src/components/SheetOverlay/FormulaSearch/constant.d.ts +63 -0
  107. package/dist/packages/react/src/components/SheetOverlay/FormulaSearch/index.d.ts +4 -0
  108. package/dist/packages/react/src/components/SheetOverlay/InputBox.d.ts +3 -0
  109. package/dist/packages/react/src/components/SheetOverlay/RowHeader.d.ts +3 -0
  110. package/dist/packages/react/src/components/SheetOverlay/ScrollBar/index.d.ts +7 -0
  111. package/dist/packages/react/src/components/SheetOverlay/index.d.ts +4 -0
  112. package/dist/packages/react/src/components/SheetTab/SheetItem.d.ts +8 -0
  113. package/dist/packages/react/src/components/SheetTab/index.d.ts +4 -0
  114. package/dist/packages/react/src/components/SplitColumn/index.d.ts +3 -0
  115. package/dist/packages/react/src/components/Toolbar/Button.d.ts +12 -0
  116. package/dist/packages/react/src/components/Toolbar/ColorPicker.d.ts +6 -0
  117. package/dist/packages/react/src/components/Toolbar/Combo.d.ts +12 -0
  118. package/dist/packages/react/src/components/Toolbar/CustomBorder.d.ts +7 -0
  119. package/dist/packages/react/src/components/Toolbar/CustomButton.d.ts +11 -0
  120. package/dist/packages/react/src/components/Toolbar/CustomColor.d.ts +8 -0
  121. package/dist/packages/react/src/components/Toolbar/CustomIcon.d.ts +9 -0
  122. package/dist/packages/react/src/components/Toolbar/Divider.d.ts +4 -0
  123. package/dist/packages/react/src/components/Toolbar/MoreItemsContainer.d.ts +6 -0
  124. package/dist/packages/react/src/components/Toolbar/Select.d.ts +14 -0
  125. package/dist/packages/react/src/components/Toolbar/index.d.ts +10 -0
  126. package/dist/packages/react/src/components/Workbook/api.d.ts +1177 -0
  127. package/dist/packages/react/src/components/Workbook/index.d.ts +1185 -0
  128. package/dist/packages/react/src/components/ZoomControl/index.d.ts +4 -0
  129. package/dist/packages/react/src/components/index.d.ts +4 -0
  130. package/dist/packages/react/src/constants.d.ts +1 -0
  131. package/dist/packages/react/src/context/index.d.ts +25 -0
  132. package/dist/packages/react/src/context/modal.d.ts +10 -0
  133. package/dist/packages/react/src/hooks/useAlert.d.ts +4 -0
  134. package/dist/packages/react/src/hooks/useDialog.d.ts +5 -0
  135. package/dist/packages/react/src/hooks/useOutsideClick.d.ts +2 -0
  136. package/dist/packages/react/src/hooks/usePrevious.d.ts +2 -0
  137. package/dist/packages/react/src/index.d.ts +1 -0
  138. package/dist/packages/react/src/utils/datepickerStyles.d.ts +2 -0
  139. package/dist/stories/API.stories.d.ts +1210 -0
  140. package/dist/stories/Collabration.stories.d.ts +2359 -0
  141. package/dist/stories/Features.stories.d.ts +9430 -0
  142. package/dist/stories/data/cell.d.ts +983 -0
  143. package/dist/stories/data/dataVerification.d.ts +131 -0
  144. package/dist/stories/data/empty.d.ts +10 -0
  145. package/dist/stories/data/formula.d.ts +362 -0
  146. package/dist/stories/data/freeze.d.ts +34 -0
  147. package/dist/stories/data/protected.d.ts +40 -0
  148. package/dist/stories/utils.d.ts +1 -0
  149. package/package.json +6 -7
  150. package/es/api/cell.js +0 -204
  151. package/es/api/common.d.ts +0 -71
  152. package/es/api/common.js +0 -79
  153. package/es/api/errors.js +0 -2
  154. package/es/api/index.js +0 -8
  155. package/es/api/merge.js +0 -15
  156. package/es/api/range.d.ts +0 -22
  157. package/es/api/range.js +0 -123
  158. package/es/api/rowcol.d.ts +0 -14
  159. package/es/api/rowcol.js +0 -207
  160. package/es/api/sheet.d.ts +0 -10
  161. package/es/api/sheet.js +0 -128
  162. package/es/api/workbook.d.ts +0 -15
  163. package/es/api/workbook.js +0 -85
  164. package/es/canvas.d.ts +0 -46
  165. package/es/canvas.js +0 -1350
  166. package/es/context.js +0 -381
  167. package/es/events/copy.js +0 -78
  168. package/es/events/index.d.ts +0 -4
  169. package/es/events/index.js +0 -4
  170. package/es/events/keyboard.d.ts +0 -6
  171. package/es/events/keyboard.js +0 -332
  172. package/es/events/mouse.js +0 -1725
  173. package/es/events/paste.js +0 -1378
  174. package/es/index.d.ts +0 -10
  175. package/es/index.js +0 -10
  176. package/es/locale/en.d.ts +0 -992
  177. package/es/locale/en.js +0 -10564
  178. package/es/locale/es.d.ts +0 -1134
  179. package/es/locale/es.js +0 -10010
  180. package/es/locale/hi.d.ts +0 -1030
  181. package/es/locale/hi.js +0 -10550
  182. package/es/locale/index.d.ts +0 -1049
  183. package/es/locale/index.js +0 -23
  184. package/es/locale/zh.js +0 -10568
  185. package/es/locale/zh_tw.d.ts +0 -1187
  186. package/es/locale/zh_tw.js +0 -10072
  187. package/es/modules/ConditionFormat.d.ts +0 -17
  188. package/es/modules/ConditionFormat.js +0 -1258
  189. package/es/modules/border.d.ts +0 -3
  190. package/es/modules/border.js +0 -1240
  191. package/es/modules/cell.d.ts +0 -32
  192. package/es/modules/cell.js +0 -1055
  193. package/es/modules/clipboard.js +0 -36
  194. package/es/modules/color.js +0 -1
  195. package/es/modules/comment.d.ts +0 -97
  196. package/es/modules/comment.js +0 -597
  197. package/es/modules/conditionalFormat.js +0 -441
  198. package/es/modules/cursor.js +0 -62
  199. package/es/modules/dataVerification.js +0 -701
  200. package/es/modules/dropCell.js +0 -2267
  201. package/es/modules/filter.d.ts +0 -45
  202. package/es/modules/filter.js +0 -434
  203. package/es/modules/format.js +0 -323
  204. package/es/modules/formula.d.ts +0 -54
  205. package/es/modules/formula.js +0 -2301
  206. package/es/modules/freeze.js +0 -148
  207. package/es/modules/hyperlink.js +0 -216
  208. package/es/modules/iframe.d.ts +0 -12
  209. package/es/modules/iframe.js +0 -220
  210. package/es/modules/image.js +0 -253
  211. package/es/modules/index.js +0 -36
  212. package/es/modules/inline-string.d.ts +0 -36
  213. package/es/modules/inline-string.js +0 -437
  214. package/es/modules/location.js +0 -46
  215. package/es/modules/locationCondition.js +0 -218
  216. package/es/modules/merge.js +0 -216
  217. package/es/modules/mobile.js +0 -33
  218. package/es/modules/moveCells.d.ts +0 -5
  219. package/es/modules/moveCells.js +0 -348
  220. package/es/modules/protection.d.ts +0 -5
  221. package/es/modules/protection.js +0 -96
  222. package/es/modules/refresh.d.ts +0 -3
  223. package/es/modules/refresh.js +0 -34
  224. package/es/modules/rowcol.js +0 -1922
  225. package/es/modules/screenshot.d.ts +0 -2
  226. package/es/modules/screenshot.js +0 -90
  227. package/es/modules/searchReplace.js +0 -388
  228. package/es/modules/selection.d.ts +0 -46
  229. package/es/modules/selection.js +0 -1674
  230. package/es/modules/sheet.js +0 -237
  231. package/es/modules/sort.js +0 -134
  232. package/es/modules/splitColumn.js +0 -126
  233. package/es/modules/ssf.js +0 -1533
  234. package/es/modules/text.js +0 -1207
  235. package/es/modules/toolbar.d.ts +0 -32
  236. package/es/modules/toolbar.js +0 -970
  237. package/es/modules/validation.js +0 -190
  238. package/es/modules/zoom.js +0 -29
  239. package/es/settings.js +0 -36
  240. package/es/types.js +0 -1
  241. package/es/utils/freeze.js +0 -86
  242. package/es/utils/index.js +0 -198
  243. package/es/utils/patch.d.ts +0 -37
  244. package/es/utils/patch.js +0 -381
  245. package/lib/api/cell.d.ts +0 -10
  246. package/lib/api/cell.js +0 -215
  247. package/lib/api/common.js +0 -88
  248. package/lib/api/errors.d.ts +0 -2
  249. package/lib/api/errors.js +0 -8
  250. package/lib/api/index.d.ts +0 -9
  251. package/lib/api/index.js +0 -101
  252. package/lib/api/merge.d.ts +0 -5
  253. package/lib/api/merge.js +0 -22
  254. package/lib/api/range.js +0 -138
  255. package/lib/api/rowcol.js +0 -222
  256. package/lib/api/sheet.js +0 -145
  257. package/lib/api/workbook.js +0 -98
  258. package/lib/canvas.js +0 -1356
  259. package/lib/context.d.ts +0 -198
  260. package/lib/context.js +0 -393
  261. package/lib/events/copy.d.ts +0 -2
  262. package/lib/events/copy.js +0 -85
  263. package/lib/events/index.js +0 -49
  264. package/lib/events/keyboard.js +0 -342
  265. package/lib/events/mouse.d.ts +0 -22
  266. package/lib/events/mouse.js +0 -1744
  267. package/lib/events/paste.d.ts +0 -3
  268. package/lib/events/paste.js +0 -1386
  269. package/lib/index.js +0 -109
  270. package/lib/locale/en.js +0 -10570
  271. package/lib/locale/es.js +0 -10016
  272. package/lib/locale/hi.js +0 -10556
  273. package/lib/locale/index.js +0 -29
  274. package/lib/locale/zh.d.ts +0 -1048
  275. package/lib/locale/zh.js +0 -10574
  276. package/lib/locale/zh_tw.js +0 -10078
  277. package/lib/modules/ConditionFormat.js +0 -1273
  278. package/lib/modules/border.js +0 -1248
  279. package/lib/modules/cell.js +0 -1085
  280. package/lib/modules/clipboard.d.ts +0 -3
  281. package/lib/modules/clipboard.js +0 -42
  282. package/lib/modules/color.d.ts +0 -1
  283. package/lib/modules/color.js +0 -7
  284. package/lib/modules/comment.js +0 -625
  285. package/lib/modules/conditionalFormat.d.ts +0 -2
  286. package/lib/modules/conditionalFormat.js +0 -447
  287. package/lib/modules/cursor.d.ts +0 -3
  288. package/lib/modules/cursor.js +0 -70
  289. package/lib/modules/dataVerification.d.ts +0 -11
  290. package/lib/modules/dataVerification.js +0 -716
  291. package/lib/modules/dropCell.d.ts +0 -10
  292. package/lib/modules/dropCell.js +0 -2283
  293. package/lib/modules/filter.js +0 -448
  294. package/lib/modules/format.d.ts +0 -6
  295. package/lib/modules/format.js +0 -334
  296. package/lib/modules/formula.js +0 -2330
  297. package/lib/modules/freeze.d.ts +0 -5
  298. package/lib/modules/freeze.js +0 -158
  299. package/lib/modules/hyperlink.d.ts +0 -21
  300. package/lib/modules/hyperlink.js +0 -232
  301. package/lib/modules/iframe.js +0 -236
  302. package/lib/modules/image.d.ts +0 -31
  303. package/lib/modules/image.js +0 -272
  304. package/lib/modules/index.d.ts +0 -36
  305. package/lib/modules/index.js +0 -401
  306. package/lib/modules/inline-string.js +0 -452
  307. package/lib/modules/location.d.ts +0 -6
  308. package/lib/modules/location.js +0 -57
  309. package/lib/modules/locationCondition.d.ts +0 -21
  310. package/lib/modules/locationCondition.js +0 -229
  311. package/lib/modules/merge.d.ts +0 -3
  312. package/lib/modules/merge.js +0 -223
  313. package/lib/modules/mobile.d.ts +0 -5
  314. package/lib/modules/mobile.js +0 -41
  315. package/lib/modules/moveCells.js +0 -357
  316. package/lib/modules/protection.js +0 -106
  317. package/lib/modules/refresh.js +0 -40
  318. package/lib/modules/rowcol.d.ts +0 -19
  319. package/lib/modules/rowcol.js +0 -1935
  320. package/lib/modules/screenshot.js +0 -96
  321. package/lib/modules/searchReplace.d.ts +0 -36
  322. package/lib/modules/searchReplace.js +0 -402
  323. package/lib/modules/selection.js +0 -1703
  324. package/lib/modules/sheet.d.ts +0 -10
  325. package/lib/modules/sheet.js +0 -250
  326. package/lib/modules/sort.d.ts +0 -7
  327. package/lib/modules/sort.js +0 -143
  328. package/lib/modules/splitColumn.d.ts +0 -5
  329. package/lib/modules/splitColumn.js +0 -136
  330. package/lib/modules/ssf.js +0 -1539
  331. package/lib/modules/text.d.ts +0 -10
  332. package/lib/modules/text.js +0 -1221
  333. package/lib/modules/toolbar.js +0 -1003
  334. package/lib/modules/validation.d.ts +0 -19
  335. package/lib/modules/validation.js +0 -205
  336. package/lib/modules/zoom.d.ts +0 -3
  337. package/lib/modules/zoom.js +0 -36
  338. package/lib/settings.d.ts +0 -100
  339. package/lib/settings.js +0 -42
  340. package/lib/types.d.ts +0 -376
  341. package/lib/types.js +0 -5
  342. package/lib/utils/freeze.d.ts +0 -7
  343. package/lib/utils/freeze.js +0 -92
  344. package/lib/utils/index.d.ts +0 -19
  345. package/lib/utils/index.js +0 -258
  346. package/lib/utils/patch.js +0 -392
@@ -1,272 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.cancelActiveImgItem = cancelActiveImgItem;
7
- exports.generateRandomId = generateRandomId;
8
- exports.imageProps = void 0;
9
- exports.insertImage = insertImage;
10
- exports.onImageMove = onImageMove;
11
- exports.onImageMoveEnd = onImageMoveEnd;
12
- exports.onImageMoveStart = onImageMoveStart;
13
- exports.onImageResize = onImageResize;
14
- exports.onImageResizeEnd = onImageResizeEnd;
15
- exports.onImageResizeStart = onImageResizeStart;
16
- exports.removeActiveImage = removeActiveImage;
17
- exports.saveImage = saveImage;
18
- exports.showImgChooser = showImgChooser;
19
- var _lodash = _interopRequireDefault(require("lodash"));
20
- var _2 = require(".");
21
- var _context = require("../context");
22
- var _utils = require("../utils");
23
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
24
- var imageProps = exports.imageProps = {
25
- defaultWidth: 144,
26
- defaultHeight: 84,
27
- currentObj: null,
28
- currentWinW: null,
29
- currentWinH: null,
30
- resize: null,
31
- resizeXY: null,
32
- move: false,
33
- moveXY: null,
34
- cursorStartPosition: null
35
- };
36
- function generateRandomId(prefix) {
37
- if (prefix == null) {
38
- prefix = "img";
39
- }
40
- var userAgent = window.navigator.userAgent.replace(/[^a-zA-Z0-9]/g, "").split("");
41
- var mid = "";
42
- for (var i = 0; i < 12; i += 1) {
43
- mid += userAgent[Math.round(Math.random() * (userAgent.length - 1))];
44
- }
45
- var time = new Date().getTime();
46
- return "".concat(prefix, "_").concat(mid, "_").concat(time);
47
- }
48
- function showImgChooser() {
49
- var chooser = document.getElementById("fortune-img-upload");
50
- if (chooser) chooser.click();
51
- }
52
- function saveImage(ctx) {
53
- var index = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
54
- if (index == null) return;
55
- var file = ctx.luckysheetfile[index];
56
- file.images = ctx.insertedImgs;
57
- }
58
- function removeActiveImage(ctx) {
59
- ctx.insertedImgs = _lodash.default.filter(ctx.insertedImgs, function (image) {
60
- return image.id !== ctx.activeImg;
61
- });
62
- ctx.activeImg = undefined;
63
- saveImage(ctx);
64
- }
65
- function insertImage(ctx, image) {
66
- var _a;
67
- try {
68
- var last = (_a = ctx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[ctx.luckysheet_select_save.length - 1];
69
- var rowIndex = last === null || last === void 0 ? void 0 : last.row_focus;
70
- var colIndex = last === null || last === void 0 ? void 0 : last.column_focus;
71
- if (!last) {
72
- rowIndex = 0;
73
- colIndex = 0;
74
- } else {
75
- if (rowIndex == null) {
76
- rowIndex = last.row[0];
77
- }
78
- if (colIndex == null) {
79
- colIndex = last.column[0];
80
- }
81
- }
82
- var flowdata = (0, _context.getFlowdata)(ctx);
83
- var left = colIndex === 0 ? 0 : ctx.visibledatacolumn[colIndex - 1];
84
- var top_1 = rowIndex === 0 ? 0 : ctx.visibledatarow[rowIndex - 1];
85
- if (flowdata) {
86
- var margeset = (0, _2.mergeBorder)(ctx, flowdata, rowIndex, colIndex);
87
- if (margeset) {
88
- top_1 = margeset.row[0];
89
- left = margeset.column[0];
90
- }
91
- }
92
- var width = image.width;
93
- var height = image.height;
94
- var img = {
95
- id: generateRandomId("img"),
96
- src: image.src,
97
- left: left,
98
- top: top_1,
99
- width: width * 0.5,
100
- height: height * 0.5,
101
- originWidth: width,
102
- originHeight: height
103
- };
104
- ctx.insertedImgs = (ctx.insertedImgs || []).concat(img);
105
- saveImage(ctx);
106
- } catch (err) {
107
- console.info(err);
108
- }
109
- }
110
- function getImagePosition() {
111
- var box = document.getElementById("luckysheet-modal-dialog-activeImage");
112
- if (!box) return undefined;
113
- var _a = box.getBoundingClientRect(),
114
- width = _a.width,
115
- height = _a.height;
116
- var left = box.offsetLeft;
117
- var top = box.offsetTop;
118
- return {
119
- left: left,
120
- top: top,
121
- width: width,
122
- height: height
123
- };
124
- }
125
- function cancelActiveImgItem(ctx, globalCache) {
126
- ctx.activeImg = undefined;
127
- globalCache.image = undefined;
128
- }
129
- function onImageMoveStart(ctx, globalCache, e) {
130
- var position = getImagePosition();
131
- if (position) {
132
- var top_2 = position.top,
133
- left = position.left;
134
- _lodash.default.set(globalCache, "image", {
135
- cursorMoveStartPosition: {
136
- x: e.pageX,
137
- y: e.pageY
138
- },
139
- imgInitialPosition: {
140
- left: left,
141
- top: top_2
142
- }
143
- });
144
- }
145
- }
146
- function onImageMove(ctx, globalCache, e) {
147
- if (ctx.allowEdit === false) return false;
148
- var image = globalCache === null || globalCache === void 0 ? void 0 : globalCache.image;
149
- var img = document.getElementById("luckysheet-modal-dialog-activeImage");
150
- if (img && image && !image.resizingSide) {
151
- var _a = image.cursorMoveStartPosition,
152
- startX = _a.x,
153
- startY = _a.y;
154
- var _b = image.imgInitialPosition,
155
- top_3 = _b.top,
156
- left = _b.left;
157
- left += e.pageX - startX;
158
- top_3 += e.pageY - startY;
159
- if (top_3 < 0) top_3 = 0;
160
- img.style.left = "".concat(left, "px");
161
- img.style.top = "".concat(top_3, "px");
162
- return true;
163
- }
164
- return false;
165
- }
166
- function onImageMoveEnd(ctx, globalCache) {
167
- var _a;
168
- var position = getImagePosition();
169
- if (!((_a = globalCache.image) === null || _a === void 0 ? void 0 : _a.resizingSide)) {
170
- globalCache.image = undefined;
171
- if (position) {
172
- var img = _lodash.default.find(ctx.insertedImgs, function (v) {
173
- return v.id === ctx.activeImg;
174
- });
175
- if (img) {
176
- img.left = position.left / ctx.zoomRatio;
177
- img.top = position.top / ctx.zoomRatio;
178
- saveImage(ctx);
179
- }
180
- }
181
- }
182
- }
183
- function onImageResizeStart(globalCache, e, resizingSide) {
184
- var position = getImagePosition();
185
- if (position) {
186
- _lodash.default.set(globalCache, "image", {
187
- cursorMoveStartPosition: {
188
- x: e.pageX,
189
- y: e.pageY
190
- },
191
- resizingSide: resizingSide,
192
- imgInitialPosition: position
193
- });
194
- }
195
- }
196
- function onImageResize(ctx, globalCache, e) {
197
- if (ctx.allowEdit === false) return false;
198
- var image = globalCache === null || globalCache === void 0 ? void 0 : globalCache.image;
199
- if (image === null || image === void 0 ? void 0 : image.resizingSide) {
200
- var imgContainer = document.getElementById("luckysheet-modal-dialog-activeImage");
201
- var img = imgContainer === null || imgContainer === void 0 ? void 0 : imgContainer.querySelector(".luckysheet-modal-dialog-content");
202
- if (img == null) return false;
203
- var _a = image.cursorMoveStartPosition,
204
- startX = _a.x,
205
- startY = _a.y;
206
- var _b = image.imgInitialPosition,
207
- top_4 = _b.top,
208
- left = _b.left,
209
- width = _b.width,
210
- height = _b.height;
211
- var dx = e.pageX - startX;
212
- var dy = e.pageY - startY;
213
- var minHeight = 60 * ctx.zoomRatio;
214
- var minWidth = 1.5 * 60 * ctx.zoomRatio;
215
- if (["lm", "lt", "lb"].includes(image.resizingSide)) {
216
- if (width - dx < minWidth) {
217
- left += width - minWidth;
218
- width = minWidth;
219
- } else {
220
- left += dx;
221
- width -= dx;
222
- }
223
- if (left < 0) left = 0;
224
- img.style.left = "".concat(left, "px");
225
- imgContainer.style.left = "".concat(left, "px");
226
- }
227
- if (["rm", "rt", "rb"].includes(image.resizingSide)) {
228
- width = width + dx < minWidth ? minWidth : width + dx;
229
- }
230
- if (["mt", "lt", "rt"].includes(image.resizingSide)) {
231
- if (height - dy < minHeight) {
232
- top_4 += height - minHeight;
233
- height = minHeight;
234
- } else {
235
- top_4 += dy;
236
- height -= dy;
237
- }
238
- if (top_4 < 0) top_4 = 0;
239
- img.style.top = "".concat(top_4, "px");
240
- imgContainer.style.top = "".concat(top_4, "px");
241
- }
242
- if (["mb", "lb", "rb"].includes(image.resizingSide)) {
243
- height = height + dy < minHeight ? minHeight : height + dy;
244
- }
245
- img.style.width = "".concat(width, "px");
246
- imgContainer.style.width = "".concat(width, "px");
247
- img.style.height = "".concat(height, "px");
248
- imgContainer.style.height = "".concat(height, "px");
249
- img.style.backgroundSize = "".concat(width, "px ").concat(height, "px");
250
- return true;
251
- }
252
- return false;
253
- }
254
- function onImageResizeEnd(ctx, globalCache) {
255
- var _a;
256
- if ((_a = globalCache.image) === null || _a === void 0 ? void 0 : _a.resizingSide) {
257
- globalCache.image = undefined;
258
- var position = getImagePosition();
259
- if (position) {
260
- var img = _lodash.default.find(ctx.insertedImgs, function (v) {
261
- return v.id === ctx.activeImg;
262
- });
263
- if (img) {
264
- img.left = position.left / ctx.zoomRatio;
265
- img.top = position.top / ctx.zoomRatio;
266
- img.width = position.width / ctx.zoomRatio;
267
- img.height = position.height / ctx.zoomRatio;
268
- saveImage(ctx);
269
- }
270
- }
271
- }
272
- }
@@ -1,36 +0,0 @@
1
- export * from "./border";
2
- export * from "./cell";
3
- export * from "./clipboard";
4
- export * from "./color";
5
- export * from "./cursor";
6
- export * from "./format";
7
- export * from "./formula";
8
- export * from "./freeze";
9
- export * from "./inline-string";
10
- export * from "./location";
11
- export * from "./protection";
12
- export * from "./rowcol";
13
- export * from "./selection";
14
- export * from "./sheet";
15
- export * from "./text";
16
- export * from "./toolbar";
17
- export * from "./validation";
18
- export * from "./comment";
19
- export * from "./image";
20
- export * from "./mobile";
21
- export * from "./dropCell";
22
- export * from "./merge";
23
- export * from "./sort";
24
- export * from "./screenshot";
25
- export * from "./searchReplace";
26
- export * from "./hyperlink";
27
- export * from "./filter";
28
- export * from "./moveCells";
29
- export * from "./conditionalFormat";
30
- export * from "./splitColumn";
31
- export * from "./locationCondition";
32
- export * from "./dataVerification";
33
- export * from "./ConditionFormat";
34
- export * from "./zoom";
35
- export * from "./refresh";
36
- export * from "./iframe";
@@ -1,401 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _border = require("./border");
7
- Object.keys(_border).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _border[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function get() {
13
- return _border[key];
14
- }
15
- });
16
- });
17
- var _cell = require("./cell");
18
- Object.keys(_cell).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _cell[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function get() {
24
- return _cell[key];
25
- }
26
- });
27
- });
28
- var _clipboard = require("./clipboard");
29
- Object.keys(_clipboard).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _clipboard[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function get() {
35
- return _clipboard[key];
36
- }
37
- });
38
- });
39
- var _color = require("./color");
40
- Object.keys(_color).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _color[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function get() {
46
- return _color[key];
47
- }
48
- });
49
- });
50
- var _cursor = require("./cursor");
51
- Object.keys(_cursor).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (key in exports && exports[key] === _cursor[key]) return;
54
- Object.defineProperty(exports, key, {
55
- enumerable: true,
56
- get: function get() {
57
- return _cursor[key];
58
- }
59
- });
60
- });
61
- var _format = require("./format");
62
- Object.keys(_format).forEach(function (key) {
63
- if (key === "default" || key === "__esModule") return;
64
- if (key in exports && exports[key] === _format[key]) return;
65
- Object.defineProperty(exports, key, {
66
- enumerable: true,
67
- get: function get() {
68
- return _format[key];
69
- }
70
- });
71
- });
72
- var _formula = require("./formula");
73
- Object.keys(_formula).forEach(function (key) {
74
- if (key === "default" || key === "__esModule") return;
75
- if (key in exports && exports[key] === _formula[key]) return;
76
- Object.defineProperty(exports, key, {
77
- enumerable: true,
78
- get: function get() {
79
- return _formula[key];
80
- }
81
- });
82
- });
83
- var _freeze = require("./freeze");
84
- Object.keys(_freeze).forEach(function (key) {
85
- if (key === "default" || key === "__esModule") return;
86
- if (key in exports && exports[key] === _freeze[key]) return;
87
- Object.defineProperty(exports, key, {
88
- enumerable: true,
89
- get: function get() {
90
- return _freeze[key];
91
- }
92
- });
93
- });
94
- var _inlineString = require("./inline-string");
95
- Object.keys(_inlineString).forEach(function (key) {
96
- if (key === "default" || key === "__esModule") return;
97
- if (key in exports && exports[key] === _inlineString[key]) return;
98
- Object.defineProperty(exports, key, {
99
- enumerable: true,
100
- get: function get() {
101
- return _inlineString[key];
102
- }
103
- });
104
- });
105
- var _location = require("./location");
106
- Object.keys(_location).forEach(function (key) {
107
- if (key === "default" || key === "__esModule") return;
108
- if (key in exports && exports[key] === _location[key]) return;
109
- Object.defineProperty(exports, key, {
110
- enumerable: true,
111
- get: function get() {
112
- return _location[key];
113
- }
114
- });
115
- });
116
- var _protection = require("./protection");
117
- Object.keys(_protection).forEach(function (key) {
118
- if (key === "default" || key === "__esModule") return;
119
- if (key in exports && exports[key] === _protection[key]) return;
120
- Object.defineProperty(exports, key, {
121
- enumerable: true,
122
- get: function get() {
123
- return _protection[key];
124
- }
125
- });
126
- });
127
- var _rowcol = require("./rowcol");
128
- Object.keys(_rowcol).forEach(function (key) {
129
- if (key === "default" || key === "__esModule") return;
130
- if (key in exports && exports[key] === _rowcol[key]) return;
131
- Object.defineProperty(exports, key, {
132
- enumerable: true,
133
- get: function get() {
134
- return _rowcol[key];
135
- }
136
- });
137
- });
138
- var _selection = require("./selection");
139
- Object.keys(_selection).forEach(function (key) {
140
- if (key === "default" || key === "__esModule") return;
141
- if (key in exports && exports[key] === _selection[key]) return;
142
- Object.defineProperty(exports, key, {
143
- enumerable: true,
144
- get: function get() {
145
- return _selection[key];
146
- }
147
- });
148
- });
149
- var _sheet = require("./sheet");
150
- Object.keys(_sheet).forEach(function (key) {
151
- if (key === "default" || key === "__esModule") return;
152
- if (key in exports && exports[key] === _sheet[key]) return;
153
- Object.defineProperty(exports, key, {
154
- enumerable: true,
155
- get: function get() {
156
- return _sheet[key];
157
- }
158
- });
159
- });
160
- var _text = require("./text");
161
- Object.keys(_text).forEach(function (key) {
162
- if (key === "default" || key === "__esModule") return;
163
- if (key in exports && exports[key] === _text[key]) return;
164
- Object.defineProperty(exports, key, {
165
- enumerable: true,
166
- get: function get() {
167
- return _text[key];
168
- }
169
- });
170
- });
171
- var _toolbar = require("./toolbar");
172
- Object.keys(_toolbar).forEach(function (key) {
173
- if (key === "default" || key === "__esModule") return;
174
- if (key in exports && exports[key] === _toolbar[key]) return;
175
- Object.defineProperty(exports, key, {
176
- enumerable: true,
177
- get: function get() {
178
- return _toolbar[key];
179
- }
180
- });
181
- });
182
- var _validation = require("./validation");
183
- Object.keys(_validation).forEach(function (key) {
184
- if (key === "default" || key === "__esModule") return;
185
- if (key in exports && exports[key] === _validation[key]) return;
186
- Object.defineProperty(exports, key, {
187
- enumerable: true,
188
- get: function get() {
189
- return _validation[key];
190
- }
191
- });
192
- });
193
- var _comment = require("./comment");
194
- Object.keys(_comment).forEach(function (key) {
195
- if (key === "default" || key === "__esModule") return;
196
- if (key in exports && exports[key] === _comment[key]) return;
197
- Object.defineProperty(exports, key, {
198
- enumerable: true,
199
- get: function get() {
200
- return _comment[key];
201
- }
202
- });
203
- });
204
- var _image = require("./image");
205
- Object.keys(_image).forEach(function (key) {
206
- if (key === "default" || key === "__esModule") return;
207
- if (key in exports && exports[key] === _image[key]) return;
208
- Object.defineProperty(exports, key, {
209
- enumerable: true,
210
- get: function get() {
211
- return _image[key];
212
- }
213
- });
214
- });
215
- var _mobile = require("./mobile");
216
- Object.keys(_mobile).forEach(function (key) {
217
- if (key === "default" || key === "__esModule") return;
218
- if (key in exports && exports[key] === _mobile[key]) return;
219
- Object.defineProperty(exports, key, {
220
- enumerable: true,
221
- get: function get() {
222
- return _mobile[key];
223
- }
224
- });
225
- });
226
- var _dropCell = require("./dropCell");
227
- Object.keys(_dropCell).forEach(function (key) {
228
- if (key === "default" || key === "__esModule") return;
229
- if (key in exports && exports[key] === _dropCell[key]) return;
230
- Object.defineProperty(exports, key, {
231
- enumerable: true,
232
- get: function get() {
233
- return _dropCell[key];
234
- }
235
- });
236
- });
237
- var _merge = require("./merge");
238
- Object.keys(_merge).forEach(function (key) {
239
- if (key === "default" || key === "__esModule") return;
240
- if (key in exports && exports[key] === _merge[key]) return;
241
- Object.defineProperty(exports, key, {
242
- enumerable: true,
243
- get: function get() {
244
- return _merge[key];
245
- }
246
- });
247
- });
248
- var _sort = require("./sort");
249
- Object.keys(_sort).forEach(function (key) {
250
- if (key === "default" || key === "__esModule") return;
251
- if (key in exports && exports[key] === _sort[key]) return;
252
- Object.defineProperty(exports, key, {
253
- enumerable: true,
254
- get: function get() {
255
- return _sort[key];
256
- }
257
- });
258
- });
259
- var _screenshot = require("./screenshot");
260
- Object.keys(_screenshot).forEach(function (key) {
261
- if (key === "default" || key === "__esModule") return;
262
- if (key in exports && exports[key] === _screenshot[key]) return;
263
- Object.defineProperty(exports, key, {
264
- enumerable: true,
265
- get: function get() {
266
- return _screenshot[key];
267
- }
268
- });
269
- });
270
- var _searchReplace = require("./searchReplace");
271
- Object.keys(_searchReplace).forEach(function (key) {
272
- if (key === "default" || key === "__esModule") return;
273
- if (key in exports && exports[key] === _searchReplace[key]) return;
274
- Object.defineProperty(exports, key, {
275
- enumerable: true,
276
- get: function get() {
277
- return _searchReplace[key];
278
- }
279
- });
280
- });
281
- var _hyperlink = require("./hyperlink");
282
- Object.keys(_hyperlink).forEach(function (key) {
283
- if (key === "default" || key === "__esModule") return;
284
- if (key in exports && exports[key] === _hyperlink[key]) return;
285
- Object.defineProperty(exports, key, {
286
- enumerable: true,
287
- get: function get() {
288
- return _hyperlink[key];
289
- }
290
- });
291
- });
292
- var _filter = require("./filter");
293
- Object.keys(_filter).forEach(function (key) {
294
- if (key === "default" || key === "__esModule") return;
295
- if (key in exports && exports[key] === _filter[key]) return;
296
- Object.defineProperty(exports, key, {
297
- enumerable: true,
298
- get: function get() {
299
- return _filter[key];
300
- }
301
- });
302
- });
303
- var _moveCells = require("./moveCells");
304
- Object.keys(_moveCells).forEach(function (key) {
305
- if (key === "default" || key === "__esModule") return;
306
- if (key in exports && exports[key] === _moveCells[key]) return;
307
- Object.defineProperty(exports, key, {
308
- enumerable: true,
309
- get: function get() {
310
- return _moveCells[key];
311
- }
312
- });
313
- });
314
- var _conditionalFormat = require("./conditionalFormat");
315
- Object.keys(_conditionalFormat).forEach(function (key) {
316
- if (key === "default" || key === "__esModule") return;
317
- if (key in exports && exports[key] === _conditionalFormat[key]) return;
318
- Object.defineProperty(exports, key, {
319
- enumerable: true,
320
- get: function get() {
321
- return _conditionalFormat[key];
322
- }
323
- });
324
- });
325
- var _splitColumn = require("./splitColumn");
326
- Object.keys(_splitColumn).forEach(function (key) {
327
- if (key === "default" || key === "__esModule") return;
328
- if (key in exports && exports[key] === _splitColumn[key]) return;
329
- Object.defineProperty(exports, key, {
330
- enumerable: true,
331
- get: function get() {
332
- return _splitColumn[key];
333
- }
334
- });
335
- });
336
- var _locationCondition = require("./locationCondition");
337
- Object.keys(_locationCondition).forEach(function (key) {
338
- if (key === "default" || key === "__esModule") return;
339
- if (key in exports && exports[key] === _locationCondition[key]) return;
340
- Object.defineProperty(exports, key, {
341
- enumerable: true,
342
- get: function get() {
343
- return _locationCondition[key];
344
- }
345
- });
346
- });
347
- var _dataVerification = require("./dataVerification");
348
- Object.keys(_dataVerification).forEach(function (key) {
349
- if (key === "default" || key === "__esModule") return;
350
- if (key in exports && exports[key] === _dataVerification[key]) return;
351
- Object.defineProperty(exports, key, {
352
- enumerable: true,
353
- get: function get() {
354
- return _dataVerification[key];
355
- }
356
- });
357
- });
358
- var _ConditionFormat = require("./ConditionFormat");
359
- Object.keys(_ConditionFormat).forEach(function (key) {
360
- if (key === "default" || key === "__esModule") return;
361
- if (key in exports && exports[key] === _ConditionFormat[key]) return;
362
- Object.defineProperty(exports, key, {
363
- enumerable: true,
364
- get: function get() {
365
- return _ConditionFormat[key];
366
- }
367
- });
368
- });
369
- var _zoom = require("./zoom");
370
- Object.keys(_zoom).forEach(function (key) {
371
- if (key === "default" || key === "__esModule") return;
372
- if (key in exports && exports[key] === _zoom[key]) return;
373
- Object.defineProperty(exports, key, {
374
- enumerable: true,
375
- get: function get() {
376
- return _zoom[key];
377
- }
378
- });
379
- });
380
- var _refresh = require("./refresh");
381
- Object.keys(_refresh).forEach(function (key) {
382
- if (key === "default" || key === "__esModule") return;
383
- if (key in exports && exports[key] === _refresh[key]) return;
384
- Object.defineProperty(exports, key, {
385
- enumerable: true,
386
- get: function get() {
387
- return _refresh[key];
388
- }
389
- });
390
- });
391
- var _iframe = require("./iframe");
392
- Object.keys(_iframe).forEach(function (key) {
393
- if (key === "default" || key === "__esModule") return;
394
- if (key in exports && exports[key] === _iframe[key]) return;
395
- Object.defineProperty(exports, key, {
396
- enumerable: true,
397
- get: function get() {
398
- return _iframe[key];
399
- }
400
- });
401
- });