<%# locals: (form:) %> <% condition = form.object %> <% rule = condition.rule %>
  • <%= form.hidden_field :condition_type, value: "compound" %>
    <%# Show prefix on condition groups, except the first one %>
    and

    match

    <%= form.select :operator, [["all", "and"], ["any", "or"]], { container_class: "w-fit" }, data: { rules_target: "operatorField" } %>

    of the following conditions

    <%= icon( "trash-2", as_button: true, size: "sm", data: { action: "rule--conditions#remove" } ) %>
    <%# Sub-condition template, used by Stimulus controller to add new sub-conditions dynamically %> <%= render DS::Button.new( text: "Add condition", leading_icon: "plus", variant: "ghost", type: "button", data: { action: "rule--conditions#addSubCondition" } ) %>