diff --git a/src/App.js b/src/App.js
index 7279df8..5d97f72 100644
--- a/src/App.js
+++ b/src/App.js
@@ -139,7 +139,7 @@ const MedPlanAssistant = () => {
therapeuticRange={therapeuticRange}
uiSettings={uiSettings}
onUpdatePkParams={(key, value) => updateNestedState('pkParams', key, value)}
- onUpdateTherapeuticRange={(key, value) => updateNestedState('therapeuticRange', key, { [key]: value })}
+ onUpdateTherapeuticRange={(key, value) => updateNestedState('therapeuticRange', key, value)}
onUpdateUiSetting={updateUiSetting}
onReset={handleReset}
t={t}
diff --git a/src/components/NumericInput.js b/src/components/NumericInput.js
index c3d3a4b..fcbbef8 100644
--- a/src/components/NumericInput.js
+++ b/src/components/NumericInput.js
@@ -10,11 +10,14 @@ const NumericInput = ({
unit,
align = 'right', // 'left', 'center', 'right'
allowEmpty = false, // Allow empty value (e.g., for "Auto" mode)
+ clearButton = false, // Show clear button (with allowEmpty=true)
errorMessage = 'This field is required' // Error message for mandatory empty fields
}) => {
const [hasError, setHasError] = React.useState(false);
const [showErrorTooltip, setShowErrorTooltip] = React.useState(false);
const containerRef = React.useRef(null);
+ const showClearButton = clearButton && allowEmpty;
+
// Determine decimal places based on increment
const getDecimalPlaces = () => {
const inc = String(increment || '1');
@@ -158,14 +161,14 @@ const NumericInput = ({
return (
- {unit &&
{unit}}
{hasError && showErrorTooltip && (
-
-
+
+
onUpdateUiSetting('simulationDays', val)}
@@ -43,8 +43,8 @@ const Settings = ({
/>
-
-
+
+
onUpdateUiSetting('displayedDays', val)}
@@ -56,60 +56,66 @@ const Settings = ({
/>
-
-
-
- onUpdateUiSetting('yAxisMin', val)}
- increment={'5'}
- min={0}
- placeholder={t.auto}
- allowEmpty={true}
- />
-
-
-
-
-
onUpdateUiSetting('yAxisMax', val)}
- increment={'5'}
- min={0}
- placeholder={t.auto}
- unit="ng/ml"
- allowEmpty={true}
- />
+
+
+
+
+ onUpdateUiSetting('yAxisMin', val)}
+ increment={'5'}
+ min={0}
+ placeholder={t.auto}
+ allowEmpty={true}
+ clearButton={true}
+ />
+
+
-
+
+ onUpdateUiSetting('yAxisMax', val)}
+ increment={'5'}
+ min={0}
+ placeholder={t.auto}
+ unit="ng/ml"
+ allowEmpty={true}
+ clearButton={true}
+ />
+
-
-
-
- onUpdateTherapeuticRange('min', val)}
- increment={'0.5'}
- min={0}
- placeholder={t.min}
- errorMessage={t.fieldRequired}
- />
-
-
-
-
-
onUpdateTherapeuticRange('max', val)}
- increment={'0.5'}
- min={0}
- placeholder={t.max}
- unit="ng/ml"
- errorMessage={t.fieldRequired}
- />
+
+
+
+
+ onUpdateTherapeuticRange('min', val)}
+ increment={'0.5'}
+ min={0}
+ placeholder={t.min}
+ errorMessage={t.fieldRequired}
+ />
+
+
-
+
+ onUpdateTherapeuticRange('max', val)}
+ increment={'0.5'}
+ min={0}
+ placeholder={t.max}
+ unit="ng/ml"
+ errorMessage={t.fieldRequired}
+ />
+
{t.dAmphetamineParameters}
-
+
{t.lisdexamfetamineParameters}
-
+
-
+
({
{ time: '01:00', dose: '0', label: 'night' },
],
steadyStateConfig: { daysOnMedication: '7' },
- therapeuticRange: { min: '11.5', max: '14' },
+ therapeuticRange: { min: '10.5', max: '11.5' },
doseIncrement: '2.5',
uiSettings: {
showDayTimeXAxis: true,