@ringcentral/juno 2.40.1 → 2.41.1

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 (315) hide show
  1. package/components/Accordion/Accordion.d.ts +1 -1
  2. package/components/Accordion/AccordionDetails/AccordionDetails.d.ts +1 -1
  3. package/components/Accordion/AccordionSummary/AccordionSummary.d.ts +1 -1
  4. package/components/Alert/Alert.d.ts +1 -1
  5. package/components/AppBar/AppBar.d.ts +2 -2
  6. package/components/Avatar/styles/StyledAvatarWrapper.d.ts +1 -1
  7. package/components/Backdrop/Backdrop.d.ts +1 -1
  8. package/components/Badge/Badge.d.ts +1 -1
  9. package/components/Box/Box.d.ts +1 -1
  10. package/components/Buttons/Button/Button.d.ts +2 -2
  11. package/components/Buttons/ButtonBase/ButtonBase.d.ts +1 -1
  12. package/components/Buttons/ButtonGroup/ButtonGroup.d.ts +1 -1
  13. package/components/Buttons/IconButton/IconButton.d.ts +2 -2
  14. package/components/Buttons/IconButtonGroup/IconButtonGroup.d.ts +1 -1
  15. package/components/Buttons/SplitButton/SplitButton.d.ts +1 -1
  16. package/components/Buttons/SplitButton/styles/StyledArrowIcon.d.ts +1 -1
  17. package/components/Buttons/ToggleButton/ToggleButton.d.ts +1 -1
  18. package/components/Buttons/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -1
  19. package/components/Card/Card/Card.d.ts +1 -1
  20. package/components/Card/CardActions/CardActions.d.ts +1 -1
  21. package/components/Card/CardContent/CardContent.d.ts +1 -1
  22. package/components/Card/CardHeader/CardHeader.d.ts +8 -8
  23. package/components/Card/CardHoverActions/CardHoverActions.d.ts +1 -1
  24. package/components/Card/CardMedia/CardMedia.d.ts +8 -8
  25. package/components/Card/CardSelectionArea/CardSelectionArea.d.ts +1 -1
  26. package/components/Dialer/DialDelete/DialDelete.d.ts +1 -0
  27. package/components/Dialer/DialDelete/DialDelete.js +1 -1
  28. package/components/Dialer/DialPad/DialPad.d.ts +4 -4
  29. package/components/Dialer/DialTextField/DialTextField.d.ts +1 -1
  30. package/components/Dialog/Dialog.d.ts +1 -1
  31. package/components/Dialog/DialogActions/DialogActions.d.ts +2 -2
  32. package/components/Dialog/DialogContent/DialogContent.d.ts +2 -2
  33. package/components/Dialog/DialogContentText/DialogContentText.d.ts +2 -2
  34. package/components/Dialog/DialogTitle/DialogTitle.d.ts +2 -2
  35. package/components/Divider/Divider.d.ts +1 -1
  36. package/components/Downshift/SuggestionList/SuggestionList.d.ts +3 -3
  37. package/components/Downshift/styles/DownshiftStyle.d.ts +2 -2
  38. package/components/Downshift/styles/StyledPopper.d.ts +1 -1
  39. package/components/Downshift/styles/StyledTextField.d.ts +1 -1
  40. package/components/Downshift/utils/useDownshift.d.ts +3 -3
  41. package/components/Downshift/utils/useDownshiftTag.d.ts +3 -3
  42. package/components/Drawer/Drawer.d.ts +1 -1
  43. package/components/Forms/Checkbox/Checkbox.d.ts +1 -1
  44. package/components/Forms/FormControl.d.ts +1 -1
  45. package/components/Forms/FormControlLabel/FormControlLabel.d.ts +1 -1
  46. package/components/Forms/FormGroup/FormGroup.d.ts +1 -1
  47. package/components/Forms/FormHelperText/FormHelperText.d.ts +1 -1
  48. package/components/Forms/FormHelperText/styles/StyledFormHelperText.d.ts +1 -1
  49. package/components/Forms/FormLabel.d.ts +1 -1
  50. package/components/Forms/InputLabel/InputLabel.d.ts +1 -1
  51. package/components/Forms/InputLabel/styles/StyledInputLabel.d.ts +1 -1
  52. package/components/Forms/Picker/DatePicker/DatePicker.d.ts +2 -2
  53. package/components/Forms/Picker/DatePicker/styles/StyledCalendar.d.ts +2 -2
  54. package/components/Forms/Picker/DatePicker/styles/StyledDatePickerHeader.d.ts +3 -3
  55. package/components/Forms/Picker/DatePicker/styles/StyledYear.d.ts +1 -1
  56. package/components/Forms/Picker/TimePicker/NumberPicker.d.ts +2 -2
  57. package/components/Forms/Picker/TimePicker/ToggleText.d.ts +2 -2
  58. package/components/Forms/Picker/TimePicker/styles/StyledSelectionItem.d.ts +1 -1
  59. package/components/Forms/Picker/TimePicker/styles/StyledTimeIconButton.d.ts +1 -1
  60. package/components/Forms/Picker/styles/PickerBaseIconButton.d.ts +1 -1
  61. package/components/Forms/Picker/styles/StyledPickerTextField.d.ts +1 -1
  62. package/components/Forms/Picker/styles/StyledPopover.d.ts +1 -1
  63. package/components/Forms/Picker/utils/PickerTextField/PickerTextField.d.ts +1 -1
  64. package/components/Forms/Radio/Radio.d.ts +1 -1
  65. package/components/Forms/RadioGroup/RadioGroup.d.ts +1 -1
  66. package/components/Forms/Select/PlainSelect/PlainSelect.d.ts +1 -1
  67. package/components/Forms/Select/Select.d.ts +1 -1
  68. package/components/Forms/Select/styles/SelectArrowDownIcon.d.ts +1 -1
  69. package/components/Forms/Select/utils/SelectInput/SelectInput.d.ts +1 -1
  70. package/components/Forms/Slider/Slider.d.ts +1 -1
  71. package/components/Forms/Switch/Switch.d.ts +1 -1
  72. package/components/Forms/TextField/TextField.d.ts +2 -2
  73. package/components/Forms/TextField/styles/ClearIconButton.d.ts +2 -2
  74. package/components/Forms/Textarea/Textarea.d.ts +1 -1
  75. package/components/Grid/Grid.d.ts +1 -1
  76. package/components/Icon/Icon.d.ts +2 -2
  77. package/components/Link/Link.d.ts +1 -1
  78. package/components/List/List/List.d.ts +1 -1
  79. package/components/List/ListItem/ListItem.d.ts +2 -2
  80. package/components/List/ListItemIcon/ListItemIcon.d.ts +1 -1
  81. package/components/List/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +1 -1
  82. package/components/List/ListItemText/ListItemText.d.ts +1 -1
  83. package/components/List/ListSubheader/ListSubheader.d.ts +1 -1
  84. package/components/Menu/Menu/Menu.d.ts +1 -1
  85. package/components/Menu/MenuItem/MenuItem.d.ts +3 -3
  86. package/components/Menu/MenuItem/styles/MenuItemStyle.d.ts +2 -2
  87. package/components/Menu/MenuItemSubAction/MenuItemSubAction.d.ts +1 -1
  88. package/components/Menu/MenuItemSubAction/styles/StyledMenuItemSubAction.d.ts +1 -1
  89. package/components/Menu/MenuList/MenuList.d.ts +1 -1
  90. package/components/Menu/MenuOption/styles/StyledMenuOption.d.ts +1 -1
  91. package/components/Menu/SubMenu/SubMenu.d.ts +1 -1
  92. package/components/Menu/SubMenu/styles/SubMenuStyle.d.ts +1 -1
  93. package/components/Pagination/Pagination/Pagination.d.ts +1 -1
  94. package/components/Pagination/PaginationItem/PaginationItem.d.ts +8 -8
  95. package/components/Paper/Paper.d.ts +1 -1
  96. package/components/Popover/Popover.d.ts +1 -1
  97. package/components/Popper/Popper.d.ts +1 -1
  98. package/components/PopupBox/PopupBox.d.ts +1 -1
  99. package/components/Presence/Presence.d.ts +2 -2
  100. package/components/Progress/CircularProgress/CircularProgress.d.ts +1 -1
  101. package/components/Progress/LinearProgress/LinearProgress.d.ts +1 -1
  102. package/components/Progress/styles/StyledCircularProgress.d.ts +1 -1
  103. package/components/Rating/Rating.d.ts +1 -1
  104. package/components/Snackbar/Snackbar.d.ts +1 -1
  105. package/components/Snackbar/SnackbarAction/SnackbarAction.d.ts +1 -1
  106. package/components/Snackbar/SnackbarContent/SnackbarContent.d.ts +1 -1
  107. package/components/Stepper/Step/Step.d.ts +1 -1
  108. package/components/Stepper/StepButton/StepButton.d.ts +1 -1
  109. package/components/Stepper/StepConnector/StepConnector.d.ts +1 -1
  110. package/components/Stepper/StepContent/StepContent.d.ts +1 -1
  111. package/components/Stepper/StepIcon/StepIcon.d.ts +1 -1
  112. package/components/Stepper/StepIcon/styles/StyledCircleIcon.d.ts +1 -1
  113. package/components/Stepper/StepLabel/StepLabel.d.ts +1 -1
  114. package/components/Stepper/Stepper.d.ts +1 -1
  115. package/components/Table/Table.d.ts +1 -1
  116. package/components/Table/TableBody/TableBody.d.ts +1 -1
  117. package/components/Table/TableCell/TableCell.d.ts +2 -2
  118. package/components/Table/TableContainer/TableContainer.d.ts +1 -1
  119. package/components/Table/TableHead/TableHead.d.ts +1 -1
  120. package/components/Table/TableRow/TableRow.d.ts +1 -1
  121. package/components/TablePagination/TablePagination.d.ts +1 -1
  122. package/components/TablePagination/styles/TablePaginationStyle.d.ts +6 -6
  123. package/components/Tabs/Tab/Tab.d.ts +1 -1
  124. package/components/Tabs/TabList/TabList.d.ts +1 -1
  125. package/components/Tabs/TabPanel/TabPanel.d.ts +1 -1
  126. package/components/Tabs/Tabs/MoreMenuTab/MoreMenuTab.d.ts +1 -1
  127. package/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.d.ts +1 -1
  128. package/components/Tabs/Tabs/Tabs.d.ts +1 -1
  129. package/components/Tag/Tag.d.ts +2 -2
  130. package/components/Text/Text.d.ts +1 -1
  131. package/components/Thumbnail/Thumbnail.d.ts +1 -1
  132. package/components/Toolbar/Toolbar.d.ts +1 -1
  133. package/components/Tooltip/Tooltip.d.ts +1 -1
  134. package/components/Typography/Typography.d.ts +1 -1
  135. package/components/VirtualizedMenu/VirtualizedDivider/VirtualizedDivider.d.ts +1 -1
  136. package/components/VirtualizedMenu/VirtualizedMenu.d.ts +1 -1
  137. package/components/VirtualizedMenu/VirtualizedMenuList.d.ts +1 -1
  138. package/components/Virtuoso/index.d.ts +1 -1
  139. package/components/Virtuoso/index.js +1 -1
  140. package/components/Virtuoso/react-virtuoso/AATree.d.ts +1 -1
  141. package/components/Virtuoso/react-virtuoso/AATree.js +60 -48
  142. package/components/Virtuoso/react-virtuoso/TableVirtuoso.d.ts +5 -0
  143. package/components/Virtuoso/react-virtuoso/TableVirtuoso.js +217 -0
  144. package/components/Virtuoso/react-virtuoso/Virtuoso.d.ts +7696 -0
  145. package/components/Virtuoso/react-virtuoso/Virtuoso.js +317 -0
  146. package/components/Virtuoso/react-virtuoso/{Grid.d.ts → VirtuosoGrid.d.ts} +182 -84
  147. package/components/Virtuoso/react-virtuoso/VirtuosoGrid.js +199 -0
  148. package/components/Virtuoso/react-virtuoso/alignToBottomSystem.d.ts +119 -65
  149. package/components/Virtuoso/react-virtuoso/alignToBottomSystem.js +3 -3
  150. package/components/Virtuoso/react-virtuoso/comparators.d.ts +1 -1
  151. package/components/Virtuoso/react-virtuoso/comparators.js +1 -3
  152. package/components/Virtuoso/react-virtuoso/component-interfaces/TableVirtuoso.d.ts +194 -0
  153. package/components/Virtuoso/react-virtuoso/component-interfaces/TableVirtuoso.js +2 -0
  154. package/components/Virtuoso/react-virtuoso/component-interfaces/Virtuoso.d.ts +274 -0
  155. package/components/Virtuoso/react-virtuoso/component-interfaces/Virtuoso.js +2 -0
  156. package/components/Virtuoso/react-virtuoso/component-interfaces/VirtuosoGrid.d.ts +125 -0
  157. package/components/Virtuoso/react-virtuoso/component-interfaces/VirtuosoGrid.js +2 -0
  158. package/components/Virtuoso/react-virtuoso/domIOSystem.d.ts +3 -2
  159. package/components/Virtuoso/react-virtuoso/domIOSystem.js +5 -3
  160. package/components/Virtuoso/react-virtuoso/followOutputSystem.d.ts +80 -43
  161. package/components/Virtuoso/react-virtuoso/followOutputSystem.js +21 -19
  162. package/components/Virtuoso/react-virtuoso/gridSystem.d.ts +57 -31
  163. package/components/Virtuoso/react-virtuoso/gridSystem.js +173 -86
  164. package/components/Virtuoso/react-virtuoso/groupedListSystem.d.ts +76 -67
  165. package/components/Virtuoso/react-virtuoso/groupedListSystem.js +12 -12
  166. package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.d.ts +6 -3
  167. package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +36 -17
  168. package/components/Virtuoso/react-virtuoso/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
  169. package/components/Virtuoso/react-virtuoso/hooks/useIsomorphicLayoutEffect.js +3 -2
  170. package/components/Virtuoso/react-virtuoso/hooks/useRcPortalWindowContext.d.ts +2 -0
  171. package/components/Virtuoso/react-virtuoso/hooks/useRcPortalWindowContext.js +5 -0
  172. package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.d.ts +2 -3
  173. package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +36 -51
  174. package/components/Virtuoso/react-virtuoso/hooks/useSize.d.ts +2 -3
  175. package/components/Virtuoso/react-virtuoso/hooks/useSize.js +13 -13
  176. package/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +17 -15
  177. package/components/Virtuoso/react-virtuoso/index.d.ts +7 -1
  178. package/components/Virtuoso/react-virtuoso/index.js +8 -1
  179. package/components/Virtuoso/react-virtuoso/initialItemCountSystem.d.ts +304 -68
  180. package/components/Virtuoso/react-virtuoso/initialItemCountSystem.js +9 -31
  181. package/components/Virtuoso/react-virtuoso/initialScrollTopSystem.d.ts +127 -109
  182. package/components/Virtuoso/react-virtuoso/initialScrollTopSystem.js +7 -7
  183. package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.d.ts +38 -22
  184. package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +13 -20
  185. package/components/Virtuoso/react-virtuoso/interfaces.d.ts +150 -51
  186. package/components/Virtuoso/react-virtuoso/listStateSystem.d.ts +109 -59
  187. package/components/Virtuoso/react-virtuoso/listStateSystem.js +100 -52
  188. package/components/Virtuoso/react-virtuoso/listSystem.d.ts +1691 -693
  189. package/components/Virtuoso/react-virtuoso/listSystem.js +15 -16
  190. package/components/Virtuoso/react-virtuoso/loggerSystem.d.ts +1 -1
  191. package/components/Virtuoso/react-virtuoso/loggerSystem.js +2 -4
  192. package/components/Virtuoso/react-virtuoso/propsReadySystem.d.ts +1 -1
  193. package/components/Virtuoso/react-virtuoso/propsReadySystem.js +3 -4
  194. package/components/Virtuoso/react-virtuoso/react-urx/index.d.ts +110 -0
  195. package/components/Virtuoso/react-virtuoso/react-urx/index.js +200 -0
  196. package/components/Virtuoso/react-virtuoso/react-urx/package.json +5 -0
  197. package/components/Virtuoso/react-virtuoso/recalcSystem.d.ts +4 -0
  198. package/components/Virtuoso/react-virtuoso/recalcSystem.js +8 -0
  199. package/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.d.ts +144 -78
  200. package/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.js +33 -21
  201. package/components/Virtuoso/react-virtuoso/scrollSeekSystem.d.ts +12 -7
  202. package/components/Virtuoso/react-virtuoso/scrollSeekSystem.js +7 -10
  203. package/components/Virtuoso/react-virtuoso/scrollToIndexSystem.d.ts +19 -11
  204. package/components/Virtuoso/react-virtuoso/scrollToIndexSystem.js +11 -23
  205. package/components/Virtuoso/react-virtuoso/sizeRangeSystem.d.ts +7 -6
  206. package/components/Virtuoso/react-virtuoso/sizeRangeSystem.js +15 -27
  207. package/components/Virtuoso/react-virtuoso/sizeSystem.d.ts +20 -11
  208. package/components/Virtuoso/react-virtuoso/sizeSystem.js +182 -52
  209. package/components/Virtuoso/react-virtuoso/stateFlagsSystem.d.ts +8 -5
  210. package/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +32 -23
  211. package/components/Virtuoso/react-virtuoso/stateLoadSystem.d.ts +318 -0
  212. package/components/Virtuoso/react-virtuoso/stateLoadSystem.js +41 -0
  213. package/components/Virtuoso/react-virtuoso/topItemCountSystem.d.ts +518 -467
  214. package/components/Virtuoso/react-virtuoso/topItemCountSystem.js +5 -5
  215. package/components/Virtuoso/react-virtuoso/totalListHeightSystem.d.ts +115 -63
  216. package/components/Virtuoso/react-virtuoso/totalListHeightSystem.js +6 -13
  217. package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.d.ts +139 -73
  218. package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +74 -31
  219. package/components/Virtuoso/react-virtuoso/urx/actions.d.ts +127 -0
  220. package/components/Virtuoso/react-virtuoso/urx/actions.js +98 -0
  221. package/components/Virtuoso/react-virtuoso/urx/constants.d.ts +8 -0
  222. package/components/Virtuoso/react-virtuoso/urx/constants.js +6 -0
  223. package/components/Virtuoso/react-virtuoso/urx/index.d.ts +6 -0
  224. package/components/Virtuoso/react-virtuoso/urx/index.js +9 -0
  225. package/components/Virtuoso/react-virtuoso/urx/package.json +5 -0
  226. package/components/Virtuoso/react-virtuoso/urx/pipe.d.ts +220 -0
  227. package/components/Virtuoso/react-virtuoso/urx/pipe.js +279 -0
  228. package/components/Virtuoso/react-virtuoso/urx/streams.d.ts +143 -0
  229. package/components/Virtuoso/react-virtuoso/urx/streams.js +227 -0
  230. package/components/Virtuoso/react-virtuoso/urx/system.d.ts +148 -0
  231. package/components/Virtuoso/react-virtuoso/urx/system.js +106 -0
  232. package/components/Virtuoso/react-virtuoso/urx/transformers.d.ts +71 -0
  233. package/components/Virtuoso/react-virtuoso/urx/transformers.js +106 -0
  234. package/components/Virtuoso/react-virtuoso/urx/utils.d.ts +57 -0
  235. package/components/Virtuoso/react-virtuoso/urx/utils.js +102 -0
  236. package/components/Virtuoso/react-virtuoso/utils/approximatelyEqual.d.ts +1 -0
  237. package/components/Virtuoso/react-virtuoso/utils/approximatelyEqual.js +6 -0
  238. package/components/Virtuoso/react-virtuoso/utils/context.d.ts +13 -0
  239. package/components/Virtuoso/react-virtuoso/utils/context.js +6 -0
  240. package/components/Virtuoso/react-virtuoso/utils/skipFrames.d.ts +1 -0
  241. package/components/Virtuoso/react-virtuoso/utils/skipFrames.js +11 -0
  242. package/components/Virtuoso/react-virtuoso/windowScrollerSystem.d.ts +6 -4
  243. package/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +1 -1
  244. package/components/Virtuoso/utils/isOutOfRange.d.ts +1 -1
  245. package/components/Virtuoso/utils/useHighlightScroll.d.ts +2 -2
  246. package/es6/components/Dialer/DialDelete/DialDelete.js +1 -1
  247. package/es6/components/Virtuoso/index.js +1 -1
  248. package/es6/components/Virtuoso/react-virtuoso/AATree.js +60 -48
  249. package/es6/components/Virtuoso/react-virtuoso/{Table.js → TableVirtuoso.js} +73 -52
  250. package/es6/components/Virtuoso/react-virtuoso/{List.js → Virtuoso.js} +85 -161
  251. package/es6/components/Virtuoso/react-virtuoso/VirtuosoGrid.js +198 -0
  252. package/es6/components/Virtuoso/react-virtuoso/alignToBottomSystem.js +3 -3
  253. package/es6/components/Virtuoso/react-virtuoso/comparators.js +1 -3
  254. package/es6/components/Virtuoso/react-virtuoso/component-interfaces/TableVirtuoso.js +0 -0
  255. package/es6/components/Virtuoso/react-virtuoso/component-interfaces/Virtuoso.js +0 -0
  256. package/es6/components/Virtuoso/react-virtuoso/component-interfaces/VirtuosoGrid.js +0 -0
  257. package/es6/components/Virtuoso/react-virtuoso/domIOSystem.js +5 -3
  258. package/es6/components/Virtuoso/react-virtuoso/followOutputSystem.js +21 -19
  259. package/es6/components/Virtuoso/react-virtuoso/gridSystem.js +173 -87
  260. package/es6/components/Virtuoso/react-virtuoso/groupedListSystem.js +13 -13
  261. package/es6/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +35 -16
  262. package/es6/components/Virtuoso/react-virtuoso/hooks/useIsomorphicLayoutEffect.js +2 -2
  263. package/es6/components/Virtuoso/react-virtuoso/hooks/useRcPortalWindowContext.js +2 -0
  264. package/es6/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +35 -50
  265. package/es6/components/Virtuoso/react-virtuoso/hooks/useSize.js +11 -12
  266. package/es6/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +15 -14
  267. package/es6/components/Virtuoso/react-virtuoso/index.js +4 -1
  268. package/es6/components/Virtuoso/react-virtuoso/initialItemCountSystem.js +11 -33
  269. package/es6/components/Virtuoso/react-virtuoso/initialScrollTopSystem.js +7 -7
  270. package/es6/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +13 -20
  271. package/es6/components/Virtuoso/react-virtuoso/listStateSystem.js +101 -54
  272. package/es6/components/Virtuoso/react-virtuoso/listSystem.js +15 -16
  273. package/es6/components/Virtuoso/react-virtuoso/loggerSystem.js +2 -4
  274. package/es6/components/Virtuoso/react-virtuoso/propsReadySystem.js +3 -4
  275. package/es6/components/Virtuoso/react-virtuoso/react-urx/index.js +197 -0
  276. package/es6/components/Virtuoso/react-virtuoso/recalcSystem.js +5 -0
  277. package/es6/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.js +34 -22
  278. package/es6/components/Virtuoso/react-virtuoso/scrollSeekSystem.js +7 -10
  279. package/es6/components/Virtuoso/react-virtuoso/scrollToIndexSystem.js +11 -23
  280. package/es6/components/Virtuoso/react-virtuoso/sizeRangeSystem.js +16 -28
  281. package/es6/components/Virtuoso/react-virtuoso/sizeSystem.js +180 -53
  282. package/es6/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +32 -23
  283. package/es6/components/Virtuoso/react-virtuoso/stateLoadSystem.js +39 -0
  284. package/es6/components/Virtuoso/react-virtuoso/topItemCountSystem.js +5 -5
  285. package/es6/components/Virtuoso/react-virtuoso/totalListHeightSystem.js +6 -13
  286. package/es6/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +75 -32
  287. package/es6/components/Virtuoso/react-virtuoso/urx/actions.js +90 -0
  288. package/es6/components/Virtuoso/react-virtuoso/urx/constants.js +4 -0
  289. package/es6/components/Virtuoso/react-virtuoso/urx/index.js +6 -0
  290. package/es6/components/Virtuoso/react-virtuoso/urx/pipe.js +266 -0
  291. package/es6/components/Virtuoso/react-virtuoso/urx/streams.js +220 -0
  292. package/es6/components/Virtuoso/react-virtuoso/urx/system.js +102 -0
  293. package/es6/components/Virtuoso/react-virtuoso/urx/transformers.js +101 -0
  294. package/es6/components/Virtuoso/react-virtuoso/urx/utils.js +88 -0
  295. package/es6/components/Virtuoso/react-virtuoso/utils/approximatelyEqual.js +3 -0
  296. package/es6/components/Virtuoso/react-virtuoso/utils/context.js +3 -0
  297. package/es6/components/Virtuoso/react-virtuoso/utils/skipFrames.js +8 -0
  298. package/es6/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +1 -1
  299. package/foundation/hooks/useKeyboardMoveFocus/useOnlyOneFocusable.d.ts +1 -1
  300. package/package.json +2 -2
  301. package/components/Virtuoso/Virtuoso.d.ts +0 -1
  302. package/components/Virtuoso/Virtuoso.js +0 -4
  303. package/components/Virtuoso/react-virtuoso/Grid.js +0 -168
  304. package/components/Virtuoso/react-virtuoso/List.d.ts +0 -6749
  305. package/components/Virtuoso/react-virtuoso/List.js +0 -393
  306. package/components/Virtuoso/react-virtuoso/Table.d.ts +0 -6515
  307. package/components/Virtuoso/react-virtuoso/Table.js +0 -196
  308. package/components/Virtuoso/react-virtuoso/components.d.ts +0 -505
  309. package/components/Virtuoso/react-virtuoso/components.js +0 -9
  310. package/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.d.ts +0 -1
  311. package/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.js +0 -11
  312. package/es6/components/Virtuoso/Virtuoso.js +0 -1
  313. package/es6/components/Virtuoso/react-virtuoso/Grid.js +0 -166
  314. package/es6/components/Virtuoso/react-virtuoso/components.js +0 -7
  315. package/es6/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.js +0 -8
