@terraware/web-components 4.2.13 → 4.2.14-rc.1

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 (302) 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.js +251 -257
  19. package/components/IconTooltip/index.js +29 -34
  20. package/components/Map/MapBox.js +199 -220
  21. package/components/Map/MapContainer.js +14 -18
  22. package/components/Map/MapDateSliderControl.js +44 -46
  23. package/components/Map/MapDrawer.js +32 -33
  24. package/components/Map/MapLegend.js +96 -95
  25. package/components/Map/MapViewStyleControl.js +38 -48
  26. package/components/Map/ReactMapboxWrapper.js +2 -9
  27. package/components/Map/index.js +47 -55
  28. package/components/Map/types.js +2 -8
  29. package/components/Map/useMaintainLayerOrder.js +4 -11
  30. package/components/Markdown/index.js +14 -21
  31. package/components/Message/Message.js +59 -51
  32. package/components/MultiSelect/MultiSelect.test.js +22 -24
  33. package/components/MultiSelect/index.js +73 -69
  34. package/components/Navbar/NavFooter.js +8 -13
  35. package/components/Navbar/NavItem.js +43 -37
  36. package/components/Navbar/NavSection.js +13 -17
  37. package/components/Navbar/Navbar.js +35 -38
  38. package/components/Navbar/SubNavbar.js +8 -13
  39. package/components/Note.js +14 -19
  40. package/components/OverlayModal/OverlayModal.js +36 -37
  41. package/components/PageForm/index.js +30 -35
  42. package/components/PhotoChooser/index.js +93 -98
  43. package/components/Pill/index.js +29 -31
  44. package/components/PillList/index.js +16 -22
  45. package/components/PlacementWrapper/index.js +20 -25
  46. package/components/PopoverMenu/Popover.js +33 -37
  47. package/components/PopoverMenu/index.js +41 -46
  48. package/components/PopoverMultiSelect/index.js +18 -21
  49. package/components/ProgressCircle/ProgressCircle.js +23 -26
  50. package/components/RadioButton.js +7 -14
  51. package/components/Select/Select.js +8 -13
  52. package/components/Select/SelectT.js +110 -108
  53. package/components/Separator/index.js +8 -14
  54. package/components/Size.js +1 -5
  55. package/components/Slider/index.js +7 -13
  56. package/components/SummaryBox.js +36 -39
  57. package/components/Tabs/index.js +75 -77
  58. package/components/TextTruncated/index.js +64 -65
  59. package/components/Textfield/Textfield.js +100 -95
  60. package/components/Textfield/TruncatedTextArea.js +44 -46
  61. package/components/TimelineSlider/TimelineMarker.js +24 -28
  62. package/components/TimelineSlider/TimelineRail.js +5 -11
  63. package/components/TimelineSlider/index.js +47 -51
  64. package/components/Tooltip/Tooltip.js +21 -26
  65. package/components/ViewPhotosDialog/index.js +58 -62
  66. package/components/VirtualWalkthrough/Annotation.d.ts +41 -0
  67. package/components/VirtualWalkthrough/Annotation.d.ts.map +1 -0
  68. package/components/VirtualWalkthrough/Annotation.js +197 -0
  69. package/components/VirtualWalkthrough/AnnotationEditPane.d.ts +20 -0
  70. package/components/VirtualWalkthrough/AnnotationEditPane.d.ts.map +1 -0
  71. package/components/VirtualWalkthrough/AnnotationEditPane.js +136 -0
  72. package/components/VirtualWalkthrough/AnnotationPanel.d.ts +13 -0
  73. package/components/VirtualWalkthrough/AnnotationPanel.d.ts.map +1 -0
  74. package/components/VirtualWalkthrough/AnnotationPanel.js +196 -0
  75. package/components/VirtualWalkthrough/Application.d.ts +9 -0
  76. package/components/VirtualWalkthrough/Application.d.ts.map +1 -0
  77. package/components/VirtualWalkthrough/Application.js +32 -0
  78. package/components/VirtualWalkthrough/AutoRotator.d.ts +109 -0
  79. package/components/VirtualWalkthrough/AutoRotator.d.ts.map +1 -0
  80. package/components/VirtualWalkthrough/AutoRotator.js +217 -0
  81. package/components/VirtualWalkthrough/BlockingSpinner.d.ts +3 -0
  82. package/components/VirtualWalkthrough/BlockingSpinner.d.ts.map +1 -0
  83. package/components/VirtualWalkthrough/BlockingSpinner.js +27 -0
  84. package/components/VirtualWalkthrough/BoundaryRing.d.ts +9 -0
  85. package/components/VirtualWalkthrough/BoundaryRing.d.ts.map +1 -0
  86. package/components/VirtualWalkthrough/BoundaryRing.js +33 -0
  87. package/components/VirtualWalkthrough/CameraInfo.d.ts +16 -0
  88. package/components/VirtualWalkthrough/CameraInfo.d.ts.map +1 -0
  89. package/components/VirtualWalkthrough/CameraInfo.js +88 -0
  90. package/components/VirtualWalkthrough/ControlsInfoPane.d.ts +37 -0
  91. package/components/VirtualWalkthrough/ControlsInfoPane.d.ts.map +1 -0
  92. package/components/VirtualWalkthrough/ControlsInfoPane.js +196 -0
  93. package/components/VirtualWalkthrough/GradientSky.d.ts +9 -0
  94. package/components/VirtualWalkthrough/GradientSky.d.ts.map +1 -0
  95. package/components/VirtualWalkthrough/GradientSky.js +73 -0
  96. package/components/VirtualWalkthrough/SplatControls.d.ts +50 -0
  97. package/components/VirtualWalkthrough/SplatControls.d.ts.map +1 -0
  98. package/components/VirtualWalkthrough/SplatControls.js +252 -0
  99. package/components/VirtualWalkthrough/SplatCrop.d.ts +8 -0
  100. package/components/VirtualWalkthrough/SplatCrop.d.ts.map +1 -0
  101. package/components/VirtualWalkthrough/SplatCrop.js +18 -0
  102. package/components/VirtualWalkthrough/SplatFadeCrop.d.ts +8 -0
  103. package/components/VirtualWalkthrough/SplatFadeCrop.d.ts.map +1 -0
  104. package/components/VirtualWalkthrough/SplatFadeCrop.js +18 -0
  105. package/components/VirtualWalkthrough/SplatModel.d.ts +15 -0
  106. package/components/VirtualWalkthrough/SplatModel.d.ts.map +1 -0
  107. package/components/VirtualWalkthrough/SplatModel.js +60 -0
  108. package/components/VirtualWalkthrough/SplatRevealRain.d.ts +18 -0
  109. package/components/VirtualWalkthrough/SplatRevealRain.d.ts.map +1 -0
  110. package/components/VirtualWalkthrough/SplatRevealRain.js +38 -0
  111. package/components/VirtualWalkthrough/TfAnnotationManager.d.ts +110 -0
  112. package/components/VirtualWalkthrough/TfAnnotationManager.d.ts.map +1 -0
  113. package/components/VirtualWalkthrough/TfAnnotationManager.js +368 -0
  114. package/components/VirtualWalkthrough/TfXrNavigation.d.ts +15 -0
  115. package/components/VirtualWalkthrough/TfXrNavigation.d.ts.map +1 -0
  116. package/components/VirtualWalkthrough/TfXrNavigation.js +24 -0
  117. package/components/VirtualWalkthrough/VirtualWalkthroughViewer.d.ts +27 -0
  118. package/components/VirtualWalkthrough/VirtualWalkthroughViewer.d.ts.map +1 -0
  119. package/components/VirtualWalkthrough/VirtualWalkthroughViewer.js +282 -0
  120. package/components/VirtualWalkthrough/annotation-styles.css +5 -0
  121. package/components/VirtualWalkthrough/application-styles.css +4 -0
  122. package/components/VirtualWalkthrough/boundary-ring.d.ts +47 -0
  123. package/components/VirtualWalkthrough/boundary-ring.d.ts.map +1 -0
  124. package/components/VirtualWalkthrough/boundary-ring.js +125 -0
  125. package/components/VirtualWalkthrough/boundary-ring.test.js +109 -0
  126. package/components/VirtualWalkthrough/groundPlane.d.ts +14 -0
  127. package/components/VirtualWalkthrough/groundPlane.d.ts.map +1 -0
  128. package/components/VirtualWalkthrough/groundPlane.js +47 -0
  129. package/components/VirtualWalkthrough/groundPlane.test.js +45 -0
  130. package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts +19 -0
  131. package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts.map +1 -0
  132. package/components/VirtualWalkthrough/gsplat-fade-crop-effect.js +119 -0
  133. package/components/VirtualWalkthrough/walkthrough-camera.d.ts +77 -0
  134. package/components/VirtualWalkthrough/walkthrough-camera.d.ts.map +1 -0
  135. package/components/VirtualWalkthrough/walkthrough-camera.js +320 -0
  136. package/components/svg/BlobbyGrayIconImage.js +36 -41
  137. package/components/svg/BlobbyGrayIconImport.js +36 -41
  138. package/components/svg/BlobbyGrayIconUploadToTheCloud.js +36 -41
  139. package/components/svg/BlobbyIconCloudChecked.js +161 -158
  140. package/components/svg/BlobbyIconExportOrUploadPhoto.js +161 -158
  141. package/components/svg/BlobbyIconFolder.js +161 -158
  142. package/components/svg/BlobbyIconGraphReport.js +161 -158
  143. package/components/svg/BlobbyIconHappy.js +161 -158
  144. package/components/svg/BlobbyIconHeartMonitor.js +161 -158
  145. package/components/svg/BlobbyIconLeaf.js +161 -158
  146. package/components/svg/BlobbyIconLibrary.js +161 -158
  147. package/components/svg/BlobbyIconNursery.js +163 -160
  148. package/components/svg/BlobbyIconOrganization.js +161 -158
  149. package/components/svg/BlobbyIconParchment.js +161 -158
  150. package/components/svg/BlobbyIconPeople.js +161 -158
  151. package/components/svg/BlobbyIconSeedBank.js +161 -158
  152. package/components/svg/BlobbyIconSeedling.js +161 -158
  153. package/components/svg/BlobbyIconSeeds.js +161 -158
  154. package/components/svg/BlobbyIconSite.js +164 -161
  155. package/components/svg/BlobbyIconSparkles.js +161 -158
  156. package/components/svg/BlobbyIconWrench.js +161 -158
  157. package/components/svg/Bug.js +18 -27
  158. package/components/svg/Calendar.js +18 -27
  159. package/components/svg/CaretDown.js +18 -27
  160. package/components/svg/CaretLeft.js +18 -27
  161. package/components/svg/CaretRight.js +18 -27
  162. package/components/svg/CaretUp.js +18 -27
  163. package/components/svg/ChevronDown.js +18 -27
  164. package/components/svg/ChevronUp.js +18 -27
  165. package/components/svg/Close.js +18 -27
  166. package/components/svg/Critical.js +18 -27
  167. package/components/svg/Edit.js +161 -158
  168. package/components/svg/Error.js +18 -27
  169. package/components/svg/Filter.js +18 -27
  170. package/components/svg/Folder.js +18 -27
  171. package/components/svg/Help.js +18 -27
  172. package/components/svg/Home.js +18 -27
  173. package/components/svg/IconAdd.js +18 -27
  174. package/components/svg/IconArrowRight.js +19 -28
  175. package/components/svg/IconBusinessNetwork.js +18 -27
  176. package/components/svg/IconCalendar.js +18 -27
  177. package/components/svg/IconCancel.js +18 -27
  178. package/components/svg/IconChargingBattery.js +18 -27
  179. package/components/svg/IconChecklist.js +19 -28
  180. package/components/svg/IconCheckmark.js +18 -27
  181. package/components/svg/IconCoinInHand.js +18 -27
  182. package/components/svg/IconColumns.js +18 -27
  183. package/components/svg/IconComment.js +18 -27
  184. package/components/svg/IconDashboard.js +18 -27
  185. package/components/svg/IconDataMigration.js +18 -27
  186. package/components/svg/IconDocument.js +19 -28
  187. package/components/svg/IconDownloadFromTheCloud.js +19 -28
  188. package/components/svg/IconEdit.js +19 -28
  189. package/components/svg/IconExpand.js +19 -28
  190. package/components/svg/IconExport.js +18 -27
  191. package/components/svg/IconExternalLink.js +18 -27
  192. package/components/svg/IconEye.js +18 -27
  193. package/components/svg/IconEyeOff.js +18 -27
  194. package/components/svg/IconFile.js +18 -27
  195. package/components/svg/IconFolder.js +18 -27
  196. package/components/svg/IconFullScreen.js +18 -27
  197. package/components/svg/IconFutures.js +18 -27
  198. package/components/svg/IconGraphReport.js +18 -27
  199. package/components/svg/IconHeartMonitor.js +18 -27
  200. package/components/svg/IconHelp.js +19 -28
  201. package/components/svg/IconHistory.js +18 -27
  202. package/components/svg/IconImport.js +18 -27
  203. package/components/svg/IconIndex.js +18 -27
  204. package/components/svg/IconLayers.js +18 -27
  205. package/components/svg/IconLibrary.js +18 -27
  206. package/components/svg/IconList.js +18 -27
  207. package/components/svg/IconLivePlant.js +18 -27
  208. package/components/svg/IconLocations.js +18 -27
  209. package/components/svg/IconMail.js +18 -27
  210. package/components/svg/IconManager.js +18 -27
  211. package/components/svg/IconMarker.js +18 -27
  212. package/components/svg/IconMenu.js +18 -27
  213. package/components/svg/IconMenuHorizontal.js +18 -27
  214. package/components/svg/IconModule.js +18 -27
  215. package/components/svg/IconMyLocation.js +18 -27
  216. package/components/svg/IconNote.js +19 -28
  217. package/components/svg/IconNursery.js +18 -27
  218. package/components/svg/IconOrg.js +18 -27
  219. package/components/svg/IconParchment.js +18 -27
  220. package/components/svg/IconPhoto.js +18 -27
  221. package/components/svg/IconPlantsFilled.js +18 -27
  222. package/components/svg/IconRedo.js +18 -27
  223. package/components/svg/IconRestorationSite.js +18 -27
  224. package/components/svg/IconSeedBank.js +18 -27
  225. package/components/svg/IconSeedling.js +18 -27
  226. package/components/svg/IconSettings.js +18 -27
  227. package/components/svg/IconSlice.js +18 -27
  228. package/components/svg/IconSubmit.js +18 -27
  229. package/components/svg/IconSubtract.js +19 -28
  230. package/components/svg/IconSynced.js +18 -27
  231. package/components/svg/IconTrashCan.js +18 -27
  232. package/components/svg/IconTreasureMap.js +18 -27
  233. package/components/svg/IconUnavailable.js +18 -27
  234. package/components/svg/IconUndo.js +18 -27
  235. package/components/svg/IconVariable.js +18 -27
  236. package/components/svg/IconVideo.js +19 -28
  237. package/components/svg/IconWifi.js +18 -27
  238. package/components/svg/Info.js +18 -27
  239. package/components/svg/Key.js +18 -27
  240. package/components/svg/Leaf.js +18 -27
  241. package/components/svg/Lock.js +18 -27
  242. package/components/svg/Logo.js +40 -45
  243. package/components/svg/MenuVertical.js +18 -27
  244. package/components/svg/Notification.js +18 -27
  245. package/components/svg/Person.js +18 -27
  246. package/components/svg/Plus.js +18 -27
  247. package/components/svg/RestorationSite.js +18 -27
  248. package/components/svg/Search.js +18 -27
  249. package/components/svg/Seeds.js +18 -27
  250. package/components/svg/Site.js +18 -27
  251. package/components/svg/Sparkles.js +18 -27
  252. package/components/svg/Species.js +18 -27
  253. package/components/svg/Species2.js +161 -158
  254. package/components/svg/Spinner.js +27 -36
  255. package/components/svg/Star.js +18 -27
  256. package/components/svg/Success.js +18 -27
  257. package/components/svg/SuccessFilled.js +18 -27
  258. package/components/svg/TerrawareLogoDesktop.js +44 -49
  259. package/components/svg/TerrawareLogoMobile.js +20 -29
  260. package/components/svg/Touchscreen.js +18 -27
  261. package/components/svg/UploadCloud.js +161 -158
  262. package/components/svg/Warning.js +18 -27
  263. package/components/svg/WelcomeClipboard.js +130 -135
  264. package/components/svg/index.js +127 -895
  265. package/components/table/EnhancedTableToolbar.js +45 -47
  266. package/components/table/EnhancedTableToolbarV2.js +18 -26
  267. package/components/table/TableCellRenderer.js +137 -143
  268. package/components/table/TableHeader.js +45 -47
  269. package/components/table/TableHeaderItem.js +65 -64
  270. package/components/table/density.js +3 -11
  271. package/components/table/index.js +225 -218
  272. package/components/table/sort.js +8 -18
  273. package/components/table/sort.test.js +6 -8
  274. package/components/table/types.js +1 -5
  275. package/components/types/index.js +1 -5
  276. package/hooks/useBoolean.d.ts +4 -0
  277. package/hooks/useBoolean.d.ts.map +1 -0
  278. package/hooks/useBoolean.js +12 -0
  279. package/hooks/useCameraPosition.d.ts +8 -0
  280. package/hooks/useCameraPosition.d.ts.map +1 -0
  281. package/hooks/useCameraPosition.js +33 -0
  282. package/hooks/useDevicePerformance.d.ts +9 -0
  283. package/hooks/useDevicePerformance.d.ts.map +1 -0
  284. package/hooks/useDevicePerformance.js +16 -0
  285. package/index.js +57 -398
  286. package/license-report.html +1 -1
  287. package/package.json +10 -3
  288. package/style-dictionary-dist/TerrawareTheme.js +1 -7
  289. package/theme.js +7 -14
  290. package/utils/color.d.ts +2 -0
  291. package/utils/color.d.ts.map +1 -0
  292. package/utils/color.js +14 -0
  293. package/utils/date.js +13 -24
  294. package/utils/date.test.js +40 -43
  295. package/utils/index.js +5 -53
  296. package/utils/preventDefaultEvent.js +1 -7
  297. package/utils/text.js +2 -9
  298. package/utils/text.test.js +9 -11
  299. package/utils/useDeviceInfo.js +10 -16
  300. package/virtualWalkthrough.d.ts +34 -0
  301. package/virtualWalkthrough.d.ts.map +1 -0
  302. package/virtualWalkthrough.js +30 -0
