@danielgindi/selectbox 1.0.117 → 1.0.119

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.117
2
+ * @danielgindi/selectbox 1.0.119
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  'use strict';
@@ -219,7 +219,7 @@ class DropList {
219
219
  onItemRender: (itemEl, index) => {
220
220
  let item;
221
221
 
222
- if ( /**@type any*/index === GhostSymbol) {
222
+ if (( /**@type any*/index) === GhostSymbol) {
223
223
  item = {
224
224
  label: p.lastMeasureLongestLabelText,
225
225
  value: 'Measure',
@@ -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
 
@@ -4250,7 +4266,7 @@ class SelectBox {
4250
4266
 
4251
4267
  p.sink.
4252
4268
  add(keyEventsTarget, 'keydown.dropdown', (evt) => {
4253
- if ( /**@type HTMLInputElement*/evt.currentTarget.readOnly)
4269
+ if (( /**@type HTMLInputElement*/evt.currentTarget).readOnly)
4254
4270
  return;
4255
4271
 
4256
4272
  let suppressEnterSpaceToggle = false;