From daff2ae609b38b85c0f4c7d18bd4556de5dee8c9 Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Thu, 12 Oct 2023 17:53:56 +0300 Subject: [PATCH 1/2] add option for tooltips --- src/Forms/Nouislider.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Forms/Nouislider.php b/src/Forms/Nouislider.php index 214252d..ed801d0 100644 --- a/src/Forms/Nouislider.php +++ b/src/Forms/Nouislider.php @@ -58,6 +58,8 @@ class Nouislider extends Field implements Contracts\HasAffixActions */ protected $minValue = null; + protected bool | Closure | null $tooltips = false; + /** * @var view-string */ @@ -130,6 +132,13 @@ public function minValue($value): static return $this; } + public function tooltips($value): static + { + $this->tooltips = $value; + + return $this; + } + public function orientation($value) { $this->orientation = $value; @@ -163,6 +172,11 @@ public function getMinValue() return $this->evaluate($this->minValue); } + public function getTooltips() + { + return $this->evaluate($this->tooltips); + } + public function getSnap() { return $this->evaluate($this->snap); @@ -260,6 +274,7 @@ public function getOptions() 'animate' => $this->getAnimate(), 'animationDuration' => $this->getAnimationDuration(), 'cssPrefix' => $this->getCssPrefix(), + 'tooltips' => $this->getTooltips(), ]; } } From a2541a67f55ac67a58100a38fc227d7613ed1e8f Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Thu, 12 Oct 2023 18:33:33 +0300 Subject: [PATCH 2/2] Update Nouislider.php --- src/Forms/Nouislider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Forms/Nouislider.php b/src/Forms/Nouislider.php index ed801d0..929e250 100644 --- a/src/Forms/Nouislider.php +++ b/src/Forms/Nouislider.php @@ -132,7 +132,7 @@ public function minValue($value): static return $this; } - public function tooltips($value): static + public function tooltips($value = true): static { $this->tooltips = $value;