File tree Expand file tree Collapse file tree 7 files changed +20
-53
lines changed Expand file tree Collapse file tree 7 files changed +20
-53
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,11 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
4
4
5
5
## [ Unreleased]
6
6
7
- ## [ 1.10.5] - 2021-07-10
7
+ ## [ 1.11.0] - 2021-07-10
8
+
9
+ ### Added
10
+
11
+ - [ Added ` addAttributes ` method to column headers] ( https://github.com/rappasoft/laravel-livewire-tables/pull/379 )
8
12
9
13
### Changed
10
14
@@ -421,8 +425,8 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
421
425
422
426
- Initial release
423
427
424
- [ Unreleased ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.10.5 ...development
425
- [ 1.10.5 ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.10.4...v1.10.5
428
+ [ Unreleased ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.11.0 ...development
429
+ [ 1.11.0 ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.10.4...v1.11.0
426
430
[ 1.10.4 ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.10.3...v1.10.4
427
431
[ 1.10.3 ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.10.2...v1.10.3
428
432
[ 1.10.2 ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.10.1...v1.10.2
Original file line number Diff line number Diff line change 4
4
' sortable' => null ,
5
5
' direction' => null ,
6
6
' text' => null ,
7
+ ' customAttributes' => [],
7
8
] )
8
9
9
- @php
10
- $headerAttributesList = [];
11
- $headerAttributesList [] = [' class' => $attributes -> get (' class' )];
12
- $headerAttributesList [] = $attributes -> get (' extraAttributes' ) ?? [];
13
-
14
- $headerAttributes = ' ' ;
15
- collect ($headerAttributesList )-> each (function ($item ) use (& $headerAttributes ) {
16
- if (count ($item )) {
17
- $headerAttributes .= collect ($item )-> map (fn ($value , $key ) => $key . ' ="' . $value . ' "' )-> implode (' ' );
18
- }
19
- });
20
-
21
- @endphp
22
-
23
10
@unless ($sortingEnabled && $sortable )
24
- <th {!! $headerAttributes ! ! } >
11
+ <th {{ $attributes -> merge ( $customAttributes ) } } >
25
12
{{ $text ?? $slot } }
26
13
</th >
27
14
@else
28
15
<th
29
16
wire:click =" sortBy('{{ $column } } ', '{{ $text ?? $column } } ')"
30
- {!! $headerAttributes ! ! }
17
+ {{ $attributes -> merge ( $customAttributes ) } }
31
18
style =" cursor :pointer ;"
32
19
>
33
20
<div class =" d-flex align-items-center" >
Original file line number Diff line number Diff line change 27
27
:direction =" $column->column() ? $sorts[$column->column()] ?? null : null"
28
28
:text =" $column->text() ?? ''"
29
29
:class =" $column->class() ?? ''"
30
- :extraAttributes =" $column->attributes()"
30
+ :customAttributes =" $column->attributes()"
31
31
/>
32
32
@endif
33
33
@endif
Original file line number Diff line number Diff line change 4
4
' sortable' => null ,
5
5
' direction' => null ,
6
6
' text' => null ,
7
+ ' customAttributes' => [],
7
8
] )
8
9
9
- @php
10
- $headerAttributesList = [];
11
- $headerAttributesList [] = [' class' => $attributes -> get (' class' )];
12
- $headerAttributesList [] = $attributes -> get (' extraAttributes' ) ?? [];
13
-
14
- $headerAttributes = ' ' ;
15
- collect ($headerAttributesList )-> each (function ($item ) use (& $headerAttributes ) {
16
- if (count ($item )) {
17
- $headerAttributes .= collect ($item )-> map (fn ($value , $key ) => $key . ' ="' . $value . ' "' )-> implode (' ' );
18
- }
19
- });
20
-
21
- @endphp
22
-
23
10
@unless ($sortingEnabled && $sortable )
24
- <th {!! $headerAttributes ! ! } >
11
+ <th {{ $attributes -> merge ( $customAttributes ) } } >
25
12
{{ $text ?? $slot } }
26
13
</th >
27
14
@else
28
15
<th
29
16
wire:click =" sortBy('{{ $column } } ', '{{ $text ?? $column } } ')"
30
- {!! $headerAttributes ! ! }
17
+ {{ $attributes -> merge ( $customAttributes ) } }
31
18
style =" cursor :pointer ;"
32
19
>
33
20
<div class =" d-flex align-items-center" >
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class="form-check-input"
28
28
:direction =" $column->column() ? $sorts[$column->column()] ?? null : null"
29
29
:text =" $column->text() ?? ''"
30
30
:class =" $column->class() ?? ''"
31
- :extraAttributes =" $column->attributes()"
31
+ :customAttributes =" $column->attributes()"
32
32
/>
33
33
@endif
34
34
@endif
Original file line number Diff line number Diff line change 4
4
' sortable' => null ,
5
5
' direction' => null ,
6
6
' text' => null ,
7
+ ' customAttributes' => [],
7
8
] )
8
9
9
- @php
10
- $headerAttributesList = [];
11
- $headerAttributesList [] = [' class' => ' px-3 py-2 md:px-6 md:py-3 bg-gray-50 ' . $attributes -> get (' class' )];
12
- $headerAttributesList [] = $attributes -> get (' extraAttributes' ) ?? [];
13
-
14
- $headerAttributes = ' ' ;
15
- collect ($headerAttributesList )-> each (function ($item ) use (& $headerAttributes ) {
16
- if (count ($item )) {
17
- $headerAttributes .= collect ($item )-> map (fn ($value , $key ) => $key . ' ="' . $value . ' "' )-> implode (' ' );
18
- }
19
- });
20
-
21
- @endphp
22
-
23
- <th {!! $headerAttributes ! !} >
10
+ <th
11
+ {{ $attributes -> merge (array_merge ([' class' => ' px-3 py-2 md:px-6 md:py-3 bg-gray-50' ], $customAttributes )) } }
12
+ >
24
13
@unless ($sortingEnabled && $sortable )
25
14
<span class =" block text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider" >
26
15
{{ $text ?? $slot } }
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class="rounded-md shadow-sm border-gray-300 block transition duration-150 ease-i
30
30
:direction =" $column->column() ? $sorts[$column->column()] ?? null : null"
31
31
:text =" $column->text() ?? ''"
32
32
:class =" $column->class() ?? ''"
33
- :extraAttributes =" $column->attributes()"
33
+ :customAttributes =" $column->attributes()"
34
34
/>
35
35
@endif
36
36
@endif
You can’t perform that action at this time.
0 commit comments