@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,1092 @@
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
+ import _ from "lodash";
3
+ import { getFlowdata } from "../context";
4
+ import { getSheetIndex, indexToColumnChar, rgbToHex } from "../utils";
5
+ import { checkCF, getComputeMap } from "./ConditionFormat";
6
+ import { getFailureText, validateCellData } from "./dataVerification";
7
+ import { genarate, update } from "./format";
8
+ import { getRowHeight } from "../api";
9
+ import { delFunctionGroup, execfunction, execFunctionGroup, functionHTMLGenerate, getcellrange, iscelldata } from "./formula";
10
+ import { attrToCssName, convertSpanToShareString, isInlineStringCell, isInlineStringCT } from "./inline-string";
11
+ import { isRealNull, isRealNum, valueIsError } from "./validation";
12
+ import { getCellTextInfo } from "./text";
13
+ export function normalizedCellAttr(cell, attr, defaultFontSize) {
14
+ if (defaultFontSize === void 0) {
15
+ defaultFontSize = 10;
16
+ }
17
+ var tf = {
18
+ bl: 1,
19
+ it: 1,
20
+ ff: 1,
21
+ cl: 1,
22
+ un: 1
23
+ };
24
+ var value = cell === null || cell === void 0 ? void 0 : cell[attr];
25
+ if (attr in tf || attr === "fs" && isInlineStringCell(cell)) {
26
+ value || (value = "0");
27
+ } else if (["fc", "bg", "bc"].includes(attr)) {
28
+ if (["fc", "bc"].includes(attr)) {
29
+ value || (value = "#000000");
30
+ }
31
+ if ((value === null || value === void 0 ? void 0 : value.indexOf("rgba")) > -1) {
32
+ value = rgbToHex(value);
33
+ }
34
+ } else if (attr.substring(0, 2) === "bs") {
35
+ value || (value = "none");
36
+ } else if (attr === "ht" || attr === "vt") {
37
+ var defaultValue = attr === "ht" ? "1" : "0";
38
+ value = !_.isNil(value) ? value.toString() : defaultValue;
39
+ if (["0", "1", "2"].indexOf(value.toString()) === -1) {
40
+ value = defaultValue;
41
+ }
42
+ } else if (attr === "fs") {
43
+ value || (value = defaultFontSize.toString());
44
+ } else if (attr === "tb" || attr === "tr") {
45
+ value || (value = "0");
46
+ }
47
+ return value;
48
+ }
49
+ export function normalizedAttr(data, r, c, attr) {
50
+ if (!data || !data[r]) {
51
+ console.warn("cell (%d, %d) is null", r, c);
52
+ return null;
53
+ }
54
+ var cell = data[r][c];
55
+ if (!cell) return undefined;
56
+ return normalizedCellAttr(cell, attr);
57
+ }
58
+ export function getCellValue(r, c, data, attr) {
59
+ if (!attr) {
60
+ attr = "v";
61
+ }
62
+ var d_value;
63
+ if (!_.isNil(r) && !_.isNil(c)) {
64
+ d_value = data[r][c];
65
+ } else if (!_.isNil(r)) {
66
+ d_value = data[r];
67
+ } else if (!_.isNil(c)) {
68
+ var newData = data[0].map(function (col, i) {
69
+ return data.map(function (row) {
70
+ return row[i];
71
+ });
72
+ });
73
+ d_value = newData[c];
74
+ } else {
75
+ return data;
76
+ }
77
+ var retv = d_value;
78
+ if (_.isPlainObject(d_value)) {
79
+ var d = d_value;
80
+ retv = d[attr];
81
+ if (attr === "f" && !_.isNil(retv)) {
82
+ retv = functionHTMLGenerate(retv);
83
+ } else if (attr === "f") {
84
+ retv = d.v;
85
+ } else if (d && d.ct && d.ct.t === "d") {
86
+ retv = d.m;
87
+ }
88
+ }
89
+ if (retv === undefined) {
90
+ retv = null;
91
+ }
92
+ return retv;
93
+ }
94
+ export function setCellValue(ctx, r, c, d, v) {
95
+ var _a, _b, _c, _d, _e, _f;
96
+ if (_.isNil(d)) {
97
+ d = getFlowdata(ctx);
98
+ }
99
+ if (!d) return;
100
+ var cell = d[r][c];
101
+ var vupdate;
102
+ if (_.isPlainObject(v)) {
103
+ if (_.isNil(cell)) {
104
+ cell = v;
105
+ } else {
106
+ if (!_.isNil(v.f)) {
107
+ cell.f = v.f;
108
+ } else if ("f" in cell) {
109
+ delete cell.f;
110
+ }
111
+ if (!_.isNil(v.baseCurrency)) {
112
+ cell.baseValue = v.baseValue;
113
+ cell.baseCurrency = v.baseCurrency;
114
+ cell.baseCurrencyPrice = v.baseCurrencyPrice;
115
+ }
116
+ if (!_.isNil(v.ct)) {
117
+ cell.ct = v.ct;
118
+ }
119
+ }
120
+ if (_.isPlainObject(v.v)) {
121
+ vupdate = v.v.v;
122
+ } else {
123
+ vupdate = v.v;
124
+ }
125
+ } else {
126
+ vupdate = v;
127
+ }
128
+ if (isRealNull(vupdate)) {
129
+ if (_.isPlainObject(cell)) {
130
+ delete cell.m;
131
+ delete cell.v;
132
+ } else {
133
+ cell = null;
134
+ }
135
+ d[r][c] = cell;
136
+ return;
137
+ }
138
+ if (isRealNull(cell) || (_.isString(cell) || _.isNumber(cell)) && cell === v) {
139
+ cell = {};
140
+ }
141
+ if (!cell) return;
142
+ var vupdateStr = vupdate.toString();
143
+ if (vupdateStr.substr(0, 1) === "'") {
144
+ cell.m = vupdateStr.substr(1);
145
+ cell.ct = {
146
+ fa: "@",
147
+ t: "s"
148
+ };
149
+ cell.v = vupdateStr.substr(1);
150
+ cell.qp = 1;
151
+ } else if (cell.qp === 1) {
152
+ cell.m = vupdateStr;
153
+ cell.ct = {
154
+ fa: "@",
155
+ t: "s"
156
+ };
157
+ cell.v = vupdateStr;
158
+ } else if (vupdateStr.toUpperCase() === "TRUE" && (_.isNil((_a = cell.ct) === null || _a === void 0 ? void 0 : _a.fa) || ((_b = cell.ct) === null || _b === void 0 ? void 0 : _b.fa) !== "@")) {
159
+ cell.m = "TRUE";
160
+ cell.ct = {
161
+ fa: "General",
162
+ t: "b"
163
+ };
164
+ cell.v = true;
165
+ } else if (vupdateStr.toUpperCase() === "FALSE" && (_.isNil((_c = cell.ct) === null || _c === void 0 ? void 0 : _c.fa) || ((_d = cell.ct) === null || _d === void 0 ? void 0 : _d.fa) !== "@")) {
166
+ cell.m = "FALSE";
167
+ cell.ct = {
168
+ fa: "General",
169
+ t: "b"
170
+ };
171
+ cell.v = false;
172
+ } else if (vupdateStr.substr(-1) === "%" && isRealNum(vupdateStr.substring(0, vupdateStr.length - 1)) && (_.isNil((_e = cell.ct) === null || _e === void 0 ? void 0 : _e.fa) || ((_f = cell.ct) === null || _f === void 0 ? void 0 : _f.fa) !== "@")) {
173
+ cell.ct = {
174
+ fa: "0%",
175
+ t: "n"
176
+ };
177
+ cell.v = vupdateStr.substring(0, vupdateStr.length - 1) / 100;
178
+ cell.m = vupdate;
179
+ } else if (valueIsError(vupdate)) {
180
+ cell.m = vupdateStr;
181
+ if (!_.isNil(cell.ct)) {
182
+ cell.ct.t = "e";
183
+ } else {
184
+ cell.ct = {
185
+ fa: "General",
186
+ t: "e"
187
+ };
188
+ }
189
+ cell.v = vupdate;
190
+ } else {
191
+ if (!_.isNil(cell.f) && isRealNum(vupdate) && !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(vupdate)) {
192
+ cell.v = parseFloat(vupdate);
193
+ if (_.isNil(cell.ct)) {
194
+ cell.ct = {
195
+ fa: "General",
196
+ t: "n"
197
+ };
198
+ }
199
+ if (cell.v === Infinity || cell.v === -Infinity) {
200
+ cell.m = cell.v.toString();
201
+ } else {
202
+ if (cell.v.toString().indexOf("e") > -1) {
203
+ var len = void 0;
204
+ if (cell.v.toString().split(".").length === 1) {
205
+ len = 0;
206
+ } else {
207
+ len = cell.v.toString().split(".")[1].split("e")[0].length;
208
+ }
209
+ if (len > 5) {
210
+ len = 5;
211
+ }
212
+ cell.m = cell.v.toExponential(len).toString();
213
+ } else {
214
+ var v_p = Math.round(cell.v * 1000000000) / 1000000000;
215
+ if (_.isNil(cell.ct)) {
216
+ var mask = genarate(v_p);
217
+ if (mask != null) {
218
+ cell.m = mask[0].toString();
219
+ }
220
+ } else {
221
+ var mask = update(cell.ct.fa, v_p);
222
+ cell.m = mask.toString();
223
+ }
224
+ }
225
+ }
226
+ } else if (!_.isNil(cell.ct) && cell.ct.fa === "@") {
227
+ cell.m = vupdateStr;
228
+ cell.v = vupdate;
229
+ } else if (cell.ct != null && cell.ct.t === "d" && _.isString(vupdate)) {
230
+ var mask = genarate(vupdate);
231
+ if (mask[1].t !== "d" || mask[1].fa === cell.ct.fa) {
232
+ cell.m = mask[0], cell.ct = mask[1], cell.v = mask[2];
233
+ } else {
234
+ cell.v = mask[2];
235
+ cell.m = update(cell.ct.fa, cell.v);
236
+ }
237
+ } else if (!_.isNil(cell.ct) && !_.isNil(cell.ct.fa) && cell.ct.fa !== "General") {
238
+ if (isRealNum(vupdate)) {
239
+ vupdate = parseFloat(vupdate);
240
+ }
241
+ var mask = update(cell.ct.fa, vupdate);
242
+ if (mask === vupdate) {
243
+ mask = genarate(vupdate);
244
+ cell.m = mask[0].toString();
245
+ cell.ct = mask[1], cell.v = mask[2];
246
+ } else {
247
+ if (v.m) {
248
+ cell.m = v.m;
249
+ } else {
250
+ cell.m = mask.toString();
251
+ }
252
+ cell.v = vupdate;
253
+ }
254
+ } else {
255
+ if (isRealNum(vupdate) && !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(vupdate)) {
256
+ if (typeof vupdate === "string") {
257
+ var flag = vupdate.split("").every(function (ele) {
258
+ return ele === "0" || ele === ".";
259
+ });
260
+ if (flag) {
261
+ vupdate = parseFloat(vupdate);
262
+ }
263
+ }
264
+ cell.v = vupdate;
265
+ cell.ct = {
266
+ fa: "General",
267
+ t: "n"
268
+ };
269
+ if (cell.v === Infinity || cell.v === -Infinity) {
270
+ cell.m = cell.v.toString();
271
+ } else if (cell.v != null) {
272
+ var mask = genarate(cell.v);
273
+ if (mask) {
274
+ if (v.m) {
275
+ cell.m = v.m;
276
+ } else {
277
+ cell.m = mask[0].toString();
278
+ }
279
+ }
280
+ }
281
+ } else {
282
+ var mask = genarate(vupdate);
283
+ if (mask) {
284
+ cell.m = mask[0].toString();
285
+ cell.ct = mask[1], cell.v = mask[2];
286
+ }
287
+ }
288
+ }
289
+ }
290
+ d[r][c] = cell;
291
+ }
292
+ export function getRealCellValue(r, c, data, attr) {
293
+ var value = getCellValue(r, c, data, "m");
294
+ if (_.isNil(value)) {
295
+ value = getCellValue(r, c, data, attr);
296
+ if (_.isNil(value)) {
297
+ var ct = getCellValue(r, c, data, "ct");
298
+ if (isInlineStringCT(ct)) {
299
+ value = ct.s;
300
+ }
301
+ }
302
+ }
303
+ return value;
304
+ }
305
+ export function mergeBorder(ctx, d, row_index, col_index) {
306
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
307
+ if (!d || !d[row_index]) {
308
+ console.warn("Merge info is null", row_index, col_index);
309
+ return null;
310
+ }
311
+ var value = d[row_index][col_index];
312
+ if (!value) return null;
313
+ if (value === null || value === void 0 ? void 0 : value.mc) {
314
+ var margeMaindata = value.mc;
315
+ if (!margeMaindata) {
316
+ console.warn("Merge info is null", row_index, col_index);
317
+ return null;
318
+ }
319
+ col_index = margeMaindata.c;
320
+ row_index = margeMaindata.r;
321
+ if (_.isNil((_a = d === null || d === void 0 ? void 0 : d[row_index]) === null || _a === void 0 ? void 0 : _a[col_index])) {
322
+ console.warn("Main merge Cell info is null", row_index, col_index);
323
+ return null;
324
+ }
325
+ var col_rs = (_d = (_c = (_b = d[row_index]) === null || _b === void 0 ? void 0 : _b[col_index]) === null || _c === void 0 ? void 0 : _c.mc) === null || _d === void 0 ? void 0 : _d.cs;
326
+ var row_rs = (_g = (_f = (_e = d[row_index]) === null || _e === void 0 ? void 0 : _e[col_index]) === null || _f === void 0 ? void 0 : _f.mc) === null || _g === void 0 ? void 0 : _g.rs;
327
+ var mergeMain = (_j = (_h = d[row_index]) === null || _h === void 0 ? void 0 : _h[col_index]) === null || _j === void 0 ? void 0 : _j.mc;
328
+ if (!mergeMain || _.isNil(mergeMain === null || mergeMain === void 0 ? void 0 : mergeMain.rs) || _.isNil(mergeMain === null || mergeMain === void 0 ? void 0 : mergeMain.cs) || _.isNil(col_rs) || _.isNil(row_rs)) {
329
+ console.warn("Main merge info is null", mergeMain);
330
+ return null;
331
+ }
332
+ var start_r = void 0;
333
+ var end_r = void 0;
334
+ var row = void 0;
335
+ var row_pre = void 0;
336
+ for (var r = row_index; r < mergeMain.rs + row_index; r += 1) {
337
+ if (r === 0) {
338
+ start_r = -1;
339
+ } else {
340
+ start_r = ctx.visibledatarow[r - 1] - 1;
341
+ }
342
+ end_r = ctx.visibledatarow[r];
343
+ if (row_pre === undefined) {
344
+ row_pre = start_r;
345
+ row = end_r;
346
+ } else if (row !== undefined) {
347
+ row += end_r - start_r - 1;
348
+ }
349
+ }
350
+ var start_c = void 0;
351
+ var end_c = void 0;
352
+ var col = void 0;
353
+ var col_pre = void 0;
354
+ for (var c = col_index; c < mergeMain.cs + col_index; c += 1) {
355
+ if (c === 0) {
356
+ start_c = 0;
357
+ } else {
358
+ start_c = ctx.visibledatacolumn[c - 1];
359
+ }
360
+ end_c = ctx.visibledatacolumn[c];
361
+ if (col_pre === undefined) {
362
+ col_pre = start_c;
363
+ col = end_c;
364
+ } else if (col !== undefined) {
365
+ col += end_c - start_c;
366
+ }
367
+ }
368
+ if (_.isNil(row_pre) || _.isNil(col_pre) || _.isNil(row) || _.isNil(col)) {
369
+ console.warn("Main merge info row_pre or col_pre or row or col is null", mergeMain);
370
+ return null;
371
+ }
372
+ return {
373
+ row: [row_pre, row, row_index, row_index + row_rs - 1],
374
+ column: [col_pre, col, col_index, col_index + col_rs - 1]
375
+ };
376
+ }
377
+ return null;
378
+ }
379
+ function mergeMove(ctx, mc, columnseleted, rowseleted, s, top, height, left, width) {
380
+ var row_st = mc.r;
381
+ var row_ed = mc.r + mc.rs - 1;
382
+ var col_st = mc.c;
383
+ var col_ed = mc.c + mc.cs - 1;
384
+ var ismatch = false;
385
+ columnseleted[0] = Math.min(columnseleted[0], columnseleted[1]);
386
+ rowseleted[0] = Math.min(rowseleted[0], rowseleted[1]);
387
+ if (columnseleted[0] <= col_st && columnseleted[1] >= col_ed && rowseleted[0] <= row_st && rowseleted[1] >= row_ed || !(columnseleted[1] < col_st || columnseleted[0] > col_ed) && !(rowseleted[1] < row_st || rowseleted[0] > row_ed)) {
388
+ var flowdata = getFlowdata(ctx);
389
+ if (!flowdata) return null;
390
+ var margeset = mergeBorder(ctx, flowdata, mc.r, mc.c);
391
+ if (margeset) {
392
+ var row = margeset.row[1];
393
+ var row_pre = margeset.row[0];
394
+ var col = margeset.column[1];
395
+ var col_pre = margeset.column[0];
396
+ if (!(columnseleted[1] < col_st || columnseleted[0] > col_ed)) {
397
+ if (rowseleted[0] <= row_ed && rowseleted[0] >= row_st) {
398
+ height += top - row_pre;
399
+ top = row_pre;
400
+ rowseleted[0] = row_st;
401
+ }
402
+ if (rowseleted[1] >= row_st && rowseleted[1] <= row_ed) {
403
+ if (s.row_focus >= row_st && s.row_focus <= row_ed) {
404
+ height = row - top;
405
+ } else {
406
+ height = row - top;
407
+ }
408
+ rowseleted[1] = row_ed;
409
+ }
410
+ }
411
+ if (!(rowseleted[1] < row_st || rowseleted[0] > row_ed)) {
412
+ if (columnseleted[0] <= col_ed && columnseleted[0] >= col_st) {
413
+ width += left - col_pre;
414
+ left = col_pre;
415
+ columnseleted[0] = col_st;
416
+ }
417
+ if (columnseleted[1] >= col_st && columnseleted[1] <= col_ed) {
418
+ if (s.column_focus >= col_st && s.column_focus <= col_ed) {
419
+ width = col - left;
420
+ } else {
421
+ width = col - left;
422
+ }
423
+ columnseleted[1] = col_ed;
424
+ }
425
+ }
426
+ ismatch = true;
427
+ }
428
+ }
429
+ if (ismatch) {
430
+ return [columnseleted, rowseleted, top, height, left, width];
431
+ }
432
+ return null;
433
+ }
434
+ export function mergeMoveMain(ctx, columnseleted, rowseleted, s, top, height, left, width) {
435
+ var mergesetting = ctx.config.merge;
436
+ if (!mergesetting) {
437
+ return null;
438
+ }
439
+ var mcset = Object.keys(mergesetting);
440
+ rowseleted[1] = Math.max(rowseleted[0], rowseleted[1]);
441
+ columnseleted[1] = Math.max(columnseleted[0], columnseleted[1]);
442
+ var offloop = true;
443
+ var mergeMoveData = {};
444
+ while (offloop) {
445
+ offloop = false;
446
+ for (var i = 0; i < mcset.length; i += 1) {
447
+ var key = mcset[i];
448
+ var mc = mergesetting[key];
449
+ if (key in mergeMoveData) {
450
+ continue;
451
+ }
452
+ var changeparam = mergeMove(ctx, mc, columnseleted, rowseleted, s, top, height, left, width);
453
+ if (changeparam != null) {
454
+ mergeMoveData[key] = mc;
455
+ columnseleted = changeparam[0], rowseleted = changeparam[1], top = changeparam[2], height = changeparam[3], left = changeparam[4], width = changeparam[5];
456
+ offloop = true;
457
+ } else {
458
+ delete mergeMoveData[key];
459
+ }
460
+ }
461
+ }
462
+ return [columnseleted, rowseleted, top, height, left, width];
463
+ }
464
+ export function cancelFunctionrangeSelected(ctx) {
465
+ if (ctx.formulaCache.selectingRangeIndex === -1) {
466
+ ctx.formulaRangeSelect = undefined;
467
+ }
468
+ }
469
+ export function cancelNormalSelected(ctx) {
470
+ cancelFunctionrangeSelected(ctx);
471
+ ctx.luckysheetCellUpdate = [];
472
+ ctx.formulaRangeHighlight = [];
473
+ ctx.functionHint = null;
474
+ ctx.formulaCache.rangestart = false;
475
+ ctx.formulaCache.rangedrag_column_start = false;
476
+ ctx.formulaCache.rangedrag_row_start = false;
477
+ }
478
+ export function updateCell(ctx, r, c, $input, value, canvas) {
479
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
480
+ var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
481
+ var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
482
+ var flowdata = getFlowdata(ctx);
483
+ if (!flowdata) return;
484
+ var index = getSheetIndex(ctx, ctx.currentSheetId);
485
+ var dataVerification = ctx.luckysheetfile[index].dataVerification;
486
+ if (!_.isNil(dataVerification)) {
487
+ var dvItem = dataVerification["".concat(r, "_").concat(c)];
488
+ if (!_.isNil(dvItem) && dvItem.prohibitInput && !validateCellData(ctx, dvItem, inputText)) {
489
+ var failureText = getFailureText(ctx, dvItem);
490
+ cancelNormalSelected(ctx);
491
+ ctx.warnDialog = failureText;
492
+ return;
493
+ }
494
+ }
495
+ var curv = flowdata[r][c];
496
+ var oldValue = _.cloneDeep(curv);
497
+ var isPrevInline = isInlineStringCell(curv);
498
+ var isCurInline = (inputText === null || inputText === void 0 ? void 0 : inputText.slice(0, 1)) !== "=" && (inputHtml === null || inputHtml === void 0 ? void 0 : inputHtml.substring(0, 5)) === "<span";
499
+ var isCopyVal = false;
500
+ if (!isCurInline && inputText && inputText.length > 0) {
501
+ var splitArr = inputText.replace(/\r\n/g, "_x000D_").replace(/&#13;&#10;/g, "_x000D_").replace(/\r/g, "_x000D_").replace(/\n/g, "_x000D_").split("_x000D_");
502
+ if (splitArr.length > 1 && inputHtml !== "<br>") {
503
+ isCopyVal = true;
504
+ isCurInline = true;
505
+ inputText = splitArr.join("\r\n");
506
+ }
507
+ }
508
+ if ((curv === null || curv === void 0 ? void 0 : curv.ct) && !value && !isCurInline && isPrevInline) {
509
+ delete curv.ct.s;
510
+ curv.ct.t = "g";
511
+ curv.ct.fa = "General";
512
+ curv.tb = "1";
513
+ value = "";
514
+ } else if (isCurInline) {
515
+ if (!_.isPlainObject(curv)) {
516
+ curv = {};
517
+ }
518
+ curv || (curv = {});
519
+ var fontSize = curv.fs || 10;
520
+ if (!curv.ct) {
521
+ curv.ct = {};
522
+ curv.ct.fa = "General";
523
+ curv.tb = "1";
524
+ }
525
+ curv.ct.t = "inlineStr";
526
+ curv.ct.s = convertSpanToShareString($input.querySelectorAll("span"), curv);
527
+ delete curv.fs;
528
+ delete curv.f;
529
+ delete curv.v;
530
+ delete curv.m;
531
+ curv.fs = fontSize;
532
+ if (isCopyVal) {
533
+ curv.ct.s = [{
534
+ v: inputText,
535
+ fs: fontSize
536
+ }];
537
+ }
538
+ }
539
+ value = value || ($input === null || $input === void 0 ? void 0 : $input.innerText);
540
+ if (((_b = (_a = ctx.hooks).beforeUpdateCell) === null || _b === void 0 ? void 0 : _b.call(_a, r, c, value)) === false) {
541
+ cancelNormalSelected(ctx);
542
+ return;
543
+ }
544
+ if (!isCurInline) {
545
+ if (isRealNull(value) && !isPrevInline) {
546
+ if (!curv || isRealNull(curv.v) && !curv.spl && !curv.f) {
547
+ cancelNormalSelected(ctx);
548
+ return;
549
+ }
550
+ } else if (curv && curv.qp !== 1) {
551
+ if (_.isPlainObject(curv) && (value === curv.f || value === curv.v || value === curv.m)) {
552
+ cancelNormalSelected(ctx);
553
+ return;
554
+ }
555
+ if (value === curv) {
556
+ cancelNormalSelected(ctx);
557
+ return;
558
+ }
559
+ }
560
+ if (_.isString(value) && value.slice(0, 1) === "=" && value.length > 1) {} else if (_.isPlainObject(curv) && curv && curv.ct && curv.ct.fa && curv.ct.fa !== "@" && !isRealNull(value)) {
561
+ delete curv.m;
562
+ if (curv.f) {
563
+ delete curv.f;
564
+ delete curv.spl;
565
+ }
566
+ }
567
+ }
568
+ var isRunExecFunction = true;
569
+ var d = flowdata;
570
+ var dynamicArrayItem = null;
571
+ if (_.isPlainObject(curv)) {
572
+ if (!isCurInline) {
573
+ if (_.isString(value) && value.slice(0, 1) === "=" && value.length > 1) {
574
+ var v = execfunction(ctx, value, r, c, undefined, undefined, true);
575
+ isRunExecFunction = false;
576
+ curv = _.cloneDeep(((_c = d === null || d === void 0 ? void 0 : d[r]) === null || _c === void 0 ? void 0 : _c[c]) || {});
577
+ curv.v = v[1], curv.f = v[2];
578
+ if (v.length === 4 && v[3].type === "sparklines") {
579
+ delete curv.m;
580
+ delete curv.v;
581
+ var curCalv = v[3].data;
582
+ if (_.isArray(curCalv) && !_.isPlainObject(curCalv[0])) {
583
+ curv.v = curCalv[0];
584
+ } else {
585
+ curv.spl = v[3].data;
586
+ }
587
+ } else if (v.length === 4 && v[3].type === "dynamicArrayItem") {
588
+ dynamicArrayItem = v[3].data;
589
+ }
590
+ } else if (_.isPlainObject(value)) {
591
+ var valueFunction = value.f;
592
+ if (_.isString(valueFunction) && valueFunction.slice(0, 1) === "=" && valueFunction.length > 1) {
593
+ var v = execfunction(ctx, valueFunction, r, c, undefined, undefined, true);
594
+ isRunExecFunction = false;
595
+ curv = _.cloneDeep(((_d = d === null || d === void 0 ? void 0 : d[r]) === null || _d === void 0 ? void 0 : _d[c]) || {});
596
+ curv.v = v[1], curv.f = v[2];
597
+ if (v.length === 4 && v[3].type === "sparklines") {
598
+ delete curv.m;
599
+ delete curv.v;
600
+ var curCalv = v[3].data;
601
+ if (_.isArray(curCalv) && !_.isPlainObject(curCalv[0])) {
602
+ curv.v = curCalv[0];
603
+ } else {
604
+ curv.spl = v[3].data;
605
+ }
606
+ } else if (v.length === 4 && v[3].type === "dynamicArrayItem") {
607
+ dynamicArrayItem = v[3].data;
608
+ }
609
+ } else {
610
+ Object.keys(value).forEach(function (attr) {
611
+ curv[attr] = value[attr];
612
+ });
613
+ }
614
+ } else {
615
+ delFunctionGroup(ctx, r, c);
616
+ curv = _.cloneDeep(((_e = d === null || d === void 0 ? void 0 : d[r]) === null || _e === void 0 ? void 0 : _e[c]) || {});
617
+ curv.v = value;
618
+ delete curv.f;
619
+ delete curv.spl;
620
+ var decemialCount_1 = ((_f = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _f === void 0 ? void 0 : _f.toString().includes(".")) ? (_h = (_g = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _g === void 0 ? void 0 : _g.toString().split(" ")[0].split(".")[1]) === null || _h === void 0 ? void 0 : _h.length : 0;
621
+ var coin_1 = (_j = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _j === void 0 ? void 0 : _j.toString().split(" ")[1];
622
+ if (_typeof(curv) === "object" && (curv === null || curv === void 0 ? void 0 : curv.baseValue)) {
623
+ curv.m = "".concat((parseFloat(value) / (oldValue === null || oldValue === void 0 ? void 0 : oldValue.baseCurrencyPrice)).toFixed(decemialCount_1 || 2), " ").concat(coin_1);
624
+ curv.baseValue = value;
625
+ }
626
+ execFunctionGroup(ctx, r, c, curv);
627
+ isRunExecFunction = false;
628
+ if (curv.qp === 1 && "".concat(value).substring(0, 1) !== "'") {
629
+ curv.qp = 0;
630
+ if (curv.ct) {
631
+ curv.ct.fa = "General";
632
+ curv.ct.t = "n";
633
+ }
634
+ }
635
+ }
636
+ }
637
+ value = curv;
638
+ } else {
639
+ if (_.isString(value) && value.slice(0, 1) === "=" && value.length > 1) {
640
+ var v = execfunction(ctx, value, r, c, undefined, undefined, true);
641
+ isRunExecFunction = false;
642
+ value = {
643
+ v: v[1],
644
+ f: v[2]
645
+ };
646
+ if (v.length === 4 && v[3].type === "sparklines") {
647
+ var curCalv = v[3].data;
648
+ if (_.isArray(curCalv) && !_.isPlainObject(curCalv[0])) {
649
+ value.v = curCalv[0];
650
+ } else {
651
+ value.spl = v[3].data;
652
+ }
653
+ } else if (v.length === 4 && v[3].type === "dynamicArrayItem") {
654
+ dynamicArrayItem = v[3].data;
655
+ }
656
+ } else if (_.isPlainObject(value)) {
657
+ var valueFunction = value.f;
658
+ if (_.isString(valueFunction) && valueFunction.slice(0, 1) === "=" && valueFunction.length > 1) {
659
+ var v = execfunction(ctx, valueFunction, r, c, undefined, undefined, true);
660
+ isRunExecFunction = false;
661
+ value.v = v[1], value.f = v[2];
662
+ if (v.length === 4 && v[3].type === "sparklines") {
663
+ var curCalv = v[3].data;
664
+ if (_.isArray(curCalv) && !_.isPlainObject(curCalv[0])) {
665
+ value.v = curCalv[0];
666
+ } else {
667
+ value.spl = v[3].data;
668
+ }
669
+ } else if (v.length === 4 && v[3].type === "dynamicArrayItem") {
670
+ dynamicArrayItem = v[3].data;
671
+ }
672
+ } else {
673
+ var v = curv;
674
+ if (_.isNil(value.v)) {
675
+ value.v = v;
676
+ }
677
+ }
678
+ } else {
679
+ delFunctionGroup(ctx, r, c);
680
+ execFunctionGroup(ctx, r, c, value);
681
+ isRunExecFunction = false;
682
+ }
683
+ }
684
+ var decemialCount = ((_k = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _k === void 0 ? void 0 : _k.toString().includes(".")) ? (_m = (_l = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _l === void 0 ? void 0 : _l.toString().split(" ")[0].split(".")[1]) === null || _m === void 0 ? void 0 : _m.length : 0;
685
+ var coin = (_o = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _o === void 0 ? void 0 : _o.toString().split(" ")[1];
686
+ if (_typeof(value) === "object" && value.baseValue && !(value === null || value === void 0 ? void 0 : value.m)) {
687
+ value.m = "".concat((parseFloat(value === null || value === void 0 ? void 0 : value.v) / (oldValue === null || oldValue === void 0 ? void 0 : oldValue.baseCurrencyPrice)).toFixed(decemialCount || 2), " ").concat(coin);
688
+ }
689
+ if (typeof value === "string") {
690
+ value = {
691
+ ct: {
692
+ fa: "General",
693
+ t: "g"
694
+ },
695
+ v: value,
696
+ tb: "1"
697
+ };
698
+ } else if (_typeof(value) === "object" && !value.tb) {
699
+ value.tb = "1";
700
+ }
701
+ setCellValue(ctx, r, c, d, value);
702
+ cancelNormalSelected(ctx);
703
+ if ((curv === null || curv === void 0 ? void 0 : curv.tb) === "2" && curv.v || isInlineStringCell(d[r][c])) {
704
+ var defaultrowlen = ctx.defaultrowlen;
705
+ var cfg = ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].config || {};
706
+ if (!(((_p = cfg.columnlen) === null || _p === void 0 ? void 0 : _p[c]) && ((_q = cfg.rowlen) === null || _q === void 0 ? void 0 : _q[r]))) {
707
+ var cellWidth = ((_r = cfg.columnlen) === null || _r === void 0 ? void 0 : _r[c]) || ctx.defaultcollen;
708
+ var textInfo = canvas ? getCellTextInfo(d[r][c], canvas, ctx, {
709
+ r: r,
710
+ c: c,
711
+ cellWidth: cellWidth
712
+ }) : null;
713
+ var currentRowLen = defaultrowlen;
714
+ if (textInfo) {
715
+ currentRowLen = textInfo.textHeightAll + 2;
716
+ }
717
+ var previousRowHeight = getRowHeight(ctx, [r])[r];
718
+ if (currentRowLen > defaultrowlen && !((_s = cfg.customHeight) === null || _s === void 0 ? void 0 : _s[r]) && previousRowHeight < currentRowLen) {
719
+ if (_.isNil(cfg.rowlen)) cfg.rowlen = {};
720
+ cfg.rowlen[r] = currentRowLen;
721
+ }
722
+ }
723
+ }
724
+ if (ctx.hooks.afterUpdateCell) {
725
+ var newValue_1 = _.cloneDeep(flowdata[r][c]);
726
+ var afterUpdateCell_1 = ctx.hooks.afterUpdateCell;
727
+ setTimeout(function () {
728
+ afterUpdateCell_1 === null || afterUpdateCell_1 === void 0 ? void 0 : afterUpdateCell_1(r, c, oldValue, newValue_1);
729
+ });
730
+ }
731
+ ctx.formulaCache.execFunctionGlobalData = null;
732
+ }
733
+ export function getOrigincell(ctx, r, c, i) {
734
+ var data = getFlowdata(ctx, i);
735
+ if (_.isNil(r) || _.isNil(c)) {
736
+ return null;
737
+ }
738
+ if (!data || !data[r] || !data[r][c]) {
739
+ return null;
740
+ }
741
+ return data[r][c];
742
+ }
743
+ export function getcellFormula(ctx, r, c, i, data) {
744
+ var cell;
745
+ if (_.isNil(data)) {
746
+ cell = getOrigincell(ctx, r, c, i);
747
+ } else {
748
+ cell = data[r][c];
749
+ }
750
+ if (_.isNil(cell)) {
751
+ return null;
752
+ }
753
+ return cell.f;
754
+ }
755
+ export function getRange(ctx) {
756
+ var rangeArr = _.cloneDeep(ctx.luckysheet_select_save);
757
+ var result = [];
758
+ if (!rangeArr) return result;
759
+ for (var i = 0; i < rangeArr.length; i += 1) {
760
+ var rangeItem = rangeArr[i];
761
+ var temp = {
762
+ row: rangeItem.row,
763
+ column: rangeItem.column
764
+ };
765
+ result.push(temp);
766
+ }
767
+ return result;
768
+ }
769
+ export function getFlattenedRange(ctx, range) {
770
+ range = range || getRange(ctx);
771
+ var result = [];
772
+ range.forEach(function (ele) {
773
+ var rs = ele.row;
774
+ var cs = ele.column;
775
+ for (var r = rs[0]; r <= rs[1]; r += 1) {
776
+ for (var c = cs[0]; c <= cs[1]; c += 1) {
777
+ result.push({
778
+ r: r,
779
+ c: c
780
+ });
781
+ }
782
+ }
783
+ });
784
+ return result;
785
+ }
786
+ export function getRangetxt(ctx, sheetId, range, currentId) {
787
+ var sheettxt = "";
788
+ if (currentId == null) {
789
+ currentId = ctx.currentSheetId;
790
+ }
791
+ if (sheetId !== currentId) {
792
+ var index = getSheetIndex(ctx, sheetId);
793
+ if (index == null) return "";
794
+ sheettxt = ctx.luckysheetfile[index].name.replace(/'/g, "''");
795
+ if (/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/.test(sheettxt)) {
796
+ sheettxt += "!";
797
+ } else {
798
+ sheettxt = "'".concat(sheettxt, "'!");
799
+ }
800
+ }
801
+ var row0 = range.row[0];
802
+ var row1 = range.row[1];
803
+ var column0 = range.column[0];
804
+ var column1 = range.column[1];
805
+ if (row0 == null && row1 == null) {
806
+ return "".concat(sheettxt + indexToColumnChar(column0), ":").concat(indexToColumnChar(column1));
807
+ }
808
+ if (column0 == null && column1 == null) {
809
+ return "".concat(sheettxt + (row0 + 1), ":").concat(row1 + 1);
810
+ }
811
+ if (column0 === column1 && row0 === row1) {
812
+ return sheettxt + indexToColumnChar(column0) + (row0 + 1);
813
+ }
814
+ return "".concat(sheettxt + indexToColumnChar(column0) + (row0 + 1), ":").concat(indexToColumnChar(column1)).concat(row1 + 1);
815
+ }
816
+ export function getRangeByTxt(ctx, txt) {
817
+ var range = [];
818
+ if (txt.indexOf(",") !== -1) {
819
+ var arr = txt.split(",");
820
+ for (var i = 0; i < arr.length; i += 1) {
821
+ if (iscelldata(arr[i])) {
822
+ range.push(getcellrange(ctx, arr[i]));
823
+ } else {
824
+ range = [];
825
+ break;
826
+ }
827
+ }
828
+ } else {
829
+ if (iscelldata(txt)) {
830
+ range.push(getcellrange(ctx, txt));
831
+ }
832
+ }
833
+ return range;
834
+ }
835
+ export function isAllSelectedCellsInStatus(ctx, attr, status) {
836
+ var _a, _b, _c, _d;
837
+ if (!_.isEmpty(ctx.luckysheetCellUpdate)) {
838
+ var w = window.getSelection();
839
+ if (!w) return false;
840
+ if (w.rangeCount === 0) return false;
841
+ var range = w.getRangeAt(0);
842
+ if (range.collapsed === true) {
843
+ return false;
844
+ }
845
+ var endContainer = range.endContainer;
846
+ var startContainer = range.startContainer;
847
+ var cssField_1 = _.camelCase(attrToCssName[attr]);
848
+ if (startContainer === endContainer) {
849
+ return !_.isEmpty((_a = startContainer.parentElement) === null || _a === void 0 ? void 0 : _a.style[cssField_1]);
850
+ }
851
+ if (((_b = startContainer.parentElement) === null || _b === void 0 ? void 0 : _b.tagName) === "SPAN" && ((_c = endContainer.parentElement) === null || _c === void 0 ? void 0 : _c.tagName) === "SPAN") {
852
+ var startSpan = startContainer.parentNode;
853
+ var endSpan = endContainer.parentNode;
854
+ var allSpans = (_d = startSpan === null || startSpan === void 0 ? void 0 : startSpan.parentNode) === null || _d === void 0 ? void 0 : _d.querySelectorAll("span");
855
+ if (allSpans) {
856
+ var startSpanIndex = _.indexOf(allSpans, startSpan);
857
+ var endSpanIndex = _.indexOf(allSpans, endSpan);
858
+ var rangeSpans = [];
859
+ for (var i = startSpanIndex; i <= endSpanIndex; i += 1) {
860
+ rangeSpans.push(allSpans[i]);
861
+ }
862
+ return _.every(rangeSpans, function (s) {
863
+ return !_.isEmpty(s.style[cssField_1]);
864
+ });
865
+ }
866
+ }
867
+ }
868
+ var cells = getFlattenedRange(ctx);
869
+ var flowdata = getFlowdata(ctx);
870
+ return cells.every(function (_a) {
871
+ var _b;
872
+ var r = _a.r,
873
+ c = _a.c;
874
+ var cell = (_b = flowdata === null || flowdata === void 0 ? void 0 : flowdata[r]) === null || _b === void 0 ? void 0 : _b[c];
875
+ if (_.isNil(cell)) {
876
+ return false;
877
+ }
878
+ return cell[attr] === status;
879
+ });
880
+ }
881
+ export function getFontStyleByCell(cell, checksAF, checksCF, isCheck) {
882
+ if (isCheck === void 0) {
883
+ isCheck = true;
884
+ }
885
+ var style = {};
886
+ if (!cell) {
887
+ return style;
888
+ }
889
+ _.forEach(cell, function (v, key) {
890
+ var _a, _b, _c, _d;
891
+ var value = cell[key];
892
+ if (isCheck) {
893
+ value = normalizedCellAttr(cell, key);
894
+ }
895
+ var valueNum = Number(value);
896
+ if (key === "bl" && valueNum !== 0) {
897
+ style.fontWeight = "bold";
898
+ }
899
+ if (key === "it" && valueNum !== 0) {
900
+ style.fontStyle = "italic";
901
+ }
902
+ if (key === "fs" && valueNum !== 10) {
903
+ style.fontSize = "".concat(valueNum, "pt");
904
+ }
905
+ if (key === "fc" && value !== "#000000" || ((_a = checksAF === null || checksAF === void 0 ? void 0 : checksAF.length) !== null && _a !== void 0 ? _a : 0) > 0 || (checksCF === null || checksCF === void 0 ? void 0 : checksCF.textColor)) {
906
+ if (checksCF === null || checksCF === void 0 ? void 0 : checksCF.textColor) {
907
+ style.color = checksCF.textColor;
908
+ } else if (((_b = checksAF === null || checksAF === void 0 ? void 0 : checksAF.length) !== null && _b !== void 0 ? _b : 0) > 0) {
909
+ style.color = checksAF[0];
910
+ } else {
911
+ style.color = value;
912
+ }
913
+ }
914
+ if (key === "cl" && valueNum !== 0) {
915
+ style.textDecoration = "line-through";
916
+ }
917
+ if (key === "un" && (valueNum === 1 || valueNum === 3)) {
918
+ var color = (_c = cell._color) !== null && _c !== void 0 ? _c : cell.fc;
919
+ var fs = (_d = cell._fontSize) !== null && _d !== void 0 ? _d : cell.fs;
920
+ style.borderBottom = "".concat(Math.floor(fs / 9), "px solid ").concat(color);
921
+ }
922
+ });
923
+ return style;
924
+ }
925
+ export function getStyleByCell(ctx, d, r, c) {
926
+ var _a;
927
+ var style = {};
928
+ var checksAF = [];
929
+ var cf_compute = getComputeMap(ctx);
930
+ var checksCF = checkCF(r, c, cf_compute);
931
+ var cell = (_a = d === null || d === void 0 ? void 0 : d[r]) === null || _a === void 0 ? void 0 : _a[c];
932
+ if (!cell) return {};
933
+ var isInline = isInlineStringCell(cell);
934
+ if ("bg" in cell) {
935
+ var value = normalizedCellAttr(cell, "bg");
936
+ if (checksCF === null || checksCF === void 0 ? void 0 : checksCF.cellColor) {
937
+ if (checksCF === null || checksCF === void 0 ? void 0 : checksCF.cellColor) {
938
+ style.background = "".concat(checksCF.cellColor);
939
+ } else if (checksAF.length > 1) {
940
+ style.background = "".concat(checksAF[1]);
941
+ } else {
942
+ style.background = "".concat(value);
943
+ }
944
+ }
945
+ }
946
+ if ("ht" in cell) {
947
+ var value = normalizedCellAttr(cell, "ht");
948
+ if (Number(value) === 0) {
949
+ style.textAlign = "center";
950
+ } else if (Number(value) === 2) {
951
+ style.textAlign = "right";
952
+ }
953
+ }
954
+ if ("vt" in cell) {
955
+ var value = normalizedCellAttr(cell, "vt");
956
+ if (Number(value) === 0) {
957
+ style.alignItems = "center";
958
+ } else if (Number(value) === 2) {
959
+ style.alignItems = "flex-end";
960
+ }
961
+ }
962
+ if (!isInline) {
963
+ style = _.assign(style, getFontStyleByCell(cell, checksAF, checksCF));
964
+ }
965
+ return style;
966
+ }
967
+ export function getInlineStringHTML(r, c, data) {
968
+ var ct = getCellValue(r, c, data, "ct");
969
+ if (isInlineStringCT(ct)) {
970
+ var strings = ct.s;
971
+ var value = "";
972
+ for (var i = 0; i < strings.length; i += 1) {
973
+ var strObj = strings[i];
974
+ if (strObj.v) {
975
+ var style = getFontStyleByCell(strObj);
976
+ var styleStr = _.map(style, function (v, key) {
977
+ return "".concat(_.kebabCase(key), ":").concat(_.isNumber(v) ? "".concat(v, "px") : v, ";");
978
+ }).join("");
979
+ value += "<span class=\"luckysheet-input-span\" index='".concat(i, "' style='").concat(styleStr, "'>").concat(strObj.v, "</span>");
980
+ }
981
+ }
982
+ return value;
983
+ }
984
+ return "";
985
+ }
986
+ export function getQKBorder(width, type, color) {
987
+ var bordertype = "";
988
+ if (width.toString().indexOf("pt") > -1) {
989
+ var nWidth = parseFloat(width);
990
+ if (nWidth < 1) {} else if (nWidth < 1.5) {
991
+ bordertype = "Medium";
992
+ } else {
993
+ bordertype = "Thick";
994
+ }
995
+ } else {
996
+ var nWidth = parseFloat(width);
997
+ if (nWidth < 2) {} else if (nWidth < 3) {
998
+ bordertype = "Medium";
999
+ } else {
1000
+ bordertype = "Thick";
1001
+ }
1002
+ }
1003
+ var style = 0;
1004
+ type = type.toLowerCase();
1005
+ if (type === "double") {
1006
+ style = 2;
1007
+ } else if (type === "dotted") {
1008
+ if (bordertype === "Medium" || bordertype === "Thick") {
1009
+ style = 3;
1010
+ } else {
1011
+ style = 10;
1012
+ }
1013
+ } else if (type === "dashed") {
1014
+ if (bordertype === "Medium" || bordertype === "Thick") {
1015
+ style = 4;
1016
+ } else {
1017
+ style = 9;
1018
+ }
1019
+ } else if (type === "solid") {
1020
+ if (bordertype === "Medium") {
1021
+ style = 8;
1022
+ } else if (bordertype === "Thick") {
1023
+ style = 13;
1024
+ } else {
1025
+ style = 1;
1026
+ }
1027
+ }
1028
+ return [style, color];
1029
+ }
1030
+ export function getdatabyselection(ctx, range, sheetId) {
1031
+ if (range == null && ctx.luckysheet_select_save) {
1032
+ range = ctx.luckysheet_select_save[0];
1033
+ }
1034
+ if (!range) return [];
1035
+ if (range.row == null || range.row.length === 0) {
1036
+ return [];
1037
+ }
1038
+ var d;
1039
+ var cfg;
1040
+ if (sheetId != null && sheetId !== ctx.currentSheetId) {
1041
+ d = ctx.luckysheetfile[getSheetIndex(ctx, sheetId)].data;
1042
+ cfg = ctx.luckysheetfile[getSheetIndex(ctx, sheetId)].config;
1043
+ } else {
1044
+ d = getFlowdata(ctx);
1045
+ cfg = ctx.config;
1046
+ }
1047
+ var data = [];
1048
+ for (var r = range.row[0]; r <= range.row[1]; r += 1) {
1049
+ if ((d === null || d === void 0 ? void 0 : d[r]) == null) {
1050
+ continue;
1051
+ }
1052
+ if ((cfg === null || cfg === void 0 ? void 0 : cfg.rowhidden) != null && cfg.rowhidden[r] != null) {
1053
+ continue;
1054
+ }
1055
+ var row = [];
1056
+ for (var c = range.column[0]; c <= range.column[1]; c += 1) {
1057
+ if ((cfg === null || cfg === void 0 ? void 0 : cfg.colhidden) != null && cfg.colhidden[c] != null) {
1058
+ continue;
1059
+ }
1060
+ row.push(d[r][c]);
1061
+ }
1062
+ data.push(row);
1063
+ }
1064
+ return data;
1065
+ }
1066
+ export function luckysheetUpdateCell(ctx, row_index, col_index) {
1067
+ ctx.luckysheetCellUpdate = [row_index, col_index];
1068
+ }
1069
+ export function getDataBySelectionNoCopy(ctx, range) {
1070
+ if (!range || !range.row || range.row.length === 0) return [];
1071
+ var data = [];
1072
+ var flowData = getFlowdata(ctx);
1073
+ if (!flowData) return [];
1074
+ for (var r = range.row[0]; r <= range.row[1]; r += 1) {
1075
+ var row = [];
1076
+ if (ctx.config.rowhidden != null && ctx.config.rowhidden[r] != null) {
1077
+ continue;
1078
+ }
1079
+ for (var c = range.column[0]; c <= range.column[1]; c += 1) {
1080
+ var value = null;
1081
+ if (ctx.config.colhidden != null && ctx.config.colhidden[c] != null) {
1082
+ continue;
1083
+ }
1084
+ if (flowData[r] != null && flowData[r][c] != null) {
1085
+ value = flowData[r][c];
1086
+ }
1087
+ row.push(value);
1088
+ }
1089
+ data.push(row);
1090
+ }
1091
+ return data;
1092
+ }