@@ -539,9 +539,22 @@ const convertOp = (op, vals, conv, config, not, meta, parentField = null) => {
539539 const parseRes = parseRule ( op , arity , vals , parentField , conv , config , meta ) ;
540540 if ( ! parseRes ) return undefined ;
541541 let { field, fieldConfig, opKey, args, having} = parseRes ;
542-
543542 let opConfig = config . operators [ opKey ] ;
544- const canRev = ! ( fieldConfig . type == "!group" ) ;
543+
544+ // Group component in array mode can show NOT checkbox, so do nothing in this case
545+ // Otherwise try to revert
546+ const showNot = fieldConfig . showNot !== undefined ? fieldConfig . showNot : config . settings . showNot ;
547+ let canRev = true ;
548+ if ( fieldConfig . type == "!group" && fieldConfig . mode == "array" && showNot )
549+ canRev = false ;
550+
551+ // Fix "some ! in"
552+ if ( fieldConfig . type == "!group" && having && Object . keys ( having ) [ 0 ] == "!" ) {
553+ not = ! not ;
554+ having = having [ "!" ] ;
555+ }
556+
557+ // Use reversed op
545558 if ( not && canRev && opConfig . reversedOp ) {
546559 not = false ;
547560 opKey = opConfig . reversedOp ;
@@ -573,7 +586,7 @@ const convertOp = (op, vals, conv, config, not, meta, parentField = null) => {
573586 }
574587 Object . assign ( res . properties , {
575588 mode : fieldConfig . mode ,
576- not : not ,
589+ not : ( canRev ? false : not ) ,
577590 operator : opKey ,
578591 } ) ;
579592 if ( fieldConfig . mode == "array" ) {
@@ -590,7 +603,7 @@ const convertOp = (op, vals, conv, config, not, meta, parentField = null) => {
590603 children1 : { } ,
591604 properties : {
592605 conjunction : defaultGroupConjunction ( config , fieldConfig ) ,
593- not : not ,
606+ not : ( canRev ? false : not ) ,
594607 mode : fieldConfig . mode ,
595608 field : field ,
596609 operator : opKey ,
0 commit comments