@illinois-grad/grad-vue 1.0.2 → 2.1.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 University of Illinois Board of Trustees
3
+ Copyright (c) 2026 University of Illinois Board of Trustees
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Shared Vue.js components and composable functions for the Graduate College.
4
4
 
5
+ **Package has moved in npm** to `@illinois-grad/grad-vue`.
6
+
5
7
  Features:
6
8
 
7
9
  - **Vue 3**: Built with Vue.js version 3 and the Composition API.
@@ -7,6 +7,10 @@ interface Props {
7
7
  * Hide the visible text
8
8
  */
9
9
  hideText?: boolean;
10
+ /**
11
+ * Copy button label
12
+ */
13
+ copyLabel?: string;
10
14
  }
11
15
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
16
  declare const _default: typeof __VLS_export;
@@ -25,7 +25,7 @@ declare const __VLS_export: <T extends TableRow, C extends TableColumn<T>>(__VLS
25
25
  columns: C[];
26
26
  resultCount?: number;
27
27
  groupBy?: keyof T;
28
- filtering: UseFilteringReturn<T>;
28
+ filtering: UseFilteringReturn<any>;
29
29
  groupRender?: (groupValue: any, row: T) => VNode;
30
30
  rowClickable?: boolean;
31
31
  rowClass?: (row: T) => string | string[] | undefined;
@@ -34,9 +34,6 @@ declare const __VLS_export: <T extends TableRow, C extends TableColumn<T>>(__VLS
34
34
  * Enable bulk selection with checkboxes
35
35
  */
36
36
  bulkSelectionEnabled?: boolean;
37
- /**
38
- * Array of actions to show in the sticky toolbar when rows are selected
39
- */
40
37
  bulkActions?: BulkAction[];
41
38
  } & {
42
39
  sortField?: keyof T;
@@ -0,0 +1,41 @@
1
+ interface Props {
2
+ /**
3
+ * Title for the popover.
4
+ */
5
+ title?: string;
6
+ /**
7
+ * Label for year select.
8
+ */
9
+ yearLabel?: string;
10
+ /**
11
+ * Label for period select.
12
+ */
13
+ periodLabel?: string;
14
+ termYears?: string[];
15
+ termNames?: string[];
16
+ }
17
+ type __VLS_Props = Required<Props>;
18
+ type __VLS_ModelProps = {
19
+ modelValue?: {
20
+ year: string;
21
+ name: string;
22
+ };
23
+ };
24
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
25
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ "update:modelValue": (value: {
27
+ year: string;
28
+ name: string;
29
+ }) => any;
30
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
31
+ "onUpdate:modelValue"?: ((value: {
32
+ year: string;
33
+ name: string;
34
+ }) => any) | undefined;
35
+ }>, {
36
+ title: string;
37
+ termYears: string[];
38
+ termNames: string[];
39
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
40
+ declare const _default: typeof __VLS_export;
41
+ export default _default;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Prebuilt GSelect and GSelectButton components that can be used to
3
+ * select a term.
4
+ */
5
+ interface Props {
6
+ /**
7
+ * List of possible term years. Defaults to ["2026"].
8
+ */
9
+ termYears?: string[];
10
+ /**
11
+ * List of possible term names. Defaults to ["Spring", "Summer", "Fall"].
12
+ */
13
+ termNames?: string[];
14
+ /**
15
+ * Label for year select. Defaults to "Select Year".
16
+ */
17
+ yearLabel?: string;
18
+ /**
19
+ * Label for period select. Defaults to "Term".
20
+ */
21
+ periodLabel?: string;
22
+ }
23
+ type __VLS_Props = Required<Props>;
24
+ type __VLS_ModelProps = {
25
+ modelValue?: {
26
+ year: string;
27
+ name: string;
28
+ };
29
+ };
30
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
31
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
+ "update:modelValue": (value: {
33
+ year: string;
34
+ name: string;
35
+ }) => any;
36
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
37
+ "onUpdate:modelValue"?: ((value: {
38
+ year: string;
39
+ name: string;
40
+ }) => any) | undefined;
41
+ }>, {
42
+ termYears: string[];
43
+ termNames: string[];
44
+ yearLabel: string;
45
+ periodLabel: string;
46
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
47
+ declare const _default: typeof __VLS_export;
48
+ export default _default;
@@ -1,14 +1,69 @@
1
- import { type Ref } from "vue";
1
+ import { Reactive, type Ref } from "vue";
2
+ export type FilterLocationQueryValueRaw = string | number;
3
+ /**
4
+ * Query representation for filtering, compatible with vue-router
5
+ */
6
+ export type FilterLocationQuery = {
7
+ [p: string]: string | null | number | undefined | FilterLocationQueryValueRaw[];
8
+ };
2
9
  export interface FilteringOptions {
3
10
  syncWith?: Ref<{
4
11
  [p: string]: string | null | (string | null)[] | undefined;
5
12
  }>;
6
13
  }
7
- export interface UseFilteringReturn<T extends Record<string, any> = Record<string, any>> {
8
- filters: Ref<Partial<T>>;
14
+ /**
15
+ * Represents a type that defines a set of filters for a given record type.
16
+ * The keys are based on the record, and the values are possible values
17
+ * for a filter.
18
+ */
19
+ export type FiltersForRecord<T extends object, F extends {
20
+ [K in keyof T]?: any;
21
+ }> = {
22
+ [K in keyof T]?: T[K] extends string | number | boolean | undefined | null ? T[K] | string | string[] : T[K] extends string[] | number[] ? T[K][] : never;
23
+ };
24
+ /**
25
+ * Represents the return type of a composition function used for handling
26
+ * filtering logic in a data structure.
27
+ */
28
+ export interface UseFilteringReturn<T extends Record<string, any> = Record<string, any>, F extends {
29
+ [K in keyof T]?: any;
30
+ } = Record<keyof T, any>> {
31
+ filters: Reactive<F>;
9
32
  isFiltered: Ref<boolean>;
10
33
  clearFilters: () => void;
11
34
  filteredColumns: Ref<Partial<Record<keyof T, boolean>>>;
12
35
  }
36
+ /**
37
+ * Returns the value if it's not empty, or undefined if it's empty.
38
+ */
39
+ export declare function emptyAsUndefined<T extends string | number | boolean | string[] | number[] | undefined | null>(value: T): (T & {}) | undefined;
40
+ export declare function filterOmitEmpty<T extends object>(value: T): Partial<T>;
41
+ /**
42
+ * Return a value as an array if it's not already one, or
43
+ * undefined if it's undefined.
44
+ */
45
+ export declare function asArray<T>(value: T | T[]): NonNullable<T>[] | undefined;
46
+ /**
47
+ * Converts filter criteria into a format suitable for use as a query object
48
+ * in vue-router.
49
+ */
50
+ export declare function filterAsQuery<T extends Record<string, any>, F extends {
51
+ [K in keyof T]?: any;
52
+ } = Record<keyof T, any>>(filters: FiltersForRecord<T, F>): FilterLocationQuery;
53
+ /**
54
+ * Converts an object of filters into a query parameters object for API calls.
55
+ *
56
+ * Transforms the values into strings or arrays of strings. Excludes fields with undefined,
57
+ * null, empty string, or false values. Supports single values and arrays.
58
+ */
13
59
  export declare function filtersToQueryParams<T extends Record<string, any>>(filters: T): Record<keyof T, string | string[]>;
14
- export declare function useFiltering<T extends Record<string, any>>(filters: T, options?: FilteringOptions): UseFilteringReturn<T>;
60
+ /**
61
+ * Provides a mechanism to manage and synchronize filterable data with given filters and options.
62
+ *
63
+ * @param filters An object that defines the filters applicable to the data record.
64
+ * @param options Configuration options for filtering, such as synchronization.
65
+ * @return Returns an object that can be used with GTable.
66
+ */
67
+ export declare function useFiltering<T extends Record<string, any> = Record<string, any>, F extends {
68
+ [K in keyof T]?: any;
69
+ } = Record<keyof T, any>>(filters: F, options?: FilteringOptions): UseFilteringReturn<T, F>;