@baleada/logic 0.21.2 → 0.21.3

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.cjs CHANGED
@@ -2753,8 +2753,9 @@ class Pickable {
2753
2753
  return this.toItems(this.picks);
2754
2754
  }
2755
2755
  toItems = createMap((index) => this.array[index]);
2756
+ computedMultiple;
2756
2757
  get multiple() {
2757
- return this.picks.length > 1;
2758
+ return this.computedMultiple;
2758
2759
  }
2759
2760
  toPossiblePicks;
2760
2761
  setArray(array) {
@@ -2801,6 +2802,7 @@ class Pickable {
2801
2802
  });
2802
2803
  this.computedFirst = Math.min(...this.picks);
2803
2804
  this.computedLast = Math.max(...this.picks);
2805
+ this.computedMultiple = toUnique(this.picks).length > 1;
2804
2806
  this.picked();
2805
2807
  return this;
2806
2808
  }
@@ -2812,6 +2814,7 @@ class Pickable {
2812
2814
  this.computedPicks = [];
2813
2815
  this.computedFirst = void 0;
2814
2816
  this.computedLast = void 0;
2817
+ this.computedMultiple = false;
2815
2818
  this.omitted();
2816
2819
  return this;
2817
2820
  }
@@ -2819,6 +2822,7 @@ class Pickable {
2819
2822
  this.computedPicks = createFilter((pick, index) => options.reference === "array" ? isUndefined(lazyCollections.find((omit) => pick === omit)(omits)) : isUndefined(lazyCollections.find((omit) => index === omit)(omits)))(this.computedPicks);
2820
2823
  this.computedFirst = Math.min(...this.picks);
2821
2824
  this.computedLast = Math.max(...this.picks);
2825
+ this.computedMultiple = toUnique(this.picks).length > 1;
2822
2826
  this.omitted();
2823
2827
  return this;
2824
2828
  }
package/lib/index.d.ts CHANGED
@@ -630,6 +630,7 @@ declare class Pickable<Item> {
630
630
  get status(): PickableStatus;
631
631
  get items(): Item[];
632
632
  private toItems;
633
+ computedMultiple: boolean;
633
634
  get multiple(): boolean;
634
635
  private toPossiblePicks;
635
636
  setArray(array: Item[]): this;
package/lib/index.js CHANGED
@@ -2742,8 +2742,9 @@ class Pickable {
2742
2742
  return this.toItems(this.picks);
2743
2743
  }
2744
2744
  toItems = createMap((index) => this.array[index]);
2745
+ computedMultiple;
2745
2746
  get multiple() {
2746
- return this.picks.length > 1;
2747
+ return this.computedMultiple;
2747
2748
  }
2748
2749
  toPossiblePicks;
2749
2750
  setArray(array) {
@@ -2790,6 +2791,7 @@ class Pickable {
2790
2791
  });
2791
2792
  this.computedFirst = Math.min(...this.picks);
2792
2793
  this.computedLast = Math.max(...this.picks);
2794
+ this.computedMultiple = toUnique(this.picks).length > 1;
2793
2795
  this.picked();
2794
2796
  return this;
2795
2797
  }
@@ -2801,6 +2803,7 @@ class Pickable {
2801
2803
  this.computedPicks = [];
2802
2804
  this.computedFirst = void 0;
2803
2805
  this.computedLast = void 0;
2806
+ this.computedMultiple = false;
2804
2807
  this.omitted();
2805
2808
  return this;
2806
2809
  }
@@ -2808,6 +2811,7 @@ class Pickable {
2808
2811
  this.computedPicks = createFilter((pick, index) => options.reference === "array" ? isUndefined(find((omit) => pick === omit)(omits)) : isUndefined(find((omit) => index === omit)(omits)))(this.computedPicks);
2809
2812
  this.computedFirst = Math.min(...this.picks);
2810
2813
  this.computedLast = Math.max(...this.picks);
2814
+ this.computedMultiple = toUnique(this.picks).length > 1;
2811
2815
  this.omitted();
2812
2816
  return this;
2813
2817
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baleada/logic",
3
- "version": "0.21.2",
3
+ "version": "0.21.3",
4
4
  "description": "UI logic for the Baleada toolkit",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.js",