@danielgindi/selectbox 2.0.43 → 2.0.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/lib.cjs.js +10 -1
- 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 +10 -1
- 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 +10 -1
- 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 +5 -0
- package/lib/SelectBox.js +4 -0
- package/package.json +1 -1
- package/vue/SelectBox.vue +3 -0
package/lib/DropList.js
CHANGED
|
@@ -1502,6 +1502,11 @@ class DropList {
|
|
|
1502
1502
|
this._updateWidth();
|
|
1503
1503
|
}
|
|
1504
1504
|
|
|
1505
|
+
// Update estimated item heights after width is set
|
|
1506
|
+
if (p.virtualListHelper.isVirtual()) {
|
|
1507
|
+
p.virtualListHelper.render();
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1505
1510
|
// How much space is there above, and how much below?
|
|
1506
1511
|
let roomAbove = targetBox.top - viewport.top;
|
|
1507
1512
|
let roomBelow = viewport.bottom - targetBox.bottom;
|
package/lib/SelectBox.js
CHANGED
|
@@ -198,6 +198,7 @@ Emits the following events:
|
|
|
198
198
|
'search' {value}: input box value has changed
|
|
199
199
|
'search:focus': input box has gained focus
|
|
200
200
|
'search:blur': input box has lost focus
|
|
201
|
+
'search:term': search term has been updated, before results were re-filtered
|
|
201
202
|
'input:resize': input box resized
|
|
202
203
|
'itemschanged' {term, mutated, count}: the current set of items has changed
|
|
203
204
|
*/
|
|
@@ -712,6 +713,7 @@ class SelectBox {
|
|
|
712
713
|
|
|
713
714
|
if (performSearch) {
|
|
714
715
|
p.filterTerm = p.input.value.trim();
|
|
716
|
+
this._trigger('search:term', p.filterTerm);
|
|
715
717
|
p.dropList?.setSearchTerm(p.filterTerm, performSearch);
|
|
716
718
|
}
|
|
717
719
|
|
|
@@ -2273,6 +2275,7 @@ class SelectBox {
|
|
|
2273
2275
|
if (p.disabled || p.readOnly) return;
|
|
2274
2276
|
|
|
2275
2277
|
p.filterTerm = p.input.value.trim();
|
|
2278
|
+
this._trigger('search:term', p.filterTerm);
|
|
2276
2279
|
p.dropList?.setSearchTerm(p.filterTerm, true);
|
|
2277
2280
|
})
|
|
2278
2281
|
.add(p.input, 'click.dropdown', () => {
|
|
@@ -3116,6 +3119,7 @@ class SelectBox {
|
|
|
3116
3119
|
p.input.value = value == null ? '' : String(value);
|
|
3117
3120
|
|
|
3118
3121
|
p.filterTerm = '';
|
|
3122
|
+
this._trigger('search:term', p.filterTerm);
|
|
3119
3123
|
p.dropList?.setSearchTerm('', true);
|
|
3120
3124
|
}
|
|
3121
3125
|
|
package/package.json
CHANGED
package/vue/SelectBox.vue
CHANGED
|
@@ -26,6 +26,7 @@ const isVue3 = version > '3.';
|
|
|
26
26
|
* 'search': `string` - input box value has changed
|
|
27
27
|
* 'search:focus': input box has gained focus
|
|
28
28
|
* 'search:blur': input box has lost focus
|
|
29
|
+
* 'search:term': search term has been updated, before results were re-filtered
|
|
29
30
|
* 'input:resize': input box resized
|
|
30
31
|
* 'input' (Vue v2): (on select, clear, addsel, removesel) - fired after any of the above events.
|
|
31
32
|
* 'update:modelValue' (Vue v3): (on select, clear, addsel, removesel) - fired after any of the above events.
|
|
@@ -297,6 +298,7 @@ export default {
|
|
|
297
298
|
'close',
|
|
298
299
|
'search:focus',
|
|
299
300
|
'search:blur',
|
|
301
|
+
'search:term',
|
|
300
302
|
'addsel:before',
|
|
301
303
|
'addsel',
|
|
302
304
|
'removesel:before',
|
|
@@ -785,6 +787,7 @@ export default {
|
|
|
785
787
|
case 'close':
|
|
786
788
|
case 'search:focus':
|
|
787
789
|
case 'search:blur':
|
|
790
|
+
case 'search:term':
|
|
788
791
|
case 'addsel:before':
|
|
789
792
|
case 'addsel':
|
|
790
793
|
case 'removesel:before':
|