@terraware/web-components 4.2.12 → 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.d.ts +1 -1
- package/components/Icon/icons/index.d.ts.map +1 -1
- package/components/Icon/icons/index.js +251 -255
- 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.d.ts +1 -1
- package/components/svg/IconCalendar.d.ts.map +1 -1
- 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.d.ts +8 -0
- package/components/svg/IconDocument.d.ts.map +1 -0
- package/components/svg/IconDocument.js +21 -0
- 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.d.ts +1 -0
- package/components/svg/index.d.ts.map +1 -1
- package/components/svg/index.js +127 -888
- 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,66 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const MapDateSliderControl = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
dates,
|
|
17
|
-
selectedDate,
|
|
18
|
-
onChange
|
|
19
|
-
} = _ref;
|
|
20
|
-
const theme = (0, _material.useTheme)();
|
|
21
|
-
const earliestDate = (0, _react.useMemo)(() => {
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Box, Card, Typography, useTheme } from '@mui/material';
|
|
3
|
+
import { DateTime } from 'luxon';
|
|
4
|
+
import { getShortDate } from '../../utils/date';
|
|
5
|
+
import Slider from '../Slider';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
+
const MapDateSliderControl = ({
|
|
8
|
+
dates,
|
|
9
|
+
selectedDate,
|
|
10
|
+
onChange
|
|
11
|
+
}) => {
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const earliestDate = useMemo(() => {
|
|
22
14
|
return dates.reduce((earliest, current) => {
|
|
23
15
|
return current < earliest ? current : earliest;
|
|
24
16
|
});
|
|
25
17
|
}, [dates]);
|
|
26
|
-
const latestDate =
|
|
18
|
+
const latestDate = useMemo(() => {
|
|
27
19
|
return dates.reduce((latest, current) => {
|
|
28
20
|
return current > latest ? current : latest;
|
|
29
21
|
});
|
|
30
22
|
}, [dates]);
|
|
31
|
-
const marks =
|
|
23
|
+
const marks = useMemo(() => {
|
|
32
24
|
return dates.map(date => ({
|
|
33
25
|
value: date.valueOf()
|
|
34
26
|
}));
|
|
35
27
|
}, [dates]);
|
|
36
|
-
const getDateString = date =>
|
|
37
|
-
const getDateLabel = date => /*#__PURE__*/
|
|
38
|
-
fontSize: "12px"
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
const getDateString = date => getShortDate(date);
|
|
29
|
+
const getDateLabel = date => /*#__PURE__*/_jsx(Typography, {
|
|
30
|
+
fontSize: "12px",
|
|
31
|
+
children: getDateString(date)
|
|
32
|
+
});
|
|
33
|
+
return /*#__PURE__*/_jsxs(Card, {
|
|
41
34
|
style: {
|
|
42
|
-
border:
|
|
35
|
+
border: `1px solid ${theme.palette.TwClrBrdrTertiary}`,
|
|
43
36
|
borderRadius: '8px',
|
|
44
37
|
display: 'flex',
|
|
45
38
|
flexDirection: 'column',
|
|
46
39
|
padding: theme.spacing(2),
|
|
47
40
|
maxWidth: '270px',
|
|
48
41
|
width: dates.length > 1 ? '270px' : undefined
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
42
|
+
},
|
|
43
|
+
children: [selectedDate && /*#__PURE__*/_jsx(Typography, {
|
|
44
|
+
fontSize: "14px",
|
|
45
|
+
fontWeight: 600,
|
|
46
|
+
textAlign: "right",
|
|
47
|
+
children: getDateString(selectedDate)
|
|
48
|
+
}), dates.length > 1 && /*#__PURE__*/_jsxs(_Fragment, {
|
|
49
|
+
children: [/*#__PURE__*/_jsx(Slider, {
|
|
50
|
+
value: selectedDate.valueOf(),
|
|
51
|
+
min: earliestDate.valueOf(),
|
|
52
|
+
max: latestDate.valueOf(),
|
|
53
|
+
marks: marks,
|
|
54
|
+
valueLabelDisplay: "off",
|
|
55
|
+
onChange: value => onChange(DateTime.fromMillis(value))
|
|
56
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
57
|
+
display: "flex",
|
|
58
|
+
justifyContent: "space-between",
|
|
59
|
+
children: [getDateLabel(earliestDate), getDateLabel(latestDate)]
|
|
60
|
+
})]
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
65
63
|
};
|
|
66
|
-
|
|
64
|
+
export default MapDateSliderControl;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _material = require("@mui/material");
|
|
10
|
-
var _utils = require("../../utils");
|
|
11
|
-
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
12
|
-
require("./styles.scss");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, IconButton, useTheme } from '@mui/material';
|
|
3
|
+
import { useDeviceInfo } from '../../utils';
|
|
4
|
+
import Icon from '../Icon/Icon';
|
|
5
|
+
import './styles.scss';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
7
|
const MapDrawer = props => {
|
|
14
8
|
const {
|
|
15
9
|
children,
|
|
@@ -19,27 +13,32 @@ const MapDrawer = props => {
|
|
|
19
13
|
style,
|
|
20
14
|
title
|
|
21
15
|
} = props;
|
|
22
|
-
const theme =
|
|
16
|
+
const theme = useTheme();
|
|
23
17
|
const {
|
|
24
18
|
isDesktop
|
|
25
|
-
} =
|
|
26
|
-
return open ? /*#__PURE__*/
|
|
27
|
-
className:
|
|
28
|
-
borderLeft: isDesktop ?
|
|
29
|
-
borderRight: isDesktop ?
|
|
30
|
-
style: style
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
19
|
+
} = useDeviceInfo();
|
|
20
|
+
return open ? /*#__PURE__*/_jsxs(Box, {
|
|
21
|
+
className: `map-drawer map-drawer${isDesktop ? `--${size}` : '--mobile'}`,
|
|
22
|
+
borderLeft: isDesktop ? `1px solid ${theme.palette.TwClrBrdrTertiary}` : undefined,
|
|
23
|
+
borderRight: isDesktop ? `1px solid ${theme.palette.TwClrBrdrTertiary}` : undefined,
|
|
24
|
+
style: style,
|
|
25
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
26
|
+
className: "map-drawer--header",
|
|
27
|
+
children: [/*#__PURE__*/_jsx("p", {
|
|
28
|
+
className: "title",
|
|
29
|
+
children: title
|
|
30
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
|
31
|
+
onClick: onClose,
|
|
32
|
+
size: "small",
|
|
33
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
34
|
+
name: "close",
|
|
35
|
+
className: "icon-close"
|
|
36
|
+
})
|
|
37
|
+
})]
|
|
38
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
39
|
+
className: 'map-drawer--body',
|
|
40
|
+
children: children
|
|
41
|
+
})]
|
|
42
|
+
}) : null;
|
|
44
43
|
};
|
|
45
|
-
|
|
44
|
+
export default MapDrawer;
|
|
@@ -1,62 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _AntSwitch = _interopRequireDefault(require("../AntSwitch"));
|
|
12
|
-
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
13
|
-
const MapLegend = _ref => {
|
|
14
|
-
let {
|
|
15
|
-
legends
|
|
16
|
-
} = _ref;
|
|
17
|
-
const theme = (0, _material.useTheme)();
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Tooltip, Typography, useTheme } from '@mui/material';
|
|
3
|
+
import { useDeviceInfo } from '../../utils';
|
|
4
|
+
import AntSwitch from '../AntSwitch';
|
|
5
|
+
import Icon from '../Icon/Icon';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const MapLegend = ({
|
|
8
|
+
legends
|
|
9
|
+
}) => {
|
|
10
|
+
const theme = useTheme();
|
|
18
11
|
const {
|
|
19
12
|
isMobile,
|
|
20
13
|
isDesktop
|
|
21
|
-
} =
|
|
14
|
+
} = useDeviceInfo();
|
|
22
15
|
const legendComponents = legends.map((legend, index) => {
|
|
23
16
|
const isFirst = index === 0;
|
|
24
17
|
const isLast = index === legends.length - 1;
|
|
25
|
-
const switchComponent = legend.type === 'highlight' ? /*#__PURE__*/
|
|
18
|
+
const switchComponent = legend.type === 'highlight' ? /*#__PURE__*/_jsx(AntSwitch, {
|
|
26
19
|
disabled: legend.disabled,
|
|
27
20
|
checked: legend.visible,
|
|
28
21
|
onChange: legend.setVisible
|
|
29
22
|
}) : undefined;
|
|
30
|
-
const titleComponent = /*#__PURE__*/
|
|
23
|
+
const titleComponent = /*#__PURE__*/_jsxs(Typography, {
|
|
31
24
|
fontSize: "16px",
|
|
32
25
|
fontWeight: 600,
|
|
33
26
|
width: isMobile ? '100%' : undefined,
|
|
34
27
|
marginRight: isMobile ? 0 : theme.spacing(4),
|
|
35
|
-
paddingLeft: switchComponent ? theme.spacing(1) : theme.spacing(0)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
28
|
+
paddingLeft: switchComponent ? theme.spacing(1) : theme.spacing(0),
|
|
29
|
+
children: [legend.title, legend.tooltip && /*#__PURE__*/_jsx(Tooltip, {
|
|
30
|
+
title: legend.tooltip,
|
|
31
|
+
sx: {
|
|
32
|
+
display: 'inline-block',
|
|
33
|
+
verticalAlign: 'text-top',
|
|
34
|
+
marginLeft: theme.spacing(1)
|
|
35
|
+
},
|
|
36
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
37
|
+
display: "flex",
|
|
38
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
39
|
+
fillColor: theme.palette.TwClrIcnInfo,
|
|
40
|
+
name: "info",
|
|
41
|
+
size: "small"
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
50
46
|
const itemComponents = legend.items.map((item, itemIndex) => {
|
|
51
|
-
const onClick = legend.disabled ? undefined : legend.type === 'layer' ? item.disabled ? undefined : () => legend.setSelectedLayer(item.id) : legend.type === 'marker' ? item.disabled ? undefined : () =>
|
|
52
|
-
var _setVisible, _ref2;
|
|
53
|
-
return (_setVisible = (_ref2 = item).setVisible) === null || _setVisible === void 0 ? void 0 : _setVisible.call(_ref2, !item.visible);
|
|
54
|
-
} : undefined;
|
|
47
|
+
const onClick = legend.disabled ? undefined : legend.type === 'layer' ? item.disabled ? undefined : () => legend.setSelectedLayer(item.id) : legend.type === 'marker' ? item.disabled ? undefined : () => item.setVisible?.(!item.visible) : undefined;
|
|
55
48
|
const disabled = legend.disabled || (legend.type === 'layer' ? item.disabled : legend.type === 'marker' ? item.disabled : false) || false;
|
|
56
49
|
const selected = legend.type === 'layer' ? item.id === legend.selectedLayer : legend.type === 'marker' ? item.visible : false;
|
|
57
50
|
const logoComponent = () => {
|
|
58
51
|
if (item.style.type === 'icon') {
|
|
59
|
-
return /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/_jsx(Icon, {
|
|
60
53
|
name: item.style.iconName,
|
|
61
54
|
fillColor: item.style.iconColor,
|
|
62
55
|
style: {
|
|
@@ -65,59 +58,61 @@ const MapLegend = _ref => {
|
|
|
65
58
|
size: 'small'
|
|
66
59
|
});
|
|
67
60
|
} else {
|
|
68
|
-
|
|
69
|
-
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
61
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
70
62
|
display: 'flex',
|
|
71
63
|
sx: {
|
|
72
|
-
border:
|
|
64
|
+
border: `2px solid ${item.style.borderColor ?? theme.palette.TwClrBaseGreen300}`,
|
|
73
65
|
opacity: disabled ? 0.7 : 1.0,
|
|
74
66
|
height: '16px',
|
|
75
67
|
width: '24px',
|
|
76
68
|
minWidth: '24px',
|
|
77
69
|
marginRight: theme.spacing(1)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
70
|
+
},
|
|
71
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
72
|
+
height: '16px',
|
|
73
|
+
width: '24px',
|
|
74
|
+
sx: {
|
|
75
|
+
backgroundColor: item.style.fillColor,
|
|
76
|
+
backgroundImage: item.style.fillPatternUrl ? `url('${item.style.fillPatternUrl}')` : undefined,
|
|
77
|
+
backgroundRepeat: 'repeat',
|
|
78
|
+
opacity: item.style.opacity ?? 0.2
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
});
|
|
89
82
|
}
|
|
90
83
|
};
|
|
91
84
|
const visibleComponent = () => {
|
|
92
85
|
switch (legend.type) {
|
|
93
86
|
case 'marker':
|
|
94
87
|
const featureItem = item;
|
|
95
|
-
const visibleIcon = featureItem.visible ? /*#__PURE__*/
|
|
88
|
+
const visibleIcon = featureItem.visible ? /*#__PURE__*/_jsx(Icon, {
|
|
96
89
|
name: "iconEye"
|
|
97
|
-
}) : /*#__PURE__*/
|
|
90
|
+
}) : /*#__PURE__*/_jsx(Icon, {
|
|
98
91
|
name: "iconEyeOff"
|
|
99
92
|
});
|
|
100
|
-
return /*#__PURE__*/
|
|
101
|
-
display: "flex"
|
|
102
|
-
|
|
93
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
94
|
+
display: "flex",
|
|
95
|
+
children: visibleIcon
|
|
96
|
+
});
|
|
103
97
|
case 'layer':
|
|
104
98
|
const layerItem = item;
|
|
105
|
-
return /*#__PURE__*/
|
|
99
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
106
100
|
display: "flex",
|
|
107
101
|
sx: {
|
|
108
102
|
visibility: layerItem.id === legend.selectedLayer ? 'visible' : 'hidden'
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
103
|
+
},
|
|
104
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
105
|
+
name: "checkmark",
|
|
106
|
+
style: {
|
|
107
|
+
marginRight: theme.spacing(1)
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
});
|
|
116
111
|
case 'highlight':
|
|
117
112
|
return undefined;
|
|
118
113
|
}
|
|
119
114
|
};
|
|
120
|
-
return /*#__PURE__*/
|
|
115
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
121
116
|
onClick: onClick,
|
|
122
117
|
display: "flex",
|
|
123
118
|
alignItems: "center",
|
|
@@ -129,35 +124,40 @@ const MapLegend = _ref => {
|
|
|
129
124
|
opacity: disabled ? '0.5' : 1
|
|
130
125
|
},
|
|
131
126
|
justifyContent: 'space-between',
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
127
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
128
|
+
display: "flex",
|
|
129
|
+
alignItems: "center",
|
|
130
|
+
paddingRight: theme.spacing(1),
|
|
131
|
+
children: [logoComponent(), /*#__PURE__*/_jsx(Typography, {
|
|
132
|
+
fontSize: "14px",
|
|
133
|
+
fontWeight: 400,
|
|
134
|
+
children: item.label
|
|
135
|
+
})]
|
|
136
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
137
|
+
display: "flex",
|
|
138
|
+
children: visibleComponent()
|
|
139
|
+
})]
|
|
140
|
+
}, `${index}-${itemIndex}`);
|
|
143
141
|
});
|
|
144
|
-
return /*#__PURE__*/
|
|
145
|
-
key: legend.title,
|
|
142
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
146
143
|
sx: {
|
|
147
144
|
opacity: legend.disabled ? 0.7 : 1
|
|
148
145
|
},
|
|
149
|
-
borderBottom: isLast ? 'none' :
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
146
|
+
borderBottom: isLast ? 'none' : `1px solid ${theme.palette.TwClrBrdrTertiary}`,
|
|
147
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
148
|
+
paddingBottom: 2,
|
|
149
|
+
paddingTop: isFirst ? 0 : 2,
|
|
150
|
+
flexDirection: 'column',
|
|
151
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
152
|
+
display: "flex",
|
|
153
|
+
alignItems: 'center',
|
|
154
|
+
paddingLeft: theme.spacing(1),
|
|
155
|
+
children: [switchComponent, titleComponent]
|
|
156
|
+
}), itemComponents]
|
|
157
|
+
})
|
|
158
|
+
}, legend.title);
|
|
159
159
|
});
|
|
160
|
-
return /*#__PURE__*/
|
|
160
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
161
161
|
bgcolor: theme.palette.TwClrBaseWhite,
|
|
162
162
|
display: "flex",
|
|
163
163
|
justifyItems: "flex-start",
|
|
@@ -167,7 +167,8 @@ const MapLegend = _ref => {
|
|
|
167
167
|
minWidth: isDesktop ? '160px' : undefined,
|
|
168
168
|
width: isDesktop ? 'auto' : 'stretch',
|
|
169
169
|
margin: 0,
|
|
170
|
-
overflow: 'scroll'
|
|
171
|
-
|
|
170
|
+
overflow: 'scroll',
|
|
171
|
+
children: legendComponents
|
|
172
|
+
});
|
|
172
173
|
};
|
|
173
|
-
|
|
174
|
+
export default MapLegend;
|
|
@@ -1,49 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
mapViewStyleNames,
|
|
19
|
-
setMapViewStyle
|
|
20
|
-
} = _ref;
|
|
21
|
-
const theme = (0, _material.useTheme)();
|
|
22
|
-
const viewOptions = (0, _react.useMemo)(() => {
|
|
23
|
-
return _types.MapViewStyles.map(style => {
|
|
24
|
-
var _mapViewStyleNames;
|
|
25
|
-
return {
|
|
26
|
-
label: (_mapViewStyleNames = mapViewStyleNames === null || mapViewStyleNames === void 0 ? void 0 : mapViewStyleNames(style)) !== null && _mapViewStyleNames !== void 0 ? _mapViewStyleNames : style,
|
|
27
|
-
value: style
|
|
28
|
-
};
|
|
29
|
-
});
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import { Box, useTheme } from '@mui/material';
|
|
3
|
+
import PopoverMenu from '../PopoverMenu';
|
|
4
|
+
import { MapViewStyles } from './types';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const MapViewStyleControl = ({
|
|
7
|
+
containerId,
|
|
8
|
+
mapViewStyle,
|
|
9
|
+
mapViewStyleNames,
|
|
10
|
+
setMapViewStyle
|
|
11
|
+
}) => {
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const viewOptions = useMemo(() => {
|
|
14
|
+
return MapViewStyles.map(style => ({
|
|
15
|
+
label: mapViewStyleNames?.(style) ?? style,
|
|
16
|
+
value: style
|
|
17
|
+
}));
|
|
30
18
|
}, [mapViewStyleNames]);
|
|
31
|
-
const onSelectMapViewStyle =
|
|
19
|
+
const onSelectMapViewStyle = useCallback(item => {
|
|
32
20
|
setMapViewStyle(item.value);
|
|
33
21
|
}, []);
|
|
34
|
-
const container =
|
|
22
|
+
const container = useMemo(() => {
|
|
35
23
|
if (containerId) {
|
|
36
24
|
return document.getElementById(containerId);
|
|
37
25
|
}
|
|
38
26
|
}, [containerId]);
|
|
39
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
40
28
|
sx: {
|
|
41
29
|
position: 'absolute',
|
|
42
30
|
top: '10px',
|
|
43
31
|
left: '45px',
|
|
44
32
|
zIndex: 10,
|
|
45
33
|
height: 28,
|
|
46
|
-
backgroundColor:
|
|
34
|
+
backgroundColor: `${theme.palette.TwClrBaseWhite}`,
|
|
47
35
|
borderRadius: '4px',
|
|
48
36
|
display: 'flex',
|
|
49
37
|
alignItems: 'center',
|
|
@@ -56,19 +44,21 @@ const MapViewStyleControl = _ref => {
|
|
|
56
44
|
'& svg': {
|
|
57
45
|
marginLeft: 0
|
|
58
46
|
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
47
|
+
},
|
|
48
|
+
children: /*#__PURE__*/_jsx(PopoverMenu, {
|
|
49
|
+
anchor: /*#__PURE__*/_jsx(Box, {
|
|
50
|
+
component: "span",
|
|
51
|
+
sx: {
|
|
52
|
+
fontSize: '12px',
|
|
53
|
+
paddingLeft: theme.spacing(0.5),
|
|
54
|
+
color: theme.palette.TwClrTxt
|
|
55
|
+
},
|
|
56
|
+
children: mapViewStyleNames?.(mapViewStyle) ?? mapViewStyle
|
|
57
|
+
}),
|
|
58
|
+
container: container,
|
|
59
|
+
menuSections: [viewOptions],
|
|
60
|
+
onClick: onSelectMapViewStyle
|
|
61
|
+
})
|
|
62
|
+
});
|
|
73
63
|
};
|
|
74
|
-
|
|
64
|
+
export default MapViewStyleControl;
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _mapbox = _interopRequireDefault(require("react-map-gl/mapbox"));
|
|
9
|
-
var _default = exports.default = _mapbox.default;
|
|
1
|
+
import ReactMapbox from 'react-map-gl/mapbox';
|
|
2
|
+
export default ReactMapbox;
|