@fileverse-dev/fortune-core 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/{dist/packages/core/src → es}/api/cell.d.ts +10 -10
  2. package/es/api/cell.js +204 -0
  3. package/{dist/packages/core/src → es}/api/common.d.ts +71 -66
  4. package/es/api/common.js +79 -0
  5. package/{dist/packages/core/src → es}/api/errors.d.ts +2 -2
  6. package/es/api/errors.js +2 -0
  7. package/{dist/packages/core/src → es}/api/index.d.ts +9 -9
  8. package/es/api/index.js +8 -0
  9. package/{dist/packages/core/src → es}/api/merge.d.ts +5 -5
  10. package/es/api/merge.js +15 -0
  11. package/{dist/packages/core/src → es}/api/range.d.ts +22 -22
  12. package/es/api/range.js +123 -0
  13. package/{dist/packages/core/src → es}/api/rowcol.d.ts +14 -14
  14. package/es/api/rowcol.js +207 -0
  15. package/{dist/packages/core/src → es}/api/sheet.d.ts +10 -10
  16. package/es/api/sheet.js +128 -0
  17. package/{dist/packages/core/src → es}/api/workbook.d.ts +15 -15
  18. package/es/api/workbook.js +85 -0
  19. package/{dist/packages/core/src → es}/canvas.d.ts +46 -46
  20. package/es/canvas.js +1350 -0
  21. package/{dist/packages/core/src → es}/context.d.ts +198 -197
  22. package/es/context.js +381 -0
  23. package/{dist/packages/core/src → es}/events/copy.d.ts +2 -2
  24. package/es/events/copy.js +78 -0
  25. package/{dist/packages/core/src → es}/events/index.d.ts +4 -4
  26. package/es/events/index.js +4 -0
  27. package/{dist/packages/core/src → es}/events/keyboard.d.ts +6 -6
  28. package/es/events/keyboard.js +360 -0
  29. package/{dist/packages/core/src → es}/events/mouse.d.ts +22 -22
  30. package/es/events/mouse.js +1725 -0
  31. package/{dist/packages/core/src → es}/events/paste.d.ts +4 -3
  32. package/es/events/paste.js +1416 -0
  33. package/{dist/packages/core/src → es}/index.d.ts +10 -10
  34. package/es/index.js +10 -0
  35. package/{dist/packages/core/src → es}/locale/en.d.ts +993 -992
  36. package/es/locale/en.js +10140 -0
  37. package/{dist/packages/core/src → es}/locale/es.d.ts +1134 -1134
  38. package/es/locale/es.js +10010 -0
  39. package/{dist/packages/core/src → es}/locale/hi.d.ts +1030 -1030
  40. package/es/locale/hi.js +10550 -0
  41. package/{dist/packages/core/src → es}/locale/index.d.ts +1049 -1049
  42. package/es/locale/index.js +23 -0
  43. package/{dist/packages/core/src → es}/locale/zh.d.ts +1048 -1048
  44. package/es/locale/zh.js +10568 -0
  45. package/{dist/packages/core/src → es}/locale/zh_tw.d.ts +1187 -1187
  46. package/es/locale/zh_tw.js +10072 -0
  47. package/{dist/packages/core/src → es}/modules/ConditionFormat.d.ts +17 -17
  48. package/es/modules/ConditionFormat.js +1258 -0
  49. package/{dist/packages/core/src → es}/modules/border.d.ts +3 -3
  50. package/es/modules/border.js +1240 -0
  51. package/{dist/packages/core/src → es}/modules/cell.d.ts +32 -32
  52. package/es/modules/cell.js +1092 -0
  53. package/{dist/packages/core/src → es}/modules/clipboard.d.ts +3 -3
  54. package/es/modules/clipboard.js +36 -0
  55. package/{dist/packages/core/src → es}/modules/color.d.ts +1 -1
  56. package/es/modules/color.js +1 -0
  57. package/{dist/packages/core/src → es}/modules/comment.d.ts +97 -97
  58. package/es/modules/comment.js +597 -0
  59. package/{dist/packages/core/src → es}/modules/conditionalFormat.d.ts +2 -2
  60. package/es/modules/conditionalFormat.js +441 -0
  61. package/{dist/packages/core/src → es}/modules/cursor.d.ts +3 -3
  62. package/es/modules/cursor.js +62 -0
  63. package/{dist/packages/core/src → es}/modules/dataVerification.d.ts +11 -11
  64. package/es/modules/dataVerification.js +701 -0
  65. package/{dist/packages/core/src → es}/modules/dropCell.d.ts +10 -10
  66. package/es/modules/dropCell.js +2267 -0
  67. package/{dist/packages/core/src → es}/modules/filter.d.ts +45 -45
  68. package/es/modules/filter.js +434 -0
  69. package/{dist/packages/core/src → es}/modules/format.d.ts +6 -6
  70. package/es/modules/format.js +323 -0
  71. package/{dist/packages/core/src → es}/modules/formula.d.ts +54 -54
  72. package/es/modules/formula.js +2346 -0
  73. package/{dist/packages/core/src → es}/modules/freeze.d.ts +5 -5
  74. package/es/modules/freeze.js +148 -0
  75. package/{dist/packages/core/src → es}/modules/hyperlink.d.ts +21 -21
  76. package/es/modules/hyperlink.js +216 -0
  77. package/{dist/packages/core/src → es}/modules/iframe.d.ts +12 -12
  78. package/es/modules/iframe.js +220 -0
  79. package/{dist/packages/core/src → es}/modules/image.d.ts +31 -31
  80. package/es/modules/image.js +253 -0
  81. package/{dist/packages/core/src → es}/modules/index.d.ts +36 -36
  82. package/es/modules/index.js +36 -0
  83. package/{dist/packages/core/src → es}/modules/inline-string.d.ts +36 -36
  84. package/es/modules/inline-string.js +437 -0
  85. package/{dist/packages/core/src → es}/modules/location.d.ts +6 -6
  86. package/es/modules/location.js +46 -0
  87. package/{dist/packages/core/src → es}/modules/locationCondition.d.ts +21 -21
  88. package/es/modules/locationCondition.js +218 -0
  89. package/{dist/packages/core/src → es}/modules/merge.d.ts +3 -3
  90. package/es/modules/merge.js +216 -0
  91. package/{dist/packages/core/src → es}/modules/mobile.d.ts +5 -5
  92. package/es/modules/mobile.js +33 -0
  93. package/{dist/packages/core/src → es}/modules/moveCells.d.ts +5 -5
  94. package/es/modules/moveCells.js +348 -0
  95. package/{dist/packages/core/src → es}/modules/protection.d.ts +5 -5
  96. package/es/modules/protection.js +96 -0
  97. package/{dist/packages/core/src → es}/modules/refresh.d.ts +3 -3
  98. package/es/modules/refresh.js +34 -0
  99. package/{dist/packages/core/src → es}/modules/rowcol.d.ts +19 -19
  100. package/es/modules/rowcol.js +1922 -0
  101. package/{dist/packages/core/src → es}/modules/screenshot.d.ts +2 -2
  102. package/es/modules/screenshot.js +90 -0
  103. package/{dist/packages/core/src → es}/modules/searchReplace.d.ts +36 -36
  104. package/es/modules/searchReplace.js +388 -0
  105. package/{dist/packages/core/src → es}/modules/selection.d.ts +50 -46
  106. package/es/modules/selection.js +1856 -0
  107. package/{dist/packages/core/src → es}/modules/sheet.d.ts +10 -10
  108. package/es/modules/sheet.js +237 -0
  109. package/{dist/packages/core/src → es}/modules/sort.d.ts +7 -7
  110. package/es/modules/sort.js +134 -0
  111. package/{dist/packages/core/src → es}/modules/splitColumn.d.ts +5 -5
  112. package/es/modules/splitColumn.js +126 -0
  113. package/es/modules/ssf.js +1533 -0
  114. package/{dist/packages/core/src → es}/modules/text.d.ts +10 -10
  115. package/es/modules/text.js +1207 -0
  116. package/{dist/packages/core/src → es}/modules/toolbar.d.ts +32 -32
  117. package/es/modules/toolbar.js +970 -0
  118. package/{dist/packages/core/src → es}/modules/validation.d.ts +19 -19
  119. package/es/modules/validation.js +190 -0
  120. package/{dist/packages/core/src → es}/modules/zoom.d.ts +3 -3
  121. package/es/modules/zoom.js +29 -0
  122. package/{dist/packages/core/src → es}/settings.d.ts +100 -100
  123. package/es/settings.js +36 -0
  124. package/{dist/packages/core/src → es}/types.d.ts +380 -371
  125. package/es/types.js +1 -0
  126. package/{dist/packages/core/src → es}/utils/freeze.d.ts +7 -7
  127. package/es/utils/freeze.js +86 -0
  128. package/{dist/packages/core/src → es}/utils/index.d.ts +19 -18
  129. package/es/utils/index.js +198 -0
  130. package/{dist/packages/core/src → es}/utils/patch.d.ts +37 -37
  131. package/es/utils/patch.js +381 -0
  132. package/lib/api/cell.d.ts +10 -0
  133. package/lib/api/cell.js +215 -0
  134. package/lib/api/common.d.ts +71 -0
  135. package/lib/api/common.js +88 -0
  136. package/lib/api/errors.d.ts +2 -0
  137. package/lib/api/errors.js +8 -0
  138. package/lib/api/index.d.ts +9 -0
  139. package/lib/api/index.js +101 -0
  140. package/lib/api/merge.d.ts +5 -0
  141. package/lib/api/merge.js +22 -0
  142. package/lib/api/range.d.ts +22 -0
  143. package/lib/api/range.js +138 -0
  144. package/lib/api/rowcol.d.ts +14 -0
  145. package/lib/api/rowcol.js +222 -0
  146. package/lib/api/sheet.d.ts +10 -0
  147. package/lib/api/sheet.js +145 -0
  148. package/lib/api/workbook.d.ts +15 -0
  149. package/lib/api/workbook.js +98 -0
  150. package/lib/canvas.d.ts +46 -0
  151. package/lib/canvas.js +1356 -0
  152. package/lib/context.d.ts +198 -0
  153. package/lib/context.js +393 -0
  154. package/lib/events/copy.d.ts +2 -0
  155. package/lib/events/copy.js +85 -0
  156. package/lib/events/index.d.ts +4 -0
  157. package/lib/events/index.js +49 -0
  158. package/lib/events/keyboard.d.ts +6 -0
  159. package/lib/events/keyboard.js +370 -0
  160. package/lib/events/mouse.d.ts +22 -0
  161. package/lib/events/mouse.js +1744 -0
  162. package/lib/events/paste.d.ts +4 -0
  163. package/lib/events/paste.js +1425 -0
  164. package/lib/index.d.ts +10 -0
  165. package/lib/index.js +109 -0
  166. package/lib/locale/en.d.ts +993 -0
  167. package/lib/locale/en.js +10146 -0
  168. package/lib/locale/es.d.ts +1134 -0
  169. package/lib/locale/es.js +10016 -0
  170. package/lib/locale/hi.d.ts +1030 -0
  171. package/lib/locale/hi.js +10556 -0
  172. package/lib/locale/index.d.ts +1049 -0
  173. package/lib/locale/index.js +29 -0
  174. package/lib/locale/zh.d.ts +1048 -0
  175. package/lib/locale/zh.js +10574 -0
  176. package/lib/locale/zh_tw.d.ts +1187 -0
  177. package/lib/locale/zh_tw.js +10078 -0
  178. package/lib/modules/ConditionFormat.d.ts +17 -0
  179. package/lib/modules/ConditionFormat.js +1273 -0
  180. package/lib/modules/border.d.ts +3 -0
  181. package/lib/modules/border.js +1248 -0
  182. package/lib/modules/cell.d.ts +32 -0
  183. package/lib/modules/cell.js +1122 -0
  184. package/lib/modules/clipboard.d.ts +3 -0
  185. package/lib/modules/clipboard.js +42 -0
  186. package/lib/modules/color.d.ts +1 -0
  187. package/lib/modules/color.js +7 -0
  188. package/lib/modules/comment.d.ts +97 -0
  189. package/lib/modules/comment.js +625 -0
  190. package/lib/modules/conditionalFormat.d.ts +2 -0
  191. package/lib/modules/conditionalFormat.js +447 -0
  192. package/lib/modules/cursor.d.ts +3 -0
  193. package/lib/modules/cursor.js +70 -0
  194. package/lib/modules/dataVerification.d.ts +11 -0
  195. package/lib/modules/dataVerification.js +716 -0
  196. package/lib/modules/dropCell.d.ts +10 -0
  197. package/lib/modules/dropCell.js +2283 -0
  198. package/lib/modules/filter.d.ts +45 -0
  199. package/lib/modules/filter.js +448 -0
  200. package/lib/modules/format.d.ts +6 -0
  201. package/lib/modules/format.js +334 -0
  202. package/lib/modules/formula.d.ts +54 -0
  203. package/lib/modules/formula.js +2375 -0
  204. package/lib/modules/freeze.d.ts +5 -0
  205. package/lib/modules/freeze.js +158 -0
  206. package/lib/modules/hyperlink.d.ts +21 -0
  207. package/lib/modules/hyperlink.js +232 -0
  208. package/lib/modules/iframe.d.ts +12 -0
  209. package/lib/modules/iframe.js +236 -0
  210. package/lib/modules/image.d.ts +31 -0
  211. package/lib/modules/image.js +272 -0
  212. package/lib/modules/index.d.ts +36 -0
  213. package/lib/modules/index.js +401 -0
  214. package/lib/modules/inline-string.d.ts +36 -0
  215. package/lib/modules/inline-string.js +452 -0
  216. package/lib/modules/location.d.ts +6 -0
  217. package/lib/modules/location.js +57 -0
  218. package/lib/modules/locationCondition.d.ts +21 -0
  219. package/lib/modules/locationCondition.js +229 -0
  220. package/lib/modules/merge.d.ts +3 -0
  221. package/lib/modules/merge.js +223 -0
  222. package/lib/modules/mobile.d.ts +5 -0
  223. package/lib/modules/mobile.js +41 -0
  224. package/lib/modules/moveCells.d.ts +5 -0
  225. package/lib/modules/moveCells.js +357 -0
  226. package/lib/modules/protection.d.ts +5 -0
  227. package/lib/modules/protection.js +106 -0
  228. package/lib/modules/refresh.d.ts +3 -0
  229. package/lib/modules/refresh.js +40 -0
  230. package/lib/modules/rowcol.d.ts +19 -0
  231. package/lib/modules/rowcol.js +1935 -0
  232. package/lib/modules/screenshot.d.ts +2 -0
  233. package/lib/modules/screenshot.js +96 -0
  234. package/lib/modules/searchReplace.d.ts +36 -0
  235. package/lib/modules/searchReplace.js +402 -0
  236. package/lib/modules/selection.d.ts +50 -0
  237. package/lib/modules/selection.js +1889 -0
  238. package/lib/modules/sheet.d.ts +10 -0
  239. package/lib/modules/sheet.js +250 -0
  240. package/lib/modules/sort.d.ts +7 -0
  241. package/lib/modules/sort.js +143 -0
  242. package/lib/modules/splitColumn.d.ts +5 -0
  243. package/lib/modules/splitColumn.js +136 -0
  244. package/lib/modules/ssf.js +1539 -0
  245. package/lib/modules/text.d.ts +10 -0
  246. package/lib/modules/text.js +1221 -0
  247. package/lib/modules/toolbar.d.ts +32 -0
  248. package/lib/modules/toolbar.js +1003 -0
  249. package/lib/modules/validation.d.ts +19 -0
  250. package/lib/modules/validation.js +205 -0
  251. package/lib/modules/zoom.d.ts +3 -0
  252. package/lib/modules/zoom.js +36 -0
  253. package/lib/settings.d.ts +100 -0
  254. package/lib/settings.js +42 -0
  255. package/lib/types.d.ts +380 -0
  256. package/lib/types.js +5 -0
  257. package/lib/utils/freeze.d.ts +7 -0
  258. package/lib/utils/freeze.js +92 -0
  259. package/lib/utils/index.d.ts +19 -0
  260. package/lib/utils/index.js +258 -0
  261. package/lib/utils/patch.d.ts +37 -0
  262. package/lib/utils/patch.js +392 -0
  263. package/package.json +7 -6
  264. package/dist/index.esm.js +0 -80255
  265. package/dist/index.js +0 -80601
  266. package/dist/packages/react/src/components/ChangeColor/index.d.ts +0 -7
  267. package/dist/packages/react/src/components/ConditionFormat/ConditionRules.d.ts +0 -6
  268. package/dist/packages/react/src/components/ConditionFormat/index.d.ts +0 -7
  269. package/dist/packages/react/src/components/ContextMenu/Divider.d.ts +0 -3
  270. package/dist/packages/react/src/components/ContextMenu/FilterMenu.d.ts +0 -3
  271. package/dist/packages/react/src/components/ContextMenu/Menu.d.ts +0 -8
  272. package/dist/packages/react/src/components/ContextMenu/SheetTab.d.ts +0 -4
  273. package/dist/packages/react/src/components/ContextMenu/index.d.ts +0 -5
  274. package/dist/packages/react/src/components/CustomSort/index.d.ts +0 -4
  275. package/dist/packages/react/src/components/DataVerification/DropdownList.d.ts +0 -4
  276. package/dist/packages/react/src/components/DataVerification/RangeDialog.d.ts +0 -4
  277. package/dist/packages/react/src/components/DataVerification/getDisplayedRangeTxt.d.ts +0 -2
  278. package/dist/packages/react/src/components/DataVerification/index.d.ts +0 -4
  279. package/dist/packages/react/src/components/Dialog/index.d.ts +0 -15
  280. package/dist/packages/react/src/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +0 -11
  281. package/dist/packages/react/src/components/DunePreview/DunePreview.d.ts +0 -13
  282. package/dist/packages/react/src/components/FilterOption/index.d.ts +0 -5
  283. package/dist/packages/react/src/components/FormatSearch/index.d.ts +0 -6
  284. package/dist/packages/react/src/components/FormulaSearch/index.d.ts +0 -5
  285. package/dist/packages/react/src/components/FxEditor/NameBox.d.ts +0 -3
  286. package/dist/packages/react/src/components/FxEditor/index.d.ts +0 -4
  287. package/dist/packages/react/src/components/IFrameBoxs/iFrameBoxs.d.ts +0 -4
  288. package/dist/packages/react/src/components/ImgBoxs/index.d.ts +0 -3
  289. package/dist/packages/react/src/components/LinkEidtCard/index.d.ts +0 -5
  290. package/dist/packages/react/src/components/LocationCondition/index.d.ts +0 -3
  291. package/dist/packages/react/src/components/MessageBox/index.d.ts +0 -9
  292. package/dist/packages/react/src/components/NotationBoxes/index.d.ts +0 -3
  293. package/dist/packages/react/src/components/ResetColumnWidth/index.d.ts +0 -2
  294. package/dist/packages/react/src/components/SVGDefines.d.ts +0 -5
  295. package/dist/packages/react/src/components/SVGIcon.d.ts +0 -9
  296. package/dist/packages/react/src/components/SearchReplace/index.d.ts +0 -6
  297. package/dist/packages/react/src/components/Sheet/index.d.ts +0 -8
  298. package/dist/packages/react/src/components/SheetList/SheetHiddenButton.d.ts +0 -8
  299. package/dist/packages/react/src/components/SheetList/SheetListItem.d.ts +0 -9
  300. package/dist/packages/react/src/components/SheetList/index.d.ts +0 -4
  301. package/dist/packages/react/src/components/SheetOverlay/ColumnHeader.d.ts +0 -3
  302. package/dist/packages/react/src/components/SheetOverlay/ContentEditable.d.ts +0 -11
  303. package/dist/packages/react/src/components/SheetOverlay/FormulaHint/index.d.ts +0 -4
  304. package/dist/packages/react/src/components/SheetOverlay/FormulaSearch/constant.d.ts +0 -63
  305. package/dist/packages/react/src/components/SheetOverlay/FormulaSearch/index.d.ts +0 -4
  306. package/dist/packages/react/src/components/SheetOverlay/InputBox.d.ts +0 -3
  307. package/dist/packages/react/src/components/SheetOverlay/RowHeader.d.ts +0 -3
  308. package/dist/packages/react/src/components/SheetOverlay/ScrollBar/index.d.ts +0 -7
  309. package/dist/packages/react/src/components/SheetOverlay/index.d.ts +0 -4
  310. package/dist/packages/react/src/components/SheetTab/SheetItem.d.ts +0 -8
  311. package/dist/packages/react/src/components/SheetTab/index.d.ts +0 -4
  312. package/dist/packages/react/src/components/SplitColumn/index.d.ts +0 -3
  313. package/dist/packages/react/src/components/Toolbar/Button.d.ts +0 -12
  314. package/dist/packages/react/src/components/Toolbar/ColorPicker.d.ts +0 -6
  315. package/dist/packages/react/src/components/Toolbar/Combo.d.ts +0 -12
  316. package/dist/packages/react/src/components/Toolbar/CustomBorder.d.ts +0 -7
  317. package/dist/packages/react/src/components/Toolbar/CustomButton.d.ts +0 -11
  318. package/dist/packages/react/src/components/Toolbar/CustomColor.d.ts +0 -8
  319. package/dist/packages/react/src/components/Toolbar/CustomIcon.d.ts +0 -9
  320. package/dist/packages/react/src/components/Toolbar/Divider.d.ts +0 -4
  321. package/dist/packages/react/src/components/Toolbar/MoreItemsContainer.d.ts +0 -6
  322. package/dist/packages/react/src/components/Toolbar/Select.d.ts +0 -14
  323. package/dist/packages/react/src/components/Toolbar/index.d.ts +0 -10
  324. package/dist/packages/react/src/components/Workbook/api.d.ts +0 -1177
  325. package/dist/packages/react/src/components/Workbook/index.d.ts +0 -1185
  326. package/dist/packages/react/src/components/ZoomControl/index.d.ts +0 -4
  327. package/dist/packages/react/src/components/index.d.ts +0 -4
  328. package/dist/packages/react/src/constants.d.ts +0 -1
  329. package/dist/packages/react/src/context/index.d.ts +0 -25
  330. package/dist/packages/react/src/context/modal.d.ts +0 -10
  331. package/dist/packages/react/src/hooks/useAlert.d.ts +0 -4
  332. package/dist/packages/react/src/hooks/useDialog.d.ts +0 -5
  333. package/dist/packages/react/src/hooks/useOutsideClick.d.ts +0 -2
  334. package/dist/packages/react/src/hooks/usePrevious.d.ts +0 -2
  335. package/dist/packages/react/src/index.d.ts +0 -1
  336. package/dist/packages/react/src/utils/datepickerStyles.d.ts +0 -2
  337. package/dist/stories/API.stories.d.ts +0 -1210
  338. package/dist/stories/Collabration.stories.d.ts +0 -2359
  339. package/dist/stories/Features.stories.d.ts +0 -9430
  340. package/dist/stories/data/cell.d.ts +0 -983
  341. package/dist/stories/data/dataVerification.d.ts +0 -131
  342. package/dist/stories/data/empty.d.ts +0 -10
  343. package/dist/stories/data/formula.d.ts +0 -362
  344. package/dist/stories/data/freeze.d.ts +0 -34
  345. package/dist/stories/data/protected.d.ts +0 -40
  346. package/dist/stories/utils.d.ts +0 -1
