@@ -23,38 +25,45 @@
])
}}
>
- @if ($isMultiple)
- @if (filled($optionLabels = $getOptionLabels()))
+ @if (((! $isMultiple) && filled($optionLabel = $getOptionLabel())) ||
+ ($isMultiple && filled($optionLabels = $getOptionLabels())))
+ @if ($isMultiple && $hasBadges)
@foreach ($optionLabels as $optionLabel)
-
+ @if ($hasBadges)
+
+ {{ $optionLabel }}
+
+ @else
{{ $optionLabel }}
-
+ @endif
@endforeach
- @elseif (filled($placeholder = $getPlaceholder()))
-
- {{ $placeholder }}
-
- @endif
-
- @if (! $isDisabled)
+ @else
- {{ $getAction('select') }}
-
- @endif
- @else
- @if (filled($optionLabel = $getOptionLabel()))
- {{ $optionLabel }}
- @elseif (filled($placeholder = $getPlaceholder()))
-
- {{ $placeholder }}
+ @if ($hasBadges)
+
+ {{ $optionLabel }}
+
+ @elseif ($isMultiple)
+ @foreach ($optionLabels as $optionLabel)
+ {{ $optionLabel . ($loop->last ? '' : ', ') }}
+ @endforeach
+ @else
+ {{ $optionLabel }}
+ @endif
@endif
+ @elseif (filled($placeholder = $getPlaceholder()))
+
+ {{ $placeholder }}
+
+ @endif
- @if (! $isDisabled)
+ @if (! $isDisabled)
+
{{ $getAction('select') }}
- @endif
+
@endif
diff --git a/packages/forms/src/Components/ModalTableSelect.php b/packages/forms/src/Components/ModalTableSelect.php
index ef77420952..0dd733c571 100644
--- a/packages/forms/src/Components/ModalTableSelect.php
+++ b/packages/forms/src/Components/ModalTableSelect.php
@@ -59,6 +59,10 @@ class ModalTableSelect extends Field
protected ?Closure $modifySelectActionUsing = null;
+ protected bool | Closure | null $hasBadges = null;
+
+ protected string | Closure | null $badgeColor = null;
+
/**
* @var array