diff --git a/dist/bootstrap5.css b/dist/bootstrap5.css index 179a2673..b8919dc1 100644 --- a/dist/bootstrap5.css +++ b/dist/bootstrap5.css @@ -1,3 +1,3 @@ -[x-cloak]{display:none}table{width:100%}select{background-color:inherit}.loader{animation:spinner 1.5s linear infinite;border-top-color:#222}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(1turn)}}table thead{color:#6b6a6a;font-size:.75rem;padding-bottom:8px;padding-left:15px;padding-top:8px;text-transform:uppercase}.pg-actions{display:flex;gap:4px;width:100%}.pg-actions a{display:inline-block} +[x-cloak]{display:none}table{width:100%}select{background-color:inherit}.loader{animation:spinner 1.5s linear infinite;border-top-color:#222}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(1turn)}}table thead{color:#6b6a6a;font-size:.75rem;padding-bottom:8px;padding-left:15px;padding-top:8px;text-transform:uppercase} [x-ref=editable].pg-single-line{overflow:hidden;white-space:nowrap}[x-ref=editable].pg-single-line br{display:none}[x-ref=editable].pg-single-line *{display:inline;white-space:nowrap}[x-ref=editable][placeholder]:empty:before{background-color:transparent;color:gray;content:attr(placeholder);position:absolute} .table .checkbox-column{max-width:50px!important;text-align:center;width:50px!important}.btn-light{background-color:#fff;border-color:#d7dbdf;color:#000;font-size:.85rem}.form-control:disabled,.form-control[readonly]{background-color:#fff!important;opacity:1}.btn-light:hover{background-color:#fff;border-color:#d7dbdf;color:#000;font-size:.85rem}.btn-light,.has-search .form-control{padding-left:10px!important}.accordion-button{padding:.7rem}.btn-light,.has-search .form-control{padding-left:2.375rem}.page-link{color:gray!important}.page-item.active .page-link{background-color:gray;border-color:gray;color:#fff!important}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.badge{font-size:.77em}.btn,.form-control{box-shadow:none!important}.btn-group-vertical>.btn,.btn-group>.btn{border-color:#ced4da!important;flex:1 1 auto;position:relative}.bs5-rotate-0{transform:rotate(0deg);transition:all .3s ease}.bs5-rotate-90{transform:rotate(90deg);transition:all .3s ease}.bs5-w-h-1_5em{height:1.5em;width:1.5em} diff --git a/dist/mix-manifest.json b/dist/mix-manifest.json index 54c7f1b4..7b59149e 100644 --- a/dist/mix-manifest.json +++ b/dist/mix-manifest.json @@ -1,7 +1,7 @@ { "/powergrid.js": "/powergrid.js?id=abadfd5261368378c9a092e58c07156e", - "/bootstrap5.css": "/bootstrap5.css?id=ebd9853ab6704f4a2335e83a4310bb2b", - "/tailwind.css": "/tailwind.css?id=01ab1b7207e6bfcf473c14f0818e9d5f", + "/bootstrap5.css": "/bootstrap5.css?id=a27af22343149104b2aa3283d8fd502b", + "/tailwind.css": "/tailwind.css?id=924477e2afcb2cb56aa392e266ee56ca", "/tom-select.css": "/tom-select.css?id=7feeb634924554f9e57ce1e09edcabcb", - "/powergrid.css": "/powergrid.css?id=ccf9e99db3929ffc436445d5befaf2ac" + "/powergrid.css": "/powergrid.css?id=c2648f9d0d2b90371db3b914ef05450e" } diff --git a/dist/powergrid.css b/dist/powergrid.css index 1524a21c..027bd7cc 100644 --- a/dist/powergrid.css +++ b/dist/powergrid.css @@ -1 +1 @@ -[x-cloak]{display:none}table{width:100%}.btn-light{background-color:#fff;border-color:#d7dbdf;color:#000;font-size:.85rem}.form-control:disabled,.form-control[readonly]{background-color:#fff!important;opacity:1}.btn-light:hover{background-color:#fff;border-color:#d7dbdf;color:#000;font-size:.85rem}.btn-light,.has-search .form-control{padding-left:10px!important}.table .checkbox-column{max-width:50px!important;text-align:center;width:50px!important}.accordion-button{padding:.7rem}.btn-light,.has-search .form-control{padding-left:2.375rem}.page-link{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-right-width:1px;color:rgb(30 64 175/var(--tw-text-opacity));display:block;font-size:.875rem;line-height:1.25rem;outline:2px solid transparent;outline-offset:2px;padding-bottom:.5rem;padding-top:.5rem;text-align:center;width:3rem}.page-link:last-child{border-width:0}.page-item.active .page-link,.page-link:hover{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity));border-color:rgb(29 78 216/var(--tw-border-opacity));color:rgb(255 255 255/var(--tw-text-opacity))}.page-item.disabled .page-link{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));color:rgb(209 213 219/var(--tw-text-opacity))}.page-link{color:gray!important}.page-item.active .page-link{background-color:gray;border-color:gray;color:#fff!important}.loader{animation:spinner 1.5s linear infinite;border-top-color:#222}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(1turn)}}table thead{color:#6b6a6a;font-size:.75rem;padding-bottom:8px;padding-left:15px;padding-top:8px;text-transform:uppercase}.badge{font-size:.77em}.btn,.form-control{box-shadow:none!important}.btn-group-vertical>.btn,.btn-group>.btn{border-color:#ced4da!important;flex:1 1 auto;position:relative}[x-ref=editable].pg-single-line{overflow:hidden;white-space:nowrap}[x-ref=editable].pg-single-line br{display:none}[x-ref=editable].pg-single-line *{display:inline;white-space:nowrap}[x-ref=editable][placeholder]:empty:before{background-color:transparent;color:gray;content:attr(placeholder);position:absolute}.power-grid-button{width:100%}.pg-btn-white{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(226 232 240/var(--tw-ring-opacity));align-items:center;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(203 213 225/var(--tw-border-opacity));border-radius:.5rem;border-width:1px;color:rgb(100 116 139/var(--tw-text-opacity));-moz-column-gap:.5rem;column-gap:.5rem;display:inline-flex;font-size:.875rem;justify-content:center;line-height:1.25rem;outline:2px solid transparent;outline-offset:2px;padding:.5rem .75rem}.pg-btn-white:hover{--tw-bg-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(241 245 249/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pg-btn-white:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);--tw-ring-offset-width:1px;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pg-btn-white:disabled{cursor:not-allowed;opacity:.8}.bs5-rotate-0{transform:rotate(0deg);transition:all .3s ease}.bs5-rotate-90{transform:rotate(90deg);transition:all .3s ease}.bs5-w-h-1_5em{height:1.5em;width:1.5em}.pg-actions{display:flex;gap:.5rem;width:100%}.pg-filter-container{padding-bottom:.75rem;padding-top:.75rem}select{background-image:unset!important}.pg-enabled-filters-base{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.5rem}@media (min-width:768px){.pg-enabled-filters-base{margin-top:0}} +[x-cloak]{display:none}table{width:100%}.btn-light{background-color:#fff;border-color:#d7dbdf;color:#000;font-size:.85rem}.form-control:disabled,.form-control[readonly]{background-color:#fff!important;opacity:1}.btn-light:hover{background-color:#fff;border-color:#d7dbdf;color:#000;font-size:.85rem}.btn-light,.has-search .form-control{padding-left:10px!important}.table .checkbox-column{max-width:50px!important;text-align:center;width:50px!important}.accordion-button{padding:.7rem}.btn-light,.has-search .form-control{padding-left:2.375rem}.page-link{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-right-width:1px;color:rgb(30 64 175/var(--tw-text-opacity));display:block;font-size:.875rem;line-height:1.25rem;outline:2px solid transparent;outline-offset:2px;padding-bottom:.5rem;padding-top:.5rem;text-align:center;width:3rem}.page-link:last-child{border-width:0}.page-item.active .page-link,.page-link:hover{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity));border-color:rgb(29 78 216/var(--tw-border-opacity));color:rgb(255 255 255/var(--tw-text-opacity))}.page-item.disabled .page-link{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));color:rgb(209 213 219/var(--tw-text-opacity))}.page-link{color:gray!important}.page-item.active .page-link{background-color:gray;border-color:gray;color:#fff!important}.loader{animation:spinner 1.5s linear infinite;border-top-color:#222}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(1turn)}}table thead{color:#6b6a6a;font-size:.75rem;padding-bottom:8px;padding-left:15px;padding-top:8px;text-transform:uppercase}.badge{font-size:.77em}.btn,.form-control{box-shadow:none!important}.btn-group-vertical>.btn,.btn-group>.btn{border-color:#ced4da!important;flex:1 1 auto;position:relative}[x-ref=editable].pg-single-line{overflow:hidden;white-space:nowrap}[x-ref=editable].pg-single-line br{display:none}[x-ref=editable].pg-single-line *{display:inline;white-space:nowrap}[x-ref=editable][placeholder]:empty:before{background-color:transparent;color:gray;content:attr(placeholder);position:absolute}.power-grid-button{width:100%}.pg-btn-white{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(226 232 240/var(--tw-ring-opacity));align-items:center;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(203 213 225/var(--tw-border-opacity));border-radius:.5rem;border-width:1px;color:rgb(100 116 139/var(--tw-text-opacity));-moz-column-gap:.5rem;column-gap:.5rem;display:inline-flex;font-size:.875rem;justify-content:center;line-height:1.25rem;outline:2px solid transparent;outline-offset:2px;padding:.5rem .75rem}.pg-btn-white:hover{--tw-bg-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(241 245 249/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pg-btn-white:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);--tw-ring-offset-width:1px;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pg-btn-white:disabled{cursor:not-allowed;opacity:.8}.bs5-rotate-0{transform:rotate(0deg);transition:all .3s ease}.bs5-rotate-90{transform:rotate(90deg);transition:all .3s ease}.bs5-w-h-1_5em{height:1.5em;width:1.5em}select{background-image:unset!important}.pg-enabled-filters-base{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.5rem}@media (min-width:768px){.pg-enabled-filters-base{margin-top:0}} diff --git a/dist/tailwind.css b/dist/tailwind.css index b587ae06..e8b8868f 100644 --- a/dist/tailwind.css +++ b/dist/tailwind.css @@ -1,3 +1,3 @@ -[x-cloak]{display:none}table{width:100%}select{background-color:inherit}.loader{animation:spinner 1.5s linear infinite;border-top-color:#222}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(1turn)}}table thead{color:#6b6a6a;font-size:.75rem;padding-bottom:8px;padding-left:15px;padding-top:8px;text-transform:uppercase}.pg-actions{display:flex;gap:4px;width:100%}.pg-actions a{display:inline-block} +[x-cloak]{display:none}table{width:100%}select{background-color:inherit}.loader{animation:spinner 1.5s linear infinite;border-top-color:#222}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(1turn)}}table thead{color:#6b6a6a;font-size:.75rem;padding-bottom:8px;padding-left:15px;padding-top:8px;text-transform:uppercase} [x-ref=editable].pg-single-line{overflow:hidden;white-space:nowrap}[x-ref=editable].pg-single-line br{display:none}[x-ref=editable].pg-single-line *{display:inline;white-space:nowrap}[x-ref=editable][placeholder]:empty:before{background-color:transparent;color:gray;content:attr(placeholder);position:absolute} -.page-link{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-right-width:1px;color:rgb(30 64 175/var(--tw-text-opacity));display:block;font-size:.875rem;line-height:1.25rem;outline:2px solid transparent;outline-offset:2px;padding-bottom:.5rem;padding-top:.5rem;text-align:center;width:3rem}.page-link:last-child{border-width:0}.page-item.active .page-link,.page-link:hover{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity));border-color:rgb(29 78 216/var(--tw-border-opacity));color:rgb(255 255 255/var(--tw-text-opacity))}.page-item.disabled .page-link{border-color:rgb(229 231 235/var(--tw-border-opacity));color:rgb(209 213 219/var(--tw-text-opacity))}.page-item.disabled .page-link,.pg-btn-white{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pg-btn-white{--tw-ring-opacity:1;--tw-ring-color:rgb(226 232 240/var(--tw-ring-opacity));align-items:center;border-color:rgb(203 213 225/var(--tw-border-opacity));border-radius:.5rem;border-width:1px;color:rgb(100 116 139/var(--tw-text-opacity));-moz-column-gap:.5rem;column-gap:.5rem;display:inline-flex;font-size:.875rem;justify-content:center;line-height:1.25rem;outline:2px solid transparent;outline-offset:2px;padding:.5rem .75rem}.pg-btn-white:hover{--tw-bg-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(241 245 249/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pg-btn-white:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);--tw-ring-offset-width:1px;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pg-btn-white:disabled{cursor:not-allowed;opacity:.8}.pg-filter-container{padding-bottom:.75rem;padding-top:.75rem}.pg-enabled-filters-base{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:.75rem;margin-top:.75rem}@media (min-width:768px){.pg-enabled-filters-base{margin-top:0}}.pg-actions-row{display:flex;gap:.5rem} +.page-link{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-right-width:1px;color:rgb(30 64 175/var(--tw-text-opacity));display:block;font-size:.875rem;line-height:1.25rem;outline:2px solid transparent;outline-offset:2px;padding-bottom:.5rem;padding-top:.5rem;text-align:center;width:3rem}.page-link:last-child{border-width:0}.page-item.active .page-link,.page-link:hover{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity));border-color:rgb(29 78 216/var(--tw-border-opacity));color:rgb(255 255 255/var(--tw-text-opacity))}.page-item.disabled .page-link{border-color:rgb(229 231 235/var(--tw-border-opacity));color:rgb(209 213 219/var(--tw-text-opacity))}.page-item.disabled .page-link,.pg-btn-white{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pg-btn-white{--tw-ring-opacity:1;--tw-ring-color:rgb(226 232 240/var(--tw-ring-opacity));align-items:center;border-color:rgb(203 213 225/var(--tw-border-opacity));border-radius:.5rem;border-width:1px;color:rgb(100 116 139/var(--tw-text-opacity));-moz-column-gap:.5rem;column-gap:.5rem;display:inline-flex;font-size:.875rem;justify-content:center;line-height:1.25rem;outline:2px solid transparent;outline-offset:2px;padding:.5rem .75rem}.pg-btn-white:hover{--tw-bg-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(241 245 249/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pg-btn-white:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);--tw-ring-offset-width:1px;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pg-btn-white:disabled{cursor:not-allowed;opacity:.8}.pg-filter-container{padding-bottom:.75rem;padding-top:.75rem}.pg-enabled-filters-base{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:.75rem;margin-top:.75rem}@media (min-width:768px){.pg-enabled-filters-base{margin-top:0}} diff --git a/src/Concerns/ToggleDetail.php b/src/Concerns/ToggleDetail.php index f670bcdd..15303100 100644 --- a/src/Concerns/ToggleDetail.php +++ b/src/Concerns/ToggleDetail.php @@ -18,7 +18,7 @@ public function mountToggleDetail(): void private function resolveDetailRow(mixed $results): void { - if (!isset($this->setUp['detail'])) { + if (!isset($this->setUp['detail']) && !isset($this->setUp['lazy'])) { return; } diff --git a/src/DataSource/Processors/DataSourceBase.php b/src/DataSource/Processors/DataSourceBase.php index 0b96b607..9b7a7aa5 100644 --- a/src/DataSource/Processors/DataSourceBase.php +++ b/src/DataSource/Processors/DataSourceBase.php @@ -164,14 +164,22 @@ private static function processRows(BaseCollection $results, PowerGridComponent $loopInstance = app(ManageLoops::class); $loopInstance->addLoop($results); - return $results->map(function ($row, $index) use ($component, $fields, $loopInstance) { + $renderActions = false; + + if (method_exists($component, 'actions')) { + $renderActions = true; + } + + return $results->map(function ($row, $index) use ($component, $fields, $loopInstance, $renderActions) { $data = $fields->map(fn ($field) => $field((object) $row, $index)); $loopInstance->incrementLoopIndices(); - $hasCookieActionsForRow = isset($_COOKIE['pg_cookie_' . $component->tableName . '_row_' . data_get($row, $component->realPrimaryKey)]); + $rowId = data_get($row, $component->realPrimaryKey); + + $hasCookieActionsForRow = isset($_COOKIE['pg_cookie_' . $component->tableName . '_row_' . $rowId]); - if (method_exists($component, 'actions') && !$hasCookieActionsForRow) { + if ($renderActions && !$hasCookieActionsForRow) { $actions = collect($component->actions((object) $row)) // @phpstan-ignore-line ->transform(function (Button|array $action) use ($row, $component) { return [ @@ -184,7 +192,7 @@ private static function processRows(BaseCollection $results, PowerGridComponent ]; }); - static::$actionsHtml[data_get($row, $component->realPrimaryKey)] = $actions->toArray(); + static::$actionsHtml[$rowId] = $actions->toArray(); } $mergedData = $data->merge([ diff --git a/src/PowerGridComponent.php b/src/PowerGridComponent.php index b1121092..101005ad 100644 --- a/src/PowerGridComponent.php +++ b/src/PowerGridComponent.php @@ -4,9 +4,9 @@ use Exception; use Illuminate\Contracts\Events\Dispatcher; -use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\View\{Factory, View}; use Illuminate\Database\Eloquent\Relations\MorphToMany; +use Illuminate\Foundation\Application; use Illuminate\Pagination\{LengthAwarePaginator, Paginator}; use Illuminate\Support\{Collection as BaseCollection, Facades\Cache, Facades\DB}; @@ -15,8 +15,6 @@ use PowerComponents\LivewirePowerGrid\DataSource\Processors\{DataSourceBase}; use PowerComponents\LivewirePowerGrid\Events\PowerGridPerformanceData; -use Throwable; - /** * @property-read mixed $getRecords * @property-read bool $hasColumnFilters @@ -237,19 +235,6 @@ public function noDataLabel(): string|View return view('livewire-powergrid::components.table.no-data-label'); } - private function renderView(mixed $data): Application|Factory|View - { - $themeClass = $this->customThemeClass() ?? strval(config('livewire-powergrid.theme')); - - $theme = app($themeClass)->apply(); - - return view(theme_style($theme, 'layout.table'), [ - 'data' => $data, - 'theme' => $theme, - 'table' => 'livewire-powergrid::components.table', - ]); - } - public function getPublicPropertiesDefinedInComponent(): array { return collect((new \ReflectionClass($this))->getProperties(\ReflectionProperty::IS_PUBLIC)) @@ -260,26 +245,29 @@ public function getPublicPropertiesDefinedInComponent(): array ->all(); } - /** - * @throws Exception|Throwable - */ public function render(): Application|Factory|View { $data = $this->getRecords(); + /** @phpstan-ignore-next-line */ + $this->totalCurrentPage = method_exists($data, 'items') ? count($data->items()) : $data->count(); + $this->storeActionsRowInJSWindow(); $this->storeActionsHeaderInJSWindow(); - if (empty(data_get($this->setUp, 'lazy'))) { - $this->resolveDetailRow($data); - } - - /** @phpstan-ignore-next-line */ - $this->totalCurrentPage = method_exists($data, 'items') ? count($data->items()) : $data->count(); + $this->resolveDetailRow($data); $this->resolveFilters(); - return $this->renderView($data); + $theme = app( + $this->customThemeClass() ?? strval(config('livewire-powergrid.theme')) + )->apply(); + + return view(theme_style($theme, 'layout.table'), [ + 'data' => $data, + 'theme' => $theme, + 'table' => 'livewire-powergrid::components.table', + ]); } }