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