mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-08 08:02:27 +00:00
add support for table selected as list inputs
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user