From 9c91d8634fb9aba925ddb1ffaad53280ec6f1888 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 10 Jul 2024 14:15:48 -0400 Subject: [PATCH] feat(ags): add setup_list func for sorted list --- modules/ags/config/ts/misc/sorted-list.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/ags/config/ts/misc/sorted-list.ts b/modules/ags/config/ts/misc/sorted-list.ts index 4b2d7ada..759b473a 100644 --- a/modules/ags/config/ts/misc/sorted-list.ts +++ b/modules/ags/config/ts/misc/sorted-list.ts @@ -14,12 +14,13 @@ type MakeChild = ReturnType; type SortedListProps> = PopupWindowProps & { on_select: (row: ListBoxRow) => void; - init_rows: (list: MakeChild['list']) => void; + init_rows?: (list: MakeChild['list']) => void; set_sort: ( text: string, list: MakeChild['list'], placeholder: MakeChild['placeholder'], ) => void; + setup_list?: (list: MakeChild['list']) => void; }; // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -145,8 +146,9 @@ export class SortedList< constructor({ on_select, - init_rows, + init_rows = () => { /**/ }, set_sort, + setup_list = () => { /**/ }, on_open = () => { /**/ }, class_name = '', keymode = 'on-demand', @@ -185,6 +187,7 @@ export class SortedList< }; // TODO: add on_accept where it just selects the first visible one + setup_list(this._list); this._init_rows(this._list); this._set_sort('', this._list, this._placeholder); }