@elliemae/ds-left-navigation 2.1.1-rc.1 → 2.2.0-alpha.4

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.
Files changed (209) hide show
  1. package/cjs/LeftNavigation.js +49 -27
  2. package/cjs/LeftNavigation.js.map +7 -0
  3. package/cjs/LeftNavigationContext.js +44 -18
  4. package/cjs/LeftNavigationContext.js.map +7 -0
  5. package/cjs/common/getItemBackgroundStyle.js +47 -8
  6. package/cjs/common/getItemBackgroundStyle.js.map +7 -0
  7. package/cjs/common/getLeftBorderStyle.js +50 -8
  8. package/cjs/common/getLeftBorderStyle.js.map +7 -0
  9. package/cjs/common/getScrollbarStyle.js +55 -4
  10. package/cjs/common/getScrollbarStyle.js.map +7 -0
  11. package/cjs/common/index.js +30 -13
  12. package/cjs/common/index.js.map +7 -0
  13. package/cjs/configs/index.js +38 -10
  14. package/cjs/configs/index.js.map +7 -0
  15. package/cjs/configs/useLeftNavConfig.js +76 -72
  16. package/cjs/configs/useLeftNavConfig.js.map +7 -0
  17. package/cjs/configs/useLeftNavItems.js +66 -64
  18. package/cjs/configs/useLeftNavItems.js.map +7 -0
  19. package/cjs/configs/useLeftNavSmoothExpand.js +42 -21
  20. package/cjs/configs/useLeftNavSmoothExpand.js.map +7 -0
  21. package/cjs/exported-related/ChevronItem/index.js +42 -27
  22. package/cjs/exported-related/ChevronItem/index.js.map +7 -0
  23. package/cjs/exported-related/Icon/index.js +51 -34
  24. package/cjs/exported-related/Icon/index.js.map +7 -0
  25. package/cjs/exported-related/ItemRenderer/index.js +99 -94
  26. package/cjs/exported-related/ItemRenderer/index.js.map +7 -0
  27. package/cjs/exported-related/ItemRenderer/styled.js +83 -51
  28. package/cjs/exported-related/ItemRenderer/styled.js.map +7 -0
  29. package/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js +57 -45
  30. package/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js.map +7 -0
  31. package/cjs/exported-related/Notifications/index.js +81 -61
  32. package/cjs/exported-related/Notifications/index.js.map +7 -0
  33. package/cjs/exported-related/OpenWindowItem/index.js +49 -32
  34. package/cjs/exported-related/OpenWindowItem/index.js.map +7 -0
  35. package/cjs/exported-related/constants.js +53 -25
  36. package/cjs/exported-related/constants.js.map +7 -0
  37. package/cjs/exported-related/index.js +33 -23
  38. package/cjs/exported-related/index.js.map +7 -0
  39. package/cjs/hooks/index.js +30 -13
  40. package/cjs/hooks/index.js.map +7 -0
  41. package/cjs/hooks/useExpandableOnClickHandler.js +55 -26
  42. package/cjs/hooks/useExpandableOnClickHandler.js.map +7 -0
  43. package/cjs/hooks/useKeyboardNavigation.js +62 -54
  44. package/cjs/hooks/useKeyboardNavigation.js.map +7 -0
  45. package/cjs/hooks/useOpenableOnClickHandler.js +55 -26
  46. package/cjs/hooks/useOpenableOnClickHandler.js.map +7 -0
  47. package/cjs/hooks/useSelectFirstBodyItem.js +46 -30
  48. package/cjs/hooks/useSelectFirstBodyItem.js.map +7 -0
  49. package/cjs/index.d.js +27 -2
  50. package/cjs/index.d.js.map +7 -0
  51. package/cjs/index.js +41 -30
  52. package/cjs/index.js.map +7 -0
  53. package/cjs/outOfTheBox/ItemControlledDrilldown/index.js +97 -103
  54. package/cjs/outOfTheBox/ItemControlledDrilldown/index.js.map +7 -0
  55. package/cjs/outOfTheBox/ItemControlledDrilldown/styled.js +49 -27
  56. package/cjs/outOfTheBox/ItemControlledDrilldown/styled.js.map +7 -0
  57. package/cjs/outOfTheBox/ItemHeader/index.js +95 -91
  58. package/cjs/outOfTheBox/ItemHeader/index.js.map +7 -0
  59. package/cjs/outOfTheBox/ItemHeader/styled.js +49 -22
  60. package/cjs/outOfTheBox/ItemHeader/styled.js.map +7 -0
  61. package/cjs/outOfTheBox/ItemLink/index.js +75 -65
  62. package/cjs/outOfTheBox/ItemLink/index.js.map +7 -0
  63. package/cjs/outOfTheBox/ItemLink/styled.js +41 -17
  64. package/cjs/outOfTheBox/ItemLink/styled.js.map +7 -0
  65. package/cjs/outOfTheBox/ItemSection/index.js +59 -63
  66. package/cjs/outOfTheBox/ItemSection/index.js.map +7 -0
  67. package/cjs/outOfTheBox/ItemSection/styled.js +53 -23
  68. package/cjs/outOfTheBox/ItemSection/styled.js.map +7 -0
  69. package/cjs/outOfTheBox/ItemSeparator/index.js +56 -45
  70. package/cjs/outOfTheBox/ItemSeparator/index.js.map +7 -0
  71. package/cjs/outOfTheBox/ItemSubmenu/index.js +95 -90
  72. package/cjs/outOfTheBox/ItemSubmenu/index.js.map +7 -0
  73. package/cjs/outOfTheBox/ItemSubmenu/styled.js +49 -22
  74. package/cjs/outOfTheBox/ItemSubmenu/styled.js.map +7 -0
  75. package/cjs/outOfTheBox/ItemTextLabel/index.js +51 -52
  76. package/cjs/outOfTheBox/ItemTextLabel/index.js.map +7 -0
  77. package/cjs/outOfTheBox/ItemTextLabel/styled.js +43 -23
  78. package/cjs/outOfTheBox/ItemTextLabel/styled.js.map +7 -0
  79. package/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js +107 -113
  80. package/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +7 -0
  81. package/cjs/outOfTheBox/ItemUncontrolledDrilldown/styled.js +49 -27
  82. package/cjs/outOfTheBox/ItemUncontrolledDrilldown/styled.js.map +7 -0
  83. package/cjs/outOfTheBox/ItemWithDate/index.js +59 -54
  84. package/cjs/outOfTheBox/ItemWithDate/index.js.map +7 -0
  85. package/cjs/outOfTheBox/ItemWithDate/styled.js +49 -27
  86. package/cjs/outOfTheBox/ItemWithDate/styled.js.map +7 -0
  87. package/cjs/outOfTheBox/index.js +65 -50
  88. package/cjs/outOfTheBox/index.js.map +7 -0
  89. package/cjs/parts/LeftNavContent/index.js +75 -71
  90. package/cjs/parts/LeftNavContent/index.js.map +7 -0
  91. package/cjs/parts/LeftNavContent/styled.js +110 -50
  92. package/cjs/parts/LeftNavContent/styled.js.map +7 -0
  93. package/cjs/parts/LeftNavContentWithScrollbar/index.js +89 -79
  94. package/cjs/parts/LeftNavContentWithScrollbar/index.js.map +7 -0
  95. package/cjs/parts/LeftNavFooterItem/index.js +97 -80
  96. package/cjs/parts/LeftNavFooterItem/index.js.map +7 -0
  97. package/cjs/parts/LeftNavFooterItem/styled.js +89 -34
  98. package/cjs/parts/LeftNavFooterItem/styled.js.map +7 -0
  99. package/cjs/parts/LeftNavLoading/index.js +51 -33
  100. package/cjs/parts/LeftNavLoading/index.js.map +7 -0
  101. package/cjs/parts/OutOfTheBoxMapItem.js +49 -46
  102. package/cjs/parts/OutOfTheBoxMapItem.js.map +7 -0
  103. package/cjs/prop-types.js +58 -39
  104. package/cjs/prop-types.js.map +7 -0
  105. package/esm/LeftNavigation.js +17 -15
  106. package/esm/LeftNavigation.js.map +7 -0
  107. package/esm/LeftNavigationContext.js +15 -11
  108. package/esm/LeftNavigationContext.js.map +7 -0
  109. package/esm/common/getItemBackgroundStyle.js +20 -6
  110. package/esm/common/getItemBackgroundStyle.js.map +7 -0
  111. package/esm/common/getLeftBorderStyle.js +23 -6
  112. package/esm/common/getLeftBorderStyle.js.map +7 -0
  113. package/esm/common/getScrollbarStyle.js +28 -2
  114. package/esm/common/getScrollbarStyle.js.map +7 -0
  115. package/esm/common/index.js +5 -3
  116. package/esm/common/index.js.map +7 -0
  117. package/esm/configs/index.js +9 -2
  118. package/esm/configs/index.js.map +7 -0
  119. package/esm/configs/useLeftNavConfig.js +47 -63
  120. package/esm/configs/useLeftNavConfig.js.map +7 -0
  121. package/esm/configs/useLeftNavItems.js +33 -55
  122. package/esm/configs/useLeftNavItems.js.map +7 -0
  123. package/esm/configs/useLeftNavSmoothExpand.js +13 -12
  124. package/esm/configs/useLeftNavSmoothExpand.js.map +7 -0
  125. package/esm/exported-related/ChevronItem/index.js +13 -18
  126. package/esm/exported-related/ChevronItem/index.js.map +7 -0
  127. package/esm/exported-related/Icon/index.js +21 -24
  128. package/esm/exported-related/Icon/index.js.map +7 -0
  129. package/esm/exported-related/ItemRenderer/index.js +65 -80
  130. package/esm/exported-related/ItemRenderer/index.js.map +7 -0
  131. package/esm/exported-related/ItemRenderer/styled.js +56 -42
  132. package/esm/exported-related/ItemRenderer/styled.js.map +7 -0
  133. package/esm/exported-related/ItemRenderer/usePropsWithDefaults.js +27 -36
  134. package/esm/exported-related/ItemRenderer/usePropsWithDefaults.js.map +7 -0
  135. package/esm/exported-related/Notifications/index.js +57 -50
  136. package/esm/exported-related/Notifications/index.js.map +7 -0
  137. package/esm/exported-related/OpenWindowItem/index.js +20 -22
  138. package/esm/exported-related/OpenWindowItem/index.js.map +7 -0
  139. package/esm/exported-related/constants.js +24 -17
  140. package/esm/exported-related/constants.js.map +7 -0
  141. package/esm/exported-related/index.js +8 -6
  142. package/esm/exported-related/index.js.map +7 -0
  143. package/esm/hooks/index.js +5 -3
  144. package/esm/hooks/index.js.map +7 -0
  145. package/esm/hooks/useExpandableOnClickHandler.js +26 -22
  146. package/esm/hooks/useExpandableOnClickHandler.js.map +7 -0
  147. package/esm/hooks/useKeyboardNavigation.js +30 -47
  148. package/esm/hooks/useKeyboardNavigation.js.map +7 -0
  149. package/esm/hooks/useOpenableOnClickHandler.js +26 -22
  150. package/esm/hooks/useOpenableOnClickHandler.js.map +7 -0
  151. package/esm/hooks/useSelectFirstBodyItem.js +17 -26
  152. package/esm/hooks/useSelectFirstBodyItem.js.map +7 -0
  153. package/esm/index.d.js +2 -1
  154. package/esm/index.d.js.map +7 -0
  155. package/esm/index.js +12 -8
  156. package/esm/index.js.map +7 -0
  157. package/esm/outOfTheBox/ItemControlledDrilldown/index.js +62 -87
  158. package/esm/outOfTheBox/ItemControlledDrilldown/index.js.map +7 -0
  159. package/esm/outOfTheBox/ItemControlledDrilldown/styled.js +20 -17
  160. package/esm/outOfTheBox/ItemControlledDrilldown/styled.js.map +7 -0
  161. package/esm/outOfTheBox/ItemHeader/index.js +65 -80
  162. package/esm/outOfTheBox/ItemHeader/index.js.map +7 -0
  163. package/esm/outOfTheBox/ItemHeader/styled.js +20 -12
  164. package/esm/outOfTheBox/ItemHeader/styled.js.map +7 -0
  165. package/esm/outOfTheBox/ItemLink/index.js +46 -55
  166. package/esm/outOfTheBox/ItemLink/index.js.map +7 -0
  167. package/esm/outOfTheBox/ItemLink/styled.js +12 -8
  168. package/esm/outOfTheBox/ItemLink/styled.js.map +7 -0
  169. package/esm/outOfTheBox/ItemSection/index.js +30 -53
  170. package/esm/outOfTheBox/ItemSection/index.js.map +7 -0
  171. package/esm/outOfTheBox/ItemSection/styled.js +24 -13
  172. package/esm/outOfTheBox/ItemSection/styled.js.map +7 -0
  173. package/esm/outOfTheBox/ItemSeparator/index.js +27 -35
  174. package/esm/outOfTheBox/ItemSeparator/index.js.map +7 -0
  175. package/esm/outOfTheBox/ItemSubmenu/index.js +65 -79
  176. package/esm/outOfTheBox/ItemSubmenu/index.js.map +7 -0
  177. package/esm/outOfTheBox/ItemSubmenu/styled.js +20 -12
  178. package/esm/outOfTheBox/ItemSubmenu/styled.js.map +7 -0
  179. package/esm/outOfTheBox/ItemTextLabel/index.js +22 -43
  180. package/esm/outOfTheBox/ItemTextLabel/index.js.map +7 -0
  181. package/esm/outOfTheBox/ItemTextLabel/styled.js +14 -14
  182. package/esm/outOfTheBox/ItemTextLabel/styled.js.map +7 -0
  183. package/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js +70 -95
  184. package/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +7 -0
  185. package/esm/outOfTheBox/ItemUncontrolledDrilldown/styled.js +20 -17
  186. package/esm/outOfTheBox/ItemUncontrolledDrilldown/styled.js.map +7 -0
  187. package/esm/outOfTheBox/ItemWithDate/index.js +30 -44
  188. package/esm/outOfTheBox/ItemWithDate/index.js.map +7 -0
  189. package/esm/outOfTheBox/ItemWithDate/styled.js +20 -17
  190. package/esm/outOfTheBox/ItemWithDate/styled.js.map +7 -0
  191. package/esm/outOfTheBox/index.js +25 -34
  192. package/esm/outOfTheBox/index.js.map +7 -0
  193. package/esm/parts/LeftNavContent/index.js +54 -64
  194. package/esm/parts/LeftNavContent/index.js.map +7 -0
  195. package/esm/parts/LeftNavContent/styled.js +81 -36
  196. package/esm/parts/LeftNavContent/styled.js.map +7 -0
  197. package/esm/parts/LeftNavContentWithScrollbar/index.js +56 -64
  198. package/esm/parts/LeftNavContentWithScrollbar/index.js.map +7 -0
  199. package/esm/parts/LeftNavFooterItem/index.js +73 -68
  200. package/esm/parts/LeftNavFooterItem/index.js.map +7 -0
  201. package/esm/parts/LeftNavFooterItem/styled.js +63 -24
  202. package/esm/parts/LeftNavFooterItem/styled.js.map +7 -0
  203. package/esm/parts/LeftNavLoading/index.js +22 -22
  204. package/esm/parts/LeftNavLoading/index.js.map +7 -0
  205. package/esm/parts/OutOfTheBoxMapItem.js +19 -35
  206. package/esm/parts/OutOfTheBoxMapItem.js.map +7 -0
  207. package/esm/prop-types.js +26 -29
  208. package/esm/prop-types.js.map +7 -0
  209. package/package.json +6 -6
