css and stuffs

This commit is contained in:
Andras Bacsai
2023-05-18 13:26:35 +02:00
parent f2e91f97ed
commit b58a3bf209
49 changed files with 327 additions and 252 deletions

View File

@@ -1,17 +1,30 @@
@props([
'type' => $attributes->get('type') ?? 'button',
'disabled' => null,
'confirm' => null,
'confirmAction' => null,
])
<button {{ $attributes }}
@if ($attributes->whereStartsWith('wire:click') && !$disabled) wire:target="{{ explode('(', $attributes->whereStartsWith('wire:click')->first())[0] }}"
wire:loading.delay.class='loading' wire:loading.delay.attr="disabled" @endif
@if ($disabled !== null) disabled title="{{ $disabled }}" @endif
@isset($confirm)
@if ($type === 'submit')
<button type="submit" @if ($disabled !== null) disabled @endif wire:target="submit"
wire:loading.delay.shorter.class="loading"
@isset($confirm)
x-on:click="toggleConfirmModal('{{ $confirm }}', '{{ explode('(', $confirmAction)[0] }}')"
@endisset
@isset($confirmAction)
@isset($confirmAction)
x-on:{{ explode('(', $confirmAction)[0] }}.window="$wire.{{ explode('(', $confirmAction)[0] }}"
@endisset>
{{ $slot }}
</button>
{{ $slot }}
</button>
@elseif($type === 'button')
<button {{ $attributes }} @if ($disabled !== null) disabled @endif type="button"
wire:target="{{ explode('(', $attributes->whereStartsWith('wire:click')->first())[0] }}"
wire:loading.delay.shorter.class="loading"
@isset($confirm)
x-on:click="toggleConfirmModal('{{ $confirm }}', '{{ explode('(', $confirmAction)[0] }}')"
@endisset
@isset($confirmAction)
x-on:{{ explode('(', $confirmAction)[0] }}.window="$wire.{{ explode('(', $confirmAction)[0] }}"
@endisset>
{{ $slot }}
</button>
@endif

View File

@@ -8,17 +8,16 @@
'noDirty' => $attributes->has('noDirty'),
'disabled' => null,
])
<label {{ $attributes->merge(['class' => 'flex items-center gap-16 cursor-pointer']) }}>
<span class="label-text">
<label {{ $attributes->merge(['class' => 'flex cursor-pointer w-64 label']) }}>
<div class="label-text">
@if ($label)
{{ $label }}
@else
{{ $id }}
@endif
</span>
<input type="checkbox" @if ($disabled !== null) disabled @endif class="toggle" name={{ $id }}
</div>
<div class="flex-1"></div>
<input type="checkbox" @if ($disabled !== null) disabled @endif name={{ $id }}
@if (!$noDirty) wire:dirty.class="input-warning" @endif
@if ($instantSave) wire:click='instantSave' wire:model.defer={{ $id }} @else wire:model.defer={{ $value ?? $id }} @endif />
</label>
</div>

View File

@@ -1,14 +1,15 @@
@props([
'id' => $attributes->has('id') || $attributes->has('label'),
'required' => $attributes->has('required'),
'type' => $attributes->get('type') ?? 'text',
'required' => null,
'label' => $attributes->has('label'),
'helper' => $attributes->has('helper'),
'instantSave' => $attributes->has('instantSave'),
'noLabel' => $attributes->has('noLabel'),
'noDirty' => $attributes->has('noDirty'),
'disabled' => null,
])
<div class="w-full max-w-xs form-control">
<div {{ $attributes->merge(['class' => 'w-full form-control']) }}>
@if (!$noLabel)
<label class="label">
<span class="label-text">
@@ -40,8 +41,8 @@
</span>
</label>
@endif
<input {{ $attributes }} name={{ $id }}
@if ($instantSave) wire:click='instantSave' wire:model.defer={{ $id }} @else wire:model.defer={{ $value ?? $id }} @endif
<input {{ $attributes }} type={{ $type }} name={{ $id }} wire:model.defer={{ $id }}
@if ($disabled !== null) disabled @endif @if ($required !== null) required @endif
@if (!$noDirty) wire:dirty.class="input-warning" @endif />
@error($id)
<label class="label">

View File

@@ -4,7 +4,7 @@
'required' => false,
])
<span @class(['flex flex-col'])>
<span {{ $attributes->merge(['class' => 'flex flex-col']) }}>
<label for={{ $id }}>
@if ($label)
{{ $label }}

View File

@@ -8,7 +8,7 @@
'noDirty' => $attributes->has('noDirty'),
])
<div class="w-full max-w-xs form-control">
<div class=" form-control">
@if (!$noLabel)
<label class="label">
<span class="label-text">
@@ -40,8 +40,7 @@
</span>
</label>
@endif
<textarea {{ $attributes }} name={{ $id }}
@if ($instantSave) wire:click='instantSave' wire:model.defer={{ $id }} @else wire:model.defer={{ $value ?? $id }} @endif
<textarea {{ $attributes }} name={{ $id }} wire:model.defer={{ $value ?? $id }}
@if (!$noDirty) wire:dirty.class="input-warning" @endif></textarea>
@error($id)
<label class="label">