@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.
- 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.js +251 -257
- 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/VirtualWalkthroughViewer.d.ts +27 -0
- package/components/VirtualWalkthrough/VirtualWalkthroughViewer.d.ts.map +1 -0
- package/components/VirtualWalkthrough/VirtualWalkthroughViewer.js +282 -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.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.js +19 -28
- 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.js +127 -895
- 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/hooks/useDevicePerformance.d.ts +9 -0
- package/hooks/useDevicePerformance.d.ts.map +1 -0
- package/hooks/useDevicePerformance.js +16 -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 +34 -0
- package/virtualWalkthrough.d.ts.map +1 -0
- package/virtualWalkthrough.js +30 -0
|
@@ -1,45 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = PageForm;
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _material = require("@mui/material");
|
|
12
|
-
var _useDeviceInfo = _interopRequireDefault(require("../../utils/useDeviceInfo"));
|
|
13
|
-
var _BusySpinner = _interopRequireDefault(require("../BusySpinner"));
|
|
14
|
-
var _FormBottomBar = _interopRequireDefault(require("../FormBottomBar"));
|
|
15
|
-
const _excluded = ["children", "className", "hideEdit", "onSave", "style"];
|
|
16
|
-
function PageForm(props) {
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Box, useTheme } from '@mui/material';
|
|
3
|
+
import useDeviceInfo from '../../utils/useDeviceInfo';
|
|
4
|
+
import BusySpinner from '../BusySpinner';
|
|
5
|
+
import FormBottomBar from '../FormBottomBar';
|
|
6
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export default function PageForm(props) {
|
|
17
8
|
const {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const theme =
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
hideEdit,
|
|
12
|
+
onSave,
|
|
13
|
+
style,
|
|
14
|
+
...bottomBarProps
|
|
15
|
+
} = props;
|
|
16
|
+
const theme = useTheme();
|
|
26
17
|
const {
|
|
27
18
|
isMobile
|
|
28
|
-
} = (
|
|
29
|
-
const [processing, setProcessing] =
|
|
19
|
+
} = useDeviceInfo();
|
|
20
|
+
const [processing, setProcessing] = useState(false);
|
|
30
21
|
const handleSave = async () => {
|
|
31
22
|
setProcessing(true);
|
|
32
23
|
// eslint-disable-next-line @typescript-eslint/await-thenable
|
|
33
24
|
await onSave(); // <-- we want all onSaves to be async
|
|
34
25
|
setProcessing(false);
|
|
35
26
|
};
|
|
36
|
-
return /*#__PURE__*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
27
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
28
|
+
children: [processing && /*#__PURE__*/_jsx(BusySpinner, {
|
|
29
|
+
withSkrim: true
|
|
30
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
31
|
+
className: className,
|
|
32
|
+
paddingBottom: hideEdit ? theme.spacing(4) : theme.spacing(isMobile ? 25 : 15),
|
|
33
|
+
style: style,
|
|
34
|
+
children: children
|
|
35
|
+
}), !hideEdit && /*#__PURE__*/_jsx(FormBottomBar, {
|
|
36
|
+
onSave: handleSave,
|
|
37
|
+
...bottomBarProps
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
45
40
|
}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
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 _ErrorBox = _interopRequireDefault(require("../ErrorBox/ErrorBox"));
|
|
14
|
-
var _FileChooser = _interopRequireDefault(require("../FileChooser"));
|
|
15
|
-
function PhotoChooser(props) {
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Box, Typography, useTheme } from '@mui/material';
|
|
3
|
+
import { useDeviceInfo } from '../../utils';
|
|
4
|
+
import Button from '../Button/Button';
|
|
5
|
+
import ErrorBox from '../ErrorBox/ErrorBox';
|
|
6
|
+
import FileChooser from '../FileChooser';
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
export default function PhotoChooser(props) {
|
|
16
9
|
const {
|
|
17
10
|
title,
|
|
18
11
|
description,
|
|
@@ -30,21 +23,20 @@ function PhotoChooser(props) {
|
|
|
30
23
|
} = props;
|
|
31
24
|
const {
|
|
32
25
|
isMobile
|
|
33
|
-
} =
|
|
34
|
-
const [files, setFiles] =
|
|
35
|
-
const [filesData, setFilesData] =
|
|
36
|
-
const divRef =
|
|
37
|
-
const theme =
|
|
26
|
+
} = useDeviceInfo();
|
|
27
|
+
const [files, setFiles] = useState([]);
|
|
28
|
+
const [filesData, setFilesData] = useState([]);
|
|
29
|
+
const divRef = useRef(null);
|
|
30
|
+
const theme = useTheme();
|
|
38
31
|
const removeFileAtIndex = index => {
|
|
39
32
|
const filesList = [...files];
|
|
40
33
|
filesList.splice(index, 1);
|
|
41
34
|
setFiles(filesList);
|
|
42
35
|
};
|
|
43
36
|
const onChoosingFiles = () => {
|
|
44
|
-
|
|
45
|
-
(_divRef$current = divRef.current) === null || _divRef$current === void 0 ? void 0 : _divRef$current.focus();
|
|
37
|
+
divRef.current?.focus();
|
|
46
38
|
};
|
|
47
|
-
|
|
39
|
+
useEffect(() => {
|
|
48
40
|
const filesDataList = files.map(file => URL.createObjectURL(file));
|
|
49
41
|
setFilesData(filesDataList);
|
|
50
42
|
onPhotosChanged(files);
|
|
@@ -53,85 +45,88 @@ function PhotoChooser(props) {
|
|
|
53
45
|
filesDataList.forEach(fileData => URL.revokeObjectURL(fileData));
|
|
54
46
|
};
|
|
55
47
|
}, [files]);
|
|
56
|
-
return /*#__PURE__*/
|
|
48
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
57
49
|
ref: divRef,
|
|
58
50
|
tabIndex: 0,
|
|
59
51
|
sx: {
|
|
60
52
|
backgroundColor: theme.palette.TwClrBg,
|
|
61
53
|
borderRadius: theme.spacing(4),
|
|
62
54
|
padding: theme.spacing(3)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
55
|
+
},
|
|
56
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
57
|
+
children: [title && /*#__PURE__*/_jsx(Typography, {
|
|
58
|
+
fontSize: 20,
|
|
59
|
+
fontWeight: 600,
|
|
60
|
+
children: title
|
|
61
|
+
}), description && /*#__PURE__*/_jsx(Typography, {
|
|
62
|
+
fontSize: 14,
|
|
63
|
+
fontWeight: 400,
|
|
64
|
+
marginTop: theme.spacing(1),
|
|
65
|
+
marginBottom: theme.spacing(2),
|
|
66
|
+
children: Array.isArray(description) ? description.map((txt, i) => /*#__PURE__*/_jsx("div", {
|
|
67
|
+
children: txt
|
|
68
|
+
}, i)) : description
|
|
69
|
+
}), error && /*#__PURE__*/_jsx(ErrorBox, {
|
|
70
|
+
title: error.title,
|
|
71
|
+
text: error.text,
|
|
72
|
+
sx: {
|
|
73
|
+
width: 'auto',
|
|
74
|
+
marginBottom: theme.spacing(2),
|
|
75
|
+
'&.mobile': {
|
|
76
|
+
width: 'auto'
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}), filesData.length > 0 && multipleSelection && /*#__PURE__*/_jsx(Box, {
|
|
80
|
+
display: "flex",
|
|
81
|
+
flexDirection: "row",
|
|
82
|
+
flexWrap: "wrap",
|
|
83
|
+
marginBottom: theme.spacing(2),
|
|
84
|
+
children: filesData.map((fileData, index) => /*#__PURE__*/_jsxs(Box, {
|
|
85
|
+
position: "relative",
|
|
86
|
+
height: 122,
|
|
87
|
+
width: 122,
|
|
88
|
+
marginRight: isMobile ? theme.spacing(2) : theme.spacing(3),
|
|
89
|
+
marginTop: theme.spacing(1),
|
|
90
|
+
border: `1px solid ${theme.palette.TwClrBrdrTertiary}`,
|
|
91
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
92
|
+
icon: "iconTrashCan",
|
|
93
|
+
onClick: () => removeFileAtIndex(index),
|
|
94
|
+
size: "small",
|
|
95
|
+
style: {
|
|
96
|
+
position: 'absolute',
|
|
97
|
+
top: -10,
|
|
98
|
+
right: -10,
|
|
99
|
+
backgroundColor: theme.palette.TwClrBgDanger
|
|
100
|
+
}
|
|
101
|
+
}), /*#__PURE__*/_jsx("img", {
|
|
102
|
+
height: "120px",
|
|
103
|
+
src: fileData,
|
|
104
|
+
alt: files[index]?.name,
|
|
105
|
+
style: {
|
|
106
|
+
margin: 'auto auto',
|
|
107
|
+
objectFit: 'contain',
|
|
108
|
+
display: 'flex',
|
|
109
|
+
maxWidth: '120px',
|
|
110
|
+
maxHeight: '120px'
|
|
111
|
+
}
|
|
112
|
+
})]
|
|
113
|
+
}, index))
|
|
114
|
+
})]
|
|
115
|
+
}), /*#__PURE__*/_jsx(FileChooser, {
|
|
116
|
+
acceptFileType: "image/jpeg,image/png",
|
|
117
|
+
chooseFileText: chooseFileText,
|
|
118
|
+
files: files,
|
|
119
|
+
fileSelectedText: photoSelectedText,
|
|
120
|
+
iconName: "blobbyGrayIconImage",
|
|
121
|
+
maxFiles: maxPhotos,
|
|
122
|
+
multipleSelection: multipleSelection,
|
|
123
|
+
onChoosingFiles: onChoosingFiles,
|
|
124
|
+
replaceFileText: replaceFileText,
|
|
125
|
+
selectedFile: selectedFile,
|
|
126
|
+
setFiles: setFiles,
|
|
127
|
+
uploadDescription: uploadDescription,
|
|
128
|
+
uploadMobileDescription: uploadMobileDescription,
|
|
129
|
+
uploadText: uploadText
|
|
130
|
+
})]
|
|
131
|
+
});
|
|
137
132
|
}
|
package/components/Pill/index.js
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = Pill;
|
|
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 Pill(props) {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconButton } from '@mui/material';
|
|
3
|
+
import Icon from '../Icon/Icon';
|
|
4
|
+
import './styles.scss';
|
|
5
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export default function Pill(props) {
|
|
13
7
|
const {
|
|
14
8
|
id,
|
|
15
9
|
label,
|
|
@@ -18,29 +12,33 @@ function Pill(props) {
|
|
|
18
12
|
onRemove,
|
|
19
13
|
className
|
|
20
14
|
} = props;
|
|
21
|
-
return /*#__PURE__*/
|
|
22
|
-
className:
|
|
15
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
16
|
+
className: `pill ${className ?? ''}`,
|
|
23
17
|
onClick: ev => {
|
|
24
18
|
ev.stopPropagation();
|
|
25
19
|
if (onClick) {
|
|
26
20
|
onClick(id);
|
|
27
21
|
}
|
|
28
|
-
}
|
|
29
|
-
}, label && /*#__PURE__*/_react.default.createElement("p", {
|
|
30
|
-
className: "label"
|
|
31
|
-
}, label, ":"), /*#__PURE__*/_react.default.createElement("p", {
|
|
32
|
-
className: "value".concat(label ? '' : ' value--no-label')
|
|
33
|
-
}, value), onRemove ? /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
34
|
-
onClick: ev => {
|
|
35
|
-
ev.stopPropagation();
|
|
36
|
-
onRemove(id);
|
|
37
22
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
23
|
+
children: [label && /*#__PURE__*/_jsxs("p", {
|
|
24
|
+
className: "label",
|
|
25
|
+
children: [label, ":"]
|
|
26
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
27
|
+
className: `value${label ? '' : ' value--no-label'}`,
|
|
28
|
+
children: value
|
|
29
|
+
}), onRemove ? /*#__PURE__*/_jsx(IconButton, {
|
|
30
|
+
onClick: ev => {
|
|
31
|
+
ev.stopPropagation();
|
|
32
|
+
onRemove(id);
|
|
33
|
+
},
|
|
34
|
+
className: "iconContainer",
|
|
35
|
+
"aria-label": "remove",
|
|
36
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
37
|
+
name: "close",
|
|
38
|
+
className: "icon"
|
|
39
|
+
})
|
|
40
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
41
|
+
className: "spacer"
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
46
44
|
}
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = PillList;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _Pill = _interopRequireDefault(require("../Pill"));
|
|
10
|
-
require("./styles.scss");
|
|
11
|
-
function PillList(props) {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Pill from '../Pill';
|
|
3
|
+
import './styles.scss';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export default function PillList(props) {
|
|
12
6
|
const {
|
|
13
7
|
data,
|
|
14
8
|
onClick,
|
|
15
9
|
onRemove,
|
|
16
10
|
className
|
|
17
11
|
} = props;
|
|
18
|
-
return /*#__PURE__*/
|
|
19
|
-
className: "pill-list"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
})
|
|
12
|
+
return /*#__PURE__*/_jsx("div", {
|
|
13
|
+
className: "pill-list",
|
|
14
|
+
children: data.map((item, index) => /*#__PURE__*/_jsx(Pill, {
|
|
15
|
+
id: item.id,
|
|
16
|
+
label: item.label,
|
|
17
|
+
value: item.value,
|
|
18
|
+
onClick: item.onClick || onClick,
|
|
19
|
+
onRemove: item.onRemove || onRemove,
|
|
20
|
+
className: item.className || className
|
|
21
|
+
}, index))
|
|
22
|
+
});
|
|
29
23
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _material = require("@mui/material");
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Box, useTheme } from '@mui/material';
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
4
|
/**
|
|
11
5
|
* A component that allows simple management of the location of an object around some children
|
|
12
6
|
*
|
|
@@ -17,14 +11,13 @@ var _material = require("@mui/material");
|
|
|
17
11
|
* </PlacementWrapper>
|
|
18
12
|
* ```
|
|
19
13
|
*/
|
|
20
|
-
const PlacementWrapper =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
const outsideDirection = (0, _react.useMemo)(() => {
|
|
14
|
+
const PlacementWrapper = ({
|
|
15
|
+
placedObject,
|
|
16
|
+
children,
|
|
17
|
+
objectPlacement
|
|
18
|
+
}) => {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
const outsideDirection = useMemo(() => {
|
|
28
21
|
if (!objectPlacement) {
|
|
29
22
|
return 'column';
|
|
30
23
|
}
|
|
@@ -38,7 +31,7 @@ const PlacementWrapper = _ref => {
|
|
|
38
31
|
return 'row-reverse';
|
|
39
32
|
}
|
|
40
33
|
}, [objectPlacement]);
|
|
41
|
-
const insideAlignment =
|
|
34
|
+
const insideAlignment = useMemo(() => {
|
|
42
35
|
if (!objectPlacement) {
|
|
43
36
|
return 'center';
|
|
44
37
|
}
|
|
@@ -50,14 +43,16 @@ const PlacementWrapper = _ref => {
|
|
|
50
43
|
return 'center';
|
|
51
44
|
}
|
|
52
45
|
}, [objectPlacement]);
|
|
53
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
54
47
|
display: 'flex',
|
|
55
48
|
flexDirection: outsideDirection,
|
|
56
49
|
flexGrow: 1,
|
|
57
|
-
marginBottom: theme.spacing(2)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
marginBottom: theme.spacing(2),
|
|
51
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
52
|
+
alignSelf: insideAlignment,
|
|
53
|
+
margin: theme.spacing(1),
|
|
54
|
+
children: placedObject
|
|
55
|
+
}), children]
|
|
56
|
+
});
|
|
62
57
|
};
|
|
63
|
-
|
|
58
|
+
export default PlacementWrapper;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = PopoverDropdown;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _material = require("@mui/material");
|
|
10
|
-
function PopoverDropdown(props) {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Divider, MenuItem, MenuList, Popover, useTheme } from '@mui/material';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export default function PopoverDropdown(props) {
|
|
11
5
|
const {
|
|
12
6
|
sections,
|
|
13
7
|
handleClick,
|
|
@@ -19,7 +13,7 @@ function PopoverDropdown(props) {
|
|
|
19
13
|
onClose,
|
|
20
14
|
container
|
|
21
15
|
} = props;
|
|
22
|
-
const theme =
|
|
16
|
+
const theme = useTheme();
|
|
23
17
|
const handleClose = () => {
|
|
24
18
|
if (onClose) {
|
|
25
19
|
onClose();
|
|
@@ -41,7 +35,7 @@ function PopoverDropdown(props) {
|
|
|
41
35
|
backgroundColor: theme.palette.TwClrBgSelectedGhostActive
|
|
42
36
|
}
|
|
43
37
|
});
|
|
44
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/_jsx(Popover, {
|
|
45
39
|
id: "simple-popover",
|
|
46
40
|
container: container,
|
|
47
41
|
open: Boolean(anchorElement),
|
|
@@ -49,40 +43,42 @@ function PopoverDropdown(props) {
|
|
|
49
43
|
onClose: handleClose,
|
|
50
44
|
anchorOrigin: {
|
|
51
45
|
vertical: 'bottom',
|
|
52
|
-
horizontal: menuAlign
|
|
46
|
+
horizontal: menuAlign ?? 'left'
|
|
53
47
|
},
|
|
54
48
|
transformOrigin: {
|
|
55
49
|
vertical: 'top',
|
|
56
|
-
horizontal: menuAlign
|
|
50
|
+
horizontal: menuAlign ?? 'left'
|
|
57
51
|
},
|
|
58
52
|
sx: {
|
|
59
53
|
'& .MuiPaper-root': {
|
|
60
54
|
borderRadius: '8px',
|
|
61
55
|
boxShadow: 'none',
|
|
62
|
-
border:
|
|
56
|
+
border: `1px solid ${theme.palette.TwClrBrdrSecondary}`,
|
|
63
57
|
paddingY: '8px',
|
|
64
58
|
marginTop: '4px'
|
|
65
59
|
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
60
|
+
},
|
|
61
|
+
children: /*#__PURE__*/_jsx(MenuList, {
|
|
62
|
+
sx: {
|
|
63
|
+
padding: 0
|
|
64
|
+
},
|
|
65
|
+
children: sections?.map((section, index) => {
|
|
66
|
+
let elements = [];
|
|
67
|
+
if (index > 0) {
|
|
68
|
+
elements.push(/*#__PURE__*/_jsx(Divider, {}));
|
|
69
|
+
}
|
|
70
|
+
elements = [...elements, ...section.map((item, itemIndex) => {
|
|
71
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
|
72
|
+
onClick: () => onClick(item),
|
|
73
|
+
sx: itemStyles(item.type),
|
|
74
|
+
disableRipple: true,
|
|
75
|
+
disabled: item.disabled,
|
|
76
|
+
selected: item.value === selectedValue,
|
|
77
|
+
children: itemRenderer ? itemRenderer(item) : item.label
|
|
78
|
+
}, `option-${itemIndex}`);
|
|
79
|
+
})];
|
|
80
|
+
return elements;
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
});
|
|
88
84
|
}
|