@danielgindi/selectbox 1.0.78 → 1.0.79
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/lib.cjs.js +33 -48
- package/dist/lib.cjs.js.map +1 -1
- package/dist/lib.cjs.min.js +2 -2
- package/dist/lib.cjs.min.js.map +1 -1
- package/dist/lib.es6.js +37 -52
- package/dist/lib.es6.js.map +1 -1
- package/dist/lib.es6.min.js +2 -2
- package/dist/lib.es6.min.js.map +1 -1
- package/dist/lib.umd.js +33 -48
- package/dist/lib.umd.js.map +1 -1
- package/dist/lib.umd.min.js +2 -2
- package/dist/lib.umd.min.js.map +1 -1
- package/lib/DropList.js +8 -6
- package/lib/SelectBox.js +30 -47
- package/package.json +1 -1
package/dist/lib.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @danielgindi/selectbox 1.0.
|
|
2
|
+
* @danielgindi/selectbox 1.0.79
|
|
3
3
|
* git://github.com/danielgindi/selectbox.git
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -6651,6 +6651,14 @@
|
|
|
6651
6651
|
|
|
6652
6652
|
function previousPage(event) {
|
|
6653
6653
|
this._move('prev_page', event);
|
|
6654
|
+
} }, { key: "goToFirst", value:
|
|
6655
|
+
|
|
6656
|
+
function goToFirst(event) {
|
|
6657
|
+
this._move('first', event);
|
|
6658
|
+
} }, { key: "goToLast", value:
|
|
6659
|
+
|
|
6660
|
+
function goToLast(event) {
|
|
6661
|
+
this._move('last', event);
|
|
6654
6662
|
} }, { key: "toggleFocusedItem", value:
|
|
6655
6663
|
|
|
6656
6664
|
function toggleFocusedItem() {
|
|
@@ -7678,12 +7686,6 @@
|
|
|
7678
7686
|
var p = this._p;
|
|
7679
7687
|
|
|
7680
7688
|
p.sink.
|
|
7681
|
-
add(p.el, 'mousedown', function (event) {
|
|
7682
|
-
var li = Dom.closestUntil(event.target, 'li', event.currentTarget);
|
|
7683
|
-
if (!li) return;
|
|
7684
|
-
|
|
7685
|
-
event.preventDefault();
|
|
7686
|
-
}).
|
|
7687
7689
|
add(p.el, 'mouseup', function (event) {
|
|
7688
7690
|
var li = Dom.closestUntil(event.target, 'li', event.currentTarget);
|
|
7689
7691
|
if (!li) return;
|
|
@@ -11406,6 +11408,16 @@
|
|
|
11406
11408
|
case keycodeJs.VALUE_PAGE_DOWN:
|
|
11407
11409
|
case keycodeJs.VALUE_UP:
|
|
11408
11410
|
case keycodeJs.VALUE_DOWN:
|
|
11411
|
+
case keycodeJs.VALUE_HOME:
|
|
11412
|
+
case keycodeJs.VALUE_END:
|
|
11413
|
+
if ((evt.key === keycodeJs.VALUE_HOME || evt.key === keycodeJs.VALUE_END) &&
|
|
11414
|
+
p.input && p.input.value.length > 0 && !p.lastKeyAllowsNonTypeKeys) {
|
|
11415
|
+
// Allow using HOME/END button within the textbox
|
|
11416
|
+
suppressKeyPressRepeat = true;
|
|
11417
|
+
dropList._keydownFreeType(evt);
|
|
11418
|
+
break;
|
|
11419
|
+
}
|
|
11420
|
+
|
|
11409
11421
|
suppressKeyPress = true;
|
|
11410
11422
|
evt.preventDefault();
|
|
11411
11423
|
|
|
@@ -11431,13 +11443,20 @@
|
|
|
11431
11443
|
} else {
|
|
11432
11444
|
_this6._moveNext();
|
|
11433
11445
|
}
|
|
11434
|
-
break;
|
|
11446
|
+
break;
|
|
11435
11447
|
|
|
11448
|
+
case keycodeJs.VALUE_HOME:
|
|
11449
|
+
dropList.goToFirst(evt);
|
|
11450
|
+
break;
|
|
11451
|
+
|
|
11452
|
+
case keycodeJs.VALUE_END:
|
|
11453
|
+
dropList.goToLast(evt);
|
|
11454
|
+
break;}
|
|
11436
11455
|
|
|
11437
11456
|
break;
|
|
11438
11457
|
|
|
11439
11458
|
case keycodeJs.VALUE_SPACE:
|
|
11440
|
-
if (p.
|
|
11459
|
+
if (p.lastKeyAllowsNonTypeKeys) {
|
|
11441
11460
|
if (dropList.isVisible() && dropList.hasFocusedItem()) {
|
|
11442
11461
|
suppressKeyPress = true;
|
|
11443
11462
|
suppressKeyPressRepeat = true;
|
|
@@ -11478,11 +11497,13 @@
|
|
|
11478
11497
|
break;}
|
|
11479
11498
|
|
|
11480
11499
|
|
|
11481
|
-
p.
|
|
11500
|
+
p.lastKeyAllowsNonTypeKeys = evt.key === keycodeJs.VALUE_UP ||
|
|
11482
11501
|
evt.key === keycodeJs.VALUE_DOWN ||
|
|
11483
11502
|
evt.key === keycodeJs.VALUE_PAGE_UP ||
|
|
11484
11503
|
evt.key === keycodeJs.VALUE_PAGE_DOWN ||
|
|
11485
|
-
evt.key === keycodeJs.
|
|
11504
|
+
evt.key === keycodeJs.VALUE_HOME ||
|
|
11505
|
+
evt.key === keycodeJs.VALUE_END ||
|
|
11506
|
+
evt.key === keycodeJs.VALUE_SPACE && !!p.lastKeyAllowsNonTypeKeys;
|
|
11486
11507
|
}).
|
|
11487
11508
|
add(keyEventsTarget, 'keypress.dropdown', function (evt) {
|
|
11488
11509
|
if (suppressKeyPress) {
|
|
@@ -11495,9 +11516,8 @@
|
|
|
11495
11516
|
return;
|
|
11496
11517
|
|
|
11497
11518
|
if (evt.key === keycodeJs.VALUE_ENTER ||
|
|
11498
|
-
|
|
11499
11519
|
evt.key === keycodeJs.VALUE_SPACE &&
|
|
11500
|
-
p.
|
|
11520
|
+
p.lastKeyAllowsNonTypeKeys &&
|
|
11501
11521
|
!p.multi &&
|
|
11502
11522
|
!dropList.hasFocusedItem())
|
|
11503
11523
|
|
|
@@ -11505,42 +11525,7 @@
|
|
|
11505
11525
|
_this6.toggleList();
|
|
11506
11526
|
evt.preventDefault();
|
|
11507
11527
|
evt.stopPropagation();
|
|
11508
|
-
return;
|
|
11509
11528
|
}
|
|
11510
|
-
|
|
11511
|
-
switch (evt.key) {
|
|
11512
|
-
case keycodeJs.VALUE_PAGE_UP:
|
|
11513
|
-
case keycodeJs.VALUE_PAGE_DOWN:
|
|
11514
|
-
case keycodeJs.VALUE_UP:
|
|
11515
|
-
case keycodeJs.VALUE_DOWN:
|
|
11516
|
-
evt.preventDefault();
|
|
11517
|
-
|
|
11518
|
-
switch (evt.key) {
|
|
11519
|
-
case keycodeJs.VALUE_PAGE_UP:
|
|
11520
|
-
if (dropList.isVisible())
|
|
11521
|
-
dropList.previousPage(evt);
|
|
11522
|
-
break;
|
|
11523
|
-
case keycodeJs.VALUE_PAGE_DOWN:
|
|
11524
|
-
if (dropList.isVisible())
|
|
11525
|
-
dropList.nextPage(evt);
|
|
11526
|
-
break;
|
|
11527
|
-
case keycodeJs.VALUE_UP:
|
|
11528
|
-
if (dropList.isVisible()) {
|
|
11529
|
-
dropList.previous(evt);
|
|
11530
|
-
} else {
|
|
11531
|
-
_this6._movePrev();
|
|
11532
|
-
}
|
|
11533
|
-
break;
|
|
11534
|
-
case keycodeJs.VALUE_DOWN:
|
|
11535
|
-
if (dropList.isVisible()) {
|
|
11536
|
-
dropList.next(evt);
|
|
11537
|
-
} else {
|
|
11538
|
-
_this6._moveNext();
|
|
11539
|
-
}
|
|
11540
|
-
break;}
|
|
11541
|
-
|
|
11542
|
-
break;}
|
|
11543
|
-
|
|
11544
11529
|
});
|
|
11545
11530
|
|
|
11546
11531
|
if (p.input) {
|