@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
|
@@ -61,6 +61,7 @@ export declare const Breadcrumbs: import("@workday/canvas-kit-react/common").Ele
|
|
|
61
61
|
orientation: import("../../collection/lib/useBaseListModel").Orientation;
|
|
62
62
|
menuConfig: Partial<{
|
|
63
63
|
mode: "multiple" | "single";
|
|
64
|
+
shouldVirtualize: boolean;
|
|
64
65
|
returnFocusRef: React.RefObject<any> | undefined;
|
|
65
66
|
initialFocusRef: React.RefObject<any> | undefined;
|
|
66
67
|
id: string;
|
|
@@ -77,7 +78,6 @@ export declare const Breadcrumbs: import("@workday/canvas-kit-react/common").Ele
|
|
|
77
78
|
nonInteractiveIds: string[];
|
|
78
79
|
orientation: import("../../collection/lib/useBaseListModel").Orientation;
|
|
79
80
|
defaultItemHeight: number;
|
|
80
|
-
shouldVirtualize: boolean;
|
|
81
81
|
items: any[];
|
|
82
82
|
}>;
|
|
83
83
|
initialHiddenIds: string[];
|
|
@@ -2343,6 +2343,7 @@ export declare const Breadcrumbs: import("@workday/canvas-kit-react/common").Ele
|
|
|
2343
2343
|
*/
|
|
2344
2344
|
Menu: import("@workday/canvas-kit-react/common").ComponentM<import("../../menu/lib/Menu").MenuProps & Partial<{
|
|
2345
2345
|
mode: "multiple" | "single";
|
|
2346
|
+
shouldVirtualize: boolean;
|
|
2346
2347
|
returnFocusRef: React.RefObject<any> | undefined;
|
|
2347
2348
|
initialFocusRef: React.RefObject<any> | undefined;
|
|
2348
2349
|
id: string;
|
|
@@ -2359,7 +2360,6 @@ export declare const Breadcrumbs: import("@workday/canvas-kit-react/common").Ele
|
|
|
2359
2360
|
nonInteractiveIds: string[];
|
|
2360
2361
|
orientation: import("../../collection/lib/useBaseListModel").Orientation;
|
|
2361
2362
|
defaultItemHeight: number;
|
|
2362
|
-
shouldVirtualize: boolean;
|
|
2363
2363
|
items: any[];
|
|
2364
2364
|
}> & {
|
|
2365
2365
|
onUpdatePlacement?: ((data: {
|
|
@@ -75,6 +75,7 @@ export declare const BreadcrumbsMenuItem: import("@workday/canvas-kit-react/comm
|
|
|
75
75
|
}, {}>>;
|
|
76
76
|
export declare const BreadcrumbsMenu: import("@workday/canvas-kit-react/common").ComponentM<import("../../menu/lib/Menu").MenuProps & Partial<{
|
|
77
77
|
mode: "multiple" | "single";
|
|
78
|
+
shouldVirtualize: boolean;
|
|
78
79
|
returnFocusRef: React.RefObject<any> | undefined;
|
|
79
80
|
initialFocusRef: React.RefObject<any> | undefined;
|
|
80
81
|
id: string;
|
|
@@ -91,7 +92,6 @@ export declare const BreadcrumbsMenu: import("@workday/canvas-kit-react/common")
|
|
|
91
92
|
nonInteractiveIds: string[];
|
|
92
93
|
orientation: import("../../collection/lib/useBaseListModel").Orientation;
|
|
93
94
|
defaultItemHeight: number;
|
|
94
|
-
shouldVirtualize: boolean;
|
|
95
95
|
items: any[];
|
|
96
96
|
}> & {
|
|
97
97
|
onUpdatePlacement?: ((data: {
|
|
@@ -13,6 +13,7 @@ export declare const useBreadcrumbsModel: (<TT_Special_Generic>(config?: (Partia
|
|
|
13
13
|
orientation: import("../../../collection/lib/useBaseListModel").Orientation;
|
|
14
14
|
menuConfig: Partial<{
|
|
15
15
|
mode: "multiple" | "single";
|
|
16
|
+
shouldVirtualize: boolean;
|
|
16
17
|
returnFocusRef: React.RefObject<any> | undefined;
|
|
17
18
|
initialFocusRef: React.RefObject<any> | undefined;
|
|
18
19
|
id: string;
|
|
@@ -29,7 +30,6 @@ export declare const useBreadcrumbsModel: (<TT_Special_Generic>(config?: (Partia
|
|
|
29
30
|
nonInteractiveIds: string[];
|
|
30
31
|
orientation: import("../../../collection/lib/useBaseListModel").Orientation;
|
|
31
32
|
defaultItemHeight: number;
|
|
32
|
-
shouldVirtualize: boolean;
|
|
33
33
|
items: any[];
|
|
34
34
|
}>;
|
|
35
35
|
initialHiddenIds: string[];
|
|
@@ -1600,6 +1600,7 @@ export declare const useBreadcrumbsModel: (<TT_Special_Generic>(config?: (Partia
|
|
|
1600
1600
|
orientation: import("../../../collection/lib/useBaseListModel").Orientation;
|
|
1601
1601
|
menuConfig: Partial<{
|
|
1602
1602
|
mode: "multiple" | "single";
|
|
1603
|
+
shouldVirtualize: boolean;
|
|
1603
1604
|
returnFocusRef: React.RefObject<any> | undefined;
|
|
1604
1605
|
initialFocusRef: React.RefObject<any> | undefined;
|
|
1605
1606
|
id: string;
|
|
@@ -1616,7 +1617,6 @@ export declare const useBreadcrumbsModel: (<TT_Special_Generic>(config?: (Partia
|
|
|
1616
1617
|
nonInteractiveIds: string[];
|
|
1617
1618
|
orientation: import("../../../collection/lib/useBaseListModel").Orientation;
|
|
1618
1619
|
defaultItemHeight: number;
|
|
1619
|
-
shouldVirtualize: boolean;
|
|
1620
1620
|
items: any[];
|
|
1621
1621
|
}>;
|
|
1622
1622
|
initialHiddenIds: string[];
|
|
@@ -8,9 +8,11 @@ export * from './lib/useListRenderItem';
|
|
|
8
8
|
export * from './lib/useListResetCursorOnBlur';
|
|
9
9
|
export * from './lib/useListItemRovingFocus';
|
|
10
10
|
export * from './lib/useListItemSelect';
|
|
11
|
+
export * from './lib/useListKeyboardHandler';
|
|
11
12
|
export * from './lib/useListLoader';
|
|
12
13
|
export * from './lib/useListModel';
|
|
13
14
|
export * from './lib/useGridModel';
|
|
15
|
+
export * from './lib/useListActiveDescendant';
|
|
14
16
|
export * from './lib/useListItemAllowChildStrings';
|
|
15
17
|
export { ListBox, ListBoxProps } from './lib/ListBox';
|
|
16
18
|
export { singleSelectionManager, multiSelectionManager, isSelected, } from './lib/useSelectionListModel';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../collection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAC1D,cAAc,2BAA2B,CAAC;AAC1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AyB,EAAE,iBAAiB,EAAC,MAAM,0BAA0B,CAAC"}
|
|
@@ -8,9 +8,11 @@ export * from './lib/useListRenderItem';
|
|
|
8
8
|
export * from './lib/useListResetCursorOnBlur';
|
|
9
9
|
export * from './lib/useListItemRovingFocus';
|
|
10
10
|
export * from './lib/useListItemSelect';
|
|
11
|
+
export * from './lib/useListKeyboardHandler';
|
|
11
12
|
export * from './lib/useListLoader';
|
|
12
13
|
export * from './lib/useListModel';
|
|
13
14
|
export * from './lib/useGridModel';
|
|
15
|
+
export * from './lib/useListActiveDescendant';
|
|
14
16
|
export * from './lib/useListItemAllowChildStrings';
|
|
15
17
|
export { ListBox } from './lib/ListBox';
|
|
16
18
|
export { singleSelectionManager, multiSelectionManager, isSelected, } from './lib/useSelectionListModel';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
4
|
+
export interface ListBoxProps<T = any> extends Omit<ExtractProps<typeof Flex, never>, 'children'> {
|
|
5
|
+
children?: React.ReactNode | ((item: T, index: number) => React.ReactNode);
|
|
5
6
|
}
|
|
6
|
-
export declare const ListBoxItem: import("@workday/canvas-kit-react/common").ElementComponentM<"li", BoxProps, {
|
|
7
|
+
export declare const ListBoxItem: import("@workday/canvas-kit-react/common").ElementComponentM<"li", Omit<import("@workday/canvas-kit-react/layout").BoxProps, "display"> & import("@workday/canvas-kit-react/layout").FlexStyleProps, {
|
|
7
8
|
state: {
|
|
8
9
|
selectedIds: string[] | "all";
|
|
9
10
|
unselectedIds: string[];
|
|
@@ -145,7 +146,7 @@ export declare const useListBox: import("@workday/canvas-kit-react/common").Beha
|
|
|
145
146
|
* - Inner Box: The element responsible for the virtual container. Height is controlled by the model
|
|
146
147
|
* and cannot be changed by the developer. All props and ref will be spread to this element.
|
|
147
148
|
*/
|
|
148
|
-
export declare const ListBox: import("@workday/canvas-kit-react/common").ElementComponentM<"ul", ListBoxProps & Partial<{
|
|
149
|
+
export declare const ListBox: import("@workday/canvas-kit-react/common").ElementComponentM<"ul", ListBoxProps<any> & Partial<{
|
|
149
150
|
initialSelectedIds: import("./useSelectionListModel").SelectedIds;
|
|
150
151
|
initialUnselectedIds: string[];
|
|
151
152
|
selection: import("./useSelectionListModel").SelectionManager;
|
|
@@ -1104,7 +1105,7 @@ export declare const ListBox: import("@workday/canvas-kit-react/common").Element
|
|
|
1104
1105
|
* functionality. `elemPropsHook` is provided on all compound components and is useful in the
|
|
1105
1106
|
* example to add additional functionality without making a new component.
|
|
1106
1107
|
*/
|
|
1107
|
-
Item: import("@workday/canvas-kit-react/common").ElementComponentM<"li", BoxProps, {
|
|
1108
|
+
Item: import("@workday/canvas-kit-react/common").ElementComponentM<"li", Omit<import("@workday/canvas-kit-react/layout").BoxProps, "display"> & import("@workday/canvas-kit-react/layout").FlexStyleProps, {
|
|
1108
1109
|
state: {
|
|
1109
1110
|
selectedIds: string[] | "all";
|
|
1110
1111
|
unselectedIds: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBox.d.ts","sourceRoot":"","sources":["../../../../collection/lib/ListBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ListBox.d.ts","sourceRoot":"","sources":["../../../../collection/lib/ListBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIL,YAAY,EACb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAM,IAAI,EAAC,MAAM,kCAAkC,CAAC;AAM3D,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,EAAE,KAAK,CAAC,EAAE,UAAU,CAAC;IAC/F,QAAQ,CAAC,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKhB;;;;;;;;OAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBL,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createContainer, createElemPropsHook, createSubcomponent, } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { Box } from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import { Box, Flex } from '@workday/canvas-kit-react/layout';
|
|
4
4
|
import { useListModel } from './useListModel';
|
|
5
5
|
import { useListRenderItems } from './useListRenderItem';
|
|
6
6
|
import { useListItemRegister } from './useListItemRegister';
|
|
@@ -52,8 +52,10 @@ export const ListBox = createContainer('ul')({
|
|
|
52
52
|
*/
|
|
53
53
|
Item: ListBoxItem,
|
|
54
54
|
},
|
|
55
|
-
})(({ height, maxHeight, ...elemProps }, Element, model) => {
|
|
55
|
+
})(({ height, maxHeight, marginY, ...elemProps }, Element, model) => {
|
|
56
|
+
// We're moving `marginY` to the container to not interfere with the virtualization size. We set
|
|
57
|
+
// the `marginY` on the Flex to `0` to avoid inaccurate scrollbars
|
|
56
58
|
// TODO figure out what style props should go to which `Box`
|
|
57
|
-
return (React.createElement(Box, { ref: model.state.containerRef,
|
|
58
|
-
React.createElement(
|
|
59
|
+
return (React.createElement(Box, { ref: model.state.containerRef, marginY: marginY, maxHeight: maxHeight, overflowY: model.state.orientation === 'vertical' ? 'auto' : undefined },
|
|
60
|
+
React.createElement(Flex, Object.assign({ as: Element, flexDirection: "column" }, elemProps, { marginY: 0 }), useListRenderItems(model, elemProps.children))));
|
|
59
61
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBaseListModel.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useBaseListModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAA+B,OAAO,EAAC,MAAM,kCAAkC,CAAC;AAEvF,oBAAY,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;AAEpD,eAAO,MAAM,YAAY,SAAU,GAAG,KAAG,MAExC,CAAC;AAEF,eAAO,MAAM,mBAAmB,SAAU,GAAG,KAAG,MAE/C,CAAC;AAEF,MAAM,WAAW,IAAI,CAAC,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC;IACT;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmDD,eAAO,MAAM,gBAAgB;IAGzB,kEAAkE;;IAElE;;;;;;OAMG;kBACW,OAAO;
|
|
1
|
+
{"version":3,"file":"useBaseListModel.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useBaseListModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAA+B,OAAO,EAAC,MAAM,kCAAkC,CAAC;AAEvF,oBAAY,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;AAEpD,eAAO,MAAM,YAAY,SAAU,GAAG,KAAG,MAExC,CAAC;AAEF,eAAO,MAAM,mBAAmB,SAAU,GAAG,KAAG,MAE/C,CAAC;AAEF,MAAM,WAAW,IAAI,CAAC,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC;IACT;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CA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oB;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC;;;;;;;;;;;;;;;;;eAvDZ,KAAK,OAAO,CAAC,EAAE;;;QAiBzC;;;WAGG;2BACgB;YAAC,IAAI,EAAE,OAAO,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAC;QAWrD;;;WAGG;;gBACuB,MAAM;;QAUhC;;;;;;;;WAQG;+BACoB;YAAC,KAAK,EAAE,MAAM,CAAA;SAAC;;kBAhIxB,OAAO;EAsIvB,CAAC"}
|
|
@@ -2,10 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { useVirtual } from './react-virtual';
|
|
3
3
|
import { useUniqueId, createModelHook } from '@workday/canvas-kit-react/common';
|
|
4
4
|
export const defaultGetId = (item) => {
|
|
5
|
-
return item.id || '';
|
|
5
|
+
return typeof item === 'string' ? item : item.id || '';
|
|
6
6
|
};
|
|
7
7
|
export const defaultGetTextValue = (item) => {
|
|
8
|
-
return item.text || '';
|
|
8
|
+
return typeof item === 'string' ? item : item.text || '';
|
|
9
9
|
};
|
|
10
10
|
// interface Collection<T> {
|
|
11
11
|
// getKeys(): string[];
|
|
@@ -54,13 +54,13 @@ export const useBaseListModel = createModelHook({
|
|
|
54
54
|
* JSX, the list will create an internal array of items where `id` is the only property and the
|
|
55
55
|
* default `getId` will return the desired result.
|
|
56
56
|
*/
|
|
57
|
-
getId: (item) => item.id,
|
|
57
|
+
getId: (item) => typeof item === 'string' ? item : item === undefined ? '' : item.id,
|
|
58
58
|
/**
|
|
59
59
|
* Optional function to return the text representation of an item. If not provided, the default
|
|
60
60
|
* function will return the `text` property of the object of each item or an empty string if
|
|
61
61
|
* there is no `text` property. If you did not provide `items`, do not override this function.
|
|
62
62
|
*/
|
|
63
|
-
getTextValue: (item) => (item.text || ''),
|
|
63
|
+
getTextValue: (item) => (typeof item === 'string' ? item : item === undefined ? '' : item.text || ''),
|
|
64
64
|
/**
|
|
65
65
|
* Array of all ids which are currently disabled. This is used for navigation to skip over items
|
|
66
66
|
* which are not focusable.
|
|
@@ -139,23 +139,6 @@ export declare const useCursorListModel: (<TT_Special_Generic>(config?: (Partial
|
|
|
139
139
|
pageSize: number;
|
|
140
140
|
id: string;
|
|
141
141
|
getId: (item: any) => string;
|
|
142
|
-
/**
|
|
143
|
-
* Factory function that does type checking to create navigation managers. Navigation managers
|
|
144
|
-
* are expected to handle all methods of a grid. If your use-case isn't meant to handle a grid,
|
|
145
|
-
* pick one of the existing navigation managers and override the methods you wish to implement.
|
|
146
|
-
*
|
|
147
|
-
* For example,
|
|
148
|
-
* ```tsx
|
|
149
|
-
* import {createNavigationManager, wrappingNavigationManager} from '@workday/canvas-kit-react/collection'
|
|
150
|
-
*
|
|
151
|
-
* const navigationManager = createNavigationManager({
|
|
152
|
-
* ...wrappingNavigationManager,
|
|
153
|
-
* getNext(id, {state}) {
|
|
154
|
-
* //
|
|
155
|
-
* }
|
|
156
|
-
* })
|
|
157
|
-
* ```
|
|
158
|
-
*/
|
|
159
142
|
getTextValue: (item: any) => string;
|
|
160
143
|
nonInteractiveIds: string[];
|
|
161
144
|
orientation: import("./useBaseListModel").Orientation;
|
|
@@ -1425,23 +1408,6 @@ export declare const useCursorListModel: (<TT_Special_Generic>(config?: (Partial
|
|
|
1425
1408
|
pageSize: number;
|
|
1426
1409
|
id: string;
|
|
1427
1410
|
getId: (item: any) => string;
|
|
1428
|
-
/**
|
|
1429
|
-
* Factory function that does type checking to create navigation managers. Navigation managers
|
|
1430
|
-
* are expected to handle all methods of a grid. If your use-case isn't meant to handle a grid,
|
|
1431
|
-
* pick one of the existing navigation managers and override the methods you wish to implement.
|
|
1432
|
-
*
|
|
1433
|
-
* For example,
|
|
1434
|
-
* ```tsx
|
|
1435
|
-
* import {createNavigationManager, wrappingNavigationManager} from '@workday/canvas-kit-react/collection'
|
|
1436
|
-
*
|
|
1437
|
-
* const navigationManager = createNavigationManager({
|
|
1438
|
-
* ...wrappingNavigationManager,
|
|
1439
|
-
* getNext(id, {state}) {
|
|
1440
|
-
* //
|
|
1441
|
-
* }
|
|
1442
|
-
* })
|
|
1443
|
-
* ```
|
|
1444
|
-
*/
|
|
1445
1411
|
getTextValue: (item: any) => string;
|
|
1446
1412
|
nonInteractiveIds: string[];
|
|
1447
1413
|
orientation: import("./useBaseListModel").Orientation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCursorListModel.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useCursorListModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0B,OAAO,EAAC,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAmB,IAAI,EAAC,MAAM,oBAAoB,CAAC;AAE1D,aAAK,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,EAAE,OAAO,CAAC,CAAC;AAE5E;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;0CACsC;IACtC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;mCAC+B;IAC/B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,0CAA0C;IAC1C,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/D;2FACuF;IACvF,OAAO,EAAE,mBAAmB,CAAC;IAC7B;uCACmC;IACnC,UAAU,EAAE,mBAAmB,CAAC;IAChC;+FAC2F;IAC3F,WAAW,EAAE,mBAAmB,CAAC;IACjC;0CACsC;IACtC,cAAc,EAAE,mBAAmB,CAAC;IACpC;kBACc;IACd,aAAa,EAAE,mBAAmB,CAAC;IACnC;kBACc;IACd,YAAY,EAAE,mBAAmB,CAAC;IAClC;;yEAEqE;IACrE,WAAW,EAAE,mBAAmB,CAAC;IACjC;;gFAE4E;IAC5E,eAAe,EAAE,mBAAmB,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,uBAAuB,YAAa,iBAA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wDAAwD;;IAExD;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;;;;OAMG;;0BArCyD,MAAM;;;;;;;;;;;;;;;;;;IA2ClE,mEAAmE;eACxD;QAAC,EAAE,EAAE,MAAM,CAAA;KAAC;IAIvB;;;;;OAKG;;IAKH;;;OAGG;;IAKH;;;;;OAKG;;IAOH;;;;;OAKG;;IAKH,mDAAmD;;IAKnD,kDAAkD;;;;;;;;;;;;;;;;;;QA3ElD,wDAAwD;;QAExD;;;;WAIG;;QAEH;;;WAGG;;QAEH;;;;;;WAMG;;8BArCyD,MAAM;;;;;;;;;;;;;;;;;;;QA2ClE,mEAAmE;mBACxD;YAAC,EAAE,EAAE,MAAM,CAAA;SAAC;QAIvB;;;;;WAKG;;QAKH;;;WAGG;;QAKH;;;;;WAKG;;QAOH;;;;;WAKG;;QAKH,mDAAmD;;QAKnD,kDAAkD;;;;;;;;;;;;;;;;;;;EA0BpD,CAAC"}
|
|
@@ -122,7 +122,7 @@ export const getWrappingOffsetItem = (offset) => (index, { state }, tries = stat
|
|
|
122
122
|
nextIndex = nextIndex - idealLength;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
if (state.nonInteractiveIds.includes(items[nextIndex].id) && tries > 0) {
|
|
125
|
+
if (items.length > 1 && state.nonInteractiveIds.includes(items[nextIndex].id) && tries > 0) {
|
|
126
126
|
// The next item is disabled, try again, but only if we haven't already tried everything.
|
|
127
127
|
// Avoid an infinite loop with `tries`
|
|
128
128
|
return getWrappingOffsetItem(offset)(nextIndex, { state }, tries - 1);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This elemProps hook is used for cursor navigation by using [Active
|
|
3
|
+
* Descendant](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_focus_activedescendant).
|
|
4
|
+
* `aria-activedescendant` tells assistive technology which element has "focus" within the component
|
|
5
|
+
* while this single element maintains focus.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* const useMyItem = composeHooks(
|
|
9
|
+
* useListActiveDescendant, // adds `aria-activedescendant` support
|
|
10
|
+
* useListItemRegister
|
|
11
|
+
* );
|
|
12
|
+
```
|
|
13
|
+
*/
|
|
14
|
+
export declare const useListActiveDescendant: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
15
|
+
state: {
|
|
16
|
+
cursorId: string;
|
|
17
|
+
columnCount: number;
|
|
18
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
19
|
+
cursorIndexRef: {
|
|
20
|
+
readonly current: number;
|
|
21
|
+
};
|
|
22
|
+
UNSTABLE_virtual: {
|
|
23
|
+
virtualItems: import("./react-virtual").VirtualItem[];
|
|
24
|
+
totalSize: number;
|
|
25
|
+
scrollToOffset: (index: number, options?: import("./react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
26
|
+
scrollToIndex: (index: number, options?: import("./react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
27
|
+
measure: () => void;
|
|
28
|
+
};
|
|
29
|
+
UNSTABLE_defaultItemHeight: number;
|
|
30
|
+
containerRef: import("react").RefObject<HTMLDivElement>;
|
|
31
|
+
id: string;
|
|
32
|
+
orientation: "horizontal" | "vertical";
|
|
33
|
+
indexRef: import("react").MutableRefObject<number>;
|
|
34
|
+
nonInteractiveIds: string[];
|
|
35
|
+
isVirtualized: boolean;
|
|
36
|
+
items: import("./useBaseListModel").Item<any>[];
|
|
37
|
+
};
|
|
38
|
+
events: {
|
|
39
|
+
goTo(data: {
|
|
40
|
+
id: string;
|
|
41
|
+
}): void;
|
|
42
|
+
goToNext(): void;
|
|
43
|
+
goToPrevious(): void;
|
|
44
|
+
goToPreviousRow(): void;
|
|
45
|
+
goToNextRow(): void;
|
|
46
|
+
goToFirst(): void;
|
|
47
|
+
goToLast(): void;
|
|
48
|
+
goToFirstOfRow(): void;
|
|
49
|
+
goToLastOfRow(): void;
|
|
50
|
+
goToNextPage(): void;
|
|
51
|
+
goToPreviousPage(): void;
|
|
52
|
+
registerItem(data: {
|
|
53
|
+
item: any;
|
|
54
|
+
textValue: string;
|
|
55
|
+
}): void;
|
|
56
|
+
unregisterItem(data: {
|
|
57
|
+
id: string;
|
|
58
|
+
}): void;
|
|
59
|
+
updateItemHeight(data: {
|
|
60
|
+
value: number;
|
|
61
|
+
}): void;
|
|
62
|
+
};
|
|
63
|
+
navigation: import("./useCursorListModel").NavigationManager;
|
|
64
|
+
getId: (item: any) => string;
|
|
65
|
+
}, {
|
|
66
|
+
'aria-activedescendant': string | undefined;
|
|
67
|
+
}>;
|
|
68
|
+
//# sourceMappingURL=useListActiveDescendant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useListActiveDescendant.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListActiveDescendant.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMlC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createElemPropsHook, slugify } from '@workday/canvas-kit-react/common';
|
|
2
|
+
import { useCursorListModel } from './useCursorListModel';
|
|
3
|
+
/**
|
|
4
|
+
* This elemProps hook is used for cursor navigation by using [Active
|
|
5
|
+
* Descendant](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_focus_activedescendant).
|
|
6
|
+
* `aria-activedescendant` tells assistive technology which element has "focus" within the component
|
|
7
|
+
* while this single element maintains focus.
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* const useMyItem = composeHooks(
|
|
11
|
+
* useListActiveDescendant, // adds `aria-activedescendant` support
|
|
12
|
+
* useListItemRegister
|
|
13
|
+
* );
|
|
14
|
+
```
|
|
15
|
+
*/
|
|
16
|
+
export const useListActiveDescendant = createElemPropsHook(useCursorListModel)(model => {
|
|
17
|
+
return {
|
|
18
|
+
'aria-activedescendant': model.state.cursorId
|
|
19
|
+
? slugify(`${model.state.id}-${model.state.cursorId}`)
|
|
20
|
+
: undefined,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
* attribute if one hasn't been defined by the application.
|
|
6
6
|
*
|
|
7
7
|
* An example might look like:
|
|
8
|
+
*
|
|
8
9
|
* ```tsx
|
|
9
10
|
* const useMyListItem = composeHooks(
|
|
10
11
|
* // any other hooks here
|
|
11
12
|
* useListItemSelect,
|
|
12
13
|
* useListItemRegister,
|
|
13
|
-
* useListItemAllowChildStrings
|
|
14
|
+
* useListItemAllowChildStrings // always the last in the list
|
|
14
15
|
* )
|
|
15
16
|
*
|
|
16
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useListItemAllowChildStrings.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemAllowChildStrings.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"useListItemAllowChildStrings.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemAllowChildStrings.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxC,CAAC"}
|
|
@@ -7,12 +7,13 @@ import { useListModel } from '@workday/canvas-kit-react/collection';
|
|
|
7
7
|
* attribute if one hasn't been defined by the application.
|
|
8
8
|
*
|
|
9
9
|
* An example might look like:
|
|
10
|
+
*
|
|
10
11
|
* ```tsx
|
|
11
12
|
* const useMyListItem = composeHooks(
|
|
12
13
|
* // any other hooks here
|
|
13
14
|
* useListItemSelect,
|
|
14
15
|
* useListItemRegister,
|
|
15
|
-
* useListItemAllowChildStrings
|
|
16
|
+
* useListItemAllowChildStrings // always the last in the list
|
|
16
17
|
* )
|
|
17
18
|
*
|
|
18
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useListItemRegister.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemRegister.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAU3C,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useListItemRegister.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemRegister.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAU3C,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2E/B,CAAC"}
|
|
@@ -48,7 +48,11 @@ export const useListItemRegister = createElemPropsHook(useListModel)(({ state, e
|
|
|
48
48
|
item: {
|
|
49
49
|
id: itemId,
|
|
50
50
|
},
|
|
51
|
-
textValue:
|
|
51
|
+
textValue: elemProps['data-text']
|
|
52
|
+
? elemProps['data-text']
|
|
53
|
+
: typeof elemProps.children === 'string'
|
|
54
|
+
? elemProps.children
|
|
55
|
+
: '',
|
|
52
56
|
});
|
|
53
57
|
setLocalId(itemId);
|
|
54
58
|
return () => {
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* This elemProps hook is used to attach keyboard events to handle keyboard navigation
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* const useMyItem = composeHooks(
|
|
7
|
+
* useListKeyboardHandler, // adds keyboard support support
|
|
8
|
+
* useListItemRegister
|
|
9
|
+
* );
|
|
10
|
+
```
|
|
11
|
+
*/
|
|
12
|
+
export declare const useListKeyboardHandler: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
13
|
+
state: {
|
|
14
|
+
cursorId: string;
|
|
15
|
+
columnCount: number;
|
|
16
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
17
|
+
cursorIndexRef: {
|
|
18
|
+
readonly current: number;
|
|
19
|
+
};
|
|
20
|
+
UNSTABLE_virtual: {
|
|
21
|
+
virtualItems: import("./react-virtual").VirtualItem[];
|
|
22
|
+
totalSize: number;
|
|
23
|
+
scrollToOffset: (index: number, options?: import("./react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
24
|
+
scrollToIndex: (index: number, options?: import("./react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
25
|
+
measure: () => void;
|
|
26
|
+
};
|
|
27
|
+
UNSTABLE_defaultItemHeight: number;
|
|
28
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
29
|
+
id: string;
|
|
30
|
+
orientation: "horizontal" | "vertical";
|
|
31
|
+
indexRef: React.MutableRefObject<number>;
|
|
32
|
+
nonInteractiveIds: string[];
|
|
33
|
+
isVirtualized: boolean;
|
|
34
|
+
items: import("./useBaseListModel").Item<any>[];
|
|
35
|
+
};
|
|
36
|
+
events: {
|
|
37
|
+
goTo(data: {
|
|
38
|
+
id: string;
|
|
39
|
+
}): void;
|
|
40
|
+
goToNext(): void;
|
|
41
|
+
goToPrevious(): void;
|
|
42
|
+
goToPreviousRow(): void;
|
|
43
|
+
goToNextRow(): void;
|
|
44
|
+
goToFirst(): void;
|
|
45
|
+
goToLast(): void;
|
|
46
|
+
goToFirstOfRow(): void;
|
|
47
|
+
goToLastOfRow(): void;
|
|
48
|
+
goToNextPage(): void;
|
|
49
|
+
goToPreviousPage(): void;
|
|
50
|
+
registerItem(data: {
|
|
51
|
+
item: any;
|
|
52
|
+
textValue: string;
|
|
53
|
+
}): void;
|
|
54
|
+
unregisterItem(data: {
|
|
55
|
+
id: string;
|
|
56
|
+
}): void;
|
|
57
|
+
updateItemHeight(data: {
|
|
58
|
+
value: number;
|
|
59
|
+
}): void;
|
|
60
|
+
};
|
|
61
|
+
navigation: import("./useCursorListModel").NavigationManager;
|
|
62
|
+
getId: (item: any) => string;
|
|
63
|
+
}, {
|
|
64
|
+
onKeyDown(event: React.KeyboardEvent): void;
|
|
65
|
+
}>;
|
|
66
|
+
//# sourceMappingURL=useListKeyboardHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useListKeyboardHandler.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListKeyboardHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAId,mBAAmB;EAOtC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useIsRTL, createElemPropsHook } from '@workday/canvas-kit-react/common';
|
|
2
|
+
import { useCursorListModel } from './useCursorListModel';
|
|
3
|
+
import { keyboardEventToCursorEvents } from './keyUtils';
|
|
4
|
+
/**
|
|
5
|
+
* This elemProps hook is used to attach keyboard events to handle keyboard navigation
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* const useMyItem = composeHooks(
|
|
9
|
+
* useListKeyboardHandler, // adds keyboard support support
|
|
10
|
+
* useListItemRegister
|
|
11
|
+
* );
|
|
12
|
+
```
|
|
13
|
+
*/
|
|
14
|
+
export const useListKeyboardHandler = createElemPropsHook(useCursorListModel)(model => {
|
|
15
|
+
const isRTL = useIsRTL();
|
|
16
|
+
return {
|
|
17
|
+
onKeyDown(event) {
|
|
18
|
+
const handled = keyboardEventToCursorEvents(event, model, isRTL);
|
|
19
|
+
if (handled) {
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
});
|