@@ -23,6 +23,7 @@ import {
2323import { InProgressDropdown } from "./InProgressDropdown" ;
2424import { MethodName } from "./MethodName" ;
2525import { ModelTypeDropdown } from "./ModelTypeDropdown" ;
26+ import { ModelInputDropdown } from "./ModelInputDropdown" ;
2627
2728const ApiOrMethodCell = styled ( VSCodeDataGridCell ) `
2829 display: flex;
@@ -81,21 +82,6 @@ function ModelableMethodRow(props: MethodRowProps) {
8182 . split ( "," ) ;
8283 } , [ method . methodParameters ] ) ;
8384
84- const handleInputInput = useCallback (
85- ( e : ChangeEvent < HTMLSelectElement > ) => {
86- if ( ! modeledMethod ) {
87- return ;
88- }
89-
90- const target = e . target as HTMLSelectElement ;
91-
92- onChange ( method , {
93- ...modeledMethod ,
94- input : target . value as ModeledMethod [ "input" ] ,
95- } ) ;
96- } ,
97- [ onChange , method , modeledMethod ] ,
98- ) ;
9985 const handleOutputInput = useCallback (
10086 ( e : ChangeEvent < HTMLSelectElement > ) => {
10187 if ( ! modeledMethod ) {
@@ -130,17 +116,6 @@ function ModelableMethodRow(props: MethodRowProps) {
130116 [ method ] ,
131117 ) ;
132118
133- const inputOptions = useMemo (
134- ( ) => [
135- { value : "Argument[this]" , label : "Argument[this]" } ,
136- ...argumentsList . map ( ( argument , index ) => ( {
137- value : `Argument[${ index } ]` ,
138- label : `Argument[${ index } ]: ${ argument } ` ,
139- } ) ) ,
140- ] ,
141- [ argumentsList ] ,
142- ) ;
143-
144119 const outputOptions = useMemo (
145120 ( ) => [
146121 { value : "ReturnValue" , label : "ReturnValue" } ,
@@ -153,8 +128,6 @@ function ModelableMethodRow(props: MethodRowProps) {
153128 [ argumentsList ] ,
154129 ) ;
155130
156- const showInputCell =
157- modeledMethod ?. type && [ "sink" , "summary" ] . includes ( modeledMethod ?. type ) ;
158131 const showOutputCell =
159132 modeledMethod ?. type && [ "source" , "summary" ] . includes ( modeledMethod ?. type ) ;
160133 const predicate =
@@ -205,12 +178,10 @@ function ModelableMethodRow(props: MethodRowProps) {
205178 />
206179 </ VSCodeDataGridCell >
207180 < VSCodeDataGridCell gridColumn = { 3 } >
208- < Dropdown
209- value = { modeledMethod ?. input }
210- options = { inputOptions }
211- disabled = { ! showInputCell }
212- onChange = { handleInputInput }
213- aria-label = "Input"
181+ < ModelInputDropdown
182+ method = { method }
183+ modeledMethod = { modeledMethod }
184+ onChange = { onChange }
214185 />
215186 </ VSCodeDataGridCell >
216187 < VSCodeDataGridCell gridColumn = { 4 } >
0 commit comments