@illinois-grad/grad-vue 3.0.20 → 4.0.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.
@@ -2189,25 +2189,25 @@
2189
2189
  },
2190
2190
  {
2191
2191
  "kind": "field",
2192
- "name": "sortField",
2192
+ "name": "sorts",
2193
2193
  "type": {
2194
- "text": "keyof TableRow"
2194
+ "text": "TableSort<TableRow>[]"
2195
2195
  },
2196
2196
  "optional": true
2197
2197
  },
2198
2198
  {
2199
2199
  "kind": "field",
2200
- "name": "sortOrder",
2200
+ "name": "filter",
2201
2201
  "type": {
2202
- "text": "1 | -1"
2202
+ "text": "Partial<Record<keyof TableRow, any>>"
2203
2203
  },
2204
2204
  "optional": true
2205
2205
  },
2206
2206
  {
2207
2207
  "kind": "field",
2208
- "name": "filter",
2208
+ "name": "columnVisibility",
2209
2209
  "type": {
2210
- "text": "Partial<Record<keyof TableRow, any>>"
2210
+ "text": "Partial<Record<Extract<keyof TableRow, string>, boolean>>"
2211
2211
  },
2212
2212
  "optional": true
2213
2213
  },
@@ -1,4 +1,4 @@
1
- import { TableColumn, TableRow } from "./table/TableColumn.ts";
1
+ import { TableColumn, TableRow, TableSort } from "./table/TableColumn.ts";
2
2
  import { VNode } from "vue";
3
3
  import { UseFilteringReturn } from "../compose/useFiltering.ts";
4
4
  import { CellChangePayload, UseTableChangesReturn } from "../compose/useTableChanges.ts";
@@ -127,16 +127,16 @@ declare const __VLS_export: <T extends TableRow, C extends TableColumn<T>>(__VLS
127
127
  */
128
128
  showPagination?: boolean;
129
129
  } & {
130
- sortField?: keyof T;
131
- sortOrder?: 1 | -1;
130
+ sorts?: TableSort<T>[];
132
131
  filter?: Partial<Record<keyof T, any>>;
132
+ columnVisibility?: Partial<Record<Extract<keyof T, string>, boolean>>;
133
133
  selectedRows?: string[];
134
134
  }) & {
135
135
  "onRow-click"?: ((link: string) => any) | undefined;
136
136
  "onCell-change"?: ((payload: CellChangePayload<T, Extract<keyof T, string>>) => any) | undefined;
137
- "onUpdate:sortField"?: ((value: keyof T | undefined) => any) | undefined;
138
- "onUpdate:sortOrder"?: ((value: 1 | -1 | undefined) => any) | undefined;
137
+ "onUpdate:sorts"?: ((value: TableSort<T, Extract<keyof T, string>>[]) => any) | undefined;
139
138
  "onUpdate:filter"?: ((value: Partial<Record<keyof T, any>>) => any) | undefined;
139
+ "onUpdate:columnVisibility"?: ((value: Partial<Record<Extract<keyof T, string>, boolean>>) => any) | undefined;
140
140
  "onUpdate:selectedRows"?: ((value: string[]) => any) | undefined;
141
141
  "onBulk-action"?: ((actionId: string, selectedKeys: string[]) => any) | undefined;
142
142
  }> & (typeof globalThis extends {
@@ -151,7 +151,7 @@ declare const __VLS_export: <T extends TableRow, C extends TableColumn<T>>(__VLS
151
151
  (e: "row-click", link: string): void;
152
152
  (e: "bulk-action", actionId: string, selectedKeys: string[]): void;
153
153
  (e: "cell-change", payload: CellChangePayload<T>): void;
154
- } & (((event: "update:sortField", value: keyof T | undefined) => void) & ((event: "update:sortOrder", value: 1 | -1 | undefined) => void) & ((event: "update:filter", value: Partial<Record<keyof T, any>>) => void) & ((event: "update:selectedRows", value: string[]) => void));
154
+ } & (((event: "update:sorts", value: TableSort<T, Extract<keyof T, string>>[]) => void) & ((event: "update:filter", value: Partial<Record<keyof T, any>>) => void) & ((event: "update:columnVisibility", value: Partial<Record<Extract<keyof T, string>, boolean>>) => void) & ((event: "update:selectedRows", value: string[]) => void));
155
155
  }>) => import("vue").VNode & {
156
156
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
157
157
  };
@@ -78,6 +78,10 @@ export interface EditableColumnConfig {
78
78
  labelKey?: string;
79
79
  }
80
80
  type ColumnKey<T> = Extract<keyof T, string>;
81
+ export interface TableSort<T extends TableRow, K extends ColumnKey<T> = ColumnKey<T>> {
82
+ key: K;
83
+ order: 1 | -1;
84
+ }
81
85
  export interface TableColumn<T extends TableRow, K extends ColumnKey<T> = ColumnKey<T>> {
82
86
  key: K;
83
87
  label: string;