@danielgindi/selectbox 1.0.70 → 1.0.71

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/selectbox 1.0.70
2
+ * @danielgindi/selectbox 1.0.71
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  'use strict';
@@ -10249,6 +10249,14 @@ var SelectBox = /*#__PURE__*/function () {
10249
10249
  if (p.input)
10250
10250
  return p.input.value;
10251
10251
  return '';
10252
+ } }, { key: "invokeRefilter", value:
10253
+
10254
+ function invokeRefilter() {
10255
+ var p = this._p;
10256
+ if (!p.filterTerm && !p.filterOnEmptyTerm)
10257
+ return this;
10258
+ p.throttledUpdateListItems();
10259
+ return this;
10252
10260
  }
10253
10261
 
10254
10262
  /**
@@ -10591,7 +10599,10 @@ var SelectBox = /*#__PURE__*/function () {
10591
10599
  */ }, { key: "setFilterOnEmptyTerm", value:
10592
10600
  function setFilterOnEmptyTerm(value) {
10593
10601
  var p = this._p;
10602
+ if (p.filterOnEmptyTerm === value)
10603
+ return this;
10594
10604
  p.filterOnEmptyTerm = value;
10605
+ p.throttledUpdateListItems();
10595
10606
  return this;
10596
10607
  }
10597
10608
 
@@ -10731,7 +10742,10 @@ var SelectBox = /*#__PURE__*/function () {
10731
10742
  */ }, { key: "setFilterFn", value:
10732
10743
  function setFilterFn(fn) {
10733
10744
  var p = this._p;
10745
+ if (p.filterFn === fn)
10746
+ return this;
10734
10747
  p.filterFn = fn;
10748
+ p.throttledUpdateListItems();
10735
10749
  return this;
10736
10750
  }
10737
10751
 
@@ -10847,7 +10861,7 @@ var SelectBox = /*#__PURE__*/function () {
10847
10861
  if (item !== undefined) {
10848
10862
  selectedItems.push(item);
10849
10863
  } else {
10850
- selectedItems.push(_defineProperty({}, p.valueProp, value));
10864
+ selectedItems.push(_defineProperty({}, valueProp, value));
10851
10865
  }
10852
10866
  }} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}
10853
10867
 
@@ -10856,7 +10870,6 @@ var SelectBox = /*#__PURE__*/function () {
10856
10870
  p.selectionChanged = true;
10857
10871
  p.resortBySelectionNeeded = true;
10858
10872
 
10859
- this._updateListItems();
10860
10873
  this._scheduleSync('full');
10861
10874
 
10862
10875
  return this;
@@ -11872,8 +11885,9 @@ var SelectBox = /*#__PURE__*/function () {
11872
11885
  if (hasRefocusedItem) {
11873
11886
  p.dropList.setFocusedItemAtIndex(p.dropList.getFocusedItemIndex());
11874
11887
  }
11875
- } }, { key: "_refilterItems", value:
11888
+ }
11876
11889
 
11890
+ /** @private */ }, { key: "_refilterItems", value:
11877
11891
  function _refilterItems() {
11878
11892
  var p = this._p;
11879
11893
 
@@ -11942,8 +11956,9 @@ var SelectBox = /*#__PURE__*/function () {
11942
11956
  this._trigger('itemschanged', { term: term, mutated: false, count: this.getFilteredItemCount() });
11943
11957
 
11944
11958
  p.itemsChanged = true;
11945
- } }, { key: "_setSelectedItems", value:
11959
+ }
11946
11960
 
11961
+ /** @private */ }, { key: "_setSelectedItems", value:
11947
11962
  function _setSelectedItems(items) {
11948
11963
  var p = this._p,valueProp = p.valueProp;
11949
11964
 
@@ -11960,8 +11975,9 @@ var SelectBox = /*#__PURE__*/function () {
11960
11975
 
11961
11976
  this._updateListItems();
11962
11977
  this._scheduleSync('full');
11963
- } }, { key: "_scheduleSync", value:
11978
+ }
11964
11979
 
11980
+ /** @private */ }, { key: "_scheduleSync", value:
11965
11981
  function _scheduleSync(mode, data) {var _this7 = this;
11966
11982
  var p = this._p;
11967
11983
 
@@ -11983,8 +11999,9 @@ var SelectBox = /*#__PURE__*/function () {
11983
11999
  delete p.syncQueue;
11984
12000
  _this7._performSync(queue);
11985
12001
  });
11986
- } }, { key: "_performSync", value:
12002
+ }
11987
12003
 
12004
+ /** @private */ }, { key: "_performSync", value:
11988
12005
  function _performSync(queue) {var _this8 = this;
11989
12006
  var p = this._p;
11990
12007
 
@@ -12057,8 +12074,9 @@ var SelectBox = /*#__PURE__*/function () {
12057
12074
  break;}
12058
12075
 
12059
12076
  }} catch (err) {_iterator4.e(err);} finally {_iterator4.f();}
12060
- } }, { key: "_cleanupSingleWrapper", value:
12077
+ }
12061
12078
 
12079
+ /** @private */ }, { key: "_cleanupSingleWrapper", value:
12062
12080
  function _cleanupSingleWrapper() {
12063
12081
  var p = this._p;
12064
12082
 
@@ -12356,7 +12374,10 @@ var SelectBox = /*#__PURE__*/function () {
12356
12374
  }
12357
12375
 
12358
12376
  // Update input size
12359
- this._resizeInput()._updateListItems();
12377
+ this._resizeInput();
12378
+
12379
+ // Update list items
12380
+ this._updateListItems();
12360
12381
 
12361
12382
  return this;
12362
12383
  }