@terraware/web-components 5.0.27-rc.0 → 5.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AntSwitch/index.js +22 -19
- package/components/Autocomplete/Autocomplete.js +130 -106
- package/components/Badge/index.js +29 -28
- package/components/BusySpinner/index.js +45 -40
- package/components/Button/Button.js +47 -41
- package/components/Checkbox.js +63 -64
- package/components/Confirm/index.js +83 -74
- package/components/DatePicker/DatePicker.js +141 -138
- package/components/DialogBox/DialogBox.js +118 -111
- package/components/Divisor.js +18 -18
- package/components/Dropdown.js +94 -66
- package/components/EditableTable/index.js +271 -211
- package/components/ErrorBox/ErrorBox.js +49 -47
- package/components/FileChooser/index.js +135 -117
- package/components/FormBottomBar/index.js +84 -75
- package/components/Icon/Icon.js +20 -12
- package/components/Icon/icons/index.js +256 -256
- package/components/IconTooltip/index.js +60 -49
- package/components/Map/MapBox.js +452 -545
- package/components/Map/MapContainer.js +29 -25
- package/components/Map/MapDateSliderControl.js +64 -64
- package/components/Map/MapDrawer.js +47 -41
- package/components/Map/MapLegend.js +172 -176
- package/components/Map/MapViewStyleControl.js +63 -59
- package/components/Map/ReactMapboxWrapper.js +2 -3
- package/components/Map/index.js +180 -161
- package/components/Map/types.js +17 -12
- package/components/Map/useMaintainLayerOrder.js +26 -16
- package/components/Markdown/index.js +26 -25
- package/components/Message/Message.js +76 -73
- package/components/MultiSelect/index.js +124 -112
- package/components/Navbar/NavFooter.js +13 -9
- package/components/Navbar/NavItem.js +76 -70
- package/components/Navbar/NavSection.js +19 -17
- package/components/Navbar/Navbar.js +46 -39
- package/components/Navbar/SubNavbar.js +13 -9
- package/components/Note.js +22 -18
- package/components/OverlayModal/OverlayModal.js +63 -56
- package/components/PageForm/index.js +41 -33
- package/components/PhotoChooser/index.js +173 -165
- package/components/PhotosCarousel/PhotoSlide.js +35 -32
- package/components/PhotosCarousel/index.js +85 -80
- package/components/PhotosCarousel/usePhotosCarousel.js +76 -69
- package/components/Pill/index.js +45 -41
- package/components/PillList/index.js +24 -17
- package/components/PlacementWrapper/index.js +59 -38
- package/components/PopoverMenu/Popover.js +85 -68
- package/components/PopoverMenu/index.js +56 -51
- package/components/PopoverMultiSelect/index.js +59 -52
- package/components/ProgressCircle/ProgressCircle.js +32 -28
- package/components/RadioButton.js +19 -17
- package/components/Select/Select.js +15 -13
- package/components/Select/SelectT.js +250 -235
- package/components/Separator/index.js +17 -14
- package/components/Size.js +1 -0
- package/components/Slider/index.js +56 -43
- package/components/SummaryBox.js +72 -70
- package/components/Tabs/index.js +135 -133
- package/components/TextTruncated/index.js +130 -117
- package/components/Textfield/Textfield.js +190 -158
- package/components/Textfield/TruncatedTextArea.js +84 -70
- package/components/TimelineSlider/TimelineMarker.js +30 -25
- package/components/TimelineSlider/TimelineRail.js +11 -8
- package/components/TimelineSlider/index.js +66 -64
- package/components/TimelineSliderV2/ClusterBadge.js +29 -25
- package/components/TimelineSliderV2/TimelineDot.js +35 -31
- package/components/TimelineSliderV2/TimelineRail.js +11 -8
- package/components/TimelineSliderV2/index.js +103 -121
- package/components/TimelineSliderV2/layout.js +147 -124
- package/components/TimelineSliderV2/types.js +1 -0
- package/components/Tooltip/Tooltip.js +56 -47
- package/components/ViewPhotosDialog/index.js +35 -28
- package/components/VirtualWalkthrough/Annotation.js +207 -163
- package/components/VirtualWalkthrough/AnnotationEditPane.js +184 -198
- package/components/VirtualWalkthrough/AnnotationPanel.js +199 -187
- package/components/VirtualWalkthrough/Application.js +34 -31
- package/components/VirtualWalkthrough/AutoRotator.js +223 -85
- package/components/VirtualWalkthrough/BlockingSpinner.js +28 -26
- package/components/VirtualWalkthrough/BoundaryRing.js +34 -30
- package/components/VirtualWalkthrough/BoundaryWall.js +36 -32
- package/components/VirtualWalkthrough/CameraInfo.js +89 -100
- package/components/VirtualWalkthrough/ControlsInfoPane.js +195 -254
- package/components/VirtualWalkthrough/GradientSky.js +73 -72
- package/components/VirtualWalkthrough/SplatControls.js +221 -209
- package/components/VirtualWalkthrough/SplatCrop.js +20 -21
- package/components/VirtualWalkthrough/SplatFadeCrop.js +20 -21
- package/components/VirtualWalkthrough/SplatModel.js +85 -65
- package/components/VirtualWalkthrough/SplatRevealRain.js +46 -41
- package/components/VirtualWalkthrough/TfAnnotationManager.js +379 -197
- package/components/VirtualWalkthrough/TfXrNavigation.js +162 -73
- package/components/VirtualWalkthrough/VirtualWalkthroughViewer.js +431 -438
- package/components/VirtualWalkthrough/VrAnnotationPanel.js +22 -18
- package/components/VirtualWalkthrough/XrAnnotationInteraction.js +17 -14
- package/components/VirtualWalkthrough/XrExitButton.js +17 -14
- package/components/VirtualWalkthrough/XrGazeDwell.js +17 -14
- package/components/VirtualWalkthrough/XrPointerRay.js +17 -14
- package/components/VirtualWalkthrough/XrStartPose.js +121 -67
- package/components/VirtualWalkthrough/boundary-ring.js +117 -87
- package/components/VirtualWalkthrough/boundary-wall.js +258 -175
- package/components/VirtualWalkthrough/camera-adoption.js +64 -18
- package/components/VirtualWalkthrough/groundPlane.js +47 -32
- package/components/VirtualWalkthrough/gsplat-fade-crop-effect.js +35 -35
- package/components/VirtualWalkthrough/splatFormat.js +47 -13
- package/components/VirtualWalkthrough/useAdoptedCamera.js +44 -23
- package/components/VirtualWalkthrough/useRestartOnVr.js +37 -26
- package/components/VirtualWalkthrough/useXrRenderTuning.js +54 -33
- package/components/VirtualWalkthrough/vr-annotation-panel-layout.js +99 -67
- package/components/VirtualWalkthrough/vr-annotation-panel.js +433 -403
- package/components/VirtualWalkthrough/vr-annotation-scroll.js +28 -10
- package/components/VirtualWalkthrough/walkthrough-camera.js +329 -204
- package/components/VirtualWalkthrough/xr-annotation-candidate-buffer.js +80 -39
- package/components/VirtualWalkthrough/xr-annotation-candidates.js +18 -6
- package/components/VirtualWalkthrough/xr-annotation-interaction.js +56 -31
- package/components/VirtualWalkthrough/xr-annotation-targeting.js +38 -22
- package/components/VirtualWalkthrough/xr-button-arming.js +17 -7
- package/components/VirtualWalkthrough/xr-button-hold.js +36 -22
- package/components/VirtualWalkthrough/xr-exit-button-mask.js +36 -22
- package/components/VirtualWalkthrough/xr-exit-button.js +207 -148
- package/components/VirtualWalkthrough/xr-face-buttons.js +29 -19
- package/components/VirtualWalkthrough/xr-gaze-dwell-state.js +34 -23
- package/components/VirtualWalkthrough/xr-gaze-dwell.js +144 -107
- package/components/VirtualWalkthrough/xr-interactive-ui.js +24 -12
- package/components/VirtualWalkthrough/xr-pointer-ray.js +20 -13
- package/components/VirtualWalkthrough/xr-progress-pie-material.js +88 -117
- package/components/VirtualWalkthrough/xr-progress-pie.js +10 -1
- package/components/VirtualWalkthrough/xr-ray-quad.js +30 -16
- package/components/VirtualWalkthrough/xr-render-tuning.js +48 -17
- package/components/VirtualWalkthrough/xr-scene-bounds.js +37 -21
- package/components/VirtualWalkthrough/xr-start-pose.js +73 -27
- package/components/VirtualWalkthrough/xr-teleport-gesture.js +42 -16
- package/components/svg/BlobbyGrayIconImage.js +39 -41
- package/components/svg/BlobbyGrayIconImport.js +39 -41
- package/components/svg/BlobbyGrayIconUploadToTheCloud.js +39 -41
- package/components/svg/BlobbyIconCloudChecked.js +164 -202
- package/components/svg/BlobbyIconExportOrUploadPhoto.js +164 -202
- package/components/svg/BlobbyIconFolder.js +164 -202
- package/components/svg/BlobbyIconGraphReport.js +164 -202
- package/components/svg/BlobbyIconHappy.js +164 -202
- package/components/svg/BlobbyIconHeartMonitor.js +164 -202
- package/components/svg/BlobbyIconLeaf.js +164 -202
- package/components/svg/BlobbyIconLibrary.js +164 -202
- package/components/svg/BlobbyIconNursery.js +166 -204
- package/components/svg/BlobbyIconOrganization.js +164 -202
- package/components/svg/BlobbyIconParchment.js +164 -202
- package/components/svg/BlobbyIconPeople.js +164 -202
- package/components/svg/BlobbyIconSeedBank.js +164 -202
- package/components/svg/BlobbyIconSeedling.js +164 -202
- package/components/svg/BlobbyIconSeeds.js +164 -202
- package/components/svg/BlobbyIconSite.js +167 -206
- package/components/svg/BlobbyIconSparkles.js +164 -202
- package/components/svg/BlobbyIconWrench.js +164 -202
- package/components/svg/Bug.js +21 -19
- package/components/svg/Calendar.js +21 -19
- package/components/svg/CaretDown.js +21 -19
- package/components/svg/CaretLeft.js +21 -19
- package/components/svg/CaretRight.js +21 -19
- package/components/svg/CaretUp.js +21 -19
- package/components/svg/ChevronDown.js +21 -19
- package/components/svg/ChevronUp.js +21 -19
- package/components/svg/Close.js +21 -19
- package/components/svg/Critical.js +21 -19
- package/components/svg/Edit.js +164 -202
- package/components/svg/Error.js +21 -19
- package/components/svg/Filter.js +21 -19
- package/components/svg/Folder.js +21 -19
- package/components/svg/Help.js +21 -19
- package/components/svg/Home.js +21 -19
- package/components/svg/IconAdd.js +21 -19
- package/components/svg/IconArrowRight.js +23 -21
- package/components/svg/IconBusinessNetwork.js +21 -19
- package/components/svg/IconCalendar.js +21 -19
- package/components/svg/IconCancel.js +21 -19
- package/components/svg/IconChargingBattery.js +21 -19
- package/components/svg/IconChecklist.js +23 -21
- package/components/svg/IconCheckmark.js +21 -19
- package/components/svg/IconCoinInHand.js +21 -19
- package/components/svg/IconColumns.js +21 -19
- package/components/svg/IconComment.js +22 -20
- package/components/svg/IconDashboard.js +21 -19
- package/components/svg/IconDataMigration.js +21 -19
- package/components/svg/IconDocument.js +23 -21
- package/components/svg/IconDownloadFromTheCloud.js +23 -21
- package/components/svg/IconEdit.js +23 -21
- package/components/svg/IconExpand.js +23 -21
- package/components/svg/IconExport.js +21 -19
- package/components/svg/IconExternalLink.js +21 -19
- package/components/svg/IconEye.js +21 -19
- package/components/svg/IconEyeOff.js +21 -19
- package/components/svg/IconFile.js +21 -19
- package/components/svg/IconFolder.js +21 -19
- package/components/svg/IconFullScreen.js +22 -20
- package/components/svg/IconFutures.js +21 -19
- package/components/svg/IconGraphReport.js +21 -19
- package/components/svg/IconGrid.js +21 -19
- package/components/svg/IconHeartMonitor.js +21 -19
- package/components/svg/IconHelp.js +23 -21
- package/components/svg/IconHistory.js +21 -19
- package/components/svg/IconImport.js +21 -19
- package/components/svg/IconIndex.js +21 -19
- package/components/svg/IconLayers.js +21 -19
- package/components/svg/IconLibrary.js +22 -20
- package/components/svg/IconList.js +21 -19
- package/components/svg/IconLivePlant.js +21 -19
- package/components/svg/IconLocations.js +21 -19
- package/components/svg/IconMail.js +21 -19
- package/components/svg/IconManager.js +21 -19
- package/components/svg/IconMap.js +21 -19
- package/components/svg/IconMarker.js +21 -19
- package/components/svg/IconMenu.js +21 -19
- package/components/svg/IconMenuHorizontal.js +21 -19
- package/components/svg/IconModule.js +21 -19
- package/components/svg/IconMyLocation.js +21 -19
- package/components/svg/IconNote.js +23 -21
- package/components/svg/IconNursery.js +23 -21
- package/components/svg/IconOrg.js +21 -19
- package/components/svg/IconParchment.js +21 -19
- package/components/svg/IconPhoto.js +21 -19
- package/components/svg/IconPlantsFilled.js +21 -19
- package/components/svg/IconRedo.js +21 -19
- package/components/svg/IconRestorationSite.js +21 -19
- package/components/svg/IconSeedBank.js +21 -19
- package/components/svg/IconSeedling.js +21 -19
- package/components/svg/IconSettings.js +21 -19
- package/components/svg/IconSlice.js +21 -19
- package/components/svg/IconSubmit.js +21 -19
- package/components/svg/IconSubtract.js +23 -21
- package/components/svg/IconSynced.js +21 -19
- package/components/svg/IconTrashCan.js +21 -19
- package/components/svg/IconTreasureMap.js +21 -19
- package/components/svg/IconUnavailable.js +21 -19
- package/components/svg/IconUndo.js +21 -19
- package/components/svg/IconVariable.js +21 -19
- package/components/svg/IconVideo.js +31 -30
- package/components/svg/IconWifi.js +21 -19
- package/components/svg/Info.js +21 -19
- package/components/svg/Key.js +21 -19
- package/components/svg/Leaf.js +21 -19
- package/components/svg/Lock.js +21 -19
- package/components/svg/Logo.js +43 -48
- package/components/svg/MenuVertical.js +21 -19
- package/components/svg/Notification.js +21 -19
- package/components/svg/Person.js +21 -19
- package/components/svg/Plus.js +21 -19
- package/components/svg/RestorationSite.js +21 -19
- package/components/svg/Search.js +21 -19
- package/components/svg/Seeds.js +21 -19
- package/components/svg/Site.js +21 -19
- package/components/svg/Sparkles.js +21 -19
- package/components/svg/Species.js +21 -19
- package/components/svg/Species2.js +164 -202
- package/components/svg/Spinner.js +48 -54
- package/components/svg/Star.js +21 -19
- package/components/svg/Success.js +21 -19
- package/components/svg/SuccessFilled.js +21 -19
- package/components/svg/TerrawareLogoDesktop.js +49 -55
- package/components/svg/TerrawareLogoMobile.js +26 -25
- package/components/svg/Touchscreen.js +21 -19
- package/components/svg/UploadCloud.js +164 -202
- package/components/svg/Warning.js +21 -19
- package/components/svg/WelcomeClipboard.js +133 -156
- package/components/svg/index.js +129 -129
- package/components/table/EnhancedTableToolbar.js +74 -68
- package/components/table/EnhancedTableToolbarV2.js +41 -31
- package/components/table/TableCellRenderer.js +231 -196
- package/components/table/TableHeader.js +73 -71
- package/components/table/TableHeaderItem.js +102 -97
- package/components/table/density.js +19 -18
- package/components/table/index.js +369 -350
- package/components/table/sort.js +52 -27
- package/components/table/types.js +1 -0
- package/components/types/index.js +1 -0
- package/hooks/cameraEntityContext.js +13 -2
- package/hooks/useBoolean.js +13 -17
- package/hooks/useCameraPosition.js +56 -56
- package/hooks/useDevicePerformance.js +17 -17
- package/hooks/useXr.js +87 -85
- package/index.js +58 -58
- package/package.json +1 -1
- package/setupTests.js +4 -0
- package/strings/export.js +170 -111
- package/strings/index.js +54 -25
- package/strings/locales.js +41 -21
- package/strings/strings-en.js +51 -49
- package/strings/strings-es.js +51 -49
- package/strings/strings-fr.js +51 -49
- package/strings/strings-gx.js +51 -49
- package/style-dictionary-dist/TerrawareTheme.js +186 -186
- package/theme.js +76 -74
- package/utils/color.js +15 -8
- package/utils/date.js +108 -42
- package/utils/index.js +4 -4
- package/utils/preventDefaultEvent.js +3 -3
- package/utils/text.js +11 -11
- package/utils/useDeviceInfo.js +79 -42
- package/virtualWalkthrough.js +23 -23
|
@@ -1,359 +1,378 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import React, { useState, useEffect, useCallback, useMemo } from 'react';
|
|
2
|
+
import { useSensors, useSensor, MouseSensor, TouchSensor, KeyboardSensor, DndContext } from '@dnd-kit/core';
|
|
3
|
+
import { sortableKeyboardCoordinates } from '@dnd-kit/sortable';
|
|
4
|
+
import { useTheme, TableContainer, Table, TableBody, TableRow, TableCell, Checkbox, Typography, Box, Pagination } from '@mui/material';
|
|
5
|
+
import 'lodash';
|
|
6
|
+
import 'luxon';
|
|
7
|
+
import useDeviceInfo from '../../utils/useDeviceInfo.js';
|
|
8
|
+
import { CheckboxStyle } from '../Checkbox.js';
|
|
9
|
+
import EnhancedTableToolbarV2 from './EnhancedTableToolbarV2.js';
|
|
10
|
+
import CellRenderer from './TableCellRenderer.js';
|
|
11
|
+
import EnhancedTableHead from './TableHeader.js';
|
|
12
|
+
import { getTableCellPaddingY, getTableRowHeight } from './density.js';
|
|
13
|
+
import { stableSort, descendingComparator, getComparator } from './sort.js';
|
|
14
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
15
|
+
|
|
16
|
+
const isTopBarButton = input => {
|
|
17
|
+
const castInput = input;
|
|
18
|
+
return !!(castInput.buttonType && castInput.onButtonClick);
|
|
16
19
|
};
|
|
17
|
-
function EnhancedTable({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
20
|
+
function EnhancedTable({
|
|
21
|
+
id,
|
|
22
|
+
columns,
|
|
23
|
+
rows,
|
|
24
|
+
order: _order = 'asc',
|
|
25
|
+
orderBy: _orderBy,
|
|
26
|
+
Renderer = CellRenderer,
|
|
27
|
+
onSelect,
|
|
28
|
+
onPageChange,
|
|
29
|
+
maxItemsPerPage = 100,
|
|
30
|
+
totalRowCount,
|
|
31
|
+
currentPage,
|
|
32
|
+
DetailsRenderer,
|
|
33
|
+
sortComparator = descendingComparator,
|
|
34
|
+
sortHandler,
|
|
35
|
+
isInactive,
|
|
36
|
+
isPresorted,
|
|
37
|
+
onReorderEnd,
|
|
38
|
+
isClickable,
|
|
39
|
+
emptyTableMessage,
|
|
40
|
+
showCheckbox,
|
|
41
|
+
showTopBar,
|
|
42
|
+
topBarButtons,
|
|
43
|
+
selectedRows,
|
|
44
|
+
setSelectedRows,
|
|
45
|
+
controlledOnSelect,
|
|
46
|
+
reloadData,
|
|
47
|
+
stickyHeader = true,
|
|
48
|
+
hideHeader,
|
|
49
|
+
booleanFalseText,
|
|
50
|
+
booleanTrueText,
|
|
51
|
+
editText,
|
|
52
|
+
renderNumSelectedText,
|
|
53
|
+
renderPaginationText,
|
|
54
|
+
enhancedTopBarSelectionConfig,
|
|
55
|
+
density = 'comfortable',
|
|
56
|
+
tableComments
|
|
57
|
+
}) {
|
|
58
|
+
const theme = useTheme();
|
|
59
|
+
const [order, setOrder] = React.useState(_order);
|
|
60
|
+
const [orderBy, setOrderBy] = React.useState(_orderBy);
|
|
61
|
+
const [internalPage, setInternalPage] = useState(1);
|
|
62
|
+
const {
|
|
63
|
+
isMobile
|
|
64
|
+
} = useDeviceInfo();
|
|
65
|
+
const [displayColumnKeyNames, setDisplayColumnKeyNames] = useState();
|
|
66
|
+
const [displayColumnsIndexed, setDisplayColumnsIndexed] = useState();
|
|
67
|
+
const [displayColumnDetails, setDisplayColumnDetails] = useState();
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
const columnsKeyNames = columns.map(col => col.key);
|
|
70
|
+
const columnsIndexed = columns.reduce((acum, value) => {
|
|
71
|
+
acum[value.key] = value;
|
|
72
|
+
return acum;
|
|
73
|
+
}, {});
|
|
74
|
+
setDisplayColumnKeyNames(columnsKeyNames);
|
|
75
|
+
setDisplayColumnsIndexed(columnsIndexed);
|
|
76
|
+
}, [columns]);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (displayColumnKeyNames && displayColumnsIndexed) {
|
|
79
|
+
const columnsDetails = displayColumnKeyNames.map(key => ({
|
|
80
|
+
...displayColumnsIndexed[key]
|
|
81
|
+
}));
|
|
82
|
+
setDisplayColumnDetails(columnsDetails);
|
|
83
|
+
}
|
|
84
|
+
}, [displayColumnKeyNames, displayColumnsIndexed]);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (setSelectedRows && rows.length >= 0) {
|
|
87
|
+
setSelectedRows(currentlySelectedRows => {
|
|
88
|
+
const emptyArray = [];
|
|
89
|
+
if (rows.length || currentlySelectedRows.length > rows.length) {
|
|
90
|
+
return emptyArray;
|
|
43
91
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
density
|
|
112
|
-
]);
|
|
113
|
-
const [headCells, setHeadCells] = react.useState();
|
|
114
|
-
react.useEffect(()=>{
|
|
115
|
-
if (displayColumnDetails) setHeadCells(columnsToHeadCells(displayColumnDetails));
|
|
116
|
-
}, [
|
|
117
|
-
columnsToHeadCells,
|
|
118
|
-
displayColumnDetails
|
|
119
|
-
]);
|
|
120
|
-
const sensors = useSensors(useSensor(MouseSensor), useSensor(TouchSensor), useSensor(KeyboardSensor, {
|
|
121
|
-
coordinateGetter: sortableKeyboardCoordinates
|
|
92
|
+
return currentlySelectedRows;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}, [rows, setSelectedRows]);
|
|
96
|
+
const handleChangePage = useCallback((event, newPage) => {
|
|
97
|
+
onPageChange?.(newPage);
|
|
98
|
+
if (currentPage === undefined) {
|
|
99
|
+
setInternalPage(newPage);
|
|
100
|
+
}
|
|
101
|
+
}, [onPageChange, currentPage]);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
// this is not most elegant but we want to do this if table was sorted by some column in a presorted table
|
|
104
|
+
// but we don't know when the data changes, hence this useEffect on the data size
|
|
105
|
+
if (isPresorted && onPageChange === undefined) {
|
|
106
|
+
// we want to set page back to 1 if the data changes on presorted lists,
|
|
107
|
+
// this is because the data was reset due to some sort behavior refetching new data
|
|
108
|
+
handleChangePage({}, 1);
|
|
109
|
+
}
|
|
110
|
+
}, [handleChangePage, isPresorted, onPageChange, rows]);
|
|
111
|
+
const handleRequestSort = (event, property) => {
|
|
112
|
+
const isAsc = orderBy === property && order === 'asc';
|
|
113
|
+
const newOrder = isAsc ? 'desc' : 'asc';
|
|
114
|
+
setOrder(newOrder);
|
|
115
|
+
setOrderBy(property);
|
|
116
|
+
if (sortHandler) {
|
|
117
|
+
sortHandler(newOrder, property);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
const hasEditColumn = columns.filter(c => c.type === 'edit').length > 0;
|
|
121
|
+
const isSelected = row => {
|
|
122
|
+
return selectedRows && selectedRows.indexOf(row) !== -1;
|
|
123
|
+
};
|
|
124
|
+
const handleSelectAllClick = event => {
|
|
125
|
+
if (setSelectedRows) {
|
|
126
|
+
if (event.target.checked) {
|
|
127
|
+
setSelectedRows(rows);
|
|
128
|
+
return;
|
|
129
|
+
} else {
|
|
130
|
+
setSelectedRows([]);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const handleClick = (event, row) => {
|
|
135
|
+
if (setSelectedRows && selectedRows) {
|
|
136
|
+
const selectedIndex = selectedRows.indexOf(row);
|
|
137
|
+
let newSelected = [];
|
|
138
|
+
if (selectedIndex === -1) {
|
|
139
|
+
newSelected = newSelected.concat(selectedRows, row);
|
|
140
|
+
} else if (selectedIndex === 0) {
|
|
141
|
+
newSelected = newSelected.concat(selectedRows.slice(1));
|
|
142
|
+
} else if (selectedIndex === selectedRows.length - 1) {
|
|
143
|
+
newSelected = newSelected.concat(selectedRows.slice(0, -1));
|
|
144
|
+
} else if (selectedIndex > 0) {
|
|
145
|
+
newSelected = newSelected.concat(selectedRows.slice(0, selectedIndex), selectedRows.slice(selectedIndex + 1));
|
|
146
|
+
}
|
|
147
|
+
setSelectedRows(newSelected);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const columnsToHeadCells = useCallback(columnsR => {
|
|
151
|
+
return columnsR.map(c => ({
|
|
152
|
+
id: c.key,
|
|
153
|
+
disablePadding: true,
|
|
154
|
+
label: typeof c.name === 'string' ? c.name.toUpperCase() : c.name,
|
|
155
|
+
sx: [{
|
|
156
|
+
paddingY: getTableCellPaddingY(density)
|
|
157
|
+
}, ...(Array.isArray(c.sx) ? c.sx : [c.sx])],
|
|
158
|
+
tooltipTitle: c.tooltipTitle
|
|
122
159
|
}));
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const newIndex = headCells.findIndex((item)=>item.id === over.id);
|
|
146
|
-
onReorderEndHandler({
|
|
147
|
-
oldIndex,
|
|
148
|
-
newIndex
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
const pageNumber = useMemo(()=>currentPage ?? internalPage, [
|
|
154
|
-
currentPage,
|
|
155
|
-
internalPage
|
|
156
|
-
]);
|
|
157
|
-
const sortedPageRows = useMemo(()=>{
|
|
158
|
-
if (!rows) return [];
|
|
159
|
-
else {
|
|
160
|
-
const itemsToSkip = onPageChange ? 0 : maxItemsPerPage * (pageNumber - 1);
|
|
161
|
-
return (isPresorted ? rows : stableSort(rows, getComparator(order, orderBy, sortComparator))).slice(itemsToSkip, itemsToSkip + maxItemsPerPage);
|
|
160
|
+
}, [density]);
|
|
161
|
+
const [headCells, setHeadCells] = React.useState();
|
|
162
|
+
React.useEffect(() => {
|
|
163
|
+
if (displayColumnDetails) {
|
|
164
|
+
setHeadCells(columnsToHeadCells(displayColumnDetails));
|
|
165
|
+
}
|
|
166
|
+
}, [columnsToHeadCells, displayColumnDetails]);
|
|
167
|
+
const sensors = useSensors(useSensor(MouseSensor), useSensor(TouchSensor), useSensor(KeyboardSensor, {
|
|
168
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
169
|
+
}));
|
|
170
|
+
const onReorderEndHandler = useCallback(({
|
|
171
|
+
oldIndex,
|
|
172
|
+
newIndex
|
|
173
|
+
}) => {
|
|
174
|
+
if (displayColumnKeyNames) {
|
|
175
|
+
if (newIndex !== 0 && oldIndex !== 0) {
|
|
176
|
+
const newOrder = [...displayColumnKeyNames];
|
|
177
|
+
const moved = newOrder.splice(oldIndex, 1);
|
|
178
|
+
newOrder.splice(newIndex, 0, moved[0]);
|
|
179
|
+
setDisplayColumnKeyNames(newOrder);
|
|
180
|
+
if (onReorderEnd) {
|
|
181
|
+
onReorderEnd(newOrder);
|
|
162
182
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
/*#__PURE__*/ jsxs(TableRow, {
|
|
254
|
-
id: `row${index + 1}`,
|
|
255
|
-
hover: true,
|
|
256
|
-
onClick: (e)=>{
|
|
257
|
-
e.stopPropagation();
|
|
258
|
-
if (onClick && !hasEditColumn && (isClickable ? isClickable(row) : true)) onClick();
|
|
259
|
-
if (!onClick && !hasEditColumn && (isClickable ? isClickable(row) : true)) handleClick(e, row);
|
|
260
|
-
},
|
|
261
|
-
selected: isItemSelected,
|
|
262
|
-
"aria-checked": isItemSelected,
|
|
263
|
-
sx: {
|
|
264
|
-
...isInactive && isInactive(row) ? {
|
|
265
|
-
backgroundColor: theme.palette.neutral[50]
|
|
266
|
-
} : {},
|
|
267
|
-
height: getTableRowHeight(density),
|
|
268
|
-
'&.MuiTableRow-root.Mui-selected': {
|
|
269
|
-
backgroundColor: theme.palette.TwClrBgSelectedTertiary
|
|
270
|
-
},
|
|
271
|
-
'&:nth-of-type(odd)': {
|
|
272
|
-
backgroundColor: theme.palette.TwClrBgSecondary
|
|
273
|
-
},
|
|
274
|
-
'&:hover': {
|
|
275
|
-
backgroundColor: theme.palette.TwClrBgSecondaryHover
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
children: [
|
|
279
|
-
showCheckbox && /*#__PURE__*/ jsx(TableCell, {
|
|
280
|
-
padding: "checkbox",
|
|
281
|
-
sx: {
|
|
282
|
-
'&.MuiTableCell-root': {
|
|
283
|
-
borderBottom: `1px solid ${theme.palette.TwClrBgSecondary}`
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
children: /*#__PURE__*/ jsx(Checkbox, {
|
|
287
|
-
disableRipple: true,
|
|
288
|
-
sx: CheckboxStyle(theme),
|
|
289
|
-
color: "primary",
|
|
290
|
-
checked: isItemSelected,
|
|
291
|
-
onClick: (e)=>isClickable && isClickable(row) ? null : handleClick(e, row)
|
|
292
|
-
})
|
|
293
|
-
}),
|
|
294
|
-
displayColumnDetails && displayColumnDetails.map((c)=>/*#__PURE__*/ jsx(Renderer, {
|
|
295
|
-
index: index + 1,
|
|
296
|
-
row: row,
|
|
297
|
-
column: c,
|
|
298
|
-
value: row[c.key],
|
|
299
|
-
onRowClick: onSelect && controlledOnSelect ? (newValue)=>onSelect(row, c.key, newValue) : onClick,
|
|
300
|
-
reloadData: reloadData,
|
|
301
|
-
booleanFalseText: booleanFalseText,
|
|
302
|
-
booleanTrueText: booleanTrueText,
|
|
303
|
-
editText: editText,
|
|
304
|
-
sx: {
|
|
305
|
-
paddingY: getTableCellPaddingY(density)
|
|
306
|
-
}
|
|
307
|
-
}, c.key))
|
|
308
|
-
]
|
|
309
|
-
}),
|
|
310
|
-
DetailsRenderer && /*#__PURE__*/ jsx(DetailsRenderer, {
|
|
311
|
-
index: index,
|
|
312
|
-
row: row
|
|
313
|
-
})
|
|
314
|
-
]
|
|
315
|
-
}, index);
|
|
316
|
-
})
|
|
317
|
-
]
|
|
318
|
-
})
|
|
319
|
-
]
|
|
320
|
-
})
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}, [displayColumnKeyNames, setDisplayColumnKeyNames, onReorderEnd]);
|
|
186
|
+
const handleDragEnd = event => {
|
|
187
|
+
if (headCells) {
|
|
188
|
+
const {
|
|
189
|
+
active,
|
|
190
|
+
over
|
|
191
|
+
} = event;
|
|
192
|
+
if (active && over && active.id !== over.id && onReorderEndHandler) {
|
|
193
|
+
const oldIndex = headCells.findIndex(item => item.id === active.id);
|
|
194
|
+
const newIndex = headCells.findIndex(item => item.id === over.id);
|
|
195
|
+
onReorderEndHandler({
|
|
196
|
+
oldIndex,
|
|
197
|
+
newIndex
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
const pageNumber = useMemo(() => currentPage ?? internalPage, [currentPage, internalPage]);
|
|
203
|
+
const sortedPageRows = useMemo(() => {
|
|
204
|
+
if (rows) {
|
|
205
|
+
const itemsToSkip = onPageChange ? 0 : maxItemsPerPage * (pageNumber - 1);
|
|
206
|
+
return (isPresorted ? rows : stableSort(rows, getComparator(order, orderBy, sortComparator))).slice(itemsToSkip, itemsToSkip + maxItemsPerPage);
|
|
207
|
+
} else {
|
|
208
|
+
return [];
|
|
209
|
+
}
|
|
210
|
+
}, [rows, onPageChange, maxItemsPerPage, pageNumber, isPresorted, order, orderBy, sortComparator]);
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Calculate pagination numbers to show.
|
|
214
|
+
* If the table is empty (rows.length === 0) override calculation and show '0 of 0'
|
|
215
|
+
* Pagination total is overridden by totalRowCount if provided.
|
|
216
|
+
*/
|
|
217
|
+
const paginationTotal = useMemo(() => totalRowCount || rows.length, [rows.length, totalRowCount]);
|
|
218
|
+
const pagesCount = useMemo(() => Math.ceil(paginationTotal / maxItemsPerPage), [maxItemsPerPage, paginationTotal]);
|
|
219
|
+
const minRowNumber = useMemo(() => {
|
|
220
|
+
if (!sortedPageRows.length) {
|
|
221
|
+
return 0;
|
|
222
|
+
}
|
|
223
|
+
return (pageNumber - 1) * maxItemsPerPage + 1;
|
|
224
|
+
}, [pageNumber, maxItemsPerPage, sortedPageRows.length]);
|
|
225
|
+
const maxRowNumber = useMemo(() => {
|
|
226
|
+
if (!sortedPageRows.length) {
|
|
227
|
+
return 0;
|
|
228
|
+
}
|
|
229
|
+
return Math.min(pageNumber * maxItemsPerPage, paginationTotal);
|
|
230
|
+
}, [pageNumber, maxItemsPerPage, paginationTotal, sortedPageRows.length]);
|
|
231
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
232
|
+
children: [showTopBar && /*#__PURE__*/jsx(EnhancedTableToolbarV2, {
|
|
233
|
+
selectedRowsCount: selectedRows?.length || 0,
|
|
234
|
+
pagesCount: pagesCount,
|
|
235
|
+
renderNumSelectedText: renderNumSelectedText,
|
|
236
|
+
rowsCount: rows.length,
|
|
237
|
+
topBarButtons: topBarButtons,
|
|
238
|
+
topBarSelectionConfig: enhancedTopBarSelectionConfig ? {
|
|
239
|
+
...enhancedTopBarSelectionConfig,
|
|
240
|
+
handleSelectAll: () => setSelectedRows && setSelectedRows(rows),
|
|
241
|
+
handleSelectNone: () => setSelectedRows && setSelectedRows([])
|
|
242
|
+
} : undefined
|
|
243
|
+
}), /*#__PURE__*/jsx(TableContainer, {
|
|
244
|
+
id: id,
|
|
245
|
+
children: /*#__PURE__*/jsx(DndContext, {
|
|
246
|
+
sensors: sensors,
|
|
247
|
+
onDragEnd: handleDragEnd,
|
|
248
|
+
children: /*#__PURE__*/jsxs(Table, {
|
|
249
|
+
stickyHeader: stickyHeader,
|
|
250
|
+
"aria-labelledby": "tableTitle",
|
|
251
|
+
size: "medium",
|
|
252
|
+
"aria-label": "enhanced table",
|
|
253
|
+
sx: {
|
|
254
|
+
borderCollapse: 'initial'
|
|
255
|
+
},
|
|
256
|
+
children: [!hideHeader && /*#__PURE__*/jsx(EnhancedTableHead, {
|
|
257
|
+
order: order,
|
|
258
|
+
orderBy: orderBy,
|
|
259
|
+
onRequestSort: handleRequestSort,
|
|
260
|
+
columns: displayColumnDetails ?? [],
|
|
261
|
+
onReorderEnd: onReorderEndHandler,
|
|
262
|
+
numSelected: showCheckbox ? selectedRows?.length : undefined,
|
|
263
|
+
onSelectAllClick: showCheckbox ? handleSelectAllClick : undefined,
|
|
264
|
+
rowCount: showCheckbox ? sortedPageRows?.length : undefined,
|
|
265
|
+
density: density
|
|
266
|
+
}), /*#__PURE__*/jsxs(TableBody, {
|
|
267
|
+
children: [sortedPageRows.length < 1 && emptyTableMessage && /*#__PURE__*/jsx(TableRow, {
|
|
268
|
+
children: /*#__PURE__*/jsx(TableCell, {
|
|
269
|
+
colSpan: columns.length + 1,
|
|
270
|
+
align: "center",
|
|
271
|
+
children: /*#__PURE__*/jsx("p", {
|
|
272
|
+
children: emptyTableMessage
|
|
321
273
|
})
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
274
|
+
})
|
|
275
|
+
}), sortedPageRows && sortedPageRows.map((row, index) => {
|
|
276
|
+
const onClick = onSelect && !controlledOnSelect ? () => onSelect(row) : undefined;
|
|
277
|
+
const isItemSelected = isSelected(row);
|
|
278
|
+
return /*#__PURE__*/jsxs(React.Fragment, {
|
|
279
|
+
children: [/*#__PURE__*/jsxs(TableRow, {
|
|
280
|
+
id: `row${index + 1}`,
|
|
281
|
+
hover: true,
|
|
282
|
+
onClick: e => {
|
|
283
|
+
e.stopPropagation();
|
|
284
|
+
if (onClick && !hasEditColumn && (isClickable ? isClickable(row) : true)) {
|
|
285
|
+
onClick();
|
|
286
|
+
}
|
|
287
|
+
if (!onClick && !hasEditColumn && (isClickable ? isClickable(row) : true)) {
|
|
288
|
+
handleClick(e, row);
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
selected: isItemSelected,
|
|
292
|
+
"aria-checked": isItemSelected,
|
|
293
|
+
sx: {
|
|
294
|
+
...(isInactive && isInactive(row) ? {
|
|
295
|
+
backgroundColor: theme.palette.neutral[50]
|
|
296
|
+
} : {}),
|
|
297
|
+
height: getTableRowHeight(density),
|
|
298
|
+
'&.MuiTableRow-root.Mui-selected': {
|
|
299
|
+
backgroundColor: theme.palette.TwClrBgSelectedTertiary
|
|
300
|
+
},
|
|
301
|
+
'&:nth-of-type(odd)': {
|
|
302
|
+
backgroundColor: theme.palette.TwClrBgSecondary
|
|
303
|
+
},
|
|
304
|
+
'&:hover': {
|
|
305
|
+
backgroundColor: theme.palette.TwClrBgSecondaryHover
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
children: [showCheckbox && /*#__PURE__*/jsx(TableCell, {
|
|
309
|
+
padding: "checkbox",
|
|
310
|
+
sx: {
|
|
311
|
+
'&.MuiTableCell-root': {
|
|
312
|
+
borderBottom: `1px solid ${theme.palette.TwClrBgSecondary}`
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
children: /*#__PURE__*/jsx(Checkbox, {
|
|
316
|
+
disableRipple: true,
|
|
317
|
+
sx: CheckboxStyle(theme),
|
|
318
|
+
color: "primary",
|
|
319
|
+
checked: isItemSelected,
|
|
320
|
+
onClick: e => !isClickable || !isClickable(row) ? handleClick(e, row) : null
|
|
348
321
|
})
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
322
|
+
}), displayColumnDetails && displayColumnDetails.map(c => /*#__PURE__*/jsx(Renderer, {
|
|
323
|
+
index: index + 1,
|
|
324
|
+
row: row,
|
|
325
|
+
column: c,
|
|
326
|
+
value: row[c.key],
|
|
327
|
+
onRowClick: onSelect && controlledOnSelect ? newValue => onSelect(row, c.key, newValue) : onClick,
|
|
328
|
+
reloadData: reloadData,
|
|
329
|
+
booleanFalseText: booleanFalseText,
|
|
330
|
+
booleanTrueText: booleanTrueText,
|
|
331
|
+
editText: editText,
|
|
332
|
+
sx: {
|
|
333
|
+
paddingY: getTableCellPaddingY(density)
|
|
334
|
+
}
|
|
335
|
+
}, c.key))]
|
|
336
|
+
}), DetailsRenderer && /*#__PURE__*/jsx(DetailsRenderer, {
|
|
337
|
+
index: index,
|
|
338
|
+
row: row
|
|
339
|
+
})]
|
|
340
|
+
}, index);
|
|
341
|
+
})]
|
|
342
|
+
})]
|
|
343
|
+
})
|
|
344
|
+
})
|
|
345
|
+
}), tableComments && /*#__PURE__*/jsx(Typography, {
|
|
346
|
+
fontWeight: 400,
|
|
347
|
+
fontSize: "14px",
|
|
348
|
+
color: theme.palette.TwClrTxtSecondary,
|
|
349
|
+
marginTop: 2,
|
|
350
|
+
children: tableComments
|
|
351
|
+
}), renderPaginationText && /*#__PURE__*/jsxs(Box, {
|
|
352
|
+
display: "flex",
|
|
353
|
+
alignItems: "center",
|
|
354
|
+
justifyContent: "flex-end",
|
|
355
|
+
paddingTop: "24px",
|
|
356
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
357
|
+
paddingRight: "24px",
|
|
358
|
+
fontSize: "14px",
|
|
359
|
+
children: renderPaginationText(minRowNumber, maxRowNumber, paginationTotal)
|
|
360
|
+
}), /*#__PURE__*/jsx(Pagination, {
|
|
361
|
+
count: pagesCount,
|
|
362
|
+
page: pageNumber,
|
|
363
|
+
shape: "rounded",
|
|
364
|
+
onChange: handleChangePage,
|
|
365
|
+
siblingCount: isMobile ? 0 : 1,
|
|
366
|
+
size: 'small'
|
|
367
|
+
})]
|
|
368
|
+
})]
|
|
369
|
+
});
|
|
353
370
|
}
|
|
354
371
|
function tableSort(ignore, array, comparator) {
|
|
355
|
-
|
|
356
|
-
return
|
|
372
|
+
if (ignore) {
|
|
373
|
+
return array;
|
|
374
|
+
}
|
|
375
|
+
return stableSort(array, comparator);
|
|
357
376
|
}
|
|
358
|
-
|
|
359
|
-
export { isTopBarButton, tableSort };
|
|
377
|
+
|
|
378
|
+
export { EnhancedTable as default, isTopBarButton, tableSort };
|