@fileverse-dev/fortune-core 1.0.5 → 1.0.7

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 +6 -5
  264. package/dist/index.esm.js +0 -80253
  265. package/dist/index.js +0 -80599
  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,700 @@
1
+ import { colLocationByIndex, diff, getcellrange, getCellValue, getFlowdata, getRangeByTxt, getSheetIndex, isAllowEdit, iscelldata, isdatetime, isRealNull, isRealNum, jfrefreshgrid, mergeBorder, rowLocationByIndex, setCellValue } from "..";
2
+ export function dataRangeSelection(ctx, cache, rangT, type, value) {
3
+ var _a, _b;
4
+ ctx.rangeDialog.show = true;
5
+ ctx.rangeDialog.type = type;
6
+ ctx.rangeDialog.rangeTxt = value;
7
+ if (ctx.luckysheet_select_save && !!rangT) {
8
+ var last = ctx.luckysheet_select_save[ctx.luckysheet_select_save.length - 1];
9
+ var row_index = last.row_focus;
10
+ var col_index = last.column_focus;
11
+ ctx.luckysheetCellUpdate = [row_index, col_index];
12
+ var range = getRangeByTxt(ctx, rangT);
13
+ var r = range[0].row;
14
+ var c = range[0].column;
15
+ var row_pre = rowLocationByIndex(r[0], ctx.visibledatarow)[0];
16
+ var row = rowLocationByIndex(r[1], ctx.visibledatarow)[1];
17
+ var col_pre = colLocationByIndex(c[0], ctx.visibledatacolumn)[0];
18
+ var col = colLocationByIndex(c[1], ctx.visibledatacolumn)[1];
19
+ ctx.formulaRangeSelect = {
20
+ height: row - row_pre - 1,
21
+ left: col_pre,
22
+ rangeIndex: (_b = (_a = ctx.formulaRangeSelect) === null || _a === void 0 ? void 0 : _a.rangeIndex) !== null && _b !== void 0 ? _b : 0,
23
+ top: row_pre,
24
+ width: col - col_pre - 1
25
+ };
26
+ } else {
27
+ ctx.luckysheetCellUpdate = [0, 0];
28
+ }
29
+ }
30
+ export function getDropdownList(ctx, txt) {
31
+ var list = [];
32
+ if (iscelldata(txt)) {
33
+ var range = getcellrange(ctx, txt);
34
+ var index = getSheetIndex(ctx, range.sheetId);
35
+ var d = ctx.luckysheetfile[index].data;
36
+ if (!d) return [];
37
+ for (var r = range.row[0]; r <= range.row[1]; r += 1) {
38
+ for (var c = range.column[0]; c <= range.column[1]; c += 1) {
39
+ if (!d[r]) {
40
+ continue;
41
+ }
42
+ var cell = d[r][c];
43
+ if (!cell || !cell.v) {
44
+ continue;
45
+ }
46
+ var v = cell.m || cell.v;
47
+ if (!list.includes(v)) {
48
+ list.push(v);
49
+ }
50
+ }
51
+ }
52
+ } else {
53
+ var arr = txt.split(",");
54
+ for (var i = 0; i < arr.length; i += 1) {
55
+ var v = arr[i];
56
+ if (v.length === 0) {
57
+ continue;
58
+ }
59
+ if (!list.includes(v)) {
60
+ list.push(v);
61
+ }
62
+ }
63
+ }
64
+ return list;
65
+ }
66
+ export function validateIdCard(ctx, idCard) {
67
+ var regIdCard = /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/;
68
+ if (regIdCard.test(idCard)) {
69
+ if (idCard.length === 18) {
70
+ var idCardWi = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
71
+ var idCardY = [1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2];
72
+ var idCardWiSum = 0;
73
+ for (var i = 0; i < 17; i += 1) {
74
+ idCardWiSum += Number(idCard.substring(i, i + 1)) * idCardWi[i];
75
+ }
76
+ var idCardMod = idCardWiSum % 11;
77
+ var idCardLast = idCard.substring(17);
78
+ if (idCardMod === 2) {
79
+ if (idCardLast === "X" || idCardLast === "x") {
80
+ return true;
81
+ }
82
+ return false;
83
+ }
84
+ if (idCardLast === idCardY[idCardMod].toString()) {
85
+ return true;
86
+ }
87
+ return false;
88
+ }
89
+ } else {
90
+ return false;
91
+ }
92
+ return false;
93
+ }
94
+ export function validateCellData(ctx, item, cellValue) {
95
+ var value1 = item.value1,
96
+ value2 = item.value2;
97
+ var type = item.type,
98
+ type2 = item.type2;
99
+ if (type === "dropdown") {
100
+ var list_1 = getDropdownList(ctx, value1);
101
+ if (type2 && cellValue) {
102
+ return cellValue.toString().split(",").every(function (i) {
103
+ return list_1.indexOf(i) !== -1;
104
+ });
105
+ }
106
+ var result = false;
107
+ for (var i = 0; i < list_1.length; i += 1) {
108
+ if (list_1[i] === cellValue) {
109
+ result = true;
110
+ break;
111
+ }
112
+ }
113
+ return result;
114
+ }
115
+ if (type === "checkbox") {} else if (type === "number" || type === "number_integer" || type === "number_decimal") {
116
+ if (!isRealNum(cellValue)) {
117
+ return false;
118
+ }
119
+ cellValue = Number(cellValue);
120
+ if (type === "number_integer" && cellValue % 1 !== 0) {
121
+ return false;
122
+ }
123
+ if (type === "number_decimal" && cellValue % 1 === 0) {
124
+ return false;
125
+ }
126
+ value1 = Number(value1);
127
+ value2 = Number(value2);
128
+ if (type2 === "between" && (cellValue < value1 || cellValue > value2)) {
129
+ return false;
130
+ }
131
+ if (type2 === "notBetween" && cellValue >= value1 && cellValue <= value2) {
132
+ return false;
133
+ }
134
+ if (type2 === "equal" && cellValue !== value1) {
135
+ return false;
136
+ }
137
+ if (type2 === "notEqualTo" && cellValue === value1) {
138
+ return false;
139
+ }
140
+ if (type2 === "moreThanThe" && cellValue <= value1) {
141
+ return false;
142
+ }
143
+ if (type2 === "lessThan" && cellValue >= value1) {
144
+ return false;
145
+ }
146
+ if (type2 === "greaterOrEqualTo" && cellValue < value1) {
147
+ return false;
148
+ }
149
+ if (type2 === "lessThanOrEqualTo" && cellValue > value1) {
150
+ return false;
151
+ }
152
+ } else if (type === "text_content") {
153
+ cellValue = cellValue.toString();
154
+ value1 = value1.toString();
155
+ if (type2 === "include" && cellValue.indexOf(value1) === -1) {
156
+ return false;
157
+ }
158
+ if (type2 === "exclude" && cellValue.indexOf(value1) > -1) {
159
+ return false;
160
+ }
161
+ if (type2 === "equal" && cellValue !== value1) {
162
+ return false;
163
+ }
164
+ } else if (type === "text_length") {
165
+ cellValue = cellValue.toString().length;
166
+ value1 = Number(value1);
167
+ value2 = Number(value2);
168
+ if (type2 === "between" && (cellValue < value1 || cellValue > value2)) {
169
+ return false;
170
+ }
171
+ if (type2 === "notBetween" && cellValue >= value1 && cellValue <= value2) {
172
+ return false;
173
+ }
174
+ if (type2 === "equal" && cellValue !== value1) {
175
+ return false;
176
+ }
177
+ if (type2 === "notEqualTo" && cellValue === value1) {
178
+ return false;
179
+ }
180
+ if (type2 === "moreThanThe" && cellValue <= value1) {
181
+ return false;
182
+ }
183
+ if (type2 === "lessThan" && cellValue >= value1) {
184
+ return false;
185
+ }
186
+ if (type2 === "greaterOrEqualTo" && cellValue < value1) {
187
+ return false;
188
+ }
189
+ if (type2 === "lessThanOrEqualTo" && cellValue > value1) {
190
+ return false;
191
+ }
192
+ } else if (type === "date") {
193
+ if (!isdatetime(cellValue)) {
194
+ return false;
195
+ }
196
+ if (type2 === "between" && (diff(cellValue, value1) < 0 || diff(cellValue, value2) > 0)) {
197
+ return false;
198
+ }
199
+ if (type2 === "notBetween" && diff(cellValue, value1) >= 0 && diff(cellValue, value2) <= 0) {
200
+ return false;
201
+ }
202
+ if (type2 === "equal" && diff(cellValue, value1) !== 0) {
203
+ return false;
204
+ }
205
+ if (type2 === "notEqualTo" && diff(cellValue, value1) === 0) {
206
+ return false;
207
+ }
208
+ if (type2 === "earlierThan" && diff(cellValue, value1) >= 0) {
209
+ return false;
210
+ }
211
+ if (type2 === "noEarlierThan" && diff(cellValue, value1) < 0) {
212
+ return false;
213
+ }
214
+ if (type2 === "laterThan" && diff(cellValue, value1) <= 0) {
215
+ return false;
216
+ }
217
+ if (type2 === "noLaterThan" && diff(cellValue, value1) > 0) {
218
+ return false;
219
+ }
220
+ } else if (type === "validity") {
221
+ if (type2 === "identificationNumber" && !validateIdCard(ctx, cellValue)) {
222
+ return false;
223
+ }
224
+ if (type2 === "phoneNumber" && !/^1[3456789]\d{9}$/.test(cellValue)) {
225
+ return false;
226
+ }
227
+ }
228
+ return true;
229
+ }
230
+ export function checkboxChange(ctx, r, c) {
231
+ var _a;
232
+ var index = getSheetIndex(ctx, ctx.currentSheetId);
233
+ var currentDataVerification = (_a = ctx.luckysheetfile[index].dataVerification) !== null && _a !== void 0 ? _a : {};
234
+ var item = currentDataVerification["".concat(r, "_").concat(c)];
235
+ item.checked = !item.checked;
236
+ var value = item.value2;
237
+ if (item.checked) {
238
+ value = item.value1;
239
+ }
240
+ var d = getFlowdata(ctx);
241
+ setCellValue(ctx, r, c, d, value);
242
+ }
243
+ export function getFailureText(ctx, item) {
244
+ var _a, _b, _c, _d, _e;
245
+ var failureText = "";
246
+ var lang = ctx.lang;
247
+ var type = item.type,
248
+ type2 = item.type2,
249
+ value1 = item.value1,
250
+ value2 = item.value2;
251
+ if (lang === "zh" || lang === "zh-CN") {
252
+ var optionLabel_zh = (_a = ctx.dataVerification) === null || _a === void 0 ? void 0 : _a.optionLabel_zh;
253
+ if (type === "dropdown") {
254
+ failureText += "你选择的不是下拉列表中的选项";
255
+ } else if (type === "checkbox") {} else if (type === "number" || type === "number_integer" || type === "number_decimal") {
256
+ failureText += "\u4F60\u8F93\u5165\u7684\u4E0D\u662F".concat(optionLabel_zh[type2]).concat(value1);
257
+ if (type2 === "between" || type2 === "notBetween") {
258
+ failureText += "\u548C".concat(value2, "\u4E4B\u95F4");
259
+ }
260
+ failureText += "\u7684".concat(optionLabel_zh[type]);
261
+ } else if (type === "text_content") {
262
+ failureText += "\u4F60\u8F93\u5165\u7684\u4E0D\u662F\u5185\u5BB9".concat(optionLabel_zh[type2]).concat(value1, "\u7684\u6587\u672C");
263
+ } else if (type === "text_length") {
264
+ failureText += "\u4F60\u8F93\u5165\u7684\u4E0D\u662F\u957F\u5EA6".concat(optionLabel_zh[type2]).concat(value1);
265
+ if (type2 === "between" || type2 === "notBetween") {
266
+ failureText += "\u548C".concat(value2, "\u4E4B\u95F4");
267
+ }
268
+ failureText += "的文本";
269
+ } else if (type === "date") {
270
+ failureText += "\u4F60\u8F93\u5165\u7684\u4E0D\u662F".concat(optionLabel_zh[type2]).concat(value1);
271
+ if (type2 === "between" || type2 === "notBetween") {
272
+ failureText += "\u548C".concat(value2, "\u4E4B\u95F4");
273
+ }
274
+ failureText += "的日期";
275
+ } else if (type === "validity") {
276
+ failureText += "\u4F60\u8F93\u5165\u7684\u4E0D\u662F\u4E00\u4E2A\u6B63\u786E\u7684".concat(optionLabel_zh[type2]);
277
+ }
278
+ } else if (lang === "zh-TW") {
279
+ var optionLabel_zh_tw = (_b = ctx.dataVerification) === null || _b === void 0 ? void 0 : _b.optionLabel_zh_tw;
280
+ if (type === "dropdown") {
281
+ failureText += "你選擇的不是下拉清單中的選項";
282
+ } else if (type === "checkbox") {} else if (type === "number" || type === "number_integer" || type === "number_decimal") {
283
+ failureText += "\u4F60\u8F38\u5165\u7684\u4E0D\u662F".concat(optionLabel_zh_tw[type2]).concat(value1);
284
+ if (type2 === "between" || type2 === "notBetween") {
285
+ failureText += "\u548C".concat(value2, "\u4E4B\u9593");
286
+ }
287
+ failureText += "\u7684".concat(optionLabel_zh_tw[type]);
288
+ } else if (type === "text_content") {
289
+ failureText += "\u4F60\u8F38\u5165\u7684\u4E0D\u662F\u5167\u5BB9".concat(optionLabel_zh_tw[type2]).concat(value1, "\u7684\u6587\u672C");
290
+ } else if (type === "text_length") {
291
+ failureText += "\u4F60\u8F38\u5165\u7684\u4E0D\u662F\u9577\u5EA6".concat(optionLabel_zh_tw[type2]).concat(value1);
292
+ if (type2 === "between" || type2 === "notBetween") {
293
+ failureText += "\u548C".concat(value2, "\u4E4B\u95F4");
294
+ }
295
+ failureText += "的文本";
296
+ } else if (type === "date") {
297
+ failureText += "\u4F60\u8F38\u5165\u7684\u4E0D\u662F".concat(optionLabel_zh_tw[type2]).concat(value1);
298
+ if (type2 === "between" || type2 === "notBetween") {
299
+ failureText += "\u548C".concat(value2, "\u4E4B\u95F4");
300
+ }
301
+ failureText += "的日期";
302
+ } else if (type === "validity") {
303
+ failureText += "\u4F60\u8F38\u5165\u7684\u4E0D\u662F\u4E00\u500B\u6B63\u78BA\u7684".concat(optionLabel_zh_tw[type2]);
304
+ }
305
+ } else if (lang === "es") {
306
+ var optionLabel_es = (_c = ctx.dataVerification) === null || _c === void 0 ? void 0 : _c.optionLabel_es;
307
+ if (type === "dropdown") {
308
+ failureText += "No elegiste una opción en la lista desplegable";
309
+ } else if (type === "checkbox") {} else if (type === "number" || type === "number_integer" || type === "number_decimal") {
310
+ failureText += "Lo que introduciste no es".concat(optionLabel_es[type2]).concat(value1);
311
+ if (type2 === "between" || type2 === "notBetween") {
312
+ failureText += "Y".concat(value2, "Entre");
313
+ }
314
+ failureText += "De".concat(optionLabel_es[type]);
315
+ } else if (type === "text_content") {
316
+ failureText += "Lo que introduciste no fue contenido".concat(optionLabel_es[type2]).concat(value1, "Texto");
317
+ } else if (type === "text_length") {
318
+ failureText += "No introduciste la longitud".concat(optionLabel_es[type2]).concat(value1);
319
+ if (type2 === "between" || type2 === "notBetween") {
320
+ failureText += "Y".concat(value2, "Entre");
321
+ }
322
+ failureText += "Texto";
323
+ } else if (type === "date") {
324
+ failureText += "Lo que introduciste no es".concat(optionLabel_es[type2]).concat(value1);
325
+ if (type2 === "between" || type2 === "notBetween") {
326
+ failureText += "Y".concat(value2, "Entre");
327
+ }
328
+ failureText += "Fecha";
329
+ } else if (type === "validity") {
330
+ failureText += "Lo que ingresas no es correcto".concat(optionLabel_es[type2]);
331
+ }
332
+ } else if (lang === "hi") {
333
+ var optionLabel_hi = (_d = ctx.dataVerification) === null || _d === void 0 ? void 0 : _d.optionLabel_hi;
334
+ if (type === "dropdown") {
335
+ failureText += "आपने जो चयन किया है वह ड्रॉप-डाउन सूची में एक विकल्प नहीं है";
336
+ } else if (type === "checkbox") {} else if (type === "number" || type === "number_integer" || type === "number_decimal") {
337
+ failureText += "\u0906\u092A\u0928\u0947 \u091C\u094B \u0926\u0930\u094D\u091C \u0915\u093F\u092F\u093E \u0939\u0948 \u0935\u0939 ".concat(optionLabel_hi[item.type], " ").concat(optionLabel_hi[item.type2], " ").concat(item.value1, " \u0928\u0939\u0940\u0902 \u0939\u0948");
338
+ if (item.type2 === "between" || item.type2 === "notBetween") {
339
+ failureText += " and ".concat(item.value2);
340
+ }
341
+ } else if (type === "text_content") {
342
+ failureText += "\u0906\u092A\u0928\u0947 \u091C\u094B \u0926\u0930\u094D\u091C \u0915\u093F\u092F\u093E \u0939\u0948 \u0935\u0939 \u092A\u093E\u0920 \u0928\u0939\u0940\u0902 \u0939\u0948 \u091C\u094B ".concat(optionLabel_hi[item.type2], " ").concat(item.value1, " \u0939\u0948");
343
+ } else if (type === "text_length") {
344
+ failureText += "\u0906\u092A\u0915\u0947 \u0926\u094D\u0935\u093E\u0930\u093E \u0926\u0930\u094D\u091C \u0915\u093F\u092F\u093E \u0917\u092F\u093E \u092A\u093E\u0920 \u0915\u0940 \u0932\u0902\u092C\u093E\u0908 ".concat(optionLabel_hi[item.type2], " ").concat(item.value1, " \u0928\u0939\u0940\u0902 \u0939\u0948");
345
+ if (item.type2 === "between" || item.type2 === "notBetween") {
346
+ failureText += " \u0914\u0930 ".concat(item.value2);
347
+ }
348
+ } else if (type === "date") {
349
+ failureText += "\u0906\u092A\u0915\u0947 \u0926\u094D\u0935\u093E\u0930\u093E \u0926\u0930\u094D\u091C \u0915\u0940 \u0917\u0908 \u0924\u093F\u0925\u093F ".concat(optionLabel_hi[item.type2], " ").concat(item.value1, " \u0928\u0939\u0940\u0902 \u0939\u0948\u0964");
350
+ if (type2 === "between" || type2 === "notBetween") {
351
+ failureText += " \u0914\u0930 ".concat(item.value2);
352
+ }
353
+ } else if (type === "validity") {
354
+ failureText += "\u0906\u092A\u0928\u0947 \u091C\u094B \u0926\u0930\u094D\u091C \u0915\u093F\u092F\u093E \u0939\u0948 \u0935\u0939 \u0938\u0939\u0940 ".concat(optionLabel_hi[item.type2], " \u0928\u0939\u0940\u0902 \u0939\u0948\u0964");
355
+ }
356
+ } else {
357
+ var optionLabel_en = (_e = ctx.dataVerification) === null || _e === void 0 ? void 0 : _e.optionLabel_en;
358
+ if (type === "dropdown") {
359
+ failureText += "What you selected is not an option in the drop-down list";
360
+ } else if (type === "checkbox") {} else if (type === "number" || type === "number_integer" || type === "number_decimal") {
361
+ failureText += "What you entered is not a ".concat(optionLabel_en[item.type], " ").concat(optionLabel_en[item.type2], " ").concat(item.value1);
362
+ if (item.type2 === "between" || item.type2 === "notBetween") {
363
+ failureText += " and ".concat(item.value2);
364
+ }
365
+ } else if (type === "text_content") {
366
+ failureText += "What you entered is not text that ".concat(optionLabel_en[item.type2], " ").concat(item.value1);
367
+ } else if (type === "text_length") {
368
+ failureText += "The text you entered is not length ".concat(optionLabel_en[item.type2], " ").concat(item.value1);
369
+ if (item.type2 === "between" || item.type2 === "notBetween") {
370
+ failureText += " and ".concat(item.value2);
371
+ }
372
+ } else if (type === "date") {
373
+ failureText += "The date you entered is not ".concat(optionLabel_en[item.type2], " ").concat(item.value1);
374
+ if (type2 === "between" || type2 === "notBetween") {
375
+ failureText += " and ".concat(item.value2);
376
+ }
377
+ } else if (type === "validity") {
378
+ failureText += "What you entered is not a correct ".concat(optionLabel_en[item.type2]);
379
+ }
380
+ }
381
+ return failureText;
382
+ }
383
+ export function getHintText(ctx, item) {
384
+ var _a, _b, _c, _d;
385
+ var hintValue = item.hintValue || "";
386
+ var type = item.type,
387
+ type2 = item.type2,
388
+ value1 = item.value1,
389
+ value2 = item.value2;
390
+ var lang = ctx.lang;
391
+ if (!hintValue) {
392
+ if (lang === "en") {
393
+ var optionLabel_en = (_a = ctx.dataVerification) === null || _a === void 0 ? void 0 : _a.optionLabel_en;
394
+ if (type === "dropdown") {
395
+ hintValue += "please select an option in the drop-down list";
396
+ } else if (type === "checkbox") {} else if (type === "number" || type === "number_integer" || type === "number_decimal") {
397
+ hintValue += "please enter a ".concat(optionLabel_en[type], " ").concat(optionLabel_en[type2], " ").concat(item.value1);
398
+ if (type2 === "between" || type2 === "notBetween") {
399
+ hintValue += " and ".concat(value2);
400
+ }
401
+ } else if (type === "text_content") {
402
+ hintValue += "please enter text ".concat(optionLabel_en[type2], " ").concat(value1);
403
+ } else if (type === "date") {
404
+ hintValue += "please enter a date ".concat(optionLabel_en[type2], " ").concat(value1);
405
+ if (type2 === "between" || type2 === "notBetween") {
406
+ hintValue += " and ".concat(value2);
407
+ }
408
+ } else if (type === "validity") {
409
+ hintValue += "please enter the correct ".concat(optionLabel_en[type2]);
410
+ }
411
+ } else if (lang === "zh" || lang === "zh-CN") {
412
+ var optionLabel_zh = (_b = ctx.dataVerification) === null || _b === void 0 ? void 0 : _b.optionLabel_zh;
413
+ if (type === "dropdown") {
414
+ hintValue += "请选择下拉列表中的选项";
415
+ } else if (type === "checkbox") {} else if (type === "number" || type === "number_integer" || type === "number_decimal") {
416
+ hintValue += "\u8BF7\u8F93\u5165".concat(optionLabel_zh[type2]).concat(value1);
417
+ if (type2 === "between" || type2 === "notBetween") {
418
+ hintValue += "\u548C".concat(value2, "\u4E4B\u95F4");
419
+ }
420
+ hintValue += "\u7684".concat(optionLabel_zh[type]);
421
+ } else if (type === "text_content") {
422
+ hintValue += "\u8BF7\u8F93\u5165\u5185\u5BB9".concat(optionLabel_zh[type2]).concat(value1, "\u7684\u6587\u672C");
423
+ } else if (type === "text_length") {
424
+ hintValue += "\u8BF7\u8F93\u5165\u957F\u5EA6".concat(optionLabel_zh[type2]).concat(value1);
425
+ if (type2 === "between" || type2 === "notBetween") {
426
+ hintValue += "\u548C".concat(value2, "\u4E4B\u95F4");
427
+ }
428
+ hintValue += "的文本";
429
+ } else if (type === "date") {
430
+ hintValue += "\u8BF7\u8F93\u5165".concat(optionLabel_zh[type2]).concat(value1);
431
+ if (type2 === "between" || type2 === "notBetween") {
432
+ hintValue += "\u548C".concat(value2, "\u4E4B\u95F4");
433
+ }
434
+ hintValue += "的日期";
435
+ } else if (type === "validity") {
436
+ hintValue += "\u8BF7\u8F93\u5165\u6B63\u786E\u7684".concat(optionLabel_zh[type2]);
437
+ }
438
+ } else if (lang === "zh-TW") {
439
+ var optionLabel_zh_tw = (_c = ctx.dataVerification) === null || _c === void 0 ? void 0 : _c.optionLabel_zh_tw;
440
+ if (type === "dropdown") {
441
+ hintValue += "請選擇下拉清單中的選項";
442
+ } else if (type === "checkbox") {} else if (type === "number" || type === "number_integer" || type === "number_decimal") {
443
+ hintValue += "\u8ACB\u8F38\u5165".concat(optionLabel_zh_tw[type2]).concat(value1);
444
+ if (type2 === "between" || type2 === "notBetween") {
445
+ hintValue += "\u548C".concat(value2, "\u4E4B\u9593");
446
+ }
447
+ hintValue += "\u7684".concat(optionLabel_zh_tw[type]);
448
+ } else if (type === "text_content") {
449
+ hintValue += "\u8ACB\u8F38\u5165\u5167\u5BB9".concat(optionLabel_zh_tw[type2]).concat(value1, "\u7684\u6587\u672C");
450
+ } else if (type === "text_length") {
451
+ hintValue += "\u8ACB\u8F38\u5165\u9577\u5EA6".concat(optionLabel_zh_tw[type2]).concat(value1);
452
+ if (type2 === "between" || type2 === "notBetween") {
453
+ hintValue += "\u548C".concat(value2, "\u4E4B\u9593");
454
+ }
455
+ hintValue += "的文本";
456
+ } else if (type === "date") {
457
+ hintValue += "\u8ACB\u8F38\u5165".concat(optionLabel_zh_tw[type2]).concat(value1);
458
+ if (type2 === "between" || type2 === "notBetween") {
459
+ hintValue += "\u548C".concat(value2, "\u4E4B\u9593");
460
+ }
461
+ hintValue += "的日期";
462
+ } else if (type === "validity") {
463
+ hintValue += "\u8ACB\u8F38\u5165\u6B63\u78BA\u7684".concat(optionLabel_zh_tw[type2]);
464
+ }
465
+ } else if (lang === "es") {
466
+ var optionLabel_es = (_d = ctx.dataVerification) === null || _d === void 0 ? void 0 : _d.optionLabel_es;
467
+ if (type === "dropdown") {
468
+ hintValue += "Por favor, elija una opción en la lista desplegable";
469
+ } else if (type === "checkbox") {} else if (type === "number" || type === "number_integer" || type === "number_decimal") {
470
+ hintValue += "Por favor, introduzca".concat(optionLabel_es[type2]).concat(value1);
471
+ if (type2 === "between" || type2 === "notBetween") {
472
+ hintValue += "Y".concat(value2, "Entre");
473
+ }
474
+ hintValue += "De".concat(optionLabel_es[type]);
475
+ } else if (type === "text_content") {
476
+ hintValue += "Por favor, introduzca el contenido".concat(optionLabel_es[type2]).concat(value1, "Texto");
477
+ } else if (type === "text_length") {
478
+ hintValue += "Por favor, introduzca la longitud".concat(optionLabel_es[type2]).concat(value1);
479
+ if (type2 === "between" || type2 === "notBetween") {
480
+ hintValue += "Y".concat(value2, "Entre");
481
+ }
482
+ hintValue += "Texto";
483
+ } else if (type === "date") {
484
+ hintValue += "Por favor, introduzca".concat(optionLabel_es[type2]).concat(value1);
485
+ if (type2 === "between" || type2 === "notBetween") {
486
+ hintValue += "Y".concat(value2, "Entre");
487
+ }
488
+ hintValue += "Fecha";
489
+ } else if (type === "validity") {
490
+ hintValue += "Por favor, introduzca lo correcto.".concat(optionLabel_es[type2]);
491
+ }
492
+ }
493
+ }
494
+ return hintValue;
495
+ }
496
+ export function cellFocus(ctx, r, c, clickMode) {
497
+ var _a, _b;
498
+ var allowEdit = isAllowEdit(ctx);
499
+ if (!allowEdit) return;
500
+ var showHintBox = document.getElementById("luckysheet-dataVerification-showHintBox");
501
+ var dropDownBtn = document.getElementById("luckysheet-dataVerification-dropdown-btn");
502
+ ctx.dataVerificationDropDownList = false;
503
+ if (!showHintBox || !dropDownBtn) return;
504
+ showHintBox.style.display = "none";
505
+ dropDownBtn.style.display = "none";
506
+ var index = getSheetIndex(ctx, ctx.currentSheetId);
507
+ var dataVerification = ctx.luckysheetfile[index].dataVerification;
508
+ ctx.dataVerificationDropDownList = false;
509
+ if (!dataVerification) return;
510
+ var row = ctx.visibledatarow[r];
511
+ var row_pre = r === 0 ? 0 : ctx.visibledatarow[r - 1];
512
+ var col = ctx.visibledatacolumn[c];
513
+ var col_pre = c === 0 ? 0 : ctx.visibledatacolumn[c - 1];
514
+ var d = getFlowdata(ctx);
515
+ if (!d) return;
516
+ var margeSet = mergeBorder(ctx, d, r, c);
517
+ if (margeSet) {
518
+ _a = margeSet.row, row_pre = _a[0], row = _a[1];
519
+ _b = margeSet.column, col_pre = _b[0], col = _b[1];
520
+ }
521
+ var item = dataVerification["".concat(r, "_").concat(c)];
522
+ if (!item) return;
523
+ if (clickMode && item.type === "checkbox") {
524
+ checkboxChange(ctx, r, c);
525
+ }
526
+ if (item.type === "dropdown") {
527
+ dropDownBtn.style.display = "block";
528
+ dropDownBtn.style.maxWidth = "".concat(col - col_pre, "px");
529
+ dropDownBtn.style.maxHeight = "".concat(row - row_pre, "px");
530
+ dropDownBtn.style.left = "".concat(col - 20, "px");
531
+ dropDownBtn.style.top = "".concat(row_pre + (row - row_pre - 20) / 2 - 2, "px");
532
+ }
533
+ if (item.hintShow) {
534
+ var hintText = "";
535
+ var lang = ctx.lang;
536
+ if (lang === "en") {
537
+ hintText = '<span style="color:#f5a623;">Hint: </span>';
538
+ } else if (lang === "zh" || lang === "zh-CN") {
539
+ hintText = '<span style="color:#f5a623;">提示:</span>';
540
+ } else if (lang === "zh-TW") {
541
+ hintText = '<span style="color:#f5a623;">提示:</span>';
542
+ } else if (lang === "es") {
543
+ hintText = '<span style="color:#f5a623;">Consejos:</span>';
544
+ } else if (lang === "hi") {
545
+ hintText = '<span style="color:#f5a623;">सुझाव: </span>';
546
+ }
547
+ hintText += getHintText(ctx, item);
548
+ showHintBox.innerHTML = hintText;
549
+ showHintBox.style.display = "block";
550
+ showHintBox.style.left = "".concat(col_pre, "px");
551
+ showHintBox.style.top = "".concat(row, "px");
552
+ }
553
+ var cellValue = getCellValue(r, c, d);
554
+ if (isRealNull(cellValue)) {
555
+ return;
556
+ }
557
+ var validate = validateCellData(ctx, item, cellValue);
558
+ if (!validate) {
559
+ var failureText = "";
560
+ var lang = ctx.lang;
561
+ var invalidText = '<div style="color:#F4874A;font-weight:500;font-size:14px;margin-bottom:4px;">Invalid</div>';
562
+ if (lang === "en") {
563
+ failureText = '<span style="color:#f72626;">Failure: </span>';
564
+ } else if (lang === "zh" || lang === "zh-CN") {
565
+ failureText = '<span style="color:#f72626;">失效:</span>';
566
+ } else if (lang === "zh-TW") {
567
+ failureText = '<span style="color:#f72626;">失效:</span>';
568
+ } else if (lang === "es") {
569
+ failureText = '<span style="color:#f72626;">Caducidad: </span>';
570
+ } else if (lang === "hi") {
571
+ failureText = '<span style="color:#f72626;">असफलता: </span>';
572
+ }
573
+ failureText = invalidText + failureText + getFailureText(ctx, item);
574
+ showHintBox.innerHTML = failureText;
575
+ showHintBox.style.display = "block";
576
+ showHintBox.style.left = "".concat(col_pre, "px");
577
+ showHintBox.style.top = "".concat(row, "px");
578
+ }
579
+ }
580
+ export function setDropdownValue(ctx, value, arr) {
581
+ if (!ctx.luckysheet_select_save) return;
582
+ var d = getFlowdata(ctx);
583
+ if (!d) return;
584
+ var last = ctx.luckysheet_select_save[ctx.luckysheet_select_save.length - 1];
585
+ var rowIndex = last.row_focus;
586
+ var colIndex = last.column_focus;
587
+ if (rowIndex == null || colIndex == null) return;
588
+ var index = getSheetIndex(ctx, ctx.currentSheetId);
589
+ var item = ctx.luckysheetfile[index].dataVerification["".concat(rowIndex, "_").concat(colIndex)];
590
+ if (item.type2 === "true") {
591
+ value = item.value1.split(",").filter(function (v) {
592
+ return arr.indexOf(v) >= 0;
593
+ }).join(",");
594
+ } else {
595
+ ctx.dataVerificationDropDownList = false;
596
+ }
597
+ setCellValue(ctx, rowIndex, colIndex, d, value);
598
+ jfrefreshgrid(ctx, null, undefined);
599
+ }
600
+ export function confirmMessage(ctx, generalDialog, dataVerification) {
601
+ var _a, _b;
602
+ var range = getRangeByTxt(ctx, (_b = (_a = ctx.dataVerification) === null || _a === void 0 ? void 0 : _a.dataRegulation) === null || _b === void 0 ? void 0 : _b.rangeTxt);
603
+ if (range.length === 0) {
604
+ ctx.warnDialog = generalDialog.noSelectionError;
605
+ return false;
606
+ }
607
+ var str = range[range.length - 1].row[0];
608
+ var edr = range[range.length - 1].row[1];
609
+ var stc = range[range.length - 1].column[0];
610
+ var edc = range[range.length - 1].column[1];
611
+ var d = getFlowdata(ctx);
612
+ if (!d) return false;
613
+ if (str < 0) {
614
+ str = 0;
615
+ }
616
+ if (edr > d.length - 1) {
617
+ edr = d.length - 1;
618
+ }
619
+ if (stc < 0) {
620
+ stc = 0;
621
+ }
622
+ if (edc > d[0].length - 1) {
623
+ edc = d[0].length - 1;
624
+ }
625
+ var regulation = ctx.dataVerification.dataRegulation;
626
+ var verifacationT = regulation === null || regulation === void 0 ? void 0 : regulation.type;
627
+ var value1 = regulation.value1,
628
+ value2 = regulation.value2,
629
+ type2 = regulation.type2;
630
+ var v1 = parseFloat(value1).toString() !== "NaN";
631
+ var v2 = parseFloat(value2).toString() !== "NaN";
632
+ if (verifacationT === "dropdown") {
633
+ if (!value1) {
634
+ ctx.warnDialog = dataVerification.tooltipInfo1;
635
+ }
636
+ } else if (verifacationT === "checkbox") {
637
+ if (!value1 || !value2) {
638
+ ctx.warnDialog = dataVerification.tooltipInfo2;
639
+ }
640
+ } else if (verifacationT === "number" || verifacationT === "number_integer" || verifacationT === "number_decimal") {
641
+ if (!v1) {
642
+ ctx.warnDialog = dataVerification.tooltipInfo3;
643
+ return false;
644
+ }
645
+ if (type2 === "between" || type2 === "notBetween") {
646
+ if (!v2) {
647
+ ctx.warnDialog = dataVerification.tooltipInfo3;
648
+ return false;
649
+ }
650
+ if (Number(value2) < Number(value1)) {
651
+ ctx.warnDialog = dataVerification.tooltipInfo4;
652
+ return false;
653
+ }
654
+ }
655
+ } else if (verifacationT === "text_content") {
656
+ if (!value1) {
657
+ ctx.warnDialog = dataVerification.tooltipInfo5;
658
+ return false;
659
+ }
660
+ } else if (verifacationT === "text_length") {
661
+ if (!v1) {
662
+ ctx.warnDialog = dataVerification.tooltipInfo3;
663
+ return false;
664
+ }
665
+ if (!Number.isInteger(Number(value1)) || Number(value1) < 0) {
666
+ ctx.warnDialog = dataVerification.textlengthInteger;
667
+ return false;
668
+ }
669
+ if (type2 === "between" || type2 === "notBetween") {
670
+ if (!v2) {
671
+ ctx.warnDialog = dataVerification.tooltipInfo3;
672
+ return false;
673
+ }
674
+ if (!Number.isInteger(Number(value2)) || Number(value2) < 0) {
675
+ ctx.warnDialog = dataVerification.textlengthInteger;
676
+ return false;
677
+ }
678
+ if (Number(value2) < Number(value1)) {
679
+ ctx.warnDialog = dataVerification.tooltipInfo4;
680
+ return false;
681
+ }
682
+ }
683
+ } else if (verifacationT === "date") {
684
+ if (!isdatetime(value1)) {
685
+ ctx.warnDialog = dataVerification.tooltipInfo6;
686
+ return false;
687
+ }
688
+ if (type2 === "between" || type2 === "notBetween") {
689
+ if (!isdatetime(value2)) {
690
+ ctx.warnDialog = dataVerification.tooltipInfo6;
691
+ return false;
692
+ }
693
+ if (diff(value1, value2) > 0) {
694
+ ctx.warnDialog = dataVerification.tooltipInfo7;
695
+ return false;
696
+ }
697
+ }
698
+ }
699
+ return true;
700
+ }