@@ -1,16 +1,12 @@
1
1
  import { __assign, __read, __rest } from "tslib";
2
- import * as u from '@virtuoso.dev/urx';
3
- import { alignToBottomSystem } from './alignToBottomSystem';
2
+ import * as u from './urx';
4
3
  import { domIOSystem } from './domIOSystem';
5
4
  import { followOutputSystem } from './followOutputSystem';
6
5
  import { groupedListSystem } from './groupedListSystem';
7
6
  import { initialItemCountSystem } from './initialItemCountSystem';
8
- import { initialScrollTopSystem } from './initialScrollTopSystem';
9
7
  import { initialTopMostItemIndexSystem } from './initialTopMostItemIndexSystem';
10
8
  import { listStateSystem } from './listStateSystem';
11
- import { loggerSystem } from './loggerSystem';
12
9
  import { propsReadySystem } from './propsReadySystem';
13
- import { scrollIntoViewSystem } from './scrollIntoViewSystem';
14
10
  import { scrollSeekSystem } from './scrollSeekSystem';
15
11
  import { scrollToIndexSystem } from './scrollToIndexSystem';
16
12
  import { sizeRangeSystem } from './sizeRangeSystem';
@@ -18,18 +14,21 @@ import { sizeSystem } from './sizeSystem';
18
14
  import { topItemCountSystem } from './topItemCountSystem';
