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