@beppla/tapas-ui 1.0.70 → 1.0.72
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/commonjs/Alert/Alert.js +67 -47
- package/commonjs/AnimatedNavItem/AnimatedNavItem.js +0 -72
- package/commonjs/AnimatedNavItem/index.js +9 -16
- package/commonjs/BarChart/BarChart.js +0 -1
- package/commonjs/BarChart/index.js +0 -1
- package/commonjs/Button/Button.js +77 -97
- package/commonjs/Button/ButtonGroup.js +0 -1
- package/commonjs/Button/react-native-hoverable.d.js +0 -1
- package/commonjs/Calendar/Calendar.base.js +189 -163
- package/commonjs/Calendar/Calendar.js +102 -87
- package/commonjs/Calendar/ConcreteTimeSelector.js +0 -2
- package/commonjs/Calendar/CustomRange.js +0 -1
- package/commonjs/Calendar/DaySelector.js +113 -116
- package/commonjs/Calendar/MonthSelector.js +0 -2
- package/commonjs/Calendar/TimeSelector.js +223 -275
- package/commonjs/Calendar/WeekDaySelector.js +0 -1
- package/commonjs/Calendar/helper.js +68 -69
- package/commonjs/Calendar/local.js +0 -1
- package/commonjs/Calendar/types.js +10 -11
- package/commonjs/Card/Card.js +158 -232
- package/commonjs/CheckBox/CheckBox.js +0 -1
- package/commonjs/CheckBox/CheckBoxItem.js +36 -87
- package/commonjs/CheckBox/GroupCheckBox.js +66 -81
- package/commonjs/CircularProgress/CircularProgress.js +0 -1
- package/commonjs/Collapsible/Collapsible.js +0 -2
- package/commonjs/DashboardCard/DashboardCard.js +94 -75
- package/commonjs/DataCell/DataCell.js +235 -290
- package/commonjs/DataCell/index.js +0 -2
- package/commonjs/DataTable/DataTable.js +144 -71
- package/commonjs/DataTable/index.js +0 -1
- package/commonjs/DeviceSelectionModal/DeviceSelectionModal.js +243 -243
- package/commonjs/DraggableFlatList/DraggableFlatList.js +0 -1
- package/commonjs/Drawer/Drawer.js +0 -1
- package/commonjs/Dropdown/CustomDropdown.js +0 -1
- package/commonjs/Dropdown/Dropdown.js +461 -494
- package/commonjs/Dropdown/InputDropdown.js +113 -124
- package/commonjs/ExternalLink/ExternalLink.js +58 -51
- package/commonjs/Gantt/Accessories.js +0 -1
- package/commonjs/Gantt/Gantt.js +0 -2
- package/commonjs/Gantt/GanttInnerElementType.js +0 -2
- package/commonjs/Gantt/helper.js +0 -1
- package/commonjs/Gantt/types.js +0 -1
- package/commonjs/Grid/FixedSizeGrid.js +0 -1
- package/commonjs/Grid/Grid.base.js +400 -337
- package/commonjs/Grid/StaticFixedSizeGrid.js +0 -1
- package/commonjs/Grid/VariableSizeGrid.js +113 -121
- package/commonjs/Grid/helper.js +15 -12
- package/commonjs/Grid/timer.js +0 -1
- package/commonjs/Header/Header.js +177 -167
- package/commonjs/HelloWave/HelloWave.js +52 -47
- package/commonjs/Hoverable/Hoverable.js +0 -2
- package/commonjs/IconText/IconText.js +0 -2
- package/commonjs/Icons/TapasIcon.js +99 -100
- package/commonjs/Icons/TapasIconExpo.js +93 -102
- package/commonjs/Icons/expoFontLoader.js +0 -2
- package/commonjs/Icons/fontLoader.js +0 -1
- package/commonjs/Icons/index.js +0 -2
- package/commonjs/Icons/smartFontLoader.js +222 -267
- package/commonjs/Image/Image.js +106 -97
- package/commonjs/Image/PreviewImg.js +0 -1
- package/commonjs/Input/Input.js +0 -2
- package/commonjs/Layout/DrawerContext.js +34 -50
- package/commonjs/Layout/Layout.js +0 -2
- package/commonjs/Layout/ToastContext.js +46 -35
- package/commonjs/Layout/index.js +37 -35
- package/commonjs/LineChart/LineChart.js +0 -1
- package/commonjs/LineChart/index.js +2 -4
- package/commonjs/ListItem/ListItem.js +108 -81
- package/commonjs/Loading/Loading.js +0 -1
- package/commonjs/MessageBox/MessageBox.js +0 -2
- package/commonjs/MultiSelector/MultiSelector.js +225 -251
- package/commonjs/MultiSelector/index.js +0 -2
- package/commonjs/Navigation/Navigation.js +117 -115
- package/commonjs/Notification/Notification.js +66 -136
- package/commonjs/Notification/index.js +0 -2
- package/commonjs/NumericInput/NumericInput.js +85 -72
- package/commonjs/Overlay/Overlay.js +45 -25
- package/commonjs/Pagination/Pagination.js +0 -1
- package/commonjs/PieChart/PieChart.js +0 -2
- package/commonjs/PieChart/index.js +0 -1
- package/commonjs/Popover/Popover.js +136 -113
- package/commonjs/Progress/Progress.js +48 -55
- package/commonjs/Quantity/Quantity.js +69 -1
- package/commonjs/Quantity/index.js +0 -1
- package/commonjs/RadioButton/RadioButton.js +94 -47
- package/commonjs/ReasonModal/ReasonModal.js +0 -2
- package/commonjs/ReasonModal/index.js +14 -10
- package/commonjs/ScanButton/ScanButton.js +0 -2
- package/commonjs/SearchInput/SearchInput.js +0 -2
- package/commonjs/SearchInput/index.js +0 -1
- package/commonjs/SheetTitle/SheetTitle.js +34 -32
- package/commonjs/Shell/Shell.js +92 -85
- package/commonjs/Shell/styles.js +2 -3
- package/commonjs/Shell/types.js +0 -1
- package/commonjs/StatisticCard/StatisticCard.js +46 -42
- package/commonjs/StatisticCard/index.js +0 -2
- package/commonjs/Status/Status.js +34 -32
- package/commonjs/Steps/Steps.js +40 -42
- package/commonjs/TabTitle/TabTitle.js +53 -49
- package/commonjs/TabTitle/index.js +0 -1
- package/commonjs/TableColumnHeader/TableColumnHeader.js +0 -1
- package/commonjs/TableColumnHeader/index.js +0 -2
- package/commonjs/Tag/Tag.js +88 -35
- package/commonjs/Task/Task.js +112 -202
- package/commonjs/Task/type.js +3 -4
- package/commonjs/Text/Text.js +96 -57
- package/commonjs/TextArea/TextArea.js +0 -2
- package/commonjs/Theme/ThemeProvider.js +15 -19
- package/commonjs/Theme/defaultTheme.js +0 -2
- package/commonjs/Theme/themed.d.js +0 -1
- package/commonjs/Timeline/Timeline.js +0 -24
- package/commonjs/Toast/Toast.js +83 -63
- package/commonjs/UserSwitcher/UserSwitcher.js +0 -2
- package/commonjs/UserSwitcher/index.js +8 -15
- package/commonjs/common.js +4 -5
- package/commonjs/index.js +335 -427
- package/module/Alert/Alert.js +0 -2
- package/module/AnimatedNavItem/AnimatedNavItem.js +124 -160
- package/module/AnimatedNavItem/index.js +2 -8
- package/module/BarChart/BarChart.js +0 -2
- package/module/BarChart/index.js +0 -1
- package/module/Button/Button.js +70 -81
- package/module/Button/ButtonGroup.js +128 -121
- package/module/Button/react-native-hoverable.d.js +0 -1
- package/module/Calendar/Calendar.base.js +225 -150
- package/module/Calendar/Calendar.js +76 -81
- package/module/Calendar/ConcreteTimeSelector.js +0 -2
- package/module/Calendar/CustomRange.js +0 -1
- package/module/Calendar/DaySelector.js +95 -119
- package/module/Calendar/MonthSelector.js +0 -2
- package/module/Calendar/TimeSelector.js +0 -2
- package/module/Calendar/WeekDaySelector.js +0 -1
- package/module/Calendar/helper.js +73 -75
- package/module/Calendar/local.js +7 -8
- package/module/Calendar/types.js +13 -14
- package/module/Card/Card.js +0 -1
- package/module/CheckBox/CheckBox.js +93 -90
- package/module/CheckBox/CheckBoxItem.js +69 -85
- package/module/CheckBox/GroupCheckBox.js +66 -77
- package/module/CircularProgress/CircularProgress.js +21 -1
- package/module/Collapsible/Collapsible.js +54 -65
- package/module/DashboardCard/DashboardCard.js +0 -1
- package/module/DataCell/DataCell.js +310 -225
- package/module/DataCell/index.js +4 -4
- package/module/DataTable/DataTable.js +0 -2
- package/module/DataTable/index.js +1 -5
- package/module/DeviceSelectionModal/DeviceSelectionModal.js +178 -242
- package/module/DraggableFlatList/DraggableFlatList.js +0 -10
- package/module/Drawer/Drawer.js +166 -140
- package/module/Dropdown/CustomDropdown.js +55 -1
- package/module/Dropdown/Dropdown.js +0 -1
- package/module/Dropdown/InputDropdown.js +116 -135
- package/module/ExternalLink/ExternalLink.js +149 -1
- package/module/Gantt/Accessories.js +182 -125
- package/module/Gantt/Gantt.js +139 -153
- package/module/Gantt/GanttInnerElementType.js +0 -1
- package/module/Gantt/helper.js +0 -2
- package/module/Gantt/types.js +3 -9
- package/module/Grid/FixedSizeGrid.js +85 -81
- package/module/Grid/Grid.base.js +400 -340
- package/module/Grid/StaticFixedSizeGrid.js +192 -256
- package/module/Grid/VariableSizeGrid.js +120 -119
- package/module/Grid/helper.js +0 -1
- package/module/Grid/timer.js +13 -17
- package/module/Header/Header.js +167 -184
- package/module/HelloWave/HelloWave.js +0 -2
- package/module/Hoverable/Hoverable.js +0 -1
- package/module/IconText/IconText.js +63 -89
- package/module/Icons/TapasIcon.js +119 -97
- package/module/Icons/TapasIconExpo.js +78 -99
- package/module/Icons/expoFontLoader.js +0 -2
- package/module/Icons/fontLoader.js +212 -183
- package/module/Icons/index.js +8 -11
- package/module/Icons/smartFontLoader.js +0 -1
- package/module/Image/Image.js +0 -2
- package/module/Image/PreviewImg.js +0 -1
- package/module/Input/Input.js +0 -2
- package/module/Layout/DrawerContext.js +0 -2
- package/module/Layout/Layout.js +100 -101
- package/module/Layout/ToastContext.js +26 -16
- package/module/Layout/index.js +0 -1
- package/module/LineChart/LineChart.js +121 -158
- package/module/LineChart/index.js +0 -2
- package/module/ListItem/ListItem.js +0 -2
- package/module/Loading/Loading.js +0 -2
- package/module/MessageBox/MessageBox.js +0 -2
- package/module/MultiSelector/MultiSelector.js +0 -1
- package/module/MultiSelector/index.js +0 -2
- package/module/Navigation/Navigation.js +0 -2
- package/module/Notification/Notification.js +101 -106
- package/module/Notification/index.js +1 -4
- package/module/NumericInput/NumericInput.js +0 -55
- package/module/Overlay/Overlay.js +0 -2
- package/module/Pagination/Pagination.js +71 -1
- package/module/PieChart/PieChart.js +76 -102
- package/module/PieChart/index.js +0 -2
- package/module/Popover/Popover.js +97 -126
- package/module/Progress/Progress.js +51 -58
- package/module/Quantity/Quantity.js +112 -130
- package/module/Quantity/index.js +3 -3
- package/module/RadioButton/RadioButton.js +0 -2
- package/module/ReasonModal/ReasonModal.js +0 -1
- package/module/ReasonModal/index.js +5 -4
- package/module/ScanButton/ScanButton.js +76 -54
- package/module/SearchInput/SearchInput.js +83 -94
- package/module/SearchInput/index.js +0 -1
- package/module/SheetTitle/SheetTitle.js +29 -40
- package/module/Shell/Shell.js +91 -80
- package/module/Shell/styles.js +7 -9
- package/module/Shell/types.js +4 -3
- package/module/StatisticCard/StatisticCard.js +48 -80
- package/module/StatisticCard/index.js +0 -2
- package/module/Status/Status.js +0 -2
- package/module/Steps/Steps.js +36 -42
- package/module/TabTitle/TabTitle.js +0 -2
- package/module/TabTitle/index.js +0 -2
- package/module/TableColumnHeader/TableColumnHeader.js +126 -154
- package/module/TableColumnHeader/index.js +8 -4
- package/module/Tag/Tag.js +72 -88
- package/module/Task/Task.js +206 -114
- package/module/Task/type.js +8 -5
- package/module/Text/Text.js +69 -81
- package/module/TextArea/TextArea.js +0 -2
- package/module/Theme/ThemeProvider.js +0 -2
- package/module/Theme/defaultTheme.js +0 -2
- package/module/Theme/themed.d.js +0 -1
- package/module/Timeline/Timeline.js +0 -2
- package/module/Toast/Toast.js +66 -78
- package/module/UserSwitcher/UserSwitcher.js +130 -172
- package/module/UserSwitcher/index.js +0 -2
- package/module/common.js +0 -1
- package/module/index.js +119 -132
- package/package.json +1 -1
- package/commonjs/Alert/Alert.js.map +0 -2
- package/commonjs/AnimatedNavItem/AnimatedNavItem.js.map +0 -2
- package/commonjs/AnimatedNavItem/index.js.map +0 -2
- package/commonjs/BarChart/BarChart.js.map +0 -1
- package/commonjs/BarChart/index.js.map +0 -2
- package/commonjs/Button/Button.js.map +0 -1
- package/commonjs/Button/ButtonGroup.js.map +0 -1
- package/commonjs/Button/react-native-hoverable.d.js.map +0 -1
- package/commonjs/Calendar/Calendar.base.js.map +0 -1
- package/commonjs/Calendar/Calendar.js.map +0 -2
- package/commonjs/Calendar/ConcreteTimeSelector.js.map +0 -2
- package/commonjs/Calendar/CustomRange.js.map +0 -2
- package/commonjs/Calendar/DaySelector.js.map +0 -2
- package/commonjs/Calendar/MonthSelector.js.map +0 -2
- package/commonjs/Calendar/TimeSelector.js.map +0 -2
- package/commonjs/Calendar/WeekDaySelector.js.map +0 -2
- package/commonjs/Calendar/helper.js.map +0 -2
- package/commonjs/Calendar/local.js.map +0 -2
- package/commonjs/Calendar/types.js.map +0 -1
- package/commonjs/Card/Card.js.map +0 -1
- package/commonjs/CheckBox/CheckBox.js.map +0 -1
- package/commonjs/CheckBox/CheckBoxItem.js.map +0 -1
- package/commonjs/CheckBox/GroupCheckBox.js.map +0 -1
- package/commonjs/CircularProgress/CircularProgress.js.map +0 -1
- package/commonjs/Collapsible/Collapsible.js.map +0 -2
- package/commonjs/DashboardCard/DashboardCard.js.map +0 -1
- package/commonjs/DataCell/DataCell.js.map +0 -2
- package/commonjs/DataCell/index.js.map +0 -1
- package/commonjs/DataTable/DataTable.js.map +0 -2
- package/commonjs/DataTable/index.js.map +0 -2
- package/commonjs/DeviceSelectionModal/DeviceSelectionModal.js.map +0 -1
- package/commonjs/DraggableFlatList/DraggableFlatList.js.map +0 -1
- package/commonjs/Drawer/Drawer.js.map +0 -1
- package/commonjs/Dropdown/CustomDropdown.js.map +0 -1
- package/commonjs/Dropdown/Dropdown.js.map +0 -2
- package/commonjs/Dropdown/InputDropdown.js.map +0 -2
- package/commonjs/ExternalLink/ExternalLink.js.map +0 -2
- package/commonjs/Gantt/Accessories.js.map +0 -1
- package/commonjs/Gantt/Gantt.js.map +0 -2
- package/commonjs/Gantt/GanttInnerElementType.js.map +0 -2
- package/commonjs/Gantt/helper.js.map +0 -2
- package/commonjs/Gantt/types.js.map +0 -2
- package/commonjs/Grid/FixedSizeGrid.js.map +0 -1
- package/commonjs/Grid/Grid.base.js.map +0 -1
- package/commonjs/Grid/StaticFixedSizeGrid.js.map +0 -1
- package/commonjs/Grid/VariableSizeGrid.js.map +0 -2
- package/commonjs/Grid/helper.js.map +0 -2
- package/commonjs/Grid/timer.js.map +0 -1
- package/commonjs/Header/Header.js.map +0 -2
- package/commonjs/HelloWave/HelloWave.js.map +0 -1
- package/commonjs/Hoverable/Hoverable.js.map +0 -2
- package/commonjs/IconText/IconText.js.map +0 -2
- package/commonjs/Icons/TapasIcon.js.map +0 -1
- package/commonjs/Icons/TapasIconExpo.js.map +0 -2
- package/commonjs/Icons/expoFontLoader.js.map +0 -2
- package/commonjs/Icons/fontLoader.js.map +0 -1
- package/commonjs/Icons/index.js.map +0 -2
- package/commonjs/Icons/smartFontLoader.js.map +0 -2
- package/commonjs/Image/Image.js.map +0 -2
- package/commonjs/Image/PreviewImg.js.map +0 -1
- package/commonjs/Input/Input.js.map +0 -2
- package/commonjs/Layout/DrawerContext.js.map +0 -1
- package/commonjs/Layout/Layout.js.map +0 -2
- package/commonjs/Layout/ToastContext.js.map +0 -2
- package/commonjs/Layout/index.js.map +0 -2
- package/commonjs/LineChart/LineChart.js.map +0 -1
- package/commonjs/LineChart/index.js.map +0 -1
- package/commonjs/ListItem/ListItem.js.map +0 -2
- package/commonjs/Loading/Loading.js.map +0 -1
- package/commonjs/MessageBox/MessageBox.js.map +0 -2
- package/commonjs/MultiSelector/MultiSelector.js.map +0 -2
- package/commonjs/MultiSelector/index.js.map +0 -2
- package/commonjs/Navigation/Navigation.js.map +0 -2
- package/commonjs/Notification/Notification.js.map +0 -1
- package/commonjs/Notification/index.js.map +0 -2
- package/commonjs/NumericInput/NumericInput.js.map +0 -2
- package/commonjs/Overlay/Overlay.js.map +0 -1
- package/commonjs/Pagination/Pagination.js.map +0 -1
- package/commonjs/PieChart/PieChart.js.map +0 -2
- package/commonjs/PieChart/index.js.map +0 -2
- package/commonjs/Popover/Popover.js.map +0 -1
- package/commonjs/Progress/Progress.js.map +0 -1
- package/commonjs/Quantity/Quantity.js.map +0 -1
- package/commonjs/Quantity/index.js.map +0 -1
- package/commonjs/RadioButton/RadioButton.js.map +0 -1
- package/commonjs/ReasonModal/ReasonModal.js.map +0 -2
- package/commonjs/ReasonModal/index.js.map +0 -1
- package/commonjs/ScanButton/ScanButton.js.map +0 -2
- package/commonjs/SearchInput/SearchInput.js.map +0 -2
- package/commonjs/SearchInput/index.js.map +0 -1
- package/commonjs/SheetTitle/SheetTitle.js.map +0 -1
- package/commonjs/Shell/Shell.js.map +0 -2
- package/commonjs/Shell/styles.js.map +0 -1
- package/commonjs/Shell/types.js.map +0 -1
- package/commonjs/StatisticCard/StatisticCard.js.map +0 -2
- package/commonjs/StatisticCard/index.js.map +0 -2
- package/commonjs/Status/Status.js.map +0 -1
- package/commonjs/Steps/Steps.js.map +0 -1
- package/commonjs/TabTitle/TabTitle.js.map +0 -2
- package/commonjs/TabTitle/index.js.map +0 -1
- package/commonjs/TableColumnHeader/TableColumnHeader.js.map +0 -2
- package/commonjs/TableColumnHeader/index.js.map +0 -2
- package/commonjs/Tag/Tag.js.map +0 -1
- package/commonjs/Task/Task.js.map +0 -2
- package/commonjs/Task/type.js.map +0 -1
- package/commonjs/Text/Text.js.map +0 -1
- package/commonjs/TextArea/TextArea.js.map +0 -2
- package/commonjs/Theme/ThemeProvider.js.map +0 -2
- package/commonjs/Theme/defaultTheme.js.map +0 -2
- package/commonjs/Theme/themed.d.js.map +0 -1
- package/commonjs/Timeline/Timeline.js.map +0 -2
- package/commonjs/Toast/Toast.js.map +0 -2
- package/commonjs/UserSwitcher/UserSwitcher.js.map +0 -2
- package/commonjs/UserSwitcher/index.js.map +0 -2
- package/commonjs/common.js.map +0 -1
- package/commonjs/index.js.map +0 -2
- package/module/Alert/Alert.js.map +0 -2
- package/module/AnimatedNavItem/AnimatedNavItem.js.map +0 -1
- package/module/AnimatedNavItem/index.js.map +0 -1
- package/module/BarChart/BarChart.js.map +0 -2
- package/module/BarChart/index.js.map +0 -2
- package/module/Button/Button.js.map +0 -1
- package/module/Button/ButtonGroup.js.map +0 -1
- package/module/Button/react-native-hoverable.d.js.map +0 -1
- package/module/Calendar/Calendar.base.js.map +0 -1
- package/module/Calendar/Calendar.js.map +0 -2
- package/module/Calendar/ConcreteTimeSelector.js.map +0 -2
- package/module/Calendar/CustomRange.js.map +0 -1
- package/module/Calendar/DaySelector.js.map +0 -2
- package/module/Calendar/MonthSelector.js.map +0 -2
- package/module/Calendar/TimeSelector.js.map +0 -1
- package/module/Calendar/WeekDaySelector.js.map +0 -2
- package/module/Calendar/helper.js.map +0 -1
- package/module/Calendar/local.js.map +0 -2
- package/module/Calendar/types.js.map +0 -1
- package/module/Card/Card.js.map +0 -1
- package/module/CheckBox/CheckBox.js.map +0 -2
- package/module/CheckBox/CheckBoxItem.js.map +0 -1
- package/module/CheckBox/GroupCheckBox.js.map +0 -2
- package/module/CircularProgress/CircularProgress.js.map +0 -1
- package/module/Collapsible/Collapsible.js.map +0 -2
- package/module/DashboardCard/DashboardCard.js.map +0 -1
- package/module/DataCell/DataCell.js.map +0 -1
- package/module/DataCell/index.js.map +0 -2
- package/module/DataTable/DataTable.js.map +0 -2
- package/module/DataTable/index.js.map +0 -1
- package/module/DeviceSelectionModal/DeviceSelectionModal.js.map +0 -2
- package/module/DraggableFlatList/DraggableFlatList.js.map +0 -2
- package/module/Drawer/Drawer.js.map +0 -1
- package/module/Dropdown/CustomDropdown.js.map +0 -1
- package/module/Dropdown/Dropdown.js.map +0 -1
- package/module/Dropdown/InputDropdown.js.map +0 -2
- package/module/ExternalLink/ExternalLink.js.map +0 -1
- package/module/Gantt/Accessories.js.map +0 -2
- package/module/Gantt/Gantt.js.map +0 -2
- package/module/Gantt/GanttInnerElementType.js.map +0 -1
- package/module/Gantt/helper.js.map +0 -1
- package/module/Gantt/types.js.map +0 -1
- package/module/Grid/FixedSizeGrid.js.map +0 -1
- package/module/Grid/Grid.base.js.map +0 -1
- package/module/Grid/StaticFixedSizeGrid.js.map +0 -2
- package/module/Grid/VariableSizeGrid.js.map +0 -1
- package/module/Grid/helper.js.map +0 -2
- package/module/Grid/timer.js.map +0 -1
- package/module/Header/Header.js.map +0 -2
- package/module/HelloWave/HelloWave.js.map +0 -2
- package/module/Hoverable/Hoverable.js.map +0 -1
- package/module/IconText/IconText.js.map +0 -2
- package/module/Icons/TapasIcon.js.map +0 -1
- package/module/Icons/TapasIconExpo.js.map +0 -2
- package/module/Icons/expoFontLoader.js.map +0 -2
- package/module/Icons/fontLoader.js.map +0 -2
- package/module/Icons/index.js.map +0 -2
- package/module/Icons/smartFontLoader.js.map +0 -2
- package/module/Image/Image.js.map +0 -2
- package/module/Image/PreviewImg.js.map +0 -1
- package/module/Input/Input.js.map +0 -2
- package/module/Layout/DrawerContext.js.map +0 -2
- package/module/Layout/Layout.js.map +0 -1
- package/module/Layout/ToastContext.js.map +0 -1
- package/module/Layout/index.js.map +0 -2
- package/module/LineChart/LineChart.js.map +0 -1
- package/module/LineChart/index.js.map +0 -2
- package/module/ListItem/ListItem.js.map +0 -2
- package/module/Loading/Loading.js.map +0 -2
- package/module/MessageBox/MessageBox.js.map +0 -2
- package/module/MultiSelector/MultiSelector.js.map +0 -2
- package/module/MultiSelector/index.js.map +0 -2
- package/module/Navigation/Navigation.js.map +0 -2
- package/module/Notification/Notification.js.map +0 -2
- package/module/Notification/index.js.map +0 -1
- package/module/NumericInput/NumericInput.js.map +0 -2
- package/module/Overlay/Overlay.js.map +0 -2
- package/module/Pagination/Pagination.js.map +0 -1
- package/module/PieChart/PieChart.js.map +0 -1
- package/module/PieChart/index.js.map +0 -2
- package/module/Popover/Popover.js.map +0 -1
- package/module/Progress/Progress.js.map +0 -2
- package/module/Quantity/Quantity.js.map +0 -2
- package/module/Quantity/index.js.map +0 -2
- package/module/RadioButton/RadioButton.js.map +0 -2
- package/module/ReasonModal/ReasonModal.js.map +0 -1
- package/module/ReasonModal/index.js.map +0 -2
- package/module/ScanButton/ScanButton.js.map +0 -1
- package/module/SearchInput/SearchInput.js.map +0 -2
- package/module/SearchInput/index.js.map +0 -1
- package/module/SheetTitle/SheetTitle.js.map +0 -1
- package/module/Shell/Shell.js.map +0 -1
- package/module/Shell/styles.js.map +0 -1
- package/module/Shell/types.js.map +0 -2
- package/module/StatisticCard/StatisticCard.js.map +0 -2
- package/module/StatisticCard/index.js.map +0 -2
- package/module/Status/Status.js.map +0 -2
- package/module/Steps/Steps.js.map +0 -2
- package/module/TabTitle/TabTitle.js.map +0 -1
- package/module/TabTitle/index.js.map +0 -2
- package/module/TableColumnHeader/TableColumnHeader.js.map +0 -2
- package/module/TableColumnHeader/index.js.map +0 -2
- package/module/Tag/Tag.js.map +0 -2
- package/module/Task/Task.js.map +0 -1
- package/module/Task/type.js.map +0 -1
- package/module/Text/Text.js.map +0 -1
- package/module/TextArea/TextArea.js.map +0 -2
- package/module/Theme/ThemeProvider.js.map +0 -2
- package/module/Theme/defaultTheme.js.map +0 -2
- package/module/Theme/themed.d.js.map +0 -1
- package/module/Timeline/Timeline.js.map +0 -2
- package/module/Toast/Toast.js.map +0 -2
- package/module/UserSwitcher/UserSwitcher.js.map +0 -2
- package/module/UserSwitcher/index.js.map +0 -2
- package/module/common.js.map +0 -1
- package/module/index.js.map +0 -1
- package/typescript/Alert/Alert.d.ts.map +0 -1
- package/typescript/AnimatedNavItem/AnimatedNavItem.d.ts.map +0 -1
- package/typescript/AnimatedNavItem/index.d.ts.map +0 -1
- package/typescript/BarChart/BarChart.d.ts.map +0 -1
- package/typescript/BarChart/index.d.ts.map +0 -1
- package/typescript/Button/Button.d.ts.map +0 -1
- package/typescript/Button/ButtonGroup.d.ts.map +0 -1
- package/typescript/Calendar/Calendar.base.d.ts.map +0 -1
- package/typescript/Calendar/Calendar.d.ts.map +0 -1
- package/typescript/Calendar/ConcreteTimeSelector.d.ts.map +0 -1
- package/typescript/Calendar/CustomRange.d.ts.map +0 -1
- package/typescript/Calendar/DaySelector.d.ts.map +0 -1
- package/typescript/Calendar/MonthSelector.d.ts.map +0 -1
- package/typescript/Calendar/TimeSelector.d.ts.map +0 -1
- package/typescript/Calendar/WeekDaySelector.d.ts.map +0 -1
- package/typescript/Calendar/helper.d.ts.map +0 -1
- package/typescript/Calendar/local.d.ts.map +0 -1
- package/typescript/Calendar/types.d.ts.map +0 -1
- package/typescript/Card/Card.d.ts.map +0 -1
- package/typescript/CheckBox/CheckBox.d.ts.map +0 -1
- package/typescript/CheckBox/CheckBoxItem.d.ts.map +0 -1
- package/typescript/CheckBox/GroupCheckBox.d.ts.map +0 -1
- package/typescript/CircularProgress/CircularProgress.d.ts.map +0 -1
- package/typescript/Collapsible/Collapsible.d.ts.map +0 -1
- package/typescript/DashboardCard/DashboardCard.d.ts.map +0 -1
- package/typescript/DataCell/DataCell.d.ts.map +0 -1
- package/typescript/DataCell/index.d.ts.map +0 -1
- package/typescript/DataTable/DataTable.d.ts.map +0 -1
- package/typescript/DataTable/index.d.ts.map +0 -1
- package/typescript/DeviceSelectionModal/DeviceSelectionModal.d.ts.map +0 -1
- package/typescript/DraggableFlatList/DraggableFlatList.d.ts.map +0 -1
- package/typescript/Drawer/Drawer.d.ts.map +0 -1
- package/typescript/Dropdown/CustomDropdown.d.ts.map +0 -1
- package/typescript/Dropdown/Dropdown.d.ts.map +0 -1
- package/typescript/Dropdown/InputDropdown.d.ts.map +0 -1
- package/typescript/ExternalLink/ExternalLink.d.ts.map +0 -1
- package/typescript/Gantt/Accessories.d.ts.map +0 -1
- package/typescript/Gantt/Gantt.d.ts.map +0 -1
- package/typescript/Gantt/GanttInnerElementType.d.ts.map +0 -1
- package/typescript/Gantt/helper.d.ts.map +0 -1
- package/typescript/Gantt/types.d.ts.map +0 -1
- package/typescript/Grid/FixedSizeGrid.d.ts.map +0 -1
- package/typescript/Grid/Grid.base.d.ts.map +0 -1
- package/typescript/Grid/StaticFixedSizeGrid.d.ts.map +0 -1
- package/typescript/Grid/VariableSizeGrid.d.ts.map +0 -1
- package/typescript/Grid/helper.d.ts.map +0 -1
- package/typescript/Grid/timer.d.ts.map +0 -1
- package/typescript/Header/Header.d.ts.map +0 -1
- package/typescript/HelloWave/HelloWave.d.ts.map +0 -1
- package/typescript/Hoverable/Hoverable.d.ts.map +0 -1
- package/typescript/IconText/IconText.d.ts.map +0 -1
- package/typescript/Icons/TapasIcon.d.ts.map +0 -1
- package/typescript/Icons/TapasIconExpo.d.ts.map +0 -1
- package/typescript/Icons/expoFontLoader.d.ts.map +0 -1
- package/typescript/Icons/fontLoader.d.ts.map +0 -1
- package/typescript/Icons/index.d.ts.map +0 -1
- package/typescript/Icons/smartFontLoader.d.ts.map +0 -1
- package/typescript/Image/Image.d.ts.map +0 -1
- package/typescript/Image/PreviewImg.d.ts.map +0 -1
- package/typescript/Input/Input.d.ts.map +0 -1
- package/typescript/Layout/DrawerContext.d.ts.map +0 -1
- package/typescript/Layout/Layout.d.ts.map +0 -1
- package/typescript/Layout/ToastContext.d.ts.map +0 -1
- package/typescript/Layout/index.d.ts.map +0 -1
- package/typescript/LineChart/LineChart.d.ts.map +0 -1
- package/typescript/LineChart/index.d.ts.map +0 -1
- package/typescript/ListItem/ListItem.d.ts.map +0 -1
- package/typescript/Loading/Loading.d.ts.map +0 -1
- package/typescript/MessageBox/MessageBox.d.ts.map +0 -1
- package/typescript/MultiSelector/MultiSelector.d.ts.map +0 -1
- package/typescript/MultiSelector/index.d.ts.map +0 -1
- package/typescript/Navigation/Navigation.d.ts.map +0 -1
- package/typescript/Notification/Notification.d.ts.map +0 -1
- package/typescript/Notification/index.d.ts.map +0 -1
- package/typescript/NumericInput/NumericInput.d.ts.map +0 -1
- package/typescript/Overlay/Overlay.d.ts.map +0 -1
- package/typescript/Pagination/Pagination.d.ts.map +0 -1
- package/typescript/PieChart/PieChart.d.ts.map +0 -1
- package/typescript/PieChart/index.d.ts.map +0 -1
- package/typescript/Popover/Popover.d.ts.map +0 -1
- package/typescript/Progress/Progress.d.ts.map +0 -1
- package/typescript/Quantity/Quantity.d.ts.map +0 -1
- package/typescript/Quantity/index.d.ts.map +0 -1
- package/typescript/RadioButton/RadioButton.d.ts.map +0 -1
- package/typescript/ReasonModal/ReasonModal.d.ts.map +0 -1
- package/typescript/ReasonModal/index.d.ts.map +0 -1
- package/typescript/ScanButton/ScanButton.d.ts.map +0 -1
- package/typescript/SearchInput/SearchInput.d.ts.map +0 -1
- package/typescript/SearchInput/index.d.ts.map +0 -1
- package/typescript/SheetTitle/SheetTitle.d.ts.map +0 -1
- package/typescript/Shell/Shell.d.ts.map +0 -1
- package/typescript/Shell/styles.d.ts.map +0 -1
- package/typescript/Shell/types.d.ts.map +0 -1
- package/typescript/StatisticCard/StatisticCard.d.ts.map +0 -1
- package/typescript/StatisticCard/index.d.ts.map +0 -1
- package/typescript/Status/Status.d.ts.map +0 -1
- package/typescript/Steps/Steps.d.ts.map +0 -1
- package/typescript/TabTitle/TabTitle.d.ts.map +0 -1
- package/typescript/TabTitle/index.d.ts.map +0 -1
- package/typescript/TableColumnHeader/TableColumnHeader.d.ts.map +0 -1
- package/typescript/TableColumnHeader/index.d.ts.map +0 -1
- package/typescript/Tag/Tag.d.ts.map +0 -1
- package/typescript/Task/Task.d.ts.map +0 -1
- package/typescript/Task/type.d.ts.map +0 -1
- package/typescript/Text/Text.d.ts.map +0 -1
- package/typescript/TextArea/TextArea.d.ts.map +0 -1
- package/typescript/Theme/ThemeProvider.d.ts.map +0 -1
- package/typescript/Theme/defaultTheme.d.ts.map +0 -1
- package/typescript/Timeline/Timeline.d.ts.map +0 -1
- package/typescript/Toast/Toast.d.ts.map +0 -1
- package/typescript/UserSwitcher/UserSwitcher.d.ts.map +0 -1
- package/typescript/UserSwitcher/index.d.ts.map +0 -1
- package/typescript/common.d.ts.map +0 -1
- package/typescript/index.d.ts.map +0 -1
package/module/Grid/Grid.base.js
CHANGED
|
@@ -1,61 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import memoize from 'memoize-one';
|
|
2
|
+
import { createElement, PureComponent } from 'react';
|
|
3
|
+
import { cancelTimeout, requestTimeout } from './timer';
|
|
4
|
+
import { getScrollbarSize, getRTLOffsetType } from './helper';
|
|
5
|
+
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
+
/* eslint-disable no-console */
|
|
8
|
+
|
|
9
|
+
const IS_SCROLLING_DEBOUNCE_INTERVAL = 150;
|
|
2
10
|
|
|
3
|
-
var __extends = this && this.__extends || function () {
|
|
4
|
-
var extendStatics = function (d, b) {
|
|
5
|
-
extendStatics = Object.setPrototypeOf || {
|
|
6
|
-
__proto__: []
|
|
7
|
-
} instanceof Array && function (d, b) {
|
|
8
|
-
d.__proto__ = b;
|
|
9
|
-
} || function (d, b) {
|
|
10
|
-
for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
11
|
-
};
|
|
12
|
-
return extendStatics(d, b);
|
|
13
|
-
};
|
|
14
|
-
return function (d, b) {
|
|
15
|
-
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
16
|
-
extendStatics(d, b);
|
|
17
|
-
function __() {
|
|
18
|
-
this.constructor = d;
|
|
19
|
-
}
|
|
20
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
21
|
-
};
|
|
22
|
-
}();
|
|
23
|
-
var __assign = this && this.__assign || function () {
|
|
24
|
-
__assign = Object.assign || function (t) {
|
|
25
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
26
|
-
s = arguments[i];
|
|
27
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
28
|
-
}
|
|
29
|
-
return t;
|
|
30
|
-
};
|
|
31
|
-
return __assign.apply(this, arguments);
|
|
32
|
-
};
|
|
33
|
-
var __importDefault = this && this.__importDefault || function (mod) {
|
|
34
|
-
return mod && mod.__esModule ? mod : {
|
|
35
|
-
"default": mod
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", {
|
|
39
|
-
value: true
|
|
40
|
-
});
|
|
41
|
-
exports.default = createGridComponent;
|
|
42
|
-
var memoize_one_1 = __importDefault(require("memoize-one"));
|
|
43
|
-
var react_1 = require("react");
|
|
44
|
-
var timer_1 = require("./timer");
|
|
45
|
-
var helper_1 = require("./helper");
|
|
46
|
-
var IS_SCROLLING_DEBOUNCE_INTERVAL = 150;
|
|
47
11
|
// @ts-ignore
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
12
|
+
const defaultItemKey = ({
|
|
13
|
+
columnIndex,
|
|
14
|
+
data: _data,
|
|
15
|
+
rowIndex
|
|
16
|
+
}) => `${rowIndex}:${columnIndex}`;
|
|
54
17
|
// In DEV mode, this Set helps us only log a warning once per component instance.
|
|
55
18
|
// This avoids spamming the console every time a render happens.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
19
|
+
let devWarningsOverscanCount = null;
|
|
20
|
+
let devWarningsOverscanRowsColumnsCount = null;
|
|
21
|
+
let devWarningsTagName = null;
|
|
59
22
|
if (process.env.NODE_ENV !== 'production') {
|
|
60
23
|
if (typeof window !== 'undefined' && typeof window.WeakSet !== 'undefined') {
|
|
61
24
|
devWarningsOverscanCount = new WeakSet();
|
|
@@ -63,175 +26,63 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
63
26
|
devWarningsTagName = new WeakSet();
|
|
64
27
|
}
|
|
65
28
|
}
|
|
66
|
-
function createGridComponent(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return
|
|
84
|
-
|
|
29
|
+
export default function createGridComponent({
|
|
30
|
+
getColumnOffset,
|
|
31
|
+
getColumnStartIndexForOffset,
|
|
32
|
+
getColumnStopIndexForStartIndex,
|
|
33
|
+
getColumnWidth,
|
|
34
|
+
getEstimatedTotalHeight,
|
|
35
|
+
getEstimatedTotalWidth,
|
|
36
|
+
getOffsetForColumnAndAlignment,
|
|
37
|
+
getOffsetForRowAndAlignment,
|
|
38
|
+
getRowHeight,
|
|
39
|
+
getRowOffset,
|
|
40
|
+
getRowStartIndexForOffset,
|
|
41
|
+
getRowStopIndexForStartIndex,
|
|
42
|
+
initInstanceProps,
|
|
43
|
+
shouldResetStyleCacheOnItemSizeChange,
|
|
44
|
+
validateProps
|
|
45
|
+
}) {
|
|
46
|
+
return class Grid extends PureComponent {
|
|
47
|
+
_instanceProps = initInstanceProps(this.props, this);
|
|
48
|
+
_resetIsScrollingTimeoutId = null;
|
|
49
|
+
static defaultProps = {
|
|
50
|
+
direction: 'ltr',
|
|
51
|
+
itemData: undefined,
|
|
52
|
+
useIsScrolling: false
|
|
53
|
+
};
|
|
54
|
+
state = {
|
|
55
|
+
instance: this,
|
|
56
|
+
isScrolling: false,
|
|
57
|
+
horizontalScrollDirection: 'forward',
|
|
58
|
+
scrollLeft: typeof this.props.initialScrollLeft === 'number' ? this.props.initialScrollLeft : 0,
|
|
59
|
+
scrollTop: typeof this.props.initialScrollTop === 'number' ? this.props.initialScrollTop : 0,
|
|
60
|
+
scrollUpdateWasRequested: false,
|
|
61
|
+
verticalScrollDirection: 'forward'
|
|
62
|
+
};
|
|
63
|
+
|
|
85
64
|
// Always use explicit constructor for React components.
|
|
86
65
|
// It produces less code after transpilation. (#26)
|
|
87
66
|
// eslint-disable-next-line no-useless-constructor
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
_this._instanceProps = initInstanceProps(_this.props, _this);
|
|
91
|
-
_this._resetIsScrollingTimeoutId = null;
|
|
92
|
-
_this.state = {
|
|
93
|
-
instance: _this,
|
|
94
|
-
isScrolling: false,
|
|
95
|
-
horizontalScrollDirection: 'forward',
|
|
96
|
-
scrollLeft: typeof _this.props.initialScrollLeft === 'number' ? _this.props.initialScrollLeft : 0,
|
|
97
|
-
scrollTop: typeof _this.props.initialScrollTop === 'number' ? _this.props.initialScrollTop : 0,
|
|
98
|
-
scrollUpdateWasRequested: false,
|
|
99
|
-
verticalScrollDirection: 'forward'
|
|
100
|
-
};
|
|
101
|
-
_this._outerRefSetter = function (ref) {
|
|
102
|
-
var outerRef = _this.props.outerRef;
|
|
103
|
-
_this._outerRef = ref;
|
|
104
|
-
if (typeof outerRef === 'function') {
|
|
105
|
-
outerRef(ref);
|
|
106
|
-
} else if (outerRef != null && typeof outerRef === 'object' && Object.prototype.hasOwnProperty.call(outerRef, 'current')) {
|
|
107
|
-
outerRef.current = ref;
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
_this._onScroll = function (event) {
|
|
111
|
-
var _a = event.currentTarget,
|
|
112
|
-
clientHeight = _a.clientHeight,
|
|
113
|
-
clientWidth = _a.clientWidth,
|
|
114
|
-
scrollLeft = _a.scrollLeft,
|
|
115
|
-
scrollTop = _a.scrollTop,
|
|
116
|
-
scrollHeight = _a.scrollHeight,
|
|
117
|
-
scrollWidth = _a.scrollWidth;
|
|
118
|
-
_this.setState(function (prevState) {
|
|
119
|
-
if (prevState.scrollLeft === scrollLeft && prevState.scrollTop === scrollTop) {
|
|
120
|
-
// Scroll position may have been updated by cDM/cDU,
|
|
121
|
-
// In which case we don't need to trigger another render,
|
|
122
|
-
// And we don't want to update state.isScrolling.
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
var direction = _this.props.direction;
|
|
126
|
-
// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
|
|
127
|
-
// This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
|
|
128
|
-
// It's also easier for this component if we convert offsets to the same format as they would be in for ltr.
|
|
129
|
-
// So the simplest solution is to determine which browser behavior we're dealing with, and convert based on it.
|
|
130
|
-
var calculatedScrollLeft = scrollLeft;
|
|
131
|
-
if (direction === 'rtl') {
|
|
132
|
-
switch ((0, helper_1.getRTLOffsetType)()) {
|
|
133
|
-
case 'negative':
|
|
134
|
-
calculatedScrollLeft = -scrollLeft;
|
|
135
|
-
break;
|
|
136
|
-
case 'positive-descending':
|
|
137
|
-
calculatedScrollLeft = scrollWidth - clientWidth - scrollLeft;
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
// Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.
|
|
142
|
-
calculatedScrollLeft = Math.max(0, Math.min(calculatedScrollLeft, scrollWidth - clientWidth));
|
|
143
|
-
var calculatedScrollTop = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
|
|
144
|
-
return {
|
|
145
|
-
isScrolling: true,
|
|
146
|
-
horizontalScrollDirection: prevState.scrollLeft < scrollLeft ? 'forward' : 'backward',
|
|
147
|
-
scrollLeft: calculatedScrollLeft,
|
|
148
|
-
scrollTop: calculatedScrollTop,
|
|
149
|
-
verticalScrollDirection: prevState.scrollTop < scrollTop ? 'forward' : 'backward',
|
|
150
|
-
scrollUpdateWasRequested: false
|
|
151
|
-
};
|
|
152
|
-
}, _this._resetIsScrollingDebounced);
|
|
153
|
-
};
|
|
154
|
-
_this._getItemStyle = function (rowIndex, columnIndex) {
|
|
155
|
-
var _a = _this.props,
|
|
156
|
-
columnWidth = _a.columnWidth,
|
|
157
|
-
direction = _a.direction,
|
|
158
|
-
rowHeight = _a.rowHeight;
|
|
159
|
-
var itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && columnWidth, shouldResetStyleCacheOnItemSizeChange && direction, shouldResetStyleCacheOnItemSizeChange && rowHeight);
|
|
160
|
-
var key = "".concat(rowIndex, ":").concat(columnIndex);
|
|
161
|
-
var style;
|
|
162
|
-
if (Object.prototype.hasOwnProperty.call(itemStyleCache, key)) {
|
|
163
|
-
style = itemStyleCache[key];
|
|
164
|
-
} else {
|
|
165
|
-
var offset = getColumnOffset(_this.props, columnIndex, _this._instanceProps);
|
|
166
|
-
var isRtl = direction === 'rtl';
|
|
167
|
-
itemStyleCache[key] = style = {
|
|
168
|
-
position: 'absolute',
|
|
169
|
-
left: isRtl ? undefined : offset,
|
|
170
|
-
right: isRtl ? offset : undefined,
|
|
171
|
-
top: getRowOffset(_this.props, rowIndex, _this._instanceProps),
|
|
172
|
-
height: getRowHeight(_this.props, rowIndex, _this._instanceProps),
|
|
173
|
-
width: getColumnWidth(_this.props, columnIndex, _this._instanceProps)
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
return style || {};
|
|
177
|
-
};
|
|
178
|
-
_this._callOnScroll = (0, memoize_one_1.default)(function (scrollLeft, scrollTop, horizontalScrollDirection, verticalScrollDirection, scrollUpdateWasRequested) {
|
|
179
|
-
return _this.props.onScroll({
|
|
180
|
-
horizontalScrollDirection: horizontalScrollDirection,
|
|
181
|
-
scrollLeft: scrollLeft,
|
|
182
|
-
scrollTop: scrollTop,
|
|
183
|
-
verticalScrollDirection: verticalScrollDirection,
|
|
184
|
-
scrollUpdateWasRequested: scrollUpdateWasRequested
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
_this._callOnItemsRendered = (0, memoize_one_1.default)(function (overscanColumnStartIndex, overscanColumnStopIndex, overscanRowStartIndex, overscanRowStopIndex, visibleColumnStartIndex, visibleColumnStopIndex, visibleRowStartIndex, visibleRowStopIndex) {
|
|
188
|
-
return _this.props.onItemsRendered({
|
|
189
|
-
overscanColumnStartIndex: overscanColumnStartIndex,
|
|
190
|
-
overscanColumnStopIndex: overscanColumnStopIndex,
|
|
191
|
-
overscanRowStartIndex: overscanRowStartIndex,
|
|
192
|
-
overscanRowStopIndex: overscanRowStopIndex,
|
|
193
|
-
visibleColumnStartIndex: visibleColumnStartIndex,
|
|
194
|
-
visibleColumnStopIndex: visibleColumnStopIndex,
|
|
195
|
-
visibleRowStartIndex: visibleRowStartIndex,
|
|
196
|
-
visibleRowStopIndex: visibleRowStopIndex
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
_this._resetIsScrollingDebounced = function () {
|
|
200
|
-
if (_this._resetIsScrollingTimeoutId !== null) {
|
|
201
|
-
(0, timer_1.cancelTimeout)(_this._resetIsScrollingTimeoutId);
|
|
202
|
-
}
|
|
203
|
-
_this._resetIsScrollingTimeoutId = (0, timer_1.requestTimeout)(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL);
|
|
204
|
-
};
|
|
205
|
-
_this._resetIsScrolling = function () {
|
|
206
|
-
_this._resetIsScrollingTimeoutId = null;
|
|
207
|
-
_this.setState({
|
|
208
|
-
isScrolling: false
|
|
209
|
-
}, function () {
|
|
210
|
-
// Clear style cache after state update has been committed.
|
|
211
|
-
// This way we don't break pure sCU for items that don't use isScrolling param.
|
|
212
|
-
_this._getItemStyleCache(-1);
|
|
213
|
-
});
|
|
214
|
-
};
|
|
215
|
-
_this._getItemStyleCache = (0, memoize_one_1.default)(function (_, __, ___) {
|
|
216
|
-
return {};
|
|
217
|
-
});
|
|
218
|
-
return _this;
|
|
67
|
+
constructor(props) {
|
|
68
|
+
super(props);
|
|
219
69
|
}
|
|
220
|
-
|
|
70
|
+
static getDerivedStateFromProps(nextProps, prevState) {
|
|
221
71
|
validateSharedProps(nextProps, prevState);
|
|
222
72
|
validateProps(nextProps);
|
|
223
73
|
return null;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
74
|
+
}
|
|
75
|
+
scrollTo({
|
|
76
|
+
scrollLeft,
|
|
77
|
+
scrollTop
|
|
78
|
+
}) {
|
|
228
79
|
if (scrollLeft !== undefined) {
|
|
229
80
|
scrollLeft = Math.max(0, scrollLeft);
|
|
230
81
|
}
|
|
231
82
|
if (scrollTop !== undefined) {
|
|
232
83
|
scrollTop = Math.max(0, scrollTop);
|
|
233
84
|
}
|
|
234
|
-
this.setState(
|
|
85
|
+
this.setState(prevState => {
|
|
235
86
|
if (scrollLeft === undefined) {
|
|
236
87
|
scrollLeft = prevState.scrollLeft;
|
|
237
88
|
}
|
|
@@ -243,51 +94,55 @@ function createGridComponent(_a) {
|
|
|
243
94
|
}
|
|
244
95
|
return {
|
|
245
96
|
horizontalScrollDirection: prevState.scrollLeft < scrollLeft ? 'forward' : 'backward',
|
|
246
|
-
scrollLeft
|
|
247
|
-
scrollTop
|
|
97
|
+
scrollLeft,
|
|
98
|
+
scrollTop,
|
|
248
99
|
scrollUpdateWasRequested: true,
|
|
249
100
|
verticalScrollDirection: prevState.scrollTop < scrollTop ? 'forward' : 'backward'
|
|
250
101
|
};
|
|
251
102
|
}, this._resetIsScrollingDebounced);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
columnCount
|
|
260
|
-
height
|
|
261
|
-
rowCount
|
|
262
|
-
width
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
103
|
+
}
|
|
104
|
+
scrollToItem({
|
|
105
|
+
align = 'auto',
|
|
106
|
+
columnIndex,
|
|
107
|
+
rowIndex
|
|
108
|
+
}) {
|
|
109
|
+
const {
|
|
110
|
+
columnCount,
|
|
111
|
+
height,
|
|
112
|
+
rowCount,
|
|
113
|
+
width
|
|
114
|
+
} = this.props;
|
|
115
|
+
const {
|
|
116
|
+
scrollLeft,
|
|
117
|
+
scrollTop
|
|
118
|
+
} = this.state;
|
|
119
|
+
const scrollbarSize = getScrollbarSize();
|
|
267
120
|
if (columnIndex !== undefined) {
|
|
268
121
|
columnIndex = Math.max(0, Math.min(columnIndex, columnCount - 1));
|
|
269
122
|
}
|
|
270
123
|
if (rowIndex !== undefined) {
|
|
271
124
|
rowIndex = Math.max(0, Math.min(rowIndex, rowCount - 1));
|
|
272
125
|
}
|
|
273
|
-
|
|
274
|
-
|
|
126
|
+
const estimatedTotalHeight = getEstimatedTotalHeight(this.props, this._instanceProps);
|
|
127
|
+
const estimatedTotalWidth = getEstimatedTotalWidth(this.props, this._instanceProps);
|
|
128
|
+
|
|
275
129
|
// The scrollbar size should be considered when scrolling an item into view,
|
|
276
130
|
// to ensure it's fully visible.
|
|
277
131
|
// But we only need to account for its size when it's actually visible.
|
|
278
|
-
|
|
279
|
-
|
|
132
|
+
const horizontalScrollbarSize = estimatedTotalWidth > width ? scrollbarSize : 0;
|
|
133
|
+
const verticalScrollbarSize = estimatedTotalHeight > height ? scrollbarSize : 0;
|
|
280
134
|
this.scrollTo({
|
|
281
135
|
scrollLeft: columnIndex !== undefined ? getOffsetForColumnAndAlignment(this.props, columnIndex, align, scrollLeft, this._instanceProps, verticalScrollbarSize) : scrollLeft,
|
|
282
136
|
scrollTop: rowIndex !== undefined ? getOffsetForRowAndAlignment(this.props, rowIndex, align, scrollTop, this._instanceProps, horizontalScrollbarSize) : scrollTop
|
|
283
137
|
});
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
initialScrollLeft
|
|
288
|
-
initialScrollTop
|
|
138
|
+
}
|
|
139
|
+
componentDidMount() {
|
|
140
|
+
const {
|
|
141
|
+
initialScrollLeft,
|
|
142
|
+
initialScrollTop
|
|
143
|
+
} = this.props;
|
|
289
144
|
if (this._outerRef != null) {
|
|
290
|
-
|
|
145
|
+
const outerRef = this._outerRef;
|
|
291
146
|
if (typeof initialScrollLeft === 'number') {
|
|
292
147
|
outerRef.scrollLeft = initialScrollLeft;
|
|
293
148
|
}
|
|
@@ -296,20 +151,23 @@ function createGridComponent(_a) {
|
|
|
296
151
|
}
|
|
297
152
|
}
|
|
298
153
|
this._callPropsCallbacks();
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
154
|
+
}
|
|
155
|
+
componentDidUpdate() {
|
|
156
|
+
const {
|
|
157
|
+
direction
|
|
158
|
+
} = this.props;
|
|
159
|
+
const {
|
|
160
|
+
scrollLeft,
|
|
161
|
+
scrollTop,
|
|
162
|
+
scrollUpdateWasRequested
|
|
163
|
+
} = this.state;
|
|
306
164
|
if (scrollUpdateWasRequested && this._outerRef != null) {
|
|
307
165
|
// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
|
|
308
166
|
// This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
|
|
309
167
|
// So we need to determine which browser behavior we're dealing with, and mimic it.
|
|
310
|
-
|
|
168
|
+
const outerRef = this._outerRef;
|
|
311
169
|
if (direction === 'rtl') {
|
|
312
|
-
switch (
|
|
170
|
+
switch (getRTLOffsetType()) {
|
|
313
171
|
case 'negative':
|
|
314
172
|
outerRef.scrollLeft = -scrollLeft;
|
|
315
173
|
break;
|
|
@@ -318,8 +176,10 @@ function createGridComponent(_a) {
|
|
|
318
176
|
break;
|
|
319
177
|
default:
|
|
320
178
|
{
|
|
321
|
-
|
|
322
|
-
|
|
179
|
+
const {
|
|
180
|
+
clientWidth,
|
|
181
|
+
scrollWidth
|
|
182
|
+
} = outerRef;
|
|
323
183
|
outerRef.scrollLeft = scrollWidth - clientWidth - scrollLeft;
|
|
324
184
|
break;
|
|
325
185
|
}
|
|
@@ -330,80 +190,81 @@ function createGridComponent(_a) {
|
|
|
330
190
|
outerRef.scrollTop = Math.max(0, scrollTop);
|
|
331
191
|
}
|
|
332
192
|
this._callPropsCallbacks();
|
|
333
|
-
}
|
|
334
|
-
|
|
193
|
+
}
|
|
194
|
+
componentWillUnmount() {
|
|
335
195
|
if (this._resetIsScrollingTimeoutId !== null) {
|
|
336
|
-
|
|
196
|
+
cancelTimeout(this._resetIsScrollingTimeoutId);
|
|
337
197
|
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
children
|
|
342
|
-
className
|
|
343
|
-
columnCount
|
|
344
|
-
direction
|
|
345
|
-
height
|
|
346
|
-
innerRef
|
|
347
|
-
innerElementType
|
|
348
|
-
innerTagName
|
|
349
|
-
itemData
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
rowStopIndex = _e[1];
|
|
366
|
-
var items = [];
|
|
198
|
+
}
|
|
199
|
+
render() {
|
|
200
|
+
const {
|
|
201
|
+
children,
|
|
202
|
+
className,
|
|
203
|
+
columnCount,
|
|
204
|
+
direction,
|
|
205
|
+
height,
|
|
206
|
+
innerRef,
|
|
207
|
+
innerElementType,
|
|
208
|
+
innerTagName,
|
|
209
|
+
itemData,
|
|
210
|
+
itemKey = defaultItemKey,
|
|
211
|
+
outerElementType,
|
|
212
|
+
outerTagName,
|
|
213
|
+
rowCount,
|
|
214
|
+
style,
|
|
215
|
+
testID,
|
|
216
|
+
useIsScrolling,
|
|
217
|
+
width
|
|
218
|
+
} = this.props;
|
|
219
|
+
const {
|
|
220
|
+
isScrolling
|
|
221
|
+
} = this.state;
|
|
222
|
+
const [columnStartIndex, columnStopIndex] = this._getHorizontalRangeToRender();
|
|
223
|
+
const [rowStartIndex, rowStopIndex] = this._getVerticalRangeToRender();
|
|
224
|
+
const items = [];
|
|
367
225
|
if (columnCount > 0 && rowCount) {
|
|
368
|
-
for (
|
|
369
|
-
for (
|
|
370
|
-
items.push(
|
|
371
|
-
columnIndex
|
|
226
|
+
for (let rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
|
|
227
|
+
for (let columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {
|
|
228
|
+
items.push(/*#__PURE__*/createElement(children, {
|
|
229
|
+
columnIndex,
|
|
372
230
|
data: itemData,
|
|
373
231
|
isScrolling: useIsScrolling ? isScrolling : undefined,
|
|
374
232
|
key: itemKey({
|
|
375
|
-
columnIndex
|
|
233
|
+
columnIndex,
|
|
376
234
|
data: itemData,
|
|
377
|
-
rowIndex
|
|
235
|
+
rowIndex
|
|
378
236
|
}),
|
|
379
|
-
rowIndex
|
|
237
|
+
rowIndex,
|
|
380
238
|
style: this._getItemStyle(rowIndex, columnIndex)
|
|
381
239
|
}));
|
|
382
240
|
}
|
|
383
241
|
}
|
|
384
242
|
}
|
|
243
|
+
|
|
385
244
|
// Read this value AFTER items have been created,
|
|
386
245
|
// So their actual sizes (if variable) are taken into consideration.
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
className
|
|
246
|
+
const estimatedTotalHeight = getEstimatedTotalHeight(this.props, this._instanceProps);
|
|
247
|
+
const estimatedTotalWidth = getEstimatedTotalWidth(this.props, this._instanceProps);
|
|
248
|
+
const outerRefSetter = {
|
|
249
|
+
className,
|
|
391
250
|
onScroll: this._onScroll,
|
|
392
251
|
ref: this._outerRefSetter,
|
|
393
|
-
style:
|
|
252
|
+
style: {
|
|
394
253
|
position: 'relative',
|
|
395
|
-
height
|
|
396
|
-
width
|
|
254
|
+
height,
|
|
255
|
+
width,
|
|
397
256
|
overflow: 'auto',
|
|
398
257
|
WebkitOverflowScrolling: 'touch',
|
|
399
258
|
willChange: 'transform',
|
|
400
|
-
direction
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
testID
|
|
405
|
-
|
|
406
|
-
|
|
259
|
+
direction,
|
|
260
|
+
...style
|
|
261
|
+
},
|
|
262
|
+
children: undefined,
|
|
263
|
+
...(testID && {
|
|
264
|
+
testID
|
|
265
|
+
})
|
|
266
|
+
};
|
|
267
|
+
const innerElement = {
|
|
407
268
|
children: items,
|
|
408
269
|
ref: innerRef,
|
|
409
270
|
style: {
|
|
@@ -412,57 +273,257 @@ function createGridComponent(_a) {
|
|
|
412
273
|
width: estimatedTotalWidth || 0
|
|
413
274
|
}
|
|
414
275
|
};
|
|
415
|
-
return
|
|
276
|
+
return /*#__PURE__*/createElement(outerElementType || outerTagName || 'div', outerRefSetter, /*#__PURE__*/createElement(innerElementType || innerTagName || 'div', innerElement));
|
|
277
|
+
}
|
|
278
|
+
_outerRefSetter = ref => {
|
|
279
|
+
const {
|
|
280
|
+
outerRef
|
|
281
|
+
} = this.props;
|
|
282
|
+
this._outerRef = ref;
|
|
283
|
+
if (typeof outerRef === 'function') {
|
|
284
|
+
outerRef(ref);
|
|
285
|
+
} else if (outerRef != null && typeof outerRef === 'object' && Object.prototype.hasOwnProperty.call(outerRef, 'current')) {
|
|
286
|
+
outerRef.current = ref;
|
|
287
|
+
}
|
|
416
288
|
};
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
289
|
+
_onScroll = event => {
|
|
290
|
+
const {
|
|
291
|
+
clientHeight,
|
|
292
|
+
clientWidth,
|
|
293
|
+
scrollLeft,
|
|
294
|
+
scrollTop,
|
|
295
|
+
scrollHeight,
|
|
296
|
+
scrollWidth
|
|
297
|
+
} = event.currentTarget;
|
|
298
|
+
this.setState(prevState => {
|
|
299
|
+
if (prevState.scrollLeft === scrollLeft && prevState.scrollTop === scrollTop) {
|
|
300
|
+
// Scroll position may have been updated by cDM/cDU,
|
|
301
|
+
// In which case we don't need to trigger another render,
|
|
302
|
+
// And we don't want to update state.isScrolling.
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
const {
|
|
306
|
+
direction
|
|
307
|
+
} = this.props;
|
|
308
|
+
|
|
309
|
+
// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
|
|
310
|
+
// This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
|
|
311
|
+
// It's also easier for this component if we convert offsets to the same format as they would be in for ltr.
|
|
312
|
+
// So the simplest solution is to determine which browser behavior we're dealing with, and convert based on it.
|
|
313
|
+
let calculatedScrollLeft = scrollLeft;
|
|
314
|
+
if (direction === 'rtl') {
|
|
315
|
+
switch (getRTLOffsetType()) {
|
|
316
|
+
case 'negative':
|
|
317
|
+
calculatedScrollLeft = -scrollLeft;
|
|
318
|
+
break;
|
|
319
|
+
case 'positive-descending':
|
|
320
|
+
calculatedScrollLeft = scrollWidth - clientWidth - scrollLeft;
|
|
321
|
+
break;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.
|
|
326
|
+
calculatedScrollLeft = Math.max(0, Math.min(calculatedScrollLeft, scrollWidth - clientWidth));
|
|
327
|
+
const calculatedScrollTop = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
|
|
328
|
+
return {
|
|
329
|
+
isScrolling: true,
|
|
330
|
+
horizontalScrollDirection: prevState.scrollLeft < scrollLeft ? 'forward' : 'backward',
|
|
331
|
+
scrollLeft: calculatedScrollLeft,
|
|
332
|
+
scrollTop: calculatedScrollTop,
|
|
333
|
+
verticalScrollDirection: prevState.scrollTop < scrollTop ? 'forward' : 'backward',
|
|
334
|
+
scrollUpdateWasRequested: false
|
|
335
|
+
};
|
|
336
|
+
}, this._resetIsScrollingDebounced);
|
|
337
|
+
};
|
|
338
|
+
_getItemStyle = (rowIndex, columnIndex) => {
|
|
339
|
+
const {
|
|
340
|
+
columnWidth,
|
|
341
|
+
direction,
|
|
342
|
+
rowHeight
|
|
343
|
+
} = this.props;
|
|
344
|
+
const itemStyleCache = this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && columnWidth, shouldResetStyleCacheOnItemSizeChange && direction, shouldResetStyleCacheOnItemSizeChange && rowHeight);
|
|
345
|
+
const key = `${rowIndex}:${columnIndex}`;
|
|
346
|
+
let style;
|
|
347
|
+
if (Object.prototype.hasOwnProperty.call(itemStyleCache, key)) {
|
|
348
|
+
style = itemStyleCache[key];
|
|
349
|
+
} else {
|
|
350
|
+
const offset = getColumnOffset(this.props, columnIndex, this._instanceProps);
|
|
351
|
+
const isRtl = direction === 'rtl';
|
|
352
|
+
itemStyleCache[key] = style = {
|
|
353
|
+
position: 'absolute',
|
|
354
|
+
left: isRtl ? undefined : offset,
|
|
355
|
+
right: isRtl ? offset : undefined,
|
|
356
|
+
top: getRowOffset(this.props, rowIndex, this._instanceProps),
|
|
357
|
+
height: getRowHeight(this.props, rowIndex, this._instanceProps),
|
|
358
|
+
width: getColumnWidth(this.props, columnIndex, this._instanceProps)
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
return style || {};
|
|
362
|
+
};
|
|
363
|
+
_callPropsCallbacks() {
|
|
364
|
+
const {
|
|
365
|
+
columnCount,
|
|
366
|
+
onItemsRendered,
|
|
367
|
+
onScroll,
|
|
368
|
+
rowCount
|
|
369
|
+
} = this.props;
|
|
423
370
|
if (typeof onItemsRendered === 'function') {
|
|
424
371
|
if (columnCount > 0 && rowCount > 0) {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
overscanColumnStopIndex = _c[1],
|
|
428
|
-
visibleColumnStartIndex = _c[2],
|
|
429
|
-
visibleColumnStopIndex = _c[3];
|
|
430
|
-
var _d = this._getVerticalRangeToRender(),
|
|
431
|
-
overscanRowStartIndex = _d[0],
|
|
432
|
-
overscanRowStopIndex = _d[1],
|
|
433
|
-
visibleRowStartIndex = _d[2],
|
|
434
|
-
visibleRowStopIndex = _d[3];
|
|
372
|
+
const [overscanColumnStartIndex, overscanColumnStopIndex, visibleColumnStartIndex, visibleColumnStopIndex] = this._getHorizontalRangeToRender();
|
|
373
|
+
const [overscanRowStartIndex, overscanRowStopIndex, visibleRowStartIndex, visibleRowStopIndex] = this._getVerticalRangeToRender();
|
|
435
374
|
this._callOnItemsRendered(overscanColumnStartIndex, overscanColumnStopIndex, overscanRowStartIndex, overscanRowStopIndex, visibleColumnStartIndex, visibleColumnStopIndex, visibleRowStartIndex, visibleRowStopIndex);
|
|
436
375
|
}
|
|
437
376
|
}
|
|
438
377
|
if (typeof onScroll === 'function') {
|
|
439
|
-
|
|
440
|
-
horizontalScrollDirection
|
|
441
|
-
scrollLeft
|
|
442
|
-
scrollTop
|
|
443
|
-
scrollUpdateWasRequested
|
|
444
|
-
verticalScrollDirection
|
|
378
|
+
const {
|
|
379
|
+
horizontalScrollDirection,
|
|
380
|
+
scrollLeft,
|
|
381
|
+
scrollTop,
|
|
382
|
+
scrollUpdateWasRequested,
|
|
383
|
+
verticalScrollDirection
|
|
384
|
+
} = this.state;
|
|
445
385
|
this._callOnScroll(scrollLeft, scrollTop, horizontalScrollDirection, verticalScrollDirection, scrollUpdateWasRequested);
|
|
446
386
|
}
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
387
|
+
}
|
|
388
|
+
_callOnScroll = memoize((scrollLeft, scrollTop, horizontalScrollDirection, verticalScrollDirection, scrollUpdateWasRequested) => this.props.onScroll({
|
|
389
|
+
horizontalScrollDirection,
|
|
390
|
+
scrollLeft,
|
|
391
|
+
scrollTop,
|
|
392
|
+
verticalScrollDirection,
|
|
393
|
+
scrollUpdateWasRequested
|
|
394
|
+
}));
|
|
395
|
+
_callOnItemsRendered = memoize((overscanColumnStartIndex, overscanColumnStopIndex, overscanRowStartIndex, overscanRowStopIndex, visibleColumnStartIndex, visibleColumnStopIndex, visibleRowStartIndex, visibleRowStopIndex) => this.props.onItemsRendered({
|
|
396
|
+
overscanColumnStartIndex,
|
|
397
|
+
overscanColumnStopIndex,
|
|
398
|
+
overscanRowStartIndex,
|
|
399
|
+
overscanRowStopIndex,
|
|
400
|
+
visibleColumnStartIndex,
|
|
401
|
+
visibleColumnStopIndex,
|
|
402
|
+
visibleRowStartIndex,
|
|
403
|
+
visibleRowStopIndex
|
|
404
|
+
}));
|
|
405
|
+
_getVerticalRangeToRender() {
|
|
406
|
+
const {
|
|
407
|
+
columnCount,
|
|
408
|
+
overscanCount,
|
|
409
|
+
overscanRowCount,
|
|
410
|
+
overscanRowsCount,
|
|
411
|
+
rowCount
|
|
412
|
+
} = this.props;
|
|
413
|
+
const {
|
|
414
|
+
isScrolling,
|
|
415
|
+
verticalScrollDirection,
|
|
416
|
+
scrollTop
|
|
417
|
+
} = this.state;
|
|
418
|
+
const overscanCountResolved = overscanRowCount || overscanRowsCount || overscanCount || 1;
|
|
460
419
|
if (columnCount === 0 || rowCount === 0) {
|
|
461
420
|
return [0, 0, 0, 0];
|
|
462
421
|
}
|
|
463
|
-
|
|
464
|
-
|
|
422
|
+
const startIndex = getRowStartIndexForOffset(this.props, scrollTop, this._instanceProps);
|
|
423
|
+
const stopIndex = getRowStopIndexForStartIndex(this.props, startIndex, scrollTop, this._instanceProps);
|
|
424
|
+
|
|
465
425
|
// Overscan by one item in each direction so that tab/focus works.
|
|
426
|
+
// If there isn't at least one extra item, tab loops back around.
|
|
427
|
+
const overscanBackward = !isScrolling || verticalScrollDirection === 'backward' ? Math.max(1, overscanCountResolved) : 1;
|
|
428
|
+
const overscanForward = !isScrolling || verticalScrollDirection === 'forward' ? Math.max(1, overscanCountResolved) : 1;
|
|
429
|
+
return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(rowCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
|
|
430
|
+
}
|
|
431
|
+
_getHorizontalRangeToRender() {
|
|
432
|
+
const {
|
|
433
|
+
columnCount,
|
|
434
|
+
overscanColumnCount,
|
|
435
|
+
overscanColumnsCount,
|
|
436
|
+
overscanCount,
|
|
437
|
+
rowCount
|
|
438
|
+
} = this.props;
|
|
439
|
+
const {
|
|
440
|
+
horizontalScrollDirection,
|
|
441
|
+
isScrolling,
|
|
442
|
+
scrollLeft
|
|
443
|
+
} = this.state;
|
|
444
|
+
const overscanCountResolved = overscanColumnCount || overscanColumnsCount || overscanCount || 1;
|
|
445
|
+
if (columnCount === 0 || rowCount === 0) {
|
|
446
|
+
return [0, 0, 0, 0];
|
|
447
|
+
}
|
|
448
|
+
const startIndex = getColumnStartIndexForOffset(this.props, scrollLeft, this._instanceProps);
|
|
449
|
+
const stopIndex = getColumnStopIndexForStartIndex(this.props, startIndex, scrollLeft, this._instanceProps);
|
|
450
|
+
|
|
451
|
+
// Overscan by one item in each direction so that tab/focus works.
|
|
452
|
+
// If there isn't at least one extra item, tab loops back around.
|
|
453
|
+
const overscanBackward = !isScrolling || horizontalScrollDirection === 'backward' ? Math.max(1, overscanCountResolved) : 1;
|
|
454
|
+
const overscanForward = !isScrolling || horizontalScrollDirection === 'forward' ? Math.max(1, overscanCountResolved) : 1;
|
|
455
|
+
return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(columnCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
|
|
456
|
+
}
|
|
457
|
+
_resetIsScrollingDebounced = () => {
|
|
458
|
+
if (this._resetIsScrollingTimeoutId !== null) {
|
|
459
|
+
cancelTimeout(this._resetIsScrollingTimeoutId);
|
|
460
|
+
}
|
|
461
|
+
this._resetIsScrollingTimeoutId = requestTimeout(this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL);
|
|
462
|
+
};
|
|
463
|
+
_resetIsScrolling = () => {
|
|
464
|
+
this._resetIsScrollingTimeoutId = null;
|
|
465
|
+
this.setState({
|
|
466
|
+
isScrolling: false
|
|
467
|
+
}, () => {
|
|
468
|
+
// Clear style cache after state update has been committed.
|
|
469
|
+
// This way we don't break pure sCU for items that don't use isScrolling param.
|
|
470
|
+
this._getItemStyleCache(-1);
|
|
471
|
+
});
|
|
472
|
+
};
|
|
473
|
+
_getItemStyleCache = memoize((_, __, ___) => ({}));
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
const validateSharedProps = ({
|
|
477
|
+
children,
|
|
478
|
+
direction,
|
|
479
|
+
height,
|
|
480
|
+
innerTagName,
|
|
481
|
+
outerTagName,
|
|
482
|
+
overscanColumnsCount,
|
|
483
|
+
overscanCount,
|
|
484
|
+
overscanRowsCount,
|
|
485
|
+
width
|
|
486
|
+
}, {
|
|
487
|
+
instance
|
|
488
|
+
}) => {
|
|
489
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
490
|
+
if (typeof overscanCount === 'number') {
|
|
491
|
+
if (devWarningsOverscanCount && !devWarningsOverscanCount.has(instance)) {
|
|
492
|
+
devWarningsOverscanCount.add(instance);
|
|
493
|
+
console.warn('The overscanCount prop has been deprecated. ' + 'Please use the overscanColumnCount and overscanRowCount props instead.');
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
if (typeof overscanColumnsCount === 'number' || typeof overscanRowsCount === 'number') {
|
|
497
|
+
if (devWarningsOverscanRowsColumnsCount && !devWarningsOverscanRowsColumnsCount.has(instance)) {
|
|
498
|
+
devWarningsOverscanRowsColumnsCount.add(instance);
|
|
499
|
+
console.warn('The overscanColumnsCount and overscanRowsCount props have been deprecated. ' + 'Please use the overscanColumnCount and overscanRowCount props instead.');
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
if (innerTagName != null || outerTagName != null) {
|
|
503
|
+
if (devWarningsTagName && !devWarningsTagName.has(instance)) {
|
|
504
|
+
devWarningsTagName.add(instance);
|
|
505
|
+
console.warn('The innerTagName and outerTagName props have been deprecated. ' + 'Please use the innerElementType and outerElementType props instead.');
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
if (children == null) {
|
|
509
|
+
throw Error('An invalid "children" prop has been specified. ' + 'Value should be a React component. ' + `"${children === null ? 'null' : typeof children}" was specified.`);
|
|
510
|
+
}
|
|
511
|
+
switch (direction) {
|
|
512
|
+
case 'ltr':
|
|
513
|
+
case 'rtl':
|
|
514
|
+
// Valid values
|
|
515
|
+
break;
|
|
516
|
+
default:
|
|
517
|
+
throw Error('An invalid "direction" prop has been specified. ' + 'Value should be either "ltr" or "rtl". ' + `"${direction}" was specified.`);
|
|
518
|
+
}
|
|
519
|
+
if (typeof width !== 'number') {
|
|
520
|
+
throw Error('An invalid "width" prop has been specified. ' + 'Grids must specify a number for width. ' + `"${width === null ? 'null' : typeof width}" was specified.`);
|
|
521
|
+
}
|
|
522
|
+
if (typeof height !== 'number') {
|
|
523
|
+
throw Error('An invalid "height" prop has been specified. ' + 'Grids must specify a number for height. ' + `"${height === null ? 'null' : typeof height}" was specified.`);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
};
|
|
466
527
|
// If there isn't at least one extra item, tab loops back around.
|
|
467
528
|
var overscanBackward = !isScrolling || verticalScrollDirection === 'backward' ? Math.max(1, overscanCountResolved) : 1;
|
|
468
529
|
var overscanForward = !isScrolling || verticalScrollDirection === 'forward' ? Math.max(1, overscanCountResolved) : 1;
|
|
@@ -547,4 +608,3 @@ var validateSharedProps = function (_a, _b) {
|
|
|
547
608
|
}
|
|
548
609
|
}
|
|
549
610
|
};
|
|
550
|
-
//# sourceMappingURL=Grid.base.js.map
|