|
|
@ -4,6 +4,7 @@ import type { ExtensionManifest, ExtensionType } from '#imports' |
|
|
|
const [useProvideExtensionHelper, useExtensionHelper] = useInjectionState( |
|
|
|
const [useProvideExtensionHelper, useExtensionHelper] = useInjectionState( |
|
|
|
(extension: Ref<ExtensionType>, extensionManifest: ComputedRef<ExtensionManifest | undefined>, activeError: Ref<any>) => { |
|
|
|
(extension: Ref<ExtensionType>, extensionManifest: ComputedRef<ExtensionManifest | undefined>, activeError: Ref<any>) => { |
|
|
|
const { $api } = useNuxtApp() |
|
|
|
const { $api } = useNuxtApp() |
|
|
|
|
|
|
|
const route = useRoute(); |
|
|
|
|
|
|
|
|
|
|
|
const basesStore = useBases() |
|
|
|
const basesStore = useBases() |
|
|
|
|
|
|
|
|
|
|
@ -27,6 +28,8 @@ const [useProvideExtensionHelper, useExtensionHelper] = useInjectionState( |
|
|
|
|
|
|
|
|
|
|
|
const fullscreenModalSize = ref<keyof typeof modalSizes>(extensionManifest.value?.config?.modalSize || 'lg') |
|
|
|
const fullscreenModalSize = ref<keyof typeof modalSizes>(extensionManifest.value?.config?.modalSize || 'lg') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const activeTableId = computed(() => route.params.viewId as string | undefined) |
|
|
|
|
|
|
|
|
|
|
|
const collapsed = computed({ |
|
|
|
const collapsed = computed({ |
|
|
|
get: () => extension.value?.meta?.collapsed ?? false, |
|
|
|
get: () => extension.value?.meta?.collapsed ?? false, |
|
|
|
set: (value) => { |
|
|
|
set: (value) => { |
|
|
@ -81,7 +84,7 @@ const [useProvideExtensionHelper, useExtensionHelper] = useInjectionState( |
|
|
|
return getMeta(tableId) |
|
|
|
return getMeta(tableId) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const insertData = async (params: { tableId: string; data: Record<string, any> }) => { |
|
|
|
const insertData = async (params: { tableId: string; data: Record<string, any>[] }) => { |
|
|
|
const { tableId, data } = params |
|
|
|
const { tableId, data } = params |
|
|
|
|
|
|
|
|
|
|
|
const chunks = [] |
|
|
|
const chunks = [] |
|
|
@ -103,7 +106,7 @@ const [useProvideExtensionHelper, useExtensionHelper] = useInjectionState( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const updateData = async (params: { tableId: string; data: Record<string, any> }) => { |
|
|
|
const updateData = async (params: { tableId: string; data: Record<string, any>[] }) => { |
|
|
|
const { tableId, data } = params |
|
|
|
const { tableId, data } = params |
|
|
|
|
|
|
|
|
|
|
|
const chunks = [] |
|
|
|
const chunks = [] |
|
|
@ -127,7 +130,7 @@ const [useProvideExtensionHelper, useExtensionHelper] = useInjectionState( |
|
|
|
|
|
|
|
|
|
|
|
const upsertData = async (params: { |
|
|
|
const upsertData = async (params: { |
|
|
|
tableId: string |
|
|
|
tableId: string |
|
|
|
data: Record<string, any> |
|
|
|
data: Record<string, any>[] |
|
|
|
upsertField: ColumnType |
|
|
|
upsertField: ColumnType |
|
|
|
importType: 'insert' | 'update' | 'insertAndUpdate' |
|
|
|
importType: 'insert' | 'update' | 'insertAndUpdate' |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
@ -221,6 +224,7 @@ const [useProvideExtensionHelper, useExtensionHelper] = useInjectionState( |
|
|
|
tables, |
|
|
|
tables, |
|
|
|
showExpandBtn, |
|
|
|
showExpandBtn, |
|
|
|
fullscreenModalSize, |
|
|
|
fullscreenModalSize, |
|
|
|
|
|
|
|
activeTableId, |
|
|
|
getViewsForTable, |
|
|
|
getViewsForTable, |
|
|
|
getData, |
|
|
|
getData, |
|
|
|
getTableMeta, |
|
|
|
getTableMeta, |
|
|
@ -229,6 +233,7 @@ const [useProvideExtensionHelper, useExtensionHelper] = useInjectionState( |
|
|
|
upsertData, |
|
|
|
upsertData, |
|
|
|
reloadData, |
|
|
|
reloadData, |
|
|
|
reloadMeta, |
|
|
|
reloadMeta, |
|
|
|
|
|
|
|
eventBus, |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
'extension-helper', |
|
|
|
'extension-helper', |
|
|
|