Skip to content
Snippets Groups Projects
Commit 1148c4f1 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

feat: support deactivation of the AEditDialog save functionality

parent 7d808069
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
type="submit" type="submit"
class="btn tw-bg-aura-primary tw-text-white" class="btn tw-bg-aura-primary tw-text-white"
:form="id" :form="id"
:disabled="isSaving" :disabled="isSaving || canSave === false"
> >
<Loading v-if="isSaving" class="tw-h-1.5 tw-mr-1" /> <Loading v-if="isSaving" class="tw-h-1.5 tw-mr-1" />
{{ saveLabel ?? t('save') }} {{ saveLabel ?? t('save') }}
...@@ -33,11 +33,20 @@ import Loading from '@/components/generic/Loading.vue' ...@@ -33,11 +33,20 @@ import Loading from '@/components/generic/Loading.vue'
defineOptions({ compatConfig: { MODE: 3 } }) defineOptions({ compatConfig: { MODE: 3 } })
const props = defineProps<{ const props = withDefaults(
save?: () => Promise<unknown> defineProps<{
saveLabel?: string save?: () => unknown
cancelLabel?: string canSave?: boolean | undefined
}>() saveLabel?: string
cancelLabel?: string
}>(),
{
save: undefined,
canSave: undefined,
saveLabel: undefined,
cancelLabel: undefined,
},
)
const { t } = useI18n() const { t } = useI18n()
const id = useId('dialog-form') const id = useId('dialog-form')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment