@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 @@
|
|
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIjB;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKL,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.Combobox = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const common_1 = require("@workday/canvas-kit-react/common");
|
|
9
|
+
const useComboboxModel_1 = require("./useComboboxModel");
|
|
10
|
+
const ComboboxInput_1 = require("./ComboboxInput");
|
|
11
|
+
const ComboboxMenu_1 = require("./ComboboxMenu");
|
|
12
|
+
exports.Combobox = common_1.createContainer()({
|
|
13
|
+
displayName: 'Combobox',
|
|
14
|
+
modelHook: useComboboxModel_1.useComboboxModel,
|
|
15
|
+
subComponents: {
|
|
16
|
+
/**
|
|
17
|
+
* The input of the `Combobox`. This element will have `role="combobox"` applied, along with
|
|
18
|
+
* `aria-haspopup="true"`
|
|
19
|
+
*/
|
|
20
|
+
Input: ComboboxInput_1.ComboboxInput,
|
|
21
|
+
/**
|
|
22
|
+
* A custom {@link Menu} component that uses `aria-activedescendant` instead of roving tab index
|
|
23
|
+
* to keep the focus on the {@link ComboboxInput Combobox.Input}.
|
|
24
|
+
*/
|
|
25
|
+
Menu: ComboboxMenu_1.ComboboxMenu,
|
|
26
|
+
},
|
|
27
|
+
})(({ children }, _, model) => {
|
|
28
|
+
return react_1.default.createElement(ComboboxMenu_1.ComboboxMenu, { model: model }, children);
|
|
29
|
+
});
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { Menu } from '@workday/canvas-kit-react/menu';
|
|
4
|
+
export interface ComboboxCardProps extends ExtractProps<typeof Menu.Card> {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* This hook sets the `minWidth` style attribute to match the width of the
|
|
8
|
+
* {@link ComboboxInput Combobox.Input} component.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useComboboxCard: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
11
|
+
state: {
|
|
12
|
+
stackRef: React.RefObject<HTMLDivElement>;
|
|
13
|
+
targetRef: React.RefObject<HTMLButtonElement>;
|
|
14
|
+
initialFocusRef: React.RefObject<any> | undefined;
|
|
15
|
+
returnFocusRef: React.RefObject<any> | undefined;
|
|
16
|
+
placement: import("@popperjs/core").Placement;
|
|
17
|
+
id: string;
|
|
18
|
+
visibility: "hidden" | "visible";
|
|
19
|
+
selectedIds: string[] | "all";
|
|
20
|
+
unselectedIds: string[];
|
|
21
|
+
cursorId: string;
|
|
22
|
+
columnCount: number;
|
|
23
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
24
|
+
cursorIndexRef: {
|
|
25
|
+
readonly current: number;
|
|
26
|
+
};
|
|
27
|
+
UNSTABLE_virtual: {
|
|
28
|
+
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
29
|
+
totalSize: number;
|
|
30
|
+
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
31
|
+
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
32
|
+
measure: () => void;
|
|
33
|
+
};
|
|
34
|
+
UNSTABLE_defaultItemHeight: number;
|
|
35
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
36
|
+
orientation: "horizontal" | "vertical";
|
|
37
|
+
indexRef: React.MutableRefObject<number>;
|
|
38
|
+
nonInteractiveIds: string[];
|
|
39
|
+
isVirtualized: boolean;
|
|
40
|
+
items: import("../..").Item<any>[];
|
|
41
|
+
mode: "multiple" | "single";
|
|
42
|
+
value: string | undefined;
|
|
43
|
+
inputRef: React.RefObject<HTMLInputElement>;
|
|
44
|
+
width: number;
|
|
45
|
+
};
|
|
46
|
+
events: {
|
|
47
|
+
setWidth(width: number): void;
|
|
48
|
+
updatePlacement(data: {
|
|
49
|
+
placement: import("@popperjs/core").Placement;
|
|
50
|
+
}): void;
|
|
51
|
+
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
52
|
+
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
53
|
+
select(data: {
|
|
54
|
+
id: string;
|
|
55
|
+
}): void;
|
|
56
|
+
selectAll(): void;
|
|
57
|
+
unselectAll(): void;
|
|
58
|
+
goTo(data: {
|
|
59
|
+
id: string;
|
|
60
|
+
}): void;
|
|
61
|
+
goToNext(): void;
|
|
62
|
+
goToPrevious(): void;
|
|
63
|
+
goToPreviousRow(): void;
|
|
64
|
+
goToNextRow(): void;
|
|
65
|
+
goToFirst(): void;
|
|
66
|
+
goToLast(): void;
|
|
67
|
+
goToFirstOfRow(): void;
|
|
68
|
+
goToLastOfRow(): void;
|
|
69
|
+
goToNextPage(): void;
|
|
70
|
+
goToPreviousPage(): void;
|
|
71
|
+
registerItem(data: {
|
|
72
|
+
item: any;
|
|
73
|
+
textValue: string;
|
|
74
|
+
}): void;
|
|
75
|
+
unregisterItem(data: {
|
|
76
|
+
id: string;
|
|
77
|
+
}): void;
|
|
78
|
+
updateItemHeight(data: {
|
|
79
|
+
value: number;
|
|
80
|
+
}): void;
|
|
81
|
+
};
|
|
82
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
83
|
+
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
84
|
+
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
85
|
+
getId: (item: any) => string;
|
|
86
|
+
}, {
|
|
87
|
+
readonly minWidth: number;
|
|
88
|
+
}>;
|
|
89
|
+
export declare const ComboboxCard: import("@workday/canvas-kit-react/common").ElementComponentM<"div", ComboboxCardProps, {
|
|
90
|
+
state: {
|
|
91
|
+
stackRef: React.RefObject<HTMLDivElement>;
|
|
92
|
+
targetRef: React.RefObject<HTMLButtonElement>;
|
|
93
|
+
initialFocusRef: React.RefObject<any> | undefined;
|
|
94
|
+
returnFocusRef: React.RefObject<any> | undefined;
|
|
95
|
+
placement: import("@popperjs/core").Placement;
|
|
96
|
+
id: string;
|
|
97
|
+
visibility: "hidden" | "visible";
|
|
98
|
+
selectedIds: string[] | "all";
|
|
99
|
+
unselectedIds: string[];
|
|
100
|
+
cursorId: string;
|
|
101
|
+
columnCount: number;
|
|
102
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
103
|
+
cursorIndexRef: {
|
|
104
|
+
readonly current: number;
|
|
105
|
+
};
|
|
106
|
+
UNSTABLE_virtual: {
|
|
107
|
+
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
108
|
+
totalSize: number;
|
|
109
|
+
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
110
|
+
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
111
|
+
measure: () => void;
|
|
112
|
+
};
|
|
113
|
+
UNSTABLE_defaultItemHeight: number;
|
|
114
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
115
|
+
orientation: "horizontal" | "vertical";
|
|
116
|
+
indexRef: React.MutableRefObject<number>;
|
|
117
|
+
nonInteractiveIds: string[];
|
|
118
|
+
isVirtualized: boolean;
|
|
119
|
+
items: import("../..").Item<any>[];
|
|
120
|
+
mode: "multiple" | "single";
|
|
121
|
+
value: string | undefined;
|
|
122
|
+
inputRef: React.RefObject<HTMLInputElement>;
|
|
123
|
+
width: number;
|
|
124
|
+
};
|
|
125
|
+
events: {
|
|
126
|
+
setWidth(width: number): void;
|
|
127
|
+
updatePlacement(data: {
|
|
128
|
+
placement: import("@popperjs/core").Placement;
|
|
129
|
+
}): void;
|
|
130
|
+
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
131
|
+
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
132
|
+
select(data: {
|
|
133
|
+
id: string;
|
|
134
|
+
}): void;
|
|
135
|
+
selectAll(): void;
|
|
136
|
+
unselectAll(): void;
|
|
137
|
+
goTo(data: {
|
|
138
|
+
id: string;
|
|
139
|
+
}): void;
|
|
140
|
+
goToNext(): void;
|
|
141
|
+
goToPrevious(): void;
|
|
142
|
+
goToPreviousRow(): void;
|
|
143
|
+
goToNextRow(): void;
|
|
144
|
+
goToFirst(): void;
|
|
145
|
+
goToLast(): void;
|
|
146
|
+
goToFirstOfRow(): void;
|
|
147
|
+
goToLastOfRow(): void;
|
|
148
|
+
goToNextPage(): void;
|
|
149
|
+
goToPreviousPage(): void;
|
|
150
|
+
registerItem(data: {
|
|
151
|
+
item: any;
|
|
152
|
+
textValue: string;
|
|
153
|
+
}): void;
|
|
154
|
+
unregisterItem(data: {
|
|
155
|
+
id: string;
|
|
156
|
+
}): void;
|
|
157
|
+
updateItemHeight(data: {
|
|
158
|
+
value: number;
|
|
159
|
+
}): void;
|
|
160
|
+
};
|
|
161
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
162
|
+
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
163
|
+
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
164
|
+
getId: (item: any) => string;
|
|
165
|
+
}>;
|
|
166
|
+
//# sourceMappingURL=ComboboxCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxCard.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/ComboboxCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAGL,YAAY,EACb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,IAAI,EAAC,MAAM,gCAAgC,CAAC;AAIpD,MAAM,WAAW,iBAAkB,SAAQ,YAAY,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC;CAAG;AAE5E;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI1B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASvB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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.ComboboxCard = exports.useComboboxCard = 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
|
+
/**
|
|
12
|
+
* This hook sets the `minWidth` style attribute to match the width of the
|
|
13
|
+
* {@link ComboboxInput Combobox.Input} component.
|
|
14
|
+
*/
|
|
15
|
+
exports.useComboboxCard = common_1.createElemPropsHook(useComboboxModel_1.useComboboxModel)(model => {
|
|
16
|
+
return {
|
|
17
|
+
minWidth: model.state.width,
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
exports.ComboboxCard = common_1.createSubcomponent('div')({
|
|
21
|
+
modelHook: useComboboxModel_1.useComboboxModel,
|
|
22
|
+
elemPropsHook: exports.useComboboxCard,
|
|
23
|
+
})(({ children, ...elemProps }, Element) => {
|
|
24
|
+
return (react_1.default.createElement(menu_1.Menu.Card, Object.assign({ as: Element }, elemProps), children));
|
|
25
|
+
});
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Adds all attributes necessary to start with a {@link ComboboxInput Combobox.Input}. It opens the
|
|
4
|
+
* menu with arrow keys, uses {@link useListActiveDescendant}, and handles keyboard arrows to
|
|
5
|
+
* navigate items of the menu. You may also compose this hook to add more specific behaviors for
|
|
6
|
+
* your {@link ComboboxInput Combobox.Input}.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useComboboxInput: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
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("@workday/canvas-kit-react/collection").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
|
+
readonly onKeyDown: (event: React.KeyboardEvent) => void;
|
|
86
|
+
readonly onBlur: (event: React.FocusEvent) => void;
|
|
87
|
+
readonly onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
88
|
+
readonly onClick: (event: React.MouseEvent) => void;
|
|
89
|
+
readonly value: string | undefined;
|
|
90
|
+
readonly role: "combobox";
|
|
91
|
+
readonly 'aria-haspopup': true;
|
|
92
|
+
readonly 'aria-expanded': boolean;
|
|
93
|
+
readonly 'aria-autocomplete': "list";
|
|
94
|
+
readonly 'aria-controls': `${string}-list`;
|
|
95
|
+
readonly id: string;
|
|
96
|
+
readonly ref: (instance: unknown) => void;
|
|
97
|
+
} & {
|
|
98
|
+
onKeyDown(event: React.KeyboardEvent<Element>): void;
|
|
99
|
+
} & {
|
|
100
|
+
'aria-activedescendant': string | undefined;
|
|
101
|
+
} & {
|
|
102
|
+
onKeyDown(event: React.KeyboardEvent<Element>): void;
|
|
103
|
+
} & {
|
|
104
|
+
ref: (instance: unknown) => void;
|
|
105
|
+
onClick: (event: React.MouseEvent<Element, MouseEvent>) => void;
|
|
106
|
+
}>;
|
|
107
|
+
export declare const ComboboxInput: import("@workday/canvas-kit-react/common").ElementComponentM<import("@workday/canvas-kit-react/common").ElementComponent<"input", import("@workday/canvas-kit-react/text-input").TextInputProps> & {
|
|
108
|
+
ErrorType: typeof import("@workday/canvas-kit-react/common").ErrorType;
|
|
109
|
+
}, import("@workday/canvas-kit-react/text-input").TextInputProps, {
|
|
110
|
+
state: {
|
|
111
|
+
stackRef: React.RefObject<HTMLDivElement>;
|
|
112
|
+
targetRef: React.RefObject<HTMLButtonElement>;
|
|
113
|
+
initialFocusRef: React.RefObject<any> | undefined;
|
|
114
|
+
returnFocusRef: React.RefObject<any> | undefined;
|
|
115
|
+
placement: import("@popperjs/core").Placement;
|
|
116
|
+
id: string;
|
|
117
|
+
visibility: "hidden" | "visible";
|
|
118
|
+
selectedIds: string[] | "all";
|
|
119
|
+
unselectedIds: string[];
|
|
120
|
+
cursorId: string;
|
|
121
|
+
columnCount: number;
|
|
122
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
123
|
+
cursorIndexRef: {
|
|
124
|
+
readonly current: number;
|
|
125
|
+
};
|
|
126
|
+
UNSTABLE_virtual: {
|
|
127
|
+
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
128
|
+
totalSize: number;
|
|
129
|
+
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
130
|
+
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
131
|
+
measure: () => void;
|
|
132
|
+
};
|
|
133
|
+
UNSTABLE_defaultItemHeight: number;
|
|
134
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
135
|
+
orientation: "horizontal" | "vertical";
|
|
136
|
+
indexRef: React.MutableRefObject<number>;
|
|
137
|
+
nonInteractiveIds: string[];
|
|
138
|
+
isVirtualized: boolean;
|
|
139
|
+
items: import("@workday/canvas-kit-react/collection").Item<any>[];
|
|
140
|
+
mode: "multiple" | "single";
|
|
141
|
+
value: string | undefined;
|
|
142
|
+
inputRef: React.RefObject<HTMLInputElement>;
|
|
143
|
+
width: number;
|
|
144
|
+
};
|
|
145
|
+
events: {
|
|
146
|
+
setWidth(width: number): void;
|
|
147
|
+
updatePlacement(data: {
|
|
148
|
+
placement: import("@popperjs/core").Placement;
|
|
149
|
+
}): void;
|
|
150
|
+
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
151
|
+
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
152
|
+
select(data: {
|
|
153
|
+
id: string;
|
|
154
|
+
}): void;
|
|
155
|
+
selectAll(): void;
|
|
156
|
+
unselectAll(): void;
|
|
157
|
+
goTo(data: {
|
|
158
|
+
id: string;
|
|
159
|
+
}): void;
|
|
160
|
+
goToNext(): void;
|
|
161
|
+
goToPrevious(): void;
|
|
162
|
+
goToPreviousRow(): void;
|
|
163
|
+
goToNextRow(): void;
|
|
164
|
+
goToFirst(): void;
|
|
165
|
+
goToLast(): void;
|
|
166
|
+
goToFirstOfRow(): void;
|
|
167
|
+
goToLastOfRow(): void;
|
|
168
|
+
goToNextPage(): void;
|
|
169
|
+
goToPreviousPage(): void;
|
|
170
|
+
registerItem(data: {
|
|
171
|
+
item: any;
|
|
172
|
+
textValue: string;
|
|
173
|
+
}): void;
|
|
174
|
+
unregisterItem(data: {
|
|
175
|
+
id: string;
|
|
176
|
+
}): void;
|
|
177
|
+
updateItemHeight(data: {
|
|
178
|
+
value: number;
|
|
179
|
+
}): void;
|
|
180
|
+
};
|
|
181
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
182
|
+
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
183
|
+
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
184
|
+
getId: (item: any) => string;
|
|
185
|
+
}>;
|
|
186
|
+
//# sourceMappingURL=ComboboxInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxInput.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/ComboboxInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA2BN,mBAAmB;6BAoBtB,gBAAgB;;8BAIf,gBAAgB;;;;;;;;;;;;;;;;;;EAmBpC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKxB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
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.ComboboxInput = exports.useComboboxInput = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const common_1 = require("@workday/canvas-kit-react/common");
|
|
9
|
+
const text_input_1 = require("@workday/canvas-kit-react/text-input");
|
|
10
|
+
const popup_1 = require("@workday/canvas-kit-react/popup");
|
|
11
|
+
const collection_1 = require("@workday/canvas-kit-react/collection");
|
|
12
|
+
const useComboboxModel_1 = require("./useComboboxModel");
|
|
13
|
+
const useComboboxInputOpenWithArrowKeys_1 = require("./useComboboxInputOpenWithArrowKeys");
|
|
14
|
+
/**
|
|
15
|
+
* Adds all attributes necessary to start with a {@link ComboboxInput Combobox.Input}. It opens the
|
|
16
|
+
* menu with arrow keys, uses {@link useListActiveDescendant}, and handles keyboard arrows to
|
|
17
|
+
* navigate items of the menu. You may also compose this hook to add more specific behaviors for
|
|
18
|
+
* your {@link ComboboxInput Combobox.Input}.
|
|
19
|
+
*/
|
|
20
|
+
exports.useComboboxInput = common_1.composeHooks(common_1.createElemPropsHook(useComboboxModel_1.useComboboxModel)((model, ref) => {
|
|
21
|
+
const elementRef = common_1.useForkRef(ref, model.state.inputRef);
|
|
22
|
+
react_1.default.useEffect(() => {
|
|
23
|
+
var _a;
|
|
24
|
+
if (model.state.cursorId && model.state.visibility === 'visible') {
|
|
25
|
+
const item = model.navigation.getItem(model.state.cursorId, model);
|
|
26
|
+
if (model.state.isVirtualized && item) {
|
|
27
|
+
model.state.UNSTABLE_virtual.scrollToIndex(item.index);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const listboxId = (_a = model.state.inputRef.current) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-controls');
|
|
31
|
+
if (listboxId) {
|
|
32
|
+
const menuItem = document.querySelector(`[id="${listboxId}"] [data-id="${model.state.cursorId}"]`);
|
|
33
|
+
if (menuItem) {
|
|
34
|
+
menuItem.scrollIntoView({ block: 'nearest' });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
// we only want to run this effect if the cursor changes and not any other time
|
|
40
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
|
+
}, [model.state.cursorId]);
|
|
42
|
+
return {
|
|
43
|
+
onKeyDown(event) {
|
|
44
|
+
var _a;
|
|
45
|
+
if (event.key === 'Escape') {
|
|
46
|
+
common_1.dispatchInputEvent(event.currentTarget, '');
|
|
47
|
+
}
|
|
48
|
+
if (event.key === 'Enter' && !event.metaKey && model.state.visibility === 'visible') {
|
|
49
|
+
if (((_a = document
|
|
50
|
+
.querySelector(`[data-id="${model.state.cursorId}"]`)) === null || _a === void 0 ? void 0 : _a.getAttribute('aria-disabled')) !== 'true') {
|
|
51
|
+
model.events.select({ id: model.state.cursorId });
|
|
52
|
+
if (model.state.mode === 'single') {
|
|
53
|
+
model.events.hide(event);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// We don't want to submit forms while the combobox is open
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
onBlur(event) {
|
|
61
|
+
model.events.hide(event);
|
|
62
|
+
},
|
|
63
|
+
onChange: model.onChange,
|
|
64
|
+
onClick(event) {
|
|
65
|
+
if (model.state.visibility === 'hidden') {
|
|
66
|
+
model.events.setWidth(event.currentTarget.clientWidth);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
value: model.state.value,
|
|
70
|
+
role: 'combobox',
|
|
71
|
+
'aria-haspopup': true,
|
|
72
|
+
'aria-expanded': model.state.visibility === 'visible',
|
|
73
|
+
'aria-autocomplete': 'list',
|
|
74
|
+
'aria-controls': `${model.state.id}-list`,
|
|
75
|
+
id: model.state.id,
|
|
76
|
+
ref: elementRef,
|
|
77
|
+
};
|
|
78
|
+
}), useComboboxInputOpenWithArrowKeys_1.useComboboxInputOpenWithArrowKeys, collection_1.useListActiveDescendant, collection_1.useListKeyboardHandler, popup_1.usePopupTarget);
|
|
79
|
+
exports.ComboboxInput = common_1.createSubcomponent(text_input_1.TextInput)({
|
|
80
|
+
modelHook: useComboboxModel_1.useComboboxModel,
|
|
81
|
+
elemPropsHook: exports.useComboboxInput,
|
|
82
|
+
})(({ children, ...elemProps }, Element) => {
|
|
83
|
+
return react_1.default.createElement(Element, Object.assign({}, elemProps), children);
|
|
84
|
+
});
|