@elliemae/ds-left-navigation 3.16.0 → 3.16.1
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 +8 -4
- package/dist/cjs/LeftNavigation.js.map +2 -2
- package/dist/cjs/LeftNavigationContext.js +4 -0
- package/dist/cjs/LeftNavigationContext.js.map +1 -1
- package/dist/cjs/common/getItemBackgroundStyle.js +4 -0
- package/dist/cjs/common/getItemBackgroundStyle.js.map +1 -1
- package/dist/cjs/common/getLeftBorderStyle.js +4 -0
- package/dist/cjs/common/getLeftBorderStyle.js.map +1 -1
- package/dist/cjs/common/getScrollbarStyle.js +4 -0
- package/dist/cjs/common/getScrollbarStyle.js.map +1 -1
- package/dist/cjs/common/index.js +7 -3
- package/dist/cjs/common/index.js.map +2 -2
- package/dist/cjs/configs/index.js +6 -2
- package/dist/cjs/configs/index.js.map +2 -2
- package/dist/cjs/configs/useLeftNavConfig.js +7 -3
- package/dist/cjs/configs/useLeftNavConfig.js.map +2 -2
- package/dist/cjs/configs/useLeftNavItems.js +6 -2
- package/dist/cjs/configs/useLeftNavItems.js.map +2 -2
- package/dist/cjs/configs/useLeftNavSmoothExpand.js +4 -0
- package/dist/cjs/configs/useLeftNavSmoothExpand.js.map +1 -1
- package/dist/cjs/constants/constants.js +4 -0
- package/dist/cjs/constants/constants.js.map +1 -1
- package/dist/cjs/constants/index.js +5 -1
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/exported-related/ChevronItem/index.js +5 -1
- package/dist/cjs/exported-related/ChevronItem/index.js.map +2 -2
- package/dist/cjs/exported-related/Icon/index.js +5 -1
- package/dist/cjs/exported-related/Icon/index.js.map +2 -2
- package/dist/cjs/exported-related/ItemRenderer/index.js +10 -7
- package/dist/cjs/exported-related/ItemRenderer/index.js.map +2 -2
- package/dist/cjs/exported-related/ItemRenderer/styled.js +5 -1
- package/dist/cjs/exported-related/ItemRenderer/styled.js.map +2 -2
- package/dist/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js +5 -2
- package/dist/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js.map +2 -2
- package/dist/cjs/exported-related/Notifications/index.js +5 -1
- package/dist/cjs/exported-related/Notifications/index.js.map +2 -2
- package/dist/cjs/exported-related/OpenWindowItem/index.js +5 -1
- package/dist/cjs/exported-related/OpenWindowItem/index.js.map +2 -2
- package/dist/cjs/exported-related/constants.js +4 -0
- package/dist/cjs/exported-related/constants.js.map +1 -1
- package/dist/cjs/exported-related/index.js +10 -6
- package/dist/cjs/exported-related/index.js.map +2 -2
- package/dist/cjs/hooks/index.js +7 -3
- package/dist/cjs/hooks/index.js.map +2 -2
- package/dist/cjs/hooks/useExpandableOnClickHandler.js +5 -1
- package/dist/cjs/hooks/useExpandableOnClickHandler.js.map +2 -2
- package/dist/cjs/hooks/useKeyboardNavigation.js +6 -2
- package/dist/cjs/hooks/useKeyboardNavigation.js.map +2 -2
- package/dist/cjs/hooks/useOpenableOnClickHandler.js +5 -1
- package/dist/cjs/hooks/useOpenableOnClickHandler.js.map +2 -2
- package/dist/cjs/hooks/useSelectFirstBodyItem.js +5 -1
- package/dist/cjs/hooks/useSelectFirstBodyItem.js.map +2 -2
- package/dist/cjs/index.d.js +4 -0
- package/dist/cjs/index.d.js.map +2 -2
- package/dist/cjs/index.js +9 -5
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemControlledDrilldown/index.js +9 -5
- package/dist/cjs/outOfTheBox/ItemControlledDrilldown/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemHeader/index.js +11 -8
- package/dist/cjs/outOfTheBox/ItemHeader/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemLink/index.js +6 -3
- package/dist/cjs/outOfTheBox/ItemLink/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemSection/index.js +6 -2
- package/dist/cjs/outOfTheBox/ItemSection/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemSeparator/index.js +7 -2
- package/dist/cjs/outOfTheBox/ItemSeparator/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemSubmenu/index.js +11 -7
- package/dist/cjs/outOfTheBox/ItemSubmenu/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemTextLabel/index.js +6 -2
- package/dist/cjs/outOfTheBox/ItemTextLabel/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js +9 -5
- package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemWithDate/index.js +6 -2
- package/dist/cjs/outOfTheBox/ItemWithDate/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/index.js +23 -19
- package/dist/cjs/outOfTheBox/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/styled.js +8 -4
- package/dist/cjs/outOfTheBox/styled.js.map +2 -2
- package/dist/cjs/package.json +4 -0
- package/dist/cjs/parts/LeftNavContent/index.js +15 -8
- package/dist/cjs/parts/LeftNavContent/index.js.map +2 -2
- package/dist/cjs/parts/LeftNavContent/styled.js +5 -1
- package/dist/cjs/parts/LeftNavContent/styled.js.map +2 -2
- package/dist/cjs/parts/LeftNavFooterItem/index.js +12 -8
- package/dist/cjs/parts/LeftNavFooterItem/index.js.map +2 -2
- package/dist/cjs/parts/LeftNavFooterItem/styled.js +10 -6
- package/dist/cjs/parts/LeftNavFooterItem/styled.js.map +2 -2
- package/dist/cjs/parts/LeftNavLoading/index.js +12 -10
- package/dist/cjs/parts/LeftNavLoading/index.js.map +3 -3
- package/dist/cjs/parts/OutOfTheBoxMapItem.js +6 -2
- package/dist/cjs/parts/OutOfTheBoxMapItem.js.map +2 -2
- package/dist/cjs/prop-types.js +5 -1
- package/dist/cjs/prop-types.js.map +2 -2
- package/dist/esm/LeftNavigation.js +4 -4
- package/dist/esm/LeftNavigation.js.map +1 -1
- package/dist/esm/common/getItemBackgroundStyle.js.map +1 -1
- package/dist/esm/common/getLeftBorderStyle.js.map +1 -1
- package/dist/esm/common/index.js +3 -3
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/configs/index.js +2 -2
- package/dist/esm/configs/index.js.map +1 -1
- package/dist/esm/configs/useLeftNavConfig.js +3 -3
- package/dist/esm/configs/useLeftNavConfig.js.map +1 -1
- package/dist/esm/configs/useLeftNavItems.js +2 -2
- package/dist/esm/configs/useLeftNavItems.js.map +2 -2
- package/dist/esm/constants/index.js +1 -1
- package/dist/esm/constants/index.js.map +1 -1
- package/dist/esm/exported-related/ChevronItem/index.js +1 -1
- package/dist/esm/exported-related/ChevronItem/index.js.map +2 -2
- package/dist/esm/exported-related/Icon/index.js +1 -1
- package/dist/esm/exported-related/Icon/index.js.map +2 -2
- package/dist/esm/exported-related/ItemRenderer/index.js +6 -7
- package/dist/esm/exported-related/ItemRenderer/index.js.map +2 -2
- package/dist/esm/exported-related/ItemRenderer/styled.js +1 -1
- package/dist/esm/exported-related/ItemRenderer/styled.js.map +2 -2
- package/dist/esm/exported-related/ItemRenderer/usePropsWithDefaults.js +1 -2
- package/dist/esm/exported-related/ItemRenderer/usePropsWithDefaults.js.map +2 -2
- package/dist/esm/exported-related/Notifications/index.js +1 -1
- package/dist/esm/exported-related/Notifications/index.js.map +1 -1
- package/dist/esm/exported-related/OpenWindowItem/index.js +1 -1
- package/dist/esm/exported-related/OpenWindowItem/index.js.map +2 -2
- package/dist/esm/exported-related/index.js +6 -6
- package/dist/esm/exported-related/index.js.map +1 -1
- package/dist/esm/hooks/index.js +3 -3
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/useExpandableOnClickHandler.js +1 -1
- package/dist/esm/hooks/useExpandableOnClickHandler.js.map +1 -1
- package/dist/esm/hooks/useKeyboardNavigation.js +2 -2
- package/dist/esm/hooks/useKeyboardNavigation.js.map +2 -2
- package/dist/esm/hooks/useOpenableOnClickHandler.js +1 -1
- package/dist/esm/hooks/useOpenableOnClickHandler.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 +5 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/outOfTheBox/ItemControlledDrilldown/index.js +5 -5
- package/dist/esm/outOfTheBox/ItemControlledDrilldown/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemHeader/index.js +9 -10
- package/dist/esm/outOfTheBox/ItemHeader/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemLink/index.js +2 -3
- package/dist/esm/outOfTheBox/ItemLink/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemSection/index.js +2 -2
- package/dist/esm/outOfTheBox/ItemSection/index.js.map +1 -1
- package/dist/esm/outOfTheBox/ItemSeparator/index.js +3 -2
- package/dist/esm/outOfTheBox/ItemSeparator/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemSubmenu/index.js +9 -9
- package/dist/esm/outOfTheBox/ItemSubmenu/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemTextLabel/index.js +2 -2
- package/dist/esm/outOfTheBox/ItemTextLabel/index.js.map +1 -1
- package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js +5 -5
- package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemWithDate/index.js +2 -2
- package/dist/esm/outOfTheBox/ItemWithDate/index.js.map +1 -1
- package/dist/esm/outOfTheBox/index.js +19 -19
- package/dist/esm/outOfTheBox/index.js.map +2 -2
- package/dist/esm/outOfTheBox/styled.js +4 -4
- package/dist/esm/outOfTheBox/styled.js.map +2 -2
- package/dist/esm/package.json +4 -0
- package/dist/esm/parts/LeftNavContent/index.js +11 -8
- 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 +2 -2
- package/dist/esm/parts/LeftNavFooterItem/index.js +9 -9
- package/dist/esm/parts/LeftNavFooterItem/index.js.map +2 -2
- package/dist/esm/parts/LeftNavFooterItem/styled.js +6 -6
- package/dist/esm/parts/LeftNavFooterItem/styled.js.map +2 -2
- package/dist/esm/parts/LeftNavLoading/index.js +8 -10
- package/dist/esm/parts/LeftNavLoading/index.js.map +2 -2
- package/dist/esm/parts/OutOfTheBoxMapItem.js +2 -2
- package/dist/esm/parts/OutOfTheBoxMapItem.js.map +2 -2
- package/dist/esm/prop-types.js +1 -1
- package/dist/esm/prop-types.js.map +1 -1
- package/dist/types/LeftNavigation.d.ts +12 -12
- package/dist/types/common/index.d.ts +3 -3
- package/dist/types/configs/index.d.ts +2 -2
- package/dist/types/configs/useLeftNavConfig.d.ts +1 -1
- package/dist/types/constants/index.d.ts +1 -1
- package/dist/types/exported-related/ItemRenderer/styled.d.ts +2 -2
- package/dist/types/exported-related/index.d.ts +6 -6
- package/dist/types/hooks/index.d.ts +3 -3
- package/dist/types/index.d.d.ts +1 -1
- package/dist/types/index.d.ts +5 -5
- package/dist/types/outOfTheBox/index.d.ts +9 -9
- package/dist/types/outOfTheBox/styled.d.ts +9 -9
- package/dist/types/parts/LeftNavContent/styled.d.ts +2 -2
- package/dist/types/parts/LeftNavFooterItem/styled.d.ts +5 -5
- package/dist/types/prop-types.d.ts +18 -18
- package/dist/types/tests/a11y/axe-collapsed.test.d.ts +1 -0
- package/dist/types/tests/a11y/axe-expanded.test.d.ts +1 -0
- package/dist/types/tests/a11y/axe-opened.test.d.ts +1 -0
- package/package.json +10 -9
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/common/getLeftBorderStyle.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { Theme } from '@elliemae/ds-system';\n\nconst commonLeftBorderStyle = (color: string, hoverColor: string, activeColor: string): string => `\n\n -webkit-box-shadow: inset 4px 0 0 0 ${color};\n box-shadow: inset 4px 0 0 0 ${color};\n\n :hover {\n -webkit-box-shadow: inset 4px 0 0 0 ${hoverColor};\n box-shadow: inset 4px 0 0 0 ${hoverColor};\n }\n\n :active {\n -webkit-box-shadow: inset 4px 0 0 0 ${activeColor};\n box-shadow: inset 4px 0 0 0 ${activeColor};\n }\n`;\n\nexport const getLeftBorderStyle = (props: { theme: Theme; selected: boolean; selectedParent: boolean }): string => {\n if (props.selected || props.selectedParent)\n return commonLeftBorderStyle(\n props.theme.colors.brand[400],\n props.theme.colors.brand[400],\n props.theme.colors.brand[400],\n );\n\n return commonLeftBorderStyle('transparent', props.theme.colors.brand[300], props.theme.colors.brand[400]);\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,MAAM,wBAAwB,CAAC,OAAe,YAAoB,gBAAgC;AAAA;AAAA,wCAE1D;AAAA,wCACA;AAAA;AAAA;AAAA,0CAGE;AAAA,0CACA;AAAA;AAAA;AAAA;AAAA,0CAIA;AAAA,0CACA;AAAA;AAAA;AAInC,MAAM,qBAAqB,CAAC,UAAgF;AACjH,MAAI,MAAM,YAAY,MAAM;AAC1B,WAAO;AAAA,MACL,MAAM,MAAM,OAAO,MAAM;AAAA,
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,MAAM,wBAAwB,CAAC,OAAe,YAAoB,gBAAgC;AAAA;AAAA,wCAE1D;AAAA,wCACA;AAAA;AAAA;AAAA,0CAGE;AAAA,0CACA;AAAA;AAAA;AAAA;AAAA,0CAIA;AAAA,0CACA;AAAA;AAAA;AAInC,MAAM,qBAAqB,CAAC,UAAgF;AACjH,MAAI,MAAM,YAAY,MAAM;AAC1B,WAAO;AAAA,MACL,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,MAC5B,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,MAC5B,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,IAC9B;AAEF,SAAO,sBAAsB,eAAe,MAAM,MAAM,OAAO,MAAM,GAAG,GAAG,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAC1G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/common/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export * from "./getItemBackgroundStyle";
|
|
3
|
-
export * from "./getLeftBorderStyle";
|
|
4
|
-
export * from "./getScrollbarStyle";
|
|
2
|
+
export * from "./getItemBackgroundStyle.js";
|
|
3
|
+
export * from "./getLeftBorderStyle.js";
|
|
4
|
+
export * from "./getScrollbarStyle.js";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/common/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './getItemBackgroundStyle';\nexport * from './getLeftBorderStyle';\nexport * from './getScrollbarStyle';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './getItemBackgroundStyle.js';\nexport * from './getLeftBorderStyle.js';\nexport * from './getScrollbarStyle.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { useLeftNavConfig } from "./useLeftNavConfig";
|
|
3
|
-
import { useLeftNavConfig as useLeftNavConfig2 } from "./useLeftNavConfig";
|
|
2
|
+
import { useLeftNavConfig } from "./useLeftNavConfig.js";
|
|
3
|
+
import { useLeftNavConfig as useLeftNavConfig2 } from "./useLeftNavConfig.js";
|
|
4
4
|
var configs_default = useLeftNavConfig;
|
|
5
5
|
export {
|
|
6
6
|
configs_default as default,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/configs/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useLeftNavConfig } from './useLeftNavConfig';\n\nexport { useLeftNavConfig } from './useLeftNavConfig';\nexport default useLeftNavConfig;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useLeftNavConfig } from './useLeftNavConfig.js';\n\nexport { useLeftNavConfig } from './useLeftNavConfig.js';\nexport default useLeftNavConfig;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,wBAAwB;AAEjC,SAAS,oBAAAA,yBAAwB;AACjC,IAAO,kBAAQ;",
|
|
6
6
|
"names": ["useLeftNavConfig"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import React2 from "react";
|
|
3
|
-
import useLeftNavItems from "./useLeftNavItems";
|
|
4
|
-
import { useLeftNavSmoothExpand } from "./useLeftNavSmoothExpand";
|
|
5
|
-
import { useSelectFirstBodyItem } from "../hooks/useSelectFirstBodyItem";
|
|
3
|
+
import useLeftNavItems from "./useLeftNavItems.js";
|
|
4
|
+
import { useLeftNavSmoothExpand } from "./useLeftNavSmoothExpand.js";
|
|
5
|
+
import { useSelectFirstBodyItem } from "../hooks/useSelectFirstBodyItem.js";
|
|
6
6
|
const useLeftNavConfig = (props) => {
|
|
7
7
|
const { expanded, openedItem, onSelectedChange, onFocusChange, items } = props;
|
|
8
8
|
const [selectedItem, setSelectedItem] = React2.useState(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/configs/useLeftNavConfig.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { LeftNavProps } from '../index.d';\nimport type { ContextProps } from '../LeftNavigationContext';\nimport useLeftNavItems from './useLeftNavItems';\nimport { useLeftNavSmoothExpand } from './useLeftNavSmoothExpand';\nimport { useSelectFirstBodyItem } from '../hooks/useSelectFirstBodyItem';\n\nexport const useLeftNavConfig = (props: LeftNavProps): ContextProps => {\n const { expanded, openedItem, onSelectedChange, onFocusChange, items } = props;\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * INTERNAL STATE *\n // ************************** ------------ **************************\n // Selection related\n const [selectedItem, setSelectedItem] = React.useState<string | null>(null);\n const [selectedParent, setSelectedParent] = React.useState<string | null>(null);\n // Focus related\n const [focusedItem, setFocusedItem] = React.useState<string | null>(null);\n // Opened uncontrolled drilldowns\n const [openedDrilldowns, setOpenedDrilldowns] = React.useState<string[]>([]);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * EXPAND ANIMATION *\n // ************************** ------------ **************************\n const [expandedForAnimation, setExpandedForAnimation] = React.useState(expanded);\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout>>(null);\n const smoothExpandOpts = React.useMemo(\n () => ({\n expandedForAnimation,\n timeoutRef,\n setExpandedForAnimation,\n }),\n [expandedForAnimation, timeoutRef, setExpandedForAnimation],\n );\n useLeftNavSmoothExpand(props, smoothExpandOpts);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * SIDE EFFECTS *\n // ************************** ------------ **************************\n React.useEffect(() => {\n onSelectedChange(selectedItem);\n }, [selectedItem, onSelectedChange]);\n\n React.useEffect(() => {\n if (props.actionRef && props.actionRef.current) {\n props.actionRef.current.setFocusedItem = setFocusedItem;\n }\n }, [props.actionRef]);\n\n React.useEffect(() => {\n if (openedItem !== null) setSelectedParent(openedItem);\n }, [openedItem]);\n\n React.useEffect(() => {\n onFocusChange(focusedItem);\n }, [focusedItem, onFocusChange]);\n\n useSelectFirstBodyItem(\n items,\n openedItem,\n props.selectedItem !== undefined ? props.selectedItem : selectedItem,\n setSelectedItem,\n props.disableDefaultSelection,\n );\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * ITEMS MANAGEMENT *\n // ************************** ------------ **************************\n\n const leftNavItemsProps = React.useMemo(\n () => ({\n headerItem: props.HeaderComponent,\n bodyHeaderItem: props.BodyHeaderComponent,\n items: props.items,\n openedDrilldowns,\n }),\n [props.HeaderComponent, props.BodyHeaderComponent, props.items, openedDrilldowns],\n );\n\n // We need to know the current visible items since we have drilldowns\n const { visibleItems, visibleItemsRefs } = useLeftNavItems(leftNavItemsProps);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * LEFTNAV CONFIG *\n // ************************** ------------ **************************\n const finalConfig = React.useMemo(\n () => ({\n leftNavProps: props,\n expandedForAnimation,\n selectedItem: props.selectedItem !== undefined ? props.selectedItem : selectedItem,\n setSelectedItem,\n selectedParent: props.selectedParent !== undefined ? props.selectedParent : selectedParent,\n setSelectedParent,\n focusedItem,\n setFocusedItem,\n openedDrilldowns,\n setOpenedDrilldowns,\n visibleItems,\n visibleItemsRefs,\n }),\n [\n props,\n expandedForAnimation,\n selectedItem,\n setSelectedItem,\n setSelectedParent,\n selectedParent,\n focusedItem,\n setFocusedItem,\n openedDrilldowns,\n setOpenedDrilldowns,\n visibleItems,\n visibleItemsRefs,\n ],\n );\n\n return finalConfig;\n};\n\nexport default useLeftNavConfig;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { LeftNavProps } from '../index.d';\nimport type { ContextProps } from '../LeftNavigationContext.js';\nimport useLeftNavItems from './useLeftNavItems.js';\nimport { useLeftNavSmoothExpand } from './useLeftNavSmoothExpand.js';\nimport { useSelectFirstBodyItem } from '../hooks/useSelectFirstBodyItem.js';\n\nexport const useLeftNavConfig = (props: LeftNavProps): ContextProps => {\n const { expanded, openedItem, onSelectedChange, onFocusChange, items } = props;\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * INTERNAL STATE *\n // ************************** ------------ **************************\n // Selection related\n const [selectedItem, setSelectedItem] = React.useState<string | null>(null);\n const [selectedParent, setSelectedParent] = React.useState<string | null>(null);\n // Focus related\n const [focusedItem, setFocusedItem] = React.useState<string | null>(null);\n // Opened uncontrolled drilldowns\n const [openedDrilldowns, setOpenedDrilldowns] = React.useState<string[]>([]);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * EXPAND ANIMATION *\n // ************************** ------------ **************************\n const [expandedForAnimation, setExpandedForAnimation] = React.useState(expanded);\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout>>(null);\n const smoothExpandOpts = React.useMemo(\n () => ({\n expandedForAnimation,\n timeoutRef,\n setExpandedForAnimation,\n }),\n [expandedForAnimation, timeoutRef, setExpandedForAnimation],\n );\n useLeftNavSmoothExpand(props, smoothExpandOpts);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * SIDE EFFECTS *\n // ************************** ------------ **************************\n React.useEffect(() => {\n onSelectedChange(selectedItem);\n }, [selectedItem, onSelectedChange]);\n\n React.useEffect(() => {\n if (props.actionRef && props.actionRef.current) {\n props.actionRef.current.setFocusedItem = setFocusedItem;\n }\n }, [props.actionRef]);\n\n React.useEffect(() => {\n if (openedItem !== null) setSelectedParent(openedItem);\n }, [openedItem]);\n\n React.useEffect(() => {\n onFocusChange(focusedItem);\n }, [focusedItem, onFocusChange]);\n\n useSelectFirstBodyItem(\n items,\n openedItem,\n props.selectedItem !== undefined ? props.selectedItem : selectedItem,\n setSelectedItem,\n props.disableDefaultSelection,\n );\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * ITEMS MANAGEMENT *\n // ************************** ------------ **************************\n\n const leftNavItemsProps = React.useMemo(\n () => ({\n headerItem: props.HeaderComponent,\n bodyHeaderItem: props.BodyHeaderComponent,\n items: props.items,\n openedDrilldowns,\n }),\n [props.HeaderComponent, props.BodyHeaderComponent, props.items, openedDrilldowns],\n );\n\n // We need to know the current visible items since we have drilldowns\n const { visibleItems, visibleItemsRefs } = useLeftNavItems(leftNavItemsProps);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * LEFTNAV CONFIG *\n // ************************** ------------ **************************\n const finalConfig = React.useMemo(\n () => ({\n leftNavProps: props,\n expandedForAnimation,\n selectedItem: props.selectedItem !== undefined ? props.selectedItem : selectedItem,\n setSelectedItem,\n selectedParent: props.selectedParent !== undefined ? props.selectedParent : selectedParent,\n setSelectedParent,\n focusedItem,\n setFocusedItem,\n openedDrilldowns,\n setOpenedDrilldowns,\n visibleItems,\n visibleItemsRefs,\n }),\n [\n props,\n expandedForAnimation,\n selectedItem,\n setSelectedItem,\n setSelectedParent,\n selectedParent,\n focusedItem,\n setFocusedItem,\n openedDrilldowns,\n setOpenedDrilldowns,\n visibleItems,\n visibleItemsRefs,\n ],\n );\n\n return finalConfig;\n};\n\nexport default useLeftNavConfig;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAGlB,OAAO,qBAAqB;AAC5B,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AAEhC,MAAM,mBAAmB,CAAC,UAAsC;AACrE,QAAM,EAAE,UAAU,YAAY,kBAAkB,eAAe,MAAM,IAAI;AAOzE,QAAM,CAAC,cAAc,eAAe,IAAIA,OAAM,SAAwB,IAAI;AAC1E,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,OAAM,SAAwB,IAAI;AAE9E,QAAM,CAAC,aAAa,cAAc,IAAIA,OAAM,SAAwB,IAAI;AAExE,QAAM,CAAC,kBAAkB,mBAAmB,IAAIA,OAAM,SAAmB,CAAC,CAAC;AAM3E,QAAM,CAAC,sBAAsB,uBAAuB,IAAIA,OAAM,SAAS,QAAQ;AAC/E,QAAM,aAAaA,OAAM,OAAsC,IAAI;AACnE,QAAM,mBAAmBA,OAAM;AAAA,IAC7B,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,sBAAsB,YAAY,uBAAuB;AAAA,EAC5D;AACA,yBAAuB,OAAO,gBAAgB;AAM9C,EAAAA,OAAM,UAAU,MAAM;AACpB,qBAAiB,YAAY;AAAA,EAC/B,GAAG,CAAC,cAAc,gBAAgB,CAAC;AAEnC,EAAAA,OAAM,UAAU,MAAM;AACpB,QAAI,MAAM,aAAa,MAAM,UAAU,SAAS;AAC9C,YAAM,UAAU,QAAQ,iBAAiB;AAAA,IAC3C;AAAA,EACF,GAAG,CAAC,MAAM,SAAS,CAAC;AAEpB,EAAAA,OAAM,UAAU,MAAM;AACpB,QAAI,eAAe;AAAM,wBAAkB,UAAU;AAAA,EACvD,GAAG,CAAC,UAAU,CAAC;AAEf,EAAAA,OAAM,UAAU,MAAM;AACpB,kBAAc,WAAW;AAAA,EAC3B,GAAG,CAAC,aAAa,aAAa,CAAC;AAE/B;AAAA,IACE;AAAA,IACA;AAAA,IACA,MAAM,iBAAiB,SAAY,MAAM,eAAe;AAAA,IACxD;AAAA,IACA,MAAM;AAAA,EACR;AAOA,QAAM,oBAAoBA,OAAM;AAAA,IAC9B,OAAO;AAAA,MACL,YAAY,MAAM;AAAA,MAClB,gBAAgB,MAAM;AAAA,MACtB,OAAO,MAAM;AAAA,MACb;AAAA,IACF;AAAA,IACA,CAAC,MAAM,iBAAiB,MAAM,qBAAqB,MAAM,OAAO,gBAAgB;AAAA,EAClF;AAGA,QAAM,EAAE,cAAc,iBAAiB,IAAI,gBAAgB,iBAAiB;AAM5E,QAAM,cAAcA,OAAM;AAAA,IACxB,OAAO;AAAA,MACL,cAAc;AAAA,MACd;AAAA,MACA,cAAc,MAAM,iBAAiB,SAAY,MAAM,eAAe;AAAA,MACtE;AAAA,MACA,gBAAgB,MAAM,mBAAmB,SAAY,MAAM,iBAAiB;AAAA,MAC5E;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { createRef, useMemo, useRef } from "react";
|
|
3
|
-
import { ITEM_TYPES } from "../exported-related";
|
|
4
|
-
import { FOOTER_DS_ID } from "../exported-related/constants";
|
|
3
|
+
import { ITEM_TYPES } from "../exported-related/index.js";
|
|
4
|
+
import { FOOTER_DS_ID } from "../exported-related/constants.js";
|
|
5
5
|
const notFocuseableItems = [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, ITEM_TYPES.LEFT_NAV_ITEM_SECTION];
|
|
6
6
|
const walkItems = (items, openedDrilldowns, callback) => {
|
|
7
7
|
items.forEach((item) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/configs/useLeftNavItems.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport type { MutableRefObject, RefObject } from 'react';\nimport { createRef, useMemo, useRef } from 'react';\nimport { ITEM_TYPES } from '../exported-related';\nimport type { GenericItemItemProps } from '../index.d';\nimport { FOOTER_DS_ID } from '../exported-related/constants';\n\nconst notFocuseableItems = [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, ITEM_TYPES.LEFT_NAV_ITEM_SECTION];\n\n// Walks the array of items\n// Drilldowns are tree-like structures\nconst walkItems = (items: GenericItemItemProps[], openedDrilldowns: string[], callback: (dsId: string) => void) => {\n items.forEach((item) => {\n if (typeof item.type === 'string') {\n // Out of the box item\n if (notFocuseableItems.includes(item.type)) return; // not focuseable\n\n callback(item.dsId);\n\n // If it's an opened uncontrolled drilldown\n if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_UNCONTROLLED_DRILLDOWN && openedDrilldowns.includes(item.dsId))\n walkItems(item.itemOpts?.items ?? [], openedDrilldowns, callback);\n\n // If it's an opened controlled drilldown\n if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN && item.itemOpts?.isOpened)\n walkItems(item.itemOpts?.items ?? [], openedDrilldowns, callback);\n } else {\n // Custom item\n if (!item.itemOpts?.focuseable) return; // not focuseable specified\n callback(item.dsId);\n }\n });\n};\n\nexport const useLeftNavItems = (props: {\n headerItem: GenericItemItemProps;\n bodyHeaderItem: GenericItemItemProps;\n items: GenericItemItemProps[];\n openedDrilldowns: string[];\n}): {\n visibleItems: string[];\n visibleItemsRefs: MutableRefObject<Record<string, RefObject<HTMLElement>>>;\n} => {\n const { headerItem, bodyHeaderItem, items: bodyItems, openedDrilldowns } = props;\n\n // Place the header and body header items into the array of items\n const items = useMemo(() => {\n const itemsArray: GenericItemItemProps[] = [...bodyItems];\n if (bodyHeaderItem) itemsArray.unshift(bodyHeaderItem);\n if (headerItem) itemsArray.unshift(headerItem);\n return itemsArray;\n }, [headerItem, bodyHeaderItem, bodyItems]);\n\n const visibleItemsRefs = useRef<Record<string, RefObject<HTMLElement>>>({});\n\n const visibleItems: string[] = useMemo(() => {\n const visibleItemsArray: string[] = [];\n walkItems(items, openedDrilldowns, (dsId: string) => {\n visibleItemsArray.push(dsId);\n });\n visibleItemsArray.push(FOOTER_DS_ID);\n return visibleItemsArray;\n }, [items, openedDrilldowns]);\n\n visibleItems.forEach((dsId) => {\n if (!(dsId in visibleItemsRefs.current)) visibleItemsRefs.current[dsId] = createRef();\n });\n\n return { visibleItems, visibleItemsRefs };\n};\n\nexport default useLeftNavItems;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,SAAS,cAAc;AAC3C,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB;AAE7B,MAAM,qBAAqB,CAAC,WAAW,yBAAyB,WAAW,qBAAqB;AAIhG,MAAM,YAAY,CAAC,OAA+B,kBAA4B,aAAqC;AACjH,QAAM,QAAQ,CAAC,SAAS;AACtB,QAAI,OAAO,KAAK,SAAS,UAAU;AAEjC,UAAI,mBAAmB,SAAS,KAAK,IAAI;AAAG;AAE5C,eAAS,KAAK,IAAI;AAGlB,UAAI,KAAK,SAAS,WAAW,wCAAwC,iBAAiB,SAAS,KAAK,IAAI;AACtG,kBAAU,KAAK,UAAU,SAAS,CAAC,GAAG,kBAAkB,QAAQ;AAGlE,UAAI,KAAK,SAAS,WAAW,sCAAsC,KAAK,UAAU;AAChF,kBAAU,KAAK,UAAU,SAAS,CAAC,GAAG,kBAAkB,QAAQ;AAAA,IACpE,OAAO;AAEL,UAAI,CAAC,KAAK,UAAU;AAAY;AAChC,eAAS,KAAK,IAAI;AAAA,IACpB;AAAA,EACF,CAAC;AACH;AAEO,MAAM,kBAAkB,CAAC,UAQ3B;AACH,QAAM,EAAE,YAAY,gBAAgB,OAAO,WAAW,iBAAiB,IAAI;AAG3E,QAAM,QAAQ,QAAQ,MAAM;AAC1B,UAAM,aAAqC,CAAC,GAAG,SAAS;AACxD,QAAI;AAAgB,iBAAW,QAAQ,cAAc;AACrD,QAAI;AAAY,iBAAW,QAAQ,UAAU;AAC7C,WAAO;AAAA,EACT,GAAG,CAAC,YAAY,gBAAgB,SAAS,CAAC;AAE1C,QAAM,mBAAmB,OAA+C,CAAC,CAAC;AAE1E,QAAM,eAAyB,QAAQ,MAAM;AAC3C,UAAM,oBAA8B,CAAC;AACrC,cAAU,OAAO,kBAAkB,CAAC,SAAiB;AACnD,wBAAkB,KAAK,IAAI;AAAA,IAC7B,CAAC;AACD,sBAAkB,KAAK,YAAY;AACnC,WAAO;AAAA,EACT,GAAG,CAAC,OAAO,gBAAgB,CAAC;AAE5B,eAAa,QAAQ,CAAC,SAAS;AAC7B,QAAI,EAAE,QAAQ,iBAAiB;AAAU,uBAAiB,QAAQ,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport type { MutableRefObject, RefObject } from 'react';\nimport { createRef, useMemo, useRef } from 'react';\nimport { ITEM_TYPES } from '../exported-related/index.js';\nimport type { GenericItemItemProps } from '../index.d';\nimport { FOOTER_DS_ID } from '../exported-related/constants.js';\n\nconst notFocuseableItems = [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, ITEM_TYPES.LEFT_NAV_ITEM_SECTION];\n\n// Walks the array of items\n// Drilldowns are tree-like structures\nconst walkItems = (items: GenericItemItemProps[], openedDrilldowns: string[], callback: (dsId: string) => void) => {\n items.forEach((item) => {\n if (typeof item.type === 'string') {\n // Out of the box item\n if (notFocuseableItems.includes(item.type)) return; // not focuseable\n\n callback(item.dsId);\n\n // If it's an opened uncontrolled drilldown\n if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_UNCONTROLLED_DRILLDOWN && openedDrilldowns.includes(item.dsId))\n walkItems(item.itemOpts?.items ?? [], openedDrilldowns, callback);\n\n // If it's an opened controlled drilldown\n if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN && item.itemOpts?.isOpened)\n walkItems(item.itemOpts?.items ?? [], openedDrilldowns, callback);\n } else {\n // Custom item\n if (!item.itemOpts?.focuseable) return; // not focuseable specified\n callback(item.dsId);\n }\n });\n};\n\nexport const useLeftNavItems = (props: {\n headerItem: GenericItemItemProps;\n bodyHeaderItem: GenericItemItemProps;\n items: GenericItemItemProps[];\n openedDrilldowns: string[];\n}): {\n visibleItems: string[];\n visibleItemsRefs: MutableRefObject<Record<string, RefObject<HTMLElement>>>;\n} => {\n const { headerItem, bodyHeaderItem, items: bodyItems, openedDrilldowns } = props;\n\n // Place the header and body header items into the array of items\n const items = useMemo(() => {\n const itemsArray: GenericItemItemProps[] = [...bodyItems];\n if (bodyHeaderItem) itemsArray.unshift(bodyHeaderItem);\n if (headerItem) itemsArray.unshift(headerItem);\n return itemsArray;\n }, [headerItem, bodyHeaderItem, bodyItems]);\n\n const visibleItemsRefs = useRef<Record<string, RefObject<HTMLElement>>>({});\n\n const visibleItems: string[] = useMemo(() => {\n const visibleItemsArray: string[] = [];\n walkItems(items, openedDrilldowns, (dsId: string) => {\n visibleItemsArray.push(dsId);\n });\n visibleItemsArray.push(FOOTER_DS_ID);\n return visibleItemsArray;\n }, [items, openedDrilldowns]);\n\n visibleItems.forEach((dsId) => {\n if (!(dsId in visibleItemsRefs.current)) visibleItemsRefs.current[dsId] = createRef();\n });\n\n return { visibleItems, visibleItemsRefs };\n};\n\nexport default useLeftNavItems;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,SAAS,cAAc;AAC3C,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB;AAE7B,MAAM,qBAAqB,CAAC,WAAW,yBAAyB,WAAW,qBAAqB;AAIhG,MAAM,YAAY,CAAC,OAA+B,kBAA4B,aAAqC;AACjH,QAAM,QAAQ,CAAC,SAAS;AACtB,QAAI,OAAO,KAAK,SAAS,UAAU;AAEjC,UAAI,mBAAmB,SAAS,KAAK,IAAI;AAAG;AAE5C,eAAS,KAAK,IAAI;AAGlB,UAAI,KAAK,SAAS,WAAW,wCAAwC,iBAAiB,SAAS,KAAK,IAAI;AACtG,kBAAU,KAAK,UAAU,SAAS,CAAC,GAAG,kBAAkB,QAAQ;AAGlE,UAAI,KAAK,SAAS,WAAW,sCAAsC,KAAK,UAAU;AAChF,kBAAU,KAAK,UAAU,SAAS,CAAC,GAAG,kBAAkB,QAAQ;AAAA,IACpE,OAAO;AAEL,UAAI,CAAC,KAAK,UAAU;AAAY;AAChC,eAAS,KAAK,IAAI;AAAA,IACpB;AAAA,EACF,CAAC;AACH;AAEO,MAAM,kBAAkB,CAAC,UAQ3B;AACH,QAAM,EAAE,YAAY,gBAAgB,OAAO,WAAW,iBAAiB,IAAI;AAG3E,QAAM,QAAQ,QAAQ,MAAM;AAC1B,UAAM,aAAqC,CAAC,GAAG,SAAS;AACxD,QAAI;AAAgB,iBAAW,QAAQ,cAAc;AACrD,QAAI;AAAY,iBAAW,QAAQ,UAAU;AAC7C,WAAO;AAAA,EACT,GAAG,CAAC,YAAY,gBAAgB,SAAS,CAAC;AAE1C,QAAM,mBAAmB,OAA+C,CAAC,CAAC;AAE1E,QAAM,eAAyB,QAAQ,MAAM;AAC3C,UAAM,oBAA8B,CAAC;AACrC,cAAU,OAAO,kBAAkB,CAAC,SAAiB;AACnD,wBAAkB,KAAK,IAAI;AAAA,IAC7B,CAAC;AACD,sBAAkB,KAAK,YAAY;AACnC,WAAO;AAAA,EACT,GAAG,CAAC,OAAO,gBAAgB,CAAC;AAE5B,eAAa,QAAQ,CAAC,SAAS;AAC7B,QAAI,EAAE,QAAQ,iBAAiB;AAAU,uBAAiB,QAAQ,IAAI,IAAI,UAAU;AAAA,EACtF,CAAC;AAED,SAAO,EAAE,cAAc,iBAAiB;AAC1C;AAEA,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './constants';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './constants.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { ChevronSmallRight } from "@elliemae/ds-icons";
|
|
4
|
-
const ChevronItem = (props) => /* @__PURE__ */ jsx(ChevronSmallRight, { size: "m", color: ["brand-primary", 800], ...props });
|
|
4
|
+
const ChevronItem = (props) => /* @__PURE__ */ jsx(ChevronSmallRight, { size: "m", color: ["brand-primary", "800"], ...props });
|
|
5
5
|
var ChevronItem_default = ChevronItem;
|
|
6
6
|
export {
|
|
7
7
|
ChevronItem,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/ChevronItem/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ChevronSmallRight } from '@elliemae/ds-icons';\n\nexport const ChevronItem = (props: unknown): JSX.Element => (\n <ChevronSmallRight size=\"m\" color={['brand-primary', 800]} {...props} />\n);\n\nexport default ChevronItem;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACIrB;AAHF,SAAS,yBAAyB;AAE3B,MAAM,cAAc,CAAC,UAC1B,oBAAC,qBAAkB,MAAK,KAAI,OAAO,CAAC,iBAAiB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ChevronSmallRight } from '@elliemae/ds-icons';\n\nexport const ChevronItem = (props: unknown): JSX.Element => (\n <ChevronSmallRight size=\"m\" color={['brand-primary', '800']} {...props} />\n);\n\nexport default ChevronItem;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIrB;AAHF,SAAS,yBAAyB;AAE3B,MAAM,cAAc,CAAC,UAC1B,oBAAC,qBAAkB,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAI,GAAG,OAAO;AAG1E,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -12,7 +12,7 @@ const AugmentedIcon = (Icon2) => styled(Icon2)`
|
|
|
12
12
|
`;
|
|
13
13
|
const Icon = (IconComponent) => function(props) {
|
|
14
14
|
const StyledComponent = AugmentedIcon(IconComponent);
|
|
15
|
-
return /* @__PURE__ */ jsx(StyledComponent, { color: ["brand-primary", 800], tabIndex: 0, ...props });
|
|
15
|
+
return /* @__PURE__ */ jsx(StyledComponent, { color: ["brand-primary", "800"], tabIndex: 0, ...props });
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
18
|
Icon
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Icon/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\n\nconst AugmentedIcon = (Icon: React.ComponentType<{ color: unknown; tabIndex: number }>) => styled(Icon)`\n cursor: pointer;\n\n outline: 0;\n :focus,\n :active {\n outline: 1px solid #1e79c2;\n }\n`;\n\nexport const Icon = (IconComponent: React.ComponentType<{ color: unknown; tabIndex: number }>) =>\n function (props: unknown): JSX.Element {\n const StyledComponent = AugmentedIcon(IconComponent);\n return <StyledComponent color={['brand-primary', 800]} tabIndex={0} {...props} />;\n };\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACgBZ;AAfX,SAAS,cAAc;AAEvB,MAAM,gBAAgB,CAACA,UAAoE,OAAOA,KAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU/F,MAAM,OAAO,CAAC,kBACnB,SAAU,OAA6B;AACrC,QAAM,kBAAkB,cAAc,aAAa;AACnD,SAAO,oBAAC,mBAAgB,OAAO,CAAC,iBAAiB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\n\nconst AugmentedIcon = (Icon: React.ComponentType<{ color: unknown; tabIndex: number }>) => styled(Icon)`\n cursor: pointer;\n\n outline: 0;\n :focus,\n :active {\n outline: 1px solid #1e79c2;\n }\n`;\n\nexport const Icon = (IconComponent: React.ComponentType<{ color: unknown; tabIndex: number }>) =>\n function (props: unknown): JSX.Element {\n const StyledComponent = AugmentedIcon(IconComponent);\n return <StyledComponent color={['brand-primary', '800']} tabIndex={0} {...props} />;\n };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACgBZ;AAfX,SAAS,cAAc;AAEvB,MAAM,gBAAgB,CAACA,UAAoE,OAAOA,KAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU/F,MAAM,OAAO,CAAC,kBACnB,SAAU,OAA6B;AACrC,QAAM,kBAAkB,cAAc,aAAa;AACnD,SAAO,oBAAC,mBAAgB,OAAO,CAAC,iBAAiB,KAAK,GAAG,UAAU,GAAI,GAAG,OAAO;AACnF;",
|
|
6
6
|
"names": ["Icon"]
|
|
7
7
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, useMemo, useCallback } from "react";
|
|
4
|
-
import { StyledItem, StyledCollapsedContainer, StyledBorderBottom } from "./styled";
|
|
5
|
-
import { LeftNavContext } from "../../LeftNavigationContext";
|
|
6
|
-
import { usePropsWithDefaults } from "./usePropsWithDefaults";
|
|
7
|
-
import { useKeyboardNavigation } from "../../hooks";
|
|
4
|
+
import { StyledItem, StyledCollapsedContainer, StyledBorderBottom } from "./styled.js";
|
|
5
|
+
import { LeftNavContext } from "../../LeftNavigationContext.js";
|
|
6
|
+
import { usePropsWithDefaults } from "./usePropsWithDefaults.js";
|
|
7
|
+
import { useKeyboardNavigation } from "../../hooks/index.js";
|
|
8
8
|
const ItemRenderer = (props) => {
|
|
9
9
|
const propsWithDefault = usePropsWithDefaults(props);
|
|
10
10
|
const {
|
|
11
11
|
item,
|
|
12
12
|
item: {
|
|
13
13
|
dsId,
|
|
14
|
-
itemOpts: { selectable, focuseable, indent, ariaLabel, ariaRole,
|
|
14
|
+
itemOpts: { selectable, focuseable, indent, ariaLabel, ariaRole, ariaExpanded, ariaDescribedBy },
|
|
15
15
|
CollapsedComponent
|
|
16
16
|
},
|
|
17
17
|
subitems,
|
|
@@ -76,7 +76,7 @@ const ItemRenderer = (props) => {
|
|
|
76
76
|
opened,
|
|
77
77
|
onFocus: handleFocus,
|
|
78
78
|
"data-testid": "leftnav-item-container",
|
|
79
|
-
tabIndex: focuseable ? 0 :
|
|
79
|
+
tabIndex: focuseable ? 0 : void 0,
|
|
80
80
|
"aria-describedby": ariaDescribedBy,
|
|
81
81
|
"aria-expanded": ariaExpanded,
|
|
82
82
|
role: ariaRole,
|
|
@@ -85,7 +85,6 @@ const ItemRenderer = (props) => {
|
|
|
85
85
|
"data-opened": opened,
|
|
86
86
|
"data-type": item.type,
|
|
87
87
|
"aria-label": ariaLabel,
|
|
88
|
-
"aria-live": ariaLive,
|
|
89
88
|
children: [
|
|
90
89
|
!expandedForAnimation ? /* @__PURE__ */ jsx(StyledCollapsedContainer, { "data-testid": "leftnav-leftcomponent", justifyContent: "center", children: CollapsedComponent && /* @__PURE__ */ jsx(CollapsedComponent, { item, ctx }) }) : children,
|
|
91
90
|
hasBorderBottom && /* @__PURE__ */ jsx(StyledBorderBottom, { opened, borderBottomMr })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/ItemRenderer/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useContext, useMemo, useCallback } from 'react';\nimport { StyledItem, StyledCollapsedContainer, StyledBorderBottom } from './styled';\nimport type { ItemRendererT } from '../../index.d';\nimport { LeftNavContext } from '../../LeftNavigationContext';\nimport { usePropsWithDefaults } from './usePropsWithDefaults';\nimport { useKeyboardNavigation } from '../../hooks';\n\nexport const ItemRenderer: React.ComponentType<ItemRendererT> = (props) => {\n const propsWithDefault = usePropsWithDefaults(props);\n const {\n item,\n item: {\n dsId,\n itemOpts: { selectable, focuseable, indent, ariaLabel, ariaRole,
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACmEnB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useContext, useMemo, useCallback } from 'react';\nimport { StyledItem, StyledCollapsedContainer, StyledBorderBottom } from './styled.js';\nimport type { ItemRendererT } from '../../index.d';\nimport { LeftNavContext } from '../../LeftNavigationContext.js';\nimport { usePropsWithDefaults } from './usePropsWithDefaults.js';\nimport { useKeyboardNavigation } from '../../hooks/index.js';\n\nexport const ItemRenderer: React.ComponentType<ItemRendererT> = (props) => {\n const propsWithDefault = usePropsWithDefaults(props);\n const {\n item,\n item: {\n dsId,\n itemOpts: { selectable, focuseable, indent, ariaLabel, ariaRole, ariaExpanded, ariaDescribedBy },\n CollapsedComponent,\n },\n subitems,\n minHeight,\n paddingTop,\n onClick,\n shadowStyle,\n hasBorderBottom,\n borderBottomMr,\n children,\n } = propsWithDefault;\n\n const ctx = useContext(LeftNavContext);\n const {\n leftNavProps: { onItemClick, openedItem },\n expandedForAnimation,\n selectedParent,\n selectedItem,\n setSelectedItem,\n setFocusedItem,\n visibleItemsRefs,\n } = ctx;\n\n const opened = dsId === openedItem;\n\n const handleOnClick = useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n if (onClick) onClick(); // used by uncontrolled drilldowns\n onItemClick(item, e);\n if (selectable) setSelectedItem(item.dsId as string);\n },\n [onItemClick, item, setSelectedItem, selectable, onClick],\n );\n\n const handleFocus = useCallback(() => {\n if (focuseable) setFocusedItem(dsId as string);\n }, [dsId, setFocusedItem, focuseable]);\n\n const onKeyDown = useKeyboardNavigation({\n item,\n onClick: handleOnClick,\n });\n\n const cols = useMemo(() => (expandedForAnimation ? ['auto', '1fr', 'auto'] : ['38px']), [expandedForAnimation]);\n const isSelected = useMemo(() => selectedItem === dsId, [selectedItem, dsId]);\n\n if (!expandedForAnimation && !CollapsedComponent) {\n return null;\n }\n\n return (\n <>\n <StyledItem\n ref={visibleItemsRefs.current[dsId]}\n pt={paddingTop}\n pl={indent === undefined ? 'xxxs' : `${indent}px`}\n minHeight={minHeight}\n shadowStyle={shadowStyle(opened, item.type)}\n alignItems=\"flex-start\"\n cols={cols}\n onClick={!opened ? handleOnClick : () => null}\n onKeyDown={onKeyDown}\n selectable={selectable}\n selected={isSelected}\n selectedParent={selectedParent === dsId}\n opened={opened}\n onFocus={handleFocus}\n data-testid=\"leftnav-item-container\"\n tabIndex={focuseable ? 0 : undefined}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n role={ariaRole}\n data-selected={isSelected}\n data-selectedparent={selectedParent === dsId}\n data-opened={opened}\n data-type={item.type}\n aria-label={ariaLabel}\n >\n {!expandedForAnimation ? (\n <StyledCollapsedContainer data-testid=\"leftnav-leftcomponent\" justifyContent=\"center\">\n {CollapsedComponent && <CollapsedComponent item={item} ctx={ctx} />}\n </StyledCollapsedContainer>\n ) : (\n children\n )}\n {hasBorderBottom && <StyledBorderBottom opened={opened} borderBottomMr={borderBottomMr} />}\n </StyledItem>\n {subitems}\n </>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmEnB,mBA6B+B,KA5B7B,YADF;AAjEJ,SAAgB,YAAY,SAAS,mBAAmB;AACxD,SAAS,YAAY,0BAA0B,0BAA0B;AAEzE,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AAE/B,MAAM,eAAmD,CAAC,UAAU;AACzE,QAAM,mBAAmB,qBAAqB,KAAK;AACnD,QAAM;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ;AAAA,MACA,UAAU,EAAE,YAAY,YAAY,QAAQ,WAAW,UAAU,cAAc,gBAAgB;AAAA,MAC/F;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,MAAM,WAAW,cAAc;AACrC,QAAM;AAAA,IACJ,cAAc,EAAE,aAAa,WAAW;AAAA,IACxC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,SAAS,SAAS;AAExB,QAAM,gBAAgB;AAAA,IACpB,CAAC,MAAqC;AACpC,UAAI;AAAS,gBAAQ;AACrB,kBAAY,MAAM,CAAC;AACnB,UAAI;AAAY,wBAAgB,KAAK,IAAc;AAAA,IACrD;AAAA,IACA,CAAC,aAAa,MAAM,iBAAiB,YAAY,OAAO;AAAA,EAC1D;AAEA,QAAM,cAAc,YAAY,MAAM;AACpC,QAAI;AAAY,qBAAe,IAAc;AAAA,EAC/C,GAAG,CAAC,MAAM,gBAAgB,UAAU,CAAC;AAErC,QAAM,YAAY,sBAAsB;AAAA,IACtC;AAAA,IACA,SAAS;AAAA,EACX,CAAC;AAED,QAAM,OAAO,QAAQ,MAAO,uBAAuB,CAAC,QAAQ,OAAO,MAAM,IAAI,CAAC,MAAM,GAAI,CAAC,oBAAoB,CAAC;AAC9G,QAAM,aAAa,QAAQ,MAAM,iBAAiB,MAAM,CAAC,cAAc,IAAI,CAAC;AAE5E,MAAI,CAAC,wBAAwB,CAAC,oBAAoB;AAChD,WAAO;AAAA,EACT;AAEA,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,KAAK,iBAAiB,QAAQ,IAAI;AAAA,QAClC,IAAI;AAAA,QACJ,IAAI,WAAW,SAAY,SAAS,GAAG;AAAA,QACvC;AAAA,QACA,aAAa,YAAY,QAAQ,KAAK,IAAI;AAAA,QAC1C,YAAW;AAAA,QACX;AAAA,QACA,SAAS,CAAC,SAAS,gBAAgB,MAAM;AAAA,QACzC;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QACV,gBAAgB,mBAAmB;AAAA,QACnC;AAAA,QACA,SAAS;AAAA,QACT,eAAY;AAAA,QACZ,UAAU,aAAa,IAAI;AAAA,QAC3B,oBAAkB;AAAA,QAClB,iBAAe;AAAA,QACf,MAAM;AAAA,QACN,iBAAe;AAAA,QACf,uBAAqB,mBAAmB;AAAA,QACxC,eAAa;AAAA,QACb,aAAW,KAAK;AAAA,QAChB,cAAY;AAAA,QAEX;AAAA,WAAC,uBACA,oBAAC,4BAAyB,eAAY,yBAAwB,gBAAe,UAC1E,gCAAsB,oBAAC,sBAAmB,MAAY,KAAU,GACnE,IAEA;AAAA,UAED,mBAAmB,oBAAC,sBAAmB,QAAgB,gBAAgC;AAAA;AAAA;AAAA,IAC1F;AAAA,IACC;AAAA,KACH;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import Grid from "@elliemae/ds-grid";
|
|
3
3
|
import { styled } from "@elliemae/ds-system";
|
|
4
|
-
import { DSLeftNavigationName, DSLeftNavigationSlots } from "../../constants";
|
|
4
|
+
import { DSLeftNavigationName, DSLeftNavigationSlots } from "../../constants/index.js";
|
|
5
5
|
const borderOutside = (color, weight = 2) => `&:before {
|
|
6
6
|
content: '';
|
|
7
7
|
position: absolute;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/ItemRenderer/styled.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport Grid from '@elliemae/ds-grid';\nimport { styled, type Theme } from '@elliemae/ds-system';\nimport { DSLeftNavigationName, DSLeftNavigationSlots } from '../../constants';\n\ninterface ItemProps {\n selected: boolean;\n selectable: boolean;\n opened: boolean;\n theme: Theme;\n shadowStyle: (theme: Theme) => string;\n}\n\nexport const borderOutside = (color: string, weight = 2): string => `&:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: ${weight}px solid ${color};\n pointer-events: none;\n}`;\n\nconst getItemBackground = ({ selectable, opened, selected, theme }: ItemProps) => {\n if (!selectable) return 'white';\n if (selected && !opened) return theme.colors.brand[200];\n return theme.colors.neutral['000'];\n};\n\nconst getItemHoverBackground = ({ selectable, opened, selected, theme }: ItemProps) => {\n if (!selectable) return 'white';\n if (selected && !opened) return theme.colors.brand[200];\n return theme.colors.brand['200'];\n};\n\nexport const StyledItem = styled(Grid, { name: DSLeftNavigationName, slot: DSLeftNavigationSlots.ITEM })<\n { minHeight: string } & ItemProps\n>`\n position: relative;\n cursor: ${(props) => (props.selectable && !props.opened ? 'pointer' : 'auto')};\n min-height: ${(props) => props.minHeight};\n\n background: ${getItemBackground};\n\n ${(props) => (props.selected && !props.opened ? borderOutside(props.theme.colors.brand[500], 1) : '')}\n\n :hover {\n background: ${getItemHoverBackground};\n }\n\n :active {\n background: ${({ selectable, theme }) => (selectable ? theme.colors.brand[200] : 'white')};\n }\n\n ${(props) => props.shadowStyle(props.theme)};\n\n outline: none;\n\n :focus {\n ${(props) => borderOutside(props.theme.colors.brand[700])}\n }\n`;\n\nexport const StyledCollapsedContainer = styled(Grid, {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.COLLAPSED_CONTAINER,\n})``;\n\nexport const StyledBorderBottom = styled('div', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.ITEM_BORDER_BOTTOM,\n})<{ opened: boolean; borderBottomMr?: string }>`\n margin-left: ${({ opened }) => (opened ? '12px' : '-4px')};\n margin-right: ${({ borderBottomMr }) => borderBottomMr};\n margin-top: 1px;\n height: 1px;\n width: calc(100% - ${({ borderBottomMr }) => borderBottomMr} - ${({ opened }) => (opened ? '12px' : '-4px')});\n background-color: #e0e3e8;\n grid-column: span 3;\n align-self: end;\n`;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,OAAO,UAAU;AACjB,SAAS,cAA0B;AACnC,SAAS,sBAAsB,6BAA6B;AAUrD,MAAM,gBAAgB,CAAC,OAAe,SAAS,MAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOxD,kBAAkB;AAAA;AAAA;AAI9B,MAAM,oBAAoB,CAAC,EAAE,YAAY,QAAQ,UAAU,MAAM,MAAiB;AAChF,MAAI,CAAC;AAAY,WAAO;AACxB,MAAI,YAAY,CAAC;AAAQ,WAAO,MAAM,OAAO,MAAM;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport Grid from '@elliemae/ds-grid';\nimport { styled, type Theme } from '@elliemae/ds-system';\nimport { DSLeftNavigationName, DSLeftNavigationSlots } from '../../constants/index.js';\n\ninterface ItemProps {\n selected: boolean;\n selectable: boolean;\n opened: boolean;\n theme: Theme;\n shadowStyle: (theme: Theme) => string;\n}\n\nexport const borderOutside = (color: string, weight = 2): string => `&:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: ${weight}px solid ${color};\n pointer-events: none;\n}`;\n\nconst getItemBackground = ({ selectable, opened, selected, theme }: ItemProps) => {\n if (!selectable) return 'white';\n if (selected && !opened) return theme.colors.brand[200];\n return theme.colors.neutral['000'];\n};\n\nconst getItemHoverBackground = ({ selectable, opened, selected, theme }: ItemProps) => {\n if (!selectable) return 'white';\n if (selected && !opened) return theme.colors.brand[200];\n return theme.colors.brand['200'];\n};\n\nexport const StyledItem = styled(Grid, { name: DSLeftNavigationName, slot: DSLeftNavigationSlots.ITEM })<\n { minHeight: string } & ItemProps\n>`\n position: relative;\n cursor: ${(props) => (props.selectable && !props.opened ? 'pointer' : 'auto')};\n min-height: ${(props) => props.minHeight};\n\n background: ${getItemBackground};\n\n ${(props) => (props.selected && !props.opened ? borderOutside(props.theme.colors.brand[500], 1) : '')}\n\n :hover {\n background: ${getItemHoverBackground};\n }\n\n :active {\n background: ${({ selectable, theme }) => (selectable ? theme.colors.brand[200] : 'white')};\n }\n\n ${(props) => props.shadowStyle(props.theme)};\n\n outline: none;\n\n :focus {\n ${(props) => borderOutside(props.theme.colors.brand[700])}\n }\n`;\n\nexport const StyledCollapsedContainer = styled(Grid, {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.COLLAPSED_CONTAINER,\n})``;\n\nexport const StyledBorderBottom = styled('div', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.ITEM_BORDER_BOTTOM,\n})<{ opened: boolean; borderBottomMr?: string }>`\n margin-left: ${({ opened }) => (opened ? '12px' : '-4px')};\n margin-right: ${({ borderBottomMr }) => borderBottomMr};\n margin-top: 1px;\n height: 1px;\n width: calc(100% - ${({ borderBottomMr }) => borderBottomMr} - ${({ opened }) => (opened ? '12px' : '-4px')});\n background-color: #e0e3e8;\n grid-column: span 3;\n align-self: end;\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,OAAO,UAAU;AACjB,SAAS,cAA0B;AACnC,SAAS,sBAAsB,6BAA6B;AAUrD,MAAM,gBAAgB,CAAC,OAAe,SAAS,MAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOxD,kBAAkB;AAAA;AAAA;AAI9B,MAAM,oBAAoB,CAAC,EAAE,YAAY,QAAQ,UAAU,MAAM,MAAiB;AAChF,MAAI,CAAC;AAAY,WAAO;AACxB,MAAI,YAAY,CAAC;AAAQ,WAAO,MAAM,OAAO,MAAM,GAAG;AACtD,SAAO,MAAM,OAAO,QAAQ,KAAK;AACnC;AAEA,MAAM,yBAAyB,CAAC,EAAE,YAAY,QAAQ,UAAU,MAAM,MAAiB;AACrF,MAAI,CAAC;AAAY,WAAO;AACxB,MAAI,YAAY,CAAC;AAAQ,WAAO,MAAM,OAAO,MAAM,GAAG;AACtD,SAAO,MAAM,OAAO,MAAM,KAAK;AACjC;AAEO,MAAM,aAAa,OAAO,MAAM,EAAE,MAAM,sBAAsB,MAAM,sBAAsB,KAAK,CAAC;AAAA;AAAA,YAI3F,CAAC,UAAW,MAAM,cAAc,CAAC,MAAM,SAAS,YAAY;AAAA,gBACxD,CAAC,UAAU,MAAM;AAAA;AAAA,gBAEjB;AAAA;AAAA,IAEZ,CAAC,UAAW,MAAM,YAAY,CAAC,MAAM,SAAS,cAAc,MAAM,MAAM,OAAO,MAAM,GAAG,GAAG,CAAC,IAAI;AAAA;AAAA;AAAA,kBAGlF;AAAA;AAAA;AAAA;AAAA,kBAIA,CAAC,EAAE,YAAY,MAAM,MAAO,aAAa,MAAM,OAAO,MAAM,GAAG,IAAI;AAAA;AAAA;AAAA,IAGjF,CAAC,UAAU,MAAM,YAAY,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,MAKtC,CAAC,UAAU,cAAc,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAIrD,MAAM,2BAA2B,OAAO,MAAM;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAEM,MAAM,qBAAqB,OAAO,OAAO;AAAA,EAC9C,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA,iBACgB,CAAC,EAAE,OAAO,MAAO,SAAS,SAAS;AAAA,kBAClC,CAAC,EAAE,eAAe,MAAM;AAAA;AAAA;AAAA,uBAGnB,CAAC,EAAE,eAAe,MAAM,oBAAoB,CAAC,EAAE,OAAO,MAAO,SAAS,SAAS;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/ItemRenderer/usePropsWithDefaults.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport type { ItemOptsT, ItemRendererT } from '../../index.d';\n\nconst itemDefaultProps: ItemOptsT = {\n label: '',\n labelOverflow: 'truncate',\n selectable: true,\n focuseable: true,\n openable: false,\n closable: false,\n ariaLabel:
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAGxB,MAAM,mBAA8B;AAAA,EAClC,OAAO;AAAA,EACP,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU;AAAA,EACV,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport type { ItemOptsT, ItemRendererT } from '../../index.d';\n\nconst itemDefaultProps: ItemOptsT = {\n label: '',\n labelOverflow: 'truncate',\n selectable: true,\n focuseable: true,\n openable: false,\n closable: false,\n ariaLabel: undefined,\n ariaRole: 'menuitem',\n ariaExpanded: undefined,\n ariaDescribedBy: undefined,\n};\n\nconst itemWithoutShadows = ['ds-left-nav-item-header', 'ds-left-nav-item-link', 'ds-left-nav-item-submenu'];\n\n// Make use Item props with defaults\nexport const usePropsWithDefaults = (props: ItemRendererT): Required<ItemRendererT> => {\n const propsWithDefault = useMemo(() => {\n const itemWithDefaults = {\n CollapsedComponent: () => null,\n ...props.item,\n itemOpts: { ...itemDefaultProps, ...props.item.itemOpts },\n };\n return {\n minHeight: '48px',\n paddingTop: '12px',\n subitems: [],\n shadowStyle: (opened: boolean, type: string) => () =>\n `box-shadow: ${\n opened || !itemWithoutShadows.includes(type) ? 'inset 4px 0 0 0 #52A6EC' : 'inset 4px 0 0 0 white'\n }`,\n hasBorderBottom: false,\n borderBottomMr: '0px',\n ...props,\n item: itemWithDefaults,\n };\n }, [props]);\n\n return propsWithDefault as Required<ItemRendererT>;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAGxB,MAAM,mBAA8B;AAAA,EAClC,OAAO;AAAA,EACP,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU;AAAA,EACV,cAAc;AAAA,EACd,iBAAiB;AACnB;AAEA,MAAM,qBAAqB,CAAC,2BAA2B,yBAAyB,0BAA0B;AAGnG,MAAM,uBAAuB,CAAC,UAAkD;AACrF,QAAM,mBAAmB,QAAQ,MAAM;AACrC,UAAM,mBAAmB;AAAA,MACvB,oBAAoB,MAAM;AAAA,MAC1B,GAAG,MAAM;AAAA,MACT,UAAU,EAAE,GAAG,kBAAkB,GAAG,MAAM,KAAK,SAAS;AAAA,IAC1D;AACA,WAAO;AAAA,MACL,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,UAAU,CAAC;AAAA,MACX,aAAa,CAAC,QAAiB,SAAiB,MAC9C,eACE,UAAU,CAAC,mBAAmB,SAAS,IAAI,IAAI,4BAA4B;AAAA,MAE/E,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,IACR;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AAEV,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "@elliemae/ds-icons";
|
|
9
9
|
import { styled } from "@elliemae/ds-system";
|
|
10
10
|
import Grid from "@elliemae/ds-grid";
|
|
11
|
-
import { DSLeftNavigationName, DSLeftNavigationSlots } from "../../constants";
|
|
11
|
+
import { DSLeftNavigationName, DSLeftNavigationSlots } from "../../constants/index.js";
|
|
12
12
|
const StyledIconContainer = styled("div", {
|
|
13
13
|
name: DSLeftNavigationName,
|
|
14
14
|
slot: DSLeftNavigationSlots.NOTIFICATIONS_CONTAINER
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Notifications/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport {\n AlertsSmallFill,\n Notifications as InternalNotifications,\n ExceptionsSmallFill,\n MessagesSmallFill,\n} from '@elliemae/ds-icons';\nimport { styled } from '@elliemae/ds-system';\nimport Grid from '@elliemae/ds-grid';\nimport { DSLeftNavigationName, DSLeftNavigationSlots } from '../../constants';\n\nconst StyledIconContainer = styled('div', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.NOTIFICATIONS_CONTAINER,\n})`\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\ntype NotificationsProps = {\n exceptions?: boolean;\n alerts?: boolean;\n messages?: boolean;\n};\n\nexport const Notifications = ({\n exceptions = false,\n alerts = false,\n messages = false,\n}: NotificationsProps): JSX.Element => (\n <StyledIconContainer>\n <InternalNotifications size=\"m\" color={['brand-primary', '800']} data-testid=\"left-nav-notifications-icon\" />\n {(exceptions || alerts || messages) && (\n <Grid cols={['1fr', '1fr', '1fr']} gutter=\"xxxs\" mt=\"2px\">\n <Grid width=\"6px\" height=\"6px\" data-testid=\"left-nav-exceptions-icon\">\n {exceptions && <ExceptionsSmallFill width=\"6px\" height=\"6px\" color={['warning', '900']} />}\n </Grid>\n <Grid width=\"6px\" height=\"6px\" data-testid=\"left-nav-alerts-icon\">\n {alerts && <AlertsSmallFill width=\"6px\" height=\"6px\" color={['danger', '900']} />}\n </Grid>\n <Grid width=\"6px\" height=\"6px\" data-testid=\"left-nav-messages-icon\">\n {messages && <MessagesSmallFill width=\"6px\" height=\"6px\" color={['success', '900']} />}\n </Grid>\n </Grid>\n )}\n </StyledIconContainer>\n);\n\nexport default Notifications;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport {\n AlertsSmallFill,\n Notifications as InternalNotifications,\n ExceptionsSmallFill,\n MessagesSmallFill,\n} from '@elliemae/ds-icons';\nimport { styled } from '@elliemae/ds-system';\nimport Grid from '@elliemae/ds-grid';\nimport { DSLeftNavigationName, DSLeftNavigationSlots } from '../../constants/index.js';\n\nconst StyledIconContainer = styled('div', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.NOTIFICATIONS_CONTAINER,\n})`\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\ntype NotificationsProps = {\n exceptions?: boolean;\n alerts?: boolean;\n messages?: boolean;\n};\n\nexport const Notifications = ({\n exceptions = false,\n alerts = false,\n messages = false,\n}: NotificationsProps): JSX.Element => (\n <StyledIconContainer>\n <InternalNotifications size=\"m\" color={['brand-primary', '800']} data-testid=\"left-nav-notifications-icon\" />\n {(exceptions || alerts || messages) && (\n <Grid cols={['1fr', '1fr', '1fr']} gutter=\"xxxs\" mt=\"2px\">\n <Grid width=\"6px\" height=\"6px\" data-testid=\"left-nav-exceptions-icon\">\n {exceptions && <ExceptionsSmallFill width=\"6px\" height=\"6px\" color={['warning', '900']} />}\n </Grid>\n <Grid width=\"6px\" height=\"6px\" data-testid=\"left-nav-alerts-icon\">\n {alerts && <AlertsSmallFill width=\"6px\" height=\"6px\" color={['danger', '900']} />}\n </Grid>\n <Grid width=\"6px\" height=\"6px\" data-testid=\"left-nav-messages-icon\">\n {messages && <MessagesSmallFill width=\"6px\" height=\"6px\" color={['success', '900']} />}\n </Grid>\n </Grid>\n )}\n </StyledIconContainer>\n);\n\nexport default Notifications;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACgCnB,cAEE,YAFF;AA/BJ;AAAA,EACE;AAAA,EACA,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,sBAAsB,6BAA6B;AAE5D,MAAM,sBAAsB,OAAO,OAAO;AAAA,EACxC,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA;AAAA;AAAA;AAAA;AAYM,MAAM,gBAAgB,CAAC;AAAA,EAC5B,aAAa;AAAA,EACb,SAAS;AAAA,EACT,WAAW;AACb,MACE,qBAAC,uBACC;AAAA,sBAAC,yBAAsB,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG,eAAY,+BAA8B;AAAA,GACzG,cAAc,UAAU,aACxB,qBAAC,QAAK,MAAM,CAAC,OAAO,OAAO,KAAK,GAAG,QAAO,QAAO,IAAG,OAClD;AAAA,wBAAC,QAAK,OAAM,OAAM,QAAO,OAAM,eAAY,4BACxC,wBAAc,oBAAC,uBAAoB,OAAM,OAAM,QAAO,OAAM,OAAO,CAAC,WAAW,KAAK,GAAG,GAC1F;AAAA,IACA,oBAAC,QAAK,OAAM,OAAM,QAAO,OAAM,eAAY,wBACxC,oBAAU,oBAAC,mBAAgB,OAAM,OAAM,QAAO,OAAM,OAAO,CAAC,UAAU,KAAK,GAAG,GACjF;AAAA,IACA,oBAAC,QAAK,OAAM,OAAM,QAAO,OAAM,eAAY,0BACxC,sBAAY,oBAAC,qBAAkB,OAAM,OAAM,QAAO,OAAM,OAAO,CAAC,WAAW,KAAK,GAAG,GACtF;AAAA,KACF;AAAA,GAEJ;AAGF,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,7 +8,7 @@ const StyledOpenWindow = styled(OpenWindowIcon)`
|
|
|
8
8
|
outline: 1px solid ${(props) => props.theme.colors.brand[800]};
|
|
9
9
|
}
|
|
10
10
|
`;
|
|
11
|
-
const OpenWindow = (props) => /* @__PURE__ */ jsx(StyledOpenWindow, { size: "s", color: ["brand-primary", 800], ...props });
|
|
11
|
+
const OpenWindow = (props) => /* @__PURE__ */ jsx(StyledOpenWindow, { size: "s", color: ["brand-primary", "800"], ...props });
|
|
12
12
|
var OpenWindowItem_default = OpenWindow;
|
|
13
13
|
export {
|
|
14
14
|
OpenWindow,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/OpenWindowItem/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { OpenWindow as OpenWindowIcon } from '@elliemae/ds-icons';\n\nconst StyledOpenWindow = styled(OpenWindowIcon)`\n cursor: pointer;\n :focus {\n outline: 1px solid ${(props) => props.theme.colors.brand[800]};\n }\n`;\n\nexport const OpenWindow = (props: unknown): JSX.Element => (\n <StyledOpenWindow size=\"s\" color={['brand-primary', 800]} {...props} />\n);\n\nexport default OpenWindow;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACYrB;AAXF,SAAS,cAAc;AACvB,SAAS,cAAc,sBAAsB;AAE7C,MAAM,mBAAmB,OAAO,cAAc;AAAA;AAAA;AAAA,yBAGrB,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { OpenWindow as OpenWindowIcon } from '@elliemae/ds-icons';\n\nconst StyledOpenWindow = styled(OpenWindowIcon)`\n cursor: pointer;\n :focus {\n outline: 1px solid ${(props) => props.theme.colors.brand[800]};\n }\n`;\n\nexport const OpenWindow = (props: unknown): JSX.Element => (\n <StyledOpenWindow size=\"s\" color={['brand-primary', '800']} {...props} />\n);\n\nexport default OpenWindow;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACYrB;AAXF,SAAS,cAAc;AACvB,SAAS,cAAc,sBAAsB;AAE7C,MAAM,mBAAmB,OAAO,cAAc;AAAA;AAAA;AAAA,yBAGrB,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAIzD,MAAM,aAAa,CAAC,UACzB,oBAAC,oBAAiB,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAI,GAAG,OAAO;AAGzE,IAAO,yBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export * from "./constants";
|
|
3
|
-
export * from "./ItemRenderer";
|
|
4
|
-
export * from "./ChevronItem";
|
|
5
|
-
export * from "./Notifications";
|
|
6
|
-
export * from "./OpenWindowItem";
|
|
7
|
-
export * from "./Icon";
|
|
2
|
+
export * from "./constants.js";
|
|
3
|
+
export * from "./ItemRenderer/index.js";
|
|
4
|
+
export * from "./ChevronItem/index.js";
|
|
5
|
+
export * from "./Notifications/index.js";
|
|
6
|
+
export * from "./OpenWindowItem/index.js";
|
|
7
|
+
export * from "./Icon/index.js";
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/exported-related/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './constants';\nexport * from './ItemRenderer';\nexport * from './ChevronItem';\nexport * from './Notifications';\nexport * from './OpenWindowItem';\nexport * from './Icon';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './constants.js';\nexport * from './ItemRenderer/index.js';\nexport * from './ChevronItem/index.js';\nexport * from './Notifications/index.js';\nexport * from './OpenWindowItem/index.js';\nexport * from './Icon/index.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/hooks/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export * from "./useOpenableOnClickHandler";
|
|
3
|
-
export * from "./useExpandableOnClickHandler";
|
|
4
|
-
export * from "./useKeyboardNavigation";
|
|
2
|
+
export * from "./useOpenableOnClickHandler.js";
|
|
3
|
+
export * from "./useExpandableOnClickHandler.js";
|
|
4
|
+
export * from "./useKeyboardNavigation.js";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './useOpenableOnClickHandler';\nexport * from './useExpandableOnClickHandler';\nexport * from './useKeyboardNavigation';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './useOpenableOnClickHandler.js';\nexport * from './useExpandableOnClickHandler.js';\nexport * from './useKeyboardNavigation.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useCallback, useContext } from "react";
|
|
3
|
-
import LeftNavigationContext from "../LeftNavigationContext";
|
|
3
|
+
import LeftNavigationContext from "../LeftNavigationContext.js";
|
|
4
4
|
const useExpandableOnClickHandler = ({
|
|
5
5
|
id,
|
|
6
6
|
onExpand,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useExpandableOnClickHandler.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { useCallback, useContext } from 'react';\nimport LeftNavigationContext from '../LeftNavigationContext';\n\ntype useExpandableOnClickHandlerProps = {\n id: string;\n onExpand: React.MouseEventHandler & React.KeyboardEventHandler;\n onOpen: React.MouseEventHandler & React.KeyboardEventHandler;\n selectable?: boolean;\n};\n\nexport const useExpandableOnClickHandler = ({\n id,\n onExpand,\n onOpen,\n selectable = true,\n}: useExpandableOnClickHandlerProps): ((e: React.MouseEvent<HTMLElement>) => void) => {\n const {\n leftNavProps: { expanded },\n setSelectedItem,\n } = useContext(LeftNavigationContext);\n\n const handleOnExpand = useCallback(\n (e) => {\n onExpand(e);\n if (selectable) setSelectedItem(id);\n },\n [id, onExpand, setSelectedItem, selectable],\n );\n\n const handleOnOpen = useCallback(\n (e) => {\n onOpen(e);\n if (selectable) setSelectedItem(id);\n },\n [id, onOpen, setSelectedItem, selectable],\n );\n\n const handleOnClick = useCallback(\n (e) => {\n if (!expanded) handleOnExpand(e);\n else handleOnOpen(e);\n },\n [expanded, handleOnExpand, handleOnOpen],\n );\n\n return handleOnClick;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { useCallback, useContext } from 'react';\nimport LeftNavigationContext from '../LeftNavigationContext.js';\n\ntype useExpandableOnClickHandlerProps = {\n id: string;\n onExpand: React.MouseEventHandler & React.KeyboardEventHandler;\n onOpen: React.MouseEventHandler & React.KeyboardEventHandler;\n selectable?: boolean;\n};\n\nexport const useExpandableOnClickHandler = ({\n id,\n onExpand,\n onOpen,\n selectable = true,\n}: useExpandableOnClickHandlerProps): ((e: React.MouseEvent<HTMLElement>) => void) => {\n const {\n leftNavProps: { expanded },\n setSelectedItem,\n } = useContext(LeftNavigationContext);\n\n const handleOnExpand = useCallback(\n (e) => {\n onExpand(e);\n if (selectable) setSelectedItem(id);\n },\n [id, onExpand, setSelectedItem, selectable],\n );\n\n const handleOnOpen = useCallback(\n (e) => {\n onOpen(e);\n if (selectable) setSelectedItem(id);\n },\n [id, onOpen, setSelectedItem, selectable],\n );\n\n const handleOnClick = useCallback(\n (e) => {\n if (!expanded) handleOnExpand(e);\n else handleOnOpen(e);\n },\n [expanded, handleOnExpand, handleOnOpen],\n );\n\n return handleOnClick;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,aAAa,kBAAkB;AACxC,OAAO,2BAA2B;AAS3B,MAAM,8BAA8B,CAAC;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AACf,MAAsF;AACpF,QAAM;AAAA,IACJ,cAAc,EAAE,SAAS;AAAA,IACzB;AAAA,EACF,IAAI,WAAW,qBAAqB;AAEpC,QAAM,iBAAiB;AAAA,IACrB,CAAC,MAAM;AACL,eAAS,CAAC;AACV,UAAI;AAAY,wBAAgB,EAAE;AAAA,IACpC;AAAA,IACA,CAAC,IAAI,UAAU,iBAAiB,UAAU;AAAA,EAC5C;AAEA,QAAM,eAAe;AAAA,IACnB,CAAC,MAAM;AACL,aAAO,CAAC;AACR,UAAI;AAAY,wBAAgB,EAAE;AAAA,IACpC;AAAA,IACA,CAAC,IAAI,QAAQ,iBAAiB,UAAU;AAAA,EAC1C;AAEA,QAAM,gBAAgB;AAAA,IACpB,CAAC,MAAM;AACL,UAAI,CAAC;AAAU,uBAAe,CAAC;AAAA;AAC1B,qBAAa,CAAC;AAAA,IACrB;AAAA,IACA,CAAC,UAAU,gBAAgB,YAAY;AAAA,EACzC;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useCallback, useMemo, useLayoutEffect, useContext } from "react";
|
|
3
|
-
import { CHEVRON_BACK_DS_ID, FOOTER_MENU_CLOSE_DS_ID } from "../exported-related/constants";
|
|
4
|
-
import LeftNavContext from "../LeftNavigationContext";
|
|
3
|
+
import { CHEVRON_BACK_DS_ID, FOOTER_MENU_CLOSE_DS_ID } from "../exported-related/constants.js";
|
|
4
|
+
import LeftNavContext from "../LeftNavigationContext.js";
|
|
5
5
|
const KEY_CODES = {
|
|
6
6
|
TAB: 9,
|
|
7
7
|
ENTER: 13,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useKeyboardNavigation.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport type React from 'react';\nimport { useCallback, useMemo, useLayoutEffect, useContext } from 'react';\nimport { CHEVRON_BACK_DS_ID, FOOTER_MENU_CLOSE_DS_ID } from '../exported-related/constants';\nimport type { GenericItemItemProps } from '../index.d';\nimport LeftNavContext from '../LeftNavigationContext';\n\nconst KEY_CODES = {\n TAB: 9,\n ENTER: 13,\n SPACE: 32,\n LEFT_ARROW: 37,\n UP_ARROW: 38,\n RIGHT_ARROW: 39,\n DOWN_ARROW: 40,\n END: 35,\n HOME: 36,\n};\n\nconst nextIndex = (index: number, length: number) => (index + 1) % length;\nconst prevIndex = (index: number, length: number) => (index - 1 + length) % length;\n\ntype useKeyboardNavigationProps = {\n item: GenericItemItemProps;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onClick: (e: any) => void;\n};\n\nexport const useKeyboardNavigation = ({ item, onClick }: useKeyboardNavigationProps): React.KeyboardEventHandler => {\n const {\n dsId,\n itemOpts: { selectable, openable, closable },\n } = item;\n\n const { visibleItems, visibleItemsRefs } = useContext(LeftNavContext);\n\n const currentIndex = useMemo(\n () => visibleItems.findIndex((visibleItemDsId) => visibleItemDsId === dsId),\n [dsId, visibleItems],\n );\n\n const { setFocusedItem, focusedItem, setSelectedItem } = useContext(LeftNavContext);\n\n const focusAndSelect = useCallback(\n (nextDsId: string) => {\n setFocusedItem(nextDsId);\n setSelectedItem(nextDsId);\n },\n [setFocusedItem, setSelectedItem],\n );\n\n useLayoutEffect(() => {\n if (dsId === focusedItem) visibleItemsRefs.current[dsId]?.current?.focus();\n }, [dsId, focusedItem, visibleItemsRefs]);\n\n const onKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n const { keyCode } = e;\n\n // Prevent default behaviour when not tab\n if (keyCode !== KEY_CODES.TAB) {\n e.preventDefault();\n }\n\n if (keyCode === KEY_CODES.ENTER || keyCode === KEY_CODES.SPACE) {\n if (selectable) {\n onClick(e);\n focusAndSelect(dsId);\n } else if (focusedItem === CHEVRON_BACK_DS_ID) {\n onClick(e);\n focusAndSelect(dsId);\n } else if (focusedItem === FOOTER_MENU_CLOSE_DS_ID) {\n onClick(e);\n setFocusedItem(dsId);\n }\n }\n\n if (openable && keyCode === KEY_CODES.RIGHT_ARROW) {\n onClick(e);\n }\n\n if (closable && keyCode === KEY_CODES.LEFT_ARROW) {\n onClick(e);\n setFocusedItem(dsId);\n }\n\n if (keyCode === KEY_CODES.DOWN_ARROW) {\n const nextDsId = visibleItems[nextIndex(currentIndex, visibleItems.length)];\n setFocusedItem(nextDsId);\n }\n\n if (keyCode === KEY_CODES.UP_ARROW) {\n const prevDsId = visibleItems[prevIndex(currentIndex, visibleItems.length)];\n setFocusedItem(prevDsId);\n }\n\n if (keyCode === KEY_CODES.HOME) {\n setFocusedItem(visibleItems[0]);\n }\n\n if (keyCode === KEY_CODES.END) {\n setFocusedItem(visibleItems[visibleItems.length - 1]);\n }\n },\n [\n openable,\n closable,\n selectable,\n focusedItem,\n onClick,\n focusAndSelect,\n dsId,\n setFocusedItem,\n visibleItems,\n currentIndex,\n ],\n );\n\n return onKeyDown;\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,aAAa,SAAS,iBAAiB,kBAAkB;AAClE,SAAS,oBAAoB,+BAA+B;AAE5D,OAAO,oBAAoB;AAE3B,MAAM,YAAY;AAAA,EAChB,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,MAAM;AACR;AAEA,MAAM,YAAY,CAAC,OAAe,YAAoB,QAAQ,KAAK;AACnE,MAAM,YAAY,CAAC,OAAe,YAAoB,QAAQ,IAAI,UAAU;AAQrE,MAAM,wBAAwB,CAAC,EAAE,MAAM,QAAQ,MAA8D;AAClH,QAAM;AAAA,IACJ;AAAA,IACA,UAAU,EAAE,YAAY,UAAU,SAAS;AAAA,EAC7C,IAAI;AAEJ,QAAM,EAAE,cAAc,iBAAiB,IAAI,WAAW,cAAc;AAEpE,QAAM,eAAe;AAAA,IACnB,MAAM,aAAa,UAAU,CAAC,oBAAoB,oBAAoB,IAAI;AAAA,IAC1E,CAAC,MAAM,YAAY;AAAA,EACrB;AAEA,QAAM,EAAE,gBAAgB,aAAa,gBAAgB,IAAI,WAAW,cAAc;AAElF,QAAM,iBAAiB;AAAA,IACrB,CAAC,aAAqB;AACpB,qBAAe,QAAQ;AACvB,sBAAgB,QAAQ;AAAA,IAC1B;AAAA,IACA,CAAC,gBAAgB,eAAe;AAAA,EAClC;AAEA,kBAAgB,MAAM;AACpB,QAAI,SAAS;AAAa,uBAAiB,QAAQ,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport type React from 'react';\nimport { useCallback, useMemo, useLayoutEffect, useContext } from 'react';\nimport { CHEVRON_BACK_DS_ID, FOOTER_MENU_CLOSE_DS_ID } from '../exported-related/constants.js';\nimport type { GenericItemItemProps } from '../index.d';\nimport LeftNavContext from '../LeftNavigationContext.js';\n\nconst KEY_CODES = {\n TAB: 9,\n ENTER: 13,\n SPACE: 32,\n LEFT_ARROW: 37,\n UP_ARROW: 38,\n RIGHT_ARROW: 39,\n DOWN_ARROW: 40,\n END: 35,\n HOME: 36,\n};\n\nconst nextIndex = (index: number, length: number) => (index + 1) % length;\nconst prevIndex = (index: number, length: number) => (index - 1 + length) % length;\n\ntype useKeyboardNavigationProps = {\n item: GenericItemItemProps;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onClick: (e: any) => void;\n};\n\nexport const useKeyboardNavigation = ({ item, onClick }: useKeyboardNavigationProps): React.KeyboardEventHandler => {\n const {\n dsId,\n itemOpts: { selectable, openable, closable },\n } = item;\n\n const { visibleItems, visibleItemsRefs } = useContext(LeftNavContext);\n\n const currentIndex = useMemo(\n () => visibleItems.findIndex((visibleItemDsId) => visibleItemDsId === dsId),\n [dsId, visibleItems],\n );\n\n const { setFocusedItem, focusedItem, setSelectedItem } = useContext(LeftNavContext);\n\n const focusAndSelect = useCallback(\n (nextDsId: string) => {\n setFocusedItem(nextDsId);\n setSelectedItem(nextDsId);\n },\n [setFocusedItem, setSelectedItem],\n );\n\n useLayoutEffect(() => {\n if (dsId === focusedItem) visibleItemsRefs.current[dsId]?.current?.focus();\n }, [dsId, focusedItem, visibleItemsRefs]);\n\n const onKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n const { keyCode } = e;\n\n // Prevent default behaviour when not tab\n if (keyCode !== KEY_CODES.TAB) {\n e.preventDefault();\n }\n\n if (keyCode === KEY_CODES.ENTER || keyCode === KEY_CODES.SPACE) {\n if (selectable) {\n onClick(e);\n focusAndSelect(dsId);\n } else if (focusedItem === CHEVRON_BACK_DS_ID) {\n onClick(e);\n focusAndSelect(dsId);\n } else if (focusedItem === FOOTER_MENU_CLOSE_DS_ID) {\n onClick(e);\n setFocusedItem(dsId);\n }\n }\n\n if (openable && keyCode === KEY_CODES.RIGHT_ARROW) {\n onClick(e);\n }\n\n if (closable && keyCode === KEY_CODES.LEFT_ARROW) {\n onClick(e);\n setFocusedItem(dsId);\n }\n\n if (keyCode === KEY_CODES.DOWN_ARROW) {\n const nextDsId = visibleItems[nextIndex(currentIndex, visibleItems.length)];\n setFocusedItem(nextDsId);\n }\n\n if (keyCode === KEY_CODES.UP_ARROW) {\n const prevDsId = visibleItems[prevIndex(currentIndex, visibleItems.length)];\n setFocusedItem(prevDsId);\n }\n\n if (keyCode === KEY_CODES.HOME) {\n setFocusedItem(visibleItems[0]);\n }\n\n if (keyCode === KEY_CODES.END) {\n setFocusedItem(visibleItems[visibleItems.length - 1]);\n }\n },\n [\n openable,\n closable,\n selectable,\n focusedItem,\n onClick,\n focusAndSelect,\n dsId,\n setFocusedItem,\n visibleItems,\n currentIndex,\n ],\n );\n\n return onKeyDown;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,aAAa,SAAS,iBAAiB,kBAAkB;AAClE,SAAS,oBAAoB,+BAA+B;AAE5D,OAAO,oBAAoB;AAE3B,MAAM,YAAY;AAAA,EAChB,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,MAAM;AACR;AAEA,MAAM,YAAY,CAAC,OAAe,YAAoB,QAAQ,KAAK;AACnE,MAAM,YAAY,CAAC,OAAe,YAAoB,QAAQ,IAAI,UAAU;AAQrE,MAAM,wBAAwB,CAAC,EAAE,MAAM,QAAQ,MAA8D;AAClH,QAAM;AAAA,IACJ;AAAA,IACA,UAAU,EAAE,YAAY,UAAU,SAAS;AAAA,EAC7C,IAAI;AAEJ,QAAM,EAAE,cAAc,iBAAiB,IAAI,WAAW,cAAc;AAEpE,QAAM,eAAe;AAAA,IACnB,MAAM,aAAa,UAAU,CAAC,oBAAoB,oBAAoB,IAAI;AAAA,IAC1E,CAAC,MAAM,YAAY;AAAA,EACrB;AAEA,QAAM,EAAE,gBAAgB,aAAa,gBAAgB,IAAI,WAAW,cAAc;AAElF,QAAM,iBAAiB;AAAA,IACrB,CAAC,aAAqB;AACpB,qBAAe,QAAQ;AACvB,sBAAgB,QAAQ;AAAA,IAC1B;AAAA,IACA,CAAC,gBAAgB,eAAe;AAAA,EAClC;AAEA,kBAAgB,MAAM;AACpB,QAAI,SAAS;AAAa,uBAAiB,QAAQ,IAAI,GAAG,SAAS,MAAM;AAAA,EAC3E,GAAG,CAAC,MAAM,aAAa,gBAAgB,CAAC;AAExC,QAAM,YAAwC;AAAA,IAC5C,CAAC,MAAM;AACL,YAAM,EAAE,QAAQ,IAAI;AAGpB,UAAI,YAAY,UAAU,KAAK;AAC7B,UAAE,eAAe;AAAA,MACnB;AAEA,UAAI,YAAY,UAAU,SAAS,YAAY,UAAU,OAAO;AAC9D,YAAI,YAAY;AACd,kBAAQ,CAAC;AACT,yBAAe,IAAI;AAAA,QACrB,WAAW,gBAAgB,oBAAoB;AAC7C,kBAAQ,CAAC;AACT,yBAAe,IAAI;AAAA,QACrB,WAAW,gBAAgB,yBAAyB;AAClD,kBAAQ,CAAC;AACT,yBAAe,IAAI;AAAA,QACrB;AAAA,MACF;AAEA,UAAI,YAAY,YAAY,UAAU,aAAa;AACjD,gBAAQ,CAAC;AAAA,MACX;AAEA,UAAI,YAAY,YAAY,UAAU,YAAY;AAChD,gBAAQ,CAAC;AACT,uBAAe,IAAI;AAAA,MACrB;AAEA,UAAI,YAAY,UAAU,YAAY;AACpC,cAAM,WAAW,aAAa,UAAU,cAAc,aAAa,MAAM,CAAC;AAC1E,uBAAe,QAAQ;AAAA,MACzB;AAEA,UAAI,YAAY,UAAU,UAAU;AAClC,cAAM,WAAW,aAAa,UAAU,cAAc,aAAa,MAAM,CAAC;AAC1E,uBAAe,QAAQ;AAAA,MACzB;AAEA,UAAI,YAAY,UAAU,MAAM;AAC9B,uBAAe,aAAa,CAAC,CAAC;AAAA,MAChC;AAEA,UAAI,YAAY,UAAU,KAAK;AAC7B,uBAAe,aAAa,aAAa,SAAS,CAAC,CAAC;AAAA,MACtD;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useCallback, useContext } from "react";
|
|
3
|
-
import LeftNavigationContext from "../LeftNavigationContext";
|
|
3
|
+
import LeftNavigationContext from "../LeftNavigationContext.js";
|
|
4
4
|
const useOpenableOnClickHandler = ({
|
|
5
5
|
id,
|
|
6
6
|
opened,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useOpenableOnClickHandler.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useCallback, useContext } from 'react';\nimport LeftNavigationContext from '../LeftNavigationContext';\n\ntype useOpenableOnClickHandlerProps = {\n id: string;\n onExpand: React.MouseEventHandler & React.KeyboardEventHandler;\n onOpen: React.MouseEventHandler & React.KeyboardEventHandler;\n onClose: React.MouseEventHandler & React.KeyboardEventHandler;\n opened: boolean;\n};\n\nexport const useOpenableOnClickHandler = ({\n id,\n opened,\n onExpand,\n onOpen,\n onClose,\n}: useOpenableOnClickHandlerProps): ((e: React.MouseEvent<HTMLElement>) => void) => {\n const {\n leftNavProps: { expanded },\n setSelectedItem,\n } = useContext(LeftNavigationContext);\n\n const handleOnExpand = useCallback(\n (e) => {\n onExpand(e);\n setSelectedItem(id);\n },\n [id, onExpand, setSelectedItem],\n );\n\n const handleOnOpen = useCallback(\n (e) => {\n onOpen(e);\n setSelectedItem(id);\n },\n [id, onOpen, setSelectedItem],\n );\n\n const handleOnClose = useCallback(\n (e) => {\n onClose(e);\n setSelectedItem(id);\n },\n [id, onClose, setSelectedItem],\n );\n\n const handleOnClick = useCallback(\n (e) => {\n if (!expanded) handleOnExpand(e);\n else if (!opened) handleOnOpen(e);\n else handleOnClose(e);\n },\n [expanded, opened, handleOnExpand, handleOnOpen, handleOnClose],\n );\n\n return handleOnClick;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useCallback, useContext } from 'react';\nimport LeftNavigationContext from '../LeftNavigationContext.js';\n\ntype useOpenableOnClickHandlerProps = {\n id: string;\n onExpand: React.MouseEventHandler & React.KeyboardEventHandler;\n onOpen: React.MouseEventHandler & React.KeyboardEventHandler;\n onClose: React.MouseEventHandler & React.KeyboardEventHandler;\n opened: boolean;\n};\n\nexport const useOpenableOnClickHandler = ({\n id,\n opened,\n onExpand,\n onOpen,\n onClose,\n}: useOpenableOnClickHandlerProps): ((e: React.MouseEvent<HTMLElement>) => void) => {\n const {\n leftNavProps: { expanded },\n setSelectedItem,\n } = useContext(LeftNavigationContext);\n\n const handleOnExpand = useCallback(\n (e) => {\n onExpand(e);\n setSelectedItem(id);\n },\n [id, onExpand, setSelectedItem],\n );\n\n const handleOnOpen = useCallback(\n (e) => {\n onOpen(e);\n setSelectedItem(id);\n },\n [id, onOpen, setSelectedItem],\n );\n\n const handleOnClose = useCallback(\n (e) => {\n onClose(e);\n setSelectedItem(id);\n },\n [id, onClose, setSelectedItem],\n );\n\n const handleOnClick = useCallback(\n (e) => {\n if (!expanded) handleOnExpand(e);\n else if (!opened) handleOnOpen(e);\n else handleOnClose(e);\n },\n [expanded, opened, handleOnExpand, handleOnOpen, handleOnClose],\n );\n\n return handleOnClick;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,aAAa,kBAAkB;AACxC,OAAO,2BAA2B;AAU3B,MAAM,4BAA4B,CAAC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAoF;AAClF,QAAM;AAAA,IACJ,cAAc,EAAE,SAAS;AAAA,IACzB;AAAA,EACF,IAAI,WAAW,qBAAqB;AAEpC,QAAM,iBAAiB;AAAA,IACrB,CAAC,MAAM;AACL,eAAS,CAAC;AACV,sBAAgB,EAAE;AAAA,IACpB;AAAA,IACA,CAAC,IAAI,UAAU,eAAe;AAAA,EAChC;AAEA,QAAM,eAAe;AAAA,IACnB,CAAC,MAAM;AACL,aAAO,CAAC;AACR,sBAAgB,EAAE;AAAA,IACpB;AAAA,IACA,CAAC,IAAI,QAAQ,eAAe;AAAA,EAC9B;AAEA,QAAM,gBAAgB;AAAA,IACpB,CAAC,MAAM;AACL,cAAQ,CAAC;AACT,sBAAgB,EAAE;AAAA,IACpB;AAAA,IACA,CAAC,IAAI,SAAS,eAAe;AAAA,EAC/B;AAEA,QAAM,gBAAgB;AAAA,IACpB,CAAC,MAAM;AACL,UAAI,CAAC;AAAU,uBAAe,CAAC;AAAA,eACtB,CAAC;AAAQ,qBAAa,CAAC;AAAA;AAC3B,sBAAc,CAAC;AAAA,IACtB;AAAA,IACA,CAAC,UAAU,QAAQ,gBAAgB,cAAc,aAAa;AAAA,EAChE;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
|
-
import { ITEM_TYPES } from "../exported-related/constants";
|
|
3
|
+
import { ITEM_TYPES } from "../exported-related/constants.js";
|
|
4
4
|
const { LEFT_NAV_ITEM_SEPARATOR, LEFT_NAV_ITEM_SECTION } = ITEM_TYPES;
|
|
5
5
|
const isSelectableOutOfTheBox = (elem) => typeof elem.type === "string" && elem.type !== LEFT_NAV_ITEM_SEPARATOR && elem.type !== LEFT_NAV_ITEM_SECTION;
|
|
6
6
|
const isSelectableCustom = (elem) => elem.itemOpts.selectable;
|