Skip to content

Commit e53d95a

Browse files
lrljoegithub-actions[bot]
authored andcommitted
Fix styling
1 parent 6bc6850 commit e53d95a

File tree

8 files changed

+281
-298
lines changed

8 files changed

+281
-298
lines changed

src/Traits/Configuration/PaginationConfiguration.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,4 @@ public function setShouldRetrieveTotalItemCountDisabled(): self
163163

164164
return $this;
165165
}
166-
167166
}

src/Traits/Helpers/PaginationHelpers.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,9 @@ private function getPerPagePaginationSessionKey(): string
139139
return $this->tableName.'-perPage';
140140
}
141141

142-
143142
#[Computed]
144143
public function getShouldRetrieveTotalItemCount(): bool
145144
{
146145
return $this->shouldRetrieveTotalItemCount;
147146
}
148-
149-
150147
}
Lines changed: 41 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,41 @@
1-
<?php
2-
3-
namespace Rappasoft\LaravelLivewireTables\Traits\Styling\Configuration;
4-
5-
trait PaginationStylingConfiguration
6-
{
7-
public function setCustomPaginationBlade(string $customPaginationBlade): self
8-
{
9-
$this->customPaginationBlade = $customPaginationBlade;
10-
11-
return $this;
12-
}
13-
14-
public function setPaginationTheme(string $theme): self
15-
{
16-
$this->paginationTheme = $theme;
17-
18-
return $this;
19-
}
20-
21-
public function setPaginationWrapperAttributes(array $paginationWrapperAttributes = []): self
22-
{
23-
$this->setCustomAttributes(propertyName: 'paginationWrapperAttributes', customAttributes: array_merge($this->getPaginationWrapperAttributes(), $paginationWrapperAttributes));
24-
25-
return $this;
26-
}
27-
28-
public function setPerPageFieldAttributes(array $perPageFieldAttributes = []): self
29-
{
30-
$this->setCustomAttributes(propertyName: 'perPageFieldAttributes', customAttributes: array_merge($this->getPerPageFieldAttributes(), $perPageFieldAttributes));
31-
32-
return $this;
33-
}
34-
35-
public function setPerPageWrapperAttributes(array $perPageWrapperAttributes = []): self
36-
{
37-
$this->setCustomAttributes(propertyName: 'perPageWrapperAttributes', customAttributes: array_merge($this->getPerPageWrapperAttributes(), $perPageWrapperAttributes));
38-
39-
return $this;
40-
}
41-
42-
43-
}
1+
<?php
2+
3+
namespace Rappasoft\LaravelLivewireTables\Traits\Styling\Configuration;
4+
5+
trait PaginationStylingConfiguration
6+
{
7+
public function setCustomPaginationBlade(string $customPaginationBlade): self
8+
{
9+
$this->customPaginationBlade = $customPaginationBlade;
10+
11+
return $this;
12+
}
13+
14+
public function setPaginationTheme(string $theme): self
15+
{
16+
$this->paginationTheme = $theme;
17+
18+
return $this;
19+
}
20+
21+
public function setPaginationWrapperAttributes(array $paginationWrapperAttributes = []): self
22+
{
23+
$this->setCustomAttributes(propertyName: 'paginationWrapperAttributes', customAttributes: array_merge($this->getPaginationWrapperAttributes(), $paginationWrapperAttributes));
24+
25+
return $this;
26+
}
27+
28+
public function setPerPageFieldAttributes(array $perPageFieldAttributes = []): self
29+
{
30+
$this->setCustomAttributes(propertyName: 'perPageFieldAttributes', customAttributes: array_merge($this->getPerPageFieldAttributes(), $perPageFieldAttributes));
31+
32+
return $this;
33+
}
34+
35+
public function setPerPageWrapperAttributes(array $perPageWrapperAttributes = []): self
36+
{
37+
$this->setCustomAttributes(propertyName: 'perPageWrapperAttributes', customAttributes: array_merge($this->getPerPageWrapperAttributes(), $perPageWrapperAttributes));
38+
39+
return $this;
40+
}
41+
}
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
<?php
2-
3-
namespace Rappasoft\LaravelLivewireTables\Traits\Styling;
4-
5-
use Livewire\Attributes\Locked;
6-
use Rappasoft\LaravelLivewireTables\Traits\Styling\Configuration\PaginationStylingConfiguration;
7-
use Rappasoft\LaravelLivewireTables\Traits\Styling\Helpers\PaginationStylingHelpers;
8-
9-
trait HasPaginationStyling
10-
{
11-
use PaginationStylingConfiguration,
12-
PaginationStylingHelpers;
13-
14-
// Used In Frontend
15-
#[Locked]
16-
public string $paginationTheme = 'tailwind';
17-
18-
// Used In Frontend
19-
protected array $perPageFieldAttributes = ['class' => '', 'default-colors' => true, 'default-styling' => true];
20-
21-
// Used In Frontend
22-
protected array $perPageWrapperAttributes = ['class' => '', 'default-colors' => true, 'default-styling' => true];
23-
24-
// Used In Frontend
25-
protected array $paginationWrapperAttributes = ['class' => ''];
26-
27-
// Used In Frontend
28-
protected ?string $customPaginationBlade;
29-
}
1+
<?php
2+
3+
namespace Rappasoft\LaravelLivewireTables\Traits\Styling;
4+
5+
use Livewire\Attributes\Locked;
6+
use Rappasoft\LaravelLivewireTables\Traits\Styling\Configuration\PaginationStylingConfiguration;
7+
use Rappasoft\LaravelLivewireTables\Traits\Styling\Helpers\PaginationStylingHelpers;
8+
9+
trait HasPaginationStyling
10+
{
11+
use PaginationStylingConfiguration,
12+
PaginationStylingHelpers;
13+
14+
// Used In Frontend
15+
#[Locked]
16+
public string $paginationTheme = 'tailwind';
17+
18+
// Used In Frontend
19+
protected array $perPageFieldAttributes = ['class' => '', 'default-colors' => true, 'default-styling' => true];
20+
21+
// Used In Frontend
22+
protected array $perPageWrapperAttributes = ['class' => '', 'default-colors' => true, 'default-styling' => true];
23+
24+
// Used In Frontend
25+
protected array $paginationWrapperAttributes = ['class' => ''];
26+
27+
// Used In Frontend
28+
protected ?string $customPaginationBlade;
29+
}
Lines changed: 65 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,65 @@
1-
<?php
2-
3-
namespace Rappasoft\LaravelLivewireTables\Traits\Styling\Helpers;
4-
5-
use Livewire\Attributes\Computed;
6-
use Illuminate\View\ComponentAttributeBag;
7-
8-
trait PaginationStylingHelpers
9-
{
10-
#[Computed]
11-
public function getPaginationTheme(): string
12-
{
13-
return $this->paginationTheme;
14-
}
15-
16-
#[Computed]
17-
public function getPaginationWrapperAttributes(): array
18-
{
19-
return $this->getCustomAttributes(propertyName: 'paginationWrapperAttributes', default: false, classicMode: true);
20-
}
21-
22-
#[Computed]
23-
public function getPaginationWrapperAttributesBag(): ComponentAttributeBag
24-
{
25-
return $this->getCustomAttributesBagFromArray($this->getPaginationWrapperAttributes());
26-
}
27-
28-
29-
#[Computed]
30-
public function getPerPageFieldAttributes(): array
31-
{
32-
return $this->getCustomAttributes(propertyName: 'perPageFieldAttributes', default: false, classicMode: false);
33-
34-
}
35-
36-
#[Computed]
37-
public function getPerPageFieldAttributesBag(): ComponentAttributeBag
38-
{
39-
return new ComponentAttributeBag($this->getPerPageFieldAttributes());
40-
}
41-
42-
#[Computed]
43-
public function getPerPageWrapperAttributes(): array
44-
{
45-
return $this->getCustomAttributes(propertyName: 'perPageWrapperAttributes', default: false, classicMode: false);
46-
47-
}
48-
49-
#[Computed]
50-
public function getPerPageWrapperAttributesBag(): ComponentAttributeBag
51-
{
52-
return new ComponentAttributeBag($this->getPerPageWrapperAttributes());
53-
}
54-
55-
#[Computed]
56-
public function hasCustomPaginationBlade(): bool
57-
{
58-
return (isset($this->customPaginationBlade) && $this->customPaginationBlade !== null);
59-
}
60-
61-
#[Computed]
62-
public function getCustomPaginationBlade(): string
63-
{
64-
return $this->customPaginationBlade ?? '';
65-
}
66-
67-
}
1+
<?php
2+
3+
namespace Rappasoft\LaravelLivewireTables\Traits\Styling\Helpers;
4+
5+
use Illuminate\View\ComponentAttributeBag;
6+
use Livewire\Attributes\Computed;
7+
8+
trait PaginationStylingHelpers
9+
{
10+
#[Computed]
11+
public function getPaginationTheme(): string
12+
{
13+
return $this->paginationTheme;
14+
}
15+
16+
#[Computed]
17+
public function getPaginationWrapperAttributes(): array
18+
{
19+
return $this->getCustomAttributes(propertyName: 'paginationWrapperAttributes', default: false, classicMode: true);
20+
}
21+
22+
#[Computed]
23+
public function getPaginationWrapperAttributesBag(): ComponentAttributeBag
24+
{
25+
return $this->getCustomAttributesBagFromArray($this->getPaginationWrapperAttributes());
26+
}
27+
28+
#[Computed]
29+
public function getPerPageFieldAttributes(): array
30+
{
31+
return $this->getCustomAttributes(propertyName: 'perPageFieldAttributes', default: false, classicMode: false);
32+
33+
}
34+
35+
#[Computed]
36+
public function getPerPageFieldAttributesBag(): ComponentAttributeBag
37+
{
38+
return new ComponentAttributeBag($this->getPerPageFieldAttributes());
39+
}
40+
41+
#[Computed]
42+
public function getPerPageWrapperAttributes(): array
43+
{
44+
return $this->getCustomAttributes(propertyName: 'perPageWrapperAttributes', default: false, classicMode: false);
45+
46+
}
47+
48+
#[Computed]
49+
public function getPerPageWrapperAttributesBag(): ComponentAttributeBag
50+
{
51+
return new ComponentAttributeBag($this->getPerPageWrapperAttributes());
52+
}
53+
54+
#[Computed]
55+
public function hasCustomPaginationBlade(): bool
56+
{
57+
return isset($this->customPaginationBlade) && $this->customPaginationBlade !== null;
58+
}
59+
60+
#[Computed]
61+
public function getCustomPaginationBlade(): string
62+
{
63+
return $this->customPaginationBlade ?? '';
64+
}
65+
}

src/Traits/WithPagination.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ trait WithPagination
4949

5050
protected bool $shouldRetrieveTotalItemCount = true;
5151

52-
5352
public function mountWithPagination(): void
5453
{
5554
$sessionPerPage = session()->get($this->getPerPagePaginationSessionKey(), $this->getPerPageAccepted()[0] ?? 10);

tests/Traits/Helpers/PaginationHelpersTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ public function test_can_disable_detailed_pagination(): void
120120

121121
}
122122

123-
124123
public function test_can_toggle_total_item_count_retrieval(): void
125124
{
126125

@@ -150,5 +149,4 @@ public function test_can_toggle_total_item_count_retrieval_via_status(): void
150149
$this->assertTrue($this->basicTable->getShouldRetrieveTotalItemCount());
151150

152151
}
153-
154152
}

0 commit comments

Comments
 (0)