@open-slot-ui/core 0.13.2 → 0.13.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/dist/index.cjs CHANGED
@@ -670,7 +670,8 @@ var SliderControl = class extends Control {
670
670
  bus;
671
671
  states = {
672
672
  idle: { interactable: true },
673
- dragging: { interactable: true }
673
+ dragging: { interactable: true },
674
+ disabled: { interactable: false }
674
675
  };
675
676
  value = new Signal(0.5);
676
677
  label;
@@ -682,11 +683,20 @@ var SliderControl = class extends Control {
682
683
  this.bus?.emit("valueChanged", { id: this.id, value: c });
683
684
  }
684
685
  beginDrag() {
686
+ if (this.current === "disabled") return;
685
687
  this.setState("dragging");
686
688
  }
687
689
  endDrag() {
690
+ if (this.current === "disabled") return;
688
691
  this.setState("idle");
689
692
  }
693
+ /** Grey the slider out + block interaction (e.g. the volume sliders while sound is off). */
694
+ disable() {
695
+ this.setState("disabled");
696
+ }
697
+ enable() {
698
+ if (this.current === "disabled") this.setState("idle");
699
+ }
690
700
  };
691
701
 
692
702
  // src/controls/PanelControl.ts