@hitachivantara/uikit-react-core 5.87.2 → 5.88.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/ActionsGeneric/ActionsGeneric.cjs +1 -1
- package/dist/cjs/Banner/BannerContent/BannerContent.cjs +1 -1
- package/dist/cjs/BaseInput/BaseInput.cjs +44 -83
- package/dist/cjs/BaseInput/BaseInput.styles.cjs +68 -142
- package/dist/cjs/BaseInput/validations.cjs +2 -1
- package/dist/cjs/Calendar/CalendarHeader/CalendarHeader.cjs +0 -6
- package/dist/cjs/Calendar/CalendarHeader/CalendarHeader.styles.cjs +1 -5
- package/dist/cjs/ColorPicker/ColorPicker.cjs +1 -1
- package/dist/cjs/DatePicker/DatePicker.cjs +12 -12
- package/dist/cjs/Dropdown/Dropdown.cjs +8 -10
- package/dist/cjs/FilterGroup/FilterContent/FilterContent.cjs +1 -1
- package/dist/cjs/FormElement/Adornment/Adornment.cjs +15 -36
- package/dist/cjs/FormElement/Adornment/Adornment.styles.cjs +11 -17
- package/dist/cjs/InlineEditor/InlineEditor.cjs +10 -14
- package/dist/cjs/InlineEditor/InlineEditor.styles.cjs +13 -36
- package/dist/cjs/Input/Input.cjs +33 -56
- package/dist/cjs/Input/Input.styles.cjs +6 -19
- package/dist/cjs/List/List.cjs +12 -12
- package/dist/cjs/Pagination/Pagination.styles.cjs +2 -1
- package/dist/cjs/Pagination/Select.cjs +1 -1
- package/dist/cjs/Select/Select.styles.cjs +1 -1
- package/dist/cjs/Table/TableBody/TableBody.cjs +16 -17
- package/dist/cjs/TableSection/TableSection.styles.cjs +10 -10
- package/dist/cjs/Tag/Tag.cjs +1 -1
- package/dist/cjs/TagsInput/TagsInput.cjs +103 -169
- package/dist/cjs/TagsInput/TagsInput.styles.cjs +45 -111
- package/dist/cjs/TextArea/TextArea.cjs +1 -3
- package/dist/cjs/TextArea/TextArea.styles.cjs +1 -1
- package/dist/cjs/TimePicker/TimePicker.cjs +5 -4
- package/dist/cjs/TimePicker/Unit/Unit.cjs +0 -1
- package/dist/cjs/TimePicker/Unit/Unit.styles.cjs +0 -3
- package/dist/cjs/hooks/useFocus.cjs +38 -0
- package/dist/cjs/utils/CounterLabel.cjs +3 -2
- package/dist/cjs/utils/focusUtils.cjs +0 -4
- package/dist/esm/ActionsGeneric/ActionsGeneric.js +1 -1
- package/dist/esm/AvatarGroup/AvatarGroupContext.js +1 -1
- package/dist/esm/Banner/BannerContent/BannerContent.js +1 -1
- package/dist/esm/BaseCheckBox/BaseCheckBox.js +1 -1
- package/dist/esm/BaseDropdown/BaseDropdown.js +3 -3
- package/dist/esm/BaseInput/BaseInput.js +45 -84
- package/dist/esm/BaseInput/BaseInput.js.map +1 -1
- package/dist/esm/BaseInput/BaseInput.styles.js +68 -142
- package/dist/esm/BaseInput/BaseInput.styles.js.map +1 -1
- package/dist/esm/BaseInput/validations.js +2 -1
- package/dist/esm/BaseInput/validations.js.map +1 -1
- package/dist/esm/BaseRadio/BaseRadio.js +1 -1
- package/dist/esm/Button/Button.js +1 -1
- package/dist/esm/Calendar/CalendarHeader/CalendarHeader.js +1 -7
- package/dist/esm/Calendar/CalendarHeader/CalendarHeader.js.map +1 -1
- package/dist/esm/Calendar/CalendarHeader/CalendarHeader.styles.js +1 -5
- package/dist/esm/Calendar/CalendarHeader/CalendarHeader.styles.js.map +1 -1
- package/dist/esm/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
- package/dist/esm/ColorPicker/ColorPicker.js +1 -1
- package/dist/esm/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/esm/ColorPicker/Fields/Fields.js.map +1 -1
- package/dist/esm/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/DatePicker/utils.js +1 -1
- package/dist/esm/Dialog/context.js +1 -1
- package/dist/esm/DotPagination/DotPagination.js +1 -1
- package/dist/esm/Dropdown/Dropdown.js +8 -10
- package/dist/esm/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/DropdownButton/DropdownButton.js.map +1 -1
- package/dist/esm/FilterGroup/FilterContent/FilterContent.js +1 -1
- package/dist/esm/FilterGroup/FilterContent/FilterContent.js.map +1 -1
- package/dist/esm/FilterGroup/FilterGroupContext.js +1 -1
- package/dist/esm/FilterGroup/RightPanel/RightPanel.js.map +1 -1
- package/dist/esm/Focus/Focus.js +1 -1
- package/dist/esm/FormElement/Adornment/Adornment.js +15 -36
- package/dist/esm/FormElement/Adornment/Adornment.js.map +1 -1
- package/dist/esm/FormElement/Adornment/Adornment.styles.js +11 -17
- package/dist/esm/FormElement/Adornment/Adornment.styles.js.map +1 -1
- package/dist/esm/Header/Navigation/useSelectionPath.js.map +1 -1
- package/dist/esm/InlineEditor/InlineEditor.js +10 -14
- package/dist/esm/InlineEditor/InlineEditor.js.map +1 -1
- package/dist/esm/InlineEditor/InlineEditor.styles.js +13 -36
- package/dist/esm/InlineEditor/InlineEditor.styles.js.map +1 -1
- package/dist/esm/Input/Input.js +34 -57
- package/dist/esm/Input/Input.js.map +1 -1
- package/dist/esm/Input/Input.styles.js +6 -19
- package/dist/esm/Input/Input.styles.js.map +1 -1
- package/dist/esm/List/List.js +12 -12
- package/dist/esm/List/List.js.map +1 -1
- package/dist/esm/Pagination/Pagination.styles.js +5 -4
- package/dist/esm/Pagination/Pagination.styles.js.map +1 -1
- package/dist/esm/Pagination/Select.js +1 -1
- package/dist/esm/QueryBuilder/Context.js +1 -1
- package/dist/esm/QueryBuilder/QueryBuilder.js +1 -1
- package/dist/esm/QueryBuilder/utils/index.js +1 -1
- package/dist/esm/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/Select/Select.styles.js +1 -1
- package/dist/esm/Select/Select.styles.js.map +1 -1
- package/dist/esm/SelectionList/SelectionList.js.map +1 -1
- package/dist/esm/Slider/Slider.js +1 -1
- package/dist/esm/Slider/Slider.js.map +1 -1
- package/dist/esm/SnackbarProvider/SnackbarProvider.js +2 -2
- package/dist/esm/Table/TableBody/TableBody.js +16 -17
- package/dist/esm/Table/TableBody/TableBody.js.map +1 -1
- package/dist/esm/TableSection/TableSection.styles.js +24 -24
- package/dist/esm/Tag/Tag.js +1 -1
- package/dist/esm/Tag/Tag.js.map +1 -1
- package/dist/esm/TagsInput/TagsInput.js +103 -169
- package/dist/esm/TagsInput/TagsInput.js.map +1 -1
- package/dist/esm/TagsInput/TagsInput.styles.js +45 -111
- package/dist/esm/TagsInput/TagsInput.styles.js.map +1 -1
- package/dist/esm/TextArea/TextArea.js +1 -3
- package/dist/esm/TextArea/TextArea.js.map +1 -1
- package/dist/esm/TextArea/TextArea.styles.js +1 -1
- package/dist/esm/TextArea/TextArea.styles.js.map +1 -1
- package/dist/esm/TimePicker/TimePicker.js +1 -0
- package/dist/esm/TimePicker/TimePicker.js.map +1 -1
- package/dist/esm/TimePicker/Unit/Unit.js +0 -1
- package/dist/esm/TimePicker/Unit/Unit.js.map +1 -1
- package/dist/esm/TimePicker/Unit/Unit.styles.js +0 -3
- package/dist/esm/TimePicker/Unit/Unit.styles.js.map +1 -1
- package/dist/esm/TreeView/internals/TreeViewProvider.js +1 -1
- package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewKeyboardNavigation.js +1 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
- package/dist/esm/hooks/useFocus.js +38 -0
- package/dist/esm/hooks/useFocus.js.map +1 -0
- package/dist/esm/hooks/useScrollTo.js.map +1 -1
- package/dist/esm/utils/CounterLabel.js +3 -2
- package/dist/esm/utils/CounterLabel.js.map +1 -1
- package/dist/esm/utils/document.js.map +1 -1
- package/dist/esm/utils/focusUtils.js +0 -4
- package/dist/esm/utils/focusUtils.js.map +1 -1
- package/dist/types/index.d.ts +213 -274
- package/package.json +8 -8
|
@@ -2,45 +2,30 @@
|
|
|
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
|
|
6
|
-
const Suggestions_styles = require("../FormElement/Suggestions/Suggestions.styles.cjs");
|
|
5
|
+
const focusUtils = require("../utils/focusUtils.cjs");
|
|
7
6
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTagsInput", {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
listItemGutters: { padding: "0 5px" },
|
|
13
|
-
listItemRoot: {
|
|
14
|
-
marginBottom: 2,
|
|
15
|
-
height: 24,
|
|
16
|
-
lineHeight: "24px",
|
|
17
|
-
"&:not(:last-child)": {
|
|
18
|
-
marginBottom: 2
|
|
19
|
-
},
|
|
20
|
-
"&$singleLine": {
|
|
21
|
-
display: "table-cell",
|
|
22
|
-
paddingTop: "2px"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
7
|
+
/** @deprecated unused */
|
|
8
|
+
listItemGutters: {},
|
|
9
|
+
/** @deprecated use `chipRoot` */
|
|
10
|
+
listItemRoot: {},
|
|
25
11
|
root: { display: "inline-block", width: "100%" },
|
|
12
|
+
// TODO: consider renaming this
|
|
26
13
|
chipRoot: {
|
|
27
14
|
maxWidth: "none"
|
|
28
15
|
},
|
|
29
16
|
disabled: {
|
|
30
17
|
"& $tagsList": {
|
|
31
18
|
backgroundColor: uikitStyles.theme.colors.atmo2,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
border: `1px solid ${uikitStyles.theme.colors.atmo4}`
|
|
19
|
+
"&,:hover": {
|
|
20
|
+
borderColor: uikitStyles.theme.colors.atmo4
|
|
35
21
|
}
|
|
36
22
|
}
|
|
37
23
|
},
|
|
38
24
|
readOnly: {
|
|
39
25
|
"& $tagsList": {
|
|
40
26
|
backgroundColor: uikitStyles.theme.colors.atmo2,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
border: `1px solid ${uikitStyles.theme.colors.secondary_60}`
|
|
27
|
+
"&,:hover": {
|
|
28
|
+
borderColor: uikitStyles.theme.colors.secondary_60
|
|
44
29
|
}
|
|
45
30
|
}
|
|
46
31
|
},
|
|
@@ -57,118 +42,67 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTagsInput
|
|
|
57
42
|
},
|
|
58
43
|
tagsList: {
|
|
59
44
|
display: "flex",
|
|
45
|
+
alignItems: "center",
|
|
60
46
|
alignContent: "flex-start",
|
|
61
|
-
|
|
62
|
-
|
|
47
|
+
gap: uikitStyles.theme.spacing("xxs", "xs"),
|
|
48
|
+
cursor: "text",
|
|
63
49
|
width: "100%",
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
padding: 5,
|
|
50
|
+
minHeight: 32,
|
|
51
|
+
padding: uikitStyles.theme.spacing("xxs", "xs"),
|
|
67
52
|
overflow: "auto",
|
|
68
53
|
position: "relative",
|
|
69
54
|
flexDirection: "row",
|
|
70
55
|
flexWrap: "wrap",
|
|
71
56
|
backgroundColor: uikitStyles.theme.colors.atmo1,
|
|
72
|
-
|
|
57
|
+
borderWidth: 1,
|
|
58
|
+
borderColor: uikitStyles.theme.colors.secondary_80,
|
|
73
59
|
borderRadius: uikitStyles.theme.radii.base,
|
|
74
60
|
"&:hover": {
|
|
75
|
-
|
|
76
|
-
border: `1px solid ${uikitStyles.theme.colors.primary}`
|
|
61
|
+
borderColor: uikitStyles.theme.colors.primary
|
|
77
62
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
"&:focus, &:focus-within, &:focus-visible": {
|
|
82
|
-
outlineColor: "#52A8EC",
|
|
83
|
-
outlineStyle: "solid",
|
|
84
|
-
outlineWidth: "0px",
|
|
85
|
-
outlineOffset: "-1px",
|
|
86
|
-
boxShadow: "0 0 0 1px #52A8EC, 0 0 0 4px rgba(29,155,209,.3)"
|
|
63
|
+
"&:focus-within, &:focus-visible": {
|
|
64
|
+
...focusUtils.outlineStyles
|
|
87
65
|
},
|
|
88
66
|
"&$singleLine": {
|
|
89
|
-
|
|
90
|
-
overflowY: "hidden",
|
|
91
|
-
height: 32,
|
|
92
|
-
display: "table-row",
|
|
93
|
-
paddingTop: 0
|
|
67
|
+
flexWrap: "nowrap"
|
|
94
68
|
},
|
|
95
69
|
"&$error": {
|
|
96
|
-
|
|
70
|
+
borderColor: uikitStyles.theme.colors.negative_120
|
|
97
71
|
},
|
|
98
72
|
"&$invalid": {
|
|
99
|
-
|
|
73
|
+
borderColor: uikitStyles.theme.colors.negative_120
|
|
100
74
|
}
|
|
101
75
|
},
|
|
102
|
-
|
|
76
|
+
/** @deprecated use `classes.input` instead */
|
|
77
|
+
tagInputContainerRoot: {},
|
|
78
|
+
/** @deprecated use `classes.input` instead */
|
|
79
|
+
tagInputRoot: {},
|
|
80
|
+
input: {
|
|
103
81
|
display: "flex",
|
|
104
|
-
|
|
105
|
-
height:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
tagInputRoot: {
|
|
116
|
-
[`& .${BaseInput_styles.staticClasses.root}`]: {
|
|
117
|
-
width: "100%",
|
|
118
|
-
border: "none",
|
|
119
|
-
"&:hover $tagInputBorderContainer": {
|
|
120
|
-
background: "none"
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
[`&& .${BaseInput_styles.staticClasses.inputRoot}`]: {
|
|
124
|
-
marginLeft: 0,
|
|
125
|
-
marginRight: 0,
|
|
126
|
-
flex: "1 1 auto",
|
|
127
|
-
height: 24,
|
|
128
|
-
lineHeight: "24px",
|
|
129
|
-
padding: 0,
|
|
130
|
-
border: "none"
|
|
131
|
-
},
|
|
132
|
-
[`& .${BaseInput_styles.staticClasses.inputBorderContainer}`]: {
|
|
133
|
-
border: "none",
|
|
134
|
-
background: "none"
|
|
135
|
-
},
|
|
136
|
-
[`& .${BaseInput_styles.staticClasses.inputRootFocused}`]: {
|
|
137
|
-
outline: "none",
|
|
138
|
-
boxShadow: "none"
|
|
139
|
-
},
|
|
140
|
-
[`& .${BaseInput_styles.staticClasses.root} .${BaseInput_styles.staticClasses.inputRootReadOnly}`]: {
|
|
141
|
-
backgroundColor: "transparent",
|
|
142
|
-
border: "none",
|
|
143
|
-
"&:hover": {
|
|
144
|
-
border: "none"
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
[`&& .${BaseInput_styles.staticClasses.input}`]: {
|
|
148
|
-
marginLeft: 0
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
tagSelected: {
|
|
152
|
-
outlineColor: "#52A8EC",
|
|
153
|
-
outlineStyle: "solid",
|
|
154
|
-
outlineWidth: "0px",
|
|
155
|
-
outlineOffset: "-1px",
|
|
156
|
-
boxShadow: "0 0 0 1px #52A8EC, 0 0 0 4px rgba(29,155,209,.3)"
|
|
82
|
+
flex: "1 0 auto",
|
|
83
|
+
height: "auto",
|
|
84
|
+
width: 0,
|
|
85
|
+
minWidth: 60,
|
|
86
|
+
border: "none",
|
|
87
|
+
margin: 0,
|
|
88
|
+
padding: 0,
|
|
89
|
+
...uikitStyles.theme.typography.caption1,
|
|
90
|
+
backgroundColor: "transparent",
|
|
91
|
+
outline: "none",
|
|
92
|
+
boxShadow: "none"
|
|
157
93
|
},
|
|
94
|
+
/** @deprecated unused. use `:focus` or `:focus-visible` instead */
|
|
95
|
+
tagSelected: {},
|
|
96
|
+
/** @deprecated unused. use `::after` instead */
|
|
158
97
|
tagInputBorderContainer: {},
|
|
98
|
+
/** @deprecated unused. use `:focus` or `:focus-visible` instead */
|
|
159
99
|
tagInputRootFocused: {},
|
|
100
|
+
/** @deprecated unused */
|
|
160
101
|
tagInputRootEmpty: {},
|
|
161
102
|
singleLine: {},
|
|
162
103
|
error: { float: "left" },
|
|
163
104
|
inputExtension: {},
|
|
164
|
-
suggestionsContainer: {
|
|
165
|
-
width: "100%",
|
|
166
|
-
position: "relative",
|
|
167
|
-
top: 59,
|
|
168
|
-
[`& .${Suggestions_styles.staticClasses.root} .${Suggestions_styles.staticClasses.list} &`]: {
|
|
169
|
-
width: "100%"
|
|
170
|
-
}
|
|
171
|
-
},
|
|
105
|
+
suggestionsContainer: {},
|
|
172
106
|
suggestionList: {}
|
|
173
107
|
});
|
|
174
108
|
exports.staticClasses = staticClasses;
|
|
@@ -83,7 +83,6 @@ const HvTextArea = React.forwardRef(function HvTextArea2(props, ref) {
|
|
|
83
83
|
const performValidation = React.useCallback(() => {
|
|
84
84
|
const inputValidity = validations.validateInput(
|
|
85
85
|
inputRef.current,
|
|
86
|
-
String(value),
|
|
87
86
|
required,
|
|
88
87
|
minCharQuantity,
|
|
89
88
|
maxCharQuantity,
|
|
@@ -104,8 +103,7 @@ const HvTextArea = React.forwardRef(function HvTextArea2(props, ref) {
|
|
|
104
103
|
required,
|
|
105
104
|
setValidationMessage,
|
|
106
105
|
setValidationState,
|
|
107
|
-
validation
|
|
108
|
-
value
|
|
106
|
+
validation
|
|
109
107
|
]);
|
|
110
108
|
const limitValue = (currentValue) => {
|
|
111
109
|
if (currentValue === void 0 || !blockMax) return currentValue;
|
|
@@ -8,7 +8,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTextArea"
|
|
|
8
8
|
invalid: {},
|
|
9
9
|
baseInput: { clear: "both", float: "left" },
|
|
10
10
|
input: {},
|
|
11
|
-
inputResizable: {
|
|
11
|
+
inputResizable: {},
|
|
12
12
|
labelContainer: { float: "left", display: "flex", alignItems: "flex-start" },
|
|
13
13
|
label: {},
|
|
14
14
|
description: { display: "block", float: "left" },
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const date = require("@internationalized/date");
|
|
6
|
-
const utils = require("@mui/material/utils");
|
|
6
|
+
const utils$1 = require("@mui/material/utils");
|
|
7
7
|
const datepicker$1 = require("@react-aria/datepicker");
|
|
8
8
|
const datepicker = require("@react-stately/datepicker");
|
|
9
9
|
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
10
10
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
11
|
-
const utils
|
|
11
|
+
const utils = require("../Calendar/utils.cjs");
|
|
12
12
|
const useControlled = require("../hooks/useControlled.cjs");
|
|
13
13
|
const useUniqueId = require("../hooks/useUniqueId.cjs");
|
|
14
14
|
const setId = require("../utils/setId.cjs");
|
|
@@ -52,7 +52,7 @@ const HvTimePicker = React.forwardRef(
|
|
|
52
52
|
timeFormat,
|
|
53
53
|
showSeconds,
|
|
54
54
|
disableExpand,
|
|
55
|
-
locale = utils
|
|
55
|
+
locale = utils.DEFAULT_LOCALE,
|
|
56
56
|
onToggle,
|
|
57
57
|
onChange,
|
|
58
58
|
// misc properties:
|
|
@@ -65,7 +65,7 @@ const HvTimePicker = React.forwardRef(
|
|
|
65
65
|
const { classes, cx } = TimePicker_styles.useClasses(classesProp);
|
|
66
66
|
const timeFieldRef = React.useRef(null);
|
|
67
67
|
const { ref: refProp, ...otherDropdownProps } = dropdownProps;
|
|
68
|
-
const dropdownForkedRef = utils.useForkRef(ref, refProp);
|
|
68
|
+
const dropdownForkedRef = utils$1.useForkRef(ref, refProp);
|
|
69
69
|
const stateProps = {
|
|
70
70
|
value: toTime(valueProp),
|
|
71
71
|
defaultValue: toTime(defaultValueProp),
|
|
@@ -77,6 +77,7 @@ const HvTimePicker = React.forwardRef(
|
|
|
77
77
|
granularity: showSeconds === false ? "minute" : "second",
|
|
78
78
|
hourCycle: timeFormat === "12" ? 12 : 24,
|
|
79
79
|
onChange: (value) => {
|
|
80
|
+
if (!value) return;
|
|
80
81
|
const { hour: hours, minute: minutes, second: seconds } = value;
|
|
81
82
|
onChange?.({ hours, minutes, seconds });
|
|
82
83
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const document = require("../utils/document.cjs");
|
|
5
|
+
const getActiveEl = () => document.getDocument()?.activeElement || null;
|
|
6
|
+
function makeFocusUtils(containerRef) {
|
|
7
|
+
function focus(el, checkFocus = true) {
|
|
8
|
+
if (!checkFocus || containerRef.current?.contains(getActiveEl())) {
|
|
9
|
+
el?.focus();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
focusPrevious() {
|
|
14
|
+
focus(getActiveEl()?.previousElementSibling);
|
|
15
|
+
},
|
|
16
|
+
focusNext() {
|
|
17
|
+
focus(getActiveEl()?.nextElementSibling);
|
|
18
|
+
},
|
|
19
|
+
focusFirst() {
|
|
20
|
+
focus(getActiveEl()?.parentElement?.firstElementChild);
|
|
21
|
+
},
|
|
22
|
+
focusLast() {
|
|
23
|
+
focus(getActiveEl()?.parentElement?.lastElementChild);
|
|
24
|
+
},
|
|
25
|
+
focusChild(index) {
|
|
26
|
+
focus(containerRef.current?.children[index], false);
|
|
27
|
+
},
|
|
28
|
+
focusSibling(index) {
|
|
29
|
+
focus(getActiveEl()?.parentElement?.children[index]);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function useFocus({
|
|
34
|
+
containerRef
|
|
35
|
+
}) {
|
|
36
|
+
return React.useMemo(() => makeFocusUtils(containerRef), [containerRef]);
|
|
37
|
+
}
|
|
38
|
+
exports.useFocus = useFocus;
|
|
@@ -4,9 +4,10 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const CounterLabel = ({
|
|
5
5
|
selected,
|
|
6
6
|
total,
|
|
7
|
-
conjunctionLabel = "/"
|
|
7
|
+
conjunctionLabel = "/",
|
|
8
|
+
...others
|
|
8
9
|
}) => {
|
|
9
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { ...others, children: [
|
|
10
11
|
/* @__PURE__ */ jsxRuntime.jsx("b", { children: selected }),
|
|
11
12
|
" ",
|
|
12
13
|
` ${conjunctionLabel} ${total}`
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const outlineStyles = {
|
|
4
|
-
outlineColor: "#52A8EC",
|
|
5
|
-
outlineStyle: "solid",
|
|
6
|
-
outlineWidth: "0px",
|
|
7
|
-
outlineOffset: "-1px",
|
|
8
4
|
boxShadow: "0 0 0 1px #52A8EC, 0 0 0 4px rgba(29,155,209,.3)"
|
|
9
5
|
};
|
|
10
6
|
exports.outlineStyles = outlineStyles;
|
|
@@ -5,9 +5,9 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
|
5
5
|
import { setId } from "../utils/setId.js";
|
|
6
6
|
import { useClasses } from "./ActionsGeneric.styles.js";
|
|
7
7
|
import { staticClasses } from "./ActionsGeneric.styles.js";
|
|
8
|
+
import { HvDropDownMenu } from "../DropDownMenu/DropDownMenu.js";
|
|
8
9
|
import { HvIconButton } from "../IconButton/IconButton.js";
|
|
9
10
|
import { HvButton } from "../Button/Button.js";
|
|
10
|
-
import { HvDropDownMenu } from "../DropDownMenu/DropDownMenu.js";
|
|
11
11
|
const HvActionsGeneric = forwardRef(function HvActionsGeneric2(props, ref) {
|
|
12
12
|
const {
|
|
13
13
|
id: idProp,
|
|
@@ -6,8 +6,8 @@ import { iconVariant } from "../../utils/iconVariant.js";
|
|
|
6
6
|
import { setId } from "../../utils/setId.js";
|
|
7
7
|
import { useClasses } from "./BannerContent.styles.js";
|
|
8
8
|
import { staticClasses } from "./BannerContent.styles.js";
|
|
9
|
-
import { HvActionsGeneric } from "../../ActionsGeneric/ActionsGeneric.js";
|
|
10
9
|
import { HvButton } from "../../Button/Button.js";
|
|
10
|
+
import { HvActionsGeneric } from "../../ActionsGeneric/ActionsGeneric.js";
|
|
11
11
|
const HvBannerContent = forwardRef(
|
|
12
12
|
function HvBannerContent2(props, ref) {
|
|
13
13
|
const {
|
|
@@ -4,7 +4,7 @@ import MuiCheckbox from "@mui/material/Checkbox";
|
|
|
4
4
|
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
5
5
|
import { useClasses } from "./BaseCheckBox.styles.js";
|
|
6
6
|
import { staticClasses } from "./BaseCheckBox.styles.js";
|
|
7
|
-
import {
|
|
7
|
+
import { Check, Partial, Box } from "./icons.js";
|
|
8
8
|
const getSelectorIcons = () => {
|
|
9
9
|
return {
|
|
10
10
|
checkbox: /* @__PURE__ */ jsx(Box, {}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef,
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState, useCallback, useMemo, isValidElement, cloneElement, Fragment } from "react";
|
|
3
3
|
import { usePopper } from "react-popper";
|
|
4
4
|
import { useForkRef } from "@mui/material/utils";
|
|
5
5
|
import { detectOverflow } from "@popperjs/core";
|
|
@@ -13,7 +13,7 @@ import { setId } from "../utils/setId.js";
|
|
|
13
13
|
import { useClasses } from "./BaseDropdown.styles.js";
|
|
14
14
|
import { staticClasses } from "./BaseDropdown.styles.js";
|
|
15
15
|
import { BaseDropdownPanel } from "./BaseDropdownPanel.js";
|
|
16
|
-
import {
|
|
16
|
+
import { BaseDropdownContext, useBaseDropdownContext } from "./context.js";
|
|
17
17
|
import { HvTypography } from "../Typography/Typography.js";
|
|
18
18
|
const BaseDropdown = forwardRef(function BaseDropdown2(props, ref) {
|
|
19
19
|
const {
|
|
@@ -1,36 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useContext } from "react";
|
|
3
|
-
import { css, Global } from "@emotion/react";
|
|
4
3
|
import MuiInputBase from "@mui/material/InputBase";
|
|
5
4
|
import { useForkRef } from "@mui/material/utils";
|
|
6
5
|
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
7
|
-
import { theme } from "@hitachivantara/uikit-styles";
|
|
8
6
|
import { useClasses } from "./BaseInput.styles.js";
|
|
9
7
|
import { staticClasses } from "./BaseInput.styles.js";
|
|
10
8
|
import { HvFormElementContext, HvFormElementDescriptorsContext } from "../FormElement/context.js";
|
|
11
9
|
import { buildFormElementPropsFromContext, buildAriaPropsFromContext } from "../FormElement/utils.js";
|
|
12
|
-
const baseInputStyles = css({
|
|
13
|
-
"input:-webkit-autofill": {
|
|
14
|
-
WebkitBoxShadow: `0 0 0px 1000px ${theme.colors.atmo1} inset`,
|
|
15
|
-
WebkitTextFillColor: theme.colors.secondary
|
|
16
|
-
},
|
|
17
|
-
// Clears number input up/down arrows in Chrome and Firefox
|
|
18
|
-
"input::-webkit-outer-spin-button,input::-webkit-inner-spin-button": {
|
|
19
|
-
WebkitAppearance: "none",
|
|
20
|
-
margin: 0
|
|
21
|
-
},
|
|
22
|
-
"input[type=number]": {
|
|
23
|
-
MozAppearance: "textfield"
|
|
24
|
-
},
|
|
25
|
-
// Clears time input clock in Chrome
|
|
26
|
-
"input::-webkit-calendar-picker-indicator": {
|
|
27
|
-
display: "none"
|
|
28
|
-
},
|
|
29
|
-
// Clears search input clear button in Chrome
|
|
30
|
-
"input::-webkit-search-decoration,input::-webkit-search-cancel-button,input::-webkit-search-results-button,input::-webkit-search-results-decoration": {
|
|
31
|
-
display: "none"
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
10
|
const HvBaseInput = forwardRef(function HvBaseInput2(props, ref) {
|
|
35
11
|
const {
|
|
36
12
|
classes: classesProp,
|
|
@@ -47,7 +23,7 @@ const HvBaseInput = forwardRef(function HvBaseInput2(props, ref) {
|
|
|
47
23
|
placeholder,
|
|
48
24
|
multiline,
|
|
49
25
|
resizable,
|
|
50
|
-
invalid,
|
|
26
|
+
invalid: invalidProp,
|
|
51
27
|
inputRef,
|
|
52
28
|
inputProps = {},
|
|
53
29
|
...others
|
|
@@ -62,72 +38,57 @@ const HvBaseInput = forwardRef(function HvBaseInput2(props, ref) {
|
|
|
62
38
|
formElementContext
|
|
63
39
|
);
|
|
64
40
|
const forkedRef = useForkRef(ref, inputRef);
|
|
65
|
-
const
|
|
41
|
+
const invalid = invalidProp || formElementProps.status === "invalid";
|
|
66
42
|
const formElementDescriptorsContext = useContext(
|
|
67
43
|
HvFormElementDescriptorsContext
|
|
68
44
|
);
|
|
69
45
|
const ariaProps = buildAriaPropsFromContext(
|
|
70
46
|
inputProps,
|
|
71
47
|
formElementDescriptorsContext,
|
|
72
|
-
|
|
48
|
+
invalid,
|
|
73
49
|
id
|
|
74
50
|
);
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
required: formElementProps.required,
|
|
117
|
-
...inputProps,
|
|
118
|
-
...ariaProps
|
|
119
|
-
},
|
|
120
|
-
inputRef: forkedRef,
|
|
121
|
-
multiline,
|
|
122
|
-
rows: 10,
|
|
123
|
-
...others
|
|
124
|
-
}
|
|
125
|
-
),
|
|
126
|
-
!multiline && /* @__PURE__ */ jsx("div", { role: "presentation", className: classes.inputBorderContainer })
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
] });
|
|
51
|
+
return /* @__PURE__ */ jsx(
|
|
52
|
+
MuiInputBase,
|
|
53
|
+
{
|
|
54
|
+
id,
|
|
55
|
+
name: formElementProps.name,
|
|
56
|
+
value,
|
|
57
|
+
defaultValue,
|
|
58
|
+
placeholder,
|
|
59
|
+
readOnly: !!formElementProps.readOnly,
|
|
60
|
+
disabled: formElementProps.disabled,
|
|
61
|
+
onChange: (event) => onChange?.(event, event.target.value),
|
|
62
|
+
className: cx(classes.root, classes.inputRoot, className, {
|
|
63
|
+
[classes.inputRootMultiline]: multiline,
|
|
64
|
+
[classes.multiline]: multiline,
|
|
65
|
+
[classes.inputRootInvalid]: invalid,
|
|
66
|
+
[classes.invalid]: invalid,
|
|
67
|
+
[classes.inputRootReadOnly]: formElementProps.readOnly,
|
|
68
|
+
[classes.readOnly]: formElementProps.readOnly,
|
|
69
|
+
[classes.inputRootDisabled]: formElementProps.disabled,
|
|
70
|
+
[classes.disabled]: formElementProps.disabled
|
|
71
|
+
}),
|
|
72
|
+
classes: {
|
|
73
|
+
focused: cx(classes.focused, classes.inputRootFocused),
|
|
74
|
+
input: cx(classes.input, {
|
|
75
|
+
[classes.inputResizable]: !formElementProps.disabled && resizable,
|
|
76
|
+
[classes.inputDisabled]: formElementProps.disabled,
|
|
77
|
+
[classes.inputReadOnly]: formElementProps.readOnly
|
|
78
|
+
})
|
|
79
|
+
},
|
|
80
|
+
inputProps: {
|
|
81
|
+
// Avoid the required attribute at the root node
|
|
82
|
+
required: formElementProps.required,
|
|
83
|
+
...inputProps,
|
|
84
|
+
...ariaProps
|
|
85
|
+
},
|
|
86
|
+
inputRef: forkedRef,
|
|
87
|
+
multiline,
|
|
88
|
+
...multiline ? { rows: 10 } : { type },
|
|
89
|
+
...others
|
|
90
|
+
}
|
|
91
|
+
);
|
|
131
92
|
});
|
|
132
93
|
export {
|
|
133
94
|
HvBaseInput,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInput.js","sources":["../../../src/BaseInput/BaseInput.tsx"],"sourcesContent":["import { forwardRef, useContext } from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"BaseInput.js","sources":["../../../src/BaseInput/BaseInput.tsx"],"sourcesContent":["import { forwardRef, useContext } from \"react\";\nimport MuiInputBase, { type InputBaseProps } from \"@mui/material/InputBase\";\nimport { useForkRef } from \"@mui/material/utils\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport {\n buildAriaPropsFromContext,\n buildFormElementPropsFromContext,\n HvFormElementContext,\n HvFormElementDescriptorsContext,\n} from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./BaseInput.styles\";\n\nexport { staticClasses as baseInputClasses };\n\nexport type HvBaseInputClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBaseInputProps\n extends Omit<\n InputBaseProps,\n \"onChange\" | \"classes\" | \"ref\" | \"color\" | \"size\"\n > {\n /** The input name. */\n name?: string;\n /** The value of the input, when controlled. */\n value?: React.InputHTMLAttributes<HTMLInputElement>[\"value\"];\n /** The initial value of the input, when uncontrolled. */\n defaultValue?: React.InputHTMLAttributes<HTMLInputElement>[\"value\"];\n /** If `true` the input is disabled. */\n disabled?: boolean;\n /** Indicates that the input is not editable. */\n readOnly?: boolean;\n /** If true, the input element will be required. */\n required?: boolean;\n /**\n * Callback fired when the value is changed.\n *\n * You can pull out the new value by accessing `event.target.value` (string),\n * or using the second callback argument.\n */\n onChange?: (\n event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n value: string,\n ) => void;\n /** If true, a textarea element will be rendered. */\n multiline?: boolean;\n /** If true and multiline is also true the textarea element will be resizable. */\n resizable?: boolean;\n /** Denotes if the input is in an invalid state. */\n invalid?: boolean;\n /**\n * Allows passing a ref to the underlying input\n * @deprecated Use `ref` directly instead\n * */\n inputRef?: InputBaseProps[\"inputRef\"];\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBaseInputClasses;\n}\n\n/**\n * An Input component that only posses the most basic functionalities.\n * It should be used alongside the other form elements to construct a proper accessible form.\n */\nexport const HvBaseInput = forwardRef<\n // no-indent\n React.ElementRef<\"input\">,\n HvBaseInputProps\n>(function HvBaseInput(props, ref) {\n const {\n classes: classesProp,\n className = \"\",\n id,\n name,\n value,\n defaultValue,\n required,\n readOnly,\n disabled,\n onChange,\n type = \"text\",\n placeholder,\n multiline,\n resizable,\n invalid: invalidProp,\n inputRef,\n inputProps = {},\n ...others\n } = useDefaultProps(\"HvBaseInput\", props);\n const { classes, cx } = useClasses(classesProp);\n const formElementContext = useContext(HvFormElementContext);\n const formElementProps = buildFormElementPropsFromContext(\n name,\n disabled,\n readOnly,\n required,\n formElementContext,\n );\n\n const forkedRef = useForkRef(ref, inputRef);\n\n const invalid = invalidProp || formElementProps.status === \"invalid\";\n\n const formElementDescriptorsContext = useContext(\n HvFormElementDescriptorsContext,\n );\n const ariaProps = buildAriaPropsFromContext(\n inputProps,\n formElementDescriptorsContext,\n invalid,\n id,\n );\n\n return (\n <MuiInputBase\n id={id}\n name={formElementProps.name}\n value={value}\n defaultValue={defaultValue}\n placeholder={placeholder}\n readOnly={!!formElementProps.readOnly}\n disabled={formElementProps.disabled}\n onChange={(event) => onChange?.(event, event.target.value)}\n className={cx(classes.root, classes.inputRoot, className, {\n [classes.inputRootMultiline]: multiline,\n [classes.multiline]: multiline,\n [classes.inputRootInvalid]: invalid,\n [classes.invalid]: invalid,\n [classes.inputRootReadOnly]: formElementProps.readOnly,\n [classes.readOnly]: formElementProps.readOnly,\n [classes.inputRootDisabled]: formElementProps.disabled,\n [classes.disabled]: formElementProps.disabled,\n })}\n classes={{\n focused: cx(classes.focused, classes.inputRootFocused),\n input: cx(classes.input, {\n [classes.inputResizable]: !formElementProps.disabled && resizable,\n [classes.inputDisabled]: formElementProps.disabled,\n [classes.inputReadOnly]: formElementProps.readOnly,\n }),\n }}\n inputProps={{\n // Avoid the required attribute at the root node\n required: formElementProps.required,\n ...inputProps,\n ...ariaProps,\n }}\n inputRef={forkedRef}\n multiline={multiline}\n {...(multiline ? { rows: 10 } : { type })}\n {...others}\n />\n );\n});\n"],"names":["HvBaseInput"],"mappings":";;;;;;;;;AAkEO,MAAM,cAAc,WAIzB,SAASA,aAAY,OAAO,KAAK;AAC3B,QAAA;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,aAAa,CAAC;AAAA,IACd,GAAG;AAAA,EAAA,IACD,gBAAgB,eAAe,KAAK;AACxC,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AACxC,QAAA,qBAAqB,WAAW,oBAAoB;AAC1D,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEM,QAAA,YAAY,WAAW,KAAK,QAAQ;AAEpC,QAAA,UAAU,eAAe,iBAAiB,WAAW;AAE3D,QAAM,gCAAgC;AAAA,IACpC;AAAA,EACF;AACA,QAAM,YAAY;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAGE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,MAAM,iBAAiB;AAAA,MACvB;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,CAAC,CAAC,iBAAiB;AAAA,MAC7B,UAAU,iBAAiB;AAAA,MAC3B,UAAU,CAAC,UAAU,WAAW,OAAO,MAAM,OAAO,KAAK;AAAA,MACzD,WAAW,GAAG,QAAQ,MAAM,QAAQ,WAAW,WAAW;AAAA,QACxD,CAAC,QAAQ,kBAAkB,GAAG;AAAA,QAC9B,CAAC,QAAQ,SAAS,GAAG;AAAA,QACrB,CAAC,QAAQ,gBAAgB,GAAG;AAAA,QAC5B,CAAC,QAAQ,OAAO,GAAG;AAAA,QACnB,CAAC,QAAQ,iBAAiB,GAAG,iBAAiB;AAAA,QAC9C,CAAC,QAAQ,QAAQ,GAAG,iBAAiB;AAAA,QACrC,CAAC,QAAQ,iBAAiB,GAAG,iBAAiB;AAAA,QAC9C,CAAC,QAAQ,QAAQ,GAAG,iBAAiB;AAAA,MAAA,CACtC;AAAA,MACD,SAAS;AAAA,QACP,SAAS,GAAG,QAAQ,SAAS,QAAQ,gBAAgB;AAAA,QACrD,OAAO,GAAG,QAAQ,OAAO;AAAA,UACvB,CAAC,QAAQ,cAAc,GAAG,CAAC,iBAAiB,YAAY;AAAA,UACxD,CAAC,QAAQ,aAAa,GAAG,iBAAiB;AAAA,UAC1C,CAAC,QAAQ,aAAa,GAAG,iBAAiB;AAAA,QAC3C,CAAA;AAAA,MACH;AAAA,MACA,YAAY;AAAA;AAAA,QAEV,UAAU,iBAAiB;AAAA,QAC3B,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACC,GAAI,YAAY,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK;AAAA,MACtC,GAAG;AAAA,IAAA;AAAA,EACN;AAEJ,CAAC;"}
|