@elliemae/ds-menu-items-skeleton 3.80.0-next.22 → 3.80.0-next.30
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/DSMenuItemsSkeleton.js +2 -1
- package/dist/cjs/DSMenuItemsSkeleton.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +12 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/DSMenuItemsSkeleton.js +2 -1
- package/dist/esm/DSMenuItemsSkeleton.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +12 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/react-desc-prop-types.d.ts +8 -1
- package/package.json +6 -6
|
@@ -42,7 +42,7 @@ var import_useMenuItemsSkeleton = require("./config/useMenuItemsSkeleton.js");
|
|
|
42
42
|
const gridLayout = ["16px", "auto"];
|
|
43
43
|
const DSMenuItemsSkeleton = (props) => {
|
|
44
44
|
const { propsWithDefault, globalProps, xstyledProps } = (0, import_useMenuItemsSkeleton.useMenuItemsSkeleton)(props);
|
|
45
|
-
const { wrapperStyles, isActive, dsId } = propsWithDefault;
|
|
45
|
+
const { wrapperStyles, isActive, dsId, innerRef } = propsWithDefault;
|
|
46
46
|
const { getOwnerProps } = (0, import_ds_props_helpers.useOwnerProps)(props);
|
|
47
47
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
48
|
import_ds_menu_items_commons.StyledGlobalMenuItemWrapper,
|
|
@@ -53,6 +53,7 @@ const DSMenuItemsSkeleton = (props) => {
|
|
|
53
53
|
role: "presentation",
|
|
54
54
|
style: wrapperStyles,
|
|
55
55
|
isActive,
|
|
56
|
+
innerRef,
|
|
56
57
|
getOwnerProps,
|
|
57
58
|
...globalProps,
|
|
58
59
|
...xstyledProps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSMenuItemsSkeleton.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { DSSkeleton } from '@elliemae/ds-skeleton';\nimport { StyledGlobalMenuItemWrapper, StyledContentWrapper } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSkeletonT, DSMenuItemsSkeletonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSkeleton } from './config/useMenuItemsSkeleton.js';\nconst gridLayout = ['16px', 'auto'];\n\nconst DSMenuItemsSkeleton: React.ComponentType<DSMenuItemsSkeletonT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSkeleton(props);\n const { wrapperStyles, isActive, dsId } = propsWithDefault;\n const { getOwnerProps } = useOwnerProps(props);\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n data-type=\"skeleton\"\n data-testid=\"ds-skeleton-menu-item\"\n role=\"presentation\"\n style={wrapperStyles}\n isActive={isActive}\n getOwnerProps={getOwnerProps}\n {...globalProps}\n {...xstyledProps}\n >\n <StyledContentWrapper\n cols={gridLayout}\n minHeight=\"16px\"\n gutter=\"xxs\"\n alignItems=\"center\"\n getOwnerProps={getOwnerProps}\n >\n <DSSkeleton variant=\"rectangular\" width=\"20px\" bg=\"neutral-080\" borderRadius=\"1px\" />\n <DSSkeleton variant=\"rectangular\" width=\"100%\" bg=\"neutral-080\" borderRadius=\"1px\" />\n </StyledContentWrapper>\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// the component used to not even define this...\nDSMenuItemsSkeleton.displayName = 'DSMenuItemSkeleton';\nconst DSMenuItemsSkeletonWithSchema = describe(DSMenuItemsSkeleton);\nDSMenuItemsSkeletonWithSchema.propTypes = DSMenuItemsSkeletonPropTypesSchema;\n\nexport { DSMenuItemsSkeleton, DSMenuItemsSkeletonWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { DSSkeleton } from '@elliemae/ds-skeleton';\nimport { StyledGlobalMenuItemWrapper, StyledContentWrapper } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSkeletonT, DSMenuItemsSkeletonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSkeleton } from './config/useMenuItemsSkeleton.js';\nconst gridLayout = ['16px', 'auto'];\n\nconst DSMenuItemsSkeleton: React.ComponentType<DSMenuItemsSkeletonT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSkeleton(props);\n const { wrapperStyles, isActive, dsId, innerRef } = propsWithDefault;\n const { getOwnerProps } = useOwnerProps(props);\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n data-type=\"skeleton\"\n data-testid=\"ds-skeleton-menu-item\"\n role=\"presentation\"\n style={wrapperStyles}\n isActive={isActive}\n innerRef={innerRef}\n getOwnerProps={getOwnerProps}\n {...globalProps}\n {...xstyledProps}\n >\n <StyledContentWrapper\n cols={gridLayout}\n minHeight=\"16px\"\n gutter=\"xxs\"\n alignItems=\"center\"\n getOwnerProps={getOwnerProps}\n >\n <DSSkeleton variant=\"rectangular\" width=\"20px\" bg=\"neutral-080\" borderRadius=\"1px\" />\n <DSSkeleton variant=\"rectangular\" width=\"100%\" bg=\"neutral-080\" borderRadius=\"1px\" />\n </StyledContentWrapper>\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// the component used to not even define this...\nDSMenuItemsSkeleton.displayName = 'DSMenuItemSkeleton';\nconst DSMenuItemsSkeletonWithSchema = describe(DSMenuItemsSkeleton);\nDSMenuItemsSkeletonWithSchema.propTypes = DSMenuItemsSkeletonPropTypesSchema;\n\nexport { DSMenuItemsSkeleton, DSMenuItemsSkeletonWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0BjB;AAzBN,8BAAwC;AACxC,yBAA2B;AAC3B,mCAAkE;AAClE,mCAA8E;AAC9E,kCAAqC;AACrC,MAAM,aAAa,CAAC,QAAQ,MAAM;AAElC,MAAM,sBAAuE,CAAC,UAAU;AACtF,QAAM,EAAE,kBAAkB,aAAa,aAAa,QAAI,kDAAqB,KAAK;AAClF,QAAM,EAAE,eAAe,UAAU,MAAM,SAAS,IAAI;AACpD,QAAM,EAAE,cAAc,QAAI,uCAAc,KAAK;AAE7C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,aAAU;AAAA,MACV,eAAY;AAAA,MACZ,MAAK;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,WAAU;AAAA,UACV,QAAO;AAAA,UACP,YAAW;AAAA,UACX;AAAA,UAEA;AAAA,wDAAC,iCAAW,SAAQ,eAAc,OAAM,QAAO,IAAG,eAAc,cAAa,OAAM;AAAA,YACnF,4CAAC,iCAAW,SAAQ,eAAc,OAAM,QAAO,IAAG,eAAc,cAAa,OAAM;AAAA;AAAA;AAAA,MACrF;AAAA;AAAA,EACF;AAEJ;AAGA,oBAAoB,cAAc;AAClC,MAAM,oCAAgC,kCAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -36,7 +36,9 @@ module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
|
36
36
|
var React = __toESM(require("react"));
|
|
37
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
38
|
const defaultProps = {
|
|
39
|
-
wrapperStyles: {}
|
|
39
|
+
wrapperStyles: {},
|
|
40
|
+
innerRef: () => {
|
|
41
|
+
}
|
|
40
42
|
};
|
|
41
43
|
const DSMenuItemsSkeletonPropTypes = {
|
|
42
44
|
// each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps
|
|
@@ -47,7 +49,15 @@ const DSMenuItemsSkeletonPropTypes = {
|
|
|
47
49
|
'This is used as "id" in the DOM, you need this to be able to make this A11Y accessible.'
|
|
48
50
|
).isRequired,
|
|
49
51
|
isActive: import_ds_props_helpers.PropTypes.bool.description("Whether the menu item is active."),
|
|
50
|
-
wrapperStyles: import_ds_props_helpers.PropTypes.object.description("The styles to apply to the wrapper element, if any.")
|
|
52
|
+
wrapperStyles: import_ds_props_helpers.PropTypes.object.description("The styles to apply to the wrapper element, if any."),
|
|
53
|
+
innerRef: import_ds_props_helpers.PropTypes.oneOfType([
|
|
54
|
+
import_ds_props_helpers.PropTypes.shape({
|
|
55
|
+
current: import_ds_props_helpers.PropTypes.node
|
|
56
|
+
}),
|
|
57
|
+
import_ds_props_helpers.PropTypes.func.description(
|
|
58
|
+
"A ref object or callback function to access the main underlying DOM element of the menu item."
|
|
59
|
+
)
|
|
60
|
+
]).defaultValue(`(() => {})`)
|
|
51
61
|
};
|
|
52
62
|
const DSMenuItemsSkeletonPropTypesSchema = DSMenuItemsSkeletonPropTypes;
|
|
53
63
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { type DSMenuItemsCommonsT } from '@elliemae/ds-menu-items-commons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSkeletonT {\n /** *****************************************************************************************\n ******************************** IMPORTANT DISCLAIMER *************************************\n *******************************************************************************************\n This component violates `common.RequiredProps` because\n - it does not have a 'render' prop\n - it does not have an 'original' prop\n - it does not have
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { type DSMenuItemsCommonsT } from '@elliemae/ds-menu-items-commons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSkeletonT {\n /** *****************************************************************************************\n ******************************** IMPORTANT DISCLAIMER *************************************\n *******************************************************************************************\n This component violates `common.RequiredProps` because\n - it does not have a 'render' prop\n - it does not have an 'original' prop\n - it does not have any \"schema\" validator\n\n 'innerRef' was added (optional, defaulting to a no-op) so this item type can participate in a\n parent virtualized list's dynamic height measurement the same as every other menu item type.\n\n Legacy was not supporting global attributes but during the refactor I added them.\n It was not merging \"default\" props either, but I added them as well. (only for wrapperStyles)\n Those changes should be 100% backward compatible.\n \n I am reflecting what the code is actually doing instead of what we \"meant\" to do.\n ***************************************************************************************** */\n\n // sections can not be \"selected\" nor activated and for this reason we never had an hard requirement for the dsId\n // this may not scale well but to avoid breaking changes we are keeping it this way, if we ever need to add it we will do a V2\n\n // typescript inheritance has no syntax support for \"interfaces\", we have to use union types instead...\n export type RequiredProps = DSMenuItemsCommonsT.RequiredProps;\n\n export type DefaultProps = {\n wrapperStyles?: DSMenuItemsCommonsT.DefaultProps['wrapperStyles'];\n /**\n * A parent virtualized list needs to attach a ref to this item type's rendered root, same\n * as every other menu item type, so it can be included in dynamic height measurement.\n */\n innerRef?: DSMenuItemsCommonsT.DefaultProps['innerRef'];\n };\n\n export type OptionalProps = {\n isActive?: boolean;\n };\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSMenuItemsSkeletonT.DefaultProps = {\n wrapperStyles: {},\n innerRef: () => {},\n};\n\nexport const DSMenuItemsSkeletonPropTypes: DSPropTypesSchema<DSMenuItemsSkeletonT.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 ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n dsId: PropTypes.string.description(\n 'This is used as \"id\" in the DOM, you need this to be able to make this A11Y accessible.',\n ).isRequired,\n isActive: PropTypes.bool.description('Whether the menu item is active.'),\n wrapperStyles: PropTypes.object.description('The styles to apply to the wrapper element, if any.'),\n innerRef: PropTypes.oneOfType([\n PropTypes.shape({\n current: PropTypes.node,\n }),\n PropTypes.func.description(\n 'A ref object or callback function to access the main underlying DOM element of the menu item.',\n ),\n ]).defaultValue(`(() => {})`),\n};\n\nexport const DSMenuItemsSkeletonPropTypesSchema =\n DSMenuItemsSkeletonPropTypes as unknown as WeakValidationMap<DSMenuItemsSkeletonT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AA2DhE,MAAM,eAAkD;AAAA,EAC7D,eAAe,CAAC;AAAA,EAChB,UAAU,MAAM;AAAA,EAAC;AACnB;AAEO,MAAM,+BAAsF;AAAA;AAAA;AAAA,EAGjG,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,kCAAU,OAAO;AAAA,IACrB;AAAA,EACF,EAAE;AAAA,EACF,UAAU,kCAAU,KAAK,YAAY,kCAAkC;AAAA,EACvE,eAAe,kCAAU,OAAO,YAAY,qDAAqD;AAAA,EACjG,UAAU,kCAAU,UAAU;AAAA,IAC5B,kCAAU,MAAM;AAAA,MACd,SAAS,kCAAU;AAAA,IACrB,CAAC;AAAA,IACD,kCAAU,KAAK;AAAA,MACb;AAAA,IACF;AAAA,EACF,CAAC,EAAE,aAAa,YAAY;AAC9B;AAEO,MAAM,qCACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,7 +8,7 @@ import { useMenuItemsSkeleton } from "./config/useMenuItemsSkeleton.js";
|
|
|
8
8
|
const gridLayout = ["16px", "auto"];
|
|
9
9
|
const DSMenuItemsSkeleton = (props) => {
|
|
10
10
|
const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSkeleton(props);
|
|
11
|
-
const { wrapperStyles, isActive, dsId } = propsWithDefault;
|
|
11
|
+
const { wrapperStyles, isActive, dsId, innerRef } = propsWithDefault;
|
|
12
12
|
const { getOwnerProps } = useOwnerProps(props);
|
|
13
13
|
return /* @__PURE__ */ jsx(
|
|
14
14
|
StyledGlobalMenuItemWrapper,
|
|
@@ -19,6 +19,7 @@ const DSMenuItemsSkeleton = (props) => {
|
|
|
19
19
|
role: "presentation",
|
|
20
20
|
style: wrapperStyles,
|
|
21
21
|
isActive,
|
|
22
|
+
innerRef,
|
|
22
23
|
getOwnerProps,
|
|
23
24
|
...globalProps,
|
|
24
25
|
...xstyledProps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSMenuItemsSkeleton.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { DSSkeleton } from '@elliemae/ds-skeleton';\nimport { StyledGlobalMenuItemWrapper, StyledContentWrapper } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSkeletonT, DSMenuItemsSkeletonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSkeleton } from './config/useMenuItemsSkeleton.js';\nconst gridLayout = ['16px', 'auto'];\n\nconst DSMenuItemsSkeleton: React.ComponentType<DSMenuItemsSkeletonT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSkeleton(props);\n const { wrapperStyles, isActive, dsId } = propsWithDefault;\n const { getOwnerProps } = useOwnerProps(props);\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n data-type=\"skeleton\"\n data-testid=\"ds-skeleton-menu-item\"\n role=\"presentation\"\n style={wrapperStyles}\n isActive={isActive}\n getOwnerProps={getOwnerProps}\n {...globalProps}\n {...xstyledProps}\n >\n <StyledContentWrapper\n cols={gridLayout}\n minHeight=\"16px\"\n gutter=\"xxs\"\n alignItems=\"center\"\n getOwnerProps={getOwnerProps}\n >\n <DSSkeleton variant=\"rectangular\" width=\"20px\" bg=\"neutral-080\" borderRadius=\"1px\" />\n <DSSkeleton variant=\"rectangular\" width=\"100%\" bg=\"neutral-080\" borderRadius=\"1px\" />\n </StyledContentWrapper>\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// the component used to not even define this...\nDSMenuItemsSkeleton.displayName = 'DSMenuItemSkeleton';\nconst DSMenuItemsSkeletonWithSchema = describe(DSMenuItemsSkeleton);\nDSMenuItemsSkeletonWithSchema.propTypes = DSMenuItemsSkeletonPropTypesSchema;\n\nexport { DSMenuItemsSkeleton, DSMenuItemsSkeletonWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { DSSkeleton } from '@elliemae/ds-skeleton';\nimport { StyledGlobalMenuItemWrapper, StyledContentWrapper } from '@elliemae/ds-menu-items-commons';\nimport { type DSMenuItemsSkeletonT, DSMenuItemsSkeletonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useMenuItemsSkeleton } from './config/useMenuItemsSkeleton.js';\nconst gridLayout = ['16px', 'auto'];\n\nconst DSMenuItemsSkeleton: React.ComponentType<DSMenuItemsSkeletonT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useMenuItemsSkeleton(props);\n const { wrapperStyles, isActive, dsId, innerRef } = propsWithDefault;\n const { getOwnerProps } = useOwnerProps(props);\n\n return (\n <StyledGlobalMenuItemWrapper\n id={dsId}\n data-type=\"skeleton\"\n data-testid=\"ds-skeleton-menu-item\"\n role=\"presentation\"\n style={wrapperStyles}\n isActive={isActive}\n innerRef={innerRef}\n getOwnerProps={getOwnerProps}\n {...globalProps}\n {...xstyledProps}\n >\n <StyledContentWrapper\n cols={gridLayout}\n minHeight=\"16px\"\n gutter=\"xxs\"\n alignItems=\"center\"\n getOwnerProps={getOwnerProps}\n >\n <DSSkeleton variant=\"rectangular\" width=\"20px\" bg=\"neutral-080\" borderRadius=\"1px\" />\n <DSSkeleton variant=\"rectangular\" width=\"100%\" bg=\"neutral-080\" borderRadius=\"1px\" />\n </StyledContentWrapper>\n </StyledGlobalMenuItemWrapper>\n );\n};\n\n// the component used to not even define this...\nDSMenuItemsSkeleton.displayName = 'DSMenuItemSkeleton';\nconst DSMenuItemsSkeletonWithSchema = describe(DSMenuItemsSkeleton);\nDSMenuItemsSkeletonWithSchema.propTypes = DSMenuItemsSkeletonPropTypesSchema;\n\nexport { DSMenuItemsSkeleton, DSMenuItemsSkeletonWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC0BjB,SAOE,KAPF;AAzBN,SAAS,UAAU,qBAAqB;AACxC,SAAS,kBAAkB;AAC3B,SAAS,6BAA6B,4BAA4B;AAClE,SAAoC,0CAA0C;AAC9E,SAAS,4BAA4B;AACrC,MAAM,aAAa,CAAC,QAAQ,MAAM;AAElC,MAAM,sBAAuE,CAAC,UAAU;AACtF,QAAM,EAAE,kBAAkB,aAAa,aAAa,IAAI,qBAAqB,KAAK;AAClF,QAAM,EAAE,eAAe,UAAU,MAAM,SAAS,IAAI;AACpD,QAAM,EAAE,cAAc,IAAI,cAAc,KAAK;AAE7C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,aAAU;AAAA,MACV,eAAY;AAAA,MACZ,MAAK;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,WAAU;AAAA,UACV,QAAO;AAAA,UACP,YAAW;AAAA,UACX;AAAA,UAEA;AAAA,gCAAC,cAAW,SAAQ,eAAc,OAAM,QAAO,IAAG,eAAc,cAAa,OAAM;AAAA,YACnF,oBAAC,cAAW,SAAQ,eAAc,OAAM,QAAO,IAAG,eAAc,cAAa,OAAM;AAAA;AAAA;AAAA,MACrF;AAAA;AAAA,EACF;AAEJ;AAGA,oBAAoB,cAAc;AAClC,MAAM,gCAAgC,SAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
3
|
const defaultProps = {
|
|
4
|
-
wrapperStyles: {}
|
|
4
|
+
wrapperStyles: {},
|
|
5
|
+
innerRef: () => {
|
|
6
|
+
}
|
|
5
7
|
};
|
|
6
8
|
const DSMenuItemsSkeletonPropTypes = {
|
|
7
9
|
// each single menu-item is in charge of spreading the GlobalAttributesT & XstyledProps
|
|
@@ -12,7 +14,15 @@ const DSMenuItemsSkeletonPropTypes = {
|
|
|
12
14
|
'This is used as "id" in the DOM, you need this to be able to make this A11Y accessible.'
|
|
13
15
|
).isRequired,
|
|
14
16
|
isActive: PropTypes.bool.description("Whether the menu item is active."),
|
|
15
|
-
wrapperStyles: PropTypes.object.description("The styles to apply to the wrapper element, if any.")
|
|
17
|
+
wrapperStyles: PropTypes.object.description("The styles to apply to the wrapper element, if any."),
|
|
18
|
+
innerRef: PropTypes.oneOfType([
|
|
19
|
+
PropTypes.shape({
|
|
20
|
+
current: PropTypes.node
|
|
21
|
+
}),
|
|
22
|
+
PropTypes.func.description(
|
|
23
|
+
"A ref object or callback function to access the main underlying DOM element of the menu item."
|
|
24
|
+
)
|
|
25
|
+
]).defaultValue(`(() => {})`)
|
|
16
26
|
};
|
|
17
27
|
const DSMenuItemsSkeletonPropTypesSchema = DSMenuItemsSkeletonPropTypes;
|
|
18
28
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { type DSMenuItemsCommonsT } from '@elliemae/ds-menu-items-commons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSkeletonT {\n /** *****************************************************************************************\n ******************************** IMPORTANT DISCLAIMER *************************************\n *******************************************************************************************\n This component violates `common.RequiredProps` because\n - it does not have a 'render' prop\n - it does not have an 'original' prop\n - it does not have
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { type DSMenuItemsCommonsT } from '@elliemae/ds-menu-items-commons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSMenuItemsSkeletonT {\n /** *****************************************************************************************\n ******************************** IMPORTANT DISCLAIMER *************************************\n *******************************************************************************************\n This component violates `common.RequiredProps` because\n - it does not have a 'render' prop\n - it does not have an 'original' prop\n - it does not have any \"schema\" validator\n\n 'innerRef' was added (optional, defaulting to a no-op) so this item type can participate in a\n parent virtualized list's dynamic height measurement the same as every other menu item type.\n\n Legacy was not supporting global attributes but during the refactor I added them.\n It was not merging \"default\" props either, but I added them as well. (only for wrapperStyles)\n Those changes should be 100% backward compatible.\n \n I am reflecting what the code is actually doing instead of what we \"meant\" to do.\n ***************************************************************************************** */\n\n // sections can not be \"selected\" nor activated and for this reason we never had an hard requirement for the dsId\n // this may not scale well but to avoid breaking changes we are keeping it this way, if we ever need to add it we will do a V2\n\n // typescript inheritance has no syntax support for \"interfaces\", we have to use union types instead...\n export type RequiredProps = DSMenuItemsCommonsT.RequiredProps;\n\n export type DefaultProps = {\n wrapperStyles?: DSMenuItemsCommonsT.DefaultProps['wrapperStyles'];\n /**\n * A parent virtualized list needs to attach a ref to this item type's rendered root, same\n * as every other menu item type, so it can be included in dynamic height measurement.\n */\n innerRef?: DSMenuItemsCommonsT.DefaultProps['innerRef'];\n };\n\n export type OptionalProps = {\n isActive?: boolean;\n };\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSMenuItemsSkeletonT.DefaultProps = {\n wrapperStyles: {},\n innerRef: () => {},\n};\n\nexport const DSMenuItemsSkeletonPropTypes: DSPropTypesSchema<DSMenuItemsSkeletonT.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 ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n dsId: PropTypes.string.description(\n 'This is used as \"id\" in the DOM, you need this to be able to make this A11Y accessible.',\n ).isRequired,\n isActive: PropTypes.bool.description('Whether the menu item is active.'),\n wrapperStyles: PropTypes.object.description('The styles to apply to the wrapper element, if any.'),\n innerRef: PropTypes.oneOfType([\n PropTypes.shape({\n current: PropTypes.node,\n }),\n PropTypes.func.description(\n 'A ref object or callback function to access the main underlying DOM element of the menu item.',\n ),\n ]).defaultValue(`(() => {})`),\n};\n\nexport const DSMenuItemsSkeletonPropTypesSchema =\n DSMenuItemsSkeletonPropTypes as unknown as WeakValidationMap<DSMenuItemsSkeletonT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AA2DhE,MAAM,eAAkD;AAAA,EAC7D,eAAe,CAAC;AAAA,EAChB,UAAU,MAAM;AAAA,EAAC;AACnB;AAEO,MAAM,+BAAsF;AAAA;AAAA;AAAA,EAGjG,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,UAAU,OAAO;AAAA,IACrB;AAAA,EACF,EAAE;AAAA,EACF,UAAU,UAAU,KAAK,YAAY,kCAAkC;AAAA,EACvE,eAAe,UAAU,OAAO,YAAY,qDAAqD;AAAA,EACjG,UAAU,UAAU,UAAU;AAAA,IAC5B,UAAU,MAAM;AAAA,MACd,SAAS,UAAU;AAAA,IACrB,CAAC;AAAA,IACD,UAAU,KAAK;AAAA,MACb;AAAA,IACF;AAAA,EACF,CAAC,EAAE,aAAa,YAAY;AAC9B;AAEO,MAAM,qCACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,9 +8,11 @@ export declare namespace DSMenuItemsSkeletonT {
|
|
|
8
8
|
This component violates `common.RequiredProps` because
|
|
9
9
|
- it does not have a 'render' prop
|
|
10
10
|
- it does not have an 'original' prop
|
|
11
|
-
- it does not have an 'innerRef' prop
|
|
12
11
|
- it does not have any "schema" validator
|
|
13
12
|
|
|
13
|
+
'innerRef' was added (optional, defaulting to a no-op) so this item type can participate in a
|
|
14
|
+
parent virtualized list's dynamic height measurement the same as every other menu item type.
|
|
15
|
+
|
|
14
16
|
Legacy was not supporting global attributes but during the refactor I added them.
|
|
15
17
|
It was not merging "default" props either, but I added them as well. (only for wrapperStyles)
|
|
16
18
|
Those changes should be 100% backward compatible.
|
|
@@ -20,6 +22,11 @@ export declare namespace DSMenuItemsSkeletonT {
|
|
|
20
22
|
type RequiredProps = DSMenuItemsCommonsT.RequiredProps;
|
|
21
23
|
type DefaultProps = {
|
|
22
24
|
wrapperStyles?: DSMenuItemsCommonsT.DefaultProps['wrapperStyles'];
|
|
25
|
+
/**
|
|
26
|
+
* A parent virtualized list needs to attach a ref to this item type's rendered root, same
|
|
27
|
+
* as every other menu item type, so it can be included in dynamic height measurement.
|
|
28
|
+
*/
|
|
29
|
+
innerRef?: DSMenuItemsCommonsT.DefaultProps['innerRef'];
|
|
23
30
|
};
|
|
24
31
|
type OptionalProps = {
|
|
25
32
|
isActive?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-menu-items-skeleton",
|
|
3
|
-
"version": "3.80.0-next.
|
|
3
|
+
"version": "3.80.0-next.30",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Menu Items Skeleton",
|
|
6
6
|
"files": [
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"indent": 4
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-menu-items-commons": "3.80.0-next.
|
|
40
|
-
"@elliemae/ds-props-helpers": "3.80.0-next.
|
|
41
|
-
"@elliemae/ds-skeleton": "3.80.0-next.
|
|
39
|
+
"@elliemae/ds-menu-items-commons": "3.80.0-next.30",
|
|
40
|
+
"@elliemae/ds-props-helpers": "3.80.0-next.30",
|
|
41
|
+
"@elliemae/ds-skeleton": "3.80.0-next.30"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@elliemae/ds-monorepo-devops": "3.80.0-next.
|
|
45
|
-
"@elliemae/ds-test-utils": "3.80.0-next.
|
|
44
|
+
"@elliemae/ds-monorepo-devops": "3.80.0-next.30",
|
|
45
|
+
"@elliemae/ds-test-utils": "3.80.0-next.30",
|
|
46
46
|
"jest": "^30.0.0",
|
|
47
47
|
"lodash-es": "^4.18.1",
|
|
48
48
|
"styled-components": "~5.3.11"
|