feat: migrate ListBox with virtual collection and accessible parts
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import {
|
||||
ListBox,
|
||||
ListBoxItem,
|
||||
ListBoxItemIndicator,
|
||||
ListBoxSection,
|
||||
type ListBoxProps,
|
||||
type ListBoxItemProps,
|
||||
} from "@heroui-vue/components";
|
||||
const props: ListBoxProps = {
|
||||
modelValue: [0, "0"],
|
||||
selectionMode: "multiple",
|
||||
variant: "danger",
|
||||
onSelectionChange: (keys) => keys.forEach((key) => String(key)),
|
||||
};
|
||||
const item: ListBoxItemProps = { id: 0, textValue: "Zero" };
|
||||
// @ts-expect-error Vue collection models are key arrays, not scalars
|
||||
const scalar: ListBoxProps = { modelValue: 0 };
|
||||
// @ts-expect-error Keys cannot be objects
|
||||
const badKey: ListBoxProps = { modelValue: [{}] };
|
||||
// @ts-expect-error Selection mode is constrained
|
||||
const badMode: ListBoxProps = { selectionMode: "radio" };
|
||||
// @ts-expect-error Variant is constrained
|
||||
const badVariant: ListBoxItemProps = { id: "a", variant: "solid" };
|
||||
// @ts-expect-error Item identity is required
|
||||
const missing: ListBoxItemProps = { textValue: "Missing" };
|
||||
void [
|
||||
ListBox,
|
||||
ListBoxItem,
|
||||
ListBoxItemIndicator,
|
||||
ListBoxSection,
|
||||
props,
|
||||
item,
|
||||
scalar,
|
||||
badKey,
|
||||
badMode,
|
||||
badVariant,
|
||||
missing,
|
||||
];
|
||||
Reference in New Issue
Block a user