@elliemae/ds-left-navigation 2.2.0-alpha.4 → 3.0.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 +27 -49
- package/cjs/LeftNavigationContext.js +18 -44
- package/cjs/common/getItemBackgroundStyle.js +8 -47
- package/cjs/common/getLeftBorderStyle.js +8 -50
- package/cjs/common/getScrollbarStyle.js +4 -55
- package/cjs/common/index.js +13 -30
- package/cjs/configs/index.js +10 -38
- package/cjs/configs/useLeftNavConfig.js +76 -76
- package/cjs/configs/useLeftNavItems.js +64 -66
- package/cjs/configs/useLeftNavSmoothExpand.js +25 -43
- package/cjs/exported-related/ChevronItem/index.js +27 -42
- package/cjs/exported-related/Icon/index.js +34 -51
- package/cjs/exported-related/ItemRenderer/index.js +94 -99
- package/cjs/exported-related/ItemRenderer/styled.js +51 -83
- package/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js +45 -57
- package/cjs/exported-related/Notifications/index.js +61 -81
- package/cjs/exported-related/OpenWindowItem/index.js +32 -49
- package/cjs/exported-related/constants.js +25 -53
- package/cjs/exported-related/index.js +23 -33
- package/cjs/hooks/index.js +13 -30
- package/cjs/hooks/useExpandableOnClickHandler.js +26 -55
- package/cjs/hooks/useKeyboardNavigation.js +54 -62
- package/cjs/hooks/useOpenableOnClickHandler.js +26 -55
- package/cjs/hooks/useSelectFirstBodyItem.js +34 -47
- package/cjs/index.d.js +2 -27
- package/cjs/index.js +30 -41
- package/cjs/outOfTheBox/ItemControlledDrilldown/index.js +103 -97
- package/cjs/outOfTheBox/ItemControlledDrilldown/styled.js +27 -49
- package/cjs/outOfTheBox/ItemHeader/index.js +93 -95
- package/cjs/outOfTheBox/ItemHeader/styled.js +22 -49
- package/cjs/outOfTheBox/ItemLink/index.js +67 -75
- package/cjs/outOfTheBox/ItemLink/styled.js +17 -41
- package/cjs/outOfTheBox/ItemSection/index.js +63 -59
- package/cjs/outOfTheBox/ItemSection/styled.js +23 -53
- package/cjs/outOfTheBox/ItemSeparator/index.js +45 -56
- package/cjs/outOfTheBox/ItemSubmenu/index.js +92 -95
- package/cjs/outOfTheBox/ItemSubmenu/styled.js +22 -49
- package/cjs/outOfTheBox/ItemTextLabel/index.js +52 -51
- package/cjs/outOfTheBox/ItemTextLabel/styled.js +23 -43
- package/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js +113 -107
- package/cjs/outOfTheBox/ItemUncontrolledDrilldown/styled.js +27 -49
- package/cjs/outOfTheBox/ItemWithDate/index.js +54 -59
- package/cjs/outOfTheBox/ItemWithDate/styled.js +27 -49
- package/cjs/outOfTheBox/index.js +50 -65
- package/cjs/parts/LeftNavContent/index.js +71 -75
- package/cjs/parts/LeftNavContent/styled.js +50 -110
- package/cjs/parts/LeftNavContentWithScrollbar/index.js +79 -89
- package/cjs/parts/LeftNavFooterItem/index.js +80 -97
- package/cjs/parts/LeftNavFooterItem/styled.js +34 -89
- package/cjs/parts/LeftNavLoading/index.js +33 -51
- package/cjs/parts/OutOfTheBoxMapItem.js +46 -49
- package/cjs/prop-types.js +39 -58
- package/esm/LeftNavigation.js +15 -17
- package/esm/LeftNavigationContext.js +11 -15
- package/esm/common/getItemBackgroundStyle.js +6 -20
- package/esm/common/getLeftBorderStyle.js +6 -23
- package/esm/common/getScrollbarStyle.js +2 -28
- package/esm/common/index.js +3 -5
- package/esm/configs/index.js +2 -9
- package/esm/configs/useLeftNavConfig.js +67 -47
- package/esm/configs/useLeftNavItems.js +55 -33
- package/esm/configs/useLeftNavSmoothExpand.js +16 -14
- package/esm/exported-related/ChevronItem/index.js +18 -13
- package/esm/exported-related/Icon/index.js +24 -21
- package/esm/exported-related/ItemRenderer/index.js +80 -65
- package/esm/exported-related/ItemRenderer/styled.js +42 -56
- package/esm/exported-related/ItemRenderer/usePropsWithDefaults.js +36 -27
- package/esm/exported-related/Notifications/index.js +50 -57
- package/esm/exported-related/OpenWindowItem/index.js +22 -20
- package/esm/exported-related/constants.js +17 -24
- package/esm/exported-related/index.js +6 -8
- package/esm/hooks/index.js +3 -5
- package/esm/hooks/useExpandableOnClickHandler.js +22 -26
- package/esm/hooks/useKeyboardNavigation.js +47 -30
- package/esm/hooks/useOpenableOnClickHandler.js +22 -26
- package/esm/hooks/useSelectFirstBodyItem.js +30 -18
- package/esm/index.d.js +1 -2
- package/esm/index.js +8 -12
- package/esm/outOfTheBox/ItemControlledDrilldown/index.js +87 -62
- package/esm/outOfTheBox/ItemControlledDrilldown/styled.js +17 -20
- package/esm/outOfTheBox/ItemHeader/index.js +82 -65
- package/esm/outOfTheBox/ItemHeader/styled.js +12 -20
- package/esm/outOfTheBox/ItemLink/index.js +57 -46
- package/esm/outOfTheBox/ItemLink/styled.js +8 -12
- package/esm/outOfTheBox/ItemSection/index.js +53 -30
- package/esm/outOfTheBox/ItemSection/styled.js +13 -24
- package/esm/outOfTheBox/ItemSeparator/index.js +35 -27
- package/esm/outOfTheBox/ItemSubmenu/index.js +81 -65
- package/esm/outOfTheBox/ItemSubmenu/styled.js +12 -20
- package/esm/outOfTheBox/ItemTextLabel/index.js +43 -22
- package/esm/outOfTheBox/ItemTextLabel/styled.js +14 -14
- package/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js +95 -70
- package/esm/outOfTheBox/ItemUncontrolledDrilldown/styled.js +17 -20
- package/esm/outOfTheBox/ItemWithDate/index.js +44 -30
- package/esm/outOfTheBox/ItemWithDate/styled.js +17 -20
- package/esm/outOfTheBox/index.js +34 -25
- package/esm/parts/LeftNavContent/index.js +64 -54
- package/esm/parts/LeftNavContent/styled.js +36 -81
- package/esm/parts/LeftNavContentWithScrollbar/index.js +64 -56
- package/esm/parts/LeftNavFooterItem/index.js +68 -73
- package/esm/parts/LeftNavFooterItem/styled.js +24 -63
- package/esm/parts/LeftNavLoading/index.js +22 -22
- package/esm/parts/OutOfTheBoxMapItem.js +35 -19
- package/esm/prop-types.js +29 -26
- package/package.json +6 -6
- package/types/LeftNavigationContext.d.ts +4 -4
- package/types/configs/useLeftNavSmoothExpand.d.ts +3 -3
- package/types/hooks/useSelectFirstBodyItem.d.ts +1 -1
- package/types/index.d.d.ts +5 -2
- package/cjs/LeftNavigation.js.map +0 -7
- package/cjs/LeftNavigationContext.js.map +0 -7
- package/cjs/common/getItemBackgroundStyle.js.map +0 -7
- package/cjs/common/getLeftBorderStyle.js.map +0 -7
- package/cjs/common/getScrollbarStyle.js.map +0 -7
- package/cjs/common/index.js.map +0 -7
- package/cjs/configs/index.js.map +0 -7
- package/cjs/configs/useLeftNavConfig.js.map +0 -7
- package/cjs/configs/useLeftNavItems.js.map +0 -7
- package/cjs/configs/useLeftNavSmoothExpand.js.map +0 -7
- package/cjs/exported-related/ChevronItem/index.js.map +0 -7
- package/cjs/exported-related/Icon/index.js.map +0 -7
- package/cjs/exported-related/ItemRenderer/index.js.map +0 -7
- package/cjs/exported-related/ItemRenderer/styled.js.map +0 -7
- package/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js.map +0 -7
- package/cjs/exported-related/Notifications/index.js.map +0 -7
- package/cjs/exported-related/OpenWindowItem/index.js.map +0 -7
- package/cjs/exported-related/constants.js.map +0 -7
- package/cjs/exported-related/index.js.map +0 -7
- package/cjs/hooks/index.js.map +0 -7
- package/cjs/hooks/useExpandableOnClickHandler.js.map +0 -7
- package/cjs/hooks/useKeyboardNavigation.js.map +0 -7
- package/cjs/hooks/useOpenableOnClickHandler.js.map +0 -7
- package/cjs/hooks/useSelectFirstBodyItem.js.map +0 -7
- package/cjs/index.d.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/outOfTheBox/ItemControlledDrilldown/index.js.map +0 -7
- package/cjs/outOfTheBox/ItemControlledDrilldown/styled.js.map +0 -7
- package/cjs/outOfTheBox/ItemHeader/index.js.map +0 -7
- package/cjs/outOfTheBox/ItemHeader/styled.js.map +0 -7
- package/cjs/outOfTheBox/ItemLink/index.js.map +0 -7
- package/cjs/outOfTheBox/ItemLink/styled.js.map +0 -7
- package/cjs/outOfTheBox/ItemSection/index.js.map +0 -7
- package/cjs/outOfTheBox/ItemSection/styled.js.map +0 -7
- package/cjs/outOfTheBox/ItemSeparator/index.js.map +0 -7
- package/cjs/outOfTheBox/ItemSubmenu/index.js.map +0 -7
- package/cjs/outOfTheBox/ItemSubmenu/styled.js.map +0 -7
- package/cjs/outOfTheBox/ItemTextLabel/index.js.map +0 -7
- package/cjs/outOfTheBox/ItemTextLabel/styled.js.map +0 -7
- package/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +0 -7
- package/cjs/outOfTheBox/ItemUncontrolledDrilldown/styled.js.map +0 -7
- package/cjs/outOfTheBox/ItemWithDate/index.js.map +0 -7
- package/cjs/outOfTheBox/ItemWithDate/styled.js.map +0 -7
- package/cjs/outOfTheBox/index.js.map +0 -7
- package/cjs/parts/LeftNavContent/index.js.map +0 -7
- package/cjs/parts/LeftNavContent/styled.js.map +0 -7
- package/cjs/parts/LeftNavContentWithScrollbar/index.js.map +0 -7
- package/cjs/parts/LeftNavFooterItem/index.js.map +0 -7
- package/cjs/parts/LeftNavFooterItem/styled.js.map +0 -7
- package/cjs/parts/LeftNavLoading/index.js.map +0 -7
- package/cjs/parts/OutOfTheBoxMapItem.js.map +0 -7
- package/cjs/prop-types.js.map +0 -7
- package/esm/LeftNavigation.js.map +0 -7
- package/esm/LeftNavigationContext.js.map +0 -7
- package/esm/common/getItemBackgroundStyle.js.map +0 -7
- package/esm/common/getLeftBorderStyle.js.map +0 -7
- package/esm/common/getScrollbarStyle.js.map +0 -7
- package/esm/common/index.js.map +0 -7
- package/esm/configs/index.js.map +0 -7
- package/esm/configs/useLeftNavConfig.js.map +0 -7
- package/esm/configs/useLeftNavItems.js.map +0 -7
- package/esm/configs/useLeftNavSmoothExpand.js.map +0 -7
- package/esm/exported-related/ChevronItem/index.js.map +0 -7
- package/esm/exported-related/Icon/index.js.map +0 -7
- package/esm/exported-related/ItemRenderer/index.js.map +0 -7
- package/esm/exported-related/ItemRenderer/styled.js.map +0 -7
- package/esm/exported-related/ItemRenderer/usePropsWithDefaults.js.map +0 -7
- package/esm/exported-related/Notifications/index.js.map +0 -7
- package/esm/exported-related/OpenWindowItem/index.js.map +0 -7
- package/esm/exported-related/constants.js.map +0 -7
- package/esm/exported-related/index.js.map +0 -7
- package/esm/hooks/index.js.map +0 -7
- package/esm/hooks/useExpandableOnClickHandler.js.map +0 -7
- package/esm/hooks/useKeyboardNavigation.js.map +0 -7
- package/esm/hooks/useOpenableOnClickHandler.js.map +0 -7
- package/esm/hooks/useSelectFirstBodyItem.js.map +0 -7
- package/esm/index.d.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/outOfTheBox/ItemControlledDrilldown/index.js.map +0 -7
- package/esm/outOfTheBox/ItemControlledDrilldown/styled.js.map +0 -7
- package/esm/outOfTheBox/ItemHeader/index.js.map +0 -7
- package/esm/outOfTheBox/ItemHeader/styled.js.map +0 -7
- package/esm/outOfTheBox/ItemLink/index.js.map +0 -7
- package/esm/outOfTheBox/ItemLink/styled.js.map +0 -7
- package/esm/outOfTheBox/ItemSection/index.js.map +0 -7
- package/esm/outOfTheBox/ItemSection/styled.js.map +0 -7
- package/esm/outOfTheBox/ItemSeparator/index.js.map +0 -7
- package/esm/outOfTheBox/ItemSubmenu/index.js.map +0 -7
- package/esm/outOfTheBox/ItemSubmenu/styled.js.map +0 -7
- package/esm/outOfTheBox/ItemTextLabel/index.js.map +0 -7
- package/esm/outOfTheBox/ItemTextLabel/styled.js.map +0 -7
- package/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +0 -7
- package/esm/outOfTheBox/ItemUncontrolledDrilldown/styled.js.map +0 -7
- package/esm/outOfTheBox/ItemWithDate/index.js.map +0 -7
- package/esm/outOfTheBox/ItemWithDate/styled.js.map +0 -7
- package/esm/outOfTheBox/index.js.map +0 -7
- package/esm/parts/LeftNavContent/index.js.map +0 -7
- package/esm/parts/LeftNavContent/styled.js.map +0 -7
- package/esm/parts/LeftNavContentWithScrollbar/index.js.map +0 -7
- package/esm/parts/LeftNavFooterItem/index.js.map +0 -7
- package/esm/parts/LeftNavFooterItem/styled.js.map +0 -7
- package/esm/parts/LeftNavLoading/index.js.map +0 -7
- package/esm/parts/OutOfTheBoxMapItem.js.map +0 -7
- package/esm/prop-types.js.map +0 -7
package/cjs/LeftNavigation.js
CHANGED
|
@@ -1,51 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var LeftNavigation_exports = {};
|
|
29
|
-
__export(LeftNavigation_exports, {
|
|
30
|
-
LeftNavigation: () => LeftNavigation,
|
|
31
|
-
LeftNavigationWithSchema: () => LeftNavigationWithSchema
|
|
32
|
-
});
|
|
33
|
-
var React = __toESM(require("react"));
|
|
34
|
-
var import_react = __toESM(require("react"));
|
|
35
|
-
var import_react_desc = require("react-desc");
|
|
36
|
-
var import_prop_types = require("./prop-types");
|
|
37
|
-
var import_LeftNavigationContext = __toESM(require("./LeftNavigationContext"));
|
|
38
|
-
var import_useLeftNavConfig = require("./configs/useLeftNavConfig");
|
|
39
|
-
var import_LeftNavContent = __toESM(require("./parts/LeftNavContent"));
|
|
40
|
-
const LeftNavigation = (props) => {
|
|
41
|
-
const leftNavConfig = (0, import_useLeftNavConfig.useLeftNavConfig)(props);
|
|
42
|
-
return /* @__PURE__ */ import_react.default.createElement(import_LeftNavigationContext.default.Provider, {
|
|
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, {
|
|
43
21
|
value: leftNavConfig
|
|
44
|
-
},
|
|
22
|
+
}, void 0, _LeftNavContent || (_LeftNavContent = /*#__PURE__*/_jsx__default["default"](index, {})));
|
|
45
23
|
};
|
|
46
|
-
LeftNavigation.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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;
|
|
@@ -1,52 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var LeftNavigationContext_exports = {};
|
|
29
|
-
__export(LeftNavigationContext_exports, {
|
|
30
|
-
LeftNavContext: () => LeftNavContext,
|
|
31
|
-
default: () => LeftNavigationContext_default,
|
|
32
|
-
defaultContext: () => defaultContext,
|
|
33
|
-
defaultProps: () => defaultProps
|
|
34
|
-
});
|
|
35
|
-
var React = __toESM(require("react"));
|
|
36
|
-
var import_react = require("react");
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
37
7
|
const defaultProps = {
|
|
38
|
-
expandedWidth:
|
|
8
|
+
expandedWidth: '240px',
|
|
39
9
|
tabIndex: 0,
|
|
40
10
|
loading: false,
|
|
41
11
|
expanded: false,
|
|
42
12
|
openedItem: null,
|
|
43
|
-
footerLabel:
|
|
13
|
+
footerLabel: '',
|
|
44
14
|
onSelectedChange: () => null,
|
|
45
15
|
onFocusChange: () => null,
|
|
46
16
|
onFooterExpand: () => null,
|
|
47
17
|
onFooterClose: () => null,
|
|
48
18
|
items: [],
|
|
49
|
-
labelOverflow:
|
|
19
|
+
labelOverflow: 'wrap',
|
|
50
20
|
onItemClick: () => null
|
|
51
21
|
};
|
|
52
22
|
const defaultContext = {
|
|
@@ -59,9 +29,13 @@ const defaultContext = {
|
|
|
59
29
|
openedDrilldowns: [],
|
|
60
30
|
setOpenedDrilldowns: () => null,
|
|
61
31
|
visibleItems: [],
|
|
62
|
-
visibleItemsRefs: {
|
|
32
|
+
visibleItemsRefs: {
|
|
33
|
+
current: {}
|
|
34
|
+
}
|
|
63
35
|
};
|
|
64
|
-
const LeftNavContext =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
36
|
+
const LeftNavContext = /*#__PURE__*/React.createContext(defaultContext);
|
|
37
|
+
|
|
38
|
+
exports.LeftNavContext = LeftNavContext;
|
|
39
|
+
exports["default"] = LeftNavContext;
|
|
40
|
+
exports.defaultContext = defaultContext;
|
|
41
|
+
exports.defaultProps = defaultProps;
|
|
@@ -1,51 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var getItemBackgroundStyle_exports = {};
|
|
29
|
-
__export(getItemBackgroundStyle_exports, {
|
|
30
|
-
getItemBackgroundStyle: () => getItemBackgroundStyle
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
const commonItemBackgroundStyle = (color, hoverColor, activeColor) => `
|
|
1
|
+
'use strict';
|
|
34
2
|
|
|
35
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
36
4
|
|
|
37
|
-
:hover {
|
|
38
|
-
background: ${hoverColor};
|
|
39
|
-
}
|
|
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");
|
|
40
6
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
`;
|
|
45
|
-
const getItemBackgroundStyle = (props) => {
|
|
46
|
-
if (props.selected && !props.opened)
|
|
47
|
-
return commonItemBackgroundStyle(props.theme.colors.brand[200], props.theme.colors.brand[200], props.theme.colors.brand[200]);
|
|
48
|
-
return commonItemBackgroundStyle(props.theme.colors.neutral["000"], props.theme.colors.neutral["080"], props.theme.colors.brand[200]);
|
|
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]);
|
|
49
10
|
};
|
|
50
|
-
|
|
51
|
-
|
|
11
|
+
|
|
12
|
+
exports.getItemBackgroundStyle = getItemBackgroundStyle;
|
|
@@ -1,54 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var getLeftBorderStyle_exports = {};
|
|
29
|
-
__export(getLeftBorderStyle_exports, {
|
|
30
|
-
getLeftBorderStyle: () => getLeftBorderStyle
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
const commonLeftBorderStyle = (color, hoverColor, activeColor) => `
|
|
1
|
+
'use strict';
|
|
34
2
|
|
|
35
|
-
|
|
36
|
-
box-shadow: inset 4px 0 0 0 ${color};
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
37
4
|
|
|
38
|
-
:hover {
|
|
39
|
-
-webkit-box-shadow: inset 4px 0 0 0 ${hoverColor};
|
|
40
|
-
box-shadow: inset 4px 0 0 0 ${hoverColor};
|
|
41
|
-
}
|
|
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");
|
|
42
6
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
const getLeftBorderStyle = (props) => {
|
|
49
|
-
if (props.selected || props.selectedParent)
|
|
50
|
-
return commonLeftBorderStyle(props.theme.colors.brand[400], props.theme.colors.brand[400], props.theme.colors.brand[400]);
|
|
51
|
-
return commonLeftBorderStyle(props.theme.colors.neutral["000"], props.theme.colors.brand[300], props.theme.colors.brand[400]);
|
|
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]);
|
|
52
10
|
};
|
|
53
|
-
|
|
54
|
-
|
|
11
|
+
|
|
12
|
+
exports.getLeftBorderStyle = getLeftBorderStyle;
|
|
@@ -1,58 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var getScrollbarStyle_exports = {};
|
|
29
|
-
__export(getScrollbarStyle_exports, {
|
|
30
|
-
getScrolbarStyle: () => getScrolbarStyle
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
const getScrolbarStyle = () => `
|
|
34
|
-
::-webkit-scrollbar {
|
|
35
|
-
width: 14px;
|
|
36
|
-
}
|
|
37
|
-
::-webkit-scrollbar-thumb {
|
|
38
|
-
height: 6px;
|
|
39
|
-
border: 4px solid rgba(0, 0, 0, 0);
|
|
1
|
+
'use strict';
|
|
40
2
|
|
|
41
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
42
4
|
|
|
43
|
-
background-color: rgba(105, 116, 137, 0.5);
|
|
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";
|
|
44
6
|
|
|
45
|
-
|
|
46
|
-
-webkit-border-radius: 7px;
|
|
47
|
-
}
|
|
48
|
-
::-webkit-scrollbar-button {
|
|
49
|
-
width: 0;
|
|
50
|
-
height: 0;
|
|
51
|
-
display: none;
|
|
52
|
-
}
|
|
53
|
-
::-webkit-scrollbar-corner {
|
|
54
|
-
background-color: transparent;
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
57
|
-
module.exports = __toCommonJS(getScrollbarStyle_exports);
|
|
58
|
-
//# sourceMappingURL=getScrollbarStyle.js.map
|
|
7
|
+
exports.getScrolbarStyle = getScrolbarStyle;
|
package/cjs/common/index.js
CHANGED
|
@@ -1,30 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var common_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
__reExport(common_exports, require("./getItemBackgroundStyle"));
|
|
27
|
-
__reExport(common_exports, require("./getLeftBorderStyle"));
|
|
28
|
-
__reExport(common_exports, require("./getScrollbarStyle"));
|
|
29
|
-
module.exports = __toCommonJS(common_exports);
|
|
30
|
-
//# sourceMappingURL=index.js.map
|
|
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;
|
package/cjs/configs/index.js
CHANGED
|
@@ -1,38 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var configs_exports = {};
|
|
29
|
-
__export(configs_exports, {
|
|
30
|
-
default: () => configs_default,
|
|
31
|
-
useLeftNavConfig: () => import_useLeftNavConfig2.useLeftNavConfig
|
|
32
|
-
});
|
|
33
|
-
var React = __toESM(require("react"));
|
|
34
|
-
var import_useLeftNavConfig = require("./useLeftNavConfig");
|
|
35
|
-
var import_useLeftNavConfig2 = require("./useLeftNavConfig");
|
|
36
|
-
var configs_default = import_useLeftNavConfig.useLeftNavConfig;
|
|
37
|
-
module.exports = __toCommonJS(configs_exports);
|
|
38
|
-
//# sourceMappingURL=index.js.map
|
|
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;
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const [selectedSubitem, setSelectedSubitem] = import_react.default.useState(null);
|
|
42
|
-
const [selectedParent, setSelectedParent] = import_react.default.useState(null);
|
|
43
|
-
const [focusedItem, setFocusedItem] = import_react.default.useState(null);
|
|
44
|
-
const [openedDrilldowns, setOpenedDrilldowns] = import_react.default.useState([]);
|
|
45
|
-
const [expandedForAnimation, setExpandedForAnimation] = import_react.default.useState(expanded);
|
|
46
|
-
const timeoutRef = import_react.default.useRef(null);
|
|
47
|
-
const smoothExpandOpts = import_react.default.useMemo(() => ({
|
|
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(() => ({
|
|
48
41
|
expandedForAnimation,
|
|
49
42
|
timeoutRef,
|
|
50
43
|
setExpandedForAnimation
|
|
51
44
|
}), [expandedForAnimation, timeoutRef, setExpandedForAnimation]);
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
useLeftNavSmoothExpand.useLeftNavSmoothExpand(props, smoothExpandOpts); // -----------------------------------------------------------------------------
|
|
46
|
+
// ************************** ------------ **************************
|
|
47
|
+
// * SIDE EFFECTS *
|
|
48
|
+
// ************************** ------------ **************************
|
|
49
|
+
|
|
50
|
+
React__default["default"].useEffect(() => {
|
|
54
51
|
onSelectedChange(selectedItem);
|
|
55
52
|
}, [selectedItem, onSelectedChange]);
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
|
|
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);
|
|
59
60
|
}, [openedItem]);
|
|
60
|
-
|
|
61
|
+
React__default["default"].useEffect(() => {
|
|
61
62
|
onFocusChange(focusedItem);
|
|
62
63
|
}, [focusedItem, onFocusChange]);
|
|
63
|
-
|
|
64
|
-
|
|
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(() => ({
|
|
65
70
|
headerItem: props.HeaderComponent,
|
|
66
71
|
bodyHeaderItem: props.BodyHeaderComponent,
|
|
67
72
|
items: props.items,
|
|
68
73
|
openedDrilldowns
|
|
69
|
-
}), [props.HeaderComponent, props.BodyHeaderComponent, props.items, openedDrilldowns]);
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
leftNavProps: props,
|
|
73
|
-
expandedForAnimation,
|
|
74
|
-
selectedItem: props.selectedItem !== void 0 ? props.selectedItem : selectedItem,
|
|
75
|
-
setSelectedItem,
|
|
76
|
-
selectedParent: props.selectedParent !== void 0 ? props.selectedParent : selectedParent,
|
|
77
|
-
setSelectedParent,
|
|
78
|
-
focusedItem,
|
|
79
|
-
setFocusedItem,
|
|
80
|
-
openedDrilldowns,
|
|
81
|
-
setOpenedDrilldowns,
|
|
74
|
+
}), [props.HeaderComponent, props.BodyHeaderComponent, props.items, openedDrilldowns]); // We need to know the current visible items since we have drilldowns
|
|
75
|
+
|
|
76
|
+
const {
|
|
82
77
|
visibleItems,
|
|
83
78
|
visibleItemsRefs
|
|
84
|
-
})
|
|
85
|
-
|
|
79
|
+
} = useLeftNavItems.useLeftNavItems(leftNavItemsProps); // -----------------------------------------------------------------------------
|
|
80
|
+
// ************************** ------------ **************************
|
|
81
|
+
// * LEFTNAV CONFIG *
|
|
82
|
+
// ************************** ------------ **************************
|
|
83
|
+
|
|
84
|
+
const finalConfig = React__default["default"].useMemo(() => ({
|
|
85
|
+
leftNavProps: props,
|
|
86
86
|
expandedForAnimation,
|
|
87
|
-
selectedItem,
|
|
87
|
+
selectedItem: props.selectedItem !== undefined ? props.selectedItem : selectedItem,
|
|
88
88
|
setSelectedItem,
|
|
89
|
+
selectedParent: props.selectedParent !== undefined ? props.selectedParent : selectedParent,
|
|
89
90
|
setSelectedParent,
|
|
90
|
-
selectedParent,
|
|
91
91
|
focusedItem,
|
|
92
92
|
setFocusedItem,
|
|
93
93
|
openedDrilldowns,
|
|
94
94
|
setOpenedDrilldowns,
|
|
95
95
|
visibleItems,
|
|
96
96
|
visibleItemsRefs
|
|
97
|
-
]);
|
|
97
|
+
}), [props, expandedForAnimation, selectedItem, setSelectedItem, setSelectedParent, selectedParent, focusedItem, setFocusedItem, openedDrilldowns, setOpenedDrilldowns, visibleItems, visibleItemsRefs]);
|
|
98
98
|
return finalConfig;
|
|
99
99
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
|
|
101
|
+
exports["default"] = useLeftNavConfig;
|
|
102
|
+
exports.useLeftNavConfig = useLeftNavConfig;
|