@@ -1,89 +1,73 @@
1
- import 'core-js/modules/web.dom-collections.iterator.js';
2
- import React from 'react';
3
- import { useLeftNavItems } from './useLeftNavItems.js';
4
- import { useLeftNavSmoothExpand } from './useLeftNavSmoothExpand.js';
5
- import { useSelectFirstBodyItem } from '../hooks/useSelectFirstBodyItem.js';
6
-
7
- const useLeftNavConfig = props => {
8
- const {
9
- expanded,
10
- openedItem,
11
- onSelectedChange,
12
- onFocusChange,
13
- items
14
- } = props; // -----------------------------------------------------------------------------
15
- // ************************** ------------ **************************
16
- // * INTERNAL STATE *
17
- // ************************** ------------ **************************
18
- // Selection related
19
-
20
- const [selectedItem, setSelectedItem] = React.useState(null);
21
- React.useState(null);
22
- const [selectedParent, setSelectedParent] = React.useState(null); // Focus related
23
-
24
- const [focusedItem, setFocusedItem] = React.useState(null); // Opened uncontrolled drilldowns
25
-
26
- const [openedDrilldowns, setOpenedDrilldowns] = React.useState([]); // -----------------------------------------------------------------------------
27
- // ************************** ------------ **************************
28
- // * EXPAND ANIMATION *
29
- // ************************** ------------ **************************
30
-
31
- const [expandedForAnimation, setExpandedForAnimation] = React.useState(expanded);
32
- const timeoutRef = React.useRef(null);
33
- const smoothExpandOpts = React.useMemo(() => ({
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import useLeftNavItems from "./useLeftNavItems";
4
+ import { useLeftNavSmoothExpand } from "./useLeftNavSmoothExpand";
5
+ import { useSelectFirstBodyItem } from "../hooks/useSelectFirstBodyItem";
6
+ const useLeftNavConfig = (props) => {
7
+ const { expanded, openedItem, onSelectedChange, onFocusChange, items } = props;
8
+ const [selectedItem, setSelectedItem] = React2.useState(null);
9
+ const [selectedSubitem, setSelectedSubitem] = React2.useState(null);
10
+ const [selectedParent, setSelectedParent] = React2.useState(null);
11
+ const [focusedItem, setFocusedItem] = React2.useState(null);
12
+ const [openedDrilldowns, setOpenedDrilldowns] = React2.useState([]);
13
+ const [expandedForAnimation, setExpandedForAnimation] = React2.useState(expanded);
14
+ const timeoutRef = React2.useRef(null);
15
+ const smoothExpandOpts = React2.useMemo(() => ({
34
16
  expandedForAnimation,
35
17
  timeoutRef,
36
18
  setExpandedForAnimation
37
19
  }), [expandedForAnimation, timeoutRef, setExpandedForAnimation]);
38
- useLeftNavSmoothExpand(props, smoothExpandOpts); // -----------------------------------------------------------------------------
39
- // ************************** ------------ **************************
40
- // * SIDE EFFECTS *
41
- // ************************** ------------ **************************
42
-
43
- React.useEffect(() => {
20
+ useLeftNavSmoothExpand(props, smoothExpandOpts);
21
+ React2.useEffect(() => {
44
22
  onSelectedChange(selectedItem);
45
23
  }, [selectedItem, onSelectedChange]);
46
- React.useEffect(() => {
47
- if (openedItem !== null) setSelectedParent(openedItem);
24
+ React2.useEffect(() => {
25
+ if (openedItem !== null)
26
+ setSelectedParent(openedItem);
48
27
  }, [openedItem]);
49
- React.useEffect(() => {
28
+ React2.useEffect(() => {
50
29
  onFocusChange(focusedItem);
51
30
  }, [focusedItem, onFocusChange]);
52
- useSelectFirstBodyItem(items, openedItem, props.selectedItem !== undefined ? props.selectedItem : selectedItem, setSelectedItem, props.disableDefaultSelection); // -----------------------------------------------------------------------------
53
- // ************************** ------------ **************************
54
- // * ITEMS MANAGEMENT *
55
- // ************************** ------------ **************************
56
-
57
- const leftNavItemsProps = React.useMemo(() => ({
31
+ useSelectFirstBodyItem(items, openedItem, props.selectedItem !== void 0 ? props.selectedItem : selectedItem, setSelectedItem, props.disableDefaultSelection);
32
+ const leftNavItemsProps = React2.useMemo(() => ({
58
33
  headerItem: props.HeaderComponent,
59
34
  bodyHeaderItem: props.BodyHeaderComponent,
60
35
  items: props.items,
61
36
  openedDrilldowns
62
- }), [props.HeaderComponent, props.BodyHeaderComponent, props.items, openedDrilldowns]); // We need to know the current visible items since we have drilldowns
63
-
64
- const {
37
+ }), [props.HeaderComponent, props.BodyHeaderComponent, props.items, openedDrilldowns]);
38
+ const { visibleItems, visibleItemsRefs } = useLeftNavItems(leftNavItemsProps);
39
+ const finalConfig = React2.useMemo(() => ({
40
+ leftNavProps: props,
41
+ expandedForAnimation,
42
+ selectedItem: props.selectedItem !== void 0 ? props.selectedItem : selectedItem,
43
+ setSelectedItem,
44
+ selectedParent: props.selectedParent !== void 0 ? props.selectedParent : selectedParent,
45
+ setSelectedParent,
46
+ focusedItem,
47
+ setFocusedItem,
48
+ openedDrilldowns,
49
+ setOpenedDrilldowns,
65
50
  visibleItems,
66
51
  visibleItemsRefs
67
- } = useLeftNavItems(leftNavItemsProps); // -----------------------------------------------------------------------------
68
- // ************************** ------------ **************************
69
- // * LEFTNAV CONFIG *
70
- // ************************** ------------ **************************
71
-
72
- const finalConfig = React.useMemo(() => ({
73
- leftNavProps: props,
52
+ }), [
53
+ props,
74
54
  expandedForAnimation,
75
- selectedItem: props.selectedItem !== undefined ? props.selectedItem : selectedItem,
55
+ selectedItem,
76
56
  setSelectedItem,
77
- selectedParent: props.selectedParent !== undefined ? props.selectedParent : selectedParent,
78
57
  setSelectedParent,
58
+ selectedParent,
79
59
  focusedItem,
80
60
  setFocusedItem,
81
61
  openedDrilldowns,
82
62
  setOpenedDrilldowns,
83
63
  visibleItems,
84
64
  visibleItemsRefs
85
- }), [props, expandedForAnimation, selectedItem, setSelectedItem, setSelectedParent, selectedParent, focusedItem, setFocusedItem, openedDrilldowns, setOpenedDrilldowns, visibleItems, visibleItemsRefs]);
65
+ ]);
86
66
  return finalConfig;
87
67
  };
88
-
89
- export { useLeftNavConfig as default, useLeftNavConfig };
68
+ var useLeftNavConfig_default = useLeftNavConfig;
69
+ export {
70
+ useLeftNavConfig_default as default,
71
+ useLeftNavConfig
72
+ };
73
+ //# sourceMappingURL=useLeftNavConfig.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/configs/useLeftNavConfig.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { LeftNavProps } from '../index.d';\nimport { ContextProps } from '../LeftNavigationContext';\nimport useLeftNavItems from './useLeftNavItems';\nimport { useLeftNavSmoothExpand } from './useLeftNavSmoothExpand';\nimport { useSelectFirstBodyItem } from '../hooks/useSelectFirstBodyItem';\n\nexport const useLeftNavConfig = (props: LeftNavProps): ContextProps => {\n const { expanded, openedItem, onSelectedChange, onFocusChange, items } = props;\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * INTERNAL STATE *\n // ************************** ------------ **************************\n // Selection related\n const [selectedItem, setSelectedItem] = React.useState(null);\n const [selectedSubitem, setSelectedSubitem] = React.useState(null);\n const [selectedParent, setSelectedParent] = React.useState(null);\n // Focus related\n const [focusedItem, setFocusedItem] = React.useState(null);\n // Opened uncontrolled drilldowns\n const [openedDrilldowns, setOpenedDrilldowns] = React.useState<string[]>([]);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * EXPAND ANIMATION *\n // ************************** ------------ **************************\n const [expandedForAnimation, setExpandedForAnimation] = React.useState(expanded);\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout>>(null);\n const smoothExpandOpts = React.useMemo(\n () => ({\n expandedForAnimation,\n timeoutRef,\n setExpandedForAnimation,\n }),\n [expandedForAnimation, timeoutRef, setExpandedForAnimation],\n );\n useLeftNavSmoothExpand(props, smoothExpandOpts);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * SIDE EFFECTS *\n // ************************** ------------ **************************\n React.useEffect(() => {\n onSelectedChange(selectedItem);\n }, [selectedItem, onSelectedChange]);\n\n React.useEffect(() => {\n if (openedItem !== null) setSelectedParent(openedItem);\n }, [openedItem]);\n\n React.useEffect(() => {\n onFocusChange(focusedItem);\n }, [focusedItem, onFocusChange]);\n\n useSelectFirstBodyItem(\n items,\n openedItem,\n props.selectedItem !== undefined ? props.selectedItem : selectedItem,\n setSelectedItem,\n props.disableDefaultSelection,\n );\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * ITEMS MANAGEMENT *\n // ************************** ------------ **************************\n\n const leftNavItemsProps = React.useMemo(\n () => ({\n headerItem: props.HeaderComponent,\n bodyHeaderItem: props.BodyHeaderComponent,\n items: props.items,\n openedDrilldowns,\n }),\n [props.HeaderComponent, props.BodyHeaderComponent, props.items, openedDrilldowns],\n );\n\n // We need to know the current visible items since we have drilldowns\n const { visibleItems, visibleItemsRefs } = useLeftNavItems(leftNavItemsProps);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * LEFTNAV CONFIG *\n // ************************** ------------ **************************\n const finalConfig = React.useMemo(\n () => ({\n leftNavProps: props,\n expandedForAnimation,\n selectedItem: props.selectedItem !== undefined ? props.selectedItem : selectedItem,\n setSelectedItem,\n selectedParent: props.selectedParent !== undefined ? props.selectedParent : selectedParent,\n setSelectedParent,\n focusedItem,\n setFocusedItem,\n openedDrilldowns,\n setOpenedDrilldowns,\n visibleItems,\n visibleItemsRefs,\n }),\n [\n props,\n expandedForAnimation,\n selectedItem,\n setSelectedItem,\n setSelectedParent,\n selectedParent,\n focusedItem,\n setFocusedItem,\n openedDrilldowns,\n setOpenedDrilldowns,\n visibleItems,\n visibleItemsRefs,\n ],\n );\n\n return finalConfig;\n};\n\nexport default useLeftNavConfig;\n"],
5
+ "mappings": "AAAA;ACAA;AAGA;AACA;AACA;AAEO,MAAM,mBAAmB,CAAC,UAAsC;AACrE,QAAM,EAAE,UAAU,YAAY,kBAAkB,eAAe,UAAU;AAOzE,QAAM,CAAC,cAAc,mBAAmB,OAAM,SAAS;AACvD,QAAM,CAAC,iBAAiB,sBAAsB,OAAM,SAAS;AAC7D,QAAM,CAAC,gBAAgB,qBAAqB,OAAM,SAAS;AAE3D,QAAM,CAAC,aAAa,kBAAkB,OAAM,SAAS;AAErD,QAAM,CAAC,kBAAkB,uBAAuB,OAAM,SAAmB;AAMzE,QAAM,CAAC,sBAAsB,2BAA2B,OAAM,SAAS;AACvE,QAAM,aAAa,OAAM,OAAsC;AAC/D,QAAM,mBAAmB,OAAM,QAC7B,MAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,MAEF,CAAC,sBAAsB,YAAY;AAErC,yBAAuB,OAAO;AAM9B,SAAM,UAAU,MAAM;AACpB,qBAAiB;AAAA,KAChB,CAAC,cAAc;AAElB,SAAM,UAAU,MAAM;AACpB,QAAI,eAAe;AAAM,wBAAkB;AAAA,KAC1C,CAAC;AAEJ,SAAM,UAAU,MAAM;AACpB,kBAAc;AAAA,KACb,CAAC,aAAa;AAEjB,yBACE,OACA,YACA,MAAM,iBAAiB,SAAY,MAAM,eAAe,cACxD,iBACA,MAAM;AAQR,QAAM,oBAAoB,OAAM,QAC9B,MAAO;AAAA,IACL,YAAY,MAAM;AAAA,IAClB,gBAAgB,MAAM;AAAA,IACtB,OAAO,MAAM;AAAA,IACb;AAAA,MAEF,CAAC,MAAM,iBAAiB,MAAM,qBAAqB,MAAM,OAAO;AAIlE,QAAM,EAAE,cAAc,qBAAqB,gBAAgB;AAM3D,QAAM,cAAc,OAAM,QACxB,MAAO;AAAA,IACL,cAAc;AAAA,IACd;AAAA,IACA,cAAc,MAAM,iBAAiB,SAAY,MAAM,eAAe;AAAA,IACtE;AAAA,IACA,gBAAgB,MAAM,mBAAmB,SAAY,MAAM,iBAAiB;AAAA,IAC5E;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MAEF;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAIJ,SAAO;AAAA;AAGT,IAAO,2BAAQ;",
6
+ "names": []
7
+ }
@@ -1,75 +1,53 @@
1
- import 'core-js/modules/esnext.async-iterator.for-each.js';
2
- import 'core-js/modules/esnext.iterator.constructor.js';
3
- import 'core-js/modules/esnext.iterator.for-each.js';
4
- import 'core-js/modules/web.dom-collections.iterator.js';
5
- import { useMemo, useRef, createRef } from 'react';
6
- import { ITEM_TYPES, FOOTER_DS_ID } from '../exported-related/constants.js';
7
- import '@babel/runtime/helpers/esm/jsx';
8
- import '@elliemae/ds-grid';
9
- import 'styled-components';
10
- import 'core-js/modules/esnext.async-iterator.filter.js';
11
- import 'core-js/modules/esnext.iterator.filter.js';
12
- import '@babel/runtime/helpers/esm/defineProperty';
13
- import 'react/jsx-runtime';
14
- import '@elliemae/ds-icons';
15
-
16
- const notFocuseableItems = [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, ITEM_TYPES.LEFT_NAV_ITEM_SECTION]; // Walks the array of items
17
- // Drilldowns are tree-like structures
18
-
1
+ import * as React from "react";
2
+ import { createRef, useMemo, useRef } from "react";
3
+ import { ITEM_TYPES } from "../exported-related";
4
+ import { FOOTER_DS_ID } from "../exported-related/constants";
5
+ const notFocuseableItems = [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, ITEM_TYPES.LEFT_NAV_ITEM_SECTION];
19
6
  const walkItems = (items, openedDrilldowns, callback) => {
20
- items.forEach(item => {
21
- if (typeof item.type === 'string') {
22
- var _item$itemOpts$items, _item$itemOpts, _item$itemOpts2, _item$itemOpts$items2, _item$itemOpts3;
23
-
24
- // Out of the box item
25
- if (notFocuseableItems.includes(item.type)) return; // not focuseable
26
-
27
- callback(item.dsId); // If it's an opened uncontrolled drilldown
28
-
29
- if (item.type === 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
30
-
31
- if (item.type === 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);
7
+ items.forEach((item) => {
8
+ if (typeof item.type === "string") {
9
+ if (notFocuseableItems.includes(item.type))
10
+ return;
11
+ callback(item.dsId);
12
+ if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_UNCONTROLLED_DRILLDOWN && openedDrilldowns.includes(item.dsId))
13
+ walkItems(item.itemOpts?.items ?? [], openedDrilldowns, callback);
14
+ if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN && item.itemOpts?.isOpened)
15
+ walkItems(item.itemOpts?.items ?? [], openedDrilldowns, callback);
32
16
  } else {
33
- var _item$itemOpts4;
34
-
35
- // Custom item
36
- if (!((_item$itemOpts4 = item.itemOpts) !== null && _item$itemOpts4 !== void 0 && _item$itemOpts4.focuseable)) return; // not focuseable specified
37
-
17
+ if (!item.itemOpts?.focuseable)
18
+ return;
38
19
  callback(item.dsId);
39
20
  }
40
21
  });
41
22
  };
42
-
43
- const useLeftNavItems = props => {
44
- const {
45
- headerItem,
46
- bodyHeaderItem,
47
- items: bodyItems,
48
- openedDrilldowns
49
- } = props; // Place the header and body header items into the array of items
50
-
23
+ const useLeftNavItems = (props) => {
24
+ const { headerItem, bodyHeaderItem, items: bodyItems, openedDrilldowns } = props;
51
25
  const items = useMemo(() => {
52
26
  const itemsArray = [...bodyItems];
53
- if (bodyHeaderItem) itemsArray.unshift(bodyHeaderItem);
54
- if (headerItem) itemsArray.unshift(headerItem);
27
+ if (bodyHeaderItem)
28
+ itemsArray.unshift(bodyHeaderItem);
29
+ if (headerItem)
30
+ itemsArray.unshift(headerItem);
55
31
  return itemsArray;
56
32
  }, [headerItem, bodyHeaderItem, bodyItems]);
57
33
  const visibleItemsRefs = useRef({});
58
34
  const visibleItems = useMemo(() => {
59
35
  const visibleItemsArray = [];
60
- walkItems(items, openedDrilldowns, dsId => {
36
+ walkItems(items, openedDrilldowns, (dsId) => {
61
37
  visibleItemsArray.push(dsId);
62
38
  });
63
39
  visibleItemsArray.push(FOOTER_DS_ID);
64
40
  return visibleItemsArray;
65
41
  }, [items, openedDrilldowns]);
66
- visibleItems.forEach(dsId => {
67
- if (!(dsId in visibleItemsRefs.current)) visibleItemsRefs.current[dsId] = /*#__PURE__*/createRef();
42
+ visibleItems.forEach((dsId) => {
43
+ if (!(dsId in visibleItemsRefs.current))
44
+ visibleItemsRefs.current[dsId] = createRef();
68
45
  });
69
- return {
70
- visibleItems,
71
- visibleItemsRefs
72
- };
46
+ return { visibleItems, visibleItemsRefs };
47
+ };
48
+ var useLeftNavItems_default = useLeftNavItems;
49
+ export {
50
+ useLeftNavItems_default as default,
51
+ useLeftNavItems
73
52
  };
74
-
75
- export { useLeftNavItems as default, useLeftNavItems };
53
+ //# sourceMappingURL=useLeftNavItems.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/configs/useLeftNavItems.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport { createRef, MutableRefObject, RefObject, useMemo, useRef } from 'react';\nimport { ITEM_TYPES } from '../exported-related';\nimport type { GenericItemItemProps } from '../index.d';\nimport { FOOTER_DS_ID } from '../exported-related/constants';\n\nconst notFocuseableItems = [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, ITEM_TYPES.LEFT_NAV_ITEM_SECTION];\n\n// Walks the array of items\n// Drilldowns are tree-like structures\nconst walkItems = (items: GenericItemItemProps[], openedDrilldowns: string[], callback: (dsId: string) => void) => {\n items.forEach((item) => {\n if (typeof item.type === 'string') {\n // Out of the box item\n if (notFocuseableItems.includes(item.type)) return; // not focuseable\n\n callback(item.dsId);\n\n // If it's an opened uncontrolled drilldown\n if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_UNCONTROLLED_DRILLDOWN && openedDrilldowns.includes(item.dsId))\n walkItems(item.itemOpts?.items ?? [], openedDrilldowns, callback);\n\n // If it's an opened controlled drilldown\n if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN && item.itemOpts?.isOpened)\n walkItems(item.itemOpts?.items ?? [], openedDrilldowns, callback);\n } else {\n // Custom item\n if (!item.itemOpts?.focuseable) return; // not focuseable specified\n callback(item.dsId);\n }\n });\n};\n\nexport const useLeftNavItems = (props: {\n headerItem: GenericItemItemProps;\n bodyHeaderItem: GenericItemItemProps;\n items: GenericItemItemProps[];\n openedDrilldowns: string[];\n}): {\n visibleItems: string[];\n visibleItemsRefs: MutableRefObject<Record<string, RefObject<HTMLElement>>>;\n} => {\n const { headerItem, bodyHeaderItem, items: bodyItems, openedDrilldowns } = props;\n\n // Place the header and body header items into the array of items\n const items = useMemo(() => {\n const itemsArray: GenericItemItemProps[] = [...bodyItems];\n if (bodyHeaderItem) itemsArray.unshift(bodyHeaderItem);\n if (headerItem) itemsArray.unshift(headerItem);\n return itemsArray;\n }, [headerItem, bodyHeaderItem, bodyItems]);\n\n const visibleItemsRefs = useRef<Record<string, RefObject<HTMLElement>>>({});\n\n const visibleItems: string[] = useMemo(() => {\n const visibleItemsArray: string[] = [];\n walkItems(items, openedDrilldowns, (dsId: string) => {\n visibleItemsArray.push(dsId);\n });\n visibleItemsArray.push(FOOTER_DS_ID);\n return visibleItemsArray;\n }, [items, openedDrilldowns]);\n\n visibleItems.forEach((dsId) => {\n if (!(dsId in visibleItemsRefs.current)) visibleItemsRefs.current[dsId] = createRef();\n });\n\n return { visibleItems, visibleItemsRefs };\n};\n\nexport default useLeftNavItems;\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AAEA;AAEA,MAAM,qBAAqB,CAAC,WAAW,yBAAyB,WAAW;AAI3E,MAAM,YAAY,CAAC,OAA+B,kBAA4B,aAAqC;AACjH,QAAM,QAAQ,CAAC,SAAS;AACtB,QAAI,OAAO,KAAK,SAAS,UAAU;AAEjC,UAAI,mBAAmB,SAAS,KAAK;AAAO;AAE5C,eAAS,KAAK;AAGd,UAAI,KAAK,SAAS,WAAW,wCAAwC,iBAAiB,SAAS,KAAK;AAClG,kBAAU,KAAK,UAAU,SAAS,IAAI,kBAAkB;AAG1D,UAAI,KAAK,SAAS,WAAW,sCAAsC,KAAK,UAAU;AAChF,kBAAU,KAAK,UAAU,SAAS,IAAI,kBAAkB;AAAA,WACrD;AAEL,UAAI,CAAC,KAAK,UAAU;AAAY;AAChC,eAAS,KAAK;AAAA;AAAA;AAAA;AAKb,MAAM,kBAAkB,CAAC,UAQ3B;AACH,QAAM,EAAE,YAAY,gBAAgB,OAAO,WAAW,qBAAqB;AAG3E,QAAM,QAAQ,QAAQ,MAAM;AAC1B,UAAM,aAAqC,CAAC,GAAG;AAC/C,QAAI;AAAgB,iBAAW,QAAQ;AACvC,QAAI;AAAY,iBAAW,QAAQ;AACnC,WAAO;AAAA,KACN,CAAC,YAAY,gBAAgB;AAEhC,QAAM,mBAAmB,OAA+C;AAExE,QAAM,eAAyB,QAAQ,MAAM;AAC3C,UAAM,oBAA8B;AACpC,cAAU,OAAO,kBAAkB,CAAC,SAAiB;AACnD,wBAAkB,KAAK;AAAA;AAEzB,sBAAkB,KAAK;AACvB,WAAO;AAAA,KACN,CAAC,OAAO;AAEX,eAAa,QAAQ,CAAC,SAAS;AAC7B,QAAI,CAAE,SAAQ,iBAAiB;AAAU,uBAAiB,QAAQ,QAAQ;AAAA;AAG5E,SAAO,EAAE,cAAc;AAAA;AAGzB,IAAO,0BAAQ;",
6
+ "names": []
7
+ }
@@ -1,23 +1,24 @@
1
- import React from 'react';
2
-
1
+ import * as React from "react";
2
+ import React2 from "react";
3
3
  const useLeftNavSmoothExpand = (props, smoothExpandOpts) => {
4
- const {
5
- expanded
6
- } = props;
4
+ const { expanded } = props;
7
5
  const {
8
6
  expandedForAnimation,
9
7
  timeoutRef,
10
8
  setExpandedForAnimation
11
9
  } = smoothExpandOpts;
12
- React.useEffect(() => {
13
- // If expanded changes, we need to smoothly transition to the non-expanded state
14
- // so we need to wait for 350ms
10
+ React2.useEffect(() => {
15
11
  if (!expanded && expandedForAnimation) {
16
12
  clearTimeout(timeoutRef.current);
17
13
  timeoutRef.current = setTimeout(() => setExpandedForAnimation(false), 350);
18
- } else if (expanded) setExpandedForAnimation(true);
14
+ } else if (expanded)
15
+ setExpandedForAnimation(true);
19
16
  }, [expanded]);
20
- React.useEffect(() => () => clearTimeout(timeoutRef.current), []);
17
+ React2.useEffect(() => () => clearTimeout(timeoutRef.current), []);
18
+ };
19
+ var useLeftNavSmoothExpand_default = useLeftNavSmoothExpand;
20
+ export {
21
+ useLeftNavSmoothExpand_default as default,
22
+ useLeftNavSmoothExpand
21
23
  };
22
-
23
- export { useLeftNavSmoothExpand as default, useLeftNavSmoothExpand };
24
+ //# sourceMappingURL=useLeftNavSmoothExpand.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/configs/useLeftNavSmoothExpand.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { LeftNavProps } from '../index.d';\n\ninterface smoothExpandOptsT {\n expandedForAnimation: boolean;\n timeoutRef: React.MutableRefObject<NodeJS.Timeout>;\n setExpandedForAnimation: React.Dispatch<React.SetStateAction<boolean>>;\n}\nexport const useLeftNavSmoothExpand = (\n props: LeftNavProps,\n smoothExpandOpts: smoothExpandOptsT,\n): void => {\n const { expanded } = props;\n const {\n expandedForAnimation,\n timeoutRef,\n setExpandedForAnimation,\n } = 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 clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(\n () => setExpandedForAnimation(false),\n 350,\n );\n } else if (expanded) setExpandedForAnimation(true);\n }, [expanded]);\n\n React.useEffect(() => () => clearTimeout(timeoutRef.current), []);\n};\n\nexport default useLeftNavSmoothExpand;\n"],
5
+ "mappings": "AAAA;ACAA;AAQO,MAAM,yBAAyB,CACpC,OACA,qBACS;AACT,QAAM,EAAE,aAAa;AACrB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,MACE;AAEJ,SAAM,UAAU,MAAM;AAGpB,QAAI,CAAC,YAAY,sBAAsB;AACrC,mBAAa,WAAW;AACxB,iBAAW,UAAU,WACnB,MAAM,wBAAwB,QAC9B;AAAA,eAEO;AAAU,8BAAwB;AAAA,KAC5C,CAAC;AAEJ,SAAM,UAAU,MAAM,MAAM,aAAa,WAAW,UAAU;AAAA;AAGhE,IAAO,iCAAQ;",
6
+ "names": []
7
+ }
@@ -1,19 +1,14 @@
1
- import 'core-js/modules/esnext.async-iterator.filter.js';
2
- import 'core-js/modules/esnext.iterator.constructor.js';
3
- import 'core-js/modules/esnext.iterator.filter.js';
4
- import 'core-js/modules/esnext.async-iterator.for-each.js';
5
- import 'core-js/modules/esnext.iterator.for-each.js';
6
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
- import 'react';
8
- import { ChevronSmallRight } from '@elliemae/ds-icons';
9
- import { jsx } from 'react/jsx-runtime';
10
-
11
- 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; }
12
-
13
- 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(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; }
14
- const ChevronItem = props => /*#__PURE__*/jsx(ChevronSmallRight, _objectSpread({
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { ChevronSmallRight } from "@elliemae/ds-icons";
4
+ const ChevronItem = (props) => /* @__PURE__ */ React2.createElement(ChevronSmallRight, {
15
5
  size: "m",
16
- color: ['brand-primary', 800]
17
- }, props));
18
-
19
- export { ChevronItem, ChevronItem as default };
6
+ color: ["brand-primary", 800],
7
+ ...props
8
+ });
9
+ var ChevronItem_default = ChevronItem;
10
+ export {
11
+ ChevronItem,
12
+ ChevronItem_default as default
13
+ };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/ChevronItem/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ChevronSmallRight } from '@elliemae/ds-icons';\n\nexport const ChevronItem = (props: unknown): JSX.Element => (\n <ChevronSmallRight size=\"m\" color={['brand-primary', 800]} {...props} />\n);\n\nexport default ChevronItem;\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AAEO,MAAM,cAAc,CAAC,UAC1B,qCAAC,mBAAD;AAAA,EAAmB,MAAK;AAAA,EAAI,OAAO,CAAC,iBAAiB;AAAA,KAAU;AAAA;AAGjE,IAAO,sBAAQ;",
6
+ "names": []
7
+ }
@@ -1,27 +1,24 @@
1
- import 'core-js/modules/esnext.async-iterator.filter.js';
2
- import 'core-js/modules/esnext.iterator.constructor.js';
3
- import 'core-js/modules/esnext.iterator.filter.js';
4
- import 'core-js/modules/esnext.async-iterator.for-each.js';
5
- import 'core-js/modules/esnext.iterator.for-each.js';
6
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
- import 'react';
8
- import styled from 'styled-components';
9
- import { jsx } from 'react/jsx-runtime';
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import styled from "styled-components";
4
+ const AugmentedIcon = (Icon2) => styled(Icon2)`
5
+ cursor: pointer;
10
6
 
11
- 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; }
12
-
13
- 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(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; }
14
-
15
- const AugmentedIcon = Icon => styled(Icon).withConfig({
16
- componentId: "sc-1eek2uh-0"
17
- })(["cursor:pointer;outline:0;:focus,:active{outline:1px solid #1e79c2;}"]);
18
-
19
- const Icon = IconComponent => props => {
7
+ outline: 0;
8
+ :focus,
9
+ :active {
10
+ outline: 1px solid #1e79c2;
11
+ }
12
+ `;
13
+ const Icon = (IconComponent) => (props) => {
20
14
  const StyledComponent = AugmentedIcon(IconComponent);
21
- return /*#__PURE__*/jsx(StyledComponent, _objectSpread({
22
- color: ['brand-primary', 800],
23
- tabIndex: 0
24
- }, props));
15
+ return /* @__PURE__ */ React2.createElement(StyledComponent, {
16
+ color: ["brand-primary", 800],
17
+ tabIndex: 0,
18
+ ...props
19
+ });
25
20
  };
26
-
27
- export { Icon };
21
+ export {
22
+ Icon
23
+ };
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Icon/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport styled from 'styled-components';\n\nconst AugmentedIcon = (\n Icon: React.ComponentType<{ color: unknown; tabIndex: number }>,\n) => styled(Icon)`\n cursor: pointer;\n\n outline: 0;\n :focus,\n :active {\n outline: 1px solid #1e79c2;\n }\n`;\n\nexport const Icon = (\n IconComponent: React.ComponentType<{ color: unknown; tabIndex: number }>,\n) => (props: unknown): JSX.Element => {\n const StyledComponent = AugmentedIcon(IconComponent);\n return (\n <StyledComponent color={['brand-primary', 800]} tabIndex={0} {...props} />\n );\n};\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AAEA,MAAM,gBAAgB,CACpB,UACG,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUL,MAAM,OAAO,CAClB,kBACG,CAAC,UAAgC;AACpC,QAAM,kBAAkB,cAAc;AACtC,SACE,qCAAC,iBAAD;AAAA,IAAiB,OAAO,CAAC,iBAAiB;AAAA,IAAM,UAAU;AAAA,OAAO;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,28 +1,17 @@
1
- import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import { useContext, useCallback, useMemo } from 'react';
3
- import Grid from '@elliemae/ds-grid';
4
- import { StyledItemWrapper, StyledItem } from './styled.js';
5
- import { LeftNavContext } from '../../LeftNavigationContext.js';
6
- import { usePropsWithDefaults } from './usePropsWithDefaults.js';
7
- import { useKeyboardNavigation } from '../../hooks/useKeyboardNavigation.js';
8
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
9
-
10
- const ItemRenderer = props => {
1
+ import * as React from "react";
2
+ import React2, { useContext, useMemo, useCallback } from "react";
3
+ import Grid from "@elliemae/ds-grid";
4
+ import { StyledItemWrapper, StyledItem } from "./styled";
5
+ import { LeftNavContext } from "../../LeftNavigationContext";
6
+ import { usePropsWithDefaults } from "./usePropsWithDefaults";
7
+ import { useKeyboardNavigation } from "../../hooks";
8
+ const ItemRenderer = (props) => {
11
9
  const propsWithDefault = usePropsWithDefaults(props);
12
10
  const {
13
11
  item,
14
12
  item: {
15
13
  dsId,
16
- itemOpts: {
17
- selectable,
18
- focuseable,
19
- indent,
20
- ariaLabel,
21
- ariaRole,
22
- ariaLive,
23
- ariaExpanded,
24
- ariaDescribedBy
25
- },
14
+ itemOpts: { selectable, focuseable, indent, ariaLabel, ariaRole, ariaLive, ariaExpanded, ariaDescribedBy },
26
15
  CollapsedComponent
27
16
  },
28
17
  subitems,
@@ -36,10 +25,7 @@ const ItemRenderer = props => {
36
25
  } = propsWithDefault;
37
26
  const ctx = useContext(LeftNavContext);
38
27
  const {
39
- leftNavProps: {
40
- onItemClick,
41
- openedItem
42
- },
28
+ leftNavProps: { onItemClick, openedItem },
43
29
  expandedForAnimation,
44
30
  selectedParent,
45
31
  selectedItem,
@@ -48,72 +34,71 @@ const ItemRenderer = props => {
48
34
  visibleItemsRefs
49
35
  } = ctx;
50
36
  const opened = dsId === openedItem;
51
- const handleOnClick = useCallback(e => {
52
- if (onClick) onClick(); // used by uncontrolled drilldowns
53
-
37
+ const handleOnClick = useCallback((e) => {
38
+ if (onClick)
39
+ onClick();
54
40
  onItemClick(item, e);
55
- if (selectable) setSelectedItem(item.dsId);
41
+ if (selectable)
42
+ setSelectedItem(item.dsId);
56
43
  }, [onItemClick, item, setSelectedItem, selectable, onClick]);
57
44
  const handleFocus = useCallback(() => {
58
- if (focuseable) setFocusedItem(dsId);
45
+ if (focuseable)
46
+ setFocusedItem(dsId);
59
47
  }, [dsId, setFocusedItem, focuseable]);
60
48
  const onKeyDown = useKeyboardNavigation({
61
49
  item,
62
50
  onClick: handleOnClick
63
51
  });
64
- const cols = useMemo(() => expandedForAnimation ? ['auto', '1fr', 'auto'] : ['38px'], [expandedForAnimation]);
52
+ const cols = useMemo(() => expandedForAnimation ? ["auto", "1fr", "auto"] : ["38px"], [expandedForAnimation]);
65
53
  const isSelected = useMemo(() => selectedItem === dsId, [selectedItem, dsId]);
66
-
67
54
  if (!expandedForAnimation && !CollapsedComponent) {
68
55
  return null;
69
56
  }
70
-
71
- return /*#__PURE__*/jsxs(Fragment, {
72
- children: [/*#__PURE__*/_jsx(StyledItemWrapper, {
73
- shadowStyle: shadowStyle(opened, item.type),
74
- "data-testid": "leftnav-item-wrapper"
75
- }, void 0, /*#__PURE__*/jsx(StyledItem, {
76
- ref: visibleItemsRefs.current[dsId],
77
- pt: paddingTop,
78
- pl: indent === undefined ? 'xxxs' : "".concat(indent, "px"),
79
- minHeight: minHeight,
80
- shadowStyle: shadowStyle(opened, item.type),
81
- alignItems: "flex-start",
82
- cols: cols,
83
- onClick: !opened ? handleOnClick : () => null,
84
- onKeyDown: onKeyDown,
85
- selectable: selectable,
86
- selected: isSelected,
87
- selectedParent: selectedParent === dsId,
88
- opened: opened,
89
- onFocus: handleFocus,
90
- "data-testid": "leftnav-item-container",
91
- tabIndex: focuseable ? 0 : -1,
92
- "aria-describedby": ariaDescribedBy,
93
- "aria-expanded": ariaExpanded,
94
- role: ariaRole,
95
- "data-selected": isSelected,
96
- "data-selectedparent": selectedParent === dsId,
97
- "aria-label": ariaLabel,
98
- "aria-hidden": !focuseable,
99
- "aria-live": ariaLive,
100
- children: !expandedForAnimation ? /*#__PURE__*/_jsx(Grid, {
101
- "data-testid": "leftnav-leftcomponent",
102
- justifyContent: "center"
103
- }, void 0, /*#__PURE__*/_jsx(CollapsedComponent, {
104
- item: item,
105
- ctx: ctx
106
- })) : children
107
- }), hasBorderBottom && /*#__PURE__*/_jsx("div", {
108
- style: {
109
- marginLeft: opened ? '16px' : '0px',
110
- marginRight: borderBottomMr,
111
- height: '1px',
112
- width: "calc(100% - ".concat(borderBottomMr, " - ").concat(opened ? '16px' : '0px', ")"),
113
- backgroundColor: '#E0E3E8'
114
- }
115
- })), subitems]
116
- });
57
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(StyledItemWrapper, {
58
+ shadowStyle: shadowStyle(opened, item.type),
59
+ "data-testid": "leftnav-item-wrapper"
60
+ }, /* @__PURE__ */ React2.createElement(StyledItem, {
61
+ ref: visibleItemsRefs.current[dsId],
62
+ pt: paddingTop,
63
+ pl: indent === void 0 ? "xxxs" : `${indent}px`,
64
+ minHeight,
65
+ shadowStyle: shadowStyle(opened, item.type),
66
+ alignItems: "flex-start",
67
+ cols,
68
+ onClick: !opened ? handleOnClick : () => null,
69
+ onKeyDown,
70
+ selectable,
71
+ selected: isSelected,
72
+ selectedParent: selectedParent === dsId,
73
+ opened,
74
+ onFocus: handleFocus,
75
+ "data-testid": "leftnav-item-container",
76
+ tabIndex: focuseable ? 0 : -1,
77
+ "aria-describedby": ariaDescribedBy,
78
+ "aria-expanded": ariaExpanded,
79
+ role: ariaRole,
80
+ "data-selected": isSelected,
81
+ "data-selectedparent": selectedParent === dsId,
82
+ "aria-label": ariaLabel,
83
+ "aria-hidden": !focuseable,
84
+ "aria-live": ariaLive
85
+ }, !expandedForAnimation ? /* @__PURE__ */ React2.createElement(Grid, {
86
+ "data-testid": "leftnav-leftcomponent",
87
+ justifyContent: "center"
88
+ }, /* @__PURE__ */ React2.createElement(CollapsedComponent, {
89
+ item,
90
+ ctx
91
+ })) : children), hasBorderBottom && /* @__PURE__ */ React2.createElement("div", {
92
+ style: {
93
+ marginLeft: opened ? "16px" : "0px",
94
+ marginRight: borderBottomMr,
95
+ height: "1px",
96
+ width: `calc(100% - ${borderBottomMr} - ${opened ? "16px" : "0px"})`,
97
+ backgroundColor: "#E0E3E8"
98
+ }
99
+ })), subitems);
100
+ };
101
+ export {
102
+ ItemRenderer
117
103
  };
118
-
119
- export { ItemRenderer };
104
+ //# sourceMappingURL=index.js.map