@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.
Files changed (304) hide show
  1. package/components/AntSwitch/index.js +8 -14
  2. package/components/Autocomplete/Autocomplete.js +67 -70
  3. package/components/Badge/index.js +16 -20
  4. package/components/BusySpinner/index.js +30 -35
  5. package/components/Button/Button.js +23 -27
  6. package/components/Button/button.test.js +8 -10
  7. package/components/Checkbox.js +10 -19
  8. package/components/Confirm/index.js +44 -51
  9. package/components/DatePicker/DatePicker.js +116 -117
  10. package/components/DialogBox/DialogBox.js +76 -66
  11. package/components/Divisor.js +15 -20
  12. package/components/Dropdown.js +54 -61
  13. package/components/EditableTable/index.js +129 -135
  14. package/components/ErrorBox/ErrorBox.js +37 -36
  15. package/components/FileChooser/index.js +73 -77
  16. package/components/FormBottomBar/index.js +63 -69
  17. package/components/Icon/Icon.js +14 -21
  18. package/components/Icon/icons/index.d.ts +1 -1
  19. package/components/Icon/icons/index.d.ts.map +1 -1
  20. package/components/Icon/icons/index.js +251 -255
  21. package/components/IconTooltip/index.js +29 -34
  22. package/components/Map/MapBox.js +199 -220
  23. package/components/Map/MapContainer.js +14 -18
  24. package/components/Map/MapDateSliderControl.js +44 -46
  25. package/components/Map/MapDrawer.js +32 -33
  26. package/components/Map/MapLegend.js +96 -95
  27. package/components/Map/MapViewStyleControl.js +38 -48
  28. package/components/Map/ReactMapboxWrapper.js +2 -9
  29. package/components/Map/index.js +47 -55
  30. package/components/Map/types.js +2 -8
  31. package/components/Map/useMaintainLayerOrder.js +4 -11
  32. package/components/Markdown/index.js +14 -21
  33. package/components/Message/Message.js +59 -51
  34. package/components/MultiSelect/MultiSelect.test.js +22 -24
  35. package/components/MultiSelect/index.js +73 -69
  36. package/components/Navbar/NavFooter.js +8 -13
  37. package/components/Navbar/NavItem.js +43 -37
  38. package/components/Navbar/NavSection.js +13 -17
  39. package/components/Navbar/Navbar.js +35 -38
  40. package/components/Navbar/SubNavbar.js +8 -13
  41. package/components/Note.js +14 -19
  42. package/components/OverlayModal/OverlayModal.js +36 -37
  43. package/components/PageForm/index.js +30 -35
  44. package/components/PhotoChooser/index.js +93 -98
  45. package/components/Pill/index.js +29 -31
  46. package/components/PillList/index.js +16 -22
  47. package/components/PlacementWrapper/index.js +20 -25
  48. package/components/PopoverMenu/Popover.js +33 -37
  49. package/components/PopoverMenu/index.js +41 -46
  50. package/components/PopoverMultiSelect/index.js +18 -21
  51. package/components/ProgressCircle/ProgressCircle.js +23 -26
  52. package/components/RadioButton.js +7 -14
  53. package/components/Select/Select.js +8 -13
  54. package/components/Select/SelectT.js +110 -108
  55. package/components/Separator/index.js +8 -14
  56. package/components/Size.js +1 -5
  57. package/components/Slider/index.js +7 -13
  58. package/components/SummaryBox.js +36 -39
  59. package/components/Tabs/index.js +75 -77
  60. package/components/TextTruncated/index.js +64 -65
  61. package/components/Textfield/Textfield.js +100 -95
  62. package/components/Textfield/TruncatedTextArea.js +44 -46
  63. package/components/TimelineSlider/TimelineMarker.js +24 -28
  64. package/components/TimelineSlider/TimelineRail.js +5 -11
  65. package/components/TimelineSlider/index.js +47 -51
  66. package/components/Tooltip/Tooltip.js +21 -26
  67. package/components/ViewPhotosDialog/index.js +58 -62
  68. package/components/VirtualWalkthrough/Annotation.d.ts +41 -0
  69. package/components/VirtualWalkthrough/Annotation.d.ts.map +1 -0
  70. package/components/VirtualWalkthrough/Annotation.js +197 -0
  71. package/components/VirtualWalkthrough/AnnotationEditPane.d.ts +20 -0
  72. package/components/VirtualWalkthrough/AnnotationEditPane.d.ts.map +1 -0
  73. package/components/VirtualWalkthrough/AnnotationEditPane.js +136 -0
  74. package/components/VirtualWalkthrough/AnnotationPanel.d.ts +13 -0
  75. package/components/VirtualWalkthrough/AnnotationPanel.d.ts.map +1 -0
  76. package/components/VirtualWalkthrough/AnnotationPanel.js +196 -0
  77. package/components/VirtualWalkthrough/Application.d.ts +9 -0
  78. package/components/VirtualWalkthrough/Application.d.ts.map +1 -0
  79. package/components/VirtualWalkthrough/Application.js +32 -0
  80. package/components/VirtualWalkthrough/AutoRotator.d.ts +109 -0
  81. package/components/VirtualWalkthrough/AutoRotator.d.ts.map +1 -0
  82. package/components/VirtualWalkthrough/AutoRotator.js +217 -0
  83. package/components/VirtualWalkthrough/BlockingSpinner.d.ts +3 -0
  84. package/components/VirtualWalkthrough/BlockingSpinner.d.ts.map +1 -0
  85. package/components/VirtualWalkthrough/BlockingSpinner.js +27 -0
  86. package/components/VirtualWalkthrough/BoundaryRing.d.ts +9 -0
  87. package/components/VirtualWalkthrough/BoundaryRing.d.ts.map +1 -0
  88. package/components/VirtualWalkthrough/BoundaryRing.js +33 -0
  89. package/components/VirtualWalkthrough/CameraInfo.d.ts +16 -0
  90. package/components/VirtualWalkthrough/CameraInfo.d.ts.map +1 -0
  91. package/components/VirtualWalkthrough/CameraInfo.js +88 -0
  92. package/components/VirtualWalkthrough/ControlsInfoPane.d.ts +37 -0
  93. package/components/VirtualWalkthrough/ControlsInfoPane.d.ts.map +1 -0
  94. package/components/VirtualWalkthrough/ControlsInfoPane.js +196 -0
  95. package/components/VirtualWalkthrough/GradientSky.d.ts +9 -0
  96. package/components/VirtualWalkthrough/GradientSky.d.ts.map +1 -0
  97. package/components/VirtualWalkthrough/GradientSky.js +73 -0
  98. package/components/VirtualWalkthrough/SplatControls.d.ts +50 -0
  99. package/components/VirtualWalkthrough/SplatControls.d.ts.map +1 -0
  100. package/components/VirtualWalkthrough/SplatControls.js +252 -0
  101. package/components/VirtualWalkthrough/SplatCrop.d.ts +8 -0
  102. package/components/VirtualWalkthrough/SplatCrop.d.ts.map +1 -0
  103. package/components/VirtualWalkthrough/SplatCrop.js +18 -0
  104. package/components/VirtualWalkthrough/SplatFadeCrop.d.ts +8 -0
  105. package/components/VirtualWalkthrough/SplatFadeCrop.d.ts.map +1 -0
  106. package/components/VirtualWalkthrough/SplatFadeCrop.js +18 -0
  107. package/components/VirtualWalkthrough/SplatModel.d.ts +15 -0
  108. package/components/VirtualWalkthrough/SplatModel.d.ts.map +1 -0
  109. package/components/VirtualWalkthrough/SplatModel.js +60 -0
  110. package/components/VirtualWalkthrough/SplatRevealRain.d.ts +18 -0
  111. package/components/VirtualWalkthrough/SplatRevealRain.d.ts.map +1 -0
  112. package/components/VirtualWalkthrough/SplatRevealRain.js +38 -0
  113. package/components/VirtualWalkthrough/TfAnnotationManager.d.ts +110 -0
  114. package/components/VirtualWalkthrough/TfAnnotationManager.d.ts.map +1 -0
  115. package/components/VirtualWalkthrough/TfAnnotationManager.js +368 -0
  116. package/components/VirtualWalkthrough/TfXrNavigation.d.ts +15 -0
  117. package/components/VirtualWalkthrough/TfXrNavigation.d.ts.map +1 -0
  118. package/components/VirtualWalkthrough/TfXrNavigation.js +24 -0
  119. package/components/VirtualWalkthrough/annotation-styles.css +5 -0
  120. package/components/VirtualWalkthrough/application-styles.css +4 -0
  121. package/components/VirtualWalkthrough/boundary-ring.d.ts +47 -0
  122. package/components/VirtualWalkthrough/boundary-ring.d.ts.map +1 -0
  123. package/components/VirtualWalkthrough/boundary-ring.js +125 -0
  124. package/components/VirtualWalkthrough/boundary-ring.test.js +109 -0
  125. package/components/VirtualWalkthrough/groundPlane.d.ts +14 -0
  126. package/components/VirtualWalkthrough/groundPlane.d.ts.map +1 -0
  127. package/components/VirtualWalkthrough/groundPlane.js +47 -0
  128. package/components/VirtualWalkthrough/groundPlane.test.js +45 -0
  129. package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts +19 -0
  130. package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts.map +1 -0
  131. package/components/VirtualWalkthrough/gsplat-fade-crop-effect.js +119 -0
  132. package/components/VirtualWalkthrough/walkthrough-camera.d.ts +77 -0
  133. package/components/VirtualWalkthrough/walkthrough-camera.d.ts.map +1 -0
  134. package/components/VirtualWalkthrough/walkthrough-camera.js +320 -0
  135. package/components/svg/BlobbyGrayIconImage.js +36 -41
  136. package/components/svg/BlobbyGrayIconImport.js +36 -41
  137. package/components/svg/BlobbyGrayIconUploadToTheCloud.js +36 -41
  138. package/components/svg/BlobbyIconCloudChecked.js +161 -158
  139. package/components/svg/BlobbyIconExportOrUploadPhoto.js +161 -158
  140. package/components/svg/BlobbyIconFolder.js +161 -158
  141. package/components/svg/BlobbyIconGraphReport.js +161 -158
  142. package/components/svg/BlobbyIconHappy.js +161 -158
  143. package/components/svg/BlobbyIconHeartMonitor.js +161 -158
  144. package/components/svg/BlobbyIconLeaf.js +161 -158
  145. package/components/svg/BlobbyIconLibrary.js +161 -158
  146. package/components/svg/BlobbyIconNursery.js +163 -160
  147. package/components/svg/BlobbyIconOrganization.js +161 -158
  148. package/components/svg/BlobbyIconParchment.js +161 -158
  149. package/components/svg/BlobbyIconPeople.js +161 -158
  150. package/components/svg/BlobbyIconSeedBank.js +161 -158
  151. package/components/svg/BlobbyIconSeedling.js +161 -158
  152. package/components/svg/BlobbyIconSeeds.js +161 -158
  153. package/components/svg/BlobbyIconSite.js +164 -161
  154. package/components/svg/BlobbyIconSparkles.js +161 -158
  155. package/components/svg/BlobbyIconWrench.js +161 -158
  156. package/components/svg/Bug.js +18 -27
  157. package/components/svg/Calendar.js +18 -27
  158. package/components/svg/CaretDown.js +18 -27
  159. package/components/svg/CaretLeft.js +18 -27
  160. package/components/svg/CaretRight.js +18 -27
  161. package/components/svg/CaretUp.js +18 -27
  162. package/components/svg/ChevronDown.js +18 -27
  163. package/components/svg/ChevronUp.js +18 -27
  164. package/components/svg/Close.js +18 -27
  165. package/components/svg/Critical.js +18 -27
  166. package/components/svg/Edit.js +161 -158
  167. package/components/svg/Error.js +18 -27
  168. package/components/svg/Filter.js +18 -27
  169. package/components/svg/Folder.js +18 -27
  170. package/components/svg/Help.js +18 -27
  171. package/components/svg/Home.js +18 -27
  172. package/components/svg/IconAdd.js +18 -27
  173. package/components/svg/IconArrowRight.js +19 -28
  174. package/components/svg/IconBusinessNetwork.js +18 -27
  175. package/components/svg/IconCalendar.d.ts +1 -1
  176. package/components/svg/IconCalendar.d.ts.map +1 -1
  177. package/components/svg/IconCalendar.js +18 -27
  178. package/components/svg/IconCancel.js +18 -27
  179. package/components/svg/IconChargingBattery.js +18 -27
  180. package/components/svg/IconChecklist.js +19 -28
  181. package/components/svg/IconCheckmark.js +18 -27
  182. package/components/svg/IconCoinInHand.js +18 -27
  183. package/components/svg/IconColumns.js +18 -27
  184. package/components/svg/IconComment.js +18 -27
  185. package/components/svg/IconDashboard.js +18 -27
  186. package/components/svg/IconDataMigration.js +18 -27
  187. package/components/svg/IconDocument.d.ts +8 -0
  188. package/components/svg/IconDocument.d.ts.map +1 -0
  189. package/components/svg/IconDocument.js +21 -0
  190. package/components/svg/IconDownloadFromTheCloud.js +19 -28
  191. package/components/svg/IconEdit.js +19 -28
  192. package/components/svg/IconExpand.js +19 -28
  193. package/components/svg/IconExport.js +18 -27
  194. package/components/svg/IconExternalLink.js +18 -27
  195. package/components/svg/IconEye.js +18 -27
  196. package/components/svg/IconEyeOff.js +18 -27
  197. package/components/svg/IconFile.js +18 -27
  198. package/components/svg/IconFolder.js +18 -27
  199. package/components/svg/IconFullScreen.js +18 -27
  200. package/components/svg/IconFutures.js +18 -27
  201. package/components/svg/IconGraphReport.js +18 -27
  202. package/components/svg/IconHeartMonitor.js +18 -27
  203. package/components/svg/IconHelp.js +19 -28
  204. package/components/svg/IconHistory.js +18 -27
  205. package/components/svg/IconImport.js +18 -27
  206. package/components/svg/IconIndex.js +18 -27
  207. package/components/svg/IconLayers.js +18 -27
  208. package/components/svg/IconLibrary.js +18 -27
  209. package/components/svg/IconList.js +18 -27
  210. package/components/svg/IconLivePlant.js +18 -27
  211. package/components/svg/IconLocations.js +18 -27
  212. package/components/svg/IconMail.js +18 -27
  213. package/components/svg/IconManager.js +18 -27
  214. package/components/svg/IconMarker.js +18 -27
  215. package/components/svg/IconMenu.js +18 -27
  216. package/components/svg/IconMenuHorizontal.js +18 -27
  217. package/components/svg/IconModule.js +18 -27
  218. package/components/svg/IconMyLocation.js +18 -27
  219. package/components/svg/IconNote.js +19 -28
  220. package/components/svg/IconNursery.js +18 -27
  221. package/components/svg/IconOrg.js +18 -27
  222. package/components/svg/IconParchment.js +18 -27
  223. package/components/svg/IconPhoto.js +18 -27
  224. package/components/svg/IconPlantsFilled.js +18 -27
  225. package/components/svg/IconRedo.js +18 -27
  226. package/components/svg/IconRestorationSite.js +18 -27
  227. package/components/svg/IconSeedBank.js +18 -27
  228. package/components/svg/IconSeedling.js +18 -27
  229. package/components/svg/IconSettings.js +18 -27
  230. package/components/svg/IconSlice.js +18 -27
  231. package/components/svg/IconSubmit.js +18 -27
  232. package/components/svg/IconSubtract.js +19 -28
  233. package/components/svg/IconSynced.js +18 -27
  234. package/components/svg/IconTrashCan.js +18 -27
  235. package/components/svg/IconTreasureMap.js +18 -27
  236. package/components/svg/IconUnavailable.js +18 -27
  237. package/components/svg/IconUndo.js +18 -27
  238. package/components/svg/IconVariable.js +18 -27
  239. package/components/svg/IconVideo.js +19 -28
  240. package/components/svg/IconWifi.js +18 -27
  241. package/components/svg/Info.js +18 -27
  242. package/components/svg/Key.js +18 -27
  243. package/components/svg/Leaf.js +18 -27
  244. package/components/svg/Lock.js +18 -27
  245. package/components/svg/Logo.js +40 -45
  246. package/components/svg/MenuVertical.js +18 -27
  247. package/components/svg/Notification.js +18 -27
  248. package/components/svg/Person.js +18 -27
  249. package/components/svg/Plus.js +18 -27
  250. package/components/svg/RestorationSite.js +18 -27
  251. package/components/svg/Search.js +18 -27
  252. package/components/svg/Seeds.js +18 -27
  253. package/components/svg/Site.js +18 -27
  254. package/components/svg/Sparkles.js +18 -27
  255. package/components/svg/Species.js +18 -27
  256. package/components/svg/Species2.js +161 -158
  257. package/components/svg/Spinner.js +27 -36
  258. package/components/svg/Star.js +18 -27
  259. package/components/svg/Success.js +18 -27
  260. package/components/svg/SuccessFilled.js +18 -27
  261. package/components/svg/TerrawareLogoDesktop.js +44 -49
  262. package/components/svg/TerrawareLogoMobile.js +20 -29
  263. package/components/svg/Touchscreen.js +18 -27
  264. package/components/svg/UploadCloud.js +161 -158
  265. package/components/svg/Warning.js +18 -27
  266. package/components/svg/WelcomeClipboard.js +130 -135
  267. package/components/svg/index.d.ts +1 -0
  268. package/components/svg/index.d.ts.map +1 -1
  269. package/components/svg/index.js +127 -888
  270. package/components/table/EnhancedTableToolbar.js +45 -47
  271. package/components/table/EnhancedTableToolbarV2.js +18 -26
  272. package/components/table/TableCellRenderer.js +137 -143
  273. package/components/table/TableHeader.js +45 -47
  274. package/components/table/TableHeaderItem.js +65 -64
  275. package/components/table/density.js +3 -11
  276. package/components/table/index.js +225 -218
  277. package/components/table/sort.js +8 -18
  278. package/components/table/sort.test.js +6 -8
  279. package/components/table/types.js +1 -5
  280. package/components/types/index.js +1 -5
  281. package/hooks/useBoolean.d.ts +4 -0
  282. package/hooks/useBoolean.d.ts.map +1 -0
  283. package/hooks/useBoolean.js +12 -0
  284. package/hooks/useCameraPosition.d.ts +8 -0
  285. package/hooks/useCameraPosition.d.ts.map +1 -0
  286. package/hooks/useCameraPosition.js +33 -0
  287. package/index.js +57 -398
  288. package/license-report.html +1 -1
  289. package/package.json +10 -3
  290. package/style-dictionary-dist/TerrawareTheme.js +1 -7
  291. package/theme.js +7 -14
  292. package/utils/color.d.ts +2 -0
  293. package/utils/color.d.ts.map +1 -0
  294. package/utils/color.js +14 -0
  295. package/utils/date.js +13 -24
  296. package/utils/date.test.js +40 -43
  297. package/utils/index.js +5 -53
  298. package/utils/preventDefaultEvent.js +1 -7
  299. package/utils/text.js +2 -9
  300. package/utils/text.test.js +9 -11
  301. package/utils/useDeviceInfo.js +10 -16
  302. package/virtualWalkthrough.d.ts +31 -0
  303. package/virtualWalkthrough.d.ts.map +1 -0
  304. package/virtualWalkthrough.js +28 -0
