Skip to content

Commit bac7432

Browse files
committed
Restore Component to Column for historic purposes
1 parent ffb34f9 commit bac7432

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Rappasoft\LaravelLivewireTables\Views\Columns\Traits;
4+
5+
use Rappasoft\LaravelLivewireTables\DataTableComponent;
6+
7+
trait HasDataTableComponent
8+
{
9+
protected ?DataTableComponent $component = null;
10+
11+
public function setComponent(DataTableComponent $component): self
12+
{
13+
$this->component = $component;
14+
15+
return $this;
16+
}
17+
18+
public function getComponent(): ?DataTableComponent
19+
{
20+
return $this->component;
21+
}
22+
}

src/Views/Columns/Traits/Helpers/ColumnHelpers.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@
33
namespace Rappasoft\LaravelLivewireTables\Views\Columns\Traits\Helpers;
44

55
use Illuminate\Database\Eloquent\Model;
6-
use Illuminate\Support\HtmlString;
7-
use Illuminate\Support\Str;
8-
use Rappasoft\LaravelLivewireTables\DataTableComponent;
6+
use Illuminate\Support\{HtmlString,Str};
97
use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException;
108
use Rappasoft\LaravelLivewireTables\Views\Column;
119
use Rappasoft\LaravelLivewireTables\Views\Columns\LinkColumn;
1210

1311
trait ColumnHelpers
1412
{
15-
// Defunct and unused
16-
/*public function getComponent(): ?DataTableComponent
17-
{
18-
return $this->component;
19-
}*/
2013

2114
public function hasFrom(): bool
2215
{

src/Views/Columns/Traits/IsColumn.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Rappasoft\LaravelLivewireTables\Views\Columns\Traits;
44

5-
use Rappasoft\LaravelLivewireTables\DataTableComponent;
65
use Rappasoft\LaravelLivewireTables\Traits\Core\HasLocalisations;
76
use Rappasoft\LaravelLivewireTables\Views\Columns\Traits\Configuration\ColumnConfiguration;
87
use Rappasoft\LaravelLivewireTables\Views\Columns\Traits\Helpers\{ColumnHelpers,RelationshipHelpers};
@@ -12,6 +11,7 @@
1211
trait IsColumn
1312
{
1413
use HasLocalisations,
14+
HasDataTableComponent,
1515
ColumnConfiguration,
1616
ColumnHelpers,
1717
RelationshipHelpers,
@@ -27,9 +27,6 @@ trait IsColumn
2727
HasTheme,
2828
HasVisibility;
2929

30-
// Defunct and unused
31-
// protected ?DataTableComponent $component = null;
32-
3330
// What displays in the columns header
3431
protected string $title;
3532

0 commit comments

Comments
 (0)