@danielgindi/selectbox 2.0.34 → 2.0.36

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import DropList from './DropList.js';
2
- import SelectBox from './SelectBox.js';
1
+ import DropList, { DefaultOptions as DropListDefaultOptions, ItemSymbol } from './DropList.js';
2
+ import SelectBox, { DefaultOptions as SelectBoxDefaultOptions } from './SelectBox.js';
3
3
 
4
- export { DropList, SelectBox };
4
+ export { DropList, SelectBox, DropListDefaultOptions, SelectBoxDefaultOptions, ItemSymbol };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielgindi/selectbox",
3
- "version": "2.0.34",
3
+ "version": "2.0.36",
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
  });