@danielgindi/selectbox 1.0.117 → 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.es6.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/selectbox 1.0.117
2
+ * @danielgindi/selectbox 1.0.118
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  import { createElement, closestUntil, setElementAttrs, next, prev } from '@danielgindi/dom-utils/lib/Dom';
@@ -637,6 +637,22 @@ class DropList {
637
637
  return this;
638
638
  }
639
639
 
640
+ /**
641
+ * Replaces all current items with the supplied items
642
+ * @param {DropList.Item[]} items The items to set. These are copied.
643
+ * @returns {DropList}
644
+ */
645
+ setItems(items) {
646
+ const p = this._p;
647
+
648
+ p.items.length = 0;
649
+ p.groupCount = 0;
650
+
651
+ p.virtualListHelper.setCount(0);
652
+
653
+ return this.addItems(items);
654
+ }
655
+
640
656
  updateItemByValue(value, newItem) {
641
657
  const p = this._p;
642
658