|  | 
| 1 |  | -@aware([ 'tableName','isTailwind','isBootstrap']) | 
|  | 1 | +@aware(['tableName','isTailwind','isBootstrap']) | 
|  | 2 | +@props(['bulkActionsTdAttributes','bulkActionsTdCheckboxAttributes']) | 
| 2 | 3 | 
 | 
| 3 |  | -@php | 
| 4 |  | -    $customAttributes = [ | 
| 5 |  | -        'wrapper' => $this->getTableWrapperAttributes(), | 
| 6 |  | -        'table' => $this->getTableAttributes(), | 
| 7 |  | -        'thead' => $this->getTheadAttributes(), | 
| 8 |  | -        'tbody' => $this->getTbodyAttributes(), | 
| 9 |  | -    ]; | 
| 10 |  | -@endphp | 
|  | 4 | +@php($coreTableAttributes = $this->getCoreTableAttributes()) | 
| 11 | 5 | 
 | 
| 12 | 6 | @if ($isTailwind) | 
| 13 |  | -    <div | 
| 14 |  | -        wire:key="{{ $tableName }}-twrap" | 
| 15 |  | -        {{ $attributes->merge($customAttributes['wrapper']) | 
|  | 7 | +    <div {{ $attributes->merge($coreTableAttributes['wrapper']) | 
| 16 | 8 |             ->class([ | 
| 17 |  | -                'shadow overflow-y-auto border-b border-gray-200 dark:border-gray-700 sm:rounded-lg' => $customAttributes['wrapper']['default'] ?? true | 
|  | 9 | +                'border-gray-200 dark:border-gray-700' => $coreTableAttributes['wrapper']['default-colors'] ?? ($coreTableAttributes['wrapper']['default'] ?? false), | 
|  | 10 | +                'shadow overflow-y-auto border-b sm:rounded-lg' => $coreTableAttributes['wrapper']['default-styling'] ?? ($coreTableAttributes['wrapper']['default'] ?? false), | 
| 18 | 11 |             ]) | 
| 19 |  | -            ->except(['default','default-styling','default-colors']) }} | 
| 20 |  | -    > | 
| 21 |  | -        <table | 
| 22 |  | -            wire:key="{{ $tableName }}-table" | 
| 23 |  | -            {{ $attributes->merge($customAttributes['table']) | 
| 24 |  | -                ->class(['min-w-full divide-y divide-gray-200 dark:divide-none' => $customAttributes['table']['default'] ?? true]) | 
|  | 12 | +            ->except(['default','default-styling','default-colors']) | 
|  | 13 | +    }}> | 
|  | 14 | +        <table {{ $attributes->merge($coreTableAttributes['table']) | 
|  | 15 | +                ->class([ | 
|  | 16 | +                    'divide-gray-200 dark:divide-none' => $coreTableAttributes['table']['default-colors'] ?? ($coreTableAttributes['table']['default'] ?? true), | 
|  | 17 | +                    'min-w-full divide-y' => $coreTableAttributes['table']['default-styling'] ?? ($coreTableAttributes['table']['default'] ?? true), | 
|  | 18 | +                ]) | 
| 25 | 19 |                 ->except(['default','default-styling','default-colors']) }} | 
| 26 |  | - | 
| 27 | 20 |         > | 
| 28 |  | -            <thead wire:key="{{ $tableName }}-thead" | 
| 29 |  | -                {{ $attributes->merge($customAttributes['thead']) | 
|  | 21 | +            <thead {{ $attributes->merge($coreTableAttributes['thead']) | 
| 30 | 22 |                     ->class([ | 
| 31 |  | -                        'bg-gray-50 dark:bg-gray-800' => $customAttributes['thead']['default'] ?? true | 
|  | 23 | +                        'bg-gray-50 dark:bg-gray-800' => $coreTableAttributes['thead']['default-colors'] ?? ($coreTableAttributes['thead']['default'] ?? true), | 
|  | 24 | +                        '' => $coreTableAttributes['thead']['default-styling'] ?? ($coreTableAttributes['thead']['default'] ?? true), | 
| 32 | 25 |                     ]) | 
| 33 | 26 |                     ->except(['default','default-styling','default-colors']) }} | 
| 34 | 27 |             > | 
|  | 
| 37 | 30 |                 </tr> | 
| 38 | 31 |             </thead> | 
| 39 | 32 | 
 | 
| 40 |  | -            <tbody | 
| 41 |  | -                wire:key="{{ $tableName }}-tbody" | 
| 42 |  | -                id="{{ $tableName }}-tbody" | 
| 43 |  | -                {{ $attributes->merge($customAttributes['tbody']) | 
| 44 |  | -                        ->class([ | 
| 45 |  | -                            'bg-white divide-y divide-gray-200 dark:bg-gray-800 dark:divide-none' => $customAttributes['tbody']['default'] ?? true | 
| 46 |  | -                        ]) | 
| 47 |  | -                        ->except(['default','default-styling','default-colors']) }} | 
| 48 |  | -            > | 
| 49 |  | -                {{ $slot }} | 
| 50 |  | -            </tbody> | 
|  | 33 | +            {{ $slot }} | 
|  | 34 | + | 
| 51 | 35 | 
 | 
| 52 | 36 |             @isset($tfoot) | 
| 53 | 37 |                 <tfoot wire:key="{{ $tableName }}-tfoot"> | 
|  | 
| 57 | 41 |         </table> | 
| 58 | 42 |     </div> | 
| 59 | 43 | @elseif ($isBootstrap) | 
| 60 |  | -    <div wire:key="{{ $tableName }}-twrap" | 
| 61 |  | -        {{ $attributes->merge($customAttributes['wrapper']) | 
| 62 |  | -            ->class(['table-responsive' => $customAttributes['wrapper']['default'] ?? true]) | 
| 63 |  | -            ->except(['default','default-styling','default-colors']) }} | 
|  | 44 | +    <div {{ $attributes->merge($coreTableAttributes['wrapper']) | 
|  | 45 | +            ->class([ | 
|  | 46 | +                '' => $coreTableAttributes['wrapper']['default-colors'] ?? ($coreTableAttributes['wrapper']['default'] ?? true), | 
|  | 47 | +                'table-responsive' => $coreTableAttributes['wrapper']['default-styling'] ?? ($coreTableAttributes['wrapper']['default'] ?? true), | 
|  | 48 | +            ]) | 
|  | 49 | +            ->except(['default','default-styling','default-colors'])  | 
|  | 50 | +        }} | 
| 64 | 51 |     > | 
| 65 |  | -        <table | 
| 66 |  | -            wire:key="{{ $tableName }}-table" | 
| 67 |  | -            {{ $attributes->merge($customAttributes['table']) | 
| 68 |  | -                ->class(['laravel-livewire-table table' => $customAttributes['table']['default'] ?? true]) | 
|  | 52 | +        <table {{ $attributes->merge($coreTableAttributes['table']) | 
|  | 53 | +                ->class([ | 
|  | 54 | +                    '' => $coreTableAttributes['table']['default-colors'] ?? ($coreTableAttributes['table']['default'] ?? true), | 
|  | 55 | +                    'laravel-livewire-table table' => $coreTableAttributes['table']['default-styling'] ?? ($coreTableAttributes['table']['default'] ?? true), | 
|  | 56 | +                ]) | 
| 69 | 57 |                 ->except(['default','default-styling','default-colors']) | 
| 70 | 58 |             }} | 
| 71 | 59 |         > | 
| 72 |  | -            <thead | 
| 73 |  | -                wire:key="{{ $tableName }}-thead" | 
| 74 |  | -                {{ $attributes->merge($customAttributes['thead']) | 
| 75 |  | -                    ->class(['' => $customAttributes['thead']['default'] ?? true]) | 
|  | 60 | +            <thead {{ $attributes->merge($coreTableAttributes['thead']) | 
|  | 61 | +                    ->class([ | 
|  | 62 | +                        '' => $coreTableAttributes['thead']['default-colors'] ?? ($coreTableAttributes['thead']['default'] ?? true), | 
|  | 63 | +                        '' => $coreTableAttributes['thead']['default-styling'] ?? ($coreTableAttributes['thead']['default'] ?? true), | 
|  | 64 | +                    ]) | 
| 76 | 65 |                     ->except(['default','default-styling','default-colors']) }} | 
| 77 | 66 |             > | 
| 78 | 67 |                 <tr> | 
| 79 | 68 |                     {{ $thead }} | 
| 80 | 69 |                 </tr> | 
| 81 | 70 |             </thead> | 
| 82 | 71 | 
 | 
| 83 |  | -            <tbody | 
| 84 |  | -                wire:key="{{ $tableName }}-tbody" | 
| 85 |  | -                id="{{ $tableName }}-tbody" | 
| 86 |  | -                {{ $attributes->merge($customAttributes['tbody']) | 
| 87 |  | -                        ->class(['' => $customAttributes['tbody']['default'] ?? true]) | 
| 88 |  | -                        ->except(['default','default-styling','default-colors']) }} | 
|  | 72 | +            <tbody {{ $attributes->merge($coreTableAttributes['tbody']) | 
|  | 73 | +                    ->class([ | 
|  | 74 | +                        '' => $coreTableAttributes['tbody']['default-colors'] ?? ($coreTableAttributes['tbody']['default'] ?? true), | 
|  | 75 | +                        '' => $coreTableAttributes['tbody']['default-styling'] ?? ($coreTableAttributes['tbody']['default'] ?? true), | 
|  | 76 | +                    ]) | 
|  | 77 | +                    ->except(['default','default-styling','default-colors']) }} | 
| 89 | 78 |             > | 
| 90 | 79 |                 {{ $slot }} | 
| 91 | 80 |             </tbody> | 
|  | 
0 commit comments