@hitachivantara/uikit-react-core 6.8.0 → 6.8.1
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/AppSwitcher/Action/Action.js +2 -2
- package/dist/BaseDropdown/BaseDropdown.js +6 -4
- package/dist/BaseDropdown/BaseDropdownPanel.js +6 -6
- package/dist/BreadCrumb/BreadCrumb.js +1 -1
- package/dist/Calendar/CalendarHeader/CalendarHeader.js +1 -1
- package/dist/Calendar/SingleCalendar/SingleCalendar.js +1 -1
- package/dist/Carousel/Carousel.js +1 -1
- package/dist/CheckBox/CheckBox.js +1 -1
- package/dist/DatePicker/DatePicker.js +9 -8
- package/dist/Dropdown/Dropdown.js +2 -2
- package/dist/Dropdown/List/List.js +1 -1
- package/dist/FileUploader/FileUploader.js +1 -1
- package/dist/FilterGroup/FilterContent/FilterContent.js +2 -2
- package/dist/FilterGroup/FilterGroup.js +1 -1
- package/dist/FilterGroup/LeftPanel/LeftPanel.js +2 -2
- package/dist/Input/Input.js +2 -2
- package/dist/List/List.js +2 -2
- package/dist/NumberInput/NumberInput.js +1 -1
- package/dist/QueryBuilder/RuleGroup.js +1 -1
- package/dist/Radio/Radio.js +1 -1
- package/dist/Section/Section.js +1 -1
- package/dist/SelectionList/SelectionList.js +1 -1
- package/dist/Switch/Switch.js +2 -2
- package/dist/Table/renderers/renderers.js +1 -1
- package/dist/TagsInput/TagsInput.js +1 -1
- package/dist/TextArea/TextArea.js +2 -2
- package/dist/TimePicker/Placeholder.js +36 -31
- package/dist/TimePicker/TimePicker.js +15 -13
- package/dist/VerticalNavigation/NavigationSlider/NavigationSlider.js +1 -1
- package/dist/utils/Callout.js +1 -1
- package/package.json +4 -4
|
@@ -5,11 +5,11 @@ import { useUniqueId } from "../../hooks/useUniqueId.js";
|
|
|
5
5
|
import { HvIcon } from "../../icons.js";
|
|
6
6
|
import { useClasses } from "./Action.styles.js";
|
|
7
7
|
import { staticClasses } from "./Action.styles.js";
|
|
8
|
-
import { HvAvatar } from "../../Avatar/Avatar.js";
|
|
9
|
-
import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
|
|
10
8
|
import { HvTypography } from "../../Typography/Typography.js";
|
|
11
9
|
import { HvOverflowTooltip } from "../../OverflowTooltip/OverflowTooltip.js";
|
|
12
10
|
import { HvTooltip } from "../../Tooltip/Tooltip.js";
|
|
11
|
+
import { HvAvatar } from "../../Avatar/Avatar.js";
|
|
12
|
+
import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
|
|
13
13
|
const HvAppSwitcherAction = ({
|
|
14
14
|
id,
|
|
15
15
|
className,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState, useId, useCallback, isValidElement, cloneElement, Fragment } from "react";
|
|
3
|
+
import useEventCallback from "@mui/utils/useEventCallback";
|
|
3
4
|
import useForkRef from "@mui/utils/useForkRef";
|
|
4
5
|
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
5
6
|
import { useControlled } from "../hooks/useControlled.js";
|
|
@@ -139,6 +140,10 @@ const HvBaseDropdown = forwardRef(function BaseDropdown(props, ref) {
|
|
|
139
140
|
const hasCustomHeader = !!HeaderComponentProp;
|
|
140
141
|
const HeaderComponent = HeaderComponentProp || "div";
|
|
141
142
|
const RootComponent = HeaderComponentProp ? Fragment : "div";
|
|
143
|
+
const onFirstUpdate = useEventCallback((state) => {
|
|
144
|
+
setComputedPlacement(state.placement);
|
|
145
|
+
onContainerCreation?.(state.elements?.popper ?? null, state);
|
|
146
|
+
});
|
|
142
147
|
return /* @__PURE__ */ jsxs(RootComponent, { ...!hasCustomHeader && { className: classes.root }, children: [
|
|
143
148
|
/* @__PURE__ */ jsx(
|
|
144
149
|
HeaderComponent,
|
|
@@ -176,10 +181,7 @@ const HvBaseDropdown = forwardRef(function BaseDropdown(props, ref) {
|
|
|
176
181
|
disablePortal,
|
|
177
182
|
anchorEl: referenceElement,
|
|
178
183
|
onToggle: handleToggle,
|
|
179
|
-
onFirstUpdate
|
|
180
|
-
setComputedPlacement(state.placement);
|
|
181
|
-
onContainerCreation?.(state.elements?.popper ?? null, state);
|
|
182
|
-
},
|
|
184
|
+
onFirstUpdate,
|
|
183
185
|
popperOptions: popperProps,
|
|
184
186
|
children
|
|
185
187
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useState } from "react";
|
|
2
|
+
import { useRef, useState, useMemo } from "react";
|
|
3
3
|
import ClickAwayListener from "@mui/material/ClickAwayListener";
|
|
4
4
|
import Popper from "@mui/material/Popper";
|
|
5
5
|
import { useDefaultProps, useTheme, createClasses } from "@hitachivantara/uikit-react-utils";
|
|
@@ -30,7 +30,7 @@ const HvDropdownPanel = (props) => {
|
|
|
30
30
|
anchorEl,
|
|
31
31
|
disablePortal,
|
|
32
32
|
modifiers: modifiersProp,
|
|
33
|
-
popperOptions,
|
|
33
|
+
popperOptions: popperOptionsProp,
|
|
34
34
|
onToggle,
|
|
35
35
|
onClickAway,
|
|
36
36
|
onFirstUpdate,
|
|
@@ -45,6 +45,9 @@ const HvDropdownPanel = (props) => {
|
|
|
45
45
|
modifiers: modifiersProp,
|
|
46
46
|
onPlacementChange: setPlacement
|
|
47
47
|
});
|
|
48
|
+
const popperOptions = useMemo(() => {
|
|
49
|
+
return { ...popperOptionsProp, onFirstUpdate };
|
|
50
|
+
}, [onFirstUpdate, popperOptionsProp]);
|
|
48
51
|
const handleKeyDown = (event) => {
|
|
49
52
|
if (isKey(event, "Esc")) {
|
|
50
53
|
onToggle?.(event);
|
|
@@ -69,10 +72,7 @@ const HvDropdownPanel = (props) => {
|
|
|
69
72
|
className: cx(classes.container, className),
|
|
70
73
|
modifiers,
|
|
71
74
|
onKeyDown: handleKeyDown,
|
|
72
|
-
popperOptions
|
|
73
|
-
onFirstUpdate,
|
|
74
|
-
...popperOptions
|
|
75
|
-
},
|
|
75
|
+
popperOptions,
|
|
76
76
|
...others,
|
|
77
77
|
children: /* @__PURE__ */ jsx(ClickAwayListener, { onClickAway, children: /* @__PURE__ */ jsx(
|
|
78
78
|
HvPanel,
|
|
@@ -6,9 +6,9 @@ import { useClasses } from "./BreadCrumb.styles.js";
|
|
|
6
6
|
import { staticClasses } from "./BreadCrumb.styles.js";
|
|
7
7
|
import { pathWithSubMenu, removeExtension } from "./utils.js";
|
|
8
8
|
import { HvPathElement } from "./PathElement/PathElement.js";
|
|
9
|
-
import { HvBreadCrumbPage } from "./Page/Page.js";
|
|
10
9
|
import { HvIconButton } from "../IconButton/IconButton.js";
|
|
11
10
|
import { HvTypography } from "../Typography/Typography.js";
|
|
11
|
+
import { HvBreadCrumbPage } from "./Page/Page.js";
|
|
12
12
|
const HomeIcon = (props) => /* @__PURE__ */ jsx(SvgBase, { viewBox: "0 0 256 256", width: "16", height: "16", ...props, children: /* @__PURE__ */ jsx("path", { d: "M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z" }) });
|
|
13
13
|
const HvBreadCrumb = forwardRef(function HvBreadCrumb2(props, ref) {
|
|
14
14
|
const {
|
|
@@ -5,9 +5,9 @@ import { isKey } from "../../utils/keyboardUtils.js";
|
|
|
5
5
|
import { DEFAULT_LOCALE, isRange, getLocaleDateFormat, isDate, getFormattedDate, getStringFromDate, parseDateString, isSameDay } from "../utils.js";
|
|
6
6
|
import { useClasses } from "./CalendarHeader.styles.js";
|
|
7
7
|
import { staticClasses } from "./CalendarHeader.styles.js";
|
|
8
|
-
import { HvInput } from "../../Input/Input.js";
|
|
9
8
|
import { HvFormElementDescriptorsContext } from "../../FormElement/context.js";
|
|
10
9
|
import { HvTypography } from "../../Typography/Typography.js";
|
|
10
|
+
import { HvInput } from "../../Input/Input.js";
|
|
11
11
|
const HvCalendarHeader = (props) => {
|
|
12
12
|
const {
|
|
13
13
|
id,
|
|
@@ -8,9 +8,9 @@ import { DEFAULT_LOCALE, isDate, getWeekdayNamesList, isRange } from "../utils.j
|
|
|
8
8
|
import { HvCalendarCell } from "./CalendarCell.js";
|
|
9
9
|
import { useClasses } from "./SingleCalendar.styles.js";
|
|
10
10
|
import { staticClasses } from "./SingleCalendar.styles.js";
|
|
11
|
+
import { HvPanel } from "../../Panel/Panel.js";
|
|
11
12
|
import { HvComposedNavigation } from "../CalendarNavigation/ComposedNavigation/ComposedNavigation.js";
|
|
12
13
|
import { HvMonthSelector } from "../CalendarNavigation/MonthSelector/MonthSelector.js";
|
|
13
|
-
import { HvPanel } from "../../Panel/Panel.js";
|
|
14
14
|
import { HvTypography } from "../../Typography/Typography.js";
|
|
15
15
|
const HvSingleCalendar = (props) => {
|
|
16
16
|
const {
|
|
@@ -8,8 +8,8 @@ import { useClasses } from "./Carousel.styles.js";
|
|
|
8
8
|
import { staticClasses } from "./Carousel.styles.js";
|
|
9
9
|
import { HvCarouselControls } from "./CarouselControls.js";
|
|
10
10
|
import { HvCarouselThumbnails } from "./CarouselThumbnails.js";
|
|
11
|
-
import { HvContainer } from "../Container/Container.js";
|
|
12
11
|
import { HvIconButton } from "../IconButton/IconButton.js";
|
|
12
|
+
import { HvContainer } from "../Container/Container.js";
|
|
13
13
|
import { HvTypography } from "../Typography/Typography.js";
|
|
14
14
|
import { HvButton } from "../Button/Button.js";
|
|
15
15
|
const DEFAULT_LABELS = {
|
|
@@ -7,8 +7,8 @@ import { setId } from "../utils/setId.js";
|
|
|
7
7
|
import { useClasses } from "./CheckBox.styles.js";
|
|
8
8
|
import { staticClasses } from "./CheckBox.styles.js";
|
|
9
9
|
import { HvBaseCheckBox } from "../BaseCheckBox/BaseCheckBox.js";
|
|
10
|
-
import { isInvalid } from "../FormElement/utils.js";
|
|
11
10
|
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
11
|
+
import { isInvalid } from "../FormElement/utils.js";
|
|
12
12
|
import { HvLabel } from "../FormElement/Label/Label.js";
|
|
13
13
|
import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
|
|
14
14
|
const HvCheckBox = forwardRef(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useRef, useEffect } from "react";
|
|
2
|
+
import { forwardRef, useRef, useMemo, useEffect } from "react";
|
|
3
3
|
import { useForkRef } from "@mui/material/utils";
|
|
4
4
|
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
5
5
|
import { DEFAULT_LOCALE, isDate } from "../Calendar/utils.js";
|
|
@@ -14,13 +14,13 @@ import { useClasses } from "./DatePicker.styles.js";
|
|
|
14
14
|
import { staticClasses } from "./DatePicker.styles.js";
|
|
15
15
|
import useVisibleDate from "./useVisibleDate.js";
|
|
16
16
|
import { getDateLabel } from "./utils.js";
|
|
17
|
-
import { HvCalendar } from "../Calendar/Calendar.js";
|
|
18
17
|
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
19
18
|
import { HvBaseDropdown } from "../BaseDropdown/BaseDropdown.js";
|
|
20
|
-
import {
|
|
19
|
+
import { HvCalendar } from "../Calendar/Calendar.js";
|
|
21
20
|
import { isInvalid } from "../FormElement/utils.js";
|
|
22
21
|
import { HvActionBar } from "../ActionBar/ActionBar.js";
|
|
23
22
|
import { HvButton } from "../Button/Button.js";
|
|
23
|
+
import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
|
|
24
24
|
const DEFAULT_LABELS = {
|
|
25
25
|
/** Apply button label. */
|
|
26
26
|
applyLabel: "Apply",
|
|
@@ -92,6 +92,11 @@ const HvDatePicker = forwardRef(
|
|
|
92
92
|
const focusTarget = useRef(null);
|
|
93
93
|
const { ref: refProp, ...otherDropdownProps } = dropdownProps;
|
|
94
94
|
const dropdownForkedRef = useForkRef(ref, refProp);
|
|
95
|
+
const popperProps = useMemo(() => {
|
|
96
|
+
return {
|
|
97
|
+
modifiers: [{ name: "preventOverflow", enabled: escapeWithReference }]
|
|
98
|
+
};
|
|
99
|
+
}, [escapeWithReference]);
|
|
95
100
|
useEffect(() => {
|
|
96
101
|
setStartDate(rangeMode ? startValue : value, true);
|
|
97
102
|
setEndDate(endValue, true);
|
|
@@ -290,11 +295,7 @@ const HvDatePicker = forwardRef(
|
|
|
290
295
|
onContainerCreation: focusOnContainer,
|
|
291
296
|
placeholder: dateString || placeholder || "",
|
|
292
297
|
adornment: /* @__PURE__ */ jsx(HvIcon, { name: "Calendar", className: classes.icon }),
|
|
293
|
-
popperProps
|
|
294
|
-
modifiers: [
|
|
295
|
-
{ name: "preventOverflow", enabled: escapeWithReference }
|
|
296
|
-
]
|
|
297
|
-
},
|
|
298
|
+
popperProps,
|
|
298
299
|
"aria-haspopup": "dialog",
|
|
299
300
|
"aria-label": ariaLabel,
|
|
300
301
|
"aria-labelledby": [label && setId(elementId, "label"), ariaLabelledBy].join(" ").trim() || void 0,
|
|
@@ -12,12 +12,12 @@ import { setId } from "../utils/setId.js";
|
|
|
12
12
|
import { useClasses } from "./Dropdown.styles.js";
|
|
13
13
|
import { staticClasses } from "./Dropdown.styles.js";
|
|
14
14
|
import { getSelectionLabel, getSelected } from "./utils.js";
|
|
15
|
-
import { HvDropdownList } from "./List/List.js";
|
|
16
15
|
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
17
16
|
import { HvBaseDropdown } from "../BaseDropdown/BaseDropdown.js";
|
|
18
|
-
import {
|
|
17
|
+
import { HvDropdownList } from "./List/List.js";
|
|
19
18
|
import { HvTypography } from "../Typography/Typography.js";
|
|
20
19
|
import { isInvalid } from "../FormElement/utils.js";
|
|
20
|
+
import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
|
|
21
21
|
const DEFAULT_LABELS = {
|
|
22
22
|
/** Label for overwrite the default header behavior. */
|
|
23
23
|
select: void 0,
|
|
@@ -6,10 +6,10 @@ import { CounterLabel } from "../../utils/CounterLabel.js";
|
|
|
6
6
|
import { getSelected } from "../utils.js";
|
|
7
7
|
import { useClasses } from "./List.styles.js";
|
|
8
8
|
import { staticClasses } from "./List.styles.js";
|
|
9
|
-
import { HvActionBar } from "../../ActionBar/ActionBar.js";
|
|
10
9
|
import { HvList } from "../../List/List.js";
|
|
11
10
|
import { HvInput } from "../../Input/Input.js";
|
|
12
11
|
import { HvCheckBox } from "../../CheckBox/CheckBox.js";
|
|
12
|
+
import { HvActionBar } from "../../ActionBar/ActionBar.js";
|
|
13
13
|
import { HvButton } from "../../Button/Button.js";
|
|
14
14
|
const clone = (values) => values.map((value) => ({ ...value }));
|
|
15
15
|
const cleanHidden = (lst) => lst.map((item) => ({ ...item, isHidden: false }));
|
|
@@ -3,9 +3,9 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
|
3
3
|
import { useLabels } from "../hooks/useLabels.js";
|
|
4
4
|
import { useClasses } from "./FileUploader.styles.js";
|
|
5
5
|
import { staticClasses } from "./FileUploader.styles.js";
|
|
6
|
+
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
6
7
|
import { HvDropZone } from "./DropZone/DropZone.js";
|
|
7
8
|
import { HvFileList } from "./FileList/FileList.js";
|
|
8
|
-
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
9
9
|
const DEFAULT_LABELS = {
|
|
10
10
|
removeFileButtonLabel: "Remove File"
|
|
11
11
|
};
|
|
@@ -7,10 +7,10 @@ import { HvFilterGroupContext } from "../FilterGroupContext.js";
|
|
|
7
7
|
import { useClasses } from "./FilterContent.styles.js";
|
|
8
8
|
import { staticClasses } from "./FilterContent.styles.js";
|
|
9
9
|
import { HvHeaderButton } from "./HeaderButton.js";
|
|
10
|
-
import { HvFilterGroupLeftPanel } from "../LeftPanel/LeftPanel.js";
|
|
11
|
-
import { HvFilterGroupRightPanel } from "../RightPanel/RightPanel.js";
|
|
12
10
|
import { HvTypography } from "../../Typography/Typography.js";
|
|
13
11
|
import { HvBaseDropdown } from "../../BaseDropdown/BaseDropdown.js";
|
|
12
|
+
import { HvFilterGroupLeftPanel } from "../LeftPanel/LeftPanel.js";
|
|
13
|
+
import { HvFilterGroupRightPanel } from "../RightPanel/RightPanel.js";
|
|
14
14
|
import { HvActionBar } from "../../ActionBar/ActionBar.js";
|
|
15
15
|
import { HvButton } from "../../Button/Button.js";
|
|
16
16
|
import { HvFilterGroupCounter } from "../Counter/Counter.js";
|
|
@@ -9,8 +9,8 @@ import { setId } from "../utils/setId.js";
|
|
|
9
9
|
import { useClasses } from "./FilterGroup.styles.js";
|
|
10
10
|
import { staticClasses } from "./FilterGroup.styles.js";
|
|
11
11
|
import { HvFilterGroupProvider } from "./FilterGroupContext.js";
|
|
12
|
-
import { HvFilterGroupContent } from "./FilterContent/FilterContent.js";
|
|
13
12
|
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
13
|
+
import { HvFilterGroupContent } from "./FilterContent/FilterContent.js";
|
|
14
14
|
import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
|
|
15
15
|
const DEFAULT_LABELS = {
|
|
16
16
|
/** Apply button label. */
|
|
@@ -5,11 +5,11 @@ import { HvIcon } from "../../icons.js";
|
|
|
5
5
|
import { HvFilterGroupContext } from "../FilterGroupContext.js";
|
|
6
6
|
import { useClasses } from "./LeftPanel.styles.js";
|
|
7
7
|
import { staticClasses } from "./LeftPanel.styles.js";
|
|
8
|
-
import { HvFilterGroupCounter } from "../Counter/Counter.js";
|
|
9
8
|
import { HvPanel } from "../../Panel/Panel.js";
|
|
10
9
|
import { HvListContainer } from "../../ListContainer/ListContainer.js";
|
|
11
|
-
import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
|
|
12
10
|
import { HvOverflowTooltip } from "../../OverflowTooltip/OverflowTooltip.js";
|
|
11
|
+
import { HvFilterGroupCounter } from "../Counter/Counter.js";
|
|
12
|
+
import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
|
|
13
13
|
const HvFilterGroupLeftPanel = ({
|
|
14
14
|
className,
|
|
15
15
|
emptyElement,
|
package/dist/Input/Input.js
CHANGED
|
@@ -18,10 +18,10 @@ import { useClasses } from "./Input.styles.js";
|
|
|
18
18
|
import { staticClasses } from "./Input.styles.js";
|
|
19
19
|
import { changeInputValue } from "./utils.js";
|
|
20
20
|
import { HvAdornment } from "../FormElement/Adornment/Adornment.js";
|
|
21
|
-
import { isValid, isInvalid } from "../FormElement/utils.js";
|
|
22
|
-
import { HvBaseInput } from "../BaseInput/BaseInput.js";
|
|
23
21
|
import { HvTooltip } from "../Tooltip/Tooltip.js";
|
|
22
|
+
import { isValid, isInvalid } from "../FormElement/utils.js";
|
|
24
23
|
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
24
|
+
import { HvBaseInput } from "../BaseInput/BaseInput.js";
|
|
25
25
|
import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
|
|
26
26
|
import { HvInfoMessage } from "../FormElement/InfoMessage/InfoMessage.js";
|
|
27
27
|
const DEFAULT_LABELS = {
|
package/dist/List/List.js
CHANGED
|
@@ -8,12 +8,12 @@ import { useClasses } from "./List.styles.js";
|
|
|
8
8
|
import { staticClasses } from "./List.styles.js";
|
|
9
9
|
import { useSelectableList } from "./useSelectableList.js";
|
|
10
10
|
import { parseList } from "./utils.js";
|
|
11
|
+
import { HvListContainer } from "../ListContainer/ListContainer.js";
|
|
11
12
|
import { HvCheckBox } from "../CheckBox/CheckBox.js";
|
|
12
13
|
import { HvRadio } from "../Radio/Radio.js";
|
|
13
14
|
import { HvOverflowTooltip } from "../OverflowTooltip/OverflowTooltip.js";
|
|
14
|
-
import { HvListContainer } from "../ListContainer/ListContainer.js";
|
|
15
|
-
import { HvListItem } from "../ListContainer/ListItem/ListItem.js";
|
|
16
15
|
import { HvTypography } from "../Typography/Typography.js";
|
|
16
|
+
import { HvListItem } from "../ListContainer/ListItem/ListItem.js";
|
|
17
17
|
const DEFAULT_LABELS = {
|
|
18
18
|
/** The label used in the middle of the multi-selection count. */
|
|
19
19
|
selectionConjunction: "/"
|
|
@@ -5,8 +5,8 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
|
5
5
|
import { HvIcon } from "../icons.js";
|
|
6
6
|
import { changeInputValue } from "../Input/utils.js";
|
|
7
7
|
import { useClasses } from "./NumberInput.styles.js";
|
|
8
|
-
import { HvAdornment } from "../FormElement/Adornment/Adornment.js";
|
|
9
8
|
import { HvInput } from "../Input/Input.js";
|
|
9
|
+
import { HvAdornment } from "../FormElement/Adornment/Adornment.js";
|
|
10
10
|
const HvNumberInput = forwardRef(function HvNumberInput2(props, ref) {
|
|
11
11
|
const {
|
|
12
12
|
classes: classesProp,
|
|
@@ -4,10 +4,10 @@ import { HvIcon } from "../icons.js";
|
|
|
4
4
|
import { useQueryBuilderContext } from "./Context.js";
|
|
5
5
|
import { useClasses } from "./QueryBuilder.styles.js";
|
|
6
6
|
import { Rule } from "./Rule/Rule.js";
|
|
7
|
-
import { HvEmptyState } from "../EmptyState/EmptyState.js";
|
|
8
7
|
import { HvButton } from "../Button/Button.js";
|
|
9
8
|
import { HvMultiButton } from "../MultiButton/MultiButton.js";
|
|
10
9
|
import { HvIconButton } from "../IconButton/IconButton.js";
|
|
10
|
+
import { HvEmptyState } from "../EmptyState/EmptyState.js";
|
|
11
11
|
import { HvTypography } from "../Typography/Typography.js";
|
|
12
12
|
const RuleGroup = ({
|
|
13
13
|
level = 0,
|
package/dist/Radio/Radio.js
CHANGED
|
@@ -8,9 +8,9 @@ import { useClasses } from "./Radio.styles.js";
|
|
|
8
8
|
import { staticClasses } from "./Radio.styles.js";
|
|
9
9
|
import { HvBaseRadio } from "../BaseRadio/BaseRadio.js";
|
|
10
10
|
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
11
|
+
import { isInvalid } from "../FormElement/utils.js";
|
|
11
12
|
import { HvLabel } from "../FormElement/Label/Label.js";
|
|
12
13
|
import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
|
|
13
|
-
import { isInvalid } from "../FormElement/utils.js";
|
|
14
14
|
const HvRadio = forwardRef(
|
|
15
15
|
function HvRadio2(props, ref) {
|
|
16
16
|
const {
|
package/dist/Section/Section.js
CHANGED
|
@@ -40,7 +40,7 @@ const HvSection = forwardRef(
|
|
|
40
40
|
}),
|
|
41
41
|
...others,
|
|
42
42
|
children: [
|
|
43
|
-
hasHeader && // eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
43
|
+
hasHeader && // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
44
44
|
/* @__PURE__ */ jsxs(
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
@@ -9,9 +9,9 @@ import { multiSelectionEventHandler } from "../utils/multiSelectionEventHandler.
|
|
|
9
9
|
import { setId } from "../utils/setId.js";
|
|
10
10
|
import { useClasses } from "./SelectionList.styles.js";
|
|
11
11
|
import { staticClasses } from "./SelectionList.styles.js";
|
|
12
|
+
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
12
13
|
import { HvLabel } from "../FormElement/Label/Label.js";
|
|
13
14
|
import { HvInfoMessage } from "../FormElement/InfoMessage/InfoMessage.js";
|
|
14
|
-
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
15
15
|
import { HvListContainer } from "../ListContainer/ListContainer.js";
|
|
16
16
|
import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
|
|
17
17
|
const getValueFromSelectedChildren = (children, multiple) => {
|
package/dist/Switch/Switch.js
CHANGED
|
@@ -6,11 +6,11 @@ import { useUniqueId } from "../hooks/useUniqueId.js";
|
|
|
6
6
|
import { setId } from "../utils/setId.js";
|
|
7
7
|
import { useClasses } from "./Switch.styles.js";
|
|
8
8
|
import { staticClasses } from "./Switch.styles.js";
|
|
9
|
-
import { HvBaseSwitch } from "../BaseSwitch/BaseSwitch.js";
|
|
10
9
|
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
10
|
+
import { HvBaseSwitch } from "../BaseSwitch/BaseSwitch.js";
|
|
11
|
+
import { isInvalid } from "../FormElement/utils.js";
|
|
11
12
|
import { HvLabel } from "../FormElement/Label/Label.js";
|
|
12
13
|
import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
|
|
13
|
-
import { isInvalid } from "../FormElement/utils.js";
|
|
14
14
|
const HvSwitch = forwardRef(
|
|
15
15
|
function HvSwitch2(props, ref) {
|
|
16
16
|
const {
|
|
@@ -6,9 +6,9 @@ import { HvDateColumnCell } from "./DateColumnCell.js";
|
|
|
6
6
|
import { HvDropdownColumnCell } from "./DropdownColumnCell.js";
|
|
7
7
|
import { HvProgressColumnCell } from "./ProgressColumnCell.js";
|
|
8
8
|
import { HvSwitchColumnCell } from "./SwitchColumnCell.js";
|
|
9
|
-
import { HvTag } from "../../Tag/Tag.js";
|
|
10
9
|
import { HvButton } from "../../Button/Button.js";
|
|
11
10
|
import { HvOverflowTooltip } from "../../OverflowTooltip/OverflowTooltip.js";
|
|
11
|
+
import { HvTag } from "../../Tag/Tag.js";
|
|
12
12
|
const EM_DASH = "—";
|
|
13
13
|
const hvStringFallback = (value) => {
|
|
14
14
|
return typeof value === "string" && value !== "" ? value : EM_DASH;
|
|
@@ -13,8 +13,8 @@ import { isKey } from "../utils/keyboardUtils.js";
|
|
|
13
13
|
import { setId } from "../utils/setId.js";
|
|
14
14
|
import { useClasses } from "./TagsInput.styles.js";
|
|
15
15
|
import { staticClasses } from "./TagsInput.styles.js";
|
|
16
|
-
import { HvCharCounter } from "../FormElement/CharCounter/CharCounter.js";
|
|
17
16
|
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
17
|
+
import { HvCharCounter } from "../FormElement/CharCounter/CharCounter.js";
|
|
18
18
|
import { HvTag } from "../Tag/Tag.js";
|
|
19
19
|
import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
|
|
20
20
|
const HvTagsInput = forwardRef(
|
|
@@ -10,11 +10,11 @@ import { setId } from "../utils/setId.js";
|
|
|
10
10
|
import { useClasses } from "./TextArea.styles.js";
|
|
11
11
|
import { staticClasses } from "./TextArea.styles.js";
|
|
12
12
|
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
13
|
-
import { HvCharCounter } from "../FormElement/CharCounter/CharCounter.js";
|
|
14
13
|
import { HvBaseInput } from "../BaseInput/BaseInput.js";
|
|
14
|
+
import { isInvalid } from "../FormElement/utils.js";
|
|
15
|
+
import { HvCharCounter } from "../FormElement/CharCounter/CharCounter.js";
|
|
15
16
|
import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
|
|
16
17
|
import { HvInfoMessage } from "../FormElement/InfoMessage/InfoMessage.js";
|
|
17
|
-
import { isInvalid } from "../FormElement/utils.js";
|
|
18
18
|
const HvTextArea = forwardRef(function HvTextArea2(props, ref) {
|
|
19
19
|
const {
|
|
20
20
|
id,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useRef } from "react";
|
|
3
|
-
import { useDateSegment } from "
|
|
3
|
+
import { useDateSegment } from "react-aria/useDateField";
|
|
4
4
|
const getDateValue = (date) => {
|
|
5
5
|
if (!date) return "";
|
|
6
6
|
const { hour, minute, second } = date;
|
|
@@ -9,45 +9,50 @@ const getDateValue = (date) => {
|
|
|
9
9
|
const PlaceholderSegment = ({
|
|
10
10
|
segment,
|
|
11
11
|
state,
|
|
12
|
-
|
|
12
|
+
value
|
|
13
13
|
}) => {
|
|
14
14
|
const ref = useRef(null);
|
|
15
15
|
const { segmentProps } = useDateSegment(segment, state, ref);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (segment.isPlaceholder) return placeholder ?? segment.text;
|
|
19
|
-
return segment.text.padStart(2, "0");
|
|
20
|
-
})() });
|
|
16
|
+
if (segment.type === "literal" && segment.text === "") return;
|
|
17
|
+
return /* @__PURE__ */ jsx("div", { ref, ...segmentProps, children: value });
|
|
21
18
|
};
|
|
22
19
|
const Placeholder = forwardRef(
|
|
23
20
|
function Placeholder2(props, ref) {
|
|
24
21
|
const { name, state, placeholders, onKeyDown, ...others } = props;
|
|
25
22
|
const { value, segments } = state;
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onKeyDown
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
23
|
+
return (
|
|
24
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
25
|
+
/* @__PURE__ */ jsxs(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
ref,
|
|
29
|
+
onKeyDown: (event) => {
|
|
30
|
+
event.stopPropagation();
|
|
31
|
+
onKeyDown?.(event);
|
|
32
|
+
},
|
|
33
|
+
...others,
|
|
34
|
+
children: [
|
|
35
|
+
name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: getDateValue(value) }),
|
|
36
|
+
segments.map((segment, i) => /* @__PURE__ */ jsx(
|
|
37
|
+
PlaceholderSegment,
|
|
38
|
+
{
|
|
39
|
+
segment,
|
|
40
|
+
state,
|
|
41
|
+
value: renderSegment(segment, placeholders[segment.type])
|
|
42
|
+
},
|
|
43
|
+
segment.type === "literal" ? `literal-${i}` : segment.type
|
|
44
|
+
))
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
|
+
function renderSegment(segment, placeholder) {
|
|
52
|
+
if (segment.type === "literal") return segment.text;
|
|
53
|
+
if (segment.isPlaceholder) return placeholder ?? segment.text;
|
|
54
|
+
return segment.text.padStart(2, "0");
|
|
55
|
+
}
|
|
51
56
|
export {
|
|
52
57
|
Placeholder
|
|
53
58
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useRef,
|
|
2
|
+
import { forwardRef, useRef, useMemo, useState } from "react";
|
|
3
|
+
import { useTimeField } from "react-aria/useTimeField";
|
|
4
|
+
import { useTimeFieldState } from "react-stately/useTimeFieldState";
|
|
3
5
|
import { Time } from "@internationalized/date";
|
|
4
|
-
import
|
|
5
|
-
import { useTimeField } from "@react-aria/datepicker";
|
|
6
|
-
import { useTimeFieldState } from "@react-stately/datepicker";
|
|
6
|
+
import useForkRef from "@mui/utils/useForkRef";
|
|
7
7
|
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
8
8
|
import { DEFAULT_LOCALE } from "../Calendar/utils.js";
|
|
9
9
|
import { HvLabelContainer } from "../FormElement/LabelContainer.js";
|
|
@@ -14,9 +14,9 @@ import { setId } from "../utils/setId.js";
|
|
|
14
14
|
import { Placeholder } from "./Placeholder.js";
|
|
15
15
|
import { useClasses } from "./TimePicker.styles.js";
|
|
16
16
|
import { staticClasses } from "./TimePicker.styles.js";
|
|
17
|
-
import { Unit } from "./Unit/Unit.js";
|
|
18
17
|
import { HvFormElement } from "../FormElement/FormElement.js";
|
|
19
18
|
import { HvBaseDropdown } from "../BaseDropdown/BaseDropdown.js";
|
|
19
|
+
import { Unit } from "./Unit/Unit.js";
|
|
20
20
|
import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
|
|
21
21
|
const toTime = (value) => {
|
|
22
22
|
if (!value) return value;
|
|
@@ -64,8 +64,9 @@ const HvTimePicker = forwardRef(
|
|
|
64
64
|
const timeFieldRef = useRef(null);
|
|
65
65
|
const { ref: refProp, ...otherDropdownProps } = dropdownProps;
|
|
66
66
|
const dropdownForkedRef = useForkRef(ref, refProp);
|
|
67
|
+
const valueState = useMemo(() => toTime(valueProp), [valueProp]);
|
|
67
68
|
const stateProps = {
|
|
68
|
-
value:
|
|
69
|
+
value: valueState,
|
|
69
70
|
defaultValue: toTime(defaultValueProp),
|
|
70
71
|
label,
|
|
71
72
|
locale,
|
|
@@ -92,6 +93,11 @@ const HvTimePicker = forwardRef(
|
|
|
92
93
|
state,
|
|
93
94
|
timeFieldRef
|
|
94
95
|
);
|
|
96
|
+
const popperProps = useMemo(() => {
|
|
97
|
+
return {
|
|
98
|
+
modifiers: [{ name: "preventOverflow", enabled: escapeWithReference }]
|
|
99
|
+
};
|
|
100
|
+
}, [escapeWithReference]);
|
|
95
101
|
const [open, setOpen] = useState(false);
|
|
96
102
|
const [validationMessage] = useControlled(statusMessage, "Required");
|
|
97
103
|
const [validationState] = useControlled(status, "standBy");
|
|
@@ -176,13 +182,9 @@ const HvTimePicker = forwardRef(
|
|
|
176
182
|
"aria-invalid": isStateInvalid ? true : void 0,
|
|
177
183
|
"aria-errormessage": errorMessageId,
|
|
178
184
|
disablePortal,
|
|
179
|
-
popperProps
|
|
180
|
-
modifiers: [
|
|
181
|
-
{ name: "preventOverflow", enabled: escapeWithReference }
|
|
182
|
-
]
|
|
183
|
-
},
|
|
185
|
+
popperProps,
|
|
184
186
|
...otherDropdownProps,
|
|
185
|
-
children: /* @__PURE__ */ jsx("div", { ref: timeFieldRef, className: classes.timePopperContainer, children: state.segments.map((segment) => /* @__PURE__ */ jsx(
|
|
187
|
+
children: /* @__PURE__ */ jsx("div", { ref: timeFieldRef, className: classes.timePopperContainer, children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(
|
|
186
188
|
Unit,
|
|
187
189
|
{
|
|
188
190
|
state,
|
|
@@ -194,7 +196,7 @@ const HvTimePicker = forwardRef(
|
|
|
194
196
|
state.setSegment(segment.type, Number(val));
|
|
195
197
|
}
|
|
196
198
|
},
|
|
197
|
-
segment.type
|
|
199
|
+
segment.type === "literal" ? `literal-${i}` : segment.type
|
|
198
200
|
)) })
|
|
199
201
|
}
|
|
200
202
|
),
|
|
@@ -4,9 +4,9 @@ import { HvIcon } from "../../icons.js";
|
|
|
4
4
|
import { useClasses } from "./NavigationSlider.styles.js";
|
|
5
5
|
import { staticClasses } from "./NavigationSlider.styles.js";
|
|
6
6
|
import { HvListContainer } from "../../ListContainer/ListContainer.js";
|
|
7
|
-
import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
|
|
8
7
|
import { HvOverflowTooltip } from "../../OverflowTooltip/OverflowTooltip.js";
|
|
9
8
|
import { HvButton } from "../../Button/Button.js";
|
|
9
|
+
import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
|
|
10
10
|
const HvVerticalNavigationSlider = (props) => {
|
|
11
11
|
const {
|
|
12
12
|
className,
|
package/dist/utils/Callout.js
CHANGED
|
@@ -6,8 +6,8 @@ import { theme } from "@hitachivantara/uikit-styles";
|
|
|
6
6
|
import { HvIcon } from "../icons.js";
|
|
7
7
|
import { iconVariant } from "./iconVariant.js";
|
|
8
8
|
import { HvActionsGeneric } from "../ActionsGeneric/ActionsGeneric.js";
|
|
9
|
-
import { HvStatusIcon } from "../StatusIcon/StatusIcon.js";
|
|
10
9
|
import { HvButton } from "../Button/Button.js";
|
|
10
|
+
import { HvStatusIcon } from "../StatusIcon/StatusIcon.js";
|
|
11
11
|
const { useClasses } = createClasses("HvCallout", {
|
|
12
12
|
root: {
|
|
13
13
|
position: "relative",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/uikit-react-core",
|
|
3
|
-
"version": "6.8.
|
|
3
|
+
"version": "6.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Hitachi Vantara UI Kit Team",
|
|
@@ -39,8 +39,6 @@
|
|
|
39
39
|
"@internationalized/date": "^3.2.0",
|
|
40
40
|
"@mui/base": "7.0.0-beta.4",
|
|
41
41
|
"@popperjs/core": "^2.11.8",
|
|
42
|
-
"@react-aria/datepicker": "^3.9.0",
|
|
43
|
-
"@react-stately/datepicker": "^3.9.0",
|
|
44
42
|
"@types/react-table": "^7.7.18",
|
|
45
43
|
"@uiw/react-color-hue": "^2.9.2",
|
|
46
44
|
"@uiw/react-color-saturation": "^2.9.2",
|
|
@@ -49,8 +47,10 @@
|
|
|
49
47
|
"notistack": "^3.0.2",
|
|
50
48
|
"rc-slider": "^10.5.0",
|
|
51
49
|
"rc-tooltip": "~6.3.0",
|
|
50
|
+
"react-aria": "^3.48.0",
|
|
52
51
|
"react-popper": "^2.3.0",
|
|
53
52
|
"react-resize-detector": "^12.3.0",
|
|
53
|
+
"react-stately": "^3.46.0",
|
|
54
54
|
"react-table": "^7.8.0",
|
|
55
55
|
"react-window": "^1.8.10"
|
|
56
56
|
},
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"access": "public",
|
|
62
62
|
"directory": "package"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "b9034f709fcfa749a28a52ed31dab060455493d6",
|
|
65
65
|
"exports": {
|
|
66
66
|
".": {
|
|
67
67
|
"types": "./dist/index.d.ts",
|