@@ -1,66 +1,64 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _material = require("@mui/material");
11
- var _luxon = require("luxon");
12
- var _date = require("../../utils/date");
13
- var _Slider = _interopRequireDefault(require("../Slider"));
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 = (0, _react.useMemo)(() => {
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 = (0, _react.useMemo)(() => {
23
+ const marks = useMemo(() => {
32
24
  return dates.map(date => ({
33
25
  value: date.valueOf()
34
26
  }));
35
27
  }, [dates]);
36
- const getDateString = date => (0, _date.getShortDate)(date);
37
- const getDateLabel = date => /*#__PURE__*/_react.default.createElement(_material.Typography, {
38
- fontSize: "12px"
39
- }, getDateString(date));
40
- return /*#__PURE__*/_react.default.createElement(_material.Card, {
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: "1px solid ".concat(theme.palette.TwClrBrdrTertiary),
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
- }, selectedDate && /*#__PURE__*/_react.default.createElement(_material.Typography, {
51
- fontSize: "14px",
52
- fontWeight: 600,
53
- textAlign: "right"
54
- }, getDateString(selectedDate)), dates.length > 1 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Slider.default, {
55
- value: selectedDate.valueOf(),
56
- min: earliestDate.valueOf(),
57
- max: latestDate.valueOf(),
58
- marks: marks,
59
- valueLabelDisplay: "off",
60
- onChange: value => onChange(_luxon.DateTime.fromMillis(value))
61
- }), /*#__PURE__*/_react.default.createElement(_material.Box, {
62
- display: "flex",
63
- justifyContent: "space-between"
64
- }, getDateLabel(earliestDate), getDateLabel(latestDate))));
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
- var _default = exports.default = MapDateSliderControl;
64
+ export default MapDateSliderControl;
@@ -1,15 +1,9 @@
1
- "use strict";
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 _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 = (0, _material.useTheme)();
16
+ const theme = useTheme();
23
17
  const {
24
18
  isDesktop
25
- } = (0, _utils.useDeviceInfo)();
26
- return open ? /*#__PURE__*/_react.default.createElement(_material.Box, {
27
- className: "map-drawer map-drawer".concat(isDesktop ? "--".concat(size) : '--mobile'),
28
- borderLeft: isDesktop ? "1px solid ".concat(theme.palette.TwClrBrdrTertiary) : undefined,
29
- borderRight: isDesktop ? "1px solid ".concat(theme.palette.TwClrBrdrTertiary) : undefined,
30
- style: style
31
- }, /*#__PURE__*/_react.default.createElement(_material.Box, {
32
- className: "map-drawer--header"
33
- }, /*#__PURE__*/_react.default.createElement("p", {
34
- className: "title"
35
- }, title), /*#__PURE__*/_react.default.createElement(_material.IconButton, {
36
- onClick: onClose,
37
- size: "small"
38
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
39
- name: "close",
40
- className: "icon-close"
41
- }))), /*#__PURE__*/_react.default.createElement(_material.Box, {
42
- className: 'map-drawer--body'
43
- }, children)) : null;
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
- var _default = exports.default = MapDrawer;
44
+ export default MapDrawer;
@@ -1,62 +1,55 @@
1
- "use strict";
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 _react = _interopRequireDefault(require("react"));
9
- var _material = require("@mui/material");
10
- var _utils = require("../../utils");
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
- } = (0, _utils.useDeviceInfo)();
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__*/_react.default.createElement(_AntSwitch.default, {
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__*/_react.default.createElement(_material.Typography, {
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
- }, legend.title, legend.tooltip && /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
37
- title: legend.tooltip,
38
- sx: {
39
- display: 'inline-block',
40
- verticalAlign: 'text-top',
41
- marginLeft: theme.spacing(1)
42
- }
43
- }, /*#__PURE__*/_react.default.createElement(_material.Box, {
44
- display: "flex"
45
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
46
- fillColor: theme.palette.TwClrIcnInfo,
47
- name: "info",
48
- size: "small"
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__*/_react.default.createElement(_Icon.default, {
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
- var _item$style$borderCol, _item$style$opacity;
69
- return /*#__PURE__*/_react.default.createElement(_material.Box, {
61
+ return /*#__PURE__*/_jsx(Box, {
70
62
  display: 'flex',
71
63
  sx: {
72
- border: "2px solid ".concat((_item$style$borderCol = item.style.borderColor) !== null && _item$style$borderCol !== void 0 ? _item$style$borderCol : theme.palette.TwClrBaseGreen300),
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
- }, /*#__PURE__*/_react.default.createElement(_material.Box, {
80
- height: '16px',
81
- width: '24px',
82
- sx: {
83
- backgroundColor: item.style.fillColor,
84
- backgroundImage: item.style.fillPatternUrl ? "url('".concat(item.style.fillPatternUrl, "')") : undefined,
85
- backgroundRepeat: 'repeat',
86
- opacity: (_item$style$opacity = item.style.opacity) !== null && _item$style$opacity !== void 0 ? _item$style$opacity : 0.2
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__*/_react.default.createElement(_Icon.default, {
88
+ const visibleIcon = featureItem.visible ? /*#__PURE__*/_jsx(Icon, {
96
89
  name: "iconEye"
97
- }) : /*#__PURE__*/_react.default.createElement(_Icon.default, {
90
+ }) : /*#__PURE__*/_jsx(Icon, {
98
91
  name: "iconEyeOff"
99
92
  });
100
- return /*#__PURE__*/_react.default.createElement(_material.Box, {
101
- display: "flex"
102
- }, visibleIcon);
93
+ return /*#__PURE__*/_jsx(Box, {
94
+ display: "flex",
95
+ children: visibleIcon
96
+ });
103
97
  case 'layer':
104
98
  const layerItem = item;
105
- return /*#__PURE__*/_react.default.createElement(_material.Box, {
99
+ return /*#__PURE__*/_jsx(Box, {
106
100
  display: "flex",
107
101
  sx: {
108
102
  visibility: layerItem.id === legend.selectedLayer ? 'visible' : 'hidden'
109
- }
110
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
111
- name: "checkmark",
112
- style: {
113
- marginRight: theme.spacing(1)
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__*/_react.default.createElement(_material.Box, {
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
- key: "".concat(index, "-").concat(itemIndex)
133
- }, /*#__PURE__*/_react.default.createElement(_material.Box, {
134
- display: "flex",
135
- alignItems: "center",
136
- paddingRight: theme.spacing(1)
137
- }, logoComponent(), /*#__PURE__*/_react.default.createElement(_material.Typography, {
138
- fontSize: "14px",
139
- fontWeight: 400
140
- }, item.label)), /*#__PURE__*/_react.default.createElement(_material.Box, {
141
- display: "flex"
142
- }, visibleComponent()));
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__*/_react.default.createElement(_material.Box, {
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' : "1px solid ".concat(theme.palette.TwClrBrdrTertiary)
150
- }, /*#__PURE__*/_react.default.createElement(_material.Box, {
151
- paddingBottom: 2,
152
- paddingTop: isFirst ? 0 : 2,
153
- flexDirection: 'column'
154
- }, /*#__PURE__*/_react.default.createElement(_material.Box, {
155
- display: "flex",
156
- alignItems: 'center',
157
- paddingLeft: theme.spacing(1)
158
- }, switchComponent, titleComponent), itemComponents));
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__*/_react.default.createElement(_material.Box, {
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
- }, legendComponents);
170
+ overflow: 'scroll',
171
+ children: legendComponents
172
+ });
172
173
  };
173
- var _default = exports.default = MapLegend;
174
+ export default MapLegend;
@@ -1,49 +1,37 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _material = require("@mui/material");
11
- var _PopoverMenu = _interopRequireDefault(require("../PopoverMenu"));
12
- var _types = require("./types");
13
- const MapViewStyleControl = _ref => {
14
- var _mapViewStyleNames2;
15
- let {
16
- containerId,
17
- mapViewStyle,
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 = (0, _react.useCallback)(item => {
19
+ const onSelectMapViewStyle = useCallback(item => {
32
20
  setMapViewStyle(item.value);
33
21
  }, []);
34
- const container = (0, _react.useMemo)(() => {
22
+ const container = useMemo(() => {
35
23
  if (containerId) {
36
24
  return document.getElementById(containerId);
37
25
  }
38
26
  }, [containerId]);
39
- return /*#__PURE__*/_react.default.createElement(_material.Box, {
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: "".concat(theme.palette.TwClrBaseWhite),
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
- }, /*#__PURE__*/_react.default.createElement(_PopoverMenu.default, {
61
- anchor: /*#__PURE__*/_react.default.createElement(_material.Box, {
62
- component: "span",
63
- sx: {
64
- fontSize: '12px',
65
- paddingLeft: theme.spacing(0.5),
66
- color: theme.palette.TwClrTxt
67
- }
68
- }, (_mapViewStyleNames2 = mapViewStyleNames === null || mapViewStyleNames === void 0 ? void 0 : mapViewStyleNames(mapViewStyle)) !== null && _mapViewStyleNames2 !== void 0 ? _mapViewStyleNames2 : mapViewStyle),
69
- container: container,
70
- menuSections: [viewOptions],
71
- onClick: onSelectMapViewStyle
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
- var _default = exports.default = MapViewStyleControl;
64
+ export default MapViewStyleControl;
@@ -1,9 +1,2 @@
1
- "use strict";
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;