Skip to content

ListPanelProps beta ​

Interface of @v12-engine/client/kit

ts
export interface ListPanelProps<T>

What a list panel is given of each item: its id, what it says (searched, typed to), and how it is drawn

Members ​

"aria-label" ​

ts
'aria-label'?: string;

The list's name for a screen reader

"data-list" ​

ts
'data-list'?: string;

A data-list attribute on the list's element, which tests and styles find it by

class ​

ts
class?: string;

CSS classes added to the whole list

count ​

ts
count?: boolean;

Whether the count is shown beside the field: yes when there is a field

empty ​

ts
empty?: JSX.Element;

What is said with nothing to list, or nothing found

id ​

ts
id: (item: T) => string;

A thing's id, unique among the items: what value and onValue go by

items ​

ts
items: readonly T[];

The things to list, in their order

label ​

ts
label: (item: T) => string;

What the item says of itself: its label, and words it is found by (searched, and the letters typed go to it)

ts
menu?: (item: T) => MenuItem[];

A right click on a row: its menu

onDelete ​

ts
onDelete?: (items: T[]) => void;

Delete or Backspace

onOpen ​

ts
onOpen?: (item: T) => void;

Enter, or a double click

onQuery ​

ts
onQuery?: (query: string) => void;

Told what is typed in the search field as it changes

onRename ​

ts
onRename?: (item: T) => void;

F2

onReorder ​

ts
onReorder?: (from: number, to: number) => void;

Rows dragged to another place (or moved with Alt and the arrows): the item, and where it goes among the items as given

onValue ​

ts
onValue?: (ids: string[], items: T[]) => void;

Told the ids picked and their items whenever the picking changes

page ​

ts
page?: number;

How many rows are drawn at first, and more as the end comes into view: 200 when left out

placeholder ​

ts
placeholder?: string;

What the search field says while empty

query ​

ts
query?: string;

What is typed, said from outside

render ​

ts
render?: (item: T, query: string) => JSX.Element;

How a row is drawn, given the words typed (for a Highlight of its own): its label with the letters found marked, when left out

rowClass ​

ts
rowClass?: string;

For the rows: their height, their words

ts
search?: boolean | 'rank';

A search field on top: every word typed somewhere in the label and words (a typo's nearest when nothing has them); 'rank' puts what starts with them first, and a typo's nearest last

selectionMode ​

ts
selectionMode?: 'single' | 'multiple' | 'extended';

How rows are picked: one, many with Ctrl and Shift (extended), or many by clicks (multiple)

value ​

ts
value?: readonly string[];

The ids picked: one, many with Ctrl and Shift (extended), or many by clicks (multiple); single when left out

words ​

ts
words?: (item: T) => string;

More words a thing is found by, beyond its label