u
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Component, PureComponent } from 'react';
|
||||
import Autocomplete from '@mui/material/Autocomplete';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import TextInput from '../../TextInput';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import Box from '@mui/material/Box';
|
||||
import { EditablePanelTile } from 'dashgui/panels';
|
||||
@@ -86,22 +86,22 @@ class BrandEdit extends Component {
|
||||
);
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
<TextInput
|
||||
{...params}
|
||||
inputRef={inputRef}
|
||||
size="small"
|
||||
slotProps={{
|
||||
...params.slotProps,
|
||||
input: {
|
||||
...params.slotProps?.input,
|
||||
startAdornment: matchingBrand ? (
|
||||
<InputAdornment position="start" sx={{ mr: 0.5 }}>
|
||||
<BrandThumb brand={matchingBrand} size={20} />
|
||||
</InputAdornment>
|
||||
) : (
|
||||
params.slotProps?.input?.startAdornment
|
||||
),
|
||||
},
|
||||
label="Marke"
|
||||
InputProps={{
|
||||
...params.InputProps,
|
||||
startAdornment: (
|
||||
<>
|
||||
{matchingBrand ? (
|
||||
<InputAdornment position="start" sx={{ mr: 0.5 }}>
|
||||
<BrandThumb brand={matchingBrand} size={20} />
|
||||
</InputAdornment>
|
||||
) : null}
|
||||
{params.InputProps?.startAdornment}
|
||||
</>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
@@ -182,6 +182,7 @@ export default class ArticleViewBrand extends PureComponent {
|
||||
wide={1}
|
||||
minHeight={SECOND_ROW_MIN_HEIGHT}
|
||||
color="#e9d5ff"
|
||||
contentAlignItems="flex-start"
|
||||
value={value}
|
||||
onSave={this.handleSave}
|
||||
onError={notifyError}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, PureComponent } from 'react';
|
||||
import Autocomplete from '@mui/material/Autocomplete';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import TextInput from '../../TextInput';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import Box from '@mui/material/Box';
|
||||
import { EditablePanelTile } from 'dashgui/panels';
|
||||
@@ -117,18 +117,10 @@ class EansEdit extends Component {
|
||||
value={draft.eans ?? []}
|
||||
onChange={(_event, eans) => onChange({ eans })}
|
||||
renderInput={(params) => (
|
||||
<TextField
|
||||
<TextInput
|
||||
{...params}
|
||||
inputRef={inputRef}
|
||||
label="EANs (Enter zum Hinzufügen)"
|
||||
size="small"
|
||||
slotProps={{
|
||||
...params.slotProps,
|
||||
inputLabel: {
|
||||
...params.slotProps?.inputLabel,
|
||||
shrink: true,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -8,7 +8,7 @@ import MenuItem from '@mui/material/MenuItem';
|
||||
import Select from '@mui/material/Select';
|
||||
import StraightenOutlinedIcon from '@mui/icons-material/StraightenOutlined';
|
||||
import Switch from '@mui/material/Switch';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import TextInput from '../../TextInput';
|
||||
import { findUnitBySi, unitLabel } from '../../../utils/units';
|
||||
|
||||
const priceUnitCornerSx = {
|
||||
@@ -73,15 +73,13 @@ export class PriceUnitRow extends Component {
|
||||
width: '100%',
|
||||
}}
|
||||
>
|
||||
<TextField
|
||||
<TextInput
|
||||
label="Menge"
|
||||
value={unitamount}
|
||||
onChange={(event) => onChangeAmount(event.target.value)}
|
||||
size="small"
|
||||
error={amountError}
|
||||
sx={{ width: 88, flexShrink: 0 }}
|
||||
slotProps={{
|
||||
inputLabel: { shrink: true },
|
||||
htmlInput: { inputMode: 'decimal' },
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user