Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb1c8799

Browse files
fixed query variables loses focus while typing
1 parent343f688 commitb1c8799

File tree

3 files changed

+46
-29
lines changed

3 files changed

+46
-29
lines changed

‎client/packages/lowcoder-design/src/components/keyValueList.tsx

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -73,34 +73,52 @@ const AddBtn = styled(TacoButton)`
7373
}
7474
`;
7575

76+
constIndicatorWrapper=({
77+
indicatorForAll,
78+
children,
79+
}:{
80+
indicatorForAll?:boolean;
81+
children:ReactNode,
82+
})=>{
83+
if(indicatorForAll){
84+
return(
85+
<BranchDiv$type={"inline"}>
86+
{children}
87+
</BranchDiv>
88+
)
89+
}
90+
return(<>{children}</>);
91+
};
92+
7693
exportconstKeyValueList=(props:{
7794
list:ReactNode[];
7895
onAdd:()=>void;
7996
onDelete:(item:ReactNode,index:number)=>void;
8097
isStatic?:boolean;
8198
indicatorForAll?:boolean;
8299
})=>{
83-
letIndicatorWrapper=({children}:any)=>(<>{children}</>);
84-
if(props.indicatorForAll)IndicatorWrapper=BranchDiv;
85-
return<>
86-
{props.list.map((item,index)=>(
87-
<IndicatorWrapper$type={"inline"}key={index}>
88-
<KeyValueListItemkey={index/* FIXME: find a proper key instead of `index` */}>
89-
{item}
90-
{!props.isStatic&&
91-
<DelIcon
92-
onClick={()=>props.list.length>1&&props.onDelete(item,index)}
93-
$forbidden={props.list.length===1}
94-
/>
95-
}
96-
</KeyValueListItem>
97-
</IndicatorWrapper>
98-
))}
99-
{!props.isStatic&&
100-
<AddBtnonClick={props.onAdd}>
101-
<AddIcon/>
102-
{trans("addItem")}
103-
</AddBtn>
104-
}
105-
</>
100+
return(
101+
<>
102+
{props.list.map((item,index)=>(
103+
<IndicatorWrapperkey={index}>
104+
<KeyValueListItemkey={index/* FIXME: find a proper key instead of `index` */}>
105+
{item}
106+
{!props.isStatic&&
107+
<DelIcon
108+
onClick={()=>props.list.length>1&&props.onDelete(item,index)}
109+
$forbidden={props.list.length===1}
110+
/>
111+
}
112+
</KeyValueListItem>
113+
</IndicatorWrapper>
114+
))}
115+
{!props.isStatic&&(
116+
<AddBtnonClick={props.onAdd}>
117+
<AddIcon/>
118+
{trans("addItem")}
119+
</AddBtn>
120+
121+
)}
122+
</>
123+
)
106124
};

‎client/packages/lowcoder/src/comps/queries/queryComp.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ export const QueryComp = withExposingConfigs(QueryCompTmp, [
664664
newNameConfig("runTime",trans("query.runTimeExportDesc")),
665665
newNameConfig("latestEndTime",trans("query.latestEndTimeExportDesc")),
666666
newDepsConfig(
667-
"variable",
667+
"variables",
668668
(children:any)=>{
669669
return{data:children.variables.children.variables.node()};
670670
},
@@ -673,8 +673,8 @@ export const QueryComp = withExposingConfigs(QueryCompTmp, [
673673
returnundefined;
674674
}
675675
constnewNode=Object.values(input.data)
676-
.filter((kvNode:any)=>kvNode.key.text.value)
677-
.map((kvNode:any)=>({[kvNode.key.text.value]:kvNode.value.text.value}))
676+
.filter((kvNode:any)=>kvNode.key.value)
677+
.map((kvNode:any)=>({[kvNode.key.value]:kvNode.value.value}))
678678
.reduce((prev,obj)=>({...prev, ...obj}),{});
679679
returnnewNode;
680680
},

‎client/packages/lowcoder/src/comps/queries/queryComp/variablesComp.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ import { keyValueListControl } from "../../controls/keyValueListControl";
33

44
exportconstVariablesComp=newMultiCompBuilder(
55
{
6-
variables:withDefault(keyValueListControl(),[{key:"",value:""}]),
6+
variables:withDefault(keyValueListControl(false,[],"string"),[{key:"",value:""}]),
77
},
8-
(props)=>
9-
props.variables
8+
(props)=>props//props.variables
109
)
1110
.setPropertyViewFn((children)=>(
1211
<>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp