iss-query-filters 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # @jtekt/iss-query-filters
2
+
3
+ A reusable QueryFilter component built with Vue 3 + Vuetify 3.
4
+
5
+ It lets users build nested AND/OR filter trees and outputs a query object via `v-model`.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @jtekt/iss-query-filters
11
+ # peer deps
12
+ npm install vue vuetify
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```ts
18
+ // main.ts
19
+ import { createApp } from "vue";
20
+ import App from "./App.vue";
21
+
22
+ import "vuetify/styles";
23
+ import { createVuetify } from "vuetify";
24
+
25
+ import { QueryFilterPlugin } from "@jtekt/iss-query-filters";
26
+ import "@jtekt/iss-query-filters/style.css";
27
+
28
+ const vuetify = createVuetify();
29
+
30
+ createApp(App).use(vuetify).use(QueryFilterPlugin).mount("#app");
31
+ ```
32
+
33
+ ```ts
34
+ <script setup lang="ts">
35
+ import { ref } from "vue";
36
+
37
+ const query = ref<Record<string, any>>({});
38
+ const loading = ref(false);
39
+ </script>
40
+
41
+ <template>
42
+ <QueryFilter
43
+ v-model="query"
44
+ :fields="['_id', 'description', 'title']"
45
+ :loading="loading"
46
+ />
47
+ </template>
48
+ ```
49
+
50
+ ![QueryFilter-without-limitField](http://10.115.1.14/leahishiguro/iss-query-filters/-/raw/main/playground/assets/QueryFilter-withoutLimit.png)
51
+
52
+ ### `show-limit-field`
53
+
54
+ Controls whether the **Limit** field is displayed in the QueryFilter component.
55
+
56
+ Use this when your page **does not already manage pagination or items-per-page**.
57
+ If your table or data list already handles page size, keep this set to `false` to avoid duplicate limit controls.
58
+
59
+ **Type:** `boolean`
60
+ **Default:** `false`
61
+
62
+ ```ts
63
+ // It can also be imported it directly as a component not plugin
64
+ import { QueryFilter } from "@jtekt/iss-query-filters";
65
+
66
+ <QueryFilter
67
+ v-model="query"
68
+ :fields="['_id', 'description', 'title']"
69
+ :loading="loading"
70
+ :show-limit-field="true"
71
+ />
72
+ ```
73
+
74
+ ![QueryFilter-with-limitField](http://10.115.1.14/leahishiguro/iss-query-filters/-/raw/main/playground/assets/QueryFilter-withLimit.png)
75
+
76
+ `query` will contain keys like `from`, `to`, `limit`, `regex`, and `filter` (JSON string with your nested AND/OR Mongo-like query).
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,12 @@
1
+ type __VLS_Props = {
2
+ label: string;
3
+ };
4
+ type __VLS_PublicProps = {
5
+ modelValue?: string | undefined;
6
+ } & __VLS_Props;
7
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
+ "update:modelValue": (value: string | undefined) => any;
9
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
10
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { Group } from './types';
2
+ type __VLS_Props = {
3
+ fieldsAll: any[];
4
+ };
5
+ type __VLS_PublicProps = {
6
+ modelValue: Group;
7
+ } & __VLS_Props;
8
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
+ "update:modelValue": (value: Group) => any;
10
+ } & {
11
+ remove: () => any;
12
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
+ onRemove?: (() => any) | undefined;
14
+ "onUpdate:modelValue"?: ((value: Group) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ export default _default;
@@ -0,0 +1,16 @@
1
+ type __VLS_Props = {
2
+ fields?: string[];
3
+ loading?: boolean;
4
+ showLimitField: boolean;
5
+ };
6
+ type __VLS_PublicProps = {
7
+ modelValue?: Record<string, any>;
8
+ } & __VLS_Props;
9
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ "update:modelValue": (value: Record<string, any>) => any;
11
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
+ "onUpdate:modelValue"?: ((value: Record<string, any>) => any) | undefined;
13
+ }>, {
14
+ showLimitField: boolean;
15
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ export default _default;