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