feat(interface/menu): checkbox

feat(package/interface/menu): checkbox
feat(web/menu/list): checkbox
feat(web/menu/list): checkbox option for ListItem
feat(web/menu/list): custom checkbox
This commit is contained in:
BerkieBb
2022-10-29 12:23:15 +02:00
committed by Luke
parent de23227ea7
commit 5ba1a3b8f9
5 changed files with 125 additions and 30 deletions

View File

@@ -1,11 +1,12 @@
import { IconName, IconPrefix } from '@fortawesome/fontawesome-common-types';
type MenuPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
type ChangeFunction = (selected: number, scrollIndex: number | null, args: any | null) => void;
type ChangeFunction = (selected: number, scrollIndex?: number, args?: any, checked?: boolean) => void;
interface MenuOptions {
label: string;
icon?: IconName | [IconPrefix, IconName];
checked?: boolean;
values?: Array<string | { label: string; description: string }>;
description?: string;
defaultIndex?: number;
@@ -23,6 +24,7 @@ interface MenuProps {
onClose?: (keyPressed?: 'Escape' | 'Backspace') => void;
onSelected?: ChangeFunction;
onSideScroll?: ChangeFunction;
onChecked?: ChangeFunction;
cb?: ChangeFunction;
}