From b8e7a386f50d150fd55b06b93ef1dc67bb2980be Mon Sep 17 00:00:00 2001 From: Michael Aerni Date: Fri, 24 May 2024 08:59:32 -0400 Subject: [PATCH] Add support for `hide_display` property --- .../views/default/fields/assets.blade.php | 10 +-- .../views/default/fields/captcha.blade.php | 10 +-- .../views/default/fields/checkboxes.blade.php | 86 +++++++++---------- .../views/default/fields/default.blade.php | 10 +-- .../views/default/fields/honeypot.blade.php | 20 ++--- .../views/default/fields/radio.blade.php | 86 +++++++++---------- .../views/default/fields/select.blade.php | 10 +-- .../views/default/fields/textarea.blade.php | 10 +-- .../views/default/messages/display.blade.php | 2 +- .../default/messages/instructions.blade.php | 4 +- .../views/default/messages/legend.blade.php | 2 +- src/Fields/Concerns/WithDefaultProperties.php | 2 + src/Fields/Properties/WithHideDisplay.php | 11 +++ 13 files changed, 134 insertions(+), 129 deletions(-) create mode 100644 src/Fields/Properties/WithHideDisplay.php diff --git a/resources/views/default/fields/assets.blade.php b/resources/views/default/fields/assets.blade.php index cf00ab39..749591e6 100644 --- a/resources/views/default/fields/assets.blade.php +++ b/resources/views/default/fields/assets.blade.php @@ -1,10 +1,8 @@ -
- @formView('messages.display') +@formView('messages.display') - @if($field->instructions && $field->instructions_position === 'above') - @formView('messages.instructions') - @endif -
+@if($field->instructions && $field->instructions_position === 'above') + @formView('messages.instructions') +@endif
- @formView('messages.display') +@formView('messages.display') - @if($field->instructions && $field->instructions_position === 'above') - @formView('messages.instructions') - @endif -
+@if($field->instructions && $field->instructions_position === 'above') + @formView('messages.instructions') +@endif
-
+
+
@formView('messages.legend') @if($field->instructions && $field->instructions_position === 'above') @formView('messages.instructions') @endif -
-
- @foreach($field->options as $option => $label) -
-
- + @foreach($field->options as $option => $label) +
+
+ wire_model) - wire:model.{{ $field->wire_model }}="{{ $field->key }}" - @else - wire:model="{{ $field->key }}" - @endif + @if($field->wire_model) + wire:model.{{ $field->wire_model }}="{{ $field->key }}" + @else + wire:model="{{ $field->key }}" + @endif - @if(! $errors->has($field->key)) - class="w-4 h-4 text-indigo-600 border-gray-300 rounded focus:ring-indigo-500" - @if($field->instructions) - aria-describedby="{{ $field->id }}-instructions" + @if(! $errors->has($field->key)) + class="w-4 h-4 text-indigo-600 border-gray-300 rounded focus:ring-indigo-500" + @if($field->instructions) + aria-describedby="{{ $field->id }}-instructions" + @endif + @else + class="w-4 h-4 text-indigo-600 border-red-300 rounded focus:ring-red-500" + aria-invalid="true" + aria-describedby="{{ $field->id }}-error" @endif - @else - class="w-4 h-4 text-indigo-600 border-red-300 rounded focus:ring-red-500" - aria-invalid="true" - aria-describedby="{{ $field->id }}-error" - @endif - /> -
+ /> +
-
- +
+ +
-
- @endforeach -
+ @endforeach +
- @if($errors->has($field->key)) - @formView('messages.error') - @elseif($field->instructions && $field->instructions_position === 'below') - @formView('messages.instructions') - @endif + @if($errors->has($field->key)) + @formView('messages.error') + @elseif($field->instructions && $field->instructions_position === 'below') + @formView('messages.instructions') + @endif +
diff --git a/resources/views/default/fields/default.blade.php b/resources/views/default/fields/default.blade.php index dd19ee04..6aeeb316 100644 --- a/resources/views/default/fields/default.blade.php +++ b/resources/views/default/fields/default.blade.php @@ -1,10 +1,8 @@ -
- @formView('messages.display') +@formView('messages.display') - @if($field->instructions && $field->instructions_position === 'above') - @formView('messages.instructions') - @endif -
+@if($field->instructions && $field->instructions_position === 'above') + @formView('messages.instructions') +@endif - -
+ diff --git a/resources/views/default/fields/radio.blade.php b/resources/views/default/fields/radio.blade.php index 3c68a961..18144961 100644 --- a/resources/views/default/fields/radio.blade.php +++ b/resources/views/default/fields/radio.blade.php @@ -1,56 +1,56 @@ -
-
+
+
@formView('messages.legend') @if($field->instructions && $field->instructions_position === 'above') @formView('messages.instructions') @endif -
-
- @foreach($field->options as $option => $label) -
-
- + @foreach($field->options as $option => $label) +
+
+ wire_model) - wire:model.{{ $field->wire_model }}="{{ $field->key }}" - @else - wire:model="{{ $field->key }}" - @endif + @if($field->wire_model) + wire:model.{{ $field->wire_model }}="{{ $field->key }}" + @else + wire:model="{{ $field->key }}" + @endif - @if(! $errors->has($field->key)) - class="w-4 h-4 text-indigo-600 border-gray-300 focus:ring-indigo-500" - @if($field->instructions) - aria-describedby="{{ $field->id }}-instructions" + @if(! $errors->has($field->key)) + class="w-4 h-4 text-indigo-600 border-gray-300 focus:ring-indigo-500" + @if($field->instructions) + aria-describedby="{{ $field->id }}-instructions" + @endif + @else + class="w-4 h-4 text-indigo-600 border-red-300 focus:ring-red-500" + aria-invalid="true" + aria-describedby="{{ $field->id }}-error" @endif - @else - class="w-4 h-4 text-indigo-600 border-red-300 focus:ring-red-500" - aria-invalid="true" - aria-describedby="{{ $field->id }}-error" - @endif - /> -
+ /> +
-
- +
+ +
-
- @endforeach -
+ @endforeach +
- @if($errors->has($field->key)) - @formView('messages.error') - @elseif($field->instructions && $field->instructions_position === 'below') - @formView('messages.instructions') - @endif + @if($errors->has($field->key)) + @formView('messages.error') + @elseif($field->instructions && $field->instructions_position === 'below') + @formView('messages.instructions') + @endif +
diff --git a/resources/views/default/fields/select.blade.php b/resources/views/default/fields/select.blade.php index fb36edcb..3689b89e 100644 --- a/resources/views/default/fields/select.blade.php +++ b/resources/views/default/fields/select.blade.php @@ -1,10 +1,8 @@ -
- @formView('messages.display') +@formView('messages.display') - @if($field->instructions && $field->instructions_position === 'above') - @formView('messages.instructions') - @endif -
+@if($field->instructions && $field->instructions_position === 'above') + @formView('messages.instructions') +@endif