refactor: Update checkbox component to support full width option
This commit is contained in:
@@ -6,9 +6,13 @@
|
|||||||
'instantSave' => false,
|
'instantSave' => false,
|
||||||
'value' => null,
|
'value' => null,
|
||||||
'hideLabel' => false,
|
'hideLabel' => false,
|
||||||
|
'fullWidth' => false,
|
||||||
])
|
])
|
||||||
|
|
||||||
<div class="flex flex-row items-center py-1 form-control min-w-fit dark:hover:bg-coolgray-100">
|
<div @class([
|
||||||
|
'flex flex-row items-center gap-4 px-2 py-1 form-control min-w-fit dark:hover:bg-coolgray-100',
|
||||||
|
'w-full' => $fullWidth,
|
||||||
|
])>
|
||||||
@if (!$hideLabel)
|
@if (!$hideLabel)
|
||||||
<label class="flex gap-4 px-0 min-w-fit label">
|
<label class="flex gap-4 px-0 min-w-fit label">
|
||||||
<span class="flex gap-2">
|
<span class="flex gap-2">
|
||||||
|
@@ -181,14 +181,10 @@
|
|||||||
</div>
|
</div>
|
||||||
@foreach ($checkboxes as $index => $checkbox)
|
@foreach ($checkboxes as $index => $checkbox)
|
||||||
<div class="flex justify-between items-center mb-2">
|
<div class="flex justify-between items-center mb-2">
|
||||||
<label for="{{ $checkbox['id'] }}"
|
<x-forms.checkbox fullWidth :label="$checkbox['label']" :id="$checkbox['id']"
|
||||||
class="flex-grow pr-4 text-sm leading-5 text-gray-700 dark:text-gray-300">
|
:wire:model="$checkbox['id']"
|
||||||
{{ $checkbox['label'] }}
|
|
||||||
</label>
|
|
||||||
<x-forms.checkbox :id="$checkbox['id']" :wire:model="$checkbox['id']"
|
|
||||||
x-on:change="toggleAction('{{ $checkbox['id'] }}')" :checked="$this->{$checkbox['id']}"
|
x-on:change="toggleAction('{{ $checkbox['id'] }}')" :checked="$this->{$checkbox['id']}"
|
||||||
x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')"
|
x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')" />
|
||||||
class="flex-shrink-0" :hideLabel="true" />
|
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user