19
15
  import { totalListHeightSystem } from './totalListHeightSystem';
20
16
  import { upwardScrollFixSystem } from './upwardScrollFixSystem';
17
+ import { initialScrollTopSystem } from './initialScrollTopSystem';
18
+ import { alignToBottomSystem } from './alignToBottomSystem';
21
19
  import { windowScrollerSystem } from './windowScrollerSystem';
22
- // workaround the growing list of systems below
23
- // fix this with 4.1 recursive conditional types
20
+ import { loggerSystem } from './loggerSystem';
21
+ import { scrollIntoViewSystem } from './scrollIntoViewSystem';
22
+ import { stateLoadSystem } from './stateLoadSystem';
24
23
  var featureGroup1System = u.system(function (_a) {
25
- var _b = __read(_a, 9), sizeRange = _b[0], initialItemCount = _b[1], propsReady = _b[2], scrollSeek = _b[3], totalListHeight = _b[4], initialScrollTopSystem = _b[5], alignToBottom = _b[6], windowScroller = _b[7], scrollIntoView = _b[8];
26
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, sizeRange), initialItemCount), propsReady), scrollSeek), totalListHeight), initialScrollTopSystem), alignToBottom), windowScroller), scrollIntoView);
27
- }, u.tup(sizeRangeSystem, initialItemCountSystem, propsReadySystem, scrollSeekSystem, totalListHeightSystem, initialScrollTopSystem, alignToBottomSystem, windowScrollerSystem, scrollIntoViewSystem));
24
+ var _b = __read(_a, 10), sizeRange = _b[0], initialItemCount = _b[1], propsReady = _b[2], scrollSeek = _b[3], totalListHeight = _b[4], initialScrollTopSystem = _b[5], alignToBottom = _b[6], windowScroller = _b[7], scrollIntoView = _b[8], logger = _b[9];
25
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, sizeRange), initialItemCount), propsReady), scrollSeek), totalListHeight), initialScrollTopSystem), alignToBottom), windowScroller), scrollIntoView), logger);
26
+ }, u.tup(sizeRangeSystem, initialItemCountSystem, propsReadySystem, scrollSeekSystem, totalListHeightSystem, initialScrollTopSystem, alignToBottomSystem, windowScrollerSystem, scrollIntoViewSystem, loggerSystem));
28
27
  export var listSystem = u.system(function (_a) {
29
- var _b = _a, _c = __read(_b, 11), _d = _c[0], totalCount = _d.totalCount, sizeRanges = _d.sizeRanges, fixedItemSize = _d.fixedItemSize, defaultItemSize = _d.defaultItemSize, trackItemSizes = _d.trackItemSizes, itemSize = _d.itemSize, data = _d.data, firstItemIndex = _d.firstItemIndex, groupIndices = _d.groupIndices, statefulTotalCount = _d.statefulTotalCount, _e = _c[1], initialTopMostItemIndex = _e.initialTopMostItemIndex, scrolledToInitialItem = _e.scrolledToInitialItem, domIO = _c[2], followOutput = _c[3], _f = _c[4], scrollToIndex = _c[5].scrollToIndex, topItemCount = _c[7].topItemCount, groupCounts = _c[8].groupCounts, featureGroup1 = _c[9], log = _c[10], listState = _f.listState, topItemsIndexes = _f.topItemsIndexes, flags = __rest(_f, ["listState", "topItemsIndexes"]);
28
+ var _b = _a, _c = __read(_b, 11), _d = _c[0], totalCount = _d.totalCount, sizeRanges = _d.sizeRanges, fixedItemSize = _d.fixedItemSize, defaultItemSize = _d.defaultItemSize, trackItemSizes = _d.trackItemSizes, itemSize = _d.itemSize, data = _d.data, firstItemIndex = _d.firstItemIndex, groupIndices = _d.groupIndices, statefulTotalCount = _d.statefulTotalCount, gap = _d.gap, sizes = _d.sizes, _e = _c[1], initialTopMostItemIndex = _e.initialTopMostItemIndex, scrolledToInitialItem = _e.scrolledToInitialItem, domIO = _c[2], stateLoad = _c[3], followOutput = _c[4], _f = _c[5], scrollToIndex = _c[6].scrollToIndex, _ = _c[7], topItemCount = _c[8].topItemCount, groupCounts = _c[9].groupCounts, featureGroup1 = _c[10], listState = _f.listState, topItemsIndexes = _f.topItemsIndexes, flags = __rest(_f, ["listState", "topItemsIndexes"]);
30
29
  u.connect(flags.rangeChanged, featureGroup1.scrollSeekRangeChanged);
31
- u.connect(u.pipe(featureGroup1.windowViewportRect, u.map(u.prop('visibleHeight'))), domIO.viewportHeight);
32
- return __assign(__assign(__assign(__assign(__assign(__assign({
30
+ u.connect(u.pipe(featureGroup1.windowViewportRect, u.map(function (value) { return value.visibleHeight; })), domIO.viewportHeight);
31
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign({
33
32
  // input
34
33
  totalCount: totalCount,
35
34
  data: data,
@@ -39,12 +38,12 @@ export var listSystem = u.system(function (_a) {
39
38
  scrolledToInitialItem: scrolledToInitialItem,
40
39
  topItemsIndexes: topItemsIndexes,
41
40
  topItemCount: topItemCount,
42
- groupCounts: groupCounts, fixedItemHeight: fixedItemSize, defaultItemHeight: defaultItemSize }, followOutput), {
41
+ groupCounts: groupCounts, fixedItemHeight: fixedItemSize, defaultItemHeight: defaultItemSize, gap: gap }, followOutput), {
43
42
  // output
44
43
  statefulTotalCount: statefulTotalCount,
45
44
  listState: listState,
46
45
  scrollToIndex: scrollToIndex,
47
46
  trackItemSizes: trackItemSizes,
48
47
  itemSize: itemSize,
49
- groupIndices: groupIndices }), flags), featureGroup1), domIO), log);
50
- }, u.tup(sizeSystem, initialTopMostItemIndexSystem, domIOSystem, followOutputSystem, listStateSystem, scrollToIndexSystem, upwardScrollFixSystem, topItemCountSystem, groupedListSystem, featureGroup1System, loggerSystem));
48
+ groupIndices: groupIndices }), flags), featureGroup1), domIO), { sizes: sizes }), stateLoad);
49
+ }, u.tup(sizeSystem, initialTopMostItemIndexSystem, domIOSystem, stateLoadSystem, followOutputSystem, listStateSystem, scrollToIndexSystem, upwardScrollFixSystem, topItemCountSystem, groupedListSystem, featureGroup1System));
@@ -1,5 +1,5 @@
1
1
  var _a;
