Skip to content

Commit f45e0bc

Browse files
committed
Migrate variables to DataTableComponent
1 parent 85396fa commit f45e0bc

File tree

2 files changed

+30
-28
lines changed

2 files changed

+30
-28
lines changed

resources/views/datatable.blade.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,3 @@
1-
@php($tableName = $this->getTableName())
2-
@php($tableId = $this->getTableId())
3-
@php($primaryKey = $this->getPrimaryKey())
4-
@php($isTailwind = $this->isTailwind())
5-
@php($isBootstrap = $this->isBootstrap())
6-
@php($isBootstrap4 = $this->isBootstrap4())
7-
@php($isBootstrap5 = $this->isBootstrap5())
8-
@php($localisationPath = $this->getLocalisationPath())
9-
@php($getCurrentlyReorderingStatus = $this->getCurrentlyReorderingStatus())
10-
@php($currentlyReorderingStatus = $this->getCurrentlyReorderingStatus())
11-
@php($showBulkActionsSections = $this->showBulkActionsSections())
12-
@php($showCollapsingColumnSections = $this->showCollapsingColumnSections())
13-
@php($selectedVisibleColumns = $this->selectedVisibleColumns())
14-
@php($columnCollapseInfo = $this->getCollapsedColumnsForContentAll())
15-
@php($collapsingColumnDetails = $this->getCollapsedColumnsForContentNew())
16-
@php($tdAttributes = $this->getBulkActionsTdAttributes())
17-
@php($tdCheckboxAttributes = $this->getBulkActionsTdCheckboxAttributes())
18-
@php($collapsingColumnButtonExpandAttributes = $this->getCollapsingColumnButtonExpandAttributes())
19-
@php($collapsingColumnButtonCollapseAttributes = $this->getCollapsingColumnButtonCollapseAttributes())
20-
@php($hasCollapsingColumns = ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns()))
21-
@php($shouldCollapseAlways = $this->shouldCollapseAlways())
22-
@php($shouldCollapseOnTablet = $this->shouldCollapseOnTablet())
23-
@php($shouldCollapseOnMobile = $this->shouldCollapseOnMobile())
24-
@php($coreTableAttributes = $this->getCoreTableAttributes())
25-
@php($hasDisplayLoadingPlaceholder = $this->hasDisplayLoadingPlaceholder())
26-
@php($hasTableRowUrl = $this->hasTableRowUrl())
27-
@php($colspanCount = $this->getColspanCount())
281

292
<div>
303

src/DataTableComponent.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,35 @@ public function render(): \Illuminate\Contracts\Foundation\Application|\Illumina
3636
"isHtml" => false
3737
"title" => "Created At"
3838
]*/
39-
return view('livewire-tables::datatable');
39+
return view('livewire-tables::datatable')->with(
40+
[
41+
'tableName' => $this->getTableName(),
42+
'tableId' => $this->getTableId(),
43+
'primaryKey' => $this->getPrimaryKey(),
44+
'isTailwind' => $this->isTailwind(),
45+
'isBootstrap' => $this->isBootstrap(),
46+
'isBootstrap4' => $this->isBootstrap4(),
47+
'isBootstrap5' => $this->isBootstrap5(),
48+
'localisationPath' => $this->getLocalisationPath(),
49+
'getCurrentlyReorderingStatus' => $this->getCurrentlyReorderingStatus(),
50+
'currentlyReorderingStatus' => $this->getCurrentlyReorderingStatus(),
51+
'showBulkActionsSections' => $this->showBulkActionsSections(),
52+
'showCollapsingColumnSections' => $this->showCollapsingColumnSections(),
53+
'selectedVisibleColumns' => $this->selectedVisibleColumns(),
54+
'columnCollapseInfo' => $this->getCollapsedColumnsForContentAll(),
55+
'collapsingColumnDetails' => $this->getCollapsedColumnsForContentNew(),
56+
'tdAttributes' => $this->getBulkActionsTdAttributes(),
57+
'tdCheckboxAttributes' => $this->getBulkActionsTdCheckboxAttributes(),
58+
'collapsingColumnButtonExpandAttributes' => $this->getCollapsingColumnButtonExpandAttributes(),
59+
'collapsingColumnButtonCollapseAttributes' => $this->getCollapsingColumnButtonCollapseAttributes(),
60+
'hasCollapsingColumns' => ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns()),
61+
'shouldCollapseAlways' => $this->shouldCollapseAlways(),
62+
'shouldCollapseOnTablet' => $this->shouldCollapseOnTablet(),
63+
'shouldCollapseOnMobile' => $this->shouldCollapseOnMobile(),
64+
'coreTableAttributes' => $this->getCoreTableAttributes(),
65+
'hasDisplayLoadingPlaceholder' => $this->hasDisplayLoadingPlaceholder(),
66+
'hasTableRowUrl' => $this->hasTableRowUrl(),
67+
'colspanCount' => $this->getColspanCount(),
68+
]);
4069
}
4170
}

0 commit comments

Comments
 (0)