@illinois-grad/grad-vue 7.0.0 → 7.1.1
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/dist/components/GButton.vue.d.ts +2 -2
- package/dist/components/GModal.vue.d.ts +1 -1
- package/dist/components/GProgress.vue.d.ts +1 -1
- package/dist/components/GSelectButton.vue.d.ts +1 -1
- package/dist/components/GSidebar.vue.d.ts +1 -1
- package/dist/components/GSidebarMenu.vue.d.ts +1 -1
- package/dist/components/GTable.vue.d.ts +2 -1
- package/dist/components/GTreeMenu.vue.d.ts +2 -2
- package/dist/components/table/TableColumn.d.ts +15 -1
- package/dist/components/tree-menu/GTreeMenuList.vue.d.ts +1 -1
- package/dist/compose/useFiltering.d.ts +43 -2
- package/dist/{grad-vue-Dgo1hdiu.js → grad-vue-BqBZYXQU.js} +200 -191
- package/dist/grad-vue-BqBZYXQU.js.map +1 -0
- package/dist/grad-vue-elements.css +28 -28
- package/dist/grad-vue-elements.js.map +1 -1
- package/dist/grad-vue.d.ts +2 -2
- package/dist/grad-vue.js +2 -2
- package/dist/plugin.js +2 -2
- package/dist/plugin.js.map +1 -1
- package/package.json +4 -4
- package/dist/grad-vue-Dgo1hdiu.js.map +0 -1
|
@@ -127,10 +127,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
127
127
|
onMouseenter?: ((...args: any[]) => any) | undefined;
|
|
128
128
|
onMouseleave?: ((...args: any[]) => any) | undefined;
|
|
129
129
|
}>, {
|
|
130
|
-
size: "
|
|
130
|
+
size: "medium" | "tiny" | "small" | "large";
|
|
131
131
|
type: "button" | "submit" | "reset";
|
|
132
132
|
text: boolean;
|
|
133
|
-
theme: "
|
|
133
|
+
theme: "none" | "primary" | "secondary" | "danger" | "accent";
|
|
134
134
|
outlined: boolean;
|
|
135
135
|
disabled: boolean;
|
|
136
136
|
to: string | Record<string, any>;
|
|
@@ -90,7 +90,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
90
90
|
}> & Readonly<{
|
|
91
91
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
92
92
|
}>, {
|
|
93
|
-
size: "
|
|
93
|
+
size: "medium" | "small" | "large" | "full";
|
|
94
94
|
describedby: string;
|
|
95
95
|
hiddenLabel: boolean;
|
|
96
96
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
@@ -50,5 +50,5 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
50
50
|
}> & Readonly<{}>, {
|
|
51
51
|
label: string;
|
|
52
52
|
value: number;
|
|
53
|
-
size: "
|
|
53
|
+
size: "medium" | "tiny" | "small" | "large";
|
|
54
54
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -102,7 +102,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
102
102
|
}> & Readonly<{
|
|
103
103
|
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
104
104
|
}>, {
|
|
105
|
-
size: "
|
|
105
|
+
size: "medium" | "small" | "large";
|
|
106
106
|
required: boolean;
|
|
107
107
|
name: string;
|
|
108
108
|
disabled: boolean;
|
|
@@ -115,7 +115,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
115
115
|
storageKey?: string;
|
|
116
116
|
}> & Readonly<{}>, {
|
|
117
117
|
width: string;
|
|
118
|
-
theme: "
|
|
118
|
+
theme: "dark" | "light";
|
|
119
119
|
sidebarKey: string;
|
|
120
120
|
backgroundColor: string;
|
|
121
121
|
backgroundImage: string;
|
|
@@ -141,7 +141,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
141
141
|
}> & Readonly<{
|
|
142
142
|
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
143
143
|
}>, {
|
|
144
|
-
theme: "
|
|
144
|
+
theme: "dark" | "light";
|
|
145
145
|
compact: boolean;
|
|
146
146
|
offset: number;
|
|
147
147
|
spy: boolean;
|
|
@@ -38,7 +38,8 @@ export interface BulkAction {
|
|
|
38
38
|
* `filter.key` is omitted. Pass a filter/request type as the third
|
|
39
39
|
* `TableColumn` type argument to type-check `filter.key` and values, and
|
|
40
40
|
* use `buildFilterRequest()` to convert filter state into request values
|
|
41
|
-
* (for example `match: "contains"` produces `%text%`).
|
|
41
|
+
* (for example `match: "contains"` produces `%text%`). `filterDefaults()`
|
|
42
|
+
* builds the initial filter state from the same columns.
|
|
42
43
|
* - `display` accepts a custom render function for the column data.
|
|
43
44
|
* - `trClass` and `tdClass` can be used to provide custom classes for table rows and cells.
|
|
44
45
|
* - `data` array with objects containing fields for the columns.
|
|
@@ -118,8 +118,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
118
118
|
*/
|
|
119
119
|
smallHeading?: boolean;
|
|
120
120
|
}> & Readonly<{}>, {
|
|
121
|
-
theme: "
|
|
122
|
-
listType: "
|
|
121
|
+
theme: "dark" | "light";
|
|
122
|
+
listType: "ol" | "ul";
|
|
123
123
|
showExpandAll: boolean;
|
|
124
124
|
headingLevel: "h2" | "h3";
|
|
125
125
|
smallHeading: boolean;
|
|
@@ -106,7 +106,21 @@ export type SearchColumnFilter<F = AnyFilterRecord, K extends FilterKey<F> = Fil
|
|
|
106
106
|
} & SearchFilterMapping<F, K>;
|
|
107
107
|
/**
|
|
108
108
|
* A single-select filter. Without `transform`, option values must match the
|
|
109
|
-
* request field's type.
|
|
109
|
+
* request field's type. `0` and `false` are valid option values.
|
|
110
|
+
*
|
|
111
|
+
* For a "has value / has no value" filter on a nullable field, use boolean
|
|
112
|
+
* options with a boolean request key; clearing the select removes the filter:
|
|
113
|
+
*
|
|
114
|
+
* ```ts
|
|
115
|
+
* filter: {
|
|
116
|
+
* type: "select",
|
|
117
|
+
* key: "deposit_date__notnull",
|
|
118
|
+
* options: [
|
|
119
|
+
* { label: "Has Deposit Date", value: true },
|
|
120
|
+
* { label: "No Deposit Date", value: false },
|
|
121
|
+
* ],
|
|
122
|
+
* }
|
|
123
|
+
* ```
|
|
110
124
|
*/
|
|
111
125
|
export type SelectColumnFilter<F = AnyFilterRecord, K extends FilterKey<F> = FilterKey<F>> = SelectFilterBase & {
|
|
112
126
|
key?: K;
|
|
@@ -17,7 +17,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
17
17
|
*/
|
|
18
18
|
listType?: "ul" | "ol";
|
|
19
19
|
}> & Readonly<{}>, {
|
|
20
|
-
listType: "
|
|
20
|
+
listType: "ol" | "ul";
|
|
21
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
22
22
|
default?: (props: {}) => any;
|
|
23
23
|
}>;
|
|
@@ -32,7 +32,15 @@ export type FilterLocationQuery = {
|
|
|
32
32
|
export interface FilteringOptions {
|
|
33
33
|
syncWith?: Ref<FilterRouteQuery>;
|
|
34
34
|
}
|
|
35
|
-
export interface
|
|
35
|
+
export interface FilterStateFromQueryOptions<F = AnyFilterRecord> {
|
|
36
|
+
/**
|
|
37
|
+
* Array filters whose `"true"`/`"false"` query values should be
|
|
38
|
+
* converted to booleans. Not needed for column filters with boolean
|
|
39
|
+
* option values, since `buildFilterRequest()` matches those itself.
|
|
40
|
+
*/
|
|
41
|
+
booleanArrayKeys?: readonly FilterKey<F>[];
|
|
42
|
+
}
|
|
43
|
+
export interface QueryFilteringOptions<F = AnyFilterRecord> extends FilterStateFromQueryOptions<F> {
|
|
36
44
|
route: {
|
|
37
45
|
query: FilterRouteQuery;
|
|
38
46
|
};
|
|
@@ -41,7 +49,6 @@ export interface QueryFilteringOptions<F = AnyFilterRecord> {
|
|
|
41
49
|
query: FilterLocationQuery;
|
|
42
50
|
}) => unknown;
|
|
43
51
|
};
|
|
44
|
-
booleanArrayKeys?: readonly FilterKey<F>[];
|
|
45
52
|
}
|
|
46
53
|
/**
|
|
47
54
|
* Represents a type that defines a set of filters for a given record type.
|
|
@@ -101,6 +108,37 @@ export declare function parseQueryArrayValue(value: FilterRouteQueryValue | Filt
|
|
|
101
108
|
* ```
|
|
102
109
|
*/
|
|
103
110
|
export declare function buildFilterRequest<T extends TableRow, F>(columns: readonly TableColumn<T, ColumnKey<T>, F>[], filters: FilterState<F>): FilterRequest<F>;
|
|
111
|
+
/**
|
|
112
|
+
* Builds the default filter state for `useFiltering()` / `useQueryFiltering()`
|
|
113
|
+
* from column filter configuration, so filters don't have to be listed twice.
|
|
114
|
+
*
|
|
115
|
+
* Each filtered column adds its filter key (`filter.key ?? column.key`).
|
|
116
|
+
* Multi-select filters default to `[]`, so their query params are always read
|
|
117
|
+
* as arrays; all other filters default to `undefined`.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* const filtering = useQueryFiltering<StudentRow, Query>(filterDefaults(columns), { route, router });
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
export declare function filterDefaults<T extends TableRow, F>(columns: readonly TableColumn<T, ColumnKey<T>, F>[]): FilterState<F>;
|
|
125
|
+
/**
|
|
126
|
+
* Reads filter state from route query params, the same way
|
|
127
|
+
* `useQueryFiltering()` does, without creating reactive state or writing to
|
|
128
|
+
* the URL.
|
|
129
|
+
*
|
|
130
|
+
* Use this when another view needs the filters of a query-synced table, for
|
|
131
|
+
* example a detail page that loads the same list. Keys come from `defaults`;
|
|
132
|
+
* filters with array defaults are always read as arrays.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* const request = computed(() =>
|
|
137
|
+
* buildFilterRequest(columns, filterStateFromQuery(filterDefaults(columns), route.query)),
|
|
138
|
+
* );
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
export declare function filterStateFromQuery<F>(defaults: FilterState<F>, query: FilterRouteQuery, options?: FilterStateFromQueryOptions<F>): FilterState<F>;
|
|
104
142
|
/**
|
|
105
143
|
* Converts filter criteria into a format suitable for use as a query object
|
|
106
144
|
* in vue-router.
|
|
@@ -123,6 +161,9 @@ export declare function filtersToQueryParams<T extends Record<string, any>>(filt
|
|
|
123
161
|
* read from and written to query params as arrays, and `booleanArrayKeys` can
|
|
124
162
|
* be used for multi-value filters that should be converted to boolean values
|
|
125
163
|
* inside the filter state.
|
|
164
|
+
*
|
|
165
|
+
* Use `filterDefaults(columns)` to build `filters` from column configuration,
|
|
166
|
+
* and `filterStateFromQuery()` to read the same state elsewhere without syncing.
|
|
126
167
|
*/
|
|
127
168
|
export declare function useQueryFiltering<T extends object = AnyFilterRecord, F = Partial<Record<keyof T, any>>>(filters: FilterState<F>, options: QueryFilteringOptions<F>): UseFilteringReturn<T, F>;
|
|
128
169
|
/**
|