This commit is contained in:
seb
2026-09-26 23:05:48 +02:00
parent 454c5ab6bf
commit 3ab9d904e6
12 changed files with 1505 additions and 65 deletions

View File

@@ -61,31 +61,36 @@ class EansDisplay extends Component {
class EansEdit extends Component {
render() {
const { draft, onChange, inputRef } = this.props;
const { sku, draft, onChange, inputRef } = this.props;
return (
<Autocomplete
fullWidth
multiple
freeSolo
options={[]}
value={draft.eans ?? []}
onChange={(_event, eans) => onChange({ eans })}
renderInput={(params) => (
<TextField
{...params}
inputRef={inputRef}
label="EANs (Enter zum Hinzufügen)"
size="small"
slotProps={{
...params.slotProps,
inputLabel: {
...params.slotProps?.inputLabel,
shrink: true,
},
}}
<Box sx={{ width: '100%' }}>
<PanelValue label="SKU">{sku}</PanelValue>
<Box sx={{ mt: 3 }}>
<Autocomplete
fullWidth
multiple
freeSolo
options={[]}
value={draft.eans ?? []}
onChange={(_event, eans) => onChange({ eans })}
renderInput={(params) => (
<TextField
{...params}
inputRef={inputRef}
label="EANs (Enter zum Hinzufügen)"
size="small"
slotProps={{
...params.slotProps,
inputLabel: {
...params.slotProps?.inputLabel,
shrink: true,
},
}}
/>
)}
/>
)}
/>
</Box>
</Box>
);
}
}
@@ -121,7 +126,12 @@ export default class ArticleViewEANs extends PureComponent {
canSave={eansDraftValid}
display={<EansDisplay sku={articleData.sku} eans={value.eans} />}
edit={({ draft, onChange, inputRef }) => (
<EansEdit draft={draft} onChange={onChange} inputRef={inputRef} />
<EansEdit
sku={articleData.sku}
draft={draft}
onChange={onChange}
inputRef={inputRef}
/>
)}
/>
);