From d5cff2ef4889fe6aae91217c070c85f30f89e2c2 Mon Sep 17 00:00:00 2001 From: Michael Aerni Date: Wed, 25 Oct 2023 14:34:15 -0400 Subject: [PATCH 001/209] Add `wire:key` to `@foreach` loops As per docs: https://livewire.laravel.com/docs/components#adding-wirekey-to-foreach-loops --- resources/stubs/theme/errors.blade.php | 4 ++-- resources/stubs/theme/fields/checkbox.blade.php | 2 +- resources/stubs/theme/fields/radio.blade.php | 2 +- resources/stubs/theme/fields/select.blade.php | 2 +- resources/stubs/theme/section.blade.php | 2 +- src/Form/Fields.php | 5 ++--- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/resources/stubs/theme/errors.blade.php b/resources/stubs/theme/errors.blade.php index 23ee02f5..79df3f8d 100644 --- a/resources/stubs/theme/errors.blade.php +++ b/resources/stubs/theme/errors.blade.php @@ -12,8 +12,8 @@
diff --git a/resources/stubs/theme/fields/checkbox.blade.php b/resources/stubs/theme/fields/checkbox.blade.php index dea2e16f..fd466b99 100644 --- a/resources/stubs/theme/fields/checkbox.blade.php +++ b/resources/stubs/theme/fields/checkbox.blade.php @@ -13,7 +13,7 @@
@foreach ($field->options as $option => $label) -
+
@foreach ($field->options as $option => $label) -
+
{{ $label }} + @endforeach
diff --git a/resources/stubs/theme/section.blade.php b/resources/stubs/theme/section.blade.php index 6cac8586..b4c21146 100644 --- a/resources/stubs/theme/section.blade.php +++ b/resources/stubs/theme/section.blade.php @@ -1,6 +1,6 @@ @if ($section) -
+
@if ($section['display'])
diff --git a/src/Form/Fields.php b/src/Form/Fields.php index 569c8e82..96525eff 100644 --- a/src/Form/Fields.php +++ b/src/Form/Fields.php @@ -76,12 +76,11 @@ public function sections(): Collection { return $this->form->blueprint()->tabs()->first()->sections() ->map(function ($section, $index) { - $handle = $section->display() - ? Str::snake($section->display()) - : $index; + $handle = $section->display() ? Str::snake($section->display()) : $index; return [ 'handle' => $handle, + 'id' => "{$this->id}-section-{$index}-{$handle}", 'display' => $section->display(), 'instructions' => $section->instructions(), 'fields' => $this->getSectionFields($section), From d84b11a5eb4214ba3b6a5923348fb172402f8687 Mon Sep 17 00:00:00 2001 From: Michael Aerni Date: Wed, 25 Oct 2023 14:36:48 -0400 Subject: [PATCH 002/209] Use coherent naming for keys and ids --- resources/stubs/theme/field.blade.php | 2 +- resources/stubs/theme/fields/checkbox.blade.php | 4 ++-- resources/stubs/theme/fields/radio.blade.php | 4 ++-- src/Fields/Properties/WithId.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/stubs/theme/field.blade.php b/resources/stubs/theme/field.blade.php index add21217..0935be3a 100644 --- a/resources/stubs/theme/field.blade.php +++ b/resources/stubs/theme/field.blade.php @@ -1,7 +1,7 @@ @if ($field->show)
id }}-{{ $option }}" class="flex items-start">