bkui-vue 2.0.1-beta.45 → 2.0.1-beta.46
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.cjs.js +31 -31
- package/dist/index.esm.js +2342 -2339
- package/dist/index.umd.js +25 -25
- package/lib/index.js +1 -1
- package/lib/input/index.js +8 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
package/lib/input/index.js
CHANGED
@@ -1101,20 +1101,23 @@ var inputEmitEventsType = (_inputEmitEventsType = {}, _defineProperty(_definePro
|
|
1101
1101
|
isCNInput.value = false;
|
1102
1102
|
handleInput(e);
|
1103
1103
|
}
|
1104
|
+
function isNum(num) {
|
1105
|
+
return typeof num === 'number';
|
1106
|
+
}
|
1104
1107
|
function handleNumber(modelValue, step) {
|
1105
1108
|
var INC = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
1106
|
-
var numStep = Number(step);
|
1109
|
+
var numStep = Number(step) || 1;
|
1107
1110
|
var precision = Number.isInteger(props.precision) ? props.precision : 0;
|
1108
1111
|
var val = Number(modelValue);
|
1109
|
-
var factor =
|
1112
|
+
var factor = isNum(numStep) ? numStep : 1;
|
1110
1113
|
if (Number.isNaN(val)) {
|
1111
|
-
return
|
1114
|
+
return isNum(props.min) ? props.min : 0;
|
1112
1115
|
}
|
1113
1116
|
var newVal = val + (INC ? factor : -1 * factor);
|
1114
|
-
if (
|
1117
|
+
if (isNum(props.max)) {
|
1115
1118
|
newVal = Math.min(newVal, props.max);
|
1116
1119
|
}
|
1117
|
-
if (
|
1120
|
+
if (isNum(props.min)) {
|
1118
1121
|
newVal = Math.max(newVal, props.min);
|
1119
1122
|
}
|
1120
1123
|
return +newVal.toFixed(precision);
|