11@aware ([ ' dataTableFingerprint' ' isTailwind' ' isTailwind4' ' isBootstrap' ' isBootstrap4' ' isBootstrap5' ' localisationPath'  )
22@props ([' jsoned'  )
33@php ($columnSelectButtonAttributes  =  $this -> getColumnSelectButtonAttributes ()
4+ @php ($columnSelectMenuAttributes  =  $this -> getColumnSelectMenuAttributes 
45@php ($columnSelectMenuOptionCheckboxAttributes  =  $this -> getColumnSelectMenuOptionCheckboxAttributes 
56@php ($selectableSelectedColumnCount  =  $this -> getSelectableSelectedColumns ()-> count ()
67@php ($selectedColCount  =  count ($this -> getColumnsForColumnSelect ())
2324                timeout: 0, 
2425                toggleAll() 
2526                { 
27+                     this.open = false; 
2628                    $wire.call('toggleAllColumns'); 
2729                }, 
2830                sendUpdate() 
2931                { 
3032                    if(this.selectedCols != this.previousCols) 
3133                    { 
32-                         console.log('this selectedCols: '+this.selectedCols); 
33-                         console.log('this previousCols: '+this.previousCols); 
3434                        this.previousCols = this.selectedCols; 
3535                        open = false; 
36-                         console.log('SelectedCol Length: '+this.selectedCols.length); 
3736                        $wire.$refresh(); 
3837                    } 
3938                }, 
40-                 adjustSelectedStatus(value) 
41-                 { 
42-                     console.log('adjustSelectedStatus'); 
43-                     console.log('value'); 
44-                     let array = JSON.parse(JSON.stringify(value)) 
45-                     console.log(array); 
46-                      
47-                 }, 
4839                init() 
4940                { 
5041                    $nextTick(() => {  
5142                        this.previousCols = $wire.get('selectedColumns'); 
52-                         console.log('previousCols: '+this.previousCols); 
53- 
5443                    }); 
55-                     $watch('selectedCols', value => this.adjustSelectedStatus(value)); 
56- 
5744                } 
5845            }"  
5946            @keydown .window.escape =" if (!childElementOpen) { open = false }" 
6047            x-on:click.away =" if (!childElementOpen) { open = false }" 
6148            class =" inline-block relative w-full text-left md:w-auto" 
6249            wire:key =" {{  $dataTableFingerprint   } }" 
63-         >   <div >
64-                 <div ><span >selectedCols.length</span ><span  x-text =" selectedCols.length" span ></div >
65-                 <div ><span >selectableColumnCount</span ><span  x-text =" selectableColumnCount" span ></div >
66- 
67- 
68-             </div >
50+         >
6951            <div >
7052                <span  class =" rounded-md shadow-sm" 
7153                    <button 
@@ -92,57 +74,56 @@ class="inline-block relative w-full text-left md:w-auto"
9274
9375            <div  
9476                x-cloak  x-show =" open" 
95-                 x-transition:enter =" transition ease-out duration-100" 
96-                 x-transition:enter-start =" transform opacity-0 scale-95" 
97-                 x-transition:enter-end =" transform opacity-100 scale-100" 
98-                 x-transition:leave =" transition ease-in duration-75" 
99-                 x-transition:leave-start =" transform opacity-100 scale-100" 
100-                 x-transition:leave-end =" transform opacity-0 scale-95" 
101-                 class =" absolute right-0 z-50 mt-2 w-full rounded-md divide-y divide-gray-100 ring-1 ring-black ring-opacity-5 shadow-lg origin-top-right md:w-48 focus:outline-none" 
77+                 {{  $attributes -> merge ($columnSelectMenuAttributes )-> class ( 
78+                     [ 
79+                         ' divide-gray-100 ring-black bg-white dark:bg-gray-700 dark:text-white' =>  $isTailwind  &&  ($columnSelectMenuAttributes [' default-colors' true ), 
80+                         ' absolute right-0 z-50 mt-2 w-full rounded-md divide-y ring-1 ring-opacity-5 shadow-lg origin-top-right md:w-48 focus:outline-none' =>   $isTailwind  &&  ($columnSelectMenuAttributes [' default-styling' true ), 
81+                     ]) 
82+                  } }
10283            >
103-                 <div  class =" bg-white rounded-md shadow-xs dark:bg-gray-700 dark:text-white" 
104-                     <div  class =" p-2" role =" menu" aria-orientation =" vertical" 
105-                             aria-labelledby =" column-select-menu" 
106-                         @click .outside =" sendUpdate" 
84+                 <div  class =" p-2" 
85+                     role =" menu" 
86+                     aria-orientation =" vertical" 
87+                     aria-labelledby =" column-select-menu" 
88+                     @click .outside =" sendUpdate" 
89+                 >
90+                     <div  wire:key =" {{  $dataTableFingerprint   } }{{  rand (0 ,1000 )  } }" 
91+                         <label 
92+                             wire:loading.attr =" disabled" 
93+                             class =" inline-flex items-center px-2 py-1 disabled:opacity-50 disabled:cursor-wait" 
94+                         >
95+                             <x-livewire-tables::forms .checkbox 
96+                                 ::checked =" selectedCols.length == selectableColumnCount" 
97+                                 wire:key =" {{  $dataTableFingerprint   } }" 
98+                                 wire:target =" selectedCols" 
99+                                 wire:loading.attr =" disabled" 
100+                                 x-on:click =" toggleAll" 
101+                                 :checkboxAttributes =$columnSelectMenuOptionCheckboxAttributes 
102+                             />
103+                             <span  class =" ml-2" {{  __ ($localisationPath . ' All Columns'  } }span >
104+                         </label >
105+                     </div >
107106
108-                     >
109-                         <div  wire:key =" {{  $dataTableFingerprint   } }{{  rand (0 ,1000 )  } }" 
107+                     @foreach  ($columnSelectItems  as  $index  =>  $columnDetail 
108+                         <div 
109+                             wire:key =" {{  $dataTableFingerprint   } }{{  $loop -> index   } }" 
110+                         >
110111                            <label 
111112                                wire:loading.attr =" disabled" 
113+                                 wire:target =" selectedCols" 
112114                                class =" inline-flex items-center px-2 py-1 disabled:opacity-50 disabled:cursor-wait" 
113115                            >
114-                                 <x-livewire-tables::forms .checkbox 
115-                                     ::checked =" selectedCols.length == selectableColumnCount" 
116-                                     wire:key =" {{  $dataTableFingerprint   } }" 
117-                                     wire:target =" selectedCols" 
118-                                     wire:loading.attr =" disabled" 
119-                                     x-on:click =" toggleAll" 
116+                             <x-livewire-tables::forms .alpineCheckbox 
117+                                     type =' checkbox' 
118+                                     wire:key =" {{  $dataTableFingerprint  .  ' selectedItems-' . $columnDetail [' slug'  } }" 
119+                                     x-model =' selectedCols' 
120+                                     value =" {{  $columnDetail [' slug'  } }" 
120121                                    :checkboxAttributes =$columnSelectMenuOptionCheckboxAttributes 
121-                                  />
122-                                 <span  class =" ml-2" {{  __ ( $localisationPath . ' All Columns ' )   } }span >
122+                             />
123+                                 <span  class =" ml-2" {{  $columnDetail [ ' title ' ]   } }span >
123124                            </label >
124125                        </div >
125- 
126-                         @foreach  ($columnSelectItems  as  $index  =>  $columnDetail 
127-                             <div 
128-                                 wire:key =" {{  $dataTableFingerprint   } }{{  $loop -> index   } }" 
129-                             >
130-                                 <label 
131-                                     wire:loading.attr =" disabled" 
132-                                     wire:target =" selectedCols" 
133-                                     class =" inline-flex items-center px-2 py-1 disabled:opacity-50 disabled:cursor-wait" 
134-                                 >
135- 
136-                                         <input  type =' checkbox' 
137-                                             wire:key =" {{  $dataTableFingerprint  .  ' selectedItems-' . $columnDetail [' slug'  } }" 
138-                                             x-model =' selectedCols' 
139-                                             value =" {{  $columnDetail [' slug'  } }" 
140-                                         />
141-                                     <span  class =" ml-2" {{  $columnDetail [' title'  } }span >
142-                                 </label >
143-                             </div >
144-                         @endforeach 
145-                     </div >
126+                     @endforeach 
146127                </div >
147128            </div >
148129        </div >
0 commit comments