@danielgindi/selectbox 2.0.35 → 2.0.37

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
@@ -2775,10 +2775,6 @@ class DropList {
2775
2775
  let next = p.virtualListHelper.getItemElementAt(matchIndex);
2776
2776
  this._focus(evt, next || null, matchIndex, true);
2777
2777
 
2778
- if (!this.isVisible()) {
2779
- this.triggerItemSelection(next ? null : items[matchIndex], evt);
2780
- }
2781
-
2782
2778
  // Record the last filter used
2783
2779
  p.previousFilter = keyword;
2784
2780
 
package/lib/SelectBox.js CHANGED
@@ -2221,6 +2221,10 @@ class SelectBox {
2221
2221
  break;
2222
2222
 
2223
2223
  default:
2224
+ if (!dropList.isVisible()) {
2225
+ this.openList();
2226
+ }
2227
+
2224
2228
  dropList._keydownFreeType(evt);
2225
2229
  break;
2226
2230
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielgindi/selectbox",
3
- "version": "2.0.35",
3
+ "version": "2.0.37",
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/DropList.vue CHANGED
@@ -3,7 +3,7 @@
3
3
  </template>
4
4
 
5
5
  <script>
6
- import DropList from '../lib/DropList';
6
+ import DropList, { DefaultOptions } from '../lib/DropList';
7
7
  import DomEventsSink from '@danielgindi/dom-utils/lib/DomEventsSink';
8
8
  import { createSlotBasedRenderFunc, createSlotBasedUnrenderFunc } from './utils/slots.js';
9
9
  import { version } from 'vue';
@@ -60,11 +60,11 @@ export const PropTypes = {
60
60
  },
61
61
  noResultsText: {
62
62
  type: String,
63
- default: 'No matching results',
63
+ required: false,
64
64
  },
65
65
  filterThrottleWindow: {
66
66
  type: Number,
67
- default: 300,
67
+ required: false,
68
68
  },
69
69
  filterOnEmptyTerm: {
70
70
  type: Boolean,
@@ -303,12 +303,12 @@ export default {
303
303
 
304
304
  noResultsText(value) {
305
305
  if (this.nonReactive.instance)
306
- this.nonReactive.instance.setNoResultsText(value);
306
+ this.nonReactive.instance.setNoResultsText(value ?? DefaultOptions.noResultsText);
307
307
  },
308
308
 
309
309
  filterThrottleWindow(value) {
310
310
  if (this.nonReactive.instance)
311
- this.nonReactive.instance.setFilterThrottleWindow(value || 0);
311
+ this.nonReactive.instance.setFilterThrottleWindow(value ?? DefaultOptions.filterThrottleWindow ?? 0);
312
312
  },
313
313
 
314
314
  filterOnEmptyTerm(value) {
package/vue/SelectBox.vue CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <script>
6
6
  import { version } from 'vue';
7
- import SelectBox from '../lib/SelectBox';
7
+ import SelectBox, { DefaultOptions } from '../lib/SelectBox';
8
8
  import { createSlotBasedRenderFunc, createSlotBasedUnrenderFunc } from './utils/slots';
9
9
  import deepEqual from 'fast-deep-equal';
10
10
 
@@ -111,11 +111,11 @@ export const PropTypes = {
111
111
  },
112
112
  noResultsText: {
113
113
  type: String,
114
- default: 'No matching results',
114
+ required: false,
115
115
  },
116
116
  filterThrottleWindow: {
117
117
  type: Number,
118
- default: 300,
118
+ required: false,
119
119
  },
120
120
  filterOnEmptyTerm: {
121
121
  type: Boolean,
@@ -246,7 +246,7 @@ export const PropTypes = {
246
246
  },
247
247
  closeListWhenLoading: {
248
248
  type: Boolean,
249
- default: true,
249
+ required: false,
250
250
  },
251
251
  clearInputWhen: {
252
252
  type: Array,
@@ -570,12 +570,12 @@ export default {
570
570
 
571
571
  noResultsText(value) {
572
572
  if (this.nonReactive.instance)
573
- this.nonReactive.instance.setNoResultsText(value);
573
+ this.nonReactive.instance.setNoResultsText(value ?? DefaultOptions.noResultsText);
574
574
  },
575
575
 
576
576
  filterThrottleWindow(value) {
577
577
  if (this.nonReactive.instance)
578
- this.nonReactive.instance.setFilterThrottleWindow(value || 0);
578
+ this.nonReactive.instance.setFilterThrottleWindow(value ?? DefaultOptions.filterThrottleWindow ?? 0);
579
579
  },
580
580
 
581
581
  filterOnEmptyTerm(value) {
@@ -710,7 +710,7 @@ export default {
710
710
 
711
711
  closeListWhenLoading() {
712
712
  if (this.nonReactive.instance)
713
- this.nonReactive.instance.setCloseListWhenLoading(!!this.closeListWhenLoading);
713
+ this.nonReactive.instance.setCloseListWhenLoading(this.closeListWhenLoading ?? DefaultOptions.closeListWhenLoading);
714
714
  },
715
715
 
716
716
  clearInputWhen() {
@@ -827,8 +827,8 @@ export default {
827
827
  blurOnSingleSelection: this.blurOnSingleSelection,
828
828
  multi: this.multi,
829
829
  searchable: this.searchable,
830
- noResultsText: this.noResultsText,
831
- filterThrottleWindow: this.filterThrottleWindow,
830
+ noResultsText: this.noResultsText ?? DefaultOptions.noResultsText,
831
+ filterThrottleWindow: this.filterThrottleWindow ?? DefaultOptions.filterThrottleWindow ?? 0,
832
832
  filterOnEmptyTerm: this.filterOnEmptyTerm,
833
833
  labelProp: this.labelProp,
834
834
  valueProp: this.valueProp,
@@ -848,7 +848,7 @@ export default {
848
848
  on: this._handleBoxEvents.bind(this),
849
849
  additionalClasses: this.additionalClassesList,
850
850
  isLoadingMode: this.isLoadingMode,
851
- closeListWhenLoading: this.closeListWhenLoading,
851
+ closeListWhenLoading: this.closeListWhenLoading ?? DefaultOptions.closeListWhenLoading,
852
852
  clearInputWhen: this.clearInputWhen,
853
853
  treatGroupSelectionAsItems: this.treatGroupSelectionAsItems,
854
854
  });