@@ -1,16 +1,8 @@
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 = EditableTable;
9
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
- var _react = _interopRequireWildcard(require("react"));
11
- var _material = require("@mui/material");
12
- var _materialReactTable = require("material-react-table");
13
- var _Button = _interopRequireDefault(require("../Button/Button"));
1
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
+ import { Box, MenuItem, TextField, useTheme } from '@mui/material';
3
+ import { MaterialReactTable as MRTTable, MRT_ToolbarInternalButtons, useMaterialReactTable } from 'material-react-table';
4
+ import Button from '../Button/Button';
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
6
  const isActiveFilter = filter => {
15
7
  if (!filter.value) {
16
8
  return false;
@@ -20,41 +12,40 @@ const isActiveFilter = filter => {
20
12
  }
21
13
  return filter.value !== null && filter.value !== undefined && filter.value !== '';
22
14
  };
23
- function EditableTable(_ref) {
24
- let {
25
- clearAllFiltersLabel,
26
- columns,
27
- data,
28
- enableClearAllFilters = true,
29
- enableEditing = false,
30
- enableColumnOrdering = false,
31
- enableColumnPinning = false,
32
- enableSorting = true,
33
- enableGlobalFilter = false,
34
- enableColumnFilters = false,
35
- stickyFilters = false,
36
- storageKey,
37
- enablePagination = true,
38
- enableBottomToolbar = true,
39
- enableTopToolbar = true,
40
- initialSorting,
41
- onClearAllFilters,
42
- onRowClick,
43
- renderToolbarInternalActions,
44
- sx,
45
- tableOptions = {}
46
- } = _ref;
47
- const theme = (0, _material.useTheme)();
15
+ export default function EditableTable({
16
+ clearAllFiltersLabel,
17
+ columns,
18
+ data,
19
+ enableClearAllFilters = true,
20
+ enableEditing = false,
21
+ enableColumnOrdering = false,
22
+ enableColumnPinning = false,
23
+ enableSorting = true,
24
+ enableGlobalFilter = false,
25
+ enableColumnFilters = false,
26
+ stickyFilters = false,
27
+ storageKey,
28
+ enablePagination = true,
29
+ enableBottomToolbar = true,
30
+ enableTopToolbar = true,
31
+ initialSorting,
32
+ onClearAllFilters,
33
+ onRowClick,
34
+ renderToolbarInternalActions,
35
+ sx,
36
+ tableOptions = {}
37
+ }) {
38
+ const theme = useTheme();
48
39
  const filtersEnabled = enableColumnFilters || enableGlobalFilter;
49
40
  const showClearAllFilters = enableClearAllFilters && filtersEnabled;
50
41
 
51
42
  // Sticky column filters - load from localStorage (only if stickyFilters is enabled)
52
- const [columnFilters, setColumnFilters] = (0, _react.useState)(() => {
43
+ const [columnFilters, setColumnFilters] = useState(() => {
53
44
  if (!stickyFilters || !storageKey) {
54
45
  return [];
55
46
  }
56
47
  try {
57
- const saved = localStorage.getItem("".concat(storageKey, "_columnFilters"));
48
+ const saved = localStorage.getItem(`${storageKey}_columnFilters`);
58
49
  if (saved) {
59
50
  const parsed = JSON.parse(saved);
60
51
 
@@ -69,31 +60,30 @@ function EditableTable(_ref) {
69
60
  });
70
61
 
71
62
  // Save column filters to localStorage when they change
72
- (0, _react.useEffect)(() => {
63
+ useEffect(() => {
73
64
  if (!stickyFilters || !storageKey) {
74
65
  return;
75
66
  }
76
67
  try {
77
68
  // Filter out any filters with null or empty values before saving
78
69
  const validFilters = columnFilters.filter(isActiveFilter);
79
- localStorage.setItem("".concat(storageKey, "_columnFilters"), JSON.stringify(validFilters));
70
+ localStorage.setItem(`${storageKey}_columnFilters`, JSON.stringify(validFilters));
80
71
  } catch (error) {
81
72
  console.error('Error saving column filters:', error);
82
73
  }
83
74
  }, [columnFilters, stickyFilters, storageKey]);
84
75
 
85
76
  // Convert simplified column definitions to MRT column definitions
86
- const mrtColumns = (0, _react.useMemo)(() => {
77
+ const mrtColumns = useMemo(() => {
87
78
  return columns.map(col => {
88
- var _col$enableEditing, _col$enableHiding;
89
79
  const mrtCol = {
90
80
  id: col.id,
91
81
  header: col.header,
92
82
  accessorKey: col.accessorKey,
93
83
  accessorFn: col.accessorFn,
94
84
  size: col.size,
95
- enableEditing: (_col$enableEditing = col.enableEditing) !== null && _col$enableEditing !== void 0 ? _col$enableEditing : enableEditing,
96
- enableHiding: (_col$enableHiding = col.enableHiding) !== null && _col$enableHiding !== void 0 ? _col$enableHiding : true,
85
+ enableEditing: col.enableEditing ?? enableEditing,
86
+ enableHiding: col.enableHiding ?? true,
97
87
  Cell: col.Cell,
98
88
  filterVariant: col.filterVariant,
99
89
  filterSelectOptions: col.filterSelectOptions,
@@ -119,20 +109,19 @@ function EditableTable(_ref) {
119
109
  } else if (editVariant === 'select' && selectOptions) {
120
110
  mrtCol.editVariant = 'select';
121
111
  mrtCol.editSelectOptions = selectOptions;
122
- const SelectEditComponent = _ref2 => {
123
- let {
124
- cell,
125
- row,
126
- table: iTable
127
- } = _ref2;
128
- const [value, setValue] = _react.default.useState(cell.getValue() || '');
129
- const handleSave = (0, _react.useCallback)(() => {
112
+ const SelectEditComponent = ({
113
+ cell,
114
+ row,
115
+ table: iTable
116
+ }) => {
117
+ const [value, setValue] = React.useState(cell.getValue() || '');
118
+ const handleSave = useCallback(() => {
130
119
  if (onSave) {
131
120
  void onSave(row.original, value, col.id);
132
121
  }
133
122
  iTable.setEditingCell(null);
134
123
  }, [value]);
135
- return /*#__PURE__*/_react.default.createElement(_material.TextField, {
124
+ return /*#__PURE__*/_jsx(TextField, {
136
125
  select: true,
137
126
  value: value,
138
127
  onChange: e => setValue(e.target.value),
@@ -145,80 +134,82 @@ function EditableTable(_ref) {
145
134
  }
146
135
  },
147
136
  size: "small",
148
- fullWidth: true
149
- }, selectOptions.map(option => /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
150
- key: option.value,
151
- value: option.value
152
- }, option.label)));
137
+ fullWidth: true,
138
+ children: selectOptions.map(option => /*#__PURE__*/_jsx(MenuItem, {
139
+ value: option.value,
140
+ children: option.label
141
+ }, option.value))
142
+ });
153
143
  };
154
144
  mrtCol.Edit = SelectEditComponent;
155
145
  } else {
156
146
  // Default text input with onBlur save
157
- mrtCol.muiEditTextFieldProps = _ref3 => {
158
- let {
159
- row
160
- } = _ref3;
161
- return {
162
- onBlur: event => {
163
- if (onSave) {
164
- const value = event.target.value;
165
- // eslint-disable-next-line react/prop-types
166
- void onSave(row.original, value, col.id);
167
- }
147
+ mrtCol.muiEditTextFieldProps = ({
148
+ row
149
+ }) => ({
150
+ onBlur: event => {
151
+ if (onSave) {
152
+ const value = event.target.value;
153
+ // eslint-disable-next-line react/prop-types
154
+ void onSave(row.original, value, col.id);
168
155
  }
169
- };
170
- };
156
+ }
157
+ });
171
158
  }
172
159
  }
173
160
  return mrtCol;
174
161
  });
175
162
  }, [columns, enableEditing]);
176
- const initialStateConfig = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, initialSorting ? {
177
- sorting: initialSorting
178
- } : {}), enableColumnFilters ? {
179
- showColumnFilters: true
180
- } : {}), enableGlobalFilter ? {
181
- showGlobalFilter: true
182
- } : {});
183
- const handleClearAllFilters = (0, _react.useCallback)(tbl => {
163
+ const initialStateConfig = {
164
+ ...(initialSorting ? {
165
+ sorting: initialSorting
166
+ } : {}),
167
+ ...(enableColumnFilters ? {
168
+ showColumnFilters: true
169
+ } : {}),
170
+ ...(enableGlobalFilter ? {
171
+ showGlobalFilter: true
172
+ } : {})
173
+ };
174
+ const handleClearAllFilters = useCallback(tbl => {
184
175
  tbl.resetColumnFilters();
185
176
  if (enableGlobalFilter) {
186
177
  tbl.resetGlobalFilter();
187
178
  }
188
179
  setColumnFilters([]);
189
180
  if (storageKey) {
190
- localStorage.removeItem("".concat(storageKey, "_columnFilters"));
181
+ localStorage.removeItem(`${storageKey}_columnFilters`);
191
182
  }
192
- onClearAllFilters === null || onClearAllFilters === void 0 ? void 0 : onClearAllFilters();
183
+ onClearAllFilters?.();
193
184
  }, [enableGlobalFilter, storageKey, onClearAllFilters]);
194
- const consumerRenderTopToolbarCustomActions = tableOptions === null || tableOptions === void 0 ? void 0 : tableOptions.renderTopToolbarCustomActions;
195
- const consumerRenderToolbarInternalActions = renderToolbarInternalActions !== null && renderToolbarInternalActions !== void 0 ? renderToolbarInternalActions : tableOptions === null || tableOptions === void 0 ? void 0 : tableOptions.renderToolbarInternalActions;
196
- const composedRenderToolbarInternalActions = (0, _react.useCallback)(_ref4 => {
197
- let {
198
- table: tbl
199
- } = _ref4;
185
+ const consumerRenderTopToolbarCustomActions = tableOptions?.renderTopToolbarCustomActions;
186
+ const consumerRenderToolbarInternalActions = renderToolbarInternalActions ?? tableOptions?.renderToolbarInternalActions;
187
+ const composedRenderToolbarInternalActions = useCallback(({
188
+ table: tbl
189
+ }) => {
200
190
  const state = tbl.getState();
201
191
  const hasColumnFilters = state.columnFilters.some(isActiveFilter);
202
192
  const hasGlobalFilter = enableGlobalFilter && !!state.globalFilter;
203
193
  const hasActiveFilters = hasColumnFilters || hasGlobalFilter;
204
- return /*#__PURE__*/_react.default.createElement(_material.Box, {
194
+ return /*#__PURE__*/_jsxs(Box, {
205
195
  sx: {
206
196
  display: 'flex',
207
197
  alignItems: 'center',
208
198
  gap: 1
209
- }
210
- }, showClearAllFilters && hasActiveFilters && /*#__PURE__*/_react.default.createElement(_Button.default, {
211
- onClick: () => handleClearAllFilters(tbl),
212
- label: clearAllFiltersLabel,
213
- priority: "ghost",
214
- size: "small"
215
- }), consumerRenderToolbarInternalActions ? consumerRenderToolbarInternalActions({
216
- table: tbl
217
- }) : /*#__PURE__*/_react.default.createElement(_materialReactTable.MRT_ToolbarInternalButtons, {
218
- table: tbl
219
- }));
199
+ },
200
+ children: [showClearAllFilters && hasActiveFilters && /*#__PURE__*/_jsx(Button, {
201
+ onClick: () => handleClearAllFilters(tbl),
202
+ label: clearAllFiltersLabel,
203
+ priority: "ghost",
204
+ size: "small"
205
+ }), consumerRenderToolbarInternalActions ? consumerRenderToolbarInternalActions({
206
+ table: tbl
207
+ }) : /*#__PURE__*/_jsx(MRT_ToolbarInternalButtons, {
208
+ table: tbl
209
+ })]
210
+ });
220
211
  }, [showClearAllFilters, consumerRenderToolbarInternalActions, enableGlobalFilter, handleClearAllFilters, clearAllFiltersLabel]);
221
- const table = (0, _materialReactTable.useMaterialReactTable)((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
212
+ const table = useMaterialReactTable({
222
213
  columns: mrtColumns,
223
214
  data,
224
215
  editDisplayMode: 'cell',
@@ -232,10 +223,10 @@ function EditableTable(_ref) {
232
223
  enablePagination,
233
224
  enableBottomToolbar: enablePagination ? enableBottomToolbar : false,
234
225
  enableTopToolbar,
235
- positionGlobalFilter: enableGlobalFilter ? 'left' : undefined
236
- }, Object.keys(initialStateConfig).length > 0 ? {
237
- initialState: initialStateConfig
238
- } : {}), {}, {
226
+ positionGlobalFilter: enableGlobalFilter ? 'left' : undefined,
227
+ ...(Object.keys(initialStateConfig).length > 0 ? {
228
+ initialState: initialStateConfig
229
+ } : {}),
239
230
  muiTableBodyProps: {
240
231
  sx: {
241
232
  '& tr:nth-of-type(odd) > td': {
@@ -246,37 +237,40 @@ function EditableTable(_ref) {
246
237
  muiTablePaperProps: {
247
238
  elevation: 0
248
239
  },
249
- muiTableBodyRowProps: _ref5 => {
250
- let {
251
- row
252
- } = _ref5;
253
- return {
254
- // eslint-disable-next-line react/prop-types
255
- onClick: onRowClick ? () => onRowClick(row.original) : undefined,
256
- sx: {
257
- cursor: onRowClick ? 'pointer' : 'default',
258
- '& td': {
259
- borderBottom: 'none'
260
- }
240
+ muiTableBodyRowProps: ({
241
+ row
242
+ }) => ({
243
+ // eslint-disable-next-line react/prop-types
244
+ onClick: onRowClick ? () => onRowClick(row.original) : undefined,
245
+ sx: {
246
+ cursor: onRowClick ? 'pointer' : 'default',
247
+ '& td': {
248
+ borderBottom: 'none'
261
249
  }
262
- };
263
- }
264
- }, tableOptions), {}, {
265
- // These must come after ...tableOptions to avoid being overridden
266
- renderToolbarInternalActions: composedRenderToolbarInternalActions
267
- }, consumerRenderTopToolbarCustomActions ? {
268
- renderTopToolbarCustomActions: consumerRenderTopToolbarCustomActions
269
- } : {}), stickyFilters && storageKey ? {
270
- state: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, tableOptions === null || tableOptions === void 0 ? void 0 : tableOptions.state), {}, {
271
- columnFilters
250
+ }
272
251
  }),
273
- onColumnFiltersChange: setColumnFilters
274
- } : {}));
275
- return /*#__PURE__*/_react.default.createElement(_material.Box, {
252
+ // Merge any additional table options
253
+ ...tableOptions,
254
+ // These must come after ...tableOptions to avoid being overridden
255
+ renderToolbarInternalActions: composedRenderToolbarInternalActions,
256
+ ...(consumerRenderTopToolbarCustomActions ? {
257
+ renderTopToolbarCustomActions: consumerRenderTopToolbarCustomActions
258
+ } : {}),
259
+ // Add sticky filters state if enabled
260
+ ...(stickyFilters && storageKey ? {
261
+ state: {
262
+ ...tableOptions?.state,
263
+ columnFilters
264
+ },
265
+ onColumnFiltersChange: setColumnFilters
266
+ } : {})
267
+ });
268
+ return /*#__PURE__*/_jsx(Box, {
276
269
  minHeight: "160px",
277
270
  padding: 2,
278
- sx: sx
279
- }, /*#__PURE__*/_react.default.createElement(_materialReactTable.MaterialReactTable, {
280
- table: table
281
- }));
271
+ sx: sx,
272
+ children: /*#__PURE__*/_jsx(MRTTable, {
273
+ table: table
274
+ })
275
+ });
282
276
  }
@@ -1,17 +1,11 @@
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 = ErrorBox;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _material = require("@mui/material");
10
- var _useDeviceInfo = _interopRequireDefault(require("../../utils/useDeviceInfo"));
11
- var _Button = _interopRequireDefault(require("../Button/Button"));
12
- var _Icon = _interopRequireDefault(require("../Icon/Icon"));
13
- require("./styles.scss");
14
- function ErrorBox(props) {
1
+ import React from 'react';
2
+ import { Box } from '@mui/material';
3
+ import useDeviceInfo from '../../utils/useDeviceInfo';
4
+ import Button from '../Button/Button';
5
+ import Icon from '../Icon/Icon';
6
+ import './styles.scss';
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ export default function ErrorBox(props) {
15
9
  const {
16
10
  text,
17
11
  onClick,
@@ -22,26 +16,33 @@ function ErrorBox(props) {
22
16
  } = props;
23
17
  const {
24
18
  isMobile
25
- } = (0, _useDeviceInfo.default)();
26
- return /*#__PURE__*/_react.default.createElement(_material.Box, {
27
- className: "error-box ".concat(className, " ").concat(isMobile ? 'mobile' : ''),
28
- sx: sx
29
- }, /*#__PURE__*/_react.default.createElement("div", {
30
- className: "error-box--container"
31
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
32
- name: "error",
33
- className: "error-icon",
34
- size: "large"
35
- }), /*#__PURE__*/_react.default.createElement("div", null, title && /*#__PURE__*/_react.default.createElement("h1", {
36
- className: "error-title"
37
- }, title), /*#__PURE__*/_react.default.createElement("p", {
38
- className: "error-text"
39
- }, text))), buttonText && onClick && /*#__PURE__*/_react.default.createElement("div", {
40
- className: "button-container"
41
- }, /*#__PURE__*/_react.default.createElement(_Button.default, {
42
- label: buttonText,
43
- priority: "secondary",
44
- type: "passive",
45
- onClick: onClick
46
- })));
19
+ } = useDeviceInfo();
20
+ return /*#__PURE__*/_jsxs(Box, {
21
+ className: `error-box ${className} ${isMobile ? 'mobile' : ''}`,
22
+ sx: sx,
23
+ children: [/*#__PURE__*/_jsxs("div", {
24
+ className: "error-box--container",
25
+ children: [/*#__PURE__*/_jsx(Icon, {
26
+ name: "error",
27
+ className: "error-icon",
28
+ size: "large"
29
+ }), /*#__PURE__*/_jsxs("div", {
30
+ children: [title && /*#__PURE__*/_jsx("h1", {
31
+ className: "error-title",
32
+ children: title
33
+ }), /*#__PURE__*/_jsx("p", {
34
+ className: "error-text",
35
+ children: text
36
+ })]
37
+ })]
38
+ }), buttonText && onClick && /*#__PURE__*/_jsx("div", {
39
+ className: "button-container",
40
+ children: /*#__PURE__*/_jsx(Button, {
41
+ label: buttonText,
42
+ priority: "secondary",
43
+ type: "passive",
44
+ onClick: onClick
45
+ })
46
+ })]
47
+ });
47
48
  }
@@ -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 = FileChooser;
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _material = require("@mui/material");
11
- var _utils = require("../../utils");
12
- var _Button = _interopRequireDefault(require("../Button/Button"));
13
- var _Icon = _interopRequireDefault(require("../Icon/Icon"));
14
- function FileChooser(props) {
1
+ import React, { useEffect, useRef, useState } from 'react';
2
+ import { Box, Link, Typography, useTheme } from '@mui/material';
3
+ import { useDeviceInfo } from '../../utils';
4
+ import Button from '../Button/Button';
5
+ import Icon from '../Icon/Icon';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ export default function FileChooser(props) {
15
8
  const {
16
9
  acceptFileType,
17
10
  chooseFileText,
@@ -31,11 +24,11 @@ function FileChooser(props) {
31
24
  } = props;
32
25
  const {
33
26
  isMobile
34
- } = (0, _utils.useDeviceInfo)();
35
- const inputRef = (0, _react.useRef)(null);
36
- const theme = (0, _material.useTheme)();
37
- const [editing, setEditing] = (0, _react.useState)(false);
38
- (0, _react.useEffect)(() => {
27
+ } = useDeviceInfo();
28
+ const inputRef = useRef(null);
29
+ const theme = useTheme();
30
+ const [editing, setEditing] = useState(false);
31
+ useEffect(() => {
39
32
  setEditing(!!selectedFile);
40
33
  }, [selectedFile]);
41
34
  const addFiles = fileList => {
@@ -47,7 +40,7 @@ function FileChooser(props) {
47
40
  }
48
41
  }
49
42
  if (newFiles.length) {
50
- setFiles([...(files !== null && files !== void 0 ? files : []), ...newFiles].slice(0, maxFiles));
43
+ setFiles([...(files ?? []), ...newFiles].slice(0, maxFiles));
51
44
  }
52
45
  };
53
46
  const dropHandler = event => {
@@ -58,9 +51,8 @@ function FileChooser(props) {
58
51
  event.preventDefault();
59
52
  };
60
53
  const onChooseFileHandler = () => {
61
- var _inputRef$current;
62
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.click();
63
- onChoosingFiles === null || onChoosingFiles === void 0 ? void 0 : onChoosingFiles();
54
+ inputRef.current?.click();
55
+ onChoosingFiles?.();
64
56
  };
65
57
  const onFileChosen = event => {
66
58
  if (editing) {
@@ -70,10 +62,10 @@ function FileChooser(props) {
70
62
  addFiles(event.currentTarget.files);
71
63
  }
72
64
  };
73
- return /*#__PURE__*/_react.default.createElement(_material.Box, {
65
+ return /*#__PURE__*/_jsxs(Box, {
74
66
  onDrop: dropHandler,
75
67
  onDragOver: enableDropping,
76
- border: "1px dashed ".concat(theme.palette.TwClrBrdrTertiary),
68
+ border: `1px dashed ${theme.palette.TwClrBrdrTertiary}`,
77
69
  borderRadius: theme.spacing(2),
78
70
  display: "flex",
79
71
  flexDirection: "column",
@@ -81,57 +73,61 @@ function FileChooser(props) {
81
73
  padding: theme.spacing(3),
82
74
  sx: {
83
75
  background: theme.palette.TwClrBg
84
- }
85
- }, iconName && /*#__PURE__*/_react.default.createElement(_Icon.default, {
86
- name: iconName,
87
- size: "xlarge",
88
- style: {
89
- height: '120px',
90
- width: '120px'
91
- }
92
- }), /*#__PURE__*/_react.default.createElement(_material.Typography, {
93
- color: theme.palette.TwClrTxt,
94
- fontSize: 14,
95
- fontWeight: 600,
96
- margin: theme.spacing(0, 0, 1)
97
- }, !editing && ((files || []).length > 0 && !multipleSelection ? files === null || files === void 0 ? void 0 : files[0].name : uploadText)), /*#__PURE__*/_react.default.createElement(_material.Typography, {
98
- color: theme.palette.TwClrTxt,
99
- fontSize: 12,
100
- fontWeight: 400,
101
- margin: 0
102
- }, (editing || (files || []).length > 0) && !multipleSelection ? fileSelectedText : isMobile && uploadMobileDescription ? uploadMobileDescription : uploadDescription), /*#__PURE__*/_react.default.createElement("input", {
103
- type: "file",
104
- ref: inputRef,
105
- onChange: onFileChosen,
106
- accept: acceptFileType,
107
- multiple: multipleSelection || false,
108
- value: '',
109
- style: {
110
- display: 'none'
111
- }
112
- }), /*#__PURE__*/_react.default.createElement(_Button.default, {
113
- onClick: onChooseFileHandler,
114
- disabled: maxFiles !== undefined ? (files || []).length >= maxFiles : false,
115
- label: !multipleSelection && ((files || []).length === 1 || editing) ? replaceFileText : chooseFileText,
116
- priority: "secondary",
117
- type: "passive",
118
- sx: {
119
- marginTop: theme.spacing(3)
120
- }
121
- }), template && /*#__PURE__*/_react.default.createElement(_material.Link, {
122
- href: template.url,
123
- target: "_blank",
124
- sx: {
125
- color: theme.palette.TwClrTxtBrand,
126
- fontFamily: 'Inter',
127
- fontSize: '12px',
128
- fontWeight: 500,
129
- lineHeight: '16px',
130
- marginTop: theme.spacing(2),
131
- textDecoration: 'none',
132
- '&:hover': {
133
- textDecoration: 'underline'
76
+ },
77
+ children: [iconName && /*#__PURE__*/_jsx(Icon, {
78
+ name: iconName,
79
+ size: "xlarge",
80
+ style: {
81
+ height: '120px',
82
+ width: '120px'
134
83
  }
135
- }
136
- }, template.text));
84
+ }), /*#__PURE__*/_jsx(Typography, {
85
+ color: theme.palette.TwClrTxt,
86
+ fontSize: 14,
87
+ fontWeight: 600,
88
+ margin: theme.spacing(0, 0, 1),
89
+ children: !editing && ((files || []).length > 0 && !multipleSelection ? files?.[0].name : uploadText)
90
+ }), /*#__PURE__*/_jsx(Typography, {
91
+ color: theme.palette.TwClrTxt,
92
+ fontSize: 12,
93
+ fontWeight: 400,
94
+ margin: 0,
95
+ children: (editing || (files || []).length > 0) && !multipleSelection ? fileSelectedText : isMobile && uploadMobileDescription ? uploadMobileDescription : uploadDescription
96
+ }), /*#__PURE__*/_jsx("input", {
97
+ type: "file",
98
+ ref: inputRef,
99
+ onChange: onFileChosen,
100
+ accept: acceptFileType,
101
+ multiple: multipleSelection || false,
102
+ value: '',
103
+ style: {
104
+ display: 'none'
105
+ }
106
+ }), /*#__PURE__*/_jsx(Button, {
107
+ onClick: onChooseFileHandler,
108
+ disabled: maxFiles !== undefined ? (files || []).length >= maxFiles : false,
109
+ label: !multipleSelection && ((files || []).length === 1 || editing) ? replaceFileText : chooseFileText,
110
+ priority: "secondary",
111
+ type: "passive",
112
+ sx: {
113
+ marginTop: theme.spacing(3)
114
+ }
115
+ }), template && /*#__PURE__*/_jsx(Link, {
116
+ href: template.url,
117
+ target: "_blank",
118
+ sx: {
119
+ color: theme.palette.TwClrTxtBrand,
120
+ fontFamily: 'Inter',
121
+ fontSize: '12px',
122
+ fontWeight: 500,
123
+ lineHeight: '16px',
124
+ marginTop: theme.spacing(2),
125
+ textDecoration: 'none',
126
+ '&:hover': {
127
+ textDecoration: 'underline'
128
+ }
129
+ },
130
+ children: template.text
131
+ })]
132
+ });
137
133
  }