File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
lowcoder-design/src/components
lowcoder/src/comps/queries/queryComp Expand file tree Collapse file tree 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: {
9696 onDelete : ( item : ReactNode , index : number ) => void ;
9797 isStatic ?: boolean ;
9898 indicatorForAll ?: boolean ;
99+ allowDeletingAll ?: boolean ;
99100} ) => {
100101 return (
101102 < >
@@ -105,8 +106,8 @@ export const KeyValueList = (props: {
105106 { item }
106107 { ! props . isStatic &&
107108 < 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 }
110111 />
111112 }
112113 </ KeyValueListItem >
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ export const VariablesComp = class extends list(VariableItem) {
9898 { ( editorState : EditorState ) => (
9999 < ControlPropertyViewWrapper { ...params } >
100100 < KeyValueList
101+ allowDeletingAll
101102 list = { this . getView ( ) . map ( ( child ) => child . propertyView ( params ) ) }
102103 onAdd = { ( ) => this . add ( editorState ) }
103104 onDelete = { ( item , index ) => this . dispatch ( this . deleteAction ( index ) ) }
You can’t perform that action at this time.
0 commit comments