2
- import * as u from '@virtuoso.dev/urx';
2
+ import * as u from './urx';
3
3
  export var LogLevel;
4
4
  (function (LogLevel) {
5
5
  LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
@@ -13,9 +13,7 @@ var CONSOLE_METHOD_MAP = (_a = {},
13
13
  _a[LogLevel.WARN] = 'warn',
14
14
  _a[LogLevel.ERROR] = 'error',
15
15
  _a);
16
- var getGlobalThis = function () {
17
- return typeof globalThis === 'undefined' ? window : globalThis;
18
- };
16
+ var getGlobalThis = function () { return (typeof globalThis === 'undefined' ? window : globalThis); };
19
17
  export var loggerSystem = u.system(function () {
20
18
  var logLevel = u.statefulStream(LogLevel.ERROR);
21
19
  var log = u.statefulStream(function (label, message, level) {
@@ -1,13 +1,12 @@
1
1
  import { __read } from "tslib";
2
- import * as u from '@virtuoso.dev/urx';
3
- import { getValue, tup } from '@virtuoso.dev/urx';
2
+ import * as u from './urx';
4
3
  import { loggerSystem, LogLevel } from './loggerSystem';
5
4
  export var propsReadySystem = u.system(function (_a) {
6
5
  var _b = __read(_a, 1), log = _b[0].log;
7
6
  var propsReady = u.statefulStream(false);
8
7
  var didMount = u.streamFromEmitter(u.pipe(propsReady, u.filter(function (ready) { return ready; }), u.distinctUntilChanged()));
9
8
  u.subscribe(propsReady, function (value) {
10
- value && getValue(log)('props updated', {}, LogLevel.DEBUG);
9
+ value && u.getValue(log)('props updated', {}, LogLevel.DEBUG);
11
10
  });
12
11
  return { propsReady: propsReady, didMount: didMount };
13
- }, tup(loggerSystem), { singleton: true });
12
+ }, u.tup(loggerSystem), { singleton: true });
@@ -0,0 +1,197 @@
1
+ import { __read, __rest, __spread, __values } from "tslib";
2
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
4
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
5
+ /**
6
+ * `@virtuoso.dev/react-urx` exports the [[systemToComponent]] function.
7
+ * It wraps urx systems in to UI **logic provider components**,
8
+ * mapping the system input and output streams to the component input / output points.
9
+ *
10
+ * ### Simple System wrapped as React Component
11
+ *
12
+ * ```tsx
13
+ * const sys = system(() => {
14
+ * const foo = statefulStream(42)
15
+ * return { foo }
16
+ * })
17
+ *
18
+ * const { Component: MyComponent, useEmitterValue } = systemToComponent(sys, {
19
+ * required: { fooProp: 'foo' },
20
+ * })
21
+ *
22
+ * const Child = () => {
23
+ * const foo = useEmitterValue('foo')
24
+ * return <div>{foo}</div>
25
+ * }
26
+ *
27
+ * const App = () => {
28
+ * return <Comp fooProp={42}><Child /><Comp>
29
+ * }
30
+ * ```
31
+ *
32
+ * @packageDocumentation
33
+ */
34
+ import React from 'react';
35
+ import * as u from '../urx';
36
+ /** @internal */
37
+ function omit(keys, obj) {
38
+ var result = {};
39
+ var index = {};
40
+ var idx = 0;
41
+ var len = keys.length;
42
+ while (idx < len) {
43
+ index[keys[idx]] = 1;
44
+ idx += 1;
45
+ }
46
+ for (var prop in obj) {
47
+ if (!index.hasOwnProperty(prop)) {
48
+ result[prop] = obj[prop];
49
+ }
50
+ }
51
+ return result;
52
+ }
53
+ var useIsomorphicLayoutEffect = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
54
+ /**
55
+ * Converts a system spec to React component by mapping the system streams to component properties, events and methods. Returns hooks for querying and modifying
56
+ * the system streams from the component's child components.
57
+ * @param systemSpec The return value from a [[system]] call.
58
+ * @param map The streams to props / events / methods mapping Check [[SystemPropsMap]] for more details.
59
+ * @param Root The optional React component to render. By default, the resulting component renders nothing, acting as a logical wrapper for its children.
60
+ * @returns an object containing the following:
61
+ * - `Component`: the React component.
62
+ * - `useEmitterValue`: a hook that lets child components use values emitted from the specified output stream.
63
+ * - `useEmitter`: a hook that calls the provided callback whenever the specified stream emits a value.
64
+ * - `usePublisher`: a hook which lets child components publish values to the specified stream.
65
+ * <hr />
66
+ */
67
+ export function systemToComponent(systemSpec, map, Root) {
68
+ var requiredPropNames = Object.keys(map.required || {});
69
+ var optionalPropNames = Object.keys(map.optional || {});
70
+ var methodNames = Object.keys(map.methods || {});
71
+ var eventNames = Object.keys(map.events || {});
72
+ var Context = React.createContext({});
73
+ function applyPropsToSystem(system, props) {
74
+ var e_1, _a, e_2, _b;
75
+ if (system['propsReady']) {
76
+ u.publish(system['propsReady'], false);
77
+ }
78
+ try {
79
+ for (var requiredPropNames_1 = __values(requiredPropNames), requiredPropNames_1_1 = requiredPropNames_1.next(); !requiredPropNames_1_1.done; requiredPropNames_1_1 = requiredPropNames_1.next()) {
80
+ var requiredPropName = requiredPropNames_1_1.value;
81
+ var stream = system[map.required[requiredPropName]];
82
+ u.publish(stream, props[requiredPropName]);
83
+ }
84
+ }
85
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
86
+ finally {
87
+ try {
88
+ if (requiredPropNames_1_1 && !requiredPropNames_1_1.done && (_a = requiredPropNames_1.return)) _a.call(requiredPropNames_1);
89
+ }
90
+ finally { if (e_1) throw e_1.error; }
91
+ }
92
+ try {
93
+ for (var optionalPropNames_1 = __values(optionalPropNames), optionalPropNames_1_1 = optionalPropNames_1.next(); !optionalPropNames_1_1.done; optionalPropNames_1_1 = optionalPropNames_1.next()) {
94
+ var optionalPropName = optionalPropNames_1_1.value;
95
+ if (optionalPropName in props) {
96
+ var stream = system[map.optional[optionalPropName]];
97
+ u.publish(stream, props[optionalPropName]);
98
+ }
99
+ }
100
+ }
101
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
102
+ finally {
103
+ try {
104
+ if (optionalPropNames_1_1 && !optionalPropNames_1_1.done && (_b = optionalPropNames_1.return)) _b.call(optionalPropNames_1);
105
+ }
106
+ finally { if (e_2) throw e_2.error; }
107
+ }
108
+ if (system['propsReady']) {
109
+ u.publish(system['propsReady'], true);
110
+ }
111
+ }
112
+ function buildMethods(system) {
113
+ return methodNames.reduce(function (acc, methodName) {
114
+ ;
115
+ acc[methodName] = function (value) {
116
+ var stream = system[map.methods[methodName]];
117
+ u.publish(stream, value);
118
+ };
119
+ return acc;
120
+ }, {});
121
+ }
122
+ function buildEventHandlers(system) {
123
+ return eventNames.reduce(function (handlers, eventName) {
124
+ handlers[eventName] = u.eventHandler(system[map.events[eventName]]);
125
+ return handlers;
126
+ }, {});
127
+ }
128
+ /**
129
+ * A React component generated from an urx system
130
+ */
131
+ // eslint-disable-next-line react/display-name
132
+ var Component = React.forwardRef(function (propsWithChildren, ref) {
133
+ var _a = propsWithChildren, children = _a.children, props = __rest(_a, ["children"]);
134
+ var _b = __read(React.useState(function () {
135
+ return u.tap(u.init(systemSpec), function (system) { return applyPropsToSystem(system, props); });
136
+ }), 1), system = _b[0];
137
+ var _c = __read(React.useState(u.curry1to0(buildEventHandlers, system)), 1), handlers = _c[0];
138
+ useIsomorphicLayoutEffect(function () {
139
+ var e_3, _a;
140
+ try {
141
+ for (var eventNames_1 = __values(eventNames), eventNames_1_1 = eventNames_1.next(); !eventNames_1_1.done; eventNames_1_1 = eventNames_1.next()) {
142
+ var eventName = eventNames_1_1.value;
143
+ if (eventName in props) {
144
+ u.subscribe(handlers[eventName], props[eventName]);
145
+ }
146
+ }
147
+ }
148
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
149
+ finally {
150
+ try {
151
+ if (eventNames_1_1 && !eventNames_1_1.done && (_a = eventNames_1.return)) _a.call(eventNames_1);
152
+ }
153
+ finally { if (e_3) throw e_3.error; }
154
+ }
155
+ return function () {
156
+ Object.values(handlers).map(u.reset);
157
+ };
158
+ }, [props, handlers, system]);
159
+ useIsomorphicLayoutEffect(function () {
160
+ applyPropsToSystem(system, props);
161
+ });
162
+ React.useImperativeHandle(ref, u.always(buildMethods(system)));
163
+ return React.createElement(Context.Provider, { value: system }, Root
164
+ ? React.createElement(Root, omit(__spread(requiredPropNames, optionalPropNames, eventNames), props), children)
165
+ : children);
166
+ });
167
+ var usePublisher = function (key) {
168
+ return React.useCallback(u.curry2to1(u.publish, React.useContext(Context)[key]), [key]);
169
+ };
170
+ /**
171
+ * Returns the value emitted from the stream.
172
+ */
173
+ var useEmitterValue = function (key) {
174
+ var system = React.useContext(Context);
175
+ var source = system[key];
176
+ var _a = __read(React.useState(u.curry1to0(u.getValue, source)), 2), value = _a[0], setValue = _a[1];
177
+ useIsomorphicLayoutEffect(function () {
178
+ return u.subscribe(source, function (next) {
179
+ if (next !== value) {
180
+ setValue(u.always(next));
181
+ }
182
+ });
183
+ }, [source, value]);
184
+ return value;
185
+ };
186
+ var useEmitter = function (key, callback) {
187
+ var context = React.useContext(Context);
188
+ var source = context[key];
189
+ useIsomorphicLayoutEffect(function () { return u.subscribe(source, callback); }, [callback, source]);
190
+ };
191
+ return {
192
+ Component: Component,
193
+ usePublisher: usePublisher,
194
+ useEmitterValue: useEmitterValue,
195
+ useEmitter: useEmitter,
196
+ };
197
+ }
@@ -0,0 +1,5 @@
1
+ import * as u from './urx';
2
+ export var recalcSystem = u.system(function () {
3
+ var recalcInProgress = u.statefulStream(false);
4
+ return { recalcInProgress: recalcInProgress };
5
+ }, [], { singleton: true });
@@ -1,33 +1,45 @@
1
- import { __read } from "tslib";
2
- import * as u from '@virtuoso.dev/urx';
1
+ import { __assign, __read, __rest } from "tslib";
2
+ import * as u from './urx';
3
3
  import { findMaxKeyValue } from './AATree';
4
4
  import { domIOSystem } from './domIOSystem';
5
- import { listStateSystem } from './listStateSystem';
5
+ import { offsetOf, originalIndexFromLocation, sizeSystem } from './sizeSystem';
6
6
  import { loggerSystem } from './loggerSystem';
7
7
  import { scrollToIndexSystem } from './scrollToIndexSystem';
8
- import { offsetOf, originalIndexFromItemIndex, sizeSystem } from './sizeSystem';
8
+ import { listStateSystem } from './listStateSystem';
9
+ var defaultCalculateViewLocation = function (_a) {
10
+ var itemTop = _a.itemTop, itemBottom = _a.itemBottom, viewportTop = _a.viewportTop, viewportBottom = _a.viewportBottom, _b = _a.locationParams, behavior = _b.behavior, align = _b.align, rest = __rest(_b, ["behavior", "align"]);
11
+ if (itemTop < viewportTop) {
12
+ return __assign(__assign({}, rest), { behavior: behavior, align: align !== null && align !== void 0 ? align : 'start' });
13
+ }
14
+ if (itemBottom > viewportBottom) {
15
+ return __assign(__assign({}, rest), { behavior: behavior, align: align !== null && align !== void 0 ? align : 'end' });
16
+ }
17
+ return null;
18
+ };
9
19
  export var scrollIntoViewSystem = u.system(function (_a) {
10
- var _b = __read(_a, 3), _c = _b[0], sizes = _c.sizes, totalCount = _c.totalCount, _d = _b[1], scrollTop = _d.scrollTop, viewportHeight = _d.viewportHeight, headerHeight = _d.headerHeight, scrollingInProgress = _d.scrollingInProgress, scrollToIndex = _b[2].scrollToIndex;
20
+ var _b = __read(_a, 3), _c = _b[0], sizes = _c.sizes, totalCount = _c.totalCount, gap = _c.gap, _d = _b[1], scrollTop = _d.scrollTop, viewportHeight = _d.viewportHeight, headerHeight = _d.headerHeight, fixedHeaderHeight = _d.fixedHeaderHeight, fixedFooterHeight = _d.fixedFooterHeight, scrollingInProgress = _d.scrollingInProgress, scrollToIndex = _b[2].scrollToIndex;
11
21
  var scrollIntoView = u.stream();
12
- u.connect(u.pipe(scrollIntoView, u.withLatestFrom(sizes, viewportHeight, totalCount, headerHeight, scrollTop), u.map(function (_a) {
13
- var _b = __read(_a, 6), _c = _b[0], index = _c.index, _d = _c.behavior, behavior = _d === void 0 ? 'auto' : _d, done = _c.done, sizes = _b[1], viewportHeight = _b[2], totalCount = _b[3], headerHeight = _b[4], scrollTop = _b[5];
14
- var lastIndex = totalCount - 1;
15
- var location = null;
16
- index = originalIndexFromItemIndex(index, sizes);
17
- index = Math.max(0, index, Math.min(lastIndex, index));
18
- var itemTop = offsetOf(index, sizes.offsetTree) + headerHeight;
19
- if (itemTop < scrollTop) {
20
- location = { index: index, behavior: behavior, align: 'start' };
21
- }
22
- else {
23
- var itemBottom = itemTop + findMaxKeyValue(sizes.sizeTree, index)[1];
24
- if (itemBottom > scrollTop + viewportHeight) {
25
- location = { index: index, behavior: behavior, align: 'end' };
26
- }
27
- }
22
+ u.connect(u.pipe(scrollIntoView, u.withLatestFrom(sizes, viewportHeight, totalCount, headerHeight, fixedHeaderHeight, fixedFooterHeight, scrollTop), u.withLatestFrom(gap), u.map(function (_a) {
23
+ var _b = __read(_a, 2), _c = __read(_b[0], 8), viewLocation = _c[0], sizes = _c[1], viewportHeight = _c[2], totalCount = _c[3], headerHeight = _c[4], fixedHeaderHeight = _c[5], fixedFooterHeight = _c[6], scrollTop = _c[7], gap = _b[1];
24
+ var done = viewLocation.done, behavior = viewLocation.behavior, align = viewLocation.align, _d = viewLocation.calculateViewLocation, calculateViewLocation = _d === void 0 ? defaultCalculateViewLocation : _d, rest = __rest(viewLocation, ["done", "behavior", "align", "calculateViewLocation"]);
25
+ var actualIndex = originalIndexFromLocation(viewLocation, sizes, totalCount - 1);
26
+ var itemTop = offsetOf(actualIndex, sizes.offsetTree, gap) + headerHeight + fixedHeaderHeight;
27
+ var itemBottom = itemTop + findMaxKeyValue(sizes.sizeTree, actualIndex)[1];
28
+ var viewportTop = scrollTop + fixedHeaderHeight;
29
+ var viewportBottom = scrollTop + viewportHeight - fixedFooterHeight;
30
+ var location = calculateViewLocation({
31
+ itemTop: itemTop,
32
+ itemBottom: itemBottom,
33
+ viewportTop: viewportTop,
34
+ viewportBottom: viewportBottom,
35
+ locationParams: __assign({ behavior: behavior, align: align }, rest),
36
+ });
28
37
  if (location) {
29
38
  done &&
30
- u.handleNext(u.pipe(scrollingInProgress, u.skip(1), u.filter(function (value) { return value === false; })), done);
39
+ u.handleNext(u.pipe(scrollingInProgress, u.filter(function (value) { return value === false; }),
40
+ // skips the initial publish of false, and the cleanup call.
41
+ // but if scrollingInProgress is true, we skip the initial publish.
42
+ u.skip(u.getValue(scrollingInProgress) ? 1 : 2)), done);
31
43
  }
32
44
  else {
33
45
  done && done();
@@ -1,5 +1,5 @@
1
1
  import { __read } from "tslib";
2
- import * as u from '@virtuoso.dev/urx';
2
+ import * as u from './urx';
3
3
  import { stateFlagsSystem } from './stateFlagsSystem';
4
4
  export var scrollSeekSystem = u.system(function (_a) {
5
5
  var _b = __read(_a, 1), scrollVelocity = _b[0].scrollVelocity;
@@ -7,7 +7,7 @@ export var scrollSeekSystem = u.system(function (_a) {
7
7
  var rangeChanged = u.stream();
8
8
  var scrollSeekConfiguration = u.statefulStream(false);
9
9
  u.connect(u.pipe(scrollVelocity, u.withLatestFrom(scrollSeekConfiguration, isSeeking, rangeChanged), u.filter(function (_a) {
10
- var _b = __read(_a, 2), config = _b[1];
10
+ var _b = __read(_a, 2), _ = _b[0], config = _b[1];
11
11
  return !!config;
12
12
  }), u.map(function (_a) {
13
13
  var _b = __read(_a, 4), speed = _b[0], config = _b[1], isSeeking = _b[2], range = _b[3];
@@ -17,8 +17,10 @@ export var scrollSeekSystem = u.system(function (_a) {
17
17
  return false;
18
18
  }
19
19
  }
20
- else if (enter(speed, range)) {
21
- return true;
20
+ else {
21
+ if (enter(speed, range)) {
22
+ return true;
23
+ }
22
24
  }
23
25
  return isSeeking;
24
26
  }), u.distinctUntilChanged()), isSeeking);
@@ -26,10 +28,5 @@ export var scrollSeekSystem = u.system(function (_a) {
26
28
  var _b = __read(_a, 2), _c = __read(_b[0], 3), isSeeking = _c[0], velocity = _c[1], range = _c[2], config = _b[1];
27
29
  return isSeeking && config && config.change && config.change(velocity, range);
28
30
  });
29
- return {
30
- isSeeking: isSeeking,
31
- scrollSeekConfiguration: scrollSeekConfiguration,
32
- scrollVelocity: scrollVelocity,
33
- scrollSeekRangeChanged: rangeChanged,
34
- };
31
+ return { isSeeking: isSeeking, scrollSeekConfiguration: scrollSeekConfiguration, scrollVelocity: scrollVelocity, scrollSeekRangeChanged: rangeChanged };
35
32
  }, u.tup(stateFlagsSystem), { singleton: true });
@@ -1,12 +1,11 @@
1
1
  import { __read } from "tslib";
2
2
  /* eslint-disable @typescript-eslint/no-unsafe-call */
3
- import * as u from '@virtuoso.dev/urx';
3
+ import * as u from './urx';
4
4
  import { findMaxKeyValue } from './AATree';
5
5
  import { domIOSystem } from './domIOSystem';
6
+ import { offsetOf, originalIndexFromLocation, sizeSystem } from './sizeSystem';
6
7
  import { loggerSystem, LogLevel } from './loggerSystem';
7
- import { offsetOf, originalIndexFromItemIndex, sizeSystem } from './sizeSystem';
8
- var SUPPORTS_SCROLL_TO_OPTIONS = typeof document !== 'undefined' &&
9
- 'scrollBehavior' in document.documentElement.style;
8
+ var SUPPORTS_SCROLL_TO_OPTIONS = typeof document !== 'undefined' && 'scrollBehavior' in document.documentElement.style;
10
9
  export function normalizeIndexLocation(location) {
11
10
  var result = typeof location === 'number' ? { index: location } : location;
12
11
  if (!result.align) {
@@ -21,7 +20,7 @@ export function normalizeIndexLocation(location) {
21
20
  return result;
22
21
  }
23
22
  export var scrollToIndexSystem = u.system(function (_a) {
24
- var _b = __read(_a, 3), _c = _b[0], sizes = _c.sizes, totalCount = _c.totalCount, listRefresh = _c.listRefresh, _d = _b[1], scrollingInProgress = _d.scrollingInProgress, viewportHeight = _d.viewportHeight, scrollTo = _d.scrollTo, smoothScrollTargetReached = _d.smoothScrollTargetReached, headerHeight = _d.headerHeight, footerHeight = _d.footerHeight, log = _b[2].log;
23
+ var _b = __read(_a, 3), _c = _b[0], sizes = _c.sizes, totalCount = _c.totalCount, listRefresh = _c.listRefresh, gap = _c.gap, _d = _b[1], scrollingInProgress = _d.scrollingInProgress, viewportHeight = _d.viewportHeight, scrollTo = _d.scrollTo, smoothScrollTargetReached = _d.smoothScrollTargetReached, headerHeight = _d.headerHeight, footerHeight = _d.footerHeight, fixedHeaderHeight = _d.fixedHeaderHeight, fixedFooterHeight = _d.fixedFooterHeight, log = _b[2].log;
25
24
  var scrollToIndex = u.stream();
26
25
  var topListHeight = u.statefulStream(0);
27
26
  var unsubscribeNextListRefresh = null;
@@ -42,32 +41,21 @@ export var scrollToIndexSystem = u.system(function (_a) {
42
41
  }
43
42
  u.publish(scrollingInProgress, false);
44
43
  }
45
- u.connect(u.pipe(scrollToIndex, u.withLatestFrom(sizes, viewportHeight, totalCount, topListHeight, headerHeight, footerHeight, log), u.map(function (_a) {
46
- var _b = __read(_a, 8), location = _b[0], sizes = _b[1], viewportHeight = _b[2], totalCount = _b[3], topListHeight = _b[4], headerHeight = _b[5], footerHeight = _b[6], log = _b[7];
44
+ u.connect(u.pipe(scrollToIndex, u.withLatestFrom(sizes, viewportHeight, totalCount, topListHeight, headerHeight, footerHeight, log), u.withLatestFrom(gap, fixedHeaderHeight, fixedFooterHeight), u.map(function (_a) {
45
+ var _b = __read(_a, 4), _c = __read(_b[0], 8), location = _c[0], sizes = _c[1], viewportHeight = _c[2], totalCount = _c[3], topListHeight = _c[4], headerHeight = _c[5], footerHeight = _c[6], log = _c[7], gap = _b[1], fixedHeaderHeight = _b[2], fixedFooterHeight = _b[3];
47
46
  var normalLocation = normalizeIndexLocation(location);
48
47
  var align = normalLocation.align, behavior = normalLocation.behavior, offset = normalLocation.offset;
49
48
  var lastIndex = totalCount - 1;
50
- var index = normalLocation.index;
51
- if (index === 'LAST') {
52
- index = lastIndex;
53
- }
54
- index = originalIndexFromItemIndex(index, sizes);
55
- index = Math.max(0, index, Math.min(lastIndex, index));
56
- var top = offsetOf(index, sizes.offsetTree) + headerHeight;
49
+ var index = originalIndexFromLocation(normalLocation, sizes, lastIndex);
50
+ var top = offsetOf(index, sizes.offsetTree, gap) + headerHeight;
57
51
  if (align === 'end') {
58
- top =
59
- top -
60
- viewportHeight +
61
- findMaxKeyValue(sizes.sizeTree, index)[1];
52
+ top += fixedHeaderHeight + findMaxKeyValue(sizes.sizeTree, index)[1] - viewportHeight + fixedFooterHeight;
62
53
  if (index === lastIndex) {
63
54
  top += footerHeight;
64
55
  }
65
56
  }
66
57
  else if (align === 'center') {
67
- top =
68
- top -
69
- viewportHeight / 2 +
70
- findMaxKeyValue(sizes.sizeTree, index)[1] / 2;
58
+ top += (fixedHeaderHeight + findMaxKeyValue(sizes.sizeTree, index)[1] - viewportHeight + fixedFooterHeight) / 2;
71
59
  }
72
60
  else {
73
61
  top -= topListHeight;
@@ -96,7 +84,7 @@ export var scrollToIndexSystem = u.system(function (_a) {
96
84
  });
97
85
  }
98
86
  else {
99
- unsubscribeNextListRefresh = u.handleNext(u.pipe(listRefresh, watchChangesFor(50)), retry);
87
+ unsubscribeNextListRefresh = u.handleNext(u.pipe(listRefresh, watchChangesFor(150)), retry);
100
88
  }
101
89
  // if the scroll jump is too small, the list won't get rerendered.
102
90
  // clean this listener
@@ -1,37 +1,35 @@
1
1
  import { __read } from "tslib";
2
- import * as u from '@virtuoso.dev/urx';
3
- import { tupleComparator } from './comparators';
2
+ import * as u from './urx';
4
3
  import { domIOSystem } from './domIOSystem';
5
- import { DOWN, UP } from './stateFlagsSystem';
4
+ import { UP, DOWN } from './stateFlagsSystem';
5
+ import { tupleComparator } from './comparators';
6
6
  export var TOP = 'top';
7
7
  export var BOTTOM = 'bottom';
8
8
  export var NONE = 'none';
9
9
  export function getOverscan(overscan, end, direction) {
10
10
  if (typeof overscan === 'number') {
11
- return (direction === UP && end === TOP) ||
12
- (direction === DOWN && end === BOTTOM)
13
- ? overscan
14
- : 0;
11
+ return (direction === UP && end === TOP) || (direction === DOWN && end === BOTTOM) ? overscan : 0;
15
12
  }
16
- if (direction === UP) {
17
- return end === TOP ? overscan.main : overscan.reverse;
13
+ else {
14
+ if (direction === UP) {
15
+ return end === TOP ? overscan.main : overscan.reverse;
16
+ }
17
+ else {
18
+ return end === BOTTOM ? overscan.main : overscan.reverse;
19
+ }
18
20
  }
19
- return end === BOTTOM ? overscan.main : overscan.reverse;
20
21
  }
21
22
  function getViewportIncrease(value, end) {
22
23
  return typeof value === 'number' ? value : value[end] || 0;
23
24
  }
24
25
  export var sizeRangeSystem = u.system(function (_a) {
25
- var _b = __read(_a, 1), _c = _b[0], scrollTop = _c.scrollTop, viewportHeight = _c.viewportHeight, deviation = _c.deviation, headerHeight = _c.headerHeight;
26
+ var _b = __read(_a, 1), _c = _b[0], scrollTop = _c.scrollTop, viewportHeight = _c.viewportHeight, deviation = _c.deviation, headerHeight = _c.headerHeight, fixedHeaderHeight = _c.fixedHeaderHeight;
26
27
  var listBoundary = u.stream();
27
28
  var topListHeight = u.statefulStream(0);
28
- var fixedHeaderHeight = u.statefulStream(0);
29
29
  var increaseViewportBy = u.statefulStream(0);
30
30
  var overscan = u.statefulStream(0);
31
31
  var visibleRange = u.statefulStreamFromEmitter(u.pipe(u.combineLatest(u.duc(scrollTop), u.duc(viewportHeight), u.duc(headerHeight), u.duc(listBoundary, tupleComparator), u.duc(overscan), u.duc(topListHeight), u.duc(fixedHeaderHeight), u.duc(deviation), u.duc(increaseViewportBy)), u.map(function (_a) {
32
- var _b = __read(_a, 9), scrollTop = _b[0], viewportHeight = _b[1], headerHeight = _b[2],
33
- // @ts-ignore
34
- _c = __read(_b[3], 2), listTop = _c[0], listBottom = _c[1], overscan = _b[4], topListHeight = _b[5], fixedHeaderHeight = _b[6], deviation = _b[7], increaseViewportBy = _b[8];
32
+ var _b = __read(_a, 9), scrollTop = _b[0], viewportHeight = _b[1], headerHeight = _b[2], _c = __read(_b[3], 2), listTop = _c[0], listBottom = _c[1], overscan = _b[4], topListHeight = _b[5], fixedHeaderHeight = _b[6], deviation = _b[7], increaseViewportBy = _b[8];
35
33
  var top = scrollTop - deviation;
36
34
  var stickyHeaderHeight = topListHeight + fixedHeaderHeight;
37
35
  var headerVisible = Math.max(headerHeight - top, 0);
@@ -42,24 +40,15 @@ export var sizeRangeSystem = u.system(function (_a) {
42
40
  listTop += headerHeight + fixedHeaderHeight;
43
41
  listBottom += headerHeight + fixedHeaderHeight;
44
42
  listBottom -= deviation;
45
- // console.log({ listTop, scrollTop, stickyHeaderHeight, topViewportAddition })
46
- if (listTop >
47
- scrollTop + stickyHeaderHeight - topViewportAddition) {
43
+ if (listTop > scrollTop + stickyHeaderHeight - topViewportAddition) {
48
44
  direction = UP;
49
45
  }
50
- if (listBottom <
51
- scrollTop -
52
- headerVisible +
53
- viewportHeight +
54
- bottomViewportAddition) {
46
+ if (listBottom < scrollTop - headerVisible + viewportHeight + bottomViewportAddition) {
55
47
  direction = DOWN;
56
48
  }
57
49
  if (direction !== NONE) {
58
50
  return [
59
- Math.max(top -
60
- headerHeight -
61
- getOverscan(overscan, TOP, direction) -
62
- topViewportAddition, 0),
51
+ Math.max(top - headerHeight - getOverscan(overscan, TOP, direction) - topViewportAddition, 0),
63
52
  top -
64
53
  headerVisible -
65
54
  fixedHeaderHeight +
@@ -75,7 +64,6 @@ export var sizeRangeSystem = u.system(function (_a) {
75
64
  listBoundary: listBoundary,
76
65
  overscan: overscan,
77
66
  topListHeight: topListHeight,
78
- fixedHeaderHeight: fixedHeaderHeight,
79
67
  increaseViewportBy: increaseViewportBy,
80
68
  // output
81
69
  visibleRange: visibleRange,