@elliemae/ds-left-navigation 3.60.0-next.3 → 3.60.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/LeftNavigation.js +3 -3
- package/dist/cjs/LeftNavigation.js.map +2 -2
- package/dist/cjs/LeftNavigationContext.js +3 -19
- package/dist/cjs/LeftNavigationContext.js.map +2 -2
- package/dist/cjs/{configs → config}/index.js +5 -5
- package/dist/cjs/{configs → config}/index.js.map +2 -2
- package/dist/cjs/{configs → config}/useLeftNavConfig.js +4 -4
- package/dist/cjs/config/useLeftNavConfig.js.map +7 -0
- package/dist/cjs/{configs → config}/useLeftNavItems.js +4 -5
- package/dist/cjs/config/useLeftNavItems.js.map +7 -0
- package/dist/cjs/{configs → config}/useLeftNavSmoothExpand.js.map +1 -1
- package/dist/cjs/constants/{constants.js → index.js} +41 -2
- package/dist/cjs/constants/{constants.js.map → index.js.map} +3 -3
- package/dist/cjs/exported-related/ItemRenderer/index.js +12 -3
- package/dist/cjs/exported-related/ItemRenderer/index.js.map +3 -3
- package/dist/cjs/exported-related/ItemRenderer/styled.js +1 -1
- package/dist/cjs/exported-related/ItemRenderer/styled.js.map +1 -1
- package/dist/cjs/exported-related/Notifications/index.js +60 -42
- package/dist/cjs/exported-related/Notifications/index.js.map +3 -3
- package/dist/cjs/exported-related/index.js +16 -7
- package/dist/cjs/exported-related/index.js.map +2 -2
- package/dist/cjs/hooks/useKeyboardNavigation.js +1 -1
- package/dist/cjs/hooks/useKeyboardNavigation.js.map +1 -1
- package/dist/cjs/hooks/useSelectFirstBodyItem.js +1 -1
- package/dist/cjs/hooks/useSelectFirstBodyItem.js.map +2 -2
- package/dist/cjs/index.js +16 -4
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemControlledDrilldown/index.js +16 -5
- package/dist/cjs/outOfTheBox/ItemControlledDrilldown/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemHeader/index.js +20 -8
- package/dist/cjs/outOfTheBox/ItemHeader/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemLink/index.js +11 -2
- package/dist/cjs/outOfTheBox/ItemLink/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemSection/index.js +23 -4
- package/dist/cjs/outOfTheBox/ItemSection/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemSeparator/index.js +11 -3
- package/dist/cjs/outOfTheBox/ItemSeparator/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemSkeleton/index.js +11 -2
- package/dist/cjs/outOfTheBox/ItemSkeleton/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemSubmenu/index.js +17 -5
- package/dist/cjs/outOfTheBox/ItemSubmenu/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemTextLabel/index.js +7 -1
- package/dist/cjs/outOfTheBox/ItemTextLabel/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js +16 -5
- package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemWithDate/index.js +11 -1
- package/dist/cjs/outOfTheBox/ItemWithDate/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/index.js +6 -8
- package/dist/cjs/outOfTheBox/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/styled.js +1 -1
- package/dist/cjs/outOfTheBox/styled.js.map +1 -1
- package/dist/cjs/parts/LeftNavContent/index.js +24 -3
- package/dist/cjs/parts/LeftNavContent/index.js.map +2 -2
- package/dist/cjs/parts/LeftNavContent/styled.js +1 -1
- package/dist/cjs/parts/LeftNavContent/styled.js.map +1 -1
- package/dist/cjs/parts/LeftNavFooterItem/index.js +13 -13
- package/dist/cjs/parts/LeftNavFooterItem/index.js.map +3 -3
- package/dist/cjs/parts/LeftNavFooterItem/styled.js +1 -1
- package/dist/cjs/parts/LeftNavFooterItem/styled.js.map +1 -1
- package/dist/cjs/parts/LeftNavLoading/index.js +26 -10
- package/dist/cjs/parts/LeftNavLoading/index.js.map +3 -3
- package/dist/cjs/react-desc-prop-types.js +52 -22
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/slot-props.js +94 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-left-navigation-valid.js +1 -1
- package/dist/cjs/typescript-testing/typescript-left-navigation-valid.js.map +1 -1
- package/dist/esm/LeftNavigation.js +4 -4
- package/dist/esm/LeftNavigation.js.map +2 -2
- package/dist/esm/LeftNavigationContext.js +2 -18
- package/dist/esm/LeftNavigationContext.js.map +2 -2
- package/dist/esm/{configs → config}/index.js +2 -2
- package/dist/esm/{configs → config}/index.js.map +2 -2
- package/dist/esm/{configs → config}/useLeftNavConfig.js +3 -3
- package/dist/esm/config/useLeftNavConfig.js.map +7 -0
- package/dist/esm/{configs → config}/useLeftNavItems.js +1 -2
- package/dist/esm/config/useLeftNavItems.js.map +7 -0
- package/dist/esm/{configs → config}/useLeftNavSmoothExpand.js.map +1 -1
- package/dist/esm/constants/{constants.js → index.js} +41 -2
- package/dist/esm/constants/{constants.js.map → index.js.map} +3 -3
- package/dist/esm/exported-related/ItemRenderer/index.js +12 -3
- package/dist/esm/exported-related/ItemRenderer/index.js.map +3 -3
- package/dist/esm/exported-related/ItemRenderer/styled.js +1 -1
- package/dist/esm/exported-related/ItemRenderer/styled.js.map +1 -1
- package/dist/esm/exported-related/Notifications/index.js +60 -42
- package/dist/esm/exported-related/Notifications/index.js.map +3 -3
- package/dist/esm/exported-related/index.js +12 -6
- package/dist/esm/exported-related/index.js.map +2 -2
- package/dist/esm/hooks/useKeyboardNavigation.js +1 -1
- package/dist/esm/hooks/useKeyboardNavigation.js.map +1 -1
- package/dist/esm/hooks/useSelectFirstBodyItem.js +1 -1
- package/dist/esm/hooks/useSelectFirstBodyItem.js.map +2 -2
- package/dist/esm/index.js +31 -7
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemControlledDrilldown/index.js +14 -3
- package/dist/esm/outOfTheBox/ItemControlledDrilldown/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemHeader/index.js +18 -6
- package/dist/esm/outOfTheBox/ItemHeader/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemLink/index.js +11 -2
- package/dist/esm/outOfTheBox/ItemLink/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemSection/index.js +27 -8
- package/dist/esm/outOfTheBox/ItemSection/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemSeparator/index.js +11 -3
- package/dist/esm/outOfTheBox/ItemSeparator/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemSkeleton/index.js +11 -2
- package/dist/esm/outOfTheBox/ItemSkeleton/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemSubmenu/index.js +16 -4
- package/dist/esm/outOfTheBox/ItemSubmenu/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemTextLabel/index.js +7 -1
- package/dist/esm/outOfTheBox/ItemTextLabel/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js +14 -3
- package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemWithDate/index.js +11 -1
- package/dist/esm/outOfTheBox/ItemWithDate/index.js.map +3 -3
- package/dist/esm/outOfTheBox/index.js +5 -7
- package/dist/esm/outOfTheBox/index.js.map +2 -2
- package/dist/esm/outOfTheBox/styled.js +1 -1
- package/dist/esm/outOfTheBox/styled.js.map +1 -1
- package/dist/esm/parts/LeftNavContent/index.js +24 -3
- package/dist/esm/parts/LeftNavContent/index.js.map +2 -2
- package/dist/esm/parts/LeftNavContent/styled.js +1 -1
- package/dist/esm/parts/LeftNavContent/styled.js.map +1 -1
- package/dist/esm/parts/LeftNavFooterItem/index.js +11 -11
- package/dist/esm/parts/LeftNavFooterItem/index.js.map +2 -2
- package/dist/esm/parts/LeftNavFooterItem/styled.js +1 -1
- package/dist/esm/parts/LeftNavFooterItem/styled.js.map +1 -1
- package/dist/esm/parts/LeftNavLoading/index.js +26 -10
- package/dist/esm/parts/LeftNavLoading/index.js.map +3 -3
- package/dist/esm/react-desc-prop-types.js +59 -23
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +71 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-left-navigation-valid.js +1 -1
- package/dist/esm/typescript-testing/typescript-left-navigation-valid.js.map +1 -1
- package/dist/types/LeftNavigationContext.d.ts +1 -2
- package/dist/types/constants/{constants.d.ts → index.d.ts} +32 -0
- package/dist/types/exported-related/index.d.ts +5 -6
- package/dist/types/index.d.ts +3 -3
- package/dist/types/outOfTheBox/ItemSkeleton/index.d.ts +1 -1
- package/dist/types/outOfTheBox/index.d.ts +1 -2
- package/dist/types/react-desc-prop-types.d.ts +47 -13
- package/dist/types/tests/LeftNavigation.exports.test.d.ts +1 -0
- package/dist/types/typescript-testing/slot-props.d.ts +1 -0
- package/package.json +27 -29
- package/dist/cjs/configs/useLeftNavConfig.js.map +0 -7
- package/dist/cjs/configs/useLeftNavItems.js.map +0 -7
- package/dist/cjs/exported-related/constants.js +0 -71
- package/dist/cjs/exported-related/constants.js.map +0 -7
- package/dist/esm/configs/useLeftNavConfig.js.map +0 -7
- package/dist/esm/configs/useLeftNavItems.js.map +0 -7
- package/dist/esm/exported-related/constants.js +0 -41
- package/dist/esm/exported-related/constants.js.map +0 -7
- package/dist/types/exported-related/constants.d.ts +0 -31
- /package/dist/cjs/{configs → config}/useLeftNavSmoothExpand.js +0 -0
- /package/dist/esm/{configs → config}/useLeftNavSmoothExpand.js +0 -0
- /package/dist/types/{configs → config}/index.d.ts +0 -0
- /package/dist/types/{configs → config}/useLeftNavConfig.d.ts +0 -0
- /package/dist/types/{configs → config}/useLeftNavItems.d.ts +0 -0
- /package/dist/types/{configs → config}/useLeftNavSmoothExpand.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/ItemControlledDrilldown/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport React, { useMemo } from 'react';\nimport { LEFT_NAVIGATION_DATA_TESTID } from '../../constants/
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC+BZ,
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport React, { useMemo } from 'react';\nimport { ITEM_TYPES, LEFT_NAVIGATION_DATA_TESTID } from '../../constants/index.js';\nimport { ItemRenderer } from '../../exported-related/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\nimport { ItemSeparator } from '../ItemSeparator/index.js';\nimport { ItemTextLabel } from '../ItemTextLabel/index.js';\nimport { ItemWithDate } from '../ItemWithDate/index.js';\nimport { StyledArrowContainer, StyledDate, StyledLabel, StyledRightContainer } from '../styled.js';\n\nconst outOfTheBoxSubitemsComponents: Record<string, React.ComponentType<DSLeftNavigationT.ComponentProps>> = {\n [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR]: ItemSeparator,\n [ITEM_TYPES.LEFT_NAV_ITEM_WITH_DATE]: ItemWithDate,\n [ITEM_TYPES.LEFT_NAV_ITEM_TEXT_LABEL]: ItemTextLabel,\n};\n\nconst OutOfTheBoxMapSubitem: React.ComponentType<DSLeftNavigationT.ComponentProps> = (props) => {\n const {\n item,\n item: { type, Component },\n ctx,\n } = props;\n\n if (typeof type === 'string' && !!outOfTheBoxSubitemsComponents[type]) {\n const OutOfTheBoxComponent = outOfTheBoxSubitemsComponents[type];\n const currentIndent = item.itemOpts?.indent ?? 0;\n const newItem = {\n ...item,\n itemOpts: { ...item.itemOpts, indent: currentIndent + 44 },\n };\n return <OutOfTheBoxComponent item={newItem} ctx={ctx} />;\n }\n if (!Component) return null;\n // we expect an error to be threw if Component is not defined and type is not a valid out-of-the-box...\n return <Component item={item} ctx={ctx} />;\n};\n\nexport const ItemControlledDrilldown = (props: DSLeftNavigationT.ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n itemOpts: {\n label,\n RightComponent,\n labelRightSection,\n labelOverflow: itemLabelOverflow,\n labelBold,\n labelColor,\n isOpened,\n items,\n },\n },\n ctx,\n ctx: {\n leftNavProps,\n leftNavProps: { labelOverflow: leftNavLabelOverflow },\n },\n } = props;\n const getOwnerProps = React.useCallback(() => leftNavProps, [leftNavProps]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const arrowIcon = useMemo(() => {\n const Component = isOpened ? ArrowheadDown : ArrowheadRight;\n return <Component width=\"24px\" height=\"18px\" color={['brand-primary', '800']} />;\n }, [isOpened]);\n\n const subitems = useMemo(() => {\n if (!isOpened || !items) return [];\n return items.map((subitem) => <OutOfTheBoxMapSubitem item={subitem} ctx={ctx} key={subitem.dsId} />);\n }, [isOpened, items, ctx]);\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaExpanded: isOpened,\n ariaRole: 'menuitem',\n ...item.itemOpts,\n openable: !isOpened,\n closable: isOpened,\n },\n CollapsedComponent: null,\n }}\n subitems={subitems}\n minHeight=\"32px\"\n paddingTop=\"8px\"\n >\n <StyledArrowContainer\n pl=\"xxs\"\n mt=\"-2px\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.ARROW_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {arrowIcon}\n </StyledArrowContainer>\n <StyledLabel\n pb=\"xxxs\"\n labelOverflow={labelOverflow}\n labelBold={labelBold}\n labelColor={labelColor}\n data-testid={LEFT_NAVIGATION_DATA_TESTID.LIST_ITEM_LABEL_ID_EXCEPTION}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {labelOverflow === 'truncate' ? <SimpleTruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledLabel>\n <StyledRightContainer\n pr=\"xxs2\"\n cols={['auto', 'auto']}\n alignItems=\"center\"\n gutter=\"xxs\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.RIGHT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledDate\n ml=\"xxs\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.ITEM_DATE} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {labelRightSection}\n </StyledDate>\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </StyledRightContainer>\n </ItemRenderer>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC+BZ,cAgFL,YAhFK;AA/BX,SAAS,eAAe,sBAAsB;AAC9C,SAAS,kCAAkC;AAC3C,OAAOA,UAAS,eAAe;AAC/B,SAAS,YAAY,mCAAmC;AACxD,SAAS,oBAAoB;AAE7B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB,YAAY,aAAa,4BAA4B;AAEpF,MAAM,gCAAuG;AAAA,EAC3G,CAAC,WAAW,uBAAuB,GAAG;AAAA,EACtC,CAAC,WAAW,uBAAuB,GAAG;AAAA,EACtC,CAAC,WAAW,wBAAwB,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
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback } from "react";
|
|
4
3
|
import { ChevronSmallLeft } from "@elliemae/ds-icons";
|
|
5
4
|
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
5
|
+
import React2, { useCallback } from "react";
|
|
6
|
+
import { CHEVRON_BACK_DS_ID, LEFT_NAVIGATION_DATA_TESTID } from "../../constants/index.js";
|
|
6
7
|
import { ItemRenderer } from "../../exported-related/index.js";
|
|
7
8
|
import {
|
|
8
|
-
StyledItemLabel,
|
|
9
9
|
StyledBottomContainer,
|
|
10
|
+
StyledChevronLeft,
|
|
11
|
+
StyledItemLabel,
|
|
10
12
|
StyledLeftContainer,
|
|
11
|
-
StyledRightContainer
|
|
12
|
-
StyledChevronLeft
|
|
13
|
+
StyledRightContainer
|
|
13
14
|
} from "../styled.js";
|
|
14
|
-
import { CHEVRON_BACK_DS_ID } from "../../exported-related/constants.js";
|
|
15
|
-
import { LEFT_NAVIGATION_DATA_TESTID } from "../../constants/constants.js";
|
|
16
15
|
const notOpenedShadowStyle = (isSelected) => (theme) => `
|
|
17
16
|
box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : "transparent"};
|
|
18
17
|
|
|
@@ -34,6 +33,7 @@ const ItemHeader = (props) => {
|
|
|
34
33
|
},
|
|
35
34
|
ctx,
|
|
36
35
|
ctx: {
|
|
36
|
+
leftNavProps,
|
|
37
37
|
leftNavProps: { openedItem, labelOverflow: leftNavLabelOverflow, onItemClick },
|
|
38
38
|
expandedForAnimation,
|
|
39
39
|
setFocusedItem,
|
|
@@ -41,6 +41,8 @@ const ItemHeader = (props) => {
|
|
|
41
41
|
selectedParent
|
|
42
42
|
}
|
|
43
43
|
} = props;
|
|
44
|
+
const getOwnerProps = React2.useCallback(() => leftNavProps, [leftNavProps]);
|
|
45
|
+
const getOwnerPropsArguments = React2.useCallback(() => ({}), []);
|
|
44
46
|
const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;
|
|
45
47
|
const opened = openedItem === dsId;
|
|
46
48
|
const ariaLabel = item.itemOpts.ariaLabel ?? (typeof label === "string" ? `${label}, category` : "category");
|
|
@@ -75,6 +77,8 @@ const ItemHeader = (props) => {
|
|
|
75
77
|
pl: opened ? "xxs" : 0,
|
|
76
78
|
justifyItems: "center",
|
|
77
79
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.LEFT_CONTAINER,
|
|
80
|
+
getOwnerProps,
|
|
81
|
+
getOwnerPropsArguments,
|
|
78
82
|
children: [
|
|
79
83
|
opened && /* @__PURE__ */ jsx(
|
|
80
84
|
StyledChevronLeft,
|
|
@@ -89,6 +93,8 @@ const ItemHeader = (props) => {
|
|
|
89
93
|
},
|
|
90
94
|
"aria-label": `Close ${ariaLabel}`,
|
|
91
95
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.ITEM_CHEVRON_BACK,
|
|
96
|
+
getOwnerProps,
|
|
97
|
+
getOwnerPropsArguments,
|
|
92
98
|
children: /* @__PURE__ */ jsx(ChevronSmallLeft, { size: "m", color: ["brand-primary", "800"] })
|
|
93
99
|
}
|
|
94
100
|
),
|
|
@@ -104,6 +110,8 @@ const ItemHeader = (props) => {
|
|
|
104
110
|
mb: "15px",
|
|
105
111
|
labelOverflow,
|
|
106
112
|
"data-testid": labelDataTestId || LEFT_NAVIGATION_DATA_TESTID.ITEM_LABEL,
|
|
113
|
+
getOwnerProps,
|
|
114
|
+
getOwnerPropsArguments,
|
|
107
115
|
children: labelOverflow === "truncate" ? /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: label, placement: "bottom-start" }) : label
|
|
108
116
|
}
|
|
109
117
|
),
|
|
@@ -118,6 +126,8 @@ const ItemHeader = (props) => {
|
|
|
118
126
|
},
|
|
119
127
|
onKeyDown: (e) => e.stopPropagation(),
|
|
120
128
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.RIGHT_CONTAINER,
|
|
129
|
+
getOwnerProps,
|
|
130
|
+
getOwnerPropsArguments,
|
|
121
131
|
children: RightComponent && /* @__PURE__ */ jsx(RightComponent, { ctx, item })
|
|
122
132
|
}
|
|
123
133
|
),
|
|
@@ -133,6 +143,8 @@ const ItemHeader = (props) => {
|
|
|
133
143
|
},
|
|
134
144
|
onKeyDown: (e) => e.stopPropagation(),
|
|
135
145
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.BOTTOM_CONTAINER,
|
|
146
|
+
getOwnerProps,
|
|
147
|
+
getOwnerPropsArguments,
|
|
136
148
|
children: /* @__PURE__ */ jsx(BottomComponent, { ctx, item })
|
|
137
149
|
}
|
|
138
150
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/ItemHeader/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { ChevronSmallLeft } from '@elliemae/ds-icons';\nimport type { Theme } from '@elliemae/ds-system';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport React, { useCallback } from 'react';\nimport { CHEVRON_BACK_DS_ID, LEFT_NAVIGATION_DATA_TESTID } from '../../constants/index.js';\nimport { ItemRenderer } from '../../exported-related/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\nimport {\n StyledBottomContainer,\n StyledChevronLeft,\n StyledItemLabel,\n StyledLeftContainer,\n StyledRightContainer,\n} from '../styled.js';\n\nconst notOpenedShadowStyle = (isSelected: boolean) => (theme: Theme) =>\n `\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : 'transparent'};\n\n :hover {\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : theme.colors.brand[300]};\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};\n }\n`;\n\nexport const ItemHeader = (props: DSLeftNavigationT.ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: { label, RightComponent, BottomComponent, labelDataTestId, labelOverflow: itemLabelOverflow },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps,\n leftNavProps: { openedItem, labelOverflow: leftNavLabelOverflow, onItemClick },\n expandedForAnimation,\n setFocusedItem,\n selectedItem,\n selectedParent,\n },\n } = props;\n\n const getOwnerProps = React.useCallback(() => leftNavProps, [leftNavProps]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const opened = openedItem === dsId;\n\n const ariaLabel = item.itemOpts.ariaLabel ?? (typeof label === 'string' ? `${label}, category` : 'category');\n\n const isSelected = selectedItem === dsId || selectedParent === dsId;\n\n const shadowStyle = useCallback(\n (opened_: boolean) => (theme: Theme) =>\n !opened_ ? notOpenedShadowStyle(isSelected)(theme) : `box-shadow: inset 4px 0 0 0 #52A6EC`,\n [isSelected],\n );\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaLabel,\n ariaExpanded: opened,\n ...item.itemOpts,\n openable: expandedForAnimation && !opened,\n closable: expandedForAnimation && opened,\n selectable: !opened,\n },\n }}\n hasBorderBottom\n borderBottomMr={opened ? '12px' : '0px'}\n shadowStyle={shadowStyle}\n >\n <StyledLeftContainer\n cols={opened ? ['auto', 'auto'] : ['38px']}\n gutter=\"1px\"\n pl={opened ? 'xxs' : 0}\n justifyItems=\"center\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.LEFT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {opened && (\n <StyledChevronLeft\n buttonType=\"raw\"\n onClick={(e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => {\n if (onItemClick) onItemClick(item, e as React.MouseEvent<HTMLElement>);\n }}\n onFocus={(e: React.FocusEvent) => {\n e.stopPropagation();\n setFocusedItem(CHEVRON_BACK_DS_ID);\n }}\n aria-label={`Close ${ariaLabel}`}\n data-testid={LEFT_NAVIGATION_DATA_TESTID.ITEM_CHEVRON_BACK} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <ChevronSmallLeft size=\"m\" color={['brand-primary', '800']} />\n </StyledChevronLeft>\n )}\n {CollapsedComponent && <CollapsedComponent item={item} ctx={ctx} />}\n </StyledLeftContainer>\n <StyledItemLabel\n ml={opened ? 'xxs' : '1px'}\n mt=\"xxxs\"\n mb=\"15px\"\n labelOverflow={labelOverflow}\n data-testid={labelDataTestId || LEFT_NAVIGATION_DATA_TESTID.ITEM_LABEL}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {labelOverflow === 'truncate' ? <SimpleTruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledItemLabel>\n <StyledRightContainer\n pl=\"xs\"\n pr={opened ? 'xxs2' : 'xxs'}\n onFocus={(e: React.FocusEvent) => {\n setFocusedItem(null);\n e.stopPropagation();\n }}\n onKeyDown={(e: React.KeyboardEvent) => e.stopPropagation()}\n data-testid={LEFT_NAVIGATION_DATA_TESTID.RIGHT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </StyledRightContainer>\n {BottomComponent && (\n <StyledBottomContainer\n pb=\"xxxs\"\n pl=\"xxs\"\n pr=\"xxs\"\n onFocus={(e: React.FocusEvent) => {\n setFocusedItem(null);\n e.stopPropagation();\n }}\n onKeyDown={(e: React.KeyboardEvent) => e.stopPropagation()}\n data-testid={LEFT_NAVIGATION_DATA_TESTID.BOTTOM_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <BottomComponent ctx={ctx} item={item} />\n </StyledBottomContainer>\n )}\n </ItemRenderer>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACoFjB,SAwBM,KAxBN;AAhFN,SAAS,wBAAwB;AAEjC,SAAS,kCAAkC;AAC3C,OAAOA,UAAS,mBAAmB;AACnC,SAAS,oBAAoB,mCAAmC;AAChE,SAAS,oBAAoB;AAE7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,uBAAuB,CAAC,eAAwB,CAAC,UACrD;AAAA,gCAC8B,aAAa,MAAM,OAAO,MAAM,GAAG,IAAI,aAAa;AAAA;AAAA;AAAA,kCAGlD,aAAa,MAAM,OAAO,MAAM,GAAG,IAAI,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA,kCAI9D,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAIlD,MAAM,aAAa,CAAC,UAAyD;AAClF,QAAM;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ;AAAA,MACA,UAAU,EAAE,OAAO,gBAAgB,iBAAiB,iBAAiB,eAAe,kBAAkB;AAAA,MACtG,qBAAqB,MAAM;AAAA,IAC7B;AAAA,IACA;AAAA,IACA,KAAK;AAAA,MACH;AAAA,MACA,cAAc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
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback } from "react";
|
|
4
3
|
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
4
|
+
import React2, { useCallback } from "react";
|
|
5
|
+
import { LEFT_NAVIGATION_DATA_TESTID } from "../../constants/index.js";
|
|
5
6
|
import { ItemRenderer } from "../../exported-related/index.js";
|
|
6
7
|
import { StyledItemLabel, StyledLeftContainer, StyledRightContainer } from "../styled.js";
|
|
7
|
-
import { LEFT_NAVIGATION_DATA_TESTID } from "../../constants/constants.js";
|
|
8
8
|
const notOpenedShadowStyle = (isSelected) => (theme) => `
|
|
9
9
|
box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : "transparent"};
|
|
10
10
|
|
|
@@ -26,11 +26,14 @@ const ItemLink = (props) => {
|
|
|
26
26
|
},
|
|
27
27
|
ctx,
|
|
28
28
|
ctx: {
|
|
29
|
+
leftNavProps,
|
|
29
30
|
leftNavProps: { labelOverflow: leftNavLabelOverflow },
|
|
30
31
|
selectedItem,
|
|
31
32
|
selectedParent
|
|
32
33
|
}
|
|
33
34
|
} = props;
|
|
35
|
+
const getOwnerProps = React2.useCallback(() => leftNavProps, [leftNavProps]);
|
|
36
|
+
const getOwnerPropsArguments = React2.useCallback(() => ({}), []);
|
|
34
37
|
const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;
|
|
35
38
|
const isSelected = selectedItem === dsId || selectedParent === dsId;
|
|
36
39
|
const shadowStyle = useCallback(
|
|
@@ -57,6 +60,8 @@ const ItemLink = (props) => {
|
|
|
57
60
|
gutter: "1px",
|
|
58
61
|
justifyItems: "center",
|
|
59
62
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.LEFT_CONTAINER,
|
|
63
|
+
getOwnerProps,
|
|
64
|
+
getOwnerPropsArguments,
|
|
60
65
|
children: CollapsedComponent && /* @__PURE__ */ jsx(CollapsedComponent, { item, ctx })
|
|
61
66
|
}
|
|
62
67
|
),
|
|
@@ -68,6 +73,8 @@ const ItemLink = (props) => {
|
|
|
68
73
|
mb: "15px",
|
|
69
74
|
labelOverflow,
|
|
70
75
|
"data-testid": labelDataTestId || LEFT_NAVIGATION_DATA_TESTID.ITEM_LABEL,
|
|
76
|
+
getOwnerProps,
|
|
77
|
+
getOwnerPropsArguments,
|
|
71
78
|
children: labelOverflow === "truncate" ? /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: label, placement: "bottom-start" }) : label
|
|
72
79
|
}
|
|
73
80
|
),
|
|
@@ -77,6 +84,8 @@ const ItemLink = (props) => {
|
|
|
77
84
|
mt: "xxxs",
|
|
78
85
|
pr: "xxs2",
|
|
79
86
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.RIGHT_CONTAINER,
|
|
87
|
+
getOwnerProps,
|
|
88
|
+
getOwnerPropsArguments,
|
|
80
89
|
children: RightComponent && /* @__PURE__ */ jsx(RightComponent, { ctx, item })
|
|
81
90
|
}
|
|
82
91
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/ItemLink/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport type { Theme } from '@elliemae/ds-system';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport React, { useCallback } from 'react';\nimport { LEFT_NAVIGATION_DATA_TESTID } from '../../constants/index.js';\nimport { ItemRenderer } from '../../exported-related/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\nimport { StyledItemLabel, StyledLeftContainer, StyledRightContainer } from '../styled.js';\n\nconst notOpenedShadowStyle = (isSelected: boolean) => (theme: Theme) =>\n `\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : 'transparent'};\n\n :hover {\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : theme.colors.brand[300]};\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};\n }\n`;\n\nexport const ItemLink = (props: DSLeftNavigationT.ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: { label, RightComponent, labelDataTestId, labelOverflow: itemLabelOverflow },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps,\n leftNavProps: { labelOverflow: leftNavLabelOverflow },\n selectedItem,\n selectedParent,\n },\n } = props;\n\n const getOwnerProps = React.useCallback(() => leftNavProps, [leftNavProps]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const isSelected = selectedItem === dsId || selectedParent === dsId;\n\n const shadowStyle = useCallback(\n (opened_: boolean) => (theme: Theme) =>\n !opened_ ? notOpenedShadowStyle(isSelected)(theme) : `box-shadow: inset 4px 0 0 0 #52A6EC`,\n [isSelected],\n );\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaLabel: typeof label === 'string' ? label : '',\n ...item.itemOpts,\n selectable: true,\n },\n }}\n shadowStyle={shadowStyle}\n >\n <StyledLeftContainer\n cols={['38px']}\n gutter=\"1px\"\n justifyItems=\"center\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.LEFT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {CollapsedComponent && <CollapsedComponent item={item} ctx={ctx} />}\n </StyledLeftContainer>\n <StyledItemLabel\n ml=\"1px\"\n mt=\"xxxs\"\n mb=\"15px\"\n labelOverflow={labelOverflow}\n data-testid={labelDataTestId || LEFT_NAVIGATION_DATA_TESTID.ITEM_LABEL}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {labelOverflow === 'truncate' ? <SimpleTruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledItemLabel>\n <StyledRightContainer\n mt=\"xxxs\"\n pr=\"xxs2\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.RIGHT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </StyledRightContainer>\n </ItemRenderer>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACoDnB,SAmB2B,KAnB3B;AAlDJ,SAAS,kCAAkC;AAC3C,OAAOA,UAAS,mBAAmB;AACnC,SAAS,mCAAmC;AAC5C,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB,qBAAqB,4BAA4B;AAE3E,MAAM,uBAAuB,CAAC,eAAwB,CAAC,UACrD;AAAA,gCAC8B,aAAa,MAAM,OAAO,MAAM,GAAG,IAAI,aAAa;AAAA;AAAA;AAAA,kCAGlD,aAAa,MAAM,OAAO,MAAM,GAAG,IAAI,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA,kCAI9D,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAIlD,MAAM,WAAW,CAAC,UAAyD;AAChF,QAAM;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ;AAAA,MACA,UAAU,EAAE,OAAO,gBAAgB,iBAAiB,eAAe,kBAAkB;AAAA,MACrF,qBAAqB,MAAM;AAAA,IAC7B;AAAA,IACA;AAAA,IACA,KAAK;AAAA,MACH;AAAA,MACA,cAAc,EAAE,eAAe,qBAAqB;AAAA,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F;AAEJ;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React2 from "react";
|
|
4
|
+
import { LEFT_NAVIGATION_DATA_TESTID } from "../../constants/index.js";
|
|
3
5
|
import { ItemRenderer } from "../../exported-related/index.js";
|
|
4
6
|
import {
|
|
5
|
-
StyledSectionLabel,
|
|
6
|
-
StyledRightLabel,
|
|
7
|
-
StyledVerticalSeparator,
|
|
8
7
|
StyledRightContainer,
|
|
9
|
-
|
|
8
|
+
StyledRightLabel,
|
|
9
|
+
StyledSectionContainer,
|
|
10
|
+
StyledSectionLabel,
|
|
11
|
+
StyledVerticalSeparator
|
|
10
12
|
} from "../styled.js";
|
|
11
|
-
import { LEFT_NAVIGATION_DATA_TESTID } from "../../constants/constants.js";
|
|
12
13
|
const ItemSection = (props) => {
|
|
13
14
|
const {
|
|
14
15
|
item,
|
|
@@ -16,8 +17,10 @@ const ItemSection = (props) => {
|
|
|
16
17
|
itemOpts: { label, LeftComponent, RightComponent, labelRightSection, labelDataTestId }
|
|
17
18
|
},
|
|
18
19
|
ctx,
|
|
19
|
-
ctx: { setFocusedItem }
|
|
20
|
+
ctx: { leftNavProps, setFocusedItem }
|
|
20
21
|
} = props;
|
|
22
|
+
const getOwnerProps = React2.useCallback(() => leftNavProps, [leftNavProps]);
|
|
23
|
+
const getOwnerPropsArguments = React2.useCallback(() => ({}), []);
|
|
21
24
|
return /* @__PURE__ */ jsxs(
|
|
22
25
|
ItemRenderer,
|
|
23
26
|
{
|
|
@@ -36,19 +39,33 @@ const ItemSection = (props) => {
|
|
|
36
39
|
pl: "xxs",
|
|
37
40
|
alignItems: "center",
|
|
38
41
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.SECTION_CONTAINER,
|
|
42
|
+
getOwnerProps,
|
|
43
|
+
getOwnerPropsArguments,
|
|
39
44
|
children: [
|
|
40
45
|
LeftComponent ? /* @__PURE__ */ jsx(LeftComponent, { ctx, item }) : /* @__PURE__ */ jsx("div", {}),
|
|
41
|
-
/* @__PURE__ */ jsx(
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
StyledSectionLabel,
|
|
48
|
+
{
|
|
49
|
+
"data-testid": labelDataTestId || LEFT_NAVIGATION_DATA_TESTID.SECTION_LABEL,
|
|
50
|
+
getOwnerProps,
|
|
51
|
+
getOwnerPropsArguments,
|
|
52
|
+
children: label
|
|
53
|
+
}
|
|
54
|
+
),
|
|
42
55
|
/* @__PURE__ */ jsx(
|
|
43
56
|
StyledVerticalSeparator,
|
|
44
57
|
{
|
|
45
|
-
"data-testid": LEFT_NAVIGATION_DATA_TESTID.VERTICAL_SEPARATOR
|
|
58
|
+
"data-testid": LEFT_NAVIGATION_DATA_TESTID.VERTICAL_SEPARATOR,
|
|
59
|
+
getOwnerProps,
|
|
60
|
+
getOwnerPropsArguments
|
|
46
61
|
}
|
|
47
62
|
),
|
|
48
63
|
/* @__PURE__ */ jsx(
|
|
49
64
|
StyledRightLabel,
|
|
50
65
|
{
|
|
51
66
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.SECTION_RIGHT_LABEL,
|
|
67
|
+
getOwnerProps,
|
|
68
|
+
getOwnerPropsArguments,
|
|
52
69
|
children: labelRightSection
|
|
53
70
|
}
|
|
54
71
|
)
|
|
@@ -67,6 +84,8 @@ const ItemSection = (props) => {
|
|
|
67
84
|
pr: "xxs2",
|
|
68
85
|
alignItems: "center",
|
|
69
86
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.RIGHT_CONTAINER,
|
|
87
|
+
getOwnerProps,
|
|
88
|
+
getOwnerPropsArguments,
|
|
70
89
|
children: RightComponent && /* @__PURE__ */ jsx(RightComponent, { ctx, item })
|
|
71
90
|
}
|
|
72
91
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/ItemSection/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ItemRenderer } from '../../exported-related/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\nimport {\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { LEFT_NAVIGATION_DATA_TESTID } from '../../constants/index.js';\nimport { ItemRenderer } from '../../exported-related/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\nimport {\n StyledRightContainer,\n StyledRightLabel,\n StyledSectionContainer,\n StyledSectionLabel,\n StyledVerticalSeparator,\n} from '../styled.js';\n\nexport const ItemSection = (props: DSLeftNavigationT.ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n itemOpts: { label, LeftComponent, RightComponent, labelRightSection, labelDataTestId },\n },\n ctx,\n ctx: { leftNavProps, setFocusedItem },\n } = props;\n\n const getOwnerProps = React.useCallback(() => leftNavProps, [leftNavProps]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: { ...item.itemOpts, selectable: false, focuseable: false },\n CollapsedComponent: null,\n }}\n minHeight=\"32px\"\n paddingTop=\"8px\"\n >\n <StyledSectionContainer\n cols={['min-content', 'auto', 'min-content', 'auto']}\n pl=\"xxs\"\n alignItems=\"center\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.SECTION_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {LeftComponent ? <LeftComponent ctx={ctx} item={item} /> : <div />}\n <StyledSectionLabel\n data-testid={labelDataTestId || LEFT_NAVIGATION_DATA_TESTID.SECTION_LABEL}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledSectionLabel>\n <StyledVerticalSeparator\n data-testid={LEFT_NAVIGATION_DATA_TESTID.VERTICAL_SEPARATOR} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n <StyledRightLabel\n data-testid={LEFT_NAVIGATION_DATA_TESTID.SECTION_RIGHT_LABEL} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {labelRightSection}\n </StyledRightLabel>\n </StyledSectionContainer>\n <StyledRightContainer\n ml=\"auto\"\n onFocus={(e: React.FocusEvent) => {\n setFocusedItem(null);\n e.stopPropagation();\n }}\n onKeyDown={(e: React.KeyboardEvent) => e.stopPropagation()}\n pr=\"xxs2\"\n alignItems=\"center\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.RIGHT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </StyledRightContainer>\n </ItemRenderer>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkCjB,SAQmB,KARnB;AAlCN,OAAOA,YAAW;AAClB,SAAS,mCAAmC;AAC5C,SAAS,oBAAoB;AAE7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,cAAc,CAAC,UAAyD;AACnF,QAAM;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ,UAAU,EAAE,OAAO,eAAe,gBAAgB,mBAAmB,gBAAgB;AAAA,IACvF;AAAA,IACA;AAAA,IACA,KAAK,EAAE,cAAc,eAAe;AAAA,EACtC,IAAI;AAEJ,QAAM,gBAAgBA,OAAM,YAAY,MAAM,cAAc,CAAC,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
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import React2 from "react";
|
|
3
4
|
import { styled } from "@elliemae/ds-system";
|
|
5
|
+
import { DSLeftNavigationName, LEFT_NAVIGATION_DATA_TESTID, LEFT_NAVIGATION_SLOTS } from "../../constants/index.js";
|
|
4
6
|
import { ItemRenderer } from "../../exported-related/index.js";
|
|
5
|
-
import { DSLeftNavigationName, LEFT_NAVIGATION_SLOTS, LEFT_NAVIGATION_DATA_TESTID } from "../../constants/constants.js";
|
|
6
7
|
const StyledSeparator = styled("div", { name: DSLeftNavigationName, slot: LEFT_NAVIGATION_SLOTS.ITEM_SEPARATOR })`
|
|
7
8
|
height: 1px;
|
|
8
9
|
background-color: ${(props) => props.theme.colors.neutral[100]};
|
|
@@ -12,7 +13,12 @@ const StyledSeparator = styled("div", { name: DSLeftNavigationName, slot: LEFT_N
|
|
|
12
13
|
grid-column: span 3;
|
|
13
14
|
`;
|
|
14
15
|
const ItemSeparator = (props) => {
|
|
15
|
-
const {
|
|
16
|
+
const {
|
|
17
|
+
item,
|
|
18
|
+
ctx: { leftNavProps }
|
|
19
|
+
} = props;
|
|
20
|
+
const getOwnerProps = React2.useCallback(() => leftNavProps, [leftNavProps]);
|
|
21
|
+
const getOwnerPropsArguments = React2.useCallback(() => ({}), []);
|
|
16
22
|
return /* @__PURE__ */ jsx(
|
|
17
23
|
ItemRenderer,
|
|
18
24
|
{
|
|
@@ -31,7 +37,9 @@ const ItemSeparator = (props) => {
|
|
|
31
37
|
children: /* @__PURE__ */ jsx(
|
|
32
38
|
StyledSeparator,
|
|
33
39
|
{
|
|
34
|
-
"data-testid": LEFT_NAVIGATION_DATA_TESTID.ITEM_SEPARATOR
|
|
40
|
+
"data-testid": LEFT_NAVIGATION_DATA_TESTID.ITEM_SEPARATOR,
|
|
41
|
+
getOwnerProps,
|
|
42
|
+
getOwnerPropsArguments
|
|
35
43
|
}
|
|
36
44
|
)
|
|
37
45
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/ItemSeparator/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSLeftNavigationName, LEFT_NAVIGATION_DATA_TESTID, LEFT_NAVIGATION_SLOTS } from '../../constants/index.js';\nimport { ItemRenderer } from '../../exported-related/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\n\nconst StyledSeparator = styled('div', { name: DSLeftNavigationName, slot: LEFT_NAVIGATION_SLOTS.ITEM_SEPARATOR })`\n height: 1px;\n background-color: ${(props) => props.theme.colors.neutral[100]};\n width: auto;\n margin: ${(props) => props.theme.space.xxxs} 0;\n margin-left: ${(props) => props.theme.space.xxxs};\n grid-column: span 3;\n`;\n\nexport const ItemSeparator = (props: DSLeftNavigationT.ComponentProps): JSX.Element => {\n const {\n item,\n ctx: { leftNavProps },\n } = props;\n const getOwnerProps = React.useCallback(() => leftNavProps, [leftNavProps]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ...item.itemOpts,\n ariaRole: 'separator',\n selectable: false,\n focuseable: false,\n },\n CollapsedComponent: null,\n }}\n minHeight=\"1px\"\n paddingTop=\"0px\"\n >\n <StyledSeparator\n data-testid={LEFT_NAVIGATION_DATA_TESTID.ITEM_SEPARATOR} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n </ItemRenderer>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACqCjB;AArCN,OAAOA,YAAW;AAClB,SAAS,cAAc;AACvB,SAAS,sBAAsB,6BAA6B,6BAA6B;AACzF,SAAS,oBAAoB;AAG7B,MAAM,kBAAkB,OAAO,OAAO,EAAE,MAAM,sBAAsB,MAAM,sBAAsB,eAAe,CAAC;AAAA;AAAA,sBAE1F,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA,YAEpD,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA,iBAC5B,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA;AAAA;AAI3C,MAAM,gBAAgB,CAAC,UAAyD;AACrF,QAAM;AAAA,IACJ;AAAA,IACA,KAAK,EAAE,aAAa;AAAA,EACtB,IAAI;AACJ,QAAM,gBAAgBA,OAAM,YAAY,MAAM,cAAc,CAAC,YAAY,CAAC;AAC1E,QAAM,yBAAyBA,OAAM,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,QACJ,GAAG;AAAA,QACH,UAAU;AAAA,UACR,GAAG,KAAK;AAAA,UACR,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,YAAY;AAAA,QACd;AAAA,QACA,oBAAoB;AAAA,MACtB;AAAA,MACA,WAAU;AAAA,MACV,YAAW;AAAA,MAEX;AAAA,QAAC;AAAA;AAAA,UACC,eAAa,4BAA4B;AAAA,UACzC;AAAA,UACA;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React2 from "react";
|
|
3
4
|
import { DSSkeleton } from "@elliemae/ds-skeleton";
|
|
4
|
-
import { LEFT_NAVIGATION_DATA_TESTID } from "../../constants/
|
|
5
|
+
import { LEFT_NAVIGATION_DATA_TESTID } from "../../constants/index.js";
|
|
5
6
|
import { ItemRenderer } from "../../exported-related/index.js";
|
|
6
7
|
import { StyledLeftContainer } from "../styled.js";
|
|
7
8
|
const noShadowStyle = () => () => "box-shadow: none;";
|
|
8
9
|
const CollapsedComponent = () => /* @__PURE__ */ jsx(DSSkeleton, { variant: "circular", w: 24, h: 24 });
|
|
9
10
|
const ItemSkeleton = (props) => {
|
|
10
|
-
const {
|
|
11
|
+
const {
|
|
12
|
+
item,
|
|
13
|
+
hasBorderBottom,
|
|
14
|
+
ctx: { leftNavProps }
|
|
15
|
+
} = props;
|
|
16
|
+
const getOwnerProps = React2.useCallback(() => leftNavProps, [leftNavProps]);
|
|
17
|
+
const getOwnerPropsArguments = React2.useCallback(() => ({}), []);
|
|
11
18
|
const variant = item?.itemOpts?.skeletonVariant ?? "item";
|
|
12
19
|
return /* @__PURE__ */ jsxs(
|
|
13
20
|
ItemRenderer,
|
|
@@ -35,6 +42,8 @@ const ItemSkeleton = (props) => {
|
|
|
35
42
|
pl: 0,
|
|
36
43
|
justifyItems: "center",
|
|
37
44
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.LEFT_CONTAINER,
|
|
45
|
+
getOwnerProps,
|
|
46
|
+
getOwnerPropsArguments,
|
|
38
47
|
children: variant === "item" && /* @__PURE__ */ jsx(CollapsedComponent, {})
|
|
39
48
|
}
|
|
40
49
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/ItemSkeleton/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSSkeleton } from '@elliemae/ds-skeleton';\nimport { LEFT_NAVIGATION_DATA_TESTID } from '../../constants/
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSSkeleton } from '@elliemae/ds-skeleton';\nimport { LEFT_NAVIGATION_DATA_TESTID } from '../../constants/index.js';\nimport { ItemRenderer } from '../../exported-related/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\nimport { StyledLeftContainer } from '../styled.js';\n\nconst noShadowStyle = () => () => 'box-shadow: none;';\n\nconst CollapsedComponent = () => <DSSkeleton variant=\"circular\" w={24} h={24} />;\n\ninterface SkeletonPropsT extends DSLeftNavigationT.ComponentProps {\n item: DSLeftNavigationT.ComponentProps['item'];\n hasBorderBottom?: boolean;\n}\nexport const ItemSkeleton = (props: SkeletonPropsT): JSX.Element => {\n const {\n item,\n hasBorderBottom,\n ctx: { leftNavProps },\n } = props;\n const getOwnerProps = React.useCallback(() => leftNavProps, [leftNavProps]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n const variant = item?.itemOpts?.skeletonVariant ?? 'item';\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: item?.itemOpts\n ? {\n ...item.itemOpts,\n selectable: false,\n focuseable: false,\n ariaRole: 'menuitem',\n ariaLabel: 'Loading',\n }\n : {},\n CollapsedComponent: variant === 'item' ? CollapsedComponent : null,\n }}\n minHeight={variant === 'item' ? '48px' : '32px'}\n shadowStyle={noShadowStyle}\n hasBorderBottom={hasBorderBottom}\n >\n <StyledLeftContainer\n cols={['38px']}\n gutter=\"1px\"\n pl={0}\n justifyItems=\"center\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.LEFT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {variant === 'item' && <CollapsedComponent />}\n </StyledLeftContainer>\n <DSSkeleton variant=\"rectangular\" mt=\"2px\" mb=\"15px\" w=\"auto\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AAAA;AAAA;AAAA,EACxE;AAEJ;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -2,9 +2,8 @@ import * as React from "react";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ChevronSmallLeft } from "@elliemae/ds-icons";
|
|
4
4
|
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
5
|
-
import
|
|
6
|
-
import { LEFT_NAVIGATION_DATA_TESTID } from "../../constants/
|
|
7
|
-
import { CHEVRON_BACK_DS_ID } from "../../exported-related/constants.js";
|
|
5
|
+
import React2 from "react";
|
|
6
|
+
import { CHEVRON_BACK_DS_ID, LEFT_NAVIGATION_DATA_TESTID } from "../../constants/index.js";
|
|
8
7
|
import { ItemRenderer } from "../../exported-related/index.js";
|
|
9
8
|
import {
|
|
10
9
|
StyledBottomContainer,
|
|
@@ -34,6 +33,7 @@ const ItemSubmenu = (props) => {
|
|
|
34
33
|
},
|
|
35
34
|
ctx,
|
|
36
35
|
ctx: {
|
|
36
|
+
leftNavProps,
|
|
37
37
|
leftNavProps: { openedItem, labelOverflow: leftNavLabelOverflow, onItemClick },
|
|
38
38
|
expandedForAnimation,
|
|
39
39
|
selectedItem,
|
|
@@ -41,10 +41,12 @@ const ItemSubmenu = (props) => {
|
|
|
41
41
|
setFocusedItem
|
|
42
42
|
}
|
|
43
43
|
} = props;
|
|
44
|
+
const getOwnerProps = React2.useCallback(() => leftNavProps, [leftNavProps]);
|
|
45
|
+
const getOwnerPropsArguments = React2.useCallback(() => ({}), []);
|
|
44
46
|
const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;
|
|
45
47
|
const opened = openedItem === dsId;
|
|
46
48
|
const isSelected = selectedItem === dsId;
|
|
47
|
-
const shadowStyle = useCallback(
|
|
49
|
+
const shadowStyle = React2.useCallback(
|
|
48
50
|
(opened_) => (theme) => !opened_ ? notOpenedShadowStyle(isSelected || selectedParent === dsId)(theme) : `box-shadow: inset 4px 0 0 0 #52A6EC`,
|
|
49
51
|
[dsId, isSelected, selectedParent]
|
|
50
52
|
);
|
|
@@ -75,6 +77,8 @@ const ItemSubmenu = (props) => {
|
|
|
75
77
|
pl: opened ? "xxs" : 0,
|
|
76
78
|
justifyItems: "center",
|
|
77
79
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.LEFT_CONTAINER,
|
|
80
|
+
getOwnerProps,
|
|
81
|
+
getOwnerPropsArguments,
|
|
78
82
|
children: [
|
|
79
83
|
opened && /* @__PURE__ */ jsx(
|
|
80
84
|
StyledChevronLeft,
|
|
@@ -90,6 +94,8 @@ const ItemSubmenu = (props) => {
|
|
|
90
94
|
},
|
|
91
95
|
"aria-label": `Close ${ariaLabel}`,
|
|
92
96
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.ITEM_CHEVRON_BACK,
|
|
97
|
+
getOwnerProps,
|
|
98
|
+
getOwnerPropsArguments,
|
|
93
99
|
children: /* @__PURE__ */ jsx(ChevronSmallLeft, { size: "m", color: ["brand-primary", "800"] })
|
|
94
100
|
}
|
|
95
101
|
),
|
|
@@ -105,6 +111,8 @@ const ItemSubmenu = (props) => {
|
|
|
105
111
|
mb: "15px",
|
|
106
112
|
labelOverflow,
|
|
107
113
|
"data-testid": labelDataTestId || LEFT_NAVIGATION_DATA_TESTID.ITEM_LABEL,
|
|
114
|
+
getOwnerProps,
|
|
115
|
+
getOwnerPropsArguments,
|
|
108
116
|
children: labelOverflow === "truncate" ? /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: label, placement: "bottom-start" }) : label
|
|
109
117
|
}
|
|
110
118
|
),
|
|
@@ -120,6 +128,8 @@ const ItemSubmenu = (props) => {
|
|
|
120
128
|
onKeyDown: (e) => e.stopPropagation(),
|
|
121
129
|
onClick: (e) => openedItem === dsId && e.stopPropagation(),
|
|
122
130
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.RIGHT_CONTAINER,
|
|
131
|
+
getOwnerProps,
|
|
132
|
+
getOwnerPropsArguments,
|
|
123
133
|
children: RightComponent && /* @__PURE__ */ jsx(RightComponent, { ctx, item })
|
|
124
134
|
}
|
|
125
135
|
),
|
|
@@ -137,6 +147,8 @@ const ItemSubmenu = (props) => {
|
|
|
137
147
|
onKeyDown: (e) => e.stopPropagation(),
|
|
138
148
|
onClick: (e) => openedItem && e.stopPropagation(),
|
|
139
149
|
"data-testid": LEFT_NAVIGATION_DATA_TESTID.BOTTOM_CONTAINER,
|
|
150
|
+
getOwnerProps,
|
|
151
|
+
getOwnerPropsArguments,
|
|
140
152
|
children: /* @__PURE__ */ jsx(BottomComponent, { ctx, item })
|
|
141
153
|
}
|
|
142
154
|
)
|