@elliemae/ds-left-navigation 3.60.0-next.4 → 3.60.0-next.41
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
|
@@ -28,48 +28,78 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var react_desc_prop_types_exports = {};
|
|
30
30
|
__export(react_desc_prop_types_exports, {
|
|
31
|
+
DSLeftNavigationItemPropTypes: () => DSLeftNavigationItemPropTypes,
|
|
32
|
+
DSLeftNavigationItemPropTypesSchema: () => DSLeftNavigationItemPropTypesSchema,
|
|
33
|
+
DSLeftNavigationPropTypes: () => DSLeftNavigationPropTypes,
|
|
34
|
+
DSLeftNavigationPropTypesSchema: () => DSLeftNavigationPropTypesSchema,
|
|
31
35
|
LeftNavItemOptionsSchema: () => LeftNavItemOptionsSchema,
|
|
32
36
|
LeftNavItemPropsSchema: () => LeftNavItemPropsSchema,
|
|
33
|
-
|
|
34
|
-
leftNavigationProps: () => leftNavigationProps
|
|
37
|
+
defaultProps: () => defaultProps
|
|
35
38
|
});
|
|
36
39
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
37
40
|
var React = __toESM(require("react"));
|
|
38
41
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
|
-
var
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
var import_constants = require("./constants/index.js");
|
|
43
|
+
const defaultProps = {
|
|
44
|
+
expandedWidth: "240px",
|
|
45
|
+
loading: false,
|
|
46
|
+
expanded: false,
|
|
47
|
+
openedItem: null,
|
|
48
|
+
footerLabel: "",
|
|
49
|
+
onSelectedChange: () => null,
|
|
50
|
+
onFocusChange: () => null,
|
|
51
|
+
onFooterExpand: () => null,
|
|
52
|
+
onFooterClose: () => null,
|
|
53
|
+
items: [],
|
|
54
|
+
labelOverflow: "wrap",
|
|
55
|
+
onItemClick: () => null,
|
|
56
|
+
isSkeleton: false,
|
|
57
|
+
hideFooterPipe: false
|
|
48
58
|
};
|
|
49
|
-
const
|
|
50
|
-
|
|
59
|
+
const DSLeftNavigationPropTypes = {
|
|
60
|
+
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSLeftNavigationName, import_constants.LEFT_NAVIGATION_SLOTS),
|
|
61
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
62
|
+
...import_ds_props_helpers.xstyledPropTypes,
|
|
63
|
+
expandedWidth: import_ds_props_helpers.PropTypes.string.description("Width of the navigation when expanded").defaultValue("240px"),
|
|
51
64
|
expanded: import_ds_props_helpers.PropTypes.bool.description("Whether to show the left navigation expanded or collapsed").defaultValue(false),
|
|
52
65
|
loading: import_ds_props_helpers.PropTypes.bool.description("Whether the left-nav is loading").defaultValue(false),
|
|
53
66
|
openedItem: import_ds_props_helpers.PropTypes.string.description("The id of the left navigation item you want to be opened").defaultValue(null),
|
|
54
|
-
footerLabel: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.node, import_ds_props_helpers.PropTypes.string]).description(
|
|
55
|
-
"The label to show in the footer item"
|
|
56
|
-
),
|
|
67
|
+
footerLabel: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.node, import_ds_props_helpers.PropTypes.string]).description("The label to show in the footer item").defaultValue(""),
|
|
57
68
|
FooterLabelComponent: import_ds_props_helpers.PropTypes.func.description("The component to show in the footer item"),
|
|
58
|
-
onFooterExpand: import_ds_props_helpers.PropTypes.func.description("The function to call when the left-nav is opened via the footer"),
|
|
59
|
-
onFooterClose: import_ds_props_helpers.PropTypes.func.description("The function to call when the left-nav is closed via the footer"),
|
|
69
|
+
onFooterExpand: import_ds_props_helpers.PropTypes.func.description("The function to call when the left-nav is opened via the footer").defaultValue(() => null),
|
|
70
|
+
onFooterClose: import_ds_props_helpers.PropTypes.func.description("The function to call when the left-nav is closed via the footer").defaultValue(() => null),
|
|
60
71
|
onSelectedChange: import_ds_props_helpers.PropTypes.func.description("A callback which triggers when the selected item changes").defaultValue(() => null),
|
|
61
72
|
onFocusChange: import_ds_props_helpers.PropTypes.func.description("A callback which triggers when the focused item changes").defaultValue(() => null),
|
|
62
73
|
items: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.object).description("The array of items you want to render inside the left nav").defaultValue([]),
|
|
63
|
-
|
|
74
|
+
labelOverflow: import_ds_props_helpers.PropTypes.oneOf(["wrap", "wrapAll", "truncate"]).description("How to handle label overflow").defaultValue("wrap"),
|
|
75
|
+
onItemClick: import_ds_props_helpers.PropTypes.func.description("Callback when an item is clicked").defaultValue(() => null),
|
|
64
76
|
isSkeleton: import_ds_props_helpers.PropTypes.bool.description("Whether the component is in skeleton mode").defaultValue(false),
|
|
65
|
-
hideFooterPipe: import_ds_props_helpers.PropTypes.bool.description("Whether to hide the pipe in the footer").defaultValue(false)
|
|
77
|
+
hideFooterPipe: import_ds_props_helpers.PropTypes.bool.description("Whether to hide the pipe in the footer").defaultValue(false),
|
|
78
|
+
selectedItem: import_ds_props_helpers.PropTypes.string.description("The currently selected item"),
|
|
79
|
+
selectedParent: import_ds_props_helpers.PropTypes.string.description("The parent of the currently selected item"),
|
|
80
|
+
disableDefaultSelection: import_ds_props_helpers.PropTypes.bool.description("Whether you do not want to automatically select the first body item").defaultValue(false),
|
|
81
|
+
withoutBodyShadow: import_ds_props_helpers.PropTypes.bool.description("Whether to hide the body shadow"),
|
|
82
|
+
actionRef: import_ds_props_helpers.PropTypes.object.description("Ref for controlling focus"),
|
|
83
|
+
HeaderComponent: import_ds_props_helpers.PropTypes.object.description("Custom header component"),
|
|
84
|
+
BodyHeaderComponent: import_ds_props_helpers.PropTypes.object.description("Custom body header component")
|
|
85
|
+
};
|
|
86
|
+
const DSLeftNavigationPropTypesSchema = DSLeftNavigationPropTypes;
|
|
87
|
+
const DSLeftNavigationItemPropTypes = {
|
|
88
|
+
type: import_ds_props_helpers.PropTypes.oneOf(import_constants.outOfTheBoxTypes).description("out of the box types"),
|
|
89
|
+
dsId: import_ds_props_helpers.PropTypes.string.description("unique identifier for the left nav item"),
|
|
90
|
+
Component: import_ds_props_helpers.PropTypes.func.description(
|
|
91
|
+
"A custom component, receives the item as prop. This is used only when type is not defined or doesn't matches any out-of-the-box"
|
|
92
|
+
),
|
|
93
|
+
CollapsedComponent: import_ds_props_helpers.PropTypes.func.description("A component which is renderer when the left-nav is collapsed"),
|
|
94
|
+
itemOpts: import_ds_props_helpers.PropTypes.object.description("Item options")
|
|
66
95
|
};
|
|
96
|
+
const DSLeftNavigationItemPropTypesSchema = DSLeftNavigationItemPropTypes;
|
|
67
97
|
const LeftNavItemProps = () => null;
|
|
68
98
|
LeftNavItemProps.displayName = "LeftNavItemProps";
|
|
69
99
|
const LeftNavItemPropsSchema = (0, import_ds_props_helpers.describe)(LeftNavItemProps);
|
|
70
|
-
LeftNavItemPropsSchema.propTypes =
|
|
100
|
+
LeftNavItemPropsSchema.propTypes = DSLeftNavigationItemPropTypes;
|
|
71
101
|
const LeftNavItemOptions = () => null;
|
|
72
102
|
LeftNavItemOptions.displayName = "LeftNavItemOptions";
|
|
73
103
|
const LeftNavItemOptionsSchema = (0, import_ds_props_helpers.describe)(LeftNavItemOptions);
|
|
74
|
-
LeftNavItemOptionsSchema.propTypes =
|
|
104
|
+
LeftNavItemOptionsSchema.propTypes = DSLeftNavigationItemPropTypes;
|
|
75
105
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { type Theme } from '@elliemae/ds-system';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { outOfTheBoxTypes } from './outOfTheBox/index.js';\nimport type { ContextProps } from './LeftNavigationContext.js';\n\ntype ColorsKey = keyof Theme['colors'];\n\nexport declare namespace DSLeftNavigationT {\n export type LabelOveflowT = 'wrap' | 'wrapAll' | 'truncate';\n\n export interface DefaultProps {\n expanded: boolean;\n expandedWidth: string;\n openedItem: string | null;\n items: GenericItemItemProps[];\n footerLabel: string;\n labelOverflow: LabelOveflowT;\n onSelectedChange: (item: string | null) => void;\n onFocusChange: (item: string | null) => void;\n onFooterExpand: () => void;\n onFooterClose: () => void;\n onItemClick: (item: GenericItemItemProps, e: React.MouseEvent<HTMLElement>) => void;\n loading: boolean;\n isSkeleton: boolean;\n hideFooterPipe: boolean;\n }\n export interface OptionalProps {\n FooterLabelComponent?: React.ComponentType<unknown>;\n selectedItem?: string | null;\n selectedParent?: string | null;\n disableDefaultSelection?: boolean;\n withoutBodyShadow?: boolean;\n actionRef?: React.RefObject<{ setFocusedItem: React.Dispatch<React.SetStateAction<string | null>> }>;\n HeaderComponent?: GenericItemItemProps;\n BodyHeaderComponent?: GenericItemItemProps;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n\n export type OutOfTheBoxT =\n | 'ds-left-nav-item-header'\n | 'ds-left-nav-item-link'\n | 'ds-left-nav-item-submenu'\n | 'ds-left-nav-item-controlled-drilldown'\n | 'ds-left-nav-item-uncontrolled-drilldown'\n | 'ds-left-nav-item-section'\n | 'ds-left-nav-item-separator'\n | 'ds-left-nav-item-text-label'\n | 'ds-left-nav-item-with-date';\n\n export interface ItemOptsT extends Record<string, unknown> {\n label?: string | JSX.Element;\n labelBold?: boolean;\n labelColor?: [ColorsKey, keyof Theme['colors'][ColorsKey]];\n labelOverflow?: LabelOveflowT;\n labelRightSection?: string | JSX.Element;\n selectable?: boolean;\n focuseable?: boolean;\n startOpened?: boolean;\n isOpened?: boolean;\n openable?: boolean;\n closable?: boolean;\n indent?: number;\n LeftComponent?: React.ComponentType<ComponentProps>;\n RightComponent?: React.ComponentType<ComponentProps>;\n BottomComponent?: React.ComponentType<ComponentProps>;\n ariaLabel?: string;\n ariaRole?: string;\n ariaLive?: string;\n ariaExpanded?: boolean;\n ariaDescribedBy?: string;\n items?: GenericItemItemProps[];\n labelDataTestId?: string;\n skeletonVariant?: 'item' | 'subitem';\n }\n\n export interface ComponentProps {\n item: GenericItemItemProps;\n ctx: ContextProps;\n }\n export interface GenericItemItemProps {\n dsId?: string;\n type?: string;\n CollapsedComponent?: React.ComponentType<ComponentProps> | null;\n Component?: React.ComponentType<ComponentProps>;\n itemOpts: ItemOptsT;\n }\n export interface OutOfTheBoxMapItemT {\n item: GenericItemItemProps;\n }\n export interface ItemRendererT {\n item: GenericItemItemProps;\n subitems?: JSX.Element[];\n minHeight?: string;\n paddingTop?: string;\n onClick?: () => void;\n shadowStyle?: (opened: boolean, type?: string) => (theme: Theme) => string;\n hasBorderBottom?: boolean;\n borderBottomMr?: string;\n children: React.ReactNode;\n }\n}\nexport const leftNavItemProps = {\n type: PropTypes.oneOf(outOfTheBoxTypes).description('out of the box types'),\n dsId: PropTypes.string.description('unique identifier for the left nav item'),\n Component: PropTypes.func.description(\n \"A custom component, receives the item as prop. This is used only when type is not defined or doesn't matches any out-of-the-box\",\n ),\n CollapsedComponent: PropTypes.func.description('A component which is renderer when the left-nav is collapsed'),\n itemOpts: PropTypes.object.description('Item options'),\n};\n\nexport const leftNavigationProps = {\n containerProps: PropTypes.shape({ expandedWidth: PropTypes.string })\n .description('Set of Properties attached to the main container')\n .defaultValue({ expandedWidth: '240px' }),\n expanded: PropTypes.bool.description('Whether to show the left navigation expanded or collapsed').defaultValue(false),\n loading: PropTypes.bool.description('Whether the left-nav is loading').defaultValue(false),\n openedItem: PropTypes.string\n .description('The id of the left navigation item you want to be opened')\n .defaultValue(null),\n footerLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.string]).description(\n 'The label to show in the footer item',\n ),\n FooterLabelComponent: PropTypes.func.description('The component to show in the footer item'),\n onFooterExpand: PropTypes.func.description('The function to call when the left-nav is opened via the footer'),\n onFooterClose: PropTypes.func.description('The function to call when the left-nav is closed via the footer'),\n onSelectedChange: PropTypes.func\n .description('A callback which triggers when the selected item changes')\n .defaultValue(() => null),\n onFocusChange: PropTypes.func\n .description('A callback which triggers when the focused item changes')\n .defaultValue(() => null),\n items: PropTypes.arrayOf(PropTypes.object)\n .description('The array of items you want to render inside the left nav')\n .defaultValue([]),\n disableDefaultSelection: PropTypes.bool\n .description('Whether you do not want to automatically select the first body item')\n .defaultValue(false),\n isSkeleton: PropTypes.bool.description('Whether the component is in skeleton mode').defaultValue(false),\n hideFooterPipe: PropTypes.bool.description('Whether to hide the pipe in the footer').defaultValue(false),\n} as unknown as WeakValidationMap<DSLeftNavigationT.Props>;\n\nconst LeftNavItemProps = () => null;\nLeftNavItemProps.displayName = 'LeftNavItemProps';\nexport const LeftNavItemPropsSchema = describe(LeftNavItemProps);\nLeftNavItemPropsSchema.propTypes = leftNavItemProps;\n\nconst LeftNavItemOptions = () => null;\nLeftNavItemOptions.displayName = 'LeftNavItemOptions';\nexport const LeftNavItemOptionsSchema = describe(LeftNavItemOptions);\nLeftNavItemOptionsSchema.propTypes = leftNavItemProps;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n describe,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type Theme } from '@elliemae/ds-system';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSLeftNavigationName, LEFT_NAVIGATION_SLOTS, outOfTheBoxTypes } from './constants/index.js';\nimport type { ContextProps } from './LeftNavigationContext.js';\n\ntype ColorsKey = keyof Theme['colors'];\n\nexport declare namespace DSLeftNavigationT {\n export type SlotFunctionArguments = {\n dsLeftnavigationAlertsIcon: () => object;\n dsLeftnavigationAreasContainer: () => object;\n dsLeftnavigationArrowContainer: () => object;\n dsLeftnavigationBodyAreasContainer: () => object;\n dsLeftnavigationBodyHeaderArea: () => object;\n dsLeftnavigationBodyItemsArea: () => object;\n dsLeftnavigationBottomContainer: () => object;\n dsLeftnavigationCollapsedContainer: () => object;\n dsLeftnavigationExceptionsIcon: () => object;\n dsLeftnavigationFooterItem: () => object;\n dsLeftnavigationFooterLabel: () => object;\n dsLeftnavigationFooterMenu: () => object;\n dsLeftnavigationFooterMenuCollapse: () => object;\n dsLeftnavigationFooterSeparator: () => object;\n dsLeftnavigationHeaderArea: () => object;\n dsLeftnavigationItem: () => object;\n dsLeftnavigationItemBorderBottom: () => object;\n dsLeftnavigationItemChevronBack: () => object;\n dsLeftnavigationItemDate: () => object;\n dsLeftnavigationItemLabel: () => object;\n dsLeftnavigationItemSeparator: () => object;\n dsLeftnavigationLeftContainer: () => object;\n dsLeftnavigationLoaderWrapper: () => object;\n dsLeftnavigationMessagesIcon: () => object;\n dsLeftnavigationNotificationsContainer: () => object;\n dsLeftnavigationNotificationsIcon: () => object;\n dsLeftnavigationRightContainer: () => object;\n dsLeftnavigationRoot: () => object;\n dsLeftnavigationSectionContainer: () => object;\n dsLeftnavigationSectionLabel: () => object;\n dsLeftnavigationSectionRightLabel: () => object;\n dsLeftnavigationVerticalSeparator: () => object;\n };\n export type LabelOveflowT = 'wrap' | 'wrapAll' | 'truncate';\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n expanded: boolean;\n expandedWidth: string;\n openedItem: string | null;\n items: GenericItemItemProps[];\n footerLabel: string;\n labelOverflow: LabelOveflowT;\n onSelectedChange: (item: string | null) => void;\n onFocusChange: (item: string | null) => void;\n onFooterExpand: () => void;\n onFooterClose: () => void;\n onItemClick: (item: GenericItemItemProps, e: React.MouseEvent<HTMLElement>) => void;\n loading: boolean;\n isSkeleton: boolean;\n hideFooterPipe: boolean;\n }\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSLeftNavigationName, typeof LEFT_NAVIGATION_SLOTS> {\n FooterLabelComponent?: React.ComponentType<unknown>;\n selectedItem?: string | null;\n selectedParent?: string | null;\n disableDefaultSelection?: boolean;\n withoutBodyShadow?: boolean;\n actionRef?: React.RefObject<{ setFocusedItem: React.Dispatch<React.SetStateAction<string | null>> }>;\n HeaderComponent?: GenericItemItemProps;\n BodyHeaderComponent?: GenericItemItemProps;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export type OutOfTheBoxT =\n | 'ds-left-nav-item-header'\n | 'ds-left-nav-item-link'\n | 'ds-left-nav-item-submenu'\n | 'ds-left-nav-item-controlled-drilldown'\n | 'ds-left-nav-item-uncontrolled-drilldown'\n | 'ds-left-nav-item-section'\n | 'ds-left-nav-item-separator'\n | 'ds-left-nav-item-text-label'\n | 'ds-left-nav-item-with-date';\n\n export interface ItemOptsT extends Record<string, unknown> {\n label?: string | JSX.Element;\n labelBold?: boolean;\n labelColor?: [ColorsKey, keyof Theme['colors'][ColorsKey]];\n labelOverflow?: LabelOveflowT;\n labelRightSection?: string | JSX.Element;\n selectable?: boolean;\n focuseable?: boolean;\n startOpened?: boolean;\n isOpened?: boolean;\n openable?: boolean;\n closable?: boolean;\n indent?: number;\n LeftComponent?: React.ComponentType<ComponentProps>;\n RightComponent?: React.ComponentType<ComponentProps>;\n BottomComponent?: React.ComponentType<ComponentProps>;\n ariaLabel?: string;\n ariaRole?: string;\n ariaLive?: string;\n ariaExpanded?: boolean;\n ariaDescribedBy?: string;\n items?: GenericItemItemProps[];\n labelDataTestId?: string;\n skeletonVariant?: 'item' | 'subitem';\n }\n\n export interface ComponentProps {\n item: GenericItemItemProps;\n ctx: ContextProps;\n }\n export interface GenericItemItemProps {\n dsId?: string;\n type?: string;\n CollapsedComponent?: React.ComponentType<ComponentProps> | null;\n Component?: React.ComponentType<ComponentProps>;\n itemOpts: ItemOptsT;\n }\n export interface OutOfTheBoxMapItemT {\n item: GenericItemItemProps;\n }\n export interface ItemRendererT {\n item: GenericItemItemProps;\n subitems?: JSX.Element[];\n minHeight?: string;\n paddingTop?: string;\n onClick?: () => void;\n shadowStyle?: (opened: boolean, type?: string) => (theme: Theme) => string;\n hasBorderBottom?: boolean;\n borderBottomMr?: string;\n children: React.ReactNode;\n }\n}\n\nexport const defaultProps: DSLeftNavigationT.DefaultProps = {\n expandedWidth: '240px',\n loading: false,\n expanded: false,\n openedItem: null,\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n items: [],\n labelOverflow: 'wrap' as DSLeftNavigationT.LabelOveflowT,\n onItemClick: () => null,\n isSkeleton: false,\n hideFooterPipe: false,\n};\n\nexport const DSLeftNavigationPropTypes: DSPropTypesSchema<DSLeftNavigationT.Props> = {\n ...getPropsPerSlotPropTypes(DSLeftNavigationName, LEFT_NAVIGATION_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n\n expandedWidth: PropTypes.string.description('Width of the navigation when expanded').defaultValue('240px'),\n expanded: PropTypes.bool.description('Whether to show the left navigation expanded or collapsed').defaultValue(false),\n loading: PropTypes.bool.description('Whether the left-nav is loading').defaultValue(false),\n openedItem: PropTypes.string\n .description('The id of the left navigation item you want to be opened')\n .defaultValue(null),\n footerLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.string])\n .description('The label to show in the footer item')\n .defaultValue(''),\n FooterLabelComponent: PropTypes.func.description('The component to show in the footer item'),\n onFooterExpand: PropTypes.func\n .description('The function to call when the left-nav is opened via the footer')\n .defaultValue(() => null),\n onFooterClose: PropTypes.func\n .description('The function to call when the left-nav is closed via the footer')\n .defaultValue(() => null),\n onSelectedChange: PropTypes.func\n .description('A callback which triggers when the selected item changes')\n .defaultValue(() => null),\n onFocusChange: PropTypes.func\n .description('A callback which triggers when the focused item changes')\n .defaultValue(() => null),\n items: PropTypes.arrayOf(PropTypes.object)\n .description('The array of items you want to render inside the left nav')\n .defaultValue([]),\n labelOverflow: PropTypes.oneOf(['wrap', 'wrapAll', 'truncate'])\n .description('How to handle label overflow')\n .defaultValue('wrap'),\n onItemClick: PropTypes.func.description('Callback when an item is clicked').defaultValue(() => null),\n isSkeleton: PropTypes.bool.description('Whether the component is in skeleton mode').defaultValue(false),\n hideFooterPipe: PropTypes.bool.description('Whether to hide the pipe in the footer').defaultValue(false),\n selectedItem: PropTypes.string.description('The currently selected item'),\n selectedParent: PropTypes.string.description('The parent of the currently selected item'),\n disableDefaultSelection: PropTypes.bool\n .description('Whether you do not want to automatically select the first body item')\n .defaultValue(false),\n withoutBodyShadow: PropTypes.bool.description('Whether to hide the body shadow'),\n actionRef: PropTypes.object.description('Ref for controlling focus'),\n HeaderComponent: PropTypes.object.description('Custom header component'),\n BodyHeaderComponent: PropTypes.object.description('Custom body header component'),\n};\n\nexport const DSLeftNavigationPropTypesSchema =\n DSLeftNavigationPropTypes as unknown as ValidationMap<DSLeftNavigationT.Props>;\n\nexport const DSLeftNavigationItemPropTypes: DSPropTypesSchema<DSLeftNavigationT.GenericItemItemProps> = {\n type: PropTypes.oneOf(outOfTheBoxTypes).description('out of the box types'),\n dsId: PropTypes.string.description('unique identifier for the left nav item'),\n Component: PropTypes.func.description(\n \"A custom component, receives the item as prop. This is used only when type is not defined or doesn't matches any out-of-the-box\",\n ),\n CollapsedComponent: PropTypes.func.description('A component which is renderer when the left-nav is collapsed'),\n itemOpts: PropTypes.object.description('Item options'),\n};\n\nexport const DSLeftNavigationItemPropTypesSchema =\n DSLeftNavigationItemPropTypes as unknown as ValidationMap<DSLeftNavigationT.GenericItemItemProps>;\n\nconst LeftNavItemProps = () => null;\nLeftNavItemProps.displayName = 'LeftNavItemProps';\nexport const LeftNavItemPropsSchema = describe(LeftNavItemProps);\nLeftNavItemPropsSchema.propTypes = DSLeftNavigationItemPropTypes;\n\nconst LeftNavItemOptions = () => null;\nLeftNavItemOptions.displayName = 'LeftNavItemOptions';\nexport const LeftNavItemOptionsSchema = describe(LeftNavItemOptions);\nLeftNavItemOptionsSchema.propTypes = DSLeftNavigationItemPropTypes;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAMO;AAGP,uBAA8E;AAqJvE,MAAM,eAA+C;AAAA,EAC1D,eAAe;AAAA,EACf,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,kBAAkB,MAAM;AAAA,EACxB,eAAe,MAAM;AAAA,EACrB,gBAAgB,MAAM;AAAA,EACtB,eAAe,MAAM;AAAA,EACrB,OAAO,CAAC;AAAA,EACR,eAAe;AAAA,EACf,aAAa,MAAM;AAAA,EACnB,YAAY;AAAA,EACZ,gBAAgB;AAClB;AAEO,MAAM,4BAAwE;AAAA,EACnF,OAAG,kDAAyB,uCAAsB,sCAAqB;AAAA,EACvE,GAAG;AAAA,EACH,GAAG;AAAA,EAEH,eAAe,kCAAU,OAAO,Y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ACrB,mBAAmB,kCAAU,KAAK,YAAY,iCAAiC;AAAA,EAC/E,WAAW,kCAAU,OAAO,YAAY,2BAA2B;AAAA,EACnE,iBAAiB,kCAAU,OAAO,YAAY,yBAAyB;AAAA,EACvE,qBAAqB,kCAAU,OAAO,YAAY,8BAA8B;AAClF;AAEO,MAAM,kCACX;AAEK,MAAM,gCAA2F;AAAA,EACtG,MAAM,kCAAU,MAAM,iCAAgB,EAAE,YAAY,sBAAsB;AAAA,EAC1E,MAAM,kCAAU,OAAO,YAAY,yCAAyC;AAAA,EAC5E,WAAW,kCAAU,KAAK;AAAA,IACxB;AAAA,EACF;AAAA,EACA,oBAAoB,kCAAU,KAAK,YAAY,8DAA8D;AAAA,EAC7G,UAAU,kCAAU,OAAO,YAAY,cAAc;AACvD;AAEO,MAAM,sCACX;AAEF,MAAM,mBAAmB,MAAM;AAC/B,iBAAiB,cAAc;AACxB,MAAM,6BAAyB,kCAAS,gBAAgB;AAC/D,uBAAuB,YAAY;AAEnC,MAAM,qBAAqB,MAAM;AACjC,mBAAmB,cAAc;AAC1B,MAAM,+BAA2B,kCAAS,kBAAkB;AACnE,yBAAyB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
const SlotPropsAsObject = {
|
|
26
|
+
dsLeftnavigationAlertsIcon: { "aria-label": "just a typescript test" },
|
|
27
|
+
dsLeftnavigationAreasContainer: { "aria-label": "just a typescript test" },
|
|
28
|
+
dsLeftnavigationArrowContainer: { "aria-label": "just a typescript test" },
|
|
29
|
+
dsLeftnavigationBodyAreasContainer: { "aria-label": "just a typescript test" },
|
|
30
|
+
dsLeftnavigationBodyHeaderArea: { "aria-label": "just a typescript test" },
|
|
31
|
+
dsLeftnavigationBodyItemsArea: { "aria-label": "just a typescript test" },
|
|
32
|
+
dsLeftnavigationBottomContainer: { "aria-label": "just a typescript test" },
|
|
33
|
+
dsLeftnavigationCollapsedContainer: { "aria-label": "just a typescript test" },
|
|
34
|
+
dsLeftnavigationExceptionsIcon: { "aria-label": "just a typescript test" },
|
|
35
|
+
dsLeftnavigationFooterItem: { "aria-label": "just a typescript test" },
|
|
36
|
+
dsLeftnavigationFooterLabel: { "aria-label": "just a typescript test" },
|
|
37
|
+
dsLeftnavigationFooterMenu: { "aria-label": "just a typescript test" },
|
|
38
|
+
dsLeftnavigationFooterMenuCollapse: { "aria-label": "just a typescript test" },
|
|
39
|
+
dsLeftnavigationFooterSeparator: { "aria-label": "just a typescript test" },
|
|
40
|
+
dsLeftnavigationHeaderArea: { "aria-label": "just a typescript test" },
|
|
41
|
+
dsLeftnavigationItem: { "aria-label": "just a typescript test" },
|
|
42
|
+
dsLeftnavigationItemBorderBottom: { "aria-label": "just a typescript test" },
|
|
43
|
+
dsLeftnavigationItemChevronBack: { "aria-label": "just a typescript test" },
|
|
44
|
+
dsLeftnavigationItemDate: { "aria-label": "just a typescript test" },
|
|
45
|
+
dsLeftnavigationItemLabel: { "aria-label": "just a typescript test" },
|
|
46
|
+
dsLeftnavigationItemSeparator: { "aria-label": "just a typescript test" },
|
|
47
|
+
dsLeftnavigationLeftContainer: { "aria-label": "just a typescript test" },
|
|
48
|
+
dsLeftnavigationLoaderWrapper: { "aria-label": "just a typescript test" },
|
|
49
|
+
dsLeftnavigationMessagesIcon: { "aria-label": "just a typescript test" },
|
|
50
|
+
dsLeftnavigationNotificationsContainer: { "aria-label": "just a typescript test" },
|
|
51
|
+
dsLeftnavigationNotificationsIcon: { "aria-label": "just a typescript test" },
|
|
52
|
+
dsLeftnavigationRightContainer: { "aria-label": "just a typescript test" },
|
|
53
|
+
dsLeftnavigationRoot: { "aria-label": "just a typescript test" },
|
|
54
|
+
dsLeftnavigationSectionContainer: { "aria-label": "just a typescript test" },
|
|
55
|
+
dsLeftnavigationSectionLabel: { "aria-label": "just a typescript test" },
|
|
56
|
+
dsLeftnavigationSectionRightLabel: { "aria-label": "just a typescript test" },
|
|
57
|
+
dsLeftnavigationVerticalSeparator: { "aria-label": "just a typescript test" }
|
|
58
|
+
};
|
|
59
|
+
const SlotPropsAsFunctions = {
|
|
60
|
+
dsLeftnavigationAlertsIcon: () => ({ "aria-label": "just a typescript test" }),
|
|
61
|
+
dsLeftnavigationAreasContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
62
|
+
dsLeftnavigationArrowContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
63
|
+
dsLeftnavigationBodyAreasContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
64
|
+
dsLeftnavigationBodyHeaderArea: () => ({ "aria-label": "just a typescript test" }),
|
|
65
|
+
dsLeftnavigationBodyItemsArea: () => ({ "aria-label": "just a typescript test" }),
|
|
66
|
+
dsLeftnavigationBottomContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
67
|
+
dsLeftnavigationCollapsedContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
68
|
+
dsLeftnavigationExceptionsIcon: () => ({ "aria-label": "just a typescript test" }),
|
|
69
|
+
dsLeftnavigationFooterItem: () => ({ "aria-label": "just a typescript test" }),
|
|
70
|
+
dsLeftnavigationFooterLabel: () => ({ "aria-label": "just a typescript test" }),
|
|
71
|
+
dsLeftnavigationFooterMenu: () => ({ "aria-label": "just a typescript test" }),
|
|
72
|
+
dsLeftnavigationFooterMenuCollapse: () => ({ "aria-label": "just a typescript test" }),
|
|
73
|
+
dsLeftnavigationFooterSeparator: () => ({ "aria-label": "just a typescript test" }),
|
|
74
|
+
dsLeftnavigationHeaderArea: () => ({ "aria-label": "just a typescript test" }),
|
|
75
|
+
dsLeftnavigationItem: () => ({ "aria-label": "just a typescript test" }),
|
|
76
|
+
dsLeftnavigationItemBorderBottom: () => ({ "aria-label": "just a typescript test" }),
|
|
77
|
+
dsLeftnavigationItemChevronBack: () => ({ "aria-label": "just a typescript test" }),
|
|
78
|
+
dsLeftnavigationItemDate: () => ({ "aria-label": "just a typescript test" }),
|
|
79
|
+
dsLeftnavigationItemLabel: () => ({ "aria-label": "just a typescript test" }),
|
|
80
|
+
dsLeftnavigationItemSeparator: () => ({ "aria-label": "just a typescript test" }),
|
|
81
|
+
dsLeftnavigationLeftContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
82
|
+
dsLeftnavigationLoaderWrapper: () => ({ "aria-label": "just a typescript test" }),
|
|
83
|
+
dsLeftnavigationMessagesIcon: () => ({ "aria-label": "just a typescript test" }),
|
|
84
|
+
dsLeftnavigationNotificationsContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
85
|
+
dsLeftnavigationNotificationsIcon: () => ({ "aria-label": "just a typescript test" }),
|
|
86
|
+
dsLeftnavigationRightContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
87
|
+
dsLeftnavigationRoot: () => ({ "aria-label": "just a typescript test" }),
|
|
88
|
+
dsLeftnavigationSectionContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
89
|
+
dsLeftnavigationSectionLabel: () => ({ "aria-label": "just a typescript test" }),
|
|
90
|
+
dsLeftnavigationSectionRightLabel: () => ({ "aria-label": "just a typescript test" }),
|
|
91
|
+
dsLeftnavigationVerticalSeparator: () => ({ "aria-label": "just a typescript test" })
|
|
92
|
+
};
|
|
93
|
+
const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
|
|
94
|
+
//# sourceMappingURL=slot-props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSLeftNavigationName, LEFT_NAVIGATION_SLOTS } from '../constants/index.js';\nimport type { DSLeftNavigationT } from '../index.js';\n\nconst SlotPropsAsObject: Partial<DSLeftNavigationT.Props> = {\n dsLeftnavigationAlertsIcon: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationAreasContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationArrowContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationBodyAreasContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationBodyHeaderArea: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationBodyItemsArea: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationBottomContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationCollapsedContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationExceptionsIcon: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationFooterItem: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationFooterLabel: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationFooterMenu: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationFooterMenuCollapse: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationFooterSeparator: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationHeaderArea: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationItem: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationItemBorderBottom: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationItemChevronBack: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationItemDate: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationItemLabel: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationItemSeparator: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationLeftContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationLoaderWrapper: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationMessagesIcon: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationNotificationsContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationNotificationsIcon: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationRightContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationRoot: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationSectionContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationSectionLabel: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationSectionRightLabel: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationVerticalSeparator: { 'aria-label': 'just a typescript test' },\n};\nconst SlotPropsAsFunctions: DSLeftNavigationT.SlotFunctionArguments = {\n dsLeftnavigationAlertsIcon: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationAreasContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationArrowContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationBodyAreasContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationBodyHeaderArea: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationBodyItemsArea: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationBottomContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationCollapsedContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationExceptionsIcon: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationFooterItem: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationFooterLabel: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationFooterMenu: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationFooterMenuCollapse: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationFooterSeparator: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationHeaderArea: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationItem: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationItemBorderBottom: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationItemChevronBack: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationItemDate: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationItemLabel: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationItemSeparator: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationLeftContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationLoaderWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationMessagesIcon: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationNotificationsContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationNotificationsIcon: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationRightContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationRoot: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationSectionContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationSectionLabel: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationSectionRightLabel: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationVerticalSeparator: () => ({ 'aria-label': 'just a typescript test' }),\n};\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSLeftNavigationName, typeof LEFT_NAVIGATION_SLOTS>\n> = SlotPropsAsFunctions;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACKvB,MAAM,oBAAsD;AAAA,EAC1D,4BAA4B,EAAE,cAAc,yBAAyB;AAAA,EACrE,gCAAgC,EAAE,cAAc,yBAAyB;AAAA,EACzE,gCAAgC,EAAE,cAAc,yBAAyB;AAAA,EACzE,oCAAoC,EAAE,cAAc,yBAAyB;AAAA,EAC7E,gCAAgC,EAAE,cAAc,yBAAyB;AAAA,EACzE,+BAA+B,EAAE,cAAc,yBAAyB;AAAA,EACxE,iCAAiC,EAAE,cAAc,yBAAyB;AAAA,EAC1E,oCAAoC,EAAE,cAAc,yBAAyB;AAAA,EAC7E,gCAAgC,EAAE,cAAc,yBAAyB;AAAA,EACzE,4BAA4B,EAAE,cAAc,yBAAyB;AAAA,EACrE,6BAA6B,EAAE,cAAc,yBAAyB;AAAA,EACtE,4BAA4B,EAAE,cAAc,yBAAyB;AAAA,EACrE,oCAAoC,EAAE,cAAc,yBAAyB;AAAA,EAC7E,iCAAiC,EAAE,cAAc,yBAAyB;AAAA,EAC1E,4BAA4B,EAAE,cAAc,yBAAyB;AAAA,EACrE,sBAAsB,EAAE,cAAc,yBAAyB;AAAA,EAC/D,kCAAkC,EAAE,cAAc,yBAAyB;AAAA,EAC3E,iCAAiC,EAAE,cAAc,yBAAyB;AAAA,EAC1E,0BAA0B,EA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Ac,yBAAyB;AAAA,EACjF,4BAA4B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC5E,sBAAsB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACtE,kCAAkC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAClF,iCAAiC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACjF,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,2BAA2B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC3E,+BAA+B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC/E,+BAA+B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC/E,+BAA+B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC/E,8BAA8B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC9E,wCAAwC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACxF,mCAAmC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACnF,gCAAgC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAChF,sBAAsB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACtE,kCAAkC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAClF,8BAA8B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC9E,mCAAmC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACnF,mCAAmC,OAAO,EAAE,cAAc,yBAAyB;AACrF;AACA,MAAM,6CAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -25,7 +25,7 @@ var React = __toESM(require("react"));
|
|
|
25
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
26
|
var import_react = require("react");
|
|
27
27
|
var import__ = require("../index.js");
|
|
28
|
-
var import_constants = require("../
|
|
28
|
+
var import_constants = require("../constants/index.js");
|
|
29
29
|
const ref = (0, import_react.createRef)();
|
|
30
30
|
const testOptionalProps = {
|
|
31
31
|
selectedItem: "selected item",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-left-navigation-valid.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { createRef } from 'react';\nimport { LeftNavigation } from '../index.js';\nimport type { DSLeftNavigationT } from '../index.js';\nimport { ITEM_TYPES } from '../
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { createRef } from 'react';\nimport { LeftNavigation } from '../index.js';\nimport type { DSLeftNavigationT } from '../index.js';\nimport { ITEM_TYPES } from '../constants/index.js';\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSLeftNavigationT.Props;\ntype ComponentPropsInternals = DSLeftNavigationT.InternalProps;\ntype ComponentPropsDefaultProps = DSLeftNavigationT.DefaultProps;\ntype ComponentPropsOptionalProps = DSLeftNavigationT.OptionalProps;\n\nconst ref = createRef<{ setFocusedItem: React.Dispatch<React.SetStateAction<string | null>> }>();\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n selectedItem: 'selected item',\n selectedParent: 'parent',\n disableDefaultSelection: true,\n withoutBodyShadow: true,\n actionRef: ref,\n HeaderComponent: {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n BodyHeaderComponent: {\n type: ITEM_TYPES.LEFT_NAV_ITEM_SUBMENU,\n dsId: 'application-submenu-forms-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Forms',\n },\n },\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {};\nconst testProps: ComponentPropsForApp = {\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n expanded: true,\n expandedWidth: '100px',\n openedItem: 'opened item',\n items: [\n {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n ],\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n labelOverflow: 'wrap',\n onItemClick: () => null,\n isSkeleton: false,\n loading: false,\n hideFooterPipe: false,\n};\nconst testInternalProps: ComponentPropsInternals = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n expanded: true,\n expandedWidth: '100px',\n openedItem: 'opened item',\n items: [\n {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n ],\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n labelOverflow: 'wrap',\n onItemClick: () => null,\n isSkeleton: false,\n loading: false,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n expanded: true,\n expandedWidth: '100px',\n openedItem: 'opened item',\n items: [\n {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n ],\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n labelOverflow: 'wrap',\n onItemClick: () => null,\n isSkeleton: false,\n loading: false,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n expanded: true,\n expandedWidth: '100px',\n openedItem: 'opened item',\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n labelOverflow: 'wrap',\n onItemClick: () => null,\n isSkeleton: false,\n loading: false,\n} as const;\n\nconst ComponentDummy = () => <div />;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <LeftNavigation {...testExplicitDefinition} />\n <LeftNavigation {...testInferedTypeCompatibility} />\n <LeftNavigation {...testDefinitionAsConst} />\n {/* works with inline values */}\n <LeftNavigation\n expanded\n expandedWidth=\"100px\"\n openedItem=\"opened item\"\n items={[\n {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: ComponentDummy,\n itemOpts: {\n label: 'Notifications',\n },\n },\n ]}\n footerLabel=\"\"\n onSelectedChange={() => null}\n onFocusChange={() => null}\n onFooterExpand={() => null}\n onFooterClose={() => null}\n labelOverflow=\"wrap\"\n onItemClick={() => null}\n />\n </>\n);\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACsBO;AArB9B,mBAA0B;AAC1B,eAA+B;AAE/B,uBAA2B;AAO3B,MAAM,UAAM,wBAAmF;AAE/F,MAAM,oBAAiD;AAAA,EACrD,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,iBAAiB;AAAA,IACf,MAAM,4BAAW;AAAA,IACjB,MAAM;AAAA,IACN,oBAAoB,MAAM,4CAAC,SAAI;AAAA,IAC/B,UAAU;AAAA,MACR,OAAO;AAAA,IACT;AAAA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YACR,OAAO;AAAA,UACT;AAAA,QACF;AAAA,MACF;AAAA,MACA,aAAY;AAAA,MACZ,kBAAkB,MAAM;AAAA,MACxB,eAAe,MAAM;AAAA,MACrB,gBAAgB,MAAM;AAAA,MACtB,eAAe,MAAM;AAAA,MACrB,eAAc;AAAA,MACd,aAAa,MAAM;AAAA;AAAA,EACrB;AAAA,GACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
|
-
import {
|
|
5
|
-
import LeftNavigationContext
|
|
6
|
-
import { useLeftNavConfig } from "./
|
|
4
|
+
import { DSLeftNavigationPropTypesSchema, defaultProps } from "./react-desc-prop-types.js";
|
|
5
|
+
import LeftNavigationContext from "./LeftNavigationContext.js";
|
|
6
|
+
import { useLeftNavConfig } from "./config/useLeftNavConfig.js";
|
|
7
7
|
import LeftNavContent from "./parts/LeftNavContent/index.js";
|
|
8
8
|
const LeftNavigation = (props) => {
|
|
9
9
|
const leftNavConfig = useLeftNavConfig(props);
|
|
@@ -12,7 +12,7 @@ const LeftNavigation = (props) => {
|
|
|
12
12
|
LeftNavigation.defaultProps = defaultProps;
|
|
13
13
|
LeftNavigation.displayName = "LeftNavigation";
|
|
14
14
|
const LeftNavigationWithSchema = describe(LeftNavigation).description("Left Navigation");
|
|
15
|
-
LeftNavigationWithSchema.propTypes =
|
|
15
|
+
LeftNavigationWithSchema.propTypes = DSLeftNavigationPropTypesSchema;
|
|
16
16
|
export {
|
|
17
17
|
LeftNavigation,
|
|
18
18
|
LeftNavigationWithSchema
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/LeftNavigation.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACajB;AAZN,SAAS,gBAAgB;AACzB,SAAS,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSLeftNavigationPropTypesSchema, defaultProps } from './react-desc-prop-types.js';\nimport LeftNavigationContext from './LeftNavigationContext.js';\nimport { useLeftNavConfig } from './config/useLeftNavConfig.js';\nimport LeftNavContent from './parts/LeftNavContent/index.js';\nimport type { DSLeftNavigationT } from './react-desc-prop-types.js';\n\nexport const LeftNavigation = (props: DSLeftNavigationT.Props): JSX.Element => {\n const leftNavConfig = useLeftNavConfig(props);\n\n return (\n <LeftNavigationContext.Provider value={leftNavConfig}>\n <LeftNavContent />\n </LeftNavigationContext.Provider>\n );\n};\n\nLeftNavigation.defaultProps = defaultProps;\nLeftNavigation.displayName = 'LeftNavigation';\nexport const LeftNavigationWithSchema = describe(LeftNavigation).description('Left Navigation');\nLeftNavigationWithSchema.propTypes = DSLeftNavigationPropTypesSchema;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACajB;AAZN,SAAS,gBAAgB;AACzB,SAAS,iCAAiC,oBAAoB;AAC9D,OAAO,2BAA2B;AAClC,SAAS,wBAAwB;AACjC,OAAO,oBAAoB;AAGpB,MAAM,iBAAiB,CAAC,UAAgD;AAC7E,QAAM,gBAAgB,iBAAiB,KAAK;AAE5C,SACE,oBAAC,sBAAsB,UAAtB,EAA+B,OAAO,eACrC,8BAAC,kBAAe,GAClB;AAEJ;AAEA,eAAe,eAAe;AAC9B,eAAe,cAAc;AACtB,MAAM,2BAA2B,SAAS,cAAc,EAAE,YAAY,iBAAiB;AAC9F,yBAAyB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { createContext } from "react";
|
|
3
|
-
|
|
4
|
-
expandedWidth: "240px",
|
|
5
|
-
loading: false,
|
|
6
|
-
expanded: false,
|
|
7
|
-
openedItem: null,
|
|
8
|
-
footerLabel: "",
|
|
9
|
-
onSelectedChange: () => null,
|
|
10
|
-
onFocusChange: () => null,
|
|
11
|
-
onFooterExpand: () => null,
|
|
12
|
-
onFooterClose: () => null,
|
|
13
|
-
items: [],
|
|
14
|
-
labelOverflow: "wrap",
|
|
15
|
-
onItemClick: () => null,
|
|
16
|
-
isSkeleton: false,
|
|
17
|
-
hideFooterPipe: false
|
|
18
|
-
};
|
|
3
|
+
import { defaultProps } from "./react-desc-prop-types.js";
|
|
19
4
|
const defaultContext = {
|
|
20
5
|
leftNavProps: defaultProps,
|
|
21
6
|
selectedItem: null,
|
|
@@ -35,7 +20,6 @@ var LeftNavigationContext_default = LeftNavContext;
|
|
|
35
20
|
export {
|
|
36
21
|
LeftNavContext,
|
|
37
22
|
LeftNavigationContext_default as default,
|
|
38
|
-
defaultContext
|
|
39
|
-
defaultProps
|
|
23
|
+
defaultContext
|
|
40
24
|
};
|
|
41
25
|
//# sourceMappingURL=LeftNavigationContext.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/LeftNavigationContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { MutableRefObject, RefObject } from 'react';\nimport
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,qBAAqB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport type { MutableRefObject, RefObject } from 'react';\nimport { createContext } from 'react';\nimport type { DSLeftNavigationT } from './react-desc-prop-types.js';\nimport { defaultProps } from './react-desc-prop-types.js';\n\nexport type ContextProps = {\n selectedItem: string | null;\n setSelectedItem: React.Dispatch<React.SetStateAction<string | null>>;\n selectedParent: string | null;\n setSelectedParent: React.Dispatch<React.SetStateAction<string | null>>;\n focusedItem: string | null;\n setFocusedItem: React.Dispatch<React.SetStateAction<string | null>>;\n openedDrilldowns: string[];\n setOpenedDrilldowns: React.Dispatch<React.SetStateAction<string[]>>;\n visibleItems: string[];\n visibleItemsRefs: MutableRefObject<Record<string, RefObject<HTMLDivElement>>>;\n leftNavProps: DSLeftNavigationT.InternalProps;\n expandedForAnimation: boolean;\n};\n\nexport const defaultContext: ContextProps = {\n leftNavProps: defaultProps,\n selectedItem: null,\n setSelectedItem: () => null,\n selectedParent: null,\n setSelectedParent: () => null,\n focusedItem: null,\n setFocusedItem: () => null,\n expandedForAnimation: true,\n openedDrilldowns: [],\n setOpenedDrilldowns: () => null,\n visibleItems: [],\n visibleItemsRefs: { current: {} },\n};\n\nexport const LeftNavContext = createContext<ContextProps>(defaultContext);\n\nexport default LeftNavContext;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,qBAAqB;AAE9B,SAAS,oBAAoB;AAiBtB,MAAM,iBAA+B;AAAA,EAC1C,cAAc;AAAA,EACd,cAAc;AAAA,EACd,iBAAiB,MAAM;AAAA,EACvB,gBAAgB;AAAA,EAChB,mBAAmB,MAAM;AAAA,EACzB,aAAa;AAAA,EACb,gBAAgB,MAAM;AAAA,EACtB,sBAAsB;AAAA,EACtB,kBAAkB,CAAC;AAAA,EACnB,qBAAqB,MAAM;AAAA,EAC3B,cAAc,CAAC;AAAA,EACf,kBAAkB,EAAE,SAAS,CAAC,EAAE;AAClC;AAEO,MAAM,iBAAiB,cAA4B,cAAc;AAExE,IAAO,gCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useLeftNavConfig } from "./useLeftNavConfig.js";
|
|
3
3
|
import { useLeftNavConfig as useLeftNavConfig2 } from "./useLeftNavConfig.js";
|
|
4
|
-
var
|
|
4
|
+
var config_default = useLeftNavConfig;
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
config_default as default,
|
|
7
7
|
useLeftNavConfig2 as useLeftNavConfig
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/index.tsx"],
|
|
4
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
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,wBAAwB;AAEjC,SAAS,oBAAAA,yBAAwB;AACjC,IAAO,
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,wBAAwB;AAEjC,SAAS,oBAAAA,yBAAwB;AACjC,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["useLeftNavConfig"]
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import React2 from "react";
|
|
3
2
|
import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
4
|
-
import
|
|
3
|
+
import React2 from "react";
|
|
4
|
+
import { useSelectFirstBodyItem } from "../hooks/useSelectFirstBodyItem.js";
|
|
5
|
+
import { defaultProps } from "../react-desc-prop-types.js";
|
|
5
6
|
import useLeftNavItems from "./useLeftNavItems.js";
|
|
6
7
|
import { useLeftNavSmoothExpand } from "./useLeftNavSmoothExpand.js";
|
|
7
|
-
import { useSelectFirstBodyItem } from "../hooks/useSelectFirstBodyItem.js";
|
|
8
8
|
const useLeftNavConfig = (props) => {
|
|
9
9
|
const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);
|
|
10
10
|
const { expanded, openedItem, onSelectedChange, onFocusChange, items } = propsWithDefaults;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useLeftNavConfig.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport { useSelectFirstBodyItem } from '../hooks/useSelectFirstBodyItem.js';\nimport type { DSLeftNavigationT } from '../react-desc-prop-types.js';\nimport { defaultProps } from '../react-desc-prop-types.js';\nimport useLeftNavItems from './useLeftNavItems.js';\nimport { useLeftNavSmoothExpand } from './useLeftNavSmoothExpand.js';\n\nexport const useLeftNavConfig = (props: DSLeftNavigationT.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSLeftNavigationT.InternalProps>(props, defaultProps);\n const { expanded, openedItem, onSelectedChange, onFocusChange, items } = propsWithDefaults;\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(propsWithDefaults, smoothExpandOpts);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * SIDE EFFECTS *\n // ************************** ------------ **************************\n React.useEffect(() => {\n if (onSelectedChange) onSelectedChange(selectedItem);\n }, [selectedItem, onSelectedChange]);\n\n React.useEffect(() => {\n if (propsWithDefaults.actionRef && propsWithDefaults.actionRef.current) {\n propsWithDefaults.actionRef.current.setFocusedItem = setFocusedItem;\n }\n }, [propsWithDefaults.actionRef]);\n\n React.useEffect(() => {\n if (openedItem) setSelectedParent(openedItem);\n }, [openedItem]);\n\n React.useEffect(() => {\n if (onFocusChange) onFocusChange(focusedItem);\n }, [focusedItem, onFocusChange]);\n\n useSelectFirstBodyItem(\n items ?? [],\n openedItem ?? '',\n propsWithDefaults.selectedItem !== undefined ? propsWithDefaults.selectedItem : selectedItem,\n setSelectedItem,\n propsWithDefaults.disableDefaultSelection,\n );\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * ITEMS MANAGEMENT *\n // ************************** ------------ **************************\n\n const leftNavItemsProps = React.useMemo(\n () => ({\n headerItem: propsWithDefaults.HeaderComponent,\n bodyHeaderItem: propsWithDefaults.BodyHeaderComponent,\n items: propsWithDefaults.items,\n openedDrilldowns,\n }),\n [\n propsWithDefaults.HeaderComponent,\n propsWithDefaults.BodyHeaderComponent,\n propsWithDefaults.items,\n openedDrilldowns,\n ],\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 return React.useMemo(\n () => ({\n leftNavProps: propsWithDefaults,\n expandedForAnimation,\n selectedItem: propsWithDefaults.selectedItem !== undefined ? propsWithDefaults.selectedItem : selectedItem,\n setSelectedItem,\n selectedParent:\n propsWithDefaults.selectedParent !== undefined ? propsWithDefaults.selectedParent : selectedParent,\n setSelectedParent,\n focusedItem,\n setFocusedItem,\n openedDrilldowns,\n setOpenedDrilldowns,\n visibleItems,\n visibleItemsRefs,\n }),\n [\n propsWithDefaults,\n expandedForAnimation,\n selectedItem,\n selectedParent,\n focusedItem,\n openedDrilldowns,\n visibleItems,\n visibleItemsRefs,\n ],\n );\n};\n\nexport default useLeftNavConfig;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,oCAAoC;AAC7C,OAAOA,YAAW;AAClB,SAAS,8BAA8B;AAEvC,SAAS,oBAAoB;AAC7B,OAAO,qBAAqB;AAC5B,SAAS,8BAA8B;AAEhC,MAAM,mBAAmB,CAAC,UAAmC;AAClE,QAAM,oBAAoB,6BAA8D,OAAO,YAAY;AAC3G,QAAM,EAAE,UAAU,YAAY,kBAAkB,eAAe,MAAM,IAAI;AAMzE,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,mBAAmB,gBAAgB;AAM1D,EAAAA,OAAM,UAAU,MAAM;AACpB,QAAI,iBAAkB,kBAAiB,YAAY;AAAA,EACrD,GAAG,CAAC,cAAc,gBAAgB,CAAC;AAEnC,EAAAA,OAAM,UAAU,MAAM;AACpB,QAAI,kBAAkB,aAAa,kBAAkB,UAAU,SAAS;AACtE,wBAAkB,UA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* as React from "react";
|
|
2
2
|
import { createRef, useMemo, useRef } from "react";
|
|
3
|
-
import { ITEM_TYPES } from "../
|
|
4
|
-
import { FOOTER_DS_ID } from "../exported-related/constants.js";
|
|
3
|
+
import { ITEM_TYPES, FOOTER_DS_ID } from "../constants/index.js";
|
|
5
4
|
const notFocuseableItems = [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, ITEM_TYPES.LEFT_NAV_ITEM_SECTION];
|
|
6
5
|
const walkItems = (items, openedDrilldowns, callback) => {
|
|
7
6
|
items.forEach((item) => {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/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, FOOTER_DS_ID } from '../constants/index.js';\nimport type { DSLeftNavigationT } from '../react-desc-prop-types.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 = (\n items: DSLeftNavigationT.GenericItemItemProps[],\n openedDrilldowns: string[],\n callback: (dsId: string) => void,\n) => {\n items.forEach((item) => {\n if (typeof item.type === 'string' && item.dsId) {\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 if (item.dsId) {\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?: DSLeftNavigationT.GenericItemItemProps;\n bodyHeaderItem?: DSLeftNavigationT.GenericItemItemProps;\n items?: DSLeftNavigationT.GenericItemItemProps[];\n openedDrilldowns: string[];\n}): {\n visibleItems: string[];\n visibleItemsRefs: MutableRefObject<Record<string, RefObject<HTMLDivElement>>>;\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 if (!bodyItems) return [];\n const itemsArray: DSLeftNavigationT.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<HTMLDivElement>>>({});\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,YAAY,oBAAoB;AAGzC,MAAM,qBAAqB,CAAC,WAAW,yBAAyB,WAAW,qBAAqB;AAIhG,MAAM,YAAY,CAChB,OACA,kBACA,aACG;AACH,QAAM,QAAQ,CAAC,SAAS;AACtB,QAAI,OAAO,KAAK,SAAS,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O,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useLeftNavSmoothExpand.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { DSLeftNavigationT } from '../react-desc-prop-types.js';\n\ninterface SmoothExpandOptsT {\n expandedForAnimation: boolean;\n timeoutRef: React.MutableRefObject<NodeJS.Timeout | null>;\n setExpandedForAnimation: React.Dispatch<React.SetStateAction<boolean>>;\n}\nexport const useLeftNavSmoothExpand = (props: DSLeftNavigationT.Props, smoothExpandOpts: SmoothExpandOptsT): void => {\n const { expanded } = props;\n const { expandedForAnimation, timeoutRef, setExpandedForAnimation } = smoothExpandOpts;\n\n React.useEffect(() => {\n // If expanded changes, we need to smoothly transition to the non-expanded state\n // so we need to wait for 350ms\n if (!expanded && expandedForAnimation) {\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(() => setExpandedForAnimation(false), 350);\n } else if (expanded) setExpandedForAnimation(true);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [expanded]);\n\n React.useEffect(\n () => () => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n },\n [timeoutRef],\n );\n};\n\nexport default useLeftNavSmoothExpand;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAQX,MAAM,yBAAyB,CAAC,OAAgC,qBAA8C;AACnH,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,EAAE,sBAAsB,YAAY,wBAAwB,IAAI;AAEtE,EAAAA,OAAM,UAAU,MAAM;AAGpB,QAAI,CAAC,YAAY,sBAAsB;AACrC,UAAI,WAAW,QAAS,cAAa,WAAW,OAAO;AACvD,iBAAW,UAAU,WAAW,MAAM,wBAAwB,KAAK,GAAG,GAAG;AAAA,IAC3E,WAAW,SAAU,yBAAwB,IAAI;AAAA,EAEnD,GAAG,CAAC,QAAQ,CAAC;AAEb,EAAAA,OAAM;AAAA,IACJ,MAAM,MAAM;AACV,UAAI,WAAW,QAAS,cAAa,WAAW,OAAO;AAAA,IACzD;AAAA,IACA,CAAC,UAAU;AAAA,EACb;AACF;AAEA,IAAO,iCAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
@@ -112,11 +112,50 @@ const LEFT_NAVIGATION_DATA_TESTID = {
|
|
|
112
112
|
LIST_ITEM_LABEL_ID_EXCEPTION: "leftnav-list-item-label"
|
|
113
113
|
};
|
|
114
114
|
const DSLeftNavigationSlots = LEFT_NAVIGATION_SLOTS;
|
|
115
|
+
const LABEL_OVERFLOW = {
|
|
116
|
+
WRAP: "wrap",
|
|
117
|
+
WRAP_ALL: "wrapAll",
|
|
118
|
+
TRUNCATE: "truncate"
|
|
119
|
+
};
|
|
120
|
+
const ITEM_TYPES = {
|
|
121
|
+
LEFT_NAV_ITEM_HEADER: "ds-left-nav-item-header",
|
|
122
|
+
LEFT_NAV_ITEM_LINK: "ds-left-nav-item-link",
|
|
123
|
+
LEFT_NAV_ITEM_SUBMENU: "ds-left-nav-item-submenu",
|
|
124
|
+
LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN: "ds-left-nav-item-controlled-drilldown",
|
|
125
|
+
LEFT_NAV_ITEM_UNCONTROLLED_DRILLDOWN: "ds-left-nav-item-uncontrolled-drilldown",
|
|
126
|
+
LEFT_NAV_ITEM_SECTION: "ds-left-nav-item-section",
|
|
127
|
+
LEFT_NAV_ITEM_SEPARATOR: "ds-left-nav-item-separator",
|
|
128
|
+
LEFT_NAV_ITEM_SKELETON: "ds-left-nav-item-skeleton",
|
|
129
|
+
LEFT_NAV_ITEM_TEXT_LABEL: "ds-left-nav-item-text-label",
|
|
130
|
+
LEFT_NAV_ITEM_WITH_DATE: "ds-left-nav-item-with-date"
|
|
131
|
+
};
|
|
132
|
+
const outOfTheBoxTypes = Object.values(ITEM_TYPES);
|
|
133
|
+
const MAP_ITEMS_TO_SKELETON = {
|
|
134
|
+
"ds-left-nav-item-header": "item",
|
|
135
|
+
"ds-left-nav-item-link": "subitem",
|
|
136
|
+
"ds-left-nav-item-submenu": "item",
|
|
137
|
+
"ds-left-nav-item-controlled-drilldown": "subitem",
|
|
138
|
+
"ds-left-nav-item-uncontrolled-drilldown": "subitem",
|
|
139
|
+
"ds-left-nav-item-section": "subitem",
|
|
140
|
+
"ds-left-nav-item-separator": "subitem",
|
|
141
|
+
"ds-left-nav-item-text-label": "subitem",
|
|
142
|
+
"ds-left-nav-item-with-date": "subitem"
|
|
143
|
+
};
|
|
144
|
+
const FOOTER_DS_ID = "ds-left-nav-__internal__-footer";
|
|
145
|
+
const FOOTER_MENU_CLOSE_DS_ID = "ds-left-nav-__internal__-footer-menu-close";
|
|
146
|
+
const CHEVRON_BACK_DS_ID = "ds-left-nav-__internal__-chevron-back";
|
|
115
147
|
export {
|
|
148
|
+
CHEVRON_BACK_DS_ID,
|
|
116
149
|
DSLeftNavigationName,
|
|
117
150
|
DSLeftNavigationSlots,
|
|
151
|
+
FOOTER_DS_ID,
|
|
152
|
+
FOOTER_MENU_CLOSE_DS_ID,
|
|
153
|
+
ITEM_TYPES,
|
|
154
|
+
LABEL_OVERFLOW,
|
|
118
155
|
LEFT_NAVIGATION_DATA_TESTID,
|
|
119
156
|
LEFT_NAVIGATION_REGION_FOCUSES,
|
|
120
|
-
LEFT_NAVIGATION_SLOTS
|
|
157
|
+
LEFT_NAVIGATION_SLOTS,
|
|
158
|
+
MAP_ITEMS_TO_SKELETON,
|
|
159
|
+
outOfTheBoxTypes
|
|
121
160
|
};
|
|
122
|
-
//# sourceMappingURL=
|
|
161
|
+
//# sourceMappingURL=index.js.map
|