vaishu-react-comp 1.1.2 → 1.1.3

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 (361) hide show
  1. package/lib/ComponentProps/TreeNodeProps.d.ts +2 -0
  2. package/lib/components/AddResourceButton/AddResourceButton.js +28 -15
  3. package/lib/components/AddResourceButton/AddResourceButton.js.map +1 -1
  4. package/lib/components/AppHeader/AppHeader.js +1 -1
  5. package/lib/components/AppHeader/AppHeader.js.map +1 -1
  6. package/lib/components/AppHeader/types.d.ts +1 -0
  7. package/lib/components/AttachmentButton/AttachmentButton.js +4 -1
  8. package/lib/components/AttachmentButton/AttachmentButton.js.map +1 -1
  9. package/lib/components/AttachmentButton/types.d.ts +1 -0
  10. package/lib/components/AutoTruncateText/AutoTruncateText.d.ts +4 -0
  11. package/lib/components/AutoTruncateText/AutoTruncateText.js +41 -0
  12. package/lib/components/AutoTruncateText/AutoTruncateText.js.map +1 -0
  13. package/lib/components/AutoTruncateText/index.d.ts +1 -0
  14. package/lib/components/AutoTruncateText/index.js +2 -0
  15. package/lib/components/AutoTruncateText/index.js.map +1 -0
  16. package/lib/components/AutoTruncateText/resizeObserverService.d.ts +7 -0
  17. package/lib/components/AutoTruncateText/resizeObserverService.js +25 -0
  18. package/lib/components/AutoTruncateText/resizeObserverService.js.map +1 -0
  19. package/lib/components/AutoTruncateText/types.d.ts +8 -0
  20. package/lib/components/AutoTruncateText/types.js +2 -0
  21. package/lib/components/AutoTruncateText/types.js.map +1 -0
  22. package/lib/components/AutoTruncateText/useResizeSignal.d.ts +5 -0
  23. package/lib/components/AutoTruncateText/useResizeSignal.js +18 -0
  24. package/lib/components/AutoTruncateText/useResizeSignal.js.map +1 -0
  25. package/lib/components/BrowserTabs/BrowserTabs.d.ts +1 -1
  26. package/lib/components/BrowserTabs/BrowserTabs.js +11 -7
  27. package/lib/components/BrowserTabs/BrowserTabs.js.map +1 -1
  28. package/lib/components/BrowserTabs/types.d.ts +7 -0
  29. package/lib/components/Button/types.d.ts +1 -1
  30. package/lib/components/Charts/DonutChart/DonutChart.js +24 -16
  31. package/lib/components/Charts/DonutChart/DonutChart.js.map +1 -1
  32. package/lib/components/Charts/DonutChart/type.d.ts +4 -1
  33. package/lib/components/ChatModalAi/ChatModalAi.js +11 -32
  34. package/lib/components/ChatModalAi/ChatModalAi.js.map +1 -1
  35. package/lib/components/ChatModalAi/types.d.ts +5 -0
  36. package/lib/components/ChipWithCount/ChipWithCount.js +4 -3
  37. package/lib/components/ChipWithCount/ChipWithCount.js.map +1 -1
  38. package/lib/components/ConditionalDropdown/ConditionalDropdown.js +2 -2
  39. package/lib/components/ConditionalDropdown/ConditionalDropdown.js.map +1 -1
  40. package/lib/components/ConnectingBranch/BranchComponents/MachineInstances.js +3 -2
  41. package/lib/components/ConnectingBranch/BranchComponents/MachineInstances.js.map +1 -1
  42. package/lib/components/ConnectingBranch/ConnectingBranch.js +6 -5
  43. package/lib/components/ConnectingBranch/ConnectingBranch.js.map +1 -1
  44. package/lib/components/ConnectingBranch/types.d.ts +2 -0
  45. package/lib/components/CreateVariable/CreateVariableSlider.js +3 -3
  46. package/lib/components/CreateVariable/CreateVariableSlider.js.map +1 -1
  47. package/lib/components/CreateVariable/types.d.ts +6 -2
  48. package/lib/components/DownloadClient/DownloadClient.js +1 -1
  49. package/lib/components/DownloadClient/DownloadClient.js.map +1 -1
  50. package/lib/components/Drawer/Drawer.js +13 -4
  51. package/lib/components/Drawer/Drawer.js.map +1 -1
  52. package/lib/components/Drawer/Types.d.ts +5 -0
  53. package/lib/components/EditLabel/EditLabel.d.ts +1 -1
  54. package/lib/components/EditLabel/EditLabel.js +6 -4
  55. package/lib/components/EditLabel/EditLabel.js.map +1 -1
  56. package/lib/components/EditLabel/types.d.ts +2 -0
  57. package/lib/components/Editor/Editor.js +1 -1
  58. package/lib/components/Editor/Editor.js.map +1 -1
  59. package/lib/components/Editor/constants.js +121 -40
  60. package/lib/components/Editor/constants.js.map +1 -1
  61. package/lib/components/Excel/ColorBarSelector/ColorBarSelector.d.ts +1 -1
  62. package/lib/components/Excel/ColorBarSelector/ColorBarSelector.js +5 -3
  63. package/lib/components/Excel/ColorBarSelector/ColorBarSelector.js.map +1 -1
  64. package/lib/components/Excel/Data.d.ts +89 -17
  65. package/lib/components/Excel/Data.js +420 -56
  66. package/lib/components/Excel/Data.js.map +1 -1
  67. package/lib/components/Excel/ExcelFile/ExcelFile.js +2 -2
  68. package/lib/components/Excel/ExcelFile/ExcelFile.js.map +1 -1
  69. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.js +96 -18
  70. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.js.map +1 -1
  71. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Cell.js +5 -3
  72. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Cell.js.map +1 -1
  73. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.js +8 -8
  74. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.js.map +1 -1
  75. package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataEditor.js +1 -1
  76. package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataEditor.js.map +1 -1
  77. package/lib/components/Excel/ExcelFile/ExcelFileComponents/EditableCell.js +20 -22
  78. package/lib/components/Excel/ExcelFile/ExcelFileComponents/EditableCell.js.map +1 -1
  79. package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.js +5 -4
  80. package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.js.map +1 -1
  81. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.js +45 -5
  82. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.js.map +1 -1
  83. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +16 -1
  84. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.js +14 -0
  85. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.js.map +1 -1
  86. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.js +157 -28
  87. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.js.map +1 -1
  88. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.js +10 -3
  89. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.js.map +1 -1
  90. package/lib/components/Excel/ExcelToolBar/ExcelToolBar.js +8 -2
  91. package/lib/components/Excel/ExcelToolBar/ExcelToolBar.js.map +1 -1
  92. package/lib/components/Excel/Types.d.ts +2 -0
  93. package/lib/components/Excel/dataConversion.d.ts +2 -2
  94. package/lib/components/Excel/dataConversion.js +6 -2
  95. package/lib/components/Excel/dataConversion.js.map +1 -1
  96. package/lib/components/ExpandableMenu/ExpandableMenu.js +11 -10
  97. package/lib/components/ExpandableMenu/ExpandableMenu.js.map +1 -1
  98. package/lib/components/ExpandableMenu/types.d.ts +1 -0
  99. package/lib/components/HOC/LayoutWithDrawer/LayoutWithDrawer.d.ts +11 -0
  100. package/lib/components/HOC/LayoutWithDrawer/LayoutWithDrawer.js +7 -0
  101. package/lib/components/HOC/LayoutWithDrawer/LayoutWithDrawer.js.map +1 -0
  102. package/lib/components/HOC/LayoutWithDrawer/index.d.ts +1 -0
  103. package/lib/components/HOC/LayoutWithDrawer/index.js +2 -0
  104. package/lib/components/HOC/LayoutWithDrawer/index.js.map +1 -0
  105. package/lib/components/Icon/iconList.js +106 -0
  106. package/lib/components/Icon/iconList.js.map +1 -1
  107. package/lib/components/Loader/Loader.d.ts +5 -0
  108. package/lib/components/Loader/Loader.js +8 -0
  109. package/lib/components/Loader/Loader.js.map +1 -0
  110. package/lib/components/Loader/index.d.ts +1 -0
  111. package/lib/components/Loader/index.js +2 -0
  112. package/lib/components/Loader/index.js.map +1 -0
  113. package/lib/components/MachineInputField/MachineInputField.d.ts +1 -1
  114. package/lib/components/MachineInputField/MachineInputField.js +4 -1
  115. package/lib/components/MachineInputField/MachineInputField.js.map +1 -1
  116. package/lib/components/MachineInputField/types.d.ts +1 -0
  117. package/lib/components/MediaPreview/MediaPreview.js +1 -1
  118. package/lib/components/MediaPreview/MediaPreview.js.map +1 -1
  119. package/lib/components/MediaViewerModal/MediaViewerModal.js +2 -3
  120. package/lib/components/MediaViewerModal/MediaViewerModal.js.map +1 -1
  121. package/lib/components/MediaViewerModal/type.d.ts +2 -1
  122. package/lib/components/MenuOption/MenuOption.js +19 -18
  123. package/lib/components/MenuOption/MenuOption.js.map +1 -1
  124. package/lib/components/MiniModal/MiniModal.js +44 -27
  125. package/lib/components/MiniModal/MiniModal.js.map +1 -1
  126. package/lib/components/MiniModal/types.d.ts +1 -1
  127. package/lib/components/MultiSelect/Dropdown.js +2 -1
  128. package/lib/components/MultiSelect/Dropdown.js.map +1 -1
  129. package/lib/components/NLPInput/components/ChipsFolder/ChipsAccordion.js +1 -1
  130. package/lib/components/NLPInput/components/ChipsFolder/ChipsAccordion.js.map +1 -1
  131. package/lib/components/NetworkErrorBoundary/NetworkErrorBoundary.d.ts +5 -0
  132. package/lib/components/NetworkErrorBoundary/NetworkErrorBoundary.js +19 -0
  133. package/lib/components/NetworkErrorBoundary/NetworkErrorBoundary.js.map +1 -0
  134. package/lib/components/NetworkErrorBoundary/index.d.ts +1 -0
  135. package/lib/components/NetworkErrorBoundary/index.js +2 -0
  136. package/lib/components/NetworkErrorBoundary/index.js.map +1 -0
  137. package/lib/components/NetworkErrorBoundary/types.d.ts +33 -0
  138. package/lib/components/NetworkErrorBoundary/types.js +2 -0
  139. package/lib/components/NetworkErrorBoundary/types.js.map +1 -0
  140. package/lib/components/NoDataAvailable/NoDataAvailable.d.ts +5 -0
  141. package/lib/components/NoDataAvailable/NoDataAvailable.js +11 -0
  142. package/lib/components/NoDataAvailable/NoDataAvailable.js.map +1 -0
  143. package/lib/components/NoDataAvailable/index.d.ts +1 -0
  144. package/lib/components/NoDataAvailable/index.js +2 -0
  145. package/lib/components/NoDataAvailable/index.js.map +1 -0
  146. package/lib/components/NoDataAvailable/type.d.ts +3 -0
  147. package/lib/components/NoDataAvailable/type.js +2 -0
  148. package/lib/components/NoDataAvailable/type.js.map +1 -0
  149. package/lib/components/NoResultFound/NoResultFound.d.ts +14 -0
  150. package/lib/components/NoResultFound/NoResultFound.js +7 -0
  151. package/lib/components/NoResultFound/NoResultFound.js.map +1 -0
  152. package/lib/components/NoResultFound/index.d.ts +1 -0
  153. package/lib/components/NoResultFound/index.js +2 -0
  154. package/lib/components/NoResultFound/index.js.map +1 -0
  155. package/lib/components/PopUpModal/PopUpModal.d.ts +1 -2
  156. package/lib/components/PopUpModal/PopUpModal.js +4 -3
  157. package/lib/components/PopUpModal/PopUpModal.js.map +1 -1
  158. package/lib/components/PrePostTable/components/DraggableTableRow.js +4 -1
  159. package/lib/components/PrePostTable/components/DraggableTableRow.js.map +1 -1
  160. package/lib/components/PrePostTable/components/PrePostStepAccordions.js +14 -3
  161. package/lib/components/PrePostTable/components/PrePostStepAccordions.js.map +1 -1
  162. package/lib/components/PromptContainer/PromptContainer.js +1 -1
  163. package/lib/components/PromptContainer/PromptContainer.js.map +1 -1
  164. package/lib/components/RadioButton/RadioButton.js +2 -2
  165. package/lib/components/RadioButton/RadioButton.js.map +1 -1
  166. package/lib/components/RadioButton/radioButtonTypes.d.ts +8 -0
  167. package/lib/components/RadioGroup/RadioGroup.js +2 -2
  168. package/lib/components/RadioGroup/RadioGroup.js.map +1 -1
  169. package/lib/components/RadioGroup/radioGroupTypes.d.ts +8 -0
  170. package/lib/components/ScriptCommentModal/ScriptCommentModal.d.ts +4 -0
  171. package/lib/components/ScriptCommentModal/ScriptCommentModal.js +47 -0
  172. package/lib/components/ScriptCommentModal/ScriptCommentModal.js.map +1 -0
  173. package/lib/components/ScriptCommentModal/components/ButtonActions.d.ts +5 -0
  174. package/lib/components/ScriptCommentModal/components/ButtonActions.js +8 -0
  175. package/lib/components/ScriptCommentModal/components/ButtonActions.js.map +1 -0
  176. package/lib/components/ScriptCommentModal/components/CommentCount.d.ts +4 -0
  177. package/lib/components/ScriptCommentModal/components/CommentCount.js +7 -0
  178. package/lib/components/ScriptCommentModal/components/CommentCount.js.map +1 -0
  179. package/lib/components/ScriptCommentModal/components/CommentDiscription.d.ts +5 -0
  180. package/lib/components/ScriptCommentModal/components/CommentDiscription.js +13 -0
  181. package/lib/components/ScriptCommentModal/components/CommentDiscription.js.map +1 -0
  182. package/lib/components/ScriptCommentModal/components/CommentFooter.d.ts +5 -0
  183. package/lib/components/ScriptCommentModal/components/CommentFooter.js +9 -0
  184. package/lib/components/ScriptCommentModal/components/CommentFooter.js.map +1 -0
  185. package/lib/components/ScriptCommentModal/components/CommentTitleText.d.ts +4 -0
  186. package/lib/components/ScriptCommentModal/components/CommentTitleText.js +7 -0
  187. package/lib/components/ScriptCommentModal/components/CommentTitleText.js.map +1 -0
  188. package/lib/components/ScriptCommentModal/components/CommentsTitle.d.ts +4 -0
  189. package/lib/components/ScriptCommentModal/components/CommentsTitle.js +12 -0
  190. package/lib/components/ScriptCommentModal/components/CommentsTitle.js.map +1 -0
  191. package/lib/components/ScriptCommentModal/components/DeleteComment.d.ts +3 -0
  192. package/lib/components/ScriptCommentModal/components/DeleteComment.js +15 -0
  193. package/lib/components/ScriptCommentModal/components/DeleteComment.js.map +1 -0
  194. package/lib/components/ScriptCommentModal/components/DeleteCommentIcon.d.ts +4 -0
  195. package/lib/components/ScriptCommentModal/components/DeleteCommentIcon.js +8 -0
  196. package/lib/components/ScriptCommentModal/components/DeleteCommentIcon.js.map +1 -0
  197. package/lib/components/ScriptCommentModal/components/DeleteCommentMessage.d.ts +3 -0
  198. package/lib/components/ScriptCommentModal/components/DeleteCommentMessage.js +7 -0
  199. package/lib/components/ScriptCommentModal/components/DeleteCommentMessage.js.map +1 -0
  200. package/lib/components/ScriptCommentModal/components/DeleteCommentPopup.d.ts +4 -0
  201. package/lib/components/ScriptCommentModal/components/DeleteCommentPopup.js +8 -0
  202. package/lib/components/ScriptCommentModal/components/DeleteCommentPopup.js.map +1 -0
  203. package/lib/components/ScriptCommentModal/components/FooterText.d.ts +5 -0
  204. package/lib/components/ScriptCommentModal/components/FooterText.js +8 -0
  205. package/lib/components/ScriptCommentModal/components/FooterText.js.map +1 -0
  206. package/lib/components/ScriptCommentModal/index.d.ts +1 -0
  207. package/lib/components/ScriptCommentModal/index.js +2 -0
  208. package/lib/components/ScriptCommentModal/index.js.map +1 -0
  209. package/lib/components/ScriptCommentModal/type.d.ts +59 -0
  210. package/lib/components/ScriptCommentModal/type.js +2 -0
  211. package/lib/components/ScriptCommentModal/type.js.map +1 -0
  212. package/lib/components/Select/Select.js +8 -7
  213. package/lib/components/Select/Select.js.map +1 -1
  214. package/lib/components/Select/components/Dropdown.js +107 -22
  215. package/lib/components/Select/components/Dropdown.js.map +1 -1
  216. package/lib/components/Select/components/types.d.ts +2 -0
  217. package/lib/components/Select/components/types.js.map +1 -1
  218. package/lib/components/Select/types.d.ts +9 -0
  219. package/lib/components/SelectionSwitcher/SelectionSwitcher.d.ts +5 -0
  220. package/lib/components/SelectionSwitcher/SelectionSwitcher.js +16 -0
  221. package/lib/components/SelectionSwitcher/SelectionSwitcher.js.map +1 -0
  222. package/lib/components/SelectionSwitcher/index.d.ts +1 -0
  223. package/lib/components/SelectionSwitcher/index.js +2 -0
  224. package/lib/components/SelectionSwitcher/index.js.map +1 -0
  225. package/lib/components/SelectionSwitcher/types.d.ts +13 -0
  226. package/lib/components/SelectionSwitcher/types.js +2 -0
  227. package/lib/components/SelectionSwitcher/types.js.map +1 -0
  228. package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.js +3 -3
  229. package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.js.map +1 -1
  230. package/lib/components/SequentialConnectingBranch/components/Branches/Branches.js +22 -13
  231. package/lib/components/SequentialConnectingBranch/components/Branches/Branches.js.map +1 -1
  232. package/lib/components/SequentialConnectingBranch/types.d.ts +2 -1
  233. package/lib/components/SessionDropdown/SessionDropdown.js +4 -4
  234. package/lib/components/SessionDropdown/SessionDropdown.js.map +1 -1
  235. package/lib/components/SessionDropdown/type.d.ts +2 -0
  236. package/lib/components/SessionManager/SessionManager.js +3 -3
  237. package/lib/components/SessionManager/SessionManager.js.map +1 -1
  238. package/lib/components/StatusBadge/StatusBadge.d.ts +2 -1
  239. package/lib/components/StatusBadge/StatusBadge.js +3 -3
  240. package/lib/components/StatusBadge/StatusBadge.js.map +1 -1
  241. package/lib/components/StatusButton/StatusButton.d.ts +1 -1
  242. package/lib/components/StatusButton/StatusButton.js +3 -2
  243. package/lib/components/StatusButton/StatusButton.js.map +1 -1
  244. package/lib/components/StatusButton/types.d.ts +2 -1
  245. package/lib/components/StepsLandingTable/Components/StepGroupAccordions.js +8 -5
  246. package/lib/components/StepsLandingTable/Components/StepGroupAccordions.js.map +1 -1
  247. package/lib/components/StepsLandingTable/Components/StepInnerTable.js.map +1 -1
  248. package/lib/components/StepsLandingTable/Components/StepResultStats.js +21 -2
  249. package/lib/components/StepsLandingTable/Components/StepResultStats.js.map +1 -1
  250. package/lib/components/StepsLandingTable/Components/StepTableMainRow.js +6 -4
  251. package/lib/components/StepsLandingTable/Components/StepTableMainRow.js.map +1 -1
  252. package/lib/components/StepsLandingTable/Components/StepsTitle.js +20 -3
  253. package/lib/components/StepsLandingTable/Components/StepsTitle.js.map +1 -1
  254. package/lib/components/StepsLandingTable/Components/Types.d.ts +11 -6
  255. package/lib/components/StepsLandingTable/StepLandingTable.js.map +1 -1
  256. package/lib/components/StepsLandingTable/types.d.ts +2 -0
  257. package/lib/components/StorageUsageBar/StorageUsageBar.d.ts +4 -0
  258. package/lib/components/StorageUsageBar/StorageUsageBar.js +47 -0
  259. package/lib/components/StorageUsageBar/StorageUsageBar.js.map +1 -0
  260. package/lib/components/StorageUsageBar/index.d.ts +1 -0
  261. package/lib/components/StorageUsageBar/index.js +2 -0
  262. package/lib/components/StorageUsageBar/index.js.map +1 -0
  263. package/lib/components/StorageUsageBar/types.d.ts +7 -0
  264. package/lib/components/StorageUsageBar/types.js +2 -0
  265. package/lib/components/StorageUsageBar/types.js.map +1 -0
  266. package/lib/components/Table/Table.js +2 -2
  267. package/lib/components/Table/Table.js.map +1 -1
  268. package/lib/components/Table/Types.d.ts +2 -0
  269. package/lib/components/Table/components/SortableRow.js +29 -16
  270. package/lib/components/Table/components/SortableRow.js.map +1 -1
  271. package/lib/components/Table/components/VirtualizedRows.d.ts +1 -1
  272. package/lib/components/Table/components/VirtualizedRows.js +6 -2
  273. package/lib/components/Table/components/VirtualizedRows.js.map +1 -1
  274. package/lib/components/TableTreeFn/Components/TableBody.d.ts +1 -1
  275. package/lib/components/TableTreeFn/Components/TableBody.js +12 -7
  276. package/lib/components/TableTreeFn/Components/TableBody.js.map +1 -1
  277. package/lib/components/TableTreeFn/Components/TableCell.d.ts +1 -1
  278. package/lib/components/TableTreeFn/Components/TableCell.js +24 -19
  279. package/lib/components/TableTreeFn/Components/TableCell.js.map +1 -1
  280. package/lib/components/TableTreeFn/Components/TableHead.d.ts +1 -1
  281. package/lib/components/TableTreeFn/Components/TableHead.js +23 -29
  282. package/lib/components/TableTreeFn/Components/TableHead.js.map +1 -1
  283. package/lib/components/TableTreeFn/Components/TableRow.d.ts +1 -1
  284. package/lib/components/TableTreeFn/Components/TableRow.js +7 -2
  285. package/lib/components/TableTreeFn/Components/TableRow.js.map +1 -1
  286. package/lib/components/TableTreeFn/TableTreeFn.d.ts +1 -1
  287. package/lib/components/TableTreeFn/TableTreeFn.js +726 -241
  288. package/lib/components/TableTreeFn/TableTreeFn.js.map +1 -1
  289. package/lib/components/TableTreeFn/Utils/TableCell.d.ts +1 -0
  290. package/lib/components/TableTreeFn/Utils/TableCell.js +24 -0
  291. package/lib/components/TableTreeFn/Utils/TableCell.js.map +1 -0
  292. package/lib/components/TableTreeFn/Utils/addLastChild.d.ts +1 -1
  293. package/lib/components/TableTreeFn/Utils/addLastChild.js +2 -2
  294. package/lib/components/TableTreeFn/Utils/addLastChild.js.map +1 -1
  295. package/lib/components/TableTreeFn/Utils/addNewRow.js +6 -5
  296. package/lib/components/TableTreeFn/Utils/addNewRow.js.map +1 -1
  297. package/lib/components/TableTreeFn/Utils/formatDataCell.js +1 -1
  298. package/lib/components/TableTreeFn/Utils/formatDataCell.js.map +1 -1
  299. package/lib/components/TableTreeFn/Utils/updateParentSibling.d.ts +1 -1
  300. package/lib/components/TableTreeFn/Utils/updateParentSibling.js +7 -7
  301. package/lib/components/TableTreeFn/Utils/updateParentSibling.js.map +1 -1
  302. package/lib/components/TableTreeFn/index.d.ts +2 -0
  303. package/lib/components/TableTreeFn/index.js +2 -0
  304. package/lib/components/TableTreeFn/index.js.map +1 -1
  305. package/lib/components/TableTreeFn/types.d.ts +32 -12
  306. package/lib/components/TextEditor/TextEditor.js +101 -26
  307. package/lib/components/TextEditor/TextEditor.js.map +1 -1
  308. package/lib/components/Tooltip/Tooltip.js +2 -2
  309. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  310. package/lib/components/Tooltip/types.d.ts +1 -0
  311. package/lib/components/TooltipService/TooltipService.d.ts +4 -0
  312. package/lib/components/TooltipService/TooltipService.js +164 -0
  313. package/lib/components/TooltipService/TooltipService.js.map +1 -0
  314. package/lib/components/TooltipService/index.d.ts +1 -0
  315. package/lib/components/TooltipService/index.js +2 -0
  316. package/lib/components/TooltipService/index.js.map +1 -0
  317. package/lib/components/Typography/Typography.js +2 -2
  318. package/lib/components/Typography/Typography.js.map +1 -1
  319. package/lib/components/Typography/types.d.ts +1 -0
  320. package/lib/components/ZoomControl/ZoomControl.d.ts +5 -0
  321. package/lib/components/ZoomControl/ZoomControl.js +22 -0
  322. package/lib/components/ZoomControl/ZoomControl.js.map +1 -0
  323. package/lib/components/ZoomControl/index.d.ts +1 -0
  324. package/lib/components/ZoomControl/index.js +2 -0
  325. package/lib/components/ZoomControl/index.js.map +1 -0
  326. package/lib/components/ZoomControl/types.d.ts +8 -0
  327. package/lib/components/ZoomControl/types.js +2 -0
  328. package/lib/components/ZoomControl/types.js.map +1 -0
  329. package/lib/hooks/useClickOutside.d.ts +4 -1
  330. package/lib/hooks/useClickOutside.js +7 -5
  331. package/lib/hooks/useClickOutside.js.map +1 -1
  332. package/lib/index.d.ts +5895 -5
  333. package/lib/index.js +48 -2
  334. package/lib/index.js.map +1 -1
  335. package/lib/styles.css +1 -0
  336. package/lib/tsconfig.tsbuildinfo +1 -1
  337. package/lib/utils/AddStepGroup/AddStepGroup.js +5 -2
  338. package/lib/utils/AddStepGroup/AddStepGroup.js.map +1 -1
  339. package/lib/utils/OnlineStatus/useOnlineStatus.d.ts +1 -0
  340. package/lib/utils/OnlineStatus/useOnlineStatus.js +20 -0
  341. package/lib/utils/OnlineStatus/useOnlineStatus.js.map +1 -0
  342. package/lib/utils/cleanAllTooltips/cleanAllTooltips.d.ts +1 -0
  343. package/lib/utils/cleanAllTooltips/cleanAllTooltips.js +8 -0
  344. package/lib/utils/cleanAllTooltips/cleanAllTooltips.js.map +1 -0
  345. package/lib/utils/converToCamelCase.d.ts +1 -0
  346. package/lib/utils/converToCamelCase.js +6 -0
  347. package/lib/utils/converToCamelCase.js.map +1 -0
  348. package/lib/utils/getTopVisibleNodeKey/getTopVisibleNodeKey.js +8 -9
  349. package/lib/utils/getTopVisibleNodeKey/getTopVisibleNodeKey.js.map +1 -1
  350. package/lib/utils/getTreeDetails/getTreeDetails.d.ts +1 -1
  351. package/lib/utils/getTreeDetails/getTreeDetails.js +37 -20
  352. package/lib/utils/getTreeDetails/getTreeDetails.js.map +1 -1
  353. package/lib/utils/handleTreeExpandAllCollapseAll/handleTreeExpandAllCollapseAll.js +1 -0
  354. package/lib/utils/handleTreeExpandAllCollapseAll/handleTreeExpandAllCollapseAll.js.map +1 -1
  355. package/lib/utils/handleTreeNodeSelect/handleTreeNodeSelect.d.ts +4 -3
  356. package/lib/utils/handleTreeNodeSelect/handleTreeNodeSelect.js +89 -342
  357. package/lib/utils/handleTreeNodeSelect/handleTreeNodeSelect.js.map +1 -1
  358. package/lib/validations/regex.d.ts +3 -1
  359. package/lib/validations/regex.js +4 -1
  360. package/lib/validations/regex.js.map +1 -1
  361. package/package.json +27 -15
