@hazelcast/ui 3.0.1-canary.0 → 3.0.1-canary.2
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/lib/components/Alert.js +50 -116
- package/lib/components/Alert.js.map +1 -1
- package/lib/components/Alert.module.scss +141 -0
- package/lib/components/AppHeader/AppHeader.js +17 -39
- package/lib/components/AppHeader/AppHeader.js.map +1 -1
- package/lib/components/AppHeader/AppHeader.module.scss +29 -0
- package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.js +7 -24
- package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.js.map +1 -1
- package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.module.scss +29 -0
- package/lib/components/AppHeader/AppHeaderLogo/index.js +2 -8
- package/lib/components/AppHeader/AppHeaderLogo/index.js.map +1 -1
- package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.js +14 -46
- package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.js.map +1 -1
- package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.module.scss +20 -0
- package/lib/components/AppHeader/AppHeaderMenu/index.js +2 -8
- package/lib/components/AppHeader/AppHeaderMenu/index.js.map +1 -1
- package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.js +9 -19
- package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.js.map +1 -1
- package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.module.scss +13 -0
- package/lib/components/AppHeader/EnvironmentBadge/index.js +2 -8
- package/lib/components/AppHeader/EnvironmentBadge/index.js.map +1 -1
- package/lib/components/AppHeader/SelectCluster/SelectCluster.js +32 -72
- package/lib/components/AppHeader/SelectCluster/SelectCluster.js.map +1 -1
- package/lib/components/AppHeader/SelectCluster/SelectCluster.module.scss +101 -0
- package/lib/components/AppHeader/SelectCluster/index.js +2 -8
- package/lib/components/AppHeader/SelectCluster/index.js.map +1 -1
- package/lib/components/AppHeader/index.js +2 -8
- package/lib/components/AppHeader/index.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebar.js +30 -56
- package/lib/components/AppSidebar/AppSidebar.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebar.module.scss +66 -0
- package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.js +21 -37
- package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.module.scss +16 -0
- package/lib/components/AppSidebar/AppSidebarFavoriteButton/index.js +2 -8
- package/lib/components/AppSidebar/AppSidebarFavoriteButton/index.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.js +10 -31
- package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.module.scss +13 -0
- package/lib/components/AppSidebar/AppSidebarFavorites/index.js +2 -8
- package/lib/components/AppSidebar/AppSidebarFavorites/index.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.js +22 -77
- package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.module.scss +92 -0
- package/lib/components/AppSidebar/AppSidebarItem/index.js +2 -8
- package/lib/components/AppSidebar/AppSidebarItem/index.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.js +6 -17
- package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.module.scss +24 -0
- package/lib/components/AppSidebar/AppSidebarMenuItemCounter/index.js +2 -8
- package/lib/components/AppSidebar/AppSidebarMenuItemCounter/index.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.js +14 -39
- package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.module.scss +58 -0
- package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSectionExpandable.js +53 -94
- package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSectionExpandable.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarSection/appSidebarSectionContext.js +3 -8
- package/lib/components/AppSidebar/AppSidebarSection/appSidebarSectionContext.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarSection/index.js +2 -8
- package/lib/components/AppSidebar/AppSidebarSection/index.js.map +1 -1
- package/lib/components/AppSidebar/appSidebarContext.js +9 -14
- package/lib/components/AppSidebar/appSidebarContext.js.map +1 -1
- package/lib/components/AppSidebar/index.js +6 -16
- package/lib/components/AppSidebar/index.js.map +1 -1
- package/lib/components/AutocompleteField.js +154 -229
- package/lib/components/AutocompleteField.js.map +1 -1
- package/lib/components/AutocompleteField.module.scss +164 -0
- package/lib/components/AutocompleteFieldFormik.js +18 -41
- package/lib/components/AutocompleteFieldFormik.js.map +1 -1
- package/lib/components/Badge.js +42 -66
- package/lib/components/Badge.js.map +1 -1
- package/lib/components/Badge.module.scss +55 -0
- package/lib/components/Button.js +42 -115
- package/lib/components/Button.js.map +1 -1
- package/lib/components/Button.module.scss +329 -0
- package/lib/components/Calendar/Calendar.js +23 -77
- package/lib/components/Calendar/Calendar.js.map +1 -1
- package/lib/components/Calendar/Calendar.module.scss +185 -0
- package/lib/components/Calendar/CalendarRange.js +12 -60
- package/lib/components/Calendar/CalendarRange.js.map +1 -1
- package/lib/components/Calendar/CalendarRange.module.scss +21 -0
- package/lib/components/Calendar/components/CalendarHeader.js +12 -35
- package/lib/components/Calendar/components/CalendarHeader.js.map +1 -1
- package/lib/components/Calendar/components/CalendarInput.js +9 -39
- package/lib/components/Calendar/components/CalendarInput.js.map +1 -1
- package/lib/components/Calendar/components/CalendarTime.js +66 -104
- package/lib/components/Calendar/components/CalendarTime.js.map +1 -1
- package/lib/components/Calendar/components/CalendarTime.module.scss +72 -0
- package/lib/components/Calendar/helpers/consts.js +100 -8
- package/lib/components/Calendar/helpers/consts.js.map +1 -1
- package/lib/components/Card.js +14 -60
- package/lib/components/Card.js.map +1 -1
- package/lib/components/Card.module.scss +92 -0
- package/lib/components/Carousel.js +27 -60
- package/lib/components/Carousel.js.map +1 -1
- package/lib/components/Carousel.module.scss +43 -0
- package/lib/components/CenteredLoader.js +6 -18
- package/lib/components/CenteredLoader.js.map +1 -1
- package/lib/components/CenteredLoader.module.scss +11 -0
- package/lib/components/Checkbox.js +26 -87
- package/lib/components/Checkbox.js.map +1 -1
- package/lib/components/Checkbox.module.scss +106 -0
- package/lib/components/CheckboxFormik.js +16 -37
- package/lib/components/CheckboxFormik.js.map +1 -1
- package/lib/components/CircularProgressBar.js +27 -78
- package/lib/components/CircularProgressBar.js.map +1 -1
- package/lib/components/CircularProgressBar.module.scss +37 -0
- package/lib/components/ContextMenu.js +60 -86
- package/lib/components/ContextMenu.js.map +1 -1
- package/lib/components/ContextMenu.module.scss +37 -0
- package/lib/components/Dialog.js +30 -50
- package/lib/components/Dialog.js.map +1 -1
- package/lib/components/Dialog.module.scss +62 -0
- package/lib/components/EmptyState.js +20 -66
- package/lib/components/EmptyState.js.map +1 -1
- package/lib/components/EmptyState.module.scss +87 -0
- package/lib/components/Error.js +7 -28
- package/lib/components/Error.js.map +1 -1
- package/lib/components/Error.module.scss +12 -0
- package/lib/components/FieldHeader.js +14 -43
- package/lib/components/FieldHeader.js.map +1 -1
- package/lib/components/FieldHeader.module.scss +20 -0
- package/lib/components/Help.js +13 -42
- package/lib/components/Help.js.map +1 -1
- package/lib/components/Help.module.scss +9 -0
- package/lib/components/Icon.js +25 -48
- package/lib/components/Icon.js.map +1 -1
- package/lib/components/Icon.module.scss +33 -0
- package/lib/components/IconButton.js +23 -81
- package/lib/components/IconButton.js.map +1 -1
- package/lib/components/IconButton.module.scss +59 -0
- package/lib/components/InteractiveList.js +41 -115
- package/lib/components/InteractiveList.js.map +1 -1
- package/lib/components/InteractiveList.module.scss +72 -0
- package/lib/components/InteractiveListFormik.js +81 -110
- package/lib/components/InteractiveListFormik.js.map +1 -1
- package/lib/components/Label.js +5 -20
- package/lib/components/Label.js.map +1 -1
- package/lib/components/Label.module.scss +12 -0
- package/lib/components/Link.js +31 -59
- package/lib/components/Link.js.map +1 -1
- package/lib/components/Link.module.scss +64 -0
- package/lib/components/Loader.js +23 -82
- package/lib/components/Loader.js.map +1 -1
- package/lib/components/Loader.module.scss +74 -0
- package/lib/components/Modal.js +26 -93
- package/lib/components/Modal.js.map +1 -1
- package/lib/components/Modal.module.scss +109 -0
- package/lib/components/Notification.js +37 -75
- package/lib/components/Notification.js.map +1 -1
- package/lib/components/Notification.module.scss +97 -0
- package/lib/components/NumberBadge.js +7 -18
- package/lib/components/NumberBadge.js.map +1 -1
- package/lib/components/NumberBadge.module.scss +13 -0
- package/lib/components/NumberField.js +140 -181
- package/lib/components/NumberField.js.map +1 -1
- package/lib/components/NumberField.module.scss +76 -0
- package/lib/components/NumberFieldFormik.js +49 -69
- package/lib/components/NumberFieldFormik.js.map +1 -1
- package/lib/components/Overlay.js +29 -92
- package/lib/components/Overlay.js.map +1 -1
- package/lib/components/Overlay.module.scss +108 -0
- package/lib/components/Pagination.js +91 -198
- package/lib/components/Pagination.js.map +1 -1
- package/lib/components/Pagination.module.scss +117 -0
- package/lib/components/PasswordField.js +25 -61
- package/lib/components/PasswordField.js.map +1 -1
- package/lib/components/PasswordField.module.scss +26 -0
- package/lib/components/PasswordFieldFormik.js +16 -37
- package/lib/components/PasswordFieldFormik.js.map +1 -1
- package/lib/components/Popover.js +67 -85
- package/lib/components/Popover.js.map +1 -1
- package/lib/components/Popover.module.scss +12 -0
- package/lib/components/Radio.js +26 -67
- package/lib/components/Radio.js.map +1 -1
- package/lib/components/Radio.module.scss +112 -0
- package/lib/components/RadioFormik.js +11 -26
- package/lib/components/RadioFormik.js.map +1 -1
- package/lib/components/RadioGroup.js +18 -51
- package/lib/components/RadioGroup.js.map +1 -1
- package/lib/components/RadioGroup.module.scss +21 -0
- package/lib/components/RadioGroupContext.js +3 -10
- package/lib/components/RadioGroupContext.js.map +1 -1
- package/lib/components/RadioGroupFormik.js +16 -34
- package/lib/components/RadioGroupFormik.js.map +1 -1
- package/lib/components/SegmentedControl.js +9 -43
- package/lib/components/SegmentedControl.js.map +1 -1
- package/lib/components/SegmentedControl.module.scss +81 -0
- package/lib/components/SegmentedControlFormik.js +12 -30
- package/lib/components/SegmentedControlFormik.js.map +1 -1
- package/lib/components/Select/CheckableSelectField.js +74 -178
- package/lib/components/Select/CheckableSelectField.js.map +1 -1
- package/lib/components/Select/CheckableSelectField.module.scss +100 -0
- package/lib/components/Select/CheckableSelectFieldFormik.js +18 -41
- package/lib/components/Select/CheckableSelectFieldFormik.js.map +1 -1
- package/lib/components/Select/Common.js +44 -87
- package/lib/components/Select/Common.js.map +1 -1
- package/lib/components/Select/Common.module.scss +69 -0
- package/lib/components/Select/MultiSelectField.js +107 -187
- package/lib/components/Select/MultiSelectField.js.map +1 -1
- package/lib/components/Select/MultiSelectField.module.scss +72 -0
- package/lib/components/Select/MultiSelectFieldFormik.js +18 -41
- package/lib/components/Select/MultiSelectFieldFormik.js.map +1 -1
- package/lib/components/Select/SelectField.js +100 -169
- package/lib/components/Select/SelectField.js.map +1 -1
- package/lib/components/Select/SelectField.module.scss +194 -0
- package/lib/components/Select/SelectFieldFormik.js +18 -38
- package/lib/components/Select/SelectFieldFormik.js.map +1 -1
- package/lib/components/Select/helpers.js +25 -30
- package/lib/components/Select/helpers.js.map +1 -1
- package/lib/components/Select/index.js +8 -21
- package/lib/components/Select/index.js.map +1 -1
- package/lib/components/SimpleTable.js +13 -36
- package/lib/components/SimpleTable.js.map +1 -1
- package/lib/components/SimpleTable.module.scss +28 -0
- package/lib/components/Slider.js +173 -294
- package/lib/components/Slider.js.map +1 -1
- package/lib/components/Slider.module.scss +277 -0
- package/lib/components/SliderFormik.js +13 -30
- package/lib/components/SliderFormik.js.map +1 -1
- package/lib/components/Table/Cell.js +58 -111
- package/lib/components/Table/Cell.js.map +1 -1
- package/lib/components/Table/Cell.module.scss +61 -0
- package/lib/components/Table/CellWrapper.js +27 -44
- package/lib/components/Table/CellWrapper.js.map +1 -1
- package/lib/components/Table/EnhancedRenderers.js +12 -31
- package/lib/components/Table/EnhancedRenderers.js.map +1 -1
- package/lib/components/Table/Header.js +92 -141
- package/lib/components/Table/Header.js.map +1 -1
- package/lib/components/Table/Header.module.scss +128 -0
- package/lib/components/Table/Row.js +22 -77
- package/lib/components/Table/Row.js.map +1 -1
- package/lib/components/Table/Row.module.scss +59 -0
- package/lib/components/Table/Table.js +245 -456
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Table/Table.module.scss +31 -0
- package/lib/components/Table/TableContent.js +57 -129
- package/lib/components/Table/TableContent.js.map +1 -1
- package/lib/components/Table/TableContent.module.scss +21 -0
- package/lib/components/Table/constants.js +3 -8
- package/lib/components/Table/constants.js.map +1 -1
- package/lib/components/Table/features/columnsSelection/CellCopyablePopover.js +12 -39
- package/lib/components/Table/features/columnsSelection/CellCopyablePopover.js.map +1 -1
- package/lib/components/Table/features/columnsSelection/CellCopyablePopover.module.scss +12 -0
- package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.js +16 -23
- package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.js.map +1 -1
- package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.module.scss +6 -0
- package/lib/components/Table/features/columnsSelection/ContextMenu/index.js +2 -8
- package/lib/components/Table/features/columnsSelection/ContextMenu/index.js.map +1 -1
- package/lib/components/Table/features/columnsSelection/columnsSelection.js +68 -76
- package/lib/components/Table/features/columnsSelection/columnsSelection.js.map +1 -1
- package/lib/components/Table/features/columnsSelection/helpers.js +22 -28
- package/lib/components/Table/features/columnsSelection/helpers.js.map +1 -1
- package/lib/components/Table/features/columnsSelection/index.js +5 -16
- package/lib/components/Table/features/columnsSelection/index.js.map +1 -1
- package/lib/components/Table/helpers.js +9 -17
- package/lib/components/Table/helpers.js.map +1 -1
- package/lib/components/Table/tableTypes.js +2 -3
- package/lib/components/Table/tableTypes.js.map +1 -1
- package/lib/components/Table/useTrackTableState.js +29 -43
- package/lib/components/Table/useTrackTableState.js.map +1 -1
- package/lib/components/Table/utils.js +111 -176
- package/lib/components/Table/utils.js.map +1 -1
- package/lib/components/Tabs/Tab.js +27 -61
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/Tab.module.scss +58 -0
- package/lib/components/Tabs/TabContext.js +26 -51
- package/lib/components/Tabs/TabContext.js.map +1 -1
- package/lib/components/Tabs/TabList.js +49 -62
- package/lib/components/Tabs/TabList.js.map +1 -1
- package/lib/components/Tabs/TabList.module.scss +3 -0
- package/lib/components/Tabs/TabPanel.js +9 -29
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/TabPanel.module.scss +7 -0
- package/lib/components/Tabs/index.js +5 -20
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/Terminal.js +108 -179
- package/lib/components/Terminal.js.map +1 -1
- package/lib/components/Terminal.module.scss +109 -0
- package/lib/components/TextArea.js +24 -79
- package/lib/components/TextArea.js.map +1 -1
- package/lib/components/TextArea.module.scss +144 -0
- package/lib/components/TextAreaFormik.js +10 -26
- package/lib/components/TextAreaFormik.js.map +1 -1
- package/lib/components/TextField.js +48 -154
- package/lib/components/TextField.js.map +1 -1
- package/lib/components/TextField.module.scss +209 -0
- package/lib/components/TextFieldFormik.js +22 -46
- package/lib/components/TextFieldFormik.js.map +1 -1
- package/lib/components/TimeField.js +14 -62
- package/lib/components/TimeField.js.map +1 -1
- package/lib/components/TimeField.module.scss +4 -0
- package/lib/components/TimeFieldFormik.js +10 -26
- package/lib/components/TimeFieldFormik.js.map +1 -1
- package/lib/components/Toast.js +44 -79
- package/lib/components/Toast.js.map +1 -1
- package/lib/components/Toast.module.scss +53 -0
- package/lib/components/Toggle.js +21 -71
- package/lib/components/Toggle.js.map +1 -1
- package/lib/components/Toggle.module.scss +175 -0
- package/lib/components/ToggleFormik.js +11 -27
- package/lib/components/ToggleFormik.js.map +1 -1
- package/lib/components/Tooltip.js +39 -79
- package/lib/components/Tooltip.js.map +1 -1
- package/lib/components/Tooltip.module.scss +44 -0
- package/lib/components/TruncatedText.js +22 -49
- package/lib/components/TruncatedText.js.map +1 -1
- package/lib/components/TruncatedText.module.scss +9 -0
- package/lib/helpers/array.js +17 -26
- package/lib/helpers/array.js.map +1 -1
- package/lib/helpers/escapeHtml.js +6 -10
- package/lib/helpers/escapeHtml.js.map +1 -1
- package/lib/helpers/forms.js +14 -20
- package/lib/helpers/forms.js.map +1 -1
- package/lib/helpers/math.js +6 -10
- package/lib/helpers/math.js.map +1 -1
- package/lib/helpers/types.js +2 -6
- package/lib/helpers/types.js.map +1 -1
- package/lib/hooks/index.js +7 -17
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useCloseOnResize.js +12 -17
- package/lib/hooks/useCloseOnResize.js.map +1 -1
- package/lib/hooks/useDeepCompareMemo.js +7 -12
- package/lib/hooks/useDeepCompareMemo.js.map +1 -1
- package/lib/hooks/useDeepEqual.js +9 -14
- package/lib/hooks/useDeepEqual.js.map +1 -1
- package/lib/hooks/useDimensions.js +15 -26
- package/lib/hooks/useDimensions.js.map +1 -1
- package/lib/hooks/useIsMounted.js +11 -16
- package/lib/hooks/useIsMounted.js.map +1 -1
- package/lib/hooks/useOnClickOutside.js +32 -41
- package/lib/hooks/useOnClickOutside.js.map +1 -1
- package/lib/hooks/useOpenCloseState.js +13 -18
- package/lib/hooks/useOpenCloseState.js.map +1 -1
- package/lib/hooks/usePagination.js +60 -64
- package/lib/hooks/usePagination.js.map +1 -1
- package/lib/hooks/usePersistedState.js +33 -35
- package/lib/hooks/usePersistedState.js.map +1 -1
- package/lib/hooks/usePrevious.js +8 -13
- package/lib/hooks/usePrevious.js.map +1 -1
- package/lib/hooks/useRefValue.js +8 -13
- package/lib/hooks/useRefValue.js.map +1 -1
- package/lib/icons/Cluster.js +7 -44
- package/lib/icons/Cluster.js.map +1 -1
- package/lib/icons/Compare.js +7 -46
- package/lib/icons/Compare.js.map +1 -1
- package/lib/icons/Compute.js +7 -43
- package/lib/icons/Compute.js.map +1 -1
- package/lib/icons/Folder.js +4 -25
- package/lib/icons/Folder.js.map +1 -1
- package/lib/icons/PlusCircle.js +6 -37
- package/lib/icons/PlusCircle.js.map +1 -1
- package/lib/icons/Streaming.js +8 -45
- package/lib/icons/Streaming.js.map +1 -1
- package/lib/index.js +71 -178
- package/lib/index.js.map +1 -1
- package/lib/services/logger.js +75 -85
- package/lib/services/logger.js.map +1 -1
- package/lib/services/time.js +14 -18
- package/lib/services/time.js.map +1 -1
- package/lib/test-helpers/index.d.ts +3 -0
- package/lib/test-helpers/index.js +4 -0
- package/lib/test-helpers/index.js.map +1 -0
- package/lib/test-helpers/render.d.ts +10 -0
- package/lib/test-helpers/render.js +24 -0
- package/lib/test-helpers/render.js.map +1 -0
- package/lib/test-helpers/time.d.ts +1 -0
- package/lib/test-helpers/time.js +2 -0
- package/lib/test-helpers/time.js.map +1 -0
- package/lib/test-helpers/utils.d.ts +5 -0
- package/lib/test-helpers/utils.js +11 -0
- package/lib/test-helpers/utils.js.map +1 -0
- package/lib/types.js +2 -3
- package/lib/types.js.map +1 -1
- package/lib/utils/formik.js +7 -12
- package/lib/utils/formik.js.map +1 -1
- package/lib/utils/keyboard.js +3 -8
- package/lib/utils/keyboard.js.map +1 -1
- package/lib/utils/portal.js +14 -19
- package/lib/utils/portal.js.map +1 -1
- package/lib/utils/ssr.js +2 -6
- package/lib/utils/ssr.js.map +1 -1
- package/lib/utils/types.js +2 -3
- package/lib/utils/types.js.map +1 -1
- package/package.json +3 -2
- package/lib/components/Alert.module.scss.js +0 -8
- package/lib/components/Alert.module.scss.js.map +0 -1
- package/lib/components/AppHeader/AppHeader.module.scss.js +0 -8
- package/lib/components/AppHeader/AppHeader.module.scss.js.map +0 -1
- package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.module.scss.js +0 -8
- package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.module.scss.js.map +0 -1
- package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.module.scss.js +0 -8
- package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.module.scss.js.map +0 -1
- package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.module.scss.js +0 -8
- package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.module.scss.js.map +0 -1
- package/lib/components/AppHeader/SelectCluster/SelectCluster.module.scss.js +0 -8
- package/lib/components/AppHeader/SelectCluster/SelectCluster.module.scss.js.map +0 -1
- package/lib/components/AppSidebar/AppSidebar.module.scss.js +0 -8
- package/lib/components/AppSidebar/AppSidebar.module.scss.js.map +0 -1
- package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.module.scss.js +0 -8
- package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.module.scss.js.map +0 -1
- package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.module.scss.js +0 -8
- package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.module.scss.js.map +0 -1
- package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.module.scss.js +0 -8
- package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.module.scss.js.map +0 -1
- package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.module.scss.js +0 -8
- package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.module.scss.js.map +0 -1
- package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.module.scss.js +0 -8
- package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.module.scss.js.map +0 -1
- package/lib/components/AutocompleteField.module.scss.js +0 -8
- package/lib/components/AutocompleteField.module.scss.js.map +0 -1
- package/lib/components/Badge.module.scss.js +0 -8
- package/lib/components/Badge.module.scss.js.map +0 -1
- package/lib/components/Button.module.scss.js +0 -8
- package/lib/components/Button.module.scss.js.map +0 -1
- package/lib/components/Calendar/Calendar.module.scss.js +0 -8
- package/lib/components/Calendar/Calendar.module.scss.js.map +0 -1
- package/lib/components/Calendar/CalendarRange.module.scss.js +0 -8
- package/lib/components/Calendar/CalendarRange.module.scss.js.map +0 -1
- package/lib/components/Calendar/components/CalendarTime.module.scss.js +0 -8
- package/lib/components/Calendar/components/CalendarTime.module.scss.js.map +0 -1
- package/lib/components/Card.module.scss.js +0 -8
- package/lib/components/Card.module.scss.js.map +0 -1
- package/lib/components/Carousel.module.scss.js +0 -8
- package/lib/components/Carousel.module.scss.js.map +0 -1
- package/lib/components/CenteredLoader.module.scss.js +0 -8
- package/lib/components/CenteredLoader.module.scss.js.map +0 -1
- package/lib/components/Checkbox.module.scss.js +0 -8
- package/lib/components/Checkbox.module.scss.js.map +0 -1
- package/lib/components/CircularProgressBar.module.scss.js +0 -8
- package/lib/components/CircularProgressBar.module.scss.js.map +0 -1
- package/lib/components/ContextMenu.module.scss.js +0 -8
- package/lib/components/ContextMenu.module.scss.js.map +0 -1
- package/lib/components/Dialog.module.scss.js +0 -8
- package/lib/components/Dialog.module.scss.js.map +0 -1
- package/lib/components/EmptyState.module.scss.js +0 -8
- package/lib/components/EmptyState.module.scss.js.map +0 -1
- package/lib/components/Error.module.scss.js +0 -8
- package/lib/components/Error.module.scss.js.map +0 -1
- package/lib/components/FieldHeader.module.scss.js +0 -8
- package/lib/components/FieldHeader.module.scss.js.map +0 -1
- package/lib/components/Help.module.scss.js +0 -8
- package/lib/components/Help.module.scss.js.map +0 -1
- package/lib/components/Icon.module.scss.js +0 -8
- package/lib/components/Icon.module.scss.js.map +0 -1
- package/lib/components/IconButton.module.scss.js +0 -8
- package/lib/components/IconButton.module.scss.js.map +0 -1
- package/lib/components/InteractiveList.module.scss.js +0 -8
- package/lib/components/InteractiveList.module.scss.js.map +0 -1
- package/lib/components/Label.module.scss.js +0 -8
- package/lib/components/Label.module.scss.js.map +0 -1
- package/lib/components/Link.module.scss.js +0 -8
- package/lib/components/Link.module.scss.js.map +0 -1
- package/lib/components/Loader.module.scss.js +0 -8
- package/lib/components/Loader.module.scss.js.map +0 -1
- package/lib/components/Modal.module.scss.js +0 -8
- package/lib/components/Modal.module.scss.js.map +0 -1
- package/lib/components/Notification.module.scss.js +0 -8
- package/lib/components/Notification.module.scss.js.map +0 -1
- package/lib/components/NumberBadge.module.scss.js +0 -8
- package/lib/components/NumberBadge.module.scss.js.map +0 -1
- package/lib/components/NumberField.module.scss.js +0 -8
- package/lib/components/NumberField.module.scss.js.map +0 -1
- package/lib/components/Overlay.module.scss.js +0 -8
- package/lib/components/Overlay.module.scss.js.map +0 -1
- package/lib/components/Pagination.module.scss.js +0 -8
- package/lib/components/Pagination.module.scss.js.map +0 -1
- package/lib/components/PasswordField.module.scss.js +0 -8
- package/lib/components/PasswordField.module.scss.js.map +0 -1
- package/lib/components/Popover.module.scss.js +0 -8
- package/lib/components/Popover.module.scss.js.map +0 -1
- package/lib/components/Radio.module.scss.js +0 -8
- package/lib/components/Radio.module.scss.js.map +0 -1
- package/lib/components/RadioGroup.module.scss.js +0 -8
- package/lib/components/RadioGroup.module.scss.js.map +0 -1
- package/lib/components/SegmentedControl.module.scss.js +0 -8
- package/lib/components/SegmentedControl.module.scss.js.map +0 -1
- package/lib/components/Select/CheckableSelectField.module.scss.js +0 -8
- package/lib/components/Select/CheckableSelectField.module.scss.js.map +0 -1
- package/lib/components/Select/Common.module.scss.js +0 -8
- package/lib/components/Select/Common.module.scss.js.map +0 -1
- package/lib/components/Select/MultiSelectField.module.scss.js +0 -8
- package/lib/components/Select/MultiSelectField.module.scss.js.map +0 -1
- package/lib/components/Select/SelectField.module.scss.js +0 -8
- package/lib/components/Select/SelectField.module.scss.js.map +0 -1
- package/lib/components/SimpleTable.module.scss.js +0 -8
- package/lib/components/SimpleTable.module.scss.js.map +0 -1
- package/lib/components/Slider.module.scss.js +0 -8
- package/lib/components/Slider.module.scss.js.map +0 -1
- package/lib/components/Table/Cell.module.scss.js +0 -8
- package/lib/components/Table/Cell.module.scss.js.map +0 -1
- package/lib/components/Table/Header.module.scss.js +0 -8
- package/lib/components/Table/Header.module.scss.js.map +0 -1
- package/lib/components/Table/Row.module.scss.js +0 -8
- package/lib/components/Table/Row.module.scss.js.map +0 -1
- package/lib/components/Table/Table.module.scss.js +0 -8
- package/lib/components/Table/Table.module.scss.js.map +0 -1
- package/lib/components/Table/TableContent.module.scss.js +0 -8
- package/lib/components/Table/TableContent.module.scss.js.map +0 -1
- package/lib/components/Table/features/columnsSelection/CellCopyablePopover.module.scss.js +0 -8
- package/lib/components/Table/features/columnsSelection/CellCopyablePopover.module.scss.js.map +0 -1
- package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.module.scss.js +0 -8
- package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.module.scss.js.map +0 -1
- package/lib/components/Tabs/Tab.module.scss.js +0 -8
- package/lib/components/Tabs/Tab.module.scss.js.map +0 -1
- package/lib/components/Tabs/TabList.module.scss.js +0 -8
- package/lib/components/Tabs/TabList.module.scss.js.map +0 -1
- package/lib/components/Tabs/TabPanel.module.scss.js +0 -8
- package/lib/components/Tabs/TabPanel.module.scss.js.map +0 -1
- package/lib/components/Terminal.module.scss.js +0 -8
- package/lib/components/Terminal.module.scss.js.map +0 -1
- package/lib/components/TextArea.module.scss.js +0 -8
- package/lib/components/TextArea.module.scss.js.map +0 -1
- package/lib/components/TextField.module.scss.js +0 -8
- package/lib/components/TextField.module.scss.js.map +0 -1
- package/lib/components/TimeField.module.scss.js +0 -8
- package/lib/components/TimeField.module.scss.js.map +0 -1
- package/lib/components/Toast.module.scss.js +0 -8
- package/lib/components/Toast.module.scss.js.map +0 -1
- package/lib/components/Toggle.module.scss.js +0 -8
- package/lib/components/Toggle.module.scss.js.map +0 -1
- package/lib/components/Tooltip.module.scss.js +0 -8
- package/lib/components/Tooltip.module.scss.js.map +0 -1
- package/lib/components/TruncatedText.module.scss.js +0 -8
- package/lib/components/TruncatedText.module.scss.js.map +0 -1
- package/lib/styles/constants/export.module.scss.js +0 -8
- package/lib/styles/constants/export.module.scss.js.map +0 -1
- package/lib/styles.css +0 -1
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var export_module = require('../../styles/constants/export.module.scss.js');
|
|
26
|
-
var hooks_useRefValue = require('../../hooks/useRefValue.js');
|
|
27
|
-
|
|
1
|
+
import debounce from 'lodash/debounce';
|
|
2
|
+
import React, { useCallback, useEffect, useRef, useMemo, useState, } from 'react';
|
|
3
|
+
import cn from 'classnames';
|
|
4
|
+
import HotKeys from 'react-hot-keys';
|
|
5
|
+
import { useReactTable, getCoreRowModel, getPaginationRowModel, getSortedRowModel, getExpandedRowModel, getFilteredRowModel, } from '@tanstack/react-table';
|
|
6
|
+
import { AlertTriangle, ChevronDown, ChevronUp } from 'react-feather';
|
|
7
|
+
import { Pagination } from '../Pagination';
|
|
8
|
+
import { Cell } from './Cell';
|
|
9
|
+
import { EnhancedCellRenderer, EnhancedHeaderFooterRenderer } from './EnhancedRenderers';
|
|
10
|
+
import { Header } from './Header';
|
|
11
|
+
import { HeaderRow, Row } from './Row';
|
|
12
|
+
import { Loader } from '../Loader';
|
|
13
|
+
import { EmptyState } from '../EmptyState';
|
|
14
|
+
import { usePrevious } from '../../hooks/usePrevious';
|
|
15
|
+
import { Icon } from '../Icon';
|
|
16
|
+
import { TableContent } from './TableContent';
|
|
17
|
+
import { ROW_EXPANDER_COLUMN_ID } from './constants';
|
|
18
|
+
import { useColumnsSelection, ContextMenu } from './features/columnsSelection';
|
|
19
|
+
import { useRefValue } from '../../hooks';
|
|
20
|
+
import { useTrackTableState } from './useTrackTableState';
|
|
21
|
+
import { getCellStyle, getColumnDef, getRowStyle, getTableInitialState, prepareRow } from './utils';
|
|
22
|
+
import styles from './Table.module.scss';
|
|
23
|
+
import styleConsts from '../../../styles/constants/export.module.scss';
|
|
24
|
+
export * from './tableTypes';
|
|
28
25
|
/**
|
|
29
26
|
* ### Purpose
|
|
30
27
|
* Table component allows to arrange data in rows and columns.
|
|
@@ -36,436 +33,228 @@ var hooks_useRefValue = require('../../hooks/useRefValue.js');
|
|
|
36
33
|
* - Is able to resize columns out of the box
|
|
37
34
|
*/
|
|
38
35
|
// Inspiration here: https://react-table.tanstack.com/docs/examples/basic
|
|
39
|
-
const Table = ({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
className = '',
|
|
67
|
-
headerClassName = '',
|
|
68
|
-
contentClassName = '',
|
|
69
|
-
footerClassName = '',
|
|
70
|
-
searchValue,
|
|
71
|
-
hideHeader,
|
|
72
|
-
onPageChange,
|
|
73
|
-
overlayLoading,
|
|
74
|
-
onRowSelect,
|
|
75
|
-
columnsOrdering = false,
|
|
76
|
-
children,
|
|
77
|
-
renderRowSubComponent,
|
|
78
|
-
onCopy,
|
|
79
|
-
canExpand,
|
|
80
|
-
onStateChange
|
|
81
|
-
}) => {
|
|
82
|
-
var _a;
|
|
83
|
-
const getOncopy = hooks_useRefValue.useRefValue(onCopy);
|
|
84
|
-
const getCanExpand = hooks_useRefValue.useRefValue(canExpand);
|
|
85
|
-
const getRenderRowSubComponent = hooks_useRefValue.useRefValue(renderRowSubComponent);
|
|
86
|
-
const [contextMenuAnchorEl, setContextMenuAnchorEl] = React.useState(null);
|
|
87
|
-
const draggedColumnRef = React.useRef(null);
|
|
88
|
-
const previousIncomingPageIndex = hooks_usePrevious.usePrevious(incomingPageIndex);
|
|
89
|
-
const columns = React.useMemo(() => {
|
|
90
|
-
if (renderRowSubComponent || data.some(item => 'subRows' in item)) {
|
|
91
|
-
const expander = {
|
|
92
|
-
width: 60,
|
|
93
|
-
disableResizing: true,
|
|
94
|
-
id: components_Table_constants.ROW_EXPANDER_COLUMN_ID,
|
|
95
|
-
Header: () => /*#__PURE__*/React.createElement("span", {
|
|
96
|
-
role: "contentinfo",
|
|
97
|
-
"aria-label": "row-expander-column-header"
|
|
98
|
-
}),
|
|
99
|
-
Cell: ({
|
|
100
|
-
row
|
|
101
|
-
}) => {
|
|
102
|
-
if (row.getCanExpand()) {
|
|
103
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
104
|
-
tabIndex: 0,
|
|
105
|
-
role: "button",
|
|
106
|
-
"data-test": "row-expander",
|
|
107
|
-
"aria-expanded": row.getIsExpanded(),
|
|
108
|
-
className: Table_module.default.expander,
|
|
109
|
-
onClick: e => {
|
|
110
|
-
e.preventDefault();
|
|
111
|
-
row.getToggleExpandedHandler()();
|
|
112
|
-
}
|
|
113
|
-
}, /*#__PURE__*/React.createElement(components_Icon.Icon, {
|
|
114
|
-
icon: row.getIsExpanded() ? reactFeather.ChevronUp : reactFeather.ChevronDown,
|
|
115
|
-
ariaLabel: "row-expander"
|
|
116
|
-
}));
|
|
117
|
-
}
|
|
118
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, null);
|
|
36
|
+
export const Table = ({ 'data-test': dataTest, columns: propColumns, data, disableSortBy, onPaginationChange, onSortingChange, manualPagination, onRenderedContentChange, hidePagination = false, pageCount: controlledPageCount, defaultPageSize = 10, paginationOptions, onRowClick, getHref, AnchorComponent, getCustomRowProps, getCustomCellProps, loading, noDataTitle = 'The table is empty', pageIndex: incomingPageIndex, initialState = { paginationOptions: { pageIndex: incomingPageIndex || 0, pageSize: defaultPageSize } }, className = '', headerClassName = '', contentClassName = '', footerClassName = '', searchValue, hideHeader, onPageChange, overlayLoading, onRowSelect, columnsOrdering = false, children, renderRowSubComponent, onCopy, canExpand, onStateChange, }) => {
|
|
37
|
+
var _a;
|
|
38
|
+
const getOncopy = useRefValue(onCopy);
|
|
39
|
+
const getCanExpand = useRefValue(canExpand);
|
|
40
|
+
const getRenderRowSubComponent = useRefValue(renderRowSubComponent);
|
|
41
|
+
const [contextMenuAnchorEl, setContextMenuAnchorEl] = useState(null);
|
|
42
|
+
const draggedColumnRef = useRef(null);
|
|
43
|
+
const previousIncomingPageIndex = usePrevious(incomingPageIndex);
|
|
44
|
+
const columns = useMemo(() => {
|
|
45
|
+
if (renderRowSubComponent || data.some((item) => 'subRows' in item)) {
|
|
46
|
+
const expander = {
|
|
47
|
+
width: 60,
|
|
48
|
+
disableResizing: true,
|
|
49
|
+
id: ROW_EXPANDER_COLUMN_ID,
|
|
50
|
+
Header: () => React.createElement("span", { role: "contentinfo", "aria-label": "row-expander-column-header" }),
|
|
51
|
+
Cell: ({ row }) => {
|
|
52
|
+
if (row.getCanExpand()) {
|
|
53
|
+
return (React.createElement("div", { tabIndex: 0, role: "button", "data-test": "row-expander", "aria-expanded": row.getIsExpanded(), className: styles.expander, onClick: (e) => {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
row.getToggleExpandedHandler()();
|
|
56
|
+
} },
|
|
57
|
+
React.createElement(Icon, { icon: row.getIsExpanded() ? ChevronUp : ChevronDown, ariaLabel: "row-expander" })));
|
|
58
|
+
}
|
|
59
|
+
return React.createElement(React.Fragment, null, null);
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
return [expander, ...propColumns].map(getColumnDef);
|
|
119
63
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
minSize: Number(export_module.default.tableColumnMinWidth),
|
|
131
|
-
// minWidth is only used as a limit for resizing
|
|
132
|
-
size: Number(export_module.default.tableColumnWidth),
|
|
133
|
-
// width is used for both the flex-basis and flex-grow
|
|
134
|
-
maxSize: Number(export_module.default.tableColumnMaxWidth) // maxWidth is only used as a limit for resizing
|
|
135
|
-
}), []);
|
|
136
|
-
const tableInitialState = React.useMemo(() => components_Table_utils.getTableInitialState(initialState), [initialState]);
|
|
137
|
-
const tableInstance = reactTable.useReactTable({
|
|
138
|
-
columns,
|
|
139
|
-
data,
|
|
140
|
-
enableSorting: !disableSortBy,
|
|
141
|
-
enableMultiSort: false,
|
|
142
|
-
// Pass our hoisted table state
|
|
143
|
-
initialState: tableInitialState,
|
|
144
|
-
// Tell the usePagination hook that we'll handle our own data fetching
|
|
145
|
-
manualPagination: manualPagination,
|
|
146
|
-
// This means we'll also have to provide our own pageCount
|
|
147
|
-
pageCount: controlledPageCount,
|
|
148
|
-
defaultColumn,
|
|
149
|
-
columnResizeMode: 'onChange',
|
|
150
|
-
paginateExpandedRows: false,
|
|
151
|
-
autoResetPageIndex: false,
|
|
152
|
-
getSubRows: React.useCallback(row => row.subRows, []),
|
|
153
|
-
getRowCanExpand: React.useCallback(row => {
|
|
154
|
-
var _a;
|
|
155
|
-
const cb = getCanExpand();
|
|
156
|
-
if (cb) {
|
|
157
|
-
return cb(components_Table_utils.prepareRow(row));
|
|
158
|
-
}
|
|
159
|
-
if (getRenderRowSubComponent()) {
|
|
160
|
-
return true;
|
|
161
|
-
}
|
|
162
|
-
return ((_a = row.subRows) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
163
|
-
}, [getCanExpand, getRenderRowSubComponent]),
|
|
164
|
-
getCoreRowModel: reactTable.getCoreRowModel(),
|
|
165
|
-
getPaginationRowModel: reactTable.getPaginationRowModel(),
|
|
166
|
-
getSortedRowModel: reactTable.getSortedRowModel(),
|
|
167
|
-
getExpandedRowModel: reactTable.getExpandedRowModel(),
|
|
168
|
-
getFilteredRowModel: reactTable.getFilteredRowModel()
|
|
169
|
-
});
|
|
170
|
-
const {
|
|
171
|
-
getVisibleFlatColumns,
|
|
172
|
-
nextPage,
|
|
173
|
-
setPageIndex: goToPage,
|
|
174
|
-
getRowCount,
|
|
175
|
-
getState,
|
|
176
|
-
previousPage,
|
|
177
|
-
setPageSize,
|
|
178
|
-
setGlobalFilter,
|
|
179
|
-
setColumnOrder,
|
|
180
|
-
getPageCount,
|
|
181
|
-
getCanNextPage,
|
|
182
|
-
getCanPreviousPage,
|
|
183
|
-
getFooterGroups
|
|
184
|
-
} = tableInstance;
|
|
185
|
-
components_Table_useTrackTableState.useTrackTableState(tableInstance, onStateChange);
|
|
186
|
-
const footerGroups = getFooterGroups();
|
|
187
|
-
const page = tableInstance.getPaginationRowModel().rows;
|
|
188
|
-
const rowsPerPage = getRowCount();
|
|
189
|
-
const pageCount = getPageCount();
|
|
190
|
-
const {
|
|
191
|
-
sorting: sortBy,
|
|
192
|
-
columnOrder,
|
|
193
|
-
columnSizing: columnResizing,
|
|
194
|
-
rowSelection: selectedRowIds,
|
|
195
|
-
pagination: {
|
|
196
|
-
pageIndex,
|
|
197
|
-
pageSize
|
|
198
|
-
}
|
|
199
|
-
} = getState();
|
|
200
|
-
const getColumnOrder = hooks_useRefValue.useRefValue(columnOrder);
|
|
201
|
-
// drag and drop
|
|
202
|
-
const onDragStart = React.useCallback(e => {
|
|
203
|
-
draggedColumnRef.current = Number(e.dataTransfer.getData('text/plain'));
|
|
204
|
-
}, []);
|
|
205
|
-
const onDrop = React.useCallback((_, columnIndex) => {
|
|
206
|
-
if (draggedColumnRef.current !== null && columnIndex !== draggedColumnRef.current) {
|
|
207
|
-
const visibleColumns = getColumnOrder() || getVisibleFlatColumns().map(({
|
|
208
|
-
id
|
|
209
|
-
}) => id);
|
|
210
|
-
const newColumns = [...visibleColumns];
|
|
211
|
-
newColumns[columnIndex] = visibleColumns[draggedColumnRef.current];
|
|
212
|
-
newColumns[draggedColumnRef.current] = visibleColumns[columnIndex];
|
|
213
|
-
setColumnOrder(newColumns);
|
|
214
|
-
}
|
|
215
|
-
}, [getColumnOrder, getVisibleFlatColumns, setColumnOrder]);
|
|
216
|
-
const columnsSelectionProps = components_Table_features_columnsSelection_columnsSelection.useColumnsSelection({
|
|
217
|
-
rowsPerPage,
|
|
218
|
-
columnsPerRow: columns.length
|
|
219
|
-
});
|
|
220
|
-
const {
|
|
221
|
-
onEndSelection,
|
|
222
|
-
getSelectedColumns,
|
|
223
|
-
selectedColumnValuesRef
|
|
224
|
-
} = columnsSelectionProps;
|
|
225
|
-
const onPaginationChangeDebounced = React.useMemo(() => onPaginationChange ? debounce(onPaginationChange, 200) : undefined, [onPaginationChange]);
|
|
226
|
-
const onKeyUp = React.useCallback(() => {
|
|
227
|
-
const callback = getOncopy();
|
|
228
|
-
if (callback) {
|
|
229
|
-
const {
|
|
64
|
+
return propColumns.map(getColumnDef);
|
|
65
|
+
}, [propColumns, data, renderRowSubComponent]);
|
|
66
|
+
const defaultColumn = useMemo(() => ({
|
|
67
|
+
cell: (props) => React.createElement(EnhancedCellRenderer, { cell: props.cell, columnResizing: props.column.getIsResizing() }),
|
|
68
|
+
minSize: Number(styleConsts.tableColumnMinWidth), // minWidth is only used as a limit for resizing
|
|
69
|
+
size: Number(styleConsts.tableColumnWidth), // width is used for both the flex-basis and flex-grow
|
|
70
|
+
maxSize: Number(styleConsts.tableColumnMaxWidth), // maxWidth is only used as a limit for resizing
|
|
71
|
+
}), []);
|
|
72
|
+
const tableInitialState = useMemo(() => getTableInitialState(initialState), [initialState]);
|
|
73
|
+
const tableInstance = useReactTable({
|
|
230
74
|
columns,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
75
|
+
data,
|
|
76
|
+
enableSorting: !disableSortBy,
|
|
77
|
+
enableMultiSort: false,
|
|
78
|
+
// Pass our hoisted table state
|
|
79
|
+
initialState: tableInitialState,
|
|
80
|
+
// Tell the usePagination hook that we'll handle our own data fetching
|
|
81
|
+
manualPagination: manualPagination,
|
|
82
|
+
// This means we'll also have to provide our own pageCount
|
|
83
|
+
pageCount: controlledPageCount,
|
|
84
|
+
defaultColumn,
|
|
85
|
+
columnResizeMode: 'onChange',
|
|
86
|
+
paginateExpandedRows: false,
|
|
87
|
+
autoResetPageIndex: false,
|
|
88
|
+
getSubRows: useCallback((row) => row.subRows, []),
|
|
89
|
+
getRowCanExpand: useCallback((row) => {
|
|
90
|
+
var _a;
|
|
91
|
+
const cb = getCanExpand();
|
|
92
|
+
if (cb) {
|
|
93
|
+
return cb(prepareRow(row));
|
|
94
|
+
}
|
|
95
|
+
if (getRenderRowSubComponent()) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
return ((_a = row.subRows) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
99
|
+
}, [getCanExpand, getRenderRowSubComponent]),
|
|
100
|
+
getCoreRowModel: getCoreRowModel(),
|
|
101
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
102
|
+
getSortedRowModel: getSortedRowModel(),
|
|
103
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
104
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
105
|
+
});
|
|
106
|
+
const { getVisibleFlatColumns, nextPage, setPageIndex: goToPage, getRowCount, getState, previousPage, setPageSize, setGlobalFilter, setColumnOrder, getPageCount, getCanNextPage, getCanPreviousPage, getFooterGroups, } = tableInstance;
|
|
107
|
+
useTrackTableState(tableInstance, onStateChange);
|
|
108
|
+
const footerGroups = getFooterGroups();
|
|
109
|
+
const page = tableInstance.getPaginationRowModel().rows;
|
|
110
|
+
const rowsPerPage = getRowCount();
|
|
111
|
+
const pageCount = getPageCount();
|
|
112
|
+
const { sorting: sortBy, columnOrder, columnSizing: columnResizing, rowSelection: selectedRowIds, pagination: { pageIndex, pageSize }, } = getState();
|
|
113
|
+
const getColumnOrder = useRefValue(columnOrder);
|
|
114
|
+
// drag and drop
|
|
115
|
+
const onDragStart = useCallback((e) => {
|
|
116
|
+
draggedColumnRef.current = Number(e.dataTransfer.getData('text/plain'));
|
|
117
|
+
}, []);
|
|
118
|
+
const onDrop = useCallback((_, columnIndex) => {
|
|
119
|
+
if (draggedColumnRef.current !== null && columnIndex !== draggedColumnRef.current) {
|
|
120
|
+
const visibleColumns = getColumnOrder() || getVisibleFlatColumns().map(({ id }) => id);
|
|
121
|
+
const newColumns = [...visibleColumns];
|
|
122
|
+
newColumns[columnIndex] = visibleColumns[draggedColumnRef.current];
|
|
123
|
+
newColumns[draggedColumnRef.current] = visibleColumns[columnIndex];
|
|
124
|
+
setColumnOrder(newColumns);
|
|
125
|
+
}
|
|
126
|
+
}, [getColumnOrder, getVisibleFlatColumns, setColumnOrder]);
|
|
127
|
+
const columnsSelectionProps = useColumnsSelection({
|
|
128
|
+
rowsPerPage,
|
|
129
|
+
columnsPerRow: columns.length,
|
|
130
|
+
});
|
|
131
|
+
const { onEndSelection, getSelectedColumns, selectedColumnValuesRef } = columnsSelectionProps;
|
|
132
|
+
const onPaginationChangeDebounced = useMemo(() => (onPaginationChange ? debounce(onPaginationChange, 200) : undefined), [onPaginationChange]);
|
|
133
|
+
const onKeyUp = useCallback(() => {
|
|
134
|
+
const callback = getOncopy();
|
|
135
|
+
if (callback) {
|
|
136
|
+
const { columns, range } = getSelectedColumns();
|
|
137
|
+
if (columns.size || (range[0] !== undefined && range[0] !== undefined)) {
|
|
138
|
+
callback(selectedColumnValuesRef === null || selectedColumnValuesRef === void 0 ? void 0 : selectedColumnValuesRef.current);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}, [getOncopy, getSelectedColumns, selectedColumnValuesRef]);
|
|
142
|
+
useEffect(() => {
|
|
143
|
+
return () => {
|
|
144
|
+
document.body.removeEventListener('mouseup', onEndSelection);
|
|
145
|
+
document.body.removeEventListener('contextmenu', onEndSelection);
|
|
146
|
+
document.body.removeEventListener('keyup', onKeyUp);
|
|
147
|
+
};
|
|
148
|
+
}, [onKeyUp, onEndSelection]);
|
|
149
|
+
// Listen for changes in pagination and use the state to fetch new data. This is a recommended way to fetch new data: https://react-table.tanstack.com/docs/faq#how-can-i-use-the-table-state-to-fetch-new-data
|
|
150
|
+
useEffect(() => {
|
|
151
|
+
if (onPaginationChangeDebounced) {
|
|
152
|
+
onPaginationChangeDebounced({ pageIndex, pageSize });
|
|
153
|
+
}
|
|
154
|
+
}, [onPaginationChangeDebounced, pageIndex, pageSize]);
|
|
155
|
+
useEffect(() => {
|
|
156
|
+
if (onSortingChange) {
|
|
157
|
+
onSortingChange(sortBy);
|
|
158
|
+
}
|
|
159
|
+
}, [sortBy, onSortingChange]);
|
|
160
|
+
// Debounce our `fetchData` call for 200ms.
|
|
161
|
+
const onRenderedContentChangeDebounced = useMemo(() => (onRenderedContentChange ? debounce(onRenderedContentChange, 200) : undefined), [onRenderedContentChange]);
|
|
162
|
+
// Listen for changes in pagination and use the state to fetch new data. This is a recommended way to fetch new data: https://react-table.tanstack.com/docs/faq#how-can-i-use-the-table-state-to-fetch-new-data
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
if (onRenderedContentChangeDebounced) {
|
|
165
|
+
onRenderedContentChangeDebounced(page.map(prepareRow));
|
|
166
|
+
}
|
|
167
|
+
}, [onRenderedContentChangeDebounced, page]);
|
|
168
|
+
// Apply global filter when searchValue changes
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
if (searchValue !== undefined) {
|
|
171
|
+
;
|
|
172
|
+
setGlobalFilter(searchValue);
|
|
173
|
+
}
|
|
174
|
+
}, [searchValue, setGlobalFilter]);
|
|
175
|
+
useEffect(() => {
|
|
176
|
+
if (pageCount < pageIndex + 1) {
|
|
177
|
+
goToPage(pageCount - 1);
|
|
178
|
+
}
|
|
179
|
+
}, [pageIndex, pageCount, goToPage]);
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
if (incomingPageIndex !== undefined && incomingPageIndex !== previousIncomingPageIndex) {
|
|
182
|
+
goToPage(incomingPageIndex);
|
|
183
|
+
}
|
|
184
|
+
}, [goToPage, incomingPageIndex, previousIncomingPageIndex]);
|
|
185
|
+
useEffect(() => {
|
|
186
|
+
if (onRowSelect) {
|
|
187
|
+
onRowSelect(Object.keys(selectedRowIds));
|
|
188
|
+
}
|
|
189
|
+
}, [onRowSelect, selectedRowIds]);
|
|
190
|
+
const hasData = data.length > 0;
|
|
191
|
+
// If at least one of the columns has footer then we display the footer row
|
|
192
|
+
const hasFooter = !loading && hasData && columns.some((col) => !!col.footer);
|
|
193
|
+
// Header row has always aria-rowindex = 1.
|
|
194
|
+
const headerIndex = 1;
|
|
195
|
+
// We're using this offset to display correct aria-rowindex when pagination is in action.
|
|
196
|
+
const cellIndexOffset = pageSize * pageIndex + headerIndex;
|
|
197
|
+
// Total row count.
|
|
198
|
+
const rowCount = data.length + headerIndex + (hasFooter ? 1 : 0);
|
|
199
|
+
const content = (React.createElement(React.Fragment, null,
|
|
200
|
+
React.createElement("div", { "data-test": dataTest !== null && dataTest !== void 0 ? dataTest : 'table-wrapper', className: className },
|
|
201
|
+
React.createElement("div", { className: cn(styles.container, {
|
|
202
|
+
[styles.spaceBottom]: !hidePagination,
|
|
203
|
+
}) },
|
|
204
|
+
React.createElement("div", { "data-test": "table", role: "table", "aria-rowcount": rowCount },
|
|
205
|
+
!hideHeader && (React.createElement("div", { "data-test": "table-header-row-group", role: "rowgroup", className: headerClassName }, tableInstance.getHeaderGroups().map((headerGroup) => (React.createElement(HeaderRow, { key: headerGroup.id, role: "row", ariaRowIndex: headerIndex, style: getRowStyle({ totalSize: tableInstance.getTotalSize() }) }, headerGroup.headers.map((header, i) => {
|
|
206
|
+
var _a, _b;
|
|
207
|
+
const canSort = header.column.getCanSort();
|
|
208
|
+
const isDraggable = columnsOrdering && header.id !== 'expander';
|
|
209
|
+
return (React.createElement(Header, { index: i, colSpan: 1, key: header.id, role: "columnheader", onDragStart: onDragStart, style: getCellStyle({ size: header.getSize(), minSize: header.column.columnDef.minSize || header.getSize() }), canSort: canSort, isSorted: !!header.column.getIsSorted(), isSortedDesc: (_a = sortBy[header.column.getSortIndex()]) === null || _a === void 0 ? void 0 : _a.desc, canResize: header.column.getCanResize(), onDrop: isDraggable ? onDrop : undefined, resizeHandler: header.getResizeHandler(), isResizing: header.column.getIsResizing(), align: (_b = header.column.columnDef.meta) === null || _b === void 0 ? void 0 : _b.align, onClick: canSort ? header.column.getToggleSortingHandler() : undefined },
|
|
210
|
+
React.createElement(EnhancedHeaderFooterRenderer, { type: "header", context: header.getContext() })));
|
|
211
|
+
})))))),
|
|
212
|
+
!overlayLoading && loading ? (React.createElement(Row, { role: "row" },
|
|
213
|
+
React.createElement(Cell, { role: "cell", align: "center", colSpan: columns.length, "data-test": "table-loader-cell" },
|
|
214
|
+
React.createElement(Loader, null)))) : hasData ? (React.createElement(HotKeys, { keyName: "ctrl+c, command+c", onKeyUp: onKeyUp },
|
|
215
|
+
React.createElement("div", { "data-test": "table-cell-row-group", className: styles.hotKeys },
|
|
216
|
+
React.createElement(TableContent, { page: page, onCopy: onCopy, getHref: getHref, totalSize: tableInstance.getTotalSize(), rootRef: setContextMenuAnchorEl, ...columnsSelectionProps, onRowClick: onRowClick, className: contentClassName, columnResizing: columnResizing, AnchorComponent: AnchorComponent, cellIndexOffset: cellIndexOffset, getCustomRowProps: getCustomRowProps, getCustomCellProps: getCustomCellProps, renderRowSubComponent: renderRowSubComponent })))) : (React.createElement("div", { role: "row" },
|
|
217
|
+
React.createElement("div", { role: "cell" },
|
|
218
|
+
React.createElement(EmptyState, { "data-test": "table-no-data", className: styles.empty, title: noDataTitle, icon: AlertTriangle, iconLabel: "Alert" })))),
|
|
219
|
+
hasFooter && (React.createElement("div", { "data-test": "table-footer-row-group", role: "rowgroup", className: footerClassName }, footerGroups.map((group) => {
|
|
220
|
+
const { id: footerGroupKey } = group;
|
|
221
|
+
return (
|
|
222
|
+
// Footer props getters do not provide role attributes
|
|
223
|
+
React.createElement(Row, { key: footerGroupKey, ariaRowIndex: rowCount, style: getRowStyle({ totalSize: tableInstance.getTotalSize() }), role: "row" }, group.headers.map((column) => {
|
|
224
|
+
var _a;
|
|
225
|
+
const { id: footerKey, column: { columnDef }, } = column;
|
|
226
|
+
return (
|
|
227
|
+
// Footer props getters do not provide role attributes
|
|
228
|
+
React.createElement(Cell, { key: footerKey, colSpan: 1, align: (_a = columnDef.meta) === null || _a === void 0 ? void 0 : _a.align, style: getCellStyle({ size: column.getSize(), maxSize: columnDef.maxSize, minSize: columnDef.minSize }), role: "cell" },
|
|
229
|
+
React.createElement(EnhancedHeaderFooterRenderer, { context: column.getContext(), type: "footer" })));
|
|
230
|
+
})));
|
|
231
|
+
}))))),
|
|
232
|
+
!hidePagination && hasData && (React.createElement(Pagination, { pageCount: pageCount, currentPage: pageIndex + 1, canPreviousPage: getCanPreviousPage(), canNextPage: getCanNextPage(), goToPage: (p) => {
|
|
233
|
+
if (onPageChange) {
|
|
234
|
+
onPageChange(p - 1);
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
goToPage(p - 1);
|
|
238
|
+
}
|
|
239
|
+
}, nextPage: () => {
|
|
240
|
+
if (onPageChange) {
|
|
241
|
+
onPageChange(pageIndex + 1);
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
nextPage();
|
|
245
|
+
}
|
|
246
|
+
}, previousPage: () => {
|
|
247
|
+
if (onPageChange) {
|
|
248
|
+
onPageChange(pageIndex - 1);
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
previousPage();
|
|
252
|
+
}
|
|
253
|
+
}, pageSize: pageSize, setPageSize: setPageSize, numberOfItems: data.length, pageSizeOptions: (_a = paginationOptions === null || paginationOptions === void 0 ? void 0 : paginationOptions.pageSizeOptions) !== null && _a !== void 0 ? _a : [5, 10, 20] }))),
|
|
254
|
+
onCopy && React.createElement(ContextMenu, { anchorElement: contextMenuAnchorEl, onCopy: onKeyUp })));
|
|
255
|
+
if (children) {
|
|
256
|
+
return children(content);
|
|
286
257
|
}
|
|
287
|
-
|
|
288
|
-
const hasData = data.length > 0;
|
|
289
|
-
// If at least one of the columns has footer then we display the footer row
|
|
290
|
-
const hasFooter = !loading && hasData && columns.some(col => !!col.footer);
|
|
291
|
-
// Header row has always aria-rowindex = 1.
|
|
292
|
-
const headerIndex = 1;
|
|
293
|
-
// We're using this offset to display correct aria-rowindex when pagination is in action.
|
|
294
|
-
const cellIndexOffset = pageSize * pageIndex + headerIndex;
|
|
295
|
-
// Total row count.
|
|
296
|
-
const rowCount = data.length + headerIndex + (hasFooter ? 1 : 0);
|
|
297
|
-
const content = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
298
|
-
"data-test": dataTest !== null && dataTest !== void 0 ? dataTest : 'table-wrapper',
|
|
299
|
-
className: className
|
|
300
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
301
|
-
className: cn(Table_module.default.container, {
|
|
302
|
-
[Table_module.default.spaceBottom]: !hidePagination
|
|
303
|
-
})
|
|
304
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
305
|
-
"data-test": "table",
|
|
306
|
-
role: "table",
|
|
307
|
-
"aria-rowcount": rowCount
|
|
308
|
-
}, !hideHeader && (/*#__PURE__*/React.createElement("div", {
|
|
309
|
-
"data-test": "table-header-row-group",
|
|
310
|
-
role: "rowgroup",
|
|
311
|
-
className: headerClassName
|
|
312
|
-
}, tableInstance.getHeaderGroups().map(headerGroup => (/*#__PURE__*/React.createElement(components_Table_Row.HeaderRow, {
|
|
313
|
-
key: headerGroup.id,
|
|
314
|
-
role: "row",
|
|
315
|
-
ariaRowIndex: headerIndex,
|
|
316
|
-
style: components_Table_utils.getRowStyle({
|
|
317
|
-
totalSize: tableInstance.getTotalSize()
|
|
318
|
-
})
|
|
319
|
-
}, headerGroup.headers.map((header, i) => {
|
|
320
|
-
var _a, _b;
|
|
321
|
-
const canSort = header.column.getCanSort();
|
|
322
|
-
const isDraggable = columnsOrdering && header.id !== 'expander';
|
|
323
|
-
return /*#__PURE__*/React.createElement(components_Table_Header.Header, {
|
|
324
|
-
index: i,
|
|
325
|
-
colSpan: 1,
|
|
326
|
-
key: header.id,
|
|
327
|
-
role: "columnheader",
|
|
328
|
-
onDragStart: onDragStart,
|
|
329
|
-
style: components_Table_utils.getCellStyle({
|
|
330
|
-
size: header.getSize(),
|
|
331
|
-
minSize: header.column.columnDef.minSize || header.getSize()
|
|
332
|
-
}),
|
|
333
|
-
canSort: canSort,
|
|
334
|
-
isSorted: !!header.column.getIsSorted(),
|
|
335
|
-
isSortedDesc: (_a = sortBy[header.column.getSortIndex()]) === null || _a === void 0 ? void 0 : _a.desc,
|
|
336
|
-
canResize: header.column.getCanResize(),
|
|
337
|
-
onDrop: isDraggable ? onDrop : undefined,
|
|
338
|
-
resizeHandler: header.getResizeHandler(),
|
|
339
|
-
isResizing: header.column.getIsResizing(),
|
|
340
|
-
align: (_b = header.column.columnDef.meta) === null || _b === void 0 ? void 0 : _b.align,
|
|
341
|
-
onClick: canSort ? header.column.getToggleSortingHandler() : undefined
|
|
342
|
-
}, /*#__PURE__*/React.createElement(components_Table_EnhancedRenderers.EnhancedHeaderFooterRenderer, {
|
|
343
|
-
type: "header",
|
|
344
|
-
context: header.getContext()
|
|
345
|
-
}));
|
|
346
|
-
})))))), !overlayLoading && loading ? (/*#__PURE__*/React.createElement(components_Table_Row.Row, {
|
|
347
|
-
role: "row"
|
|
348
|
-
}, /*#__PURE__*/React.createElement(components_Table_Cell.Cell, {
|
|
349
|
-
role: "cell",
|
|
350
|
-
align: "center",
|
|
351
|
-
colSpan: columns.length,
|
|
352
|
-
"data-test": "table-loader-cell"
|
|
353
|
-
}, /*#__PURE__*/React.createElement(components_Loader.Loader, null)))) : hasData ? (/*#__PURE__*/React.createElement(HotKeys, {
|
|
354
|
-
keyName: "ctrl+c, command+c",
|
|
355
|
-
onKeyUp: onKeyUp
|
|
356
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
357
|
-
"data-test": "table-cell-row-group",
|
|
358
|
-
className: Table_module.default.hotKeys
|
|
359
|
-
}, /*#__PURE__*/React.createElement(components_Table_TableContent.TableContent, {
|
|
360
|
-
page: page,
|
|
361
|
-
onCopy: onCopy,
|
|
362
|
-
getHref: getHref,
|
|
363
|
-
totalSize: tableInstance.getTotalSize(),
|
|
364
|
-
rootRef: setContextMenuAnchorEl,
|
|
365
|
-
...columnsSelectionProps,
|
|
366
|
-
onRowClick: onRowClick,
|
|
367
|
-
className: contentClassName,
|
|
368
|
-
columnResizing: columnResizing,
|
|
369
|
-
AnchorComponent: AnchorComponent,
|
|
370
|
-
cellIndexOffset: cellIndexOffset,
|
|
371
|
-
getCustomRowProps: getCustomRowProps,
|
|
372
|
-
getCustomCellProps: getCustomCellProps,
|
|
373
|
-
renderRowSubComponent: renderRowSubComponent
|
|
374
|
-
})))) : (/*#__PURE__*/React.createElement("div", {
|
|
375
|
-
role: "row"
|
|
376
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
377
|
-
role: "cell"
|
|
378
|
-
}, /*#__PURE__*/React.createElement(components_EmptyState.EmptyState, {
|
|
379
|
-
"data-test": "table-no-data",
|
|
380
|
-
className: Table_module.default.empty,
|
|
381
|
-
title: noDataTitle,
|
|
382
|
-
icon: reactFeather.AlertTriangle,
|
|
383
|
-
iconLabel: "Alert"
|
|
384
|
-
})))), hasFooter && (/*#__PURE__*/React.createElement("div", {
|
|
385
|
-
"data-test": "table-footer-row-group",
|
|
386
|
-
role: "rowgroup",
|
|
387
|
-
className: footerClassName
|
|
388
|
-
}, footerGroups.map(group => {
|
|
389
|
-
const {
|
|
390
|
-
id: footerGroupKey
|
|
391
|
-
} = group;
|
|
392
|
-
return (
|
|
393
|
-
/*#__PURE__*/
|
|
394
|
-
// Footer props getters do not provide role attributes
|
|
395
|
-
React.createElement(components_Table_Row.Row, {
|
|
396
|
-
key: footerGroupKey,
|
|
397
|
-
ariaRowIndex: rowCount,
|
|
398
|
-
style: components_Table_utils.getRowStyle({
|
|
399
|
-
totalSize: tableInstance.getTotalSize()
|
|
400
|
-
}),
|
|
401
|
-
role: "row"
|
|
402
|
-
}, group.headers.map(column => {
|
|
403
|
-
var _a;
|
|
404
|
-
const {
|
|
405
|
-
id: footerKey,
|
|
406
|
-
column: {
|
|
407
|
-
columnDef
|
|
408
|
-
}
|
|
409
|
-
} = column;
|
|
410
|
-
return (
|
|
411
|
-
/*#__PURE__*/
|
|
412
|
-
// Footer props getters do not provide role attributes
|
|
413
|
-
React.createElement(components_Table_Cell.Cell, {
|
|
414
|
-
key: footerKey,
|
|
415
|
-
colSpan: 1,
|
|
416
|
-
align: (_a = columnDef.meta) === null || _a === void 0 ? void 0 : _a.align,
|
|
417
|
-
style: components_Table_utils.getCellStyle({
|
|
418
|
-
size: column.getSize(),
|
|
419
|
-
maxSize: columnDef.maxSize,
|
|
420
|
-
minSize: columnDef.minSize
|
|
421
|
-
}),
|
|
422
|
-
role: "cell"
|
|
423
|
-
}, /*#__PURE__*/React.createElement(components_Table_EnhancedRenderers.EnhancedHeaderFooterRenderer, {
|
|
424
|
-
context: column.getContext(),
|
|
425
|
-
type: "footer"
|
|
426
|
-
}))
|
|
427
|
-
);
|
|
428
|
-
}))
|
|
429
|
-
);
|
|
430
|
-
}))))), !hidePagination && hasData && (/*#__PURE__*/React.createElement(components_Pagination.Pagination, {
|
|
431
|
-
pageCount: pageCount,
|
|
432
|
-
currentPage: pageIndex + 1,
|
|
433
|
-
canPreviousPage: getCanPreviousPage(),
|
|
434
|
-
canNextPage: getCanNextPage(),
|
|
435
|
-
goToPage: p => {
|
|
436
|
-
if (onPageChange) {
|
|
437
|
-
onPageChange(p - 1);
|
|
438
|
-
} else {
|
|
439
|
-
goToPage(p - 1);
|
|
440
|
-
}
|
|
441
|
-
},
|
|
442
|
-
nextPage: () => {
|
|
443
|
-
if (onPageChange) {
|
|
444
|
-
onPageChange(pageIndex + 1);
|
|
445
|
-
} else {
|
|
446
|
-
nextPage();
|
|
447
|
-
}
|
|
448
|
-
},
|
|
449
|
-
previousPage: () => {
|
|
450
|
-
if (onPageChange) {
|
|
451
|
-
onPageChange(pageIndex - 1);
|
|
452
|
-
} else {
|
|
453
|
-
previousPage();
|
|
454
|
-
}
|
|
455
|
-
},
|
|
456
|
-
pageSize: pageSize,
|
|
457
|
-
setPageSize: setPageSize,
|
|
458
|
-
numberOfItems: data.length,
|
|
459
|
-
pageSizeOptions: (_a = paginationOptions === null || paginationOptions === void 0 ? void 0 : paginationOptions.pageSizeOptions) !== null && _a !== void 0 ? _a : [5, 10, 20]
|
|
460
|
-
}))), onCopy && /*#__PURE__*/React.createElement(components_Table_features_columnsSelection_ContextMenu_ContextMenu.ContextMenu, {
|
|
461
|
-
anchorElement: contextMenuAnchorEl,
|
|
462
|
-
onCopy: onKeyUp
|
|
463
|
-
}));
|
|
464
|
-
if (children) {
|
|
465
|
-
return children(content);
|
|
466
|
-
}
|
|
467
|
-
return content;
|
|
258
|
+
return content;
|
|
468
259
|
};
|
|
469
|
-
|
|
470
|
-
exports.Table = Table;
|
|
471
|
-
//# sourceMappingURL=Table.js.map
|
|
260
|
+
//# sourceMappingURL=Table.js.map
|