@elliemae/ds-menu-items 3.12.0-rc.2 → 3.12.0-rc.3
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/components/ActionMenuItem/index.js +21 -31
- package/dist/cjs/components/ActionMenuItem/index.js.map +2 -2
- package/dist/cjs/components/MultiMenuItem/index.js +37 -34
- package/dist/cjs/components/MultiMenuItem/index.js.map +2 -2
- package/dist/cjs/components/Section/index.js +4 -12
- package/dist/cjs/components/Section/index.js.map +2 -2
- package/dist/cjs/components/Separator/index.js +4 -10
- package/dist/cjs/components/Separator/index.js.map +2 -2
- package/dist/cjs/components/SingleMenuItem/index.js +28 -41
- package/dist/cjs/components/SingleMenuItem/index.js.map +2 -2
- package/dist/cjs/components/SingleWithSubmenuItem/index.js +54 -72
- package/dist/cjs/components/SingleWithSubmenuItem/index.js.map +2 -2
- package/dist/cjs/components/SubmenuItem/index.js +54 -69
- package/dist/cjs/components/SubmenuItem/index.js.map +2 -2
- package/dist/cjs/exported-related/constants.js +1 -1
- package/dist/cjs/exported-related/constants.js.map +1 -1
- package/dist/esm/components/ActionMenuItem/index.js +21 -31
- package/dist/esm/components/ActionMenuItem/index.js.map +2 -2
- package/dist/esm/components/MultiMenuItem/index.js +37 -34
- package/dist/esm/components/MultiMenuItem/index.js.map +2 -2
- package/dist/esm/components/Section/index.js +4 -12
- package/dist/esm/components/Section/index.js.map +2 -2
- package/dist/esm/components/Separator/index.js +4 -10
- package/dist/esm/components/Separator/index.js.map +2 -2
- package/dist/esm/components/SingleMenuItem/index.js +28 -41
- package/dist/esm/components/SingleMenuItem/index.js.map +2 -2
- package/dist/esm/components/SingleWithSubmenuItem/index.js +54 -72
- package/dist/esm/components/SingleWithSubmenuItem/index.js.map +2 -2
- package/dist/esm/components/SubmenuItem/index.js +54 -69
- package/dist/esm/components/SubmenuItem/index.js.map +2 -2
- package/dist/esm/exported-related/constants.js +1 -1
- package/dist/esm/exported-related/constants.js.map +1 -1
- package/package.json +6 -6
|
@@ -34,9 +34,10 @@ var import_react = require("react");
|
|
|
34
34
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
35
35
|
var import_react_desc_prop_types = require("../../react-desc-prop-types");
|
|
36
36
|
var import_styled = require("../styled");
|
|
37
|
+
var import_exported_related = require("../../exported-related");
|
|
37
38
|
const ActionMenuItem = (props) => {
|
|
38
39
|
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultActionProps);
|
|
39
|
-
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.itemProps);
|
|
40
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.itemProps, `${import_exported_related.DSMenuItemName}Action`);
|
|
40
41
|
const {
|
|
41
42
|
dsId,
|
|
42
43
|
label,
|
|
@@ -55,38 +56,27 @@ const ActionMenuItem = (props) => {
|
|
|
55
56
|
cols.push("min-content");
|
|
56
57
|
return cols;
|
|
57
58
|
}, [secondaryLabel]);
|
|
58
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
children: [
|
|
77
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleMenuItemLabel, {
|
|
78
|
-
children: label
|
|
79
|
-
}),
|
|
80
|
-
secondaryLabel !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleMenuItemSecondaryLabel, {
|
|
81
|
-
children: secondaryLabel
|
|
82
|
-
})
|
|
83
|
-
]
|
|
84
|
-
})
|
|
85
|
-
})
|
|
86
|
-
});
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
import_styled.StyledGlobalMenuItemWrapper,
|
|
61
|
+
{
|
|
62
|
+
id: dsId,
|
|
63
|
+
role: "option",
|
|
64
|
+
isActive,
|
|
65
|
+
disabled,
|
|
66
|
+
onClick: !disabled ? onClick : void 0,
|
|
67
|
+
ref: innerRef,
|
|
68
|
+
pl: optionsShouldHavePadding ? 40 : 16,
|
|
69
|
+
style: wrapperStyles,
|
|
70
|
+
"data-type": "action",
|
|
71
|
+
children: Render !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, { ...propsWithDefault }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledContentWrapper, { cols: gridLayout, minHeight: "16px", gutter: "xxs", alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleMenuItemLabel, { children: label }),
|
|
73
|
+
secondaryLabel !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleMenuItemSecondaryLabel, { children: secondaryLabel })
|
|
74
|
+
] }) })
|
|
75
|
+
}
|
|
76
|
+
);
|
|
87
77
|
};
|
|
88
78
|
ActionMenuItem.propTypes = import_react_desc_prop_types.itemProps;
|
|
89
|
-
ActionMenuItem.displayName =
|
|
79
|
+
ActionMenuItem.displayName = `${import_exported_related.DSMenuItemName}Action`;
|
|
90
80
|
const ActionMenuItemWithSchema = (0, import_ds_utilities.describe)(ActionMenuItem);
|
|
91
81
|
ActionMenuItemWithSchema.propTypes = import_react_desc_prop_types.itemProps;
|
|
92
82
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/ActionMenuItem/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { DSMenuItemT } from '../../react-desc-prop-types';\nimport { defaultActionProps, itemProps } from '../../react-desc-prop-types';\nimport {\n StyledContentWrapper,\n StyledGlobalMenuItemWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n} from '../styled';\n\nconst ActionMenuItem: React.ComponentType<DSMenuItemT.ActionProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultActionProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, itemProps);\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 } = propsWithDefault;\n\n const gridLayout = 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 onClick={!disabled ? onClick : undefined}\n ref={innerRef}\n pl={optionsShouldHavePadding ? 40 : 16}\n style={wrapperStyles}\n data-type=\"action\"\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\nActionMenuItem.propTypes = itemProps;\nActionMenuItem.displayName =
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { DSMenuItemT } from '../../react-desc-prop-types';\nimport { defaultActionProps, itemProps } from '../../react-desc-prop-types';\nimport {\n StyledContentWrapper,\n StyledGlobalMenuItemWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n} from '../styled';\nimport { DSMenuItemName } from '../../exported-related';\n\nconst ActionMenuItem: React.ComponentType<DSMenuItemT.ActionProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultActionProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, itemProps, `${DSMenuItemName}Action`);\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 } = propsWithDefault;\n\n const gridLayout = 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 onClick={!disabled ? onClick : undefined}\n ref={innerRef}\n pl={optionsShouldHavePadding ? 40 : 16}\n style={wrapperStyles}\n data-type=\"action\"\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\nActionMenuItem.propTypes = itemProps;\nActionMenuItem.displayName = `${DSMenuItemName}Action`;\nconst ActionMenuItemWithSchema = describe(ActionMenuItem);\nActionMenuItemWithSchema.propTypes = itemProps;\n\nexport { ActionMenuItem, ActionMenuItemWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiDf;AAjDR,mBAA+B;AAC/B,0BAAuF;AAEvF,mCAA8C;AAC9C,oBAKO;AACP,8BAA+B;AAE/B,MAAM,iBAA+D,CAAC,UAAU;AAC9E,QAAM,uBAAmB,kDAA6B,OAAO,+CAAkB;AAE/E,0DAA+B,kBAAkB,wCAAW,GAAG,8CAAsB;AAErF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV,IAAI;AAEJ,QAAM,iBAAa,sBAAQ,MAAM;AAC/B,UAAM,OAAO,CAAC,MAAM;AACpB,QAAI;AAAgB,WAAK,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,SAAS,CAAC,WAAW,UAAU;AAAA,MAC/B,KAAK;AAAA,MACL,IAAI,2BAA2B,KAAK;AAAA,MACpC,OAAO;AAAA,MACP,aAAU;AAAA,MAET,qBAAW,SACV,4CAAC,UAAQ,GAAG,kBAAkB,IAE9B,4CAAC,sCAAqB,MAAM,YAAY,WAAU,QAAO,QAAO,OAAM,YAAW,UAC/E,sFACE;AAAA,oDAAC,oCAAoB,iBAAM;AAAA,QAC1B,mBAAmB,UAClB,4CAAC,6CAA6B,0BAAe;AAAA,SAEjD,GACF;AAAA;AAAA,EAEJ;AAEJ;AAEA,eAAe,YAAY;AAC3B,eAAe,cAAc,GAAG;AAChC,MAAM,+BAA2B,8BAAS,cAAc;AACxD,yBAAyB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -34,10 +34,11 @@ var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
|
34
34
|
var import_ds_form_checkbox = require("@elliemae/ds-form-checkbox");
|
|
35
35
|
var import_react_desc_prop_types = require("../../react-desc-prop-types");
|
|
36
36
|
var import_styled = require("../styled");
|
|
37
|
+
var import_exported_related = require("../../exported-related");
|
|
37
38
|
const noop = () => null;
|
|
38
39
|
const MultiMenuItem = (props) => {
|
|
39
40
|
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultMultiProps);
|
|
40
|
-
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.itemProps);
|
|
41
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.itemProps, `${import_exported_related.DSMenuItemName}Multi`);
|
|
41
42
|
const {
|
|
42
43
|
dsId,
|
|
43
44
|
label,
|
|
@@ -54,41 +55,43 @@ const MultiMenuItem = (props) => {
|
|
|
54
55
|
tabIndex,
|
|
55
56
|
render: Render
|
|
56
57
|
} = propsWithDefault;
|
|
57
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
import_styled.StyledGlobalMenuItemWrapper,
|
|
60
|
+
{
|
|
61
|
+
id: dsId,
|
|
62
|
+
disabled,
|
|
63
|
+
isActive,
|
|
64
|
+
isSelected,
|
|
65
|
+
ref: innerRef,
|
|
66
|
+
onMouseDown,
|
|
67
|
+
onMouseEnter,
|
|
68
|
+
onMouseLeave,
|
|
69
|
+
role: "option",
|
|
70
|
+
className: isActive ? "ds-list-item-active" : "",
|
|
71
|
+
"aria-selected": isSelected,
|
|
72
|
+
style: wrapperStyles,
|
|
73
|
+
onClick,
|
|
74
|
+
"data-testid": dataTestid,
|
|
75
|
+
"data-type": "multi",
|
|
76
|
+
children: Render !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledItemContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
77
|
+
import_ds_form_checkbox.DSControlledCheckbox,
|
|
78
|
+
{
|
|
79
|
+
disabled,
|
|
80
|
+
checked: isSelected,
|
|
81
|
+
onMouseDown,
|
|
82
|
+
name: label,
|
|
83
|
+
label,
|
|
84
|
+
onChange: noop,
|
|
85
|
+
tabIndex,
|
|
86
|
+
wrapLabel: true,
|
|
87
|
+
device: "desktop"
|
|
88
|
+
}
|
|
89
|
+
) })
|
|
90
|
+
}
|
|
91
|
+
);
|
|
89
92
|
};
|
|
90
93
|
MultiMenuItem.propTypes = import_react_desc_prop_types.itemProps;
|
|
91
|
-
MultiMenuItem.displayName =
|
|
94
|
+
MultiMenuItem.displayName = `${import_exported_related.DSMenuItemName}Multi`;
|
|
92
95
|
const MultiMenuItemWithSchema = (0, import_ds_utilities.describe)(MultiMenuItem);
|
|
93
96
|
MultiMenuItemWithSchema.propTypes = import_react_desc_prop_types.itemProps;
|
|
94
97
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/MultiMenuItem/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport { DSControlledCheckbox } from '@elliemae/ds-form-checkbox';\nimport type { DSMenuItemT } from '../../react-desc-prop-types';\nimport { defaultMultiProps, itemProps } from '../../react-desc-prop-types';\nimport { StyledGlobalMenuItemWrapper, StyledItemContent } from '../styled';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmDf;AAlDR,0BAAuF;AACvF,8BAAqC;AAErC,mCAA6C;AAC7C,oBAA+D;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport { DSControlledCheckbox } from '@elliemae/ds-form-checkbox';\nimport type { DSMenuItemT } from '../../react-desc-prop-types';\nimport { defaultMultiProps, itemProps } from '../../react-desc-prop-types';\nimport { StyledGlobalMenuItemWrapper, StyledItemContent } from '../styled';\nimport { DSMenuItemName } from '../../exported-related';\n\nconst noop = () => null;\n\nconst MultiMenuItem: React.ComponentType<DSMenuItemT.MultiProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultMultiProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, itemProps, `${DSMenuItemName}Multi`);\n\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 } = propsWithDefault;\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n disabled={disabled}\n isActive={isActive}\n isSelected={isSelected}\n ref={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 onClick={onClick}\n data-testid={dataTestid}\n data-type=\"multi\"\n >\n {Render !== undefined ? (\n <Render {...props} />\n ) : (\n <StyledItemContent>\n <DSControlledCheckbox\n disabled={disabled}\n checked={isSelected}\n onMouseDown={onMouseDown}\n name={label}\n label={label}\n onChange={noop}\n tabIndex={tabIndex}\n wrapLabel\n device=\"desktop\"\n />\n </StyledItemContent>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\nMultiMenuItem.propTypes = itemProps;\nMultiMenuItem.displayName = `${DSMenuItemName}Multi`;\nconst MultiMenuItemWithSchema = describe(MultiMenuItem);\nMultiMenuItemWithSchema.propTypes = itemProps;\n\nexport { MultiMenuItem, MultiMenuItemWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmDf;AAlDR,0BAAuF;AACvF,8BAAqC;AAErC,mCAA6C;AAC7C,oBAA+D;AAC/D,8BAA+B;AAE/B,MAAM,OAAO,MAAM;AAEnB,MAAM,gBAA6D,CAAC,UAAU;AAC5E,QAAM,uBAAmB,kDAA6B,OAAO,8CAAiB;AAE9E,0DAA+B,kBAAkB,wCAAW,GAAG,6CAAqB;AAEpF,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,EACV,IAAI;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAK;AAAA,MACL,WAAW,WAAW,wBAAwB;AAAA,MAC9C,iBAAe;AAAA,MACf,OAAO;AAAA,MACP;AAAA,MACA,eAAa;AAAA,MACb,aAAU;AAAA,MAET,qBAAW,SACV,4CAAC,UAAQ,GAAG,OAAO,IAEnB,4CAAC,mCACC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,SAAS;AAAA,UACT;AAAA,UACA,MAAM;AAAA,UACN;AAAA,UACA,UAAU;AAAA,UACV;AAAA,UACA,WAAS;AAAA,UACT,QAAO;AAAA;AAAA,MACT,GACF;AAAA;AAAA,EAEJ;AAEJ;AAEA,cAAc,YAAY;AAC1B,cAAc,cAAc,GAAG;AAC/B,MAAM,8BAA0B,8BAAS,aAAa;AACtD,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,23 +33,15 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
33
33
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
34
34
|
var import_react_desc_prop_types = require("../../react-desc-prop-types");
|
|
35
35
|
var import_styled = require("../styled");
|
|
36
|
+
var import_exported_related = require("../../exported-related");
|
|
36
37
|
const Section = (props) => {
|
|
37
38
|
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultSectionProps);
|
|
38
|
-
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.itemProps);
|
|
39
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.itemProps, `${import_exported_related.DSMenuItemName}Section`);
|
|
39
40
|
const { label, wrapperStyles, innerRef, render: Render } = props;
|
|
40
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSectionWrapper, {
|
|
41
|
-
style: wrapperStyles,
|
|
42
|
-
ref: innerRef,
|
|
43
|
-
role: "presentation",
|
|
44
|
-
children: Render !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, {
|
|
45
|
-
...props
|
|
46
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledGroupLabel, {
|
|
47
|
-
children: label
|
|
48
|
-
})
|
|
49
|
-
});
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSectionWrapper, { style: wrapperStyles, ref: innerRef, role: "presentation", children: Render !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledGroupLabel, { children: label }) });
|
|
50
42
|
};
|
|
51
43
|
Section.propTypes = import_react_desc_prop_types.itemProps;
|
|
52
|
-
Section.displayName =
|
|
44
|
+
Section.displayName = `${import_exported_related.DSMenuItemName}Section`;
|
|
53
45
|
const SectionWithSchema = (0, import_ds_utilities.describe)(Section);
|
|
54
46
|
SectionWithSchema.propTypes = import_react_desc_prop_types.itemProps;
|
|
55
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/Section/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { DSMenuItemT } from '../../react-desc-prop-types';\nimport { defaultSectionProps, itemProps } from '../../react-desc-prop-types';\nimport { StyledSectionWrapper, StyledGroupLabel } from '../styled';\n\nconst Section: React.ComponentType<DSMenuItemT.SectionProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultSectionProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, itemProps);\n\n const { label, wrapperStyles, innerRef, render: Render } = props;\n\n return (\n <StyledSectionWrapper style={wrapperStyles} ref={innerRef} role=\"presentation\">\n {Render !== undefined ? <Render {...props} /> : <StyledGroupLabel>{label}</StyledGroupLabel>}\n </StyledSectionWrapper>\n );\n};\n\nSection.propTypes = itemProps;\nSection.displayName =
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { DSMenuItemT } from '../../react-desc-prop-types';\nimport { defaultSectionProps, itemProps } from '../../react-desc-prop-types';\nimport { StyledSectionWrapper, StyledGroupLabel } from '../styled';\nimport { DSMenuItemName } from '../../exported-related';\n\nconst Section: React.ComponentType<DSMenuItemT.SectionProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultSectionProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, itemProps, `${DSMenuItemName}Section`);\n\n const { label, wrapperStyles, innerRef, render: Render } = props;\n\n return (\n <StyledSectionWrapper style={wrapperStyles} ref={innerRef} role=\"presentation\">\n {Render !== undefined ? <Render {...props} /> : <StyledGroupLabel>{label}</StyledGroupLabel>}\n </StyledSectionWrapper>\n );\n};\n\nSection.propTypes = itemProps;\nSection.displayName = `${DSMenuItemName}Section`;\nconst SectionWithSchema = describe(Section);\nSectionWithSchema.propTypes = itemProps;\n\nexport { Section, SectionWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiBO;AAf9B,0BAAuF;AAEvF,mCAA+C;AAC/C,oBAAuD;AACvD,8BAA+B;AAE/B,MAAM,UAAyD,CAAC,UAAU;AACxE,QAAM,uBAAmB,kDAA6B,OAAO,gDAAmB;AAEhF,0DAA+B,kBAAkB,wCAAW,GAAG,+CAAuB;AAEtF,QAAM,EAAE,OAAO,eAAe,UAAU,QAAQ,OAAO,IAAI;AAE3D,SACE,4CAAC,sCAAqB,OAAO,eAAe,KAAK,UAAU,MAAK,gBAC7D,qBAAW,SAAY,4CAAC,UAAQ,GAAG,OAAO,IAAK,4CAAC,kCAAkB,iBAAM,GAC3E;AAEJ;AAEA,QAAQ,YAAY;AACpB,QAAQ,cAAc,GAAG;AACzB,MAAM,wBAAoB,8BAAS,OAAO;AAC1C,kBAAkB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,21 +33,15 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
33
33
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
34
34
|
var import_react_desc_prop_types = require("../../react-desc-prop-types");
|
|
35
35
|
var import_styled = require("../styled");
|
|
36
|
+
var import_exported_related = require("../../exported-related");
|
|
36
37
|
const Separator = (props) => {
|
|
37
38
|
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultSeparatorProps);
|
|
38
|
-
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.itemProps);
|
|
39
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.itemProps, `${import_exported_related.DSMenuItemName}Separator`);
|
|
39
40
|
const { wrapperStyles, innerRef, render: Render } = propsWithDefault;
|
|
40
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSeparatorWrapper, {
|
|
41
|
-
style: wrapperStyles,
|
|
42
|
-
ref: innerRef,
|
|
43
|
-
role: "separator",
|
|
44
|
-
children: Render ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, {
|
|
45
|
-
...props
|
|
46
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSeparator, {})
|
|
47
|
-
});
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSeparatorWrapper, { style: wrapperStyles, ref: innerRef, role: "separator", children: Render ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSeparator, {}) });
|
|
48
42
|
};
|
|
49
43
|
Separator.propTypes = import_react_desc_prop_types.itemProps;
|
|
50
|
-
Separator.displayName =
|
|
44
|
+
Separator.displayName = `${import_exported_related.DSMenuItemName}Separator`;
|
|
51
45
|
const SeparatorWithSchema = (0, import_ds_utilities.describe)(Separator);
|
|
52
46
|
SeparatorWithSchema.propTypes = import_react_desc_prop_types.itemProps;
|
|
53
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/Separator/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { DSMenuItemT } from '../../react-desc-prop-types';\nimport { itemProps, defaultSeparatorProps } from '../../react-desc-prop-types';\nimport { StyledSeparatorWrapper, StyledSeparator } from '../styled';\n\nconst Separator: React.ComponentType<DSMenuItemT.SeparatorProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultSeparatorProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, itemProps);\n const { wrapperStyles, innerRef, render: Render } = propsWithDefault;\n return (\n <StyledSeparatorWrapper style={wrapperStyles} ref={innerRef} role=\"separator\">\n {Render ? <Render {...props} /> : <StyledSeparator />}\n </StyledSeparatorWrapper>\n );\n};\n\nSeparator.propTypes = itemProps;\nSeparator.displayName =
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { DSMenuItemT } from '../../react-desc-prop-types';\nimport { itemProps, defaultSeparatorProps } from '../../react-desc-prop-types';\nimport { StyledSeparatorWrapper, StyledSeparator } from '../styled';\nimport { DSMenuItemName } from '../../exported-related';\n\nconst Separator: React.ComponentType<DSMenuItemT.SeparatorProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultSeparatorProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, itemProps, `${DSMenuItemName}Separator`);\n const { wrapperStyles, innerRef, render: Render } = propsWithDefault;\n return (\n <StyledSeparatorWrapper style={wrapperStyles} ref={innerRef} role=\"separator\">\n {Render ? <Render {...props} /> : <StyledSeparator />}\n </StyledSeparatorWrapper>\n );\n};\n\nSeparator.propTypes = itemProps;\nSeparator.displayName = `${DSMenuItemName}Separator`;\nconst SeparatorWithSchema = describe(Separator);\nSeparatorWithSchema.propTypes = itemProps;\n\nexport { Separator, SeparatorWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcP;AAbhB,0BAAuF;AAEvF,mCAAiD;AACjD,oBAAwD;AACxD,8BAA+B;AAE/B,MAAM,YAA6D,CAAC,UAAU;AAC5E,QAAM,uBAAmB,kDAA6B,OAAO,kDAAqB;AAElF,0DAA+B,kBAAkB,wCAAW,GAAG,iDAAyB;AACxF,QAAM,EAAE,eAAe,UAAU,QAAQ,OAAO,IAAI;AACpD,SACE,4CAAC,wCAAuB,OAAO,eAAe,KAAK,UAAU,MAAK,aAC/D,mBAAS,4CAAC,UAAQ,GAAG,OAAO,IAAK,4CAAC,iCAAgB,GACrD;AAEJ;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc,GAAG;AAC3B,MAAM,0BAAsB,8BAAS,SAAS;AAC9C,oBAAoB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -34,9 +34,10 @@ var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
|
34
34
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
35
35
|
var import_react_desc_prop_types = require("../../react-desc-prop-types");
|
|
36
36
|
var import_styled = require("../styled");
|
|
37
|
+
var import_exported_related = require("../../exported-related");
|
|
37
38
|
const SingleMenuItem = (props) => {
|
|
38
39
|
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultSingleProps);
|
|
39
|
-
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.itemProps);
|
|
40
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.itemProps, `${import_exported_related.DSMenuItemName}Single`);
|
|
40
41
|
const {
|
|
41
42
|
dsId,
|
|
42
43
|
label,
|
|
@@ -59,48 +60,34 @@ const SingleMenuItem = (props) => {
|
|
|
59
60
|
cols.push("min-content");
|
|
60
61
|
return cols;
|
|
61
62
|
}, [secondaryLabel]);
|
|
62
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.Checkmark, {
|
|
88
|
-
size: "s",
|
|
89
|
-
color: ["brand-primary", "600"]
|
|
90
|
-
})
|
|
91
|
-
}),
|
|
92
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleMenuItemLabel, {
|
|
93
|
-
children: label
|
|
94
|
-
}),
|
|
95
|
-
secondaryLabel !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleMenuItemSecondaryLabel, {
|
|
96
|
-
children: secondaryLabel
|
|
97
|
-
})
|
|
98
|
-
]
|
|
99
|
-
})
|
|
100
|
-
});
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
import_styled.StyledGlobalMenuItemWrapper,
|
|
65
|
+
{
|
|
66
|
+
"aria-selected": isSelected,
|
|
67
|
+
id: dsId,
|
|
68
|
+
role: "option",
|
|
69
|
+
isActive,
|
|
70
|
+
isSelected,
|
|
71
|
+
onClick,
|
|
72
|
+
ref: innerRef,
|
|
73
|
+
onMouseDown,
|
|
74
|
+
onMouseEnter,
|
|
75
|
+
onMouseLeave,
|
|
76
|
+
className: isActive ? "ds-list-item-active" : "",
|
|
77
|
+
style: wrapperStyles,
|
|
78
|
+
"data-testid": dataTestid,
|
|
79
|
+
disabled,
|
|
80
|
+
"data-type": "single",
|
|
81
|
+
children: Render !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledContentWrapper, { cols: gridLayout, minHeight: "16px", gutter: "xxs", alignItems: "center", children: [
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.Checkmark, { size: "s", color: ["brand-primary", "600"] }) }),
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleMenuItemLabel, { children: label }),
|
|
84
|
+
secondaryLabel !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleMenuItemSecondaryLabel, { children: secondaryLabel })
|
|
85
|
+
] })
|
|
86
|
+
}
|
|
87
|
+
);
|
|
101
88
|
};
|
|
102
89
|
SingleMenuItem.propTypes = import_react_desc_prop_types.itemProps;
|
|
103
|
-
SingleMenuItem.displayName =
|
|
90
|
+
SingleMenuItem.displayName = `${import_exported_related.DSMenuItemName}Single`;
|
|
104
91
|
const SingleMenuItemWithSchema = (0, import_ds_utilities.describe)(SingleMenuItem);
|
|
105
92
|
SingleMenuItemWithSchema.propTypes = import_react_desc_prop_types.itemProps;
|
|
106
93
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/SingleMenuItem/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport type { DSMenuItemT } from '../../react-desc-prop-types';\nimport { defaultSingleProps, itemProps } from '../../react-desc-prop-types';\nimport {\n StyledContentWrapper,\n StyledGlobalMenuItemWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n} from '../styled';\n\nconst SingleMenuItem: React.ComponentType<DSMenuItemT.SingleProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultSingleProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, itemProps);\n const {\n dsId,\n label,\n secondaryLabel,\n isSelected,\n onClick,\n isActive,\n innerRef,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n wrapperStyles,\n render: Render,\n dataTestid,\n disabled,\n } = propsWithDefault;\n\n const gridLayout = useMemo(() => {\n const cols = ['16px', 'auto'];\n if (secondaryLabel) cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n return (\n <StyledGlobalMenuItemWrapper\n aria-selected={isSelected}\n id={dsId}\n role=\"option\"\n isActive={isActive}\n isSelected={isSelected}\n onClick={onClick}\n ref={innerRef}\n onMouseDown={onMouseDown}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n className={isActive ? 'ds-list-item-active' : ''}\n style={wrapperStyles}\n data-testid={dataTestid}\n disabled={disabled}\n data-type=\"single\"\n >\n {Render !== undefined ? (\n <Render {...props} />\n ) : (\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <div>{isSelected && <Checkmark size=\"s\" color={['brand-primary', '600']} />}</div>\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>}\n </StyledContentWrapper>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\nSingleMenuItem.propTypes = itemProps;\nSingleMenuItem.displayName =
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport type { DSMenuItemT } from '../../react-desc-prop-types';\nimport { defaultSingleProps, itemProps } from '../../react-desc-prop-types';\nimport {\n StyledContentWrapper,\n StyledGlobalMenuItemWrapper,\n StyleMenuItemLabel,\n StyleMenuItemSecondaryLabel,\n} from '../styled';\nimport { DSMenuItemName } from '../../exported-related';\n\nconst SingleMenuItem: React.ComponentType<DSMenuItemT.SingleProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultSingleProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, itemProps, `${DSMenuItemName}Single`);\n const {\n dsId,\n label,\n secondaryLabel,\n isSelected,\n onClick,\n isActive,\n innerRef,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n wrapperStyles,\n render: Render,\n dataTestid,\n disabled,\n } = propsWithDefault;\n\n const gridLayout = useMemo(() => {\n const cols = ['16px', 'auto'];\n if (secondaryLabel) cols.push('min-content');\n return cols;\n }, [secondaryLabel]);\n\n return (\n <StyledGlobalMenuItemWrapper\n aria-selected={isSelected}\n id={dsId}\n role=\"option\"\n isActive={isActive}\n isSelected={isSelected}\n onClick={onClick}\n ref={innerRef}\n onMouseDown={onMouseDown}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n className={isActive ? 'ds-list-item-active' : ''}\n style={wrapperStyles}\n data-testid={dataTestid}\n disabled={disabled}\n data-type=\"single\"\n >\n {Render !== undefined ? (\n <Render {...props} />\n ) : (\n <StyledContentWrapper cols={gridLayout} minHeight=\"16px\" gutter=\"xxs\" alignItems=\"center\">\n <div>{isSelected && <Checkmark size=\"s\" color={['brand-primary', '600']} />}</div>\n <StyleMenuItemLabel>{label}</StyleMenuItemLabel>\n {secondaryLabel !== undefined && <StyleMenuItemSecondaryLabel>{secondaryLabel}</StyleMenuItemSecondaryLabel>}\n </StyledContentWrapper>\n )}\n </StyledGlobalMenuItemWrapper>\n );\n};\n\nSingleMenuItem.propTypes = itemProps;\nSingleMenuItem.displayName = `${DSMenuItemName}Single`;\nconst SingleMenuItemWithSchema = describe(SingleMenuItem);\nSingleMenuItemWithSchema.propTypes = itemProps;\n\nexport { SingleMenuItem };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2Df;AA3DR,mBAA+B;AAC/B,0BAAuF;AACvF,sBAA0B;AAE1B,mCAA8C;AAC9C,oBAKO;AACP,8BAA+B;AAE/B,MAAM,iBAA+D,CAAC,UAAU;AAC9E,QAAM,uBAAmB,kDAA6B,OAAO,+CAAkB;AAE/E,0DAA+B,kBAAkB,wCAAW,GAAG,8CAAsB;AACrF,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,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,iBAAa,sBAAQ,MAAM;AAC/B,UAAM,OAAO,CAAC,QAAQ,MAAM;AAC5B,QAAI;AAAgB,WAAK,KAAK,aAAa;AAC3C,WAAO;AAAA,EACT,GAAG,CAAC,cAAc,CAAC;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,iBAAe;AAAA,MACf,IAAI;AAAA,MACJ,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,WAAW,wBAAwB;AAAA,MAC9C,OAAO;AAAA,MACP,eAAa;AAAA,MACb;AAAA,MACA,aAAU;AAAA,MAET,qBAAW,SACV,4CAAC,UAAQ,GAAG,OAAO,IAEnB,6CAAC,sCAAqB,MAAM,YAAY,WAAU,QAAO,QAAO,OAAM,YAAW,UAC/E;AAAA,oDAAC,SAAK,wBAAc,4CAAC,6BAAU,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG,GAAG;AAAA,QAC5E,4CAAC,oCAAoB,iBAAM;AAAA,QAC1B,mBAAmB,UAAa,4CAAC,6CAA6B,0BAAe;AAAA,SAChF;AAAA;AAAA,EAEJ;AAEJ;AAEA,eAAe,YAAY;AAC3B,eAAe,cAAc,GAAG;AAChC,MAAM,+BAA2B,8BAAS,cAAc;AACxD,yBAAyB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -36,12 +36,13 @@ var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
|
36
36
|
var import_react_desc_prop_types = require("../../react-desc-prop-types");
|
|
37
37
|
var import_styled = require("../styled");
|
|
38
38
|
var import_useGetSubmenuHandlers = require("./useGetSubmenuHandlers");
|
|
39
|
+
var import_exported_related = require("../../exported-related");
|
|
39
40
|
const SingleWithSubmenuItem = (props) => {
|
|
40
41
|
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(
|
|
41
42
|
props,
|
|
42
43
|
import_react_desc_prop_types.defaultSingleWithSubmenuProps
|
|
43
44
|
);
|
|
44
|
-
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.itemProps);
|
|
45
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.itemProps, `${import_exported_related.DSMenuItemName}SingleWithSubmenu`);
|
|
45
46
|
const {
|
|
46
47
|
dsId,
|
|
47
48
|
label,
|
|
@@ -80,87 +81,68 @@ const SingleWithSubmenuItem = (props) => {
|
|
|
80
81
|
cols.push("min-content");
|
|
81
82
|
return cols;
|
|
82
83
|
}, [secondaryLabel]);
|
|
83
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
wrapperStyles: { ...wrapperStyles, w: "100%" },
|
|
98
|
-
minWidth,
|
|
99
|
-
maxHeight,
|
|
100
|
-
as: "li",
|
|
101
|
-
role: "option",
|
|
102
|
-
"aria-selected": isSubmenuOpened,
|
|
103
|
-
"aria-describedby": `dropdownmenu-submenu-${dsId}`,
|
|
104
|
-
id: dsId,
|
|
105
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledGlobalMenuItemWrapper, {
|
|
106
|
-
pr: 0,
|
|
107
|
-
onClick: !disabled ? onClick : void 0,
|
|
108
|
-
isSelected: isSubmenuOpened,
|
|
109
|
-
disabled,
|
|
110
|
-
isActive,
|
|
84
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
|
+
Dropdown,
|
|
86
|
+
{
|
|
87
|
+
isOpened: delayedIsOpened,
|
|
88
|
+
options: options ?? [],
|
|
89
|
+
onOptionClick,
|
|
90
|
+
startPlacementPreference: "right-start",
|
|
91
|
+
placementOrderPreference: ["right-start", "right-end", "left-start", "left-end"],
|
|
92
|
+
selectedOptions,
|
|
93
|
+
openedSubmenus,
|
|
94
|
+
onSubmenuToggle,
|
|
95
|
+
onKeyDown,
|
|
96
|
+
onClickOutside,
|
|
97
|
+
customOffset: [-4, 1],
|
|
111
98
|
onMouseEnter: onMouseEnterHandler,
|
|
112
99
|
onMouseLeave: onMouseLeaveHandler,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
100
|
+
wrapperStyles: { ...wrapperStyles, w: "100%" },
|
|
101
|
+
minWidth,
|
|
102
|
+
maxHeight,
|
|
103
|
+
as: "li",
|
|
104
|
+
role: "option",
|
|
105
|
+
"aria-selected": isSubmenuOpened,
|
|
106
|
+
"aria-describedby": `dropdownmenu-submenu-${dsId}`,
|
|
107
|
+
id: dsId,
|
|
108
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
109
|
+
import_styled.StyledGlobalMenuItemWrapper,
|
|
110
|
+
{
|
|
111
|
+
pr: 0,
|
|
112
|
+
onClick: !disabled ? onClick : void 0,
|
|
113
|
+
isSelected: isSubmenuOpened,
|
|
114
|
+
disabled,
|
|
115
|
+
isActive,
|
|
116
|
+
onMouseEnter: onMouseEnterHandler,
|
|
117
|
+
onMouseLeave: onMouseLeaveHandler,
|
|
118
|
+
ref: innerRef,
|
|
119
|
+
"data-type": "single-with-submenu",
|
|
122
120
|
children: [
|
|
123
|
-
|
|
124
|
-
size: "s",
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
children: label
|
|
129
|
-
}),
|
|
130
|
-
secondaryLabel !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleMenuItemSecondaryLabel, {
|
|
131
|
-
children: secondaryLabel
|
|
132
|
-
}),
|
|
133
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledIconContainer, {
|
|
134
|
-
children: [
|
|
121
|
+
Render !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Render, { ...propsWithDefault }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledContentWrapper, { cols: gridLayout, gutter: "xxs", alignItems: "center", children: [
|
|
122
|
+
isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.Checkmark, { size: "s", color: disabled ? ["neutral", "500"] : ["brand-primary", "600"] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleMenuItemLabel, { children: label }),
|
|
124
|
+
secondaryLabel !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleMenuItemSecondaryLabel, { children: secondaryLabel }),
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledIconContainer, { children: [
|
|
135
126
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledVerticalSeparator, {}),
|
|
136
|
-
rightAddon === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledEllipsisButton, {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
disabled,
|
|
140
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.MoreOptionsVert, {
|
|
127
|
+
rightAddon === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledEllipsisButton, { tabIndex: -1, onClick: onEllipsisClick, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
128
|
+
import_ds_icons.MoreOptionsVert,
|
|
129
|
+
{
|
|
141
130
|
className: "ds-dropdown-menu-v2-more-options",
|
|
142
131
|
color: disabled ? ["neutral", "500"] : ["brand-primary", "600"],
|
|
143
132
|
size: "s"
|
|
144
|
-
}
|
|
145
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.ChevronRight, {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
]
|
|
150
|
-
})
|
|
133
|
+
}
|
|
134
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.ChevronRight, { color: disabled ? ["neutral", "500"] : ["brand-primary", "600"], size: "s" })
|
|
135
|
+
] })
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { id: `dropdownmenu-submenu-${dsId}`, style: { display: "none" }, children: "submenu, to open this submenu press the Right Arrow key" })
|
|
151
138
|
]
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
children: "submenu, to open this submenu press the Right Arrow key"
|
|
157
|
-
})
|
|
158
|
-
]
|
|
159
|
-
})
|
|
160
|
-
});
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
);
|
|
161
143
|
};
|
|
162
144
|
SingleWithSubmenuItem.propTypes = import_react_desc_prop_types.itemProps;
|
|
163
|
-
SingleWithSubmenuItem.displayName =
|
|
145
|
+
SingleWithSubmenuItem.displayName = `${import_exported_related.DSMenuItemName}SingleWithSubmenu`;
|
|
164
146
|
const SingleWithSubmenuItemWithSchema = (0, import_ds_utilities.describe)(SingleWithSubmenuItem);
|
|
165
147
|
SingleWithSubmenuItemWithSchema.propTypes = import_react_desc_prop_types.itemProps;
|
|
166
148
|
//# sourceMappingURL=index.js.map
|