@elliemae/ds-left-navigation 2.3.0-alpha.8 → 2.3.0-next.2
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/cjs/LeftNavigation.js +29 -0
- package/cjs/LeftNavigationContext.js +41 -0
- package/cjs/common/getItemBackgroundStyle.js +12 -0
- package/cjs/common/getLeftBorderStyle.js +12 -0
- package/cjs/common/getScrollbarStyle.js +7 -0
- package/cjs/common/index.js +13 -0
- package/cjs/configs/index.js +10 -0
- package/cjs/configs/useLeftNavConfig.js +102 -0
- package/cjs/configs/useLeftNavItems.js +80 -0
- package/cjs/configs/useLeftNavSmoothExpand.js +35 -0
- package/cjs/exported-related/ChevronItem/index.js +28 -0
- package/cjs/exported-related/Icon/index.js +36 -0
- package/cjs/exported-related/ItemRenderer/index.js +128 -0
- package/cjs/exported-related/ItemRenderer/styled.js +58 -0
- package/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js +57 -0
- package/cjs/exported-related/Notifications/index.js +62 -0
- package/cjs/exported-related/OpenWindowItem/index.js +33 -0
- package/cjs/exported-related/constants.js +29 -0
- package/cjs/exported-related/index.js +23 -0
- package/cjs/hooks/index.js +13 -0
- package/cjs/hooks/useExpandableOnClickHandler.js +35 -0
- package/cjs/hooks/useKeyboardNavigation.js +110 -0
- package/cjs/hooks/useOpenableOnClickHandler.js +40 -0
- package/cjs/hooks/useSelectFirstBodyItem.js +39 -0
- package/cjs/index.d.js +2 -0
- package/cjs/index.js +30 -0
- package/cjs/outOfTheBox/ItemControlledDrilldown/index.js +158 -0
- package/cjs/outOfTheBox/ItemControlledDrilldown/styled.js +27 -0
- package/cjs/outOfTheBox/ItemHeader/index.js +144 -0
- package/cjs/outOfTheBox/ItemHeader/styled.js +22 -0
- package/cjs/outOfTheBox/ItemLink/index.js +97 -0
- package/cjs/outOfTheBox/ItemLink/styled.js +17 -0
- package/cjs/outOfTheBox/ItemSection/index.js +83 -0
- package/cjs/outOfTheBox/ItemSection/styled.js +23 -0
- package/cjs/outOfTheBox/ItemSeparator/index.js +52 -0
- package/cjs/outOfTheBox/ItemSubmenu/index.js +145 -0
- package/cjs/outOfTheBox/ItemSubmenu/styled.js +22 -0
- package/cjs/outOfTheBox/ItemTextLabel/index.js +70 -0
- package/cjs/outOfTheBox/ItemTextLabel/styled.js +23 -0
- package/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js +172 -0
- package/cjs/outOfTheBox/ItemUncontrolledDrilldown/styled.js +27 -0
- package/cjs/outOfTheBox/ItemWithDate/index.js +86 -0
- package/cjs/outOfTheBox/ItemWithDate/styled.js +27 -0
- package/cjs/outOfTheBox/index.js +62 -0
- package/cjs/parts/LeftNavContent/index.js +84 -0
- package/cjs/parts/LeftNavContent/styled.js +53 -0
- package/cjs/parts/LeftNavContentWithScrollbar/index.js +91 -0
- package/cjs/parts/LeftNavFooterItem/index.js +108 -0
- package/cjs/parts/LeftNavFooterItem/styled.js +39 -0
- package/cjs/parts/LeftNavLoading/index.js +34 -0
- package/cjs/parts/OutOfTheBoxMapItem.js +52 -0
- package/cjs/prop-types.js +47 -0
- package/esm/LeftNavigation.js +20 -0
- package/{dist/esm → esm}/LeftNavigationContext.js +11 -15
- package/esm/common/getItemBackgroundStyle.js +8 -0
- package/esm/common/getLeftBorderStyle.js +8 -0
- package/esm/common/getScrollbarStyle.js +3 -0
- package/esm/common/index.js +3 -0
- package/esm/configs/index.js +2 -0
- package/esm/configs/useLeftNavConfig.js +93 -0
- package/esm/configs/useLeftNavItems.js +75 -0
- package/esm/configs/useLeftNavSmoothExpand.js +26 -0
- package/esm/exported-related/ChevronItem/index.js +19 -0
- package/esm/exported-related/Icon/index.js +27 -0
- package/esm/exported-related/ItemRenderer/index.js +119 -0
- package/esm/exported-related/ItemRenderer/styled.js +47 -0
- package/esm/exported-related/ItemRenderer/usePropsWithDefaults.js +49 -0
- package/esm/exported-related/Notifications/index.js +51 -0
- package/esm/exported-related/OpenWindowItem/index.js +23 -0
- package/esm/exported-related/constants.js +21 -0
- package/esm/exported-related/index.js +6 -0
- package/esm/hooks/index.js +3 -0
- package/esm/hooks/useExpandableOnClickHandler.js +31 -0
- package/{dist/esm → esm}/hooks/useKeyboardNavigation.js +47 -30
- package/esm/hooks/useOpenableOnClickHandler.js +36 -0
- package/esm/hooks/useSelectFirstBodyItem.js +35 -0
- package/esm/index.d.js +1 -0
- package/esm/index.js +8 -0
- package/esm/outOfTheBox/ItemControlledDrilldown/index.js +148 -0
- package/esm/outOfTheBox/ItemControlledDrilldown/styled.js +17 -0
- package/esm/outOfTheBox/ItemHeader/index.js +134 -0
- package/esm/outOfTheBox/ItemHeader/styled.js +12 -0
- package/esm/outOfTheBox/ItemLink/index.js +87 -0
- package/esm/outOfTheBox/ItemLink/styled.js +8 -0
- package/esm/outOfTheBox/ItemSection/index.js +73 -0
- package/esm/outOfTheBox/ItemSection/styled.js +13 -0
- package/esm/outOfTheBox/ItemSeparator/index.js +42 -0
- package/esm/outOfTheBox/ItemSubmenu/index.js +135 -0
- package/esm/outOfTheBox/ItemSubmenu/styled.js +12 -0
- package/esm/outOfTheBox/ItemTextLabel/index.js +61 -0
- package/esm/outOfTheBox/ItemTextLabel/styled.js +14 -0
- package/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js +162 -0
- package/esm/outOfTheBox/ItemUncontrolledDrilldown/styled.js +17 -0
- package/esm/outOfTheBox/ItemWithDate/index.js +76 -0
- package/esm/outOfTheBox/ItemWithDate/styled.js +17 -0
- package/esm/outOfTheBox/index.js +57 -0
- package/esm/parts/LeftNavContent/index.js +77 -0
- package/esm/parts/LeftNavContent/styled.js +39 -0
- package/esm/parts/LeftNavContentWithScrollbar/index.js +80 -0
- package/esm/parts/LeftNavFooterItem/index.js +98 -0
- package/esm/parts/LeftNavFooterItem/styled.js +26 -0
- package/esm/parts/LeftNavLoading/index.js +23 -0
- package/esm/parts/OutOfTheBoxMapItem.js +42 -0
- package/esm/prop-types.js +40 -0
- package/package.json +121 -123
- package/types/LeftNavigation.d.ts +55 -0
- package/types/LeftNavigationContext.d.ts +18 -0
- package/types/common/getItemBackgroundStyle.d.ts +5 -0
- package/types/common/getLeftBorderStyle.d.ts +4 -0
- package/types/common/getScrollbarStyle.d.ts +1 -0
- package/types/common/index.d.ts +3 -0
- package/types/configs/index.d.ts +3 -0
- package/types/configs/useLeftNavConfig.d.ts +4 -0
- package/types/configs/useLeftNavItems.d.ts +12 -0
- package/types/configs/useLeftNavSmoothExpand.d.ts +10 -0
- package/types/exported-related/ChevronItem/index.d.ts +3 -0
- package/types/exported-related/Icon/index.d.ts +5 -0
- package/types/exported-related/ItemRenderer/index.d.ts +3 -0
- package/types/exported-related/ItemRenderer/styled.d.ts +16 -0
- package/types/exported-related/ItemRenderer/usePropsWithDefaults.d.ts +2 -0
- package/types/exported-related/Notifications/index.d.ts +8 -0
- package/types/exported-related/OpenWindowItem/index.d.ts +3 -0
- package/types/exported-related/constants.d.ts +19 -0
- package/types/exported-related/index.d.ts +6 -0
- package/types/hooks/index.d.ts +3 -0
- package/types/hooks/useExpandableOnClickHandler.d.ts +9 -0
- package/types/hooks/useKeyboardNavigation.d.ts +8 -0
- package/types/hooks/useOpenableOnClickHandler.d.ts +10 -0
- package/types/hooks/useSelectFirstBodyItem.d.ts +3 -0
- package/types/index.d.d.ts +77 -0
- package/types/index.d.ts +3 -0
- package/types/outOfTheBox/ItemControlledDrilldown/index.d.ts +3 -0
- package/types/outOfTheBox/ItemControlledDrilldown/styled.d.ts +5 -0
- package/types/outOfTheBox/ItemHeader/index.d.ts +3 -0
- package/types/outOfTheBox/ItemHeader/styled.d.ts +3 -0
- package/types/outOfTheBox/ItemLink/index.d.ts +3 -0
- package/types/outOfTheBox/ItemLink/styled.d.ts +2 -0
- package/types/outOfTheBox/ItemSection/index.d.ts +3 -0
- package/types/outOfTheBox/ItemSection/styled.d.ts +3 -0
- package/types/outOfTheBox/ItemSeparator/index.d.ts +3 -0
- package/types/outOfTheBox/ItemSubmenu/index.d.ts +3 -0
- package/types/outOfTheBox/ItemSubmenu/styled.d.ts +3 -0
- package/types/outOfTheBox/ItemTextLabel/index.d.ts +3 -0
- package/types/outOfTheBox/ItemTextLabel/styled.d.ts +2 -0
- package/types/outOfTheBox/ItemUncontrolledDrilldown/index.d.ts +3 -0
- package/types/outOfTheBox/ItemUncontrolledDrilldown/styled.d.ts +5 -0
- package/types/outOfTheBox/ItemWithDate/index.d.ts +3 -0
- package/types/outOfTheBox/ItemWithDate/styled.d.ts +5 -0
- package/types/outOfTheBox/index.d.ts +13 -0
- package/types/parts/LeftNavContent/index.d.ts +3 -0
- package/types/parts/LeftNavContent/styled.d.ts +14 -0
- package/types/parts/LeftNavContentWithScrollbar/index.d.ts +6 -0
- package/types/parts/LeftNavFooterItem/index.d.ts +8 -0
- package/types/parts/LeftNavFooterItem/styled.d.ts +14 -0
- package/types/parts/LeftNavLoading/index.d.ts +4 -0
- package/types/parts/OutOfTheBoxMapItem.d.ts +3 -0
- package/types/prop-types.d.ts +91 -0
- package/types/tests/LeftNavigation.collapsed.test.d.ts +1 -0
- package/types/tests/LeftNavigation.expanded.test.d.ts +1 -0
- package/types/tests/LeftNavigation.opened.test.d.ts +1 -0
- package/types/tests/events/LeftNavigation.events.keyboard.test.d.ts +1 -0
- package/types/tests/events/LeftNavigation.events.subitems.test.d.ts +1 -0
- package/types/tests/events/LeftNavigation.events.test.d.ts +1 -0
- package/types/tests/events/LeftNavigation.focus.events.test.d.ts +1 -0
- package/dist/cjs/LeftNavigation.js +0 -51
- package/dist/cjs/LeftNavigation.js.map +0 -7
- package/dist/cjs/LeftNavigationContext.js +0 -67
- package/dist/cjs/LeftNavigationContext.js.map +0 -7
- package/dist/cjs/common/getItemBackgroundStyle.js +0 -51
- package/dist/cjs/common/getItemBackgroundStyle.js.map +0 -7
- package/dist/cjs/common/getLeftBorderStyle.js +0 -54
- package/dist/cjs/common/getLeftBorderStyle.js.map +0 -7
- package/dist/cjs/common/getScrollbarStyle.js +0 -58
- package/dist/cjs/common/getScrollbarStyle.js.map +0 -7
- package/dist/cjs/common/index.js +0 -30
- package/dist/cjs/common/index.js.map +0 -7
- package/dist/cjs/configs/index.js +0 -38
- package/dist/cjs/configs/index.js.map +0 -7
- package/dist/cjs/configs/useLeftNavConfig.js +0 -106
- package/dist/cjs/configs/useLeftNavConfig.js.map +0 -7
- package/dist/cjs/configs/useLeftNavItems.js +0 -82
- package/dist/cjs/configs/useLeftNavItems.js.map +0 -7
- package/dist/cjs/configs/useLeftNavSmoothExpand.js +0 -53
- package/dist/cjs/configs/useLeftNavSmoothExpand.js.map +0 -7
- package/dist/cjs/exported-related/ChevronItem/index.js +0 -43
- package/dist/cjs/exported-related/ChevronItem/index.js.map +0 -7
- package/dist/cjs/exported-related/Icon/index.js +0 -53
- package/dist/cjs/exported-related/Icon/index.js.map +0 -7
- package/dist/cjs/exported-related/ItemRenderer/index.js +0 -133
- package/dist/cjs/exported-related/ItemRenderer/index.js.map +0 -7
- package/dist/cjs/exported-related/ItemRenderer/styled.js +0 -90
- package/dist/cjs/exported-related/ItemRenderer/styled.js.map +0 -7
- package/dist/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js +0 -69
- package/dist/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js.map +0 -7
- package/dist/cjs/exported-related/Notifications/index.js +0 -82
- package/dist/cjs/exported-related/Notifications/index.js.map +0 -7
- package/dist/cjs/exported-related/OpenWindowItem/index.js +0 -50
- package/dist/cjs/exported-related/OpenWindowItem/index.js.map +0 -7
- package/dist/cjs/exported-related/constants.js +0 -57
- package/dist/cjs/exported-related/constants.js.map +0 -7
- package/dist/cjs/exported-related/index.js +0 -33
- package/dist/cjs/exported-related/index.js.map +0 -7
- package/dist/cjs/hooks/index.js +0 -30
- package/dist/cjs/hooks/index.js.map +0 -7
- package/dist/cjs/hooks/useExpandableOnClickHandler.js +0 -64
- package/dist/cjs/hooks/useExpandableOnClickHandler.js.map +0 -7
- package/dist/cjs/hooks/useKeyboardNavigation.js +0 -118
- package/dist/cjs/hooks/useKeyboardNavigation.js.map +0 -7
- package/dist/cjs/hooks/useOpenableOnClickHandler.js +0 -69
- package/dist/cjs/hooks/useOpenableOnClickHandler.js.map +0 -7
- package/dist/cjs/hooks/useSelectFirstBodyItem.js +0 -52
- package/dist/cjs/hooks/useSelectFirstBodyItem.js.map +0 -7
- package/dist/cjs/index.d.js +0 -27
- package/dist/cjs/index.d.js.map +0 -7
- package/dist/cjs/index.js +0 -41
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemControlledDrilldown/index.js +0 -152
- package/dist/cjs/outOfTheBox/ItemControlledDrilldown/index.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemControlledDrilldown/styled.js +0 -49
- package/dist/cjs/outOfTheBox/ItemControlledDrilldown/styled.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemHeader/index.js +0 -147
- package/dist/cjs/outOfTheBox/ItemHeader/index.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemHeader/styled.js +0 -49
- package/dist/cjs/outOfTheBox/ItemHeader/styled.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemLink/index.js +0 -106
- package/dist/cjs/outOfTheBox/ItemLink/index.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemLink/styled.js +0 -41
- package/dist/cjs/outOfTheBox/ItemLink/styled.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemSection/index.js +0 -79
- package/dist/cjs/outOfTheBox/ItemSection/index.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemSection/styled.js +0 -53
- package/dist/cjs/outOfTheBox/ItemSection/styled.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemSeparator/index.js +0 -63
- package/dist/cjs/outOfTheBox/ItemSeparator/index.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemSubmenu/index.js +0 -149
- package/dist/cjs/outOfTheBox/ItemSubmenu/index.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemSubmenu/styled.js +0 -49
- package/dist/cjs/outOfTheBox/ItemSubmenu/styled.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemTextLabel/index.js +0 -69
- package/dist/cjs/outOfTheBox/ItemTextLabel/index.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemTextLabel/styled.js +0 -43
- package/dist/cjs/outOfTheBox/ItemTextLabel/styled.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js +0 -166
- package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/styled.js +0 -49
- package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/styled.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemWithDate/index.js +0 -91
- package/dist/cjs/outOfTheBox/ItemWithDate/index.js.map +0 -7
- package/dist/cjs/outOfTheBox/ItemWithDate/styled.js +0 -49
- package/dist/cjs/outOfTheBox/ItemWithDate/styled.js.map +0 -7
- package/dist/cjs/outOfTheBox/index.js +0 -77
- package/dist/cjs/outOfTheBox/index.js.map +0 -7
- package/dist/cjs/parts/LeftNavContent/index.js +0 -88
- package/dist/cjs/parts/LeftNavContent/index.js.map +0 -7
- package/dist/cjs/parts/LeftNavContent/styled.js +0 -113
- package/dist/cjs/parts/LeftNavContent/styled.js.map +0 -7
- package/dist/cjs/parts/LeftNavContentWithScrollbar/index.js +0 -101
- package/dist/cjs/parts/LeftNavContentWithScrollbar/index.js.map +0 -7
- package/dist/cjs/parts/LeftNavFooterItem/index.js +0 -125
- package/dist/cjs/parts/LeftNavFooterItem/index.js.map +0 -7
- package/dist/cjs/parts/LeftNavFooterItem/styled.js +0 -94
- package/dist/cjs/parts/LeftNavFooterItem/styled.js.map +0 -7
- package/dist/cjs/parts/LeftNavLoading/index.js +0 -52
- package/dist/cjs/parts/LeftNavLoading/index.js.map +0 -7
- package/dist/cjs/parts/OutOfTheBoxMapItem.js +0 -55
- package/dist/cjs/parts/OutOfTheBoxMapItem.js.map +0 -7
- package/dist/cjs/prop-types.js +0 -66
- package/dist/cjs/prop-types.js.map +0 -7
- package/dist/esm/LeftNavigation.js +0 -22
- package/dist/esm/LeftNavigation.js.map +0 -7
- package/dist/esm/LeftNavigationContext.js.map +0 -7
- package/dist/esm/common/getItemBackgroundStyle.js +0 -22
- package/dist/esm/common/getItemBackgroundStyle.js.map +0 -7
- package/dist/esm/common/getLeftBorderStyle.js +0 -25
- package/dist/esm/common/getLeftBorderStyle.js.map +0 -7
- package/dist/esm/common/getScrollbarStyle.js +0 -29
- package/dist/esm/common/getScrollbarStyle.js.map +0 -7
- package/dist/esm/common/index.js +0 -5
- package/dist/esm/common/index.js.map +0 -7
- package/dist/esm/configs/index.js +0 -9
- package/dist/esm/configs/index.js.map +0 -7
- package/dist/esm/configs/useLeftNavConfig.js +0 -77
- package/dist/esm/configs/useLeftNavConfig.js.map +0 -7
- package/dist/esm/configs/useLeftNavItems.js +0 -53
- package/dist/esm/configs/useLeftNavItems.js.map +0 -7
- package/dist/esm/configs/useLeftNavSmoothExpand.js +0 -24
- package/dist/esm/configs/useLeftNavSmoothExpand.js.map +0 -7
- package/dist/esm/exported-related/ChevronItem/index.js +0 -14
- package/dist/esm/exported-related/ChevronItem/index.js.map +0 -7
- package/dist/esm/exported-related/Icon/index.js +0 -24
- package/dist/esm/exported-related/Icon/index.js.map +0 -7
- package/dist/esm/exported-related/ItemRenderer/index.js +0 -104
- package/dist/esm/exported-related/ItemRenderer/index.js.map +0 -7
- package/dist/esm/exported-related/ItemRenderer/styled.js +0 -61
- package/dist/esm/exported-related/ItemRenderer/styled.js.map +0 -7
- package/dist/esm/exported-related/ItemRenderer/usePropsWithDefaults.js +0 -40
- package/dist/esm/exported-related/ItemRenderer/usePropsWithDefaults.js.map +0 -7
- package/dist/esm/exported-related/Notifications/index.js +0 -58
- package/dist/esm/exported-related/Notifications/index.js.map +0 -7
- package/dist/esm/exported-related/OpenWindowItem/index.js +0 -21
- package/dist/esm/exported-related/OpenWindowItem/index.js.map +0 -7
- package/dist/esm/exported-related/constants.js +0 -28
- package/dist/esm/exported-related/constants.js.map +0 -7
- package/dist/esm/exported-related/index.js +0 -8
- package/dist/esm/exported-related/index.js.map +0 -7
- package/dist/esm/hooks/index.js +0 -5
- package/dist/esm/hooks/index.js.map +0 -7
- package/dist/esm/hooks/useExpandableOnClickHandler.js +0 -35
- package/dist/esm/hooks/useExpandableOnClickHandler.js.map +0 -7
- package/dist/esm/hooks/useKeyboardNavigation.js.map +0 -7
- package/dist/esm/hooks/useOpenableOnClickHandler.js +0 -40
- package/dist/esm/hooks/useOpenableOnClickHandler.js.map +0 -7
- package/dist/esm/hooks/useSelectFirstBodyItem.js +0 -23
- package/dist/esm/hooks/useSelectFirstBodyItem.js.map +0 -7
- package/dist/esm/index.d.js +0 -2
- package/dist/esm/index.d.js.map +0 -7
- package/dist/esm/index.js +0 -12
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemControlledDrilldown/index.js +0 -123
- package/dist/esm/outOfTheBox/ItemControlledDrilldown/index.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemControlledDrilldown/styled.js +0 -20
- package/dist/esm/outOfTheBox/ItemControlledDrilldown/styled.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemHeader/index.js +0 -118
- package/dist/esm/outOfTheBox/ItemHeader/index.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemHeader/styled.js +0 -20
- package/dist/esm/outOfTheBox/ItemHeader/styled.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemLink/index.js +0 -77
- package/dist/esm/outOfTheBox/ItemLink/index.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemLink/styled.js +0 -12
- package/dist/esm/outOfTheBox/ItemLink/styled.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemSection/index.js +0 -50
- package/dist/esm/outOfTheBox/ItemSection/index.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemSection/styled.js +0 -24
- package/dist/esm/outOfTheBox/ItemSection/styled.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemSeparator/index.js +0 -34
- package/dist/esm/outOfTheBox/ItemSeparator/index.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemSubmenu/index.js +0 -120
- package/dist/esm/outOfTheBox/ItemSubmenu/index.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemSubmenu/styled.js +0 -20
- package/dist/esm/outOfTheBox/ItemSubmenu/styled.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemTextLabel/index.js +0 -40
- package/dist/esm/outOfTheBox/ItemTextLabel/index.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemTextLabel/styled.js +0 -14
- package/dist/esm/outOfTheBox/ItemTextLabel/styled.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js +0 -137
- package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/styled.js +0 -20
- package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/styled.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemWithDate/index.js +0 -62
- package/dist/esm/outOfTheBox/ItemWithDate/index.js.map +0 -7
- package/dist/esm/outOfTheBox/ItemWithDate/styled.js +0 -20
- package/dist/esm/outOfTheBox/ItemWithDate/styled.js.map +0 -7
- package/dist/esm/outOfTheBox/index.js +0 -48
- package/dist/esm/outOfTheBox/index.js.map +0 -7
- package/dist/esm/parts/LeftNavContent/index.js +0 -67
- package/dist/esm/parts/LeftNavContent/index.js.map +0 -7
- package/dist/esm/parts/LeftNavContent/styled.js +0 -84
- package/dist/esm/parts/LeftNavContent/styled.js.map +0 -7
- package/dist/esm/parts/LeftNavContentWithScrollbar/index.js +0 -72
- package/dist/esm/parts/LeftNavContentWithScrollbar/index.js.map +0 -7
- package/dist/esm/parts/LeftNavFooterItem/index.js +0 -103
- package/dist/esm/parts/LeftNavFooterItem/index.js.map +0 -7
- package/dist/esm/parts/LeftNavFooterItem/styled.js +0 -65
- package/dist/esm/parts/LeftNavFooterItem/styled.js.map +0 -7
- package/dist/esm/parts/LeftNavLoading/index.js +0 -23
- package/dist/esm/parts/LeftNavLoading/index.js.map +0 -7
- package/dist/esm/parts/OutOfTheBoxMapItem.js +0 -26
- package/dist/esm/parts/OutOfTheBoxMapItem.js.map +0 -7
- package/dist/esm/prop-types.js +0 -37
- package/dist/esm/prop-types.js.map +0 -7
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
require('react');
|
|
7
|
+
var reactDesc = require('react-desc');
|
|
8
|
+
var propTypes = require('./prop-types.js');
|
|
9
|
+
var LeftNavigationContext = require('./LeftNavigationContext.js');
|
|
10
|
+
var useLeftNavConfig = require('./configs/useLeftNavConfig.js');
|
|
11
|
+
var index = require('./parts/LeftNavContent/index.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
16
|
+
|
|
17
|
+
var _LeftNavContent;
|
|
18
|
+
const LeftNavigation = props => {
|
|
19
|
+
const leftNavConfig = useLeftNavConfig.useLeftNavConfig(props);
|
|
20
|
+
return /*#__PURE__*/_jsx__default["default"](LeftNavigationContext.LeftNavContext.Provider, {
|
|
21
|
+
value: leftNavConfig
|
|
22
|
+
}, void 0, _LeftNavContent || (_LeftNavContent = /*#__PURE__*/_jsx__default["default"](index, {})));
|
|
23
|
+
};
|
|
24
|
+
LeftNavigation.defaultProps = LeftNavigationContext.defaultProps;
|
|
25
|
+
const LeftNavigationWithSchema = reactDesc.describe(LeftNavigation).description('Left Navigation');
|
|
26
|
+
LeftNavigationWithSchema.propTypes = propTypes.leftNavigationProps;
|
|
27
|
+
|
|
28
|
+
exports.LeftNavigation = LeftNavigation;
|
|
29
|
+
exports.LeftNavigationWithSchema = LeftNavigationWithSchema;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
const defaultProps = {
|
|
8
|
+
expandedWidth: '240px',
|
|
9
|
+
tabIndex: 0,
|
|
10
|
+
loading: false,
|
|
11
|
+
expanded: false,
|
|
12
|
+
openedItem: null,
|
|
13
|
+
footerLabel: '',
|
|
14
|
+
onSelectedChange: () => null,
|
|
15
|
+
onFocusChange: () => null,
|
|
16
|
+
onFooterExpand: () => null,
|
|
17
|
+
onFooterClose: () => null,
|
|
18
|
+
items: [],
|
|
19
|
+
labelOverflow: 'wrap',
|
|
20
|
+
onItemClick: () => null
|
|
21
|
+
};
|
|
22
|
+
const defaultContext = {
|
|
23
|
+
leftNavProps: defaultProps,
|
|
24
|
+
selectedItem: null,
|
|
25
|
+
setSelectedItem: () => null,
|
|
26
|
+
focusedItem: null,
|
|
27
|
+
setFocusedItem: () => null,
|
|
28
|
+
expandedForAnimation: true,
|
|
29
|
+
openedDrilldowns: [],
|
|
30
|
+
setOpenedDrilldowns: () => null,
|
|
31
|
+
visibleItems: [],
|
|
32
|
+
visibleItemsRefs: {
|
|
33
|
+
current: {}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const LeftNavContext = /*#__PURE__*/React.createContext(defaultContext);
|
|
37
|
+
|
|
38
|
+
exports.LeftNavContext = LeftNavContext;
|
|
39
|
+
exports["default"] = LeftNavContext;
|
|
40
|
+
exports.defaultContext = defaultContext;
|
|
41
|
+
exports.defaultProps = defaultProps;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const commonItemBackgroundStyle = (color, hoverColor, activeColor) => "\n\n background: ".concat(color, ";\n\n :hover {\n background: ").concat(hoverColor, ";\n }\n\n :active {\n background: ").concat(activeColor, ";\n }\n");
|
|
6
|
+
|
|
7
|
+
const getItemBackgroundStyle = props => {
|
|
8
|
+
if (props.selected && !props.opened) return commonItemBackgroundStyle(props.theme.colors.brand[200], props.theme.colors.brand[200], props.theme.colors.brand[200]);
|
|
9
|
+
return commonItemBackgroundStyle(props.theme.colors.neutral['000'], props.theme.colors.neutral['080'], props.theme.colors.brand[200]);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.getItemBackgroundStyle = getItemBackgroundStyle;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const commonLeftBorderStyle = (color, hoverColor, activeColor) => "\n\n -webkit-box-shadow: inset 4px 0 0 0 ".concat(color, ";\n box-shadow: inset 4px 0 0 0 ").concat(color, ";\n\n :hover {\n -webkit-box-shadow: inset 4px 0 0 0 ").concat(hoverColor, ";\n box-shadow: inset 4px 0 0 0 ").concat(hoverColor, ";\n }\n\n :active {\n -webkit-box-shadow: inset 4px 0 0 0 ").concat(activeColor, ";\n box-shadow: inset 4px 0 0 0 ").concat(activeColor, ";\n }\n");
|
|
6
|
+
|
|
7
|
+
const getLeftBorderStyle = props => {
|
|
8
|
+
if (props.selected || props.selectedParent) return commonLeftBorderStyle(props.theme.colors.brand[400], props.theme.colors.brand[400], props.theme.colors.brand[400]);
|
|
9
|
+
return commonLeftBorderStyle(props.theme.colors.neutral['000'], props.theme.colors.brand[300], props.theme.colors.brand[400]);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.getLeftBorderStyle = getLeftBorderStyle;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const getScrolbarStyle = () => "\n ::-webkit-scrollbar {\n width: 14px;\n }\n ::-webkit-scrollbar-thumb {\n height: 6px;\n border: 4px solid rgba(0, 0, 0, 0);\n\n background-clip: padding-box;\n\n background-color: rgba(105, 116, 137, 0.5);\n\n border-radius: 7px;\n -webkit-border-radius: 7px;\n }\n ::-webkit-scrollbar-button {\n width: 0;\n height: 0;\n display: none;\n }\n ::-webkit-scrollbar-corner {\n background-color: transparent;\n }\n";
|
|
6
|
+
|
|
7
|
+
exports.getScrolbarStyle = getScrolbarStyle;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var getItemBackgroundStyle = require('./getItemBackgroundStyle.js');
|
|
6
|
+
var getLeftBorderStyle = require('./getLeftBorderStyle.js');
|
|
7
|
+
var getScrollbarStyle = require('./getScrollbarStyle.js');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.getItemBackgroundStyle = getItemBackgroundStyle.getItemBackgroundStyle;
|
|
12
|
+
exports.getLeftBorderStyle = getLeftBorderStyle.getLeftBorderStyle;
|
|
13
|
+
exports.getScrolbarStyle = getScrollbarStyle.getScrolbarStyle;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var useLeftNavConfig = require('./useLeftNavConfig.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports["default"] = useLeftNavConfig.useLeftNavConfig;
|
|
10
|
+
exports.useLeftNavConfig = useLeftNavConfig.useLeftNavConfig;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var useLeftNavItems = require('./useLeftNavItems.js');
|
|
8
|
+
var useLeftNavSmoothExpand = require('./useLeftNavSmoothExpand.js');
|
|
9
|
+
var useSelectFirstBodyItem = require('../hooks/useSelectFirstBodyItem.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
+
|
|
15
|
+
const useLeftNavConfig = props => {
|
|
16
|
+
const {
|
|
17
|
+
expanded,
|
|
18
|
+
openedItem,
|
|
19
|
+
onSelectedChange,
|
|
20
|
+
onFocusChange,
|
|
21
|
+
items
|
|
22
|
+
} = props; // -----------------------------------------------------------------------------
|
|
23
|
+
// ************************** ------------ **************************
|
|
24
|
+
// * INTERNAL STATE *
|
|
25
|
+
// ************************** ------------ **************************
|
|
26
|
+
// Selection related
|
|
27
|
+
|
|
28
|
+
const [selectedItem, setSelectedItem] = React__default["default"].useState(null);
|
|
29
|
+
const [selectedParent, setSelectedParent] = React__default["default"].useState(null); // Focus related
|
|
30
|
+
|
|
31
|
+
const [focusedItem, setFocusedItem] = React__default["default"].useState(null); // Opened uncontrolled drilldowns
|
|
32
|
+
|
|
33
|
+
const [openedDrilldowns, setOpenedDrilldowns] = React__default["default"].useState([]); // -----------------------------------------------------------------------------
|
|
34
|
+
// ************************** ------------ **************************
|
|
35
|
+
// * EXPAND ANIMATION *
|
|
36
|
+
// ************************** ------------ **************************
|
|
37
|
+
|
|
38
|
+
const [expandedForAnimation, setExpandedForAnimation] = React__default["default"].useState(expanded);
|
|
39
|
+
const timeoutRef = React__default["default"].useRef(null);
|
|
40
|
+
const smoothExpandOpts = React__default["default"].useMemo(() => ({
|
|
41
|
+
expandedForAnimation,
|
|
42
|
+
timeoutRef,
|
|
43
|
+
setExpandedForAnimation
|
|
44
|
+
}), [expandedForAnimation, timeoutRef, setExpandedForAnimation]);
|
|
45
|
+
useLeftNavSmoothExpand.useLeftNavSmoothExpand(props, smoothExpandOpts); // -----------------------------------------------------------------------------
|
|
46
|
+
// ************************** ------------ **************************
|
|
47
|
+
// * SIDE EFFECTS *
|
|
48
|
+
// ************************** ------------ **************************
|
|
49
|
+
|
|
50
|
+
React__default["default"].useEffect(() => {
|
|
51
|
+
onSelectedChange(selectedItem);
|
|
52
|
+
}, [selectedItem, onSelectedChange]);
|
|
53
|
+
React__default["default"].useEffect(() => {
|
|
54
|
+
if (props.actionRef && props.actionRef.current) {
|
|
55
|
+
props.actionRef.current.setFocusedItem = setFocusedItem;
|
|
56
|
+
}
|
|
57
|
+
}, [props.actionRef]);
|
|
58
|
+
React__default["default"].useEffect(() => {
|
|
59
|
+
if (openedItem !== null) setSelectedParent(openedItem);
|
|
60
|
+
}, [openedItem]);
|
|
61
|
+
React__default["default"].useEffect(() => {
|
|
62
|
+
onFocusChange(focusedItem);
|
|
63
|
+
}, [focusedItem, onFocusChange]);
|
|
64
|
+
useSelectFirstBodyItem.useSelectFirstBodyItem(items, openedItem, props.selectedItem !== undefined ? props.selectedItem : selectedItem, setSelectedItem, props.disableDefaultSelection); // -----------------------------------------------------------------------------
|
|
65
|
+
// ************************** ------------ **************************
|
|
66
|
+
// * ITEMS MANAGEMENT *
|
|
67
|
+
// ************************** ------------ **************************
|
|
68
|
+
|
|
69
|
+
const leftNavItemsProps = React__default["default"].useMemo(() => ({
|
|
70
|
+
headerItem: props.HeaderComponent,
|
|
71
|
+
bodyHeaderItem: props.BodyHeaderComponent,
|
|
72
|
+
items: props.items,
|
|
73
|
+
openedDrilldowns
|
|
74
|
+
}), [props.HeaderComponent, props.BodyHeaderComponent, props.items, openedDrilldowns]); // We need to know the current visible items since we have drilldowns
|
|
75
|
+
|
|
76
|
+
const {
|
|
77
|
+
visibleItems,
|
|
78
|
+
visibleItemsRefs
|
|
79
|
+
} = useLeftNavItems.useLeftNavItems(leftNavItemsProps); // -----------------------------------------------------------------------------
|
|
80
|
+
// ************************** ------------ **************************
|
|
81
|
+
// * LEFTNAV CONFIG *
|
|
82
|
+
// ************************** ------------ **************************
|
|
83
|
+
|
|
84
|
+
const finalConfig = React__default["default"].useMemo(() => ({
|
|
85
|
+
leftNavProps: props,
|
|
86
|
+
expandedForAnimation,
|
|
87
|
+
selectedItem: props.selectedItem !== undefined ? props.selectedItem : selectedItem,
|
|
88
|
+
setSelectedItem,
|
|
89
|
+
selectedParent: props.selectedParent !== undefined ? props.selectedParent : selectedParent,
|
|
90
|
+
setSelectedParent,
|
|
91
|
+
focusedItem,
|
|
92
|
+
setFocusedItem,
|
|
93
|
+
openedDrilldowns,
|
|
94
|
+
setOpenedDrilldowns,
|
|
95
|
+
visibleItems,
|
|
96
|
+
visibleItemsRefs
|
|
97
|
+
}), [props, expandedForAnimation, selectedItem, setSelectedItem, setSelectedParent, selectedParent, focusedItem, setFocusedItem, openedDrilldowns, setOpenedDrilldowns, visibleItems, visibleItemsRefs]);
|
|
98
|
+
return finalConfig;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
exports["default"] = useLeftNavConfig;
|
|
102
|
+
exports.useLeftNavConfig = useLeftNavConfig;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
+
var React = require('react');
|
|
10
|
+
var constants = require('../exported-related/constants.js');
|
|
11
|
+
require('@babel/runtime/helpers/jsx');
|
|
12
|
+
require('@elliemae/ds-grid');
|
|
13
|
+
require('styled-components');
|
|
14
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
15
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
16
|
+
require('@babel/runtime/helpers/defineProperty');
|
|
17
|
+
require('react/jsx-runtime');
|
|
18
|
+
require('@elliemae/ds-icons');
|
|
19
|
+
|
|
20
|
+
const notFocuseableItems = [constants.ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, constants.ITEM_TYPES.LEFT_NAV_ITEM_SECTION]; // Walks the array of items
|
|
21
|
+
// Drilldowns are tree-like structures
|
|
22
|
+
|
|
23
|
+
const walkItems = (items, openedDrilldowns, callback) => {
|
|
24
|
+
items.forEach(item => {
|
|
25
|
+
if (typeof item.type === 'string') {
|
|
26
|
+
var _item$itemOpts$items, _item$itemOpts, _item$itemOpts2, _item$itemOpts$items2, _item$itemOpts3;
|
|
27
|
+
|
|
28
|
+
// Out of the box item
|
|
29
|
+
if (notFocuseableItems.includes(item.type)) return; // not focuseable
|
|
30
|
+
|
|
31
|
+
callback(item.dsId); // If it's an opened uncontrolled drilldown
|
|
32
|
+
|
|
33
|
+
if (item.type === constants.ITEM_TYPES.LEFT_NAV_ITEM_UNCONTROLLED_DRILLDOWN && openedDrilldowns.includes(item.dsId)) walkItems((_item$itemOpts$items = (_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.items) !== null && _item$itemOpts$items !== void 0 ? _item$itemOpts$items : [], openedDrilldowns, callback); // If it's an opened controlled drilldown
|
|
34
|
+
|
|
35
|
+
if (item.type === constants.ITEM_TYPES.LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN && (_item$itemOpts2 = item.itemOpts) !== null && _item$itemOpts2 !== void 0 && _item$itemOpts2.isOpened) walkItems((_item$itemOpts$items2 = (_item$itemOpts3 = item.itemOpts) === null || _item$itemOpts3 === void 0 ? void 0 : _item$itemOpts3.items) !== null && _item$itemOpts$items2 !== void 0 ? _item$itemOpts$items2 : [], openedDrilldowns, callback);
|
|
36
|
+
} else {
|
|
37
|
+
var _item$itemOpts4;
|
|
38
|
+
|
|
39
|
+
// Custom item
|
|
40
|
+
if (!((_item$itemOpts4 = item.itemOpts) !== null && _item$itemOpts4 !== void 0 && _item$itemOpts4.focuseable)) return; // not focuseable specified
|
|
41
|
+
|
|
42
|
+
callback(item.dsId);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const useLeftNavItems = props => {
|
|
48
|
+
const {
|
|
49
|
+
headerItem,
|
|
50
|
+
bodyHeaderItem,
|
|
51
|
+
items: bodyItems,
|
|
52
|
+
openedDrilldowns
|
|
53
|
+
} = props; // Place the header and body header items into the array of items
|
|
54
|
+
|
|
55
|
+
const items = React.useMemo(() => {
|
|
56
|
+
const itemsArray = [...bodyItems];
|
|
57
|
+
if (bodyHeaderItem) itemsArray.unshift(bodyHeaderItem);
|
|
58
|
+
if (headerItem) itemsArray.unshift(headerItem);
|
|
59
|
+
return itemsArray;
|
|
60
|
+
}, [headerItem, bodyHeaderItem, bodyItems]);
|
|
61
|
+
const visibleItemsRefs = React.useRef({});
|
|
62
|
+
const visibleItems = React.useMemo(() => {
|
|
63
|
+
const visibleItemsArray = [];
|
|
64
|
+
walkItems(items, openedDrilldowns, dsId => {
|
|
65
|
+
visibleItemsArray.push(dsId);
|
|
66
|
+
});
|
|
67
|
+
visibleItemsArray.push(constants.FOOTER_DS_ID);
|
|
68
|
+
return visibleItemsArray;
|
|
69
|
+
}, [items, openedDrilldowns]);
|
|
70
|
+
visibleItems.forEach(dsId => {
|
|
71
|
+
if (!(dsId in visibleItemsRefs.current)) visibleItemsRefs.current[dsId] = /*#__PURE__*/React.createRef();
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
visibleItems,
|
|
75
|
+
visibleItemsRefs
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
exports["default"] = useLeftNavItems;
|
|
80
|
+
exports.useLeftNavItems = useLeftNavItems;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
+
|
|
11
|
+
const useLeftNavSmoothExpand = (props, smoothExpandOpts) => {
|
|
12
|
+
const {
|
|
13
|
+
expanded
|
|
14
|
+
} = props;
|
|
15
|
+
const {
|
|
16
|
+
expandedForAnimation,
|
|
17
|
+
timeoutRef,
|
|
18
|
+
setExpandedForAnimation
|
|
19
|
+
} = smoothExpandOpts;
|
|
20
|
+
React__default["default"].useEffect(() => {
|
|
21
|
+
// If expanded changes, we need to smoothly transition to the non-expanded state
|
|
22
|
+
// so we need to wait for 350ms
|
|
23
|
+
if (!expanded && expandedForAnimation) {
|
|
24
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
25
|
+
timeoutRef.current = setTimeout(() => setExpandedForAnimation(false), 350);
|
|
26
|
+
} else if (expanded) setExpandedForAnimation(true); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
|
+
|
|
28
|
+
}, [expanded]);
|
|
29
|
+
React__default["default"].useEffect(() => () => {
|
|
30
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
31
|
+
}, [timeoutRef]);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports["default"] = useLeftNavSmoothExpand;
|
|
35
|
+
exports.useLeftNavSmoothExpand = useLeftNavSmoothExpand;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
+
require('react');
|
|
12
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
13
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
14
|
+
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
18
|
+
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
+
|
|
21
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22
|
+
const ChevronItem = props => /*#__PURE__*/jsxRuntime.jsx(dsIcons.ChevronSmallRight, _objectSpread({
|
|
23
|
+
size: "m",
|
|
24
|
+
color: ['brand-primary', 800]
|
|
25
|
+
}, props));
|
|
26
|
+
|
|
27
|
+
exports.ChevronItem = ChevronItem;
|
|
28
|
+
exports["default"] = ChevronItem;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
+
require('react');
|
|
12
|
+
var styled = require('styled-components');
|
|
13
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
14
|
+
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
18
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
19
|
+
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
+
|
|
24
|
+
const AugmentedIcon = Icon => styled__default["default"](Icon).withConfig({
|
|
25
|
+
componentId: "sc-1eek2uh-0"
|
|
26
|
+
})(["cursor:pointer;outline:0;:focus,:active{outline:1px solid #1e79c2;}"]);
|
|
27
|
+
|
|
28
|
+
const Icon = IconComponent => props => {
|
|
29
|
+
const StyledComponent = AugmentedIcon(IconComponent);
|
|
30
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledComponent, _objectSpread({
|
|
31
|
+
color: ['brand-primary', 800],
|
|
32
|
+
tabIndex: 0
|
|
33
|
+
}, props));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.Icon = Icon;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var Grid = require('@elliemae/ds-grid');
|
|
8
|
+
var styled = require('./styled.js');
|
|
9
|
+
var LeftNavigationContext = require('../../LeftNavigationContext.js');
|
|
10
|
+
var usePropsWithDefaults = require('./usePropsWithDefaults.js');
|
|
11
|
+
var useKeyboardNavigation = require('../../hooks/useKeyboardNavigation.js');
|
|
12
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
17
|
+
var Grid__default = /*#__PURE__*/_interopDefaultLegacy(Grid);
|
|
18
|
+
|
|
19
|
+
const ItemRenderer = props => {
|
|
20
|
+
const propsWithDefault = usePropsWithDefaults.usePropsWithDefaults(props);
|
|
21
|
+
const {
|
|
22
|
+
item,
|
|
23
|
+
item: {
|
|
24
|
+
dsId,
|
|
25
|
+
itemOpts: {
|
|
26
|
+
selectable,
|
|
27
|
+
focuseable,
|
|
28
|
+
indent,
|
|
29
|
+
ariaLabel,
|
|
30
|
+
ariaRole,
|
|
31
|
+
ariaLive,
|
|
32
|
+
ariaExpanded,
|
|
33
|
+
ariaDescribedBy
|
|
34
|
+
},
|
|
35
|
+
CollapsedComponent
|
|
36
|
+
},
|
|
37
|
+
subitems,
|
|
38
|
+
minHeight,
|
|
39
|
+
paddingTop,
|
|
40
|
+
onClick,
|
|
41
|
+
shadowStyle,
|
|
42
|
+
hasBorderBottom,
|
|
43
|
+
borderBottomMr,
|
|
44
|
+
children
|
|
45
|
+
} = propsWithDefault;
|
|
46
|
+
const ctx = React.useContext(LeftNavigationContext.LeftNavContext);
|
|
47
|
+
const {
|
|
48
|
+
leftNavProps: {
|
|
49
|
+
onItemClick,
|
|
50
|
+
openedItem
|
|
51
|
+
},
|
|
52
|
+
expandedForAnimation,
|
|
53
|
+
selectedParent,
|
|
54
|
+
selectedItem,
|
|
55
|
+
setSelectedItem,
|
|
56
|
+
setFocusedItem,
|
|
57
|
+
visibleItemsRefs
|
|
58
|
+
} = ctx;
|
|
59
|
+
const opened = dsId === openedItem;
|
|
60
|
+
const handleOnClick = React.useCallback(e => {
|
|
61
|
+
if (onClick) onClick(); // used by uncontrolled drilldowns
|
|
62
|
+
|
|
63
|
+
onItemClick(item, e);
|
|
64
|
+
if (selectable) setSelectedItem(item.dsId);
|
|
65
|
+
}, [onItemClick, item, setSelectedItem, selectable, onClick]);
|
|
66
|
+
const handleFocus = React.useCallback(() => {
|
|
67
|
+
if (focuseable) setFocusedItem(dsId);
|
|
68
|
+
}, [dsId, setFocusedItem, focuseable]);
|
|
69
|
+
const onKeyDown = useKeyboardNavigation.useKeyboardNavigation({
|
|
70
|
+
item,
|
|
71
|
+
onClick: handleOnClick
|
|
72
|
+
});
|
|
73
|
+
const cols = React.useMemo(() => expandedForAnimation ? ['auto', '1fr', 'auto'] : ['38px'], [expandedForAnimation]);
|
|
74
|
+
const isSelected = React.useMemo(() => selectedItem === dsId, [selectedItem, dsId]);
|
|
75
|
+
|
|
76
|
+
if (!expandedForAnimation && !CollapsedComponent) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
81
|
+
children: [/*#__PURE__*/_jsx__default["default"](styled.StyledItemWrapper, {
|
|
82
|
+
shadowStyle: shadowStyle(opened, item.type),
|
|
83
|
+
"data-testid": "leftnav-item-wrapper"
|
|
84
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsx(styled.StyledItem, {
|
|
85
|
+
ref: visibleItemsRefs.current[dsId],
|
|
86
|
+
pt: paddingTop,
|
|
87
|
+
pl: indent === undefined ? 'xxxs' : "".concat(indent, "px"),
|
|
88
|
+
minHeight: minHeight,
|
|
89
|
+
shadowStyle: shadowStyle(opened, item.type),
|
|
90
|
+
alignItems: "flex-start",
|
|
91
|
+
cols: cols,
|
|
92
|
+
onClick: !opened ? handleOnClick : () => null,
|
|
93
|
+
onKeyDown: onKeyDown,
|
|
94
|
+
selectable: selectable,
|
|
95
|
+
selected: isSelected,
|
|
96
|
+
selectedParent: selectedParent === dsId,
|
|
97
|
+
opened: opened,
|
|
98
|
+
onFocus: handleFocus,
|
|
99
|
+
"data-testid": "leftnav-item-container",
|
|
100
|
+
tabIndex: focuseable ? 0 : -1,
|
|
101
|
+
"aria-describedby": ariaDescribedBy,
|
|
102
|
+
"aria-expanded": ariaExpanded,
|
|
103
|
+
role: ariaRole,
|
|
104
|
+
"data-selected": isSelected,
|
|
105
|
+
"data-selectedparent": selectedParent === dsId,
|
|
106
|
+
"aria-label": ariaLabel,
|
|
107
|
+
"aria-hidden": !focuseable,
|
|
108
|
+
"aria-live": ariaLive,
|
|
109
|
+
children: !expandedForAnimation ? /*#__PURE__*/_jsx__default["default"](Grid__default["default"], {
|
|
110
|
+
"data-testid": "leftnav-leftcomponent",
|
|
111
|
+
justifyContent: "center"
|
|
112
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](CollapsedComponent, {
|
|
113
|
+
item: item,
|
|
114
|
+
ctx: ctx
|
|
115
|
+
})) : children
|
|
116
|
+
}), hasBorderBottom && /*#__PURE__*/_jsx__default["default"]("div", {
|
|
117
|
+
style: {
|
|
118
|
+
marginLeft: opened ? '16px' : '0px',
|
|
119
|
+
marginRight: borderBottomMr,
|
|
120
|
+
height: '1px',
|
|
121
|
+
width: "calc(100% - ".concat(borderBottomMr, " - ").concat(opened ? '16px' : '0px', ")"),
|
|
122
|
+
backgroundColor: '#E0E3E8'
|
|
123
|
+
}
|
|
124
|
+
})), subitems]
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
exports.ItemRenderer = ItemRenderer;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Grid = require('@elliemae/ds-grid');
|
|
6
|
+
var styled = require('styled-components');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var Grid__default = /*#__PURE__*/_interopDefaultLegacy(Grid);
|
|
11
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
|
+
|
|
13
|
+
/* eslint-disable indent */
|
|
14
|
+
const borderOutside = function (color) {
|
|
15
|
+
let weight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
16
|
+
return "&:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: ".concat(weight, "px solid ").concat(color, ";\n pointer-events: none;\n}");
|
|
17
|
+
};
|
|
18
|
+
const StyledItemWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
19
|
+
componentId: "sc-11wzgfh-0"
|
|
20
|
+
})(["position:relative;", ""], props => props.shadowStyle(props.theme));
|
|
21
|
+
|
|
22
|
+
const getItemBackground = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
selectable,
|
|
25
|
+
opened,
|
|
26
|
+
selected,
|
|
27
|
+
theme
|
|
28
|
+
} = _ref;
|
|
29
|
+
if (!selectable) return 'white';
|
|
30
|
+
if (selected && !opened) return theme.colors.brand[200];
|
|
31
|
+
return theme.colors.neutral['000'];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const getItemHoverBackground = _ref2 => {
|
|
35
|
+
let {
|
|
36
|
+
selectable,
|
|
37
|
+
opened,
|
|
38
|
+
selected,
|
|
39
|
+
theme
|
|
40
|
+
} = _ref2;
|
|
41
|
+
if (!selectable) return 'white';
|
|
42
|
+
if (selected && !opened) return theme.colors.brand[200];
|
|
43
|
+
return theme.colors.brand['200'];
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const StyledItem = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
47
|
+
componentId: "sc-11wzgfh-1"
|
|
48
|
+
})(["cursor:", ";min-height:", ";background:", ";", ":hover{background:", ";}:active{background:", ";}", ";outline:none;", ""], props => props.selectable && !props.opened ? 'pointer' : 'auto', props => props.minHeight, getItemBackground, props => props.selected && !props.opened ? borderOutside(props.theme.colors.brand[500], 1) : '', getItemHoverBackground, _ref3 => {
|
|
49
|
+
let {
|
|
50
|
+
selectable,
|
|
51
|
+
theme
|
|
52
|
+
} = _ref3;
|
|
53
|
+
return selectable ? theme.colors.brand[200] : 'white';
|
|
54
|
+
}, props => props.shadowStyle(props.theme), props => props.tabIndex !== -1 ? ":focus {\n ".concat(borderOutside(props.theme.colors.brand[700]), "\n }") : '');
|
|
55
|
+
|
|
56
|
+
exports.StyledItem = StyledItem;
|
|
57
|
+
exports.StyledItemWrapper = StyledItemWrapper;
|
|
58
|
+
exports.borderOutside = borderOutside;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
+
var React = require('react');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
16
|
+
|
|
17
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
+
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
|
+
const itemDefaultProps = {
|
|
21
|
+
label: '',
|
|
22
|
+
labelOverflow: 'truncate',
|
|
23
|
+
selectable: true,
|
|
24
|
+
focuseable: true,
|
|
25
|
+
openable: false,
|
|
26
|
+
closable: false,
|
|
27
|
+
ariaLabel: '',
|
|
28
|
+
ariaRole: 'menuitem',
|
|
29
|
+
ariaLive: 'off',
|
|
30
|
+
ariaExpanded: undefined,
|
|
31
|
+
ariaDescribedBy: undefined
|
|
32
|
+
};
|
|
33
|
+
const itemWithoutShadows = ['ds-left-nav-item-header', 'ds-left-nav-item-link', 'ds-left-nav-item-submenu']; // Make use Item props with defaults
|
|
34
|
+
|
|
35
|
+
const usePropsWithDefaults = props => {
|
|
36
|
+
const propsWithDefault = React.useMemo(() => {
|
|
37
|
+
const itemWithDefaults = _objectSpread(_objectSpread({
|
|
38
|
+
CollapsedComponent: () => null
|
|
39
|
+
}, props.item), {}, {
|
|
40
|
+
itemOpts: _objectSpread(_objectSpread({}, itemDefaultProps), props.item.itemOpts)
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return _objectSpread(_objectSpread({
|
|
44
|
+
minHeight: '48px',
|
|
45
|
+
paddingTop: '12px',
|
|
46
|
+
subitems: [],
|
|
47
|
+
shadowStyle: (opened, type) => theme => "box-shadow: ".concat(opened || !itemWithoutShadows.includes(type) ? 'inset 4px 0 0 0 #52A6EC' : 'inset 4px 0 0 0 white'),
|
|
48
|
+
hasBorderBottom: false,
|
|
49
|
+
borderBottomMr: '0px'
|
|
50
|
+
}, props), {}, {
|
|
51
|
+
item: itemWithDefaults
|
|
52
|
+
});
|
|
53
|
+
}, [props]);
|
|
54
|
+
return propsWithDefault;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.usePropsWithDefaults = usePropsWithDefaults;
|