File tree 2 files changed +4
-2
lines changed
lowcoder/src/comps/queries/queryComp
lowcoder-design/src/components
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ export const KeyValueList = (props: {
96
96
onDelete : ( item : ReactNode , index : number ) => void ;
97
97
isStatic ?: boolean ;
98
98
indicatorForAll ?: boolean ;
99
+ allowDeletingAll ?: boolean ;
99
100
} ) => {
100
101
return (
101
102
< >
@@ -105,8 +106,8 @@ export const KeyValueList = (props: {
105
106
{ item }
106
107
{ ! props . isStatic &&
107
108
< DelIcon
108
- onClick = { ( ) => props . list . length > 1 && props . onDelete ( item , index ) }
109
- $forbidden = { props . list . length === 1 }
109
+ onClick = { ( ) => ( props . allowDeletingAll || ( ! props . allowDeletingAll && props . list . length > 1 ) ) && props . onDelete ( item , index ) }
110
+ $forbidden = { ! props . allowDeletingAll && props . list . length === 1 }
110
111
/>
111
112
}
112
113
</ KeyValueListItem >
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ export const VariablesComp = class extends list(VariableItem) {
98
98
{ ( editorState : EditorState ) => (
99
99
< ControlPropertyViewWrapper { ...params } >
100
100
< KeyValueList
101
+ allowDeletingAll
101
102
list = { this . getView ( ) . map ( ( child ) => child . propertyView ( params ) ) }
102
103
onAdd = { ( ) => this . add ( editorState ) }
103
104
onDelete = { ( item , index ) => this . dispatch ( this . deleteAction ( index ) ) }
You can’t perform that action at this time.
0 commit comments