@terraware/web-components 4.2.12 → 4.2.14-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AntSwitch/index.js +8 -14
- package/components/Autocomplete/Autocomplete.js +67 -70
- package/components/Badge/index.js +16 -20
- package/components/BusySpinner/index.js +30 -35
- package/components/Button/Button.js +23 -27
- package/components/Button/button.test.js +8 -10
- package/components/Checkbox.js +10 -19
- package/components/Confirm/index.js +44 -51
- package/components/DatePicker/DatePicker.js +116 -117
- package/components/DialogBox/DialogBox.js +76 -66
- package/components/Divisor.js +15 -20
- package/components/Dropdown.js +54 -61
- package/components/EditableTable/index.js +129 -135
- package/components/ErrorBox/ErrorBox.js +37 -36
- package/components/FileChooser/index.js +73 -77
- package/components/FormBottomBar/index.js +63 -69
- package/components/Icon/Icon.js +14 -21
- package/components/Icon/icons/index.d.ts +1 -1
- package/components/Icon/icons/index.d.ts.map +1 -1
- package/components/Icon/icons/index.js +251 -255
- package/components/IconTooltip/index.js +29 -34
- package/components/Map/MapBox.js +199 -220
- package/components/Map/MapContainer.js +14 -18
- package/components/Map/MapDateSliderControl.js +44 -46
- package/components/Map/MapDrawer.js +32 -33
- package/components/Map/MapLegend.js +96 -95
- package/components/Map/MapViewStyleControl.js +38 -48
- package/components/Map/ReactMapboxWrapper.js +2 -9
- package/components/Map/index.js +47 -55
- package/components/Map/types.js +2 -8
- package/components/Map/useMaintainLayerOrder.js +4 -11
- package/components/Markdown/index.js +14 -21
- package/components/Message/Message.js +59 -51
- package/components/MultiSelect/MultiSelect.test.js +22 -24
- package/components/MultiSelect/index.js +73 -69
- package/components/Navbar/NavFooter.js +8 -13
- package/components/Navbar/NavItem.js +43 -37
- package/components/Navbar/NavSection.js +13 -17
- package/components/Navbar/Navbar.js +35 -38
- package/components/Navbar/SubNavbar.js +8 -13
- package/components/Note.js +14 -19
- package/components/OverlayModal/OverlayModal.js +36 -37
- package/components/PageForm/index.js +30 -35
- package/components/PhotoChooser/index.js +93 -98
- package/components/Pill/index.js +29 -31
- package/components/PillList/index.js +16 -22
- package/components/PlacementWrapper/index.js +20 -25
- package/components/PopoverMenu/Popover.js +33 -37
- package/components/PopoverMenu/index.js +41 -46
- package/components/PopoverMultiSelect/index.js +18 -21
- package/components/ProgressCircle/ProgressCircle.js +23 -26
- package/components/RadioButton.js +7 -14
- package/components/Select/Select.js +8 -13
- package/components/Select/SelectT.js +110 -108
- package/components/Separator/index.js +8 -14
- package/components/Size.js +1 -5
- package/components/Slider/index.js +7 -13
- package/components/SummaryBox.js +36 -39
- package/components/Tabs/index.js +75 -77
- package/components/TextTruncated/index.js +64 -65
- package/components/Textfield/Textfield.js +100 -95
- package/components/Textfield/TruncatedTextArea.js +44 -46
- package/components/TimelineSlider/TimelineMarker.js +24 -28
- package/components/TimelineSlider/TimelineRail.js +5 -11
- package/components/TimelineSlider/index.js +47 -51
- package/components/Tooltip/Tooltip.js +21 -26
- package/components/ViewPhotosDialog/index.js +58 -62
- package/components/VirtualWalkthrough/Annotation.d.ts +41 -0
- package/components/VirtualWalkthrough/Annotation.d.ts.map +1 -0
- package/components/VirtualWalkthrough/Annotation.js +197 -0
- package/components/VirtualWalkthrough/AnnotationEditPane.d.ts +20 -0
- package/components/VirtualWalkthrough/AnnotationEditPane.d.ts.map +1 -0
- package/components/VirtualWalkthrough/AnnotationEditPane.js +136 -0
- package/components/VirtualWalkthrough/AnnotationPanel.d.ts +13 -0
- package/components/VirtualWalkthrough/AnnotationPanel.d.ts.map +1 -0
- package/components/VirtualWalkthrough/AnnotationPanel.js +196 -0
- package/components/VirtualWalkthrough/Application.d.ts +9 -0
- package/components/VirtualWalkthrough/Application.d.ts.map +1 -0
- package/components/VirtualWalkthrough/Application.js +32 -0
- package/components/VirtualWalkthrough/AutoRotator.d.ts +109 -0
- package/components/VirtualWalkthrough/AutoRotator.d.ts.map +1 -0
- package/components/VirtualWalkthrough/AutoRotator.js +217 -0
- package/components/VirtualWalkthrough/BlockingSpinner.d.ts +3 -0
- package/components/VirtualWalkthrough/BlockingSpinner.d.ts.map +1 -0
- package/components/VirtualWalkthrough/BlockingSpinner.js +27 -0
- package/components/VirtualWalkthrough/BoundaryRing.d.ts +9 -0
- package/components/VirtualWalkthrough/BoundaryRing.d.ts.map +1 -0
- package/components/VirtualWalkthrough/BoundaryRing.js +33 -0
- package/components/VirtualWalkthrough/CameraInfo.d.ts +16 -0
- package/components/VirtualWalkthrough/CameraInfo.d.ts.map +1 -0
- package/components/VirtualWalkthrough/CameraInfo.js +88 -0
- package/components/VirtualWalkthrough/ControlsInfoPane.d.ts +37 -0
- package/components/VirtualWalkthrough/ControlsInfoPane.d.ts.map +1 -0
- package/components/VirtualWalkthrough/ControlsInfoPane.js +196 -0
- package/components/VirtualWalkthrough/GradientSky.d.ts +9 -0
- package/components/VirtualWalkthrough/GradientSky.d.ts.map +1 -0
- package/components/VirtualWalkthrough/GradientSky.js +73 -0
- package/components/VirtualWalkthrough/SplatControls.d.ts +50 -0
- package/components/VirtualWalkthrough/SplatControls.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatControls.js +252 -0
- package/components/VirtualWalkthrough/SplatCrop.d.ts +8 -0
- package/components/VirtualWalkthrough/SplatCrop.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatCrop.js +18 -0
- package/components/VirtualWalkthrough/SplatFadeCrop.d.ts +8 -0
- package/components/VirtualWalkthrough/SplatFadeCrop.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatFadeCrop.js +18 -0
- package/components/VirtualWalkthrough/SplatModel.d.ts +15 -0
- package/components/VirtualWalkthrough/SplatModel.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatModel.js +60 -0
- package/components/VirtualWalkthrough/SplatRevealRain.d.ts +18 -0
- package/components/VirtualWalkthrough/SplatRevealRain.d.ts.map +1 -0
- package/components/VirtualWalkthrough/SplatRevealRain.js +38 -0
- package/components/VirtualWalkthrough/TfAnnotationManager.d.ts +110 -0
- package/components/VirtualWalkthrough/TfAnnotationManager.d.ts.map +1 -0
- package/components/VirtualWalkthrough/TfAnnotationManager.js +368 -0
- package/components/VirtualWalkthrough/TfXrNavigation.d.ts +15 -0
- package/components/VirtualWalkthrough/TfXrNavigation.d.ts.map +1 -0
- package/components/VirtualWalkthrough/TfXrNavigation.js +24 -0
- package/components/VirtualWalkthrough/annotation-styles.css +5 -0
- package/components/VirtualWalkthrough/application-styles.css +4 -0
- package/components/VirtualWalkthrough/boundary-ring.d.ts +47 -0
- package/components/VirtualWalkthrough/boundary-ring.d.ts.map +1 -0
- package/components/VirtualWalkthrough/boundary-ring.js +125 -0
- package/components/VirtualWalkthrough/boundary-ring.test.js +109 -0
- package/components/VirtualWalkthrough/groundPlane.d.ts +14 -0
- package/components/VirtualWalkthrough/groundPlane.d.ts.map +1 -0
- package/components/VirtualWalkthrough/groundPlane.js +47 -0
- package/components/VirtualWalkthrough/groundPlane.test.js +45 -0
- package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts +19 -0
- package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts.map +1 -0
- package/components/VirtualWalkthrough/gsplat-fade-crop-effect.js +119 -0
- package/components/VirtualWalkthrough/walkthrough-camera.d.ts +77 -0
- package/components/VirtualWalkthrough/walkthrough-camera.d.ts.map +1 -0
- package/components/VirtualWalkthrough/walkthrough-camera.js +320 -0
- package/components/svg/BlobbyGrayIconImage.js +36 -41
- package/components/svg/BlobbyGrayIconImport.js +36 -41
- package/components/svg/BlobbyGrayIconUploadToTheCloud.js +36 -41
- package/components/svg/BlobbyIconCloudChecked.js +161 -158
- package/components/svg/BlobbyIconExportOrUploadPhoto.js +161 -158
- package/components/svg/BlobbyIconFolder.js +161 -158
- package/components/svg/BlobbyIconGraphReport.js +161 -158
- package/components/svg/BlobbyIconHappy.js +161 -158
- package/components/svg/BlobbyIconHeartMonitor.js +161 -158
- package/components/svg/BlobbyIconLeaf.js +161 -158
- package/components/svg/BlobbyIconLibrary.js +161 -158
- package/components/svg/BlobbyIconNursery.js +163 -160
- package/components/svg/BlobbyIconOrganization.js +161 -158
- package/components/svg/BlobbyIconParchment.js +161 -158
- package/components/svg/BlobbyIconPeople.js +161 -158
- package/components/svg/BlobbyIconSeedBank.js +161 -158
- package/components/svg/BlobbyIconSeedling.js +161 -158
- package/components/svg/BlobbyIconSeeds.js +161 -158
- package/components/svg/BlobbyIconSite.js +164 -161
- package/components/svg/BlobbyIconSparkles.js +161 -158
- package/components/svg/BlobbyIconWrench.js +161 -158
- package/components/svg/Bug.js +18 -27
- package/components/svg/Calendar.js +18 -27
- package/components/svg/CaretDown.js +18 -27
- package/components/svg/CaretLeft.js +18 -27
- package/components/svg/CaretRight.js +18 -27
- package/components/svg/CaretUp.js +18 -27
- package/components/svg/ChevronDown.js +18 -27
- package/components/svg/ChevronUp.js +18 -27
- package/components/svg/Close.js +18 -27
- package/components/svg/Critical.js +18 -27
- package/components/svg/Edit.js +161 -158
- package/components/svg/Error.js +18 -27
- package/components/svg/Filter.js +18 -27
- package/components/svg/Folder.js +18 -27
- package/components/svg/Help.js +18 -27
- package/components/svg/Home.js +18 -27
- package/components/svg/IconAdd.js +18 -27
- package/components/svg/IconArrowRight.js +19 -28
- package/components/svg/IconBusinessNetwork.js +18 -27
- package/components/svg/IconCalendar.d.ts +1 -1
- package/components/svg/IconCalendar.d.ts.map +1 -1
- package/components/svg/IconCalendar.js +18 -27
- package/components/svg/IconCancel.js +18 -27
- package/components/svg/IconChargingBattery.js +18 -27
- package/components/svg/IconChecklist.js +19 -28
- package/components/svg/IconCheckmark.js +18 -27
- package/components/svg/IconCoinInHand.js +18 -27
- package/components/svg/IconColumns.js +18 -27
- package/components/svg/IconComment.js +18 -27
- package/components/svg/IconDashboard.js +18 -27
- package/components/svg/IconDataMigration.js +18 -27
- package/components/svg/IconDocument.d.ts +8 -0
- package/components/svg/IconDocument.d.ts.map +1 -0
- package/components/svg/IconDocument.js +21 -0
- package/components/svg/IconDownloadFromTheCloud.js +19 -28
- package/components/svg/IconEdit.js +19 -28
- package/components/svg/IconExpand.js +19 -28
- package/components/svg/IconExport.js +18 -27
- package/components/svg/IconExternalLink.js +18 -27
- package/components/svg/IconEye.js +18 -27
- package/components/svg/IconEyeOff.js +18 -27
- package/components/svg/IconFile.js +18 -27
- package/components/svg/IconFolder.js +18 -27
- package/components/svg/IconFullScreen.js +18 -27
- package/components/svg/IconFutures.js +18 -27
- package/components/svg/IconGraphReport.js +18 -27
- package/components/svg/IconHeartMonitor.js +18 -27
- package/components/svg/IconHelp.js +19 -28
- package/components/svg/IconHistory.js +18 -27
- package/components/svg/IconImport.js +18 -27
- package/components/svg/IconIndex.js +18 -27
- package/components/svg/IconLayers.js +18 -27
- package/components/svg/IconLibrary.js +18 -27
- package/components/svg/IconList.js +18 -27
- package/components/svg/IconLivePlant.js +18 -27
- package/components/svg/IconLocations.js +18 -27
- package/components/svg/IconMail.js +18 -27
- package/components/svg/IconManager.js +18 -27
- package/components/svg/IconMarker.js +18 -27
- package/components/svg/IconMenu.js +18 -27
- package/components/svg/IconMenuHorizontal.js +18 -27
- package/components/svg/IconModule.js +18 -27
- package/components/svg/IconMyLocation.js +18 -27
- package/components/svg/IconNote.js +19 -28
- package/components/svg/IconNursery.js +18 -27
- package/components/svg/IconOrg.js +18 -27
- package/components/svg/IconParchment.js +18 -27
- package/components/svg/IconPhoto.js +18 -27
- package/components/svg/IconPlantsFilled.js +18 -27
- package/components/svg/IconRedo.js +18 -27
- package/components/svg/IconRestorationSite.js +18 -27
- package/components/svg/IconSeedBank.js +18 -27
- package/components/svg/IconSeedling.js +18 -27
- package/components/svg/IconSettings.js +18 -27
- package/components/svg/IconSlice.js +18 -27
- package/components/svg/IconSubmit.js +18 -27
- package/components/svg/IconSubtract.js +19 -28
- package/components/svg/IconSynced.js +18 -27
- package/components/svg/IconTrashCan.js +18 -27
- package/components/svg/IconTreasureMap.js +18 -27
- package/components/svg/IconUnavailable.js +18 -27
- package/components/svg/IconUndo.js +18 -27
- package/components/svg/IconVariable.js +18 -27
- package/components/svg/IconVideo.js +19 -28
- package/components/svg/IconWifi.js +18 -27
- package/components/svg/Info.js +18 -27
- package/components/svg/Key.js +18 -27
- package/components/svg/Leaf.js +18 -27
- package/components/svg/Lock.js +18 -27
- package/components/svg/Logo.js +40 -45
- package/components/svg/MenuVertical.js +18 -27
- package/components/svg/Notification.js +18 -27
- package/components/svg/Person.js +18 -27
- package/components/svg/Plus.js +18 -27
- package/components/svg/RestorationSite.js +18 -27
- package/components/svg/Search.js +18 -27
- package/components/svg/Seeds.js +18 -27
- package/components/svg/Site.js +18 -27
- package/components/svg/Sparkles.js +18 -27
- package/components/svg/Species.js +18 -27
- package/components/svg/Species2.js +161 -158
- package/components/svg/Spinner.js +27 -36
- package/components/svg/Star.js +18 -27
- package/components/svg/Success.js +18 -27
- package/components/svg/SuccessFilled.js +18 -27
- package/components/svg/TerrawareLogoDesktop.js +44 -49
- package/components/svg/TerrawareLogoMobile.js +20 -29
- package/components/svg/Touchscreen.js +18 -27
- package/components/svg/UploadCloud.js +161 -158
- package/components/svg/Warning.js +18 -27
- package/components/svg/WelcomeClipboard.js +130 -135
- package/components/svg/index.d.ts +1 -0
- package/components/svg/index.d.ts.map +1 -1
- package/components/svg/index.js +127 -888
- package/components/table/EnhancedTableToolbar.js +45 -47
- package/components/table/EnhancedTableToolbarV2.js +18 -26
- package/components/table/TableCellRenderer.js +137 -143
- package/components/table/TableHeader.js +45 -47
- package/components/table/TableHeaderItem.js +65 -64
- package/components/table/density.js +3 -11
- package/components/table/index.js +225 -218
- package/components/table/sort.js +8 -18
- package/components/table/sort.test.js +6 -8
- package/components/table/types.js +1 -5
- package/components/types/index.js +1 -5
- package/hooks/useBoolean.d.ts +4 -0
- package/hooks/useBoolean.d.ts.map +1 -0
- package/hooks/useBoolean.js +12 -0
- package/hooks/useCameraPosition.d.ts +8 -0
- package/hooks/useCameraPosition.d.ts.map +1 -0
- package/hooks/useCameraPosition.js +33 -0
- package/index.js +57 -398
- package/license-report.html +1 -1
- package/package.json +10 -3
- package/style-dictionary-dist/TerrawareTheme.js +1 -7
- package/theme.js +7 -14
- package/utils/color.d.ts +2 -0
- package/utils/color.d.ts.map +1 -0
- package/utils/color.js +14 -0
- package/utils/date.js +13 -24
- package/utils/date.test.js +40 -43
- package/utils/index.js +5 -53
- package/utils/preventDefaultEvent.js +1 -7
- package/utils/text.js +2 -9
- package/utils/text.test.js +9 -11
- package/utils/useDeviceInfo.js +10 -16
- package/virtualWalkthrough.d.ts +31 -0
- package/virtualWalkthrough.d.ts.map +1 -0
- package/virtualWalkthrough.js +28 -0
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _material = require("@mui/material");
|
|
10
|
-
require("./styles.scss");
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { Switch } from '@mui/material';
|
|
3
|
+
import './styles.scss';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
5
|
const AntSwitch = props => {
|
|
12
6
|
const {
|
|
13
7
|
checked,
|
|
14
8
|
disabled,
|
|
15
9
|
onChange
|
|
16
10
|
} = props;
|
|
17
|
-
const onChangeHandler =
|
|
18
|
-
onChange
|
|
11
|
+
const onChangeHandler = useCallback((event, value) => {
|
|
12
|
+
onChange?.(value);
|
|
19
13
|
}, [onChange]);
|
|
20
|
-
return /*#__PURE__*/
|
|
14
|
+
return /*#__PURE__*/_jsx(Switch, {
|
|
21
15
|
className: "ant-switch",
|
|
22
16
|
checked: checked,
|
|
23
17
|
disabled: disabled,
|
|
24
18
|
onChange: onChangeHandler
|
|
25
19
|
});
|
|
26
20
|
};
|
|
27
|
-
|
|
21
|
+
export default AntSwitch;
|
|
@@ -1,43 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _material = require("@mui/material");
|
|
10
|
-
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
11
|
-
var _IconTooltip = _interopRequireDefault(require("../IconTooltip"));
|
|
12
|
-
require("../Select/styles.scss");
|
|
13
|
-
require("./styles.scss");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Autocomplete as MUIAutocomplete, TextField } from '@mui/material';
|
|
3
|
+
import Icon from '../Icon/Icon';
|
|
4
|
+
import IconTooltip from '../IconTooltip';
|
|
5
|
+
import '../Select/styles.scss';
|
|
6
|
+
import './styles.scss';
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
8
|
const isEmpty = value => ['', undefined].includes(value);
|
|
15
|
-
function Autocomplete(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} = _ref;
|
|
9
|
+
export default function Autocomplete({
|
|
10
|
+
id,
|
|
11
|
+
label,
|
|
12
|
+
options,
|
|
13
|
+
onChange,
|
|
14
|
+
selected,
|
|
15
|
+
filterOptions,
|
|
16
|
+
freeSolo,
|
|
17
|
+
disabled,
|
|
18
|
+
className,
|
|
19
|
+
hideClearIcon,
|
|
20
|
+
isEqual,
|
|
21
|
+
placeholder,
|
|
22
|
+
errorText,
|
|
23
|
+
tooltipTitle,
|
|
24
|
+
required,
|
|
25
|
+
noOptionsText,
|
|
26
|
+
loading,
|
|
27
|
+
loadingText,
|
|
28
|
+
open,
|
|
29
|
+
onOpen,
|
|
30
|
+
onClose,
|
|
31
|
+
sx,
|
|
32
|
+
renderOption
|
|
33
|
+
}) {
|
|
41
34
|
const onChangeHandler = (event, value) => {
|
|
42
35
|
if (event) {
|
|
43
36
|
if (value) {
|
|
@@ -47,29 +40,34 @@ function Autocomplete(_ref) {
|
|
|
47
40
|
}
|
|
48
41
|
}
|
|
49
42
|
};
|
|
50
|
-
const renderInput = params => /*#__PURE__*/
|
|
51
|
-
className:
|
|
52
|
-
sx: sx
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
43
|
+
const renderInput = params => /*#__PURE__*/_jsxs(Box, {
|
|
44
|
+
className: `auto-complete ${className}`,
|
|
45
|
+
sx: sx,
|
|
46
|
+
children: [label && /*#__PURE__*/_jsxs("label", {
|
|
47
|
+
htmlFor: id,
|
|
48
|
+
className: "textfield-label",
|
|
49
|
+
children: [label, " ", required ? '*' : '', tooltipTitle && /*#__PURE__*/_jsx(IconTooltip, {
|
|
50
|
+
placement: "top",
|
|
51
|
+
title: tooltipTitle
|
|
52
|
+
})]
|
|
53
|
+
}), /*#__PURE__*/_jsx(TextField, {
|
|
54
|
+
...params,
|
|
55
|
+
variant: "outlined",
|
|
56
|
+
size: "small",
|
|
57
|
+
placeholder: placeholder,
|
|
58
|
+
className: errorText ? 'auto-complete--error' : ''
|
|
59
|
+
}), errorText && /*#__PURE__*/_jsxs("div", {
|
|
60
|
+
className: "textfield-label-container",
|
|
61
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
62
|
+
name: "error",
|
|
63
|
+
className: "textfield-error-text--icon"
|
|
64
|
+
}), /*#__PURE__*/_jsx("label", {
|
|
65
|
+
htmlFor: id,
|
|
66
|
+
className: "textfield-error-text",
|
|
67
|
+
children: errorText
|
|
68
|
+
})]
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
73
71
|
const optionalArgs = {};
|
|
74
72
|
if (hideClearIcon) {
|
|
75
73
|
optionalArgs.clearIcon = null;
|
|
@@ -79,16 +77,15 @@ function Autocomplete(_ref) {
|
|
|
79
77
|
} else {
|
|
80
78
|
optionalArgs.isOptionEqualToValue = (option, value) => option === value || isEmpty(option) && isEmpty(value);
|
|
81
79
|
}
|
|
82
|
-
return /*#__PURE__*/
|
|
80
|
+
return /*#__PURE__*/_jsx(MUIAutocomplete, {
|
|
83
81
|
disabled: disabled,
|
|
84
82
|
id: id,
|
|
85
83
|
options: options,
|
|
86
84
|
getOptionLabel: option => {
|
|
87
85
|
if (typeof option === 'object') {
|
|
88
|
-
|
|
89
|
-
return (_option$label = option.label) !== null && _option$label !== void 0 ? _option$label : '';
|
|
86
|
+
return option.label ?? '';
|
|
90
87
|
}
|
|
91
|
-
return option
|
|
88
|
+
return option ?? '';
|
|
92
89
|
},
|
|
93
90
|
onChange: onChangeHandler,
|
|
94
91
|
onInputChange: (event, value) => freeSolo && onChangeHandler(event, value),
|
|
@@ -104,7 +101,7 @@ function Autocomplete(_ref) {
|
|
|
104
101
|
open: open,
|
|
105
102
|
onOpen: onOpen,
|
|
106
103
|
onClose: onClose,
|
|
107
|
-
popupIcon: /*#__PURE__*/
|
|
104
|
+
popupIcon: /*#__PURE__*/_jsx(Icon, {
|
|
108
105
|
name: loading ? 'spinner' : open ? 'chevronUp' : 'chevronDown',
|
|
109
106
|
className: "auto-complete--icon-right",
|
|
110
107
|
size: "medium"
|
|
@@ -124,8 +121,8 @@ function Autocomplete(_ref) {
|
|
|
124
121
|
'& .MuiTouchRipple-root': {
|
|
125
122
|
display: 'none'
|
|
126
123
|
}
|
|
127
|
-
}
|
|
128
|
-
|
|
124
|
+
},
|
|
125
|
+
...optionalArgs,
|
|
129
126
|
renderOption: renderOption
|
|
130
|
-
})
|
|
127
|
+
});
|
|
131
128
|
}
|
|
@@ -1,32 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _material = require("@mui/material");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Typography, useTheme } from '@mui/material';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
4
|
const Badge = props => {
|
|
11
|
-
const theme =
|
|
5
|
+
const theme = useTheme();
|
|
12
6
|
const backgroundColor = props.backgroundColor || theme.palette.TwClrBgSecondary;
|
|
13
7
|
const borderColor = props.borderColor || theme.palette.TwClrBrdrSecondary;
|
|
14
8
|
const labelColor = props.labelColor || borderColor;
|
|
15
|
-
return /*#__PURE__*/
|
|
9
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
16
10
|
component: "span",
|
|
17
11
|
sx: {
|
|
18
12
|
backgroundColor,
|
|
19
|
-
border:
|
|
13
|
+
border: `1px solid ${borderColor}`,
|
|
20
14
|
borderRadius: theme.spacing(1),
|
|
21
15
|
display: 'inline-block',
|
|
22
16
|
padding: theme.spacing(0.5, 1),
|
|
23
17
|
width: 'fit-content'
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
},
|
|
19
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
20
|
+
color: labelColor,
|
|
21
|
+
component: "span",
|
|
22
|
+
fontSize: "14px",
|
|
23
|
+
fontWeight: 500,
|
|
24
|
+
children: props.label
|
|
25
|
+
})
|
|
26
|
+
});
|
|
31
27
|
};
|
|
32
|
-
|
|
28
|
+
export default Badge;
|
|
@@ -1,49 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function BusySpinner(_ref) {
|
|
12
|
-
let {
|
|
13
|
-
withSkrim,
|
|
14
|
-
noBackground
|
|
15
|
-
} = _ref;
|
|
16
|
-
const theme = (0, _material.useTheme)();
|
|
17
|
-
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, CircularProgress, useTheme } from '@mui/material';
|
|
3
|
+
import hexRgb from 'hex-rgb';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export default function BusySpinner({
|
|
6
|
+
withSkrim,
|
|
7
|
+
noBackground
|
|
8
|
+
}) {
|
|
9
|
+
const theme = useTheme();
|
|
10
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
18
11
|
sx: {
|
|
19
12
|
position: 'fixed',
|
|
20
13
|
left: 0,
|
|
21
14
|
right: 0,
|
|
22
15
|
top: 0,
|
|
23
16
|
bottom: 0,
|
|
24
|
-
backgroundColor: withSkrim ?
|
|
17
|
+
backgroundColor: withSkrim ? `${hexRgb(`${theme.palette.TwClrBaseGray025}`, {
|
|
25
18
|
alpha: 0.6,
|
|
26
19
|
format: 'css'
|
|
27
|
-
})
|
|
20
|
+
})}` : 'none',
|
|
28
21
|
zIndex: 2000,
|
|
29
|
-
backgroundImage: noBackground ? 'none' : 'linear-gradient(180deg,' +
|
|
22
|
+
backgroundImage: noBackground ? 'none' : 'linear-gradient(180deg,' + `${hexRgb(`${theme.palette.TwClrBaseGreen050}`, {
|
|
30
23
|
alpha: 0,
|
|
31
24
|
format: 'css'
|
|
32
|
-
})
|
|
25
|
+
})} 0%,` + `${hexRgb(`${theme.palette.TwClrBaseGreen050}`, {
|
|
33
26
|
alpha: 0.24,
|
|
34
27
|
format: 'css'
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
28
|
+
})} 100%)`
|
|
29
|
+
},
|
|
30
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
31
|
+
display: "flex",
|
|
32
|
+
justifyContent: "center",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
padding: theme.spacing(5),
|
|
35
|
+
flexDirection: "column",
|
|
36
|
+
height: "100%",
|
|
37
|
+
children: /*#__PURE__*/_jsx(CircularProgress, {
|
|
38
|
+
sx: {
|
|
39
|
+
color: theme.palette.TwClrIcnBrand
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
});
|
|
49
44
|
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = Button;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _material = require("@mui/material");
|
|
10
|
-
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
11
|
-
require("./styles.scss");
|
|
12
|
-
function Button(props) {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonBase } from '@mui/material';
|
|
3
|
+
import Icon from '../Icon/Icon';
|
|
4
|
+
import './styles.scss';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export default function Button(props) {
|
|
13
7
|
const {
|
|
14
8
|
onClick,
|
|
15
9
|
label,
|
|
@@ -25,27 +19,29 @@ function Button(props) {
|
|
|
25
19
|
style,
|
|
26
20
|
sx
|
|
27
21
|
} = props;
|
|
28
|
-
return /*#__PURE__*/
|
|
22
|
+
return /*#__PURE__*/_jsxs(ButtonBase, {
|
|
29
23
|
id: id,
|
|
30
24
|
onClick: onClick,
|
|
31
|
-
className:
|
|
25
|
+
className: `button ${type}-${priority} button--${size} ${type}-${priority}--${size} ${icon && !processing ? 'button-with-icon' : ''} ${rightIcon && !processing ? 'button-with-right-icon' : ''}
|
|
26
|
+
${!label ? 'button-no-label' : ''} ${className ?? ''}`,
|
|
32
27
|
disabled: disabled,
|
|
33
28
|
style: style,
|
|
34
29
|
sx: [{
|
|
35
30
|
'& path': {
|
|
36
31
|
fill: 'currentColor'
|
|
37
32
|
}
|
|
38
|
-
}, ...(Array.isArray(sx) ? sx : [sx])]
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
33
|
+
}, ...(Array.isArray(sx) ? sx : [sx])],
|
|
34
|
+
children: [processing && /*#__PURE__*/_jsx(Icon, {
|
|
35
|
+
name: "spinner",
|
|
36
|
+
size: size,
|
|
37
|
+
className: "icon-spinner"
|
|
38
|
+
}), !processing && icon && /*#__PURE__*/_jsx(Icon, {
|
|
39
|
+
name: icon,
|
|
40
|
+
size: size
|
|
41
|
+
}), !processing && !!label && label, !processing && rightIcon && /*#__PURE__*/_jsx(Icon, {
|
|
42
|
+
name: rightIcon,
|
|
43
|
+
size: size,
|
|
44
|
+
className: "icon-right"
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
51
47
|
}
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _react2 = require("@testing-library/react");
|
|
6
|
-
var _Button = _interopRequireDefault(require("./Button"));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
3
|
+
import Button from './Button';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
5
|
test('calls onClick prop when clicked', () => {
|
|
8
6
|
const handleClick = jest.fn();
|
|
9
|
-
|
|
7
|
+
render(/*#__PURE__*/_jsx(Button, {
|
|
10
8
|
onClick: handleClick,
|
|
11
9
|
label: "Click me"
|
|
12
10
|
}));
|
|
13
|
-
|
|
11
|
+
fireEvent.click(screen.getByText(/click me/i));
|
|
14
12
|
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
15
13
|
});
|
|
16
14
|
test('should not call onClick prop when button is disabled', () => {
|
|
17
15
|
const handleClick = jest.fn();
|
|
18
|
-
|
|
16
|
+
render(/*#__PURE__*/_jsx(Button, {
|
|
19
17
|
onClick: handleClick,
|
|
20
18
|
label: "Click me",
|
|
21
19
|
disabled: true
|
|
22
20
|
}));
|
|
23
|
-
|
|
21
|
+
fireEvent.click(screen.getByText(/click me/i));
|
|
24
22
|
expect(handleClick).toHaveBeenCalledTimes(0);
|
|
25
23
|
});
|
package/components/Checkbox.js
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.CheckboxStyle = void 0;
|
|
8
|
-
exports.default = Checkbox;
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _material = require("@mui/material");
|
|
11
|
-
const CheckboxStyle = theme => ({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormControlLabel, Checkbox as MUICheckbox, useTheme } from '@mui/material';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export const CheckboxStyle = theme => ({
|
|
12
5
|
padding: theme.spacing(0, 1, 0, 0),
|
|
13
6
|
'& .MuiSvgIcon-root': {
|
|
14
7
|
fill: theme.palette.TwClrBrdrSecondary
|
|
@@ -25,16 +18,14 @@ const CheckboxStyle = theme => ({
|
|
|
25
18
|
color: theme.palette.TwClrBgSelected
|
|
26
19
|
},
|
|
27
20
|
'&:focus > .MuiSvgIcon-root': {
|
|
28
|
-
border:
|
|
21
|
+
border: `2px solid ${theme.palette.TwClrBgSelected}`
|
|
29
22
|
},
|
|
30
23
|
'&.Mui-disabled': {
|
|
31
24
|
opacity: 0.5
|
|
32
25
|
}
|
|
33
26
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var _props$value;
|
|
37
|
-
const theme = (0, _material.useTheme)();
|
|
27
|
+
export default function Checkbox(props) {
|
|
28
|
+
const theme = useTheme();
|
|
38
29
|
const onChange = (event, checked) => {
|
|
39
30
|
if (props.indeterminate) {
|
|
40
31
|
props.onChange(true);
|
|
@@ -42,17 +33,17 @@ function Checkbox(props) {
|
|
|
42
33
|
}
|
|
43
34
|
props.onChange(checked);
|
|
44
35
|
};
|
|
45
|
-
return /*#__PURE__*/
|
|
36
|
+
return /*#__PURE__*/_jsx(FormControlLabel, {
|
|
46
37
|
id: props.id,
|
|
47
38
|
onChange: onChange,
|
|
48
39
|
label: props.label,
|
|
49
40
|
disabled: props.disabled,
|
|
50
|
-
control: /*#__PURE__*/
|
|
41
|
+
control: /*#__PURE__*/_jsx(MUICheckbox, {
|
|
51
42
|
disabled: props.disabled,
|
|
52
43
|
disableRipple: true,
|
|
53
44
|
id: 'check-' + props.id,
|
|
54
45
|
indeterminate: props.indeterminate,
|
|
55
|
-
checked:
|
|
46
|
+
checked: props.value ?? false,
|
|
56
47
|
size: "medium",
|
|
57
48
|
sx: [CheckboxStyle(theme), ...(Array.isArray(props.sx) ? props.sx : [props.sx])]
|
|
58
49
|
}),
|
|
@@ -1,94 +1,87 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Typography, useTheme } from '@mui/material';
|
|
3
|
+
import Button from '../Button/Button';
|
|
4
|
+
import DialogBox from '../DialogBox/DialogBox';
|
|
2
5
|
|
|
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 = Confirm;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _material = require("@mui/material");
|
|
12
|
-
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
13
|
-
var _DialogBox = _interopRequireDefault(require("../DialogBox/DialogBox"));
|
|
14
6
|
/**
|
|
15
7
|
* A generic confirm modal built on top of DialogBox.
|
|
16
8
|
* Most properties are optional with default values.
|
|
17
9
|
* Required properties are commented as such.
|
|
18
10
|
*/
|
|
19
|
-
|
|
20
|
-
function Confirm(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const buttons = [/*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
11
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
|
+
export default function Confirm({
|
|
13
|
+
confirmButtonDisabled,
|
|
14
|
+
confirmButtonIcon,
|
|
15
|
+
confirmButtonId,
|
|
16
|
+
confirmButtonPriority,
|
|
17
|
+
confirmButtonText,
|
|
18
|
+
confirmButtonType,
|
|
19
|
+
closeButtonId,
|
|
20
|
+
closeButtonText,
|
|
21
|
+
message,
|
|
22
|
+
onClose,
|
|
23
|
+
onConfirm,
|
|
24
|
+
open,
|
|
25
|
+
size,
|
|
26
|
+
textStyle,
|
|
27
|
+
title
|
|
28
|
+
}) {
|
|
29
|
+
const theme = useTheme();
|
|
30
|
+
const middleButtons = useMemo(() => {
|
|
31
|
+
const buttons = [/*#__PURE__*/_jsx(Button, {
|
|
41
32
|
disabled: confirmButtonDisabled,
|
|
42
33
|
icon: confirmButtonIcon,
|
|
43
34
|
id: confirmButtonId || 'confirm-submit',
|
|
44
|
-
key: "button-2",
|
|
45
35
|
label: confirmButtonText,
|
|
46
36
|
onClick: onConfirm,
|
|
47
37
|
priority: confirmButtonPriority || 'primary',
|
|
48
38
|
type: confirmButtonType || 'productive'
|
|
49
|
-
})];
|
|
39
|
+
}, 'button-2')];
|
|
50
40
|
if (onClose && closeButtonText) {
|
|
51
|
-
buttons.unshift(/*#__PURE__*/
|
|
41
|
+
buttons.unshift(/*#__PURE__*/_jsx(Button, {
|
|
52
42
|
id: closeButtonId || 'confirm-close',
|
|
53
|
-
key: "button-1",
|
|
54
43
|
label: closeButtonText,
|
|
55
44
|
onClick: onClose,
|
|
56
45
|
priority: "secondary",
|
|
57
46
|
type: "passive"
|
|
58
|
-
}));
|
|
47
|
+
}, 'button-1'));
|
|
59
48
|
}
|
|
60
49
|
return buttons;
|
|
61
50
|
}, [confirmButtonDisabled, confirmButtonIcon, confirmButtonId, confirmButtonPriority, confirmButtonText, confirmButtonType, closeButtonId, closeButtonText, onClose, onConfirm]);
|
|
62
|
-
const content =
|
|
51
|
+
const content = useMemo(() => {
|
|
63
52
|
const text = (str, key) => {
|
|
64
|
-
return /*#__PURE__*/
|
|
53
|
+
return /*#__PURE__*/_jsx(Typography, {
|
|
65
54
|
color: theme.palette.TwClrTxt,
|
|
66
55
|
fontSize: "16px",
|
|
67
56
|
fontWeight: 400,
|
|
68
|
-
key: key,
|
|
69
57
|
lineHeight: "24px",
|
|
70
58
|
textAlign: "center",
|
|
71
|
-
sx:
|
|
59
|
+
sx: {
|
|
72
60
|
marginBottom: theme.spacing(1),
|
|
73
61
|
'&:last-child': {
|
|
74
62
|
marginBottom: 0
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
63
|
+
},
|
|
64
|
+
...(textStyle || {})
|
|
65
|
+
},
|
|
66
|
+
children: str
|
|
67
|
+
}, key);
|
|
78
68
|
};
|
|
79
69
|
if (typeof message === 'string') {
|
|
80
70
|
return text(message);
|
|
81
71
|
} else if (Array.isArray(message)) {
|
|
82
|
-
return /*#__PURE__*/
|
|
72
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
73
|
+
children: message.map((str, i) => text(str, `${str}_${i}`))
|
|
74
|
+
});
|
|
83
75
|
} else {
|
|
84
76
|
return message;
|
|
85
77
|
}
|
|
86
78
|
}, [message, textStyle, theme]);
|
|
87
|
-
return /*#__PURE__*/
|
|
79
|
+
return /*#__PURE__*/_jsx(DialogBox, {
|
|
88
80
|
onClose: onClose,
|
|
89
|
-
open: open
|
|
81
|
+
open: open ?? true,
|
|
90
82
|
title: title,
|
|
91
83
|
size: size || 'medium',
|
|
92
|
-
middleButtons: middleButtons
|
|
93
|
-
|
|
84
|
+
middleButtons: middleButtons,
|
|
85
|
+
children: content
|
|
86
|
+
});
|
|
94
87
|
}
|