Query Builder
<zn-query-builder> | ZnQueryBuilder
Short summary of the component’s intended use.
<zn-query-builder filters="[ { "id":"title", "name":"Title", "operators":[ "eq" ] }, { "id":"author", "name":"Author", "operators":[ "eq", "fuzzy" ] } ]"> </zn-query-builder>
Examples
Query String
This example will show the produced query string from the selected parameters.
<zn-query-builder id="query-string-example" filters="[ { "id":"title", "name":"Title", "operators":[ "eq" ] }, { "id":"author", "name":"Author", "operators":[ "eq", "fuzzy" ] }, { "id":"genre", "name":"Genre", "options":{ "action":"Action", "comedy":"Comedy", "drama":"Drama", "fantasy":"Fantasy", "horror":"Horror", "mystery":"Mystery", "romance":"Romance", "thriller":"Thriller", "sci-fi":"Science Fiction" }, "maxOptionsVisible": "3", "operators":[ "eq", "in" ] }, { "id":"rating", "name":"Rating", "type":"number", "operators":[ "eq", "gt", "gte", "lt", "lte" ] }, { "id":"created", "name":"Created", "type":"date", "operators":[ "eq", "before", "after" ] } ]"> </zn-query-builder> <br> <div style="word-wrap: break-word;"><b>Query String:</b> </span><span class="query-string"></span></div>
Types
Name |
---|
bool |
boolean |
date |
number |
Comparators
Name | Description |
---|---|
Eq |
Equals |
Neq |
Not Equals |
Before |
Was Before |
After |
Was After |
In |
In |
MatchPhrasePre |
Match Phrase Prefix |
NMatchPhrasePre |
Does Not Match Phrase Prefix |
MatchPhrase |
Match Phrase |
NMatchPhrase |
Does Not Match Phrase |
Match |
Match |
NMatch |
Does Not Match |
Starts |
Starts With |
NStarts |
Does Not Start With |
Wild |
Wildcard Match |
NWild |
Does Not Match Wildcard |
Fuzzy |
Fuzzy Match With |
NFuzzy |
Does Not Match Fuzzy With |
Gte |
Greater Than or Equals |
Gt |
Greater Than |
Lt |
Less Than |
Lte |
Less Than or Equals |
Importing
If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.
To import this component from the CDN using a script tag:
<script type="module" src="https://cdn.jsdelivr.net/npm/@kubex/zinc@1.0.0/dist/components/query-builder/query-builder.js"></script>
To import this component from the CDN using a JavaScript import:
import 'https://cdn.jsdelivr.net/npm/@kubex/zinc@1.0.0/dist/components/query-builder/query-builder.js';
To import this component using a bundler:
import '@kubex/zinc/dist/components/query-builder/query-builder.js';
Slots
Name | Description |
---|---|
(default) | The default slot. |
example
|
An example slot. |
Learn more about using slots.
Custom Properties
Name | Description | Default |
---|---|---|
--example |
An example CSS custom property. |
Learn more about customizing CSS custom properties.
Parts
Name | Description |
---|---|
base |
The component’s base wrapper. |
Learn more about customizing CSS parts.
Dependencies
This component automatically imports the following dependencies.
<zn-button>
<zn-example>
<zn-icon>
<zn-input>
<zn-option>
<zn-popup>
<zn-select>
<zn-tag>
<zn-tooltip>