@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,41 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import { DesktopDatePicker, DesktopDateTimePicker, LocalizationProvider } from '@mui/x-date-pickers';
|
|
4
|
+
import { AdapterLuxon } from '@mui/x-date-pickers/AdapterLuxon';
|
|
5
|
+
import { Settings } from 'luxon';
|
|
6
|
+
import { getDate, tz } from '../../utils/date';
|
|
7
|
+
import Icon from '../Icon/Icon';
|
|
8
|
+
import './styles.scss';
|
|
2
9
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = DatePicker;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _material = require("@mui/material");
|
|
11
|
-
var _xDatePickers = require("@mui/x-date-pickers");
|
|
12
|
-
var _AdapterLuxon = require("@mui/x-date-pickers/AdapterLuxon");
|
|
13
|
-
var _luxon = require("luxon");
|
|
14
|
-
var _date = require("../../utils/date");
|
|
15
|
-
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
16
|
-
require("./styles.scss");
|
|
17
10
|
/**
|
|
18
11
|
* TODO: remove support for JS Date in DatePickerDateType once
|
|
19
12
|
* clients have moved to only using DateTime objects in input props
|
|
20
13
|
* and callback arguments.
|
|
21
14
|
* export type DatePickerDateType = Exclude<DateType, Date> | null;
|
|
22
15
|
*/
|
|
23
|
-
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
17
|
const initializeDate = (value, timeZoneId) => {
|
|
25
18
|
if (!value) {
|
|
26
19
|
return null;
|
|
27
20
|
}
|
|
28
|
-
const date =
|
|
29
|
-
return date
|
|
21
|
+
const date = getDate(value, timeZoneId);
|
|
22
|
+
return date?.isValid ? date : null;
|
|
30
23
|
};
|
|
31
|
-
function DatePicker(props) {
|
|
32
|
-
|
|
33
|
-
const [
|
|
34
|
-
const [
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
_react.default.useEffect(() => {
|
|
24
|
+
export default function DatePicker(props) {
|
|
25
|
+
const [temporalValue, setTemporalValue] = useState(initializeDate(props.value, props.defaultTimeZone));
|
|
26
|
+
const [minDateTime, setMinDateTime] = useState(initializeDate(props.minDate, props.defaultTimeZone));
|
|
27
|
+
const [maxDateTime, setMaxDateTime] = useState(initializeDate(props.maxDate, props.defaultTimeZone));
|
|
28
|
+
const locale = props.locale ?? 'en';
|
|
29
|
+
Settings.defaultZone = tz(props.defaultTimeZone);
|
|
30
|
+
React.useEffect(() => {
|
|
39
31
|
setTemporalValue(prev => {
|
|
40
32
|
if (props.value !== prev) {
|
|
41
33
|
return initializeDate(props.value, props.defaultTimeZone);
|
|
@@ -44,107 +36,114 @@ function DatePicker(props) {
|
|
|
44
36
|
}
|
|
45
37
|
});
|
|
46
38
|
}, [props.defaultTimeZone, props.value]);
|
|
47
|
-
|
|
39
|
+
React.useEffect(() => {
|
|
48
40
|
setMinDateTime(initializeDate(props.minDate, props.defaultTimeZone));
|
|
49
41
|
}, [props.defaultTimeZone, props.minDate]);
|
|
50
|
-
|
|
42
|
+
React.useEffect(() => {
|
|
51
43
|
setMaxDateTime(initializeDate(props.maxDate, props.defaultTimeZone));
|
|
52
44
|
}, [props.defaultTimeZone, props.maxDate]);
|
|
53
45
|
|
|
54
46
|
// TODO: Localize the yyyy-mm-dd placeholder string that is shown to users when the input is
|
|
55
47
|
// empty. It appears to be generated programmatically deep in the guts of the MUI DatePicker
|
|
56
48
|
// code, and it most likely uses the browser's locale.
|
|
57
|
-
return /*#__PURE__*/
|
|
58
|
-
className:
|
|
59
|
-
sx: props.sx
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
onError: props.onError,
|
|
81
|
-
slotProps: {
|
|
82
|
-
textField: {
|
|
83
|
-
sx: {
|
|
84
|
-
'& fieldset': {
|
|
85
|
-
border: 'none'
|
|
86
|
-
},
|
|
87
|
-
'& .MuiFormHelperText-root': {
|
|
88
|
-
marginLeft: 0
|
|
49
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
50
|
+
className: `date-picker ${props.className} ${props.errorText ? 'date-picker--error' : ''}`,
|
|
51
|
+
sx: props.sx,
|
|
52
|
+
children: /*#__PURE__*/_jsxs(LocalizationProvider, {
|
|
53
|
+
dateAdapter: AdapterLuxon,
|
|
54
|
+
adapterLocale: locale,
|
|
55
|
+
children: [props.label && /*#__PURE__*/_jsx("label", {
|
|
56
|
+
htmlFor: props.id,
|
|
57
|
+
className: "textfield-label",
|
|
58
|
+
children: props.label
|
|
59
|
+
}), props.showTime ? /*#__PURE__*/_jsx(DesktopDateTimePicker, {
|
|
60
|
+
disabled: props.disabled,
|
|
61
|
+
minDate: minDateTime && minDateTime.isValid ? minDateTime : undefined,
|
|
62
|
+
maxDate: maxDateTime && maxDateTime.isValid ? maxDateTime : undefined,
|
|
63
|
+
onChange: newValue => {
|
|
64
|
+
setTemporalValue(newValue);
|
|
65
|
+
// TODO: remove onChange and make onDateChange required
|
|
66
|
+
if (props.onChange) {
|
|
67
|
+
props.onChange(newValue && newValue.isValid ? newValue.toJSDate() : null);
|
|
68
|
+
}
|
|
69
|
+
if (props.onDateChange) {
|
|
70
|
+
props.onDateChange(newValue && newValue.isValid ? newValue : undefined);
|
|
89
71
|
}
|
|
90
72
|
},
|
|
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
|
-
if (props.onDateChange) {
|
|
119
|
-
props.onDateChange(newValue && newValue.isValid ? newValue : undefined);
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
onError: props.onError,
|
|
123
|
-
slotProps: {
|
|
124
|
-
textField: {
|
|
125
|
-
sx: {
|
|
126
|
-
'& fieldset': {
|
|
127
|
-
border: 'none'
|
|
128
|
-
},
|
|
129
|
-
'& .MuiFormHelperText-root': {
|
|
130
|
-
marginLeft: 0
|
|
73
|
+
onError: props.onError,
|
|
74
|
+
slotProps: {
|
|
75
|
+
textField: {
|
|
76
|
+
sx: {
|
|
77
|
+
'& fieldset': {
|
|
78
|
+
border: 'none'
|
|
79
|
+
},
|
|
80
|
+
'& .MuiFormHelperText-root': {
|
|
81
|
+
marginLeft: 0
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
helperText: props.errorText ? /*#__PURE__*/_jsxs("div", {
|
|
85
|
+
className: "textfield-error-text-container",
|
|
86
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
87
|
+
name: "error",
|
|
88
|
+
className: "textfield-error-text--icon"
|
|
89
|
+
}), /*#__PURE__*/_jsx("label", {
|
|
90
|
+
htmlFor: props.id,
|
|
91
|
+
className: "textfield-error-text",
|
|
92
|
+
children: props.errorText
|
|
93
|
+
})]
|
|
94
|
+
}) : props.helperText,
|
|
95
|
+
id: props.id,
|
|
96
|
+
placeholder: props.placeholder,
|
|
97
|
+
autoFocus: props.autoFocus,
|
|
98
|
+
onKeyPress: props.onKeyPress
|
|
131
99
|
}
|
|
132
100
|
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
101
|
+
value: temporalValue
|
|
102
|
+
}) : /*#__PURE__*/_jsx(DesktopDatePicker, {
|
|
103
|
+
disabled: props.disabled,
|
|
104
|
+
format: "yyyy-MM-dd",
|
|
105
|
+
minDate: minDateTime && minDateTime.isValid ? minDateTime : undefined,
|
|
106
|
+
maxDate: maxDateTime && maxDateTime.isValid ? maxDateTime : undefined,
|
|
107
|
+
onChange: newValue => {
|
|
108
|
+
setTemporalValue(newValue);
|
|
109
|
+
// TODO: remove onChange and make onDateChange required
|
|
110
|
+
if (props.onChange) {
|
|
111
|
+
props.onChange(newValue && newValue.isValid ? newValue.toJSDate() : null);
|
|
112
|
+
}
|
|
113
|
+
if (props.onDateChange) {
|
|
114
|
+
props.onDateChange(newValue && newValue.isValid ? newValue : undefined);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
onError: props.onError,
|
|
118
|
+
slotProps: {
|
|
119
|
+
textField: {
|
|
120
|
+
sx: {
|
|
121
|
+
'& fieldset': {
|
|
122
|
+
border: 'none'
|
|
123
|
+
},
|
|
124
|
+
'& .MuiFormHelperText-root': {
|
|
125
|
+
marginLeft: 0
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
helperText: props.errorText ? /*#__PURE__*/_jsxs("div", {
|
|
129
|
+
className: "textfield-error-text-container",
|
|
130
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
131
|
+
name: "error",
|
|
132
|
+
className: "textfield-error-text--icon"
|
|
133
|
+
}), /*#__PURE__*/_jsx("label", {
|
|
134
|
+
htmlFor: props.id,
|
|
135
|
+
className: "textfield-error-text",
|
|
136
|
+
children: props.errorText
|
|
137
|
+
})]
|
|
138
|
+
}) : props.helperText,
|
|
139
|
+
id: props.id,
|
|
140
|
+
placeholder: props.placeholder,
|
|
141
|
+
autoFocus: props.autoFocus,
|
|
142
|
+
onKeyPress: props.onKeyPress
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
value: temporalValue
|
|
146
|
+
})]
|
|
147
|
+
})
|
|
148
|
+
});
|
|
150
149
|
}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _material = require("@mui/material");
|
|
11
|
-
var _utils = require("../../utils");
|
|
12
|
-
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
13
|
-
require("./styles.scss");
|
|
14
|
-
function DialogBox(props) {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconButton } from '@mui/material';
|
|
3
|
+
import { useDeviceInfo } from '../../utils';
|
|
4
|
+
import Icon from '../Icon/Icon';
|
|
5
|
+
import './styles.scss';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export default function DialogBox(props) {
|
|
15
8
|
const {
|
|
16
9
|
title,
|
|
17
10
|
size,
|
|
@@ -29,60 +22,77 @@ function DialogBox(props) {
|
|
|
29
22
|
const hasFooter = leftButton || rightButtons || middleButtons;
|
|
30
23
|
const {
|
|
31
24
|
isMobile
|
|
32
|
-
} =
|
|
33
|
-
return open ? /*#__PURE__*/
|
|
34
|
-
className:
|
|
25
|
+
} = useDeviceInfo();
|
|
26
|
+
return open ? /*#__PURE__*/_jsx("div", {
|
|
27
|
+
className: `dialog-box-container${skrim ? '--skrim' : ''} ${open ? 'dialog-box--opened' : 'dialog-box--closed'} ${isMobile ? 'mobile' : ''}`,
|
|
35
28
|
onClick: event => {
|
|
36
29
|
if (event.target instanceof HTMLElement && event.target.classList.contains('dialog-box--opened')) {
|
|
37
|
-
onClose
|
|
30
|
+
onClose?.();
|
|
38
31
|
}
|
|
39
32
|
},
|
|
40
|
-
style: style
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
33
|
+
style: style,
|
|
34
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
35
|
+
className: `dialog-box dialog-box--${size}`,
|
|
36
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
37
|
+
className: "dialog-box--header",
|
|
38
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
39
|
+
className: "close-icon-spacer"
|
|
40
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
41
|
+
className: "title",
|
|
42
|
+
children: title
|
|
43
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
|
44
|
+
onClick: onClose,
|
|
45
|
+
size: "small",
|
|
46
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
47
|
+
name: "close",
|
|
48
|
+
className: "icon-close"
|
|
49
|
+
})
|
|
50
|
+
})]
|
|
51
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
52
|
+
className: (hasFooter ? 'dialog-box--body' : 'dialog-box--body-no-footer') + (scrolled ? ' scrolled' : ''),
|
|
53
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
54
|
+
className: "dialog-box--message",
|
|
55
|
+
children: message
|
|
56
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
57
|
+
className: "dialog-box--boundary",
|
|
58
|
+
children: children
|
|
59
|
+
})]
|
|
60
|
+
}), hasFooter && /*#__PURE__*/_jsxs("div", {
|
|
61
|
+
className: "dialog-box--footer",
|
|
62
|
+
children: [leftButton && /*#__PURE__*/_jsxs("div", {
|
|
63
|
+
className: "dialog-box--footer-container",
|
|
64
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
65
|
+
className: "left-button",
|
|
66
|
+
children: leftButton
|
|
67
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
68
|
+
className: "right-buttons",
|
|
69
|
+
children: rightButtons?.map((rb, index) => {
|
|
70
|
+
const rbWithKey = {
|
|
71
|
+
...rb,
|
|
72
|
+
key: `rb-${index}`,
|
|
73
|
+
props: {
|
|
74
|
+
...rb.props,
|
|
75
|
+
size: rb.props.size || 'medium'
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return rbWithKey;
|
|
79
|
+
})
|
|
80
|
+
})]
|
|
81
|
+
}), middleButtons && /*#__PURE__*/_jsx("div", {
|
|
82
|
+
className: "dialog-box--actions-container",
|
|
83
|
+
children: middleButtons?.map((mb, index) => {
|
|
84
|
+
const mbWithKey = {
|
|
85
|
+
...mb,
|
|
86
|
+
key: `mb-${index}`,
|
|
87
|
+
props: {
|
|
88
|
+
...mb.props,
|
|
89
|
+
size: mb.props.size || 'medium'
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
return mbWithKey;
|
|
93
|
+
})
|
|
94
|
+
})]
|
|
95
|
+
})]
|
|
96
|
+
})
|
|
97
|
+
}) : null;
|
|
88
98
|
}
|
package/components/Divisor.js
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}), /*#__PURE__*/_react.default.createElement(_material.Divider, {
|
|
17
|
-
light: true
|
|
18
|
-
}), /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
19
|
-
mt: mt
|
|
20
|
-
}));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Divider } from '@mui/material';
|
|
3
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export default function Divisor({
|
|
5
|
+
mt = 3
|
|
6
|
+
}) {
|
|
7
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
8
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
9
|
+
mt: mt
|
|
10
|
+
}), /*#__PURE__*/_jsx(Divider, {
|
|
11
|
+
light: true
|
|
12
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
13
|
+
mt: mt
|
|
14
|
+
})]
|
|
15
|
+
});
|
|
21
16
|
}
|
package/components/Dropdown.js
CHANGED
|
@@ -1,55 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const _excluded = ["selectedValue", "onChange", "options", "autocomplete"];
|
|
15
|
-
function DropdownV1(_ref) {
|
|
16
|
-
let {
|
|
17
|
-
id,
|
|
18
|
-
label,
|
|
19
|
-
values,
|
|
20
|
-
onChange,
|
|
21
|
-
selected,
|
|
22
|
-
disabled
|
|
23
|
-
} = _ref;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormControl, InputLabel, MenuItem, Select } from '@mui/material';
|
|
3
|
+
import Autocomplete from './Autocomplete/Autocomplete';
|
|
4
|
+
import SelectT from './Select/SelectT';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export function DropdownV1({
|
|
7
|
+
id,
|
|
8
|
+
label,
|
|
9
|
+
values,
|
|
10
|
+
onChange,
|
|
11
|
+
selected,
|
|
12
|
+
disabled
|
|
13
|
+
}) {
|
|
24
14
|
const onChangeH = event => {
|
|
25
15
|
onChange(event.target.value);
|
|
26
16
|
};
|
|
27
|
-
return /*#__PURE__*/
|
|
17
|
+
return /*#__PURE__*/_jsxs(FormControl, {
|
|
28
18
|
variant: "outlined",
|
|
29
19
|
size: "small",
|
|
30
20
|
disabled: disabled,
|
|
31
21
|
sx: {
|
|
32
22
|
width: '100%'
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
})
|
|
23
|
+
},
|
|
24
|
+
children: [/*#__PURE__*/_jsx(InputLabel, {
|
|
25
|
+
id: `${id}-outlined-label`,
|
|
26
|
+
children: label
|
|
27
|
+
}), /*#__PURE__*/_jsx(Select, {
|
|
28
|
+
labelId: `${id}-outlined-label`,
|
|
29
|
+
id: id,
|
|
30
|
+
label: label,
|
|
31
|
+
onChange: onChangeH,
|
|
32
|
+
value: selected,
|
|
33
|
+
children: values?.map(({
|
|
34
|
+
label: inLabel,
|
|
35
|
+
value
|
|
36
|
+
}) => /*#__PURE__*/_jsx(MenuItem, {
|
|
37
|
+
id: value,
|
|
38
|
+
value: value,
|
|
39
|
+
children: inLabel
|
|
40
|
+
}, value))
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
53
43
|
}
|
|
54
44
|
/**
|
|
55
45
|
* This is a simple dropdown that takes in a tuple { label, value }
|
|
@@ -63,33 +53,36 @@ function DropdownV1(_ref) {
|
|
|
63
53
|
* selectedValue={'value1'}
|
|
64
54
|
* />
|
|
65
55
|
*/
|
|
66
|
-
function Dropdown(props) {
|
|
56
|
+
export default function Dropdown(props) {
|
|
67
57
|
const {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const selectedItem = options
|
|
58
|
+
selectedValue,
|
|
59
|
+
onChange,
|
|
60
|
+
options,
|
|
61
|
+
autocomplete,
|
|
62
|
+
...remainingProps
|
|
63
|
+
} = props;
|
|
64
|
+
const selectedItem = options?.find(option => option.value === selectedValue);
|
|
75
65
|
const renderOption = option => {
|
|
76
66
|
const styles = {
|
|
77
67
|
fontWeight: option.fontWeight || 'normal',
|
|
78
68
|
fontStyle: option.fontStyle || 'normal'
|
|
79
69
|
};
|
|
80
|
-
return /*#__PURE__*/
|
|
81
|
-
style: styles
|
|
82
|
-
|
|
70
|
+
return /*#__PURE__*/_jsx("span", {
|
|
71
|
+
style: styles,
|
|
72
|
+
children: option.label
|
|
73
|
+
});
|
|
83
74
|
};
|
|
84
75
|
if (autocomplete) {
|
|
85
|
-
return /*#__PURE__*/
|
|
86
|
-
|
|
76
|
+
return /*#__PURE__*/_jsx(Autocomplete, {
|
|
77
|
+
...remainingProps,
|
|
78
|
+
options: options ?? [],
|
|
87
79
|
selected: selectedItem || '',
|
|
88
80
|
isEqual: (A, B) => A.value === B.value,
|
|
89
81
|
onChange: option => onChange(option.value)
|
|
90
|
-
})
|
|
82
|
+
});
|
|
91
83
|
}
|
|
92
|
-
return /*#__PURE__*/
|
|
84
|
+
return /*#__PURE__*/_jsx(SelectT, {
|
|
85
|
+
...remainingProps,
|
|
93
86
|
options: options,
|
|
94
87
|
selectedValue: selectedItem,
|
|
95
88
|
isEqual: (A, B) => A.value === B.value,
|
|
@@ -98,7 +91,7 @@ function Dropdown(props) {
|
|
|
98
91
|
label: str,
|
|
99
92
|
value: str
|
|
100
93
|
}),
|
|
101
|
-
displayLabel: option =>
|
|
94
|
+
displayLabel: option => option?.label || '',
|
|
102
95
|
onChange: option => onChange(option.value)
|
|
103
|
-
})
|
|
96
|
+
});
|
|
104
97
|
}
|