@fileverse-dev/fortune-core 1.0.26 → 2.0.0

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/index.esm.js +80254 -0
  2. package/dist/index.js +80600 -0
  3. package/{es → dist/packages/core/src}/api/cell.d.ts +10 -10
  4. package/{lib → dist/packages/core/src}/api/common.d.ts +66 -71
  5. package/{es → dist/packages/core/src}/api/errors.d.ts +2 -2
  6. package/{es → dist/packages/core/src}/api/index.d.ts +9 -9
  7. package/{es → dist/packages/core/src}/api/merge.d.ts +5 -5
  8. package/{lib → dist/packages/core/src}/api/range.d.ts +22 -22
  9. package/{lib → dist/packages/core/src}/api/rowcol.d.ts +14 -14
  10. package/{lib → dist/packages/core/src}/api/sheet.d.ts +10 -10
  11. package/{lib → dist/packages/core/src}/api/workbook.d.ts +15 -15
  12. package/{lib → dist/packages/core/src}/canvas.d.ts +46 -46
  13. package/{es → dist/packages/core/src}/context.d.ts +197 -198
  14. package/{es → dist/packages/core/src}/events/copy.d.ts +2 -2
  15. package/{lib → dist/packages/core/src}/events/index.d.ts +4 -4
  16. package/{lib → dist/packages/core/src}/events/keyboard.d.ts +6 -6
  17. package/{es → dist/packages/core/src}/events/mouse.d.ts +22 -22
  18. package/{es → dist/packages/core/src}/events/paste.d.ts +3 -3
  19. package/{lib → dist/packages/core/src}/index.d.ts +10 -10
  20. package/{lib → dist/packages/core/src}/locale/en.d.ts +992 -992
  21. package/{lib → dist/packages/core/src}/locale/es.d.ts +1134 -1134
  22. package/{lib → dist/packages/core/src}/locale/hi.d.ts +1030 -1030
  23. package/{lib → dist/packages/core/src}/locale/index.d.ts +1049 -1049
  24. package/{es → dist/packages/core/src}/locale/zh.d.ts +1048 -1048
  25. package/{lib → dist/packages/core/src}/locale/zh_tw.d.ts +1187 -1187
  26. package/{lib → dist/packages/core/src}/modules/ConditionFormat.d.ts +17 -17
  27. package/{lib → dist/packages/core/src}/modules/border.d.ts +3 -3
  28. package/{lib → dist/packages/core/src}/modules/cell.d.ts +32 -32
  29. package/{es → dist/packages/core/src}/modules/clipboard.d.ts +3 -3
  30. package/{es → dist/packages/core/src}/modules/color.d.ts +1 -1
  31. package/{lib → dist/packages/core/src}/modules/comment.d.ts +97 -97
  32. package/{es → dist/packages/core/src}/modules/conditionalFormat.d.ts +2 -2
  33. package/{es → dist/packages/core/src}/modules/cursor.d.ts +3 -3
  34. package/{es → dist/packages/core/src}/modules/dataVerification.d.ts +11 -11
  35. package/{es → dist/packages/core/src}/modules/dropCell.d.ts +10 -10
  36. package/{lib → dist/packages/core/src}/modules/filter.d.ts +45 -45
  37. package/{es → dist/packages/core/src}/modules/format.d.ts +6 -6
  38. package/{lib → dist/packages/core/src}/modules/formula.d.ts +54 -54
  39. package/{es → dist/packages/core/src}/modules/freeze.d.ts +5 -5
  40. package/{es → dist/packages/core/src}/modules/hyperlink.d.ts +21 -21
  41. package/{lib → dist/packages/core/src}/modules/iframe.d.ts +12 -12
  42. package/{es → dist/packages/core/src}/modules/image.d.ts +31 -31
  43. package/{es → dist/packages/core/src}/modules/index.d.ts +36 -36
  44. package/{lib → dist/packages/core/src}/modules/inline-string.d.ts +36 -36
  45. package/{es → dist/packages/core/src}/modules/location.d.ts +6 -6
  46. package/{es → dist/packages/core/src}/modules/locationCondition.d.ts +21 -21
  47. package/{es → dist/packages/core/src}/modules/merge.d.ts +3 -3
  48. package/{es → dist/packages/core/src}/modules/mobile.d.ts +5 -5
  49. package/{lib → dist/packages/core/src}/modules/moveCells.d.ts +5 -5
  50. package/{lib → dist/packages/core/src}/modules/protection.d.ts +5 -5
  51. package/{lib → dist/packages/core/src}/modules/refresh.d.ts +3 -3
  52. package/{es → dist/packages/core/src}/modules/rowcol.d.ts +19 -19
  53. package/{lib → dist/packages/core/src}/modules/screenshot.d.ts +2 -2
  54. package/{es → dist/packages/core/src}/modules/searchReplace.d.ts +36 -36
  55. package/{lib → dist/packages/core/src}/modules/selection.d.ts +46 -46
  56. package/{es → dist/packages/core/src}/modules/sheet.d.ts +10 -10
  57. package/{es → dist/packages/core/src}/modules/sort.d.ts +7 -7
  58. package/{es → dist/packages/core/src}/modules/splitColumn.d.ts +5 -5
  59. package/{es → dist/packages/core/src}/modules/text.d.ts +10 -10
  60. package/{lib → dist/packages/core/src}/modules/toolbar.d.ts +32 -32
  61. package/{es → dist/packages/core/src}/modules/validation.d.ts +19 -19
  62. package/{es → dist/packages/core/src}/modules/zoom.d.ts +3 -3
  63. package/{es → dist/packages/core/src}/settings.d.ts +100 -100
  64. package/{es → dist/packages/core/src}/types.d.ts +371 -376
  65. package/{es → dist/packages/core/src}/utils/freeze.d.ts +7 -7
  66. package/{es → dist/packages/core/src}/utils/index.d.ts +18 -19
  67. package/{lib → dist/packages/core/src}/utils/patch.d.ts +37 -37
  68. package/dist/packages/react/src/components/ChangeColor/index.d.ts +7 -0
  69. package/dist/packages/react/src/components/ConditionFormat/ConditionRules.d.ts +6 -0
  70. package/dist/packages/react/src/components/ConditionFormat/index.d.ts +7 -0
  71. package/dist/packages/react/src/components/ContextMenu/Divider.d.ts +3 -0
  72. package/dist/packages/react/src/components/ContextMenu/FilterMenu.d.ts +3 -0
  73. package/dist/packages/react/src/components/ContextMenu/Menu.d.ts +8 -0
  74. package/dist/packages/react/src/components/ContextMenu/SheetTab.d.ts +4 -0
  75. package/dist/packages/react/src/components/ContextMenu/index.d.ts +5 -0
  76. package/dist/packages/react/src/components/CustomSort/index.d.ts +4 -0
  77. package/dist/packages/react/src/components/DataVerification/DropdownList.d.ts +4 -0
  78. package/dist/packages/react/src/components/DataVerification/RangeDialog.d.ts +4 -0
  79. package/dist/packages/react/src/components/DataVerification/getDisplayedRangeTxt.d.ts +2 -0
  80. package/dist/packages/react/src/components/DataVerification/index.d.ts +4 -0
  81. package/dist/packages/react/src/components/Dialog/index.d.ts +15 -0
  82. package/dist/packages/react/src/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +11 -0
  83. package/dist/packages/react/src/components/DunePreview/DunePreview.d.ts +13 -0
  84. package/dist/packages/react/src/components/FilterOption/index.d.ts +5 -0
  85. package/dist/packages/react/src/components/FormatSearch/index.d.ts +6 -0
  86. package/dist/packages/react/src/components/FormulaSearch/index.d.ts +5 -0
  87. package/dist/packages/react/src/components/FxEditor/NameBox.d.ts +3 -0
  88. package/dist/packages/react/src/components/FxEditor/index.d.ts +4 -0
  89. package/dist/packages/react/src/components/IFrameBoxs/iFrameBoxs.d.ts +4 -0
  90. package/dist/packages/react/src/components/ImgBoxs/index.d.ts +3 -0
  91. package/dist/packages/react/src/components/LinkEidtCard/index.d.ts +5 -0
  92. package/dist/packages/react/src/components/LocationCondition/index.d.ts +3 -0
  93. package/dist/packages/react/src/components/MessageBox/index.d.ts +9 -0
  94. package/dist/packages/react/src/components/NotationBoxes/index.d.ts +3 -0
  95. package/dist/packages/react/src/components/ResetColumnWidth/index.d.ts +2 -0
  96. package/dist/packages/react/src/components/SVGDefines.d.ts +5 -0
  97. package/dist/packages/react/src/components/SVGIcon.d.ts +9 -0
  98. package/dist/packages/react/src/components/SearchReplace/index.d.ts +6 -0
  99. package/dist/packages/react/src/components/Sheet/index.d.ts +8 -0
  100. package/dist/packages/react/src/components/SheetList/SheetHiddenButton.d.ts +8 -0
  101. package/dist/packages/react/src/components/SheetList/SheetListItem.d.ts +9 -0
  102. package/dist/packages/react/src/components/SheetList/index.d.ts +4 -0
  103. package/dist/packages/react/src/components/SheetOverlay/ColumnHeader.d.ts +3 -0
  104. package/dist/packages/react/src/components/SheetOverlay/ContentEditable.d.ts +11 -0
  105. package/dist/packages/react/src/components/SheetOverlay/FormulaHint/index.d.ts +4 -0
  106. package/dist/packages/react/src/components/SheetOverlay/FormulaSearch/constant.d.ts +63 -0
  107. package/dist/packages/react/src/components/SheetOverlay/FormulaSearch/index.d.ts +4 -0
  108. package/dist/packages/react/src/components/SheetOverlay/InputBox.d.ts +3 -0
  109. package/dist/packages/react/src/components/SheetOverlay/RowHeader.d.ts +3 -0
  110. package/dist/packages/react/src/components/SheetOverlay/ScrollBar/index.d.ts +7 -0
  111. package/dist/packages/react/src/components/SheetOverlay/index.d.ts +4 -0
  112. package/dist/packages/react/src/components/SheetTab/SheetItem.d.ts +8 -0
  113. package/dist/packages/react/src/components/SheetTab/index.d.ts +4 -0
  114. package/dist/packages/react/src/components/SplitColumn/index.d.ts +3 -0
  115. package/dist/packages/react/src/components/Toolbar/Button.d.ts +12 -0
  116. package/dist/packages/react/src/components/Toolbar/ColorPicker.d.ts +6 -0
  117. package/dist/packages/react/src/components/Toolbar/Combo.d.ts +12 -0
  118. package/dist/packages/react/src/components/Toolbar/CustomBorder.d.ts +7 -0
  119. package/dist/packages/react/src/components/Toolbar/CustomButton.d.ts +11 -0
  120. package/dist/packages/react/src/components/Toolbar/CustomColor.d.ts +8 -0
  121. package/dist/packages/react/src/components/Toolbar/CustomIcon.d.ts +9 -0
  122. package/dist/packages/react/src/components/Toolbar/Divider.d.ts +4 -0
  123. package/dist/packages/react/src/components/Toolbar/MoreItemsContainer.d.ts +6 -0
  124. package/dist/packages/react/src/components/Toolbar/Select.d.ts +14 -0
  125. package/dist/packages/react/src/components/Toolbar/index.d.ts +10 -0
  126. package/dist/packages/react/src/components/Workbook/api.d.ts +1177 -0
  127. package/dist/packages/react/src/components/Workbook/index.d.ts +1185 -0
  128. package/dist/packages/react/src/components/ZoomControl/index.d.ts +4 -0
  129. package/dist/packages/react/src/components/index.d.ts +4 -0
  130. package/dist/packages/react/src/constants.d.ts +1 -0
  131. package/dist/packages/react/src/context/index.d.ts +25 -0
  132. package/dist/packages/react/src/context/modal.d.ts +10 -0
  133. package/dist/packages/react/src/hooks/useAlert.d.ts +4 -0
  134. package/dist/packages/react/src/hooks/useDialog.d.ts +5 -0
  135. package/dist/packages/react/src/hooks/useOutsideClick.d.ts +2 -0
  136. package/dist/packages/react/src/hooks/usePrevious.d.ts +2 -0
  137. package/dist/packages/react/src/index.d.ts +1 -0
  138. package/dist/packages/react/src/utils/datepickerStyles.d.ts +2 -0
  139. package/dist/stories/API.stories.d.ts +1210 -0
  140. package/dist/stories/Collabration.stories.d.ts +2359 -0
  141. package/dist/stories/Features.stories.d.ts +9430 -0
  142. package/dist/stories/data/cell.d.ts +983 -0
  143. package/dist/stories/data/dataVerification.d.ts +131 -0
  144. package/dist/stories/data/empty.d.ts +10 -0
  145. package/dist/stories/data/formula.d.ts +362 -0
  146. package/dist/stories/data/freeze.d.ts +34 -0
  147. package/dist/stories/data/protected.d.ts +40 -0
  148. package/dist/stories/utils.d.ts +1 -0
  149. package/package.json +6 -7
  150. package/es/api/cell.js +0 -204
  151. package/es/api/common.d.ts +0 -71
  152. package/es/api/common.js +0 -79
  153. package/es/api/errors.js +0 -2
  154. package/es/api/index.js +0 -8
  155. package/es/api/merge.js +0 -15
  156. package/es/api/range.d.ts +0 -22
  157. package/es/api/range.js +0 -123
  158. package/es/api/rowcol.d.ts +0 -14
  159. package/es/api/rowcol.js +0 -207
  160. package/es/api/sheet.d.ts +0 -10
  161. package/es/api/sheet.js +0 -128
  162. package/es/api/workbook.d.ts +0 -15
  163. package/es/api/workbook.js +0 -85
  164. package/es/canvas.d.ts +0 -46
  165. package/es/canvas.js +0 -1350
  166. package/es/context.js +0 -381
  167. package/es/events/copy.js +0 -78
  168. package/es/events/index.d.ts +0 -4
  169. package/es/events/index.js +0 -4
  170. package/es/events/keyboard.d.ts +0 -6
  171. package/es/events/keyboard.js +0 -332
  172. package/es/events/mouse.js +0 -1725
  173. package/es/events/paste.js +0 -1378
  174. package/es/index.d.ts +0 -10
  175. package/es/index.js +0 -10
  176. package/es/locale/en.d.ts +0 -992
  177. package/es/locale/en.js +0 -10564
  178. package/es/locale/es.d.ts +0 -1134
  179. package/es/locale/es.js +0 -10010
  180. package/es/locale/hi.d.ts +0 -1030
  181. package/es/locale/hi.js +0 -10550
  182. package/es/locale/index.d.ts +0 -1049
  183. package/es/locale/index.js +0 -23
  184. package/es/locale/zh.js +0 -10568
  185. package/es/locale/zh_tw.d.ts +0 -1187
  186. package/es/locale/zh_tw.js +0 -10072
  187. package/es/modules/ConditionFormat.d.ts +0 -17
  188. package/es/modules/ConditionFormat.js +0 -1258
  189. package/es/modules/border.d.ts +0 -3
  190. package/es/modules/border.js +0 -1240
  191. package/es/modules/cell.d.ts +0 -32
  192. package/es/modules/cell.js +0 -1055
  193. package/es/modules/clipboard.js +0 -36
  194. package/es/modules/color.js +0 -1
  195. package/es/modules/comment.d.ts +0 -97
  196. package/es/modules/comment.js +0 -597
  197. package/es/modules/conditionalFormat.js +0 -441
  198. package/es/modules/cursor.js +0 -62
  199. package/es/modules/dataVerification.js +0 -701
  200. package/es/modules/dropCell.js +0 -2267
  201. package/es/modules/filter.d.ts +0 -45
  202. package/es/modules/filter.js +0 -434
  203. package/es/modules/format.js +0 -323
  204. package/es/modules/formula.d.ts +0 -54
  205. package/es/modules/formula.js +0 -2301
  206. package/es/modules/freeze.js +0 -148
  207. package/es/modules/hyperlink.js +0 -216
  208. package/es/modules/iframe.d.ts +0 -12
  209. package/es/modules/iframe.js +0 -220
  210. package/es/modules/image.js +0 -253
  211. package/es/modules/index.js +0 -36
  212. package/es/modules/inline-string.d.ts +0 -36
  213. package/es/modules/inline-string.js +0 -437
  214. package/es/modules/location.js +0 -46
  215. package/es/modules/locationCondition.js +0 -218
  216. package/es/modules/merge.js +0 -216
  217. package/es/modules/mobile.js +0 -33
  218. package/es/modules/moveCells.d.ts +0 -5
  219. package/es/modules/moveCells.js +0 -348
  220. package/es/modules/protection.d.ts +0 -5
  221. package/es/modules/protection.js +0 -96
  222. package/es/modules/refresh.d.ts +0 -3
  223. package/es/modules/refresh.js +0 -34
  224. package/es/modules/rowcol.js +0 -1922
  225. package/es/modules/screenshot.d.ts +0 -2
  226. package/es/modules/screenshot.js +0 -90
  227. package/es/modules/searchReplace.js +0 -388
  228. package/es/modules/selection.d.ts +0 -46
  229. package/es/modules/selection.js +0 -1674
  230. package/es/modules/sheet.js +0 -237
  231. package/es/modules/sort.js +0 -134
  232. package/es/modules/splitColumn.js +0 -126
  233. package/es/modules/ssf.js +0 -1533
  234. package/es/modules/text.js +0 -1207
  235. package/es/modules/toolbar.d.ts +0 -32
  236. package/es/modules/toolbar.js +0 -970
  237. package/es/modules/validation.js +0 -190
  238. package/es/modules/zoom.js +0 -29
  239. package/es/settings.js +0 -36
  240. package/es/types.js +0 -1
  241. package/es/utils/freeze.js +0 -86
  242. package/es/utils/index.js +0 -198
  243. package/es/utils/patch.d.ts +0 -37
  244. package/es/utils/patch.js +0 -381
  245. package/lib/api/cell.d.ts +0 -10
  246. package/lib/api/cell.js +0 -215
  247. package/lib/api/common.js +0 -88
  248. package/lib/api/errors.d.ts +0 -2
  249. package/lib/api/errors.js +0 -8
  250. package/lib/api/index.d.ts +0 -9
  251. package/lib/api/index.js +0 -101
  252. package/lib/api/merge.d.ts +0 -5
  253. package/lib/api/merge.js +0 -22
  254. package/lib/api/range.js +0 -138
  255. package/lib/api/rowcol.js +0 -222
  256. package/lib/api/sheet.js +0 -145
  257. package/lib/api/workbook.js +0 -98
  258. package/lib/canvas.js +0 -1356
  259. package/lib/context.d.ts +0 -198
  260. package/lib/context.js +0 -393
  261. package/lib/events/copy.d.ts +0 -2
  262. package/lib/events/copy.js +0 -85
  263. package/lib/events/index.js +0 -49
  264. package/lib/events/keyboard.js +0 -342
  265. package/lib/events/mouse.d.ts +0 -22
  266. package/lib/events/mouse.js +0 -1744
  267. package/lib/events/paste.d.ts +0 -3
  268. package/lib/events/paste.js +0 -1386
  269. package/lib/index.js +0 -109
  270. package/lib/locale/en.js +0 -10570
  271. package/lib/locale/es.js +0 -10016
  272. package/lib/locale/hi.js +0 -10556
  273. package/lib/locale/index.js +0 -29
  274. package/lib/locale/zh.d.ts +0 -1048
  275. package/lib/locale/zh.js +0 -10574
  276. package/lib/locale/zh_tw.js +0 -10078
  277. package/lib/modules/ConditionFormat.js +0 -1273
  278. package/lib/modules/border.js +0 -1248
  279. package/lib/modules/cell.js +0 -1085
  280. package/lib/modules/clipboard.d.ts +0 -3
  281. package/lib/modules/clipboard.js +0 -42
  282. package/lib/modules/color.d.ts +0 -1
  283. package/lib/modules/color.js +0 -7
  284. package/lib/modules/comment.js +0 -625
  285. package/lib/modules/conditionalFormat.d.ts +0 -2
  286. package/lib/modules/conditionalFormat.js +0 -447
  287. package/lib/modules/cursor.d.ts +0 -3
  288. package/lib/modules/cursor.js +0 -70
  289. package/lib/modules/dataVerification.d.ts +0 -11
  290. package/lib/modules/dataVerification.js +0 -716
  291. package/lib/modules/dropCell.d.ts +0 -10
  292. package/lib/modules/dropCell.js +0 -2283
  293. package/lib/modules/filter.js +0 -448
  294. package/lib/modules/format.d.ts +0 -6
  295. package/lib/modules/format.js +0 -334
  296. package/lib/modules/formula.js +0 -2330
  297. package/lib/modules/freeze.d.ts +0 -5
  298. package/lib/modules/freeze.js +0 -158
  299. package/lib/modules/hyperlink.d.ts +0 -21
  300. package/lib/modules/hyperlink.js +0 -232
  301. package/lib/modules/iframe.js +0 -236
  302. package/lib/modules/image.d.ts +0 -31
  303. package/lib/modules/image.js +0 -272
  304. package/lib/modules/index.d.ts +0 -36
  305. package/lib/modules/index.js +0 -401
  306. package/lib/modules/inline-string.js +0 -452
  307. package/lib/modules/location.d.ts +0 -6
  308. package/lib/modules/location.js +0 -57
  309. package/lib/modules/locationCondition.d.ts +0 -21
  310. package/lib/modules/locationCondition.js +0 -229
  311. package/lib/modules/merge.d.ts +0 -3
  312. package/lib/modules/merge.js +0 -223
  313. package/lib/modules/mobile.d.ts +0 -5
  314. package/lib/modules/mobile.js +0 -41
  315. package/lib/modules/moveCells.js +0 -357
  316. package/lib/modules/protection.js +0 -106
  317. package/lib/modules/refresh.js +0 -40
  318. package/lib/modules/rowcol.d.ts +0 -19
  319. package/lib/modules/rowcol.js +0 -1935
  320. package/lib/modules/screenshot.js +0 -96
  321. package/lib/modules/searchReplace.d.ts +0 -36
  322. package/lib/modules/searchReplace.js +0 -402
  323. package/lib/modules/selection.js +0 -1703
  324. package/lib/modules/sheet.d.ts +0 -10
  325. package/lib/modules/sheet.js +0 -250
  326. package/lib/modules/sort.d.ts +0 -7
  327. package/lib/modules/sort.js +0 -143
  328. package/lib/modules/splitColumn.d.ts +0 -5
  329. package/lib/modules/splitColumn.js +0 -136
  330. package/lib/modules/ssf.js +0 -1539
  331. package/lib/modules/text.d.ts +0 -10
  332. package/lib/modules/text.js +0 -1221
  333. package/lib/modules/toolbar.js +0 -1003
  334. package/lib/modules/validation.d.ts +0 -19
  335. package/lib/modules/validation.js +0 -205
  336. package/lib/modules/zoom.d.ts +0 -3
  337. package/lib/modules/zoom.js +0 -36
  338. package/lib/settings.d.ts +0 -100
  339. package/lib/settings.js +0 -42
  340. package/lib/types.d.ts +0 -376
  341. package/lib/types.js +0 -5
  342. package/lib/utils/freeze.d.ts +0 -7
  343. package/lib/utils/freeze.js +0 -92
  344. package/lib/utils/index.d.ts +0 -19
  345. package/lib/utils/index.js +0 -258
  346. package/lib/utils/patch.js +0 -392
