Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiselect to combobox #1325

Merged
merged 21 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 89 additions & 89 deletions lib/platform-bible-react/dist/index.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/platform-bible-react/dist/index.cjs.map

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions lib/platform-bible-react/dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,22 +669,33 @@ export type ComboBoxProps<T> = {
/** Additional css classes to help with unique styling of the combo box */
className?: string;
/**
* The selected value that the combo box currently holds. Must be shallow equal to one of the
* options entries.
* The selected value(s) that the combo box currently holds. Must be shallow equal to one or more
* of the options entries.
*/
value?: T;
value?: T | T[];
/** Triggers when content of textfield is changed */
onChange?: (newValue: T) => void;
/** Used to determine the string value for a given option. */
getOptionLabel?: (option: ComboBoxOption) => string;
/** Icon to be displayed on the button */
buttonIcon?: React$1.ReactNode;
/** Text displayed on button if `value` is undefined */
buttonPlaceholder?: string;
/** Placeholder text for text field */
textPlaceholder?: string;
/**
* Normally the selected value, if any, will be shown on the button. Enable this if you always
* want the button to show placeholder text
*/
alwaysShowPlaceholderOnButton?: boolean;
/** Allows hiding of the Chevrons on the right of the button */
hideChevrons?: boolean;
/** Text to display when no options match input */
commandEmptyMessage?: string;
/** Variant of button */
buttonVariant?: ButtonProps["variant"];
/** Option boolean to set if popover should stay open after clicking an entry */
keepOpen?: boolean;
/** Text direction ltr or rtl */
dir?: Direction;
/** Optional boolean to set if trigger should be disabled */
Expand All @@ -697,7 +708,7 @@ export type Direction = "ltr" | "rtl";
* Thanks to Shadcn for heavy inspiration and documentation
* https://ui.shadcn.com/docs/components/combobox
*/
export declare function ComboBox<T extends ComboBoxOption = ComboBoxOption>({ id, options, className, value, onChange, getOptionLabel, buttonPlaceholder, textPlaceholder, commandEmptyMessage, buttonVariant, dir, isDisabled, ...props }: ComboBoxProps<T>): import("react/jsx-runtime").JSX.Element;
export declare function ComboBox<T extends ComboBoxOption = ComboBoxOption>({ id, options, className, value, onChange, getOptionLabel, buttonIcon, buttonPlaceholder, textPlaceholder, alwaysShowPlaceholderOnButton, hideChevrons, commandEmptyMessage, buttonVariant, keepOpen, dir, isDisabled, ...props }: ComboBoxProps<T>): import("react/jsx-runtime").JSX.Element;
export type MenuItemInfoBase = {
/** Text (displayable in the UI) as the name of the menu item */
label: string;
Expand Down
Loading
Loading