From a9441f4cefee65db985442aa89e1cc35a98dd034 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Wed, 22 Jan 2025 08:24:15 +0000 Subject: [PATCH] Rename --- .../src/Concerns/InteractsWithActions.php | 2 +- .../src/Components/Concerns/HasHeadings.php | 4 ++-- packages/schemas/src/Concerns/HasHeadings.php | 12 ++++++------ packages/tables/resources/views/index.blade.php | 16 ++++++++++++---- .../tables/src/Table/Concerns/HasHeadings.php | 12 ++++++------ 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/packages/actions/src/Concerns/InteractsWithActions.php b/packages/actions/src/Concerns/InteractsWithActions.php index 116d9c4e4f..72eada12e0 100644 --- a/packages/actions/src/Concerns/InteractsWithActions.php +++ b/packages/actions/src/Concerns/InteractsWithActions.php @@ -568,7 +568,7 @@ trait InteractsWithActions ->pluck('name') ->implode('.'), ) - ->defaultHeadingLevel(3), + ->rootHeadingLevel(3), ); } diff --git a/packages/schemas/src/Components/Concerns/HasHeadings.php b/packages/schemas/src/Components/Concerns/HasHeadings.php index 82bd24b945..59d18e5506 100644 --- a/packages/schemas/src/Components/Concerns/HasHeadings.php +++ b/packages/schemas/src/Components/Concerns/HasHeadings.php @@ -6,7 +6,7 @@ trait HasHeadings { public function getHeadingLevel(int $index = 0): int { - return $this->getContainer()->getDefaultHeadingLevel() + $index; + return $this->getContainer()->getRootHeadingLevel() + $index; } public function getHeadingTag(int $index = 0): string @@ -20,7 +20,7 @@ trait HasHeadings return "h{$level}"; } - public function getChildComponentContainerDefaultHeadingLevel(): int + public function getChildComponentContainerRootHeadingLevel(): int { return $this->getHeadingLevel() + $this->getHeadingsCount(); } diff --git a/packages/schemas/src/Concerns/HasHeadings.php b/packages/schemas/src/Concerns/HasHeadings.php index c76a350a4d..cd48b82086 100644 --- a/packages/schemas/src/Concerns/HasHeadings.php +++ b/packages/schemas/src/Concerns/HasHeadings.php @@ -4,21 +4,21 @@ namespace Filament\Schemas\Concerns; trait HasHeadings { - protected int $defaultHeadingLevel = 2; + protected int $rootHeadingLevel = 2; - public function defaultHeadingLevel(int $level): static + public function rootHeadingLevel(int $level): static { - $this->defaultHeadingLevel = $level; + $this->rootHeadingLevel = $level; return $this; } - public function getDefaultHeadingLevel(): int + public function getRootHeadingLevel(): int { if ($parentComponent = $this->getParentComponent()) { - return $parentComponent->getChildComponentContainerDefaultHeadingLevel(); + return $parentComponent->getChildComponentContainerRootHeadingLevel(); } - return $this->defaultHeadingLevel; + return $this->rootHeadingLevel; } } diff --git a/packages/tables/resources/views/index.blade.php b/packages/tables/resources/views/index.blade.php index 579d030edb..0ef03b9ef8 100644 --- a/packages/tables/resources/views/index.blade.php +++ b/packages/tables/resources/views/index.blade.php @@ -137,7 +137,9 @@ @if ($heading || $description)
@if ($heading) - <{{ $headingTag }} class="fi-ta-header-heading"> + <{{ $headingTag }} + class="fi-ta-header-heading" + > {{ $heading }} @endif @@ -451,7 +453,9 @@
- <{{ $secondLevelHeadingTag }} class="fi-ta-col-toggle-heading"> + <{{ $secondLevelHeadingTag }} + class="fi-ta-col-toggle-heading" + > {{ __('filament-tables::table.column_toggle.heading') }} @@ -827,7 +831,9 @@ @endif
- <{{ $secondLevelHeadingTag }} class="fi-ta-group-heading"> + <{{ $secondLevelHeadingTag }} + class="fi-ta-group-heading" + > @if (filled($recordGroupLabel = ($group->isTitlePrefixedWithLabel() ? $group->getLabel() : null))) {{ $recordGroupLabel }}: @endif @@ -1821,7 +1827,9 @@ {{ \Filament\Support\generate_icon_html($getEmptyStateIcon()) }}
- <{{ $secondLevelHeadingTag }} class="fi-ta-empty-state-heading"> + <{{ $secondLevelHeadingTag }} + class="fi-ta-empty-state-heading" + > {{ $getEmptyStateHeading() }} diff --git a/packages/tables/src/Table/Concerns/HasHeadings.php b/packages/tables/src/Table/Concerns/HasHeadings.php index 1aeb6e9a35..b969fd687a 100644 --- a/packages/tables/src/Table/Concerns/HasHeadings.php +++ b/packages/tables/src/Table/Concerns/HasHeadings.php @@ -4,23 +4,23 @@ namespace Filament\Tables\Table\Concerns; trait HasHeadings { - protected int $defaultHeadingLevel = 2; + protected int $rootHeadingLevel = 2; - public function defaultHeadingLevel(int $level): static + public function rootHeadingLevel(int $level): static { - $this->defaultHeadingLevel = $level; + $this->rootHeadingLevel = $level; return $this; } - public function getDefaultHeadingLevel(): int + public function getRootHeadingLevel(): int { - return $this->defaultHeadingLevel; + return $this->rootHeadingLevel; } public function getHeadingLevel(int $index = 0): int { - return $this->getDefaultHeadingLevel() + $index; + return $this->getRootHeadingLevel() + $index; } public function getHeadingTag(int $index = 0): string