@danielgindi/selectbox 2.0.43 → 2.0.45

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/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
201
202
  'input:resize': input box resized
202
203
  'itemschanged' {term, mutated, count}: the current set of items has changed
203
204
  */
@@ -713,6 +714,7 @@ class SelectBox {
713
714
  if (performSearch) {
714
715
  p.filterTerm = p.input.value.trim();
715
716
  p.dropList?.setSearchTerm(p.filterTerm, performSearch);
717
+ this._trigger('search:term', p.filterTerm);
716
718
  }
717
719
 
718
720
  return this;
@@ -2274,6 +2276,7 @@ class SelectBox {
2274
2276
 
2275
2277
  p.filterTerm = p.input.value.trim();
2276
2278
  p.dropList?.setSearchTerm(p.filterTerm, true);
2279
+ this._trigger('search:term', p.filterTerm);
2277
2280
  })
2278
2281
  .add(p.input, 'click.dropdown', () => {
2279
2282
  if (p.disabled || p.readOnly) return;
@@ -3117,6 +3120,7 @@ class SelectBox {
3117
3120
 
3118
3121
  p.filterTerm = '';
3119
3122
  p.dropList?.setSearchTerm('', true);
3123
+ this._trigger('search:term', p.filterTerm);
3120
3124
  }
3121
3125
 
3122
3126
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielgindi/selectbox",
3
- "version": "2.0.43",
3
+ "version": "2.0.45",
4
4
  "description": "A collection of dom utilities. So you can work natively with the dom without dom frameworks.",
5
5
  "main": "dist/lib.cjs.min.js",
6
6
  "module": "lib/index.js",
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
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':