@@ -0,0 +1,1416 @@
1
+ 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); }
2
+ var __assign = this && this.__assign || function () {
3
+ __assign = Object.assign || function (t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import _ from "lodash";
13
+ import { getFlowdata } from "../context";
14
+ import { locale } from "../locale";
15
+ import { execfunction, functionCopy } from "../modules/formula";
16
+ import { getdatabyselection, getQKBorder } from "../modules/cell";
17
+ import { genarate, update } from "../modules/format";
18
+ import { normalizeSelection, selectionCache } from "../modules/selection";
19
+ import { getSheetIndex, isAllowEdit } from "../utils";
20
+ import { hasPartMC, isRealNum } from "../modules/validation";
21
+ import { getBorderInfoCompute } from "../modules/border";
22
+ import { expandRowsAndColumns, storeSheetParamALL } from "../modules/sheet";
23
+ import { jfrefreshgrid } from "../modules/refresh";
24
+ import { setRowHeight } from "../api";
25
+ import { CFSplitRange, sanitizeDuneUrl, saveHyperlink } from "../modules";
26
+ import clipboard from "../modules/clipboard";
27
+ function postPasteCut(ctx, source, target, RowlChange) {
28
+ var execF_rc = {};
29
+ ctx.formulaCache.execFunctionExist = [];
30
+ for (var r = source.range.row[0]; r <= source.range.row[1]; r += 1) {
31
+ for (var c = source.range.column[0]; c <= source.range.column[1]; c += 1) {
32
+ if ("".concat(r, "_").concat(c, "_").concat(source.sheetId) in execF_rc) {
33
+ continue;
34
+ }
35
+ execF_rc["".concat(r, "_").concat(c, "_").concat(source.sheetId)] = 0;
36
+ ctx.formulaCache.execFunctionExist.push({
37
+ r: r,
38
+ c: c,
39
+ i: source.sheetId
40
+ });
41
+ }
42
+ }
43
+ for (var r = target.range.row[0]; r <= target.range.row[1]; r += 1) {
44
+ for (var c = target.range.column[0]; c <= target.range.column[1]; c += 1) {
45
+ if ("".concat(r, "_").concat(c, "_").concat(target.sheetId) in execF_rc) {
46
+ continue;
47
+ }
48
+ execF_rc["".concat(r, "_").concat(c, "_").concat(target.sheetId)] = 0;
49
+ ctx.formulaCache.execFunctionExist.push({
50
+ r: r,
51
+ c: c,
52
+ i: target.sheetId
53
+ });
54
+ }
55
+ }
56
+ var rowHeight;
57
+ if (ctx.currentSheetId === source.sheetId) {
58
+ ctx.config = source.curConfig;
59
+ rowHeight = source.curData.length;
60
+ ctx.luckysheetfile[getSheetIndex(ctx, target.sheetId)].config = target.curConfig;
61
+ } else if (ctx.currentSheetId === target.sheetId) {
62
+ ctx.config = target.curConfig;
63
+ rowHeight = target.curData.length;
64
+ ctx.luckysheetfile[getSheetIndex(ctx, source.sheetId)].config = source.curConfig;
65
+ }
66
+ if (RowlChange) {
67
+ ctx.visibledatarow = [];
68
+ ctx.rh_height = 0;
69
+ for (var i = 0; i < rowHeight; i += 1) {
70
+ var rowlen = ctx.defaultrowlen;
71
+ if (ctx.config.rowlen != null && ctx.config.rowlen[i] != null) {
72
+ rowlen = ctx.config.rowlen[i];
73
+ }
74
+ if (ctx.config.rowhidden != null && ctx.config.rowhidden[i] != null) {
75
+ rowlen = ctx.config.rowhidden[i];
76
+ ctx.visibledatarow.push(ctx.rh_height);
77
+ continue;
78
+ } else {
79
+ ctx.rh_height += rowlen + 1;
80
+ }
81
+ ctx.visibledatarow.push(ctx.rh_height);
82
+ }
83
+ ctx.rh_height += 80;
84
+ if (ctx.currentSheetId === source.sheetId) {} else if (ctx.currentSheetId === target.sheetId) {}
85
+ }
86
+ if (ctx.currentSheetId === source.sheetId) {
87
+ ctx.luckysheetfile[getSheetIndex(ctx, target.sheetId)].data = target.curData;
88
+ } else if (ctx.currentSheetId === target.sheetId) {
89
+ ctx.luckysheetfile[getSheetIndex(ctx, source.sheetId)].data = source.curData;
90
+ }
91
+ if (ctx.currentSheetId === target.sheetId) {
92
+ ctx.luckysheet_select_save = [{
93
+ row: target.range.row,
94
+ column: target.range.column
95
+ }];
96
+ } else {
97
+ ctx.luckysheet_select_save = [{
98
+ row: source.range.row,
99
+ column: source.range.column
100
+ }];
101
+ }
102
+ if (ctx.luckysheet_select_save.length > 0) {}
103
+ ctx.luckysheetfile[getSheetIndex(ctx, source.sheetId)].luckysheet_conditionformat_save = source.curCdformat;
104
+ ctx.luckysheetfile[getSheetIndex(ctx, target.sheetId)].luckysheet_conditionformat_save = target.curCdformat;
105
+ ctx.luckysheetfile[getSheetIndex(ctx, source.sheetId)].dataVerification = source.curDataVerification;
106
+ ctx.luckysheetfile[getSheetIndex(ctx, target.sheetId)].dataVerification = target.curDataVerification;
107
+ ctx.formulaCache.execFunctionExist.reverse();
108
+ ctx.formulaCache.execFunctionGlobalData = null;
109
+ storeSheetParamALL(ctx);
110
+ }
111
+ function pasteHandler(ctx, data, borderInfo) {
112
+ var _a;
113
+ var _b, _c, _d, _e, _f, _g;
114
+ var allowEdit = isAllowEdit(ctx);
115
+ if (!allowEdit || ctx.isFlvReadOnly) return;
116
+ if (((_c = (_b = ctx.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0) !== 1) {
117
+ return;
118
+ }
119
+ if (_typeof(data) === "object") {
120
+ if (data.length === 0) {
121
+ return;
122
+ }
123
+ var cfg = ctx.config || {};
124
+ if (cfg.merge == null) {
125
+ cfg.merge = {};
126
+ }
127
+ if (JSON.stringify(borderInfo).length > 2 && cfg.borderInfo == null) {
128
+ cfg.borderInfo = [];
129
+ }
130
+ var copyh = data.length;
131
+ var copyc = data[0].length;
132
+ var minh = ctx.luckysheet_select_save[0].row[0];
133
+ var maxh = minh + copyh - 1;
134
+ var minc = ctx.luckysheet_select_save[0].column[0];
135
+ var maxc = minc + copyc - 1;
136
+ var has_PartMC = false;
137
+ if (cfg.merge != null) {
138
+ has_PartMC = hasPartMC(ctx, cfg, minh, maxh, minc, maxc);
139
+ }
140
+ if (has_PartMC) {
141
+ return;
142
+ }
143
+ var d = getFlowdata(ctx);
144
+ if (!d) return;
145
+ var rowMaxLength = d.length;
146
+ var cellMaxLength = d[0].length;
147
+ var addr = maxh - rowMaxLength + 1;
148
+ var addc = maxc - cellMaxLength + 1;
149
+ if (addr > 0 || addc > 0) {
150
+ expandRowsAndColumns(d, addr, addc);
151
+ }
152
+ if (!d) return;
153
+ if (cfg.rowlen == null) {
154
+ cfg.rowlen = {};
155
+ }
156
+ var RowlChange = false;
157
+ var offsetMC = {};
158
+ for (var h = minh; h <= maxh; h += 1) {
159
+ var x = d[h];
160
+ var currentRowLen = ctx.defaultrowlen;
161
+ if (cfg.rowlen[h] != null) {
162
+ currentRowLen = cfg.rowlen[h];
163
+ }
164
+ for (var c = minc; c <= maxc; c += 1) {
165
+ if ((_d = x === null || x === void 0 ? void 0 : x[c]) === null || _d === void 0 ? void 0 : _d.mc) {
166
+ if ("rs" in x[c].mc) {
167
+ delete cfg.merge["".concat(x[c].mc.r, "_").concat(x[c].mc.c)];
168
+ }
169
+ delete x[c].mc;
170
+ }
171
+ var value = null;
172
+ if (data[h - minh] != null && data[h - minh][c - minc] != null) {
173
+ value = data[h - minh][c - minc];
174
+ }
175
+ x[c] = value;
176
+ if (value != null && ((_e = x === null || x === void 0 ? void 0 : x[c]) === null || _e === void 0 ? void 0 : _e.mc)) {
177
+ if (x[c].mc.rs != null) {
178
+ x[c].mc.r = h;
179
+ x[c].mc.c = c;
180
+ cfg.merge["".concat(x[c].mc.r, "_").concat(x[c].mc.c)] = x[c].mc;
181
+ offsetMC["".concat(value.mc.r, "_").concat(value.mc.c)] = [x[c].mc.r, x[c].mc.c];
182
+ } else {
183
+ x[c] = {
184
+ mc: {
185
+ r: offsetMC["".concat(value.mc.r, "_").concat(value.mc.c)][0],
186
+ c: offsetMC["".concat(value.mc.r, "_").concat(value.mc.c)][1]
187
+ }
188
+ };
189
+ }
190
+ }
191
+ if (borderInfo["".concat(h - minh, "_").concat(c - minc)]) {
192
+ var bd_obj = {
193
+ rangeType: "cell",
194
+ value: {
195
+ row_index: h,
196
+ col_index: c,
197
+ l: borderInfo["".concat(h - minh, "_").concat(c - minc)].l,
198
+ r: borderInfo["".concat(h - minh, "_").concat(c - minc)].r,
199
+ t: borderInfo["".concat(h - minh, "_").concat(c - minc)].t,
200
+ b: borderInfo["".concat(h - minh, "_").concat(c - minc)].b
201
+ }
202
+ };
203
+ (_f = cfg.borderInfo) === null || _f === void 0 ? void 0 : _f.push(bd_obj);
204
+ }
205
+ }
206
+ d[h] = x;
207
+ if (currentRowLen !== ctx.defaultrowlen) {
208
+ cfg.rowlen[h] = currentRowLen;
209
+ }
210
+ }
211
+ ctx.luckysheet_select_save = [{
212
+ row: [minh, maxh],
213
+ column: [minc, maxc]
214
+ }];
215
+ if (addr > 0 || addc > 0 || RowlChange) {
216
+ ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].config = cfg;
217
+ } else {
218
+ ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].config = cfg;
219
+ }
220
+ jfrefreshgrid(ctx, null, undefined);
221
+ } else {
222
+ data = data.replace(/\r/g, "");
223
+ var dataChe = [];
224
+ var che = data.split("\n");
225
+ var colchelen = che[0].split("\t").length;
226
+ for (var i = 0; i < che.length; i += 1) {
227
+ if (che[i].split("\t").length < colchelen) {
228
+ continue;
229
+ }
230
+ dataChe.push(che[i].split("\t"));
231
+ }
232
+ var d = getFlowdata(ctx);
233
+ if (!d) return;
234
+ var last = (_g = ctx.luckysheet_select_save) === null || _g === void 0 ? void 0 : _g[ctx.luckysheet_select_save.length - 1];
235
+ if (!last) return;
236
+ var curR = last.row == null ? 0 : last.row[0];
237
+ var curC = last.column == null ? 0 : last.column[0];
238
+ var rlen = dataChe.length;
239
+ var clen = dataChe[0].length;
240
+ var has_PartMC = false;
241
+ if (ctx.config.merge != null) {
242
+ has_PartMC = hasPartMC(ctx, ctx.config, curR, curR + rlen - 1, curC, curC + clen - 1);
243
+ }
244
+ if (has_PartMC) {
245
+ return;
246
+ }
247
+ var addr = curR + rlen - d.length;
248
+ var addc = curC + clen - d[0].length;
249
+ if (addr > 0 || addc > 0) {
250
+ expandRowsAndColumns(d, addr, addc);
251
+ }
252
+ if (!d) return;
253
+ for (var r = 0; r < rlen; r += 1) {
254
+ var x = d[r + curR];
255
+ for (var c = 0; c < clen; c += 1) {
256
+ var originCell = x[c + curC];
257
+ var value = dataChe[r][c];
258
+ if (isRealNum(value)) {
259
+ if (originCell && originCell.ct && originCell.ct.fa === "@") {
260
+ value = String(value);
261
+ } else if (!/^0x?[a-fA-F0-9]+$/.test(value)) {
262
+ value = parseFloat(value);
263
+ }
264
+ }
265
+ if (originCell) {
266
+ originCell.v = value;
267
+ if (originCell.ct != null && originCell.ct.fa != null) {
268
+ originCell.m = update(originCell.ct.fa, value);
269
+ } else {
270
+ originCell.m = value;
271
+ }
272
+ if (originCell.f != null && originCell.f.length > 0) {
273
+ originCell.f = "";
274
+ }
275
+ } else {
276
+ var cell = {};
277
+ var mask = genarate(value);
278
+ _a = mask, cell.m = _a[0], cell.ct = _a[1], cell.v = _a[2];
279
+ if (/^0x?[a-fA-F0-9]+$/.test(value)) {
280
+ cell.m = value;
281
+ cell.ct = {
282
+ fa: "@",
283
+ t: "s"
284
+ };
285
+ cell.v = value;
286
+ }
287
+ x[c + curC] = cell;
288
+ }
289
+ }
290
+ d[r + curR] = x;
291
+ }
292
+ last.row = [curR, curR + rlen - 1];
293
+ last.column = [curC, curC + clen - 1];
294
+ jfrefreshgrid(ctx, null, undefined);
295
+ }
296
+ }
297
+ function setCellHyperlink(ctx, id, r, c, link) {
298
+ var index = getSheetIndex(ctx, id);
299
+ if (!ctx.luckysheetfile[index].hyperlink) {
300
+ ctx.luckysheetfile[index].hyperlink = {};
301
+ }
302
+ ctx.luckysheetfile[index].hyperlink["".concat(r, "_").concat(c)] = link;
303
+ }
304
+ function pasteHandlerOfCutPaste(ctx, copyRange) {
305
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
306
+ var allowEdit = isAllowEdit(ctx);
307
+ if (!allowEdit) return;
308
+ if (!copyRange) return;
309
+ var cfg = ctx.config || {};
310
+ if (cfg.merge == null) {
311
+ cfg.merge = {};
312
+ }
313
+ var copyHasMC = copyRange.HasMC;
314
+ var copyRowlChange = copyRange.RowlChange;
315
+ var copySheetId = copyRange.dataSheetId;
316
+ var c_r1 = copyRange.copyRange[0].row[0];
317
+ var c_r2 = copyRange.copyRange[0].row[1];
318
+ var c_c1 = copyRange.copyRange[0].column[0];
319
+ var c_c2 = copyRange.copyRange[0].column[1];
320
+ var copyData = _.cloneDeep(getdatabyselection(ctx, {
321
+ row: [c_r1, c_r2],
322
+ column: [c_c1, c_c2]
323
+ }, copySheetId));
324
+ var copyh = copyData.length;
325
+ var copyc = copyData[0].length;
326
+ var last = (_a = ctx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[ctx.luckysheet_select_save.length - 1];
327
+ if (!last || last.row_focus == null || last.column_focus == null) return;
328
+ var minh = last.row_focus;
329
+ var maxh = minh + copyh - 1;
330
+ var minc = last.column_focus;
331
+ var maxc = minc + copyc - 1;
332
+ var has_PartMC = false;
333
+ if (cfg.merge != null) {
334
+ has_PartMC = hasPartMC(ctx, cfg, minh, maxh, minc, maxc);
335
+ }
336
+ if (has_PartMC) {
337
+ return;
338
+ }
339
+ var d = getFlowdata(ctx);
340
+ if (!d) return;
341
+ var rowMaxLength = d.length;
342
+ var cellMaxLength = d[0].length;
343
+ var addr = copyh + minh - rowMaxLength;
344
+ var addc = copyc + minc - cellMaxLength;
345
+ if (addr > 0 || addc > 0) {
346
+ expandRowsAndColumns(d, addr, addc);
347
+ }
348
+ var borderInfoCompute = getBorderInfoCompute(ctx, copySheetId);
349
+ var c_dataVerification = _.cloneDeep(ctx.luckysheetfile[getSheetIndex(ctx, copySheetId)].dataVerification) || {};
350
+ var dataVerification = _.cloneDeep(ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].dataVerification) || {};
351
+ if (((_b = ctx.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b.length) === 1 && ((_c = ctx.luckysheet_copy_save) === null || _c === void 0 ? void 0 : _c.copyRange.length) === 1) {
352
+ _.forEach((_d = ctx.luckysheet_copy_save) === null || _d === void 0 ? void 0 : _d.copyRange, function (range) {
353
+ var _a, _b, _c;
354
+ var srcIndex = getSheetIndex(ctx, (_a = ctx.luckysheet_copy_save) === null || _a === void 0 ? void 0 : _a.dataSheetId);
355
+ for (var r = 0; r <= range.row[1] - range.row[0]; r += 1) {
356
+ for (var c = 0; c <= range.column[1] - range.column[0]; c += 1) {
357
+ var srcRow = r + range.row[0];
358
+ var srcCol = c + range.column[0];
359
+ var srcLink = (_b = ctx.luckysheetfile[srcIndex].hyperlink) === null || _b === void 0 ? void 0 : _b["".concat(srcRow, "_").concat(srcCol)];
360
+ if (!srcLink) continue;
361
+ var targetR = r + ctx.luckysheet_select_save[0].row[0];
362
+ var targetC = c + ctx.luckysheet_select_save[0].column[0];
363
+ setCellHyperlink(ctx, (_c = ctx.luckysheet_copy_save) === null || _c === void 0 ? void 0 : _c.dataSheetId, targetR, targetC, srcLink);
364
+ }
365
+ }
366
+ });
367
+ }
368
+ if (ctx.currentSheetId === copySheetId) {
369
+ for (var i = c_r1; i <= c_r2; i += 1) {
370
+ for (var j = c_c1; j <= c_c2; j += 1) {
371
+ var cell = d[i][j];
372
+ if (cell && _.isPlainObject(cell) && "mc" in cell) {
373
+ if (((_e = cell.mc) === null || _e === void 0 ? void 0 : _e.rs) != null) {
374
+ delete cfg.merge["".concat(cell.mc.r, "_").concat(cell.mc.c)];
375
+ }
376
+ delete cell.mc;
377
+ }
378
+ d[i][j] = null;
379
+ delete dataVerification["".concat(i, "_").concat(j)];
380
+ (_f = ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].hyperlink) === null || _f === void 0 ? true : delete _f["".concat(i, "_").concat(j)];
381
+ }
382
+ }
383
+ if (cfg.borderInfo && cfg.borderInfo.length > 0) {
384
+ var source_borderInfo = [];
385
+ for (var i = 0; i < cfg.borderInfo.length; i += 1) {
386
+ var bd_rangeType = cfg.borderInfo[i].rangeType;
387
+ if (bd_rangeType === "range") {
388
+ var bd_range = cfg.borderInfo[i].range;
389
+ var bd_emptyRange = [];
390
+ for (var j = 0; j < bd_range.length; j += 1) {
391
+ bd_emptyRange = bd_emptyRange.concat(CFSplitRange(bd_range[j], {
392
+ row: [c_r1, c_r2],
393
+ column: [c_c1, c_c2]
394
+ }, {
395
+ row: [minh, maxh],
396
+ column: [minc, maxc]
397
+ }, "restPart"));
398
+ }
399
+ cfg.borderInfo[i].range = bd_emptyRange;
400
+ source_borderInfo.push(cfg.borderInfo[i]);
401
+ } else if (bd_rangeType === "cell") {
402
+ var bd_r = cfg.borderInfo[i].value.row_index;
403
+ var bd_c = cfg.borderInfo[i].value.col_index;
404
+ if (!(bd_r >= c_r1 && bd_r <= c_r2 && bd_c >= c_c1 && bd_c <= c_c2)) {
405
+ source_borderInfo.push(cfg.borderInfo[i]);
406
+ }
407
+ }
408
+ }
409
+ cfg.borderInfo = source_borderInfo;
410
+ }
411
+ }
412
+ var offsetMC = {};
413
+ for (var h = minh; h <= maxh; h += 1) {
414
+ var x = d[h];
415
+ for (var c = minc; c <= maxc; c += 1) {
416
+ if (borderInfoCompute["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)] && !borderInfoCompute["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)].s) {
417
+ var bd_obj = {
418
+ rangeType: "cell",
419
+ value: {
420
+ row_index: h,
421
+ col_index: c,
422
+ l: borderInfoCompute["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)].l,
423
+ r: borderInfoCompute["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)].r,
424
+ t: borderInfoCompute["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)].t,
425
+ b: borderInfoCompute["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)].b
426
+ }
427
+ };
428
+ if (cfg.borderInfo == null) {
429
+ cfg.borderInfo = [];
430
+ }
431
+ cfg.borderInfo.push(bd_obj);
432
+ } else if (borderInfoCompute["".concat(h, "_").concat(c)]) {
433
+ var bd_obj = {
434
+ rangeType: "cell",
435
+ value: {
436
+ row_index: h,
437
+ col_index: c,
438
+ l: null,
439
+ r: null,
440
+ t: null,
441
+ b: null
442
+ }
443
+ };
444
+ if (cfg.borderInfo == null) {
445
+ cfg.borderInfo = [];
446
+ }
447
+ cfg.borderInfo.push(bd_obj);
448
+ } else if (borderInfoCompute["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)]) {
449
+ var bd_obj = {
450
+ rangeType: "range",
451
+ borderType: "border-slash",
452
+ color: borderInfoCompute["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)].s.color,
453
+ style: borderInfoCompute["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)].s.style,
454
+ range: normalizeSelection(ctx, [{
455
+ row: [h, h],
456
+ column: [c, c]
457
+ }])
458
+ };
459
+ if (cfg.borderInfo == null) {
460
+ cfg.borderInfo = [];
461
+ }
462
+ cfg.borderInfo.push(bd_obj);
463
+ }
464
+ if (c_dataVerification["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)]) {
465
+ dataVerification["".concat(h, "_").concat(c)] = c_dataVerification["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)];
466
+ }
467
+ if ((_g = x[c]) === null || _g === void 0 ? void 0 : _g.mc) {
468
+ if (((_j = (_h = x[c]) === null || _h === void 0 ? void 0 : _h.mc) === null || _j === void 0 ? void 0 : _j.rs) != null) {
469
+ delete cfg.merge["".concat(x[c].mc.r, "_").concat(x[c].mc.c)];
470
+ }
471
+ delete x[c].mc;
472
+ }
473
+ var value = null;
474
+ if (copyData[h - minh] != null && copyData[h - minh][c - minc] != null) {
475
+ value = copyData[h - minh][c - minc];
476
+ }
477
+ x[c] = _.cloneDeep(value);
478
+ if (value != null && copyHasMC && ((_k = x[c]) === null || _k === void 0 ? void 0 : _k.mc)) {
479
+ if (x[c].mc.rs != null) {
480
+ x[c].mc.r = h;
481
+ x[c].mc.c = c;
482
+ cfg.merge["".concat(x[c].mc.r, "_").concat(x[c].mc.c)] = x[c].mc;
483
+ offsetMC["".concat(value.mc.r, "_").concat(value.mc.c)] = [x[c].mc.r, x[c].mc.c];
484
+ } else {
485
+ x[c] = {
486
+ mc: {
487
+ r: offsetMC["".concat(value.mc.r, "_").concat(value.mc.c)][0],
488
+ c: offsetMC["".concat(value.mc.r, "_").concat(value.mc.c)][1]
489
+ }
490
+ };
491
+ }
492
+ }
493
+ }
494
+ d[h] = x;
495
+ }
496
+ last.row = [minh, maxh];
497
+ last.column = [minc, maxc];
498
+ if (copyRowlChange) {}
499
+ var source;
500
+ var target;
501
+ if (ctx.currentSheetId !== copySheetId) {
502
+ var sourceData = _.cloneDeep(ctx.luckysheetfile[getSheetIndex(ctx, copySheetId)].data);
503
+ var sourceConfig = _.cloneDeep(ctx.luckysheetfile[getSheetIndex(ctx, copySheetId)].config);
504
+ var sourceCurData = _.cloneDeep(sourceData);
505
+ var sourceCurConfig = _.cloneDeep(sourceConfig) || {};
506
+ if (sourceCurConfig.merge == null) {
507
+ sourceCurConfig.merge = {};
508
+ }
509
+ for (var source_r = c_r1; source_r <= c_r2; source_r += 1) {
510
+ for (var source_c = c_c1; source_c <= c_c2; source_c += 1) {
511
+ var cell = sourceCurData[source_r][source_c];
512
+ if (cell === null || cell === void 0 ? void 0 : cell.mc) {
513
+ if ("rs" in cell.mc) {
514
+ delete sourceCurConfig.merge["".concat(cell.mc.r, "_").concat(cell.mc.c)];
515
+ }
516
+ delete cell.mc;
517
+ }
518
+ sourceCurData[source_r][source_c] = null;
519
+ }
520
+ }
521
+ if (copyRowlChange) {}
522
+ if (sourceCurConfig.borderInfo && sourceCurConfig.borderInfo.length > 0) {
523
+ var source_borderInfo = [];
524
+ for (var i = 0; i < sourceCurConfig.borderInfo.length; i += 1) {
525
+ var bd_rangeType = sourceCurConfig.borderInfo[i].rangeType;
526
+ if (bd_rangeType === "range") {
527
+ var bd_range = sourceCurConfig.borderInfo[i].range;
528
+ var bd_emptyRange = [];
529
+ for (var j = 0; j < bd_range.length; j += 1) {
530
+ bd_emptyRange = bd_emptyRange.concat(CFSplitRange(bd_range[j], {
531
+ row: [c_r1, c_r2],
532
+ column: [c_c1, c_c2]
533
+ }, {
534
+ row: [minh, maxh],
535
+ column: [minc, maxc]
536
+ }, "restPart"));
537
+ }
538
+ sourceCurConfig.borderInfo[i].range = bd_emptyRange;
539
+ source_borderInfo.push(sourceCurConfig.borderInfo[i]);
540
+ } else if (bd_rangeType === "cell") {
541
+ var bd_r = sourceCurConfig.borderInfo[i].value.row_index;
542
+ var bd_c = sourceCurConfig.borderInfo[i].value.col_index;
543
+ if (!(bd_r >= c_r1 && bd_r <= c_r2 && bd_c >= c_c1 && bd_c <= c_c2)) {
544
+ source_borderInfo.push(sourceCurConfig.borderInfo[i]);
545
+ }
546
+ }
547
+ }
548
+ sourceCurConfig.borderInfo = source_borderInfo;
549
+ }
550
+ var source_cdformat = _.cloneDeep(ctx.luckysheetfile[getSheetIndex(ctx, copySheetId)].luckysheet_conditionformat_save);
551
+ var source_curCdformat = _.cloneDeep(source_cdformat);
552
+ var ruleArr = [];
553
+ if (source_curCdformat != null && source_curCdformat.length > 0) {
554
+ for (var i = 0; i < source_curCdformat.length; i += 1) {
555
+ var source_curCdformat_cellrange = source_curCdformat[i].cellrange;
556
+ var emptyRange = [];
557
+ var emptyRange2 = [];
558
+ for (var j = 0; j < source_curCdformat_cellrange.length; j += 1) {
559
+ var range = CFSplitRange(source_curCdformat_cellrange[j], {
560
+ row: [c_r1, c_r2],
561
+ column: [c_c1, c_c2]
562
+ }, {
563
+ row: [minh, maxh],
564
+ column: [minc, maxc]
565
+ }, "restPart");
566
+ emptyRange = emptyRange.concat(range);
567
+ var range2 = CFSplitRange(source_curCdformat_cellrange[j], {
568
+ row: [c_r1, c_r2],
569
+ column: [c_c1, c_c2]
570
+ }, {
571
+ row: [minh, maxh],
572
+ column: [minc, maxc]
573
+ }, "operatePart");
574
+ if (range2.length > 0) {
575
+ emptyRange2 = emptyRange2.concat(range2);
576
+ }
577
+ }
578
+ source_curCdformat[i].cellrange = emptyRange;
579
+ if (emptyRange2.length > 0) {
580
+ var ruleObj = (_l = source_curCdformat[i]) !== null && _l !== void 0 ? _l : {};
581
+ ruleObj.cellrange = emptyRange2;
582
+ ruleArr.push(ruleObj);
583
+ }
584
+ }
585
+ }
586
+ var target_cdformat = _.cloneDeep(ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].luckysheet_conditionformat_save);
587
+ var target_curCdformat = _.cloneDeep(target_cdformat);
588
+ if (ruleArr.length > 0) {
589
+ target_curCdformat = target_curCdformat === null || target_curCdformat === void 0 ? void 0 : target_curCdformat.concat(ruleArr);
590
+ }
591
+ for (var i = c_r1; i <= c_r2; i += 1) {
592
+ for (var j = c_c1; j <= c_c2; j += 1) {
593
+ delete c_dataVerification["".concat(i, "_").concat(j)];
594
+ }
595
+ }
596
+ source = {
597
+ sheetId: copySheetId,
598
+ data: sourceData,
599
+ curData: sourceCurData,
600
+ config: sourceConfig,
601
+ curConfig: sourceCurConfig,
602
+ cdformat: source_cdformat,
603
+ curCdformat: source_curCdformat,
604
+ dataVerification: _.cloneDeep(ctx.luckysheetfile[getSheetIndex(ctx, copySheetId)].dataVerification),
605
+ curDataVerification: c_dataVerification,
606
+ range: {
607
+ row: [c_r1, c_r2],
608
+ column: [c_c1, c_c2]
609
+ }
610
+ };
611
+ target = {
612
+ sheetId: ctx.currentSheetId,
613
+ data: getFlowdata(ctx),
614
+ curData: d,
615
+ config: _.cloneDeep(ctx.config),
616
+ curConfig: cfg,
617
+ cdformat: target_cdformat,
618
+ curCdformat: target_curCdformat,
619
+ dataVerification: _.cloneDeep(ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].dataVerification),
620
+ curDataVerification: dataVerification,
621
+ range: {
622
+ row: [minh, maxh],
623
+ column: [minc, maxc]
624
+ }
625
+ };
626
+ } else {
627
+ var cdformat = _.cloneDeep(ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].luckysheet_conditionformat_save);
628
+ var curCdformat = _.cloneDeep(cdformat);
629
+ if (curCdformat != null && curCdformat.length > 0) {
630
+ for (var i = 0; i < curCdformat.length; i += 1) {
631
+ var cellrange = curCdformat[i].cellrange;
632
+ var emptyRange = [];
633
+ for (var j = 0; j < cellrange.length; j += 1) {
634
+ var range = CFSplitRange(cellrange[j], {
635
+ row: [c_r1, c_r2],
636
+ column: [c_c1, c_c2]
637
+ }, {
638
+ row: [minh, maxh],
639
+ column: [minc, maxc]
640
+ }, "allPart");
641
+ emptyRange = emptyRange.concat(range);
642
+ }
643
+ curCdformat[i].cellrange = emptyRange;
644
+ }
645
+ }
646
+ source = {
647
+ sheetId: ctx.currentSheetId,
648
+ data: getFlowdata(ctx),
649
+ curData: d,
650
+ config: _.cloneDeep(ctx.config),
651
+ curConfig: cfg,
652
+ cdformat: cdformat,
653
+ curCdformat: curCdformat,
654
+ dataVerification: _.cloneDeep(ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].dataVerification),
655
+ curDataVerification: dataVerification,
656
+ range: {
657
+ row: [c_r1, c_r2],
658
+ column: [c_c1, c_c2]
659
+ }
660
+ };
661
+ target = {
662
+ sheetId: ctx.currentSheetId,
663
+ data: getFlowdata(ctx),
664
+ curData: d,
665
+ config: _.cloneDeep(ctx.config),
666
+ curConfig: cfg,
667
+ cdformat: cdformat,
668
+ curCdformat: curCdformat,
669
+ dataVerification: _.cloneDeep(ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].dataVerification),
670
+ curDataVerification: dataVerification,
671
+ range: {
672
+ row: [minh, maxh],
673
+ column: [minc, maxc]
674
+ }
675
+ };
676
+ }
677
+ if (addr > 0 || addc > 0) {
678
+ postPasteCut(ctx, source, target, true);
679
+ } else {
680
+ postPasteCut(ctx, source, target, copyRowlChange);
681
+ }
682
+ }
683
+ function pasteHandlerOfCopyPaste(ctx, copyRange) {
684
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
685
+ var allowEdit = isAllowEdit(ctx);
686
+ if (!allowEdit) return;
687
+ if (!copyRange) return;
688
+ var cfg = ctx.config;
689
+ if (_.isNil(cfg.merge)) {
690
+ cfg.merge = {};
691
+ }
692
+ var copyHasMC = copyRange.HasMC;
693
+ var copyRowlChange = copyRange.RowlChange;
694
+ var copySheetIndex = copyRange.dataSheetId;
695
+ var c_r1 = copyRange.copyRange[0].row[0];
696
+ var c_r2 = copyRange.copyRange[0].row[1];
697
+ var c_c1 = copyRange.copyRange[0].column[0];
698
+ var c_c2 = copyRange.copyRange[0].column[1];
699
+ var arr = [];
700
+ var isSameRow = false;
701
+ var _loop_1 = function _loop_1(i) {
702
+ var arrData = getdatabyselection(ctx, {
703
+ row: copyRange.copyRange[i].row,
704
+ column: copyRange.copyRange[i].column
705
+ }, copySheetIndex);
706
+ if (copyRange.copyRange.length > 1) {
707
+ if (c_r1 === copyRange.copyRange[1].row[0] && c_r2 === copyRange.copyRange[1].row[1]) {
708
+ arrData = arrData[0].map(function (col, a) {
709
+ return arrData.map(function (row) {
710
+ return row[a];
711
+ });
712
+ });
713
+ arr = arr.concat(arrData);
714
+ isSameRow = true;
715
+ } else if (c_c1 === copyRange.copyRange[1].column[0] && c_c2 === copyRange.copyRange[1].column[1]) {
716
+ arr = arr.concat(arrData);
717
+ }
718
+ } else {
719
+ arr = arrData;
720
+ }
721
+ };
722
+ for (var i = 0; i < copyRange.copyRange.length; i += 1) {
723
+ _loop_1(i);
724
+ }
725
+ if (isSameRow) {
726
+ arr = arr[0].map(function (col, b) {
727
+ return arr.map(function (row) {
728
+ return row[b];
729
+ });
730
+ });
731
+ }
732
+ var copyData = _.cloneDeep(arr);
733
+ if (copyRange.copyRange.length > 1) {
734
+ for (var i = 0; i < copyData.length; i += 1) {
735
+ for (var j = 0; j < copyData[i].length; j += 1) {
736
+ if (copyData[i][j] != null && copyData[i][j].f != null) {
737
+ delete copyData[i][j].f;
738
+ delete copyData[i][j].spl;
739
+ }
740
+ }
741
+ }
742
+ }
743
+ var copyh = copyData.length;
744
+ var copyc = copyData[0].length;
745
+ var last = (_a = ctx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[ctx.luckysheet_select_save.length - 1];
746
+ if (!last) return;
747
+ var minh = last.row[0];
748
+ var maxh = last.row[1];
749
+ var minc = last.column[0];
750
+ var maxc = last.column[1];
751
+ var mh = (maxh - minh + 1) % copyh;
752
+ var mc = (maxc - minc + 1) % copyc;
753
+ if (mh !== 0 || mc !== 0) {
754
+ maxh = minh + copyh - 1;
755
+ maxc = minc + copyc - 1;
756
+ }
757
+ var has_PartMC = false;
758
+ if (!_.isNil(cfg.merge)) {
759
+ has_PartMC = hasPartMC(ctx, cfg, minh, maxh, minc, maxc);
760
+ }
761
+ if (has_PartMC) {
762
+ return;
763
+ }
764
+ var timesH = (maxh - minh + 1) / copyh;
765
+ var timesC = (maxc - minc + 1) / copyc;
766
+ var d = getFlowdata(ctx);
767
+ if (!d) return;
768
+ var rowMaxLength = d.length;
769
+ var cellMaxLength = d[0].length;
770
+ var addr = copyh + minh - rowMaxLength;
771
+ var addc = copyc + minc - cellMaxLength;
772
+ if (addr > 0 || addc > 0) {
773
+ expandRowsAndColumns(d, addr, addc);
774
+ }
775
+ var borderInfoCompute = getBorderInfoCompute(ctx, copySheetIndex);
776
+ var c_dataVerification = _.cloneDeep(ctx.luckysheetfile[getSheetIndex(ctx, copySheetIndex)].dataVerification) || {};
777
+ var dataVerification = null;
778
+ var mth = 0;
779
+ var mtc = 0;
780
+ var maxcellCahe = 0;
781
+ var maxrowCache = 0;
782
+ var file = ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)];
783
+ var hiddenRows = new Set(Object.keys(((_b = file.config) === null || _b === void 0 ? void 0 : _b.rowhidden) || {}));
784
+ var hiddenCols = new Set(Object.keys(((_c = file.config) === null || _c === void 0 ? void 0 : _c.colhidden) || {}));
785
+ for (var th = 1; th <= timesH; th += 1) {
786
+ for (var tc = 1; tc <= timesC; tc += 1) {
787
+ mth = minh + (th - 1) * copyh;
788
+ mtc = minc + (tc - 1) * copyc;
789
+ maxrowCache = minh + th * copyh;
790
+ maxcellCahe = minc + tc * copyc;
791
+ var offsetRow = mth - c_r1;
792
+ var offsetCol = mtc - c_c1;
793
+ var offsetMC = {};
794
+ for (var h = mth; h < maxrowCache; h += 1) {
795
+ if (hiddenRows === null || hiddenRows === void 0 ? void 0 : hiddenRows.has(h.toString())) continue;
796
+ var x = d[h];
797
+ for (var c = mtc; c < maxcellCahe; c += 1) {
798
+ if (hiddenCols === null || hiddenCols === void 0 ? void 0 : hiddenCols.has(c.toString())) continue;
799
+ if (borderInfoCompute["".concat(c_r1 + h - mth, "_").concat(c_c1 + c - mtc)] && !borderInfoCompute["".concat(c_r1 + h - mth, "_").concat(c_c1 + c - mtc)].s) {
800
+ var bd_obj = {
801
+ rangeType: "cell",
802
+ value: {
803
+ row_index: h,
804
+ col_index: c,
805
+ l: borderInfoCompute["".concat(c_r1 + h - mth, "_").concat(c_c1 + c - mtc)].l,
806
+ r: borderInfoCompute["".concat(c_r1 + h - mth, "_").concat(c_c1 + c - mtc)].r,
807
+ t: borderInfoCompute["".concat(c_r1 + h - mth, "_").concat(c_c1 + c - mtc)].t,
808
+ b: borderInfoCompute["".concat(c_r1 + h - mth, "_").concat(c_c1 + c - mtc)].b
809
+ }
810
+ };
811
+ if (_.isNil(cfg.borderInfo)) {
812
+ cfg.borderInfo = [];
813
+ }
814
+ cfg.borderInfo.push(bd_obj);
815
+ } else if (borderInfoCompute["".concat(h, "_").concat(c)]) {
816
+ var bd_obj = {
817
+ rangeType: "cell",
818
+ value: {
819
+ row_index: h,
820
+ col_index: c,
821
+ l: null,
822
+ r: null,
823
+ t: null,
824
+ b: null
825
+ }
826
+ };
827
+ if (_.isNil(cfg.borderInfo)) {
828
+ cfg.borderInfo = [];
829
+ }
830
+ cfg.borderInfo.push(bd_obj);
831
+ } else if (borderInfoCompute["".concat(c_r1 + h - mth, "_").concat(c_c1 + c - mtc)]) {
832
+ var bd_obj = {
833
+ rangeType: "range",
834
+ borderType: "border-slash",
835
+ color: borderInfoCompute["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)].s.color,
836
+ style: borderInfoCompute["".concat(c_r1 + h - minh, "_").concat(c_c1 + c - minc)].s.style,
837
+ range: normalizeSelection(ctx, [{
838
+ row: [h, h],
839
+ column: [c, c]
840
+ }])
841
+ };
842
+ if (cfg.borderInfo == null) {
843
+ cfg.borderInfo = [];
844
+ }
845
+ cfg.borderInfo.push(bd_obj);
846
+ }
847
+ if (c_dataVerification["".concat(c_r1 + h - mth, "_").concat(c_c1 + c - mtc)]) {
848
+ if (_.isNil(dataVerification)) {
849
+ dataVerification = _.cloneDeep(((_d = ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)]) === null || _d === void 0 ? void 0 : _d.dataVerification) || {});
850
+ }
851
+ dataVerification["".concat(h, "_").concat(c)] = c_dataVerification["".concat(c_r1 + h - mth, "_").concat(c_c1 + c - mtc)];
852
+ }
853
+ if (((_e = x[c]) === null || _e === void 0 ? void 0 : _e.mc) != null) {
854
+ if ("rs" in x[c].mc) {
855
+ delete cfg.merge["".concat(x[c].mc.r, "_").concat(x[c].mc.c)];
856
+ }
857
+ delete x[c].mc;
858
+ }
859
+ var value = null;
860
+ if ((_f = copyData[h - mth]) === null || _f === void 0 ? void 0 : _f[c - mtc]) {
861
+ value = _.cloneDeep(copyData[h - mth][c - mtc]);
862
+ if ((value === null || value === void 0 ? void 0 : value.v) && (value === null || value === void 0 ? void 0 : value.f) && (value === null || value === void 0 ? void 0 : value.isDataBlockFormula) && arr.length === 1) {
863
+ value.m = "Loading...";
864
+ }
865
+ }
866
+ if (!_.isNil(value) && !_.isNil(value.f)) {
867
+ var func = value.f;
868
+ if (offsetRow > 0) {
869
+ func = "=".concat(functionCopy(ctx, func, "down", offsetRow));
870
+ }
871
+ if (offsetRow < 0) {
872
+ func = "=".concat(functionCopy(ctx, func, "up", Math.abs(offsetRow)));
873
+ }
874
+ if (offsetCol > 0) {
875
+ func = "=".concat(functionCopy(ctx, func, "right", offsetCol));
876
+ }
877
+ if (offsetCol < 0) {
878
+ func = "=".concat(functionCopy(ctx, func, "left", Math.abs(offsetCol)));
879
+ }
880
+ var funcV = execfunction(ctx, func, h, c, undefined, undefined, true);
881
+ var afterUpdateCell = ctx.hooks.afterUpdateCell;
882
+ if (afterUpdateCell && arr.length === 1) {
883
+ afterUpdateCell(h, c, null, __assign(__assign({}, value), {
884
+ v: funcV[1],
885
+ m: "[object Promise]"
886
+ }));
887
+ }
888
+ if (!_.isNil(value.spl)) {}
889
+ }
890
+ x[c] = _.cloneDeep(value);
891
+ if (value != null && copyHasMC && ((_g = x === null || x === void 0 ? void 0 : x[c]) === null || _g === void 0 ? void 0 : _g.mc)) {
892
+ if (((_j = (_h = x === null || x === void 0 ? void 0 : x[c]) === null || _h === void 0 ? void 0 : _h.mc) === null || _j === void 0 ? void 0 : _j.rs) != null) {
893
+ x[c].mc.r = h;
894
+ x[c].mc.c = c;
895
+ cfg.merge["".concat(h, "_").concat(c)] = x[c].mc;
896
+ offsetMC["".concat(value.mc.r, "_").concat(value.mc.c)] = [x[c].mc.r, x[c].mc.c];
897
+ } else {
898
+ x[c] = {
899
+ mc: {
900
+ r: offsetMC["".concat(value.mc.r, "_").concat(value.mc.c)][0],
901
+ c: offsetMC["".concat(value.mc.r, "_").concat(value.mc.c)][1]
902
+ }
903
+ };
904
+ }
905
+ }
906
+ }
907
+ d[h] = x;
908
+ }
909
+ }
910
+ }
911
+ var cdformat = null;
912
+ if (copyRange.copyRange.length === 1) {
913
+ var c_file = ctx.luckysheetfile[getSheetIndex(ctx, copySheetIndex)];
914
+ var a_file = ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)];
915
+ var ruleArr_cf = _.cloneDeep(c_file.luckysheet_conditionformat_save);
916
+ if (!_.isNil(ruleArr_cf) && ruleArr_cf.length > 0) {
917
+ cdformat = (_k = _.cloneDeep(a_file.luckysheet_conditionformat_save)) !== null && _k !== void 0 ? _k : [];
918
+ for (var i = 0; i < ruleArr_cf.length; i += 1) {
919
+ var cf_range = ruleArr_cf[i].cellrange;
920
+ var emptyRange = [];
921
+ for (var th = 1; th <= timesH; th += 1) {
922
+ for (var tc = 1; tc <= timesC; tc += 1) {
923
+ mth = minh + (th - 1) * copyh;
924
+ mtc = minc + (tc - 1) * copyc;
925
+ maxrowCache = minh + th * copyh;
926
+ maxcellCahe = minc + tc * copyc;
927
+ for (var j = 0; j < cf_range.length; j += 1) {
928
+ var range = CFSplitRange(cf_range[j], {
929
+ row: [c_r1, c_r2],
930
+ column: [c_c1, c_c2]
931
+ }, {
932
+ row: [mth, maxrowCache - 1],
933
+ column: [mtc, maxcellCahe - 1]
934
+ }, "operatePart");
935
+ if (range.length > 0) {
936
+ emptyRange = emptyRange.concat(range);
937
+ }
938
+ }
939
+ }
940
+ }
941
+ if (emptyRange.length > 0) {
942
+ ruleArr_cf[i].cellrange = emptyRange;
943
+ cdformat.push(ruleArr_cf[i]);
944
+ }
945
+ }
946
+ }
947
+ }
948
+ last.row = [minh, maxh];
949
+ last.column = [minc, maxc];
950
+ file.config = cfg;
951
+ file.luckysheet_conditionformat_save = cdformat;
952
+ file.dataVerification = __assign(__assign({}, file.dataVerification), dataVerification);
953
+ if (((_l = ctx.luckysheet_select_save) === null || _l === void 0 ? void 0 : _l.length) === 1 && ((_m = ctx.luckysheet_copy_save) === null || _m === void 0 ? void 0 : _m.copyRange.length) === 1) {
954
+ _.forEach((_o = ctx.luckysheet_copy_save) === null || _o === void 0 ? void 0 : _o.copyRange, function (range) {
955
+ var _a, _b, _c;
956
+ var srcIndex = getSheetIndex(ctx, (_a = ctx.luckysheet_copy_save) === null || _a === void 0 ? void 0 : _a.dataSheetId);
957
+ for (var r = 0; r <= range.row[1] - range.row[0]; r += 1) {
958
+ for (var c = 0; c <= range.column[1] - range.column[0]; c += 1) {
959
+ var srcRow = r + range.row[0];
960
+ var srcCol = c + range.column[0];
961
+ var srcLink = (_b = ctx.luckysheetfile[srcIndex].hyperlink) === null || _b === void 0 ? void 0 : _b["".concat(srcRow, "_").concat(srcCol)];
962
+ if (!srcLink) continue;
963
+ var targetR = r + ctx.luckysheet_select_save[0].row[0];
964
+ var targetC = c + ctx.luckysheet_select_save[0].column[0];
965
+ setCellHyperlink(ctx, (_c = ctx.luckysheet_copy_save) === null || _c === void 0 ? void 0 : _c.dataSheetId, targetR, targetC, srcLink);
966
+ }
967
+ }
968
+ });
969
+ }
970
+ if (copyRowlChange || addr > 0 || addc > 0) {
971
+ jfrefreshgrid(ctx, d, ctx.luckysheet_select_save);
972
+ } else {
973
+ jfrefreshgrid(ctx, d, ctx.luckysheet_select_save);
974
+ }
975
+ }
976
+ function handleFormulaStringPaste(ctx, formulaStr) {
977
+ var r = ctx.luckysheet_select_save[0].row[0];
978
+ var c = ctx.luckysheet_select_save[0].column[0];
979
+ var funcV = execfunction(ctx, formulaStr, r, c, undefined, undefined, true);
980
+ var val = funcV[1];
981
+ var isDataBlockRespose = typeof val !== "string" && typeof val !== "number";
982
+ var d = getFlowdata(ctx);
983
+ if (!d) return;
984
+ if (!d[r][c]) d[r][c] = {};
985
+ d[r][c].m = isDataBlockRespose ? "Loading..." : val.toString();
986
+ d[r][c].v = val;
987
+ d[r][c].f = formulaStr;
988
+ var cellTemp = {
989
+ m: "",
990
+ v: "",
991
+ f: ""
992
+ };
993
+ cellTemp.m = isDataBlockRespose ? "Loading..." : val.toString();
994
+ cellTemp.v = val;
995
+ cellTemp.f = formulaStr;
996
+ var afterUpdateCell = ctx.hooks.afterUpdateCell;
997
+ if (afterUpdateCell && isDataBlockRespose) {
998
+ afterUpdateCell(r, c, null, cellTemp);
999
+ }
1000
+ }
1001
+ export function parseAsLinkIfUrl(txtdata, ctx) {
1002
+ var _a, _b, _c, _d, _e, _f, _g;
1003
+ var urlRegex = /^(https?:\/\/[^\s]+)/;
1004
+ if (urlRegex.test(txtdata)) {
1005
+ var last = (_a = ctx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[ctx.luckysheet_select_save.length - 1];
1006
+ if (last) {
1007
+ var rowIndex = (_d = (_b = last.row_focus) !== null && _b !== void 0 ? _b : (_c = last.row) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : 0;
1008
+ var colIndex = (_g = (_e = last.column_focus) !== null && _e !== void 0 ? _e : (_f = last.column) === null || _f === void 0 ? void 0 : _f[0]) !== null && _g !== void 0 ? _g : 0;
1009
+ saveHyperlink(ctx, rowIndex, colIndex, txtdata, "webpage", txtdata);
1010
+ }
1011
+ }
1012
+ }
1013
+ export function handlePaste(ctx, e) {
1014
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
1015
+ var allowEdit = isAllowEdit(ctx);
1016
+ if (!allowEdit) return;
1017
+ if (selectionCache.isPasteAction) {
1018
+ ctx.luckysheetCellUpdate = [];
1019
+ selectionCache.isPasteAction = false;
1020
+ var clipboardData = e.clipboardData;
1021
+ if (!clipboardData) {
1022
+ clipboardData = window.clipboardData;
1023
+ }
1024
+ if (!clipboardData) return;
1025
+ var text = clipboardData.getData("text/plain");
1026
+ if (text) {
1027
+ parseAsLinkIfUrl(text, ctx);
1028
+ }
1029
+ var txtdata = clipboardData.getData("text/html") || clipboardData.getData("text/plain");
1030
+ var isEqual = true;
1031
+ if (txtdata.indexOf("fortune-copy-action-table") > -1 && ((_a = ctx.luckysheet_copy_save) === null || _a === void 0 ? void 0 : _a.copyRange) != null && ctx.luckysheet_copy_save.copyRange.length > 0) {
1032
+ var cpDataArr = [];
1033
+ var reg = /<tr.*?>(.*?)<\/tr>/g;
1034
+ var reg2 = /<td.*?>(.*?)<\/td>/g;
1035
+ var regArr = txtdata.match(reg) || [];
1036
+ for (var i = 0; i < regArr.length; i += 1) {
1037
+ var cpRowArr = [];
1038
+ var reg2Arr = regArr[i].match(reg2);
1039
+ if (!_.isNil(reg2Arr)) {
1040
+ for (var j = 0; j < reg2Arr.length; j += 1) {
1041
+ var cpValue = reg2Arr[j].replace(/<td.*?>/g, "").replace(/<\/td>/g, "");
1042
+ cpRowArr.push(cpValue);
1043
+ }
1044
+ }
1045
+ cpDataArr.push(cpRowArr);
1046
+ }
1047
+ var copy_r1 = ctx.luckysheet_copy_save.copyRange[0].row[0];
1048
+ var copy_r2 = ctx.luckysheet_copy_save.copyRange[0].row[1];
1049
+ var copy_c1 = ctx.luckysheet_copy_save.copyRange[0].column[0];
1050
+ var copy_c2 = ctx.luckysheet_copy_save.copyRange[0].column[1];
1051
+ var copy_index = ctx.luckysheet_copy_save.dataSheetId;
1052
+ var d = void 0;
1053
+ if (copy_index === ctx.currentSheetId) {
1054
+ d = getFlowdata(ctx);
1055
+ } else {
1056
+ var index = getSheetIndex(ctx, copy_index);
1057
+ if (_.isNil(index)) return;
1058
+ d = ctx.luckysheetfile[index].data;
1059
+ }
1060
+ if (!d) return;
1061
+ for (var r = copy_r1; r <= copy_r2; r += 1) {
1062
+ if (r - copy_r1 > cpDataArr.length - 1) {
1063
+ break;
1064
+ }
1065
+ for (var c = copy_c1; c <= copy_c2; c += 1) {
1066
+ var cell = d[r][c];
1067
+ var isInlineStr = false;
1068
+ if (!_.isNil(cell) && !_.isNil(cell.mc) && _.isNil(cell.mc.rs)) {
1069
+ continue;
1070
+ }
1071
+ var v = void 0;
1072
+ if (!_.isNil(cell)) {
1073
+ if (((_d = (_c = (_b = cell.ct) === null || _b === void 0 ? void 0 : _b.fa) === null || _c === void 0 ? void 0 : _c.indexOf("w")) !== null && _d !== void 0 ? _d : -1) > -1) {
1074
+ v = (_f = (_e = d[r]) === null || _e === void 0 ? void 0 : _e[c]) === null || _f === void 0 ? void 0 : _f.v;
1075
+ } else {
1076
+ v = (_h = (_g = d[r]) === null || _g === void 0 ? void 0 : _g[c]) === null || _h === void 0 ? void 0 : _h.m;
1077
+ }
1078
+ } else {
1079
+ v = "";
1080
+ }
1081
+ if (_.isNil(v) && ((_l = (_k = (_j = d[r]) === null || _j === void 0 ? void 0 : _j[c]) === null || _k === void 0 ? void 0 : _k.ct) === null || _l === void 0 ? void 0 : _l.t) === "inlineStr") {
1082
+ v = d[r][c].ct.s.map(function (val) {
1083
+ return val.v;
1084
+ }).join("");
1085
+ isInlineStr = true;
1086
+ }
1087
+ if (_.isNil(v)) {
1088
+ v = "";
1089
+ }
1090
+ if (isInlineStr) {} else {
1091
+ if (_.trim(cpDataArr[r - copy_r1][c - copy_c1]) !== _.trim(v)) {
1092
+ isEqual = false;
1093
+ break;
1094
+ }
1095
+ }
1096
+ }
1097
+ }
1098
+ }
1099
+ var locale_fontjson_1 = locale(ctx).fontjson;
1100
+ if (((_o = (_m = ctx.hooks).beforePaste) === null || _o === void 0 ? void 0 : _o.call(_m, ctx.luckysheet_select_save, txtdata)) === false) {
1101
+ return;
1102
+ }
1103
+ if (txtdata.indexOf("fortune-copy-action-table") > -1 && ((_p = ctx.luckysheet_copy_save) === null || _p === void 0 ? void 0 : _p.copyRange) != null && ctx.luckysheet_copy_save.copyRange.length > 0 && isEqual) {
1104
+ if (ctx.luckysheet_paste_iscut) {
1105
+ ctx.luckysheet_paste_iscut = false;
1106
+ pasteHandlerOfCutPaste(ctx, ctx.luckysheet_copy_save);
1107
+ ctx.luckysheet_selection_range = [];
1108
+ } else {
1109
+ pasteHandlerOfCopyPaste(ctx, ctx.luckysheet_copy_save);
1110
+ }
1111
+ } else if (txtdata.indexOf("fortune-copy-action-image") > -1) {} else {
1112
+ if (txtdata.indexOf("table") > -1) {
1113
+ var ele = document.createElement("div");
1114
+ ele.innerHTML = txtdata;
1115
+ var trList = ele.querySelectorAll("table tr");
1116
+ if (trList.length === 0) {
1117
+ ele.remove();
1118
+ return;
1119
+ }
1120
+ var data_1 = new Array(trList.length);
1121
+ var colLen_1 = 0;
1122
+ _.forEach(trList[0].querySelectorAll("td"), function (td) {
1123
+ var colspan = td.colSpan;
1124
+ if (Number.isNaN(colspan)) {
1125
+ colspan = 1;
1126
+ }
1127
+ colLen_1 += colspan;
1128
+ });
1129
+ for (var i = 0; i < data_1.length; i += 1) {
1130
+ data_1[i] = new Array(colLen_1);
1131
+ }
1132
+ var r_1 = 0;
1133
+ var borderInfo_1 = {};
1134
+ var styleInner = ((_q = ele.querySelectorAll("style")[0]) === null || _q === void 0 ? void 0 : _q.innerHTML) || "";
1135
+ var patternReg = /{([^}]*)}/g;
1136
+ var patternStyle = styleInner.match(patternReg);
1137
+ var nameReg = /^[^\t].*/gm;
1138
+ var patternName = _.initial(styleInner.match(nameReg));
1139
+ var allStyleList_1 = patternName.length === (patternStyle === null || patternStyle === void 0 ? void 0 : patternStyle.length) && _typeof(patternName) === _typeof(patternStyle) ? _.fromPairs(_.zip(patternName, patternStyle)) : {};
1140
+ var index_1 = getSheetIndex(ctx, ctx.currentSheetId);
1141
+ if (!_.isNil(index_1)) {
1142
+ if (_.isNil(ctx.luckysheetfile[index_1].config)) {
1143
+ ctx.luckysheetfile[index_1].config = {};
1144
+ }
1145
+ if (_.isNil(ctx.luckysheetfile[index_1].config.rowlen)) {
1146
+ ctx.luckysheetfile[index_1].config.rowlen = {};
1147
+ }
1148
+ var rowHeightList_1 = ctx.luckysheetfile[index_1].config.rowlen;
1149
+ _.forEach(trList, function (tr) {
1150
+ var c = 0;
1151
+ var targetR = ctx.luckysheet_select_save[0].row[0] + r_1;
1152
+ var targetRowHeight = !_.isNil(tr.getAttribute("height")) ? parseInt(tr.getAttribute("height"), 10) : null;
1153
+ if (_.has(ctx.luckysheetfile[index_1].config.rowlen, targetR) && ctx.luckysheetfile[index_1].config.rowlen[targetR] !== targetRowHeight || !_.has(ctx.luckysheetfile[index_1].config.rowlen, targetR) && ctx.luckysheetfile[index_1].defaultRowHeight !== targetRowHeight) {
1154
+ rowHeightList_1[targetR] = targetRowHeight;
1155
+ }
1156
+ _.forEach(tr.querySelectorAll("td"), function (td) {
1157
+ var className = td.className;
1158
+ var cell = {};
1159
+ var txt = td.innerText || td.innerHTML;
1160
+ if (_.trim(txt).length === 0) {
1161
+ cell.v = undefined;
1162
+ cell.m = "";
1163
+ } else {
1164
+ var mask = genarate(txt);
1165
+ cell.m = mask[0], cell.ct = mask[1], cell.v = mask[2];
1166
+ if (/^0x?[a-fA-F0-9]+$/.test(txt)) {
1167
+ cell.ct = {
1168
+ fa: "@",
1169
+ t: "s"
1170
+ };
1171
+ cell.m = txt;
1172
+ cell.v = txt;
1173
+ }
1174
+ }
1175
+ var styleString = typeof allStyleList_1[".".concat(className)] === "string" ? allStyleList_1[".".concat(className)].substring(1, allStyleList_1[".".concat(className)].length - 1).split("\n\t") : [];
1176
+ var styles = {};
1177
+ _.forEach(styleString, function (s) {
1178
+ var styleList = s.split(":");
1179
+ styles[styleList[0]] = styleList === null || styleList === void 0 ? void 0 : styleList[1].replace(";", "");
1180
+ });
1181
+ if (!_.isNil(styles.border)) td.style.border = styles.border;
1182
+ var bg = td.style.backgroundColor || styles.background;
1183
+ if (bg === "rgba(0, 0, 0, 0)" || _.isEmpty(bg)) {
1184
+ bg = undefined;
1185
+ }
1186
+ cell.bg = bg;
1187
+ var fontWight = td.style.fontWeight;
1188
+ cell.bl = (fontWight.toString() === "400" || fontWight === "normal" || _.isEmpty(fontWight)) && !_.includes(styles["font-style"], "bold") && (!styles["font-weight"] || styles["font-weight"] === "400") ? 0 : 1;
1189
+ cell.it = (td.style.fontStyle === "normal" || _.isEmpty(td.style.fontStyle)) && !_.includes(styles["font-style"], "italic") ? 0 : 1;
1190
+ cell.un = !_.includes(styles["text-decoration"], "underline") ? undefined : 1;
1191
+ cell.cl = !_.includes(td.innerHTML, "<s>") ? undefined : 1;
1192
+ var ff = td.style.fontFamily || styles["font-family"] || "";
1193
+ var ffs = ff.split(",");
1194
+ for (var i = 0; i < ffs.length; i += 1) {
1195
+ var fa = _.trim(ffs[i].toLowerCase());
1196
+ fa = locale_fontjson_1[fa];
1197
+ if (_.isNil(fa)) {
1198
+ cell.ff = 0;
1199
+ } else {
1200
+ cell.ff = fa;
1201
+ break;
1202
+ }
1203
+ }
1204
+ var fs = Math.round(styles["font-size"] ? parseInt(styles["font-size"].replace("pt", ""), 10) : parseInt(td.style.fontSize || "13", 10) * 72 / 96);
1205
+ cell.fs = fs;
1206
+ cell.fc = td.style.color || styles.color;
1207
+ var ht = td.style.textAlign || styles["text-align"] || "left";
1208
+ if (ht === "center") {
1209
+ cell.ht = 0;
1210
+ } else if (ht === "right") {
1211
+ cell.ht = 2;
1212
+ } else {
1213
+ cell.ht = 1;
1214
+ }
1215
+ var regex = /vertical-align:\s*(.*?);/;
1216
+ var vt = td.style.verticalAlign || styles["vertical-align"] || !_.isNil(allStyleList_1.td) && allStyleList_1.td.match(regex).length > 0 && allStyleList_1.td.match(regex)[1] || "top";
1217
+ if (vt === "middle") {
1218
+ cell.vt = 0;
1219
+ } else if (vt === "top" || vt === "text-top") {
1220
+ cell.vt = 1;
1221
+ } else {
1222
+ cell.vt = 2;
1223
+ }
1224
+ if ("mso-rotate" in styles) {
1225
+ var rt = styles["mso-rotate"];
1226
+ cell.rt = parseFloat(rt);
1227
+ }
1228
+ while (c < colLen_1 && !_.isNil(data_1[r_1][c])) {
1229
+ c += 1;
1230
+ }
1231
+ if (c === colLen_1) {
1232
+ return true;
1233
+ }
1234
+ if (_.isNil(data_1[r_1][c])) {
1235
+ data_1[r_1][c] = cell;
1236
+ var rowspan = parseInt(td.getAttribute("rowspan"), 10);
1237
+ var colspan = parseInt(td.getAttribute("colspan"), 10);
1238
+ if (Number.isNaN(rowspan)) {
1239
+ rowspan = 1;
1240
+ }
1241
+ if (Number.isNaN(colspan)) {
1242
+ colspan = 1;
1243
+ }
1244
+ var r_ab = ctx.luckysheet_select_save[0].row[0] + r_1;
1245
+ var c_ab = ctx.luckysheet_select_save[0].column[0] + c;
1246
+ for (var rp = 0; rp < rowspan; rp += 1) {
1247
+ for (var cp = 0; cp < colspan; cp += 1) {
1248
+ if (rp === 0) {
1249
+ var bt = td.style.borderTop;
1250
+ if (!_.isEmpty(bt) && bt.substring(0, 3).toLowerCase() !== "0px") {
1251
+ var width = td.style.borderTopWidth;
1252
+ var type = td.style.borderTopStyle;
1253
+ var color = td.style.borderTopColor;
1254
+ var borderconfig = getQKBorder(width, type, color);
1255
+ if (!borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)]) {
1256
+ borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)] = {};
1257
+ }
1258
+ borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)].t = {
1259
+ style: borderconfig[0],
1260
+ color: borderconfig[1]
1261
+ };
1262
+ }
1263
+ }
1264
+ if (rp === rowspan - 1) {
1265
+ var bb = td.style.borderBottom;
1266
+ if (!_.isEmpty(bb) && bb.substring(0, 3).toLowerCase() !== "0px") {
1267
+ var width = td.style.borderBottomWidth;
1268
+ var type = td.style.borderBottomStyle;
1269
+ var color = td.style.borderBottomColor;
1270
+ var borderconfig = getQKBorder(width, type, color);
1271
+ if (!borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)]) {
1272
+ borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)] = {};
1273
+ }
1274
+ borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)].b = {
1275
+ style: borderconfig[0],
1276
+ color: borderconfig[1]
1277
+ };
1278
+ }
1279
+ }
1280
+ if (cp === 0) {
1281
+ var bl = td.style.borderLeft;
1282
+ if (!_.isEmpty(bl) && bl.substring(0, 3).toLowerCase() !== "0px") {
1283
+ var width = td.style.borderLeftWidth;
1284
+ var type = td.style.borderLeftStyle;
1285
+ var color = td.style.borderLeftColor;
1286
+ var borderconfig = getQKBorder(width, type, color);
1287
+ if (!borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)]) {
1288
+ borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)] = {};
1289
+ }
1290
+ borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)].l = {
1291
+ style: borderconfig[0],
1292
+ color: borderconfig[1]
1293
+ };
1294
+ }
1295
+ }
1296
+ if (cp === colspan - 1) {
1297
+ var br = td.style.borderLeft;
1298
+ if (!_.isEmpty(br) && br.substring(0, 3).toLowerCase() !== "0px") {
1299
+ var width = td.style.borderRightWidth;
1300
+ var type = td.style.borderRightStyle;
1301
+ var color = td.style.borderRightColor;
1302
+ var borderconfig = getQKBorder(width, type, color);
1303
+ if (!borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)]) {
1304
+ borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)] = {};
1305
+ }
1306
+ borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)].r = {
1307
+ style: borderconfig[0],
1308
+ color: borderconfig[1]
1309
+ };
1310
+ }
1311
+ }
1312
+ if (rp === 0 && cp === 0) {
1313
+ continue;
1314
+ }
1315
+ data_1[r_1 + rp][c + cp] = {
1316
+ mc: {
1317
+ r: r_ab,
1318
+ c: c_ab
1319
+ }
1320
+ };
1321
+ }
1322
+ }
1323
+ if (rowspan > 1 || colspan > 1) {
1324
+ var first = {
1325
+ rs: rowspan,
1326
+ cs: colspan,
1327
+ r: r_ab,
1328
+ c: c_ab
1329
+ };
1330
+ data_1[r_1][c].mc = first;
1331
+ }
1332
+ }
1333
+ c += 1;
1334
+ if (c === colLen_1) {
1335
+ return true;
1336
+ }
1337
+ return true;
1338
+ });
1339
+ r_1 += 1;
1340
+ });
1341
+ setRowHeight(ctx, rowHeightList_1);
1342
+ }
1343
+ ctx.luckysheet_selection_range = [];
1344
+ pasteHandler(ctx, data_1, borderInfo_1);
1345
+ ele.remove();
1346
+ } else if (clipboardData.files.length === 1 && clipboardData.files[0].type.indexOf("image") > -1) {} else {
1347
+ txtdata = clipboardData.getData("text/plain");
1348
+ var isExcelFormula = txtdata.startsWith("=");
1349
+ if (isExcelFormula) {
1350
+ handleFormulaStringPaste(ctx, txtdata);
1351
+ } else {
1352
+ pasteHandler(ctx, txtdata);
1353
+ var _txtdata = clipboardData.getData("text/html") || clipboardData.getData("text/plain");
1354
+ var embedUrl = sanitizeDuneUrl(_txtdata);
1355
+ if (embedUrl) {
1356
+ var last = (_r = ctx.luckysheet_select_save) === null || _r === void 0 ? void 0 : _r[ctx.luckysheet_select_save.length - 1];
1357
+ if (last) {
1358
+ var rowIndex = (_u = (_s = last.row_focus) !== null && _s !== void 0 ? _s : (_t = last.row) === null || _t === void 0 ? void 0 : _t[0]) !== null && _u !== void 0 ? _u : 0;
1359
+ var colIndex = (_x = (_v = last.column_focus) !== null && _v !== void 0 ? _v : (_w = last.column) === null || _w === void 0 ? void 0 : _w[0]) !== null && _x !== void 0 ? _x : 0;
1360
+ var left = colIndex === 0 ? 0 : ctx.visibledatacolumn[colIndex - 1];
1361
+ var top_1 = rowIndex === 0 ? 0 : ctx.visibledatarow[rowIndex + 5];
1362
+ ctx.showDunePreview = {
1363
+ url: txtdata,
1364
+ position: {
1365
+ left: left,
1366
+ top: top_1
1367
+ }
1368
+ };
1369
+ }
1370
+ }
1371
+ }
1372
+ }
1373
+ }
1374
+ } else if (ctx.luckysheetCellUpdate.length > 0) {
1375
+ e.preventDefault();
1376
+ var clipboardData = e.clipboardData;
1377
+ if (!clipboardData) {
1378
+ clipboardData = window.clipboardData;
1379
+ }
1380
+ var text = clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData("text/plain");
1381
+ if (text) {
1382
+ document.execCommand("insertText", false, text);
1383
+ parseAsLinkIfUrl(text, ctx);
1384
+ }
1385
+ }
1386
+ }
1387
+ export function handlePasteByClick(ctx, clipboardData, triggerType) {
1388
+ var _a, _b, _c;
1389
+ var allowEdit = isAllowEdit(ctx);
1390
+ if (!allowEdit) return;
1391
+ if (clipboardData) {
1392
+ var htmlWithPreservedNewlines = "<pre style=\"white-space: pre-wrap;\">".concat(clipboardData, "</pre>");
1393
+ clipboard.writeHtml(htmlWithPreservedNewlines);
1394
+ }
1395
+ var textarea = document.querySelector("#fortune-copy-content");
1396
+ var data = (textarea === null || textarea === void 0 ? void 0 : textarea.innerHTML) || (textarea === null || textarea === void 0 ? void 0 : textarea.textContent);
1397
+ if (!data) return;
1398
+ if (((_b = (_a = ctx.hooks).beforePaste) === null || _b === void 0 ? void 0 : _b.call(_a, ctx.luckysheet_select_save, data)) === false) {
1399
+ return;
1400
+ }
1401
+ if (data.indexOf("fortune-copy-action-table") > -1 && ((_c = ctx.luckysheet_copy_save) === null || _c === void 0 ? void 0 : _c.copyRange) != null && ctx.luckysheet_copy_save.copyRange.length > 0) {
1402
+ if (ctx.luckysheet_paste_iscut) {
1403
+ ctx.luckysheet_paste_iscut = false;
1404
+ pasteHandlerOfCutPaste(ctx, ctx.luckysheet_copy_save);
1405
+ } else {
1406
+ pasteHandlerOfCopyPaste(ctx, ctx.luckysheet_copy_save);
1407
+ }
1408
+ } else if (data.indexOf("fortune-copy-action-image") > -1) {} else if (triggerType !== "btn") {
1409
+ var isExcelFormula = clipboardData.startsWith("=");
1410
+ if (isExcelFormula) {
1411
+ handleFormulaStringPaste(ctx, clipboardData);
1412
+ } else {
1413
+ pasteHandler(ctx, clipboardData);
1414
+ }
1415
+ } else {}
1416
+ }