@fileverse-dev/fortune-core 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/{dist/packages/core/src → es}/api/cell.d.ts +10 -10
  2. package/es/api/cell.js +204 -0
  3. package/{dist/packages/core/src → es}/api/common.d.ts +66 -66
  4. package/es/api/common.js +79 -0
  5. package/{dist/packages/core/src → es}/api/errors.d.ts +2 -2
  6. package/es/api/errors.js +2 -0
  7. package/{dist/packages/core/src → es}/api/index.d.ts +9 -9
  8. package/es/api/index.js +8 -0
  9. package/{dist/packages/core/src → es}/api/merge.d.ts +5 -5
  10. package/es/api/merge.js +15 -0
  11. package/{dist/packages/core/src → es}/api/range.d.ts +22 -22
  12. package/es/api/range.js +123 -0
  13. package/{dist/packages/core/src → es}/api/rowcol.d.ts +14 -14
  14. package/es/api/rowcol.js +207 -0
  15. package/{dist/packages/core/src → es}/api/sheet.d.ts +10 -10
  16. package/es/api/sheet.js +128 -0
  17. package/{dist/packages/core/src → es}/api/workbook.d.ts +15 -15
  18. package/es/api/workbook.js +85 -0
  19. package/{dist/packages/core/src → es}/canvas.d.ts +46 -46
  20. package/es/canvas.js +1350 -0
  21. package/{dist/packages/core/src → es}/context.d.ts +197 -197
  22. package/es/context.js +380 -0
  23. package/{dist/packages/core/src → es}/events/copy.d.ts +2 -2
  24. package/es/events/copy.js +78 -0
  25. package/{dist/packages/core/src → es}/events/index.d.ts +4 -4
  26. package/es/events/index.js +4 -0
  27. package/{dist/packages/core/src → es}/events/keyboard.d.ts +6 -6
  28. package/es/events/keyboard.js +332 -0
  29. package/{dist/packages/core/src → es}/events/mouse.d.ts +22 -22
  30. package/es/events/mouse.js +1725 -0
  31. package/{dist/packages/core/src → es}/events/paste.d.ts +3 -3
  32. package/es/events/paste.js +1358 -0
  33. package/{dist/packages/core/src → es}/index.d.ts +10 -10
  34. package/es/index.js +10 -0
  35. package/{dist/packages/core/src → es}/locale/en.d.ts +992 -992
  36. package/es/locale/en.js +10564 -0
  37. package/{dist/packages/core/src → es}/locale/es.d.ts +1134 -1134
  38. package/es/locale/es.js +10010 -0
  39. package/{dist/packages/core/src → es}/locale/hi.d.ts +1030 -1030
  40. package/es/locale/hi.js +10550 -0
  41. package/{dist/packages/core/src → es}/locale/index.d.ts +1049 -1049
  42. package/es/locale/index.js +23 -0
  43. package/{dist/packages/core/src → es}/locale/zh.d.ts +1048 -1048
  44. package/es/locale/zh.js +10568 -0
  45. package/{dist/packages/core/src → es}/locale/zh_tw.d.ts +1187 -1187
  46. package/es/locale/zh_tw.js +10072 -0
  47. package/{dist/packages/core/src → es}/modules/ConditionFormat.d.ts +17 -17
  48. package/es/modules/ConditionFormat.js +1258 -0
  49. package/{dist/packages/core/src → es}/modules/border.d.ts +3 -3
  50. package/es/modules/border.js +1240 -0
  51. package/{dist/packages/core/src → es}/modules/cell.d.ts +32 -32
  52. package/es/modules/cell.js +1055 -0
  53. package/{dist/packages/core/src → es}/modules/clipboard.d.ts +3 -3
  54. package/es/modules/clipboard.js +36 -0
  55. package/{dist/packages/core/src → es}/modules/color.d.ts +1 -1
  56. package/es/modules/color.js +1 -0
  57. package/{dist/packages/core/src → es}/modules/comment.d.ts +97 -97
  58. package/es/modules/comment.js +597 -0
  59. package/{dist/packages/core/src → es}/modules/conditionalFormat.d.ts +2 -2
  60. package/es/modules/conditionalFormat.js +441 -0
  61. package/{dist/packages/core/src → es}/modules/cursor.d.ts +3 -3
  62. package/es/modules/cursor.js +62 -0
  63. package/{dist/packages/core/src → es}/modules/dataVerification.d.ts +11 -11
  64. package/es/modules/dataVerification.js +700 -0
  65. package/{dist/packages/core/src → es}/modules/dropCell.d.ts +10 -10
  66. package/es/modules/dropCell.js +2266 -0
  67. package/{dist/packages/core/src → es}/modules/filter.d.ts +45 -45
  68. package/es/modules/filter.js +434 -0
  69. package/{dist/packages/core/src → es}/modules/format.d.ts +6 -6
  70. package/es/modules/format.js +323 -0
  71. package/{dist/packages/core/src → es}/modules/formula.d.ts +54 -54
  72. package/es/modules/formula.js +2301 -0
  73. package/{dist/packages/core/src → es}/modules/freeze.d.ts +5 -5
  74. package/es/modules/freeze.js +148 -0
  75. package/{dist/packages/core/src → es}/modules/hyperlink.d.ts +21 -21
  76. package/es/modules/hyperlink.js +216 -0
  77. package/{dist/packages/core/src → es}/modules/iframe.d.ts +12 -12
  78. package/es/modules/iframe.js +220 -0
  79. package/{dist/packages/core/src → es}/modules/image.d.ts +31 -31
  80. package/es/modules/image.js +253 -0
  81. package/{dist/packages/core/src → es}/modules/index.d.ts +36 -36
  82. package/es/modules/index.js +36 -0
  83. package/{dist/packages/core/src → es}/modules/inline-string.d.ts +36 -36
  84. package/es/modules/inline-string.js +437 -0
  85. package/{dist/packages/core/src → es}/modules/location.d.ts +6 -6
  86. package/es/modules/location.js +46 -0
  87. package/{dist/packages/core/src → es}/modules/locationCondition.d.ts +21 -21
  88. package/es/modules/locationCondition.js +218 -0
  89. package/{dist/packages/core/src → es}/modules/merge.d.ts +3 -3
  90. package/es/modules/merge.js +216 -0
  91. package/{dist/packages/core/src → es}/modules/mobile.d.ts +5 -5
  92. package/es/modules/mobile.js +33 -0
  93. package/{dist/packages/core/src → es}/modules/moveCells.d.ts +5 -5
  94. package/es/modules/moveCells.js +348 -0
  95. package/{dist/packages/core/src → es}/modules/protection.d.ts +5 -5
  96. package/es/modules/protection.js +96 -0
  97. package/{dist/packages/core/src → es}/modules/refresh.d.ts +3 -3
  98. package/es/modules/refresh.js +34 -0
  99. package/{dist/packages/core/src → es}/modules/rowcol.d.ts +19 -19
  100. package/es/modules/rowcol.js +1922 -0
  101. package/{dist/packages/core/src → es}/modules/screenshot.d.ts +2 -2
  102. package/es/modules/screenshot.js +90 -0
  103. package/{dist/packages/core/src → es}/modules/searchReplace.d.ts +36 -36
  104. package/es/modules/searchReplace.js +388 -0
  105. package/{dist/packages/core/src → es}/modules/selection.d.ts +46 -46
  106. package/es/modules/selection.js +1674 -0
  107. package/{dist/packages/core/src → es}/modules/sheet.d.ts +10 -10
  108. package/es/modules/sheet.js +237 -0
  109. package/{dist/packages/core/src → es}/modules/sort.d.ts +7 -7
  110. package/es/modules/sort.js +150 -0
  111. package/{dist/packages/core/src → es}/modules/splitColumn.d.ts +5 -5
  112. package/es/modules/splitColumn.js +126 -0
  113. package/es/modules/ssf.js +1533 -0
  114. package/{dist/packages/core/src → es}/modules/text.d.ts +10 -10
  115. package/es/modules/text.js +1207 -0
  116. package/{dist/packages/core/src → es}/modules/toolbar.d.ts +32 -32
  117. package/es/modules/toolbar.js +970 -0
  118. package/{dist/packages/core/src → es}/modules/validation.d.ts +19 -19
  119. package/es/modules/validation.js +190 -0
  120. package/{dist/packages/core/src → es}/modules/zoom.d.ts +3 -3
  121. package/es/modules/zoom.js +29 -0
  122. package/{dist/packages/core/src → es}/settings.d.ts +100 -100
  123. package/es/settings.js +36 -0
  124. package/{dist/packages/core/src → es}/types.d.ts +371 -371
  125. package/es/types.js +1 -0
  126. package/{dist/packages/core/src → es}/utils/freeze.d.ts +7 -7
  127. package/es/utils/freeze.js +86 -0
  128. package/{dist/packages/core/src → es}/utils/index.d.ts +18 -18
  129. package/es/utils/index.js +173 -0
  130. package/{dist/packages/core/src → es}/utils/patch.d.ts +37 -37
  131. package/es/utils/patch.js +381 -0
  132. package/lib/api/cell.d.ts +10 -0
  133. package/lib/api/cell.js +215 -0
  134. package/lib/api/common.d.ts +66 -0
  135. package/lib/api/common.js +88 -0
  136. package/lib/api/errors.d.ts +2 -0
  137. package/lib/api/errors.js +8 -0
  138. package/lib/api/index.d.ts +9 -0
  139. package/lib/api/index.js +101 -0
  140. package/lib/api/merge.d.ts +5 -0
  141. package/lib/api/merge.js +22 -0
  142. package/lib/api/range.d.ts +22 -0
  143. package/lib/api/range.js +138 -0
  144. package/lib/api/rowcol.d.ts +14 -0
  145. package/lib/api/rowcol.js +222 -0
  146. package/lib/api/sheet.d.ts +10 -0
  147. package/lib/api/sheet.js +145 -0
  148. package/lib/api/workbook.d.ts +15 -0
  149. package/lib/api/workbook.js +98 -0
  150. package/lib/canvas.d.ts +46 -0
  151. package/lib/canvas.js +1356 -0
  152. package/lib/context.d.ts +197 -0
  153. package/lib/context.js +392 -0
  154. package/lib/events/copy.d.ts +2 -0
  155. package/lib/events/copy.js +85 -0
  156. package/lib/events/index.d.ts +4 -0
  157. package/lib/events/index.js +49 -0
  158. package/lib/events/keyboard.d.ts +6 -0
  159. package/lib/events/keyboard.js +342 -0
  160. package/lib/events/mouse.d.ts +22 -0
  161. package/lib/events/mouse.js +1744 -0
  162. package/lib/events/paste.d.ts +3 -0
  163. package/lib/events/paste.js +1366 -0
  164. package/lib/index.d.ts +10 -0
  165. package/lib/index.js +109 -0
  166. package/lib/locale/en.d.ts +992 -0
  167. package/lib/locale/en.js +10570 -0
  168. package/lib/locale/es.d.ts +1134 -0
  169. package/lib/locale/es.js +10016 -0
  170. package/lib/locale/hi.d.ts +1030 -0
  171. package/lib/locale/hi.js +10556 -0
  172. package/lib/locale/index.d.ts +1049 -0
  173. package/lib/locale/index.js +29 -0
  174. package/lib/locale/zh.d.ts +1048 -0
  175. package/lib/locale/zh.js +10574 -0
  176. package/lib/locale/zh_tw.d.ts +1187 -0
  177. package/lib/locale/zh_tw.js +10078 -0
  178. package/lib/modules/ConditionFormat.d.ts +17 -0
  179. package/lib/modules/ConditionFormat.js +1273 -0
  180. package/lib/modules/border.d.ts +3 -0
  181. package/lib/modules/border.js +1248 -0
  182. package/lib/modules/cell.d.ts +32 -0
  183. package/lib/modules/cell.js +1085 -0
  184. package/lib/modules/clipboard.d.ts +3 -0
  185. package/lib/modules/clipboard.js +42 -0
  186. package/lib/modules/color.d.ts +1 -0
  187. package/lib/modules/color.js +7 -0
  188. package/lib/modules/comment.d.ts +97 -0
  189. package/lib/modules/comment.js +625 -0
  190. package/lib/modules/conditionalFormat.d.ts +2 -0
  191. package/lib/modules/conditionalFormat.js +447 -0
  192. package/lib/modules/cursor.d.ts +3 -0
  193. package/lib/modules/cursor.js +70 -0
  194. package/lib/modules/dataVerification.d.ts +11 -0
  195. package/lib/modules/dataVerification.js +715 -0
  196. package/lib/modules/dropCell.d.ts +10 -0
  197. package/lib/modules/dropCell.js +2282 -0
  198. package/lib/modules/filter.d.ts +45 -0
  199. package/lib/modules/filter.js +448 -0
  200. package/lib/modules/format.d.ts +6 -0
  201. package/lib/modules/format.js +334 -0
  202. package/lib/modules/formula.d.ts +54 -0
  203. package/lib/modules/formula.js +2330 -0
  204. package/lib/modules/freeze.d.ts +5 -0
  205. package/lib/modules/freeze.js +158 -0
  206. package/lib/modules/hyperlink.d.ts +21 -0
  207. package/lib/modules/hyperlink.js +232 -0
  208. package/lib/modules/iframe.d.ts +12 -0
  209. package/lib/modules/iframe.js +236 -0
  210. package/lib/modules/image.d.ts +31 -0
  211. package/lib/modules/image.js +272 -0
  212. package/lib/modules/index.d.ts +36 -0
  213. package/lib/modules/index.js +401 -0
  214. package/lib/modules/inline-string.d.ts +36 -0
  215. package/lib/modules/inline-string.js +452 -0
  216. package/lib/modules/location.d.ts +6 -0
  217. package/lib/modules/location.js +57 -0
  218. package/lib/modules/locationCondition.d.ts +21 -0
  219. package/lib/modules/locationCondition.js +229 -0
  220. package/lib/modules/merge.d.ts +3 -0
  221. package/lib/modules/merge.js +223 -0
  222. package/lib/modules/mobile.d.ts +5 -0
  223. package/lib/modules/mobile.js +41 -0
  224. package/lib/modules/moveCells.d.ts +5 -0
  225. package/lib/modules/moveCells.js +357 -0
  226. package/lib/modules/protection.d.ts +5 -0
  227. package/lib/modules/protection.js +106 -0
  228. package/lib/modules/refresh.d.ts +3 -0
  229. package/lib/modules/refresh.js +40 -0
  230. package/lib/modules/rowcol.d.ts +19 -0
  231. package/lib/modules/rowcol.js +1935 -0
  232. package/lib/modules/screenshot.d.ts +2 -0
  233. package/lib/modules/screenshot.js +96 -0
  234. package/lib/modules/searchReplace.d.ts +36 -0
  235. package/lib/modules/searchReplace.js +402 -0
  236. package/lib/modules/selection.d.ts +46 -0
  237. package/lib/modules/selection.js +1703 -0
  238. package/lib/modules/sheet.d.ts +10 -0
  239. package/lib/modules/sheet.js +250 -0
  240. package/lib/modules/sort.d.ts +7 -0
  241. package/lib/modules/sort.js +159 -0
  242. package/lib/modules/splitColumn.d.ts +5 -0
  243. package/lib/modules/splitColumn.js +136 -0
  244. package/lib/modules/ssf.js +1539 -0
  245. package/lib/modules/text.d.ts +10 -0
  246. package/lib/modules/text.js +1221 -0
  247. package/lib/modules/toolbar.d.ts +32 -0
  248. package/lib/modules/toolbar.js +1003 -0
  249. package/lib/modules/validation.d.ts +19 -0
  250. package/lib/modules/validation.js +205 -0
  251. package/lib/modules/zoom.d.ts +3 -0
  252. package/lib/modules/zoom.js +36 -0
  253. package/lib/settings.d.ts +100 -0
  254. package/lib/settings.js +42 -0
  255. package/lib/types.d.ts +371 -0
  256. package/lib/types.js +5 -0
  257. package/lib/utils/freeze.d.ts +7 -0
  258. package/lib/utils/freeze.js +92 -0
  259. package/lib/utils/index.d.ts +18 -0
  260. package/lib/utils/index.js +231 -0
  261. package/lib/utils/patch.d.ts +37 -0
  262. package/lib/utils/patch.js +392 -0
  263. package/package.json +7 -6
  264. package/dist/index.esm.js +0 -80255
  265. package/dist/index.js +0 -80601
  266. package/dist/packages/react/src/components/ChangeColor/index.d.ts +0 -7
  267. package/dist/packages/react/src/components/ConditionFormat/ConditionRules.d.ts +0 -6
  268. package/dist/packages/react/src/components/ConditionFormat/index.d.ts +0 -7
  269. package/dist/packages/react/src/components/ContextMenu/Divider.d.ts +0 -3
  270. package/dist/packages/react/src/components/ContextMenu/FilterMenu.d.ts +0 -3
  271. package/dist/packages/react/src/components/ContextMenu/Menu.d.ts +0 -8
  272. package/dist/packages/react/src/components/ContextMenu/SheetTab.d.ts +0 -4
  273. package/dist/packages/react/src/components/ContextMenu/index.d.ts +0 -5
  274. package/dist/packages/react/src/components/CustomSort/index.d.ts +0 -4
  275. package/dist/packages/react/src/components/DataVerification/DropdownList.d.ts +0 -4
  276. package/dist/packages/react/src/components/DataVerification/RangeDialog.d.ts +0 -4
  277. package/dist/packages/react/src/components/DataVerification/getDisplayedRangeTxt.d.ts +0 -2
  278. package/dist/packages/react/src/components/DataVerification/index.d.ts +0 -4
  279. package/dist/packages/react/src/components/Dialog/index.d.ts +0 -15
  280. package/dist/packages/react/src/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +0 -11
  281. package/dist/packages/react/src/components/DunePreview/DunePreview.d.ts +0 -13
  282. package/dist/packages/react/src/components/FilterOption/index.d.ts +0 -5
  283. package/dist/packages/react/src/components/FormatSearch/index.d.ts +0 -6
  284. package/dist/packages/react/src/components/FormulaSearch/index.d.ts +0 -5
  285. package/dist/packages/react/src/components/FxEditor/NameBox.d.ts +0 -3
  286. package/dist/packages/react/src/components/FxEditor/index.d.ts +0 -4
  287. package/dist/packages/react/src/components/IFrameBoxs/iFrameBoxs.d.ts +0 -4
  288. package/dist/packages/react/src/components/ImgBoxs/index.d.ts +0 -3
  289. package/dist/packages/react/src/components/LinkEidtCard/index.d.ts +0 -5
  290. package/dist/packages/react/src/components/LocationCondition/index.d.ts +0 -3
  291. package/dist/packages/react/src/components/MessageBox/index.d.ts +0 -9
  292. package/dist/packages/react/src/components/NotationBoxes/index.d.ts +0 -3
  293. package/dist/packages/react/src/components/ResetColumnWidth/index.d.ts +0 -2
  294. package/dist/packages/react/src/components/SVGDefines.d.ts +0 -5
  295. package/dist/packages/react/src/components/SVGIcon.d.ts +0 -9
  296. package/dist/packages/react/src/components/SearchReplace/index.d.ts +0 -6
  297. package/dist/packages/react/src/components/Sheet/index.d.ts +0 -8
  298. package/dist/packages/react/src/components/SheetList/SheetHiddenButton.d.ts +0 -8
  299. package/dist/packages/react/src/components/SheetList/SheetListItem.d.ts +0 -9
  300. package/dist/packages/react/src/components/SheetList/index.d.ts +0 -4
  301. package/dist/packages/react/src/components/SheetOverlay/ColumnHeader.d.ts +0 -3
  302. package/dist/packages/react/src/components/SheetOverlay/ContentEditable.d.ts +0 -11
  303. package/dist/packages/react/src/components/SheetOverlay/FormulaHint/index.d.ts +0 -4
  304. package/dist/packages/react/src/components/SheetOverlay/FormulaSearch/constant.d.ts +0 -63
  305. package/dist/packages/react/src/components/SheetOverlay/FormulaSearch/index.d.ts +0 -4
  306. package/dist/packages/react/src/components/SheetOverlay/InputBox.d.ts +0 -3
  307. package/dist/packages/react/src/components/SheetOverlay/RowHeader.d.ts +0 -3
  308. package/dist/packages/react/src/components/SheetOverlay/ScrollBar/index.d.ts +0 -7
  309. package/dist/packages/react/src/components/SheetOverlay/index.d.ts +0 -4
  310. package/dist/packages/react/src/components/SheetTab/SheetItem.d.ts +0 -8
  311. package/dist/packages/react/src/components/SheetTab/index.d.ts +0 -4
  312. package/dist/packages/react/src/components/SplitColumn/index.d.ts +0 -3
  313. package/dist/packages/react/src/components/Toolbar/Button.d.ts +0 -12
  314. package/dist/packages/react/src/components/Toolbar/ColorPicker.d.ts +0 -6
  315. package/dist/packages/react/src/components/Toolbar/Combo.d.ts +0 -12
  316. package/dist/packages/react/src/components/Toolbar/CustomBorder.d.ts +0 -7
  317. package/dist/packages/react/src/components/Toolbar/CustomButton.d.ts +0 -11
  318. package/dist/packages/react/src/components/Toolbar/CustomColor.d.ts +0 -8
  319. package/dist/packages/react/src/components/Toolbar/CustomIcon.d.ts +0 -9
  320. package/dist/packages/react/src/components/Toolbar/Divider.d.ts +0 -4
  321. package/dist/packages/react/src/components/Toolbar/MoreItemsContainer.d.ts +0 -6
  322. package/dist/packages/react/src/components/Toolbar/Select.d.ts +0 -14
  323. package/dist/packages/react/src/components/Toolbar/index.d.ts +0 -10
  324. package/dist/packages/react/src/components/Workbook/api.d.ts +0 -1177
  325. package/dist/packages/react/src/components/Workbook/index.d.ts +0 -1185
  326. package/dist/packages/react/src/components/ZoomControl/index.d.ts +0 -4
  327. package/dist/packages/react/src/components/index.d.ts +0 -4
  328. package/dist/packages/react/src/constants.d.ts +0 -1
  329. package/dist/packages/react/src/context/index.d.ts +0 -25
  330. package/dist/packages/react/src/context/modal.d.ts +0 -10
  331. package/dist/packages/react/src/hooks/useAlert.d.ts +0 -4
  332. package/dist/packages/react/src/hooks/useDialog.d.ts +0 -5
  333. package/dist/packages/react/src/hooks/useOutsideClick.d.ts +0 -2
  334. package/dist/packages/react/src/hooks/usePrevious.d.ts +0 -2
  335. package/dist/packages/react/src/index.d.ts +0 -1
  336. package/dist/packages/react/src/utils/datepickerStyles.d.ts +0 -2
  337. package/dist/stories/API.stories.d.ts +0 -1210
  338. package/dist/stories/Collabration.stories.d.ts +0 -2359
  339. package/dist/stories/Features.stories.d.ts +0 -9430
  340. package/dist/stories/data/cell.d.ts +0 -983
  341. package/dist/stories/data/dataVerification.d.ts +0 -131
  342. package/dist/stories/data/empty.d.ts +0 -10
  343. package/dist/stories/data/formula.d.ts +0 -362
  344. package/dist/stories/data/freeze.d.ts +0 -34
  345. package/dist/stories/data/protected.d.ts +0 -40
  346. package/dist/stories/utils.d.ts +0 -1
