lasthourcloud/resources/views/components/forms/input.blade.php

58 lines
2.6 KiB
PHP
Raw Normal View History

2023-06-16 08:32:29 +00:00
<div class="w-full">
2023-05-25 12:05:44 +00:00
@if ($label)
2023-05-17 13:46:20 +00:00
<label class="label">
2023-06-07 19:44:16 +00:00
<span class="flex gap-1 label-text">
2023-05-25 12:05:44 +00:00
{{ $label }}
2023-05-17 13:46:20 +00:00
@if ($required)
<span class="text-warning">*</span>
@endif
@if ($helper)
2023-06-16 08:32:29 +00:00
<x-helper :helper="$helper" />
2023-05-17 13:46:20 +00:00
@endif
</span>
2023-05-05 07:28:00 +00:00
</label>
@endif
2023-06-16 08:32:29 +00:00
<div class="w-full">
@if ($type === 'password')
2023-06-16 10:00:36 +00:00
<div class="w-full rounded join" x-data>
2023-06-16 11:42:02 +00:00
<input {{ $attributes }} class="join-item" wire:model.defer={{ $id }}
wire:dirty.class="input-warning" @readonly($readonly) @disabled($disabled)
type={{ $type }} id={{ $id }} name={{ $name }}
@isset($value) value={{ $value }} @endisset
2023-06-16 10:00:36 +00:00
@isset($placeholder) placeholder={{ $placeholder }} @endisset>
@if (!$cannotPeakPassword)
<span x-on:click="changePasswordFieldType" x-cloak @class([
'border-l-0 border-none rounded-r no-animation h-7 btn join-item btn-xs',
'bg-coolgray-200/50 hover:bg-coolgray-200/50 text-opacity-25' =>
$disabled || $readonly,
'bg-coolgray-200 hover:bg-coolgray-200' => !$disabled || !$readonly,
])><svg
xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 icon" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
2023-06-15 07:58:17 +00:00
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path
d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6" />
</svg>
</span>
@endif
2023-06-16 08:32:29 +00:00
</div>
@else
2023-06-16 11:42:02 +00:00
<input {{ $attributes }} id={{ $id }} name={{ $name }}
wire:model.defer={{ $id }} wire:dirty.class="input-warning" @readonly($readonly)
@disabled($disabled) @isset($value) value={{ $value }} @endisset
2023-06-16 08:32:29 +00:00
@isset($placeholder) placeholder={{ $placeholder }} @endisset>
@endif
@if (!$label && $helper)
<x-helper :helper="$helper" />
@endif
2023-06-16 10:35:40 +00:00
@error($id)
<label class="label">
<span class="text-red-500 label-text-alt">{{ $message }}</span>
</label>
@enderror
2023-06-15 07:58:17 +00:00
</div>
2023-05-17 13:46:20 +00:00
</div>