@fileverse-dev/fortune-core 1.0.4 → 1.0.6

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