dabernathy89 / vue-query-builder

A UI component for building complex queries with nested conditionals.
https://dabernathy89.github.io/vue-query-builder/
MIT License
643 stars 157 forks source link

Feature: Different grouping and views #43

Closed booni3 closed 4 years ago

booni3 commented 5 years ago

First of all, this is a great package. I have been looking to make something like this for a while and this has provided an almost perfect result!

I have no idea how you would implement this, but thought I would fire over an idea.

The current implementation allows you to make any combination of groups, with and/or's in all positions. This means you can make the most complex logic you can think of and is great.

However, from user with a non-programmer wired brain, this could get quite complicated to understand and may not be required in many situations. For example, a simple rule building application.

It would be great if there was a way within the package that you could disable certain elements such as the any/all options.

Using the front app rule builder example (https://help.frontapp.com/t/182490/how-to-create-a-rule) that I think works really well to explain this. In this case, the and/or is not selectable, but the way in which you lay out blocks means that you can get a similar functionality for simple queries.

This can be done with your package by a simple fork and a a few lines of code, but this means you have then set it for the whole project. It would be great if a way to configure the allowed user interactions could be added to the package.

Additionally, one thing that does confuse me with this package is when you click the new rule or new group button, the new rule/group does not appear where you have clicked. Personally it feels much more intuitive to me when these buttons are clicked the elements appears in the same place. Again, this is just a very small edit in a fork but there is no way to do this natively within the package, which I would love to see. This point is obviously much more down to personal preference but thought I would fire it out there.

Thanks again for all your work on this. Really really loving what you have made!

dabernathy89 commented 4 years ago

@booni3 Sorry this is coming nearly a year late, but thanks for the kind words! I just added support for overriding the template, which should give you a lot of power to change things as you see fit!