@elliemae/ds-menu-button 3.46.0-rc.1 → 3.46.0-rc.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/config/useMenuButton.js +10 -19
- package/dist/cjs/config/useMenuButton.js.map +2 -2
- package/dist/cjs/config/useSplitInherithedProps.js +33 -15
- package/dist/cjs/config/useSplitInherithedProps.js.map +2 -2
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/parts/DSFlyoutMenu/DSFlyoutMenu.js +36 -12
- package/dist/cjs/parts/DSFlyoutMenu/DSFlyoutMenu.js.map +3 -3
- package/dist/cjs/parts/DSFlyoutMenu/react-desc-prop-types.js +1 -1
- package/dist/cjs/parts/DSFlyoutMenu/react-desc-prop-types.js.map +3 -3
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/config/useAdvancedValidation.js +86 -0
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/config/useAdvancedValidation.js.map +7 -0
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/config/useFocusTracker.js +40 -30
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/config/useFocusTracker.js.map +2 -2
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/config/useMenuBehaviouralContextProvider.js +2 -0
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/config/useMenuBehaviouralContextProvider.js.map +2 -2
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/config/useMenuItemEventsHandlers.js +77 -33
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/config/useMenuItemEventsHandlers.js.map +2 -2
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/react-desc-prop-types.js +3 -0
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/utils/multipleSelectionHelpers.js +14 -14
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/utils/multipleSelectionHelpers.js.map +1 -1
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/utils/singleSelectionHelpers.js +2 -2
- package/dist/cjs/parts/DSMenuBehaviouralContextProvider/utils/singleSelectionHelpers.js.map +1 -1
- package/dist/cjs/parts/DSMenuItemRendererFactory/ActivableMenuItem.js +13 -9
- package/dist/cjs/parts/DSMenuItemRendererFactory/ActivableMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/ActivableWithSubmenuMenuItem.js +13 -9
- package/dist/cjs/parts/DSMenuItemRendererFactory/ActivableWithSubmenuMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/DSMenuItemRendererFactory.js +10 -9
- package/dist/cjs/parts/DSMenuItemRendererFactory/DSMenuItemRendererFactory.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/MultipleSelectMenuItem.js +15 -11
- package/dist/cjs/parts/DSMenuItemRendererFactory/MultipleSelectMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/MultipleSelectWithSubmenuMenuItem.js +18 -12
- package/dist/cjs/parts/DSMenuItemRendererFactory/MultipleSelectWithSubmenuMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/SingleSelectMenuItem.js +15 -11
- package/dist/cjs/parts/DSMenuItemRendererFactory/SingleSelectMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/SingleSelectWithSubmenuMenuItem.js +15 -11
- package/dist/cjs/parts/DSMenuItemRendererFactory/SingleSelectWithSubmenuMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/SkeletonMenuItem.js +112 -0
- package/dist/cjs/parts/DSMenuItemRendererFactory/SkeletonMenuItem.js.map +7 -0
- package/dist/cjs/parts/DSMenuItemRendererFactory/WithSubmenuMenuItem.js +13 -9
- package/dist/cjs/parts/DSMenuItemRendererFactory/WithSubmenuMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/config/useMenuItemRendererFactory.js +1 -1
- package/dist/cjs/parts/DSMenuItemRendererFactory/config/useMenuItemRendererFactory.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/focusNodeRacingConditionSolved.js +43 -0
- package/dist/cjs/parts/DSMenuItemRendererFactory/focusNodeRacingConditionSolved.js.map +7 -0
- package/dist/cjs/parts/DSMenuItemRendererFactory/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/parts/DSOpinionatedButton/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +16 -15
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/utils/nodesTypeguardsAndGetters.js +18 -56
- package/dist/cjs/utils/nodesTypeguardsAndGetters.js.map +2 -2
- package/dist/cjs/utils/useOptionsArrayToDsTree.js +10 -3
- package/dist/cjs/utils/useOptionsArrayToDsTree.js.map +2 -2
- package/dist/esm/config/useMenuButton.js +11 -20
- package/dist/esm/config/useMenuButton.js.map +2 -2
- package/dist/esm/config/useSplitInherithedProps.js +33 -15
- package/dist/esm/config/useSplitInherithedProps.js.map +2 -2
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/parts/DSFlyoutMenu/DSFlyoutMenu.js +34 -10
- package/dist/esm/parts/DSFlyoutMenu/DSFlyoutMenu.js.map +2 -2
- package/dist/esm/parts/DSFlyoutMenu/react-desc-prop-types.js +1 -4
- package/dist/esm/parts/DSFlyoutMenu/react-desc-prop-types.js.map +2 -2
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/config/useAdvancedValidation.js +56 -0
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/config/useAdvancedValidation.js.map +7 -0
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/config/useFocusTracker.js +40 -30
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/config/useFocusTracker.js.map +2 -2
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/config/useMenuBehaviouralContextProvider.js +2 -0
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/config/useMenuBehaviouralContextProvider.js.map +2 -2
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/config/useMenuItemEventsHandlers.js +77 -33
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/config/useMenuItemEventsHandlers.js.map +2 -2
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/react-desc-prop-types.js +3 -0
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/react-desc-prop-types.js.map +2 -2
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/utils/multipleSelectionHelpers.js +14 -14
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/utils/multipleSelectionHelpers.js.map +1 -1
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/utils/singleSelectionHelpers.js +2 -2
- package/dist/esm/parts/DSMenuBehaviouralContextProvider/utils/singleSelectionHelpers.js.map +1 -1
- package/dist/esm/parts/DSMenuItemRendererFactory/ActivableMenuItem.js +13 -9
- package/dist/esm/parts/DSMenuItemRendererFactory/ActivableMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/ActivableWithSubmenuMenuItem.js +13 -9
- package/dist/esm/parts/DSMenuItemRendererFactory/ActivableWithSubmenuMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/DSMenuItemRendererFactory.js +19 -18
- package/dist/esm/parts/DSMenuItemRendererFactory/DSMenuItemRendererFactory.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/MultipleSelectMenuItem.js +15 -11
- package/dist/esm/parts/DSMenuItemRendererFactory/MultipleSelectMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/MultipleSelectWithSubmenuMenuItem.js +18 -12
- package/dist/esm/parts/DSMenuItemRendererFactory/MultipleSelectWithSubmenuMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/SingleSelectMenuItem.js +15 -11
- package/dist/esm/parts/DSMenuItemRendererFactory/SingleSelectMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/SingleSelectWithSubmenuMenuItem.js +15 -11
- package/dist/esm/parts/DSMenuItemRendererFactory/SingleSelectWithSubmenuMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/SkeletonMenuItem.js +82 -0
- package/dist/esm/parts/DSMenuItemRendererFactory/SkeletonMenuItem.js.map +7 -0
- package/dist/esm/parts/DSMenuItemRendererFactory/WithSubmenuMenuItem.js +13 -9
- package/dist/esm/parts/DSMenuItemRendererFactory/WithSubmenuMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/config/useMenuItemRendererFactory.js +1 -1
- package/dist/esm/parts/DSMenuItemRendererFactory/config/useMenuItemRendererFactory.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/focusNodeRacingConditionSolved.js +13 -0
- package/dist/esm/parts/DSMenuItemRendererFactory/focusNodeRacingConditionSolved.js.map +7 -0
- package/dist/esm/parts/DSMenuItemRendererFactory/react-desc-prop-types.js.map +2 -2
- package/dist/esm/parts/DSOpinionatedButton/react-desc-prop-types.js +1 -1
- package/dist/esm/parts/DSOpinionatedButton/react-desc-prop-types.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +16 -15
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/utils/nodesTypeguardsAndGetters.js +18 -56
- package/dist/esm/utils/nodesTypeguardsAndGetters.js.map +2 -2
- package/dist/esm/utils/useOptionsArrayToDsTree.js +10 -3
- package/dist/esm/utils/useOptionsArrayToDsTree.js.map +2 -2
- package/dist/types/config/useSplitInherithedProps.d.ts +8 -9
- package/dist/types/index.d.ts +1 -1
- package/dist/types/parts/DSFlyoutMenu/react-desc-prop-types.d.ts +1 -1
- package/dist/types/parts/DSMenuBehaviouralContextProvider/config/useAdvancedValidation.d.ts +6 -0
- package/dist/types/parts/DSMenuBehaviouralContextProvider/config/useFocusTracker.d.ts +6 -6
- package/dist/types/parts/DSMenuBehaviouralContextProvider/config/useMenuItemEventsHandlers.d.ts +2 -1
- package/dist/types/parts/DSMenuBehaviouralContextProvider/react-desc-prop-types.d.ts +1 -0
- package/dist/types/parts/DSMenuBehaviouralContextProvider/utils/multipleSelectionHelpers.d.ts +3 -3
- package/dist/types/parts/DSMenuBehaviouralContextProvider/utils/singleSelectionHelpers.d.ts +2 -2
- package/dist/types/parts/DSMenuItemRendererFactory/SkeletonMenuItem.d.ts +5 -0
- package/dist/types/parts/DSMenuItemRendererFactory/focusNodeRacingConditionSolved.d.ts +2 -0
- package/dist/types/parts/DSMenuItemRendererFactory/react-desc-prop-types.d.ts +2 -2
- package/dist/types/parts/DSOpinionatedButton/config/useOpinionatedButton.d.ts +1 -1
- package/dist/types/parts/DSOpinionatedButton/react-desc-prop-types.d.ts +1 -1
- package/dist/types/react-desc-prop-types.d.ts +23 -17
- package/dist/types/utils/nodesTypeguardsAndGetters.d.ts +113 -1
- package/dist/types/utils/useOptionsArrayToDsTree.d.ts +2 -1
- package/package.json +12 -13
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/useOptionsArrayToDsTree.ts"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport type { UseDSTreeT } from '@elliemae/ds-tree-model';\nimport { type DSMenuButtonT } from '../react-desc-prop-types.js';\n\nconst useDsTreeOpts: UseDSTreeT.SecondParameter<DSMenuButtonT.MenuItemInterface> = {\n getUniqueId: (item) => item.dsId,\n};\n\ntype UseOptionsArrayToDsTreeRootNodeConfig = {\n options: DSMenuButtonT.MenuItemInterface[];\n instanceUid: string;\n};\n\ntype RootNodeType = UseDSTreeT.Item<DSMenuButtonT.MenuItemInterface>;\n\nexport const useOptionsArrayToDsTree = ({
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,iBAAiB;
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport type { UseDSTreeT } from '@elliemae/ds-tree-model';\nimport { type DSMenuButtonT, menuSpecificDefaultProps } from '../react-desc-prop-types.js';\n\nconst useDsTreeOpts: UseDSTreeT.SecondParameter<DSMenuButtonT.MenuItemInterface> = {\n getUniqueId: (item) => item.dsId,\n};\n\ntype UseOptionsArrayToDsTreeRootNodeConfig = {\n options: DSMenuButtonT.MenuItemInterface[];\n instanceUid: string;\n propsWithDefault?: DSMenuButtonT.MenuSpecifiDefaultProps;\n};\n\ntype RootNodeType = UseDSTreeT.Item<DSMenuButtonT.MenuItemInterface>;\n\nexport const useOptionsArrayToDsTree = ({\n options,\n instanceUid,\n propsWithDefault,\n}: UseOptionsArrayToDsTreeRootNodeConfig) => {\n const { maxHeight } = propsWithDefault || menuSpecificDefaultProps;\n // we need to create the root node that the app dev doesn't need to worry about\n const rootNode = React.useMemo<RootNodeType>(\n () =>\n ({\n dsId: `root-${instanceUid}`,\n type: 'ROOT_ITEM',\n subitems: options,\n maxHeight,\n // as unknown as RootNodeType is because currently\n // the DS tree model doesn't support the type of the root node being different from the subitems\n // in practice, this is fine because the root node is never rendered & the subitems are the only thing that matters\n // will be addresssed via PUI-XXXX\n }) as unknown as RootNodeType,\n [instanceUid, maxHeight, options],\n );\n return useDSTree<DSMenuButtonT.MenuItemInterface>(rootNode, useDsTreeOpts);\n};\n"],
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,iBAAiB;AAE1B,SAA6B,gCAAgC;AAE7D,MAAM,gBAA6E;AAAA,EACjF,aAAa,CAAC,SAAS,KAAK;AAC9B;AAUO,MAAM,0BAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AACF,MAA6C;AAC3C,QAAM,EAAE,UAAU,IAAI,oBAAoB;AAE1C,QAAM,WAAWA,OAAM;AAAA,IACrB,OACG;AAAA,MACC,MAAM,QAAQ,WAAW;AAAA,MACzB,MAAM;AAAA,MACN,UAAU;AAAA,MACV;AAAA;AAAA;AAAA;AAAA;AAAA,IAKF;AAAA,IACF,CAAC,aAAa,WAAW,OAAO;AAAA,EAClC;AACA,SAAO,UAA2C,UAAU,aAAa;AAC3E;",
|
6
6
|
"names": ["React"]
|
7
7
|
}
|
@@ -8,21 +8,21 @@ type UseSplitInherithedPropsConfig = {
|
|
8
8
|
export declare const useSplitInherithedProps: ({ propsWithDefault, focusableNodes, treeRootNode, }: UseSplitInherithedPropsConfig) => {
|
9
9
|
menuBehaviouralLayerProps: {
|
10
10
|
buttonDOMNodeRef: React.MutableRefObject<HTMLElement | null>;
|
11
|
-
|
11
|
+
selectedNodes: DSMenuButtonT.SelectionableMenuNodes[];
|
12
12
|
focusableNodes: DSMenuButtonT.PseudoFocusableMenuNodes[];
|
13
13
|
optionsTree: DSMenuButtonT.MenuNode;
|
14
14
|
onDisplayedSubmenuChange: ((newOpenedItems: DSMenuButtonT.WithSubmenuMenuNodes[], metainfo: {
|
15
15
|
itemNode: DSMenuButtonT.PseudoFocusableMenuNodes | null;
|
16
|
-
event?: React.SyntheticEvent<Element, Event> |
|
16
|
+
event?: TouchEvent | React.SyntheticEvent<Element, Event> | FocusEvent | undefined;
|
17
17
|
}) => void | import("@elliemae/ds-typescript-helpers").TypescriptHelpersT.StateSetter<DSMenuButtonT.WithSubmenuMenuNodes[]>) | undefined;
|
18
|
-
onItemSelected: (newSelection: DSMenuButtonT.SelectionableMenuNodes[], metainfo: {
|
18
|
+
onItemSelected: ((newSelection: DSMenuButtonT.SelectionableMenuNodes[], metainfo: {
|
19
19
|
itemNode: DSMenuButtonT.SelectionableMenuNodes;
|
20
20
|
event?: React.SyntheticEvent<Element, Event> | undefined;
|
21
|
-
}) => void | import("@elliemae/ds-typescript-helpers").TypescriptHelpersT.StateSetter<DSMenuButtonT.SelectionableMenuNodes[]
|
22
|
-
onActivateItem: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes, metainfo: {
|
21
|
+
}) => void | import("@elliemae/ds-typescript-helpers").TypescriptHelpersT.StateSetter<DSMenuButtonT.SelectionableMenuNodes[]>) | undefined;
|
22
|
+
onActivateItem: ((itemNode: DSMenuButtonT.PseudoFocusableMenuNodes, metainfo: {
|
23
23
|
itemNode: DSMenuButtonT.PseudoFocusableMenuNodes;
|
24
24
|
event?: React.SyntheticEvent<Element, Event> | undefined;
|
25
|
-
}) => void;
|
25
|
+
}) => void) | undefined;
|
26
26
|
onOpen: (() => void) | undefined;
|
27
27
|
onClose: (() => void) | undefined;
|
28
28
|
};
|
@@ -36,7 +36,6 @@ export declare const useSplitInherithedProps: ({ propsWithDefault, focusableNode
|
|
36
36
|
onSubmenuToggle: (nextOpenedSubmenus: Record<string, boolean>, submenu: DSMenuButtonT.MenuItemInterface, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void;
|
37
37
|
isLoading: boolean;
|
38
38
|
isSkeleton: boolean;
|
39
|
-
selectedOptions: Record<string, boolean>;
|
40
39
|
ItemRenderer: DSMenuButtonT.ItemRendererT | undefined;
|
41
40
|
};
|
42
41
|
type?: import("@elliemae/ds-button-v2").DSButtonT.HTMLButtonTypeProp | undefined;
|
@@ -276,6 +275,7 @@ export declare const useSplitInherithedProps: ({ propsWithDefault, focusableNode
|
|
276
275
|
contextMenu?: string | undefined;
|
277
276
|
dir?: string | undefined;
|
278
277
|
draggable?: (boolean | "true" | "false") | undefined;
|
278
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
279
279
|
hidden?: boolean | undefined;
|
280
280
|
id?: string | undefined;
|
281
281
|
lang?: string | undefined;
|
@@ -311,7 +311,7 @@ export declare const useSplitInherithedProps: ({ propsWithDefault, focusableNode
|
|
311
311
|
results?: number | undefined;
|
312
312
|
security?: string | undefined;
|
313
313
|
unselectable?: "on" | "off" | undefined;
|
314
|
-
inputMode?: "
|
314
|
+
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
315
315
|
is?: string | undefined;
|
316
316
|
accept?: string | undefined;
|
317
317
|
acceptCharset?: string | undefined;
|
@@ -439,7 +439,6 @@ export declare const useSplitInherithedProps: ({ propsWithDefault, focusableNode
|
|
439
439
|
h?: import("@xstyled/system").SystemProp<string | number | true | symbol | {} | (string & {}), import("@xstyled/system").Theme> | undefined;
|
440
440
|
maxWidth?: (string | number | true | symbol | {} | (string & {}) | import("@xstyled/system").ThemeProp<string | number | true | symbol | {} | (string & {}), import("@xstyled/system").Theme>) | undefined;
|
441
441
|
maxW?: (string | number | true | symbol | {} | (string & {}) | import("@xstyled/system").ThemeProp<string | number | true | symbol | {} | (string & {}), import("@xstyled/system").Theme>) | undefined;
|
442
|
-
maxHeight?: (string | number | true | symbol | {} | (string & {}) | import("@xstyled/system").ThemeProp<string | number | true | symbol | {} | (string & {}), import("@xstyled/system").Theme>) | undefined;
|
443
442
|
maxH?: (string | number | true | symbol | {} | (string & {}) | import("@xstyled/system").ThemeProp<string | number | true | symbol | {} | (string & {}), import("@xstyled/system").Theme>) | undefined;
|
444
443
|
minHeight?: (string | number | true | symbol | {} | (string & {}) | import("@xstyled/system").ThemeProp<string | number | true | symbol | {} | (string & {}), import("@xstyled/system").Theme>) | undefined;
|
445
444
|
minH?: (string | number | true | symbol | {} | (string & {}) | import("@xstyled/system").ThemeProp<string | number | true | symbol | {} | (string & {}), import("@xstyled/system").Theme>) | undefined;
|
package/dist/types/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
export { DSMenuButton, DSMenuButtonWithSchema } from './DSMenuButton.js';
|
2
|
-
export { type DSMenuButtonT } from './react-desc-prop-types.js';
|
2
|
+
export { type DSMenuButtonT, DSMenuButtonPropTypes } from './react-desc-prop-types.js';
|
3
3
|
export { MENU_BUTTON_SLOTS, MENU_BUTTON_DATA_TESTID, MENU_ITEMS_TYPES } from './constants/index.js';
|
4
4
|
export { isFocusableNode } from './utils/nodesTypeguardsAndGetters.js';
|
5
5
|
export { useOptionsArrayToDsTree } from './utils/useOptionsArrayToDsTree.js';
|
@@ -1,6 +1,6 @@
|
|
1
|
+
import { type useFloatingContext } from '@elliemae/ds-floating-context';
|
1
2
|
import type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';
|
2
3
|
import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
3
|
-
import { type useFloatingContext } from '@elliemae/ds-floating-context';
|
4
4
|
import { type DSMenuButtonT } from '../../react-desc-prop-types.js';
|
5
5
|
import { DSFlyoutMenuName, FLYOUT_MENU_SLOTS } from './constants/index.js';
|
6
6
|
export declare namespace DSFlyoutMenuT {
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { type DSMenuBehaviouralContextProviderT } from '../react-desc-prop-types.js';
|
2
|
+
type UseAdvancedValidationConfigT = {
|
3
|
+
propsWithDefault: DSMenuBehaviouralContextProviderT.InternalProps;
|
4
|
+
};
|
5
|
+
export declare const useAdvancedValidation: ({ propsWithDefault }: UseAdvancedValidationConfigT) => void;
|
6
|
+
export {};
|
@@ -4,12 +4,12 @@ export declare const useFocusTracker: () => {
|
|
4
4
|
preventBlurReset: React.MutableRefObject<boolean>;
|
5
5
|
focusRegion: "" | "trigger" | `item-dsid-${string}` | `item-dsid-${number}`;
|
6
6
|
focusedElementItemNode: React.MutableRefObject<DSMenuButtonT.PseudoFocusableMenuNodes | null>;
|
7
|
-
trackFocusTrigger: () => null;
|
7
|
+
trackFocusTrigger: () => DSMenuButtonT.PseudoFocusableMenuNodes | null;
|
8
8
|
trackFocusNode: (nodeToFocus: DSMenuButtonT.PseudoFocusableMenuNodes) => void;
|
9
|
-
trackFocusRegionReset: () => null;
|
10
|
-
trackFocusFirstChildItem: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes) => DSMenuButtonT.PseudoFocusableMenuNodes;
|
11
|
-
trackFocusLastChildItem: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes) => DSMenuButtonT.PseudoFocusableMenuNodes;
|
12
|
-
trackFocusNextItem: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes) => DSMenuButtonT.PseudoFocusableMenuNodes;
|
13
|
-
trackFocusPreviousItem: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes) => DSMenuButtonT.PseudoFocusableMenuNodes;
|
9
|
+
trackFocusRegionReset: () => DSMenuButtonT.PseudoFocusableMenuNodes | null;
|
10
|
+
trackFocusFirstChildItem: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes) => DSMenuButtonT.PseudoFocusableMenuNodes | null;
|
11
|
+
trackFocusLastChildItem: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes) => DSMenuButtonT.PseudoFocusableMenuNodes | null;
|
12
|
+
trackFocusNextItem: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes) => DSMenuButtonT.PseudoFocusableMenuNodes | null;
|
13
|
+
trackFocusPreviousItem: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes) => DSMenuButtonT.PseudoFocusableMenuNodes | null;
|
14
14
|
trackFocusParentItem: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes) => DSMenuButtonT.PseudoFocusableMenuNodes | null;
|
15
15
|
};
|
package/dist/types/parts/DSMenuBehaviouralContextProvider/config/useMenuItemEventsHandlers.d.ts
CHANGED
@@ -12,6 +12,7 @@ type UseMenuItemEventsHandlersConfig = {
|
|
12
12
|
export declare const useMenuItemEventsHandlers: ({ propsWithDefault, focusTrackers, menuOpenStatus, handleChangeOpenedSubItems, }: UseMenuItemEventsHandlersConfig) => {
|
13
13
|
handleFocusableMenuItemKeyDown: React.KeyboardEventHandler<HTMLDivElement>;
|
14
14
|
handleFocusableMenuItemClick: (event: React.MouseEvent<HTMLDivElement>) => void;
|
15
|
-
handleFocusableMenuItemOnMouseEnter: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes
|
15
|
+
handleFocusableMenuItemOnMouseEnter: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes) => void;
|
16
|
+
handleFocusableMenuItemNativeFocusEvent: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes, event: React.FocusEvent) => void;
|
16
17
|
};
|
17
18
|
export {};
|
@@ -12,6 +12,7 @@ export declare namespace DSMenuBehaviouralContextProviderT {
|
|
12
12
|
interface DefaultProps extends DSMenuButtonT.MenuBehaviouralLayerDefaultProps {
|
13
13
|
}
|
14
14
|
interface OptionalProps extends DSMenuButtonT.MenuBehaviouralLayerOptionalProps {
|
15
|
+
selectedNodes?: DSMenuButtonT.SelectionableMenuNodes[];
|
15
16
|
}
|
16
17
|
interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {
|
17
18
|
}
|
package/dist/types/parts/DSMenuBehaviouralContextProvider/utils/multipleSelectionHelpers.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type DSMenuButtonT } from '../../../react-desc-prop-types.js';
|
2
|
-
export declare const getIsMultipleSelectNodeWithSubmenuSelected: ({ itemNode,
|
2
|
+
export declare const getIsMultipleSelectNodeWithSubmenuSelected: ({ itemNode, selectedNodes, }: {
|
3
3
|
itemNode: DSMenuButtonT.MenuNodeMultipleSelectWithSubmenuItem;
|
4
|
-
|
4
|
+
selectedNodes: DSMenuButtonT.SelectionableMenuNodes[];
|
5
5
|
}) => boolean | "mixed";
|
6
|
-
export declare const getNewSelectionMultipleSelect: (
|
6
|
+
export declare const getNewSelectionMultipleSelect: (selectedNodes: DSMenuButtonT.SelectionableMenuNodes[], selectedItem: DSMenuButtonT.MultipleSelectionableMenuNodes) => DSMenuButtonT.SelectionableMenuNodes[];
|
@@ -6,8 +6,8 @@ import { type DSMenuButtonT } from '../../../react-desc-prop-types.js';
|
|
6
6
|
* the selection must be propagated because
|
7
7
|
* a single-select within a single-select-with-submenu can't be selected without implying the selection of the parent single-select-with-submenu
|
8
8
|
*
|
9
|
-
* @param
|
9
|
+
* @param selectedNodes - the current selected items
|
10
10
|
* @param selectedItem - the newly selected item
|
11
11
|
* @returns DSMenuButtonT.SelectionableMenuNodes[] - the new selection
|
12
12
|
*/
|
13
|
-
export declare const getNewSelectionSingleSelect: (
|
13
|
+
export declare const getNewSelectionSingleSelect: (selectedNodes: DSMenuButtonT.SelectionableMenuNodes[], selectedItem: DSMenuButtonT.MenuNodeSingleSelectItem | DSMenuButtonT.MenuNodeSingleSelectWithSubmenuItem) => DSMenuButtonT.SelectionableMenuNodes[];
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';
|
3
3
|
import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
4
|
-
import { DSMenuItemRendererFactoryName, MENU_ITEM_RENDERER_FACTORY_SLOTS } from './constants/index.js';
|
5
4
|
import type { DSMenuButtonT } from '../../react-desc-prop-types.js';
|
6
5
|
import type { DSFlyoutMenuT } from '../DSFlyoutMenu/react-desc-prop-types.js';
|
6
|
+
import { DSMenuItemRendererFactoryName, MENU_ITEM_RENDERER_FACTORY_SLOTS } from './constants/index.js';
|
7
7
|
export declare namespace DSMenuItemRendererFactoryT {
|
8
8
|
interface RequiredProps {
|
9
9
|
itemNode: DSMenuButtonT.MenuNode;
|
@@ -31,7 +31,7 @@ export declare const useOpinionatedButton: (propsFromUser: DSOpinionatedButtonT.
|
|
31
31
|
context: {
|
32
32
|
withoutPortal: boolean;
|
33
33
|
withoutAnimation: boolean;
|
34
|
-
portalDOMContainer: HTMLElement;
|
34
|
+
portalDOMContainer: HTMLElement | undefined;
|
35
35
|
animationDuration: number;
|
36
36
|
};
|
37
37
|
};
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import React from 'react';
|
2
1
|
import type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';
|
3
2
|
import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
3
|
+
import type React from 'react';
|
4
4
|
import { type DSMenuButtonT } from '../../react-desc-prop-types.js';
|
5
5
|
import { DSOpinionatedButtonName, OPINIONATED_BUTTON_SLOTS } from './constants/index.js';
|
6
6
|
export declare namespace DSOpinionatedButtonT {
|
@@ -8,6 +8,7 @@ export declare namespace DSMenuButtonT {
|
|
8
8
|
interface RootItem extends UseDSTreeT.AnyObjectWithoutReservedKeys {
|
9
9
|
type: 'ROOT_ITEM';
|
10
10
|
dsId: string;
|
11
|
+
maxHeight?: string | number;
|
11
12
|
label?: undefined;
|
12
13
|
secondaryLabel?: undefined;
|
13
14
|
leftDecoration?: undefined;
|
@@ -45,6 +46,7 @@ export declare namespace DSMenuButtonT {
|
|
45
46
|
secondaryLabel?: string;
|
46
47
|
leftDecoration?: React.ComponentType;
|
47
48
|
minWidth?: string | number;
|
49
|
+
maxHeight?: string | number;
|
48
50
|
disabled?: boolean;
|
49
51
|
onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
50
52
|
onKeyDown?: (e: React.KeyboardEvent) => null;
|
@@ -78,6 +80,7 @@ export declare namespace DSMenuButtonT {
|
|
78
80
|
secondaryLabel?: string;
|
79
81
|
leftDecoration?: React.ComponentType;
|
80
82
|
minWidth?: string | number;
|
83
|
+
maxHeight?: string | number;
|
81
84
|
disabled?: boolean;
|
82
85
|
onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
83
86
|
onKeyDown?: (e: React.KeyboardEvent) => null;
|
@@ -89,6 +92,7 @@ export declare namespace DSMenuButtonT {
|
|
89
92
|
secondaryLabel?: string;
|
90
93
|
leftDecoration?: React.ComponentType;
|
91
94
|
minWidth?: string | number;
|
95
|
+
maxHeight?: string | number;
|
92
96
|
disabled?: boolean;
|
93
97
|
onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
94
98
|
onKeyDown?: (e: React.KeyboardEvent) => null;
|
@@ -111,6 +115,7 @@ export declare namespace DSMenuButtonT {
|
|
111
115
|
secondaryLabel?: string;
|
112
116
|
leftDecoration?: React.ComponentType;
|
113
117
|
minWidth?: string | number;
|
118
|
+
maxHeight: string | number;
|
114
119
|
disabled?: boolean;
|
115
120
|
onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
116
121
|
onKeyDown?: (e: React.KeyboardEvent) => null;
|
@@ -122,8 +127,9 @@ export declare namespace DSMenuButtonT {
|
|
122
127
|
leftDecoration?: React.ComponentType;
|
123
128
|
minWidth?: string | number;
|
124
129
|
}
|
125
|
-
type MenuItemInterface = SeparatorItem | ActivableItem | ActionableWithSubmenuItem | SkeletonItem | MultipleSelectItem | MultiSelectWithSubmenuItem | WithSubmenuItem | GroupItem;
|
130
|
+
type MenuItemInterface = SeparatorItem | ActivableItem | ActionableWithSubmenuItem | SkeletonItem | MultipleSelectItem | MultiSelectWithSubmenuItem | WithSubmenuItem | GroupItem | SingleSelectItem | SingleSelectWithSubmenuItem;
|
126
131
|
type PseudoFocusableItemInterface = ActivableItem | ActionableWithSubmenuItem | SkeletonItem | MultipleSelectItem | MultiSelectWithSubmenuItem | WithSubmenuItem | SingleSelectItem | SingleSelectWithSubmenuItem;
|
132
|
+
type SelectionableMenuItemInterface = MultipleSelectItem | MultiSelectWithSubmenuItem | SingleSelectItem | SingleSelectWithSubmenuItem;
|
127
133
|
type MenuNodeRootItem = UseDSTreeT.TreeNode<RootItem>;
|
128
134
|
type MenuNodeSeparatorItem = UseDSTreeT.TreeNode<SeparatorItem>;
|
129
135
|
type MenuNodeActivableItem = UseDSTreeT.TreeNode<ActivableItem>;
|
@@ -138,24 +144,15 @@ export declare namespace DSMenuButtonT {
|
|
138
144
|
type MenuNode = MenuNodeSeparatorItem | MenuNodeActivableItem | MenuNodeActivableWithSubmenuItem | MenuNodeSkeletonItem | MenuNodeMultipleSelectItem | MenuNodeMultipleSelectWithSubmenuItem | MenuNodeWithSubmenuItem | MenuNodeSingleSelectItem | MenuNodeSingleSelectWithSubmenuItem | MenuNodeGroupItem;
|
139
145
|
type PseudoFocusableMenuNodes = MenuNodeActivableItem | MenuNodeActivableWithSubmenuItem | MenuNodeSkeletonItem | MenuNodeSingleSelectItem | MenuNodeMultipleSelectItem | MenuNodeMultipleSelectWithSubmenuItem | MenuNodeWithSubmenuItem | MenuNodeSingleSelectWithSubmenuItem;
|
140
146
|
type MenuNodesAllowedToHaveChildren = MenuNodeRootItem | MenuNodeWithSubmenuItem | MenuNodeGroupItem | MenuNodeActivableWithSubmenuItem | MenuNodeMultipleSelectWithSubmenuItem | MenuNodeSingleSelectWithSubmenuItem;
|
141
|
-
type ItemRendererT = React.ComponentType<{
|
142
|
-
itemNode: MenuNode;
|
143
|
-
}>;
|
144
147
|
type SelectionableMenuNodes = DSMenuButtonT.MenuNodeMultipleSelectItem | DSMenuButtonT.MenuNodeMultipleSelectWithSubmenuItem | DSMenuButtonT.MenuNodeSingleSelectItem | DSMenuButtonT.MenuNodeSingleSelectWithSubmenuItem;
|
145
148
|
type MultipleSelectionableMenuNodes = DSMenuButtonT.MenuNodeMultipleSelectItem | DSMenuButtonT.MenuNodeMultipleSelectWithSubmenuItem;
|
146
149
|
type SingleSelectionableMenuNodes = DSMenuButtonT.MenuNodeSingleSelectItem | DSMenuButtonT.MenuNodeSingleSelectWithSubmenuItem;
|
147
150
|
type WithSubmenuMenuNodes = DSMenuButtonT.MenuNodeWithSubmenuItem | DSMenuButtonT.MenuNodeActivableWithSubmenuItem | DSMenuButtonT.MenuNodeMultipleSelectWithSubmenuItem | DSMenuButtonT.MenuNodeSingleSelectWithSubmenuItem;
|
148
151
|
type SelectionablesWithSubmenuMenuNodes = DSMenuButtonT.MenuNodeMultipleSelectWithSubmenuItem | DSMenuButtonT.MenuNodeSingleSelectWithSubmenuItem;
|
152
|
+
type ItemRendererT = React.ComponentType<{
|
153
|
+
itemNode: MenuNode;
|
154
|
+
}>;
|
149
155
|
interface MenuBehaviouralLayerRequiredProps {
|
150
|
-
selectedItems: SelectionableMenuNodes[];
|
151
|
-
onItemSelected: (newSelection: SelectionableMenuNodes[], metainfo: {
|
152
|
-
itemNode: DSMenuButtonT.SelectionableMenuNodes;
|
153
|
-
event?: React.SyntheticEvent;
|
154
|
-
}) => void | TypescriptHelpersT.StateSetter<DSMenuButtonT.SelectionableMenuNodes[]>;
|
155
|
-
onActivateItem: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes, metainfo: {
|
156
|
-
itemNode: DSMenuButtonT.PseudoFocusableMenuNodes;
|
157
|
-
event?: React.SyntheticEvent;
|
158
|
-
}) => void;
|
159
156
|
}
|
160
157
|
interface MenuSpecificRequiredProps {
|
161
158
|
}
|
@@ -173,13 +170,21 @@ export declare namespace DSMenuButtonT {
|
|
173
170
|
onSubmenuToggle: (nextOpenedSubmenus: Record<string, boolean>, submenu: MenuItemInterface, e: React.MouseEvent | React.KeyboardEvent) => void;
|
174
171
|
isLoading: boolean;
|
175
172
|
isSkeleton: boolean;
|
176
|
-
|
173
|
+
maxHeight: string | number;
|
177
174
|
}
|
178
175
|
interface ButtonInheiredDefaultProps extends Omit<DSButtonV3T.DefaultProps, keyof MenuSpecifiDefaultProps> {
|
179
176
|
}
|
180
177
|
interface DefaultProps extends MenuSpecifiDefaultProps, ButtonInheiredDefaultProps, MenuBehaviouralLayerDefaultProps {
|
181
178
|
}
|
182
179
|
interface MenuBehaviouralLayerOptionalProps {
|
180
|
+
onItemSelected?: (newSelection: SelectionableMenuNodes[], metainfo: {
|
181
|
+
itemNode: DSMenuButtonT.SelectionableMenuNodes;
|
182
|
+
event?: React.SyntheticEvent;
|
183
|
+
}) => void | TypescriptHelpersT.StateSetter<DSMenuButtonT.SelectionableMenuNodes[]>;
|
184
|
+
onActivateItem?: (itemNode: DSMenuButtonT.PseudoFocusableMenuNodes, metainfo: {
|
185
|
+
itemNode: DSMenuButtonT.PseudoFocusableMenuNodes;
|
186
|
+
event?: React.SyntheticEvent;
|
187
|
+
}) => void;
|
183
188
|
onOpen?: () => void;
|
184
189
|
onClose?: () => void;
|
185
190
|
onDisplayedSubmenuChange?: (newOpenedItems: DSMenuButtonT.WithSubmenuMenuNodes[], metainfo: {
|
@@ -193,6 +198,7 @@ export declare namespace DSMenuButtonT {
|
|
193
198
|
interface ButtonInheritedOptionalProps extends Omit<DSButtonV3T.OptionalProps, keyof MenuSpecificOptionalProps> {
|
194
199
|
}
|
195
200
|
interface OptionalProps extends MenuSpecificOptionalProps, ButtonInheritedOptionalProps, MenuBehaviouralLayerOptionalProps, TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSMenuButtonName, typeof MENU_BUTTON_SLOTS> {
|
201
|
+
selectedItems?: SelectionableMenuNodes[] | SelectionableMenuItemInterface[];
|
196
202
|
}
|
197
203
|
interface MenuBehaviouralLayerProps extends Partial<MenuBehaviouralLayerDefaultProps>, MenuBehaviouralLayerOptionalProps, MenuBehaviouralLayerRequiredProps {
|
198
204
|
}
|
@@ -200,7 +206,7 @@ export declare namespace DSMenuButtonT {
|
|
200
206
|
}
|
201
207
|
interface ButtonInheritedProps extends Omit<DSButtonV3T.Props, keyof MenuSpecificProps> {
|
202
208
|
}
|
203
|
-
interface Props extends RequiredProps, Partial<DefaultProps>, OptionalProps {
|
209
|
+
interface Props extends RequiredProps, Partial<DefaultProps>, OptionalProps, Omit<DSButtonV3T.Props, keyof RequiredProps | keyof DefaultProps | keyof OptionalProps> {
|
204
210
|
}
|
205
211
|
interface MenuBehaviouralLayerInternalProps extends MenuBehaviouralLayerDefaultProps, MenuBehaviouralLayerOptionalProps, MenuBehaviouralLayerRequiredProps {
|
206
212
|
}
|
@@ -208,10 +214,10 @@ export declare namespace DSMenuButtonT {
|
|
208
214
|
}
|
209
215
|
interface ButtonInheritedInternalProps extends Omit<DSButtonV3T.InternalProps, keyof MenuSpecificInternalProps> {
|
210
216
|
}
|
211
|
-
interface InternalProps extends RequiredProps, DefaultProps, OptionalProps {
|
217
|
+
interface InternalProps extends RequiredProps, DefaultProps, OptionalProps, Omit<DSButtonV3T.Props, keyof RequiredProps | keyof DefaultProps | keyof OptionalProps> {
|
212
218
|
}
|
213
219
|
}
|
214
|
-
export declare const
|
220
|
+
export declare const menuSpecificDefaultProps: DSMenuButtonT.MenuSpecifiDefaultProps;
|
215
221
|
export declare const MenuBehaviouralLayerPropTypes: DSPropTypesSchema<DSMenuButtonT.MenuBehaviouralLayerProps>;
|
216
222
|
export declare const DSMenuSpecificPropTypes: DSPropTypesSchema<DSMenuButtonT.MenuSpecificProps>;
|
217
223
|
export declare const DSMenuButtonPropTypes: DSPropTypesSchema<DSMenuButtonT.Props>;
|
@@ -1,22 +1,134 @@
|
|
1
1
|
import { type DSMenuButtonT } from '../react-desc-prop-types.js';
|
2
|
+
/**
|
3
|
+
* Heuristic to determine if the selected item is an item or a node.
|
4
|
+
* Not perfect because JavaScript is not typed.
|
5
|
+
* If app devs provide an object that matches all of those conditions, it's an edge case the app devs should handle.
|
6
|
+
* @param {unknown} item - The item to check.
|
7
|
+
* @returns {boolean} - True if the item is (heuristically) a menu node, false otherwise.
|
8
|
+
*/
|
9
|
+
export declare const isObjectAMenuNode: (item: unknown) => item is DSMenuButtonT.MenuNode;
|
10
|
+
/**
|
11
|
+
* Checks if the item is an activable node.
|
12
|
+
* @param {unknown} item - The item to check.
|
13
|
+
* @returns {boolean} - True if the item is an activable node, false otherwise.
|
14
|
+
*/
|
2
15
|
export declare const isActivableNode: (item: unknown) => item is DSMenuButtonT.MenuNodeActivableItem;
|
3
|
-
|
16
|
+
/**
|
17
|
+
* Checks if the item is a skeleton node.
|
18
|
+
* @param {unknown} item - The item to check.
|
19
|
+
* @returns {boolean} - True if the item is a skeleton node, false otherwise.
|
20
|
+
*/
|
4
21
|
export declare const isSkeletonNode: (item: unknown) => item is DSMenuButtonT.MenuNodeSkeletonItem;
|
22
|
+
/**
|
23
|
+
* Checks if the item is a multiple select only node.
|
24
|
+
* @param {unknown} item - The item to check.
|
25
|
+
* @returns {boolean} - True if the item is a multiple select only node, false otherwise.
|
26
|
+
*/
|
5
27
|
export declare const isMultipleSelectOnlyNode: (item: unknown) => item is DSMenuButtonT.MenuNodeMultipleSelectItem;
|
28
|
+
/**
|
29
|
+
* Checks if the item is a multiple select node with a submenu.
|
30
|
+
* @param {unknown} item - The item to check.
|
31
|
+
* @returns {boolean} - True if the item is a multiple select node with a submenu, false otherwise.
|
32
|
+
*/
|
6
33
|
export declare const isMultipleSelectWithSubmenuNode: (item: unknown) => item is DSMenuButtonT.MenuNodeMultipleSelectWithSubmenuItem;
|
34
|
+
/**
|
35
|
+
* Checks if the item is a multiple select node.
|
36
|
+
* @param {unknown} item - The item to check.
|
37
|
+
* @returns {boolean} - True if the item is a multiple select node, false otherwise.
|
38
|
+
*/
|
7
39
|
export declare const isMultipleSelectNode: (item: unknown) => item is DSMenuButtonT.MultipleSelectionableMenuNodes;
|
40
|
+
/**
|
41
|
+
* Checks if the item is a single select only node.
|
42
|
+
* @param {unknown} item - The item to check.
|
43
|
+
* @returns {boolean} - True if the item is a single select only node, false otherwise.
|
44
|
+
*/
|
8
45
|
export declare const isSingleSelectOnlyNode: (item: unknown) => item is DSMenuButtonT.MenuNodeSingleSelectItem;
|
46
|
+
/**
|
47
|
+
* Checks if the item is a single select node with a submenu.
|
48
|
+
* @param {unknown} item - The item to check.
|
49
|
+
* @returns {boolean} - True if the item is a single select node with a submenu, false otherwise.
|
50
|
+
*/
|
9
51
|
export declare const isSingleSelectNodeWithSubmenu: (item: unknown) => item is DSMenuButtonT.MenuNodeSingleSelectWithSubmenuItem;
|
52
|
+
/**
|
53
|
+
* Checks if the item is a single select node.
|
54
|
+
* @param {unknown} item - The item to check.
|
55
|
+
* @returns {boolean} - True if the item is a single select node, false otherwise.
|
56
|
+
*/
|
10
57
|
export declare const isSingleSelectNode: (item: unknown) => item is DSMenuButtonT.SingleSelectionableMenuNodes;
|
58
|
+
/**
|
59
|
+
* Checks if the item is a selectionable node.
|
60
|
+
* @param {unknown} item - The item to check.
|
61
|
+
* @returns {boolean} - True if the item is a selectionable node, false otherwise.
|
62
|
+
*/
|
11
63
|
export declare const isSelectionableNode: (item: unknown) => item is DSMenuButtonT.SelectionableMenuNodes;
|
64
|
+
/**
|
65
|
+
* Gets all selectionable nodes from the tree.
|
66
|
+
* @param {DSMenuButtonT.MenuNode} tree - The tree to search.
|
67
|
+
* @returns {DSMenuButtonT.SelectionableMenuNodes[]} - An array of selectionable nodes.
|
68
|
+
*/
|
12
69
|
export declare const getSelectionableNodes: (tree: DSMenuButtonT.MenuNode) => DSMenuButtonT.SelectionableMenuNodes[];
|
70
|
+
/**
|
71
|
+
* Checks if the item is a node with a submenu (and nothing else).
|
72
|
+
* @param {unknown} item - The item to check.
|
73
|
+
* @returns {boolean} - True if the item is a node with a submenu, false otherwise.
|
74
|
+
*/
|
13
75
|
export declare const isWithSubmenuOnlyNode: (item: unknown) => item is DSMenuButtonT.MenuNodeWithSubmenuItem;
|
76
|
+
/**
|
77
|
+
* Checks if the item is a selectionable node with a submenu.
|
78
|
+
* @param {unknown} item - The item to check.
|
79
|
+
* @returns {boolean} - True if the item is a selectionable node with a submenu, false otherwise.
|
80
|
+
*/
|
14
81
|
export declare const isSelectionableWithSubmenuNode: (item: unknown) => item is DSMenuButtonT.SelectionablesWithSubmenuMenuNodes;
|
82
|
+
/**
|
83
|
+
* Checks if the item is an activable node with a submenu.
|
84
|
+
* @param {unknown} item - The item to check.
|
85
|
+
* @returns {boolean} - True if the item is an activable node with a submenu, false otherwise.
|
86
|
+
*/
|
87
|
+
export declare const isActivableWithSubmenuNode: (item: unknown) => item is DSMenuButtonT.MenuNodeActivableWithSubmenuItem;
|
88
|
+
/**
|
89
|
+
* Checks if the item is a node with a submenu.
|
90
|
+
* @param {unknown} item - The item to check.
|
91
|
+
* @returns {boolean} - True if the item is a node with a submenu, false otherwise.
|
92
|
+
*/
|
15
93
|
export declare const isWithSubmenuNode: (item: unknown) => item is DSMenuButtonT.WithSubmenuMenuNodes;
|
94
|
+
/**
|
95
|
+
* Gets all nodes with a submenu from the tree.
|
96
|
+
* @param {DSMenuButtonT.MenuNode} tree - The tree to search.
|
97
|
+
* @returns {DSMenuButtonT.PseudoFocusableMenuNodes[]} - An array of nodes with a submenu.
|
98
|
+
*/
|
16
99
|
export declare const getWithSubmenuNodes: (tree: DSMenuButtonT.MenuNode) => DSMenuButtonT.PseudoFocusableMenuNodes[];
|
100
|
+
/**
|
101
|
+
* Checks if the item is a node that can be focused.
|
102
|
+
* @param {unknown} item - The item to check.
|
103
|
+
* @returns {boolean} - True if the item is a node that can be focused, false otherwise.
|
104
|
+
*/
|
17
105
|
export declare const isFocusableNode: (item: unknown) => item is DSMenuButtonT.PseudoFocusableMenuNodes;
|
106
|
+
/**
|
107
|
+
* Gets all nodes that can be focused from the tree.
|
108
|
+
* @param {DSMenuButtonT.MenuNode} tree - The tree to search.
|
109
|
+
* @returns {DSMenuButtonT.PseudoFocusableMenuNodes[]} - An array of nodes that can be focused.
|
110
|
+
*/
|
18
111
|
export declare const getFocusableNodes: (tree: DSMenuButtonT.MenuNode) => DSMenuButtonT.PseudoFocusableMenuNodes[];
|
112
|
+
/**
|
113
|
+
* Checks if the item is a separator node.
|
114
|
+
* @param {unknown} item - The item to check.
|
115
|
+
* @returns {boolean} - True if the item is a separator node, false otherwise.
|
116
|
+
*/
|
19
117
|
export declare const isSeparatorNode: (item: unknown) => item is DSMenuButtonT.MenuNodeSeparatorItem;
|
118
|
+
/**
|
119
|
+
* Checks if the item is a group node.
|
120
|
+
* @param {unknown} item - The item to check.
|
121
|
+
* @returns {boolean} - True if the item is a group node, false otherwise.
|
122
|
+
*/
|
20
123
|
export declare const isGroup: (item: unknown) => item is DSMenuButtonT.MenuNodeGroupItem;
|
124
|
+
/**
|
125
|
+
* Checks if the given item is a root node of the menu.
|
126
|
+
* @param {DSMenuButtonT.MenuNode} tree - The tree to search.
|
127
|
+
* @returns {DSMenuButtonT.PseudoFocusableMenuNodes[]} - An array of nodes that can be focused.
|
128
|
+
* @remarks
|
129
|
+
* The root item is not a renderable item and must always be treated with special care.
|
130
|
+
*
|
131
|
+
* This function uses a hardcoded string to identify the root item.
|
132
|
+
*/
|
21
133
|
export declare const isRootNode: (item: unknown) => item is DSMenuButtonT.MenuNodeRootItem;
|
22
134
|
export declare const isMenuNodeAllowedToHaveChildren: (item: unknown) => item is DSMenuButtonT.MenuNodesAllowedToHaveChildren;
|
@@ -3,6 +3,7 @@ import { type DSMenuButtonT } from '../react-desc-prop-types.js';
|
|
3
3
|
type UseOptionsArrayToDsTreeRootNodeConfig = {
|
4
4
|
options: DSMenuButtonT.MenuItemInterface[];
|
5
5
|
instanceUid: string;
|
6
|
+
propsWithDefault?: DSMenuButtonT.MenuSpecifiDefaultProps;
|
6
7
|
};
|
7
|
-
export declare const useOptionsArrayToDsTree: ({ options, instanceUid }: UseOptionsArrayToDsTreeRootNodeConfig) => UseDSTreeT.OutputT<DSMenuButtonT.MenuItemInterface>;
|
8
|
+
export declare const useOptionsArrayToDsTree: ({ options, instanceUid, propsWithDefault, }: UseOptionsArrayToDsTreeRootNodeConfig) => UseDSTreeT.OutputT<DSMenuButtonT.MenuItemInterface>;
|
8
9
|
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@elliemae/ds-menu-button",
|
3
|
-
"version": "3.46.0-rc.
|
3
|
+
"version": "3.46.0-rc.10",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "ICE MT - Dimsum - Menu Button",
|
6
6
|
"files": [
|
@@ -37,22 +37,21 @@
|
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
39
|
"@xstyled/styled-components": "~3.6.0",
|
40
|
-
"@elliemae/ds-button-v2": "3.46.0-rc.
|
41
|
-
"@elliemae/ds-
|
42
|
-
"@elliemae/ds-grid": "3.46.0-rc.
|
43
|
-
"@elliemae/ds-
|
44
|
-
"@elliemae/ds-
|
45
|
-
"@elliemae/ds-icons": "3.46.0-rc.
|
46
|
-
"@elliemae/ds-
|
47
|
-
"@elliemae/ds-
|
48
|
-
"@elliemae/ds-tree-model": "3.46.0-rc.
|
40
|
+
"@elliemae/ds-button-v2": "3.46.0-rc.10",
|
41
|
+
"@elliemae/ds-floating-context": "3.46.0-rc.10",
|
42
|
+
"@elliemae/ds-grid": "3.46.0-rc.10",
|
43
|
+
"@elliemae/ds-hooks-on-blur-out": "3.46.0-rc.10",
|
44
|
+
"@elliemae/ds-props-helpers": "3.46.0-rc.10",
|
45
|
+
"@elliemae/ds-icons": "3.46.0-rc.10",
|
46
|
+
"@elliemae/ds-system": "3.46.0-rc.10",
|
47
|
+
"@elliemae/ds-menu-items-commons": "3.46.0-rc.10",
|
48
|
+
"@elliemae/ds-tree-model": "3.46.0-rc.10"
|
49
49
|
},
|
50
50
|
"devDependencies": {
|
51
51
|
"@elliemae/pui-cli": "9.0.0-next.50",
|
52
52
|
"styled-components": "~5.3.9",
|
53
|
-
"@elliemae/ds-
|
54
|
-
"@elliemae/ds-
|
55
|
-
"@elliemae/ds-typescript-helpers": "3.46.0-rc.1"
|
53
|
+
"@elliemae/ds-monorepo-devops": "3.46.0-rc.10",
|
54
|
+
"@elliemae/ds-typescript-helpers": "3.46.0-rc.10"
|
56
55
|
},
|
57
56
|
"peerDependencies": {
|
58
57
|
"@testing-library/jest-dom": "~5.16.4",
|