@danielgindi/selectbox 1.0.116 → 1.0.118

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.116
2
+ * @danielgindi/selectbox 1.0.118
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  'use strict';
@@ -639,6 +639,22 @@ class DropList {
639
639
  return this;
640
640
  }
641
641
 
642
+ /**
643
+ * Replaces all current items with the supplied items
644
+ * @param {DropList.Item[]} items The items to set. These are copied.
645
+ * @returns {DropList}
646
+ */
647
+ setItems(items) {
648
+ const p = this._p;
649
+
650
+ p.items.length = 0;
651
+ p.groupCount = 0;
652
+
653
+ p.virtualListHelper.setCount(0);
654
+
655
+ return this.addItems(items);
656
+ }
657
+
642
658
  updateItemByValue(value, newItem) {
643
659
  const p = this._p;
644
660
 
@@ -720,6 +736,20 @@ class DropList {
720
736
  return this;
721
737
  }
722
738
 
739
+ /**
740
+ * Should only be used if the items array has been manually manipulated.
741
+ * @return {DropList}
742
+ */
743
+ invalidate() {
744
+ const p = this._p;
745
+
746
+ p.virtualListHelper.
747
+ invalidate().
748
+ render();
749
+
750
+ return this;
751
+ }
752
+
723
753
  itemDataByValue(value) {
724
754
  const p = this._p;
725
755