ListPanelProps beta
Interface of @v12-engine/client/kit
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"
'aria-label'?: string;The list's name for a screen reader
"data-list"
'data-list'?: string;A data-list attribute on the list's element, which tests and styles find it by
class
class?: string;CSS classes added to the whole list
count
count?: boolean;Whether the count is shown beside the field: yes when there is a field
empty
empty?: JSX.Element;What is said with nothing to list, or nothing found
id
id: (item: T) => string;A thing's id, unique among the items: what value and onValue go by
items
items: readonly T[];The things to list, in their order
label
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)
menu
menu?: (item: T) => MenuItem[];A right click on a row: its menu
onDelete
onDelete?: (items: T[]) => void;Delete or Backspace
onOpen
onOpen?: (item: T) => void;Enter, or a double click
onQuery
onQuery?: (query: string) => void;Told what is typed in the search field as it changes
onRename
onRename?: (item: T) => void;F2
onReorder
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
onValue?: (ids: string[], items: T[]) => void;Told the ids picked and their items whenever the picking changes
page
page?: number;How many rows are drawn at first, and more as the end comes into view: 200 when left out
placeholder
placeholder?: string;What the search field says while empty
query
query?: string;What is typed, said from outside
render
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
rowClass?: string;For the rows: their height, their words
search
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
selectionMode?: 'single' | 'multiple' | 'extended';How rows are picked: one, many with Ctrl and Shift (extended), or many by clicks (multiple)
value
value?: readonly string[];The ids picked: one, many with Ctrl and Shift (extended), or many by clicks (multiple); single when left out
words
words?: (item: T) => string;More words a thing is found by, beyond its label