@ultraviolet/ui 1.43.1 → 1.43.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
|
@@ -2079,8 +2079,8 @@ declare const NumberInputV2: react.ForwardRefExoticComponent<{
|
|
|
2079
2079
|
error?: string | undefined;
|
|
2080
2080
|
success?: string | boolean | undefined;
|
|
2081
2081
|
helper?: ReactNode;
|
|
2082
|
-
value?: number | undefined;
|
|
2083
|
-
onChange?: ((newValue: number) => void) | undefined;
|
|
2082
|
+
value?: number | null | undefined;
|
|
2083
|
+
onChange?: ((newValue: number | null) => void) | undefined;
|
|
2084
2084
|
min?: number | undefined;
|
|
2085
2085
|
max?: number | undefined;
|
|
2086
2086
|
} & Pick<InputHTMLAttributes<HTMLInputElement>, "autoFocus" | "id" | "aria-label" | "onFocus" | "onBlur" | "name" | "disabled" | "step" | "placeholder" | "readOnly" | "required"> & react.RefAttributes<HTMLInputElement>>;
|
|
@@ -248,12 +248,17 @@ const NumberInputV2 = /*#__PURE__*/forwardRef(({
|
|
|
248
248
|
placeholder: placeholder,
|
|
249
249
|
onKeyDown: event => {
|
|
250
250
|
if (event.key === 'Enter') {
|
|
251
|
-
|
|
251
|
+
if (!localRef.current?.value) {
|
|
252
|
+
onChange?.(null);
|
|
253
|
+
} else if (onChange) {
|
|
254
|
+
onChangeValue(localRef.current?.value ?? '');
|
|
255
|
+
}
|
|
252
256
|
}
|
|
253
257
|
},
|
|
254
258
|
onBlur: event => {
|
|
255
259
|
if (event.target.value === '') {
|
|
256
260
|
onBlur?.(event);
|
|
261
|
+
onChange?.(null);
|
|
257
262
|
return;
|
|
258
263
|
}
|
|
259
264
|
if (onChange) {
|
|
@@ -261,7 +266,7 @@ const NumberInputV2 = /*#__PURE__*/forwardRef(({
|
|
|
261
266
|
}
|
|
262
267
|
onBlur?.(event);
|
|
263
268
|
},
|
|
264
|
-
defaultValue: value,
|
|
269
|
+
defaultValue: value?.toString(),
|
|
265
270
|
onFocus: onFocus,
|
|
266
271
|
"data-size": size,
|
|
267
272
|
step: step,
|
|
@@ -58,7 +58,7 @@ const StyledInputWrapper = /*#__PURE__*/_styled('div', {
|
|
|
58
58
|
theme
|
|
59
59
|
}) => theme.colors.success.border, ";}&[data-error='true']{border-color:", ({
|
|
60
60
|
theme
|
|
61
|
-
}) => theme.colors.danger.border, ";}&[data-
|
|
61
|
+
}) => theme.colors.danger.border, ";}&[data-readonly='true']{background:", ({
|
|
62
62
|
theme
|
|
63
63
|
}) => theme.colors.neutral.backgroundWeak, ";border-color:", ({
|
|
64
64
|
theme
|
|
@@ -70,7 +70,7 @@ const StyledInputWrapper = /*#__PURE__*/_styled('div', {
|
|
|
70
70
|
theme
|
|
71
71
|
}) => theme.colors.neutral.textDisabled, ";&::placeholder{color:", ({
|
|
72
72
|
theme
|
|
73
|
-
}) => theme.colors.neutral.textWeakDisabled, ";}}}&:not([data-disabled='true']):not([data-
|
|
73
|
+
}) => theme.colors.neutral.textWeakDisabled, ";}}}&:not([data-disabled='true']):not([data-readonly]):hover{border-color:", ({
|
|
74
74
|
theme
|
|
75
75
|
}) => theme.colors.primary.border, ";}", ({
|
|
76
76
|
theme,
|
|
@@ -159,7 +159,7 @@ const TextInputV2 = /*#__PURE__*/forwardRef(({
|
|
|
159
159
|
children: jsxs(StyledInputWrapper, {
|
|
160
160
|
hasFocus: hasFocus,
|
|
161
161
|
"data-disabled": disabled,
|
|
162
|
-
"data-
|
|
162
|
+
"data-readonly": readOnly,
|
|
163
163
|
"data-success": !!success,
|
|
164
164
|
"data-error": !!error,
|
|
165
165
|
size: size,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultraviolet/ui",
|
|
3
|
-
"version": "1.43.
|
|
3
|
+
"version": "1.43.2",
|
|
4
4
|
"description": "Ultraviolet UI",
|
|
5
5
|
"homepage": "https://github.com/scaleway/ultraviolet#readme",
|
|
6
6
|
"repository": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-datepicker": "4.25.0",
|
|
64
64
|
"react-flatten-children": "1.1.2",
|
|
65
65
|
"react-select": "5.8.0",
|
|
66
|
-
"react-toastify": "10.0.
|
|
66
|
+
"react-toastify": "10.0.5",
|
|
67
67
|
"react-use-clipboard": "1.0.9",
|
|
68
68
|
"reakit": "1.3.11",
|
|
69
69
|
"@ultraviolet/themes": "1.9.0",
|