|
2 | 2 |
|
3 | 3 | namespace AmirHossein5\LaravelComponents\Components\Pagination; |
4 | 4 |
|
| 5 | +use AmirHossein5\LaravelComponents\Components\HasSended; |
5 | 6 | use AmirHossein5\LaravelComponents\Components\Renderable; |
6 | 7 | use Illuminate\View\Component; |
7 | 8 | use Illuminate\Pagination\LengthAwarePaginator; |
|
10 | 11 |
|
11 | 12 | abstract class Pagination extends Component |
12 | 13 | { |
13 | | - use Pageable, Renderable; |
| 14 | + use Pageable, Renderable, HasSended; |
14 | 15 |
|
15 | 16 | public LengthAwarePaginator|Paginator $paginator; |
| 17 | + public string $prev = ''; |
| 18 | + public string $next = ''; |
| 19 | + public string $prevInResponsive = ''; |
| 20 | + public string $nextInResponsive = ''; |
| 21 | + public string $class = ''; |
| 22 | + public bool $showDisabledButtons = false; |
| 23 | + public bool $showPaginatorDetails = true; |
16 | 24 |
|
17 | 25 | public function __construct( |
18 | 26 | LengthAwarePaginator|Paginator $elems, |
19 | | - public string $prev = '', |
20 | | - public string $next = '', |
21 | | - public string $prevInResponsive = '', |
22 | | - public string $nextInResponsive = '', |
23 | | - public string $class = '', |
24 | | - public bool $showDisabledButtons = false, |
25 | | - public bool $showPaginatorDetails = true, |
| 27 | + $prev = null, |
| 28 | + $next = null, |
| 29 | + $prevInResponsive = null, |
| 30 | + $nextInResponsive = null, |
| 31 | + $class = null, |
| 32 | + $showDisabledButtons = null, |
| 33 | + $showPaginatorDetails = null, |
26 | 34 | ) { |
| 35 | + $this->setParametersToPropertiesIfPassed( |
| 36 | + 'elems', |
| 37 | + $prev, |
| 38 | + $next, |
| 39 | + $prevInResponsive, |
| 40 | + $nextInResponsive, |
| 41 | + $class, |
| 42 | + $showDisabledButtons, |
| 43 | + $showPaginatorDetails |
| 44 | + ); |
27 | 45 | $this->paginator = $elems; |
28 | 46 | $this->isSimplePaginate() ?: $this->setPageNumbers(); |
29 | 47 | } |
|
0 commit comments