@elliemae/ds-menu-items-action 3.50.0-next.3 → 3.50.0-rc.2
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/DSMenuItemsAction.js +12 -2
- package/dist/cjs/DSMenuItemsAction.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +2 -0
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/DSMenuItemsAction.js +12 -2
- package/dist/esm/DSMenuItemsAction.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +2 -0
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/config/useMenuItemsAction.d.ts +2 -2
- package/dist/types/react-desc-prop-types.d.ts +2 -1
- package/package.json +13 -12
- /package/dist/types/tests/{DSMenuItemsMulti.a11y.test.d.ts → DSMenuItemsAction.a11y.test.d.ts} +0 -0
|
@@ -46,6 +46,7 @@ const DSMenuItemsAction = (props) => {
|
|
|
46
46
|
label,
|
|
47
47
|
secondaryLabel,
|
|
48
48
|
onClick,
|
|
49
|
+
onKeyDown,
|
|
49
50
|
isActive,
|
|
50
51
|
disabled,
|
|
51
52
|
innerRef,
|
|
@@ -53,14 +54,22 @@ const DSMenuItemsAction = (props) => {
|
|
|
53
54
|
optionsShouldHavePadding,
|
|
54
55
|
render: Render,
|
|
55
56
|
applyAriaDisabled,
|
|
57
|
+
readOnly,
|
|
56
58
|
as
|
|
57
59
|
} = propsWithDefault;
|
|
58
60
|
const handleOnClick = import_react.default.useCallback(
|
|
59
61
|
(e) => {
|
|
60
|
-
if (disabled || applyAriaDisabled) return;
|
|
62
|
+
if (disabled || applyAriaDisabled || readOnly) return;
|
|
61
63
|
onClick?.(e);
|
|
62
64
|
},
|
|
63
|
-
[disabled, applyAriaDisabled, onClick]
|
|
65
|
+
[disabled, applyAriaDisabled, readOnly, onClick]
|
|
66
|
+
);
|
|
67
|
+
const handleOnKeyDown = import_react.default.useCallback(
|
|
68
|
+
(e) => {
|
|
69
|
+
if ((applyAriaDisabled || readOnly) && (e.code === "Space" || e.code === "Enter")) return;
|
|
70
|
+
onKeyDown?.(e);
|
|
71
|
+
},
|
|
72
|
+
[applyAriaDisabled, readOnly, onKeyDown]
|
|
64
73
|
);
|
|
65
74
|
const gridLayout = import_react.default.useMemo(() => {
|
|
66
75
|
const cols = ["auto"];
|
|
@@ -81,6 +90,7 @@ const DSMenuItemsAction = (props) => {
|
|
|
81
90
|
"aria-disabled": applyAriaDisabled,
|
|
82
91
|
...globalAttributes,
|
|
83
92
|
onClick: handleOnClick,
|
|
93
|
+
onKeyDown: handleOnKeyDown,
|
|
84
94
|
...xStyledProps,
|
|
85
95
|
as,
|
|
86
96
|
children: Render !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, { ...propsWithDefault }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu_items_commons.StyledContentWrapper, { cols: gridLayout, minHeight: "16px", gutter: "xxs", alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSMenuItemsAction.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {\n StyledGlobalMenuItemWrapper,\n StyledContentWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n} from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsActionT, DSMenuItemsActionPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsAction } from './config/useMenuItemsAction.js';\n\nconst DSMenuItemsAction: React.ComponentType<DSMenuItemsActionT.Props> = (props) => {\n const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsAction(props);\n\n const {\n dsId,\n label,\n secondaryLabel,\n onClick,\n isActive,\n disabled,\n innerRef,\n wrapperStyles,\n optionsShouldHavePadding,\n render: Render,\n applyAriaDisabled,\n as,\n } = propsWithDefault;\n\n const handleOnClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (disabled || applyAriaDisabled) return;\n onClick?.(e);\n },\n [disabled, applyAriaDisabled, onClick],\n );\n\n const gridLayout = React.useMemo(() => {\n const cols = ['auto'];\n if (secondaryLabel) cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n role=\"option\"\n isActive={isActive}\n disabled={disabled}\n innerRef={innerRef}\n pl={optionsShouldHavePadding ? 40 : 16}\n style={wrapperStyles}\n data-type=\"action\"\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n onClick={handleOnClick}\n {...xStyledProps}\n as={as}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <>\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && (\n <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>\n )}\n </>\n </StyledContentWrapper>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// this is `'DSActionMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsAction.displayName = 'DSActionMenuItem';\nconst DSMenuItemsActionWithSchema = describe(DSMenuItemsAction);\nDSMenuItemsActionWithSchema.propTypes = DSMenuItemsActionPropTypesSchema;\n\nexport { DSMenuItemsAction, DSMenuItemsActionWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {\n StyledGlobalMenuItemWrapper,\n StyledContentWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n} from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsActionT, DSMenuItemsActionPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsAction } from './config/useMenuItemsAction.js';\n\nconst DSMenuItemsAction: React.ComponentType<DSMenuItemsActionT.Props> = (props) => {\n const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsAction(props);\n\n const {\n dsId,\n label,\n secondaryLabel,\n onClick,\n onKeyDown,\n isActive,\n disabled,\n innerRef,\n wrapperStyles,\n optionsShouldHavePadding,\n render: Render,\n applyAriaDisabled,\n readOnly,\n as,\n } = propsWithDefault;\n\n const handleOnClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (disabled || applyAriaDisabled || readOnly) return;\n onClick?.(e);\n },\n [disabled, applyAriaDisabled, readOnly, onClick],\n );\n\n const handleOnKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n if ((applyAriaDisabled || readOnly) && (e.code === 'Space' || e.code === 'Enter')) return;\n onKeyDown?.(e);\n },\n [applyAriaDisabled, readOnly, onKeyDown],\n );\n\n const gridLayout = React.useMemo(() => {\n const cols = ['auto'];\n if (secondaryLabel) cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n role=\"option\"\n isActive={isActive}\n disabled={disabled}\n innerRef={innerRef}\n pl={optionsShouldHavePadding ? 40 : 16}\n style={wrapperStyles}\n data-type=\"action\"\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n {...xStyledProps}\n as={as}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <>\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && (\n <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>\n )}\n </>\n </StyledContentWrapper>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// this is `'DSActionMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsAction.displayName = 'DSActionMenuItem';\nconst DSMenuItemsActionWithSchema = describe(DSMenuItemsAction);\nDSMenuItemsActionWithSchema.propTypes = DSMenuItemsActionPropTypesSchema;\n\nexport { DSMenuItemsAction, DSMenuItemsActionWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuEf;AAvER,mBAAkB;AAClB,8BAAyB;AACzB,mCAKO;AACP,mCAA0E;AAC1E,gCAAmC;AAEnC,MAAM,oBAAmE,CAAC,UAAU;AAClF,QAAM,EAAE,kBAAkB,aAAa,kBAAkB,cAAc,aAAa,QAAI,8CAAmB,KAAK;AAEhH,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;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,gBAAgB,aAAAA,QAAM;AAAA,IAC1B,CAAC,MAAwB;AACvB,UAAI,YAAY,qBAAqB,SAAU;AAC/C,gBAAU,CAAC;AAAA,IACb;AAAA,IACA,CAAC,UAAU,mBAAmB,UAAU,OAAO;AAAA,EACjD;AAEA,QAAM,kBAAkB,aAAAA,QAAM;AAAA,IAC5B,CAAC,MAA2B;AAC1B,WAAK,qBAAqB,cAAc,EAAE,SAAS,WAAW,EAAE,SAAS,SAAU;AACnF,kBAAY,CAAC;AAAA,IACf;AAAA,IACA,CAAC,mBAAmB,UAAU,SAAS;AAAA,EACzC;AAEA,QAAM,aAAa,aAAAA,QAAM,QAAQ,MAAM;AACrC,UAAM,OAAO,CAAC,MAAM;AACpB,QAAI,eAAgB,MAAK,KAAK,aAAa;AAC3C,WAAO;AAAA,EACT,GAAG,CAAC,cAAc,CAAC;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,IAAI,2BAA2B,KAAK;AAAA,MACpC,OAAO;AAAA,MACP,aAAU;AAAA,MACV,iBAAe;AAAA,MACd,GAAG;AAAA,MACJ,SAAS;AAAA,MACT,WAAW;AAAA,MACV,GAAG;AAAA,MACJ;AAAA,MAEC,qBAAW,SACV,4CAAC,UAAQ,GAAG,kBAAkB,IAE9B,4CAAC,qDAAqB,MAAM,YAAY,WAAU,QAAO,QAAO,OAAM,YAAW,UAC/E,sFACE;AAAA,oDAAC,mDAAoB,iBAAM;AAAA,QAC1B,mBAAmB,UAClB,4CAAC,4DAA6B,0BAAe;AAAA,SAEjD,GACF;AAAA;AAAA,EAEJ;AAEJ;AAGA,kBAAkB,cAAc;AAChC,MAAM,kCAA8B,kCAAS,iBAAiB;AAC9D,4BAA4B,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type React from 'react';\n\nexport declare namespace DSMenuItemsActionT {\n // typescript inheritance has no syntax support for \"interfaces\", we have to use union types instead...\n export type RequiredProps = DSMenuItemsCommonsT.RequiredProps;\n\n export type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {\n label: string;\n value: unknown;\n disabled: boolean;\n isActive: boolean;\n onClick: React.MouseEventHandler;\n optionsShouldHavePadding: boolean;\n tabIndex: 0 | -1 | '0' | '-1';\n applyAriaDisabled: boolean;\n as: keyof JSX.IntrinsicElements;\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsActionT.InternalProps> & {\n secondaryLabel?: string;\n };\n\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSMenuItemsActionT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n label: '',\n value: undefined,\n disabled: false,\n isActive: false,\n onClick: () => {},\n optionsShouldHavePadding: false,\n tabIndex: 0,\n applyAriaDisabled: false,\n as: 'li',\n};\n\n// we are removing some keys from the global attributes because they are overridden by the action props\n// eslint-disable-next-line no-unused-vars\nconst { tabIndex, label, value, ...notOvverriddenGlobalPropsTypes } = globalAttributesPropTypes;\n\nexport const DSMenuItemsActionPropTypes: DSPropTypesSchema<DSMenuItemsActionT.InternalProps> = {\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n ...notOvverriddenGlobalPropsTypes,\n ...xstyledPropTypes,\n ...DSMenuItemsCommonsPropTypes,\n\n // TODO - add support to PropTypes.oneOf for typeof number\n // currently PropTypes.oneOf([0, -1]) is not supported\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(\n 'The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.',\n ),\n label: PropTypes.string.description('The label of the menu item.'),\n value: PropTypes.any.description('The value of the menu item.'),\n isActive: PropTypes.bool.description('Whether the menu item is active.'),\n optionsShouldHavePadding: PropTypes.bool.description(\n 'Whether the menu item should have padding. This is used in the context of a menu with options.',\n ),\n secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n as: PropTypes.string.description('The HTML element to render the menu item as.'),\n};\n\nexport const DSMenuItemsActionPropTypesSchema =\n DSMenuItemsActionPropTypes as unknown as ValidationMap<DSMenuItemsActionT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AACvE,mCAIO;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type React from 'react';\n\nexport declare namespace DSMenuItemsActionT {\n // typescript inheritance has no syntax support for \"interfaces\", we have to use union types instead...\n export type RequiredProps = DSMenuItemsCommonsT.RequiredProps;\n\n export type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {\n label: string;\n value: unknown;\n disabled: boolean;\n isActive: boolean;\n onClick: React.MouseEventHandler;\n onKeyDown: React.KeyboardEventHandler;\n optionsShouldHavePadding: boolean;\n tabIndex: 0 | -1 | '0' | '-1';\n applyAriaDisabled: boolean;\n as: keyof React.JSX.IntrinsicElements;\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsActionT.InternalProps> & {\n secondaryLabel?: string;\n };\n\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSMenuItemsActionT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n label: '',\n value: undefined,\n disabled: false,\n isActive: false,\n onClick: () => {},\n onKeyDown: () => {},\n optionsShouldHavePadding: false,\n tabIndex: 0,\n applyAriaDisabled: false,\n as: 'li',\n};\n\n// we are removing some keys from the global attributes because they are overridden by the action props\n// eslint-disable-next-line no-unused-vars\nconst { tabIndex, label, value, ...notOvverriddenGlobalPropsTypes } = globalAttributesPropTypes;\n\nexport const DSMenuItemsActionPropTypes: DSPropTypesSchema<DSMenuItemsActionT.InternalProps> = {\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n ...notOvverriddenGlobalPropsTypes,\n ...xstyledPropTypes,\n ...DSMenuItemsCommonsPropTypes,\n\n // TODO - add support to PropTypes.oneOf for typeof number\n // currently PropTypes.oneOf([0, -1]) is not supported\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(\n 'The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.',\n ),\n label: PropTypes.string.description('The label of the menu item.'),\n value: PropTypes.any.description('The value of the menu item.'),\n isActive: PropTypes.bool.description('Whether the menu item is active.'),\n optionsShouldHavePadding: PropTypes.bool.description(\n 'Whether the menu item should have padding. This is used in the context of a menu with options.',\n ),\n secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n as: PropTypes.string.description('The HTML element to render the menu item as.'),\n};\n\nexport const DSMenuItemsActionPropTypesSchema =\n DSMenuItemsActionPropTypes as unknown as ValidationMap<DSMenuItemsActionT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AACvE,mCAIO;AA+CA,MAAM,eAAgD;AAAA,EAC3D,GAAG;AAAA,EACH,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,WAAW,MAAM;AAAA,EAAC;AAAA,EAClB,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,IAAI;AACN;AAIA,MAAM,EAAE,UAAU,OAAO,OAAO,GAAG,+BAA+B,IAAI;AAE/D,MAAM,6BAAkF;AAAA;AAAA;AAAA,EAG7F,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA,EAIH,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAAE;AAAA,IAClE;AAAA,EACF;AAAA,EACA,OAAO,kCAAU,OAAO,YAAY,6BAA6B;AAAA,EACjE,OAAO,kCAAU,IAAI,YAAY,6BAA6B;AAAA,EAC9D,UAAU,kCAAU,KAAK,YAAY,kCAAkC;AAAA,EACvE,0BAA0B,kCAAU,KAAK;AAAA,IACvC;AAAA,EACF;AAAA,EACA,gBAAgB,kCAAU,OAAO,YAAY,uCAAuC;AAAA,EACpF,mBAAmB,kCAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,IAAI,kCAAU,OAAO,YAAY,8CAA8C;AACjF;AAEO,MAAM,mCACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,6 +17,7 @@ const DSMenuItemsAction = (props) => {
|
|
|
17
17
|
label,
|
|
18
18
|
secondaryLabel,
|
|
19
19
|
onClick,
|
|
20
|
+
onKeyDown,
|
|
20
21
|
isActive,
|
|
21
22
|
disabled,
|
|
22
23
|
innerRef,
|
|
@@ -24,14 +25,22 @@ const DSMenuItemsAction = (props) => {
|
|
|
24
25
|
optionsShouldHavePadding,
|
|
25
26
|
render: Render,
|
|
26
27
|
applyAriaDisabled,
|
|
28
|
+
readOnly,
|
|
27
29
|
as
|
|
28
30
|
} = propsWithDefault;
|
|
29
31
|
const handleOnClick = React2.useCallback(
|
|
30
32
|
(e) => {
|
|
31
|
-
if (disabled || applyAriaDisabled) return;
|
|
33
|
+
if (disabled || applyAriaDisabled || readOnly) return;
|
|
32
34
|
onClick?.(e);
|
|
33
35
|
},
|
|
34
|
-
[disabled, applyAriaDisabled, onClick]
|
|
36
|
+
[disabled, applyAriaDisabled, readOnly, onClick]
|
|
37
|
+
);
|
|
38
|
+
const handleOnKeyDown = React2.useCallback(
|
|
39
|
+
(e) => {
|
|
40
|
+
if ((applyAriaDisabled || readOnly) && (e.code === "Space" || e.code === "Enter")) return;
|
|
41
|
+
onKeyDown?.(e);
|
|
42
|
+
},
|
|
43
|
+
[applyAriaDisabled, readOnly, onKeyDown]
|
|
35
44
|
);
|
|
36
45
|
const gridLayout = React2.useMemo(() => {
|
|
37
46
|
const cols = ["auto"];
|
|
@@ -52,6 +61,7 @@ const DSMenuItemsAction = (props) => {
|
|
|
52
61
|
"aria-disabled": applyAriaDisabled,
|
|
53
62
|
...globalAttributes,
|
|
54
63
|
onClick: handleOnClick,
|
|
64
|
+
onKeyDown: handleOnKeyDown,
|
|
55
65
|
...xStyledProps,
|
|
56
66
|
as,
|
|
57
67
|
children: Render !== void 0 ? /* @__PURE__ */ jsx(Render, { ...propsWithDefault }) : /* @__PURE__ */ jsx(StyledContentWrapper, { cols: gridLayout, minHeight: "16px", gutter: "xxs", alignItems: "center", children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSMenuItemsAction.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {\n StyledGlobalMenuItemWrapper,\n StyledContentWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n} from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsActionT, DSMenuItemsActionPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsAction } from './config/useMenuItemsAction.js';\n\nconst DSMenuItemsAction: React.ComponentType<DSMenuItemsActionT.Props> = (props) => {\n const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsAction(props);\n\n const {\n dsId,\n label,\n secondaryLabel,\n onClick,\n isActive,\n disabled,\n innerRef,\n wrapperStyles,\n optionsShouldHavePadding,\n render: Render,\n applyAriaDisabled,\n as,\n } = propsWithDefault;\n\n const handleOnClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (disabled || applyAriaDisabled) return;\n onClick?.(e);\n },\n [disabled, applyAriaDisabled, onClick],\n );\n\n const gridLayout = React.useMemo(() => {\n const cols = ['auto'];\n if (secondaryLabel) cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n role=\"option\"\n isActive={isActive}\n disabled={disabled}\n innerRef={innerRef}\n pl={optionsShouldHavePadding ? 40 : 16}\n style={wrapperStyles}\n data-type=\"action\"\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n onClick={handleOnClick}\n {...xStyledProps}\n as={as}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <>\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && (\n <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>\n )}\n </>\n </StyledContentWrapper>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// this is `'DSActionMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsAction.displayName = 'DSActionMenuItem';\nconst DSMenuItemsActionWithSchema = describe(DSMenuItemsAction);\nDSMenuItemsActionWithSchema.propTypes = DSMenuItemsActionPropTypesSchema;\n\nexport { DSMenuItemsAction, DSMenuItemsActionWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {\n StyledGlobalMenuItemWrapper,\n StyledContentWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n} from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsActionT, DSMenuItemsActionPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsAction } from './config/useMenuItemsAction.js';\n\nconst DSMenuItemsAction: React.ComponentType<DSMenuItemsActionT.Props> = (props) => {\n const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsAction(props);\n\n const {\n dsId,\n label,\n secondaryLabel,\n onClick,\n onKeyDown,\n isActive,\n disabled,\n innerRef,\n wrapperStyles,\n optionsShouldHavePadding,\n render: Render,\n applyAriaDisabled,\n readOnly,\n as,\n } = propsWithDefault;\n\n const handleOnClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (disabled || applyAriaDisabled || readOnly) return;\n onClick?.(e);\n },\n [disabled, applyAriaDisabled, readOnly, onClick],\n );\n\n const handleOnKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n if ((applyAriaDisabled || readOnly) && (e.code === 'Space' || e.code === 'Enter')) return;\n onKeyDown?.(e);\n },\n [applyAriaDisabled, readOnly, onKeyDown],\n );\n\n const gridLayout = React.useMemo(() => {\n const cols = ['auto'];\n if (secondaryLabel) cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n role=\"option\"\n isActive={isActive}\n disabled={disabled}\n innerRef={innerRef}\n pl={optionsShouldHavePadding ? 40 : 16}\n style={wrapperStyles}\n data-type=\"action\"\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n {...xStyledProps}\n as={as}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <>\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && (\n <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>\n )}\n </>\n </StyledContentWrapper>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// this is `'DSActionMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsAction.displayName = 'DSActionMenuItem';\nconst DSMenuItemsActionWithSchema = describe(DSMenuItemsAction);\nDSMenuItemsActionWithSchema.propTypes = DSMenuItemsActionPropTypesSchema;\n\nexport { DSMenuItemsAction, DSMenuItemsActionWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACuEf,SAGE,UAHF,KAGE,YAHF;AAvER,OAAOA,YAAW;AAClB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAkC,wCAAwC;AAC1E,SAAS,0BAA0B;AAEnC,MAAM,oBAAmE,CAAC,UAAU;AAClF,QAAM,EAAE,kBAAkB,aAAa,kBAAkB,cAAc,aAAa,IAAI,mBAAmB,KAAK;AAEhH,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;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,gBAAgBA,OAAM;AAAA,IAC1B,CAAC,MAAwB;AACvB,UAAI,YAAY,qBAAqB,SAAU;AAC/C,gBAAU,CAAC;AAAA,IACb;AAAA,IACA,CAAC,UAAU,mBAAmB,UAAU,OAAO;AAAA,EACjD;AAEA,QAAM,kBAAkBA,OAAM;AAAA,IAC5B,CAAC,MAA2B;AAC1B,WAAK,qBAAqB,cAAc,EAAE,SAAS,WAAW,EAAE,SAAS,SAAU;AACnF,kBAAY,CAAC;AAAA,IACf;AAAA,IACA,CAAC,mBAAmB,UAAU,SAAS;AAAA,EACzC;AAEA,QAAM,aAAaA,OAAM,QAAQ,MAAM;AACrC,UAAM,OAAO,CAAC,MAAM;AACpB,QAAI,eAAgB,MAAK,KAAK,aAAa;AAC3C,WAAO;AAAA,EACT,GAAG,CAAC,cAAc,CAAC;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,IAAI,2BAA2B,KAAK;AAAA,MACpC,OAAO;AAAA,MACP,aAAU;AAAA,MACV,iBAAe;AAAA,MACd,GAAG;AAAA,MACJ,SAAS;AAAA,MACT,WAAW;AAAA,MACV,GAAG;AAAA,MACJ;AAAA,MAEC,qBAAW,SACV,oBAAC,UAAQ,GAAG,kBAAkB,IAE9B,oBAAC,wBAAqB,MAAM,YAAY,WAAU,QAAO,QAAO,OAAM,YAAW,UAC/E,2CACE;AAAA,4BAAC,sBAAoB,iBAAM;AAAA,QAC1B,mBAAmB,UAClB,oBAAC,+BAA6B,0BAAe;AAAA,SAEjD,GACF;AAAA;AAAA,EAEJ;AAEJ;AAGA,kBAAkB,cAAc;AAChC,MAAM,8BAA8B,SAAS,iBAAiB;AAC9D,4BAA4B,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/react-desc-prop-types.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type React from 'react';\n\nexport declare namespace DSMenuItemsActionT {\n // typescript inheritance has no syntax support for \"interfaces\", we have to use union types instead...\n export type RequiredProps = DSMenuItemsCommonsT.RequiredProps;\n\n export type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {\n label: string;\n value: unknown;\n disabled: boolean;\n isActive: boolean;\n onClick: React.MouseEventHandler;\n optionsShouldHavePadding: boolean;\n tabIndex: 0 | -1 | '0' | '-1';\n applyAriaDisabled: boolean;\n as: keyof JSX.IntrinsicElements;\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsActionT.InternalProps> & {\n secondaryLabel?: string;\n };\n\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSMenuItemsActionT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n label: '',\n value: undefined,\n disabled: false,\n isActive: false,\n onClick: () => {},\n optionsShouldHavePadding: false,\n tabIndex: 0,\n applyAriaDisabled: false,\n as: 'li',\n};\n\n// we are removing some keys from the global attributes because they are overridden by the action props\n// eslint-disable-next-line no-unused-vars\nconst { tabIndex, label, value, ...notOvverriddenGlobalPropsTypes } = globalAttributesPropTypes;\n\nexport const DSMenuItemsActionPropTypes: DSPropTypesSchema<DSMenuItemsActionT.InternalProps> = {\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n ...notOvverriddenGlobalPropsTypes,\n ...xstyledPropTypes,\n ...DSMenuItemsCommonsPropTypes,\n\n // TODO - add support to PropTypes.oneOf for typeof number\n // currently PropTypes.oneOf([0, -1]) is not supported\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(\n 'The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.',\n ),\n label: PropTypes.string.description('The label of the menu item.'),\n value: PropTypes.any.description('The value of the menu item.'),\n isActive: PropTypes.bool.description('Whether the menu item is active.'),\n optionsShouldHavePadding: PropTypes.bool.description(\n 'Whether the menu item should have padding. This is used in the context of a menu with options.',\n ),\n secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n as: PropTypes.string.description('The HTML element to render the menu item as.'),\n};\n\nexport const DSMenuItemsActionPropTypesSchema =\n DSMenuItemsActionPropTypes as unknown as ValidationMap<DSMenuItemsActionT.Props>;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE;AAAA,EAEE;AAAA,EACA;AAAA,OACK;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n type DSMenuItemsCommonsT,\n DSMenuItemsCommonsPropTypes,\n DSMenuItemsCommonsDefaultProps,\n} from '@elliemae/ds-menu-items-commons';\nimport type React from 'react';\n\nexport declare namespace DSMenuItemsActionT {\n // typescript inheritance has no syntax support for \"interfaces\", we have to use union types instead...\n export type RequiredProps = DSMenuItemsCommonsT.RequiredProps;\n\n export type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {\n label: string;\n value: unknown;\n disabled: boolean;\n isActive: boolean;\n onClick: React.MouseEventHandler;\n onKeyDown: React.KeyboardEventHandler;\n optionsShouldHavePadding: boolean;\n tabIndex: 0 | -1 | '0' | '-1';\n applyAriaDisabled: boolean;\n as: keyof React.JSX.IntrinsicElements;\n };\n\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsActionT.InternalProps> & {\n secondaryLabel?: string;\n };\n\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSMenuItemsActionT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n label: '',\n value: undefined,\n disabled: false,\n isActive: false,\n onClick: () => {},\n onKeyDown: () => {},\n optionsShouldHavePadding: false,\n tabIndex: 0,\n applyAriaDisabled: false,\n as: 'li',\n};\n\n// we are removing some keys from the global attributes because they are overridden by the action props\n// eslint-disable-next-line no-unused-vars\nconst { tabIndex, label, value, ...notOvverriddenGlobalPropsTypes } = globalAttributesPropTypes;\n\nexport const DSMenuItemsActionPropTypes: DSPropTypesSchema<DSMenuItemsActionT.InternalProps> = {\n // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps\n // they are NOT inherited from a common element from ds-menu-items-commons\n ...notOvverriddenGlobalPropsTypes,\n ...xstyledPropTypes,\n ...DSMenuItemsCommonsPropTypes,\n\n // TODO - add support to PropTypes.oneOf for typeof number\n // currently PropTypes.oneOf([0, -1]) is not supported\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(\n 'The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed.',\n ),\n label: PropTypes.string.description('The label of the menu item.'),\n value: PropTypes.any.description('The value of the menu item.'),\n isActive: PropTypes.bool.description('Whether the menu item is active.'),\n optionsShouldHavePadding: PropTypes.bool.description(\n 'Whether the menu item should have padding. This is used in the context of a menu with options.',\n ),\n secondaryLabel: PropTypes.string.description('The secondary label of the menu item.'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n as: PropTypes.string.description('The HTML element to render the menu item as.'),\n};\n\nexport const DSMenuItemsActionPropTypesSchema =\n DSMenuItemsActionPropTypes as unknown as ValidationMap<DSMenuItemsActionT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AA+CA,MAAM,eAAgD;AAAA,EAC3D,GAAG;AAAA,EACH,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,WAAW,MAAM;AAAA,EAAC;AAAA,EAClB,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,IAAI;AACN;AAIA,MAAM,EAAE,UAAU,OAAO,OAAO,GAAG,+BAA+B,IAAI;AAE/D,MAAM,6BAAkF;AAAA;AAAA;AAAA,EAG7F,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA,EAIH,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE;AAAA,IAClE;AAAA,EACF;AAAA,EACA,OAAO,UAAU,OAAO,YAAY,6BAA6B;AAAA,EACjE,OAAO,UAAU,IAAI,YAAY,6BAA6B;AAAA,EAC9D,UAAU,UAAU,KAAK,YAAY,kCAAkC;AAAA,EACvE,0BAA0B,UAAU,KAAK;AAAA,IACvC;AAAA,EACF;AAAA,EACA,gBAAgB,UAAU,OAAO,YAAY,uCAAuC;AAAA,EACpF,mBAAmB,UAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,IAAI,UAAU,OAAO,YAAY,8CAA8C;AACjF;AAEO,MAAM,mCACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,7 +8,7 @@ export interface MenuItemsActionCTX {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const useMenuItemsAction: (propsFromUser: DSMenuItemsActionT.Props) => {
|
|
10
10
|
propsWithDefault: DSMenuItemsActionT.InternalProps;
|
|
11
|
-
globalProps: Partial<Pick<object, "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "value" | "disabled" | "onClick" | "tabIndex" | "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" | "
|
|
11
|
+
globalProps: Partial<Pick<object, "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "value" | "disabled" | "onClick" | "onKeyDown" | "tabIndex" | "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" | "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" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "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" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "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" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "width" | "wmode" | "wrap"> & Omit<{
|
|
12
12
|
cite?: string | undefined;
|
|
13
13
|
data?: string | undefined;
|
|
14
14
|
form?: string | undefined;
|
|
@@ -22,6 +22,7 @@ export declare const useMenuItemsAction: (propsFromUser: DSMenuItemsActionT.Prop
|
|
|
22
22
|
value?: string | number | readonly string[] | undefined;
|
|
23
23
|
disabled?: boolean | undefined;
|
|
24
24
|
onClick?: React.MouseEventHandler<HTMLLIElement> | undefined;
|
|
25
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLLIElement> | undefined;
|
|
25
26
|
tabIndex?: 0 | -1 | undefined;
|
|
26
27
|
list?: string | undefined;
|
|
27
28
|
"aria-activedescendant"?: string | undefined;
|
|
@@ -110,7 +111,6 @@ export declare const useMenuItemsAction: (propsFromUser: DSMenuItemsActionT.Prop
|
|
|
110
111
|
onLoadCapture?: React.ReactEventHandler<HTMLLIElement> | undefined;
|
|
111
112
|
onError?: React.ReactEventHandler<HTMLLIElement> | undefined;
|
|
112
113
|
onErrorCapture?: React.ReactEventHandler<HTMLLIElement> | undefined;
|
|
113
|
-
onKeyDown?: React.KeyboardEventHandler<HTMLLIElement> | undefined;
|
|
114
114
|
onKeyDownCapture?: React.KeyboardEventHandler<HTMLLIElement> | undefined;
|
|
115
115
|
onKeyPress?: React.KeyboardEventHandler<HTMLLIElement> | undefined;
|
|
116
116
|
onKeyPressCapture?: React.KeyboardEventHandler<HTMLLIElement> | undefined;
|
|
@@ -10,10 +10,11 @@ export declare namespace DSMenuItemsActionT {
|
|
|
10
10
|
disabled: boolean;
|
|
11
11
|
isActive: boolean;
|
|
12
12
|
onClick: React.MouseEventHandler;
|
|
13
|
+
onKeyDown: React.KeyboardEventHandler;
|
|
13
14
|
optionsShouldHavePadding: boolean;
|
|
14
15
|
tabIndex: 0 | -1 | '0' | '-1';
|
|
15
16
|
applyAriaDisabled: boolean;
|
|
16
|
-
as: keyof JSX.IntrinsicElements;
|
|
17
|
+
as: keyof React.JSX.IntrinsicElements;
|
|
17
18
|
};
|
|
18
19
|
type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsActionT.InternalProps> & {
|
|
19
20
|
secondaryLabel?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-menu-items-action",
|
|
3
|
-
"version": "3.50.0-
|
|
3
|
+
"version": "3.50.0-rc.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Menu Items Action",
|
|
6
6
|
"files": [
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"pnpm": ">=
|
|
29
|
-
"node": ">=
|
|
28
|
+
"pnpm": ">=9",
|
|
29
|
+
"node": ">=22"
|
|
30
30
|
},
|
|
31
31
|
"author": "ICE MT",
|
|
32
32
|
"jestSonar": {
|
|
@@ -36,22 +36,23 @@
|
|
|
36
36
|
"indent": 4
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@xstyled/styled-components": "~3.
|
|
40
|
-
"@elliemae/ds-button": "3.50.0-
|
|
41
|
-
"@elliemae/ds-grid": "3.50.0-
|
|
42
|
-
"@elliemae/ds-
|
|
43
|
-
"@elliemae/ds-
|
|
44
|
-
"@elliemae/ds-system": "3.50.0-
|
|
39
|
+
"@xstyled/styled-components": "~3.6.0",
|
|
40
|
+
"@elliemae/ds-button": "3.50.0-rc.2",
|
|
41
|
+
"@elliemae/ds-grid": "3.50.0-rc.2",
|
|
42
|
+
"@elliemae/ds-menu-items-commons": "3.50.0-rc.2",
|
|
43
|
+
"@elliemae/ds-props-helpers": "3.50.0-rc.2",
|
|
44
|
+
"@elliemae/ds-system": "3.50.0-rc.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"jest": "~29.7.0",
|
|
48
|
+
"jest-cli": "~29.7.0",
|
|
48
49
|
"lodash": "^4.17.21",
|
|
49
50
|
"styled-components": "~5.3.9",
|
|
50
|
-
"@elliemae/ds-monorepo-devops": "3.50.0-
|
|
51
|
+
"@elliemae/ds-monorepo-devops": "3.50.0-rc.2"
|
|
51
52
|
},
|
|
52
53
|
"peerDependencies": {
|
|
53
|
-
"@testing-library/jest-dom": "
|
|
54
|
-
"@testing-library/react": "
|
|
54
|
+
"@testing-library/jest-dom": "~5.16.4",
|
|
55
|
+
"@testing-library/react": "~12.1.3",
|
|
55
56
|
"@testing-library/user-event": "~13.5.0",
|
|
56
57
|
"lodash": "^4.17.21",
|
|
57
58
|
"react": "^17.0.2",
|
/package/dist/types/tests/{DSMenuItemsMulti.a11y.test.d.ts → DSMenuItemsAction.a11y.test.d.ts}
RENAMED
|
File without changes
|