bootstrap-input-spinner 3.1.9 → 3.1.13
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bootstrap-input-spinner",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.13",
|
|
4
4
|
"description": "A Bootstrap 5 / jQuery plugin to create input spinner elements for number input.",
|
|
5
5
|
"browser": "./src/bootstrap-input-spinner.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"homepage": "https://shaack.com/en/open-source-components",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"prismjs": "^1.
|
|
29
|
+
"prismjs": "^1.27.0",
|
|
30
30
|
"teevi": "^2.1.10"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -40,7 +40,10 @@
|
|
|
40
40
|
if (arguments.length >= 1) {
|
|
41
41
|
for (var i = 0; i < this.length; i++) {
|
|
42
42
|
if (this[i]["bootstrap-input-spinner"] && this[i].setValue) {
|
|
43
|
-
this[i]
|
|
43
|
+
var element = this[i];
|
|
44
|
+
setTimeout(function () {
|
|
45
|
+
element.setValue(value)
|
|
46
|
+
})
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
}
|
|
@@ -161,6 +164,9 @@
|
|
|
161
164
|
newValue = $original[0].inputSpinnerEditor.parse(newValue)
|
|
162
165
|
setValue(newValue, focusOut)
|
|
163
166
|
dispatchEvent($original, event.type)
|
|
167
|
+
if (props.keyboardStepping && focusOut) { // stop stepping
|
|
168
|
+
resetTimer()
|
|
169
|
+
}
|
|
164
170
|
}).on("keydown", function (event) {
|
|
165
171
|
if (props.keyboardStepping) {
|
|
166
172
|
if (event.which === 38) { // up arrow pressed
|
package/test/Test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {describe, it, assert} from "../node_modules/teevi/src/teevi.js"
|
|
2
2
|
|
|
3
3
|
describe('bootstrap-input-spinner', function () {
|
|
4
|
-
it('Should display the spinner', function () {
|
|
4
|
+
it('Should display and destroy the spinner', function () {
|
|
5
5
|
addInput()
|
|
6
6
|
const $input = $("input[type='number']")
|
|
7
7
|
$input.inputSpinner()
|
|
@@ -14,4 +14,4 @@ function addInput() {
|
|
|
14
14
|
var input = document.createElement("input")
|
|
15
15
|
input.type = "number"
|
|
16
16
|
testContainer.append(input)
|
|
17
|
-
}
|
|
17
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<title>Test bug #98</title>
|
|
5
|
-
<link rel="stylesheet" href="
|
|
5
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
|
|
6
6
|
<link rel="stylesheet" href="test.css"/>
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
8
8
|
</head>
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
</div>
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
33
|
-
<script src="
|
|
34
|
-
<script src="
|
|
33
|
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
|
34
|
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ" crossorigin="anonymous"></script>
|
|
35
35
|
<script src="../../src/bootstrap-input-spinner.js"></script>
|
|
36
36
|
<script>
|
|
37
37
|
$('input').inputSpinner()
|
|
@@ -40,4 +40,4 @@
|
|
|
40
40
|
})
|
|
41
41
|
</script>
|
|
42
42
|
</body>
|
|
43
|
-
</html>
|
|
43
|
+
</html>
|