From 2d16d20dbcc5f41ffc98ece634f00679b884f5ca Mon Sep 17 00:00:00 2001 From: am-css <44317255+am-css@users.noreply.github.com> Date: Wed, 3 Nov 2021 19:16:58 +0000 Subject: [PATCH] feat: allow to set options on Wrapper against issue #341 --- src/Dashboards/Wrappers/Wrapper.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Dashboards/Wrappers/Wrapper.php b/src/Dashboards/Wrappers/Wrapper.php index 5fdfb742..ac8fd138 100644 --- a/src/Dashboards/Wrappers/Wrapper.php +++ b/src/Dashboards/Wrappers/Wrapper.php @@ -22,7 +22,7 @@ * @link http://lavacharts.com Official Docs Site * @license http://opensource.org/licenses/MIT MIT */ -class Wrapper implements \JsonSerializable, Jsonable, JsClass +class Wrapper extends Customizable implements \JsonSerializable, Jsonable, JsClass { use HasElementId; @@ -50,6 +50,7 @@ public function __construct(Wrappable $itemToWrap, ElementId $elementId) { $this->contents = $itemToWrap; $this->elementId = $elementId; + $this->options = array(); } /** @@ -69,11 +70,11 @@ public function unwrap() */ public function jsonSerialize() { - return [ + return array_merge($this->options, [ 'options' => $this->contents, 'containerId' => (string) $this->elementId, $this->contents->getWrapType() => $this->contents->getType() - ]; + ]); } /**