fix selection command

This commit is contained in:
Chris Kruining 2025-01-06 15:49:37 +01:00
parent ce7a300f48
commit 96d04a6094
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
3 changed files with 11 additions and 4 deletions

View file

@ -11,7 +11,8 @@ export interface GridApi {
readonly selection: Accessor<SelectionItem<number, Entry>[]>;
remove(indices: number[]): void;
addKey(key: string): void;
// addLocale(locale: string): void;
selectAll(): void;
clearSelection(): void;
};
const groupBy = (rows: DataSetRowNode<number, Entry>[]) => {
@ -68,6 +69,12 @@ export function Grid(props: { class?: string, rows: Entry[], locales: string[],
addKey(key) {
r.insert({ key, ...Object.fromEntries(locales().map(l => [l, ''])) });
},
selectAll() {
api()?.selectAll();
},
clearSelection() {
api()?.clearSelection();
},
});
});