@@ -0,0 +1,45 @@
1
+ import { Context } from "../context";
2
+ export declare function labelFilterOptionState(ctx: Context, optionstate: boolean, rowhidden: Record<string, number>, caljs: any, str: number, edr: number, cindex: number, stc: number, edc: number, saveData: boolean): void;
3
+ export declare function orderbydatafiler(ctx: Context, str: number, stc: number, edr: number, edc: number, curr: number, asc: boolean): string | null;
4
+ export declare function createFilterOptions(ctx: Context, luckysheet_filter_save: {
5
+ row: number[];
6
+ column: number[];
7
+ } | undefined, sheetId: string | undefined, filterObj?: any, saveData?: boolean): void;
8
+ export declare function clearFilter(ctx: Context): void;
9
+ export declare function createFilter(ctx: Context): void;
10
+ export type FilterDate = {
11
+ key: string;
12
+ type: string;
13
+ value: string;
14
+ text: string;
15
+ rows: number[];
16
+ dateValues: string[];
17
+ children: FilterDate[];
18
+ };
19
+ export type FilterValue = {
20
+ key: string;
21
+ value: any;
22
+ mask: any;
23
+ text: string;
24
+ rows: number[];
25
+ };
26
+ export declare function getFilterColumnValues(ctx: Context, col: number, startRow: number, endRow: number, startCol: number): {
27
+ dates: FilterDate[];
28
+ datesUncheck: string[];
29
+ dateRowMap: Record<string, number[]>;
30
+ values: FilterValue[];
31
+ valuesUncheck: string[];
32
+ valueRowMap: Record<string, number[]>;
33
+ visibleRows: number[];
34
+ flattenValues: string[];
35
+ };
36
+ export type FilterColor = {
37
+ color: string;
38
+ checked: boolean;
39
+ rows: number[];
40
+ };
41
+ export declare function getFilterColumnColors(ctx: Context, col: number, startRow: number, endRow: number): {
42
+ bgColors: FilterColor[];
43
+ fcColors: FilterColor[];
44
+ };
45
+ export declare function saveFilter(ctx: Context, optionState: boolean, hiddenRows: Record<string, number>, caljs: any, st_r: number, ed_r: number, cindex: number, st_c: number, ed_c: number): void;
@@ -0,0 +1,448 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.clearFilter = clearFilter;
7
+ exports.createFilter = createFilter;
8
+ exports.createFilterOptions = createFilterOptions;
9
+ exports.getFilterColumnColors = getFilterColumnColors;
10
+ exports.getFilterColumnValues = getFilterColumnValues;
11
+ exports.labelFilterOptionState = labelFilterOptionState;
12
+ exports.orderbydatafiler = orderbydatafiler;
13
+ exports.saveFilter = saveFilter;
14
+ var _lodash = _interopRequireDefault(require("lodash"));
15
+ var _locale = require("../locale");
16
+ var _context = require("../context");
17
+ var _utils = require("../utils");
18
+ var _format = require("./format");
19
+ var _selection = require("./selection");
20
+ var _validation = require("./validation");
21
+ var _cell = require("./cell");
22
+ var _sort = require("./sort");
23
+ var _ConditionFormat = require("./ConditionFormat");
24
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
25
+ function labelFilterOptionState(ctx, optionstate, rowhidden, caljs, str, edr, cindex, stc, edc, saveData) {
26
+ var param = {
27
+ caljs: caljs,
28
+ rowhidden: rowhidden,
29
+ optionstate: optionstate,
30
+ str: str,
31
+ edr: edr,
32
+ cindex: cindex,
33
+ stc: stc,
34
+ edc: edc
35
+ };
36
+ if (optionstate) {
37
+ ctx.filter[cindex - stc] = param;
38
+ if (caljs != null) {}
39
+ } else {
40
+ delete ctx.filter[cindex - stc];
41
+ }
42
+ if (saveData) {
43
+ var sheetIndex = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
44
+ if (sheetIndex == null) return;
45
+ var file = ctx.luckysheetfile[sheetIndex];
46
+ if (file.filter == null) {
47
+ file.filter = {};
48
+ }
49
+ if (optionstate) {
50
+ file.filter[cindex - stc] = param;
51
+ } else {
52
+ delete file.filter[cindex - stc];
53
+ }
54
+ }
55
+ }
56
+ function orderbydatafiler(ctx, str, stc, edr, edc, curr, asc) {
57
+ var _a;
58
+ var d = (0, _context.getFlowdata)(ctx);
59
+ if (d == null) {
60
+ return null;
61
+ }
62
+ str += 1;
63
+ var hasMc = false;
64
+ var data = [];
65
+ for (var r = str; r <= edr; r += 1) {
66
+ var data_row = [];
67
+ for (var c = stc; c <= edc; c += 1) {
68
+ if (d[r][c] != null && ((_a = d[r][c]) === null || _a === void 0 ? void 0 : _a.mc) != null) {
69
+ hasMc = true;
70
+ break;
71
+ }
72
+ data_row.push(d[r][c]);
73
+ }
74
+ data.push(data_row);
75
+ }
76
+ if (hasMc) {
77
+ var filter = (0, _locale.locale)(ctx).filter;
78
+ return filter.mergeError;
79
+ }
80
+ (0, _sort.sortDataRange)(ctx, d, data, curr - stc, asc, str, edr, stc, edc);
81
+ return null;
82
+ }
83
+ function createFilterOptions(ctx, luckysheet_filter_save, sheetId, filterObj, saveData) {
84
+ var _a, _b, _c, _d;
85
+ var allowEdit = (0, _utils.isAllowEdit)(ctx);
86
+ if (!allowEdit) return;
87
+ if (sheetId != null && sheetId !== ctx.currentSheetId) return;
88
+ var sheetIndex = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
89
+ if (sheetIndex == null) return;
90
+ if (luckysheet_filter_save == null || _lodash.default.size(luckysheet_filter_save) === 0) {
91
+ delete ctx.filterOptions;
92
+ return;
93
+ }
94
+ var r1 = luckysheet_filter_save.row[0];
95
+ var r2 = luckysheet_filter_save.row[1];
96
+ var c1 = luckysheet_filter_save.column[0];
97
+ var c2 = luckysheet_filter_save.column[1];
98
+ var row = (_a = ctx.visibledatarow[r2]) !== null && _a !== void 0 ? _a : 0;
99
+ var row_pre = r1 - 1 === -1 ? 0 : (_b = ctx.visibledatarow[r1 - 1]) !== null && _b !== void 0 ? _b : 0;
100
+ var col = (_c = ctx.visibledatacolumn[c2]) !== null && _c !== void 0 ? _c : 0;
101
+ var col_pre = c1 - 1 === -1 ? 0 : (_d = ctx.visibledatacolumn[c1 - 1]) !== null && _d !== void 0 ? _d : 0;
102
+ var options = {
103
+ startRow: r1,
104
+ endRow: r2,
105
+ startCol: c1,
106
+ endCol: c2,
107
+ left: col_pre,
108
+ top: row_pre,
109
+ width: col - col_pre - 1,
110
+ height: row - row_pre - 1,
111
+ items: []
112
+ };
113
+ for (var c = c1; c <= c2; c += 1) {
114
+ if (filterObj == null || (filterObj === null || filterObj === void 0 ? void 0 : filterObj[c - c1]) == null) {} else {}
115
+ var left = 0;
116
+ if (ctx.visibledatacolumn[c]) {
117
+ left = ctx.visibledatacolumn[c] - 20;
118
+ }
119
+ options.items.push({
120
+ col: c,
121
+ left: left,
122
+ top: row_pre
123
+ });
124
+ }
125
+ if (saveData) {
126
+ var file = ctx.luckysheetfile[sheetIndex];
127
+ file.filter_select = luckysheet_filter_save;
128
+ }
129
+ ctx.filterOptions = options;
130
+ }
131
+ function clearFilter(ctx) {
132
+ var allowEdit = (0, _utils.isAllowEdit)(ctx);
133
+ if (!allowEdit) return;
134
+ var sheetIndex = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
135
+ var hiddenRows = _lodash.default.reduce(ctx.filter, function (pre, curr) {
136
+ return _lodash.default.assign(pre, (curr === null || curr === void 0 ? void 0 : curr.rowhidden) || {});
137
+ }, {});
138
+ ctx.config.rowhidden = _lodash.default.omit(ctx.config.rowhidden, _lodash.default.keys(hiddenRows));
139
+ ctx.luckysheet_filter_save = undefined;
140
+ ctx.filterOptions = undefined;
141
+ ctx.filterContextMenu = undefined;
142
+ ctx.filter = {};
143
+ if (sheetIndex != null) {
144
+ ctx.luckysheetfile[sheetIndex].filter = undefined;
145
+ ctx.luckysheetfile[sheetIndex].filter_select = undefined;
146
+ ctx.luckysheetfile[sheetIndex].config = _lodash.default.assign({}, ctx.config);
147
+ }
148
+ }
149
+ function createFilter(ctx) {
150
+ var _a, _b;
151
+ if (_lodash.default.size(ctx.luckysheet_select_save) > 1) {
152
+ return;
153
+ }
154
+ if (_lodash.default.size(ctx.luckysheet_filter_save) > 0) {
155
+ clearFilter(ctx);
156
+ return;
157
+ }
158
+ var sheetIndex = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
159
+ if (sheetIndex == null || ctx.luckysheetfile[sheetIndex].isPivotTable) {
160
+ return;
161
+ }
162
+ var last = (_a = ctx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
163
+ var flowdata = (0, _context.getFlowdata)(ctx);
164
+ var filterSave;
165
+ if (last == null || flowdata == null) return;
166
+ if (last.row[0] === last.row[1] && last.column[0] === last.column[1]) {
167
+ var st_c = void 0;
168
+ var ed_c = void 0;
169
+ var curR = last.row[1];
170
+ for (var c = 0; c < flowdata[curR].length; c += 1) {
171
+ var cell = flowdata[curR][c];
172
+ if (cell != null && !(0, _validation.isRealNull)(cell.v)) {
173
+ if (st_c == null) {
174
+ st_c = c;
175
+ }
176
+ } else if (st_c != null) {
177
+ ed_c = c - 1;
178
+ break;
179
+ }
180
+ }
181
+ if (ed_c == null) {
182
+ ed_c = flowdata[curR].length - 1;
183
+ }
184
+ filterSave = (0, _selection.normalizeSelection)(ctx, [{
185
+ row: [curR, curR],
186
+ column: [st_c || 0, ed_c]
187
+ }]);
188
+ ctx.luckysheet_select_save = filterSave;
189
+ ctx.luckysheet_shiftpositon = _lodash.default.assign({}, last);
190
+ } else if (last.row[1] - last.row[0] < 2) {
191
+ ctx.luckysheet_shiftpositon = _lodash.default.assign({}, last);
192
+ }
193
+ ctx.luckysheet_filter_save = _lodash.default.assign({}, (filterSave === null || filterSave === void 0 ? void 0 : filterSave[0]) || ((_b = ctx.luckysheet_select_save) === null || _b === void 0 ? void 0 : _b[0]));
194
+ createFilterOptions(ctx, ctx.luckysheet_filter_save, undefined, {}, true);
195
+ }
196
+ function getFilterHiddenRows(ctx, col, startCol) {
197
+ var _a;
198
+ var otherHiddenRows = _lodash.default.reduce(ctx.filter, function (pre, curr) {
199
+ return _lodash.default.assign(pre, (curr === null || curr === void 0 ? void 0 : curr.cindex) !== col && (curr === null || curr === void 0 ? void 0 : curr.rowhidden) || {});
200
+ }, {});
201
+ var hiddenRows = ((_a = ctx.filter[col - startCol]) === null || _a === void 0 ? void 0 : _a.rowhidden) || {};
202
+ return {
203
+ otherHiddenRows: otherHiddenRows,
204
+ hiddenRows: hiddenRows
205
+ };
206
+ }
207
+ function getFilterColumnValues(ctx, col, startRow, endRow, startCol) {
208
+ var _a = getFilterHiddenRows(ctx, col, startCol),
209
+ otherHiddenRows = _a.otherHiddenRows,
210
+ hiddenRows = _a.hiddenRows;
211
+ var visibleRows = [];
212
+ var flattenValues = [];
213
+ var dates = [];
214
+ var datesUncheck = [];
215
+ var dateRowMap = {};
216
+ var valuesMap = new Map();
217
+ var valuesUncheck = [];
218
+ var valueRowMap = {};
219
+ var flowdata = (0, _context.getFlowdata)(ctx);
220
+ if (flowdata == null) return {
221
+ dates: dates,
222
+ datesUncheck: datesUncheck,
223
+ dateRowMap: dateRowMap,
224
+ values: [],
225
+ valuesUncheck: valuesUncheck,
226
+ valueRowMap: valueRowMap,
227
+ visibleRows: visibleRows,
228
+ flattenValues: flattenValues
229
+ };
230
+ var cell;
231
+ var filter = (0, _locale.locale)(ctx).filter;
232
+ var _loop_1 = function _loop_1(r) {
233
+ if (r in otherHiddenRows) {
234
+ return "continue";
235
+ }
236
+ visibleRows.push(r);
237
+ cell = flowdata[r][col];
238
+ if (cell != null && !(0, _validation.isRealNull)(cell.v) && cell.ct != null && cell.ct.t === "d") {
239
+ var dateStr = (0, _format.update)("YYYY-MM-DD", cell.v);
240
+ var y_1 = dateStr.split("-")[0];
241
+ var m_1 = dateStr.split("-")[1];
242
+ var d_1 = dateStr.split("-")[2];
243
+ var yearValue = _lodash.default.find(dates, function (v) {
244
+ return v.value === y_1;
245
+ });
246
+ if (yearValue == null) {
247
+ yearValue = {
248
+ key: y_1,
249
+ type: "year",
250
+ value: y_1,
251
+ text: y_1 + filter.filiterYearText,
252
+ children: [],
253
+ rows: [],
254
+ dateValues: []
255
+ };
256
+ dates.push(yearValue);
257
+ flattenValues.push(dateStr);
258
+ }
259
+ var monthValue = _lodash.default.find(yearValue.children, function (v) {
260
+ return v.value === m_1;
261
+ });
262
+ if (monthValue == null) {
263
+ monthValue = {
264
+ key: "".concat(y_1, "-").concat(m_1),
265
+ type: "month",
266
+ value: m_1,
267
+ text: m_1 + filter.filiterMonthText,
268
+ children: [],
269
+ rows: [],
270
+ dateValues: []
271
+ };
272
+ yearValue.children.push(monthValue);
273
+ }
274
+ var dayValue = _lodash.default.find(monthValue.children, function (v) {
275
+ return v.value === d_1;
276
+ });
277
+ if (dayValue == null) {
278
+ dayValue = {
279
+ key: dateStr,
280
+ type: "day",
281
+ value: d_1,
282
+ text: d_1,
283
+ children: [],
284
+ rows: [],
285
+ dateValues: []
286
+ };
287
+ monthValue.children.push(dayValue);
288
+ }
289
+ yearValue.rows.push(r);
290
+ yearValue.dateValues.push(dateStr);
291
+ monthValue.rows.push(r);
292
+ monthValue.dateValues.push(dateStr);
293
+ dayValue.rows.push(r);
294
+ dayValue.dateValues.push(dateStr);
295
+ dateRowMap[dateStr] = (dateRowMap[dateStr] || []).concat(r);
296
+ if (r in hiddenRows) {
297
+ datesUncheck = _lodash.default.union(datesUncheck, [dateStr]);
298
+ }
299
+ } else {
300
+ var v = void 0;
301
+ var m_2;
302
+ if (cell == null || (0, _validation.isRealNull)(cell.v)) {
303
+ v = null;
304
+ m_2 = null;
305
+ } else {
306
+ v = cell.v;
307
+ m_2 = cell.m;
308
+ }
309
+ var data = valuesMap.get("".concat(v));
310
+ var text = m_2 == null ? filter.valueBlank : "".concat(m_2);
311
+ var key = "".concat(v, "#$$$#").concat(m_2);
312
+ if (data != null) {
313
+ var maskValue = _lodash.default.find(data, function (value) {
314
+ return value.mask === m_2;
315
+ });
316
+ if (maskValue == null) {
317
+ maskValue = {
318
+ key: key,
319
+ value: v,
320
+ text: text,
321
+ mask: m_2,
322
+ rows: []
323
+ };
324
+ data.push(maskValue);
325
+ flattenValues.push(text);
326
+ }
327
+ maskValue.rows.push(r);
328
+ } else {
329
+ valuesMap.set("".concat(v), [{
330
+ key: key,
331
+ value: v,
332
+ text: text,
333
+ mask: m_2,
334
+ rows: [r]
335
+ }]);
336
+ flattenValues.push(text);
337
+ }
338
+ if (r in hiddenRows) {
339
+ valuesUncheck = _lodash.default.union(valuesUncheck, [key]);
340
+ }
341
+ valueRowMap[key] = (valueRowMap[key] || []).concat(r);
342
+ }
343
+ };
344
+ for (var r = startRow + 1; r <= endRow; r += 1) {
345
+ _loop_1(r);
346
+ }
347
+ return {
348
+ dates: dates,
349
+ datesUncheck: datesUncheck,
350
+ dateRowMap: dateRowMap,
351
+ values: _lodash.default.flatten(Array.from(valuesMap.values())),
352
+ valuesUncheck: valuesUncheck,
353
+ valueRowMap: valueRowMap,
354
+ visibleRows: visibleRows,
355
+ flattenValues: flattenValues
356
+ };
357
+ }
358
+ function getFilterColumnColors(ctx, col, startRow, endRow) {
359
+ var _a;
360
+ var bgMap = new Map();
361
+ var fcMap = new Map();
362
+ var cf_compute = (0, _ConditionFormat.getComputeMap)(ctx);
363
+ var flowdata = (0, _context.getFlowdata)(ctx);
364
+ if (flowdata == null) return {
365
+ bgColors: [],
366
+ fcColors: []
367
+ };
368
+ for (var r = startRow + 1; r <= endRow; r += 1) {
369
+ var cell = flowdata[r][col];
370
+ var bg = (0, _cell.normalizedAttr)(flowdata, r, col, "bg");
371
+ if (bg == null) {
372
+ bg = "#ffffff";
373
+ }
374
+ var checksAF = [];
375
+ if (checksAF.length > 1) {
376
+ bg = checksAF[1];
377
+ }
378
+ var checksCF = (0, _ConditionFormat.checkCF)(r, col, cf_compute);
379
+ if (checksCF != null && checksCF.cellColor != null) {
380
+ bg = checksCF.cellColor;
381
+ }
382
+ if (bg.indexOf("rgb") > -1) {
383
+ bg = (0, _utils.rgbToHex)(bg);
384
+ }
385
+ if (bg.length === 4) {
386
+ bg = bg.substr(0, 1) + bg.substr(1, 1).repeat(2) + bg.substr(2, 1).repeat(2) + bg.substr(3, 1).repeat(2);
387
+ }
388
+ var fc = (0, _cell.normalizedAttr)(flowdata, r, col, "fc");
389
+ if (checksAF.length > 0) {
390
+ fc = checksAF[0];
391
+ }
392
+ if (checksCF != null && checksCF.textColor != null) {
393
+ fc = checksCF.textColor;
394
+ }
395
+ if (fc != null) {
396
+ if (fc.indexOf("rgb") > -1) {
397
+ fc = (0, _utils.rgbToHex)(fc);
398
+ }
399
+ if (fc.length === 4) {
400
+ fc = fc.substr(0, 1) + fc.substr(1, 1).repeat(2) + fc.substr(2, 1).repeat(2) + fc.substr(3, 1).repeat(2);
401
+ }
402
+ }
403
+ var isRowHidden = r in (((_a = ctx.config) === null || _a === void 0 ? void 0 : _a.rowhidden) || {});
404
+ var bgData = bgMap.get(bg);
405
+ if (bgData != null) {
406
+ bgData.rows.push(r);
407
+ if (isRowHidden) bgData.checked = false;
408
+ } else {
409
+ bgMap.set(bg, {
410
+ color: bg,
411
+ checked: !isRowHidden,
412
+ rows: [r]
413
+ });
414
+ }
415
+ if (fc != null) {
416
+ var fcData = fcMap.get(fc);
417
+ if (fcData != null && cell != null && !(0, _validation.isRealNull)(cell.v)) {
418
+ fcData.rows.push(r);
419
+ if (isRowHidden) fcData.checked = false;
420
+ } else if (cell != null && !(0, _validation.isRealNull)(cell.v)) {
421
+ fcMap.set(fc, {
422
+ color: fc,
423
+ checked: !isRowHidden,
424
+ rows: [r]
425
+ });
426
+ }
427
+ }
428
+ }
429
+ var bgColors = _lodash.default.flatten(Array.from(bgMap.values()));
430
+ var fcColors = _lodash.default.flatten(Array.from(fcMap.values()));
431
+ return {
432
+ bgColors: bgColors.length < 2 ? [] : bgColors,
433
+ fcColors: fcColors.length < 2 ? [] : fcColors
434
+ };
435
+ }
436
+ function saveFilter(ctx, optionState, hiddenRows, caljs, st_r, ed_r, cindex, st_c, ed_c) {
437
+ var otherHiddenRows = getFilterHiddenRows(ctx, cindex, st_c).otherHiddenRows;
438
+ var rowHiddenAll = _lodash.default.assign(otherHiddenRows, hiddenRows);
439
+ labelFilterOptionState(ctx, optionState, hiddenRows, caljs, st_r, ed_r, cindex, st_c, ed_c, true);
440
+ var cfg = _lodash.default.assign({}, ctx.config);
441
+ cfg.rowhidden = rowHiddenAll;
442
+ ctx.config = cfg;
443
+ var sheetIndex = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
444
+ if (sheetIndex == null) {
445
+ return;
446
+ }
447
+ ctx.luckysheetfile[sheetIndex].config = cfg;
448
+ }
@@ -0,0 +1,6 @@
1
+ import { CellMatrix } from "../types";
2
+ export declare function datenum_local(v: Date, date1904?: number): number;
3
+ export declare function genarate(value: string | number | boolean): any[] | null;
4
+ export declare function update(fmt: string, v: any): any;
5
+ export declare function is_date(fmt: string, v?: any): any;
6
+ export declare function valueShowEs(r: number, c: number, d: CellMatrix): any;