mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-12-03 16:10:37 +00:00
* refactor: share one variable picker that reloads after a variable is created Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * style: format the trigger editors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: keep the variable picker's Edit/View button where it was Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
952 B
Svelte
36 lines
952 B
Svelte
<script lang="ts">
|
|
import type ItemPicker from './ItemPicker.svelte'
|
|
import type VariableEditor from './VariableEditor.svelte'
|
|
import VariablePicker from './VariablePicker.svelte'
|
|
|
|
interface Props {
|
|
/** The transforms being edited. A picked variable is written into `pickForField`'s. */
|
|
args?: Record<string, any>
|
|
/** Which field the open picker is picking for, set by whichever row opened it. */
|
|
pickForField?: string | undefined
|
|
workspace?: string | undefined
|
|
/** Handed back so every field's form can open them. */
|
|
itemPicker?: ItemPicker | undefined
|
|
variableEditor?: VariableEditor | undefined
|
|
}
|
|
|
|
let {
|
|
args = {},
|
|
pickForField = undefined,
|
|
workspace = undefined,
|
|
itemPicker = $bindable(),
|
|
variableEditor = $bindable()
|
|
}: Props = $props()
|
|
</script>
|
|
|
|
<VariablePicker
|
|
bind:itemPicker
|
|
bind:variableEditor
|
|
{workspace}
|
|
onPick={(path) => {
|
|
if (pickForField) {
|
|
args[pickForField].value = '$var:' + path
|
|
}
|
|
}}
|
|
/>
|