Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

feat: add ability to choose if the placeholder of a select element is… #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions resources/views/bootstrap-4/form-select.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@props(['disablePlaceholder' => false])

<div class="form-group">
<x-form-label :label="$label" :for="$attributes->get('id') ?: $id()" />

Expand All @@ -23,7 +25,7 @@
{!! $attributes->merge(['class' => 'form-control ' . ($hasError($name) ? 'is-invalid' : '')]) !!}>

@if($placeholder)
<option value="" disabled @if($nothingSelected()) selected="selected" @endif>
<option value="" @if($disablePlaceholder) disabled @endif @if($nothingSelected()) selected="selected" @endif>
{{ $placeholder }}
</option>
@endif
Expand All @@ -42,4 +44,4 @@
@if($hasErrorAndShow($name))
<x-form-errors :name="$name" />
@endif
</div>
</div>
4 changes: 3 additions & 1 deletion resources/views/bootstrap-5/form-select.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@props(['disablePlaceholder' => false])

@if($floating) <div class="form-floating"> @endif

@if(!$floating)
Expand Down Expand Up @@ -27,7 +29,7 @@
>

@if($placeholder)
<option value="" disabled @if($nothingSelected()) selected="selected" @endif>
<option value="" @if($disablePlaceholder) disabled @endif @if($nothingSelected()) selected="selected" @endif>
{{ $placeholder }}
</option>
@endif
Expand Down
6 changes: 4 additions & 2 deletions resources/views/tailwind-2/form-select.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@props(['disablePlaceholder' => false])

<div class="mt-4">
<label class="block">
<x-form-label :label="$label" />
Expand All @@ -22,7 +24,7 @@
]) !!}>

@if($placeholder)
<option value="" disabled @if($nothingSelected()) selected="selected" @endif>
<option value="" @if($disablePlaceholder) disabled @endif @if($nothingSelected()) selected="selected" @endif>
{{ $placeholder }}
</option>
@endif
Expand All @@ -40,4 +42,4 @@
@if($hasErrorAndShow($name))
<x-form-errors :name="$name" />
@endif
</div>
</div>
6 changes: 4 additions & 2 deletions resources/views/tailwind-forms-simple/form-select.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@props(['disablePlaceholder' => false])

<div class="mt-4">
<label class="block">
<x-form-label :label="$label" />
Expand All @@ -22,7 +24,7 @@
]) !!}>

@if($placeholder)
<option value="" disabled @if($nothingSelected()) selected="selected" @endif>
<option value="" @if($disablePlaceholder) disabled @endif @if($nothingSelected()) selected="selected" @endif>
{{ $placeholder }}
</option>
@endif
Expand All @@ -40,4 +42,4 @@
@if($hasErrorAndShow($name))
<x-form-errors :name="$name" />
@endif
</div>
</div>
6 changes: 4 additions & 2 deletions resources/views/tailwind/form-select.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@props(['disablePlaceholder' => false])

<div class="mt-4">
<label class="block">
<x-form-label :label="$label" />
Expand All @@ -22,7 +24,7 @@
]) !!}>

@if($placeholder)
<option value="" disabled @if($nothingSelected()) selected="selected" @endif>
<option value="" @if($disablePlaceholder) disabled @endif @if($nothingSelected()) selected="selected" @endif>
{{ $placeholder }}
</option>
@endif
Expand All @@ -40,4 +42,4 @@
@if($hasErrorAndShow($name))
<x-form-errors :name="$name" />
@endif
</div>
</div>