@elliemae/ds-menu-items-submenu 3.35.0 → 3.36.0-next.1
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/DSMenuItemsSubmenu.js +1 -2
- package/dist/cjs/DSMenuItemsSubmenu.js.map +1 -1
- package/dist/cjs/config/getChevronHandlers.js +3 -6
- package/dist/cjs/config/getChevronHandlers.js.map +1 -1
- package/dist/cjs/config/getEllipsisHandlers.js +3 -6
- package/dist/cjs/config/getEllipsisHandlers.js.map +1 -1
- package/dist/cjs/config/useGetSubmenuHandlers.js +1 -2
- package/dist/cjs/config/useGetSubmenuHandlers.js.map +1 -1
- package/dist/cjs/config/useValidateProps.js.map +1 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/DSMenuItemsSubmenu.js +1 -2
- package/dist/esm/DSMenuItemsSubmenu.js.map +1 -1
- package/dist/esm/config/getChevronHandlers.js +3 -6
- package/dist/esm/config/getChevronHandlers.js.map +1 -1
- package/dist/esm/config/getEllipsisHandlers.js +3 -6
- package/dist/esm/config/getEllipsisHandlers.js.map +1 -1
- package/dist/esm/config/useGetSubmenuHandlers.js +1 -2
- package/dist/esm/config/useGetSubmenuHandlers.js.map +1 -1
- package/dist/esm/config/useValidateProps.js.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/types/config/useMenuItemsSubmenu.d.ts +24 -24
- package/package.json +8 -8
|
@@ -73,8 +73,7 @@ const DSMenuItemsSubmenu = (props) => {
|
|
|
73
73
|
}, [isSubmenuOpened]);
|
|
74
74
|
const gridLayout = import_react.default.useMemo(() => {
|
|
75
75
|
const cols = ["auto"];
|
|
76
|
-
if (secondaryLabel !== void 0)
|
|
77
|
-
cols.push("min-content");
|
|
76
|
+
if (secondaryLabel !== void 0) cols.push("min-content");
|
|
78
77
|
cols.push("min-content");
|
|
79
78
|
return cols;
|
|
80
79
|
}, [secondaryLabel]);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSMenuItemsSubmenu.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { MoreOptionsVert, ChevronRight } from '@elliemae/ds-icons';\nimport {\n StyledGlobalMenuItemWrapper,\n StyledContentWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n StyledIconContainer,\n StyledVerticalSeparator,\n StyledEllipsisButton,\n} from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSubmenuT, DSMenuItemsSubmenuPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSubmenu } from './config/useMenuItemsSubmenu.js';\n\nconst DSMenuItemsSubmenu: React.ComponentType<DSMenuItemsSubmenuT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps, eventHandlers } = useMenuItemsSubmenu(props);\n const {\n dsId,\n label,\n secondaryLabel,\n isActive,\n disabled,\n isSubmenuOpened,\n rightAddon,\n innerRef,\n wrapperStyles,\n optionsShouldHavePadding,\n render: Render,\n Dropdown,\n dropdownProps: {\n options,\n openedSubmenus,\n onSubmenuToggle,\n selectedOptions,\n onKeyDown,\n onOptionClick,\n onClickOutside,\n minWidth,\n maxHeight,\n },\n } = propsWithDefault;\n\n // If we don't delay the opening of the poppers, the position will not be placed correctly\n // That why we delay it for the next render using the useEffect hook\n // TODO -- @carusox move this to utilities as a hook\n const [delayedIsOpened, setDelayedIsOpened] = React.useState(false);\n React.useEffect(() => {\n setTimeout(() => setDelayedIsOpened(Boolean(isSubmenuOpened)));\n }, [isSubmenuOpened]);\n\n const gridLayout = React.useMemo(() => {\n const cols = ['auto'];\n if (secondaryLabel !== undefined) cols.push('min-content');\n cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n // We need to exclude minWidth because we have already used it as a key value for the dropdown menu options.\n // i dont think there is a workaround for this at the moment\n // we need a complete refactor in how we build the submenus\n // eslint-disable-next-line no-unused-vars\n const { minWidth: customMinWidth, ...restXStyled } = xstyledProps;\n // eslint-disable-next-line no-unused-vars\n const { onMouseLeave, onMouseEnter, onMouseDown, ...restGlobalAttributes } = globalProps;\n\n const { onMouseEnterHandler, onMouseLeaveHandler, onMouseDownHandler, onEllipsisClick } = eventHandlers;\n\n return (\n <Dropdown\n isOpened={delayedIsOpened}\n options={options ?? []}\n onOptionClick={onOptionClick}\n startPlacementPreference=\"right-start\"\n placementOrderPreference={['right-start', 'right-end', 'left-start', 'left-end']}\n selectedOptions={selectedOptions}\n openedSubmenus={openedSubmenus}\n onSubmenuToggle={onSubmenuToggle}\n onKeyDown={onKeyDown}\n onClickOutside={onClickOutside}\n customOffset={[-4, 1]}\n wrapperStyles={{ ...wrapperStyles, w: '100%' }}\n as=\"li\"\n role=\"option\"\n minWidth={minWidth}\n maxHeight={maxHeight}\n aria-selected={isSubmenuOpened}\n aria-describedby={`dropdownmenu-submenu-${dsId}`}\n data-popover-label={label}\n id={dsId}\n onMouseEnter={onMouseEnterHandler}\n onMouseLeave={onMouseLeaveHandler}\n onMouseDown={onMouseDownHandler}\n {...restGlobalAttributes}\n {...restXStyled}\n >\n <StyledGlobalMenuItemWrapper\n pr={0}\n isSelected={isSubmenuOpened}\n isActive={isActive}\n onMouseEnter={onMouseEnterHandler}\n onMouseLeave={onMouseLeaveHandler}\n innerRef={innerRef}\n disabled={disabled}\n pl={optionsShouldHavePadding ? 40 : 16}\n as={'div' as keyof JSX.IntrinsicElements}\n data-type=\"submenu\"\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledContentWrapper cols={gridLayout} gutter=\"xxs\" alignItems=\"center\">\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && (\n <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>\n )}\n <StyledIconContainer>\n <StyledVerticalSeparator />\n {rightAddon === 'ellipsis' ? (\n <StyledEllipsisButton tabIndex={-1} onClick={onEllipsisClick} disabled={disabled}>\n <MoreOptionsVert\n className=\"ds-dropdown-menu-v2-more-options\"\n color={disabled ? ['neutral', '500'] : ['brand-primary', '600']}\n size=\"s\"\n />\n </StyledEllipsisButton>\n ) : (\n <ChevronRight color={disabled ? ['neutral', '500'] : ['brand-primary', '600']} size=\"s\" />\n )}\n </StyledIconContainer>\n </StyledContentWrapper>\n )}\n <span id={`dropdownmenu-submenu-${dsId}`} style={{ display: 'none' }}>\n submenu, to open this submenu press the Right Arrow key\n </span>\n </StyledGlobalMenuItemWrapper>\n </Dropdown>\n );\n};\n\nDSMenuItemsSubmenu.displayName = 'DSMenuItemSubmenu';\nconst DSMenuItemsSubmenuWithSchema = describe(DSMenuItemsSubmenu);\nDSMenuItemsSubmenuWithSchema.propTypes = DSMenuItemsSubmenuPropTypesSchema;\n\nexport { DSMenuItemsSubmenu, DSMenuItemsSubmenuWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6Gb;AA7GV,mBAAkB;AAClB,8BAAyB;AACzB,sBAA8C;AAC9C,mCAQO;AACP,mCAA4E;AAC5E,iCAAoC;AAEpC,MAAM,qBAAqE,CAAC,UAAU;AACpF,QAAM,EAAE,kBAAkB,aAAa,cAAc,cAAc,QAAI,gDAAoB,KAAK;AAChG,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA,eAAe;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAA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SAAS,iBAAiB,UAC5D;AAAA,kBAAC;AAAA;AAAA,oBACC,WAAU;AAAA,oBACV,OAAO,WAAW,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK;AAAA,oBAC9D,MAAK;AAAA;AAAA,gBACP,GACF,IAEA,4CAAC,gCAAa,OAAO,WAAW,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK,GAAG,MAAK,KAAI;AAAA,iBAE5F;AAAA,eACF;AAAA,YAEF,4CAAC,UAAK,IAAI,wBAAwB,IAAI,IAAI,OAAO,EAAE,SAAS,OAAO,GAAG,qEAEtE;AAAA;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;AAEA,mBAAmB,cAAc;AACjC,MAAM,mCAA+B,kCAAS,kBAAkB;AAChE,6BAA6B,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -43,10 +43,8 @@ const getChevronHandlers = ({
|
|
|
43
43
|
}) => {
|
|
44
44
|
const timeoutRef = { current: null };
|
|
45
45
|
const onMouseEnterHandler = (e) => {
|
|
46
|
-
if (timeoutRef.current !== null)
|
|
47
|
-
|
|
48
|
-
else if (!isSubmenuOpened)
|
|
49
|
-
onSubmenuOpen?.(e);
|
|
46
|
+
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
47
|
+
else if (!isSubmenuOpened) onSubmenuOpen?.(e);
|
|
50
48
|
timeoutRef.current = null;
|
|
51
49
|
onMouseEnter?.(e);
|
|
52
50
|
};
|
|
@@ -60,8 +58,7 @@ const getChevronHandlers = ({
|
|
|
60
58
|
onMouseLeave?.(e);
|
|
61
59
|
};
|
|
62
60
|
const onMouseDownHandler = (e) => {
|
|
63
|
-
if (disabled)
|
|
64
|
-
return;
|
|
61
|
+
if (disabled) return;
|
|
65
62
|
onMouseDown?.(e);
|
|
66
63
|
};
|
|
67
64
|
const onEllipsisClick = () => {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/getChevronHandlers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import type { DSMenuItemsSubmenuT } from '../react-desc-prop-types.js';\n\n// what we are trying to do:\n// onMouseEnter -> open submenu\n// onMouseLeave -> close submenu\n// onEllipsisClick -> we should not even invoke this handler, as the \"ellipsis\" should not even exist?\n\n// what are the \"challenges\" of the task:\n// - the submenu close has an animation and we ideally want to be sure state changes after the animation is done\n// (we do it via an hardcoded 300ms delay, this is know to cause issues in some cases)\n// - \"what is open and what is closed\" state lives under ds-dropdownmenu,\n// we manipulate it via \"onSubmenuOpen\" and \"onSubmenuClose\" callbacks\n// - we have created the API in such a way that we implement a \"bridge\" and \"inversion of control\" pattern\n// this requires extra care when handling the logic and designing the solution\n\n// important and relevant info:\n// when this comment has been written,\n// onSubmenuOpen coming from SingleWithSubmenuProps is forcing only one submenu to be open at a time internally\n// the logic for this is implemented in ds-dropdownmenu,\n// we had a bug in which we were invoking a stale callback,\n// we monkeypatching it by ensuring the callback never changes\n// in the future we should create code with \"hydraters\" to avoid this as per shuttle-v2\n\nexport const getChevronHandlers = ({\n isSubmenuOpened,\n onMouseEnter,\n onSubmenuOpen,\n onSubmenuClose,\n onMouseLeave,\n onMouseDown,\n disabled,\n}: DSMenuItemsSubmenuT.InternalProps) => {\n const timeoutRef: { current: NodeJS.Timeout | null } = { current: null };\n\n const onMouseEnterHandler = (e: React.MouseEvent) => {\n if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);\n else if (!isSubmenuOpened) onSubmenuOpen?.(e);\n timeoutRef.current = null;\n onMouseEnter?.(e);\n };\n\n const onMouseLeaveHandler = (e: React.MouseEvent) => {\n if (timeoutRef.current === null) {\n timeoutRef.current = setTimeout(() => {\n timeoutRef.current = null;\n onSubmenuClose?.(e);\n }, 300);\n }\n onMouseLeave?.(e);\n };\n\n const onMouseDownHandler = (e: React.MouseEvent) => {\n if (disabled) return;\n onMouseDown?.(e);\n };\n\n const onEllipsisClick = () => {\n throw new Error('Invoking onEllipsisClick from chevron handlers... this should never happen');\n };\n\n return { onMouseEnterHandler, onMouseLeaveHandler, onMouseDownHandler, onEllipsisClick };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuBhB,MAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyC;AACvC,QAAM,aAAiD,EAAE,SAAS,KAAK;AAEvE,QAAM,sBAAsB,CAAC,MAAwB;AACnD,QAAI,WAAW,YAAY
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuBhB,MAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyC;AACvC,QAAM,aAAiD,EAAE,SAAS,KAAK;AAEvE,QAAM,sBAAsB,CAAC,MAAwB;AACnD,QAAI,WAAW,YAAY,KAAM,cAAa,WAAW,OAAO;AAAA,aACvD,CAAC,gBAAiB,iBAAgB,CAAC;AAC5C,eAAW,UAAU;AACrB,mBAAe,CAAC;AAAA,EAClB;AAEA,QAAM,sBAAsB,CAAC,MAAwB;AACnD,QAAI,WAAW,YAAY,MAAM;AAC/B,iBAAW,UAAU,WAAW,MAAM;AACpC,mBAAW,UAAU;AACrB,yBAAiB,CAAC;AAAA,MACpB,GAAG,GAAG;AAAA,IACR;AACA,mBAAe,CAAC;AAAA,EAClB;AAEA,QAAM,qBAAqB,CAAC,MAAwB;AAClD,QAAI,SAAU;AACd,kBAAc,CAAC;AAAA,EACjB;AAEA,QAAM,kBAAkB,MAAM;AAC5B,UAAM,IAAI,MAAM,4EAA4E;AAAA,EAC9F;AAEA,SAAO,EAAE,qBAAqB,qBAAqB,oBAAoB,gBAAgB;AACzF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -51,13 +51,10 @@ const getEllipsisHandlers = ({
|
|
|
51
51
|
onMouseDown?.(e);
|
|
52
52
|
};
|
|
53
53
|
const onEllipsisClick = (e) => {
|
|
54
|
-
if (disabled)
|
|
55
|
-
return;
|
|
54
|
+
if (disabled) return;
|
|
56
55
|
e.stopPropagation();
|
|
57
|
-
if (isSubmenuOpened)
|
|
58
|
-
|
|
59
|
-
else
|
|
60
|
-
onSubmenuOpen(e);
|
|
56
|
+
if (isSubmenuOpened) onSubmenuClose?.(e);
|
|
57
|
+
else onSubmenuOpen(e);
|
|
61
58
|
};
|
|
62
59
|
return { onMouseEnterHandler, onMouseLeaveHandler, onMouseDownHandler, onEllipsisClick };
|
|
63
60
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/getEllipsisHandlers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import type { DSMenuItemsSubmenuT } from '../react-desc-prop-types.js';\n\n// what we are trying to do:\n// onMouseEnter -> be transparently \"doing nothing\" as hover does nothing by design for \"ellipsis\"\n// onMouseLeave -> be transparently \"doing nothing\" as hover does nothing by design for \"ellipsis\"\n// onEllipsisClick -> toggle the submenu open/close as per design\n\n// what are the \"challenges\" of the task:\n// - we have created the API in such a way that we implement a \"bridge\" and \"inversion of control\" pattern\n// this requires extra care when handling the logic and designing the solution\n\nexport const getEllipsisHandlers = ({\n disabled,\n isSubmenuOpened,\n onMouseEnter,\n onSubmenuOpen,\n onSubmenuClose,\n onMouseLeave,\n onMouseDown,\n}: DSMenuItemsSubmenuT.InternalProps) => {\n // why not just onMouseEnterHandler = onMouseEnter?\n // we expect onMouseEnterHandler/onMouseLeaveHandler\n // to always exist even if onMouseEnter/onMouseLeave are undefined\n // also, if in the future we need custom logic for these handlers, we can add it here\n const onMouseEnterHandler: React.MouseEventHandler = (e) => onMouseEnter?.(e);\n const onMouseLeaveHandler: React.MouseEventHandler = (e) => onMouseLeave?.(e);\n const onMouseDownHandler: React.MouseEventHandler = (e) => {\n if (disabled) {\n e.preventDefault();\n return;\n }\n onMouseDown?.(e);\n };\n const onEllipsisClick: React.MouseEventHandler = (e) => {\n if (disabled) return;\n e.stopPropagation();\n if (isSubmenuOpened) onSubmenuClose?.(e);\n else onSubmenuOpen(e);\n };\n\n return { onMouseEnterHandler, onMouseLeaveHandler, onMouseDownHandler, onEllipsisClick };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADWhB,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyC;AAKvC,QAAM,sBAA+C,CAAC,MAAM,eAAe,CAAC;AAC5E,QAAM,sBAA+C,CAAC,MAAM,eAAe,CAAC;AAC5E,QAAM,qBAA8C,CAAC,MAAM;AACzD,QAAI,UAAU;AACZ,QAAE,eAAe;AACjB;AAAA,IACF;AACA,kBAAc,CAAC;AAAA,EACjB;AACA,QAAM,kBAA2C,CAAC,MAAM;AACtD,QAAI;
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADWhB,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyC;AAKvC,QAAM,sBAA+C,CAAC,MAAM,eAAe,CAAC;AAC5E,QAAM,sBAA+C,CAAC,MAAM,eAAe,CAAC;AAC5E,QAAM,qBAA8C,CAAC,MAAM;AACzD,QAAI,UAAU;AACZ,QAAE,eAAe;AACjB;AAAA,IACF;AACA,kBAAc,CAAC;AAAA,EACjB;AACA,QAAM,kBAA2C,CAAC,MAAM;AACtD,QAAI,SAAU;AACd,MAAE,gBAAgB;AAClB,QAAI,gBAAiB,kBAAiB,CAAC;AAAA,QAClC,eAAc,CAAC;AAAA,EACtB;AAEA,SAAO,EAAE,qBAAqB,qBAAqB,oBAAoB,gBAAgB;AACzF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -38,8 +38,7 @@ var import_getChevronHandlers = require("./getChevronHandlers.js");
|
|
|
38
38
|
const useGetSubmenuHandlers = (propsWithDefault) => {
|
|
39
39
|
const { rightAddon } = propsWithDefault;
|
|
40
40
|
return (0, import_react.useMemo)(() => {
|
|
41
|
-
if (rightAddon === "ellipsis")
|
|
42
|
-
return (0, import_getEllipsisHandlers.getEllipsisHandlers)(propsWithDefault);
|
|
41
|
+
if (rightAddon === "ellipsis") return (0, import_getEllipsisHandlers.getEllipsisHandlers)(propsWithDefault);
|
|
43
42
|
return (0, import_getChevronHandlers.getChevronHandlers)(propsWithDefault);
|
|
44
43
|
}, [propsWithDefault, rightAddon]);
|
|
45
44
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useGetSubmenuHandlers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { useMemo } from 'react';\nimport type { DSMenuItemsSubmenuT } from '../react-desc-prop-types.js';\nimport { getEllipsisHandlers } from './getEllipsisHandlers.js';\nimport { getChevronHandlers } from './getChevronHandlers.js';\n\n// what we are trying to do:\n// Ellipsis case:\n// onMouseEnter -> open submenu\n// onMouseLeave -> close submenu\n// onEllipsisClick -> we should not even invoke this handler, as the \"ellipsis\" should not even exist?\n// Chevron case:\n// onMouseEnter -> be transparently \"doing nothing\" as hover does nothing by design for \"ellipsis\"\n// onMouseLeave -> be transparently \"doing nothing\" as hover does nothing by design for \"ellipsis\"\n// onEllipsisClick -> toggle the submenu open/close as per design\n\n// what are the \"challenges\" of the task:\n// - we have chosen to abstract multiple possible logical \"flows\" into the same layer for some reason\n// specifically speaking this is trying to solve the\n// \"rightAddons\" is \"ellipsis\" case\n// at the same time as the\n// \"rightAddons\" is \"chevron\" case\n// they have more differences than similarities, so this is messy\n\n// @yuri since I'm both lazy and stupid, I want my code to be as stupid simple as me\n// I am removing one layer of abstraction,\n// ellipsis gets it's own logical flow\n// as does chevron\n// if you are a DRY advocate, you will probably hate me for this, I'm all for AHA (Avoid Hasty Abstractions).\nexport const useGetSubmenuHandlers = (propsWithDefault: DSMenuItemsSubmenuT.InternalProps) => {\n const { rightAddon } = propsWithDefault;\n return useMemo(() => {\n if (rightAddon === 'ellipsis') return getEllipsisHandlers(propsWithDefault);\n return getChevronHandlers(propsWithDefault);\n }, [propsWithDefault, rightAddon]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AAExB,iCAAoC;AACpC,gCAAmC;AAyB5B,MAAM,wBAAwB,CAAC,qBAAwD;AAC5F,QAAM,EAAE,WAAW,IAAI;AACvB,aAAO,sBAAQ,MAAM;AACnB,QAAI,eAAe
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AAExB,iCAAoC;AACpC,gCAAmC;AAyB5B,MAAM,wBAAwB,CAAC,qBAAwD;AAC5F,QAAM,EAAE,WAAW,IAAI;AACvB,aAAO,sBAAQ,MAAM;AACnB,QAAI,eAAe,WAAY,YAAO,gDAAoB,gBAAgB;AAC1E,eAAO,8CAAmB,gBAAgB;AAAA,EAC5C,GAAG,CAAC,kBAAkB,UAAU,CAAC;AACnC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { DSMenuItemName } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSubmenuT } from '../react-desc-prop-types.js';\n\n// because this is inherited from the common props, we do not want to put this in the /constants/index.ts file\n// this is strictly defined here because this is meant to strictly influence ONLY the ERROR layer\n// this is 100% decoupled from ds-slots & data-testid\n// this constants only affect the shown error message as of 21/december/2023\nconst DSMenuItemsSubmenuName = `${DSMenuItemName}Submenu`;\n\nexport const useValidateProps = (\n props: DSMenuItemsSubmenuT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSubmenuName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAE/C,mCAA+B;AAO/B,MAAM,yBAAyB,GAAG;
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAE/C,mCAA+B;AAO/B,MAAM,yBAAyB,GAAG,2CAAc;AAEzC,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,8DAA+B,OAAO,WAAW,sBAAsB;AACzE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -34,5 +34,4 @@ __export(src_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(src_exports);
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
36
|
var import_DSMenuItemsSubmenu = require("./DSMenuItemsSubmenu.js");
|
|
37
|
-
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
38
37
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSMenuItemsSubmenu, DSMenuItemsSubmenuWithSchema } from './DSMenuItemsSubmenu.js';\nexport { type DSMenuItemsSubmenuT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,gCAAiE;
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,gCAAiE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -47,8 +47,7 @@ const DSMenuItemsSubmenu = (props) => {
|
|
|
47
47
|
}, [isSubmenuOpened]);
|
|
48
48
|
const gridLayout = React2.useMemo(() => {
|
|
49
49
|
const cols = ["auto"];
|
|
50
|
-
if (secondaryLabel !== void 0)
|
|
51
|
-
cols.push("min-content");
|
|
50
|
+
if (secondaryLabel !== void 0) cols.push("min-content");
|
|
52
51
|
cols.push("min-content");
|
|
53
52
|
return cols;
|
|
54
53
|
}, [secondaryLabel]);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSMenuItemsSubmenu.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { MoreOptionsVert, ChevronRight } from '@elliemae/ds-icons';\nimport {\n StyledGlobalMenuItemWrapper,\n StyledContentWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n StyledIconContainer,\n StyledVerticalSeparator,\n StyledEllipsisButton,\n} from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSubmenuT, DSMenuItemsSubmenuPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSubmenu } from './config/useMenuItemsSubmenu.js';\n\nconst DSMenuItemsSubmenu: React.ComponentType<DSMenuItemsSubmenuT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps, eventHandlers } = useMenuItemsSubmenu(props);\n const {\n dsId,\n label,\n secondaryLabel,\n isActive,\n disabled,\n isSubmenuOpened,\n rightAddon,\n innerRef,\n wrapperStyles,\n optionsShouldHavePadding,\n render: Render,\n Dropdown,\n dropdownProps: {\n options,\n openedSubmenus,\n onSubmenuToggle,\n selectedOptions,\n onKeyDown,\n onOptionClick,\n onClickOutside,\n minWidth,\n maxHeight,\n },\n } = propsWithDefault;\n\n // If we don't delay the opening of the poppers, the position will not be placed correctly\n // That why we delay it for the next render using the useEffect hook\n // TODO -- @carusox move this to utilities as a hook\n const [delayedIsOpened, setDelayedIsOpened] = React.useState(false);\n React.useEffect(() => {\n setTimeout(() => setDelayedIsOpened(Boolean(isSubmenuOpened)));\n }, [isSubmenuOpened]);\n\n const gridLayout = React.useMemo(() => {\n const cols = ['auto'];\n if (secondaryLabel !== undefined) cols.push('min-content');\n cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n // We need to exclude minWidth because we have already used it as a key value for the dropdown menu options.\n // i dont think there is a workaround for this at the moment\n // we need a complete refactor in how we build the submenus\n // eslint-disable-next-line no-unused-vars\n const { minWidth: customMinWidth, ...restXStyled } = xstyledProps;\n // eslint-disable-next-line no-unused-vars\n const { onMouseLeave, onMouseEnter, onMouseDown, ...restGlobalAttributes } = globalProps;\n\n const { onMouseEnterHandler, onMouseLeaveHandler, onMouseDownHandler, onEllipsisClick } = eventHandlers;\n\n return (\n <Dropdown\n isOpened={delayedIsOpened}\n options={options ?? []}\n onOptionClick={onOptionClick}\n startPlacementPreference=\"right-start\"\n placementOrderPreference={['right-start', 'right-end', 'left-start', 'left-end']}\n selectedOptions={selectedOptions}\n openedSubmenus={openedSubmenus}\n onSubmenuToggle={onSubmenuToggle}\n onKeyDown={onKeyDown}\n onClickOutside={onClickOutside}\n customOffset={[-4, 1]}\n wrapperStyles={{ ...wrapperStyles, w: '100%' }}\n as=\"li\"\n role=\"option\"\n minWidth={minWidth}\n maxHeight={maxHeight}\n aria-selected={isSubmenuOpened}\n aria-describedby={`dropdownmenu-submenu-${dsId}`}\n data-popover-label={label}\n id={dsId}\n onMouseEnter={onMouseEnterHandler}\n onMouseLeave={onMouseLeaveHandler}\n onMouseDown={onMouseDownHandler}\n {...restGlobalAttributes}\n {...restXStyled}\n >\n <StyledGlobalMenuItemWrapper\n pr={0}\n isSelected={isSubmenuOpened}\n isActive={isActive}\n onMouseEnter={onMouseEnterHandler}\n onMouseLeave={onMouseLeaveHandler}\n innerRef={innerRef}\n disabled={disabled}\n pl={optionsShouldHavePadding ? 40 : 16}\n as={'div' as keyof JSX.IntrinsicElements}\n data-type=\"submenu\"\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledContentWrapper cols={gridLayout} gutter=\"xxs\" alignItems=\"center\">\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && (\n <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>\n )}\n <StyledIconContainer>\n <StyledVerticalSeparator />\n {rightAddon === 'ellipsis' ? (\n <StyledEllipsisButton tabIndex={-1} onClick={onEllipsisClick} disabled={disabled}>\n <MoreOptionsVert\n className=\"ds-dropdown-menu-v2-more-options\"\n color={disabled ? ['neutral', '500'] : ['brand-primary', '600']}\n size=\"s\"\n />\n </StyledEllipsisButton>\n ) : (\n <ChevronRight color={disabled ? ['neutral', '500'] : ['brand-primary', '600']} size=\"s\" />\n )}\n </StyledIconContainer>\n </StyledContentWrapper>\n )}\n <span id={`dropdownmenu-submenu-${dsId}`} style={{ display: 'none' }}>\n submenu, to open this submenu press the Right Arrow key\n </span>\n </StyledGlobalMenuItemWrapper>\n </Dropdown>\n );\n};\n\nDSMenuItemsSubmenu.displayName = 'DSMenuItemSubmenu';\nconst DSMenuItemsSubmenuWithSchema = describe(DSMenuItemsSubmenu);\nDSMenuItemsSubmenuWithSchema.propTypes = DSMenuItemsSubmenuPropTypesSchema;\n\nexport { DSMenuItemsSubmenu, DSMenuItemsSubmenuWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC6Gb,cAOE,YAPF;AA7GV,OAAOA,YAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,iBAAiB,oBAAoB;AAC9C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAmC,yCAAyC;AAC5E,SAAS,2BAA2B;AAEpC,MAAM,qBAAqE,CAAC,UAAU;AACpF,QAAM,EAAE,kBAAkB,aAAa,cAAc,cAAc,IAAI,oBAAoB,KAAK;AAChG,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA,eAAe;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,IAAI;AAKJ,QAAM,CAAC,iBAAiB,kBAAkB,IAAIA,OAAM,SAAS,KAAK;AAClE,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;AAAA,oBACC,WAAU;AAAA,oBACV,OAAO,WAAW,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK;AAAA,oBAC9D,MAAK;AAAA;AAAA,gBACP,GACF,IAEA,oBAAC,gBAAa,OAAO,WAAW,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK,GAAG,MAAK,KAAI;AAAA,iBAE5F;AAAA,eACF;AAAA,YAEF,oBAAC,UAAK,IAAI,wBAAwB,IAAI,IAAI,OAAO,EAAE,SAAS,OAAO,GAAG,qEAEtE;AAAA;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;AAEA,mBAAmB,cAAc;AACjC,MAAM,+BAA+B,SAAS,kBAAkB;AAChE,6BAA6B,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -10,10 +10,8 @@ const getChevronHandlers = ({
|
|
|
10
10
|
}) => {
|
|
11
11
|
const timeoutRef = { current: null };
|
|
12
12
|
const onMouseEnterHandler = (e) => {
|
|
13
|
-
if (timeoutRef.current !== null)
|
|
14
|
-
|
|
15
|
-
else if (!isSubmenuOpened)
|
|
16
|
-
onSubmenuOpen?.(e);
|
|
13
|
+
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
14
|
+
else if (!isSubmenuOpened) onSubmenuOpen?.(e);
|
|
17
15
|
timeoutRef.current = null;
|
|
18
16
|
onMouseEnter?.(e);
|
|
19
17
|
};
|
|
@@ -27,8 +25,7 @@ const getChevronHandlers = ({
|
|
|
27
25
|
onMouseLeave?.(e);
|
|
28
26
|
};
|
|
29
27
|
const onMouseDownHandler = (e) => {
|
|
30
|
-
if (disabled)
|
|
31
|
-
return;
|
|
28
|
+
if (disabled) return;
|
|
32
29
|
onMouseDown?.(e);
|
|
33
30
|
};
|
|
34
31
|
const onEllipsisClick = () => {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/getChevronHandlers.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSMenuItemsSubmenuT } from '../react-desc-prop-types.js';\n\n// what we are trying to do:\n// onMouseEnter -> open submenu\n// onMouseLeave -> close submenu\n// onEllipsisClick -> we should not even invoke this handler, as the \"ellipsis\" should not even exist?\n\n// what are the \"challenges\" of the task:\n// - the submenu close has an animation and we ideally want to be sure state changes after the animation is done\n// (we do it via an hardcoded 300ms delay, this is know to cause issues in some cases)\n// - \"what is open and what is closed\" state lives under ds-dropdownmenu,\n// we manipulate it via \"onSubmenuOpen\" and \"onSubmenuClose\" callbacks\n// - we have created the API in such a way that we implement a \"bridge\" and \"inversion of control\" pattern\n// this requires extra care when handling the logic and designing the solution\n\n// important and relevant info:\n// when this comment has been written,\n// onSubmenuOpen coming from SingleWithSubmenuProps is forcing only one submenu to be open at a time internally\n// the logic for this is implemented in ds-dropdownmenu,\n// we had a bug in which we were invoking a stale callback,\n// we monkeypatching it by ensuring the callback never changes\n// in the future we should create code with \"hydraters\" to avoid this as per shuttle-v2\n\nexport const getChevronHandlers = ({\n isSubmenuOpened,\n onMouseEnter,\n onSubmenuOpen,\n onSubmenuClose,\n onMouseLeave,\n onMouseDown,\n disabled,\n}: DSMenuItemsSubmenuT.InternalProps) => {\n const timeoutRef: { current: NodeJS.Timeout | null } = { current: null };\n\n const onMouseEnterHandler = (e: React.MouseEvent) => {\n if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);\n else if (!isSubmenuOpened) onSubmenuOpen?.(e);\n timeoutRef.current = null;\n onMouseEnter?.(e);\n };\n\n const onMouseLeaveHandler = (e: React.MouseEvent) => {\n if (timeoutRef.current === null) {\n timeoutRef.current = setTimeout(() => {\n timeoutRef.current = null;\n onSubmenuClose?.(e);\n }, 300);\n }\n onMouseLeave?.(e);\n };\n\n const onMouseDownHandler = (e: React.MouseEvent) => {\n if (disabled) return;\n onMouseDown?.(e);\n };\n\n const onEllipsisClick = () => {\n throw new Error('Invoking onEllipsisClick from chevron handlers... this should never happen');\n };\n\n return { onMouseEnterHandler, onMouseLeaveHandler, onMouseDownHandler, onEllipsisClick };\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACuBhB,MAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyC;AACvC,QAAM,aAAiD,EAAE,SAAS,KAAK;AAEvE,QAAM,sBAAsB,CAAC,MAAwB;AACnD,QAAI,WAAW,YAAY
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACuBhB,MAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyC;AACvC,QAAM,aAAiD,EAAE,SAAS,KAAK;AAEvE,QAAM,sBAAsB,CAAC,MAAwB;AACnD,QAAI,WAAW,YAAY,KAAM,cAAa,WAAW,OAAO;AAAA,aACvD,CAAC,gBAAiB,iBAAgB,CAAC;AAC5C,eAAW,UAAU;AACrB,mBAAe,CAAC;AAAA,EAClB;AAEA,QAAM,sBAAsB,CAAC,MAAwB;AACnD,QAAI,WAAW,YAAY,MAAM;AAC/B,iBAAW,UAAU,WAAW,MAAM;AACpC,mBAAW,UAAU;AACrB,yBAAiB,CAAC;AAAA,MACpB,GAAG,GAAG;AAAA,IACR;AACA,mBAAe,CAAC;AAAA,EAClB;AAEA,QAAM,qBAAqB,CAAC,MAAwB;AAClD,QAAI,SAAU;AACd,kBAAc,CAAC;AAAA,EACjB;AAEA,QAAM,kBAAkB,MAAM;AAC5B,UAAM,IAAI,MAAM,4EAA4E;AAAA,EAC9F;AAEA,SAAO,EAAE,qBAAqB,qBAAqB,oBAAoB,gBAAgB;AACzF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,13 +18,10 @@ const getEllipsisHandlers = ({
|
|
|
18
18
|
onMouseDown?.(e);
|
|
19
19
|
};
|
|
20
20
|
const onEllipsisClick = (e) => {
|
|
21
|
-
if (disabled)
|
|
22
|
-
return;
|
|
21
|
+
if (disabled) return;
|
|
23
22
|
e.stopPropagation();
|
|
24
|
-
if (isSubmenuOpened)
|
|
25
|
-
|
|
26
|
-
else
|
|
27
|
-
onSubmenuOpen(e);
|
|
23
|
+
if (isSubmenuOpened) onSubmenuClose?.(e);
|
|
24
|
+
else onSubmenuOpen(e);
|
|
28
25
|
};
|
|
29
26
|
return { onMouseEnterHandler, onMouseLeaveHandler, onMouseDownHandler, onEllipsisClick };
|
|
30
27
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/getEllipsisHandlers.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSMenuItemsSubmenuT } from '../react-desc-prop-types.js';\n\n// what we are trying to do:\n// onMouseEnter -> be transparently \"doing nothing\" as hover does nothing by design for \"ellipsis\"\n// onMouseLeave -> be transparently \"doing nothing\" as hover does nothing by design for \"ellipsis\"\n// onEllipsisClick -> toggle the submenu open/close as per design\n\n// what are the \"challenges\" of the task:\n// - we have created the API in such a way that we implement a \"bridge\" and \"inversion of control\" pattern\n// this requires extra care when handling the logic and designing the solution\n\nexport const getEllipsisHandlers = ({\n disabled,\n isSubmenuOpened,\n onMouseEnter,\n onSubmenuOpen,\n onSubmenuClose,\n onMouseLeave,\n onMouseDown,\n}: DSMenuItemsSubmenuT.InternalProps) => {\n // why not just onMouseEnterHandler = onMouseEnter?\n // we expect onMouseEnterHandler/onMouseLeaveHandler\n // to always exist even if onMouseEnter/onMouseLeave are undefined\n // also, if in the future we need custom logic for these handlers, we can add it here\n const onMouseEnterHandler: React.MouseEventHandler = (e) => onMouseEnter?.(e);\n const onMouseLeaveHandler: React.MouseEventHandler = (e) => onMouseLeave?.(e);\n const onMouseDownHandler: React.MouseEventHandler = (e) => {\n if (disabled) {\n e.preventDefault();\n return;\n }\n onMouseDown?.(e);\n };\n const onEllipsisClick: React.MouseEventHandler = (e) => {\n if (disabled) return;\n e.stopPropagation();\n if (isSubmenuOpened) onSubmenuClose?.(e);\n else onSubmenuOpen(e);\n };\n\n return { onMouseEnterHandler, onMouseLeaveHandler, onMouseDownHandler, onEllipsisClick };\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACWhB,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyC;AAKvC,QAAM,sBAA+C,CAAC,MAAM,eAAe,CAAC;AAC5E,QAAM,sBAA+C,CAAC,MAAM,eAAe,CAAC;AAC5E,QAAM,qBAA8C,CAAC,MAAM;AACzD,QAAI,UAAU;AACZ,QAAE,eAAe;AACjB;AAAA,IACF;AACA,kBAAc,CAAC;AAAA,EACjB;AACA,QAAM,kBAA2C,CAAC,MAAM;AACtD,QAAI;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACWhB,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyC;AAKvC,QAAM,sBAA+C,CAAC,MAAM,eAAe,CAAC;AAC5E,QAAM,sBAA+C,CAAC,MAAM,eAAe,CAAC;AAC5E,QAAM,qBAA8C,CAAC,MAAM;AACzD,QAAI,UAAU;AACZ,QAAE,eAAe;AACjB;AAAA,IACF;AACA,kBAAc,CAAC;AAAA,EACjB;AACA,QAAM,kBAA2C,CAAC,MAAM;AACtD,QAAI,SAAU;AACd,MAAE,gBAAgB;AAClB,QAAI,gBAAiB,kBAAiB,CAAC;AAAA,QAClC,eAAc,CAAC;AAAA,EACtB;AAEA,SAAO,EAAE,qBAAqB,qBAAqB,oBAAoB,gBAAgB;AACzF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,8 +5,7 @@ import { getChevronHandlers } from "./getChevronHandlers.js";
|
|
|
5
5
|
const useGetSubmenuHandlers = (propsWithDefault) => {
|
|
6
6
|
const { rightAddon } = propsWithDefault;
|
|
7
7
|
return useMemo(() => {
|
|
8
|
-
if (rightAddon === "ellipsis")
|
|
9
|
-
return getEllipsisHandlers(propsWithDefault);
|
|
8
|
+
if (rightAddon === "ellipsis") return getEllipsisHandlers(propsWithDefault);
|
|
10
9
|
return getChevronHandlers(propsWithDefault);
|
|
11
10
|
}, [propsWithDefault, rightAddon]);
|
|
12
11
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useGetSubmenuHandlers.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport type { DSMenuItemsSubmenuT } from '../react-desc-prop-types.js';\nimport { getEllipsisHandlers } from './getEllipsisHandlers.js';\nimport { getChevronHandlers } from './getChevronHandlers.js';\n\n// what we are trying to do:\n// Ellipsis case:\n// onMouseEnter -> open submenu\n// onMouseLeave -> close submenu\n// onEllipsisClick -> we should not even invoke this handler, as the \"ellipsis\" should not even exist?\n// Chevron case:\n// onMouseEnter -> be transparently \"doing nothing\" as hover does nothing by design for \"ellipsis\"\n// onMouseLeave -> be transparently \"doing nothing\" as hover does nothing by design for \"ellipsis\"\n// onEllipsisClick -> toggle the submenu open/close as per design\n\n// what are the \"challenges\" of the task:\n// - we have chosen to abstract multiple possible logical \"flows\" into the same layer for some reason\n// specifically speaking this is trying to solve the\n// \"rightAddons\" is \"ellipsis\" case\n// at the same time as the\n// \"rightAddons\" is \"chevron\" case\n// they have more differences than similarities, so this is messy\n\n// @yuri since I'm both lazy and stupid, I want my code to be as stupid simple as me\n// I am removing one layer of abstraction,\n// ellipsis gets it's own logical flow\n// as does chevron\n// if you are a DRY advocate, you will probably hate me for this, I'm all for AHA (Avoid Hasty Abstractions).\nexport const useGetSubmenuHandlers = (propsWithDefault: DSMenuItemsSubmenuT.InternalProps) => {\n const { rightAddon } = propsWithDefault;\n return useMemo(() => {\n if (rightAddon === 'ellipsis') return getEllipsisHandlers(propsWithDefault);\n return getChevronHandlers(propsWithDefault);\n }, [propsWithDefault, rightAddon]);\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAExB,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AAyB5B,MAAM,wBAAwB,CAAC,qBAAwD;AAC5F,QAAM,EAAE,WAAW,IAAI;AACvB,SAAO,QAAQ,MAAM;AACnB,QAAI,eAAe
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAExB,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AAyB5B,MAAM,wBAAwB,CAAC,qBAAwD;AAC5F,QAAM,EAAE,WAAW,IAAI;AACvB,SAAO,QAAQ,MAAM;AACnB,QAAI,eAAe,WAAY,QAAO,oBAAoB,gBAAgB;AAC1E,WAAO,mBAAmB,gBAAgB;AAAA,EAC5C,GAAG,CAAC,kBAAkB,UAAU,CAAC;AACnC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { DSMenuItemName } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSubmenuT } from '../react-desc-prop-types.js';\n\n// because this is inherited from the common props, we do not want to put this in the /constants/index.ts file\n// this is strictly defined here because this is meant to strictly influence ONLY the ERROR layer\n// this is 100% decoupled from ds-slots & data-testid\n// this constants only affect the shown error message as of 21/december/2023\nconst DSMenuItemsSubmenuName = `${DSMenuItemName}Submenu`;\n\nexport const useValidateProps = (\n props: DSMenuItemsSubmenuT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsSubmenuName);\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAE/C,SAAS,sBAAsB;AAO/B,MAAM,yBAAyB,GAAG;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAE/C,SAAS,sBAAsB;AAO/B,MAAM,yBAAyB,GAAG,cAAc;AAEzC,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,sBAAsB;AACzE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
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 { DSMenuItemsSubmenu, DSMenuItemsSubmenuWithSchema } from './DSMenuItemsSubmenu.js';\nexport { type DSMenuItemsSubmenuT } from './react-desc-prop-types.js';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,oBAAoB,oCAAoC;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,oBAAoB,oCAAoC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -12,13 +12,20 @@ export interface MenuItemsSubmenuCTX {
|
|
|
12
12
|
export declare const useMenuItemsSubmenu: (propsFromUser: DSMenuItemsSubmenuT.Props) => {
|
|
13
13
|
propsWithDefault: DSMenuItemsSubmenuT.InternalProps;
|
|
14
14
|
globalProps: Partial<Pick<DSGridT.Props, "sizes" | "checked" | "disabled" | "placeholder" | "onKeyDown" | "label" | "form" | "list" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "cite" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "pattern" | "playsInline" | "poster" | "preload" | "readOnly" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap"> & Omit<{
|
|
15
|
-
|
|
15
|
+
sizes?: string | undefined;
|
|
16
|
+
checked?: boolean | undefined;
|
|
17
|
+
disabled?: boolean | undefined;
|
|
18
|
+
placeholder?: string | undefined;
|
|
19
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
20
|
+
label?: string | undefined;
|
|
21
|
+
form?: string | undefined;
|
|
22
|
+
list?: string | undefined;
|
|
16
23
|
"aria-activedescendant"?: string | undefined;
|
|
17
|
-
"aria-atomic"?: boolean | "true" | "false" | undefined;
|
|
24
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
18
25
|
"aria-autocomplete"?: "none" | "list" | "inline" | "both" | undefined;
|
|
19
26
|
"aria-braillelabel"?: string | undefined;
|
|
20
27
|
"aria-brailleroledescription"?: string | undefined;
|
|
21
|
-
"aria-busy"?: boolean | "true" | "false" | undefined;
|
|
28
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
22
29
|
"aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
23
30
|
"aria-colcount"?: number | undefined;
|
|
24
31
|
"aria-colindex"?: number | undefined;
|
|
@@ -29,37 +36,37 @@ export declare const useMenuItemsSubmenu: (propsFromUser: DSMenuItemsSubmenuT.Pr
|
|
|
29
36
|
"aria-describedby"?: string | undefined;
|
|
30
37
|
"aria-description"?: string | undefined;
|
|
31
38
|
"aria-details"?: string | undefined;
|
|
32
|
-
"aria-disabled"?: boolean | "true" | "false" | undefined;
|
|
39
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
33
40
|
"aria-dropeffect"?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
34
41
|
"aria-errormessage"?: string | undefined;
|
|
35
|
-
"aria-expanded"?: boolean | "true" | "false" | undefined;
|
|
42
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
36
43
|
"aria-flowto"?: string | undefined;
|
|
37
|
-
"aria-grabbed"?: boolean | "true" | "false" | undefined;
|
|
44
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
38
45
|
"aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
|
|
39
|
-
"aria-hidden"?: boolean | "true" | "false" | undefined;
|
|
46
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
40
47
|
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
41
48
|
"aria-keyshortcuts"?: string | undefined;
|
|
42
49
|
"aria-label"?: string | undefined;
|
|
43
50
|
"aria-labelledby"?: string | undefined;
|
|
44
51
|
"aria-level"?: number | undefined;
|
|
45
52
|
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
46
|
-
"aria-modal"?: boolean | "true" | "false" | undefined;
|
|
47
|
-
"aria-multiline"?: boolean | "true" | "false" | undefined;
|
|
48
|
-
"aria-multiselectable"?: boolean | "true" | "false" | undefined;
|
|
53
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
54
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
55
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
49
56
|
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
50
57
|
"aria-owns"?: string | undefined;
|
|
51
58
|
"aria-placeholder"?: string | undefined;
|
|
52
59
|
"aria-posinset"?: number | undefined;
|
|
53
60
|
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
54
|
-
"aria-readonly"?: boolean | "true" | "false" | undefined;
|
|
61
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
55
62
|
"aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
56
|
-
"aria-required"?: boolean | "true" | "false" | undefined;
|
|
63
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
57
64
|
"aria-roledescription"?: string | undefined;
|
|
58
65
|
"aria-rowcount"?: number | undefined;
|
|
59
66
|
"aria-rowindex"?: number | undefined;
|
|
60
67
|
"aria-rowindextext"?: string | undefined;
|
|
61
68
|
"aria-rowspan"?: number | undefined;
|
|
62
|
-
"aria-selected"?: boolean | "true" | "false" | undefined;
|
|
69
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
63
70
|
"aria-setsize"?: number | undefined;
|
|
64
71
|
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
65
72
|
"aria-valuemax"?: number | undefined;
|
|
@@ -99,7 +106,6 @@ export declare const useMenuItemsSubmenu: (propsFromUser: DSMenuItemsSubmenuT.Pr
|
|
|
99
106
|
onLoadCapture?: React.ReactEventHandler<HTMLDivElement> | undefined;
|
|
100
107
|
onError?: React.ReactEventHandler<HTMLDivElement> | undefined;
|
|
101
108
|
onErrorCapture?: React.ReactEventHandler<HTMLDivElement> | undefined;
|
|
102
|
-
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
103
109
|
onKeyDownCapture?: React.KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
104
110
|
onKeyPress?: React.KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
105
111
|
onKeyPressCapture?: React.KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
@@ -227,8 +233,6 @@ export declare const useMenuItemsSubmenu: (propsFromUser: DSMenuItemsSubmenuT.Pr
|
|
|
227
233
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLDivElement> | undefined;
|
|
228
234
|
onTransitionEnd?: React.TransitionEventHandler<HTMLDivElement> | undefined;
|
|
229
235
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLDivElement> | undefined;
|
|
230
|
-
form?: string | undefined;
|
|
231
|
-
list?: string | undefined;
|
|
232
236
|
defaultChecked?: boolean | undefined;
|
|
233
237
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
234
238
|
suppressContentEditableWarning?: boolean | undefined;
|
|
@@ -236,16 +240,16 @@ export declare const useMenuItemsSubmenu: (propsFromUser: DSMenuItemsSubmenuT.Pr
|
|
|
236
240
|
accessKey?: string | undefined;
|
|
237
241
|
autoFocus?: boolean | undefined;
|
|
238
242
|
className?: string | undefined;
|
|
239
|
-
contentEditable?:
|
|
243
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
|
|
240
244
|
contextMenu?: string | undefined;
|
|
241
245
|
dir?: string | undefined;
|
|
242
|
-
draggable?: boolean | "true" | "false" | undefined;
|
|
246
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
243
247
|
hidden?: boolean | undefined;
|
|
244
248
|
id?: string | undefined;
|
|
245
249
|
lang?: string | undefined;
|
|
246
250
|
nonce?: string | undefined;
|
|
247
251
|
slot?: string | undefined;
|
|
248
|
-
spellCheck?: boolean | "true" | "false" | undefined;
|
|
252
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
249
253
|
style?: React.CSSProperties | undefined;
|
|
250
254
|
tabIndex?: 0 | -1 | undefined;
|
|
251
255
|
title?: string | undefined;
|
|
@@ -291,7 +295,6 @@ export declare const useMenuItemsSubmenu: (propsFromUser: DSMenuItemsSubmenuT.Pr
|
|
|
291
295
|
cellSpacing?: string | number | undefined;
|
|
292
296
|
charSet?: string | undefined;
|
|
293
297
|
challenge?: string | undefined;
|
|
294
|
-
checked?: boolean | undefined;
|
|
295
298
|
cite?: string | undefined;
|
|
296
299
|
classID?: string | undefined;
|
|
297
300
|
cols?: number | undefined;
|
|
@@ -303,7 +306,6 @@ export declare const useMenuItemsSubmenu: (propsFromUser: DSMenuItemsSubmenuT.Pr
|
|
|
303
306
|
dateTime?: string | undefined;
|
|
304
307
|
default?: boolean | undefined;
|
|
305
308
|
defer?: boolean | undefined;
|
|
306
|
-
disabled?: boolean | undefined;
|
|
307
309
|
download?: any;
|
|
308
310
|
encType?: string | undefined;
|
|
309
311
|
formAction?: string | undefined;
|
|
@@ -323,7 +325,6 @@ export declare const useMenuItemsSubmenu: (propsFromUser: DSMenuItemsSubmenuT.Pr
|
|
|
323
325
|
keyParams?: string | undefined;
|
|
324
326
|
keyType?: string | undefined;
|
|
325
327
|
kind?: string | undefined;
|
|
326
|
-
label?: string | undefined;
|
|
327
328
|
loop?: boolean | undefined;
|
|
328
329
|
low?: number | undefined;
|
|
329
330
|
manifest?: string | undefined;
|
|
@@ -338,11 +339,11 @@ export declare const useMenuItemsSubmenu: (propsFromUser: DSMenuItemsSubmenuT.Pr
|
|
|
338
339
|
minLength?: number | undefined;
|
|
339
340
|
multiple?: boolean | undefined;
|
|
340
341
|
muted?: boolean | undefined;
|
|
342
|
+
name?: string | undefined;
|
|
341
343
|
noValidate?: boolean | undefined;
|
|
342
344
|
open?: boolean | undefined;
|
|
343
345
|
optimum?: number | undefined;
|
|
344
346
|
pattern?: string | undefined;
|
|
345
|
-
placeholder?: string | undefined;
|
|
346
347
|
playsInline?: boolean | undefined;
|
|
347
348
|
poster?: string | undefined;
|
|
348
349
|
preload?: string | undefined;
|
|
@@ -359,7 +360,6 @@ export declare const useMenuItemsSubmenu: (propsFromUser: DSMenuItemsSubmenuT.Pr
|
|
|
359
360
|
selected?: boolean | undefined;
|
|
360
361
|
shape?: string | undefined;
|
|
361
362
|
size?: number | undefined;
|
|
362
|
-
sizes?: string | undefined;
|
|
363
363
|
span?: number | undefined;
|
|
364
364
|
src?: string | undefined;
|
|
365
365
|
srcDoc?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-menu-items-submenu",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.36.0-next.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Menu Items Submenu",
|
|
6
6
|
"files": [
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@xstyled/styled-components": "~3.6.0",
|
|
40
|
-
"@elliemae/ds-grid": "3.
|
|
41
|
-
"@elliemae/ds-
|
|
42
|
-
"@elliemae/ds-
|
|
43
|
-
"@elliemae/ds-
|
|
44
|
-
"@elliemae/ds-system": "3.
|
|
45
|
-
"@elliemae/ds-utilities": "3.
|
|
40
|
+
"@elliemae/ds-grid": "3.36.0-next.1",
|
|
41
|
+
"@elliemae/ds-menu-items-commons": "3.36.0-next.1",
|
|
42
|
+
"@elliemae/ds-props-helpers": "3.36.0-next.1",
|
|
43
|
+
"@elliemae/ds-icons": "3.36.0-next.1",
|
|
44
|
+
"@elliemae/ds-system": "3.36.0-next.1",
|
|
45
|
+
"@elliemae/ds-utilities": "3.36.0-next.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"lodash": "^4.17.21",
|
|
49
49
|
"styled-components": "~5.3.9",
|
|
50
|
-
"@elliemae/ds-monorepo-devops": "3.
|
|
50
|
+
"@elliemae/ds-monorepo-devops": "3.36.0-next.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@testing-library/jest-dom": "~5.16.4",
|