@hitachivantara/uikit-react-core 5.87.2 → 5.87.3
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/BaseInput/BaseInput.cjs +44 -83
- package/dist/cjs/BaseInput/BaseInput.styles.cjs +68 -142
- package/dist/cjs/Calendar/CalendarHeader/CalendarHeader.cjs +0 -6
- package/dist/cjs/Calendar/CalendarHeader/CalendarHeader.styles.cjs +1 -5
- package/dist/cjs/Dropdown/Dropdown.cjs +8 -10
- package/dist/cjs/InlineEditor/InlineEditor.cjs +10 -14
- package/dist/cjs/InlineEditor/InlineEditor.styles.cjs +13 -36
- package/dist/cjs/Input/Input.cjs +4 -5
- package/dist/cjs/Input/Input.styles.cjs +5 -19
- package/dist/cjs/List/List.cjs +11 -11
- package/dist/cjs/Pagination/Pagination.styles.cjs +1 -0
- package/dist/cjs/Select/Select.styles.cjs +1 -1
- package/dist/cjs/TagsInput/TagsInput.styles.cjs +3 -8
- package/dist/cjs/TextArea/TextArea.styles.cjs +1 -1
- package/dist/cjs/TimePicker/Unit/Unit.cjs +0 -1
- package/dist/cjs/TimePicker/Unit/Unit.styles.cjs +0 -3
- package/dist/cjs/utils/CounterLabel.cjs +3 -2
- 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/Calendar/CalendarHeader/CalendarHeader.js +0 -6
- 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/Dropdown/Dropdown.js +8 -10
- package/dist/esm/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/FilterGroup/RightPanel/RightPanel.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 +4 -5
- package/dist/esm/Input/Input.js.map +1 -1
- package/dist/esm/Input/Input.styles.js +5 -19
- package/dist/esm/Input/Input.styles.js.map +1 -1
- package/dist/esm/List/List.js +11 -11
- package/dist/esm/List/List.js.map +1 -1
- package/dist/esm/Pagination/Pagination.styles.js +1 -0
- package/dist/esm/Pagination/Pagination.styles.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/TagsInput/TagsInput.styles.js +3 -8
- package/dist/esm/TagsInput/TagsInput.styles.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/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/utils/CounterLabel.js +3 -2
- package/dist/esm/utils/CounterLabel.js.map +1 -1
- package/dist/types/index.d.ts +27 -29
- package/package.json +6 -6
|
@@ -2,38 +2,14 @@
|
|
|
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 react = require("@emotion/react");
|
|
6
5
|
const MuiInputBase = require("@mui/material/InputBase");
|
|
7
6
|
const utils$1 = require("@mui/material/utils");
|
|
8
7
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
9
|
-
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
10
8
|
const BaseInput_styles = require("./BaseInput.styles.cjs");
|
|
11
9
|
const context = require("../FormElement/context.cjs");
|
|
12
10
|
const utils = require("../FormElement/utils.cjs");
|
|
13
11
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
14
12
|
const MuiInputBase__default = /* @__PURE__ */ _interopDefault(MuiInputBase);
|
|
15
|
-
const baseInputStyles = react.css({
|
|
16
|
-
"input:-webkit-autofill": {
|
|
17
|
-
WebkitBoxShadow: `0 0 0px 1000px ${uikitStyles.theme.colors.atmo1} inset`,
|
|
18
|
-
WebkitTextFillColor: uikitStyles.theme.colors.secondary
|
|
19
|
-
},
|
|
20
|
-
// Clears number input up/down arrows in Chrome and Firefox
|
|
21
|
-
"input::-webkit-outer-spin-button,input::-webkit-inner-spin-button": {
|
|
22
|
-
WebkitAppearance: "none",
|
|
23
|
-
margin: 0
|
|
24
|
-
},
|
|
25
|
-
"input[type=number]": {
|
|
26
|
-
MozAppearance: "textfield"
|
|
27
|
-
},
|
|
28
|
-
// Clears time input clock in Chrome
|
|
29
|
-
"input::-webkit-calendar-picker-indicator": {
|
|
30
|
-
display: "none"
|
|
31
|
-
},
|
|
32
|
-
// Clears search input clear button in Chrome
|
|
33
|
-
"input::-webkit-search-decoration,input::-webkit-search-cancel-button,input::-webkit-search-results-button,input::-webkit-search-results-decoration": {
|
|
34
|
-
display: "none"
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
13
|
const HvBaseInput = React.forwardRef(function HvBaseInput2(props, ref) {
|
|
38
14
|
const {
|
|
39
15
|
classes: classesProp,
|
|
@@ -50,7 +26,7 @@ const HvBaseInput = React.forwardRef(function HvBaseInput2(props, ref) {
|
|
|
50
26
|
placeholder,
|
|
51
27
|
multiline,
|
|
52
28
|
resizable,
|
|
53
|
-
invalid,
|
|
29
|
+
invalid: invalidProp,
|
|
54
30
|
inputRef,
|
|
55
31
|
inputProps = {},
|
|
56
32
|
...others
|
|
@@ -65,72 +41,57 @@ const HvBaseInput = React.forwardRef(function HvBaseInput2(props, ref) {
|
|
|
65
41
|
formElementContext
|
|
66
42
|
);
|
|
67
43
|
const forkedRef = utils$1.useForkRef(ref, inputRef);
|
|
68
|
-
const
|
|
44
|
+
const invalid = invalidProp || formElementProps.status === "invalid";
|
|
69
45
|
const formElementDescriptorsContext = React.useContext(
|
|
70
46
|
context.HvFormElementDescriptorsContext
|
|
71
47
|
);
|
|
72
48
|
const ariaProps = utils.buildAriaPropsFromContext(
|
|
73
49
|
inputProps,
|
|
74
50
|
formElementDescriptorsContext,
|
|
75
|
-
|
|
51
|
+
invalid,
|
|
76
52
|
id
|
|
77
53
|
);
|
|
78
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
required: formElementProps.required,
|
|
120
|
-
...inputProps,
|
|
121
|
-
...ariaProps
|
|
122
|
-
},
|
|
123
|
-
inputRef: forkedRef,
|
|
124
|
-
multiline,
|
|
125
|
-
rows: 10,
|
|
126
|
-
...others
|
|
127
|
-
}
|
|
128
|
-
),
|
|
129
|
-
!multiline && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "presentation", className: classes.inputBorderContainer })
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
)
|
|
133
|
-
] });
|
|
54
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
+
MuiInputBase__default.default,
|
|
56
|
+
{
|
|
57
|
+
id,
|
|
58
|
+
name: formElementProps.name,
|
|
59
|
+
value,
|
|
60
|
+
defaultValue,
|
|
61
|
+
placeholder,
|
|
62
|
+
readOnly: !!formElementProps.readOnly,
|
|
63
|
+
disabled: formElementProps.disabled,
|
|
64
|
+
onChange: (event) => onChange?.(event, event.target.value),
|
|
65
|
+
className: cx(classes.root, classes.inputRoot, className, {
|
|
66
|
+
[classes.inputRootMultiline]: multiline,
|
|
67
|
+
[classes.multiline]: multiline,
|
|
68
|
+
[classes.inputRootInvalid]: invalid,
|
|
69
|
+
[classes.invalid]: invalid,
|
|
70
|
+
[classes.inputRootReadOnly]: formElementProps.readOnly,
|
|
71
|
+
[classes.readOnly]: formElementProps.readOnly,
|
|
72
|
+
[classes.inputRootDisabled]: formElementProps.disabled,
|
|
73
|
+
[classes.disabled]: formElementProps.disabled
|
|
74
|
+
}),
|
|
75
|
+
classes: {
|
|
76
|
+
focused: cx(classes.focused, classes.inputRootFocused),
|
|
77
|
+
input: cx(classes.input, {
|
|
78
|
+
[classes.inputResizable]: !formElementProps.disabled && resizable,
|
|
79
|
+
[classes.inputDisabled]: formElementProps.disabled,
|
|
80
|
+
[classes.inputReadOnly]: formElementProps.readOnly
|
|
81
|
+
})
|
|
82
|
+
},
|
|
83
|
+
inputProps: {
|
|
84
|
+
// Avoid the required attribute at the root node
|
|
85
|
+
required: formElementProps.required,
|
|
86
|
+
...inputProps,
|
|
87
|
+
...ariaProps
|
|
88
|
+
},
|
|
89
|
+
inputRef: forkedRef,
|
|
90
|
+
multiline,
|
|
91
|
+
...multiline ? { rows: 10 } : { type },
|
|
92
|
+
...others
|
|
93
|
+
}
|
|
94
|
+
);
|
|
134
95
|
});
|
|
135
96
|
exports.baseInputClasses = BaseInput_styles.staticClasses;
|
|
136
97
|
exports.HvBaseInput = HvBaseInput;
|
|
@@ -5,176 +5,99 @@ const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
|
5
5
|
const focusUtils = require("../utils/focusUtils.cjs");
|
|
6
6
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseInput", {
|
|
7
7
|
root: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"& $inputRoot": {
|
|
20
|
-
backgroundColor: uikitStyles.theme.colors.atmo2,
|
|
21
|
-
borderColor: uikitStyles.theme.colors.secondary_60
|
|
22
|
-
},
|
|
23
|
-
"& $inputBorderContainer": {
|
|
24
|
-
backgroundColor: uikitStyles.theme.colors.atmo4
|
|
25
|
-
},
|
|
26
|
-
"&:hover $inputBorderContainer": {
|
|
27
|
-
backgroundColor: uikitStyles.theme.colors.atmo4
|
|
28
|
-
},
|
|
29
|
-
"&& $input": {
|
|
30
|
-
color: uikitStyles.theme.colors.secondary_60,
|
|
31
|
-
WebkitTextFillColor: uikitStyles.theme.colors.secondary_60
|
|
32
|
-
},
|
|
33
|
-
"& $inputRootMultiline": {
|
|
34
|
-
"& $input": {
|
|
35
|
-
backgroundColor: uikitStyles.theme.colors.atmo2,
|
|
36
|
-
border: `1px solid ${uikitStyles.theme.colors.secondary_60}`
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"&:hover $inputRootMultiline": {
|
|
40
|
-
"& $input": {
|
|
41
|
-
backgroundColor: uikitStyles.theme.colors.atmo2,
|
|
42
|
-
border: `1px solid ${uikitStyles.theme.colors.secondary_60}`
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
invalid: {
|
|
47
|
-
"&:not(.disabled)": {
|
|
48
|
-
"& $inputBorderContainer": {
|
|
49
|
-
backgroundColor: uikitStyles.theme.colors.negative_120
|
|
50
|
-
},
|
|
51
|
-
"&:hover $inputBorderContainer": {
|
|
52
|
-
backgroundColor: uikitStyles.theme.colors.negative_120
|
|
53
|
-
},
|
|
54
|
-
"& $inputRootMultiline": {
|
|
55
|
-
"& $input": {
|
|
56
|
-
border: `1px solid ${uikitStyles.theme.colors.negative_120}`
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"&:hover $inputRootMultiline": {
|
|
60
|
-
"& $input": {
|
|
61
|
-
border: `1px solid ${uikitStyles.theme.colors.negative_120}`
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"&:focus-within $inputRootMultiline": {
|
|
65
|
-
"& $input": {
|
|
66
|
-
border: `1px solid ${uikitStyles.theme.colors.negative_120}`
|
|
67
|
-
}
|
|
8
|
+
// #region `input` style reset
|
|
9
|
+
"input:-webkit-autofill": {
|
|
10
|
+
WebkitBoxShadow: `0 0 0px 1000px ${uikitStyles.theme.colors.atmo1} inset`,
|
|
11
|
+
WebkitTextFillColor: uikitStyles.theme.colors.secondary
|
|
12
|
+
},
|
|
13
|
+
// Clears number input up/down arrows in Chrome and Firefox
|
|
14
|
+
"input[type=number]": {
|
|
15
|
+
MozAppearance: "textfield",
|
|
16
|
+
"&::-webkit-outer-spin-button,&::-webkit-inner-spin-button": {
|
|
17
|
+
WebkitAppearance: "none",
|
|
18
|
+
margin: 0
|
|
68
19
|
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
resizable: { width: "auto" },
|
|
72
|
-
readOnly: {
|
|
73
|
-
"& $inputBorderContainer": {
|
|
74
|
-
backgroundColor: "transparent"
|
|
75
20
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"&:focus-within $inputBorderContainer": {
|
|
80
|
-
backgroundColor: "transparent"
|
|
81
|
-
},
|
|
82
|
-
"& $inputRootMultiline": {
|
|
83
|
-
"& $input": {
|
|
84
|
-
border: `1px solid ${uikitStyles.theme.colors.secondary_60}`,
|
|
85
|
-
backgroundColor: uikitStyles.theme.colors.atmo2
|
|
86
|
-
}
|
|
21
|
+
// Clears time input clock in Chrome
|
|
22
|
+
"input::-webkit-calendar-picker-indicator": {
|
|
23
|
+
display: "none"
|
|
87
24
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
backgroundColor: uikitStyles.theme.colors.atmo2
|
|
92
|
-
}
|
|
25
|
+
// Clears search input clear button in Chrome
|
|
26
|
+
"input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration": {
|
|
27
|
+
display: "none"
|
|
93
28
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
border: `1px solid ${uikitStyles.theme.colors.secondary_60}`,
|
|
97
|
-
backgroundColor: uikitStyles.theme.colors.atmo2
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
inputBorderContainer: {
|
|
102
|
-
position: "absolute",
|
|
103
|
-
width: "calc(100% - 4px)",
|
|
104
|
-
height: "0px",
|
|
105
|
-
top: "31px",
|
|
106
|
-
left: "2px",
|
|
107
|
-
backgroundColor: uikitStyles.theme.colors.atmo4
|
|
108
|
-
},
|
|
109
|
-
inputRootInvalid: { borderColor: uikitStyles.theme.colors.negative_120 },
|
|
110
|
-
inputRootReadOnly: {
|
|
111
|
-
borderColor: uikitStyles.theme.colors.secondary_60,
|
|
112
|
-
backgroundColor: uikitStyles.theme.colors.atmo2
|
|
113
|
-
},
|
|
114
|
-
inputRoot: {
|
|
115
|
-
margin: 0,
|
|
29
|
+
// #endregion
|
|
30
|
+
display: "inline-flex",
|
|
116
31
|
width: "100%",
|
|
32
|
+
position: "relative",
|
|
33
|
+
margin: 0,
|
|
117
34
|
borderRadius: uikitStyles.theme.radii.base,
|
|
118
35
|
height: "32px",
|
|
119
|
-
|
|
36
|
+
borderWidth: 1,
|
|
37
|
+
borderColor: uikitStyles.theme.colors.secondary,
|
|
120
38
|
boxSizing: "border-box",
|
|
121
39
|
backgroundColor: uikitStyles.theme.colors.atmo1,
|
|
122
40
|
fontFamily: uikitStyles.theme.fontFamily.body,
|
|
123
|
-
"
|
|
41
|
+
":hover:not($disabled,$invalid,$readOnly)": {
|
|
124
42
|
borderColor: uikitStyles.theme.colors.primary
|
|
125
43
|
},
|
|
126
|
-
"
|
|
127
|
-
|
|
128
|
-
},
|
|
129
|
-
"&::before": {
|
|
130
|
-
borderBottom: "none"
|
|
131
|
-
},
|
|
132
|
-
"&::after": {
|
|
133
|
-
borderBottom: "none"
|
|
44
|
+
":focus-within:not($disabled)": {
|
|
45
|
+
...focusUtils.outlineStyles
|
|
134
46
|
}
|
|
135
47
|
},
|
|
136
|
-
|
|
137
|
-
backgroundColor: uikitStyles.theme.colors.
|
|
138
|
-
|
|
139
|
-
"&:hover": {
|
|
140
|
-
backgroundColor: uikitStyles.theme.colors.atmo1
|
|
141
|
-
},
|
|
142
|
-
"&$inputRootReadOnly": {
|
|
143
|
-
backgroundColor: uikitStyles.theme.colors.atmo2
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
inputRootDisabled: {
|
|
48
|
+
disabled: {
|
|
49
|
+
backgroundColor: uikitStyles.theme.colors.atmo2,
|
|
50
|
+
borderColor: uikitStyles.theme.colors.secondary_60,
|
|
147
51
|
cursor: "not-allowed",
|
|
148
52
|
"&&::before": {
|
|
149
53
|
borderBottomStyle: "none"
|
|
150
54
|
}
|
|
151
55
|
},
|
|
152
|
-
|
|
56
|
+
invalid: {
|
|
57
|
+
borderColor: uikitStyles.theme.colors.negative_120
|
|
58
|
+
},
|
|
59
|
+
multiline: {
|
|
153
60
|
padding: 0,
|
|
154
|
-
backgroundColor: "transparent",
|
|
155
61
|
overflow: "auto",
|
|
156
|
-
border: "none",
|
|
157
62
|
height: "auto",
|
|
158
63
|
"& $input": {
|
|
159
|
-
border: `1px solid ${uikitStyles.theme.colors.secondary}`,
|
|
160
64
|
borderRadius: uikitStyles.theme.radii.base,
|
|
161
|
-
backgroundColor: uikitStyles.theme.colors.atmo1,
|
|
162
65
|
height: "auto",
|
|
163
66
|
minHeight: "21px",
|
|
164
67
|
padding: "5px 10px",
|
|
165
68
|
overflow: "auto",
|
|
166
|
-
|
|
167
|
-
marginRight: "0px",
|
|
168
|
-
"&:hover": {
|
|
169
|
-
border: `1px solid ${uikitStyles.theme.colors.primary}`
|
|
170
|
-
}
|
|
69
|
+
margin: 0
|
|
171
70
|
}
|
|
172
71
|
},
|
|
72
|
+
resizable: { width: "auto" },
|
|
73
|
+
readOnly: {
|
|
74
|
+
borderColor: uikitStyles.theme.colors.secondary_60,
|
|
75
|
+
backgroundColor: uikitStyles.theme.colors.atmo2
|
|
76
|
+
},
|
|
77
|
+
focused: {},
|
|
78
|
+
/** @deprecated unused. use `::after` instead */
|
|
79
|
+
inputBorderContainer: {},
|
|
80
|
+
/** @deprecated use `classes.invalid` instead */
|
|
81
|
+
inputRootInvalid: { borderColor: uikitStyles.theme.colors.negative_120 },
|
|
82
|
+
/** @deprecated use `classes.readOnly` instead */
|
|
83
|
+
inputRootReadOnly: {
|
|
84
|
+
borderColor: uikitStyles.theme.colors.secondary_60,
|
|
85
|
+
backgroundColor: uikitStyles.theme.colors.atmo2
|
|
86
|
+
},
|
|
87
|
+
/** @deprecated use `classes.root` instead */
|
|
88
|
+
inputRoot: {},
|
|
89
|
+
/** @deprecated unused */
|
|
90
|
+
inputRootFocused: {},
|
|
91
|
+
/** @deprecated use `classes.disabled` instead */
|
|
92
|
+
inputRootDisabled: {},
|
|
93
|
+
/** @deprecated use `classes.multiline` instead */
|
|
94
|
+
inputRootMultiline: {},
|
|
173
95
|
input: {
|
|
174
|
-
height: "
|
|
96
|
+
height: "100%",
|
|
175
97
|
marginLeft: uikitStyles.theme.space.xs,
|
|
176
98
|
marginRight: uikitStyles.theme.space.xs,
|
|
177
|
-
padding: "
|
|
99
|
+
padding: uikitStyles.theme.spacing("5px", 0),
|
|
100
|
+
backgroundColor: "transparent",
|
|
178
101
|
overflow: "hidden",
|
|
179
102
|
textOverflow: "ellipsis",
|
|
180
103
|
outline: "none",
|
|
@@ -184,16 +107,19 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseInput
|
|
|
184
107
|
"&::placeholder": {
|
|
185
108
|
opacity: 1,
|
|
186
109
|
color: uikitStyles.theme.colors.secondary_80
|
|
187
|
-
},
|
|
188
|
-
"&::-ms-clear": {
|
|
189
|
-
display: "none"
|
|
190
110
|
}
|
|
191
111
|
},
|
|
192
|
-
inputDisabled: {
|
|
112
|
+
inputDisabled: {
|
|
113
|
+
color: uikitStyles.theme.colors.secondary_60,
|
|
114
|
+
WebkitTextFillColor: uikitStyles.theme.colors.secondary_60
|
|
115
|
+
},
|
|
193
116
|
inputReadOnly: {
|
|
194
117
|
color: uikitStyles.theme.colors.secondary_80
|
|
195
118
|
},
|
|
196
|
-
inputResizable: {
|
|
119
|
+
inputResizable: {
|
|
120
|
+
resize: "both",
|
|
121
|
+
width: "100%"
|
|
122
|
+
}
|
|
197
123
|
});
|
|
198
124
|
exports.staticClasses = staticClasses;
|
|
199
125
|
exports.useClasses = useClasses;
|
|
@@ -107,12 +107,6 @@ const HvCalendarHeader = (props) => {
|
|
|
107
107
|
{
|
|
108
108
|
type: "text",
|
|
109
109
|
id: setId.setId(id, "header-input"),
|
|
110
|
-
className: classes.headerDate,
|
|
111
|
-
classes: {
|
|
112
|
-
input: classes.input,
|
|
113
|
-
inputBorderContainer: classes.inputBorderContainer,
|
|
114
|
-
error: classes.invalidMessageStyling
|
|
115
|
-
},
|
|
116
110
|
placeholder: localeFormat,
|
|
117
111
|
value: inputValue,
|
|
118
112
|
"aria-labelledby": label?.[0]?.id,
|
|
@@ -12,11 +12,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvCalendarH
|
|
|
12
12
|
invalid: {},
|
|
13
13
|
headerDayOfWeek: {
|
|
14
14
|
color: uikitStyles.theme.colors.secondary_80
|
|
15
|
-
}
|
|
16
|
-
headerDate: {},
|
|
17
|
-
input: {},
|
|
18
|
-
inputBorderContainer: {},
|
|
19
|
-
invalidMessageStyling: {}
|
|
15
|
+
}
|
|
20
16
|
});
|
|
21
17
|
exports.staticClasses = staticClasses;
|
|
22
18
|
exports.useClasses = useClasses;
|
|
@@ -8,6 +8,7 @@ const useControlled = require("../hooks/useControlled.cjs");
|
|
|
8
8
|
const useLabels = require("../hooks/useLabels.cjs");
|
|
9
9
|
const useUniqueId = require("../hooks/useUniqueId.cjs");
|
|
10
10
|
const generic = require("../types/generic.cjs");
|
|
11
|
+
const CounterLabel = require("../utils/CounterLabel.cjs");
|
|
11
12
|
const setId = require("../utils/setId.cjs");
|
|
12
13
|
const Dropdown_styles = require("./Dropdown.styles.cjs");
|
|
13
14
|
const utils = require("./utils.cjs");
|
|
@@ -22,7 +23,7 @@ const Typography = require("../Typography/Typography.cjs");
|
|
|
22
23
|
const DEFAULT_LABELS = {
|
|
23
24
|
/** Label for overwrite the default header behavior. */
|
|
24
25
|
select: void 0,
|
|
25
|
-
/** Label used for the All checkbox action. */
|
|
26
|
+
/** Label used for the All checkbox action. @deprecated unused */
|
|
26
27
|
selectAll: "All",
|
|
27
28
|
/** Cancel button label. */
|
|
28
29
|
cancelLabel: "Cancel",
|
|
@@ -183,18 +184,15 @@ const HvDropdown = generic.fixedForwardRef(function HvDropdown2(props, ref) {
|
|
|
183
184
|
}),
|
|
184
185
|
children: selectionLabel.selected
|
|
185
186
|
}
|
|
186
|
-
) : /* @__PURE__ */ jsxRuntime.
|
|
187
|
-
|
|
187
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
188
|
+
CounterLabel.CounterLabel,
|
|
188
189
|
{
|
|
189
|
-
|
|
190
|
+
selected: selectionLabel.selected,
|
|
191
|
+
total: selectionLabel.total,
|
|
192
|
+
conjunctionLabel: labels.multiSelectionConjunction,
|
|
190
193
|
className: cx(classes.placeholder, {
|
|
191
194
|
[classes.selectionDisabled]: disabled
|
|
192
|
-
})
|
|
193
|
-
variant: "body",
|
|
194
|
-
children: [
|
|
195
|
-
/* @__PURE__ */ jsxRuntime.jsx("b", { children: selectionLabel.selected }),
|
|
196
|
-
` ${labels?.multiSelectionConjunction} ${selectionLabel.total}`
|
|
197
|
-
]
|
|
195
|
+
})
|
|
198
196
|
}
|
|
199
197
|
);
|
|
200
198
|
};
|
|
@@ -40,12 +40,9 @@ const HvInlineEditor = generic.fixedForwardRef(function HvInlineEditor2(props, r
|
|
|
40
40
|
const [isOverflowing, setIsOverflowing] = React.useState(false);
|
|
41
41
|
const typographyStyles = activeTheme?.typography[variant] || {};
|
|
42
42
|
const { lineHeight } = typographyStyles;
|
|
43
|
-
const checkOverflow = () => {
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
inputRef.current.scrollWidth > inputRef.current.clientWidth
|
|
47
|
-
);
|
|
48
|
-
}
|
|
43
|
+
const checkOverflow = (el) => {
|
|
44
|
+
if (!el) return;
|
|
45
|
+
setIsOverflowing(el.scrollWidth > el.clientWidth);
|
|
49
46
|
};
|
|
50
47
|
useEnhancedEffect.useEnhancedEffect(() => {
|
|
51
48
|
const input = inputRef.current;
|
|
@@ -70,13 +67,11 @@ const HvInlineEditor = generic.fixedForwardRef(function HvInlineEditor2(props, r
|
|
|
70
67
|
newValue = cachedValue;
|
|
71
68
|
setEditMode(false);
|
|
72
69
|
setValue(newValue);
|
|
73
|
-
checkOverflow();
|
|
74
70
|
}
|
|
75
71
|
onKeyDown?.(event, newValue);
|
|
76
72
|
};
|
|
77
73
|
const handleChange = (event, val) => {
|
|
78
74
|
setValue(val);
|
|
79
|
-
checkOverflow();
|
|
80
75
|
onChange?.(event, val);
|
|
81
76
|
};
|
|
82
77
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(classes.root, className), children: editMode && !disabled ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -86,8 +81,7 @@ const HvInlineEditor = generic.fixedForwardRef(function HvInlineEditor2(props, r
|
|
|
86
81
|
inputRef,
|
|
87
82
|
classes: {
|
|
88
83
|
root: classes.inputRoot,
|
|
89
|
-
input: classes.input
|
|
90
|
-
inputBorderContainer: classes.inputBorderContainer
|
|
84
|
+
input: classes.input
|
|
91
85
|
},
|
|
92
86
|
inputProps: {
|
|
93
87
|
style: {
|
|
@@ -101,7 +95,7 @@ const HvInlineEditor = generic.fixedForwardRef(function HvInlineEditor2(props, r
|
|
|
101
95
|
onKeyDown: handleKeyDown,
|
|
102
96
|
...others
|
|
103
97
|
}
|
|
104
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
98
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
105
99
|
Button.HvButton,
|
|
106
100
|
{
|
|
107
101
|
variant: "secondaryGhost",
|
|
@@ -121,18 +115,20 @@ const HvInlineEditor = generic.fixedForwardRef(function HvInlineEditor2(props, r
|
|
|
121
115
|
onClick: handleClick,
|
|
122
116
|
disabled,
|
|
123
117
|
...buttonProps,
|
|
124
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
118
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Tooltip.HvTooltip, { title: isOverflowing && value, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
125
119
|
Typography.HvTypography,
|
|
126
120
|
{
|
|
121
|
+
component: "div",
|
|
122
|
+
ref: checkOverflow,
|
|
127
123
|
variant,
|
|
128
124
|
noWrap: true,
|
|
129
125
|
className: cx(classes.text, { [classes.textEmpty]: !value }),
|
|
130
126
|
...typographyProps,
|
|
131
127
|
children: value || placeholder
|
|
132
128
|
}
|
|
133
|
-
)
|
|
129
|
+
) })
|
|
134
130
|
}
|
|
135
|
-
) })
|
|
131
|
+
) });
|
|
136
132
|
});
|
|
137
133
|
exports.inlineEditorClasses = InlineEditor_styles.staticClasses;
|
|
138
134
|
exports.HvInlineEditor = HvInlineEditor;
|
|
@@ -2,29 +2,16 @@
|
|
|
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 BaseInput_styles = require("../BaseInput/BaseInput.styles.cjs");
|
|
6
|
-
require("../BaseInput/BaseInput.cjs");
|
|
7
|
-
const Input_styles = require("../Input/Input.styles.cjs");
|
|
8
|
-
require("../Input/Input.cjs");
|
|
9
5
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvInlineEditor", {
|
|
10
|
-
root: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
minHeight: "32px"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
inputBorderContainer: {
|
|
17
|
-
top: "unset",
|
|
18
|
-
bottom: 0
|
|
19
|
-
},
|
|
6
|
+
root: {},
|
|
7
|
+
/** @deprecated unused. use `classes.root::after` instead */
|
|
8
|
+
inputBorderContainer: {},
|
|
20
9
|
input: {},
|
|
21
|
-
inputRoot: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
textOverflow: "ellipsis",
|
|
25
|
-
whiteSpace: "nowrap",
|
|
26
|
-
alignSelf: "center"
|
|
10
|
+
inputRoot: {
|
|
11
|
+
height: "100%",
|
|
12
|
+
minHeight: "32px"
|
|
27
13
|
},
|
|
14
|
+
text: {},
|
|
28
15
|
largeText: {},
|
|
29
16
|
textEmpty: {
|
|
30
17
|
color: uikitStyles.theme.colors.secondary_60
|
|
@@ -37,41 +24,31 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvInlineEdi
|
|
|
37
24
|
height: "100%",
|
|
38
25
|
width: "100%",
|
|
39
26
|
maxWidth: "100%",
|
|
40
|
-
justifyContent: "
|
|
27
|
+
justifyContent: "start",
|
|
28
|
+
textAlign: "start",
|
|
41
29
|
alignItems: "center",
|
|
42
30
|
backgroundColor: uikitStyles.theme.colors.atmo1,
|
|
43
|
-
|
|
31
|
+
borderColor: "transparent",
|
|
44
32
|
"&:hover, &:focus": {
|
|
45
|
-
|
|
33
|
+
borderColor: uikitStyles.theme.colors.primary,
|
|
46
34
|
backgroundColor: uikitStyles.theme.colors.atmo1,
|
|
47
35
|
"& $icon": {
|
|
48
36
|
visibility: "visible"
|
|
49
37
|
}
|
|
50
38
|
},
|
|
51
39
|
"&:active": {
|
|
52
|
-
|
|
40
|
+
borderColor: uikitStyles.theme.colors.secondary,
|
|
53
41
|
backgroundColor: "transparent",
|
|
54
42
|
"& $icon": {
|
|
55
43
|
visibility: "visible"
|
|
56
44
|
}
|
|
57
|
-
},
|
|
58
|
-
"& > div": {
|
|
59
|
-
width: "100%"
|
|
60
|
-
},
|
|
61
|
-
"& > div > span": {
|
|
62
|
-
width: "100%"
|
|
63
45
|
}
|
|
64
46
|
},
|
|
65
47
|
icon: {
|
|
66
48
|
cursor: "pointer",
|
|
67
49
|
visibility: "hidden",
|
|
68
50
|
alignSelf: "center",
|
|
69
|
-
height:
|
|
70
|
-
width: "32px",
|
|
71
|
-
minWidth: "32px",
|
|
72
|
-
"& svg": {
|
|
73
|
-
margin: uikitStyles.theme.spacing(0, "xs")
|
|
74
|
-
}
|
|
51
|
+
height: 16
|
|
75
52
|
},
|
|
76
53
|
iconVisible: {
|
|
77
54
|
visibility: "visible"
|
package/dist/cjs/Input/Input.cjs
CHANGED
|
@@ -448,11 +448,10 @@ const HvInput = generic.fixedForwardRef(function HvInput2(props, ref) {
|
|
|
448
448
|
type: realType,
|
|
449
449
|
classes: {
|
|
450
450
|
input: classes.input,
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
inputBorderContainer: classes.inputBorderContainer
|
|
451
|
+
root: classes.inputRoot,
|
|
452
|
+
focused: classes.inputRootFocused,
|
|
453
|
+
disabled: classes.inputRootDisabled,
|
|
454
|
+
multiline: classes.inputRootMultiline
|
|
456
455
|
},
|
|
457
456
|
invalid: isStateInvalid,
|
|
458
457
|
inputProps: {
|