@workday/canvas-kit-react 9.0.0-alpha.419-next.21 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/breadcrumbs/lib/BreadcrumbsItem.tsx +1 -1
- package/collection/index.ts +2 -0
- package/collection/lib/ListBox.tsx +12 -10
- package/collection/lib/useBaseListModel.tsx +6 -4
- package/collection/lib/useCursorListModel.tsx +1 -1
- package/collection/lib/useListActiveDescendant.ts +24 -0
- package/collection/lib/useListItemAllowChildStrings.ts +2 -1
- package/collection/lib/useListItemRegister.tsx +10 -3
- package/collection/lib/useListItemSelect.tsx +1 -1
- package/collection/lib/useListKeyboardHandler.ts +28 -0
- package/collection/lib/useListLoader.ts +116 -54
- package/collection/lib/useOverflowListItemMeasure.tsx +2 -2
- package/collection/lib/useOverflowListMeasure.ts +11 -13
- package/collection/lib/useOverflowListTarget.tsx +28 -30
- package/collection/lib/useSelectionListModel.tsx +1 -0
- package/combobox/LICENSE +52 -0
- package/combobox/README.md +7 -0
- package/combobox/index.ts +8 -0
- package/combobox/lib/Combobox.tsx +32 -0
- package/combobox/lib/ComboboxCard.tsx +33 -0
- package/combobox/lib/ComboboxInput.tsx +104 -0
- package/combobox/lib/ComboboxMenu.tsx +67 -0
- package/combobox/lib/ComboboxMenuItem.tsx +74 -0
- package/combobox/lib/ComboboxMenuList.tsx +45 -0
- package/combobox/lib/useComboboxInputOpenWithArrowKeys.ts +21 -0
- package/combobox/lib/useComboboxLoader.ts +72 -0
- package/combobox/lib/useComboboxModel.tsx +85 -0
- package/combobox/package.json +6 -0
- package/common/lib/utils/components.ts +15 -16
- package/common/lib/utils/models.ts +2 -2
- package/dist/commonjs/action-bar/lib/ActionBar.d.ts +2 -2
- package/dist/commonjs/action-bar/lib/ActionBarList.d.ts +1 -1
- package/dist/commonjs/action-bar/lib/useActionBarModel.d.ts +2 -2
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs.d.ts +2 -2
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsMenu.d.ts +1 -1
- package/dist/commonjs/breadcrumbs/lib/hooks/useBreadcrumbsModel.d.ts +2 -2
- package/dist/commonjs/collection/index.d.ts +2 -0
- package/dist/commonjs/collection/index.d.ts.map +1 -1
- package/dist/commonjs/collection/index.js +2 -0
- package/dist/commonjs/collection/lib/ListBox.d.ts +7 -6
- package/dist/commonjs/collection/lib/ListBox.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/ListBox.js +5 -3
- package/dist/commonjs/collection/lib/useBaseListModel.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useBaseListModel.js +4 -4
- package/dist/commonjs/collection/lib/useCursorListModel.d.ts +0 -34
- package/dist/commonjs/collection/lib/useCursorListModel.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useCursorListModel.js +1 -1
- package/dist/commonjs/collection/lib/useListActiveDescendant.d.ts +68 -0
- package/dist/commonjs/collection/lib/useListActiveDescendant.d.ts.map +1 -0
- package/dist/commonjs/collection/lib/useListActiveDescendant.js +25 -0
- package/dist/commonjs/collection/lib/useListItemAllowChildStrings.d.ts +2 -1
- package/dist/commonjs/collection/lib/useListItemAllowChildStrings.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListItemAllowChildStrings.js +2 -1
- package/dist/commonjs/collection/lib/useListItemRegister.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListItemRegister.js +5 -1
- package/dist/commonjs/collection/lib/useListKeyboardHandler.d.ts +66 -0
- package/dist/commonjs/collection/lib/useListKeyboardHandler.d.ts.map +1 -0
- package/dist/commonjs/collection/lib/useListKeyboardHandler.js +27 -0
- package/dist/commonjs/collection/lib/useListLoader.d.ts +46 -7
- package/dist/commonjs/collection/lib/useListLoader.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListLoader.js +61 -35
- package/dist/commonjs/collection/lib/useOverflowListMeasure.d.ts +1 -1
- package/dist/commonjs/collection/lib/useOverflowListMeasure.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useOverflowListTarget.d.ts +5 -2
- package/dist/commonjs/collection/lib/useOverflowListTarget.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useOverflowListTarget.js +1 -1
- package/dist/commonjs/collection/lib/useSelectionListModel.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useSelectionListModel.js +1 -0
- package/dist/commonjs/combobox/index.d.ts +9 -0
- package/dist/commonjs/combobox/index.d.ts.map +1 -0
- package/dist/commonjs/combobox/index.js +19 -0
- package/dist/commonjs/combobox/lib/Combobox.d.ts +2075 -0
- package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -0
- package/dist/commonjs/combobox/lib/Combobox.js +29 -0
- package/dist/commonjs/combobox/lib/ComboboxCard.d.ts +166 -0
- package/dist/commonjs/combobox/lib/ComboboxCard.d.ts.map +1 -0
- package/dist/commonjs/combobox/lib/ComboboxCard.js +25 -0
- package/dist/commonjs/combobox/lib/ComboboxInput.d.ts +186 -0
- package/dist/commonjs/combobox/lib/ComboboxInput.d.ts.map +1 -0
- package/dist/commonjs/combobox/lib/ComboboxInput.js +84 -0
- package/dist/commonjs/combobox/lib/ComboboxMenu.d.ts +428 -0
- package/dist/commonjs/combobox/lib/ComboboxMenu.d.ts.map +1 -0
- package/dist/commonjs/combobox/lib/ComboboxMenu.js +63 -0
- package/dist/commonjs/combobox/lib/ComboboxMenuItem.d.ts +178 -0
- package/dist/commonjs/combobox/lib/ComboboxMenuItem.d.ts.map +1 -0
- package/dist/commonjs/combobox/lib/ComboboxMenuItem.js +50 -0
- package/dist/commonjs/combobox/lib/ComboboxMenuList.d.ts +164 -0
- package/dist/commonjs/combobox/lib/ComboboxMenuList.d.ts.map +1 -0
- package/dist/commonjs/combobox/lib/ComboboxMenuList.js +31 -0
- package/dist/commonjs/combobox/lib/useComboboxInputOpenWithArrowKeys.d.ts +84 -0
- package/dist/commonjs/combobox/lib/useComboboxInputOpenWithArrowKeys.d.ts.map +1 -0
- package/dist/commonjs/combobox/lib/useComboboxInputOpenWithArrowKeys.js +20 -0
- package/dist/commonjs/combobox/lib/useComboboxLoader.d.ts +28 -0
- package/dist/commonjs/combobox/lib/useComboboxLoader.d.ts.map +1 -0
- package/dist/commonjs/combobox/lib/useComboboxLoader.js +65 -0
- package/dist/commonjs/combobox/lib/useComboboxModel.d.ts +1998 -0
- package/dist/commonjs/combobox/lib/useComboboxModel.d.ts.map +1 -0
- package/dist/commonjs/combobox/lib/useComboboxModel.js +82 -0
- package/dist/commonjs/common/lib/utils/components.d.ts +9 -23
- package/dist/commonjs/common/lib/utils/components.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/components.js +2 -2
- package/dist/commonjs/common/lib/utils/models.js +2 -2
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -0
- package/dist/commonjs/menu/index.d.ts +1 -1
- package/dist/commonjs/menu/index.d.ts.map +1 -1
- package/dist/commonjs/menu/index.js +2 -1
- package/dist/commonjs/menu/lib/Menu.d.ts +7 -5
- package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/Menu.js +6 -4
- package/dist/commonjs/menu/lib/MenuContextTarget.d.ts +2 -2
- package/dist/commonjs/menu/lib/MenuItem.d.ts +7 -1
- package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +9 -11
- package/dist/commonjs/menu/lib/MenuList.d.ts +3 -3
- package/dist/commonjs/menu/lib/MenuList.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuList.js +3 -2
- package/dist/commonjs/menu/lib/MenuPopper.d.ts +1 -1
- package/dist/commonjs/menu/lib/MenuTarget.d.ts +2 -2
- package/dist/commonjs/menu/lib/useMenuModel.d.ts +2 -2
- package/dist/commonjs/menu/lib/useMenuModel.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/useMenuModel.js +3 -5
- package/dist/commonjs/popup/lib/hooks/usePopupPopper.d.ts +1 -1
- package/dist/commonjs/popup/lib/hooks/usePopupTarget.d.ts +1 -1
- package/dist/commonjs/popup/lib/hooks/usePopupTargetContext.d.ts +1 -1
- package/dist/commonjs/tabs/lib/Tabs.d.ts +18 -120
- package/dist/commonjs/tabs/lib/Tabs.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +0 -1
- package/dist/commonjs/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsItem.js +0 -1
- package/dist/commonjs/tabs/lib/TabsList.d.ts +1 -1
- package/dist/commonjs/tabs/lib/TabsMenuPopper.d.ts +1 -1
- package/dist/commonjs/tabs/lib/TabsPanel.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/useTabsModel.d.ts +8 -20
- package/dist/commonjs/tabs/lib/useTabsModel.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/useTabsModel.js +1 -0
- package/dist/es6/action-bar/lib/ActionBar.d.ts +2 -2
- package/dist/es6/action-bar/lib/ActionBarList.d.ts +1 -1
- package/dist/es6/action-bar/lib/useActionBarModel.d.ts +2 -2
- package/dist/es6/breadcrumbs/lib/Breadcrumbs.d.ts +2 -2
- package/dist/es6/breadcrumbs/lib/BreadcrumbsMenu.d.ts +1 -1
- package/dist/es6/breadcrumbs/lib/hooks/useBreadcrumbsModel.d.ts +2 -2
- package/dist/es6/collection/index.d.ts +2 -0
- package/dist/es6/collection/index.d.ts.map +1 -1
- package/dist/es6/collection/index.js +2 -0
- package/dist/es6/collection/lib/ListBox.d.ts +7 -6
- package/dist/es6/collection/lib/ListBox.d.ts.map +1 -1
- package/dist/es6/collection/lib/ListBox.js +6 -4
- package/dist/es6/collection/lib/useBaseListModel.d.ts.map +1 -1
- package/dist/es6/collection/lib/useBaseListModel.js +4 -4
- package/dist/es6/collection/lib/useCursorListModel.d.ts +0 -34
- package/dist/es6/collection/lib/useCursorListModel.d.ts.map +1 -1
- package/dist/es6/collection/lib/useCursorListModel.js +1 -1
- package/dist/es6/collection/lib/useListActiveDescendant.d.ts +68 -0
- package/dist/es6/collection/lib/useListActiveDescendant.d.ts.map +1 -0
- package/dist/es6/collection/lib/useListActiveDescendant.js +22 -0
- package/dist/es6/collection/lib/useListItemAllowChildStrings.d.ts +2 -1
- package/dist/es6/collection/lib/useListItemAllowChildStrings.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListItemAllowChildStrings.js +2 -1
- package/dist/es6/collection/lib/useListItemRegister.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListItemRegister.js +5 -1
- package/dist/es6/collection/lib/useListKeyboardHandler.d.ts +66 -0
- package/dist/es6/collection/lib/useListKeyboardHandler.d.ts.map +1 -0
- package/dist/es6/collection/lib/useListKeyboardHandler.js +24 -0
- package/dist/es6/collection/lib/useListLoader.d.ts +46 -7
- package/dist/es6/collection/lib/useListLoader.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListLoader.js +61 -35
- package/dist/es6/collection/lib/useOverflowListMeasure.d.ts +1 -1
- package/dist/es6/collection/lib/useOverflowListMeasure.d.ts.map +1 -1
- package/dist/es6/collection/lib/useOverflowListTarget.d.ts +5 -2
- package/dist/es6/collection/lib/useOverflowListTarget.d.ts.map +1 -1
- package/dist/es6/collection/lib/useOverflowListTarget.js +1 -1
- package/dist/es6/collection/lib/useSelectionListModel.d.ts.map +1 -1
- package/dist/es6/collection/lib/useSelectionListModel.js +1 -0
- package/dist/es6/combobox/index.d.ts +9 -0
- package/dist/es6/combobox/index.d.ts.map +1 -0
- package/dist/es6/combobox/index.js +8 -0
- package/dist/es6/combobox/lib/Combobox.d.ts +2075 -0
- package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -0
- package/dist/es6/combobox/lib/Combobox.js +23 -0
- package/dist/es6/combobox/lib/ComboboxCard.d.ts +166 -0
- package/dist/es6/combobox/lib/ComboboxCard.d.ts.map +1 -0
- package/dist/es6/combobox/lib/ComboboxCard.js +19 -0
- package/dist/es6/combobox/lib/ComboboxInput.d.ts +186 -0
- package/dist/es6/combobox/lib/ComboboxInput.d.ts.map +1 -0
- package/dist/es6/combobox/lib/ComboboxInput.js +78 -0
- package/dist/es6/combobox/lib/ComboboxMenu.d.ts +428 -0
- package/dist/es6/combobox/lib/ComboboxMenu.d.ts.map +1 -0
- package/dist/es6/combobox/lib/ComboboxMenu.js +57 -0
- package/dist/es6/combobox/lib/ComboboxMenuItem.d.ts +178 -0
- package/dist/es6/combobox/lib/ComboboxMenuItem.d.ts.map +1 -0
- package/dist/es6/combobox/lib/ComboboxMenuItem.js +44 -0
- package/dist/es6/combobox/lib/ComboboxMenuList.d.ts +164 -0
- package/dist/es6/combobox/lib/ComboboxMenuList.d.ts.map +1 -0
- package/dist/es6/combobox/lib/ComboboxMenuList.js +25 -0
- package/dist/es6/combobox/lib/useComboboxInputOpenWithArrowKeys.d.ts +84 -0
- package/dist/es6/combobox/lib/useComboboxInputOpenWithArrowKeys.d.ts.map +1 -0
- package/dist/es6/combobox/lib/useComboboxInputOpenWithArrowKeys.js +17 -0
- package/dist/es6/combobox/lib/useComboboxLoader.d.ts +28 -0
- package/dist/es6/combobox/lib/useComboboxLoader.d.ts.map +1 -0
- package/dist/es6/combobox/lib/useComboboxLoader.js +58 -0
- package/dist/es6/combobox/lib/useComboboxModel.d.ts +1998 -0
- package/dist/es6/combobox/lib/useComboboxModel.d.ts.map +1 -0
- package/dist/es6/combobox/lib/useComboboxModel.js +76 -0
- package/dist/es6/common/lib/utils/components.d.ts +9 -23
- package/dist/es6/common/lib/utils/components.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/components.js +2 -2
- package/dist/es6/common/lib/utils/models.js +2 -2
- package/dist/es6/index.d.ts +1 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +1 -0
- package/dist/es6/menu/index.d.ts +1 -1
- package/dist/es6/menu/index.d.ts.map +1 -1
- package/dist/es6/menu/index.js +1 -1
- package/dist/es6/menu/lib/Menu.d.ts +7 -5
- package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
- package/dist/es6/menu/lib/Menu.js +6 -4
- package/dist/es6/menu/lib/MenuContextTarget.d.ts +2 -2
- package/dist/es6/menu/lib/MenuItem.d.ts +7 -1
- package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuItem.js +8 -10
- package/dist/es6/menu/lib/MenuList.d.ts +3 -3
- package/dist/es6/menu/lib/MenuList.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuList.js +4 -3
- package/dist/es6/menu/lib/MenuPopper.d.ts +1 -1
- package/dist/es6/menu/lib/MenuTarget.d.ts +2 -2
- package/dist/es6/menu/lib/useMenuModel.d.ts +2 -2
- package/dist/es6/menu/lib/useMenuModel.d.ts.map +1 -1
- package/dist/es6/menu/lib/useMenuModel.js +4 -6
- package/dist/es6/popup/lib/hooks/usePopupPopper.d.ts +1 -1
- package/dist/es6/popup/lib/hooks/usePopupTarget.d.ts +1 -1
- package/dist/es6/popup/lib/hooks/usePopupTargetContext.d.ts +1 -1
- package/dist/es6/tabs/lib/Tabs.d.ts +18 -120
- package/dist/es6/tabs/lib/Tabs.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsItem.d.ts +0 -1
- package/dist/es6/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsItem.js +0 -1
- package/dist/es6/tabs/lib/TabsList.d.ts +1 -1
- package/dist/es6/tabs/lib/TabsMenuPopper.d.ts +1 -1
- package/dist/es6/tabs/lib/TabsPanel.d.ts.map +1 -1
- package/dist/es6/tabs/lib/useTabsModel.d.ts +8 -20
- package/dist/es6/tabs/lib/useTabsModel.d.ts.map +1 -1
- package/dist/es6/tabs/lib/useTabsModel.js +1 -0
- package/index.ts +1 -0
- package/menu/index.ts +1 -1
- package/menu/lib/Menu.tsx +6 -4
- package/menu/lib/MenuItem.tsx +9 -12
- package/menu/lib/MenuList.tsx +16 -10
- package/menu/lib/useMenuModel.tsx +4 -7
- package/modal/lib/hooks/useModalHeading.ts +2 -2
- package/package.json +3 -3
- package/tabs/lib/TabsItem.tsx +10 -13
- package/tabs/lib/TabsPanel.tsx +1 -5
- package/tabs/lib/useTabsModel.tsx +1 -0
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ComboboxMenuProps {
|
|
3
|
+
/**
|
|
4
|
+
* Children of the {@link ComboboxMenu Combobox.Menu}.
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const ComboboxMenu: import("@workday/canvas-kit-react/common").ElementComponentM<React.FC<{}>, ComboboxMenuProps, {
|
|
9
|
+
state: {
|
|
10
|
+
stackRef: React.RefObject<HTMLDivElement>;
|
|
11
|
+
targetRef: React.RefObject<HTMLButtonElement>;
|
|
12
|
+
initialFocusRef: React.RefObject<any> | undefined;
|
|
13
|
+
returnFocusRef: React.RefObject<any> | undefined;
|
|
14
|
+
placement: import("@popperjs/core").Placement;
|
|
15
|
+
id: string;
|
|
16
|
+
visibility: "hidden" | "visible";
|
|
17
|
+
selectedIds: string[] | "all";
|
|
18
|
+
unselectedIds: string[];
|
|
19
|
+
cursorId: string;
|
|
20
|
+
columnCount: number;
|
|
21
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
22
|
+
cursorIndexRef: {
|
|
23
|
+
readonly current: number;
|
|
24
|
+
};
|
|
25
|
+
UNSTABLE_virtual: {
|
|
26
|
+
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
27
|
+
totalSize: number;
|
|
28
|
+
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
29
|
+
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
30
|
+
measure: () => void;
|
|
31
|
+
};
|
|
32
|
+
UNSTABLE_defaultItemHeight: number;
|
|
33
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
34
|
+
orientation: "horizontal" | "vertical";
|
|
35
|
+
indexRef: React.MutableRefObject<number>;
|
|
36
|
+
nonInteractiveIds: string[];
|
|
37
|
+
isVirtualized: boolean;
|
|
38
|
+
items: import("../..").Item<any>[];
|
|
39
|
+
mode: "multiple" | "single";
|
|
40
|
+
value: string | undefined;
|
|
41
|
+
inputRef: React.RefObject<HTMLInputElement>;
|
|
42
|
+
width: number;
|
|
43
|
+
};
|
|
44
|
+
events: {
|
|
45
|
+
setWidth(width: number): void;
|
|
46
|
+
updatePlacement(data: {
|
|
47
|
+
placement: import("@popperjs/core").Placement;
|
|
48
|
+
}): void;
|
|
49
|
+
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
50
|
+
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
51
|
+
select(data: {
|
|
52
|
+
id: string;
|
|
53
|
+
}): void;
|
|
54
|
+
selectAll(): void;
|
|
55
|
+
unselectAll(): void;
|
|
56
|
+
goTo(data: {
|
|
57
|
+
id: string;
|
|
58
|
+
}): void;
|
|
59
|
+
goToNext(): void;
|
|
60
|
+
goToPrevious(): void;
|
|
61
|
+
goToPreviousRow(): void;
|
|
62
|
+
goToNextRow(): void;
|
|
63
|
+
goToFirst(): void;
|
|
64
|
+
goToLast(): void;
|
|
65
|
+
goToFirstOfRow(): void;
|
|
66
|
+
goToLastOfRow(): void;
|
|
67
|
+
goToNextPage(): void;
|
|
68
|
+
goToPreviousPage(): void;
|
|
69
|
+
registerItem(data: {
|
|
70
|
+
item: any;
|
|
71
|
+
textValue: string;
|
|
72
|
+
}): void;
|
|
73
|
+
unregisterItem(data: {
|
|
74
|
+
id: string;
|
|
75
|
+
}): void;
|
|
76
|
+
updateItemHeight(data: {
|
|
77
|
+
value: number;
|
|
78
|
+
}): void;
|
|
79
|
+
};
|
|
80
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
81
|
+
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
82
|
+
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
83
|
+
getId: (item: any) => string;
|
|
84
|
+
}> & {
|
|
85
|
+
/**
|
|
86
|
+
* The "Popper" of a {@link ComboboxMenu Combobox.Menu}. The popper will appear around the
|
|
87
|
+
* {@link ComboboxInput Combobox.Input}. It renders a `div` element that is portalled to the
|
|
88
|
+
* `document.body` which is controlled by the {@link PopupStack}. The `PopupStack` is not part
|
|
89
|
+
* of React. This means no extra props given to this component will be forwarded to the `div`
|
|
90
|
+
* element, but the `ref` will be forwarded.
|
|
91
|
+
*/
|
|
92
|
+
Popper: import("@workday/canvas-kit-react/common").ElementComponentM<"div", import("../../menu/lib/MenuPopper").MenuPopperProps, {
|
|
93
|
+
state: {
|
|
94
|
+
stackRef: React.RefObject<HTMLDivElement>;
|
|
95
|
+
targetRef: React.RefObject<HTMLButtonElement>;
|
|
96
|
+
initialFocusRef: React.RefObject<any> | undefined;
|
|
97
|
+
returnFocusRef: React.RefObject<any> | undefined;
|
|
98
|
+
placement: import("@popperjs/core").Placement;
|
|
99
|
+
id: string;
|
|
100
|
+
visibility: "hidden" | "visible";
|
|
101
|
+
selectedIds: string[] | "all";
|
|
102
|
+
unselectedIds: string[];
|
|
103
|
+
cursorId: string;
|
|
104
|
+
columnCount: number;
|
|
105
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
106
|
+
cursorIndexRef: {
|
|
107
|
+
readonly current: number;
|
|
108
|
+
};
|
|
109
|
+
UNSTABLE_virtual: {
|
|
110
|
+
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
111
|
+
totalSize: number;
|
|
112
|
+
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
113
|
+
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
114
|
+
measure: () => void;
|
|
115
|
+
};
|
|
116
|
+
UNSTABLE_defaultItemHeight: number;
|
|
117
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
118
|
+
orientation: "horizontal" | "vertical";
|
|
119
|
+
indexRef: React.MutableRefObject<number>;
|
|
120
|
+
nonInteractiveIds: string[];
|
|
121
|
+
isVirtualized: boolean;
|
|
122
|
+
items: import("../..").Item<any>[];
|
|
123
|
+
mode: "multiple" | "single";
|
|
124
|
+
};
|
|
125
|
+
events: {
|
|
126
|
+
updatePlacement(data: {
|
|
127
|
+
placement: import("@popperjs/core").Placement;
|
|
128
|
+
}): void;
|
|
129
|
+
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
130
|
+
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
131
|
+
select(data: {
|
|
132
|
+
id: string;
|
|
133
|
+
}): void;
|
|
134
|
+
selectAll(): void;
|
|
135
|
+
unselectAll(): void;
|
|
136
|
+
goTo(data: {
|
|
137
|
+
id: string;
|
|
138
|
+
}): void;
|
|
139
|
+
goToNext(): void;
|
|
140
|
+
goToPrevious(): void;
|
|
141
|
+
goToPreviousRow(): void;
|
|
142
|
+
goToNextRow(): void;
|
|
143
|
+
goToFirst(): void;
|
|
144
|
+
goToLast(): void;
|
|
145
|
+
goToFirstOfRow(): void;
|
|
146
|
+
goToLastOfRow(): void;
|
|
147
|
+
goToNextPage(): void;
|
|
148
|
+
goToPreviousPage(): void;
|
|
149
|
+
registerItem(data: {
|
|
150
|
+
item: any;
|
|
151
|
+
textValue: string;
|
|
152
|
+
}): void;
|
|
153
|
+
unregisterItem(data: {
|
|
154
|
+
id: string;
|
|
155
|
+
}): void;
|
|
156
|
+
updateItemHeight(data: {
|
|
157
|
+
value: number;
|
|
158
|
+
}): void;
|
|
159
|
+
};
|
|
160
|
+
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
161
|
+
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
162
|
+
getId: (item: any) => string;
|
|
163
|
+
}>;
|
|
164
|
+
/**
|
|
165
|
+
* The combobox menu list follows the Collections API. A list can either contain static items or
|
|
166
|
+
* a render prop and `items` to the model.
|
|
167
|
+
*
|
|
168
|
+
* ```tsx
|
|
169
|
+
* const MyComponent = () => {
|
|
170
|
+
* const model = useComboboxModel({
|
|
171
|
+
* items: ['First Item', 'Second Item']
|
|
172
|
+
* })
|
|
173
|
+
*
|
|
174
|
+
* return (
|
|
175
|
+
* <Combobox model={model}>
|
|
176
|
+
* // other combobox subcomponents
|
|
177
|
+
* <Combobox.Menu.List>
|
|
178
|
+
* {(item) => <Combobox.Menu.Item>{item}</Combobox.Menu.Item>}
|
|
179
|
+
* </Combobox.Menu.List>
|
|
180
|
+
* </Combobox>
|
|
181
|
+
* )
|
|
182
|
+
* }
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
List: import("@workday/canvas-kit-react/common").ElementComponentM<"ul", import("./ComboboxMenuList").ComboboxMenuListProps<any>, {
|
|
186
|
+
state: {
|
|
187
|
+
stackRef: React.RefObject<HTMLDivElement>;
|
|
188
|
+
targetRef: React.RefObject<HTMLButtonElement>;
|
|
189
|
+
initialFocusRef: React.RefObject<any> | undefined;
|
|
190
|
+
returnFocusRef: React.RefObject<any> | undefined;
|
|
191
|
+
placement: import("@popperjs/core").Placement;
|
|
192
|
+
id: string;
|
|
193
|
+
visibility: "hidden" | "visible";
|
|
194
|
+
selectedIds: string[] | "all";
|
|
195
|
+
unselectedIds: string[];
|
|
196
|
+
cursorId: string;
|
|
197
|
+
columnCount: number;
|
|
198
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
199
|
+
cursorIndexRef: {
|
|
200
|
+
readonly current: number;
|
|
201
|
+
};
|
|
202
|
+
UNSTABLE_virtual: {
|
|
203
|
+
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
204
|
+
totalSize: number;
|
|
205
|
+
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
206
|
+
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
207
|
+
measure: () => void;
|
|
208
|
+
};
|
|
209
|
+
UNSTABLE_defaultItemHeight: number;
|
|
210
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
211
|
+
orientation: "horizontal" | "vertical";
|
|
212
|
+
indexRef: React.MutableRefObject<number>;
|
|
213
|
+
nonInteractiveIds: string[];
|
|
214
|
+
isVirtualized: boolean;
|
|
215
|
+
items: import("../..").Item<any>[];
|
|
216
|
+
mode: "multiple" | "single";
|
|
217
|
+
value: string | undefined;
|
|
218
|
+
inputRef: React.RefObject<HTMLInputElement>;
|
|
219
|
+
width: number;
|
|
220
|
+
};
|
|
221
|
+
events: {
|
|
222
|
+
setWidth(width: number): void;
|
|
223
|
+
updatePlacement(data: {
|
|
224
|
+
placement: import("@popperjs/core").Placement;
|
|
225
|
+
}): void;
|
|
226
|
+
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
227
|
+
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
228
|
+
select(data: {
|
|
229
|
+
id: string;
|
|
230
|
+
}): void;
|
|
231
|
+
selectAll(): void;
|
|
232
|
+
unselectAll(): void;
|
|
233
|
+
goTo(data: {
|
|
234
|
+
id: string;
|
|
235
|
+
}): void;
|
|
236
|
+
goToNext(): void;
|
|
237
|
+
goToPrevious(): void;
|
|
238
|
+
goToPreviousRow(): void;
|
|
239
|
+
goToNextRow(): void;
|
|
240
|
+
goToFirst(): void;
|
|
241
|
+
goToLast(): void;
|
|
242
|
+
goToFirstOfRow(): void;
|
|
243
|
+
goToLastOfRow(): void;
|
|
244
|
+
goToNextPage(): void;
|
|
245
|
+
goToPreviousPage(): void;
|
|
246
|
+
registerItem(data: {
|
|
247
|
+
item: any;
|
|
248
|
+
textValue: string;
|
|
249
|
+
}): void;
|
|
250
|
+
unregisterItem(data: {
|
|
251
|
+
id: string;
|
|
252
|
+
}): void;
|
|
253
|
+
updateItemHeight(data: {
|
|
254
|
+
value: number;
|
|
255
|
+
}): void;
|
|
256
|
+
};
|
|
257
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
258
|
+
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
259
|
+
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
260
|
+
getId: (item: any) => string;
|
|
261
|
+
}>;
|
|
262
|
+
/**
|
|
263
|
+
* `Combobox.Menu.Item` has an optional `data-id` prop that identifies the item in the
|
|
264
|
+
* `Combobox.Menu.List` and will be passed to the optional `onSelect` callback of the
|
|
265
|
+
* `ComboboxModel`. `Combobox.Menu.Item` can contain any HTML.
|
|
266
|
+
*/
|
|
267
|
+
Item: import("@workday/canvas-kit-react/common").ElementComponentM<"li", import("./ComboboxMenuItem").ComboboxMenuItemProps, {
|
|
268
|
+
state: {
|
|
269
|
+
stackRef: React.RefObject<HTMLDivElement>;
|
|
270
|
+
targetRef: React.RefObject<HTMLButtonElement>;
|
|
271
|
+
initialFocusRef: React.RefObject<any> | undefined;
|
|
272
|
+
returnFocusRef: React.RefObject<any> | undefined;
|
|
273
|
+
placement: import("@popperjs/core").Placement;
|
|
274
|
+
id: string;
|
|
275
|
+
visibility: "hidden" | "visible";
|
|
276
|
+
selectedIds: string[] | "all";
|
|
277
|
+
unselectedIds: string[];
|
|
278
|
+
cursorId: string;
|
|
279
|
+
columnCount: number;
|
|
280
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
281
|
+
cursorIndexRef: {
|
|
282
|
+
readonly current: number;
|
|
283
|
+
};
|
|
284
|
+
UNSTABLE_virtual: {
|
|
285
|
+
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
286
|
+
totalSize: number;
|
|
287
|
+
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
288
|
+
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
289
|
+
measure: () => void;
|
|
290
|
+
};
|
|
291
|
+
UNSTABLE_defaultItemHeight: number;
|
|
292
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
293
|
+
orientation: "horizontal" | "vertical";
|
|
294
|
+
indexRef: React.MutableRefObject<number>;
|
|
295
|
+
nonInteractiveIds: string[];
|
|
296
|
+
isVirtualized: boolean;
|
|
297
|
+
items: import("../..").Item<any>[];
|
|
298
|
+
mode: "multiple" | "single";
|
|
299
|
+
value: string | undefined;
|
|
300
|
+
inputRef: React.RefObject<HTMLInputElement>;
|
|
301
|
+
width: number;
|
|
302
|
+
};
|
|
303
|
+
events: {
|
|
304
|
+
setWidth(width: number): void;
|
|
305
|
+
updatePlacement(data: {
|
|
306
|
+
placement: import("@popperjs/core").Placement;
|
|
307
|
+
}): void;
|
|
308
|
+
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
309
|
+
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
310
|
+
select(data: {
|
|
311
|
+
id: string;
|
|
312
|
+
}): void;
|
|
313
|
+
selectAll(): void;
|
|
314
|
+
unselectAll(): void;
|
|
315
|
+
goTo(data: {
|
|
316
|
+
id: string;
|
|
317
|
+
}): void;
|
|
318
|
+
goToNext(): void;
|
|
319
|
+
goToPrevious(): void;
|
|
320
|
+
goToPreviousRow(): void;
|
|
321
|
+
goToNextRow(): void;
|
|
322
|
+
goToFirst(): void;
|
|
323
|
+
goToLast(): void;
|
|
324
|
+
goToFirstOfRow(): void;
|
|
325
|
+
goToLastOfRow(): void;
|
|
326
|
+
goToNextPage(): void;
|
|
327
|
+
goToPreviousPage(): void;
|
|
328
|
+
registerItem(data: {
|
|
329
|
+
item: any;
|
|
330
|
+
textValue: string;
|
|
331
|
+
}): void;
|
|
332
|
+
unregisterItem(data: {
|
|
333
|
+
id: string;
|
|
334
|
+
}): void;
|
|
335
|
+
updateItemHeight(data: {
|
|
336
|
+
value: number;
|
|
337
|
+
}): void;
|
|
338
|
+
};
|
|
339
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
340
|
+
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
341
|
+
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
342
|
+
getId: (item: any) => string;
|
|
343
|
+
}>;
|
|
344
|
+
/**
|
|
345
|
+
* `Combobox.Menu.Card` is a non-semantic element used to give the dropdown menu its distinct visual
|
|
346
|
+
* cue that the dropdown menu is floating above other content. `Combobox.Menu.Card` usually contains a
|
|
347
|
+
* `Combobox.Menu.List`, but it can also contain other elements like a header or footer.
|
|
348
|
+
*/
|
|
349
|
+
Card: import("@workday/canvas-kit-react/common").ElementComponentM<"div", import("./ComboboxCard").ComboboxCardProps, {
|
|
350
|
+
state: {
|
|
351
|
+
stackRef: React.RefObject<HTMLDivElement>;
|
|
352
|
+
targetRef: React.RefObject<HTMLButtonElement>;
|
|
353
|
+
initialFocusRef: React.RefObject<any> | undefined;
|
|
354
|
+
returnFocusRef: React.RefObject<any> | undefined;
|
|
355
|
+
placement: import("@popperjs/core").Placement;
|
|
356
|
+
id: string;
|
|
357
|
+
visibility: "hidden" | "visible";
|
|
358
|
+
selectedIds: string[] | "all";
|
|
359
|
+
unselectedIds: string[];
|
|
360
|
+
cursorId: string;
|
|
361
|
+
columnCount: number;
|
|
362
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
363
|
+
cursorIndexRef: {
|
|
364
|
+
readonly current: number;
|
|
365
|
+
};
|
|
366
|
+
UNSTABLE_virtual: {
|
|
367
|
+
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
368
|
+
totalSize: number;
|
|
369
|
+
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
370
|
+
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
371
|
+
measure: () => void;
|
|
372
|
+
};
|
|
373
|
+
UNSTABLE_defaultItemHeight: number;
|
|
374
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
375
|
+
orientation: "horizontal" | "vertical";
|
|
376
|
+
indexRef: React.MutableRefObject<number>;
|
|
377
|
+
nonInteractiveIds: string[];
|
|
378
|
+
isVirtualized: boolean;
|
|
379
|
+
items: import("../..").Item<any>[];
|
|
380
|
+
mode: "multiple" | "single";
|
|
381
|
+
value: string | undefined;
|
|
382
|
+
inputRef: React.RefObject<HTMLInputElement>;
|
|
383
|
+
width: number;
|
|
384
|
+
};
|
|
385
|
+
events: {
|
|
386
|
+
setWidth(width: number): void;
|
|
387
|
+
updatePlacement(data: {
|
|
388
|
+
placement: import("@popperjs/core").Placement;
|
|
389
|
+
}): void;
|
|
390
|
+
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
391
|
+
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
392
|
+
select(data: {
|
|
393
|
+
id: string;
|
|
394
|
+
}): void;
|
|
395
|
+
selectAll(): void;
|
|
396
|
+
unselectAll(): void;
|
|
397
|
+
goTo(data: {
|
|
398
|
+
id: string;
|
|
399
|
+
}): void;
|
|
400
|
+
goToNext(): void;
|
|
401
|
+
goToPrevious(): void;
|
|
402
|
+
goToPreviousRow(): void;
|
|
403
|
+
goToNextRow(): void;
|
|
404
|
+
goToFirst(): void;
|
|
405
|
+
goToLast(): void;
|
|
406
|
+
goToFirstOfRow(): void;
|
|
407
|
+
goToLastOfRow(): void;
|
|
408
|
+
goToNextPage(): void;
|
|
409
|
+
goToPreviousPage(): void;
|
|
410
|
+
registerItem(data: {
|
|
411
|
+
item: any;
|
|
412
|
+
textValue: string;
|
|
413
|
+
}): void;
|
|
414
|
+
unregisterItem(data: {
|
|
415
|
+
id: string;
|
|
416
|
+
}): void;
|
|
417
|
+
updateItemHeight(data: {
|
|
418
|
+
value: number;
|
|
419
|
+
}): void;
|
|
420
|
+
};
|
|
421
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
422
|
+
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
423
|
+
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
424
|
+
getId: (item: any) => string;
|
|
425
|
+
}>;
|
|
426
|
+
Divider: import("@workday/canvas-kit-react/common").ElementComponent<"hr", unknown>;
|
|
427
|
+
};
|
|
428
|
+
//# sourceMappingURL=ComboboxMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxMenu.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/ComboboxMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGrB;;;;;;OAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH;;;;;;;;;;;;;;;;;;;;OAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAML,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ComboboxMenu = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const common_1 = require("@workday/canvas-kit-react/common");
|
|
9
|
+
const menu_1 = require("@workday/canvas-kit-react/menu");
|
|
10
|
+
const useComboboxModel_1 = require("./useComboboxModel");
|
|
11
|
+
const ComboboxMenuList_1 = require("./ComboboxMenuList");
|
|
12
|
+
const ComboboxMenuItem_1 = require("./ComboboxMenuItem");
|
|
13
|
+
const ComboboxCard_1 = require("./ComboboxCard");
|
|
14
|
+
exports.ComboboxMenu = common_1.createSubcomponent()({
|
|
15
|
+
modelHook: useComboboxModel_1.useComboboxModel,
|
|
16
|
+
subComponents: {
|
|
17
|
+
/**
|
|
18
|
+
* The "Popper" of a {@link ComboboxMenu Combobox.Menu}. The popper will appear around the
|
|
19
|
+
* {@link ComboboxInput Combobox.Input}. It renders a `div` element that is portalled to the
|
|
20
|
+
* `document.body` which is controlled by the {@link PopupStack}. The `PopupStack` is not part
|
|
21
|
+
* of React. This means no extra props given to this component will be forwarded to the `div`
|
|
22
|
+
* element, but the `ref` will be forwarded.
|
|
23
|
+
*/
|
|
24
|
+
Popper: menu_1.Menu.Popper,
|
|
25
|
+
/**
|
|
26
|
+
* The combobox menu list follows the Collections API. A list can either contain static items or
|
|
27
|
+
* a render prop and `items` to the model.
|
|
28
|
+
*
|
|
29
|
+
* ```tsx
|
|
30
|
+
* const MyComponent = () => {
|
|
31
|
+
* const model = useComboboxModel({
|
|
32
|
+
* items: ['First Item', 'Second Item']
|
|
33
|
+
* })
|
|
34
|
+
*
|
|
35
|
+
* return (
|
|
36
|
+
* <Combobox model={model}>
|
|
37
|
+
* // other combobox subcomponents
|
|
38
|
+
* <Combobox.Menu.List>
|
|
39
|
+
* {(item) => <Combobox.Menu.Item>{item}</Combobox.Menu.Item>}
|
|
40
|
+
* </Combobox.Menu.List>
|
|
41
|
+
* </Combobox>
|
|
42
|
+
* )
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
List: ComboboxMenuList_1.ComboboxMenuList,
|
|
47
|
+
/**
|
|
48
|
+
* `Combobox.Menu.Item` has an optional `data-id` prop that identifies the item in the
|
|
49
|
+
* `Combobox.Menu.List` and will be passed to the optional `onSelect` callback of the
|
|
50
|
+
* `ComboboxModel`. `Combobox.Menu.Item` can contain any HTML.
|
|
51
|
+
*/
|
|
52
|
+
Item: ComboboxMenuItem_1.ComboboxMenuItem,
|
|
53
|
+
/**
|
|
54
|
+
* `Combobox.Menu.Card` is a non-semantic element used to give the dropdown menu its distinct visual
|
|
55
|
+
* cue that the dropdown menu is floating above other content. `Combobox.Menu.Card` usually contains a
|
|
56
|
+
* `Combobox.Menu.List`, but it can also contain other elements like a header or footer.
|
|
57
|
+
*/
|
|
58
|
+
Card: ComboboxCard_1.ComboboxCard,
|
|
59
|
+
Divider: menu_1.Menu.Divider,
|
|
60
|
+
},
|
|
61
|
+
})(({ children }, _, model) => {
|
|
62
|
+
return react_1.default.createElement(menu_1.Menu, { model: model }, children);
|
|
63
|
+
});
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ComboboxMenuItemProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* This hook sets up accessibility and behavior of a {@link ComboboxMenuItem Combobox.Menu.Item}
|
|
7
|
+
* component. It prevents focus when clicking so the focus stays on the
|
|
8
|
+
* {@link ComboboxInput Combobox.Input} component and selects an item when the user clicks on it. It
|
|
9
|
+
* also prevents items with an `aria-disabled` attribute from being selected. A `focus` CSS class is
|
|
10
|
+
* added when the item has "focus" (when the cursor is on the item).
|
|
11
|
+
*/
|
|
12
|
+
export declare const useComboboxMenuItem: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
13
|
+
state: {
|
|
14
|
+
stackRef: React.RefObject<HTMLDivElement>;
|
|
15
|
+
targetRef: React.RefObject<HTMLButtonElement>;
|
|
16
|
+
initialFocusRef: React.RefObject<any> | undefined;
|
|
17
|
+
returnFocusRef: React.RefObject<any> | undefined;
|
|
18
|
+
placement: import("@popperjs/core").Placement;
|
|
19
|
+
id: string;
|
|
20
|
+
visibility: "hidden" | "visible";
|
|
21
|
+
selectedIds: string[] | "all";
|
|
22
|
+
unselectedIds: string[];
|
|
23
|
+
cursorId: string;
|
|
24
|
+
columnCount: number;
|
|
25
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
26
|
+
cursorIndexRef: {
|
|
27
|
+
readonly current: number;
|
|
28
|
+
};
|
|
29
|
+
UNSTABLE_virtual: {
|
|
30
|
+
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
31
|
+
totalSize: number;
|
|
32
|
+
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
33
|
+
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
34
|
+
measure: () => void;
|
|
35
|
+
};
|
|
36
|
+
UNSTABLE_defaultItemHeight: number;
|
|
37
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
38
|
+
orientation: "horizontal" | "vertical";
|
|
39
|
+
indexRef: React.MutableRefObject<number>;
|
|
40
|
+
nonInteractiveIds: string[];
|
|
41
|
+
isVirtualized: boolean;
|
|
42
|
+
items: import("@workday/canvas-kit-react/collection").Item<any>[];
|
|
43
|
+
mode: "multiple" | "single";
|
|
44
|
+
};
|
|
45
|
+
events: {
|
|
46
|
+
updatePlacement(data: {
|
|
47
|
+
placement: import("@popperjs/core").Placement;
|
|
48
|
+
}): void;
|
|
49
|
+
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
50
|
+
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
51
|
+
select(data: {
|
|
52
|
+
id: string;
|
|
53
|
+
}): void;
|
|
54
|
+
selectAll(): void;
|
|
55
|
+
unselectAll(): void;
|
|
56
|
+
goTo(data: {
|
|
57
|
+
id: string;
|
|
58
|
+
}): void;
|
|
59
|
+
goToNext(): void;
|
|
60
|
+
goToPrevious(): void;
|
|
61
|
+
goToPreviousRow(): void;
|
|
62
|
+
goToNextRow(): void;
|
|
63
|
+
goToFirst(): void;
|
|
64
|
+
goToLast(): void;
|
|
65
|
+
goToFirstOfRow(): void;
|
|
66
|
+
goToLastOfRow(): void;
|
|
67
|
+
goToNextPage(): void;
|
|
68
|
+
goToPreviousPage(): void;
|
|
69
|
+
registerItem(data: {
|
|
70
|
+
item: any;
|
|
71
|
+
textValue: string;
|
|
72
|
+
}): void;
|
|
73
|
+
unregisterItem(data: {
|
|
74
|
+
id: string;
|
|
75
|
+
}): void;
|
|
76
|
+
updateItemHeight(data: {
|
|
77
|
+
value: number;
|
|
78
|
+
}): void;
|
|
79
|
+
};
|
|
80
|
+
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
81
|
+
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
82
|
+
getId: (item: any) => string;
|
|
83
|
+
}, {
|
|
84
|
+
readonly role: "option";
|
|
85
|
+
readonly 'aria-selected': true | undefined;
|
|
86
|
+
readonly onMouseDown: (event: React.MouseEvent<HTMLElement>) => void;
|
|
87
|
+
readonly className: "" | "focus";
|
|
88
|
+
} & {
|
|
89
|
+
ref: (instance: HTMLElement | null) => void;
|
|
90
|
+
'data-id': string;
|
|
91
|
+
disabled: boolean | undefined;
|
|
92
|
+
item: null;
|
|
93
|
+
virtual: null;
|
|
94
|
+
'aria-setsize': number | undefined;
|
|
95
|
+
'aria-posinset': number | undefined;
|
|
96
|
+
style: React.CSSProperties;
|
|
97
|
+
id: string;
|
|
98
|
+
} & {
|
|
99
|
+
'data-id'?: string | undefined;
|
|
100
|
+
}>;
|
|
101
|
+
export declare const ComboboxMenuItem: import("@workday/canvas-kit-react/common").ElementComponentM<"li", ComboboxMenuItemProps, {
|
|
102
|
+
state: {
|
|
103
|
+
stackRef: React.RefObject<HTMLDivElement>;
|
|
104
|
+
targetRef: React.RefObject<HTMLButtonElement>;
|
|
105
|
+
initialFocusRef: React.RefObject<any> | undefined;
|
|
106
|
+
returnFocusRef: React.RefObject<any> | undefined;
|
|
107
|
+
placement: import("@popperjs/core").Placement;
|
|
108
|
+
id: string;
|
|
109
|
+
visibility: "hidden" | "visible";
|
|
110
|
+
selectedIds: string[] | "all";
|
|
111
|
+
unselectedIds: string[];
|
|
112
|
+
cursorId: string;
|
|
113
|
+
columnCount: number;
|
|
114
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
115
|
+
cursorIndexRef: {
|
|
116
|
+
readonly current: number;
|
|
117
|
+
};
|
|
118
|
+
UNSTABLE_virtual: {
|
|
119
|
+
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
120
|
+
totalSize: number;
|
|
121
|
+
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
122
|
+
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
123
|
+
measure: () => void;
|
|
124
|
+
};
|
|
125
|
+
UNSTABLE_defaultItemHeight: number;
|
|
126
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
127
|
+
orientation: "horizontal" | "vertical";
|
|
128
|
+
indexRef: React.MutableRefObject<number>;
|
|
129
|
+
nonInteractiveIds: string[];
|
|
130
|
+
isVirtualized: boolean;
|
|
131
|
+
items: import("@workday/canvas-kit-react/collection").Item<any>[];
|
|
132
|
+
mode: "multiple" | "single";
|
|
133
|
+
value: string | undefined;
|
|
134
|
+
inputRef: React.RefObject<HTMLInputElement>;
|
|
135
|
+
width: number;
|
|
136
|
+
};
|
|
137
|
+
events: {
|
|
138
|
+
setWidth(width: number): void;
|
|
139
|
+
updatePlacement(data: {
|
|
140
|
+
placement: import("@popperjs/core").Placement;
|
|
141
|
+
}): void;
|
|
142
|
+
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
143
|
+
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
144
|
+
select(data: {
|
|
145
|
+
id: string;
|
|
146
|
+
}): void;
|
|
147
|
+
selectAll(): void;
|
|
148
|
+
unselectAll(): void;
|
|
149
|
+
goTo(data: {
|
|
150
|
+
id: string;
|
|
151
|
+
}): void;
|
|
152
|
+
goToNext(): void;
|
|
153
|
+
goToPrevious(): void;
|
|
154
|
+
goToPreviousRow(): void;
|
|
155
|
+
goToNextRow(): void;
|
|
156
|
+
goToFirst(): void;
|
|
157
|
+
goToLast(): void;
|
|
158
|
+
goToFirstOfRow(): void;
|
|
159
|
+
goToLastOfRow(): void;
|
|
160
|
+
goToNextPage(): void;
|
|
161
|
+
goToPreviousPage(): void;
|
|
162
|
+
registerItem(data: {
|
|
163
|
+
item: any;
|
|
164
|
+
textValue: string;
|
|
165
|
+
}): void;
|
|
166
|
+
unregisterItem(data: {
|
|
167
|
+
id: string;
|
|
168
|
+
}): void;
|
|
169
|
+
updateItemHeight(data: {
|
|
170
|
+
value: number;
|
|
171
|
+
}): void;
|
|
172
|
+
};
|
|
173
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
174
|
+
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
175
|
+
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
176
|
+
getId: (item: any) => string;
|
|
177
|
+
}>;
|
|
178
|
+
//# sourceMappingURL=ComboboxMenuItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxMenuItem.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/ComboboxMenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAGA,gBAAgB,CAAC,WAAW,CAAC;;;;;;;;;;;;;;EA8B5D,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW3B,CAAC"}
|