@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,82 +1,70 @@
1
- "use strict";
1
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
+ import { DndContext, KeyboardSensor, MouseSensor, TouchSensor, useSensor, useSensors } from '@dnd-kit/core';
3
+ import { sortableKeyboardCoordinates } from '@dnd-kit/sortable';
4
+ import { Box, Checkbox, Pagination, Table, TableBody, TableCell, TableContainer, TableRow, Typography, useTheme } from '@mui/material';
5
+ import { useDeviceInfo } from '../../utils';
6
+ import { CheckboxStyle } from '../Checkbox';
7
+ import EnhancedTableToolbarV2 from './EnhancedTableToolbarV2';
8
+ import TableCellRenderer from './TableCellRenderer';
9
+ import TableHeader from './TableHeader';
10
+ import { getTableCellPaddingY, getTableRowHeight } from './density';
11
+ import { descendingComparator, getComparator, stableSort } from './sort';
2
12
 
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 = EnhancedTable;
9
- exports.isTopBarButton = void 0;
10
- exports.tableSort = tableSort;
11
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
12
- var _react = _interopRequireWildcard(require("react"));
13
- var _core = require("@dnd-kit/core");
14
- var _sortable = require("@dnd-kit/sortable");
15
- var _material = require("@mui/material");
16
- var _utils = require("../../utils");
17
- var _Checkbox = require("../Checkbox");
18
- var _EnhancedTableToolbarV = _interopRequireDefault(require("./EnhancedTableToolbarV2"));
19
- var _TableCellRenderer = _interopRequireDefault(require("./TableCellRenderer"));
20
- var _TableHeader = _interopRequireDefault(require("./TableHeader"));
21
- var _density = require("./density");
22
- var _sort = require("./sort");
23
13
  // Only the text related props need to be passed in by the implementer, and extra data is passed to the caller
