ingredient editor improvements

This commit is contained in:
vabene1111
2025-01-02 18:02:54 +01:00
parent 741c05a519
commit ac41a55d4f
3 changed files with 67 additions and 7 deletions

View File

@@ -75,7 +75,7 @@ function mergeModel() {
genericModel.merge(props.source, target.value).then(r => {
useMessageStore().addPreparedMessage(PreparedMessage.UPDATE_SUCCESS)
emit('change')
emit('change', target.value)
if (automate.value && target.value != null && Object.hasOwn(props.source, 'name') && Object.hasOwn(target.value, 'name')) {
let automation = {

View File

@@ -1,8 +1,12 @@
<template>
<!-- TODO label is not showing for some reason, for now in placeholder -->
<!-- TODO support density prop -->
<v-input :hint="props.hint" persistent-hint :label="props.label" >
<v-input :hint="props.hint" persistent-hint :label="props.label">
<template #prepend>
<slot name="prepend">
</slot>
</template>
<!-- TODO resolve-on-load false for now, race condition with model class, make prop once better solution is found -->
<Multiselect
@@ -37,6 +41,11 @@
}"
/>
<template #append>
<slot name="append">
</slot>
</template>
</v-input>
</template>
@@ -72,7 +81,7 @@ const props = defineProps({
label: {type: String, default: ''},
hint: {type: String, default: ''},
density: {type: String as PropType<''|'compact'|'comfortable'>, default: ''},
density: {type: String as PropType<'' | 'compact' | 'comfortable'>, default: ''},
searchOnLoad: {type: Boolean, default: false},
})