@@ -1,716 +0,0 @@
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
- var isReadOnly = (0, _.isAllowEditReadOnly)(ctx);
515
- if (!allowEdit || isReadOnly) return;
516
- var showHintBox = document.getElementById("luckysheet-dataVerification-showHintBox");
517
- var dropDownBtn = document.getElementById("luckysheet-dataVerification-dropdown-btn");
518
- ctx.dataVerificationDropDownList = false;
519
- if (!showHintBox || !dropDownBtn) return;
520
- showHintBox.style.display = "none";
521
- dropDownBtn.style.display = "none";
522
- var index = (0, _.getSheetIndex)(ctx, ctx.currentSheetId);
523
- var dataVerification = ctx.luckysheetfile[index].dataVerification;
524
- ctx.dataVerificationDropDownList = false;
525
- if (!dataVerification) return;
526
- var row = ctx.visibledatarow[r];
527
- var row_pre = r === 0 ? 0 : ctx.visibledatarow[r - 1];
528
- var col = ctx.visibledatacolumn[c];
529
- var col_pre = c === 0 ? 0 : ctx.visibledatacolumn[c - 1];
530
- var d = (0, _.getFlowdata)(ctx);
531
- if (!d) return;
532
- var margeSet = (0, _.mergeBorder)(ctx, d, r, c);
533
- if (margeSet) {
534
- _a = margeSet.row, row_pre = _a[0], row = _a[1];
535
- _b = margeSet.column, col_pre = _b[0], col = _b[1];
536
- }
537
- var item = dataVerification["".concat(r, "_").concat(c)];
538
- if (!item) return;
539
- if (clickMode && item.type === "checkbox") {
540
- checkboxChange(ctx, r, c);
541
- }
542
- if (item.type === "dropdown") {
543
- dropDownBtn.style.display = "block";
544
- dropDownBtn.style.maxWidth = "".concat(col - col_pre, "px");
545
- dropDownBtn.style.maxHeight = "".concat(row - row_pre, "px");
546
- dropDownBtn.style.left = "".concat(col - 20, "px");
547
- dropDownBtn.style.top = "".concat(row_pre + (row - row_pre - 20) / 2 - 2, "px");
548
- }
549
- if (item.hintShow) {
550
- var hintText = "";
551
- var lang = ctx.lang;
552
- if (lang === "en") {
553
- hintText = '<span style="color:#f5a623;">Hint: </span>';
554
- } else if (lang === "zh" || lang === "zh-CN") {
555
- hintText = '<span style="color:#f5a623;">提示:</span>';
556
- } else if (lang === "zh-TW") {
557
- hintText = '<span style="color:#f5a623;">提示:</span>';
558
- } else if (lang === "es") {
559
- hintText = '<span style="color:#f5a623;">Consejos:</span>';
560
- } else if (lang === "hi") {
561
- hintText = '<span style="color:#f5a623;">सुझाव: </span>';
562
- }
563
- hintText += getHintText(ctx, item);
564
- showHintBox.innerHTML = hintText;
565
- showHintBox.style.display = "block";
566
- showHintBox.style.left = "".concat(col_pre, "px");
567
- showHintBox.style.top = "".concat(row, "px");
568
- }
569
- var cellValue = (0, _.getCellValue)(r, c, d);
570
- if ((0, _.isRealNull)(cellValue)) {
571
- return;
572
- }
573
- var validate = validateCellData(ctx, item, cellValue);
574
- if (!validate) {
575
- var failureText = "";
576
- var lang = ctx.lang;
577
- var invalidText = '<div style="color:#F4874A;font-weight:500;font-size:14px;margin-bottom:4px;">Invalid</div>';
578
- if (lang === "en") {
579
- failureText = '<span style="color:#f72626;">Failure: </span>';
580
- } else if (lang === "zh" || lang === "zh-CN") {
581
- failureText = '<span style="color:#f72626;">失效:</span>';
582
- } else if (lang === "zh-TW") {
583
- failureText = '<span style="color:#f72626;">失效:</span>';
584
- } else if (lang === "es") {
585
- failureText = '<span style="color:#f72626;">Caducidad: </span>';
586
- } else if (lang === "hi") {
587
- failureText = '<span style="color:#f72626;">असफलता: </span>';
588
- }
589
- failureText = invalidText + failureText + getFailureText(ctx, item);
590
- showHintBox.innerHTML = failureText;
591
- showHintBox.style.display = "block";
592
- showHintBox.style.left = "".concat(col_pre, "px");
593
- showHintBox.style.top = "".concat(row, "px");
594
- }
595
- }
596
- function setDropdownValue(ctx, value, arr) {
597
- if (!ctx.luckysheet_select_save) return;
598
- var d = (0, _.getFlowdata)(ctx);
599
- if (!d) return;
600
- var last = ctx.luckysheet_select_save[ctx.luckysheet_select_save.length - 1];
601
- var rowIndex = last.row_focus;
602
- var colIndex = last.column_focus;
603
- if (rowIndex == null || colIndex == null) return;
604
- var index = (0, _.getSheetIndex)(ctx, ctx.currentSheetId);
605
- var item = ctx.luckysheetfile[index].dataVerification["".concat(rowIndex, "_").concat(colIndex)];
606
- if (item.type2 === "true") {
607
- value = item.value1.split(",").filter(function (v) {
608
- return arr.indexOf(v) >= 0;
609
- }).join(",");
610
- } else {
611
- ctx.dataVerificationDropDownList = false;
612
- }
613
- (0, _.setCellValue)(ctx, rowIndex, colIndex, d, value);
614
- (0, _.jfrefreshgrid)(ctx, null, undefined);
615
- }
616
- function confirmMessage(ctx, generalDialog, dataVerification) {
617
- var _a, _b;
618
- 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);
619
- if (range.length === 0) {
620
- ctx.warnDialog = generalDialog.noSelectionError;
621
- return false;
622
- }
623
- var str = range[range.length - 1].row[0];
624
- var edr = range[range.length - 1].row[1];
625
- var stc = range[range.length - 1].column[0];
626
- var edc = range[range.length - 1].column[1];
627
- var d = (0, _.getFlowdata)(ctx);
628
- if (!d) return false;
629
- if (str < 0) {
630
- str = 0;
631
- }
632
- if (edr > d.length - 1) {
633
- edr = d.length - 1;
634
- }
635
- if (stc < 0) {
636
- stc = 0;
637
- }
638
- if (edc > d[0].length - 1) {
639
- edc = d[0].length - 1;
640
- }
641
- var regulation = ctx.dataVerification.dataRegulation;
642
- var verifacationT = regulation === null || regulation === void 0 ? void 0 : regulation.type;
643
- var value1 = regulation.value1,
644
- value2 = regulation.value2,
645
- type2 = regulation.type2;
646
- var v1 = parseFloat(value1).toString() !== "NaN";
647
- var v2 = parseFloat(value2).toString() !== "NaN";
648
- if (verifacationT === "dropdown") {
649
- if (!value1) {
650
- ctx.warnDialog = dataVerification.tooltipInfo1;
651
- }
652
- } else if (verifacationT === "checkbox") {
653
- if (!value1 || !value2) {
654
- ctx.warnDialog = dataVerification.tooltipInfo2;
655
- }
656
- } else if (verifacationT === "number" || verifacationT === "number_integer" || verifacationT === "number_decimal") {
657
- if (!v1) {
658
- ctx.warnDialog = dataVerification.tooltipInfo3;
659
- return false;
660
- }
661
- if (type2 === "between" || type2 === "notBetween") {
662
- if (!v2) {
663
- ctx.warnDialog = dataVerification.tooltipInfo3;
664
- return false;
665
- }
666
- if (Number(value2) < Number(value1)) {
667
- ctx.warnDialog = dataVerification.tooltipInfo4;
668
- return false;
669
- }
670
- }
671
- } else if (verifacationT === "text_content") {
672
- if (!value1) {
673
- ctx.warnDialog = dataVerification.tooltipInfo5;
674
- return false;
675
- }
676
- } else if (verifacationT === "text_length") {
677
- if (!v1) {
678
- ctx.warnDialog = dataVerification.tooltipInfo3;
679
- return false;
680
- }
681
- if (!Number.isInteger(Number(value1)) || Number(value1) < 0) {
682
- ctx.warnDialog = dataVerification.textlengthInteger;
683
- return false;
684
- }
685
- if (type2 === "between" || type2 === "notBetween") {
686
- if (!v2) {
687
- ctx.warnDialog = dataVerification.tooltipInfo3;
688
- return false;
689
- }
690
- if (!Number.isInteger(Number(value2)) || Number(value2) < 0) {
691
- ctx.warnDialog = dataVerification.textlengthInteger;
692
- return false;
693
- }
694
- if (Number(value2) < Number(value1)) {
695
- ctx.warnDialog = dataVerification.tooltipInfo4;
696
- return false;
697
- }
698
- }
699
- } else if (verifacationT === "date") {
700
- if (!(0, _.isdatetime)(value1)) {
701
- ctx.warnDialog = dataVerification.tooltipInfo6;
702
- return false;
703
- }
704
- if (type2 === "between" || type2 === "notBetween") {
705
- if (!(0, _.isdatetime)(value2)) {
706
- ctx.warnDialog = dataVerification.tooltipInfo6;
707
- return false;
708
- }
709
- if ((0, _.diff)(value1, value2) > 0) {
710
- ctx.warnDialog = dataVerification.tooltipInfo7;
711
- return false;
712
- }
713
- }
714
- }
715
- return true;
716
- }