@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,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _utils = require("../../utils");
|
|
13
|
-
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
14
|
-
var _IconTooltip = _interopRequireDefault(require("../IconTooltip"));
|
|
15
|
-
var _Markdown = _interopRequireDefault(require("../Markdown"));
|
|
16
|
-
var _TruncatedTextArea = _interopRequireDefault(require("./TruncatedTextArea"));
|
|
17
|
-
require("./styles.scss");
|
|
18
|
-
function TextField(props) {
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { isWhitespaces } from '../../utils';
|
|
5
|
+
import Icon from '../Icon/Icon';
|
|
6
|
+
import IconTooltip from '../IconTooltip';
|
|
7
|
+
import Markdown from '../Markdown';
|
|
8
|
+
import TruncatedTextArea from './TruncatedTextArea';
|
|
9
|
+
import './styles.scss';
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
export default function TextField(props) {
|
|
19
12
|
const {
|
|
20
13
|
autoFocus,
|
|
21
14
|
label,
|
|
@@ -49,7 +42,7 @@ function TextField(props) {
|
|
|
49
42
|
value,
|
|
50
43
|
warningText
|
|
51
44
|
} = props;
|
|
52
|
-
const textfieldClass = (
|
|
45
|
+
const textfieldClass = classNames({
|
|
53
46
|
'textfield-value': true,
|
|
54
47
|
'textfield-value--disabled': disabled,
|
|
55
48
|
'textfield-value--error': !!errorText,
|
|
@@ -58,7 +51,7 @@ function TextField(props) {
|
|
|
58
51
|
});
|
|
59
52
|
const textfieldOnChange = event => {
|
|
60
53
|
const textValue = event.target.value;
|
|
61
|
-
if (
|
|
54
|
+
if (isWhitespaces(textValue)) {
|
|
62
55
|
return;
|
|
63
56
|
}
|
|
64
57
|
if (onChange) {
|
|
@@ -70,11 +63,11 @@ function TextField(props) {
|
|
|
70
63
|
if (type === 'number' && typeof value !== 'undefined' && String(value) === '0') {
|
|
71
64
|
event.currentTarget.select();
|
|
72
65
|
}
|
|
73
|
-
onFocus
|
|
66
|
+
onFocus?.();
|
|
74
67
|
};
|
|
75
68
|
const onKeyDownHandler = e => {
|
|
76
69
|
if (disabledCharacters && disabledCharacters.includes(e.key)) {
|
|
77
|
-
e
|
|
70
|
+
e?.preventDefault();
|
|
78
71
|
return;
|
|
79
72
|
}
|
|
80
73
|
if (onKeyDown) {
|
|
@@ -85,13 +78,14 @@ function TextField(props) {
|
|
|
85
78
|
if (iconRight === 'cancel' && !value) {
|
|
86
79
|
return null;
|
|
87
80
|
}
|
|
88
|
-
return /*#__PURE__*/
|
|
81
|
+
return /*#__PURE__*/_jsx("button", {
|
|
89
82
|
onClick: onClickRightIcon,
|
|
90
|
-
className: "textfield-value--icon-container"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
83
|
+
className: "textfield-value--icon-container",
|
|
84
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
85
|
+
name: iconRight,
|
|
86
|
+
className: `textfield-value--icon-right${iconRight === 'cancel' ? '--cancel' : ''}`
|
|
87
|
+
})
|
|
88
|
+
});
|
|
95
89
|
};
|
|
96
90
|
const typeProps = {
|
|
97
91
|
type
|
|
@@ -104,80 +98,91 @@ function TextField(props) {
|
|
|
104
98
|
typeProps.max = max;
|
|
105
99
|
}
|
|
106
100
|
}
|
|
107
|
-
const displayComponent =
|
|
101
|
+
const displayComponent = useMemo(() => {
|
|
108
102
|
if (!display || value === undefined) {
|
|
109
103
|
return null;
|
|
110
104
|
}
|
|
111
|
-
const component = markdown ? /*#__PURE__*/
|
|
105
|
+
const component = markdown ? /*#__PURE__*/_jsx(Markdown, {
|
|
112
106
|
value: value.toString()
|
|
113
|
-
}) : /*#__PURE__*/
|
|
114
|
-
className:
|
|
115
|
-
|
|
107
|
+
}) : /*#__PURE__*/_jsx("p", {
|
|
108
|
+
className: `textfield-value--display${preserveNewlines ? ' preserve-newlines' : ''}`,
|
|
109
|
+
children: value
|
|
110
|
+
});
|
|
116
111
|
if (type === 'textarea' && truncateConfig) {
|
|
117
|
-
return /*#__PURE__*/
|
|
118
|
-
truncateConfig: truncateConfig
|
|
119
|
-
|
|
112
|
+
return /*#__PURE__*/_jsx(TruncatedTextArea, {
|
|
113
|
+
truncateConfig: truncateConfig,
|
|
114
|
+
children: component
|
|
115
|
+
});
|
|
120
116
|
} else {
|
|
121
117
|
return component;
|
|
122
118
|
}
|
|
123
119
|
}, [display, markdown, preserveNewlines, truncateConfig, type, value]);
|
|
124
|
-
return /*#__PURE__*/
|
|
125
|
-
className:
|
|
126
|
-
sx: sx
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
120
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
121
|
+
className: `textfield ${className}`,
|
|
122
|
+
sx: sx,
|
|
123
|
+
children: [/*#__PURE__*/_jsxs("label", {
|
|
124
|
+
htmlFor: id,
|
|
125
|
+
className: "textfield-label",
|
|
126
|
+
children: [required && label ? `${label} *` : label, tooltipTitle && /*#__PURE__*/_jsx(IconTooltip, {
|
|
127
|
+
placement: "top",
|
|
128
|
+
title: tooltipTitle
|
|
129
|
+
})]
|
|
130
|
+
}), !display && (type === 'text' || type === 'number' ? /*#__PURE__*/_jsxs("div", {
|
|
131
|
+
id: id,
|
|
132
|
+
className: textfieldClass,
|
|
133
|
+
children: [iconLeft && /*#__PURE__*/_jsx(Icon, {
|
|
134
|
+
name: iconLeft,
|
|
135
|
+
className: "textfield-value--icon-left"
|
|
136
|
+
}), /*#__PURE__*/_jsx("input", {
|
|
137
|
+
autoFocus: autoFocus,
|
|
138
|
+
value: type === 'number' ? value : value || '',
|
|
139
|
+
disabled: readonly || disabled,
|
|
140
|
+
placeholder: placeholder,
|
|
141
|
+
onChange: textfieldOnChange,
|
|
142
|
+
onBlur: onBlur,
|
|
143
|
+
onFocus: textfieldOnFocus,
|
|
144
|
+
onKeyDown: onKeyDownHandler,
|
|
145
|
+
onWheel: e => e.currentTarget.blur(),
|
|
146
|
+
required: required,
|
|
147
|
+
maxLength: maxLength,
|
|
148
|
+
...typeProps
|
|
149
|
+
}), iconRight ? renderRightIcon() : null]
|
|
150
|
+
}) : /*#__PURE__*/_jsx("textarea", {
|
|
151
|
+
autoFocus: autoFocus,
|
|
152
|
+
className: textfieldClass,
|
|
153
|
+
value: value,
|
|
154
|
+
disabled: readonly || disabled,
|
|
155
|
+
placeholder: placeholder,
|
|
156
|
+
onChange: textfieldOnChange,
|
|
157
|
+
onBlur: onBlur,
|
|
158
|
+
onFocus: textfieldOnFocus,
|
|
159
|
+
required: required,
|
|
160
|
+
maxLength: maxLength,
|
|
161
|
+
style: (styles || {}).textarea
|
|
162
|
+
})), displayComponent, errorText && /*#__PURE__*/_jsxs("div", {
|
|
163
|
+
className: "textfield-label-container",
|
|
164
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
165
|
+
name: "error",
|
|
166
|
+
className: "textfield-error-text--icon"
|
|
167
|
+
}), /*#__PURE__*/_jsx("label", {
|
|
168
|
+
htmlFor: id,
|
|
169
|
+
className: "textfield-error-text",
|
|
170
|
+
children: errorText
|
|
171
|
+
})]
|
|
172
|
+
}), warningText && /*#__PURE__*/_jsxs("div", {
|
|
173
|
+
className: "textfield-label-container",
|
|
174
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
175
|
+
name: "warning",
|
|
176
|
+
className: "textfield-warning-text--icon"
|
|
177
|
+
}), /*#__PURE__*/_jsx("label", {
|
|
178
|
+
htmlFor: id,
|
|
179
|
+
className: "textfield-warning-text",
|
|
180
|
+
children: warningText
|
|
181
|
+
})]
|
|
182
|
+
}), helperText && /*#__PURE__*/_jsx("label", {
|
|
183
|
+
htmlFor: id,
|
|
184
|
+
className: "textfield-help-text",
|
|
185
|
+
children: helperText
|
|
186
|
+
})]
|
|
187
|
+
});
|
|
183
188
|
}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _material = require("@mui/material");
|
|
12
|
-
require("./styles.scss");
|
|
13
|
-
const TruncatedTextArea = _ref => {
|
|
14
|
-
let {
|
|
15
|
-
truncateConfig,
|
|
16
|
-
children
|
|
17
|
-
} = _ref;
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Link, Typography, useTheme } from '@mui/material';
|
|
3
|
+
import './styles.scss';
|
|
4
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
const TruncatedTextArea = ({
|
|
6
|
+
truncateConfig,
|
|
7
|
+
children
|
|
8
|
+
}) => {
|
|
18
9
|
const {
|
|
19
10
|
maxHeight,
|
|
20
11
|
showLessText,
|
|
@@ -22,12 +13,12 @@ const TruncatedTextArea = _ref => {
|
|
|
22
13
|
showTextStyle,
|
|
23
14
|
alignment = 'left'
|
|
24
15
|
} = truncateConfig;
|
|
25
|
-
const theme =
|
|
26
|
-
const [showAll, setShowAll] =
|
|
27
|
-
const [needsTruncating, setNeedsTruncating] =
|
|
28
|
-
const [totalHeight, setTotalHeight] =
|
|
29
|
-
const ref =
|
|
30
|
-
|
|
16
|
+
const theme = useTheme();
|
|
17
|
+
const [showAll, setShowAll] = useState(false);
|
|
18
|
+
const [needsTruncating, setNeedsTruncating] = useState(false);
|
|
19
|
+
const [totalHeight, setTotalHeight] = useState(0);
|
|
20
|
+
const ref = useRef(null);
|
|
21
|
+
useEffect(() => {
|
|
31
22
|
if (ref && ref.current && !totalHeight) {
|
|
32
23
|
const height = ref.current.clientHeight;
|
|
33
24
|
setTotalHeight(height);
|
|
@@ -42,28 +33,35 @@ const TruncatedTextArea = _ref => {
|
|
|
42
33
|
width: '100%'
|
|
43
34
|
};
|
|
44
35
|
if (needsTruncating && !showAll) {
|
|
45
|
-
divStyle.maxHeight =
|
|
36
|
+
divStyle.maxHeight = `${maxHeight}px`;
|
|
46
37
|
}
|
|
47
|
-
return /*#__PURE__*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
38
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
39
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
40
|
+
ref: ref,
|
|
41
|
+
style: divStyle,
|
|
42
|
+
children: children
|
|
43
|
+
}), needsTruncating && /*#__PURE__*/_jsx("div", {
|
|
44
|
+
style: {
|
|
45
|
+
width: '100%',
|
|
46
|
+
textAlign: alignment
|
|
47
|
+
},
|
|
48
|
+
children: /*#__PURE__*/_jsx(Link, {
|
|
49
|
+
component: "button",
|
|
50
|
+
onClick: toggleShowAll,
|
|
51
|
+
onBlur: () => setShowAll(false),
|
|
52
|
+
sx: {
|
|
53
|
+
color: theme.palette.TwClrTxtBrand,
|
|
54
|
+
textDecorationColor: `${theme.palette.TwClrTxtBrand}80`
|
|
55
|
+
},
|
|
56
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
57
|
+
sx: {
|
|
58
|
+
...showTextStyle,
|
|
59
|
+
marginTop: '-3px'
|
|
60
|
+
},
|
|
61
|
+
children: showAll ? showLessText : showMoreText
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
68
66
|
};
|
|
69
|
-
|
|
67
|
+
export default TruncatedTextArea;
|
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
color,
|
|
13
|
-
labelBottom,
|
|
14
|
-
labelTop,
|
|
15
|
-
onClick,
|
|
16
|
-
size,
|
|
17
|
-
value
|
|
18
|
-
} = _ref;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './styles.scss';
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
const TimelineMarker = ({
|
|
5
|
+
color,
|
|
6
|
+
labelBottom,
|
|
7
|
+
labelTop,
|
|
8
|
+
onClick,
|
|
9
|
+
size,
|
|
10
|
+
value
|
|
11
|
+
}) => {
|
|
19
12
|
const clampedValue = Math.min(1, Math.max(0, value));
|
|
20
|
-
return /*#__PURE__*/
|
|
21
|
-
className:
|
|
13
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
14
|
+
className: `timeline-marker timeline-marker--${size} ${onClick ? 'timeline-marker--clickable' : ''}`,
|
|
22
15
|
style: {
|
|
23
|
-
left:
|
|
16
|
+
left: `${clampedValue * 100}%`,
|
|
24
17
|
backgroundColor: color
|
|
25
18
|
},
|
|
26
|
-
onClick: onClick
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
onClick: onClick,
|
|
20
|
+
children: [labelTop && /*#__PURE__*/_jsx("div", {
|
|
21
|
+
className: "timeline-marker__label timeline-marker__label--top",
|
|
22
|
+
children: labelTop
|
|
23
|
+
}), labelBottom && /*#__PURE__*/_jsx("div", {
|
|
24
|
+
className: "timeline-marker__label timeline-marker__label--bottom",
|
|
25
|
+
children: labelBottom
|
|
26
|
+
})]
|
|
27
|
+
});
|
|
32
28
|
};
|
|
33
|
-
|
|
29
|
+
export default TimelineMarker;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
require("./styles.scss");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './styles.scss';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
4
|
const TimelineRail = () => {
|
|
11
|
-
return /*#__PURE__*/
|
|
5
|
+
return /*#__PURE__*/_jsx("div", {
|
|
12
6
|
className: "timeline-rail"
|
|
13
7
|
});
|
|
14
8
|
};
|
|
15
|
-
|
|
9
|
+
export default TimelineRail;
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const TimelineSlider = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
labelEnd,
|
|
17
|
-
labelSelected,
|
|
18
|
-
labelStart,
|
|
19
|
-
marks
|
|
20
|
-
} = _ref;
|
|
21
|
-
const theme = (0, _material.useTheme)();
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { useTheme } from '@mui/material';
|
|
3
|
+
import TimelineMarker from './TimelineMarker';
|
|
4
|
+
import TimelineRail from './TimelineRail';
|
|
5
|
+
import './styles.scss';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const TimelineSlider = ({
|
|
8
|
+
labelEnd,
|
|
9
|
+
labelSelected,
|
|
10
|
+
labelStart,
|
|
11
|
+
marks
|
|
12
|
+
}) => {
|
|
13
|
+
const theme = useTheme();
|
|
22
14
|
const {
|
|
23
15
|
minValue,
|
|
24
16
|
maxValue
|
|
25
|
-
} =
|
|
17
|
+
} = useMemo(() => {
|
|
26
18
|
const values = marks.map(mark => mark.value);
|
|
27
19
|
if (values.length > 0) {
|
|
28
20
|
return {
|
|
@@ -37,33 +29,37 @@ const TimelineSlider = _ref => {
|
|
|
37
29
|
}
|
|
38
30
|
}, [marks]);
|
|
39
31
|
const range = maxValue - minValue;
|
|
40
|
-
return /*#__PURE__*/
|
|
41
|
-
className: 'timeline'
|
|
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
|
-
|
|
32
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
33
|
+
className: 'timeline',
|
|
34
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
35
|
+
className: 'timeline-label',
|
|
36
|
+
style: {
|
|
37
|
+
marginRight: theme.spacing(2)
|
|
38
|
+
},
|
|
39
|
+
children: labelStart
|
|
40
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
41
|
+
className: "timeline-container",
|
|
42
|
+
children: [/*#__PURE__*/_jsx(TimelineRail, {}), marks.map((mark, idx) => {
|
|
43
|
+
const normalizedValue = range === 0 ? 1 : (mark.value - minValue) / range;
|
|
44
|
+
return /*#__PURE__*/_jsx(TimelineMarker, {
|
|
45
|
+
color: mark.color,
|
|
46
|
+
labelBottom: mark.labelBottom,
|
|
47
|
+
labelTop: mark.labelTop,
|
|
48
|
+
onClick: mark.onClick,
|
|
49
|
+
size: mark.size,
|
|
50
|
+
value: normalizedValue
|
|
51
|
+
}, idx);
|
|
52
|
+
})]
|
|
53
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
54
|
+
className: 'timeline-label',
|
|
55
|
+
style: {
|
|
56
|
+
marginLeft: theme.spacing(2)
|
|
57
|
+
},
|
|
58
|
+
children: labelEnd
|
|
59
|
+
}), labelSelected && /*#__PURE__*/_jsx("div", {
|
|
60
|
+
className: 'timeline-selected-label',
|
|
61
|
+
children: labelSelected
|
|
62
|
+
})]
|
|
63
|
+
});
|
|
68
64
|
};
|
|
69
|
-
|
|
65
|
+
export default TimelineSlider;
|
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
children,
|
|
14
|
-
placement = 'top-start',
|
|
15
|
-
slotProps,
|
|
16
|
-
sx,
|
|
17
|
-
title
|
|
18
|
-
} = _ref;
|
|
19
|
-
const [open, setOpen] = _react.default.useState(false);
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip as MUITooltip, useTheme } from '@mui/material';
|
|
3
|
+
import { useDeviceInfo } from '../../utils';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export default function Tooltip({
|
|
6
|
+
children,
|
|
7
|
+
placement = 'top-start',
|
|
8
|
+
slotProps,
|
|
9
|
+
sx,
|
|
10
|
+
title
|
|
11
|
+
}) {
|
|
12
|
+
const [open, setOpen] = React.useState(false);
|
|
20
13
|
const {
|
|
21
14
|
isMobile
|
|
22
|
-
} =
|
|
23
|
-
const theme =
|
|
15
|
+
} = useDeviceInfo();
|
|
16
|
+
const theme = useTheme();
|
|
24
17
|
const handleTooltipClose = () => {
|
|
25
18
|
setOpen(false);
|
|
26
19
|
};
|
|
@@ -29,7 +22,7 @@ function Tooltip(_ref) {
|
|
|
29
22
|
setOpen(true);
|
|
30
23
|
}
|
|
31
24
|
};
|
|
32
|
-
return /*#__PURE__*/
|
|
25
|
+
return /*#__PURE__*/_jsx(MUITooltip, {
|
|
33
26
|
arrow: true,
|
|
34
27
|
onOpen: handleTooltipOpen,
|
|
35
28
|
onClose: handleTooltipClose,
|
|
@@ -50,8 +43,10 @@ function Tooltip(_ref) {
|
|
|
50
43
|
}
|
|
51
44
|
}
|
|
52
45
|
}, ...(Array.isArray(sx) ? sx : [sx])],
|
|
53
|
-
title: title
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
title: title,
|
|
47
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
48
|
+
onClick: handleTooltipOpen,
|
|
49
|
+
children: children
|
|
50
|
+
})
|
|
51
|
+
});
|
|
57
52
|
}
|