mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
795 B
38 lines
795 B
<script lang="ts" setup> |
|
import type { Row } from '#imports' |
|
import { |
|
ReloadRowDataHookInj, |
|
ReloadViewDataHookInj, |
|
createEventHook, |
|
inject, |
|
provide, |
|
toRef, |
|
useProvideSmartsheetRowStore, |
|
} from '#imports' |
|
|
|
const props = defineProps<{ |
|
row: Row |
|
}>() |
|
|
|
const currentRow = toRef(props, 'row') |
|
|
|
const { isNew, state } = useProvideSmartsheetRowStore(currentRow) |
|
|
|
const reloadViewDataTrigger = inject(ReloadViewDataHookInj)! |
|
|
|
// override reload trigger and use it to reload row |
|
const reloadHook = createEventHook() |
|
|
|
reloadHook.on((params) => { |
|
if (isNew.value) return |
|
reloadViewDataTrigger?.trigger({ |
|
shouldShowLoading: (params?.shouldShowLoading as boolean) ?? false, |
|
}) |
|
}) |
|
|
|
provide(ReloadRowDataHookInj, reloadHook) |
|
</script> |
|
|
|
<template> |
|
<slot :state="state" /> |
|
</template>
|
|
|