@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,17 +1,10 @@
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 = 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 = (0, _material.useTheme)();
15
+ const theme = useTheme();
23
16
  const selectLinkStyles = {
24
17
  color: theme.palette.TwClrTxtBrand,
25
18
  cursor: 'pointer'
26
19
  };
27
- const topBarSelection = (0, _react.useMemo)(() => {
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__*/_react.default.createElement(_react.default.Fragment, null, renderEnhancedNumSelectedText ? renderEnhancedNumSelectedText() : renderNumSelectedText(numSelected), ' ', !isAllSelected && handleSelectAll && renderSelectAllText && /*#__PURE__*/_react.default.createElement(_material.Link, {
42
- onClick: handleSelectAll,
43
- sx: selectLinkStyles
44
- }, renderSelectAllText()), isAllSelected && handleSelectNone && renderSelectNoneText && /*#__PURE__*/_react.default.createElement(_material.Link, {
45
- onClick: handleSelectNone,
46
- sx: selectLinkStyles
47
- }, renderSelectNoneText()));
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__*/_react.default.createElement(_material.Toolbar, {
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
- }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
55
- color: "inherit",
56
- variant: "subtitle1",
57
- component: "div",
58
- sx: {
59
- flex: '1 1 auto'
60
- }
61
- }, topBarSelection), topBarButtons === null || topBarButtons === void 0 ? void 0 : topBarButtons.map((tbButton, index) => (0, _.isTopBarButton)(tbButton) ? /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
62
- title: tbButton.tooltipTitle,
63
- key: index
64
- }, /*#__PURE__*/_react.default.createElement(_Button.default, {
65
- key: tbButton.buttonText,
66
- label: tbButton.buttonText,
67
- priority: "secondary",
68
- type: tbButton.buttonType,
69
- onClick: tbButton.onButtonClick,
70
- icon: tbButton.icon,
71
- disabled: tbButton.disabled,
72
- sx: {
73
- marginLeft: theme.spacing(1)
74
- }
75
- })) : tbButton)) : null;
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
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
- var _react = _interopRequireWildcard(require("react"));
11
- var _EnhancedTableToolbar = _interopRequireDefault(require("./EnhancedTableToolbar"));
12
- const EnhancedTableToolbarV2 = _ref => {
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 (0, _objectSpread2.default)((0, _objectSpread2.default)({}, topBarSelectionConfig), {}, {
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__*/_react.default.createElement(_EnhancedTableToolbar.default, {
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__*/_react.default.createElement(_EnhancedTableToolbar.default, {
35
+ return /*#__PURE__*/_jsx(EnhancedTableToolbar, {
44
36
  numSelected: selectedRowsCount,
45
37
  renderNumSelectedText: renderNumSelectedText,
46
38
  topBarButtons: topBarButtons
47
39
  });
48
40
  };
49
- var _default = exports.default = EnhancedTableToolbarV2;
41
+ export default EnhancedTableToolbarV2;
@@ -1,29 +1,17 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
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: "1px solid ".concat(theme.palette.TwClrBgSecondary),
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 = "row".concat(index, "-").concat(column.key);
29
+ const id = `row${index}-${column.key}`;
42
30
  if (column.type === 'date' && typeof value === 'string' && value) {
43
- return /*#__PURE__*/_react.default.createElement(CellDateRenderer, {
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__*/_react.default.createElement(CellNotesRenderer, {
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__*/_react.default.createElement(CellBooleanRenderer, {
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__*/_react.default.createElement(CellEditRenderer, {
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__*/_react.default.createElement(CellTextRenderer, {
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 (0, _utils.getDateDisplayValue)(value);
87
+ return getDateDisplayValue(value);
100
88
  }
101
89
  };
102
- exports.cellDateFormatter = cellDateFormatter;
103
- function CellDateRenderer(_ref) {
104
- let {
105
- id,
106
- value,
107
- className,
108
- alignment,
109
- style,
110
- sx,
111
- title
112
- } = _ref;
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
- }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
123
- component: "p",
124
- variant: "body1",
125
- fontSize: "16px"
126
- }, cellDateFormatter(value)));
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(_ref2) {
129
- let {
130
- id,
131
- value,
132
- className,
133
- alignment,
134
- style,
135
- sx,
136
- title,
137
- component
138
- } = _ref2;
139
- const theme = (0, _material.useTheme)();
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
- }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
147
- component: component || 'p',
148
- variant: "body1",
149
- noWrap: true,
150
- fontSize: "16px",
151
- sx: {
152
- maxWidth: 400
153
- }
154
- }, value));
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(_ref3) {
157
- let {
158
- id,
159
- value,
160
- className,
161
- booleanFalseText,
162
- booleanTrueText,
163
- alignment,
164
- style,
165
- sx,
166
- title
167
- } = _ref3;
168
- const theme = (0, _material.useTheme)();
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
- }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
176
- component: "p",
177
- variant: "body1",
178
- fontSize: "16px"
179
- }, (value === null || value === void 0 ? void 0 : value.toString()) === 'true' ? booleanTrueText : booleanFalseText));
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(_ref4) {
182
- let {
183
- id,
184
- value,
185
- className,
186
- alignment,
187
- style,
188
- sx,
189
- title
190
- } = _ref4;
191
- const theme = (0, _material.useTheme)();
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
- }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
199
- id: id,
200
- component: "p",
201
- variant: "body1",
202
- fontSize: "16px"
203
- }, value && value.length > 0 ? /*#__PURE__*/_react.default.createElement(_iconsMaterial.Notes, null) : ''));
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(_ref5) {
206
- let {
207
- id,
208
- onRowClick,
209
- className,
210
- editText,
211
- alignment,
212
- style,
213
- sx,
214
- title
215
- } = _ref5;
216
- const theme = (0, _material.useTheme)();
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
- }, /*#__PURE__*/_react.default.createElement(_material.Link, {
224
- id: "".concat(id, "-button"),
225
- href: "#",
226
- onClick: event => {
227
- (0, _utils.preventDefaultEvent)(event);
228
- if (onRowClick) {
229
- onRowClick();
230
- }
231
- }
232
- }, /*#__PURE__*/_react.default.createElement(_material.Box, {
233
- display: "flex"
234
- }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
235
- component: "p",
236
- variant: "body1",
237
- fontSize: "16px"
238
- }, editText), /*#__PURE__*/_react.default.createElement(_iconsMaterial.Edit, {
239
- fontSize: "small",
240
- sx: {
241
- marginLeft: theme.spacing(1)
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
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = EnhancedTableHead;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _sortable = require("@dnd-kit/sortable");
10
- var _material = require("@mui/material");
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: "2px solid ".concat(theme.palette.TwClrBrdrSecondary)
22
+ borderBottom: `2px solid ${theme.palette.TwClrBrdrSecondary}`
29
23
  },
30
24
  paddingTop: '0px',
31
25
  paddingBottom: '0px'
32
26
  };
33
- _react.default.useEffect(() => {
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 ? (0, _text.titleCase)(c.name) : c.name,
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] = _react.default.useState(columnsToHeadCells(props.columns));
48
- return /*#__PURE__*/_react.default.createElement(_material.TableHead, null, /*#__PURE__*/_react.default.createElement(_material.TableRow, {
49
- id: "table-header",
50
- sx: {
51
- height: (0, _density.getTableRowHeight)(density)
52
- }
53
- }, numSelected !== undefined && rowCount !== undefined && rowCount > 0 && onSelectAllClick && /*#__PURE__*/_react.default.createElement(_material.TableCell, {
54
- padding: "checkbox",
55
- sx: headerCellStyles
56
- }, /*#__PURE__*/_react.default.createElement(_material.Checkbox, {
57
- disableRipple: true,
58
- sx: (0, _Checkbox.CheckboxStyle)(theme),
59
- color: "primary",
60
- indeterminate: numSelected > 0 && numSelected < rowCount,
61
- checked: rowCount > 0 && numSelected === rowCount,
62
- onChange: onSelectAllClick
63
- })), /*#__PURE__*/_react.default.createElement(_sortable.SortableContext, {
64
- items: headCells
65
- }, headCells.map((headCell, i) => {
66
- return /*#__PURE__*/_react.default.createElement(_TableHeaderItem.default, {
67
- headCell: headCell,
68
- order: order,
69
- orderBy: orderBy,
70
- onRequestSort: onRequestSort,
71
- i: i,
72
- key: i
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
  }