24
-
25
- const isTopBarButton = input => {
14
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
15
+ export const isTopBarButton = input => {
26
16
  const castInput = input;
27
17
  return !!(castInput.buttonType && castInput.onButtonClick);
28
18
  };
29
- exports.isTopBarButton = isTopBarButton;
30
- function EnhancedTable(_ref) {
31
- let {
32
- id,
33
- columns,
34
- rows,
35
- order: _order = 'asc',
36
- orderBy: _orderBy,
37
- Renderer = _TableCellRenderer.default,
38
- onSelect,
39
- onPageChange,
40
- maxItemsPerPage = 100,
41
- totalRowCount,
42
- currentPage,
43
- DetailsRenderer,
44
- sortComparator = _sort.descendingComparator,
45
- sortHandler,
46
- isInactive,
47
- isPresorted,
48
- onReorderEnd,
49
- isClickable,
50
- emptyTableMessage,
51
- showCheckbox,
52
- showTopBar,
53
- topBarButtons,
54
- selectedRows,
55
- setSelectedRows,
56
- controlledOnSelect,
57
- reloadData,
58
- stickyHeader = true,
59
- hideHeader,
60
- booleanFalseText,
61
- booleanTrueText,
62
- editText,
63
- renderNumSelectedText,
64
- renderPaginationText,
65
- enhancedTopBarSelectionConfig,
66
- density = 'comfortable',
67
- tableComments
68
- } = _ref;
69
- const theme = (0, _material.useTheme)();
70
- const [order, setOrder] = _react.default.useState(_order);
71
- const [orderBy, setOrderBy] = _react.default.useState(_orderBy);
72
- const [internalPage, setInternalPage] = (0, _react.useState)(1);
19
+ export default function EnhancedTable({
20
+ id,
21
+ columns,
22
+ rows,
23
+ order: _order = 'asc',
24
+ orderBy: _orderBy,
25
+ Renderer = TableCellRenderer,
26
+ onSelect,
27
+ onPageChange,
28
+ maxItemsPerPage = 100,
29
+ totalRowCount,
30
+ currentPage,
31
+ DetailsRenderer,
32
+ sortComparator = descendingComparator,
33
+ sortHandler,
34
+ isInactive,
35
+ isPresorted,
36
+ onReorderEnd,
37
+ isClickable,
38
+ emptyTableMessage,
39
+ showCheckbox,
40
+ showTopBar,
41
+ topBarButtons,
42
+ selectedRows,
43
+ setSelectedRows,
44
+ controlledOnSelect,
45
+ reloadData,
46
+ stickyHeader = true,
47
+ hideHeader,
48
+ booleanFalseText,
49
+ booleanTrueText,
50
+ editText,
51
+ renderNumSelectedText,
52
+ renderPaginationText,
53
+ enhancedTopBarSelectionConfig,
54
+ density = 'comfortable',
55
+ tableComments
56
+ }) {
57
+ const theme = useTheme();
58
+ const [order, setOrder] = React.useState(_order);
59
+ const [orderBy, setOrderBy] = React.useState(_orderBy);
60
+ const [internalPage, setInternalPage] = useState(1);
73
61
  const {
74
62
  isMobile
75
- } = (0, _utils.useDeviceInfo)();
76
- const [displayColumnKeyNames, setDisplayColumnKeyNames] = (0, _react.useState)();
77
- const [displayColumnsIndexed, setDisplayColumnsIndexed] = (0, _react.useState)();
78
- const [displayColumnDetails, setDisplayColumnDetails] = (0, _react.useState)();
79
- (0, _react.useEffect)(() => {
63
+ } = useDeviceInfo();
64
+ const [displayColumnKeyNames, setDisplayColumnKeyNames] = useState();
65
+ const [displayColumnsIndexed, setDisplayColumnsIndexed] = useState();
66
+ const [displayColumnDetails, setDisplayColumnDetails] = useState();
67
+ useEffect(() => {
80
68
  const columnsKeyNames = columns.map(col => col.key);
81
69
  const columnsIndexed = columns.reduce((acum, value) => {
82
70
  acum[value.key] = value;
@@ -85,13 +73,15 @@ function EnhancedTable(_ref) {
85
73
  setDisplayColumnKeyNames(columnsKeyNames);
86
74
  setDisplayColumnsIndexed(columnsIndexed);
87
75
  }, [columns]);
88
- (0, _react.useEffect)(() => {
76
+ useEffect(() => {
89
77
  if (displayColumnKeyNames && displayColumnsIndexed) {
90
- const columnsDetails = displayColumnKeyNames.map(key => (0, _objectSpread2.default)({}, displayColumnsIndexed[key]));
78
+ const columnsDetails = displayColumnKeyNames.map(key => ({
79
+ ...displayColumnsIndexed[key]
80
+ }));
91
81
  setDisplayColumnDetails(columnsDetails);
92
82
  }
93
83
  }, [displayColumnKeyNames, displayColumnsIndexed]);
94
- (0, _react.useEffect)(() => {
84
+ useEffect(() => {
95
85
  if (setSelectedRows && rows.length >= 0) {
96
86
  setSelectedRows(currentlySelectedRows => {
97
87
  const emptyArray = [];
@@ -102,13 +92,13 @@ function EnhancedTable(_ref) {
102
92
  });
103
93
  }
104
94
  }, [rows, setSelectedRows]);
105
- const handleChangePage = (0, _react.useCallback)((event, newPage) => {
106
- onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange(newPage);
95
+ const handleChangePage = useCallback((event, newPage) => {
96
+ onPageChange?.(newPage);
107
97
  if (currentPage === undefined) {
108
98
  setInternalPage(newPage);
109
99
  }
110
100
  }, [onPageChange, currentPage]);
111
- (0, _react.useEffect)(() => {
101
+ useEffect(() => {
112
102
  // this is not most elegant but we want to do this if table was sorted by some column in a presorted table
113
103
  // but we don't know when the data changes, hence this useEffect on the data size
114
104
  if (isPresorted && onPageChange === undefined) {
@@ -156,31 +146,30 @@ function EnhancedTable(_ref) {
156
146
  setSelectedRows(newSelected);
157
147
  }
158
148
  };
159
- const columnsToHeadCells = (0, _react.useCallback)(columnsR => {
149
+ const columnsToHeadCells = useCallback(columnsR => {
160
150
  return columnsR.map(c => ({
161
151
  id: c.key,
162
152
  disablePadding: true,
163
153
  label: typeof c.name === 'string' ? c.name.toUpperCase() : c.name,
164
154
  sx: [{
165
- paddingY: (0, _density.getTableCellPaddingY)(density)
155
+ paddingY: getTableCellPaddingY(density)
166
156
  }, ...(Array.isArray(c.sx) ? c.sx : [c.sx])],
167
157
  tooltipTitle: c.tooltipTitle
168
158
  }));
169
159
  }, [density]);
170
- const [headCells, setHeadCells] = _react.default.useState();
171
- _react.default.useEffect(() => {
160
+ const [headCells, setHeadCells] = React.useState();
161
+ React.useEffect(() => {
172
162
  if (displayColumnDetails) {
173
163
  setHeadCells(columnsToHeadCells(displayColumnDetails));
174
164
  }
175
165
  }, [columnsToHeadCells, displayColumnDetails]);
176
- const sensors = (0, _core.useSensors)((0, _core.useSensor)(_core.MouseSensor), (0, _core.useSensor)(_core.TouchSensor), (0, _core.useSensor)(_core.KeyboardSensor, {
177
- coordinateGetter: _sortable.sortableKeyboardCoordinates
166
+ const sensors = useSensors(useSensor(MouseSensor), useSensor(TouchSensor), useSensor(KeyboardSensor, {
167
+ coordinateGetter: sortableKeyboardCoordinates
178
168
  }));
179
- const onReorderEndHandler = (0, _react.useCallback)(_ref2 => {
180
- let {
181
- oldIndex,
182
- newIndex
183
- } = _ref2;
169
+ const onReorderEndHandler = useCallback(({
170
+ oldIndex,
171
+ newIndex
172
+ }) => {
184
173
  if (displayColumnKeyNames) {
185
174
  if (newIndex !== 0 && oldIndex !== 0) {
186
175
  const newOrder = [...displayColumnKeyNames];
@@ -209,11 +198,11 @@ function EnhancedTable(_ref) {
209
198
  }
210
199
  }
211
200
  };
212
- const pageNumber = (0, _react.useMemo)(() => currentPage !== null && currentPage !== void 0 ? currentPage : internalPage, [currentPage, internalPage]);
213
- const sortedPageRows = (0, _react.useMemo)(() => {
201
+ const pageNumber = useMemo(() => currentPage ?? internalPage, [currentPage, internalPage]);
202
+ const sortedPageRows = useMemo(() => {
214
203
  if (rows) {
215
204
  const itemsToSkip = onPageChange ? 0 : maxItemsPerPage * (pageNumber - 1);
216
- return (isPresorted ? rows : (0, _sort.stableSort)(rows, (0, _sort.getComparator)(order, orderBy, sortComparator))).slice(itemsToSkip, itemsToSkip + maxItemsPerPage);
205
+ return (isPresorted ? rows : stableSort(rows, getComparator(order, orderBy, sortComparator))).slice(itemsToSkip, itemsToSkip + maxItemsPerPage);
217
206
  } else {
218
207
  return [];
219
208
  }
@@ -224,145 +213,163 @@ function EnhancedTable(_ref) {
224
213
  * If the table is empty (rows.length === 0) override calculation and show '0 of 0'
225
214
  * Pagination total is overridden by totalRowCount if provided.
226
215
  */
227
- const paginationTotal = (0, _react.useMemo)(() => totalRowCount || rows.length, [rows.length, totalRowCount]);
228
- const pagesCount = (0, _react.useMemo)(() => Math.ceil(paginationTotal / maxItemsPerPage), [maxItemsPerPage, paginationTotal]);
229
- const minRowNumber = (0, _react.useMemo)(() => {
216
+ const paginationTotal = useMemo(() => totalRowCount || rows.length, [rows.length, totalRowCount]);
217
+ const pagesCount = useMemo(() => Math.ceil(paginationTotal / maxItemsPerPage), [maxItemsPerPage, paginationTotal]);
218
+ const minRowNumber = useMemo(() => {
230
219
  if (!sortedPageRows.length) {
231
220
  return 0;
232
221
  }
233
222
  return (pageNumber - 1) * maxItemsPerPage + 1;
234
223
  }, [pageNumber, maxItemsPerPage, sortedPageRows.length]);
235
- const maxRowNumber = (0, _react.useMemo)(() => {
224
+ const maxRowNumber = useMemo(() => {
236
225
  if (!sortedPageRows.length) {
237
226
  return 0;
238
227
  }
239
228
  return Math.min(pageNumber * maxItemsPerPage, paginationTotal);
240
229
  }, [pageNumber, maxItemsPerPage, paginationTotal, sortedPageRows.length]);
241
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showTopBar && /*#__PURE__*/_react.default.createElement(_EnhancedTableToolbarV.default, {
242
- selectedRowsCount: (selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length) || 0,
243
- pagesCount: pagesCount,
244
- renderNumSelectedText: renderNumSelectedText,
245
- rowsCount: rows.length,
246
- topBarButtons: topBarButtons,
247
- topBarSelectionConfig: enhancedTopBarSelectionConfig ? (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enhancedTopBarSelectionConfig), {}, {
248
- handleSelectAll: () => setSelectedRows && setSelectedRows(rows),
249
- handleSelectNone: () => setSelectedRows && setSelectedRows([])
250
- }) : undefined
251
- }), /*#__PURE__*/_react.default.createElement(_material.TableContainer, {
252
- id: id
253
- }, /*#__PURE__*/_react.default.createElement(_core.DndContext, {
254
- sensors: sensors,
255
- onDragEnd: handleDragEnd
256
- }, /*#__PURE__*/_react.default.createElement(_material.Table, {
257
- stickyHeader: stickyHeader,
258
- "aria-labelledby": "tableTitle",
259
- size: "medium",
260
- "aria-label": "enhanced table",
261
- sx: {
262
- borderCollapse: 'initial'
263
- }
264
- }, !hideHeader && /*#__PURE__*/_react.default.createElement(_TableHeader.default, {
265
- order: order,
266
- orderBy: orderBy,
267
- onRequestSort: handleRequestSort,
268
- columns: displayColumnDetails !== null && displayColumnDetails !== void 0 ? displayColumnDetails : [],
269
- onReorderEnd: onReorderEndHandler,
270
- numSelected: showCheckbox ? selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length : undefined,
271
- onSelectAllClick: showCheckbox ? handleSelectAllClick : undefined,
272
- rowCount: showCheckbox ? sortedPageRows === null || sortedPageRows === void 0 ? void 0 : sortedPageRows.length : undefined,
273
- density: density
274
- }), /*#__PURE__*/_react.default.createElement(_material.TableBody, null, sortedPageRows.length < 1 && emptyTableMessage && /*#__PURE__*/_react.default.createElement(_material.TableRow, null, /*#__PURE__*/_react.default.createElement(_material.TableCell, {
275
- colSpan: columns.length + 1,
276
- align: "center"
277
- }, /*#__PURE__*/_react.default.createElement("p", null, emptyTableMessage))), sortedPageRows && sortedPageRows.map((row, index) => {
278
- const onClick = onSelect && !controlledOnSelect ? () => onSelect(row) : undefined;
279
- const isItemSelected = isSelected(row);
280
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
281
- key: index
282
- }, /*#__PURE__*/_react.default.createElement(_material.TableRow, {
283
- id: "row".concat(index + 1),
284
- hover: true,
285
- onClick: e => {
286
- e.stopPropagation();
287
- if (onClick && !hasEditColumn && (isClickable ? isClickable(row) : true)) {
288
- onClick();
289
- }
290
- if (!onClick && !hasEditColumn && (isClickable ? isClickable(row) : true)) {
291
- handleClick(e, row);
292
- }
293
- },
294
- selected: isItemSelected,
295
- "aria-checked": isItemSelected,
296
- sx: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, isInactive && isInactive(row) ? {
297
- backgroundColor: theme.palette.neutral[50]
298
- } : {}), {}, {
299
- height: (0, _density.getTableRowHeight)(density),
300
- '&.MuiTableRow-root.Mui-selected': {
301
- backgroundColor: theme.palette.TwClrBgSelectedTertiary
302
- },
303
- '&:nth-of-type(odd)': {
304
- backgroundColor: theme.palette.TwClrBgSecondary
305
- },
306
- '&:hover': {
307
- backgroundColor: theme.palette.TwClrBgSecondaryHover
308
- }
230
+ return /*#__PURE__*/_jsxs(_Fragment, {
231
+ children: [showTopBar && /*#__PURE__*/_jsx(EnhancedTableToolbarV2, {
232
+ selectedRowsCount: selectedRows?.length || 0,
233
+ pagesCount: pagesCount,
234
+ renderNumSelectedText: renderNumSelectedText,
235
+ rowsCount: rows.length,
236
+ topBarButtons: topBarButtons,
237
+ topBarSelectionConfig: enhancedTopBarSelectionConfig ? {
238
+ ...enhancedTopBarSelectionConfig,
239
+ handleSelectAll: () => setSelectedRows && setSelectedRows(rows),
240
+ handleSelectNone: () => setSelectedRows && setSelectedRows([])
241
+ } : undefined
242
+ }), /*#__PURE__*/_jsx(TableContainer, {
243
+ id: id,
244
+ children: /*#__PURE__*/_jsx(DndContext, {
245
+ sensors: sensors,
246
+ onDragEnd: handleDragEnd,
247
+ children: /*#__PURE__*/_jsxs(Table, {
248
+ stickyHeader: stickyHeader,
249
+ "aria-labelledby": "tableTitle",
250
+ size: "medium",
251
+ "aria-label": "enhanced table",
252
+ sx: {
253
+ borderCollapse: 'initial'
254
+ },
255
+ children: [!hideHeader && /*#__PURE__*/_jsx(TableHeader, {
256
+ order: order,
257
+ orderBy: orderBy,
258
+ onRequestSort: handleRequestSort,
259
+ columns: displayColumnDetails ?? [],
260
+ onReorderEnd: onReorderEndHandler,
261
+ numSelected: showCheckbox ? selectedRows?.length : undefined,
262
+ onSelectAllClick: showCheckbox ? handleSelectAllClick : undefined,
263
+ rowCount: showCheckbox ? sortedPageRows?.length : undefined,
264
+ density: density
265
+ }), /*#__PURE__*/_jsxs(TableBody, {
266
+ children: [sortedPageRows.length < 1 && emptyTableMessage && /*#__PURE__*/_jsx(TableRow, {
267
+ children: /*#__PURE__*/_jsx(TableCell, {
268
+ colSpan: columns.length + 1,
269
+ align: "center",
270
+ children: /*#__PURE__*/_jsx("p", {
271
+ children: emptyTableMessage
272
+ })
273
+ })
274
+ }), sortedPageRows && sortedPageRows.map((row, index) => {
275
+ const onClick = onSelect && !controlledOnSelect ? () => onSelect(row) : undefined;
276
+ const isItemSelected = isSelected(row);
277
+ return /*#__PURE__*/_jsxs(React.Fragment, {
278
+ children: [/*#__PURE__*/_jsxs(TableRow, {
279
+ id: `row${index + 1}`,
280
+ hover: true,
281
+ onClick: e => {
282
+ e.stopPropagation();
283
+ if (onClick && !hasEditColumn && (isClickable ? isClickable(row) : true)) {
284
+ onClick();
285
+ }
286
+ if (!onClick && !hasEditColumn && (isClickable ? isClickable(row) : true)) {
287
+ handleClick(e, row);
288
+ }
289
+ },
290
+ selected: isItemSelected,
291
+ "aria-checked": isItemSelected,
292
+ sx: {
293
+ ...(isInactive && isInactive(row) ? {
294
+ backgroundColor: theme.palette.neutral[50]
295
+ } : {}),
296
+ height: getTableRowHeight(density),
297
+ '&.MuiTableRow-root.Mui-selected': {
298
+ backgroundColor: theme.palette.TwClrBgSelectedTertiary
299
+ },
300
+ '&:nth-of-type(odd)': {
301
+ backgroundColor: theme.palette.TwClrBgSecondary
302
+ },
303
+ '&:hover': {
304
+ backgroundColor: theme.palette.TwClrBgSecondaryHover
305
+ }
306
+ },
307
+ children: [showCheckbox && /*#__PURE__*/_jsx(TableCell, {
308
+ padding: "checkbox",
309
+ sx: {
310
+ '&.MuiTableCell-root': {
311
+ borderBottom: `1px solid ${theme.palette.TwClrBgSecondary}`
312
+ }
313
+ },
314
+ children: /*#__PURE__*/_jsx(Checkbox, {
315
+ disableRipple: true,
316
+ sx: CheckboxStyle(theme),
317
+ color: "primary",
318
+ checked: isItemSelected,
319
+ onClick: e => !isClickable || !isClickable(row) ? handleClick(e, row) : null
320
+ })
321
+ }), displayColumnDetails && displayColumnDetails.map(c => /*#__PURE__*/_jsx(Renderer, {
322
+ index: index + 1,
323
+ row: row,
324
+ column: c,
325
+ value: row[c.key],
326
+ onRowClick: onSelect && controlledOnSelect ? newValue => onSelect(row, c.key, newValue) : onClick,
327
+ reloadData: reloadData,
328
+ booleanFalseText: booleanFalseText,
329
+ booleanTrueText: booleanTrueText,
330
+ editText: editText,
331
+ sx: {
332
+ paddingY: getTableCellPaddingY(density)
333
+ }
334
+ }, c.key))]
335
+ }), DetailsRenderer && /*#__PURE__*/_jsx(DetailsRenderer, {
336
+ index: index,
337
+ row: row
338
+ })]
339
+ }, index);
340
+ })]
341
+ })]
342
+ })
309
343
  })
310
- }, showCheckbox && /*#__PURE__*/_react.default.createElement(_material.TableCell, {
311
- padding: "checkbox",
312
- sx: {
313
- '&.MuiTableCell-root': {
314
- borderBottom: "1px solid ".concat(theme.palette.TwClrBgSecondary)
315
- }
316
- }
317
- }, /*#__PURE__*/_react.default.createElement(_material.Checkbox, {
318
- disableRipple: true,
319
- sx: (0, _Checkbox.CheckboxStyle)(theme),
320
- color: "primary",
321
- checked: isItemSelected,
322
- onClick: e => !isClickable || !isClickable(row) ? handleClick(e, row) : null
323
- })), displayColumnDetails && displayColumnDetails.map(c => /*#__PURE__*/_react.default.createElement(Renderer, {
324
- index: index + 1,
325
- key: c.key,
326
- row: row,
327
- column: c,
328
- value: row[c.key],
329
- onRowClick: onSelect && controlledOnSelect ? newValue => onSelect(row, c.key, newValue) : onClick,
330
- reloadData: reloadData,
331
- booleanFalseText: booleanFalseText,
332
- booleanTrueText: booleanTrueText,
333
- editText: editText,
334
- sx: {
335
- paddingY: (0, _density.getTableCellPaddingY)(density)
336
- }
337
- }))), DetailsRenderer && /*#__PURE__*/_react.default.createElement(DetailsRenderer, {
338
- index: index,
339
- row: row
340
- }));
341
- }))))), tableComments && /*#__PURE__*/_react.default.createElement(_material.Typography, {
342
- fontWeight: 400,
343
- fontSize: "14px",
344
- color: theme.palette.TwClrTxtSecondary,
345
- marginTop: 2
346
- }, tableComments), renderPaginationText && /*#__PURE__*/_react.default.createElement(_material.Box, {
347
- display: "flex",
348
- alignItems: "center",
349
- justifyContent: "flex-end",
350
- paddingTop: "24px"
351
- }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
352
- paddingRight: "24px",
353
- fontSize: "14px"
354
- }, renderPaginationText(minRowNumber, maxRowNumber, paginationTotal)), /*#__PURE__*/_react.default.createElement(_material.Pagination, {
355
- count: pagesCount,
356
- page: pageNumber,
357
- shape: "rounded",
358
- onChange: handleChangePage,
359
- siblingCount: isMobile ? 0 : 1,
360
- size: 'small'
361
- })));
344
+ }), tableComments && /*#__PURE__*/_jsx(Typography, {
345
+ fontWeight: 400,
346
+ fontSize: "14px",
347
+ color: theme.palette.TwClrTxtSecondary,
348
+ marginTop: 2,
349
+ children: tableComments
350
+ }), renderPaginationText && /*#__PURE__*/_jsxs(Box, {
351
+ display: "flex",
352
+ alignItems: "center",
353
+ justifyContent: "flex-end",
354
+ paddingTop: "24px",
355
+ children: [/*#__PURE__*/_jsx(Typography, {
356
+ paddingRight: "24px",
357
+ fontSize: "14px",
358
+ children: renderPaginationText(minRowNumber, maxRowNumber, paginationTotal)
359
+ }), /*#__PURE__*/_jsx(Pagination, {
360
+ count: pagesCount,
361
+ page: pageNumber,
362
+ shape: "rounded",
363
+ onChange: handleChangePage,
364
+ siblingCount: isMobile ? 0 : 1,
365
+ size: 'small'
366
+ })]
367
+ })]
368
+ });
362
369
  }
363
- function tableSort(ignore, array, comparator) {
370
+ export function tableSort(ignore, array, comparator) {
364
371
  if (ignore) {
365
372
  return array;
366
373
  }
367
- return (0, _sort.stableSort)(array, comparator);
374
+ return stableSort(array, comparator);
368
375
  }
@@ -1,13 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.descendingComparator = descendingComparator;
7
- exports.getComparator = getComparator;
8
- exports.stableSort = stableSort;
9
- function descendingComparator(a, b, orderBy, order) {
10
- var _b$orderBy, _a$orderBy;
1
+ export function descendingComparator(a, b, orderBy, order) {
11
2
  // first attempt to parse into a numeric value and compare
12
3
  const numCompare = descendingNumComparator(a, b, orderBy);
13
4
  if (numCompare !== null) {
@@ -19,8 +10,8 @@ function descendingComparator(a, b, orderBy, order) {
19
10
  }
20
11
 
21
12
  // if non-numeric, compare using the javascript built-in compare for this type
22
- const bValue = (_b$orderBy = b[orderBy]) !== null && _b$orderBy !== void 0 ? _b$orderBy : '';
23
- const aValue = (_a$orderBy = a[orderBy]) !== null && _a$orderBy !== void 0 ? _a$orderBy : '';
13
+ const bValue = b[orderBy] ?? '';
14
+ const aValue = a[orderBy] ?? '';
24
15
 
25
16
  // blank values at the end always (any order)
26
17
  if (isEmptyValue(aValue.toString()) && isEmptyValue(bValue.toString())) {
@@ -41,25 +32,24 @@ function descendingComparator(a, b, orderBy, order) {
41
32
  return 0;
42
33
  }
43
34
  function isEmptyValue(value) {
44
- if (value === '' || value === null || (value === null || value === void 0 ? void 0 : value.toString().trim()) === '' || value === undefined) {
35
+ if (value === '' || value === null || value?.toString().trim() === '' || value === undefined) {
45
36
  return true;
46
37
  } else {
47
38
  return false;
48
39
  }
49
40
  }
50
41
  function descendingNumComparator(a, b, orderBy) {
51
- var _a$orderBy2, _b$orderBy2;
52
- const aNumValue = Number((_a$orderBy2 = a[orderBy]) !== null && _a$orderBy2 !== void 0 ? _a$orderBy2 : '0.0');
53
- const bNumValue = Number((_b$orderBy2 = b[orderBy]) !== null && _b$orderBy2 !== void 0 ? _b$orderBy2 : '0.0');
42
+ const aNumValue = Number(a[orderBy] ?? '0.0');
43
+ const bNumValue = Number(b[orderBy] ?? '0.0');
54
44
  if (!isNaN(aNumValue) && !isNaN(bNumValue)) {
55
45
  return bNumValue - aNumValue;
56
46
  }
57
47
  return null;
58
48
  }
59
- function getComparator(order, orderBy, sorting) {
49
+ export function getComparator(order, orderBy, sorting) {
60
50
  return (a, b) => sorting(a, b, orderBy, order);
61
51
  }
62
- function stableSort(array, comparator) {
52
+ export function stableSort(array, comparator) {
63
53
  const stabilizedThis = array.map((el, index) => [el, index]);
64
54
  stabilizedThis.sort((a, b) => {
65
55
  const order = comparator(a[0], b[0]);
@@ -1,6 +1,4 @@
1
- "use strict";
2
-
3
- var _sort = require("./sort");
1
+ import { descendingComparator } from './sort';
4
2
  const rowA = {
5
3
  string1: 'foo',
6
4
  string2: 'same',
@@ -16,22 +14,22 @@ const rowB = {
16
14
  number3: '1.1'
17
15
  };
18
16
  test('compare unequal string fields', () => {
19
- const cmp = (0, _sort.descendingComparator)(rowA, rowB, 'string1', 'desc');
17
+ const cmp = descendingComparator(rowA, rowB, 'string1', 'desc');
20
18
  expect(cmp).toEqual(-1);
21
19
  });
22
20
  test('compare equal string fields', () => {
23
- const cmp = (0, _sort.descendingComparator)(rowA, rowB, 'string2', 'desc');
21
+ const cmp = descendingComparator(rowA, rowB, 'string2', 'desc');
24
22
  expect(cmp).toEqual(0);
25
23
  });
26
24
  test('compare unequal number fields with same whole number digits', () => {
27
- const cmp = (0, _sort.descendingComparator)(rowA, rowB, 'number1', 'desc');
25
+ const cmp = descendingComparator(rowA, rowB, 'number1', 'desc');
28
26
  expect(Math.sign(cmp)).toEqual(-1);
29
27
  });
30
28
  test('compare unequal number fields with differing whole number digits', () => {
31
- const cmp = (0, _sort.descendingComparator)(rowA, rowB, 'number2', 'desc');
29
+ const cmp = descendingComparator(rowA, rowB, 'number2', 'desc');
32
30
  expect(Math.sign(cmp)).toEqual(1);
33
31
  });
34
32
  test('compare equal number fields', () => {
35
- const cmp = (0, _sort.descendingComparator)(rowA, rowB, 'number3', 'desc');
33
+ const cmp = descendingComparator(rowA, rowB, 'number3', 'desc');
36
34
  expect(Math.sign(cmp)).toEqual(0);
37
35
  });
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ declare const useBoolean: (initialValue: boolean) => [boolean, Dispatch<SetStateAction<boolean>>, () => void, () => void];
3
+ export default useBoolean;
4
+ //# sourceMappingURL=useBoolean.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBoolean.d.ts","sourceRoot":"","sources":["../../src/hooks/useBoolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAyB,MAAM,OAAO,CAAC;AAExE,QAAA,MAAM,UAAU,GAAI,cAAc,OAAO,KAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,IAAI,EAAE,MAAM,IAAI,CAY9G,CAAC;AAEF,eAAe,UAAU,CAAC"}