@ultraviolet/ui 1.27.0 → 1.27.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/index.d.ts
CHANGED
|
@@ -181,7 +181,7 @@ const NumberInput = _ref21 => {
|
|
|
181
181
|
}
|
|
182
182
|
return defaultValue;
|
|
183
183
|
});
|
|
184
|
-
const currentValue = value !== undefined ? value : inputValue;
|
|
184
|
+
const currentValue = value !== undefined && value !== null ? value : inputValue;
|
|
185
185
|
const setValue = function (newValue,
|
|
186
186
|
/**
|
|
187
187
|
* If true, will check if newValue is between minValue and maxValue and set it to minValue or maxValue if it's not.
|
|
@@ -190,20 +190,17 @@ const NumberInput = _ref21 => {
|
|
|
190
190
|
if (hasMinMaxVerification === void 0) {
|
|
191
191
|
hasMinMaxVerification = true;
|
|
192
192
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
setInputValue(maxValue);
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
193
|
+
let nextValue = newValue;
|
|
194
|
+
if (value === undefined && hasMinMaxVerification) {
|
|
195
|
+
if (newValue !== undefined && newValue < minValue) {
|
|
196
|
+
nextValue = minValue;
|
|
197
|
+
}
|
|
198
|
+
if (newValue !== undefined && maxValue !== undefined && newValue > maxValue) {
|
|
199
|
+
nextValue = maxValue;
|
|
203
200
|
}
|
|
204
|
-
setInputValue(newValue);
|
|
205
201
|
}
|
|
206
|
-
|
|
202
|
+
setInputValue(nextValue);
|
|
203
|
+
onChange?.(nextValue);
|
|
207
204
|
};
|
|
208
205
|
const offsetFn = direction => () => {
|
|
209
206
|
const localValue = currentValue ?? 0;
|