This commit is contained in:
seb
2026-10-04 11:25:10 +02:00
parent dd8566eabc
commit 874d6c010f
16 changed files with 345 additions and 346 deletions

View File

@@ -11,14 +11,11 @@ import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle';
import FormControl from '@mui/material/FormControl';
import FormControlLabel from '@mui/material/FormControlLabel';
import IconButton from '@mui/material/IconButton';
import InputLabel from '@mui/material/InputLabel';
import Link from '@mui/material/Link';
import MenuItem from '@mui/material/MenuItem';
import Select from '@mui/material/Select';
import TextField from '@mui/material/TextField';
import TextInput from '../../TextInput';
import Tooltip from '@mui/material/Tooltip';
import Typography from '@mui/material/Typography';
import AddIcon from '@mui/icons-material/Add';
@@ -638,21 +635,18 @@ export default class ArticleViewLists extends PureComponent {
}
isOptionEqualToValue={(opt, val) => opt.sku === val?.sku}
renderInput={(params) => (
<TextField
<TextInput
{...params}
label="Artikel"
placeholder="Artikel suchen..."
sx={{
bgcolor: 'background.paper',
'& .MuiInputBase-input': { py: 0.5, px: 1, fontSize: '0.82rem' },
}}
/>
)}
sx={{ flex: 1, minWidth: 0 }}
/>
<TextField
size="small"
<TextInput
type="number"
label="Menge"
value={stuecklisteCount}
disabled={busy}
onChange={(e) =>
@@ -660,11 +654,13 @@ export default class ArticleViewLists extends PureComponent {
stuecklisteCount: Math.max(1, parseInt(e.target.value, 10) || 1),
})
}
inputProps={{
min: 1,
style: { padding: '4px 6px', textAlign: 'center', fontSize: '0.82rem' },
slotProps={{
htmlInput: {
min: 1,
style: { textAlign: 'center' },
},
}}
sx={{ width: 44, bgcolor: 'background.paper', flexShrink: 0 }}
sx={{ width: 72, flexShrink: 0 }}
/>
<Tooltip title="Komponente hinzufügen">
@@ -809,21 +805,17 @@ export default class ArticleViewLists extends PureComponent {
}
isOptionEqualToValue={(opt, val) => opt.sku === val?.sku}
renderInput={(params) => (
<TextField
<TextInput
{...params}
label="Artikel"
placeholder="Artikel suchen..."
sx={{
bgcolor: 'background.paper',
'& .MuiInputBase-input': { py: 0.5, px: 1, fontSize: '0.82rem' },
}}
/>
)}
sx={{ width: '100%' }}
/>
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 1 }}>
<TextField
size="small"
<TextInput
type="number"
label="Menge"
value={stuecklisteCount}
@@ -833,11 +825,13 @@ export default class ArticleViewLists extends PureComponent {
stuecklisteCount: Math.max(1, parseInt(e.target.value, 10) || 1),
})
}
inputProps={{
min: 1,
style: { padding: '4px 6px', textAlign: 'center', fontSize: '0.82rem' },
slotProps={{
htmlInput: {
min: 1,
style: { textAlign: 'center' },
},
}}
sx={{ width: 70 }}
sx={{ width: 72 }}
/>
<Box sx={{ display: 'flex', gap: 0.75 }}>
@@ -917,21 +911,18 @@ export default class ArticleViewLists extends PureComponent {
}
isOptionEqualToValue={(opt, val) => opt.sku === val?.sku}
renderInput={(params) => (
<TextField
<TextInput
{...params}
label="Option"
placeholder="Option suchen..."
sx={{
bgcolor: 'background.paper',
'& .MuiInputBase-input': { py: 0.5, px: 1, fontSize: '0.82rem' },
}}
/>
)}
sx={{ flex: 1, minWidth: 0 }}
/>
<TextField
size="small"
<TextInput
type="number"
label="Menge"
value={optionCount}
disabled={busy}
onChange={(e) =>
@@ -939,11 +930,13 @@ export default class ArticleViewLists extends PureComponent {
optionCount: Math.max(1, parseInt(e.target.value, 10) || 1),
})
}
inputProps={{
min: 1,
style: { padding: '4px 6px', textAlign: 'center', fontSize: '0.82rem' },
slotProps={{
htmlInput: {
min: 1,
style: { textAlign: 'center' },
},
}}
sx={{ width: 44, bgcolor: 'background.paper', flexShrink: 0 }}
sx={{ width: 72, flexShrink: 0 }}
/>
<Tooltip title="Option hinzufügen">
@@ -1119,21 +1112,17 @@ export default class ArticleViewLists extends PureComponent {
}
isOptionEqualToValue={(opt, val) => opt.sku === val?.sku}
renderInput={(params) => (
<TextField
<TextInput
{...params}
label="Option"
placeholder="Option suchen..."
sx={{
bgcolor: 'background.paper',
'& .MuiInputBase-input': { py: 0.5, px: 1, fontSize: '0.82rem' },
}}
/>
)}
sx={{ width: '100%' }}
/>
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 1 }}>
<TextField
size="small"
<TextInput
type="number"
label="Menge"
value={optionCount}
@@ -1143,11 +1132,13 @@ export default class ArticleViewLists extends PureComponent {
optionCount: Math.max(1, parseInt(e.target.value, 10) || 1),
})
}
inputProps={{
min: 1,
style: { padding: '4px 6px', textAlign: 'center', fontSize: '0.82rem' },
slotProps={{
htmlInput: {
min: 1,
style: { textAlign: 'center' },
},
}}
sx={{ width: 70 }}
sx={{ width: 72 }}
/>
<FormControlLabel
@@ -1231,34 +1222,27 @@ export default class ArticleViewLists extends PureComponent {
Alle vorhandenen Merkmale sind diesem Artikel bereits zugewiesen.
</Typography>
) : (
<FormControl size="small" fullWidth>
<InputLabel id="activate-attr-label" sx={{ fontSize: '0.8rem' }}>
Merkmal für Varianten
</InputLabel>
<Select
labelId="activate-attr-label"
label="Merkmal für Varianten"
value={selectedAttributeId}
size="small"
onChange={(e) => this.setState({ selectedAttributeId: e.target.value })}
sx={{ fontSize: '0.82rem', height: 32 }}
>
{attributes.map((a) => {
const isAssigned = assignedAttributeIds.has(a.id);
return (
<MenuItem
key={a.id}
value={a.id}
disabled={isAssigned}
sx={{ fontSize: '0.82rem' }}
>
{a.name}
{isAssigned ? ' (bereits zugewiesen)' : ''}
</MenuItem>
);
})}
</Select>
</FormControl>
<TextInput
select
fullWidth
label="Merkmal für Varianten"
value={selectedAttributeId}
onChange={(e) => this.setState({ selectedAttributeId: e.target.value })}
>
{attributes.map((a) => {
const isAssigned = assignedAttributeIds.has(a.id);
return (
<MenuItem
key={a.id}
value={a.id}
disabled={isAssigned}
>
{a.name}
{isAssigned ? ' (bereits zugewiesen)' : ''}
</MenuItem>
);
})}
</TextInput>
)}
<Box sx={{ display: 'flex', gap: 0.75, justifyContent: 'flex-end' }}>
@@ -1475,8 +1459,8 @@ export default class ArticleViewLists extends PureComponent {
{/* Add Child Variant Row */}
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, mt: 0.5 }}>
{isCustomChildValue || availableFatherValues.length === 0 ? (
<TextField
size="small"
<TextInput
label="Neuer Wert"
placeholder="Neuer Wert..."
value={newChildText}
disabled={busy}
@@ -1487,38 +1471,26 @@ export default class ArticleViewLists extends PureComponent {
void this.handleAddChild();
}
}}
sx={{
flex: 1,
minWidth: 0,
bgcolor: 'background.paper',
'& .MuiInputBase-input': { py: 0.5, px: 1, fontSize: '0.82rem' },
}}
sx={{ flex: 1, minWidth: 0 }}
/>
) : (
<FormControl size="small" sx={{ flex: 1, minWidth: 0 }}>
<Select
size="small"
value={selectedChildValueId}
displayEmpty
disabled={busy}
onChange={(e) => this.setState({ selectedChildValueId: e.target.value })}
sx={{
bgcolor: 'background.paper',
fontSize: '0.82rem',
height: 32,
'& .MuiSelect-select': { py: 0.5, px: 1 },
}}
>
<MenuItem value="" disabled>
<em>Variante wählen...</em>
<TextInput
select
label="Variante"
value={selectedChildValueId}
disabled={busy}
onChange={(e) => this.setState({ selectedChildValueId: e.target.value })}
sx={{ flex: 1, minWidth: 0 }}
>
<MenuItem value="" disabled>
<em>Variante wählen...</em>
</MenuItem>
{availableFatherValues.map((v) => (
<MenuItem key={v.id} value={v.id}>
{v.value}
</MenuItem>
{availableFatherValues.map((v) => (
<MenuItem key={v.id} value={v.id} sx={{ fontSize: '0.82rem' }}>
{v.value}
</MenuItem>
))}
</Select>
</FormControl>
))}
</TextInput>
)}
<Tooltip title="Variante hinzufügen">