Explorar o código

Grid\Column::modal()增加xl方法

jqh %!s(int64=5) %!d(string=hai) anos
pai
achega
b4c2f301be
Modificáronse 1 ficheiros con 10 adicións e 1 borrados
  1. 10 1
      src/Grid/Displayers/Modal.php

+ 10 - 1
src/Grid/Displayers/Modal.php

@@ -10,11 +10,18 @@ class Modal extends AbstractDisplayer
 {
     protected $title;
 
+    protected $xl = false;
+
     public function title(string $title)
     {
         $this->title = $title;
     }
 
+    public function xl()
+    {
+        $this->xl = true;
+    }
+
     protected function setUpLazyRenderable(LazyRenderable $renderable)
     {
         return clone $renderable->payload(['key' => $this->getKey()]);
@@ -48,7 +55,9 @@ class Modal extends AbstractDisplayer
         $title = $this->title ?: $title;
 
         return WidgetModal::make()
-            ->lg()
+            ->when(true, function ($modal) {
+                $this->xl ? $modal->xl() : $modal->lg();
+            })
             ->title($title)
             ->body($html)
             ->delay(300)