@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.
- package/components/Accordion/Accordion.d.ts +1 -1
- package/components/Accordion/AccordionDetails/AccordionDetails.d.ts +1 -1
- package/components/Accordion/AccordionSummary/AccordionSummary.d.ts +1 -1
- package/components/Alert/Alert.d.ts +1 -1
- package/components/AppBar/AppBar.d.ts +2 -2
- package/components/Avatar/styles/StyledAvatarWrapper.d.ts +1 -1
- package/components/Backdrop/Backdrop.d.ts +1 -1
- package/components/Badge/Badge.d.ts +1 -1
- package/components/Box/Box.d.ts +1 -1
- package/components/Buttons/Button/Button.d.ts +2 -2
- package/components/Buttons/ButtonBase/ButtonBase.d.ts +1 -1
- package/components/Buttons/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/components/Buttons/IconButton/IconButton.d.ts +2 -2
- package/components/Buttons/IconButtonGroup/IconButtonGroup.d.ts +1 -1
- package/components/Buttons/SplitButton/SplitButton.d.ts +1 -1
- package/components/Buttons/SplitButton/styles/StyledArrowIcon.d.ts +1 -1
- package/components/Buttons/ToggleButton/ToggleButton.d.ts +1 -1
- package/components/Buttons/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -1
- package/components/Card/Card/Card.d.ts +1 -1
- package/components/Card/CardActions/CardActions.d.ts +1 -1
- package/components/Card/CardContent/CardContent.d.ts +1 -1
- package/components/Card/CardHeader/CardHeader.d.ts +8 -8
- package/components/Card/CardHoverActions/CardHoverActions.d.ts +1 -1
- package/components/Card/CardMedia/CardMedia.d.ts +8 -8
- package/components/Card/CardSelectionArea/CardSelectionArea.d.ts +1 -1
- package/components/Dialer/DialDelete/DialDelete.d.ts +1 -0
- package/components/Dialer/DialDelete/DialDelete.js +1 -1
- package/components/Dialer/DialPad/DialPad.d.ts +4 -4
- package/components/Dialer/DialTextField/DialTextField.d.ts +1 -1
- package/components/Dialog/Dialog.d.ts +1 -1
- package/components/Dialog/DialogActions/DialogActions.d.ts +2 -2
- package/components/Dialog/DialogContent/DialogContent.d.ts +2 -2
- package/components/Dialog/DialogContentText/DialogContentText.d.ts +2 -2
- package/components/Dialog/DialogTitle/DialogTitle.d.ts +2 -2
- package/components/Divider/Divider.d.ts +1 -1
- package/components/Downshift/SuggestionList/SuggestionList.d.ts +3 -3
- package/components/Downshift/styles/DownshiftStyle.d.ts +2 -2
- package/components/Downshift/styles/StyledPopper.d.ts +1 -1
- package/components/Downshift/styles/StyledTextField.d.ts +1 -1
- package/components/Downshift/utils/useDownshift.d.ts +3 -3
- package/components/Downshift/utils/useDownshiftTag.d.ts +3 -3
- package/components/Drawer/Drawer.d.ts +1 -1
- package/components/Forms/Checkbox/Checkbox.d.ts +1 -1
- package/components/Forms/FormControl.d.ts +1 -1
- package/components/Forms/FormControlLabel/FormControlLabel.d.ts +1 -1
- package/components/Forms/FormGroup/FormGroup.d.ts +1 -1
- package/components/Forms/FormHelperText/FormHelperText.d.ts +1 -1
- package/components/Forms/FormHelperText/styles/StyledFormHelperText.d.ts +1 -1
- package/components/Forms/FormLabel.d.ts +1 -1
- package/components/Forms/InputLabel/InputLabel.d.ts +1 -1
- package/components/Forms/InputLabel/styles/StyledInputLabel.d.ts +1 -1
- package/components/Forms/Picker/DatePicker/DatePicker.d.ts +2 -2
- package/components/Forms/Picker/DatePicker/styles/StyledCalendar.d.ts +2 -2
- package/components/Forms/Picker/DatePicker/styles/StyledDatePickerHeader.d.ts +3 -3
- package/components/Forms/Picker/DatePicker/styles/StyledYear.d.ts +1 -1
- package/components/Forms/Picker/TimePicker/NumberPicker.d.ts +2 -2
- package/components/Forms/Picker/TimePicker/ToggleText.d.ts +2 -2
- package/components/Forms/Picker/TimePicker/styles/StyledSelectionItem.d.ts +1 -1
- package/components/Forms/Picker/TimePicker/styles/StyledTimeIconButton.d.ts +1 -1
- package/components/Forms/Picker/styles/PickerBaseIconButton.d.ts +1 -1
- package/components/Forms/Picker/styles/StyledPickerTextField.d.ts +1 -1
- package/components/Forms/Picker/styles/StyledPopover.d.ts +1 -1
- package/components/Forms/Picker/utils/PickerTextField/PickerTextField.d.ts +1 -1
- package/components/Forms/Radio/Radio.d.ts +1 -1
- package/components/Forms/RadioGroup/RadioGroup.d.ts +1 -1
- package/components/Forms/Select/PlainSelect/PlainSelect.d.ts +1 -1
- package/components/Forms/Select/Select.d.ts +1 -1
- package/components/Forms/Select/styles/SelectArrowDownIcon.d.ts +1 -1
- package/components/Forms/Select/utils/SelectInput/SelectInput.d.ts +1 -1
- package/components/Forms/Slider/Slider.d.ts +1 -1
- package/components/Forms/Switch/Switch.d.ts +1 -1
- package/components/Forms/TextField/TextField.d.ts +2 -2
- package/components/Forms/TextField/styles/ClearIconButton.d.ts +2 -2
- package/components/Forms/Textarea/Textarea.d.ts +1 -1
- package/components/Grid/Grid.d.ts +1 -1
- package/components/Icon/Icon.d.ts +2 -2
- package/components/Link/Link.d.ts +1 -1
- package/components/List/List/List.d.ts +1 -1
- package/components/List/ListItem/ListItem.d.ts +2 -2
- package/components/List/ListItemIcon/ListItemIcon.d.ts +1 -1
- package/components/List/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +1 -1
- package/components/List/ListItemText/ListItemText.d.ts +1 -1
- package/components/List/ListSubheader/ListSubheader.d.ts +1 -1
- package/components/Menu/Menu/Menu.d.ts +1 -1
- package/components/Menu/MenuItem/MenuItem.d.ts +3 -3
- package/components/Menu/MenuItem/styles/MenuItemStyle.d.ts +2 -2
- package/components/Menu/MenuItemSubAction/MenuItemSubAction.d.ts +1 -1
- package/components/Menu/MenuItemSubAction/styles/StyledMenuItemSubAction.d.ts +1 -1
- package/components/Menu/MenuList/MenuList.d.ts +1 -1
- package/components/Menu/MenuOption/styles/StyledMenuOption.d.ts +1 -1
- package/components/Menu/SubMenu/SubMenu.d.ts +1 -1
- package/components/Menu/SubMenu/styles/SubMenuStyle.d.ts +1 -1
- package/components/Pagination/Pagination/Pagination.d.ts +1 -1
- package/components/Pagination/PaginationItem/PaginationItem.d.ts +8 -8
- package/components/Paper/Paper.d.ts +1 -1
- package/components/Popover/Popover.d.ts +1 -1
- package/components/Popper/Popper.d.ts +1 -1
- package/components/PopupBox/PopupBox.d.ts +1 -1
- package/components/Presence/Presence.d.ts +2 -2
- package/components/Progress/CircularProgress/CircularProgress.d.ts +1 -1
- package/components/Progress/LinearProgress/LinearProgress.d.ts +1 -1
- package/components/Progress/styles/StyledCircularProgress.d.ts +1 -1
- package/components/Rating/Rating.d.ts +1 -1
- package/components/Snackbar/Snackbar.d.ts +1 -1
- package/components/Snackbar/SnackbarAction/SnackbarAction.d.ts +1 -1
- package/components/Snackbar/SnackbarContent/SnackbarContent.d.ts +1 -1
- package/components/Stepper/Step/Step.d.ts +1 -1
- package/components/Stepper/StepButton/StepButton.d.ts +1 -1
- package/components/Stepper/StepConnector/StepConnector.d.ts +1 -1
- package/components/Stepper/StepContent/StepContent.d.ts +1 -1
- package/components/Stepper/StepIcon/StepIcon.d.ts +1 -1
- package/components/Stepper/StepIcon/styles/StyledCircleIcon.d.ts +1 -1
- package/components/Stepper/StepLabel/StepLabel.d.ts +1 -1
- package/components/Stepper/Stepper.d.ts +1 -1
- package/components/Table/Table.d.ts +1 -1
- package/components/Table/TableBody/TableBody.d.ts +1 -1
- package/components/Table/TableCell/TableCell.d.ts +2 -2
- package/components/Table/TableContainer/TableContainer.d.ts +1 -1
- package/components/Table/TableHead/TableHead.d.ts +1 -1
- package/components/Table/TableRow/TableRow.d.ts +1 -1
- package/components/TablePagination/TablePagination.d.ts +1 -1
- package/components/TablePagination/styles/TablePaginationStyle.d.ts +6 -6
- package/components/Tabs/Tab/Tab.d.ts +1 -1
- package/components/Tabs/TabList/TabList.d.ts +1 -1
- package/components/Tabs/TabPanel/TabPanel.d.ts +1 -1
- package/components/Tabs/Tabs/MoreMenuTab/MoreMenuTab.d.ts +1 -1
- package/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.d.ts +1 -1
- package/components/Tabs/Tabs/Tabs.d.ts +1 -1
- package/components/Tag/Tag.d.ts +2 -2
- package/components/Text/Text.d.ts +1 -1
- package/components/Thumbnail/Thumbnail.d.ts +1 -1
- package/components/Toolbar/Toolbar.d.ts +1 -1
- package/components/Tooltip/Tooltip.d.ts +1 -1
- package/components/Typography/Typography.d.ts +1 -1
- package/components/VirtualizedMenu/VirtualizedDivider/VirtualizedDivider.d.ts +1 -1
- package/components/VirtualizedMenu/VirtualizedMenu.d.ts +1 -1
- package/components/VirtualizedMenu/VirtualizedMenuList.d.ts +1 -1
- package/components/Virtuoso/index.d.ts +1 -1
- package/components/Virtuoso/index.js +1 -1
- package/components/Virtuoso/react-virtuoso/AATree.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/AATree.js +60 -48
- package/components/Virtuoso/react-virtuoso/TableVirtuoso.d.ts +5 -0
- package/components/Virtuoso/react-virtuoso/TableVirtuoso.js +217 -0
- package/components/Virtuoso/react-virtuoso/Virtuoso.d.ts +7696 -0
- package/components/Virtuoso/react-virtuoso/Virtuoso.js +317 -0
- package/components/Virtuoso/react-virtuoso/{Grid.d.ts → VirtuosoGrid.d.ts} +182 -84
- package/components/Virtuoso/react-virtuoso/VirtuosoGrid.js +199 -0
- package/components/Virtuoso/react-virtuoso/alignToBottomSystem.d.ts +119 -65
- package/components/Virtuoso/react-virtuoso/alignToBottomSystem.js +3 -3
- package/components/Virtuoso/react-virtuoso/comparators.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/comparators.js +1 -3
- package/components/Virtuoso/react-virtuoso/component-interfaces/TableVirtuoso.d.ts +194 -0
- package/components/Virtuoso/react-virtuoso/component-interfaces/TableVirtuoso.js +2 -0
- package/components/Virtuoso/react-virtuoso/component-interfaces/Virtuoso.d.ts +274 -0
- package/components/Virtuoso/react-virtuoso/component-interfaces/Virtuoso.js +2 -0
- package/components/Virtuoso/react-virtuoso/component-interfaces/VirtuosoGrid.d.ts +125 -0
- package/components/Virtuoso/react-virtuoso/component-interfaces/VirtuosoGrid.js +2 -0
- package/components/Virtuoso/react-virtuoso/domIOSystem.d.ts +3 -2
- package/components/Virtuoso/react-virtuoso/domIOSystem.js +5 -3
- package/components/Virtuoso/react-virtuoso/followOutputSystem.d.ts +80 -43
- package/components/Virtuoso/react-virtuoso/followOutputSystem.js +21 -19
- package/components/Virtuoso/react-virtuoso/gridSystem.d.ts +57 -31
- package/components/Virtuoso/react-virtuoso/gridSystem.js +173 -86
- package/components/Virtuoso/react-virtuoso/groupedListSystem.d.ts +76 -67
- package/components/Virtuoso/react-virtuoso/groupedListSystem.js +12 -12
- package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.d.ts +6 -3
- package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +36 -17
- package/components/Virtuoso/react-virtuoso/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
- package/components/Virtuoso/react-virtuoso/hooks/useIsomorphicLayoutEffect.js +3 -2
- package/components/Virtuoso/react-virtuoso/hooks/useRcPortalWindowContext.d.ts +2 -0
- package/components/Virtuoso/react-virtuoso/hooks/useRcPortalWindowContext.js +5 -0
- package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.d.ts +2 -3
- package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +36 -51
- package/components/Virtuoso/react-virtuoso/hooks/useSize.d.ts +2 -3
- package/components/Virtuoso/react-virtuoso/hooks/useSize.js +13 -13
- package/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +17 -15
- package/components/Virtuoso/react-virtuoso/index.d.ts +7 -1
- package/components/Virtuoso/react-virtuoso/index.js +8 -1
- package/components/Virtuoso/react-virtuoso/initialItemCountSystem.d.ts +304 -68
- package/components/Virtuoso/react-virtuoso/initialItemCountSystem.js +9 -31
- package/components/Virtuoso/react-virtuoso/initialScrollTopSystem.d.ts +127 -109
- package/components/Virtuoso/react-virtuoso/initialScrollTopSystem.js +7 -7
- package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.d.ts +38 -22
- package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +13 -20
- package/components/Virtuoso/react-virtuoso/interfaces.d.ts +150 -51
- package/components/Virtuoso/react-virtuoso/listStateSystem.d.ts +109 -59
- package/components/Virtuoso/react-virtuoso/listStateSystem.js +100 -52
- package/components/Virtuoso/react-virtuoso/listSystem.d.ts +1691 -693
- package/components/Virtuoso/react-virtuoso/listSystem.js +15 -16
- package/components/Virtuoso/react-virtuoso/loggerSystem.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/loggerSystem.js +2 -4
- package/components/Virtuoso/react-virtuoso/propsReadySystem.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/propsReadySystem.js +3 -4
- package/components/Virtuoso/react-virtuoso/react-urx/index.d.ts +110 -0
- package/components/Virtuoso/react-virtuoso/react-urx/index.js +200 -0
- package/components/Virtuoso/react-virtuoso/react-urx/package.json +5 -0
- package/components/Virtuoso/react-virtuoso/recalcSystem.d.ts +4 -0
- package/components/Virtuoso/react-virtuoso/recalcSystem.js +8 -0
- package/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.d.ts +144 -78
- package/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.js +33 -21
- package/components/Virtuoso/react-virtuoso/scrollSeekSystem.d.ts +12 -7
- package/components/Virtuoso/react-virtuoso/scrollSeekSystem.js +7 -10
- package/components/Virtuoso/react-virtuoso/scrollToIndexSystem.d.ts +19 -11
- package/components/Virtuoso/react-virtuoso/scrollToIndexSystem.js +11 -23
- package/components/Virtuoso/react-virtuoso/sizeRangeSystem.d.ts +7 -6
- package/components/Virtuoso/react-virtuoso/sizeRangeSystem.js +15 -27
- package/components/Virtuoso/react-virtuoso/sizeSystem.d.ts +20 -11
- package/components/Virtuoso/react-virtuoso/sizeSystem.js +182 -52
- package/components/Virtuoso/react-virtuoso/stateFlagsSystem.d.ts +8 -5
- package/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +32 -23
- package/components/Virtuoso/react-virtuoso/stateLoadSystem.d.ts +318 -0
- package/components/Virtuoso/react-virtuoso/stateLoadSystem.js +41 -0
- package/components/Virtuoso/react-virtuoso/topItemCountSystem.d.ts +518 -467
- package/components/Virtuoso/react-virtuoso/topItemCountSystem.js +5 -5
- package/components/Virtuoso/react-virtuoso/totalListHeightSystem.d.ts +115 -63
- package/components/Virtuoso/react-virtuoso/totalListHeightSystem.js +6 -13
- package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.d.ts +139 -73
- package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +74 -31
- package/components/Virtuoso/react-virtuoso/urx/actions.d.ts +127 -0
- package/components/Virtuoso/react-virtuoso/urx/actions.js +98 -0
- package/components/Virtuoso/react-virtuoso/urx/constants.d.ts +8 -0
- package/components/Virtuoso/react-virtuoso/urx/constants.js +6 -0
- package/components/Virtuoso/react-virtuoso/urx/index.d.ts +6 -0
- package/components/Virtuoso/react-virtuoso/urx/index.js +9 -0
- package/components/Virtuoso/react-virtuoso/urx/package.json +5 -0
- package/components/Virtuoso/react-virtuoso/urx/pipe.d.ts +220 -0
- package/components/Virtuoso/react-virtuoso/urx/pipe.js +279 -0
- package/components/Virtuoso/react-virtuoso/urx/streams.d.ts +143 -0
- package/components/Virtuoso/react-virtuoso/urx/streams.js +227 -0
- package/components/Virtuoso/react-virtuoso/urx/system.d.ts +148 -0
- package/components/Virtuoso/react-virtuoso/urx/system.js +106 -0
- package/components/Virtuoso/react-virtuoso/urx/transformers.d.ts +71 -0
- package/components/Virtuoso/react-virtuoso/urx/transformers.js +106 -0
- package/components/Virtuoso/react-virtuoso/urx/utils.d.ts +57 -0
- package/components/Virtuoso/react-virtuoso/urx/utils.js +102 -0
- package/components/Virtuoso/react-virtuoso/utils/approximatelyEqual.d.ts +1 -0
- package/components/Virtuoso/react-virtuoso/utils/approximatelyEqual.js +6 -0
- package/components/Virtuoso/react-virtuoso/utils/context.d.ts +13 -0
- package/components/Virtuoso/react-virtuoso/utils/context.js +6 -0
- package/components/Virtuoso/react-virtuoso/utils/skipFrames.d.ts +1 -0
- package/components/Virtuoso/react-virtuoso/utils/skipFrames.js +11 -0
- package/components/Virtuoso/react-virtuoso/windowScrollerSystem.d.ts +6 -4
- package/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +1 -1
- package/components/Virtuoso/utils/isOutOfRange.d.ts +1 -1
- package/components/Virtuoso/utils/useHighlightScroll.d.ts +2 -2
- package/es6/components/Dialer/DialDelete/DialDelete.js +1 -1
- package/es6/components/Virtuoso/index.js +1 -1
- package/es6/components/Virtuoso/react-virtuoso/AATree.js +60 -48
- package/es6/components/Virtuoso/react-virtuoso/{Table.js → TableVirtuoso.js} +73 -52
- package/es6/components/Virtuoso/react-virtuoso/{List.js → Virtuoso.js} +85 -161
- package/es6/components/Virtuoso/react-virtuoso/VirtuosoGrid.js +198 -0
- package/es6/components/Virtuoso/react-virtuoso/alignToBottomSystem.js +3 -3
- package/es6/components/Virtuoso/react-virtuoso/comparators.js +1 -3
- package/es6/components/Virtuoso/react-virtuoso/component-interfaces/TableVirtuoso.js +0 -0
- package/es6/components/Virtuoso/react-virtuoso/component-interfaces/Virtuoso.js +0 -0
- package/es6/components/Virtuoso/react-virtuoso/component-interfaces/VirtuosoGrid.js +0 -0
- package/es6/components/Virtuoso/react-virtuoso/domIOSystem.js +5 -3
- package/es6/components/Virtuoso/react-virtuoso/followOutputSystem.js +21 -19
- package/es6/components/Virtuoso/react-virtuoso/gridSystem.js +173 -87
- package/es6/components/Virtuoso/react-virtuoso/groupedListSystem.js +13 -13
- package/es6/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +35 -16
- package/es6/components/Virtuoso/react-virtuoso/hooks/useIsomorphicLayoutEffect.js +2 -2
- package/es6/components/Virtuoso/react-virtuoso/hooks/useRcPortalWindowContext.js +2 -0
- package/es6/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +35 -50
- package/es6/components/Virtuoso/react-virtuoso/hooks/useSize.js +11 -12
- package/es6/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +15 -14
- package/es6/components/Virtuoso/react-virtuoso/index.js +4 -1
- package/es6/components/Virtuoso/react-virtuoso/initialItemCountSystem.js +11 -33
- package/es6/components/Virtuoso/react-virtuoso/initialScrollTopSystem.js +7 -7
- package/es6/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +13 -20
- package/es6/components/Virtuoso/react-virtuoso/listStateSystem.js +101 -54
- package/es6/components/Virtuoso/react-virtuoso/listSystem.js +15 -16
- package/es6/components/Virtuoso/react-virtuoso/loggerSystem.js +2 -4
- package/es6/components/Virtuoso/react-virtuoso/propsReadySystem.js +3 -4
- package/es6/components/Virtuoso/react-virtuoso/react-urx/index.js +197 -0
- package/es6/components/Virtuoso/react-virtuoso/recalcSystem.js +5 -0
- package/es6/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.js +34 -22
- package/es6/components/Virtuoso/react-virtuoso/scrollSeekSystem.js +7 -10
- package/es6/components/Virtuoso/react-virtuoso/scrollToIndexSystem.js +11 -23
- package/es6/components/Virtuoso/react-virtuoso/sizeRangeSystem.js +16 -28
- package/es6/components/Virtuoso/react-virtuoso/sizeSystem.js +180 -53
- package/es6/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +32 -23
- package/es6/components/Virtuoso/react-virtuoso/stateLoadSystem.js +39 -0
- package/es6/components/Virtuoso/react-virtuoso/topItemCountSystem.js +5 -5
- package/es6/components/Virtuoso/react-virtuoso/totalListHeightSystem.js +6 -13
- package/es6/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +75 -32
- package/es6/components/Virtuoso/react-virtuoso/urx/actions.js +90 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/constants.js +4 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/index.js +6 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/pipe.js +266 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/streams.js +220 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/system.js +102 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/transformers.js +101 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/utils.js +88 -0
- package/es6/components/Virtuoso/react-virtuoso/utils/approximatelyEqual.js +3 -0
- package/es6/components/Virtuoso/react-virtuoso/utils/context.js +3 -0
- package/es6/components/Virtuoso/react-virtuoso/utils/skipFrames.js +8 -0
- package/es6/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +1 -1
- package/foundation/hooks/useKeyboardMoveFocus/useOnlyOneFocusable.d.ts +1 -1
- package/package.json +2 -2
- package/components/Virtuoso/Virtuoso.d.ts +0 -1
- package/components/Virtuoso/Virtuoso.js +0 -4
- package/components/Virtuoso/react-virtuoso/Grid.js +0 -168
- package/components/Virtuoso/react-virtuoso/List.d.ts +0 -6749
- package/components/Virtuoso/react-virtuoso/List.js +0 -393
- package/components/Virtuoso/react-virtuoso/Table.d.ts +0 -6515
- package/components/Virtuoso/react-virtuoso/Table.js +0 -196
- package/components/Virtuoso/react-virtuoso/components.d.ts +0 -505
- package/components/Virtuoso/react-virtuoso/components.js +0 -9
- package/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.d.ts +0 -1
- package/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.js +0 -11
- package/es6/components/Virtuoso/Virtuoso.js +0 -1
- package/es6/components/Virtuoso/react-virtuoso/Grid.js +0 -166
- package/es6/components/Virtuoso/react-virtuoso/components.js +0 -7
- package/es6/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.js +0 -8
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
|
-
|
|
5
|
-
var u = tslib_1.__importStar(require("@virtuoso.dev/urx"));
|
|
4
|
+
var u = tslib_1.__importStar(require("./urx"));
|
|
6
5
|
var AATree_1 = require("./AATree");
|
|
7
|
-
var loggerSystem_1 = require("./loggerSystem");
|
|
8
6
|
var arrayBinarySearch = tslib_1.__importStar(require("./utils/binaryArraySearch"));
|
|
9
7
|
var correctItemSize_1 = require("./utils/correctItemSize");
|
|
8
|
+
var loggerSystem_1 = require("./loggerSystem");
|
|
9
|
+
var recalcSystem_1 = require("./recalcSystem");
|
|
10
10
|
function rangeIncludes(refRange) {
|
|
11
11
|
var size = refRange.size, startIndex = refRange.startIndex, endIndex = refRange.endIndex;
|
|
12
12
|
return function (range) {
|
|
13
|
-
return
|
|
14
|
-
(range.end === endIndex || range.end === Infinity) &&
|
|
15
|
-
range.value === size);
|
|
13
|
+
return range.start === startIndex && (range.end === endIndex || range.end === Infinity) && range.value === size;
|
|
16
14
|
};
|
|
17
15
|
}
|
|
16
|
+
function affectedGroupCount(offset, groupIndices) {
|
|
17
|
+
var recognizedOffsetItems = 0;
|
|
18
|
+
var groupIndex = 0;
|
|
19
|
+
while (recognizedOffsetItems < offset) {
|
|
20
|
+
recognizedOffsetItems += groupIndices[groupIndex + 1] - groupIndices[groupIndex] - 1;
|
|
21
|
+
groupIndex++;
|
|
22
|
+
}
|
|
23
|
+
var offsetIsExact = recognizedOffsetItems === offset;
|
|
24
|
+
return groupIndex - (offsetIsExact ? 0 : 1);
|
|
25
|
+
}
|
|
18
26
|
function insertRanges(sizeTree, ranges) {
|
|
19
27
|
var e_1, _a, e_2, _b;
|
|
20
28
|
var syncStart = AATree_1.empty(sizeTree) ? 0 : Infinity;
|
|
@@ -44,10 +52,12 @@ function insertRanges(sizeTree, ranges) {
|
|
|
44
52
|
shouldInsert = rangeValue !== size;
|
|
45
53
|
firstPassDone = true;
|
|
46
54
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
else {
|
|
56
|
+
// remove the range if it starts within the new range OR if
|
|
57
|
+
// it has the same value as it, in order to perform a merge
|
|
58
|
+
if (endIndex >= rangeStart || size === rangeValue) {
|
|
59
|
+
sizeTree = AATree_1.remove(sizeTree, rangeStart);
|
|
60
|
+
}
|
|
51
61
|
}
|
|
52
62
|
// next range
|
|
53
63
|
if (rangeEnd > endIndex && endIndex >= rangeStart) {
|
|
@@ -112,7 +122,7 @@ function rangesWithinOffsets(tree, startOffset, endOffset, minStartIndex) {
|
|
|
112
122
|
return AATree_1.arrayToRanges(arrayBinarySearch.findRange(tree, startOffset, endOffset, offsetComparator), offsetPointParser);
|
|
113
123
|
}
|
|
114
124
|
exports.rangesWithinOffsets = rangesWithinOffsets;
|
|
115
|
-
function createOffsetTree(prevOffsetTree, syncStart, sizeTree) {
|
|
125
|
+
function createOffsetTree(prevOffsetTree, syncStart, sizeTree, gap) {
|
|
116
126
|
var e_3, _a;
|
|
117
127
|
var offsetTree = prevOffsetTree;
|
|
118
128
|
var prevIndex = 0;
|
|
@@ -126,8 +136,7 @@ function createOffsetTree(prevOffsetTree, syncStart, sizeTree) {
|
|
|
126
136
|
var kv = AATree_1.findMaxKeyValue(sizeTree, syncStart - 1);
|
|
127
137
|
prevIndex = kv[0];
|
|
128
138
|
prevSize = kv[1];
|
|
129
|
-
if (offsetTree.length &&
|
|
130
|
-
offsetTree[startIndex].size === AATree_1.findMaxKeyValue(sizeTree, syncStart)[1]) {
|
|
139
|
+
if (offsetTree.length && offsetTree[startIndex].size === AATree_1.findMaxKeyValue(sizeTree, syncStart)[1]) {
|
|
131
140
|
startIndex -= 1;
|
|
132
141
|
}
|
|
133
142
|
offsetTree = offsetTree.slice(0, startIndex + 1);
|
|
@@ -138,7 +147,8 @@ function createOffsetTree(prevOffsetTree, syncStart, sizeTree) {
|
|
|
138
147
|
try {
|
|
139
148
|
for (var _b = tslib_1.__values(AATree_1.rangesWithin(sizeTree, syncStart, Infinity)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
140
149
|
var _d = _c.value, startIndex_1 = _d.start, value = _d.value;
|
|
141
|
-
var
|
|
150
|
+
var indexOffset = startIndex_1 - prevIndex;
|
|
151
|
+
var aOffset = indexOffset * prevSize + prevOffset + indexOffset * gap;
|
|
142
152
|
offsetTree.push({
|
|
143
153
|
offset: aOffset,
|
|
144
154
|
size: value,
|
|
@@ -165,7 +175,7 @@ function createOffsetTree(prevOffsetTree, syncStart, sizeTree) {
|
|
|
165
175
|
}
|
|
166
176
|
function sizeStateReducer(state, _a) {
|
|
167
177
|
var _b;
|
|
168
|
-
var _c = tslib_1.__read(_a,
|
|
178
|
+
var _c = tslib_1.__read(_a, 4), ranges = _c[0], groupIndices = _c[1], log = _c[2], gap = _c[3];
|
|
169
179
|
if (ranges.length > 0) {
|
|
170
180
|
log('received item sizes', ranges, loggerSystem_1.LogLevel.DEBUG);
|
|
171
181
|
}
|
|
@@ -183,12 +193,13 @@ function sizeStateReducer(state, _a) {
|
|
|
183
193
|
}, newSizeTree);
|
|
184
194
|
}
|
|
185
195
|
else {
|
|
196
|
+
;
|
|
186
197
|
_b = tslib_1.__read(insertRanges(newSizeTree, ranges), 2), newSizeTree = _b[0], syncStart = _b[1];
|
|
187
198
|
}
|
|
188
199
|
if (newSizeTree === sizeTree) {
|
|
189
200
|
return state;
|
|
190
201
|
}
|
|
191
|
-
var _d = createOffsetTree(state.offsetTree, syncStart, newSizeTree), newOffsetTree = _d.offsetTree, lastIndex = _d.lastIndex, lastSize = _d.lastSize, lastOffset = _d.lastOffset;
|
|
202
|
+
var _d = createOffsetTree(state.offsetTree, syncStart, newSizeTree, gap), newOffsetTree = _d.offsetTree, lastIndex = _d.lastIndex, lastSize = _d.lastSize, lastOffset = _d.lastOffset;
|
|
192
203
|
return {
|
|
193
204
|
sizeTree: newSizeTree,
|
|
194
205
|
offsetTree: newOffsetTree,
|
|
@@ -196,20 +207,41 @@ function sizeStateReducer(state, _a) {
|
|
|
196
207
|
lastOffset: lastOffset,
|
|
197
208
|
lastSize: lastSize,
|
|
198
209
|
groupOffsetTree: groupIndices.reduce(function (tree, index) {
|
|
199
|
-
return AATree_1.insert(tree, index, offsetOf(index, newOffsetTree));
|
|
210
|
+
return AATree_1.insert(tree, index, offsetOf(index, newOffsetTree, gap));
|
|
200
211
|
}, AATree_1.newTree()),
|
|
201
212
|
groupIndices: groupIndices,
|
|
202
213
|
};
|
|
203
214
|
}
|
|
204
215
|
exports.sizeStateReducer = sizeStateReducer;
|
|
205
|
-
function offsetOf(index, tree) {
|
|
216
|
+
function offsetOf(index, tree, gap) {
|
|
206
217
|
if (tree.length === 0) {
|
|
207
218
|
return 0;
|
|
208
219
|
}
|
|
209
220
|
var _a = arrayBinarySearch.findClosestSmallerOrEqual(tree, index, indexComparator), offset = _a.offset, startIndex = _a.index, size = _a.size;
|
|
210
|
-
|
|
221
|
+
var itemCount = index - startIndex;
|
|
222
|
+
var top = size * itemCount + (itemCount - 1) * gap + offset;
|
|
223
|
+
return top > 0 ? top + gap : top;
|
|
211
224
|
}
|
|
212
225
|
exports.offsetOf = offsetOf;
|
|
226
|
+
function isGroupLocation(location) {
|
|
227
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
228
|
+
return typeof location.groupIndex !== 'undefined';
|
|
229
|
+
}
|
|
230
|
+
exports.isGroupLocation = isGroupLocation;
|
|
231
|
+
function originalIndexFromLocation(location, sizes, lastIndex) {
|
|
232
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
233
|
+
if (isGroupLocation(location)) {
|
|
234
|
+
// return the index of the first item below the index
|
|
235
|
+
return sizes.groupIndices[location.groupIndex] + 1;
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
var numericIndex = location.index === 'LAST' ? lastIndex : location.index;
|
|
239
|
+
var result = originalIndexFromItemIndex(numericIndex, sizes);
|
|
240
|
+
result = Math.max(0, result, Math.min(lastIndex, result));
|
|
241
|
+
return result;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
exports.originalIndexFromLocation = originalIndexFromLocation;
|
|
213
245
|
function originalIndexFromItemIndex(itemIndex, sizes) {
|
|
214
246
|
if (!hasGroups(sizes)) {
|
|
215
247
|
return itemIndex;
|
|
@@ -226,12 +258,21 @@ function hasGroups(sizes) {
|
|
|
226
258
|
return !AATree_1.empty(sizes.groupOffsetTree);
|
|
227
259
|
}
|
|
228
260
|
exports.hasGroups = hasGroups;
|
|
261
|
+
function sizeTreeToRanges(sizeTree) {
|
|
262
|
+
return AATree_1.walk(sizeTree).map(function (_a, index, sizeArray) {
|
|
263
|
+
var startIndex = _a.k, size = _a.v;
|
|
264
|
+
var nextSize = sizeArray[index + 1];
|
|
265
|
+
var endIndex = nextSize ? nextSize.k - 1 : Infinity;
|
|
266
|
+
return { startIndex: startIndex, endIndex: endIndex, size: size };
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
exports.sizeTreeToRanges = sizeTreeToRanges;
|
|
229
270
|
var SIZE_MAP = {
|
|
230
271
|
offsetHeight: 'height',
|
|
231
272
|
offsetWidth: 'width',
|
|
232
273
|
};
|
|
233
274
|
exports.sizeSystem = u.system(function (_a) {
|
|
234
|
-
var _b = tslib_1.__read(_a,
|
|
275
|
+
var _b = tslib_1.__read(_a, 2), log = _b[0].log, recalcInProgress = _b[1].recalcInProgress;
|
|
235
276
|
var sizeRanges = u.stream();
|
|
236
277
|
var totalCount = u.stream();
|
|
237
278
|
var statefulTotalCount = u.statefulStreamFromEmitter(totalCount, 0);
|
|
@@ -241,22 +282,30 @@ exports.sizeSystem = u.system(function (_a) {
|
|
|
241
282
|
var groupIndices = u.statefulStream([]);
|
|
242
283
|
var fixedItemSize = u.statefulStream(undefined);
|
|
243
284
|
var defaultItemSize = u.statefulStream(undefined);
|
|
244
|
-
var itemSize = u.statefulStream(function (el, field) {
|
|
245
|
-
return correctItemSize_1.correctItemSize(el, SIZE_MAP[field]);
|
|
246
|
-
});
|
|
285
|
+
var itemSize = u.statefulStream(function (el, field) { return correctItemSize_1.correctItemSize(el, SIZE_MAP[field]); });
|
|
247
286
|
var data = u.statefulStream(undefined);
|
|
287
|
+
var gap = u.statefulStream(0);
|
|
248
288
|
var initial = initialSizeState();
|
|
249
|
-
var sizes = u.statefulStreamFromEmitter(u.pipe(sizeRanges, u.withLatestFrom(groupIndices, log), u.scan(sizeStateReducer, initial), u.distinctUntilChanged()), initial);
|
|
250
|
-
u.
|
|
251
|
-
|
|
289
|
+
var sizes = u.statefulStreamFromEmitter(u.pipe(sizeRanges, u.withLatestFrom(groupIndices, log, gap), u.scan(sizeStateReducer, initial), u.distinctUntilChanged()), initial);
|
|
290
|
+
var prevGroupIndices = u.statefulStreamFromEmitter(u.pipe(groupIndices, u.distinctUntilChanged(), u.scan(function (prev, curr) { return ({ prev: prev.current, current: curr }); }, {
|
|
291
|
+
prev: [],
|
|
292
|
+
current: [],
|
|
293
|
+
}), u.map(function (_a) {
|
|
294
|
+
var prev = _a.prev;
|
|
295
|
+
return prev;
|
|
296
|
+
})), []);
|
|
297
|
+
u.connect(u.pipe(groupIndices, u.filter(function (indexes) { return indexes.length > 0; }), u.withLatestFrom(sizes, gap), u.map(function (_a) {
|
|
298
|
+
var _b = tslib_1.__read(_a, 3), groupIndices = _b[0], sizes = _b[1], gap = _b[2];
|
|
252
299
|
var groupOffsetTree = groupIndices.reduce(function (tree, index, idx) {
|
|
253
|
-
return AATree_1.insert(tree, index, offsetOf(index, sizes.offsetTree) || idx);
|
|
300
|
+
return AATree_1.insert(tree, index, offsetOf(index, sizes.offsetTree, gap) || idx);
|
|
254
301
|
}, AATree_1.newTree());
|
|
255
302
|
return tslib_1.__assign(tslib_1.__assign({}, sizes), { groupIndices: groupIndices,
|
|
256
303
|
groupOffsetTree: groupOffsetTree });
|
|
257
304
|
})), sizes);
|
|
258
305
|
// decreasing the total count should remove any existing entries
|
|
259
306
|
// beyond the last index - do this by publishing the default size as a range over them.
|
|
307
|
+
// This causes some size loss in for the last items, but it's better than having the wrong measurements
|
|
308
|
+
// see #896
|
|
260
309
|
u.connect(u.pipe(totalCount, u.withLatestFrom(sizes), u.filter(function (_a) {
|
|
261
310
|
var _b = tslib_1.__read(_a, 2), totalCount = _b[0], lastIndex = _b[1].lastIndex;
|
|
262
311
|
return totalCount < lastIndex;
|
|
@@ -277,7 +326,7 @@ exports.sizeSystem = u.system(function (_a) {
|
|
|
277
326
|
}), u.map(function (size) { return [{ startIndex: 0, endIndex: 0, size: size }]; })), sizeRanges);
|
|
278
327
|
var listRefresh = u.streamFromEmitter(u.pipe(sizeRanges, u.withLatestFrom(sizes), u.scan(function (_a, _b) {
|
|
279
328
|
var oldSizes = _a.sizes;
|
|
280
|
-
var _c = tslib_1.__read(_b, 2), newSizes = _c[1];
|
|
329
|
+
var _c = tslib_1.__read(_b, 2), _ = _c[0], newSizes = _c[1];
|
|
281
330
|
return {
|
|
282
331
|
changed: newSizes !== oldSizes,
|
|
283
332
|
sizes: newSizes,
|
|
@@ -286,10 +335,16 @@ exports.sizeSystem = u.system(function (_a) {
|
|
|
286
335
|
u.subscribe(u.pipe(firstItemIndex, u.scan(function (prev, next) {
|
|
287
336
|
return { diff: prev.prev - next, prev: next };
|
|
288
337
|
}, { diff: 0, prev: 0 }), u.map(function (val) { return val.diff; })), function (offset) {
|
|
338
|
+
var groupIndices = u.getValue(sizes).groupIndices;
|
|
289
339
|
if (offset > 0) {
|
|
290
|
-
u.publish(
|
|
340
|
+
u.publish(recalcInProgress, true);
|
|
341
|
+
u.publish(unshiftWith, offset + affectedGroupCount(offset, groupIndices));
|
|
291
342
|
}
|
|
292
343
|
else if (offset < 0) {
|
|
344
|
+
var prevGroupIndicesValue = u.getValue(prevGroupIndices);
|
|
345
|
+
if (prevGroupIndicesValue.length > 0) {
|
|
346
|
+
offset -= affectedGroupCount(-offset, prevGroupIndicesValue);
|
|
347
|
+
}
|
|
293
348
|
u.publish(shiftWith, offset);
|
|
294
349
|
}
|
|
295
350
|
});
|
|
@@ -303,43 +358,117 @@ exports.sizeSystem = u.system(function (_a) {
|
|
|
303
358
|
var beforeUnshiftWith = u.streamFromEmitter(unshiftWith);
|
|
304
359
|
u.connect(u.pipe(unshiftWith, u.withLatestFrom(sizes), u.map(function (_a) {
|
|
305
360
|
var _b = tslib_1.__read(_a, 2), unshiftWith = _b[0], sizes = _b[1];
|
|
306
|
-
|
|
307
|
-
|
|
361
|
+
var groupedMode = sizes.groupIndices.length > 0;
|
|
362
|
+
var initialRanges = [];
|
|
363
|
+
var defaultSize = sizes.lastSize;
|
|
364
|
+
if (groupedMode) {
|
|
365
|
+
var firstGroupSize = AATree_1.find(sizes.sizeTree, 0);
|
|
366
|
+
var prependedGroupItemsCount = 0;
|
|
367
|
+
var groupIndex = 0;
|
|
368
|
+
while (prependedGroupItemsCount < unshiftWith) {
|
|
369
|
+
var theGroupIndex = sizes.groupIndices[groupIndex];
|
|
370
|
+
var groupItemCount = sizes.groupIndices.length === groupIndex + 1 ? Infinity : sizes.groupIndices[groupIndex + 1] - theGroupIndex - 1;
|
|
371
|
+
initialRanges.push({
|
|
372
|
+
startIndex: theGroupIndex,
|
|
373
|
+
endIndex: theGroupIndex,
|
|
374
|
+
size: firstGroupSize,
|
|
375
|
+
});
|
|
376
|
+
initialRanges.push({
|
|
377
|
+
startIndex: theGroupIndex + 1,
|
|
378
|
+
endIndex: theGroupIndex + 1 + groupItemCount - 1,
|
|
379
|
+
size: defaultSize,
|
|
380
|
+
});
|
|
381
|
+
groupIndex++;
|
|
382
|
+
prependedGroupItemsCount += groupItemCount + 1;
|
|
383
|
+
}
|
|
384
|
+
var sizeTreeKV = AATree_1.walk(sizes.sizeTree);
|
|
385
|
+
// here, we detect if the first group item size has increased, so that we can delete its value.
|
|
386
|
+
var firstGroupIsExpanded = prependedGroupItemsCount !== unshiftWith;
|
|
387
|
+
if (firstGroupIsExpanded) {
|
|
388
|
+
// remove the first group item size, already incorporated
|
|
389
|
+
sizeTreeKV.shift();
|
|
390
|
+
}
|
|
391
|
+
return sizeTreeKV.reduce(function (acc, _a) {
|
|
392
|
+
var index = _a.k, size = _a.v;
|
|
393
|
+
var ranges = acc.ranges;
|
|
394
|
+
if (acc.prevSize !== 0) {
|
|
395
|
+
ranges = tslib_1.__spread(acc.ranges, [
|
|
396
|
+
{
|
|
397
|
+
startIndex: acc.prevIndex,
|
|
398
|
+
endIndex: index + unshiftWith - 1,
|
|
399
|
+
size: acc.prevSize,
|
|
400
|
+
},
|
|
401
|
+
]);
|
|
402
|
+
}
|
|
403
|
+
return {
|
|
404
|
+
ranges: ranges,
|
|
405
|
+
prevIndex: index + unshiftWith,
|
|
406
|
+
prevSize: size,
|
|
407
|
+
};
|
|
408
|
+
}, {
|
|
409
|
+
ranges: initialRanges,
|
|
410
|
+
prevIndex: unshiftWith,
|
|
411
|
+
prevSize: 0,
|
|
412
|
+
}).ranges;
|
|
308
413
|
}
|
|
309
414
|
return AATree_1.walk(sizes.sizeTree).reduce(function (acc, _a) {
|
|
310
415
|
var index = _a.k, size = _a.v;
|
|
311
416
|
return {
|
|
312
|
-
ranges: tslib_1.__spread(acc.ranges, [
|
|
313
|
-
{
|
|
314
|
-
startIndex: acc.prevIndex,
|
|
315
|
-
endIndex: index + unshiftWith - 1,
|
|
316
|
-
size: acc.prevSize,
|
|
317
|
-
},
|
|
318
|
-
]),
|
|
417
|
+
ranges: tslib_1.__spread(acc.ranges, [{ startIndex: acc.prevIndex, endIndex: index + unshiftWith - 1, size: acc.prevSize }]),
|
|
319
418
|
prevIndex: index + unshiftWith,
|
|
320
419
|
prevSize: size,
|
|
321
420
|
};
|
|
322
421
|
}, {
|
|
323
422
|
ranges: [],
|
|
324
423
|
prevIndex: 0,
|
|
325
|
-
prevSize:
|
|
424
|
+
prevSize: defaultSize,
|
|
326
425
|
}).ranges;
|
|
327
426
|
})), sizeRanges);
|
|
328
|
-
var shiftWithOffset = u.streamFromEmitter(u.pipe(shiftWith, u.withLatestFrom(sizes), u.map(function (_a) {
|
|
329
|
-
var _b = tslib_1.__read(_a,
|
|
427
|
+
var shiftWithOffset = u.streamFromEmitter(u.pipe(shiftWith, u.withLatestFrom(sizes, gap), u.map(function (_a) {
|
|
428
|
+
var _b = tslib_1.__read(_a, 3), shiftWith = _b[0], offsetTree = _b[1].offsetTree, gap = _b[2];
|
|
330
429
|
var newFirstItemIndex = -shiftWith;
|
|
331
|
-
return offsetOf(newFirstItemIndex, offsetTree);
|
|
430
|
+
return offsetOf(newFirstItemIndex, offsetTree, gap);
|
|
332
431
|
})));
|
|
333
|
-
u.connect(u.pipe(shiftWith, u.withLatestFrom(sizes), u.map(function (_a) {
|
|
334
|
-
var _b = tslib_1.__read(_a,
|
|
335
|
-
|
|
336
|
-
|
|
432
|
+
u.connect(u.pipe(shiftWith, u.withLatestFrom(sizes, gap), u.map(function (_a) {
|
|
433
|
+
var _b = tslib_1.__read(_a, 3), shiftWith = _b[0], sizes = _b[1], gap = _b[2];
|
|
434
|
+
var groupedMode = sizes.groupIndices.length > 0;
|
|
435
|
+
if (groupedMode) {
|
|
436
|
+
// we can't shift an empty tree
|
|
437
|
+
if (AATree_1.empty(sizes.sizeTree)) {
|
|
438
|
+
return sizes;
|
|
439
|
+
}
|
|
440
|
+
var newSizeTree = AATree_1.newTree();
|
|
441
|
+
var prevGroupIndicesValue = u.getValue(prevGroupIndices);
|
|
442
|
+
var removedItemsCount = 0;
|
|
443
|
+
var groupIndex = 0;
|
|
444
|
+
var groupOffset = 0;
|
|
445
|
+
while (removedItemsCount < -shiftWith) {
|
|
446
|
+
groupOffset = prevGroupIndicesValue[groupIndex];
|
|
447
|
+
var groupItemCount = prevGroupIndicesValue[groupIndex + 1] - groupOffset - 1;
|
|
448
|
+
groupIndex++;
|
|
449
|
+
removedItemsCount += groupItemCount + 1;
|
|
450
|
+
}
|
|
451
|
+
newSizeTree = AATree_1.walk(sizes.sizeTree).reduce(function (acc, _a) {
|
|
452
|
+
var k = _a.k, v = _a.v;
|
|
453
|
+
return AATree_1.insert(acc, Math.max(0, k + shiftWith), v);
|
|
454
|
+
}, newSizeTree);
|
|
455
|
+
// here, we detect if the first group item size has increased, so that we can delete its value.
|
|
456
|
+
var aGroupIsShrunk = removedItemsCount !== -shiftWith;
|
|
457
|
+
if (aGroupIsShrunk) {
|
|
458
|
+
var firstGroupSize = AATree_1.find(sizes.sizeTree, groupOffset);
|
|
459
|
+
newSizeTree = AATree_1.insert(newSizeTree, 0, firstGroupSize);
|
|
460
|
+
var nextItemSize = AATree_1.findMaxKeyValue(sizes.sizeTree, -shiftWith + 1)[1];
|
|
461
|
+
newSizeTree = AATree_1.insert(newSizeTree, 1, nextItemSize);
|
|
462
|
+
}
|
|
463
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, sizes), { sizeTree: newSizeTree }), createOffsetTree(sizes.offsetTree, 0, newSizeTree, gap));
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
var newSizeTree = AATree_1.walk(sizes.sizeTree).reduce(function (acc, _a) {
|
|
467
|
+
var k = _a.k, v = _a.v;
|
|
468
|
+
return AATree_1.insert(acc, Math.max(0, k + shiftWith), v);
|
|
469
|
+
}, AATree_1.newTree());
|
|
470
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, sizes), { sizeTree: newSizeTree }), createOffsetTree(sizes.offsetTree, 0, newSizeTree, gap));
|
|
337
471
|
}
|
|
338
|
-
var newSizeTree = AATree_1.walk(sizes.sizeTree).reduce(function (acc, _a) {
|
|
339
|
-
var k = _a.k, v = _a.v;
|
|
340
|
-
return AATree_1.insert(acc, Math.max(0, k + shiftWith), v);
|
|
341
|
-
}, AATree_1.newTree());
|
|
342
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, sizes), { sizeTree: newSizeTree }), createOffsetTree(sizes.offsetTree, 0, newSizeTree));
|
|
343
472
|
})), sizes);
|
|
344
473
|
return {
|
|
345
474
|
// input
|
|
@@ -354,6 +483,7 @@ exports.sizeSystem = u.system(function (_a) {
|
|
|
354
483
|
shiftWithOffset: shiftWithOffset,
|
|
355
484
|
beforeUnshiftWith: beforeUnshiftWith,
|
|
356
485
|
firstItemIndex: firstItemIndex,
|
|
486
|
+
gap: gap,
|
|
357
487
|
// output
|
|
358
488
|
sizes: sizes,
|
|
359
489
|
listRefresh: listRefresh,
|
|
@@ -361,4 +491,4 @@ exports.sizeSystem = u.system(function (_a) {
|
|
|
361
491
|
trackItemSizes: trackItemSizes,
|
|
362
492
|
itemSize: itemSize,
|
|
363
493
|
};
|
|
364
|
-
}, u.tup(loggerSystem_1.loggerSystem), { singleton: true });
|
|
494
|
+
}, u.tup(loggerSystem_1.loggerSystem, recalcSystem_1.recalcSystem), { singleton: true });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as u from '
|
|
1
|
+
import * as u from './urx';
|
|
2
2
|
export declare const UP: "up";
|
|
3
3
|
export declare const DOWN: "down";
|
|
4
4
|
export declare const NONE: "none";
|
|
@@ -30,31 +30,33 @@ export declare const stateFlagsSystem: u.SystemSpec<[u.SystemSpec<never[], () =>
|
|
|
30
30
|
scrollTop: u.Stream<number>;
|
|
31
31
|
viewportHeight: u.Stream<number>;
|
|
32
32
|
headerHeight: u.StatefulStream<number>;
|
|
33
|
+
fixedHeaderHeight: u.StatefulStream<number>;
|
|
34
|
+
fixedFooterHeight: u.StatefulStream<number>;
|
|
33
35
|
footerHeight: u.StatefulStream<number>;
|
|
34
36
|
scrollHeight: u.Stream<number>;
|
|
35
37
|
smoothScrollTargetReached: u.Stream<true>;
|
|
36
|
-
react18ConcurrentRendering: u.StatefulStream<boolean>;
|
|
37
38
|
scrollTo: u.Stream<ScrollToOptions>;
|
|
38
39
|
scrollBy: u.Stream<ScrollToOptions>;
|
|
39
40
|
statefulScrollTop: u.StatefulStream<number>;
|
|
40
41
|
deviation: u.StatefulStream<number>;
|
|
41
42
|
scrollingInProgress: u.StatefulStream<boolean>;
|
|
42
|
-
}>], ([{ scrollContainerState, scrollTop, viewportHeight, headerHeight, footerHeight, scrollBy
|
|
43
|
+
}>], ([{ scrollContainerState, scrollTop, viewportHeight, headerHeight, footerHeight, scrollBy }]: [{
|
|
43
44
|
scrollContainerState: u.Stream<import("./interfaces").ScrollContainerState>;
|
|
44
45
|
scrollTop: u.Stream<number>;
|
|
45
46
|
viewportHeight: u.Stream<number>;
|
|
46
47
|
headerHeight: u.StatefulStream<number>;
|
|
48
|
+
fixedHeaderHeight: u.StatefulStream<number>;
|
|
49
|
+
fixedFooterHeight: u.StatefulStream<number>;
|
|
47
50
|
footerHeight: u.StatefulStream<number>;
|
|
48
51
|
scrollHeight: u.Stream<number>;
|
|
49
52
|
smoothScrollTargetReached: u.Stream<true>;
|
|
50
|
-
react18ConcurrentRendering: u.StatefulStream<boolean>;
|
|
51
53
|
scrollTo: u.Stream<ScrollToOptions>;
|
|
52
54
|
scrollBy: u.Stream<ScrollToOptions>;
|
|
53
55
|
statefulScrollTop: u.StatefulStream<number>;
|
|
54
56
|
deviation: u.StatefulStream<number>;
|
|
55
57
|
scrollingInProgress: u.StatefulStream<boolean>;
|
|
56
58
|
}]) => {
|
|
57
|
-
isScrolling: u.
|
|
59
|
+
isScrolling: u.StatefulStream<boolean>;
|
|
58
60
|
isAtTop: u.StatefulStream<boolean>;
|
|
59
61
|
isAtBottom: u.StatefulStream<boolean>;
|
|
60
62
|
atBottomState: u.Stream<AtBottomState>;
|
|
@@ -62,6 +64,7 @@ export declare const stateFlagsSystem: u.SystemSpec<[u.SystemSpec<never[], () =>
|
|
|
62
64
|
atBottomStateChange: u.Stream<boolean>;
|
|
63
65
|
scrollDirection: u.StatefulStream<ScrollDirection>;
|
|
64
66
|
atBottomThreshold: u.StatefulStream<number>;
|
|
67
|
+
atTopThreshold: u.StatefulStream<number>;
|
|
65
68
|
scrollVelocity: u.StatefulStream<number>;
|
|
66
69
|
lastJumpDueToItemResize: u.StatefulStream<number>;
|
|
67
70
|
}>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-
|
|
5
|
-
var u = tslib_1.__importStar(require("
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
5
|
+
var u = tslib_1.__importStar(require("./urx"));
|
|
6
6
|
var domIOSystem_1 = require("./domIOSystem");
|
|
7
|
+
var approximatelyEqual_1 = require("./utils/approximatelyEqual");
|
|
7
8
|
exports.UP = 'up';
|
|
8
9
|
exports.DOWN = 'down';
|
|
9
10
|
exports.NONE = 'none';
|
|
@@ -17,6 +18,7 @@ var INITIAL_BOTTOM_STATE = {
|
|
|
17
18
|
scrollHeight: 0,
|
|
18
19
|
},
|
|
19
20
|
};
|
|
21
|
+
var DEFAULT_AT_TOP_THRESHOLD = 0;
|
|
20
22
|
exports.stateFlagsSystem = u.system(function (_a) {
|
|
21
23
|
var _b = tslib_1.__read(_a, 1), _c = _b[0], scrollContainerState = _c.scrollContainerState, scrollTop = _c.scrollTop, viewportHeight = _c.viewportHeight, headerHeight = _c.headerHeight, footerHeight = _c.footerHeight, scrollBy = _c.scrollBy;
|
|
22
24
|
var isAtBottom = u.statefulStream(false);
|
|
@@ -24,12 +26,16 @@ exports.stateFlagsSystem = u.system(function (_a) {
|
|
|
24
26
|
var atBottomStateChange = u.stream();
|
|
25
27
|
var atTopStateChange = u.stream();
|
|
26
28
|
var atBottomThreshold = u.statefulStream(4);
|
|
29
|
+
var atTopThreshold = u.statefulStream(DEFAULT_AT_TOP_THRESHOLD);
|
|
27
30
|
// skip 1 to avoid an initial on/off flick
|
|
28
|
-
var isScrolling = u.
|
|
31
|
+
var isScrolling = u.statefulStreamFromEmitter(u.pipe(u.merge(u.pipe(u.duc(scrollTop), u.skip(1), u.mapTo(true)), u.pipe(u.duc(scrollTop), u.skip(1), u.mapTo(false), u.debounceTime(100))), u.distinctUntilChanged()), false);
|
|
29
32
|
var isScrollingBy = u.statefulStreamFromEmitter(u.pipe(u.merge(u.pipe(scrollBy, u.mapTo(true)), u.pipe(scrollBy, u.mapTo(false), u.debounceTime(200))), u.distinctUntilChanged()), false);
|
|
30
33
|
// u.subscribe(isScrollingBy, (isScrollingBy) => console.log({ isScrollingBy }))
|
|
31
|
-
u.connect(u.pipe(u.duc(scrollTop), u.
|
|
32
|
-
|
|
34
|
+
u.connect(u.pipe(u.combineLatest(u.duc(scrollTop), u.duc(atTopThreshold)), u.map(function (_a) {
|
|
35
|
+
var _b = tslib_1.__read(_a, 2), top = _b[0], atTopThreshold = _b[1];
|
|
36
|
+
return top <= atTopThreshold;
|
|
37
|
+
}), u.distinctUntilChanged()), isAtTop);
|
|
38
|
+
u.connect(u.pipe(isAtTop, u.throttleTime(50)), atTopStateChange);
|
|
33
39
|
var atBottomState = u.streamFromEmitter(u.pipe(u.combineLatest(scrollContainerState, u.duc(viewportHeight), u.duc(headerHeight), u.duc(footerHeight), u.duc(atBottomThreshold)), u.scan(function (current, _a) {
|
|
34
40
|
var _b = tslib_1.__read(_a, 5), _c = _b[0], scrollTop = _c.scrollTop, scrollHeight = _c.scrollHeight, viewportHeight = _b[1], _headerHeight = _b[2], _footerHeight = _b[3], atBottomThreshold = _b[4];
|
|
35
41
|
var isAtBottom = scrollTop + viewportHeight - scrollHeight > -atBottomThreshold;
|
|
@@ -47,9 +53,7 @@ exports.stateFlagsSystem = u.system(function (_a) {
|
|
|
47
53
|
}
|
|
48
54
|
else {
|
|
49
55
|
atBottomBecause = 'SIZE_DECREASED';
|
|
50
|
-
scrollTopDelta =
|
|
51
|
-
current.state.scrollTop - scrollTop ||
|
|
52
|
-
current.scrollTopDelta;
|
|
56
|
+
scrollTopDelta = current.state.scrollTop - scrollTop || current.scrollTopDelta;
|
|
53
57
|
}
|
|
54
58
|
return {
|
|
55
59
|
atBottom: true,
|
|
@@ -81,8 +85,8 @@ exports.stateFlagsSystem = u.system(function (_a) {
|
|
|
81
85
|
})));
|
|
82
86
|
var lastJumpDueToItemResize = u.statefulStreamFromEmitter(u.pipe(scrollContainerState, u.scan(function (current, _a) {
|
|
83
87
|
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, viewportHeight = _a.viewportHeight;
|
|
84
|
-
if (current.scrollHeight
|
|
85
|
-
var atBottom = scrollTop
|
|
88
|
+
if (!approximatelyEqual_1.approximatelyEqual(current.scrollHeight, scrollHeight)) {
|
|
89
|
+
var atBottom = scrollHeight - (scrollTop + viewportHeight) < 1;
|
|
86
90
|
if (current.scrollTop !== scrollTop && atBottom) {
|
|
87
91
|
return {
|
|
88
92
|
scrollHeight: scrollHeight,
|
|
@@ -91,19 +95,23 @@ exports.stateFlagsSystem = u.system(function (_a) {
|
|
|
91
95
|
changed: true,
|
|
92
96
|
};
|
|
93
97
|
}
|
|
98
|
+
else {
|
|
99
|
+
return {
|
|
100
|
+
scrollHeight: scrollHeight,
|
|
101
|
+
scrollTop: scrollTop,
|
|
102
|
+
jump: 0,
|
|
103
|
+
changed: true,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
94
108
|
return {
|
|
95
|
-
scrollHeight: scrollHeight,
|
|
96
109
|
scrollTop: scrollTop,
|
|
110
|
+
scrollHeight: scrollHeight,
|
|
97
111
|
jump: 0,
|
|
98
|
-
changed:
|
|
112
|
+
changed: false,
|
|
99
113
|
};
|
|
100
114
|
}
|
|
101
|
-
return {
|
|
102
|
-
scrollTop: scrollTop,
|
|
103
|
-
scrollHeight: scrollHeight,
|
|
104
|
-
jump: 0,
|
|
105
|
-
changed: false,
|
|
106
|
-
};
|
|
107
115
|
}, { scrollHeight: 0, jump: 0, scrollTop: 0, changed: false }), u.filter(function (value) { return value.changed; }), u.map(function (value) { return value.jump; })), 0);
|
|
108
116
|
u.connect(u.pipe(atBottomState, u.map(function (state) { return state.atBottom; })), isAtBottom);
|
|
109
117
|
u.connect(u.pipe(isAtBottom, u.throttleTime(50)), atBottomStateChange);
|
|
@@ -117,14 +125,14 @@ exports.stateFlagsSystem = u.system(function (_a) {
|
|
|
117
125
|
if (u.getValue(isScrollingBy)) {
|
|
118
126
|
return { direction: acc.direction, prevScrollTop: scrollTop };
|
|
119
127
|
}
|
|
120
|
-
return {
|
|
121
|
-
direction: scrollTop < acc.prevScrollTop ? exports.UP : exports.DOWN,
|
|
122
|
-
prevScrollTop: scrollTop,
|
|
123
|
-
};
|
|
128
|
+
return { direction: scrollTop < acc.prevScrollTop ? exports.UP : exports.DOWN, prevScrollTop: scrollTop };
|
|
124
129
|
}, { direction: exports.DOWN, prevScrollTop: 0 }), u.map(function (value) { return value.direction; })), scrollDirection);
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
125
131
|
u.connect(u.pipe(scrollContainerState, u.throttleTime(50), u.mapTo(exports.NONE)), scrollDirection);
|
|
126
132
|
var scrollVelocity = u.statefulStream(0);
|
|
127
|
-
u.connect(u.pipe(isScrolling, u.filter(function (value) { return !value; }),
|
|
133
|
+
u.connect(u.pipe(isScrolling, u.filter(function (value) { return !value; }),
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
135
|
+
u.mapTo(0)), scrollVelocity);
|
|
128
136
|
u.connect(u.pipe(scrollTop, u.throttleTime(100), u.withLatestFrom(isScrolling), u.filter(function (_a) {
|
|
129
137
|
var _b = tslib_1.__read(_a, 2), _ = _b[0], isScrolling = _b[1];
|
|
130
138
|
return !!isScrolling;
|
|
@@ -145,6 +153,7 @@ exports.stateFlagsSystem = u.system(function (_a) {
|
|
|
145
153
|
atBottomStateChange: atBottomStateChange,
|
|
146
154
|
scrollDirection: scrollDirection,
|
|
147
155
|
atBottomThreshold: atBottomThreshold,
|
|
156
|
+
atTopThreshold: atTopThreshold,
|
|
148
157
|
scrollVelocity: scrollVelocity,
|
|
149
158
|
lastJumpDueToItemResize: lastJumpDueToItemResize,
|
|
150
159
|
};
|