1- @aware ([' isTailwind' ' isTailwind4' ' isBootstrap'  )
1+ @aware ([' isTailwind' ' isTailwind4' ' isBootstrap' ,  ' tableName ' ,  ' localisationPath '  )
22@php ($actionWrapperAttributes  =  $this -> getActionWrapperAttributes ()
33@php ($actionsPosition  =  $this -> getActionsPosition ()
44@php ($showActionsInToolbar  =  $this -> showActionsInToolbar ()
5+ @php ($actions  =  $this -> getActions ()
56
6- <div  {{  $attributes  
7-             -> merge ($actionWrapperAttributes ) 
8-             -> class ([ 
9-                 ' flex flex-cols py-2 space-x-2' =>  $isTailwind  &&  ($actionWrapperAttributes [' default-styling' true ), 
10-                 ' ' =>  $isTailwind  &&  ($actionWrapperAttributes [' default-colors' true ), 
11-                 ' tw4ph flex flex-cols py-2 space-x-2' =>  $isTailwind4  &&  ($actionWrapperAttributes [' default-styling' true ), 
12-                 ' tw4ph ' =>  $isTailwind4  &&  ($actionWrapperAttributes [' default-colors' true ), 
13- 
14- 
15-   
16-                 ' d-flex flex-cols py-2 space-x-2' =>  $isBootstrap  &&  ($actionWrapperAttributes [' default-styling' true ), 
17-                 ' ' =>  $isBootstrap  &&  ($actionWrapperAttributes [' default-colors' true ), 
18-                  
19-                 //  All 
20-                 ' justify-start' =>  $actionsPosition  ===  ' left'  
21-                 ' justify-center' =>  $actionsPosition  ===  ' center'  
22-                 ' justify-end' =>  $actionsPosition  ===  ' right'  
23-                 ' pl-2' =>  $showActionsInToolbar  &&  $actionsPosition  ===  ' left'  
24-                 ' pr-2' =>  $showActionsInToolbar  &&  $actionsPosition  ===  ' right'  
25-             ]) 
26-             -> except ([' default' ' default-styling' ' default-colors'  
27-          } }
28-     @foreach ($this -> getActions () as  $action 
29-         {{  $action -> render ()  } }
30-     @endforeach 
31- </div >
7+ @if ($showActionsInToolbar  &&  count ($actions ) >=  2 
8+ 
9+     <x-livewire-tables::dropdown .wrapper >
10+         {{--  The Button Used To Toggle The Menu --}} 
11+         <x-livewire-tables::dropdown .button  id =" {{  $tableName   } }" aria-controls =" {{  $tableName   } }" {{  $attributes -> merge ($this -> getActionsButtonAttributes )  } }
12+             {{  __ ($localisationPath . ' Actions'  } }
13+ 
14+             @if ($isTailwind  ||  $isTailwind4 
15+                 <x-heroicon-m-chevron-down  class =" -mr-1 ml-2 h-5 w-5" 
16+             @endif 
17+         </x-livewire-tables::dropdown .button >
18+ 
19+         {{--  The Body of The Menu --}} 
20+         <x-livewire-tables::dropdown .body  id =" {{  $tableName   } }" aria-labelledby =" {{  $tableName   } }" {{  $attributes -> merge ($this -> getActionsMenuAttributes )  } }
21+             @foreach ($actions  as  $action 
22+                 {{  $action -> setInMenu (true )-> render ()  } }
23+             @endforeach 
24+         </x-livewire-tables::dropdown .body >
25+     </x-livewire-tables::dropdown .wrapper >
26+ 
27+ @else 
28+         <div  {{  $attributes  
29+                     -> merge ($actionWrapperAttributes ) 
30+                     -> class ([ 
31+                         ' flex flex-cols py-2 space-x-2' =>  $isTailwind  &&  ($actionWrapperAttributes [' default-styling' true ), 
32+                         ' ' =>  $isTailwind  &&  ($actionWrapperAttributes [' default-colors' true ), 
33+                         ' tw4ph flex flex-cols py-2 space-x-2' =>  $isTailwind4  &&  ($actionWrapperAttributes [' default-styling' true ), 
34+                         ' tw4ph ' =>  $isTailwind4  &&  ($actionWrapperAttributes [' default-colors' true ), 
35+ 
36+                         ' d-flex flex-cols py-2 space-x-2' =>  $isBootstrap  &&  ($actionWrapperAttributes [' default-styling' true ), 
37+                         ' ' =>  $isBootstrap  &&  ($actionWrapperAttributes [' default-colors' true ), 
38+                          
39+                         //  All 
40+                         ' justify-start' =>  $actionsPosition  ===  ' left'  
41+                         ' justify-center' =>  $actionsPosition  ===  ' center'  
42+                         ' justify-end' =>  $actionsPosition  ===  ' right'  
43+                         ' pl-2' =>  $showActionsInToolbar  &&  $actionsPosition  ===  ' left'  
44+                         ' pr-2' =>  $showActionsInToolbar  &&  $actionsPosition  ===  ' right'  
45+                     ]) 
46+                     -> except ([' default' ' default-styling' ' default-colors'  
47+                  } }
48+ 
49+                     @foreach ($actions  as  $action 
50+                         {{  $action -> render ()  } }
51+                     @endforeach 
52+ 
53+         </div >
54+ @endif 
0 commit comments