99
1010trait  TableAttributeHelpers
1111{
12-     #[Computed]
1312    public  function  getCoreTableAttributes (): array 
1413    {
1514        return  [
@@ -20,31 +19,41 @@ public function getCoreTableAttributes(): array
2019        ];
2120    }
2221
23-     #[Computed]
2422    public  function  getComponentWrapperAttributes (): array 
2523    {
26-         return  count ($ this componentWrapperAttributes ) ? $ this componentWrapperAttributes  : ['id '  => 'datatable- ' .$ this getId ()];
24+         $ coreAttribs
25+             'id '  => 'datatable- ' .$ this getId (),   
26+         ];
27+ 
28+         if  ($ this hasRefresh ())
29+         {
30+             $ coreAttribs'wire:poll ' .$ this getRefreshOptions ()] = '' ;
31+         }
32+         if ($ this isFilterLayoutSlideDown ())
33+         {
34+             $ coreAttribs'wire:ignore.self ' ] = '' ;
35+         }
36+ 
37+         return ([
38+             ...$ coreAttribs
39+         ...$ this componentWrapperAttributes ]);
2740    }
2841
29-     #[Computed]
3042    public  function  getTableWrapperAttributes (): array 
3143    {
3244        return  array_merge (['wire:key '  => $ this getTableName ().'-twrap ' ], (count ($ this tableWrapperAttributes ) ? $ this tableWrapperAttributes  : ['default '  => true ]));
3345    }
3446
35-     #[Computed]
3647    public  function  getTableAttributes (): array 
3748    {
3849        return  array_merge (['wire:key '  => $ this getTableName ().'-table ' , 'id '  => 'table- ' .$ this getTableName ()], (count ($ this tableAttributes ) ? $ this tableAttributes  : ['default '  => true ]));
3950    }
4051
41-     #[Computed]
4252    public  function  getTheadAttributes (): array 
4353    {
4454        return  array_merge (['wire:key '  => $ this getTableName ().'-thead ' ], (count ($ this theadAttributes ) ? $ this theadAttributes  : ['default '  => true ]));
4555    }
4656
47-     #[Computed]
4857    public  function  getTbodyAttributes (): array 
4958    {
5059        return  array_merge (['wire:key '  => $ this getTableName ().'-tbody ' , 'id '  => $ this getTableName ().'-tbody ' ], (count ($ this tbodyAttributes ) ? $ this tbodyAttributes  : ['default '  => true ]));
@@ -53,7 +62,6 @@ public function getTbodyAttributes(): array
5362    /** 
5463     * Used in resources/views/components/table/th.blade.php 
5564     */ 
56-     #[Computed]
5765    public  function  getThAttributes (Column $ columnarray 
5866    {
5967
@@ -67,7 +75,6 @@ public function getThAttributes(Column $column): array
6775    /** 
6876     * Used in resources/views/components/table/th.blade.php 
6977     */ 
70-     #[Computed]
7178    public  function  getThSortButtonAttributes (Column $ columnarray 
7279    {
7380        if  (isset ($ this thSortButtonAttributesCallback )) {
@@ -80,7 +87,6 @@ public function getThSortButtonAttributes(Column $column): array
8087    /** 
8188     * Used in resources/views/components/table/th.blade.php 
8289     */ 
83-     #[Computed]
8490    public  function  getThSortIconAttributes (Column $ columnarray 
8591    {
8692        if  (isset ($ this thSortIconAttributesCallback )) {
@@ -93,7 +99,6 @@ public function getThSortIconAttributes(Column $column): array
9399    /** 
94100     * Used in resources/views/components/table/th.blade.php 
95101     */ 
96-     #[Computed]
97102    public  function  getAllThAttributes (Column $ columnarray 
98103    {
99104        return  [
@@ -104,19 +109,16 @@ public function getAllThAttributes(Column $column): array
104109        ];
105110    }
106111
107-     #[Computed]
108112    public  function  hasTrAttributes (): bool 
109113    {
110114        return  isset ($ this trAttributesCallback );
111115    }
112116
113-     #[Computed]
114117    public  function  getTrAttributes (Model $ rowint  $ indexarray 
115118    {
116119        return  isset ($ this trAttributesCallback ) ? call_user_func ($ this trAttributesCallback , $ row$ index'default '  => true ];
117120    }
118121
119-     #[Computed]
120122    public  function  getTdAttributes (Column $ columnModel $ rowint  $ colIndexint  $ rowIndexarray 
121123    {
122124        return  isset ($ this tdAttributesCallback ) ? call_user_func ($ this tdAttributesCallback , $ column$ row$ colIndex$ rowIndex'default '  => true ];
0 commit comments