This commit is contained in:
seb
2026-10-16 21:04:00 +02:00
parent 23a198b0c1
commit d8c1d44652
3 changed files with 24 additions and 18 deletions

View File

@@ -76,10 +76,26 @@ export default class TextInput extends Component {
? (propReadOnly ?? slotProps?.htmlInput?.readOnly ?? inputProps?.readOnly ?? false) ? (propReadOnly ?? slotProps?.htmlInput?.readOnly ?? inputProps?.readOnly ?? false)
: (propReadOnly ?? slotProps?.htmlInput?.readOnly ?? inputProps?.readOnly ?? this.state.readOnly); : (propReadOnly ?? slotProps?.htmlInput?.readOnly ?? inputProps?.readOnly ?? this.state.readOnly);
const { inputProps: nestedFromInputProps, ...cleanInputProps } = InputProps || {};
const { inputProps: nestedFromSlotInput, ...cleanSlotInput } = slotProps?.input || {};
const rawResolvedInputProps = (InputProps || slotProps?.input) ? {
...cleanSlotInput,
...cleanInputProps,
startAdornment: (slotProps?.input?.startAdornment && InputProps?.startAdornment)
? <>{slotProps.input.startAdornment}{InputProps.startAdornment}</>
: (InputProps?.startAdornment ?? slotProps?.input?.startAdornment),
endAdornment: (slotProps?.input?.endAdornment && InputProps?.endAdornment)
? <>{InputProps.endAdornment}{slotProps.input.endAdornment}</>
: (InputProps?.endAdornment ?? slotProps?.input?.endAdornment),
} : undefined;
const htmlInput = isSelect const htmlInput = isSelect
? { ? {
readOnly: effectiveReadOnly, readOnly: effectiveReadOnly,
...slotProps?.htmlInput, ...slotProps?.htmlInput,
...nestedFromSlotInput,
...nestedFromInputProps,
...inputProps, ...inputProps,
} }
: { : {
@@ -94,20 +110,12 @@ export default class TextInput extends Component {
'data-form-type': 'other', 'data-form-type': 'other',
readOnly: effectiveReadOnly, readOnly: effectiveReadOnly,
...slotProps?.htmlInput, ...slotProps?.htmlInput,
...nestedFromSlotInput,
...nestedFromInputProps,
...inputProps, ...inputProps,
}; };
const resolvedInputProps = (InputProps || slotProps?.input) ? { const resolvedInputProps = rawResolvedInputProps;
...slotProps?.input,
...InputProps,
startAdornment: (slotProps?.input?.startAdornment && InputProps?.startAdornment)
? <>{slotProps.input.startAdornment}{InputProps.startAdornment}</>
: (InputProps?.startAdornment ?? slotProps?.input?.startAdornment),
endAdornment: (slotProps?.input?.endAdornment && InputProps?.endAdornment)
? <>{InputProps.endAdornment}{slotProps.input.endAdornment}</>
: (InputProps?.endAdornment ?? slotProps?.input?.endAdornment),
} : undefined;
const { input: _unusedInput, ...restSlotProps } = (slotProps || {}); const { input: _unusedInput, ...restSlotProps } = (slotProps || {});
const hasLabelProps = Boolean(label || InputLabelProps || slotProps?.inputLabel); const hasLabelProps = Boolean(label || InputLabelProps || slotProps?.inputLabel);

View File

@@ -460,12 +460,10 @@ export default class BookDeliveryDialog extends PureComponent {
onChange={(e) => this.handleAmountChange(line.id, e.target.value)} onChange={(e) => this.handleAmountChange(line.id, e.target.value)}
disabled={isBooking} disabled={isBooking}
slotProps={{ slotProps={{
input: { htmlInput: {
inputProps: { min: 0,
min: 0, step: 1,
step: 1, style: { textAlign: 'right', padding: '4px 8px' },
style: { textAlign: 'right', padding: '4px 8px' },
},
}, },
}} }}
sx={{ width: 90 }} sx={{ width: 90 }}

View File

@@ -357,7 +357,7 @@ class ManifestHeader extends PureComponent {
flex: { xs: '1 1 100%', sm: '2 1 200px' }, flex: { xs: '1 1 100%', sm: '2 1 200px' },
minWidth: { sm: 160 }, minWidth: { sm: 160 },
}} }}
renderInput={(params) => ( renderInput={({ inputProps: _unusedInputProps, InputProps: _unusedInputProps2, InputLabelProps: _unusedInputLabelProps, ...params }) => (
<TextField <TextField
{...params} {...params}
inputRef={this.partyInputRef} inputRef={this.partyInputRef}