@hitachivantara/uikit-react-core 5.70.0 → 5.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DropdownButton/DropdownButton.cjs +1 -8
- package/dist/cjs/DropdownButton/DropdownButton.styles.cjs +0 -3
- package/dist/cjs/Forms/Suggestions/Suggestions.cjs +22 -29
- package/dist/cjs/ListContainer/ListItem/ListItem.styles.cjs +1 -0
- package/dist/cjs/TimePicker/TimePicker.cjs +2 -6
- package/dist/cjs/Typography/Typography.cjs +2 -1
- package/dist/cjs/Typography/Typography.styles.cjs +23 -24
- package/dist/cjs/VerticalNavigation/Actions/Action.cjs +4 -18
- package/dist/cjs/VerticalNavigation/Actions/Action.styles.cjs +4 -17
- package/dist/cjs/VerticalNavigation/Actions/Actions.styles.cjs +3 -5
- package/dist/cjs/VerticalNavigation/Header/Header.styles.cjs +7 -2
- package/dist/cjs/VerticalNavigation/Navigation/Navigation.cjs +3 -3
- package/dist/cjs/VerticalNavigation/Navigation/Navigation.styles.cjs +0 -2
- package/dist/cjs/VerticalNavigation/NavigationSlider/NavigationSlider.cjs +1 -1
- package/dist/cjs/VerticalNavigation/NavigationSlider/NavigationSlider.styles.cjs +7 -1
- package/dist/cjs/VerticalNavigation/TreeView/TreeView.styles.cjs +0 -2
- package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.cjs +32 -21
- package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.styles.cjs +4 -0
- package/dist/cjs/VerticalNavigation/VerticalNavigation.cjs +12 -18
- package/dist/cjs/VerticalNavigation/VerticalNavigation.styles.cjs +1 -1
- package/dist/esm/DropdownButton/DropdownButton.js +1 -8
- package/dist/esm/DropdownButton/DropdownButton.js.map +1 -1
- package/dist/esm/DropdownButton/DropdownButton.styles.js +0 -3
- package/dist/esm/DropdownButton/DropdownButton.styles.js.map +1 -1
- package/dist/esm/Forms/Suggestions/Suggestions.js +22 -27
- package/dist/esm/Forms/Suggestions/Suggestions.js.map +1 -1
- package/dist/esm/ListContainer/ListItem/ListItem.styles.js +1 -0
- package/dist/esm/ListContainer/ListItem/ListItem.styles.js.map +1 -1
- package/dist/esm/TimePicker/TimePicker.js +2 -6
- package/dist/esm/TimePicker/TimePicker.js.map +1 -1
- package/dist/esm/Typography/Typography.js +2 -1
- package/dist/esm/Typography/Typography.js.map +1 -1
- package/dist/esm/Typography/Typography.styles.js +23 -24
- package/dist/esm/Typography/Typography.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/Actions/Action.js +5 -19
- package/dist/esm/VerticalNavigation/Actions/Action.js.map +1 -1
- package/dist/esm/VerticalNavigation/Actions/Action.styles.js +4 -17
- package/dist/esm/VerticalNavigation/Actions/Action.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/Actions/Actions.styles.js +3 -5
- package/dist/esm/VerticalNavigation/Actions/Actions.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/Header/Header.styles.js +7 -2
- package/dist/esm/VerticalNavigation/Header/Header.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/Navigation/Navigation.js +1 -1
- package/dist/esm/VerticalNavigation/Navigation/Navigation.js.map +1 -1
- package/dist/esm/VerticalNavigation/Navigation/Navigation.styles.js +0 -2
- package/dist/esm/VerticalNavigation/Navigation/Navigation.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js +1 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js +7 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/utils.js.map +1 -0
- package/dist/esm/VerticalNavigation/TreeView/TreeView.styles.js +0 -2
- package/dist/esm/VerticalNavigation/TreeView/TreeView.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js +33 -22
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js +4 -0
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/VerticalNavigation.js +9 -15
- package/dist/esm/VerticalNavigation/VerticalNavigation.js.map +1 -1
- package/dist/esm/VerticalNavigation/VerticalNavigation.styles.js +1 -1
- package/dist/esm/VerticalNavigation/VerticalNavigation.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/VerticalNavigationContext.js.map +1 -1
- package/dist/types/index.d.ts +20 -31
- package/package.json +6 -6
- package/dist/cjs/VerticalNavigation/TreeView/IconWrapper/IconWrapper.cjs +0 -20
- package/dist/esm/VerticalNavigation/NavigationSlider/utils/NavigationSlider.utils.js.map +0 -1
- package/dist/esm/VerticalNavigation/TreeView/IconWrapper/IconWrapper.js +0 -20
- package/dist/esm/VerticalNavigation/TreeView/IconWrapper/IconWrapper.js.map +0 -1
- /package/dist/cjs/VerticalNavigation/NavigationSlider/{utils/NavigationSlider.utils.cjs → utils.cjs} +0 -0
- /package/dist/esm/VerticalNavigation/NavigationSlider/{utils/NavigationSlider.utils.js → utils.js} +0 -0
|
@@ -20,14 +20,7 @@ const HvDropdownButton = React.forwardRef((props, ref) => {
|
|
|
20
20
|
...others
|
|
21
21
|
} = uikitReactUtils.useDefaultProps("HvDropdownButton", props);
|
|
22
22
|
const { classes, cx } = DropdownButton_styles.useClasses(classesProp);
|
|
23
|
-
const endIcon = icon ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(
|
|
24
|
-
uikitReactIcons.DropDownXS,
|
|
25
|
-
{
|
|
26
|
-
iconSize: "XS",
|
|
27
|
-
style: { rotate: open ? "180deg" : void 0 },
|
|
28
|
-
className: classes.arrow
|
|
29
|
-
}
|
|
30
|
-
);
|
|
23
|
+
const endIcon = icon ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.DropDownXS, { iconSize: "XS", style: { rotate: open ? "180deg" : void 0 } });
|
|
31
24
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
32
25
|
Button.HvButton,
|
|
33
26
|
{
|
|
@@ -56,9 +56,6 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvDropdownB
|
|
|
56
56
|
placeholder: {},
|
|
57
57
|
arrowContainer: {
|
|
58
58
|
marginRight: uikitStyles.theme.spacing(-2)
|
|
59
|
-
},
|
|
60
|
-
arrow: {
|
|
61
|
-
transition: "rotate 0.2s ease"
|
|
62
59
|
}
|
|
63
60
|
});
|
|
64
61
|
exports.staticClasses = staticClasses;
|
|
@@ -2,22 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
|
-
const
|
|
5
|
+
const ClickAwayListener = require("@mui/base/ClickAwayListener");
|
|
6
|
+
const Popper = require("@mui/base/Popper");
|
|
6
7
|
const utils = require("@mui/material/utils");
|
|
7
|
-
const useClickOutside = require("../../hooks/useClickOutside.cjs");
|
|
8
8
|
const setId = require("../../utils/setId.cjs");
|
|
9
9
|
const Suggestions_styles = require("./Suggestions.styles.cjs");
|
|
10
10
|
const SelectionList = require("../../SelectionList/SelectionList.cjs");
|
|
11
11
|
const ListItem = require("../../ListContainer/ListItem/ListItem.cjs");
|
|
12
12
|
const FormElementContext = require("../FormElement/context/FormElementContext.cjs");
|
|
13
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
14
|
-
const MuiPopper__default = /* @__PURE__ */ _interopDefault(MuiPopper);
|
|
15
13
|
const HvSuggestions = React.forwardRef((props, extRef) => {
|
|
16
14
|
const {
|
|
17
15
|
id,
|
|
18
16
|
className,
|
|
19
17
|
classes: classesProp,
|
|
20
18
|
expanded = false,
|
|
19
|
+
open: openProp,
|
|
21
20
|
anchorEl,
|
|
22
21
|
suggestionValues = [],
|
|
23
22
|
onClose,
|
|
@@ -30,10 +29,6 @@ const HvSuggestions = React.forwardRef((props, extRef) => {
|
|
|
30
29
|
const ref = React.useRef(null);
|
|
31
30
|
const forkedRef = utils.useForkRef(ref, extRef);
|
|
32
31
|
const [isOpen, setIsOpen] = React.useState(expanded);
|
|
33
|
-
useClickOutside.useClickOutside(ref, (event) => {
|
|
34
|
-
setIsOpen(false);
|
|
35
|
-
onClose?.(event);
|
|
36
|
-
});
|
|
37
32
|
React.useEffect(() => {
|
|
38
33
|
setIsOpen(expanded);
|
|
39
34
|
}, [expanded]);
|
|
@@ -45,30 +40,28 @@ const HvSuggestions = React.forwardRef((props, extRef) => {
|
|
|
45
40
|
className: cx(classes.root, className),
|
|
46
41
|
...others,
|
|
47
42
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
48
|
-
|
|
43
|
+
ClickAwayListener.ClickAwayListener,
|
|
49
44
|
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
onClickAway: (event) => {
|
|
46
|
+
setIsOpen(false);
|
|
47
|
+
onClose?.(event);
|
|
48
|
+
},
|
|
54
49
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
-
|
|
50
|
+
Popper.Popper,
|
|
56
51
|
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
);
|
|
71
|
-
})
|
|
52
|
+
open: openProp ?? isOpen,
|
|
53
|
+
disablePortal: true,
|
|
54
|
+
anchorEl,
|
|
55
|
+
className: classes.popper,
|
|
56
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
57
|
+
SelectionList.HvSelectionList,
|
|
58
|
+
{
|
|
59
|
+
className: classes.list,
|
|
60
|
+
id: setId.setId(localId, "list"),
|
|
61
|
+
onChange: onSuggestionSelected,
|
|
62
|
+
children: suggestionValues?.map((item) => /* @__PURE__ */ jsxRuntime.jsx(ListItem.HvListItem, { value: item, disabled: item.disabled, children: item.label }, item.id))
|
|
63
|
+
}
|
|
64
|
+
)
|
|
72
65
|
}
|
|
73
66
|
)
|
|
74
67
|
}
|
|
@@ -24,10 +24,6 @@ const toTime = (value) => {
|
|
|
24
24
|
const { hours, minutes, seconds } = value;
|
|
25
25
|
return new date.Time(hours, minutes, seconds);
|
|
26
26
|
};
|
|
27
|
-
const getFormat = (timeFormat) => {
|
|
28
|
-
if (timeFormat == null) return 24;
|
|
29
|
-
return timeFormat === "12" ? 12 : 24;
|
|
30
|
-
};
|
|
31
27
|
const HvTimePicker = React.forwardRef(
|
|
32
28
|
(props, ref) => {
|
|
33
29
|
const {
|
|
@@ -77,8 +73,8 @@ const HvTimePicker = React.forwardRef(
|
|
|
77
73
|
isRequired: required,
|
|
78
74
|
isReadOnly: readOnly,
|
|
79
75
|
isDisabled: disabled,
|
|
80
|
-
granularity: "second",
|
|
81
|
-
hourCycle:
|
|
76
|
+
granularity: showSeconds === false ? "minute" : "second",
|
|
77
|
+
hourCycle: timeFormat === "12" ? 12 : 24,
|
|
82
78
|
onChange: (value) => {
|
|
83
79
|
const { hour: hours, minute: minutes, second: seconds } = value;
|
|
84
80
|
onChange?.({ hours, minutes, seconds });
|
|
@@ -50,7 +50,7 @@ const HvTypography = generic.fixedForwardRef(function HvTypography2(props, ref)
|
|
|
50
50
|
disabled = false,
|
|
51
51
|
...others
|
|
52
52
|
} = uikitReactUtils.useDefaultProps("HvTypography", props);
|
|
53
|
-
const { classes, cx } = Typography_styles.useClasses(classesProp);
|
|
53
|
+
const { classes, css, cx } = Typography_styles.useClasses(classesProp);
|
|
54
54
|
const { activeTheme } = uikitReactUtils.useTheme();
|
|
55
55
|
const variant = utils.mapVariant(variantProp, activeTheme?.base);
|
|
56
56
|
const Component = ComponentProp || paragraph && "p" || HvTypographyMap[variant] || "span";
|
|
@@ -59,6 +59,7 @@ const HvTypography = generic.fixedForwardRef(function HvTypography2(props, ref)
|
|
|
59
59
|
{
|
|
60
60
|
ref,
|
|
61
61
|
className: cx(
|
|
62
|
+
css({ ...activeTheme?.typography[variant] }),
|
|
62
63
|
classes.root,
|
|
63
64
|
classes[variant],
|
|
64
65
|
{
|
|
@@ -20,45 +20,44 @@ const { useClasses, staticClasses } = uikitReactUtils.createClasses("HvTypograph
|
|
|
20
20
|
whiteSpace: "nowrap"
|
|
21
21
|
},
|
|
22
22
|
// variants
|
|
23
|
-
display: {
|
|
24
|
-
title1: {
|
|
25
|
-
title2: {
|
|
26
|
-
title3: {
|
|
27
|
-
title4: {
|
|
28
|
-
body: {
|
|
29
|
-
label: {
|
|
30
|
-
captionLabel: {
|
|
31
|
-
caption1: {
|
|
32
|
-
caption2: {
|
|
23
|
+
display: {},
|
|
24
|
+
title1: {},
|
|
25
|
+
title2: {},
|
|
26
|
+
title3: {},
|
|
27
|
+
title4: {},
|
|
28
|
+
body: {},
|
|
29
|
+
label: {},
|
|
30
|
+
captionLabel: {},
|
|
31
|
+
caption1: {},
|
|
32
|
+
caption2: {},
|
|
33
33
|
// legacy variants
|
|
34
|
-
|
|
35
|
-
"
|
|
34
|
+
// TODO: remove (legacy or all variants) in v6 in favour of dynamic variants
|
|
35
|
+
"5xlTitle": {},
|
|
36
|
+
"4xlTitle": {},
|
|
36
37
|
// @ts-ignore non-existent variant
|
|
37
|
-
"3xlTitle": {
|
|
38
|
-
xxlTitle: {
|
|
38
|
+
"3xlTitle": {},
|
|
39
|
+
xxlTitle: {},
|
|
39
40
|
xlTitle: {},
|
|
40
|
-
lTitle: {
|
|
41
|
+
lTitle: {},
|
|
41
42
|
mTitle: {},
|
|
42
|
-
sTitle: {
|
|
43
|
+
sTitle: {},
|
|
43
44
|
xsTitle: {},
|
|
44
|
-
xxsTitle: {
|
|
45
|
+
xxsTitle: {},
|
|
45
46
|
sectionTitle: {
|
|
46
|
-
...uikitStyles.theme.typography.sectionTitle,
|
|
47
47
|
textTransform: "uppercase"
|
|
48
48
|
},
|
|
49
49
|
highlightText: {},
|
|
50
50
|
normalText: {},
|
|
51
|
-
placeholderText: {
|
|
51
|
+
placeholderText: {},
|
|
52
52
|
link: {
|
|
53
|
-
...uikitStyles.theme.typography.link,
|
|
54
53
|
cursor: "pointer",
|
|
55
54
|
textDecoration: "underline"
|
|
56
55
|
},
|
|
57
|
-
disabledText: {
|
|
58
|
-
selectedNavText: {
|
|
56
|
+
disabledText: {},
|
|
57
|
+
selectedNavText: {},
|
|
59
58
|
vizText: {},
|
|
60
|
-
vizTextDisabled: {
|
|
61
|
-
xsInlineLink: {
|
|
59
|
+
vizTextDisabled: {},
|
|
60
|
+
xsInlineLink: {}
|
|
62
61
|
});
|
|
63
62
|
exports.staticClasses = staticClasses;
|
|
64
63
|
exports.useClasses = useClasses;
|
|
@@ -3,11 +3,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
6
|
-
const keyboardUtils = require("../../utils/keyboardUtils.cjs");
|
|
7
6
|
const setId = require("../../utils/setId.cjs");
|
|
8
7
|
const VerticalNavigationContext = require("../VerticalNavigationContext.cjs");
|
|
9
8
|
const Action_styles = require("./Action.styles.cjs");
|
|
10
|
-
const
|
|
9
|
+
const Button = require("../../Button/Button.cjs");
|
|
11
10
|
const HvVerticalNavigationAction = (props) => {
|
|
12
11
|
const {
|
|
13
12
|
className,
|
|
@@ -15,26 +14,16 @@ const HvVerticalNavigationAction = (props) => {
|
|
|
15
14
|
id,
|
|
16
15
|
label = "",
|
|
17
16
|
icon,
|
|
18
|
-
onClick,
|
|
19
17
|
...others
|
|
20
18
|
} = uikitReactUtils.useDefaultProps("HvVerticalNavigationAction", props);
|
|
21
19
|
const { isOpen } = React.useContext(VerticalNavigationContext.VerticalNavigationContext);
|
|
22
20
|
const { classes, cx } = Action_styles.useClasses(classesProp);
|
|
23
|
-
const handleKeyDown = React.useCallback(
|
|
24
|
-
(event) => {
|
|
25
|
-
if (!onClick || !keyboardUtils.isKey(event, "Enter") && !keyboardUtils.isKey(event, "Space")) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
onClick(event);
|
|
29
|
-
},
|
|
30
|
-
[onClick]
|
|
31
|
-
);
|
|
32
21
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
33
|
-
|
|
22
|
+
Button.HvButton,
|
|
34
23
|
{
|
|
35
24
|
id: setId.setId(id, "button"),
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
variant: "secondaryGhost",
|
|
26
|
+
icon: !isOpen,
|
|
38
27
|
className: cx(
|
|
39
28
|
classes.action,
|
|
40
29
|
{
|
|
@@ -43,10 +32,7 @@ const HvVerticalNavigationAction = (props) => {
|
|
|
43
32
|
},
|
|
44
33
|
className
|
|
45
34
|
),
|
|
46
|
-
tabIndex: 0,
|
|
47
35
|
...!isOpen && { "aria-label": label },
|
|
48
|
-
onKeyDown: handleKeyDown,
|
|
49
|
-
onClick,
|
|
50
36
|
...others,
|
|
51
37
|
children: [
|
|
52
38
|
icon,
|
|
@@ -2,31 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
4
4
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
|
-
const focusUtils = require("../../utils/focusUtils.cjs");
|
|
6
|
-
const hover = {
|
|
7
|
-
background: uikitStyles.theme.colors.containerBackgroundHover
|
|
8
|
-
};
|
|
9
5
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
10
6
|
"HvVerticalNavigationAction",
|
|
11
7
|
{
|
|
12
8
|
action: {
|
|
13
9
|
width: "100%",
|
|
14
|
-
display: "flex",
|
|
15
10
|
justifyContent: "flex-start",
|
|
16
|
-
alignItems: "center",
|
|
17
11
|
height: "32px",
|
|
18
|
-
color:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
outline: "none",
|
|
23
|
-
...hover
|
|
24
|
-
},
|
|
25
|
-
"&:focus-visible": {
|
|
26
|
-
...focusUtils.outlineStyles
|
|
27
|
-
},
|
|
12
|
+
color: "inherit",
|
|
13
|
+
fontWeight: "inherit",
|
|
14
|
+
padding: 0,
|
|
15
|
+
border: "none",
|
|
28
16
|
// cursor
|
|
29
|
-
cursor: "pointer",
|
|
30
17
|
"& *": {
|
|
31
18
|
cursor: "pointer"
|
|
32
19
|
}
|
|
@@ -6,12 +6,10 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
6
6
|
"HvVerticalNavigationActions",
|
|
7
7
|
{
|
|
8
8
|
root: {
|
|
9
|
-
display: "
|
|
10
|
-
|
|
9
|
+
display: "flex",
|
|
10
|
+
flexDirection: "column",
|
|
11
11
|
marginTop: "auto",
|
|
12
|
-
|
|
13
|
-
marginBottom: "8px"
|
|
14
|
-
}
|
|
12
|
+
gap: uikitStyles.theme.space.xs
|
|
15
13
|
},
|
|
16
14
|
hide: {
|
|
17
15
|
display: "none"
|
|
@@ -16,12 +16,17 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
16
16
|
},
|
|
17
17
|
collapseButton: {
|
|
18
18
|
marginLeft: "auto",
|
|
19
|
+
color: "inherit",
|
|
19
20
|
"&$minimized": {
|
|
20
21
|
marginLeft: 0
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
|
-
backButton: {
|
|
24
|
-
|
|
24
|
+
backButton: {
|
|
25
|
+
color: "inherit"
|
|
26
|
+
},
|
|
27
|
+
title: {
|
|
28
|
+
color: "inherit"
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
);
|
|
27
32
|
exports.staticClasses = staticClasses;
|
|
@@ -7,7 +7,7 @@ const useControlled = require("../../hooks/useControlled.cjs");
|
|
|
7
7
|
const helpers = require("../../utils/helpers.cjs");
|
|
8
8
|
const setId = require("../../utils/setId.cjs");
|
|
9
9
|
const NavigationPopupContainer = require("../NavigationPopup/NavigationPopupContainer.cjs");
|
|
10
|
-
const
|
|
10
|
+
const utils = require("../NavigationSlider/utils.cjs");
|
|
11
11
|
const VerticalNavigationContext = require("../VerticalNavigationContext.cjs");
|
|
12
12
|
const Navigation_styles = require("./Navigation.styles.cjs");
|
|
13
13
|
const NavigationSlider = require("../NavigationSlider/NavigationSlider.cjs");
|
|
@@ -199,8 +199,8 @@ const HvVerticalNavigationTree = (props) => {
|
|
|
199
199
|
if (setParentData) setParentData(data);
|
|
200
200
|
}, [data, setParentData]);
|
|
201
201
|
React.useEffect(() => {
|
|
202
|
-
if (withParentData && selected && setParentItem &&
|
|
203
|
-
setParentItem(
|
|
202
|
+
if (withParentData && selected && setParentItem && utils.getParentItemById(withParentData, selected)) {
|
|
203
|
+
setParentItem(utils.getParentItemById(withParentData, selected));
|
|
204
204
|
}
|
|
205
205
|
}, [withParentData, selected, setParentItem]);
|
|
206
206
|
const navigateToTargetHandler = (event, selectedItem) => handleChange(event, selectedItem.id, selectedItem);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
4
|
-
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
4
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
6
5
|
"HvVerticalNavigationTree",
|
|
7
6
|
{
|
|
8
7
|
root: {
|
|
9
8
|
display: "block",
|
|
10
|
-
background: uikitStyles.theme.colors.atmo1,
|
|
11
9
|
overflowY: "auto"
|
|
12
10
|
},
|
|
13
11
|
list: {},
|
|
@@ -51,7 +51,7 @@ const HvVerticalNavigationSlider = (props) => {
|
|
|
51
51
|
},
|
|
52
52
|
className: classes.forwardButton,
|
|
53
53
|
"aria-label": forwardButtonAriaLabel,
|
|
54
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.DropRightXS, {})
|
|
54
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.DropRightXS, { color: "currentcolor" })
|
|
55
55
|
}
|
|
56
56
|
) : void 0,
|
|
57
57
|
children: /* @__PURE__ */ jsxRuntime.jsx(OverflowTooltip.HvOverflowTooltip, { data: item.label })
|
|
@@ -10,9 +10,13 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
10
10
|
alignItems: "center",
|
|
11
11
|
borderLeft: `4px solid transparent`,
|
|
12
12
|
minHeight: "48px",
|
|
13
|
+
color: "inherit",
|
|
13
14
|
marginBottom: "8px",
|
|
14
15
|
"& > button": {
|
|
15
16
|
marginLeft: "auto"
|
|
17
|
+
},
|
|
18
|
+
"& .HvListItem-startAdornment .color0": {
|
|
19
|
+
fill: "currentColor"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
listItemSelected: {
|
|
@@ -22,7 +26,9 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
22
26
|
listItemFocus: {
|
|
23
27
|
background: uikitStyles.theme.colors.atmo3
|
|
24
28
|
},
|
|
25
|
-
forwardButton: {
|
|
29
|
+
forwardButton: {
|
|
30
|
+
color: "inherit"
|
|
31
|
+
},
|
|
26
32
|
listContainer: {},
|
|
27
33
|
listItemDisabled: {}
|
|
28
34
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
4
|
-
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
4
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
6
5
|
"HvVerticalNavigationTreeView",
|
|
7
6
|
{
|
|
8
7
|
root: {
|
|
9
8
|
display: "block",
|
|
10
|
-
background: uikitStyles.theme.colors.atmo1,
|
|
11
9
|
padding: `0px`,
|
|
12
10
|
margin: "0",
|
|
13
11
|
listStyle: "none",
|
|
@@ -10,9 +10,9 @@ const setId = require("../../utils/setId.cjs");
|
|
|
10
10
|
const VerticalNavigationContext = require("../VerticalNavigationContext.cjs");
|
|
11
11
|
const TreeViewContext = require("./TreeViewContext.cjs");
|
|
12
12
|
const TreeViewItem_styles = require("./TreeViewItem.styles.cjs");
|
|
13
|
-
const IconWrapper = require("./IconWrapper/IconWrapper.cjs");
|
|
14
13
|
const Tooltip = require("../../Tooltip/Tooltip.cjs");
|
|
15
14
|
const Typography = require("../../Typography/Typography.cjs");
|
|
15
|
+
const Avatar = require("../../Avatar/Avatar.cjs");
|
|
16
16
|
const OverflowTooltip = require("../../OverflowTooltip/OverflowTooltip.cjs");
|
|
17
17
|
const preventSelection = (event, disabled) => {
|
|
18
18
|
if (event.shiftKey || event.ctrlKey || event.metaKey || disabled) {
|
|
@@ -271,10 +271,12 @@ const HvVerticalNavigationTreeViewItem = React.forwardRef(
|
|
|
271
271
|
component: isLink ? "a" : "div",
|
|
272
272
|
...isLink ? buttonLinkProps : null,
|
|
273
273
|
ref: contentRef,
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
274
|
+
classes: {
|
|
275
|
+
root: cx(classes.content, {
|
|
276
|
+
[classes.link]: isLink,
|
|
277
|
+
[classes.minimized]: !isOpen
|
|
278
|
+
})
|
|
279
|
+
},
|
|
278
280
|
variant: "body",
|
|
279
281
|
disabled,
|
|
280
282
|
onClick: handleClick,
|
|
@@ -295,22 +297,25 @@ const HvVerticalNavigationTreeViewItem = React.forwardRef(
|
|
|
295
297
|
"aria-label": payload?.label
|
|
296
298
|
},
|
|
297
299
|
children: [
|
|
298
|
-
/* @__PURE__ */ jsxRuntime.
|
|
299
|
-
|
|
300
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
301
|
+
"div",
|
|
300
302
|
{
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
303
|
+
className: classes.icon,
|
|
304
|
+
style: uikitReactUtils.mergeStyles(void 0, {
|
|
305
|
+
"--icon-margin-left": hasAnyChildWithData ? "auto" : "unset"
|
|
306
|
+
}),
|
|
307
|
+
children: [
|
|
308
|
+
!icon && useIcons ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
309
|
+
Avatar.HvAvatar,
|
|
310
|
+
{
|
|
311
|
+
variant: "square",
|
|
312
|
+
size: "xs",
|
|
313
|
+
backgroundColor: "secondary_80",
|
|
314
|
+
children: payload?.label?.substring(0, 1)
|
|
315
|
+
}
|
|
316
|
+
) : useIcons && icon,
|
|
317
|
+
hasChildren && !isOpen ? /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.Forwards, { iconSize: "XS" }) : hasAnyChildWithData && !isOpen && /* @__PURE__ */ jsxRuntime.jsx("div", {})
|
|
318
|
+
]
|
|
314
319
|
}
|
|
315
320
|
),
|
|
316
321
|
isOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -323,7 +328,13 @@ const HvVerticalNavigationTreeViewItem = React.forwardRef(
|
|
|
323
328
|
children: /* @__PURE__ */ jsxRuntime.jsx(OverflowTooltip.HvOverflowTooltip, { data: label })
|
|
324
329
|
}
|
|
325
330
|
),
|
|
326
|
-
isOpen && expandable &&
|
|
331
|
+
isOpen && expandable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
332
|
+
uikitReactIcons.DropDownXS,
|
|
333
|
+
{
|
|
334
|
+
color: "currentcolor",
|
|
335
|
+
style: { rotate: expanded ? "180deg" : void 0 }
|
|
336
|
+
}
|
|
337
|
+
)
|
|
327
338
|
]
|
|
328
339
|
}
|
|
329
340
|
) });
|
|
@@ -42,6 +42,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
42
42
|
width: "100%",
|
|
43
43
|
display: "flex",
|
|
44
44
|
justifyContent: "flex-start",
|
|
45
|
+
color: "inherit",
|
|
45
46
|
alignItems: "center",
|
|
46
47
|
height: "32px",
|
|
47
48
|
borderLeft: `4px solid transparent`,
|
|
@@ -127,6 +128,9 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
127
128
|
},
|
|
128
129
|
icon: {
|
|
129
130
|
display: "flex",
|
|
131
|
+
"& .color0": {
|
|
132
|
+
fill: "currentColor"
|
|
133
|
+
},
|
|
130
134
|
"> div:first-of-type": {
|
|
131
135
|
marginLeft: "var(--icon-margin-left)"
|
|
132
136
|
},
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
6
|
+
const utils = require("./NavigationSlider/utils.cjs");
|
|
6
7
|
const VerticalNavigation_utils = require("./utils/VerticalNavigation.utils.cjs");
|
|
7
8
|
const VerticalNavigation_styles = require("./VerticalNavigation.styles.cjs");
|
|
8
9
|
const VerticalNavigationContext = require("./VerticalNavigationContext.cjs");
|
|
9
|
-
const
|
|
10
|
-
const HvVerticalNavigation = (props) => {
|
|
10
|
+
const HvVerticalNavigation = React.forwardRef((props, ref) => {
|
|
11
11
|
const {
|
|
12
12
|
id,
|
|
13
13
|
className,
|
|
@@ -21,13 +21,12 @@ const HvVerticalNavigation = (props) => {
|
|
|
21
21
|
const { classes, cx } = VerticalNavigation_styles.useClasses(classesProp);
|
|
22
22
|
const [parentData, setParentData] = React.useState([]);
|
|
23
23
|
const [parentSelected, setParentSelected] = React.useState();
|
|
24
|
-
const [headerTitle, setHeaderTitle] = React.useState();
|
|
25
24
|
const withParentData = React.useMemo(
|
|
26
|
-
() =>
|
|
25
|
+
() => utils.fillDataWithParentId(parentData),
|
|
27
26
|
[parentData]
|
|
28
27
|
);
|
|
29
28
|
const initialParentItem = React.useMemo(
|
|
30
|
-
() =>
|
|
29
|
+
() => utils.getParentItemById(withParentData, parentSelected),
|
|
31
30
|
[withParentData, parentSelected]
|
|
32
31
|
);
|
|
33
32
|
const [parentItem, setParentItem] = React.useState(initialParentItem);
|
|
@@ -35,19 +34,16 @@ const HvVerticalNavigation = (props) => {
|
|
|
35
34
|
() => VerticalNavigation_utils.hasChildNavigationItems(parentData),
|
|
36
35
|
[parentData]
|
|
37
36
|
);
|
|
38
|
-
React.
|
|
39
|
-
() => setHeaderTitle(parentItem?.label),
|
|
40
|
-
[parentItem, setParentItem]
|
|
41
|
-
);
|
|
37
|
+
const headerTitle = React.useMemo(() => parentItem?.label, [parentItem]);
|
|
42
38
|
const navigateToParentHandler = React.useCallback(() => {
|
|
43
|
-
setParentItem(
|
|
44
|
-
}, [parentItem,
|
|
39
|
+
setParentItem(utils.getParentItemById(withParentData, parentItem.id));
|
|
40
|
+
}, [parentItem, withParentData]);
|
|
45
41
|
const navigateToChildHandler = React.useCallback(
|
|
46
42
|
(event, item) => {
|
|
47
|
-
setParentItem(
|
|
43
|
+
setParentItem(utils.getNavigationItemById(withParentData, item.id));
|
|
48
44
|
event.stopPropagation();
|
|
49
45
|
},
|
|
50
|
-
[
|
|
46
|
+
[withParentData]
|
|
51
47
|
);
|
|
52
48
|
const value = React.useMemo(
|
|
53
49
|
() => ({
|
|
@@ -55,7 +51,6 @@ const HvVerticalNavigation = (props) => {
|
|
|
55
51
|
useIcons,
|
|
56
52
|
slider,
|
|
57
53
|
headerTitle,
|
|
58
|
-
setHeaderTitle,
|
|
59
54
|
parentItem,
|
|
60
55
|
setParentItem,
|
|
61
56
|
withParentData,
|
|
@@ -72,7 +67,6 @@ const HvVerticalNavigation = (props) => {
|
|
|
72
67
|
useIcons,
|
|
73
68
|
slider,
|
|
74
69
|
headerTitle,
|
|
75
|
-
setHeaderTitle,
|
|
76
70
|
parentItem,
|
|
77
71
|
setParentItem,
|
|
78
72
|
withParentData,
|
|
@@ -83,10 +77,11 @@ const HvVerticalNavigation = (props) => {
|
|
|
83
77
|
parentSelected
|
|
84
78
|
]
|
|
85
79
|
);
|
|
86
|
-
|
|
80
|
+
return /* @__PURE__ */ jsxRuntime.jsx(VerticalNavigationContext.VerticalNavigationContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
81
|
"div",
|
|
88
82
|
{
|
|
89
83
|
id,
|
|
84
|
+
ref,
|
|
90
85
|
className: cx(
|
|
91
86
|
classes.root,
|
|
92
87
|
{
|
|
@@ -100,7 +95,6 @@ const HvVerticalNavigation = (props) => {
|
|
|
100
95
|
children
|
|
101
96
|
}
|
|
102
97
|
) });
|
|
103
|
-
|
|
104
|
-
};
|
|
98
|
+
});
|
|
105
99
|
exports.verticalNavigationClasses = VerticalNavigation_styles.staticClasses;
|
|
106
100
|
exports.HvVerticalNavigation = HvVerticalNavigation;
|
|
@@ -10,7 +10,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
10
10
|
flexDirection: "column",
|
|
11
11
|
justifyContent: "flex-start",
|
|
12
12
|
width: "220px",
|
|
13
|
-
|
|
13
|
+
backgroundColor: uikitStyles.theme.colors.atmo1,
|
|
14
14
|
boxShadow: uikitStyles.theme.colors.shadow,
|
|
15
15
|
clipPath: "inset(0px -12px 0px 0px)",
|
|
16
16
|
"& > :only-child": {
|