@terraware/web-components 4.2.13 → 4.2.14-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 +8 -14
- package/components/Autocomplete/Autocomplete.js +67 -70
- package/components/Badge/index.js +16 -20
- package/components/BusySpinner/index.js +30 -35
- package/components/Button/Button.js +23 -27
- package/components/Button/button.test.js +8 -10
- package/components/Checkbox.js +10 -19
- package/components/Confirm/index.js +44 -51
- package/components/DatePicker/DatePicker.js +116 -117
- package/components/DialogBox/DialogBox.js +76 -66
- package/components/Divisor.js +15 -20
- package/components/Dropdown.js +54 -61
- package/components/EditableTable/index.js +129 -135
- package/components/ErrorBox/ErrorBox.js +37 -36
- package/components/FileChooser/index.js +73 -77
- package/components/FormBottomBar/index.js +63 -69
- package/components/Icon/Icon.js +14 -21
- package/components/Icon/icons/index.js +251 -257
- package/components/IconTooltip/index.js +29 -34
- package/components/Map/MapBox.js +199 -220
- package/components/Map/MapContainer.js +14 -18
- package/components/Map/MapDateSliderControl.js +44 -46
- package/components/Map/MapDrawer.js +32 -33
- package/components/Map/MapLegend.js +96 -95
- package/components/Map/MapViewStyleControl.js +38 -48
- package/components/Map/ReactMapboxWrapper.js +2 -9
- package/components/Map/index.js +47 -55
- package/components/Map/types.js +2 -8
- package/components/Map/useMaintainLayerOrder.js +4 -11
- package/components/Markdown/index.js +14 -21
- package/components/Message/Message.js +59 -51
- package/components/MultiSelect/MultiSelect.test.js +22 -24
- package/components/MultiSelect/index.js +73 -69
- package/components/Navbar/NavFooter.js +8 -13
- package/components/Navbar/NavItem.js +43 -37
- package/components/Navbar/NavSection.js +13 -17
- package/components/Navbar/Navbar.js +35 -38
- package/components/Navbar/SubNavbar.js +8 -13
- package/components/Note.js +14 -19
- package/components/OverlayModal/OverlayModal.js +36 -37
- package/components/PageForm/index.js +30 -35
- package/components/PhotoChooser/index.js +93 -98
- package/components/Pill/index.js +29 -31
- package/components/PillList/index.js +16 -22
- package/components/PlacementWrapper/index.js +20 -25
- package/components/PopoverMenu/Popover.js +33 -37
- package/components/PopoverMenu/index.js +41 -46
- package/components/PopoverMultiSelect/index.js +18 -21
- package/components/ProgressCircle/ProgressCircle.js +23 -26
- package/components/RadioButton.js +7 -14
- package/components/Select/Select.js +8 -13
- package/components/Select/SelectT.js +110 -108
- package/components/Separator/index.js +8 -14
- package/components/Size.js +1 -5
- package/components/Slider/index.js +7 -13
- package/components/SummaryBox.js +36 -39
- package/components/Tabs/index.js +75 -77
- package/components/TextTruncated/index.js +64 -65
- package/components/Textfield/Textfield.js +100 -95
- package/components/Textfield/TruncatedTextArea.js +44 -46
- package/components/TimelineSlider/TimelineMarker.js +24 -28
- package/components/TimelineSlider/TimelineRail.js +5 -11
- package/components/TimelineSlider/index.js +47 -51
- package/components/Tooltip/Tooltip.js +21 -26
- package/components/ViewPhotosDialog/index.js +58 -62
- package/components/VirtualWalkthrough/Annotation.d.ts +41 -0
- package/components/VirtualWalkthrough/Annotation.d.ts.map +1 -0
- package/components/VirtualWalkthrough/Annotation.js +197 -0
- package/components/VirtualWalkthrough/AnnotationEditPane.d.ts +20 -0
- package/components/VirtualWalkthrough/AnnotationEditPane.d.ts.map +1 -0
- package/components/VirtualWalkthrough/AnnotationEditPane.js +136 -0
- package/components/VirtualWalkthrough/AnnotationPanel.d.ts +13 -0
- package/components/VirtualWalkthrough/AnnotationPanel.d.ts.map +1 -0
- package/components/VirtualWalkthrough/AnnotationPanel.js +196 -0
- package/components/VirtualWalkthrough/Application.d.ts +9 -0
- package/components/VirtualWalkthrough/Application.d.ts.map +1 -0
- package/components/VirtualWalkthrough/Application.js +32 -0
- package/components/VirtualWalkthrough/AutoRotator.d.ts +109 -0
- package/components/VirtualWalkthrough/AutoRotator.d.ts.map +1 -0
- package/components/VirtualWalkthrough/AutoRotator.js +217 -0
- package/components/VirtualWalkthrough/BlockingSpinner.d.ts +3 -0
- package/components/VirtualWalkthrough/BlockingSpinner.d.ts.map +1 -0
- package/components/VirtualWalkthrough/BlockingSpinner.js +27 -0
- package/components/VirtualWalkthrough/BoundaryRing.d.ts +9 -0
- package/components/VirtualWalkthrough/BoundaryRing.d.ts.map +1 -0
- package/components/VirtualWalkthrough/BoundaryRing.js +33 -0
- package/components/VirtualWalkthrough/CameraInfo.d.ts +16 -0
- package/components/VirtualWalkthrough/CameraInfo.d.ts.map +1 -0
- package/components/VirtualWalkthrough/CameraInfo.js +88 -0
- package/components/VirtualWalkthrough/ControlsInfoPane.d.ts +37 -0
- package/components/VirtualWalkthrough/ControlsInfoPane.d.ts.map +1 -0
- package/components/VirtualWalkthrough/ControlsInfoPane.js +196 -0
- package/components/VirtualWalkthrough/GradientSky.d.ts +9 -0
- package/components/VirtualWalkthrough/GradientSky.d.ts.map +1 -0
- package/components/VirtualWalkthrough/GradientSky.js +73 -0
- package/components/VirtualWalkthrough/SplatControls.d.ts +50 -0
- package/components/VirtualWalkthrough/SplatControls.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatControls.js +252 -0
- package/components/VirtualWalkthrough/SplatCrop.d.ts +8 -0
- package/components/VirtualWalkthrough/SplatCrop.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatCrop.js +18 -0
- package/components/VirtualWalkthrough/SplatFadeCrop.d.ts +8 -0
- package/components/VirtualWalkthrough/SplatFadeCrop.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatFadeCrop.js +18 -0
- package/components/VirtualWalkthrough/SplatModel.d.ts +15 -0
- package/components/VirtualWalkthrough/SplatModel.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatModel.js +60 -0
- package/components/VirtualWalkthrough/SplatRevealRain.d.ts +18 -0
- package/components/VirtualWalkthrough/SplatRevealRain.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatRevealRain.js +38 -0
- package/components/VirtualWalkthrough/TfAnnotationManager.d.ts +110 -0
- package/components/VirtualWalkthrough/TfAnnotationManager.d.ts.map +1 -0
- package/components/VirtualWalkthrough/TfAnnotationManager.js +368 -0
- package/components/VirtualWalkthrough/TfXrNavigation.d.ts +15 -0
- package/components/VirtualWalkthrough/TfXrNavigation.d.ts.map +1 -0
- package/components/VirtualWalkthrough/TfXrNavigation.js +24 -0
- package/components/VirtualWalkthrough/annotation-styles.css +5 -0
- package/components/VirtualWalkthrough/application-styles.css +4 -0
- package/components/VirtualWalkthrough/boundary-ring.d.ts +47 -0
- package/components/VirtualWalkthrough/boundary-ring.d.ts.map +1 -0
- package/components/VirtualWalkthrough/boundary-ring.js +125 -0
- package/components/VirtualWalkthrough/boundary-ring.test.js +109 -0
- package/components/VirtualWalkthrough/groundPlane.d.ts +14 -0
- package/components/VirtualWalkthrough/groundPlane.d.ts.map +1 -0
- package/components/VirtualWalkthrough/groundPlane.js +47 -0
- package/components/VirtualWalkthrough/groundPlane.test.js +45 -0
- package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts +19 -0
- package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts.map +1 -0
- package/components/VirtualWalkthrough/gsplat-fade-crop-effect.js +119 -0
- package/components/VirtualWalkthrough/walkthrough-camera.d.ts +77 -0
- package/components/VirtualWalkthrough/walkthrough-camera.d.ts.map +1 -0
- package/components/VirtualWalkthrough/walkthrough-camera.js +320 -0
- package/components/svg/BlobbyGrayIconImage.js +36 -41
- package/components/svg/BlobbyGrayIconImport.js +36 -41
- package/components/svg/BlobbyGrayIconUploadToTheCloud.js +36 -41
- package/components/svg/BlobbyIconCloudChecked.js +161 -158
- package/components/svg/BlobbyIconExportOrUploadPhoto.js +161 -158
- package/components/svg/BlobbyIconFolder.js +161 -158
- package/components/svg/BlobbyIconGraphReport.js +161 -158
- package/components/svg/BlobbyIconHappy.js +161 -158
- package/components/svg/BlobbyIconHeartMonitor.js +161 -158
- package/components/svg/BlobbyIconLeaf.js +161 -158
- package/components/svg/BlobbyIconLibrary.js +161 -158
- package/components/svg/BlobbyIconNursery.js +163 -160
- package/components/svg/BlobbyIconOrganization.js +161 -158
- package/components/svg/BlobbyIconParchment.js +161 -158
- package/components/svg/BlobbyIconPeople.js +161 -158
- package/components/svg/BlobbyIconSeedBank.js +161 -158
- package/components/svg/BlobbyIconSeedling.js +161 -158
- package/components/svg/BlobbyIconSeeds.js +161 -158
- package/components/svg/BlobbyIconSite.js +164 -161
- package/components/svg/BlobbyIconSparkles.js +161 -158
- package/components/svg/BlobbyIconWrench.js +161 -158
- package/components/svg/Bug.js +18 -27
- package/components/svg/Calendar.js +18 -27
- package/components/svg/CaretDown.js +18 -27
- package/components/svg/CaretLeft.js +18 -27
- package/components/svg/CaretRight.js +18 -27
- package/components/svg/CaretUp.js +18 -27
- package/components/svg/ChevronDown.js +18 -27
- package/components/svg/ChevronUp.js +18 -27
- package/components/svg/Close.js +18 -27
- package/components/svg/Critical.js +18 -27
- package/components/svg/Edit.js +161 -158
- package/components/svg/Error.js +18 -27
- package/components/svg/Filter.js +18 -27
- package/components/svg/Folder.js +18 -27
- package/components/svg/Help.js +18 -27
- package/components/svg/Home.js +18 -27
- package/components/svg/IconAdd.js +18 -27
- package/components/svg/IconArrowRight.js +19 -28
- package/components/svg/IconBusinessNetwork.js +18 -27
- package/components/svg/IconCalendar.js +18 -27
- package/components/svg/IconCancel.js +18 -27
- package/components/svg/IconChargingBattery.js +18 -27
- package/components/svg/IconChecklist.js +19 -28
- package/components/svg/IconCheckmark.js +18 -27
- package/components/svg/IconCoinInHand.js +18 -27
- package/components/svg/IconColumns.js +18 -27
- package/components/svg/IconComment.js +18 -27
- package/components/svg/IconDashboard.js +18 -27
- package/components/svg/IconDataMigration.js +18 -27
- package/components/svg/IconDocument.js +19 -28
- package/components/svg/IconDownloadFromTheCloud.js +19 -28
- package/components/svg/IconEdit.js +19 -28
- package/components/svg/IconExpand.js +19 -28
- package/components/svg/IconExport.js +18 -27
- package/components/svg/IconExternalLink.js +18 -27
- package/components/svg/IconEye.js +18 -27
- package/components/svg/IconEyeOff.js +18 -27
- package/components/svg/IconFile.js +18 -27
- package/components/svg/IconFolder.js +18 -27
- package/components/svg/IconFullScreen.js +18 -27
- package/components/svg/IconFutures.js +18 -27
- package/components/svg/IconGraphReport.js +18 -27
- package/components/svg/IconHeartMonitor.js +18 -27
- package/components/svg/IconHelp.js +19 -28
- package/components/svg/IconHistory.js +18 -27
- package/components/svg/IconImport.js +18 -27
- package/components/svg/IconIndex.js +18 -27
- package/components/svg/IconLayers.js +18 -27
- package/components/svg/IconLibrary.js +18 -27
- package/components/svg/IconList.js +18 -27
- package/components/svg/IconLivePlant.js +18 -27
- package/components/svg/IconLocations.js +18 -27
- package/components/svg/IconMail.js +18 -27
- package/components/svg/IconManager.js +18 -27
- package/components/svg/IconMarker.js +18 -27
- package/components/svg/IconMenu.js +18 -27
- package/components/svg/IconMenuHorizontal.js +18 -27
- package/components/svg/IconModule.js +18 -27
- package/components/svg/IconMyLocation.js +18 -27
- package/components/svg/IconNote.js +19 -28
- package/components/svg/IconNursery.js +18 -27
- package/components/svg/IconOrg.js +18 -27
- package/components/svg/IconParchment.js +18 -27
- package/components/svg/IconPhoto.js +18 -27
- package/components/svg/IconPlantsFilled.js +18 -27
- package/components/svg/IconRedo.js +18 -27
- package/components/svg/IconRestorationSite.js +18 -27
- package/components/svg/IconSeedBank.js +18 -27
- package/components/svg/IconSeedling.js +18 -27
- package/components/svg/IconSettings.js +18 -27
- package/components/svg/IconSlice.js +18 -27
- package/components/svg/IconSubmit.js +18 -27
- package/components/svg/IconSubtract.js +19 -28
- package/components/svg/IconSynced.js +18 -27
- package/components/svg/IconTrashCan.js +18 -27
- package/components/svg/IconTreasureMap.js +18 -27
- package/components/svg/IconUnavailable.js +18 -27
- package/components/svg/IconUndo.js +18 -27
- package/components/svg/IconVariable.js +18 -27
- package/components/svg/IconVideo.js +19 -28
- package/components/svg/IconWifi.js +18 -27
- package/components/svg/Info.js +18 -27
- package/components/svg/Key.js +18 -27
- package/components/svg/Leaf.js +18 -27
- package/components/svg/Lock.js +18 -27
- package/components/svg/Logo.js +40 -45
- package/components/svg/MenuVertical.js +18 -27
- package/components/svg/Notification.js +18 -27
- package/components/svg/Person.js +18 -27
- package/components/svg/Plus.js +18 -27
- package/components/svg/RestorationSite.js +18 -27
- package/components/svg/Search.js +18 -27
- package/components/svg/Seeds.js +18 -27
- package/components/svg/Site.js +18 -27
- package/components/svg/Sparkles.js +18 -27
- package/components/svg/Species.js +18 -27
- package/components/svg/Species2.js +161 -158
- package/components/svg/Spinner.js +27 -36
- package/components/svg/Star.js +18 -27
- package/components/svg/Success.js +18 -27
- package/components/svg/SuccessFilled.js +18 -27
- package/components/svg/TerrawareLogoDesktop.js +44 -49
- package/components/svg/TerrawareLogoMobile.js +20 -29
- package/components/svg/Touchscreen.js +18 -27
- package/components/svg/UploadCloud.js +161 -158
- package/components/svg/Warning.js +18 -27
- package/components/svg/WelcomeClipboard.js +130 -135
- package/components/svg/index.js +127 -895
- package/components/table/EnhancedTableToolbar.js +45 -47
- package/components/table/EnhancedTableToolbarV2.js +18 -26
- package/components/table/TableCellRenderer.js +137 -143
- package/components/table/TableHeader.js +45 -47
- package/components/table/TableHeaderItem.js +65 -64
- package/components/table/density.js +3 -11
- package/components/table/index.js +225 -218
- package/components/table/sort.js +8 -18
- package/components/table/sort.test.js +6 -8
- package/components/table/types.js +1 -5
- package/components/types/index.js +1 -5
- package/hooks/useBoolean.d.ts +4 -0
- package/hooks/useBoolean.d.ts.map +1 -0
- package/hooks/useBoolean.js +12 -0
- package/hooks/useCameraPosition.d.ts +8 -0
- package/hooks/useCameraPosition.d.ts.map +1 -0
- package/hooks/useCameraPosition.js +33 -0
- package/index.js +57 -398
- package/license-report.html +1 -1
- package/package.json +10 -3
- package/style-dictionary-dist/TerrawareTheme.js +1 -7
- package/theme.js +7 -14
- package/utils/color.d.ts +2 -0
- package/utils/color.d.ts.map +1 -0
- package/utils/color.js +14 -0
- package/utils/date.js +13 -24
- package/utils/date.test.js +40 -43
- package/utils/index.js +5 -53
- package/utils/preventDefaultEvent.js +1 -7
- package/utils/text.js +2 -9
- package/utils/text.test.js +9 -11
- package/utils/useDeviceInfo.js +10 -16
- package/virtualWalkthrough.d.ts +31 -0
- package/virtualWalkthrough.d.ts.map +1 -0
- package/virtualWalkthrough.js +28 -0
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = EnhancedTableToolbar;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _material = require("@mui/material");
|
|
11
|
-
var _ = require(".");
|
|
12
|
-
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
13
|
-
var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
|
|
14
|
-
function EnhancedTableToolbar(props) {
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Link, Toolbar, Typography, useTheme } from '@mui/material';
|
|
3
|
+
import { isTopBarButton } from '.';
|
|
4
|
+
import Button from '../Button/Button';
|
|
5
|
+
import Tooltip from '../Tooltip/Tooltip';
|
|
6
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export default function EnhancedTableToolbar(props) {
|
|
15
8
|
const {
|
|
16
9
|
isAllSelected,
|
|
17
10
|
numSelected,
|
|
@@ -19,12 +12,12 @@ function EnhancedTableToolbar(props) {
|
|
|
19
12
|
topBarButtons,
|
|
20
13
|
topBarSelectionConfig
|
|
21
14
|
} = props;
|
|
22
|
-
const theme =
|
|
15
|
+
const theme = useTheme();
|
|
23
16
|
const selectLinkStyles = {
|
|
24
17
|
color: theme.palette.TwClrTxtBrand,
|
|
25
18
|
cursor: 'pointer'
|
|
26
19
|
};
|
|
27
|
-
const topBarSelection =
|
|
20
|
+
const topBarSelection = useMemo(() => {
|
|
28
21
|
if (!renderNumSelectedText) {
|
|
29
22
|
return null;
|
|
30
23
|
}
|
|
@@ -38,39 +31,44 @@ function EnhancedTableToolbar(props) {
|
|
|
38
31
|
renderSelectNoneText,
|
|
39
32
|
renderEnhancedNumSelectedText
|
|
40
33
|
} = topBarSelectionConfig;
|
|
41
|
-
return /*#__PURE__*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
35
|
+
children: [renderEnhancedNumSelectedText ? renderEnhancedNumSelectedText() : renderNumSelectedText(numSelected), ' ', !isAllSelected && handleSelectAll && renderSelectAllText && /*#__PURE__*/_jsx(Link, {
|
|
36
|
+
onClick: handleSelectAll,
|
|
37
|
+
sx: selectLinkStyles,
|
|
38
|
+
children: renderSelectAllText()
|
|
39
|
+
}), isAllSelected && handleSelectNone && renderSelectNoneText && /*#__PURE__*/_jsx(Link, {
|
|
40
|
+
onClick: handleSelectNone,
|
|
41
|
+
sx: selectLinkStyles,
|
|
42
|
+
children: renderSelectNoneText()
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
48
45
|
}, [renderNumSelectedText, topBarSelectionConfig, numSelected]);
|
|
49
|
-
return renderNumSelectedText && numSelected > 0 ? /*#__PURE__*/
|
|
46
|
+
return renderNumSelectedText && numSelected > 0 ? /*#__PURE__*/_jsxs(Toolbar, {
|
|
50
47
|
sx: {
|
|
51
48
|
background: theme.palette.TwClrBgSecondary,
|
|
52
49
|
borderRadius: theme.spacing(0.5)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
50
|
+
},
|
|
51
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
52
|
+
color: "inherit",
|
|
53
|
+
variant: "subtitle1",
|
|
54
|
+
component: "div",
|
|
55
|
+
sx: {
|
|
56
|
+
flex: '1 1 auto'
|
|
57
|
+
},
|
|
58
|
+
children: topBarSelection
|
|
59
|
+
}), topBarButtons?.map((tbButton, index) => isTopBarButton(tbButton) ? /*#__PURE__*/_jsx(Tooltip, {
|
|
60
|
+
title: tbButton.tooltipTitle,
|
|
61
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
62
|
+
label: tbButton.buttonText,
|
|
63
|
+
priority: "secondary",
|
|
64
|
+
type: tbButton.buttonType,
|
|
65
|
+
onClick: tbButton.onButtonClick,
|
|
66
|
+
icon: tbButton.icon,
|
|
67
|
+
disabled: tbButton.disabled,
|
|
68
|
+
sx: {
|
|
69
|
+
marginLeft: theme.spacing(1)
|
|
70
|
+
}
|
|
71
|
+
}, tbButton.buttonText)
|
|
72
|
+
}, index) : tbButton)]
|
|
73
|
+
}) : null;
|
|
76
74
|
}
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
let {
|
|
14
|
-
selectedRowsCount,
|
|
15
|
-
pagesCount,
|
|
16
|
-
renderNumSelectedText,
|
|
17
|
-
rowsCount,
|
|
18
|
-
topBarButtons,
|
|
19
|
-
topBarSelectionConfig
|
|
20
|
-
} = _ref;
|
|
21
|
-
const _topBarSelectionConfig = (0, _react.useMemo)(() => {
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import EnhancedTableToolbar from './EnhancedTableToolbar';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
const EnhancedTableToolbarV2 = ({
|
|
5
|
+
selectedRowsCount,
|
|
6
|
+
pagesCount,
|
|
7
|
+
renderNumSelectedText,
|
|
8
|
+
rowsCount,
|
|
9
|
+
topBarButtons,
|
|
10
|
+
topBarSelectionConfig
|
|
11
|
+
}) => {
|
|
12
|
+
const _topBarSelectionConfig = useMemo(() => {
|
|
22
13
|
if (!topBarSelectionConfig) {
|
|
23
14
|
return topBarSelectionConfig;
|
|
24
15
|
}
|
|
@@ -26,13 +17,14 @@ const EnhancedTableToolbarV2 = _ref => {
|
|
|
26
17
|
renderEnhancedNumSelectedText,
|
|
27
18
|
renderSelectAllText
|
|
28
19
|
} = topBarSelectionConfig;
|
|
29
|
-
return
|
|
20
|
+
return {
|
|
21
|
+
...topBarSelectionConfig,
|
|
30
22
|
renderEnhancedNumSelectedText: () => renderEnhancedNumSelectedText && renderEnhancedNumSelectedText(selectedRowsCount || 0, pagesCount) || '',
|
|
31
23
|
renderSelectAllText: () => renderSelectAllText && renderSelectAllText(rowsCount) || ''
|
|
32
|
-
}
|
|
24
|
+
};
|
|
33
25
|
}, [topBarSelectionConfig, selectedRowsCount, rowsCount, pagesCount]);
|
|
34
26
|
if (topBarSelectionConfig) {
|
|
35
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/_jsx(EnhancedTableToolbar, {
|
|
36
28
|
numSelected: selectedRowsCount,
|
|
37
29
|
topBarButtons: topBarButtons,
|
|
38
30
|
topBarSelectionConfig: _topBarSelectionConfig,
|
|
@@ -40,10 +32,10 @@ const EnhancedTableToolbarV2 = _ref => {
|
|
|
40
32
|
renderNumSelectedText: renderNumSelectedText
|
|
41
33
|
});
|
|
42
34
|
}
|
|
43
|
-
return /*#__PURE__*/
|
|
35
|
+
return /*#__PURE__*/_jsx(EnhancedTableToolbar, {
|
|
44
36
|
numSelected: selectedRowsCount,
|
|
45
37
|
renderNumSelectedText: renderNumSelectedText,
|
|
46
38
|
topBarButtons: topBarButtons
|
|
47
39
|
});
|
|
48
40
|
};
|
|
49
|
-
|
|
41
|
+
export default EnhancedTableToolbarV2;
|
|
@@ -1,29 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.CellBooleanRenderer = CellBooleanRenderer;
|
|
8
|
-
exports.CellDateRenderer = CellDateRenderer;
|
|
9
|
-
exports.CellEditRenderer = CellEditRenderer;
|
|
10
|
-
exports.CellNotesRenderer = CellNotesRenderer;
|
|
11
|
-
exports.CellTextRenderer = CellTextRenderer;
|
|
12
|
-
exports.cellDateFormatter = void 0;
|
|
13
|
-
exports.default = CellRenderer;
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var _iconsMaterial = require("@mui/icons-material");
|
|
16
|
-
var _material = require("@mui/material");
|
|
17
|
-
var _utils = require("../../utils");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Edit, Notes } from '@mui/icons-material';
|
|
3
|
+
import { Box, Link, TableCell, Typography, useTheme } from '@mui/material';
|
|
4
|
+
import { getDateDisplayValue, preventDefaultEvent } from '../../utils';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
6
|
const defaultStyles = theme => ({
|
|
19
7
|
'&.MuiTableCell-root': {
|
|
20
8
|
paddingTop: '0px',
|
|
21
9
|
paddingBottom: '0px',
|
|
22
|
-
borderBottom:
|
|
10
|
+
borderBottom: `1px solid ${theme.palette.TwClrBgSecondary}`,
|
|
23
11
|
fontVariantNumeric: 'tabular-nums'
|
|
24
12
|
}
|
|
25
13
|
});
|
|
26
|
-
function CellRenderer(props) {
|
|
14
|
+
export default function CellRenderer(props) {
|
|
27
15
|
const {
|
|
28
16
|
column,
|
|
29
17
|
value,
|
|
@@ -38,9 +26,9 @@ function CellRenderer(props) {
|
|
|
38
26
|
title,
|
|
39
27
|
component
|
|
40
28
|
} = props;
|
|
41
|
-
const id =
|
|
29
|
+
const id = `row${index}-${column.key}`;
|
|
42
30
|
if (column.type === 'date' && typeof value === 'string' && value) {
|
|
43
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/_jsx(CellDateRenderer, {
|
|
44
32
|
id: id,
|
|
45
33
|
value: value,
|
|
46
34
|
className: className,
|
|
@@ -50,7 +38,7 @@ function CellRenderer(props) {
|
|
|
50
38
|
title: title
|
|
51
39
|
});
|
|
52
40
|
} else if (column.type === 'notes' && value && typeof value === 'string') {
|
|
53
|
-
return /*#__PURE__*/
|
|
41
|
+
return /*#__PURE__*/_jsx(CellNotesRenderer, {
|
|
54
42
|
id: id,
|
|
55
43
|
value: value,
|
|
56
44
|
className: className,
|
|
@@ -60,7 +48,7 @@ function CellRenderer(props) {
|
|
|
60
48
|
title: title
|
|
61
49
|
});
|
|
62
50
|
} else if (column.type === 'boolean') {
|
|
63
|
-
return /*#__PURE__*/
|
|
51
|
+
return /*#__PURE__*/_jsx(CellBooleanRenderer, {
|
|
64
52
|
id: id,
|
|
65
53
|
value: value,
|
|
66
54
|
className: className,
|
|
@@ -72,7 +60,7 @@ function CellRenderer(props) {
|
|
|
72
60
|
title: title
|
|
73
61
|
});
|
|
74
62
|
} else if (column.type === 'edit') {
|
|
75
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/_jsx(CellEditRenderer, {
|
|
76
64
|
id: id,
|
|
77
65
|
onRowClick: onRowClick,
|
|
78
66
|
className: className,
|
|
@@ -83,7 +71,7 @@ function CellRenderer(props) {
|
|
|
83
71
|
title: title
|
|
84
72
|
});
|
|
85
73
|
}
|
|
86
|
-
return /*#__PURE__*/
|
|
74
|
+
return /*#__PURE__*/_jsx(CellTextRenderer, {
|
|
87
75
|
id: id,
|
|
88
76
|
value: value,
|
|
89
77
|
className: className,
|
|
@@ -94,151 +82,157 @@ function CellRenderer(props) {
|
|
|
94
82
|
component: component
|
|
95
83
|
});
|
|
96
84
|
}
|
|
97
|
-
const cellDateFormatter = value => {
|
|
85
|
+
export const cellDateFormatter = value => {
|
|
98
86
|
if (value) {
|
|
99
|
-
return
|
|
87
|
+
return getDateDisplayValue(value);
|
|
100
88
|
}
|
|
101
89
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const theme = (0, _material.useTheme)();
|
|
114
|
-
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
90
|
+
export function CellDateRenderer({
|
|
91
|
+
id,
|
|
92
|
+
value,
|
|
93
|
+
className,
|
|
94
|
+
alignment,
|
|
95
|
+
style,
|
|
96
|
+
sx,
|
|
97
|
+
title
|
|
98
|
+
}) {
|
|
99
|
+
const theme = useTheme();
|
|
100
|
+
return /*#__PURE__*/_jsx(TableCell, {
|
|
115
101
|
id: id,
|
|
116
102
|
align: alignment || 'left',
|
|
117
103
|
className: className,
|
|
118
104
|
sx: [defaultStyles(theme), {
|
|
119
105
|
whiteSpace: 'nowrap'
|
|
120
106
|
}, style, ...(Array.isArray(sx) ? sx : [sx])],
|
|
121
|
-
title: title
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
107
|
+
title: title,
|
|
108
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
109
|
+
component: "p",
|
|
110
|
+
variant: "body1",
|
|
111
|
+
fontSize: "16px",
|
|
112
|
+
children: cellDateFormatter(value)
|
|
113
|
+
})
|
|
114
|
+
});
|
|
127
115
|
}
|
|
128
|
-
function CellTextRenderer(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
116
|
+
export function CellTextRenderer({
|
|
117
|
+
id,
|
|
118
|
+
value,
|
|
119
|
+
className,
|
|
120
|
+
alignment,
|
|
121
|
+
style,
|
|
122
|
+
sx,
|
|
123
|
+
title,
|
|
124
|
+
component
|
|
125
|
+
}) {
|
|
126
|
+
const theme = useTheme();
|
|
127
|
+
return /*#__PURE__*/_jsx(TableCell, {
|
|
141
128
|
id: id,
|
|
142
129
|
align: alignment || 'left',
|
|
143
130
|
title: title ? title : typeof value === 'string' ? value : '',
|
|
144
131
|
className: className,
|
|
145
|
-
sx: [defaultStyles(theme), style, ...(Array.isArray(sx) ? sx : [sx])]
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
132
|
+
sx: [defaultStyles(theme), style, ...(Array.isArray(sx) ? sx : [sx])],
|
|
133
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
134
|
+
component: component || 'p',
|
|
135
|
+
variant: "body1",
|
|
136
|
+
noWrap: true,
|
|
137
|
+
fontSize: "16px",
|
|
138
|
+
sx: {
|
|
139
|
+
maxWidth: 400
|
|
140
|
+
},
|
|
141
|
+
children: value
|
|
142
|
+
})
|
|
143
|
+
});
|
|
155
144
|
}
|
|
156
|
-
function CellBooleanRenderer(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
145
|
+
export function CellBooleanRenderer({
|
|
146
|
+
id,
|
|
147
|
+
value,
|
|
148
|
+
className,
|
|
149
|
+
booleanFalseText,
|
|
150
|
+
booleanTrueText,
|
|
151
|
+
alignment,
|
|
152
|
+
style,
|
|
153
|
+
sx,
|
|
154
|
+
title
|
|
155
|
+
}) {
|
|
156
|
+
const theme = useTheme();
|
|
157
|
+
return /*#__PURE__*/_jsx(TableCell, {
|
|
170
158
|
id: id,
|
|
171
159
|
align: alignment || 'left',
|
|
172
160
|
className: className,
|
|
173
161
|
sx: [defaultStyles(theme), style, ...(Array.isArray(sx) ? sx : [sx])],
|
|
174
|
-
title: title
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
162
|
+
title: title,
|
|
163
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
164
|
+
component: "p",
|
|
165
|
+
variant: "body1",
|
|
166
|
+
fontSize: "16px",
|
|
167
|
+
children: value?.toString() === 'true' ? booleanTrueText : booleanFalseText
|
|
168
|
+
})
|
|
169
|
+
});
|
|
180
170
|
}
|
|
181
|
-
function CellNotesRenderer(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
171
|
+
export function CellNotesRenderer({
|
|
172
|
+
id,
|
|
173
|
+
value,
|
|
174
|
+
className,
|
|
175
|
+
alignment,
|
|
176
|
+
style,
|
|
177
|
+
sx,
|
|
178
|
+
title
|
|
179
|
+
}) {
|
|
180
|
+
const theme = useTheme();
|
|
181
|
+
return /*#__PURE__*/_jsx(TableCell, {
|
|
193
182
|
id: id,
|
|
194
183
|
align: alignment || 'left',
|
|
195
184
|
className: className,
|
|
196
185
|
sx: [defaultStyles(theme), style, ...(Array.isArray(sx) ? sx : [sx])],
|
|
197
|
-
title: title
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
186
|
+
title: title,
|
|
187
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
188
|
+
id: id,
|
|
189
|
+
component: "p",
|
|
190
|
+
variant: "body1",
|
|
191
|
+
fontSize: "16px",
|
|
192
|
+
children: value && value.length > 0 ? /*#__PURE__*/_jsx(Notes, {}) : ''
|
|
193
|
+
})
|
|
194
|
+
});
|
|
204
195
|
}
|
|
205
|
-
function CellEditRenderer(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
196
|
+
export function CellEditRenderer({
|
|
197
|
+
id,
|
|
198
|
+
onRowClick,
|
|
199
|
+
className,
|
|
200
|
+
editText,
|
|
201
|
+
alignment,
|
|
202
|
+
style,
|
|
203
|
+
sx,
|
|
204
|
+
title
|
|
205
|
+
}) {
|
|
206
|
+
const theme = useTheme();
|
|
207
|
+
return /*#__PURE__*/_jsx(TableCell, {
|
|
218
208
|
id: id,
|
|
219
209
|
align: alignment || 'left',
|
|
220
210
|
className: className,
|
|
221
211
|
sx: [defaultStyles(theme), style, ...(Array.isArray(sx) ? sx : [sx])],
|
|
222
|
-
title: title
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
212
|
+
title: title,
|
|
213
|
+
children: /*#__PURE__*/_jsx(Link, {
|
|
214
|
+
id: `${id}-button`,
|
|
215
|
+
href: "#",
|
|
216
|
+
onClick: event => {
|
|
217
|
+
preventDefaultEvent(event);
|
|
218
|
+
if (onRowClick) {
|
|
219
|
+
onRowClick();
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
223
|
+
display: "flex",
|
|
224
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
225
|
+
component: "p",
|
|
226
|
+
variant: "body1",
|
|
227
|
+
fontSize: "16px",
|
|
228
|
+
children: editText
|
|
229
|
+
}), /*#__PURE__*/_jsx(Edit, {
|
|
230
|
+
fontSize: "small",
|
|
231
|
+
sx: {
|
|
232
|
+
marginLeft: theme.spacing(1)
|
|
233
|
+
}
|
|
234
|
+
})]
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
});
|
|
244
238
|
}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _text = require("../../utils/text");
|
|
12
|
-
var _Checkbox = require("../Checkbox");
|
|
13
|
-
var _TableHeaderItem = _interopRequireDefault(require("./TableHeaderItem"));
|
|
14
|
-
var _density = require("./density");
|
|
15
|
-
function EnhancedTableHead(props) {
|
|
16
|
-
const theme = (0, _material.useTheme)();
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SortableContext } from '@dnd-kit/sortable';
|
|
3
|
+
import { Checkbox, TableCell, TableHead, TableRow, useTheme } from '@mui/material';
|
|
4
|
+
import { titleCase } from '../../utils/text';
|
|
5
|
+
import { CheckboxStyle } from '../Checkbox';
|
|
6
|
+
import TableHeaderItem from './TableHeaderItem';
|
|
7
|
+
import { getTableRowHeight } from './density';
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export default function EnhancedTableHead(props) {
|
|
10
|
+
const theme = useTheme();
|
|
17
11
|
const {
|
|
18
12
|
order,
|
|
19
13
|
orderBy,
|
|
@@ -25,12 +19,12 @@ function EnhancedTableHead(props) {
|
|
|
25
19
|
} = props;
|
|
26
20
|
const headerCellStyles = {
|
|
27
21
|
'&.MuiTableCell-root': {
|
|
28
|
-
borderBottom:
|
|
22
|
+
borderBottom: `2px solid ${theme.palette.TwClrBrdrSecondary}`
|
|
29
23
|
},
|
|
30
24
|
paddingTop: '0px',
|
|
31
25
|
paddingBottom: '0px'
|
|
32
26
|
};
|
|
33
|
-
|
|
27
|
+
React.useEffect(() => {
|
|
34
28
|
setHeadCells(columnsToHeadCells(props.columns));
|
|
35
29
|
}, [props.columns]);
|
|
36
30
|
function columnsToHeadCells(columns) {
|
|
@@ -38,38 +32,42 @@ function EnhancedTableHead(props) {
|
|
|
38
32
|
id: c.key,
|
|
39
33
|
disablePadding: false,
|
|
40
34
|
className: c.className,
|
|
41
|
-
label: typeof c.name === 'string' && c.name.length > 0 ?
|
|
35
|
+
label: typeof c.name === 'string' && c.name.length > 0 ? titleCase(c.name) : c.name,
|
|
42
36
|
tooltipTitle: c.tooltipTitle,
|
|
43
37
|
alignment: c.alignment,
|
|
44
38
|
sx: [headerCellStyles, ...(Array.isArray(c.sx) ? c.sx : [c.sx])]
|
|
45
39
|
}));
|
|
46
40
|
}
|
|
47
|
-
const [headCells, setHeadCells] =
|
|
48
|
-
return /*#__PURE__*/
|
|
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
|
-
|
|
41
|
+
const [headCells, setHeadCells] = React.useState(columnsToHeadCells(props.columns));
|
|
42
|
+
return /*#__PURE__*/_jsx(TableHead, {
|
|
43
|
+
children: /*#__PURE__*/_jsxs(TableRow, {
|
|
44
|
+
id: "table-header",
|
|
45
|
+
sx: {
|
|
46
|
+
height: getTableRowHeight(density)
|
|
47
|
+
},
|
|
48
|
+
children: [numSelected !== undefined && rowCount !== undefined && rowCount > 0 && onSelectAllClick && /*#__PURE__*/_jsx(TableCell, {
|
|
49
|
+
padding: "checkbox",
|
|
50
|
+
sx: headerCellStyles,
|
|
51
|
+
children: /*#__PURE__*/_jsx(Checkbox, {
|
|
52
|
+
disableRipple: true,
|
|
53
|
+
sx: CheckboxStyle(theme),
|
|
54
|
+
color: "primary",
|
|
55
|
+
indeterminate: numSelected > 0 && numSelected < rowCount,
|
|
56
|
+
checked: rowCount > 0 && numSelected === rowCount,
|
|
57
|
+
onChange: onSelectAllClick
|
|
58
|
+
})
|
|
59
|
+
}), /*#__PURE__*/_jsx(SortableContext, {
|
|
60
|
+
items: headCells,
|
|
61
|
+
children: headCells.map((headCell, i) => {
|
|
62
|
+
return /*#__PURE__*/_jsx(TableHeaderItem, {
|
|
63
|
+
headCell: headCell,
|
|
64
|
+
order: order,
|
|
65
|
+
orderBy: orderBy,
|
|
66
|
+
onRequestSort: onRequestSort,
|
|
67
|
+
i: i
|
|
68
|
+
}, i);
|
|
69
|
+
})
|
|
70
|
+
})]
|
|
71
|
+
})
|
|
72
|
+
});
|
|
75
73
|
}
|