GithubHelp home page GithubHelp logo

rtucek / vue-query-builder Goto Github PK

View Code? Open in Web Editor NEW
98.0 98.0 34.0 4.42 MB

A Vue-Query-Builder

Home Page: https://rtucek.github.io/vue-query-builder/

License: MIT License

JavaScript 1.60% HTML 0.52% Vue 33.26% TypeScript 64.63%
drag-and-drop query-builder serialization themeable typescript vue vuex

vue-query-builder's People

Contributors

djmanuel avatar rtucek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vue-query-builder's Issues

GraphQL support?

Is there any guidance on using this query builder with GraphQL/Apollo?

Vue3 compatibility

I am facing error while using the with in my vue3 project. Could you please let me know if this is compatible with vue 3.2.

Make Delete Buttons hideable

Hi,

is there an easy way to show / hide / disable the delete buttons? It is barely possible to do achieve that with pure css.

it could be possible via config like the dragging disable toggle. for my purposes it would be totaly fineto control it globaly.

Bg

Custom labels

Thanks for component!
Please add custom lables and maxDepth in component params.

Rules with Operators

Is there currently a way to build rules with operators? I would like to have comparisons within the rule.

For example:
image

I see the rules array in the config and the query have fields for the name and value of the rule, but nothing for an operator.

Translating to mongodb query

This looks really neat.

Apologies for my ignorance here, but how does one actually use the generated "query"? I would love to generate mongodb queries from this. I see that https://querybuilder.js.org/ has a plugin to do this for mongodb. Does your package have a similar methodolgy?

Operators with optional parameters

Hi,

i want to implement a "LIMIT" operation with your query builder. But i am struggeling to bring addtional information to the GroupOperatorControlComponent and back to the Query.

In the end i am thinking of using a custom GroupOperatorControlComponent and place there some kind of input box for a number that "limits" the result.

Is there any possibility to achieve that?

Btw. thank you for your code / time and of course an answer :-)

Rule operators not supported

Hi,

are rule operators not supported?
For example, for constructing a query: "numA > 3"

Note - these are not the And/Or group operators.

Number Component with Operators - Error in props type

Hi - This is a great library for building queries.
I'm trying to use the Number component with operators following the example here (https://codesandbox.io/s/njrm3?file=/src/App.vue) but get the following error.
Vue warn]: Invalid prop: type check failed for prop "value". Expected Number with value NaN, got Object

I worked around it by using code from the Type Component, it works but then I cannot set the default value. Appreciate any suggestions.

reactiveInject error

I'm having this issue when try to follow the docs. Using Vue 2.6.12

vue.esm.js?a026:628 [Vue warn]: Error in nextTick: "TypeError: Cannot use 'in' operator to search for '__reactiveInject__' in undefined" vue.esm.js?a026:1897 TypeError: Cannot use 'in' operator to search for '__reactiveInject__' in undefined at resolveInject (vue.esm.js?aba4:4649:1) at initInjections (vue.esm.js?aba4:4619:1) at Vue._init (vue.esm.js?aba4:4710:1) at new QueryBuilder (vue.esm.js?aba4:5836:1) at createComponentInstanceForVnode (vue.esm.js?a026:3292:1) at init (vue.esm.js?a026:3123:1) at createComponent (vue.esm.js?a026:5989:1) at createElm (vue.esm.js?a026:5936:1) at createChildren (vue.esm.js?a026:6064:1) at createElm (vue.esm.js?a026:5965:1)

Request: Custom Labels

Currently it is not possible to edit the labels of buttons or selectors like in the version from dabernathy89/vue-query-builder:
This would be an important feature for supporting other languages.

Example from dabernathy89's query-builder
labels optional Type: Object
Replace the default labels used in the UI. The default values are:

{
  "matchType": "Match Type",
  "matchTypes": [
    {"id": "all", "label": "All"},
    {"id": "any", "label": "Any"}
  ],
  "addRule": "Add Rule",
  "removeRule": "×",
  "addGroup": "Add Group",
  "removeGroup": "×",
  "textInputPlaceholder": "value",
}

Preserving the rules

I was wondering if there is an easy way to store and reload all the selections on the query-builder when it is remounted? Thank you.

Can you provide the better way to test a rule ?

If it's easy for you, can you provide the better way to test a rule ?
i'm struggling a bit with it (in order to pass configuration and model) and maybe you've already done this before.

Thanks!

RuleSlot exact rule identification

Hi, first of all thank you for such a great library!

I am facing an issue where I have multiple rules using the same component.
I noticed this behavior when trying to get data into the (custom) component of a (custom / scoped) RuleSlot. Within this component, I have a drop-down that eventually will fetch data from a DB / API. In the end there will be ~30 rules that have a dropdown selection, and in my opinion it is not worth creating 30 custom (pretty much duplicate) dropdown components. Therefor I am trying to use a single component in multiple rules, with different data fetched in the dropdown.

One of the main issue is the identification of the exact rule based on the data that is being forwarded into the RuleSlot:
src/QueryBuilderRule.vue#L81 and src/QueryBuilderRule.vue#L42
Only with this information currently provided, the exact rule can only be found out by matching the ruleComponent (and ruleData, dependend if initialValue is different):

    ruleName() {
      return this.rules
        .find(r => r.component === this.ruleCtrl.ruleComponent)
        .name;
    },

however, as I have multiple rules that have the same component, this won't work (it only give back the first element in the rules array it finds).

To fix this behavior, the identifier from the rules would be needed inside the RuleSlot.

Basically in the get ruleSlotProps (src/QueryBuilderRule.vue#L42) adding one item to the object being forwarded to the RuleSlot:

  get ruleSlotProps(): RuleSlotProps {
    return {
      ruleComponent: this.component,
      ruleData: this.query.value,
      ruleIdentifier: this.query.identifier
      updateRuleData: (ruleData: any) => this.ruleUpdate(ruleData),
    };
  }

When this ruleIdentifier is available in the RuleSlot the ruleName (and exact rule) can be found:

.find(r => r.identifier=== this.ruleCtrl.ruleIdentifier)

Thank you!

Max nested groups

In the documentation it says "Control maximum depth of nested groups." but I couldn't figure out how. Couldn't find an example in the documentation too. Any help?

Will they make a version for vue 3?

Hello, will you make an update for the new version of vue?
I'm building a project and can't find any query builder component for vue 3! Does anyone know one?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.