add support for table selected as list inputs

This commit is contained in:
Ruben Fiszel
2023-07-17 00:47:16 +02:00
parent 543f195912
commit 228286c4d9
@@ -4,6 +4,8 @@
AppViewerContext,
BaseAppComponent,
ComponentCustomCSS,
ListContext,
ListInputs,
RichConfigurations
} from '../../../types'
import type { AppInput } from '../../../inputType'
@@ -39,6 +41,9 @@
export let customCss: ComponentCustomCSS<'tablecomponent'> | undefined = undefined
export let render: boolean
const iterContext = getContext<ListContext>('ListWrapperContext')
const listInputs: ListInputs | undefined = getContext<ListInputs>('ListInputs')
type T = Record<string, any>
let result: Record<string, any>[] | undefined = undefined
@@ -87,6 +92,9 @@
selectedRowIndex = rowIndex
outputs?.selectedRow.set(row.original, force)
outputs?.selectedRowIndex.set(rowIndex, force)
if (iterContext && listInputs) {
listInputs(id, { selectedRow: row.original, selectedRowIndex: rowIndex })
}
}
}