@elliemae/ds-menu-items-multi 3.27.0-next.11

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.
Files changed (33) hide show
  1. package/dist/cjs/DSMenuItemsMulti.js +102 -0
  2. package/dist/cjs/DSMenuItemsMulti.js.map +7 -0
  3. package/dist/cjs/config/useMenuItemsMulti.js +58 -0
  4. package/dist/cjs/config/useMenuItemsMulti.js.map +7 -0
  5. package/dist/cjs/config/useValidateProps.js +41 -0
  6. package/dist/cjs/config/useValidateProps.js.map +7 -0
  7. package/dist/cjs/constants/index.js +25 -0
  8. package/dist/cjs/constants/index.js.map +7 -0
  9. package/dist/cjs/index.js +38 -0
  10. package/dist/cjs/index.js.map +7 -0
  11. package/dist/cjs/package.json +7 -0
  12. package/dist/cjs/react-desc-prop-types.js +74 -0
  13. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  14. package/dist/esm/DSMenuItemsMulti.js +72 -0
  15. package/dist/esm/DSMenuItemsMulti.js.map +7 -0
  16. package/dist/esm/config/useMenuItemsMulti.js +28 -0
  17. package/dist/esm/config/useMenuItemsMulti.js.map +7 -0
  18. package/dist/esm/config/useValidateProps.js +11 -0
  19. package/dist/esm/config/useValidateProps.js.map +7 -0
  20. package/dist/esm/constants/index.js +2 -0
  21. package/dist/esm/constants/index.js.map +7 -0
  22. package/dist/esm/index.js +8 -0
  23. package/dist/esm/index.js.map +7 -0
  24. package/dist/esm/package.json +7 -0
  25. package/dist/esm/react-desc-prop-types.js +47 -0
  26. package/dist/esm/react-desc-prop-types.js.map +7 -0
  27. package/dist/types/DSMenuItemsMulti.d.ts +5 -0
  28. package/dist/types/config/useMenuItemsMulti.d.ts +13 -0
  29. package/dist/types/config/useValidateProps.d.ts +3 -0
  30. package/dist/types/constants/index.d.ts +0 -0
  31. package/dist/types/index.d.ts +2 -0
  32. package/dist/types/react-desc-prop-types.d.ts +29 -0
  33. package/package.json +77 -0
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var DSMenuItemsMulti_exports = {};
30
+ __export(DSMenuItemsMulti_exports, {
31
+ DSMenuItemsMulti: () => DSMenuItemsMulti,
32
+ DSMenuItemsMultiWithSchema: () => DSMenuItemsMultiWithSchema
33
+ });
34
+ module.exports = __toCommonJS(DSMenuItemsMulti_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_ds_form_checkbox = require("@elliemae/ds-form-checkbox");
39
+ var import_ds_menu_items_commons = require("@elliemae/ds-menu-items-commons");
40
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
41
+ var import_useMenuItemsMulti = require("./config/useMenuItemsMulti.js");
42
+ const noop = () => {
43
+ };
44
+ const DSMenuItemsMulti = (props) => {
45
+ const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = (0, import_useMenuItemsMulti.useMenuItemsMulti)(props);
46
+ const {
47
+ dsId,
48
+ label,
49
+ disabled,
50
+ isSelected,
51
+ isActive,
52
+ onClick,
53
+ dataTestid,
54
+ innerRef,
55
+ onMouseEnter,
56
+ onMouseLeave,
57
+ onMouseDown,
58
+ wrapperStyles,
59
+ tabIndex,
60
+ render: Render
61
+ } = propsWithDefault;
62
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
+ import_ds_menu_items_commons.StyledGlobalMenuItemWrapper,
64
+ {
65
+ id: dsId,
66
+ disabled,
67
+ isActive,
68
+ isSelected,
69
+ innerRef,
70
+ onMouseDown,
71
+ onMouseEnter,
72
+ onMouseLeave,
73
+ role: "option",
74
+ className: isActive ? "ds-list-item-active" : "",
75
+ "aria-selected": isSelected,
76
+ style: wrapperStyles,
77
+ onClick,
78
+ "data-testid": dataTestid,
79
+ "data-type": "multi",
80
+ ...globalAttributes,
81
+ ...xStyledProps,
82
+ 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)(
83
+ import_ds_form_checkbox.PresentationalCheckbox,
84
+ {
85
+ disabled,
86
+ checked: isSelected,
87
+ onMouseDown,
88
+ name: label,
89
+ label,
90
+ onChange: noop,
91
+ tabIndex,
92
+ wrapLabel: true,
93
+ device: "desktop"
94
+ }
95
+ ) })
96
+ }
97
+ );
98
+ };
99
+ DSMenuItemsMulti.displayName = "DSMultiMenuItem";
100
+ const DSMenuItemsMultiWithSchema = (0, import_ds_props_helpers.describe)(DSMenuItemsMulti);
101
+ DSMenuItemsMultiWithSchema.propTypes = import_react_desc_prop_types.DSMenuItemsMultiPropTypesSchema;
102
+ //# sourceMappingURL=DSMenuItemsMulti.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 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 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 onClick={onClick}\n data-testid={dataTestid}\n data-type=\"multi\"\n {...globalAttributes}\n {...xStyledProps}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledItemContent>\n <PresentationalCheckbox\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\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;ADiDf;AAhDR,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,EACV,IAAI;AAEJ,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;AAAA,MACA,eAAa;AAAA,MACb,aAAU;AAAA,MACT,GAAG;AAAA,MACH,GAAG;AAAA,MAEH,qBAAW,SACV,4CAAC,UAAQ,GAAG,kBAAkB,IAE9B,4CAAC,kDACC;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;AAGA,iBAAiB,cAAc;AAC/B,MAAM,iCAA6B,kCAAS,gBAAgB;AAC5D,2BAA2B,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useMenuItemsMulti_exports = {};
30
+ __export(useMenuItemsMulti_exports, {
31
+ useMenuItemsMulti: () => useMenuItemsMulti
32
+ });
33
+ module.exports = __toCommonJS(useMenuItemsMulti_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_react = __toESM(require("react"));
36
+ var import_lodash = require("lodash");
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_react_desc_prop_types = require("../react-desc-prop-types.js");
39
+ var import_useValidateProps = require("./useValidateProps.js");
40
+ const useMenuItemsMulti = (propsFromUser) => {
41
+ const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(propsFromUser, import_react_desc_prop_types.defaultProps);
42
+ (0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSMenuItemsMultiPropTypes);
43
+ const globalProps = (0, import_lodash.omit)((0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault), [
44
+ "cols",
45
+ "rows",
46
+ "wrap"
47
+ ]);
48
+ const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
49
+ return import_react.default.useMemo(
50
+ () => ({
51
+ propsWithDefault,
52
+ globalProps,
53
+ xstyledProps
54
+ }),
55
+ [propsWithDefault, globalProps, xstyledProps]
56
+ );
57
+ };
58
+ //# sourceMappingURL=useMenuItemsMulti.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useMenuItemsMulti.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { omit } from 'lodash';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSMenuItemsMultiT, DSMenuItemsMultiPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface MenuItemsMultiCTX {\n propsWithDefault: DSMenuItemsMultiT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n}\n\nexport const useMenuItemsMulti = (propsFromUser: DSMenuItemsMultiT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n\n const propsWithDefault = useMemoMergePropsWithDefault<DSMenuItemsMultiT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSMenuItemsMultiPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSMenuItemsMultiT.InternalProps>(propsWithDefault), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n }),\n [propsWithDefault, globalProps, xstyledProps],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,oBAAqB;AACrB,8BAAyF;AACzF,mCAAgF;AAChF,8BAAiC;AAQ1B,MAAM,oBAAoB,CAAC,kBAA2C;AAK3E,QAAM,uBAAmB,sDAA8D,eAAe,yCAAY;AAClH,gDAAiB,kBAAkB,sDAAyB;AAI5D,QAAM,kBAAc,wBAAK,gDAAwD,gBAAgB,GAAG;AAAA,IAClG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,mBAAe,4CAAmB,gBAAgB;AAKxD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,YAAY;AAAA,EAC9C;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useValidateProps_exports = {};
30
+ __export(useValidateProps_exports, {
31
+ useValidateProps: () => useValidateProps
32
+ });
33
+ module.exports = __toCommonJS(useValidateProps_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
+ var import_ds_menu_items_commons = require("@elliemae/ds-menu-items-commons");
37
+ const DSMenuItemsMultiName = `${import_ds_menu_items_commons.DSMenuItemName}Multi`;
38
+ const useValidateProps = (props, propTypes) => {
39
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, DSMenuItemsMultiName);
40
+ };
41
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { DSMenuItemName } from '@elliemae/ds-menu-items-commons';\nimport type { WeakValidationMap } from 'react';\nimport { type DSMenuItemsMultiT } from '../react-desc-prop-types.js';\n\n// because this is inherited from the common props, we do not want to put this in the /constants/index.ts file\n// this is strictly defined here because this is meant to strictly influence ONLY the ERROR layer\n// this is 100% decoupled from ds-slots & data-testid\n// this constants only affect the shown error message as of 21/december/2023\nconst DSMenuItemsMultiName = `${DSMenuItemName}Multi`;\n\nexport const useValidateProps = (\n props: DSMenuItemsMultiT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsMultiName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAC/C,mCAA+B;AAQ/B,MAAM,uBAAuB,GAAG;AAEzB,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,8DAA+B,OAAO,WAAW,oBAAoB;AACvE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var React = __toESM(require("react"));
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var src_exports = {};
30
+ __export(src_exports, {
31
+ DSMenuItemsMulti: () => import_DSMenuItemsMulti.DSMenuItemsMulti,
32
+ DSMenuItemsMultiWithSchema: () => import_DSMenuItemsMulti.DSMenuItemsMultiWithSchema
33
+ });
34
+ module.exports = __toCommonJS(src_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_DSMenuItemsMulti = require("./DSMenuItemsMulti.js");
37
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSMenuItemsMulti, DSMenuItemsMultiWithSchema } from './DSMenuItemsMulti.js';\nexport { type DSMenuItemsMultiT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAA6D;AAC7D,mCAAuC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "commonjs",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ DSMenuItemsMultiPropTypes: () => DSMenuItemsMultiPropTypes,
32
+ DSMenuItemsMultiPropTypesSchema: () => DSMenuItemsMultiPropTypesSchema,
33
+ defaultProps: () => defaultProps
34
+ });
35
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
36
+ var React = __toESM(require("react"));
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_ds_menu_items_commons = require("@elliemae/ds-menu-items-commons");
39
+ const defaultProps = {
40
+ ...import_ds_menu_items_commons.DSMenuItemsCommonsDefaultProps,
41
+ label: "",
42
+ isActive: false,
43
+ disabled: false,
44
+ isSelected: false,
45
+ onClick: () => {
46
+ },
47
+ onMouseDown: () => {
48
+ },
49
+ onMouseEnter: () => {
50
+ },
51
+ onMouseLeave: () => {
52
+ },
53
+ tabIndex: 0
54
+ };
55
+ const { tabIndex, label, value, ...notOvverriddenGlobalPropsTypes } = import_ds_props_helpers.globalAttributesPropTypes;
56
+ const DSMenuItemsMultiPropTypes = {
57
+ // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps
58
+ // they are NOT inherited from a common element from ds-menu-items-commons
59
+ ...notOvverriddenGlobalPropsTypes,
60
+ ...import_ds_props_helpers.xstyledPropTypes,
61
+ ...import_ds_menu_items_commons.DSMenuItemsCommonsPropTypes,
62
+ // TODO - add support to PropTypes.oneOf for typeof number
63
+ // currently PropTypes.oneOf([0, -1]) is not supported
64
+ tabIndex: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.number, import_ds_props_helpers.PropTypes.string]).description(
65
+ "The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed."
66
+ ),
67
+ label: import_ds_props_helpers.PropTypes.string.description("The label of the menu item."),
68
+ isActive: import_ds_props_helpers.PropTypes.bool.description("Whether the menu item is active."),
69
+ isSelected: import_ds_props_helpers.PropTypes.bool.description("Whether the menu item has to show the selected state or not."),
70
+ value: import_ds_props_helpers.PropTypes.any.description("The value of the menu item."),
71
+ dataTestid: import_ds_props_helpers.PropTypes.string.description("The data-testid of the menu item.")
72
+ };
73
+ const DSMenuItemsMultiPropTypesSchema = DSMenuItemsMultiPropTypes;
74
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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';\nimport type { WeakValidationMap } 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 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 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};\n\nexport const DSMenuItemsMultiPropTypesSchema =\n DSMenuItemsMultiPropTypes as unknown as WeakValidationMap<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,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;AAC9E;AAEO,MAAM,kCACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,72 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { describe } from "@elliemae/ds-props-helpers";
4
+ import { PresentationalCheckbox } from "@elliemae/ds-form-checkbox";
5
+ import { StyledGlobalMenuItemWrapper, StyledItemContent } from "@elliemae/ds-menu-items-commons";
6
+ import { DSMenuItemsMultiPropTypesSchema } from "./react-desc-prop-types.js";
7
+ import { useMenuItemsMulti } from "./config/useMenuItemsMulti.js";
8
+ const noop = () => {
9
+ };
10
+ const DSMenuItemsMulti = (props) => {
11
+ const { propsWithDefault, globalProps: globalAttributes, xstyledProps: xStyledProps } = useMenuItemsMulti(props);
12
+ const {
13
+ dsId,
14
+ label,
15
+ disabled,
16
+ isSelected,
17
+ isActive,
18
+ onClick,
19
+ dataTestid,
20
+ innerRef,
21
+ onMouseEnter,
22
+ onMouseLeave,
23
+ onMouseDown,
24
+ wrapperStyles,
25
+ tabIndex,
26
+ render: Render
27
+ } = propsWithDefault;
28
+ return /* @__PURE__ */ jsx(
29
+ StyledGlobalMenuItemWrapper,
30
+ {
31
+ id: dsId,
32
+ disabled,
33
+ isActive,
34
+ isSelected,
35
+ innerRef,
36
+ onMouseDown,
37
+ onMouseEnter,
38
+ onMouseLeave,
39
+ role: "option",
40
+ className: isActive ? "ds-list-item-active" : "",
41
+ "aria-selected": isSelected,
42
+ style: wrapperStyles,
43
+ onClick,
44
+ "data-testid": dataTestid,
45
+ "data-type": "multi",
46
+ ...globalAttributes,
47
+ ...xStyledProps,
48
+ children: Render !== void 0 ? /* @__PURE__ */ jsx(Render, { ...propsWithDefault }) : /* @__PURE__ */ jsx(StyledItemContent, { children: /* @__PURE__ */ jsx(
49
+ PresentationalCheckbox,
50
+ {
51
+ disabled,
52
+ checked: isSelected,
53
+ onMouseDown,
54
+ name: label,
55
+ label,
56
+ onChange: noop,
57
+ tabIndex,
58
+ wrapLabel: true,
59
+ device: "desktop"
60
+ }
61
+ ) })
62
+ }
63
+ );
64
+ };
65
+ DSMenuItemsMulti.displayName = "DSMultiMenuItem";
66
+ const DSMenuItemsMultiWithSchema = describe(DSMenuItemsMulti);
67
+ DSMenuItemsMultiWithSchema.propTypes = DSMenuItemsMultiPropTypesSchema;
68
+ export {
69
+ DSMenuItemsMulti,
70
+ DSMenuItemsMultiWithSchema
71
+ };
72
+ //# sourceMappingURL=DSMenuItemsMulti.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 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 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 onClick={onClick}\n data-testid={dataTestid}\n data-type=\"multi\"\n {...globalAttributes}\n {...xStyledProps}\n >\n {Render !== undefined ? (\n <Render {...propsWithDefault} />\n ) : (\n <StyledItemContent>\n <PresentationalCheckbox\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\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;ACiDf;AAhDR,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,EACV,IAAI;AAEJ,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;AAAA,MACA,eAAa;AAAA,MACb,aAAU;AAAA,MACT,GAAG;AAAA,MACH,GAAG;AAAA,MAEH,qBAAW,SACV,oBAAC,UAAQ,GAAG,kBAAkB,IAE9B,oBAAC,qBACC;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;AAGA,iBAAiB,cAAc;AAC/B,MAAM,6BAA6B,SAAS,gBAAgB;AAC5D,2BAA2B,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { omit } from "lodash";
4
+ import { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
5
+ import { DSMenuItemsMultiPropTypes, defaultProps } from "../react-desc-prop-types.js";
6
+ import { useValidateProps } from "./useValidateProps.js";
7
+ const useMenuItemsMulti = (propsFromUser) => {
8
+ const propsWithDefault = useMemoMergePropsWithDefault(propsFromUser, defaultProps);
9
+ useValidateProps(propsWithDefault, DSMenuItemsMultiPropTypes);
10
+ const globalProps = omit(useGetGlobalAttributes(propsWithDefault), [
11
+ "cols",
12
+ "rows",
13
+ "wrap"
14
+ ]);
15
+ const xstyledProps = useGetXstyledProps(propsWithDefault);
16
+ return React2.useMemo(
17
+ () => ({
18
+ propsWithDefault,
19
+ globalProps,
20
+ xstyledProps
21
+ }),
22
+ [propsWithDefault, globalProps, xstyledProps]
23
+ );
24
+ };
25
+ export {
26
+ useMenuItemsMulti
27
+ };
28
+ //# sourceMappingURL=useMenuItemsMulti.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useMenuItemsMulti.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { omit } from 'lodash';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSMenuItemsMultiT, DSMenuItemsMultiPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface MenuItemsMultiCTX {\n propsWithDefault: DSMenuItemsMultiT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n}\n\nexport const useMenuItemsMulti = (propsFromUser: DSMenuItemsMultiT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n\n const propsWithDefault = useMemoMergePropsWithDefault<DSMenuItemsMultiT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSMenuItemsMultiPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSMenuItemsMultiT.InternalProps>(propsWithDefault), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n }),\n [propsWithDefault, globalProps, xstyledProps],\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,YAAY;AACrB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAiC,2BAA2B,oBAAoB;AAChF,SAAS,wBAAwB;AAQ1B,MAAM,oBAAoB,CAAC,kBAA2C;AAK3E,QAAM,mBAAmB,6BAA8D,eAAe,YAAY;AAClH,mBAAiB,kBAAkB,yBAAyB;AAI5D,QAAM,cAAc,KAAK,uBAAwD,gBAAgB,GAAG;AAAA,IAClG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,eAAe,mBAAmB,gBAAgB;AAKxD,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,YAAY;AAAA,EAC9C;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
3
+ import { DSMenuItemName } from "@elliemae/ds-menu-items-commons";
4
+ const DSMenuItemsMultiName = `${DSMenuItemName}Multi`;
5
+ const useValidateProps = (props, propTypes) => {
6
+ useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsMultiName);
7
+ };
8
+ export {
9
+ useValidateProps
10
+ };
11
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { DSMenuItemName } from '@elliemae/ds-menu-items-commons';\nimport type { WeakValidationMap } from 'react';\nimport { type DSMenuItemsMultiT } from '../react-desc-prop-types.js';\n\n// because this is inherited from the common props, we do not want to put this in the /constants/index.ts file\n// this is strictly defined here because this is meant to strictly influence ONLY the ERROR layer\n// this is 100% decoupled from ds-slots & data-testid\n// this constants only affect the shown error message as of 21/december/2023\nconst DSMenuItemsMultiName = `${DSMenuItemName}Multi`;\n\nexport const useValidateProps = (\n props: DSMenuItemsMultiT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSMenuItemsMultiName);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAC/C,SAAS,sBAAsB;AAQ/B,MAAM,uBAAuB,GAAG;AAEzB,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,oBAAoB;AACvE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import { DSMenuItemsMulti, DSMenuItemsMultiWithSchema } from "./DSMenuItemsMulti.js";
3
+ import {} from "./react-desc-prop-types.js";
4
+ export {
5
+ DSMenuItemsMulti,
6
+ DSMenuItemsMultiWithSchema
7
+ };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSMenuItemsMulti, DSMenuItemsMultiWithSchema } from './DSMenuItemsMulti.js';\nexport { type DSMenuItemsMultiT } from './react-desc-prop-types.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,kBAAkB,kCAAkC;AAC7D,eAAuC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,47 @@
1
+ import * as React from "react";
2
+ import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
3
+ import {
4
+ DSMenuItemsCommonsPropTypes,
5
+ DSMenuItemsCommonsDefaultProps
6
+ } from "@elliemae/ds-menu-items-commons";
7
+ const defaultProps = {
8
+ ...DSMenuItemsCommonsDefaultProps,
9
+ label: "",
10
+ isActive: false,
11
+ disabled: false,
12
+ isSelected: false,
13
+ onClick: () => {
14
+ },
15
+ onMouseDown: () => {
16
+ },
17
+ onMouseEnter: () => {
18
+ },
19
+ onMouseLeave: () => {
20
+ },
21
+ tabIndex: 0
22
+ };
23
+ const { tabIndex, label, value, ...notOvverriddenGlobalPropsTypes } = globalAttributesPropTypes;
24
+ const DSMenuItemsMultiPropTypes = {
25
+ // each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps
26
+ // they are NOT inherited from a common element from ds-menu-items-commons
27
+ ...notOvverriddenGlobalPropsTypes,
28
+ ...xstyledPropTypes,
29
+ ...DSMenuItemsCommonsPropTypes,
30
+ // TODO - add support to PropTypes.oneOf for typeof number
31
+ // currently PropTypes.oneOf([0, -1]) is not supported
32
+ tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(
33
+ "The tab index of the menu item. for WCAG 2.1 AA compliance only -1 and 0 are allowed."
34
+ ),
35
+ label: PropTypes.string.description("The label of the menu item."),
36
+ isActive: PropTypes.bool.description("Whether the menu item is active."),
37
+ isSelected: PropTypes.bool.description("Whether the menu item has to show the selected state or not."),
38
+ value: PropTypes.any.description("The value of the menu item."),
39
+ dataTestid: PropTypes.string.description("The data-testid of the menu item.")
40
+ };
41
+ const DSMenuItemsMultiPropTypesSchema = DSMenuItemsMultiPropTypes;
42
+ export {
43
+ DSMenuItemsMultiPropTypes,
44
+ DSMenuItemsMultiPropTypesSchema,
45
+ defaultProps
46
+ };
47
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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';\nimport type { WeakValidationMap } 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 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 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};\n\nexport const DSMenuItemsMultiPropTypesSchema =\n DSMenuItemsMultiPropTypes as unknown as WeakValidationMap<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,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;AAC9E;AAEO,MAAM,kCACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { type DSMenuItemsMultiT } from './react-desc-prop-types.js';
3
+ declare const DSMenuItemsMulti: React.ComponentType<DSMenuItemsMultiT.Props>;
4
+ declare const DSMenuItemsMultiWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSMenuItemsMultiT.Props>;
5
+ export { DSMenuItemsMulti, DSMenuItemsMultiWithSchema };
@@ -0,0 +1,13 @@
1
+ /// <reference types="lodash" />
2
+ import { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';
3
+ import { type DSMenuItemsMultiT } from '../react-desc-prop-types.js';
4
+ export interface MenuItemsMultiCTX {
5
+ propsWithDefault: DSMenuItemsMultiT.InternalProps;
6
+ globalProps: ReturnType<typeof useGetGlobalAttributes>;
7
+ xstyledProps: ReturnType<typeof useGetXstyledProps>;
8
+ }
9
+ export declare const useMenuItemsMulti: (propsFromUser: DSMenuItemsMultiT.Props) => {
10
+ propsWithDefault: DSMenuItemsMultiT.InternalProps;
11
+ globalProps: import("lodash").Omit<import("@elliemae/ds-props-helpers").GlobalAttributesT<Element>, "cols" | "rows" | "wrap">;
12
+ xstyledProps: import("@elliemae/ds-props-helpers").XstyledProps;
13
+ };
@@ -0,0 +1,3 @@
1
+ import type { WeakValidationMap } from 'react';
2
+ import { type DSMenuItemsMultiT } from '../react-desc-prop-types.js';
3
+ export declare const useValidateProps: (props: DSMenuItemsMultiT.InternalProps, propTypes: WeakValidationMap<unknown>) => void;
File without changes
@@ -0,0 +1,2 @@
1
+ export { DSMenuItemsMulti, DSMenuItemsMultiWithSchema } from './DSMenuItemsMulti.js';
2
+ export { type DSMenuItemsMultiT } from './react-desc-prop-types.js';
@@ -0,0 +1,29 @@
1
+ import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
2
+ import { type DSMenuItemsCommonsT } from '@elliemae/ds-menu-items-commons';
3
+ import type React from 'react';
4
+ export declare namespace DSMenuItemsMultiT {
5
+ type WCAGTabIndex = 0 | -1;
6
+ type RequiredProps = DSMenuItemsCommonsT.RequiredProps;
7
+ type DefaultProps = DSMenuItemsCommonsT.DefaultProps & {
8
+ label: string;
9
+ isActive: boolean;
10
+ disabled: boolean;
11
+ isSelected: boolean;
12
+ onClick: React.MouseEventHandler;
13
+ onMouseDown: React.MouseEventHandler;
14
+ onMouseEnter: React.MouseEventHandler;
15
+ onMouseLeave: React.MouseEventHandler;
16
+ tabIndex: WCAGTabIndex;
17
+ };
18
+ type OptionalProps = DSMenuItemsCommonsT.OptionalProps<DSMenuItemsMultiT.InternalProps> & {
19
+ dataTestid?: string;
20
+ value?: unknown;
21
+ };
22
+ interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps>, XstyledProps, RequiredProps {
23
+ }
24
+ interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps>, XstyledProps, RequiredProps {
25
+ }
26
+ }
27
+ export declare const defaultProps: DSMenuItemsMultiT.DefaultProps;
28
+ export declare const DSMenuItemsMultiPropTypes: DSPropTypesSchema<DSMenuItemsMultiT.InternalProps>;
29
+ export declare const DSMenuItemsMultiPropTypesSchema: React.WeakValidationMap<DSMenuItemsMultiT.Props>;
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@elliemae/ds-menu-items-multi",
3
+ "version": "3.27.0-next.11",
4
+ "license": "MIT",
5
+ "description": "ICE MT - Dimsum - Menu Items Multi",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
16
+ }
17
+ },
18
+ "sideEffects": [
19
+ "*.css",
20
+ "*.scss"
21
+ ],
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://git.elliemae.io/platform-ui/dimsum.git"
25
+ },
26
+ "engines": {
27
+ "pnpm": ">=6",
28
+ "node": ">=16"
29
+ },
30
+ "author": "ICE MT",
31
+ "jestSonar": {
32
+ "sonar56x": true,
33
+ "reportPath": "reports",
34
+ "reportFile": "tests.xml",
35
+ "indent": 4
36
+ },
37
+ "dependencies": {
38
+ "@xstyled/styled-components": "~3.6.0",
39
+ "@elliemae/ds-button": "3.27.0-next.11",
40
+ "@elliemae/ds-form-checkbox": "3.27.0-next.11",
41
+ "@elliemae/ds-menu-items-commons": "3.27.0-next.11",
42
+ "@elliemae/ds-props-helpers": "3.27.0-next.11",
43
+ "@elliemae/ds-grid": "3.27.0-next.11",
44
+ "@elliemae/ds-system": "3.27.0-next.11",
45
+ "@elliemae/ds-utilities": "3.27.0-next.11"
46
+ },
47
+ "devDependencies": {
48
+ "lodash": "^4.17.21",
49
+ "styled-components": "~5.3.9",
50
+ "@elliemae/ds-monorepo-devops": "3.27.0-next.11"
51
+ },
52
+ "peerDependencies": {
53
+ "@testing-library/jest-dom": "~5.16.4",
54
+ "@testing-library/react": "~12.1.3",
55
+ "@testing-library/user-event": "~13.5.0",
56
+ "lodash": "^4.17.21",
57
+ "react": "^17.0.2",
58
+ "react-dom": "^17.0.2",
59
+ "styled-components": "~5.3.9"
60
+ },
61
+ "publishConfig": {
62
+ "access": "public",
63
+ "typeSafety": true
64
+ },
65
+ "scripts": {
66
+ "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
67
+ "test": "pui-cli test --passWithNoTests",
68
+ "lint": "node ../../../scripts/lint.mjs --fix",
69
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
70
+ "dts": "node ../../scripts/dts.mjs",
71
+ "dts:withdeps": "pnpm --filter {.}... dts",
72
+ "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
73
+ "dev:build": "pnpm --filter {.}... build",
74
+ "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
75
+ "checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
76
+ }
77
+ }