@elliemae/ds-menu-items-multi 3.40.0-rc.2 → 3.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSMenuItemsMulti.js +11 -3
- package/dist/cjs/DSMenuItemsMulti.js.map +3 -3
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/DSMenuItemsMulti.js +11 -3
- package/dist/esm/DSMenuItemsMulti.js.map +3 -3
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/react-desc-prop-types.d.ts +2 -2
- package/dist/types/tests/DSMenuItemsMulti.a11y.test.d.ts +1 -0
- package/package.json +8 -8
@@ -34,6 +34,7 @@ __export(DSMenuItemsMulti_exports, {
|
|
34
34
|
module.exports = __toCommonJS(DSMenuItemsMulti_exports);
|
35
35
|
var React = __toESM(require("react"));
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
37
|
+
var import_react = __toESM(require("react"));
|
37
38
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
38
39
|
var import_ds_form_checkbox = require("@elliemae/ds-form-checkbox");
|
39
40
|
var import_ds_menu_items_commons = require("@elliemae/ds-menu-items-commons");
|
@@ -47,7 +48,6 @@ const DSMenuItemsMulti = (props) => {
|
|
47
48
|
dsId,
|
48
49
|
label,
|
49
50
|
disabled,
|
50
|
-
applyAriaDisabled,
|
51
51
|
isSelected,
|
52
52
|
isActive,
|
53
53
|
onClick,
|
@@ -58,8 +58,16 @@ const DSMenuItemsMulti = (props) => {
|
|
58
58
|
onMouseDown,
|
59
59
|
wrapperStyles,
|
60
60
|
tabIndex,
|
61
|
-
render: Render
|
61
|
+
render: Render,
|
62
|
+
applyAriaDisabled
|
62
63
|
} = propsWithDefault;
|
64
|
+
const handleOnClick = import_react.default.useCallback(
|
65
|
+
(e) => {
|
66
|
+
if (applyAriaDisabled) return;
|
67
|
+
onClick?.(e);
|
68
|
+
},
|
69
|
+
[applyAriaDisabled, onClick]
|
70
|
+
);
|
63
71
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
64
72
|
import_ds_menu_items_commons.StyledGlobalMenuItemWrapper,
|
65
73
|
{
|
@@ -75,11 +83,11 @@ const DSMenuItemsMulti = (props) => {
|
|
75
83
|
className: isActive ? "ds-list-item-active" : "",
|
76
84
|
"aria-selected": isSelected,
|
77
85
|
style: wrapperStyles,
|
78
|
-
onClick,
|
79
86
|
"data-testid": dataTestid,
|
80
87
|
"data-type": "multi",
|
81
88
|
"aria-disabled": applyAriaDisabled,
|
82
89
|
...globalAttributes,
|
90
|
+
onClick: handleOnClick,
|
83
91
|
...xStyledProps,
|
84
92
|
children: Render !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, { ...propsWithDefault }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu_items_commons.StyledItemContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
85
93
|
import_ds_form_checkbox.PresentationalCheckbox,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/DSMenuItemsMulti.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { PresentationalCheckbox } from '@elliemae/ds-form-checkbox';\nimport { StyledGlobalMenuItemWrapper, StyledItemContent } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsMultiT, DSMenuItemsMultiPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsMulti } from './config/useMenuItemsMulti.js';\n\nconst noop = () => {};\n\nconst DSMenuItemsMulti: React.ComponentType<DSMenuItemsMultiT.Props> = (props) => {\n const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsMulti(props);\n const {\n dsId,\n label,\n disabled,\n
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
6
|
-
"names": []
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { PresentationalCheckbox } from '@elliemae/ds-form-checkbox';\nimport { StyledGlobalMenuItemWrapper, StyledItemContent } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsMultiT, DSMenuItemsMultiPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsMulti } from './config/useMenuItemsMulti.js';\n\nconst noop = () => {};\n\nconst DSMenuItemsMulti: React.ComponentType<DSMenuItemsMultiT.Props> = (props) => {\n const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsMulti(props);\n const {\n dsId,\n label,\n disabled,\n isSelected,\n isActive,\n onClick,\n dataTestid,\n innerRef,\n onMouseEnter,\n onMouseLeave,\n onMouseDown,\n wrapperStyles,\n tabIndex,\n render: Render,\n applyAriaDisabled,\n } = propsWithDefault;\n\n const handleOnClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (applyAriaDisabled) return;\n onClick?.(e);\n },\n [applyAriaDisabled, onClick],\n );\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n disabled={disabled}\n isActive={isActive}\n isSelected={isSelected}\n innerRef={innerRef}\n onMouseDown={onMouseDown}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n role=\"option\"\n className={isActive ? 'ds-list-item-active' : ''}\n aria-selected={isSelected}\n style={wrapperStyles}\n data-testid={dataTestid}\n data-type=\"multi\"\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n onClick={handleOnClick}\n {...xStyledProps}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledItemContent>\n <PresentationalCheckbox\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n checked={isSelected}\n onMouseDown={onMouseDown}\n name={label}\n label={label}\n onChange={noop}\n tabIndex={tabIndex}\n wrapLabel\n />\n </StyledItemContent>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// this is `'DSMultiMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsMulti.displayName = 'DSMultiMenuItem';\nconst DSMenuItemsMultiWithSchema = describe(DSMenuItemsMulti);\nDSMenuItemsMultiWithSchema.propTypes = DSMenuItemsMultiPropTypesSchema;\n\nexport { DSMenuItemsMulti, DSMenuItemsMultiWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2Df;AA3DR,mBAAkB;AAClB,8BAAyB;AACzB,8BAAuC;AACvC,mCAA+D;AAC/D,mCAAwE;AACxE,+BAAkC;AAElC,MAAM,OAAO,MAAM;AAAC;AAEpB,MAAM,mBAAiE,CAAC,UAAU;AAChF,QAAM,EAAE,kBAAkB,aAAa,kBAAkB,cAAc,aAAa,QAAI,4CAAkB,KAAK;AAC/G,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,EACF,IAAI;AAEJ,QAAM,gBAAgB,aAAAA,QAAM;AAAA,IAC1B,CAAC,MAAwB;AACvB,UAAI,kBAAmB;AACvB,gBAAU,CAAC;AAAA,IACb;AAAA,IACA,CAAC,mBAAmB,OAAO;AAAA,EAC7B;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAK;AAAA,MACL,WAAW,WAAW,wBAAwB;AAAA,MAC9C,iBAAe;AAAA,MACf,OAAO;AAAA,MACP,eAAa;AAAA,MACb,aAAU;AAAA,MACV,iBAAe;AAAA,MACd,GAAG;AAAA,MACJ,SAAS;AAAA,MACR,GAAG;AAAA,MAEH,qBAAW,SACV,4CAAC,UAAQ,GAAG,kBAAkB,IAE9B,4CAAC,kDACC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,SAAS;AAAA,UACT;AAAA,UACA,MAAM;AAAA,UACN;AAAA,UACA,UAAU;AAAA,UACV;AAAA,UACA,WAAS;AAAA;AAAA,MACX,GACF;AAAA;AAAA,EAEJ;AAEJ;AAGA,iBAAiB,cAAc;AAC/B,MAAM,iCAA6B,kCAAS,gBAAgB;AAC5D,2BAA2B,YAAY;",
|
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 } 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';\
|
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 DSMenuItemsMultiT {\n export type WCAGTabIndex = 0 | -1;\n\n // typescript inheritance has no syntax support for \"interfaces\", we have to use union types instead...\n export type RequiredProps = DSMenuItemsCommonsT.RequiredProps;\n export type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {\n label: string;\n isActive: boolean;\n disabled: boolean;\n applyAriaDisabled: boolean;\n isSelected: boolean;\n onClick: React.MouseEventHandler;\n onMouseDown: React.MouseEventHandler;\n onMouseEnter: React.MouseEventHandler;\n onMouseLeave: React.MouseEventHandler;\n tabIndex: WCAGTabIndex;\n };\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsMultiT.InternalProps> & {\n dataTestid?: string;\n value?: unknown;\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: DSMenuItemsMultiT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n label: '',\n isActive: false,\n disabled: false,\n applyAriaDisabled: false,\n isSelected: false,\n onClick: () => {},\n onMouseDown: () => {},\n onMouseEnter: () => {},\n onMouseLeave: () => {},\n tabIndex: 0,\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 DSMenuItemsMultiPropTypes: DSPropTypesSchema<DSMenuItemsMultiT.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 // 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 isActive: PropTypes.bool.description('Whether the menu item is active.'),\n isSelected: PropTypes.bool.description('Whether the menu item has to show the selected state or not.'),\n value: PropTypes.any.description('The value of the menu item.'),\n dataTestid: PropTypes.string.description('The data-testid 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};\n\nexport const DSMenuItemsMultiPropTypesSchema =\n DSMenuItemsMultiPropTypes as unknown as ValidationMap<DSMenuItemsMultiT.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;AAgDA,MAAM,eAA+C;AAAA,EAC1D,GAAG;AAAA,EACH,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,aAAa,MAAM;AAAA,EAAC;AAAA,EACpB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,UAAU;AACZ;AAIA,MAAM,EAAE,UAAU,OAAO,OAAO,GAAG,+BAA+B,IAAI;AAE/D,MAAM,4BAAgF;AAAA;AAAA;AAAA,EAG3F,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA,EAGH,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAAE;AAAA,IAClE;AAAA,EACF;AAAA,EACA,OAAO,kCAAU,OAAO,YAAY,6BAA6B;AAAA,EACjE,UAAU,kCAAU,KAAK,YAAY,kCAAkC;AAAA,EACvE,YAAY,kCAAU,KAAK,YAAY,8DAA8D;AAAA,EACrG,OAAO,kCAAU,IAAI,YAAY,6BAA6B;AAAA,EAC9D,YAAY,kCAAU,OAAO,YAAY,mCAAmC;AAAA,EAC5E,mBAAmB,kCAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,kCACX;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
3
|
+
import React2 from "react";
|
3
4
|
import { describe } from "@elliemae/ds-props-helpers";
|
4
5
|
import { PresentationalCheckbox } from "@elliemae/ds-form-checkbox";
|
5
6
|
import { StyledGlobalMenuItemWrapper, StyledItemContent } from "@elliemae/ds-menu-items-commons";
|
@@ -13,7 +14,6 @@ const DSMenuItemsMulti = (props) => {
|
|
13
14
|
dsId,
|
14
15
|
label,
|
15
16
|
disabled,
|
16
|
-
applyAriaDisabled,
|
17
17
|
isSelected,
|
18
18
|
isActive,
|
19
19
|
onClick,
|
@@ -24,8 +24,16 @@ const DSMenuItemsMulti = (props) => {
|
|
24
24
|
onMouseDown,
|
25
25
|
wrapperStyles,
|
26
26
|
tabIndex,
|
27
|
-
render: Render
|
27
|
+
render: Render,
|
28
|
+
applyAriaDisabled
|
28
29
|
} = propsWithDefault;
|
30
|
+
const handleOnClick = React2.useCallback(
|
31
|
+
(e) => {
|
32
|
+
if (applyAriaDisabled) return;
|
33
|
+
onClick?.(e);
|
34
|
+
},
|
35
|
+
[applyAriaDisabled, onClick]
|
36
|
+
);
|
29
37
|
return /* @__PURE__ */ jsx(
|
30
38
|
StyledGlobalMenuItemWrapper,
|
31
39
|
{
|
@@ -41,11 +49,11 @@ const DSMenuItemsMulti = (props) => {
|
|
41
49
|
className: isActive ? "ds-list-item-active" : "",
|
42
50
|
"aria-selected": isSelected,
|
43
51
|
style: wrapperStyles,
|
44
|
-
onClick,
|
45
52
|
"data-testid": dataTestid,
|
46
53
|
"data-type": "multi",
|
47
54
|
"aria-disabled": applyAriaDisabled,
|
48
55
|
...globalAttributes,
|
56
|
+
onClick: handleOnClick,
|
49
57
|
...xStyledProps,
|
50
58
|
children: Render !== void 0 ? /* @__PURE__ */ jsx(Render, { ...propsWithDefault }) : /* @__PURE__ */ jsx(StyledItemContent, { children: /* @__PURE__ */ jsx(
|
51
59
|
PresentationalCheckbox,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSMenuItemsMulti.tsx"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { PresentationalCheckbox } from '@elliemae/ds-form-checkbox';\nimport { StyledGlobalMenuItemWrapper, StyledItemContent } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsMultiT, DSMenuItemsMultiPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsMulti } from './config/useMenuItemsMulti.js';\n\nconst noop = () => {};\n\nconst DSMenuItemsMulti: React.ComponentType<DSMenuItemsMultiT.Props> = (props) => {\n const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsMulti(props);\n const {\n dsId,\n label,\n disabled,\n
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
6
|
-
"names": []
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { PresentationalCheckbox } from '@elliemae/ds-form-checkbox';\nimport { StyledGlobalMenuItemWrapper, StyledItemContent } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsMultiT, DSMenuItemsMultiPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsMulti } from './config/useMenuItemsMulti.js';\n\nconst noop = () => {};\n\nconst DSMenuItemsMulti: React.ComponentType<DSMenuItemsMultiT.Props> = (props) => {\n const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsMulti(props);\n const {\n dsId,\n label,\n disabled,\n isSelected,\n isActive,\n onClick,\n dataTestid,\n innerRef,\n onMouseEnter,\n onMouseLeave,\n onMouseDown,\n wrapperStyles,\n tabIndex,\n render: Render,\n applyAriaDisabled,\n } = propsWithDefault;\n\n const handleOnClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (applyAriaDisabled) return;\n onClick?.(e);\n },\n [applyAriaDisabled, onClick],\n );\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n disabled={disabled}\n isActive={isActive}\n isSelected={isSelected}\n innerRef={innerRef}\n onMouseDown={onMouseDown}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n role=\"option\"\n className={isActive ? 'ds-list-item-active' : ''}\n aria-selected={isSelected}\n style={wrapperStyles}\n data-testid={dataTestid}\n data-type=\"multi\"\n aria-disabled={applyAriaDisabled}\n {...globalAttributes}\n onClick={handleOnClick}\n {...xStyledProps}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledItemContent>\n <PresentationalCheckbox\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n checked={isSelected}\n onMouseDown={onMouseDown}\n name={label}\n label={label}\n onChange={noop}\n tabIndex={tabIndex}\n wrapLabel\n />\n </StyledItemContent>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// this is `'DSMultiMenuItem'` for legacy reasons, when moving to inheritance pattern this has been kept as it was to avoid complications\nDSMenuItemsMulti.displayName = 'DSMultiMenuItem';\nconst DSMenuItemsMultiWithSchema = describe(DSMenuItemsMulti);\nDSMenuItemsMultiWithSchema.propTypes = DSMenuItemsMultiPropTypesSchema;\n\nexport { DSMenuItemsMulti, DSMenuItemsMultiWithSchema };\n"],
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC2Df;AA3DR,OAAOA,YAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,8BAA8B;AACvC,SAAS,6BAA6B,yBAAyB;AAC/D,SAAiC,uCAAuC;AACxE,SAAS,yBAAyB;AAElC,MAAM,OAAO,MAAM;AAAC;AAEpB,MAAM,mBAAiE,CAAC,UAAU;AAChF,QAAM,EAAE,kBAAkB,aAAa,kBAAkB,cAAc,aAAa,IAAI,kBAAkB,KAAK;AAC/G,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,EACF,IAAI;AAEJ,QAAM,gBAAgBA,OAAM;AAAA,IAC1B,CAAC,MAAwB;AACvB,UAAI,kBAAmB;AACvB,gBAAU,CAAC;AAAA,IACb;AAAA,IACA,CAAC,mBAAmB,OAAO;AAAA,EAC7B;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAK;AAAA,MACL,WAAW,WAAW,wBAAwB;AAAA,MAC9C,iBAAe;AAAA,MACf,OAAO;AAAA,MACP,eAAa;AAAA,MACb,aAAU;AAAA,MACV,iBAAe;AAAA,MACd,GAAG;AAAA,MACJ,SAAS;AAAA,MACR,GAAG;AAAA,MAEH,qBAAW,SACV,oBAAC,UAAQ,GAAG,kBAAkB,IAE9B,oBAAC,qBACC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,SAAS;AAAA,UACT;AAAA,UACA,MAAM;AAAA,UACN;AAAA,UACA,UAAU;AAAA,UACV;AAAA,UACA,WAAS;AAAA;AAAA,MACX,GACF;AAAA;AAAA,EAEJ;AAEJ;AAGA,iBAAiB,cAAc;AAC/B,MAAM,6BAA6B,SAAS,gBAAgB;AAC5D,2BAA2B,YAAY;",
|
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 } 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';\
|
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 DSMenuItemsMultiT {\n export type WCAGTabIndex = 0 | -1;\n\n // typescript inheritance has no syntax support for \"interfaces\", we have to use union types instead...\n export type RequiredProps = DSMenuItemsCommonsT.RequiredProps;\n export type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {\n label: string;\n isActive: boolean;\n disabled: boolean;\n applyAriaDisabled: boolean;\n isSelected: boolean;\n onClick: React.MouseEventHandler;\n onMouseDown: React.MouseEventHandler;\n onMouseEnter: React.MouseEventHandler;\n onMouseLeave: React.MouseEventHandler;\n tabIndex: WCAGTabIndex;\n };\n export type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsMultiT.InternalProps> & {\n dataTestid?: string;\n value?: unknown;\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: DSMenuItemsMultiT.DefaultProps = {\n ...DSMenuItemsCommonsDefaultProps,\n label: '',\n isActive: false,\n disabled: false,\n applyAriaDisabled: false,\n isSelected: false,\n onClick: () => {},\n onMouseDown: () => {},\n onMouseEnter: () => {},\n onMouseLeave: () => {},\n tabIndex: 0,\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 DSMenuItemsMultiPropTypes: DSPropTypesSchema<DSMenuItemsMultiT.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 // 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 isActive: PropTypes.bool.description('Whether the menu item is active.'),\n isSelected: PropTypes.bool.description('Whether the menu item has to show the selected state or not.'),\n value: PropTypes.any.description('The value of the menu item.'),\n dataTestid: PropTypes.string.description('The data-testid 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};\n\nexport const DSMenuItemsMultiPropTypesSchema =\n DSMenuItemsMultiPropTypes as unknown as ValidationMap<DSMenuItemsMultiT.Props>;\n"],
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAgDA,MAAM,eAA+C;AAAA,EAC1D,GAAG;AAAA,EACH,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,aAAa,MAAM;AAAA,EAAC;AAAA,EACpB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,UAAU;AACZ;AAIA,MAAM,EAAE,UAAU,OAAO,OAAO,GAAG,+BAA+B,IAAI;AAE/D,MAAM,4BAAgF;AAAA;AAAA;AAAA,EAG3F,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA,EAGH,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE;AAAA,IAClE;AAAA,EACF;AAAA,EACA,OAAO,UAAU,OAAO,YAAY,6BAA6B;AAAA,EACjE,UAAU,UAAU,KAAK,YAAY,kCAAkC;AAAA,EACvE,YAAY,UAAU,KAAK,YAAY,8DAA8D;AAAA,EACrG,OAAO,UAAU,IAAI,YAAY,6BAA6B;AAAA,EAC9D,YAAY,UAAU,OAAO,YAAY,mCAAmC;AAAA,EAC5E,mBAAmB,UAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,kCACX;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
|
1
|
+
import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';
|
2
2
|
import { type DSMenuItemsCommonsT } from '@elliemae/ds-menu-items-commons';
|
3
3
|
import type React from 'react';
|
4
4
|
export declare namespace DSMenuItemsMultiT {
|
@@ -27,4 +27,4 @@ export declare namespace DSMenuItemsMultiT {
|
|
27
27
|
}
|
28
28
|
export declare const defaultProps: DSMenuItemsMultiT.DefaultProps;
|
29
29
|
export declare const DSMenuItemsMultiPropTypes: DSPropTypesSchema<DSMenuItemsMultiT.InternalProps>;
|
30
|
-
export declare const DSMenuItemsMultiPropTypesSchema:
|
30
|
+
export declare const DSMenuItemsMultiPropTypesSchema: ValidationMap<DSMenuItemsMultiT.Props>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@elliemae/ds-menu-items-multi",
|
3
|
-
"version": "3.40.0
|
3
|
+
"version": "3.40.0",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "ICE MT - Dimsum - Menu Items Multi",
|
6
6
|
"files": [
|
@@ -37,17 +37,17 @@
|
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
39
|
"@xstyled/styled-components": "~3.6.0",
|
40
|
-
"@elliemae/ds-
|
41
|
-
"@elliemae/ds-
|
42
|
-
"@elliemae/ds-menu-items-commons": "3.40.0
|
43
|
-
"@elliemae/ds-
|
44
|
-
"@elliemae/ds-props-helpers": "3.40.0
|
45
|
-
"@elliemae/ds-system": "3.40.0
|
40
|
+
"@elliemae/ds-button": "3.40.0",
|
41
|
+
"@elliemae/ds-form-checkbox": "3.40.0",
|
42
|
+
"@elliemae/ds-menu-items-commons": "3.40.0",
|
43
|
+
"@elliemae/ds-grid": "3.40.0",
|
44
|
+
"@elliemae/ds-props-helpers": "3.40.0",
|
45
|
+
"@elliemae/ds-system": "3.40.0"
|
46
46
|
},
|
47
47
|
"devDependencies": {
|
48
48
|
"lodash": "^4.17.21",
|
49
49
|
"styled-components": "~5.3.9",
|
50
|
-
"@elliemae/ds-monorepo-devops": "3.40.0
|
50
|
+
"@elliemae/ds-monorepo-devops": "3.40.0"
|
51
51
|
},
|
52
52
|
"peerDependencies": {
|
53
53
|
"@testing-library/jest-dom": "~5.16.4",
|