@elliemae/ds-menu-button 3.60.0-next.13 → 3.60.0-next.15
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/dist/cjs/DSMenuButton.js +8 -5
- package/dist/cjs/DSMenuButton.js.map +2 -2
- package/dist/cjs/MenuButtonContextProviderCTX.js +40 -0
- package/dist/cjs/MenuButtonContextProviderCTX.js.map +7 -0
- package/dist/cjs/config/useMenuButton.js +3 -1
- package/dist/cjs/config/useMenuButton.js.map +2 -2
- package/dist/cjs/constants/index.js +12 -0
- package/dist/cjs/constants/index.js.map +3 -3
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/parts/DSFlyoutMenu/DSFlyoutMenu.js +14 -2
- package/dist/cjs/parts/DSFlyoutMenu/DSFlyoutMenu.js.map +2 -2
- package/dist/cjs/parts/DSFlyoutMenu/constants/index.js +1 -0
- package/dist/cjs/parts/DSFlyoutMenu/constants/index.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/ActivableMenuItem.js +19 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/ActivableMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/ActivableWithSubmenuMenuItem.js +19 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/ActivableWithSubmenuMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/MultipleSelectMenuItem.js +19 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/MultipleSelectMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/MultipleSelectWithSubmenuMenuItem.js +19 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/MultipleSelectWithSubmenuMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/SingleSelectMenuItem.js +19 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/SingleSelectMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/SingleSelectWithSubmenuMenuItem.js +19 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/SingleSelectWithSubmenuMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/SkeletonMenuItem.js +9 -0
- package/dist/cjs/parts/DSMenuItemRendererFactory/SkeletonMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/WithSubmenuMenuItem.js +19 -2
- package/dist/cjs/parts/DSMenuItemRendererFactory/WithSubmenuMenuItem.js.map +2 -2
- package/dist/cjs/parts/DSOpinionatedButton/DSOpinionatedButton.js +5 -0
- package/dist/cjs/parts/DSOpinionatedButton/DSOpinionatedButton.js.map +2 -2
- package/dist/esm/DSMenuButton.js +8 -5
- package/dist/esm/DSMenuButton.js.map +2 -2
- package/dist/esm/MenuButtonContextProviderCTX.js +10 -0
- package/dist/esm/MenuButtonContextProviderCTX.js.map +7 -0
- package/dist/esm/config/useMenuButton.js +4 -2
- package/dist/esm/config/useMenuButton.js.map +2 -2
- package/dist/esm/constants/index.js +12 -0
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/index.js +9 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/parts/DSFlyoutMenu/DSFlyoutMenu.js +14 -2
- package/dist/esm/parts/DSFlyoutMenu/DSFlyoutMenu.js.map +2 -2
- package/dist/esm/parts/DSFlyoutMenu/constants/index.js +1 -0
- package/dist/esm/parts/DSFlyoutMenu/constants/index.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/ActivableMenuItem.js +20 -3
- package/dist/esm/parts/DSMenuItemRendererFactory/ActivableMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/ActivableWithSubmenuMenuItem.js +19 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/ActivableWithSubmenuMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/MultipleSelectMenuItem.js +19 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/MultipleSelectMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/MultipleSelectWithSubmenuMenuItem.js +19 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/MultipleSelectWithSubmenuMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/SingleSelectMenuItem.js +19 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/SingleSelectMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/SingleSelectWithSubmenuMenuItem.js +19 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/SingleSelectWithSubmenuMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/SkeletonMenuItem.js +9 -0
- package/dist/esm/parts/DSMenuItemRendererFactory/SkeletonMenuItem.js.map +2 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/WithSubmenuMenuItem.js +19 -2
- package/dist/esm/parts/DSMenuItemRendererFactory/WithSubmenuMenuItem.js.map +2 -2
- package/dist/esm/parts/DSOpinionatedButton/DSOpinionatedButton.js +5 -0
- package/dist/esm/parts/DSOpinionatedButton/DSOpinionatedButton.js.map +2 -2
- package/dist/types/MenuButtonContextProviderCTX.d.ts +4 -0
- package/dist/types/config/useMenuButton.d.ts +2 -1
- package/dist/types/config/useSplitInherithedProps.d.ts +29 -29
- package/dist/types/constants/index.d.ts +9 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/parts/DSFlyoutMenu/constants/index.d.ts +2 -0
- package/dist/types/tests/config/ControlledTestRender.d.ts +3 -0
- package/dist/types/tests/menu-button.exports.test.d.ts +1 -0
- package/dist/types/tests/menu-button.get-owner-props.test.d.ts +1 -0
- package/dist/types/tests/menu-button.keyboard.test.d.ts +1 -0
- package/package.json +15 -16
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/DSMenuItemRendererFactory/WithSubmenuMenuItem.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { ChevronSmallRight } from '@elliemae/ds-icons';\nimport {\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n StyledContentWrapper,\n StyledGlobalMenuItemWrapper,\n} from '@elliemae/ds-menu-items-commons';\nimport { useFloatingContext, type DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport React from 'react';\nimport type { DSMenuButtonT } from '../../react-desc-prop-types.js';\nimport { MenuBehaviouralContextProviderContext } from '../DSMenuBehaviouralContextProvider/MenuBehaviouralContextProviderCTX.js';\nimport { MENU_FOCUS_REGIONS } from '../DSMenuBehaviouralContextProvider/constants/index.js';\nimport { type DSMenuItemRendererFactoryT } from './react-desc-prop-types.js';\nimport { focusNodeRacingConditionSolved } from './focusNodeRacingConditionSolved.js';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { ChevronSmallRight } from '@elliemae/ds-icons';\nimport {\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n StyledContentWrapper,\n StyledGlobalMenuItemWrapper,\n} from '@elliemae/ds-menu-items-commons';\nimport { useFloatingContext, type DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport React from 'react';\nimport type { DSMenuButtonT } from '../../react-desc-prop-types.js';\nimport { MenuBehaviouralContextProviderContext } from '../DSMenuBehaviouralContextProvider/MenuBehaviouralContextProviderCTX.js';\nimport { MENU_FOCUS_REGIONS } from '../DSMenuBehaviouralContextProvider/constants/index.js';\nimport { type DSMenuItemRendererFactoryT } from './react-desc-prop-types.js';\nimport { focusNodeRacingConditionSolved } from './focusNodeRacingConditionSolved.js';\nimport { MenuButtonContextProvider } from '../../MenuButtonContextProviderCTX.js';\nconst placementOrderPreference: Required<DSHookFloatingContextT.Props>['placementOrderPreference'] = [\n 'right-start',\n 'right-start',\n 'right',\n 'left-start',\n 'left-end',\n 'left',\n];\nexport const WithSubmenuMenuItem: React.ComponentType<{\n itemNode: DSMenuButtonT.MenuNodeWithSubmenuItem;\n FlyoutMenuCircularDepInject: DSMenuItemRendererFactoryT.RequiredProps['FlyoutMenuCircularDepInject'];\n}> = ({ itemNode, FlyoutMenuCircularDepInject }) => {\n const { dsId, plainItem } = itemNode;\n const { label, secondaryLabel, leftDecoration: LeftDecComponent, minWidth, disabled } = plainItem;\n\n const {\n ownerProps: { getOwnerProps },\n } = React.useContext(MenuButtonContextProvider);\n const getOwnerPropsArguments = React.useCallback(() => plainItem, [plainItem]);\n\n const {\n focusRegion,\n openedSubItems,\n menuItemEventsHandlers: {\n handleFocusableMenuItemKeyDown,\n handleFocusableMenuItemClick,\n handleFocusableMenuItemOnMouseEnter,\n handleFocusableMenuItemNativeFocusEvent,\n },\n } = React.useContext(MenuBehaviouralContextProviderContext);\n\n const gridLayout = React.useMemo(() => {\n const cols = LeftDecComponent ? ['min-content', 'auto'] : ['auto'];\n if (secondaryLabel) cols.push('auto');\n cols.push('min-content');\n return cols;\n }, [LeftDecComponent, secondaryLabel]);\n\n const focusedRegionPerformanceHelper = React.useRef(focusRegion);\n focusedRegionPerformanceHelper.current = focusRegion;\n\n const isFocused = focusRegion === MENU_FOCUS_REGIONS.ITEM_BY_DSID(dsId);\n const isExpanded = openedSubItems.some((itemWithOpenSubmenu) => itemWithOpenSubmenu.dsId === dsId);\n\n const floatingContext = useFloatingContext({\n placement: placementOrderPreference[0],\n placementOrderPreference,\n animationDuration: 100,\n customOffset: [0, 0],\n externallyControlledIsOpen: isExpanded,\n });\n const {\n refs: { setReference },\n } = floatingContext;\n\n const handleFocusOnRender = React.useCallback(\n (node: HTMLDivElement) => {\n setReference(node);\n if (node && focusRegion === MENU_FOCUS_REGIONS.ITEM_BY_DSID(dsId)) {\n focusNodeRacingConditionSolved(node);\n }\n },\n // we need to change the callback reference every time the focusRegion changes or else the focus will not be set\n [dsId, focusRegion, setReference],\n // we are using the \"as='div'\", typescript is not able to infer the correct type\n // the logic here actually receives a ref to a HTMLDivElement,\n // but the component must think this is a HTMLLIElement ref callback\n ) as unknown as React.RefCallback<HTMLLIElement>;\n\n const handleOnMouseEnter = React.useCallback<React.MouseEventHandler<HTMLDivElement>>(() => {\n handleFocusableMenuItemOnMouseEnter(itemNode);\n }, [handleFocusableMenuItemOnMouseEnter, itemNode]);\n const handleOnFocus = React.useCallback<React.FocusEventHandler<HTMLDivElement>>(\n (e) => {\n handleFocusableMenuItemNativeFocusEvent(itemNode, e);\n },\n [handleFocusableMenuItemNativeFocusEvent, itemNode],\n );\n\n const spacelessDsIdForDom = `ds-menu-item-${`${dsId}`.replace(/\\s/g, '')}`;\n return (\n <>\n <StyledGlobalMenuItemWrapper\n innerRef={handleFocusOnRender}\n onKeyDown={handleFocusableMenuItemKeyDown}\n onClick={handleFocusableMenuItemClick}\n onMouseEnter={handleOnMouseEnter}\n onFocus={handleOnFocus}\n as=\"div\"\n id={`${spacelessDsIdForDom}`}\n tabIndex={isFocused ? 0 : -1}\n role=\"menuitem\"\n aria-haspopup=\"menu\"\n aria-expanded={isExpanded}\n aria-controls={\n /* ********************************************************************************************************************\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls\n * The aria-controls only needs to be set when the popup is visible, but it is valid and easier to program to reference an element that is not visible.\n * ********************************************************************************************************************\n * ^^^ some automated tools will mark an error if the aria-controls references an element that does (yet) exist in the DOM\n * so, while technically valid to not check if expanded, we are doing it to avoid automated tools marking an error\n * ******************************************************************************************************************** */\n isExpanded\n ? itemNode.plainChildren.map((child) => `ds-menu-item-${`${child.dsId}`.replace(/\\s/g, '')}`).join(' ')\n : undefined\n }\n aria-disabled={disabled}\n applyAriaDisabled={disabled}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledContentWrapper\n cols={gridLayout}\n minHeight=\"16px\"\n gutter=\"xxs\"\n alignItems=\"center\"\n minWidth={minWidth ?? undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {LeftDecComponent ? <LeftDecComponent /> : null}\n <StyleMenuItemLabel getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {label}\n </StyleMenuItemLabel>\n {secondaryLabel !== undefined && (\n <StyleMenuItemSecondaryLabel\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n disabled={disabled}\n >\n {secondaryLabel}\n </StyleMenuItemSecondaryLabel>\n )}\n <ChevronSmallRight />\n </StyledContentWrapper>\n </StyledGlobalMenuItemWrapper>\n <FlyoutMenuCircularDepInject\n isMenuOpen={isExpanded}\n floatingContext={floatingContext.context}\n floatingStyles={floatingContext.floatingStyles}\n setFloatingRef={floatingContext.refs.setFloating}\n itemNode={itemNode}\n />\n </>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgGnB;AAhGJ,sBAAkC;AAClC,mCAKO;AACP,iCAAgE;AAChE,mBAAkB;AAElB,+CAAsD;AACtD,uBAAmC;AAEnC,4CAA+C;AAC/C,0CAA0C;AAC1C,MAAM,2BAA+F;AAAA,EACnG;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACO,MAAM,sBAGR,CAAC,EAAE,UAAU,4BAA4B,MAAM;AAClD,QAAM,EAAE,MAAM,UAAU,IAAI;AAC5B,QAAM,EAAE,OAAO,gBAAgB,gBAAgB,kBAAkB,UAAU,SAAS,IAAI;AAExF,QAAM;AAAA,IACJ,YAAY,EAAE,cAAc;AAAA,EAC9B,IAAI,aAAAA,QAAM,WAAW,6DAAyB;AAC9C,QAAM,yBAAyB,aAAAA,QAAM,YAAY,MAAM,WAAW,CAAC,SAAS,CAAC;AAE7E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F;AAAA,KACF;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -47,6 +47,7 @@ var import_useOpinionatedButton = require("./config/useOpinionatedButton.js");
|
|
|
47
47
|
var import_constants = require("./constants/index.js");
|
|
48
48
|
var import_DSFlyoutMenu = require("../DSFlyoutMenu/index.js");
|
|
49
49
|
var import_MenuBehaviouralContextProviderCTX = require("../DSMenuBehaviouralContextProvider/MenuBehaviouralContextProviderCTX.js");
|
|
50
|
+
var import_MenuButtonContextProviderCTX = require("../../MenuButtonContextProviderCTX.js");
|
|
50
51
|
const StyledButton = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV3, { name: import_constants.DSOpinionatedButtonName, slot: import_constants.OPINIONATED_BUTTON_SLOTS.ROOT })``;
|
|
51
52
|
const DSOpinionatedButton = (props) => {
|
|
52
53
|
const globalMenuContext = import_react.default.useContext(import_MenuBehaviouralContextProviderCTX.MenuBehaviouralContextProviderContext);
|
|
@@ -54,6 +55,9 @@ const DSOpinionatedButton = (props) => {
|
|
|
54
55
|
isMenuOpen,
|
|
55
56
|
propsWithDefault: { optionsTree }
|
|
56
57
|
} = globalMenuContext;
|
|
58
|
+
const {
|
|
59
|
+
ownerProps: { getOwnerProps }
|
|
60
|
+
} = import_react.default.useContext(import_MenuButtonContextProviderCTX.MenuButtonContextProvider);
|
|
57
61
|
const {
|
|
58
62
|
propsWithDefault: { children, menuSpecificProps, ...restOfTheProps },
|
|
59
63
|
eventsHandlers: { handleOnClick, handleOnFocus, handleFocusIfTriggerIsFocusRegion, handleTriggerKeyDown },
|
|
@@ -80,6 +84,7 @@ const DSOpinionatedButton = (props) => {
|
|
|
80
84
|
isMenuOpen ? optionsTree.plainChildren.map((child) => `ds-menu-item-${`${child.dsId}`.replace(/\s/g, "")}`).join(" ") : void 0
|
|
81
85
|
),
|
|
82
86
|
"aria-expanded": isMenuOpen,
|
|
87
|
+
getOwnerProps,
|
|
83
88
|
children
|
|
84
89
|
}
|
|
85
90
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/DSOpinionatedButton/DSOpinionatedButton.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { styled } from '@elliemae/ds-system';\nimport { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { type DSOpinionatedButtonT, DSOpinionatedButtonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useOpinionatedButton } from './config/useOpinionatedButton.js';\nimport { OPINIONATED_BUTTON_SLOTS, DSOpinionatedButtonName } from './constants/index.js';\nimport { DSFlyoutMenu } from '../DSFlyoutMenu/index.js';\nimport { MenuBehaviouralContextProviderContext } from '../DSMenuBehaviouralContextProvider/MenuBehaviouralContextProviderCTX.js';\nimport type { DSMenuButtonT } from '../../react-desc-prop-types.js';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { styled } from '@elliemae/ds-system';\nimport { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { type DSOpinionatedButtonT, DSOpinionatedButtonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useOpinionatedButton } from './config/useOpinionatedButton.js';\nimport { OPINIONATED_BUTTON_SLOTS, DSOpinionatedButtonName } from './constants/index.js';\nimport { DSFlyoutMenu } from '../DSFlyoutMenu/index.js';\nimport { MenuBehaviouralContextProviderContext } from '../DSMenuBehaviouralContextProvider/MenuBehaviouralContextProviderCTX.js';\nimport type { DSMenuButtonT } from '../../react-desc-prop-types.js';\nimport { MenuButtonContextProvider } from '../../MenuButtonContextProviderCTX.js';\nconst StyledButton = styled(DSButtonV3, { name: DSOpinionatedButtonName, slot: OPINIONATED_BUTTON_SLOTS.ROOT })``;\n\nconst DSOpinionatedButton: React.ComponentType<DSOpinionatedButtonT.Props> = (props) => {\n // this is the state of the global menu, hosted in the global context\n // each flyout menu instance will have its own state, only this instances is mandated by the global context\n // that's why flyout menu is reading the info from props and not from the context\n const globalMenuContext = React.useContext(MenuBehaviouralContextProviderContext);\n const {\n isMenuOpen,\n propsWithDefault: { optionsTree },\n } = globalMenuContext;\n\n const {\n ownerProps: { getOwnerProps },\n } = React.useContext(MenuButtonContextProvider);\n const {\n propsWithDefault: { children, menuSpecificProps, ...restOfTheProps },\n eventsHandlers: { handleOnClick, handleOnFocus, handleFocusIfTriggerIsFocusRegion, handleTriggerKeyDown },\n floatingContext,\n } = useOpinionatedButton(props, globalMenuContext);\n\n return (\n // onClick/onFocus/innerRef/onKeyDown ARE BEING OVERRIDEN ON PURPOSE\n // all the functions are being wrapped in a custom logic, they also invoke the original ones\n <>\n <StyledButton\n {...restOfTheProps}\n onClick={handleOnClick}\n onFocus={handleOnFocus}\n onKeyDown={handleTriggerKeyDown}\n innerRef={handleFocusIfTriggerIsFocusRegion}\n aria-haspopup=\"menu\"\n aria-controls={\n /* ********************************************************************************************************************\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls\n * The aria-controls only needs to be set when the popup is visible, but it is valid and easier to program to reference an element that is not visible.\n * ********************************************************************************************************************\n * ^^^ some automated tools will mark an error if the aria-controls references an element that does (yet) exist in the DOM\n * so, while technically valid to not check if expanded, we are doing it to avoid automated tools marking an error\n * ******************************************************************************************************************** */\n isMenuOpen\n ? optionsTree.plainChildren.map((child) => `ds-menu-item-${`${child.dsId}`.replace(/\\s/g, '')}`).join(' ')\n : undefined\n }\n aria-expanded={isMenuOpen}\n getOwnerProps={getOwnerProps}\n >\n {children}\n </StyledButton>\n <DSFlyoutMenu\n {...menuSpecificProps}\n isMenuOpen={isMenuOpen}\n floatingContext={floatingContext.context}\n floatingStyles={floatingContext.floatingStyles}\n setFloatingRef={floatingContext.refs.setFloating}\n // DSTree doesn't support the root node having a different type than the children, so we need to cast it manually\n itemNode={optionsTree as unknown as DSMenuButtonT.MenuNodeRootItem}\n />\n </>\n );\n};\n\nDSOpinionatedButton.displayName = DSOpinionatedButtonName;\nconst DSOpinionatedButtonWithSchema = describe(DSOpinionatedButton);\nDSOpinionatedButtonWithSchema.propTypes = DSOpinionatedButtonPropTypesSchema;\n\nexport { DSOpinionatedButton, DSOpinionatedButtonWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmCnB;AAAA;AAAA;AAAA;AAAA;AAnCJ,mBAAkB;AAClB,8BAAyB;AACzB,uBAAuB;AACvB,0BAA2B;AAC3B,mCAA8E;AAC9E,kCAAqC;AACrC,uBAAkE;AAClE,0BAA6B;AAC7B,+CAAsD;AAEtD,0CAA0C;AAC1C,MAAM,mBAAe,yBAAO,gCAAY,EAAE,MAAM,0CAAyB,MAAM,0CAAyB,KAAK,CAAC;AAE9G,MAAM,sBAAuE,CAAC,UAAU;AAItF,QAAM,oBAAoB,aAAAA,QAAM,WAAW,8EAAqC;AAChF,QAAM;AAAA,IACJ;AAAA,IACA,kBAAkB,EAAE,YAAY;AAAA,EAClC,IAAI;AAEJ,QAAM;AAAA,IACJ,YAAY,EAAE,cAAc;AAAA,EAC9B,IAAI,aAAAA,QAAM,WAAW,6DAAyB;AAC9C,QAAM;AAAA,IACJ,kBAAkB,EAAE,UAAU,mBAAmB,GAAG,eAAe;AAAA,IACnE,gBAAgB,EAAE,eAAe,eAAe,mCAAmC,qBAAqB;AAAA,IACxG;AAAA,EACF,QAAI,kDAAqB,OAAO,iBAAiB;AAEjD,SAGE,4EACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,SAAS;AAAA,QACT,SAAS;AAAA,QACT,WAAW;AAAA,QACX,UAAU;AAAA,QACV,iBAAc;AAAA,QACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAQE,aACI,YAAY,cAAc,IAAI,CAAC,UAAU,gBAAgB,GAAG,MAAM,IAAI,GAAG,QAAQ,OAAO,EAAE,CAAC,EAAE,EAAE,KAAK,GAAG,IACvG;AAAA;AAAA,QAEN,iBAAe;AAAA,QACf;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA,iBAAiB,gBAAgB;AAAA,QACjC,gBAAgB,gBAAgB;AAAA,QAChC,gBAAgB,gBAAgB,KAAK;AAAA,QAErC,UAAU;AAAA;AAAA,IACZ;AAAA,KACF;AAEJ;AAEA,oBAAoB,cAAc;AAClC,MAAM,oCAAgC,kCAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
package/dist/esm/DSMenuButton.js
CHANGED
|
@@ -8,18 +8,21 @@ import { useMenuButton } from "./config/useMenuButton.js";
|
|
|
8
8
|
import { DSOpinionatedButton } from "./parts/DSOpinionatedButton/index.js";
|
|
9
9
|
import { DSMenuButtonName, MENU_BUTTON_SLOTS, MENU_BUTTON_DATA_TESTID } from "./constants/index.js";
|
|
10
10
|
import { DSMenuBehaviouralContextProvider } from "./parts/DSMenuBehaviouralContextProvider/DSMenuBehaviouralContextProvider.js";
|
|
11
|
+
import { MenuButtonContextProvider } from "./MenuButtonContextProviderCTX.js";
|
|
11
12
|
const StyledWrapper = styled(Grid, { name: DSMenuButtonName, slot: MENU_BUTTON_SLOTS.ROOT })``;
|
|
12
13
|
const DSMenuButton = (props) => {
|
|
13
|
-
const
|
|
14
|
-
|
|
14
|
+
const ctx = useMenuButton(props);
|
|
15
|
+
const { opinionatedButtonProps, ownerProps, menuBehaviouralLayerProps } = ctx;
|
|
16
|
+
const { getOwnerProps, getOwnerPropsArguments } = ownerProps;
|
|
17
|
+
return /* @__PURE__ */ jsx(MenuButtonContextProvider.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
|
|
15
18
|
StyledWrapper,
|
|
16
19
|
{
|
|
17
20
|
"data-testid": MENU_BUTTON_DATA_TESTID.ROOT,
|
|
18
|
-
getOwnerProps
|
|
19
|
-
getOwnerPropsArguments
|
|
21
|
+
getOwnerProps,
|
|
22
|
+
getOwnerPropsArguments,
|
|
20
23
|
children: /* @__PURE__ */ jsx(DSMenuBehaviouralContextProvider, { ...menuBehaviouralLayerProps, children: /* @__PURE__ */ jsx(DSOpinionatedButton, { ...opinionatedButtonProps, children: opinionatedButtonProps.children }) })
|
|
21
24
|
}
|
|
22
|
-
);
|
|
25
|
+
) });
|
|
23
26
|
};
|
|
24
27
|
DSMenuButton.displayName = DSMenuButtonName;
|
|
25
28
|
const DSMenuButtonWithSchema = describe(DSMenuButton);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSMenuButton.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSMenuButtonT, DSMenuButtonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuButton } from './config/useMenuButton.js';\nimport { DSOpinionatedButton } from './parts/DSOpinionatedButton/index.js';\nimport { DSMenuButtonName, MENU_BUTTON_SLOTS, MENU_BUTTON_DATA_TESTID } from './constants/index.js';\nimport { DSMenuBehaviouralContextProvider } from './parts/DSMenuBehaviouralContextProvider/DSMenuBehaviouralContextProvider.js';\n\nconst StyledWrapper = styled(Grid, { name: DSMenuButtonName, slot: MENU_BUTTON_SLOTS.ROOT })``;\n\n// what are the responsability of this widget?\n// 1 - receive an API \"A\" and correctly split it into\n// what goes to the \"menu\"\n// what goes to the \"button\"\n// what goes to the \"behavioural layer\"\n// 2 - ensure the behavioural layer is parent of the button & menu\n// 3 - parse any API \"A\" into the correct data structures / high-level concerns\n// E.G. Accept array of options\n// -> convert to DSTree\n// receive an innerRef that goes to the button\n// -> make it so we still have a ref to the button in the behavioural layer\nconst DSMenuButton: React.ComponentType<DSMenuButtonT.Props> = (props) => {\n const {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSMenuButtonT, DSMenuButtonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuButton } from './config/useMenuButton.js';\nimport { DSOpinionatedButton } from './parts/DSOpinionatedButton/index.js';\nimport { DSMenuButtonName, MENU_BUTTON_SLOTS, MENU_BUTTON_DATA_TESTID } from './constants/index.js';\nimport { DSMenuBehaviouralContextProvider } from './parts/DSMenuBehaviouralContextProvider/DSMenuBehaviouralContextProvider.js';\nimport { MenuButtonContextProvider } from './MenuButtonContextProviderCTX.js';\n\nconst StyledWrapper = styled(Grid, { name: DSMenuButtonName, slot: MENU_BUTTON_SLOTS.ROOT })``;\n\n// what are the responsability of this widget?\n// 1 - receive an API \"A\" and correctly split it into\n// what goes to the \"menu\"\n// what goes to the \"button\"\n// what goes to the \"behavioural layer\"\n// 2 - ensure the behavioural layer is parent of the button & menu\n// 3 - parse any API \"A\" into the correct data structures / high-level concerns\n// E.G. Accept array of options\n// -> convert to DSTree\n// receive an innerRef that goes to the button\n// -> make it so we still have a ref to the button in the behavioural layer\nconst DSMenuButton: React.ComponentType<DSMenuButtonT.Props> = (props) => {\n const ctx = useMenuButton(props);\n const { opinionatedButtonProps, ownerProps, menuBehaviouralLayerProps } = ctx;\n\n const { getOwnerProps, getOwnerPropsArguments } = ownerProps;\n return (\n <MenuButtonContextProvider.Provider value={ctx}>\n <StyledWrapper\n data-testid={MENU_BUTTON_DATA_TESTID.ROOT}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <DSMenuBehaviouralContextProvider {...menuBehaviouralLayerProps}>\n <DSOpinionatedButton {...opinionatedButtonProps}>{opinionatedButtonProps.children}</DSOpinionatedButton>\n </DSMenuBehaviouralContextProvider>\n </StyledWrapper>\n </MenuButtonContextProvider.Provider>\n );\n};\n\nDSMenuButton.displayName = DSMenuButtonName;\nconst DSMenuButtonWithSchema = describe(DSMenuButton);\nDSMenuButtonWithSchema.propTypes = DSMenuButtonPropTypesSchema;\n\nexport { DSMenuButton, DSMenuButtonWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACqCb;AApCV,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,gBAAgB;AACzB,SAA6B,mCAAmC;AAChE,SAAS,qBAAqB;AAC9B,SAAS,2BAA2B;AACpC,SAAS,kBAAkB,mBAAmB,+BAA+B;AAC7E,SAAS,wCAAwC;AACjD,SAAS,iCAAiC;AAE1C,MAAM,gBAAgB,OAAO,MAAM,EAAE,MAAM,kBAAkB,MAAM,kBAAkB,KAAK,CAAC;AAa3F,MAAM,eAAyD,CAAC,UAAU;AACxE,QAAM,MAAM,cAAc,KAAK;AAC/B,QAAM,EAAE,wBAAwB,YAAY,0BAA0B,IAAI;AAE1E,QAAM,EAAE,eAAe,uBAAuB,IAAI;AAClD,SACE,oBAAC,0BAA0B,UAA1B,EAAmC,OAAO,KACzC;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,wBAAwB;AAAA,MACrC;AAAA,MACA;AAAA,MAEA,8BAAC,oCAAkC,GAAG,2BACpC,8BAAC,uBAAqB,GAAG,wBAAyB,iCAAuB,UAAS,GACpF;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
const defaultContext = {};
|
|
4
|
+
const MenuButtonContextProvider = createContext(defaultContext);
|
|
5
|
+
var MenuButtonContextProviderCTX_default = MenuButtonContextProvider;
|
|
6
|
+
export {
|
|
7
|
+
MenuButtonContextProvider,
|
|
8
|
+
MenuButtonContextProviderCTX_default as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=MenuButtonContextProviderCTX.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/MenuButtonContextProviderCTX.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext } from 'react';\nimport type { MenuButtonCTX } from './config/useMenuButton.js';\n\nconst defaultContext = {} as MenuButtonCTX;\n\n/** Context for cross component communication */\nexport const MenuButtonContextProvider = createContext<MenuButtonCTX>(defaultContext);\n\nexport default MenuButtonContextProvider;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB;AAG9B,MAAM,iBAAiB,CAAC;AAGjB,MAAM,4BAA4B,cAA6B,cAAc;AAEpF,IAAO,uCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { useGetXstyledProps, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
2
|
+
import { useGetXstyledProps, useMemoMergePropsWithDefault, useOwnerProps } from "@elliemae/ds-props-helpers";
|
|
3
3
|
import React2 from "react";
|
|
4
4
|
import { uid } from "uid";
|
|
5
5
|
import { DSMenuButtonPropTypes, menuSpecificDefaultProps } from "../react-desc-prop-types.js";
|
|
@@ -15,6 +15,7 @@ const useMenuButton = (propsFromUser) => {
|
|
|
15
15
|
useValidateProps(propsWithDefault, DSMenuButtonPropTypes);
|
|
16
16
|
const xstyledProps = useGetXstyledProps(propsWithDefault);
|
|
17
17
|
const instanceUid = React2.useMemo(() => `menu-button${uid(5)}`, []);
|
|
18
|
+
const ownerProps = useOwnerProps(propsFromUser);
|
|
18
19
|
const { options: appOptions } = propsWithDefault;
|
|
19
20
|
const optionsArray = Array.isArray(appOptions) ? appOptions : [];
|
|
20
21
|
const treeRootNodeFromOptionsArrayIfArray = useOptionsArrayToDsTree({
|
|
@@ -39,9 +40,10 @@ const useMenuButton = (propsFromUser) => {
|
|
|
39
40
|
propsWithDefault,
|
|
40
41
|
xstyledProps,
|
|
41
42
|
instanceUid,
|
|
43
|
+
ownerProps,
|
|
42
44
|
...splitInherithedProps
|
|
43
45
|
}),
|
|
44
|
-
[propsWithDefault, xstyledProps, instanceUid, splitInherithedProps]
|
|
46
|
+
[propsWithDefault, xstyledProps, ownerProps, instanceUid, splitInherithedProps]
|
|
45
47
|
);
|
|
46
48
|
};
|
|
47
49
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useMenuButton.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport { uid } from 'uid';\nimport { DSMenuButtonPropTypes, menuSpecificDefaultProps, type DSMenuButtonT } from '../react-desc-prop-types.js';\nimport { getFocusableNodes } from '../utils/nodesTypeguardsAndGetters.js';\nimport { useOptionsArrayToDsTree } from '../utils/useOptionsArrayToDsTree.js';\nimport { useSplitInherithedProps } from './useSplitInherithedProps.js';\nimport { useValidateProps } from './useValidateProps.js';\nexport interface MenuButtonCTX extends ReturnType<typeof useSplitInherithedProps> {\n propsWithDefault: DSMenuButtonT.InternalProps;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useMenuButton = (propsFromUser: DSMenuButtonT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSMenuButtonT.InternalProps>(\n propsFromUser,\n menuSpecificDefaultProps,\n );\n useValidateProps(propsWithDefault, DSMenuButtonPropTypes);\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const instanceUid = React.useMemo(() => `menu-button${uid(5)}`, []);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n\n // =============================================================================\n // React hooks can't be invoked conditionally...\n // =============================================================================\n\n // As per intended WIDGET API, user can provide options as an array of \"items\" or an array of \"nodes\"\n // we do the conversion from \"items\" to \"nodes\" here,\n // because the `parts` require the \"nodes\" extra properties to handle the logic and rendering\n const { options: appOptions } = propsWithDefault;\n const optionsArray: DSMenuButtonT.MenuItemInterface[] = Array.isArray(appOptions) ? appOptions : [];\n\n const treeRootNodeFromOptionsArrayIfArray = useOptionsArrayToDsTree({\n options: optionsArray,\n instanceUid,\n propsWithDefault,\n // this typecast is a safe type reconciliation, typescript checks they are compatible\n // this typecast let us avoid to have to do the ` | OtherCompatibleType` dance\n }).getRoot() as DSMenuButtonT.MenuNode;\n const treeRootNode = React.useMemo(\n () => (Array.isArray(appOptions) ? treeRootNodeFromOptionsArrayIfArray : appOptions),\n [appOptions, treeRootNodeFromOptionsArrayIfArray],\n );\n\n // =============================================================================\n // We calculate the focusableNodes from the treeRootNode.plainChildren via getFocusableNodes\n // =============================================================================\n const focusableNodes = React.useMemo(() => getFocusableNodes(treeRootNode), [treeRootNode]);\n const splitInherithedProps = useSplitInherithedProps({\n propsWithDefault,\n focusableNodes,\n treeRootNode,\n });\n\n return React.useMemo<MenuButtonCTX>(\n () => ({\n propsWithDefault,\n xstyledProps,\n instanceUid,\n ...splitInherithedProps,\n }),\n [propsWithDefault, xstyledProps, instanceUid, splitInherithedProps],\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,oBAAoB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\nimport { useGetXstyledProps, useMemoMergePropsWithDefault, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport { uid } from 'uid';\nimport { DSMenuButtonPropTypes, menuSpecificDefaultProps, type DSMenuButtonT } from '../react-desc-prop-types.js';\nimport { getFocusableNodes } from '../utils/nodesTypeguardsAndGetters.js';\nimport { useOptionsArrayToDsTree } from '../utils/useOptionsArrayToDsTree.js';\nimport { useSplitInherithedProps } from './useSplitInherithedProps.js';\nimport { useValidateProps } from './useValidateProps.js';\nexport interface MenuButtonCTX extends ReturnType<typeof useSplitInherithedProps> {\n propsWithDefault: DSMenuButtonT.InternalProps;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n ownerProps: ReturnType<typeof useOwnerProps<DSMenuButtonT.Props>>;\n instanceUid: string;\n}\n\nexport const useMenuButton = (propsFromUser: DSMenuButtonT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSMenuButtonT.InternalProps>(\n propsFromUser,\n menuSpecificDefaultProps,\n );\n useValidateProps(propsWithDefault, DSMenuButtonPropTypes);\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const instanceUid = React.useMemo(() => `menu-button${uid(5)}`, []);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n\n // =============================================================================\n // React hooks can't be invoked conditionally...\n // =============================================================================\n\n const ownerProps = useOwnerProps<DSMenuButtonT.Props>(propsFromUser);\n // As per intended WIDGET API, user can provide options as an array of \"items\" or an array of \"nodes\"\n // we do the conversion from \"items\" to \"nodes\" here,\n // because the `parts` require the \"nodes\" extra properties to handle the logic and rendering\n const { options: appOptions } = propsWithDefault;\n const optionsArray: DSMenuButtonT.MenuItemInterface[] = Array.isArray(appOptions) ? appOptions : [];\n\n const treeRootNodeFromOptionsArrayIfArray = useOptionsArrayToDsTree({\n options: optionsArray,\n instanceUid,\n propsWithDefault,\n // this typecast is a safe type reconciliation, typescript checks they are compatible\n // this typecast let us avoid to have to do the ` | OtherCompatibleType` dance\n }).getRoot() as DSMenuButtonT.MenuNode;\n const treeRootNode = React.useMemo(\n () => (Array.isArray(appOptions) ? treeRootNodeFromOptionsArrayIfArray : appOptions),\n [appOptions, treeRootNodeFromOptionsArrayIfArray],\n );\n\n // =============================================================================\n // We calculate the focusableNodes from the treeRootNode.plainChildren via getFocusableNodes\n // =============================================================================\n const focusableNodes = React.useMemo(() => getFocusableNodes(treeRootNode), [treeRootNode]);\n const splitInherithedProps = useSplitInherithedProps({\n propsWithDefault,\n focusableNodes,\n treeRootNode,\n });\n\n return React.useMemo<MenuButtonCTX>(\n () => ({\n propsWithDefault,\n xstyledProps,\n instanceUid,\n ownerProps,\n ...splitInherithedProps,\n }),\n [propsWithDefault, xstyledProps, ownerProps, instanceUid, splitInherithedProps],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,oBAAoB,8BAA8B,qBAAqB;AAChF,OAAOA,YAAW;AAClB,SAAS,WAAW;AACpB,SAAS,uBAAuB,gCAAoD;AACpF,SAAS,yBAAyB;AAClC,SAAS,+BAA+B;AACxC,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AAQ1B,MAAM,gBAAgB,CAAC,kBAAuC;AAInE,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,mBAAiB,kBAAkB,qBAAqB;AAIxD,QAAM,eAAe,mBAAmB,gBAAgB;AAKxD,QAAM,cAAcA,OAAM,QAAQ,MAAM,cAAc,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AASlE,QAAM,aAAa,cAAmC,aAAa;AAInE,QAAM,EAAE,SAAS,WAAW,IAAI;AAChC,QAAM,eAAkD,MAAM,QAAQ,UAAU,IAAI,aAAa,CAAC;AAElG,QAAM,sCAAsC,wBAAwB;AAAA,IAClE,SAAS;AAAA,IACT;AAAA,IACA;AAAA;AAAA;AAAA,EAGF,CAAC,EAAE,QAAQ;AACX,QAAM,eAAeA,OAAM;AAAA,IACzB,MAAO,MAAM,QAAQ,UAAU,IAAI,sCAAsC;AAAA,IACzE,CAAC,YAAY,mCAAmC;AAAA,EAClD;AAKA,QAAM,iBAAiBA,OAAM,QAAQ,MAAM,kBAAkB,YAAY,GAAG,CAAC,YAAY,CAAC;AAC1F,QAAM,uBAAuB,wBAAwB;AAAA,IACnD;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA,CAAC,kBAAkB,cAAc,YAAY,aAAa,oBAAoB;AAAA,EAChF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
|
+
import { FLYOUT_MENU_SLOTS } from "../parts/DSFlyoutMenu/constants/index.js";
|
|
4
|
+
import { MENU_ITEM_RENDERER_FACTORY_SLOTS } from "../parts/DSMenuItemRendererFactory/constants/index.js";
|
|
3
5
|
const DSMenuButtonName = "DSMenubutton";
|
|
4
6
|
const MENU_ITEMS_TYPES = {
|
|
5
7
|
SEPARATOR: "separator",
|
|
@@ -17,10 +19,20 @@ const MENU_BUTTON_SLOTS = {
|
|
|
17
19
|
ROOT: "root"
|
|
18
20
|
};
|
|
19
21
|
const MENU_BUTTON_DATA_TESTID = slotObjectToDataTestIds(DSMenuButtonName, MENU_BUTTON_SLOTS);
|
|
22
|
+
const { ROOT: FLYOUT_MENU_ROOT, ...FLYOUT_MENU_SLOTS_REST } = FLYOUT_MENU_SLOTS;
|
|
23
|
+
const { ROOT: MENU_ITEM_RENDERER_FACTORY_ROOT, ...MENU_ITEM_RENDERER_FACTORY_SLOTS_REST } = MENU_ITEM_RENDERER_FACTORY_SLOTS;
|
|
24
|
+
const MENU_BUTTON_WITH_PARTS_SLOTS = {
|
|
25
|
+
...MENU_BUTTON_SLOTS,
|
|
26
|
+
FLYOUT_MENU_ROOT,
|
|
27
|
+
MENU_ITEM_RENDERER_FACTORY_ROOT,
|
|
28
|
+
...FLYOUT_MENU_SLOTS_REST,
|
|
29
|
+
...MENU_ITEM_RENDERER_FACTORY_SLOTS_REST
|
|
30
|
+
};
|
|
20
31
|
export {
|
|
21
32
|
DSMenuButtonName,
|
|
22
33
|
MENU_BUTTON_DATA_TESTID,
|
|
23
34
|
MENU_BUTTON_SLOTS,
|
|
35
|
+
MENU_BUTTON_WITH_PARTS_SLOTS,
|
|
24
36
|
MENU_ITEMS_TYPES
|
|
25
37
|
};
|
|
26
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport { FLYOUT_MENU_SLOTS } from '../parts/DSFlyoutMenu/constants/index.js';\nimport { MENU_ITEM_RENDERER_FACTORY_SLOTS } from '../parts/DSMenuItemRendererFactory/constants/index.js';\nexport const DSMenuButtonName = 'DSMenubutton';\n\nexport const MENU_ITEMS_TYPES = {\n SEPARATOR: 'separator',\n ACTIVABLE_ITEM: 'activable-item',\n ACTIVABLE_WITH_SUBMENU_ITEM: 'activable-with-submenu-item',\n SKELETON_ITEM: 'skeleton-item',\n MULTIPLE_SELECT_ITEM: 'multiple-select-item',\n MULTIPLE_SELECT_WITH_SUBMENU_ITEM: 'multiple-select-with-submenu-item',\n WITH_SUBMENU_ITEM: 'with-submenu-item',\n SINGLE_SELECT_ITEM: 'single-select-item',\n SINGLE_SELECT_WITH_SUBMENU_ITEM: 'single-select-with-submenu-item',\n GROUP: 'group',\n} as const;\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const MENU_BUTTON_SLOTS = {\n ROOT: 'root',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const MENU_BUTTON_DATA_TESTID = slotObjectToDataTestIds(DSMenuButtonName, MENU_BUTTON_SLOTS);\n\nconst { ROOT: FLYOUT_MENU_ROOT, ...FLYOUT_MENU_SLOTS_REST } = FLYOUT_MENU_SLOTS;\nconst { ROOT: MENU_ITEM_RENDERER_FACTORY_ROOT, ...MENU_ITEM_RENDERER_FACTORY_SLOTS_REST } =\n MENU_ITEM_RENDERER_FACTORY_SLOTS;\n\nexport const MENU_BUTTON_WITH_PARTS_SLOTS = {\n ...MENU_BUTTON_SLOTS,\n FLYOUT_MENU_ROOT,\n MENU_ITEM_RENDERER_FACTORY_ROOT,\n ...FLYOUT_MENU_SLOTS_REST,\n ...MENU_ITEM_RENDERER_FACTORY_SLOTS_REST,\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AACxC,SAAS,yBAAyB;AAClC,SAAS,wCAAwC;AAC1C,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB;AAAA,EAC9B,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,6BAA6B;AAAA,EAC7B,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,mCAAmC;AAAA,EACnC,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,iCAAiC;AAAA,EACjC,OAAO;AACT;AAGO,MAAM,oBAAoB;AAAA,EAC/B,MAAM;AACR;AAGO,MAAM,0BAA0B,wBAAwB,kBAAkB,iBAAiB;AAElG,MAAM,EAAE,MAAM,kBAAkB,GAAG,uBAAuB,IAAI;AAC9D,MAAM,EAAE,MAAM,iCAAiC,GAAG,sCAAsC,IACtF;AAEK,MAAM,+BAA+B;AAAA,EAC1C,GAAG;AAAA,EACH;AAAA,EACA;AAAA,EACA,GAAG;AAAA,EACH,GAAG;AACL;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { DSMenuButton, DSMenuButtonWithSchema } from "./DSMenuButton.js";
|
|
3
3
|
import { DSMenuButtonPropTypes } from "./react-desc-prop-types.js";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
MENU_BUTTON_SLOTS,
|
|
6
|
+
DSMenuButtonName,
|
|
7
|
+
MENU_BUTTON_DATA_TESTID,
|
|
8
|
+
MENU_ITEMS_TYPES,
|
|
9
|
+
MENU_BUTTON_WITH_PARTS_SLOTS
|
|
10
|
+
} from "./constants/index.js";
|
|
5
11
|
import { isFocusableNode } from "./utils/nodesTypeguardsAndGetters.js";
|
|
6
12
|
import { useOptionsArrayToDsTree } from "./utils/useOptionsArrayToDsTree.js";
|
|
7
13
|
export {
|
|
8
14
|
DSMenuButton,
|
|
15
|
+
DSMenuButtonName,
|
|
9
16
|
DSMenuButtonPropTypes,
|
|
10
17
|
DSMenuButtonWithSchema,
|
|
11
18
|
MENU_BUTTON_DATA_TESTID,
|
|
12
19
|
MENU_BUTTON_SLOTS,
|
|
20
|
+
MENU_BUTTON_WITH_PARTS_SLOTS,
|
|
13
21
|
MENU_ITEMS_TYPES,
|
|
14
22
|
isFocusableNode,
|
|
15
23
|
useOptionsArrayToDsTree
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSMenuButton, DSMenuButtonWithSchema } from './DSMenuButton.js';\nexport { type DSMenuButtonT, DSMenuButtonPropTypes } from './react-desc-prop-types.js';\nexport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,cAAc,8BAA8B;AACrD,SAA6B,6BAA6B;AAC1D,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSMenuButton, DSMenuButtonWithSchema } from './DSMenuButton.js';\nexport { type DSMenuButtonT, DSMenuButtonPropTypes } from './react-desc-prop-types.js';\nexport {\n MENU_BUTTON_SLOTS,\n DSMenuButtonName,\n MENU_BUTTON_DATA_TESTID,\n MENU_ITEMS_TYPES,\n MENU_BUTTON_WITH_PARTS_SLOTS,\n} from './constants/index.js';\nexport { isFocusableNode } from './utils/nodesTypeguardsAndGetters.js';\nexport { useOptionsArrayToDsTree } from './utils/useOptionsArrayToDsTree.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,cAAc,8BAA8B;AACrD,SAA6B,6BAA6B;AAC1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAChC,SAAS,+BAA+B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -12,6 +12,7 @@ import { useFlyoutMenu } from "./config/useFlyoutMenu.js";
|
|
|
12
12
|
import { DSFlyoutMenuName, FLYOUT_MENU_SLOTS } from "./constants/index.js";
|
|
13
13
|
import { DSFlyoutMenuPropTypesSchema } from "./react-desc-prop-types.js";
|
|
14
14
|
import { isRootNode } from "../../utils/nodesTypeguardsAndGetters.js";
|
|
15
|
+
import { MenuButtonContextProvider } from "../../MenuButtonContextProviderCTX.js";
|
|
15
16
|
const StyledWrapper = styled(Grid, {
|
|
16
17
|
name: DSFlyoutMenuName,
|
|
17
18
|
slot: FLYOUT_MENU_SLOTS.ROOT
|
|
@@ -21,6 +22,10 @@ const StyledWrapper = styled(Grid, {
|
|
|
21
22
|
padding: ${({ theme }) => theme.space.xxxs} 0;
|
|
22
23
|
${xStyledCommonProps}
|
|
23
24
|
`;
|
|
25
|
+
const StyledFloatingWrapper = styled(FloatingWrapper, {
|
|
26
|
+
name: DSFlyoutMenuName,
|
|
27
|
+
slot: FLYOUT_MENU_SLOTS.FLOATING_WRAPPER
|
|
28
|
+
})``;
|
|
24
29
|
const StyledMenu = styled("div", { name: DSFlyoutMenuName, slot: FLYOUT_MENU_SLOTS.LIST_WRAPPER })`
|
|
25
30
|
max-height: ${({ $maxHeight }) => typeof $maxHeight === "number" ? `${$maxHeight}px` : $maxHeight};
|
|
26
31
|
overflow-y: auto;
|
|
@@ -30,6 +35,9 @@ const StyledMenu = styled("div", { name: DSFlyoutMenuName, slot: FLYOUT_MENU_SLO
|
|
|
30
35
|
const NoComponentPlaceholder = () => null;
|
|
31
36
|
const DSFlyoutMenu = (props) => {
|
|
32
37
|
const { propsWithDefault, xstyledProps } = useFlyoutMenu(props);
|
|
38
|
+
const {
|
|
39
|
+
ownerProps: { getOwnerProps, getOwnerPropsArguments }
|
|
40
|
+
} = React2.useContext(MenuButtonContextProvider);
|
|
33
41
|
const {
|
|
34
42
|
instanceUid,
|
|
35
43
|
globalEventsHelpers: { mainMenuRef, handleSubmenusRefChange }
|
|
@@ -53,7 +61,7 @@ const DSFlyoutMenu = (props) => {
|
|
|
53
61
|
setDidAnimationEnd(true);
|
|
54
62
|
}, []);
|
|
55
63
|
return /* @__PURE__ */ jsx(
|
|
56
|
-
|
|
64
|
+
StyledFloatingWrapper,
|
|
57
65
|
{
|
|
58
66
|
innerRef: setFloatingRef,
|
|
59
67
|
floatingStyles,
|
|
@@ -61,12 +69,16 @@ const DSFlyoutMenu = (props) => {
|
|
|
61
69
|
context: floatingContext,
|
|
62
70
|
onAnimationStartTriggered: handleAnimationStartTrigger,
|
|
63
71
|
onAnimationEnd: handleAnimationEnd,
|
|
64
|
-
|
|
72
|
+
getOwnerProps,
|
|
73
|
+
getOwnerPropsArguments,
|
|
74
|
+
children: /* @__PURE__ */ jsx(StyledWrapper, { getOwnerProps, getOwnerPropsArguments, ...xstyledProps, children: /* @__PURE__ */ jsx(
|
|
65
75
|
StyledMenu,
|
|
66
76
|
{
|
|
67
77
|
role: "menu",
|
|
68
78
|
innerRef: handleRefChange,
|
|
69
79
|
$maxHeight: itemNode.plainItem.maxHeight ?? menuSpecificDefaultProps.maxHeight,
|
|
80
|
+
getOwnerProps,
|
|
81
|
+
getOwnerPropsArguments,
|
|
70
82
|
children: itemNode.children.map((optionNode) => /* @__PURE__ */ jsx(
|
|
71
83
|
DSMenuItemRendererFactory,
|
|
72
84
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSFlyoutMenu/DSFlyoutMenu.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport React from 'react';\nimport { type DSMenuButtonT, menuSpecificDefaultProps } from '../../react-desc-prop-types.js';\nimport { MenuBehaviouralContextProviderContext } from '../DSMenuBehaviouralContextProvider/MenuBehaviouralContextProviderCTX.js';\nimport { DSMenuItemRendererFactory } from '../DSMenuItemRendererFactory/index.js';\nimport { useFlyoutMenu } from './config/useFlyoutMenu.js';\nimport { DSFlyoutMenuName, FLYOUT_MENU_SLOTS } from './constants/index.js';\nimport { DSFlyoutMenuPropTypesSchema, type DSFlyoutMenuT } from './react-desc-prop-types.js';\nimport { isRootNode } from '../../utils/nodesTypeguardsAndGetters.js';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { styled, xStyledCommonProps } from '@elliemae/ds-system';\n\nimport React from 'react';\nimport { type DSMenuButtonT, menuSpecificDefaultProps } from '../../react-desc-prop-types.js';\nimport { MenuBehaviouralContextProviderContext } from '../DSMenuBehaviouralContextProvider/MenuBehaviouralContextProviderCTX.js';\nimport { DSMenuItemRendererFactory } from '../DSMenuItemRendererFactory/index.js';\nimport { useFlyoutMenu } from './config/useFlyoutMenu.js';\nimport { DSFlyoutMenuName, FLYOUT_MENU_SLOTS } from './constants/index.js';\nimport { DSFlyoutMenuPropTypesSchema, type DSFlyoutMenuT } from './react-desc-prop-types.js';\nimport { isRootNode } from '../../utils/nodesTypeguardsAndGetters.js';\nimport { MenuButtonContextProvider } from '../../MenuButtonContextProviderCTX.js';\nconst StyledWrapper = styled(Grid, {\n name: DSFlyoutMenuName,\n slot: FLYOUT_MENU_SLOTS.ROOT,\n})`\n min-width: 1px;\n background-color: white;\n padding: ${({ theme }) => theme.space.xxxs} 0;\n ${xStyledCommonProps}\n`;\n\nconst StyledFloatingWrapper = styled(FloatingWrapper, {\n name: DSFlyoutMenuName,\n slot: FLYOUT_MENU_SLOTS.FLOATING_WRAPPER,\n})``;\n\nconst StyledMenu = styled('div', { name: DSFlyoutMenuName, slot: FLYOUT_MENU_SLOTS.LIST_WRAPPER })<{\n $maxHeight: string | number;\n}>`\n max-height: ${({ $maxHeight }) => (typeof $maxHeight === 'number' ? `${$maxHeight}px` : $maxHeight)};\n overflow-y: auto;\n padding: 0;\n margin: 0;\n`;\n\nconst NoComponentPlaceholder = () => null;\n\nconst DSFlyoutMenu: React.ComponentType<DSFlyoutMenuT.Props> = (props) => {\n const { propsWithDefault, xstyledProps } = useFlyoutMenu(props);\n const {\n ownerProps: { getOwnerProps, getOwnerPropsArguments },\n } = React.useContext(MenuButtonContextProvider);\n const {\n instanceUid,\n globalEventsHelpers: { mainMenuRef, handleSubmenusRefChange },\n } = React.useContext(MenuBehaviouralContextProviderContext);\n const [didAnimationEnd, setDidAnimationEnd] = React.useState(false);\n\n const { setFloatingRef, floatingStyles, floatingContext, ItemRenderer, isMenuOpen, itemNode } = propsWithDefault;\n const handleRefChange = React.useCallback(\n (node: HTMLDivElement) => {\n if (isRootNode(itemNode)) {\n mainMenuRef.current = node;\n return;\n }\n handleSubmenusRefChange(node, itemNode.dsId);\n },\n [handleSubmenusRefChange, itemNode, mainMenuRef],\n );\n\n const handleAnimationStartTrigger = React.useCallback(() => {\n setDidAnimationEnd(false);\n }, []);\n const handleAnimationEnd = React.useCallback(() => {\n setDidAnimationEnd(true);\n }, []);\n\n return (\n <StyledFloatingWrapper\n innerRef={setFloatingRef}\n floatingStyles={floatingStyles}\n isOpen={isMenuOpen}\n context={floatingContext}\n onAnimationStartTriggered={handleAnimationStartTrigger}\n onAnimationEnd={handleAnimationEnd}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledWrapper getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments} {...xstyledProps}>\n <StyledMenu\n role=\"menu\"\n innerRef={handleRefChange}\n $maxHeight={itemNode.plainItem.maxHeight ?? menuSpecificDefaultProps.maxHeight}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {itemNode.children.map((optionNode) => (\n <DSMenuItemRendererFactory\n key={`flyout-menu-item-${optionNode.dsId}-${instanceUid}`}\n // DSTree doesn't support children having a polymorphic type, so we need to cast it manually\n itemNode={optionNode as DSMenuButtonT.MenuNode}\n ItemRenderer={ItemRenderer}\n // we are passing the DSFlyoutMenu component as a prop to the DSMenuItemRendererFactory\n // this solves the circular-ish dependency\n // the conditional `didAnimationEnd` solves the visual artefact of nested FloatingWrapper wrongly positioned due to animation\n FlyoutMenuCircularDepInject={didAnimationEnd ? DSFlyoutMenu : NoComponentPlaceholder}\n />\n ))}\n </StyledMenu>\n </StyledWrapper>\n </StyledFloatingWrapper>\n );\n};\n\nDSFlyoutMenu.displayName = DSFlyoutMenuName;\nconst DSFlyoutMenuWithSchema = describe(DSFlyoutMenu);\nDSFlyoutMenuWithSchema.propTypes = DSFlyoutMenuPropTypesSchema;\n\nexport { DSFlyoutMenu, DSFlyoutMenuWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC0FX;AA1FZ,SAAS,uBAAuB;AAChC,SAAS,YAAY;AACrB,SAAS,gBAAgB;AACzB,SAAS,QAAQ,0BAA0B;AAE3C,OAAOA,YAAW;AAClB,SAA6B,gCAAgC;AAC7D,SAAS,6CAA6C;AACtD,SAAS,iCAAiC;AAC1C,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,mCAAuD;AAChE,SAAS,kBAAkB;AAC3B,SAAS,iCAAiC;AAC1C,MAAM,gBAAgB,OAAO,MAAM;AAAA,EACjC,MAAM;AAAA,EACN,MAAM,kBAAkB;AAC1B,CAAC;AAAA;AAAA;AA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AA,MACV;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,2BAA2B;AAAA,MAC3B,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,MAEA,8BAAC,iBAAc,eAA8B,wBAAiD,GAAG,cAC/F;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAU;AAAA,UACV,YAAY,SAAS,UAAU,aAAa,yBAAyB;AAAA,UACrE;AAAA,UACA;AAAA,UAEC,mBAAS,SAAS,IAAI,CAAC,eACtB;AAAA,YAAC;AAAA;AAAA,cAGC,UAAU;AAAA,cACV;AAAA,cAIA,6BAA6B,kBAAkB,eAAe;AAAA;AAAA,YAPzD,oBAAoB,WAAW,IAAI,IAAI,WAAW;AAAA,UAQzD,CACD;AAAA;AAAA,MACH,GACF;AAAA;AAAA,EACF;AAEJ;AAEA,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSFlyoutMenu/constants/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSFlyoutMenuName = 'DSFlyoutmenu';\n\nexport const EXAMPLE_CONSTANTS = {} as const;\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FLYOUT_MENU_SLOTS = {\n ROOT: 'root',\n LIST_WRAPPER: 'list-wrapper',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FLYOUT_MENU_DATA_TESTID = slotObjectToDataTestIds(DSFlyoutMenuName, FLYOUT_MENU_SLOTS);\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,mBAAmB;AAEzB,MAAM,oBAAoB,CAAC;AAG3B,MAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,cAAc;AAChB;AAGO,MAAM,0BAA0B,wBAAwB,kBAAkB,iBAAiB;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSFlyoutMenuName = 'DSFlyoutmenu';\n\nexport const EXAMPLE_CONSTANTS = {} as const;\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FLYOUT_MENU_SLOTS = {\n FLOATING_WRAPPER: 'floating-wrapper',\n ROOT: 'root',\n LIST_WRAPPER: 'list-wrapper',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FLYOUT_MENU_DATA_TESTID = slotObjectToDataTestIds(DSFlyoutMenuName, FLYOUT_MENU_SLOTS);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,mBAAmB;AAEzB,MAAM,oBAAoB,CAAC;AAG3B,MAAM,oBAAoB;AAAA,EAC/B,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,cAAc;AAChB;AAGO,MAAM,0BAA0B,wBAAwB,kBAAkB,iBAAiB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,15 +6,20 @@ import {
|
|
|
6
6
|
StyledContentWrapper,
|
|
7
7
|
StyledGlobalMenuItemWrapper
|
|
8
8
|
} from "@elliemae/ds-menu-items-commons";
|
|
9
|
-
import React2 from "react";
|
|
9
|
+
import React2, { useCallback } from "react";
|
|
10
10
|
import { MenuBehaviouralContextProviderContext } from "../DSMenuBehaviouralContextProvider/MenuBehaviouralContextProviderCTX.js";
|
|
11
11
|
import { MENU_FOCUS_REGIONS } from "../DSMenuBehaviouralContextProvider/constants/index.js";
|
|
12
12
|
import { focusNodeRacingConditionSolved } from "./focusNodeRacingConditionSolved.js";
|
|
13
|
+
import { MenuButtonContextProvider } from "../../MenuButtonContextProviderCTX.js";
|
|
13
14
|
const ActivableMenuItem = ({
|
|
14
15
|
itemNode
|
|
15
16
|
}) => {
|
|
16
17
|
const { dsId, plainItem } = itemNode;
|
|
17
18
|
const { label, secondaryLabel, leftDecoration: LeftDecComponent, minWidth, disabled } = plainItem;
|
|
19
|
+
const {
|
|
20
|
+
ownerProps: { getOwnerProps }
|
|
21
|
+
} = React2.useContext(MenuButtonContextProvider);
|
|
22
|
+
const getOwnerPropsArguments = useCallback(() => plainItem, [plainItem]);
|
|
18
23
|
const {
|
|
19
24
|
focusRegion,
|
|
20
25
|
menuItemEventsHandlers: {
|
|
@@ -68,6 +73,8 @@ const ActivableMenuItem = ({
|
|
|
68
73
|
tabIndex: isFocused ? 0 : -1,
|
|
69
74
|
"aria-disabled": disabled,
|
|
70
75
|
applyAriaDisabled: disabled,
|
|
76
|
+
getOwnerProps,
|
|
77
|
+
getOwnerPropsArguments,
|
|
71
78
|
children: /* @__PURE__ */ jsxs(
|
|
72
79
|
StyledContentWrapper,
|
|
73
80
|
{
|
|
@@ -76,10 +83,20 @@ const ActivableMenuItem = ({
|
|
|
76
83
|
gutter: "xxs",
|
|
77
84
|
alignItems: "center",
|
|
78
85
|
minWidth: minWidth ?? void 0,
|
|
86
|
+
getOwnerProps,
|
|
87
|
+
getOwnerPropsArguments,
|
|
79
88
|
children: [
|
|
80
89
|
LeftDecComponent ? /* @__PURE__ */ jsx(LeftDecComponent, {}) : null,
|
|
81
|
-
/* @__PURE__ */ jsx(StyleMenuItemLabel, { children: label }),
|
|
82
|
-
secondaryLabel !== void 0 && /* @__PURE__ */ jsx(
|
|
90
|
+
/* @__PURE__ */ jsx(StyleMenuItemLabel, { getOwnerProps, getOwnerPropsArguments, children: label }),
|
|
91
|
+
secondaryLabel !== void 0 && /* @__PURE__ */ jsx(
|
|
92
|
+
StyleMenuItemSecondaryLabel,
|
|
93
|
+
{
|
|
94
|
+
getOwnerProps,
|
|
95
|
+
getOwnerPropsArguments,
|
|
96
|
+
disabled,
|
|
97
|
+
children: secondaryLabel
|
|
98
|
+
}
|
|
99
|
+
)
|
|
83
100
|
]
|
|
84
101
|
}
|
|
85
102
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSMenuItemRendererFactory/ActivableMenuItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport {\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n StyledContentWrapper,\n StyledGlobalMenuItemWrapper,\n} from '@elliemae/ds-menu-items-commons';\nimport React from 'react';\nimport type { DSMenuButtonT } from '../../react-desc-prop-types.js';\nimport { MenuBehaviouralContextProviderContext } from '../DSMenuBehaviouralContextProvider/MenuBehaviouralContextProviderCTX.js';\nimport { MENU_FOCUS_REGIONS } from '../DSMenuBehaviouralContextProvider/constants/index.js';\nimport { focusNodeRacingConditionSolved } from './focusNodeRacingConditionSolved.js';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport {\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n StyledContentWrapper,\n StyledGlobalMenuItemWrapper,\n} from '@elliemae/ds-menu-items-commons';\nimport React, { useCallback } from 'react';\nimport type { DSMenuButtonT } from '../../react-desc-prop-types.js';\nimport { MenuBehaviouralContextProviderContext } from '../DSMenuBehaviouralContextProvider/MenuBehaviouralContextProviderCTX.js';\nimport { MENU_FOCUS_REGIONS } from '../DSMenuBehaviouralContextProvider/constants/index.js';\nimport { focusNodeRacingConditionSolved } from './focusNodeRacingConditionSolved.js';\nimport { MenuButtonContextProvider } from '../../MenuButtonContextProviderCTX.js';\nexport const ActivableMenuItem: React.ComponentType<{ itemNode: DSMenuButtonT.MenuNodeActivableItem }> = ({\n itemNode,\n}) => {\n const { dsId, plainItem } = itemNode;\n const { label, secondaryLabel, leftDecoration: LeftDecComponent, minWidth, disabled } = plainItem;\n\n const {\n ownerProps: { getOwnerProps },\n } = React.useContext(MenuButtonContextProvider);\n\n const getOwnerPropsArguments = useCallback(() => plainItem, [plainItem]);\n const {\n focusRegion,\n menuItemEventsHandlers: {\n handleFocusableMenuItemKeyDown,\n handleFocusableMenuItemClick,\n handleFocusableMenuItemOnMouseEnter,\n handleFocusableMenuItemNativeFocusEvent,\n },\n } = React.useContext(MenuBehaviouralContextProviderContext);\n\n const gridLayout = React.useMemo(() => {\n const cols = LeftDecComponent ? ['min-content', 'auto'] : ['auto'];\n if (secondaryLabel) cols.push('auto');\n return cols;\n }, [LeftDecComponent, secondaryLabel]);\n\n const focusedRegionPerformanceHelper = React.useRef(focusRegion);\n focusedRegionPerformanceHelper.current = focusRegion;\n\n const isFocused = focusRegion === MENU_FOCUS_REGIONS.ITEM_BY_DSID(dsId);\n\n const handleFocusOnRender = React.useCallback(\n (node: HTMLDivElement) => {\n if (node && focusRegion === MENU_FOCUS_REGIONS.ITEM_BY_DSID(dsId)) {\n focusNodeRacingConditionSolved(node);\n }\n },\n // we need to change the callback reference every time the focusRegion changes or else the focus will not be set\n [dsId, focusRegion],\n // we are using the \"as='div'\", typescript is not able to infer the correct type\n // the logic here actually receives a ref to a HTMLDivElement,\n // but the component must think this is a HTMLLIElement ref callback\n ) as unknown as React.RefCallback<HTMLLIElement>;\n const handleOnMouseEnter = React.useCallback<React.MouseEventHandler<HTMLDivElement>>(() => {\n handleFocusableMenuItemOnMouseEnter(itemNode);\n }, [handleFocusableMenuItemOnMouseEnter, itemNode]);\n const handleOnFocus = React.useCallback<React.FocusEventHandler<HTMLDivElement>>(\n (e) => {\n handleFocusableMenuItemNativeFocusEvent(itemNode, e);\n },\n [handleFocusableMenuItemNativeFocusEvent, itemNode],\n );\n\n const spacelessDsIdForDom = `ds-menu-item-${`${dsId}`.replace(/\\s/g, '')}`;\n\n return (\n <StyledGlobalMenuItemWrapper\n innerRef={handleFocusOnRender}\n onKeyDown={handleFocusableMenuItemKeyDown}\n onClick={handleFocusableMenuItemClick}\n onMouseEnter={handleOnMouseEnter}\n onFocus={handleOnFocus}\n as=\"div\"\n id={`${spacelessDsIdForDom}`}\n role=\"menuitem\"\n tabIndex={isFocused ? 0 : -1}\n aria-disabled={disabled}\n applyAriaDisabled={disabled}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledContentWrapper\n cols={gridLayout}\n minHeight=\"16px\"\n gutter=\"xxs\"\n alignItems=\"center\"\n minWidth={minWidth ?? undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {LeftDecComponent ? <LeftDecComponent /> : null}\n <StyleMenuItemLabel getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {label}\n </StyleMenuItemLabel>\n {secondaryLabel !== undefined && (\n <StyleMenuItemSecondaryLabel\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n disabled={disabled}\n >\n {secondaryLabel}\n </StyleMenuItemSecondaryLabel>\n )}\n </StyledContentWrapper>\n </StyledGlobalMenuItemWrapper>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACqFjB,SASsB,KATtB;AApFN;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAOA,UAAS,mBAAmB;AAEnC,SAAS,6CAA6C;AACtD,SAAS,0BAA0B;AACnC,SAAS,sCAAsC;AAC/C,SAAS,iCAAiC;AACnC,MAAM,oBAA4F,CAAC;AAAA,EACxG;AACF,MAAM;AACJ,QAAM,EAAE,MAAM,UAA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