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