@@ -1,242 +1,764 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useLayoutEffect, useRef, useState, forwardRef, } from 'react';
3
- import './TableTree.scss';
4
- import TableHead from './Components/TableHead';
2
+ /* eslint-disable max-lines */
3
+ import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, forwardRef, } from 'react';
4
+ import './TableTreeFn.scss';
5
5
  import TableBody from './Components/TableBody';
6
- import { addLastChild } from './Utils/addLastChild';
7
- import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
6
+ import TableHead from './Components/TableHead';
8
7
  import { debounce } from '../../utils/debounce/debounce';
9
- const TableTreeFn = forwardRef(({ treeData, columnsData, selected = [], select = null, onChange, onClick, onExpand, loadMore = () => { }, tableBorder, height = 'calc(100vh - 134px)', newNode, onAddConfirm = (_name) => { }, onAddCancel = () => { }, handleEditFieldError, loading = false, rootNode, pagination = true, selectedNode, tableHeaderBgColor = 'var(--border-color)', hideOnDisable = false, freezeColumns, scriptLengthTruncate = 25, addModuleInputWidth = 150, addModuleSelectWidth, onScroll, onScrollEnd, disableEditLabelConfirmIcon = false, transparentHeader = false, navigateTreeNode = null, handleRemoveNavigateTreeNode = () => { }, scrollThreshold = 128, // this is the Distance from edge to trigger the scroll below and above
10
- showHeader = true, }, ref) => {
8
+ import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
9
+ const DEFAULT_COLUMN_WIDTH = 400;
10
+ const ROW_HEIGHT = 32;
11
+ const OVERSCAN = 6;
12
+ const ROOT_PARENT_ID = '__root__';
13
+ const insertNewNode = (treeData, newNode, rootNode) => {
14
+ if (!newNode?.sourceId || !newNode.action)
15
+ return treeData;
16
+ const { sourceId, action, value = '', error = '', label, type, options, selectedOption, confirmIconTooltip, cancelIconTooltip, payloadSourceId, } = newNode;
17
+ const fallbackParentId = newNode
18
+ ?.parentId;
19
+ const fallbackHierarchy = newNode
20
+ ?.hierarchy;
21
+ const convertedOptions = options?.map((option) => ({
22
+ label: option,
23
+ value: option,
24
+ }));
25
+ const convertedSelectedOption = selectedOption
26
+ ? { label: selectedOption, value: selectedOption }
27
+ : undefined;
28
+ const nodeMap = new Map();
29
+ treeData.forEach((node) => nodeMap.set(node.key, node));
30
+ if (rootNode) {
31
+ nodeMap.set(rootNode.key, rootNode);
32
+ }
33
+ const sourceNode = nodeMap.get(sourceId);
34
+ let payloadSourceNode;
35
+ if (payloadSourceId) {
36
+ payloadSourceNode = nodeMap.get(payloadSourceId);
37
+ }
38
+ // For add-inside flows, backend can return navigateTo as a parent key or a
39
+ // key not present in the current page. Fallback to payload source when possible.
40
+ let effectiveSourceNode = sourceNode ?? (action === 'addInside' ? payloadSourceNode : undefined);
41
+ if (!effectiveSourceNode && action === 'addInside' && fallbackParentId) {
42
+ effectiveSourceNode = nodeMap.get(fallbackParentId);
43
+ }
44
+ const fallbackInsertAtEnd = action === 'addInside' && !effectiveSourceNode && treeData.length >= 0;
45
+ if (!effectiveSourceNode && !fallbackInsertAtEnd)
46
+ return treeData;
47
+ const updatedTreeData = [...treeData];
48
+ const sourceIndex = effectiveSourceNode
49
+ ? treeData.findIndex((node) => node.key === effectiveSourceNode.key)
50
+ : -1;
51
+ let newNodeParentId = null;
52
+ let newNodeHierarchy = 0;
53
+ let insertionIndex = sourceIndex + 1;
54
+ switch (action) {
55
+ case 'addAbove': {
56
+ const sourceNodeForInsert = effectiveSourceNode;
57
+ if (!sourceNodeForInsert)
58
+ return treeData;
59
+ newNodeParentId = sourceNodeForInsert.parentId;
60
+ newNodeHierarchy = sourceNodeForInsert.hierarchy;
61
+ break;
62
+ }
63
+ case 'addBelow': {
64
+ const sourceNodeForInsert = effectiveSourceNode;
65
+ if (!sourceNodeForInsert)
66
+ return treeData;
67
+ newNodeParentId =
68
+ payloadSourceNode?.parentId ?? sourceNodeForInsert.parentId;
69
+ newNodeHierarchy =
70
+ payloadSourceNode?.hierarchy ?? sourceNodeForInsert.hierarchy;
71
+ break;
72
+ }
73
+ case 'addInside': {
74
+ if (fallbackInsertAtEnd) {
75
+ newNodeParentId =
76
+ fallbackParentId ?? payloadSourceId ?? sourceId ?? null;
77
+ newNodeHierarchy = fallbackHierarchy ?? 1;
78
+ insertionIndex = updatedTreeData.length;
79
+ break;
80
+ }
81
+ const parentNode = payloadSourceNode ?? effectiveSourceNode;
82
+ if (!parentNode)
83
+ return treeData;
84
+ newNodeParentId = parentNode.key;
85
+ newNodeHierarchy = (parentNode.hierarchy ?? 0) + 1;
86
+ // Keep add-inside input at the end of the current parent subtree.
87
+ const parentIndex = updatedTreeData.findIndex((node) => node.key === sourceId);
88
+ if (parentIndex !== -1) {
89
+ insertionIndex = parentIndex + 1;
90
+ }
91
+ break;
92
+ }
93
+ }
94
+ const newNodeBase = {
95
+ hierarchy: newNodeHierarchy,
96
+ parentId: newNodeParentId,
97
+ sourceId: effectiveSourceNode?.key ?? sourceId ?? payloadSourceId ?? 'new-node',
98
+ isNewNode: true,
99
+ key: 'new-node',
100
+ value,
101
+ error,
102
+ label,
103
+ type,
104
+ options: convertedOptions,
105
+ selectedOption: convertedSelectedOption,
106
+ confirmIconTooltip,
107
+ cancelIconTooltip,
108
+ };
109
+ switch (action) {
110
+ case 'addAbove':
111
+ updatedTreeData.splice(sourceIndex, 0, newNodeBase);
112
+ break;
113
+ case 'addBelow':
114
+ updatedTreeData.splice(sourceIndex + 1, 0, newNodeBase);
115
+ break;
116
+ case 'addInside':
117
+ updatedTreeData.splice(Math.max(0, insertionIndex), 0, newNodeBase);
118
+ break;
119
+ }
120
+ return updatedTreeData;
121
+ };
122
+ const prepareTreeRows = (treeData, rootNode) => {
123
+ if (!treeData?.length)
124
+ return [];
125
+ const nodeById = new Map();
126
+ const childrenByParent = new Map();
127
+ const siblingIndex = new Map();
128
+ const loadedCountsByParent = new Map();
129
+ if (rootNode && rootNode.key) {
130
+ nodeById.set(rootNode.key, rootNode);
131
+ }
132
+ treeData.forEach((node) => {
133
+ nodeById.set(node.key, node);
134
+ const parentKey = node.parentId ?? ROOT_PARENT_ID;
135
+ if (!childrenByParent.has(parentKey)) {
136
+ childrenByParent.set(parentKey, []);
137
+ loadedCountsByParent.set(parentKey, { container: 0, resource: 0 });
138
+ }
139
+ childrenByParent.get(parentKey)?.push(node);
140
+ const counts = loadedCountsByParent.get(parentKey);
141
+ if (counts) {
142
+ if (node.container) {
143
+ counts.container++;
144
+ }
145
+ else {
146
+ counts.resource++;
147
+ }
148
+ }
149
+ });
150
+ childrenByParent.forEach((children) => {
151
+ children.forEach((child, index) => {
152
+ siblingIndex.set(child.key, index);
153
+ });
154
+ });
155
+ const hasNextSibling = (node) => {
156
+ const parentKey = node.parentId ?? ROOT_PARENT_ID;
157
+ const siblings = childrenByParent.get(parentKey);
158
+ if (!siblings || siblings.length === 0)
159
+ return false;
160
+ const index = siblingIndex.get(node.key) ?? 0;
161
+ if (index < siblings.length - 1)
162
+ return true;
163
+ const parent = nodeById.get(parentKey);
164
+ const loadedCounts = loadedCountsByParent.get(parentKey);
165
+ if (parent && loadedCounts) {
166
+ const siblingContainerResources = siblings
167
+ .filter((node) => node.container)
168
+ .reduce((sum, node) => sum + (node.totalResourceCount ?? 0), 0);
169
+ const siblingDirectResourcesCount = siblings.filter((node) => !node.container).length;
170
+ const calculatedDirectResources = Math.max(0, (parent.totalResourceCount ?? 0) -
171
+ (siblingContainerResources + siblingDirectResourcesCount));
172
+ if (node.container) {
173
+ const hasMoreContainers = loadedCounts.container < (parent.subContainerCount ?? 0);
174
+ const hasResourcesFollowing = calculatedDirectResources > 0;
175
+ return hasMoreContainers || hasResourcesFollowing;
176
+ }
177
+ else {
178
+ return loadedCounts.resource < calculatedDirectResources;
179
+ }
180
+ }
181
+ return false;
182
+ };
183
+ const buildParentSiblings = (node) => {
184
+ const hierarchy = node.hierarchy ?? 0;
185
+ if (hierarchy <= 0)
186
+ return [];
187
+ const path = [];
188
+ let current = node;
189
+ while (current) {
190
+ path.unshift(current);
191
+ if (!current.parentId)
192
+ break;
193
+ const parent = nodeById.get(current.parentId);
194
+ if (!parent)
195
+ break;
196
+ current = parent;
197
+ }
198
+ const flags = path.map((ancestor) => hasNextSibling(ancestor));
199
+ if (flags.length === hierarchy)
200
+ return flags;
201
+ if (flags.length > hierarchy)
202
+ return flags.slice(flags.length - hierarchy);
203
+ const padding = new Array(hierarchy - flags.length).fill(false);
204
+ return padding.concat(flags);
205
+ };
206
+ const resolveSelectedStatus = (node) => {
207
+ if (node.selectedStatus !== undefined)
208
+ return node.selectedStatus;
209
+ let current = node;
210
+ while (current?.parentId) {
211
+ const parent = nodeById.get(current.parentId);
212
+ if (!parent)
213
+ break;
214
+ if (parent.selectedStatus === 'completely')
215
+ return 'completely';
216
+ if (parent.selectedStatus === 'none')
217
+ return 'none';
218
+ current = parent;
219
+ }
220
+ if (rootNode?.selectedStatus === 'completely')
221
+ return 'completely';
222
+ if (rootNode?.selectedStatus === 'none')
223
+ return 'none';
224
+ return node.selectedStatus;
225
+ };
226
+ return treeData.map((node) => {
227
+ const nodeWithSiblings = node;
228
+ const finalParentSiblings = nodeWithSiblings.parentSiblings &&
229
+ nodeWithSiblings.parentSiblings.length > 0
230
+ ? nodeWithSiblings.parentSiblings
231
+ : buildParentSiblings(node);
232
+ return {
233
+ ...node,
234
+ lastChild: !hasNextSibling(node),
235
+ parentSiblings: finalParentSiblings,
236
+ selectedStatus: resolveSelectedStatus(node),
237
+ };
238
+ });
239
+ };
240
+ const TableTreeFn = forwardRef(({ treeData, columnsData, selected = [], select = null, onChange = () => { }, onClick = () => { }, onExpand = () => { }, loadMore = () => { }, tableBorder, height = 'calc(100vh - 134px)', newNode, onAddConfirm = () => { }, onAddCancel = () => { }, handleEditFieldError, loading = false, rootNode, pagination = true, selectedNode, tableHeaderBgColor = 'var(--border-color)', hideOnDisable = false, freezeColumns, addModuleInputWidth = 150, addModuleSelectWidth, onScroll, onScrollEnd, disableEditLabelConfirmIcon = false, transparentHeader = false, navigateTreeNode = null, handleRemoveNavigateTreeNode = () => { }, scrollThreshold = 128, showHeader = true, resetScroll = false, setResetScroll = () => { }, }, ref) => {
11
241
  const [expanding, setExpanding] = useState(null);
12
- const [scrollDirection, setScrollDirection] = useState(null); // this state will help to idenetify the direction during the pagination api call
13
- const [prevScrollTop, setPrevScrollTop] = useState(null);
14
- const [prevScrollHeight, setPrevScrollHeight] = useState(null);
15
- const [maintainScrollPosition, setMaintainScrollPosition] = useState(null);
242
+ const [scrollDirection, setScrollDirection] = useState(null);
243
+ const [virtualRange, setVirtualRange] = useState({ start: 0, end: 20 });
244
+ const [newNodeEditable, setNewNodeEditable] = useState(false);
16
245
  const containerRef = useRef(null);
17
- const previousTreeDataRef = useRef([]);
18
- const scrollPositionRef = useRef({
19
- lastScrollTop: 0,
20
- lastScrollTime: 0,
21
- direction: null,
22
- });
23
- const scrollDebounceRef = useRef(null);
24
- // this is loadMore functions which will the trigger the pagination apis in platform
25
- const loadMoreAbove = useCallback(() => {
26
- if (loading || scrollDirection === 'above')
246
+ const headerRef = useRef(null);
247
+ const headerHeightRef = useRef(0);
248
+ const loadingRef = useRef(loading);
249
+ const scrollDirectionRef = useRef(null);
250
+ const scrollRafRef = useRef(null);
251
+ const scrollPositionRef = useRef({ lastScrollTop: 0 });
252
+ const prevVisibleRowsRef = useRef([]);
253
+ const suppressScrollCancelUntilRef = useRef(0);
254
+ const debouncedScrollEndRef = useRef(null);
255
+ const expandTargetRef = useRef(null);
256
+ const expandingFallbackTimerRef = useRef(null);
257
+ const navigateAttemptsRef = useRef({ key: null, attempts: 0 });
258
+ const navigateClearTimerRef = useRef(null);
259
+ const getWidthInfo = (width, defaultWidth) => {
260
+ const w = width ?? defaultWidth;
261
+ const str = String(w);
262
+ if (str.endsWith('%')) {
263
+ return { value: parseFloat(str), unit: '%' };
264
+ }
265
+ return { value: parseFloat(str) || 0, unit: 'px' };
266
+ };
267
+ const columnMeta = useMemo(() => {
268
+ let stickyLeftPx = 0;
269
+ let stickyLeftPct = 0;
270
+ return columnsData.map((col, index) => {
271
+ const { value, unit } = getWidthInfo(col.width, DEFAULT_COLUMN_WIDTH);
272
+ const sticky = !!freezeColumns && index < freezeColumns;
273
+ const widthCss = unit === '%' ? `${value}%` : `${value}px`;
274
+ const leftCss = `calc(${stickyLeftPx}px + ${stickyLeftPct}%)`;
275
+ const meta = {
276
+ width: widthCss,
277
+ sticky,
278
+ left: leftCss,
279
+ zIndex: sticky ? 100 + (freezeColumns ?? 0) - index : 1,
280
+ };
281
+ if (sticky) {
282
+ if (unit === '%') {
283
+ stickyLeftPct += value;
284
+ }
285
+ else {
286
+ stickyLeftPx += value;
287
+ }
288
+ }
289
+ return meta;
290
+ });
291
+ }, [columnsData, freezeColumns]);
292
+ const totalWidth = useMemo(() => {
293
+ let totalPx = 0;
294
+ let totalPct = 0;
295
+ columnsData.forEach((col) => {
296
+ const { value, unit } = getWidthInfo(col.width, DEFAULT_COLUMN_WIDTH);
297
+ if (unit === '%') {
298
+ totalPct += value;
299
+ }
300
+ else {
301
+ totalPx += value;
302
+ }
303
+ });
304
+ return `calc(${totalPx}px + ${totalPct}%)`;
305
+ }, [columnsData]);
306
+ const frozenColumnWidth = useMemo(() => {
307
+ if (!freezeColumns)
308
+ return '0px';
309
+ let totalPx = 0;
310
+ let totalPct = 0;
311
+ const frozenCols = columnMeta.slice(0, freezeColumns);
312
+ frozenCols.forEach((col) => {
313
+ const val = parseFloat(col.width) || 0;
314
+ if (col.width.endsWith('%')) {
315
+ totalPct += val;
316
+ }
317
+ else {
318
+ totalPx += val;
319
+ }
320
+ });
321
+ return `calc(${totalPx}px + ${totalPct}%)`;
322
+ }, [columnMeta, freezeColumns]);
323
+ const treeDataWithNewNode = useMemo(() => insertNewNode(treeData, newNode, rootNode?.node), [treeData, newNode, rootNode]);
324
+ const preparedRows = useMemo(() => prepareTreeRows(treeDataWithNewNode, rootNode?.node), [treeDataWithNewNode, rootNode?.node]);
325
+ const visiblePreparedRows = useMemo(() => preparedRows.filter((node) => !node.hide), [preparedRows]);
326
+ const preparedRowsByKey = useMemo(() => {
327
+ const map = new Map();
328
+ preparedRows.forEach((node) => map.set(node.key, node));
329
+ return map;
330
+ }, [preparedRows]);
331
+ const keyIndexMap = useMemo(() => {
332
+ const map = new Map();
333
+ visiblePreparedRows.forEach((node, index) => map.set(node.key, index));
334
+ return map;
335
+ }, [visiblePreparedRows]);
336
+ const clearExpanding = useCallback((targetKey) => {
337
+ setExpanding((current) => {
338
+ if (!current)
339
+ return current;
340
+ if (targetKey && current !== targetKey)
341
+ return current;
342
+ return null;
343
+ });
344
+ if (!targetKey || expandTargetRef.current?.key === targetKey) {
345
+ expandTargetRef.current = null;
346
+ }
347
+ if (expandingFallbackTimerRef.current) {
348
+ clearTimeout(expandingFallbackTimerRef.current);
349
+ expandingFallbackTimerRef.current = null;
350
+ }
351
+ }, []);
352
+ useEffect(() => {
353
+ loadingRef.current = loading;
354
+ }, [loading]);
355
+ useEffect(() => {
356
+ scrollDirectionRef.current = scrollDirection;
357
+ }, [scrollDirection]);
358
+ const updateScrollDirection = useCallback((direction) => {
359
+ scrollDirectionRef.current = direction;
360
+ setScrollDirection(direction);
361
+ }, []);
362
+ const updateVirtualRange = useCallback(() => {
363
+ const container = containerRef.current;
364
+ if (!container)
27
365
  return;
28
- setScrollDirection('above');
29
- setPrevScrollTop(containerRef.current?.scrollTop ?? null);
30
- setPrevScrollHeight(containerRef.current?.scrollHeight ?? null);
31
- loadMore('above');
32
- }, [loading, scrollDirection, loadMore]);
33
- const loadMoreBelow = useCallback(() => {
34
- if (loading || scrollDirection === 'below')
366
+ const headerHeight = headerHeightRef.current || 0;
367
+ const rowScrollTop = Math.max(0, container.scrollTop - headerHeight);
368
+ const viewportHeight = container.clientHeight - headerHeight;
369
+ let start = Math.floor(rowScrollTop / ROW_HEIGHT) - OVERSCAN;
370
+ let end = Math.ceil((rowScrollTop + viewportHeight) / ROW_HEIGHT) + OVERSCAN;
371
+ start = Math.max(0, start);
372
+ end = Math.min(visiblePreparedRows.length, end);
373
+ setVirtualRange((prev) => {
374
+ if (prev.start === start && prev.end === end)
375
+ return prev;
376
+ return { start, end };
377
+ });
378
+ }, [visiblePreparedRows.length]);
379
+ const scheduleRangeUpdate = useCallback(() => {
380
+ if (scrollRafRef.current !== null)
35
381
  return;
36
- setScrollDirection('below');
37
- loadMore('below');
38
- }, [loading, scrollDirection, loadMore]);
39
- // this is scroll handler
382
+ scrollRafRef.current = requestAnimationFrame(() => {
383
+ scrollRafRef.current = null;
384
+ updateVirtualRange();
385
+ });
386
+ }, [updateVirtualRange]);
40
387
  const handleScroll = useCallback(() => {
41
388
  const container = containerRef.current;
42
- if (!container || checkEmpty(treeData))
389
+ if (!container)
43
390
  return;
44
- const now = Date.now();
45
391
  const currentScrollTop = container.scrollTop;
46
- const scrollHeight = container.scrollHeight;
47
- const clientHeight = container.clientHeight;
48
- // Scroll direction calculation
49
392
  const direction = currentScrollTop > scrollPositionRef.current.lastScrollTop
50
393
  ? 'down'
51
394
  : 'up';
52
- scrollPositionRef.current = {
53
- lastScrollTop: currentScrollTop,
54
- lastScrollTime: now,
55
- direction,
56
- };
57
- // Cancel any previous debounce
58
- if (scrollDebounceRef.current) {
59
- clearTimeout(scrollDebounceRef.current);
60
- }
61
- // Infinite Scroll
395
+ scrollPositionRef.current.lastScrollTop = currentScrollTop;
396
+ scheduleRangeUpdate();
397
+ onScroll?.();
398
+ debouncedScrollEndRef.current?.();
399
+ if (!pagination ||
400
+ loading ||
401
+ scrollDirectionRef.current ||
402
+ checkEmpty(treeData))
403
+ return;
404
+ const scrollHeight = container.scrollHeight;
405
+ const clientHeight = container.clientHeight;
62
406
  const nearBottom = scrollHeight - (currentScrollTop + clientHeight) < scrollThreshold;
63
- const nearTop = currentScrollTop < scrollThreshold;
64
407
  if (direction === 'down' &&
65
408
  nearBottom &&
66
- !loading &&
67
- !scrollDirection &&
68
- treeData[treeData.length - 1]?.lastResource !== true) {
69
- scrollDebounceRef.current = setTimeout(() => {
70
- loadMoreBelow();
71
- }, 150);
409
+ !treeData[treeData.length - 1]?.lastResource) {
410
+ updateScrollDirection('below');
411
+ loadMore('below');
412
+ }
413
+ }, [
414
+ treeData,
415
+ pagination,
416
+ loading,
417
+ scrollDirection,
418
+ scrollThreshold,
419
+ scheduleRangeUpdate,
420
+ onScroll,
421
+ loadMore,
422
+ updateScrollDirection,
423
+ ]);
424
+ useEffect(() => {
425
+ if (loading || !pagination || checkEmpty(treeData))
426
+ return;
427
+ const firstNode = treeData[0];
428
+ const hasMoreAbove = !firstNode?.lastResource;
429
+ const { totalSubContainerCount = 0, totalResourceCount = 0 } = rootNode?.node || {};
430
+ const totalItems = totalSubContainerCount + totalResourceCount;
431
+ const isListTooShort = visiblePreparedRows.length < 10 &&
432
+ visiblePreparedRows.length < totalItems;
433
+ if (hasMoreAbove && isListTooShort) {
434
+ updateScrollDirection('above');
435
+ loadMore('above');
72
436
  }
73
- if (direction === 'up' &&
74
- nearTop &&
75
- !loading &&
76
- !scrollDirection &&
77
- treeData[0]?.lastResource !== true) {
78
- scrollDebounceRef.current = setTimeout(() => {
79
- loadMoreAbove();
80
- }, 150);
437
+ }, [
438
+ loading,
439
+ pagination,
440
+ treeData,
441
+ visiblePreparedRows.length,
442
+ rootNode,
443
+ loadMore,
444
+ updateScrollDirection,
445
+ ]);
446
+ useLayoutEffect(() => {
447
+ const oldRows = prevVisibleRowsRef.current;
448
+ const newRows = visiblePreparedRows;
449
+ const container = containerRef.current;
450
+ if (resetScroll && container) {
451
+ container.scrollTop = 0;
452
+ scrollPositionRef.current.lastScrollTop = 0;
453
+ setResetScroll(false);
454
+ return;
81
455
  }
82
- // Scroll Restoration After Loading Above
83
- if (!loading &&
84
- scrollDirection === 'above' &&
85
- previousTreeDataRef.current.length > 0 &&
86
- prevScrollTop !== null) {
87
- const previousTreeData = previousTreeDataRef.current;
88
- let addedRowsCount = 0;
89
- for (let i = 0; i < treeData.length; i++) {
90
- if (previousTreeData[0] === treeData[i])
91
- break;
92
- addedRowsCount++;
93
- }
94
- let retries = 0;
95
- const maxRetries = 30;
96
- // this function will try to restore the scroll position after loading more data specially when loading more data above
97
- const tryRestoreScroll = () => {
98
- const allRows = Array.from(container.querySelectorAll('.ff-table-tree-row'));
99
- let totalAddedHeight = 0;
100
- for (let i = 0; i < addedRowsCount; i++) {
101
- const height = allRows[i]?.getBoundingClientRect().height || 0;
102
- totalAddedHeight += height;
456
+ else if (container && oldRows.length > 0 && newRows.length > 0) {
457
+ if (!loading) {
458
+ const lastScrollTop = scrollPositionRef.current.lastScrollTop;
459
+ const topVisibleIndex = Math.max(0, Math.floor(lastScrollTop / ROW_HEIGHT));
460
+ let oldIndex = -1;
461
+ let newIndex = -1;
462
+ for (let i = topVisibleIndex; i < oldRows.length; i++) {
463
+ const key = oldRows[i]?.key;
464
+ const foundNewIndex = keyIndexMap.get(key ?? '');
465
+ if (foundNewIndex !== undefined) {
466
+ oldIndex = i;
467
+ newIndex = foundNewIndex;
468
+ break;
469
+ }
103
470
  }
104
- const canScroll = container.scrollHeight > container.clientHeight;
105
- const validHeights = totalAddedHeight > 0;
106
- if (validHeights && canScroll) {
107
- container.scrollTop = prevScrollTop + totalAddedHeight;
108
- previousTreeDataRef.current = treeData;
471
+ if (oldIndex === -1) {
472
+ for (let i = topVisibleIndex - 1; i >= 0; i--) {
473
+ const key = oldRows[i]?.key;
474
+ const foundNewIndex = keyIndexMap.get(key ?? '');
475
+ if (foundNewIndex !== undefined) {
476
+ oldIndex = i;
477
+ newIndex = foundNewIndex;
478
+ break;
479
+ }
480
+ }
109
481
  }
110
- else if (retries < maxRetries) {
111
- retries++;
112
- requestAnimationFrame(tryRestoreScroll);
482
+ if (oldIndex !== -1 && newIndex !== -1) {
483
+ const deltaRows = newIndex - oldIndex;
484
+ const targetScrollTop = Math.max(0, lastScrollTop + deltaRows * ROW_HEIGHT);
485
+ if (container.scrollTop !== targetScrollTop) {
486
+ container.scrollTop = targetScrollTop;
487
+ scrollPositionRef.current.lastScrollTop = container.scrollTop;
488
+ updateVirtualRange();
489
+ }
113
490
  }
114
491
  else {
115
- previousTreeDataRef.current = treeData;
116
- console.warn('Failed to restore scroll position after max retries');
492
+ // FIX: Graceful Fallback
493
+ if (scrollDirection === 'above') {
494
+ // Only push to 0 if they specifically requested data ABOVE them
495
+ if (container.scrollTop !== 0) {
496
+ container.scrollTop = 0;
497
+ scrollPositionRef.current.lastScrollTop = 0;
498
+ updateVirtualRange();
499
+ }
500
+ }
501
+ else {
502
+ // For all other cases (canceling an add, shrinking), just safely clamp the scroll
503
+ // so it doesn't point to empty space, but DO NOT force it to 0.
504
+ const headerHeight = headerHeightRef.current || 0;
505
+ const maxScrollTop = Math.max(0, newRows.length * ROW_HEIGHT -
506
+ (container.clientHeight - headerHeight));
507
+ if (container.scrollTop > maxScrollTop) {
508
+ container.scrollTop = maxScrollTop;
509
+ scrollPositionRef.current.lastScrollTop = maxScrollTop;
510
+ updateVirtualRange();
511
+ }
512
+ }
117
513
  }
118
- };
119
- requestAnimationFrame(tryRestoreScroll);
514
+ if (scrollDirection) {
515
+ updateScrollDirection(null);
516
+ }
517
+ }
120
518
  }
519
+ prevVisibleRowsRef.current = newRows;
121
520
  }, [
122
521
  loading,
123
522
  scrollDirection,
124
- treeData,
125
- loadMoreAbove,
126
- loadMoreBelow,
127
- prevScrollTop,
128
- onScroll,
523
+ keyIndexMap,
524
+ visiblePreparedRows,
525
+ updateScrollDirection,
526
+ updateVirtualRange,
527
+ resetScroll,
528
+ setResetScroll,
129
529
  ]);
130
- // Attach scroll event listener for updated first node when we scroll
131
530
  useEffect(() => {
132
- const scrollDiv = containerRef.current;
133
- if (!scrollDiv)
531
+ const container = containerRef.current;
532
+ if (!container)
134
533
  return;
135
- const debouncedOnScrollEnd = debounce(() => {
136
- onScrollEnd?.();
137
- }, 150);
138
- const scrollListener = () => {
139
- onScroll?.();
140
- debouncedOnScrollEnd();
534
+ const handleWheelAtTop = (event) => {
535
+ if (event.deltaY >= 0)
536
+ return;
537
+ if (!pagination || checkEmpty(treeData) || loadingRef.current)
538
+ return;
539
+ if (scrollDirectionRef.current)
540
+ return;
541
+ if (container.scrollTop > 1 || treeData[0]?.lastResource)
542
+ return;
543
+ updateScrollDirection('above');
544
+ loadMore('above');
141
545
  };
142
- scrollDiv.addEventListener('scroll', scrollListener);
546
+ container.addEventListener('wheel', handleWheelAtTop, { passive: true });
143
547
  return () => {
144
- scrollDiv.removeEventListener('scroll', scrollListener);
145
- debouncedOnScrollEnd.cancel();
548
+ container.removeEventListener('wheel', handleWheelAtTop);
146
549
  };
147
- }, [onScroll, onScrollEnd]);
550
+ }, [pagination, treeData, loadMore, updateScrollDirection]);
148
551
  useEffect(() => {
552
+ const container = containerRef.current;
553
+ if (!container)
554
+ return;
555
+ debouncedScrollEndRef.current = onScrollEnd
556
+ ? debounce(() => {
557
+ onScrollEnd?.();
558
+ }, 150)
559
+ : null;
560
+ container.addEventListener('scroll', handleScroll, { passive: true });
149
561
  return () => {
150
- if (scrollDebounceRef.current) {
151
- clearTimeout(scrollDebounceRef.current);
562
+ container.removeEventListener('scroll', handleScroll);
563
+ debouncedScrollEndRef.current?.cancel();
564
+ };
565
+ }, [handleScroll, onScrollEnd]);
566
+ useEffect(() => {
567
+ const container = containerRef.current;
568
+ if (!container)
569
+ return;
570
+ const handleScrollCapture = (event) => {
571
+ if (Date.now() < suppressScrollCancelUntilRef.current) {
572
+ event.stopImmediatePropagation();
152
573
  }
153
574
  };
575
+ container.addEventListener('scroll', handleScrollCapture, {
576
+ passive: true,
577
+ capture: true,
578
+ });
579
+ return () => {
580
+ container.removeEventListener('scroll', handleScrollCapture, true);
581
+ };
154
582
  }, []);
155
- // Handle scroll position restoration after loading
583
+ useEffect(() => {
584
+ const headerNode = headerRef.current;
585
+ if (!headerNode)
586
+ return;
587
+ const updateHeight = () => {
588
+ headerHeightRef.current = headerNode.getBoundingClientRect().height;
589
+ updateVirtualRange();
590
+ };
591
+ const resizeObserver = new ResizeObserver(updateHeight);
592
+ resizeObserver.observe(headerNode);
593
+ return () => resizeObserver.disconnect();
594
+ }, [updateVirtualRange]);
156
595
  useLayoutEffect(() => {
157
- if (!loading &&
158
- scrollDirection === 'above' &&
159
- prevScrollTop !== null &&
160
- prevScrollHeight !== null) {
161
- const container = containerRef.current;
162
- if (!container)
163
- return;
164
- const scrollHeightDiff = container.scrollHeight - prevScrollHeight;
165
- if (scrollHeightDiff > 0) {
166
- container.scrollTop = prevScrollTop + scrollHeightDiff;
167
- }
168
- setScrollDirection(null);
169
- setPrevScrollTop(null);
170
- setPrevScrollHeight(null);
596
+ if (!newNode || !containerRef.current)
597
+ return;
598
+ const container = containerRef.current;
599
+ const newNodeIndex = keyIndexMap.get('new-node');
600
+ if (newNodeIndex === undefined)
601
+ return;
602
+ const headerHeight = headerHeightRef.current || 0;
603
+ const viewportHeight = container.clientHeight - headerHeight;
604
+ if (viewportHeight <= 0)
605
+ return;
606
+ const rowTop = newNodeIndex * ROW_HEIGHT;
607
+ const rowBottom = rowTop + ROW_HEIGHT;
608
+ const rowScrollTop = Math.max(0, container.scrollTop - headerHeight);
609
+ const viewTop = rowScrollTop;
610
+ const viewBottom = rowScrollTop + viewportHeight;
611
+ let nextRowScrollTop = rowScrollTop;
612
+ if (rowTop < viewTop) {
613
+ nextRowScrollTop = rowTop;
171
614
  }
172
- else if (!loading) {
173
- setScrollDirection(null);
615
+ else if (rowBottom > viewBottom) {
616
+ nextRowScrollTop = Math.max(0, rowBottom - viewportHeight);
174
617
  }
175
- }, [loading, scrollDirection, prevScrollTop, prevScrollHeight]);
176
- // Handle navigation to specific nodes
177
- useEffect(() => {
178
- if (navigateTreeNode) {
179
- const node = document.getElementById(navigateTreeNode);
180
- const container = containerRef.current;
181
- if (node && container) {
182
- // Store current scroll position
183
- setMaintainScrollPosition(container.scrollTop);
184
- // Calculate scroll position
185
- const nodeRect = node.getBoundingClientRect();
186
- const containerRect = container.getBoundingClientRect();
187
- const scrollTop = container.scrollTop;
188
- const nodeTop = nodeRect.top - containerRect.top + scrollTop;
189
- const containerHeight = containerRect.height;
190
- // Scroll to center the node
191
- container.scrollTo({
192
- top: nodeTop - containerHeight / 2 + nodeRect.height / 2,
193
- behavior: 'smooth',
194
- });
195
- }
618
+ if (nextRowScrollTop !== rowScrollTop) {
619
+ suppressScrollCancelUntilRef.current = Date.now() + 300;
620
+ container.scrollTop = nextRowScrollTop + headerHeight;
621
+ scrollPositionRef.current.lastScrollTop = container.scrollTop;
622
+ updateVirtualRange();
196
623
  }
197
- return () => {
198
- handleRemoveNavigateTreeNode();
199
- };
200
- }, [navigateTreeNode, treeData]);
201
- // Restore scroll position after navigation
624
+ const rafId = requestAnimationFrame(() => {
625
+ setNewNodeEditable(true);
626
+ });
627
+ return () => cancelAnimationFrame(rafId);
628
+ }, [newNode, keyIndexMap, updateVirtualRange]);
202
629
  useEffect(() => {
203
- if (maintainScrollPosition !== null && !loading && containerRef.current) {
204
- containerRef.current.scrollTop = maintainScrollPosition;
205
- setMaintainScrollPosition(null);
630
+ if (!newNode) {
631
+ setNewNodeEditable(false);
632
+ }
633
+ }, [newNode]);
634
+ useLayoutEffect(() => {
635
+ if (!expanding || loading)
636
+ return;
637
+ const expected = expandTargetRef.current;
638
+ if (!expected || expected.key !== expanding) {
639
+ const rafId = requestAnimationFrame(() => {
640
+ clearExpanding(expanding);
641
+ });
642
+ return () => cancelAnimationFrame(rafId);
643
+ }
644
+ const updatedNode = preparedRowsByKey.get(expected.key);
645
+ if (!updatedNode) {
646
+ const rafId = requestAnimationFrame(() => {
647
+ clearExpanding(expected.key);
648
+ });
649
+ return () => cancelAnimationFrame(rafId);
206
650
  }
207
- }, [maintainScrollPosition, loading]);
208
- // Setup scroll listener
651
+ if (Boolean(updatedNode.expanded) !== expected.expanded)
652
+ return;
653
+ const rafId = requestAnimationFrame(() => {
654
+ clearExpanding(expected.key);
655
+ });
656
+ return () => cancelAnimationFrame(rafId);
657
+ }, [preparedRowsByKey, expanding, loading, clearExpanding]);
209
658
  useEffect(() => {
659
+ if (navigateAttemptsRef.current.key !== navigateTreeNode) {
660
+ navigateAttemptsRef.current = {
661
+ key: navigateTreeNode,
662
+ attempts: 0,
663
+ };
664
+ }
665
+ if (!navigateTreeNode && navigateClearTimerRef.current) {
666
+ clearTimeout(navigateClearTimerRef.current);
667
+ navigateClearTimerRef.current = null;
668
+ }
669
+ }, [navigateTreeNode]);
670
+ useLayoutEffect(() => {
671
+ if (!navigateTreeNode || newNode)
672
+ return;
210
673
  const container = containerRef.current;
211
- if (!container || !pagination)
674
+ if (!container)
212
675
  return;
213
- container.addEventListener('scroll', handleScroll);
214
- // Initial check in case we're already at the bottom/top
215
- handleScroll();
216
- return () => {
217
- container.removeEventListener('scroll', handleScroll);
218
- if (scrollDebounceRef.current) {
219
- clearTimeout(scrollDebounceRef.current);
676
+ const rowIndex = keyIndexMap.get(navigateTreeNode);
677
+ if (rowIndex !== undefined) {
678
+ navigateAttemptsRef.current = {
679
+ key: navigateTreeNode,
680
+ attempts: 0,
681
+ };
682
+ const headerHeight = headerHeightRef.current || 0;
683
+ const viewportHeight = Math.max(ROW_HEIGHT, container.clientHeight - headerHeight);
684
+ const rowCenter = rowIndex * ROW_HEIGHT + ROW_HEIGHT / 2;
685
+ const targetTop = Math.max(0, rowCenter - viewportHeight / 2) + headerHeight;
686
+ suppressScrollCancelUntilRef.current = Date.now() + 400;
687
+ container.scrollTo({
688
+ top: targetTop,
689
+ behavior: 'smooth',
690
+ });
691
+ scheduleRangeUpdate();
692
+ if (navigateClearTimerRef.current) {
693
+ clearTimeout(navigateClearTimerRef.current);
220
694
  }
221
- };
222
- }, [handleScroll, pagination]);
223
- // Track previous tree data for scroll restoration
224
- useEffect(() => {
225
- if (treeData.length > 0) {
226
- previousTreeDataRef.current = treeData;
695
+ navigateClearTimerRef.current = setTimeout(() => {
696
+ handleRemoveNavigateTreeNode?.();
697
+ }, 350);
698
+ return;
227
699
  }
228
- }, [treeData]);
229
- useEffect(() => {
230
- if (!loading && expanding) {
231
- setExpanding(null);
700
+ if (loading || scrollDirection)
701
+ return;
702
+ const retryState = navigateAttemptsRef.current;
703
+ if (retryState.key !== navigateTreeNode) {
704
+ retryState.key = navigateTreeNode;
705
+ retryState.attempts = 0;
232
706
  }
233
- }, [loading]);
707
+ retryState.attempts += 1;
708
+ if (retryState.attempts > 30) {
709
+ handleRemoveNavigateTreeNode?.();
710
+ return;
711
+ }
712
+ if (pagination && treeData[0]?.lastResource !== true) {
713
+ updateScrollDirection('above');
714
+ loadMore('above');
715
+ return;
716
+ }
717
+ if (retryState.attempts > 2) {
718
+ handleRemoveNavigateTreeNode?.();
719
+ }
720
+ }, [
721
+ navigateTreeNode,
722
+ newNode,
723
+ keyIndexMap,
724
+ loading,
725
+ scrollDirection,
726
+ pagination,
727
+ treeData,
728
+ loadMore,
729
+ scheduleRangeUpdate,
730
+ handleRemoveNavigateTreeNode,
731
+ updateScrollDirection,
732
+ ]);
234
733
  const handleToggleExpand = useCallback((node) => {
235
734
  if (expanding)
236
735
  return;
736
+ const nextExpandedState = !node?.expanded;
237
737
  setExpanding(node.key);
738
+ expandTargetRef.current = {
739
+ key: node.key,
740
+ expanded: nextExpandedState,
741
+ };
742
+ if (expandingFallbackTimerRef.current) {
743
+ clearTimeout(expandingFallbackTimerRef.current);
744
+ }
745
+ const fallbackStartedAt = Date.now();
746
+ const MAX_FALLBACK_WAIT_MS = 2000;
747
+ const FALLBACK_CHECK_INTERVAL_MS = 1000;
748
+ const ensureExpandCleanup = () => {
749
+ if (expandTargetRef.current?.key !== node.key)
750
+ return;
751
+ const isStillLoading = loadingRef.current;
752
+ const didTimeout = Date.now() - fallbackStartedAt >= MAX_FALLBACK_WAIT_MS;
753
+ if (isStillLoading && !didTimeout) {
754
+ expandingFallbackTimerRef.current = setTimeout(ensureExpandCleanup, FALLBACK_CHECK_INTERVAL_MS);
755
+ return;
756
+ }
757
+ clearExpanding(node.key);
758
+ };
759
+ expandingFallbackTimerRef.current = setTimeout(ensureExpandCleanup, FALLBACK_CHECK_INTERVAL_MS);
238
760
  onExpand?.(node);
239
- }, [onExpand, expanding]);
761
+ }, [expanding, onExpand, clearExpanding]);
240
762
  const handleCheckBoxChange = useCallback((e, node) => {
241
763
  if (expanding)
242
764
  return;
@@ -247,69 +769,32 @@ showHeader = true, }, ref) => {
247
769
  return;
248
770
  onClick?.(e, node);
249
771
  }, [onClick, expanding]);
250
- const DEFAULT_COLUMN_WIDTH = 400;
251
- const calculateFrozenWidth = (columnData, freezeColumns) => {
252
- return columnData
253
- .slice(0, freezeColumns)
254
- .reduce((acc, col) => acc + parseInt(col.width || `${DEFAULT_COLUMN_WIDTH}`, 10), 0);
255
- };
256
- let frozenWidth;
257
- if (freezeColumns) {
258
- frozenWidth = calculateFrozenWidth(columnsData, freezeColumns);
259
- }
260
- // half visible, click on upward arrow functionality, page auto scrolling
261
772
  useEffect(() => {
262
- if (!newNode || !containerRef.current)
263
- return;
264
- const container = containerRef.current;
265
- if (newNode.action === 'addAbove' &&
266
- newNode.sourceId === treeData[0]?.key) {
267
- container.scrollTo({ top: 0, behavior: 'smooth' });
268
- }
269
- else if (newNode.action === 'addAbove' &&
270
- newNode.sourceId === newNode.firstNodeKey) {
271
- const newScrollTop = container.scrollTop - 64;
272
- container.scrollTo({ top: newScrollTop, behavior: 'smooth' });
273
- }
274
- }, [newNode]);
275
- useLayoutEffect(() => {
276
- if (!navigateTreeNode)
277
- return;
278
- const container = containerRef.current;
279
- if (!container)
280
- return;
281
- let retryCount = 0;
282
- const maxRetries = 30;
283
- const scrollToNode = () => {
284
- const element = document.getElementById(navigateTreeNode);
285
- if (element) {
286
- setTimeout(() => {
287
- element.scrollIntoView({ behavior: 'smooth', block: 'center' });
288
- handleRemoveNavigateTreeNode();
289
- }, 200);
773
+ return () => {
774
+ if (scrollRafRef.current !== null) {
775
+ cancelAnimationFrame(scrollRafRef.current);
776
+ scrollRafRef.current = null;
290
777
  }
291
- else {
292
- if (retryCount === 0 && treeData?.length > 1) {
293
- loadMoreAbove?.();
294
- }
295
- if (retryCount < maxRetries) {
296
- retryCount++;
297
- requestAnimationFrame(scrollToNode);
298
- }
299
- else {
300
- handleRemoveNavigateTreeNode();
301
- }
778
+ if (expandingFallbackTimerRef.current) {
779
+ clearTimeout(expandingFallbackTimerRef.current);
780
+ }
781
+ if (navigateClearTimerRef.current) {
782
+ clearTimeout(navigateClearTimerRef.current);
302
783
  }
303
784
  };
304
- scrollToNode();
305
- }, [navigateTreeNode, loadMoreAbove, handleRemoveNavigateTreeNode]);
306
- return (_jsx("div", { className: "tree-table-wrapper-container", children: _jsx("div", { className: "tree-table-wrap", ref: ref, children: _jsx("div", { className: `table-scrollable ${treeData.length ? '' : 'table-empty'}`, ref: containerRef, style: {
307
- '--table-height': treeData.length ? height : 'auto',
308
- '--frozen-column-width': freezeColumns
309
- ? `${frozenWidth}px`
310
- : '0px',
785
+ }, []);
786
+ const totalHeight = visiblePreparedRows.length * ROW_HEIGHT;
787
+ const visibleRows = visiblePreparedRows.slice(virtualRange.start, virtualRange.end);
788
+ return (_jsx("div", { className: "tree-table-wrapper-container table-tree-fn", children: _jsx("div", { className: "tree-table-fn-wrap", ref: ref, children: _jsx("div", { className: `table-fn-scrollable ${visiblePreparedRows.length ? '' : 'table-fn-empty'}`, ref: containerRef, style: {
789
+ '--table-height': visiblePreparedRows.length ? height : 'auto',
790
+ '--frozen-column-width': frozenColumnWidth,
311
791
  border: tableBorder,
312
- }, children: _jsxs("table", { className: "tree-table", children: [_jsx(TableHead, { columnsData: columnsData, rootNode: rootNode, onCheckBoxChange: handleCheckBoxChange, selected: selected, selectedNode: selectedNode, tableHeaderBgColor: tableHeaderBgColor, hideOnDisable: hideOnDisable, transparentHeader: transparentHeader, scriptLengthTruncate: scriptLengthTruncate, showHeader: showHeader }), _jsx(TableBody, { flattenedTreeData: addLastChild(treeData), rootNode: rootNode?.node, columnsData: columnsData, selected: selected, select: select, onRowClick: handleRowClick, onToggleExpand: handleToggleExpand, onCheckBoxChange: handleCheckBoxChange, newNode: newNode, onAddConfirm: onAddConfirm, onAddCancel: onAddCancel, handleEditFieldError: handleEditFieldError, expanding: expanding, selectedNode: selectedNode, hideOnDisable: hideOnDisable, scriptLengthTruncate: scriptLengthTruncate, addModuleInputWidth: addModuleInputWidth, addModuleSelectWidth: addModuleSelectWidth, disableEditLabelConfirmIcon: disableEditLabelConfirmIcon })] }) }) }) }));
792
+ }, children: _jsxs("div", { className: "tree-table-fn", style: { width: totalWidth }, children: [_jsx("div", { ref: headerRef, style: { position: 'sticky', top: 0, zIndex: 98 }, children: _jsx(TableHead, { columnsData: columnsData, columnMeta: columnMeta, totalWidth: totalWidth, rootNode: rootNode, onCheckBoxChange: handleCheckBoxChange, selected: selected, selectedNode: selectedNode, tableHeaderBgColor: tableHeaderBgColor, hideOnDisable: hideOnDisable, transparentHeader: transparentHeader, showHeader: showHeader }) }), _jsx(TableBody, { flattenedTreeData: visibleRows, columnsData: columnsData, columnMeta: columnMeta, totalWidth: totalWidth, rowHeight: ROW_HEIGHT, startIndex: virtualRange.start, totalHeight: totalHeight, selected: selected, select: select, onRowClick: handleRowClick, onToggleExpand: handleToggleExpand, onCheckBoxChange: handleCheckBoxChange, onAddConfirm: onAddConfirm, onAddCancel: onAddCancel, handleEditFieldError: handleEditFieldError, expanding: expanding, selectedNode: selectedNode, hideOnDisable: hideOnDisable, addModuleInputWidth: addModuleInputWidth, addModuleSelectWidth: addModuleSelectWidth, disableEditLabelConfirmIcon: disableEditLabelConfirmIcon, isEditable: newNode ? newNodeEditable : undefined, setIsEditable: newNode
793
+ ? (id) => {
794
+ setNewNodeEditable(Boolean(id));
795
+ }
796
+ : undefined })] }) }) }) }));
313
797
  });
798
+ TableTreeFn.displayName = 'TableTreeFn';
314
799
  export default TableTreeFn;
315
800
  //# sourceMappingURL=TableTreeFn.js.map