Agregando daisy ui y cambiando componentes por las alternativas de daisy
This commit is contained in:
@@ -1,16 +1,30 @@
|
||||
@use(Illuminate\Support\Number)
|
||||
<div>
|
||||
<form wire:submit.prevent="save" class="grid lg:grid-cols-[repeat(2,minmax(0,2fr))_1fr] gap-2 mb-4 items-end">
|
||||
<x-input label="Total" wire:model="valor" invalidate/>
|
||||
<x-input label="Descripción" wire:model="descripcion" invalidate/>
|
||||
|
||||
<x-button type="submit">
|
||||
<label class="form-control">
|
||||
<div class="label">
|
||||
<span class="label-text">Total</span>
|
||||
</div>
|
||||
<input type="number" class="input input-bordered" wire:model="valor"/>
|
||||
</label>
|
||||
|
||||
<label class="form-control">
|
||||
<div class="label">
|
||||
<span class="label-text">Descripción</span>
|
||||
</div>
|
||||
<input class="input input-bordered" wire:model="descripcion"/>
|
||||
</label>
|
||||
|
||||
<button class="btn" type="submit">
|
||||
@if($this->currentCalculo)
|
||||
<i class="ti ti-device-floppy text-lg"></i>
|
||||
Guardar
|
||||
@else
|
||||
<i class="ti ti-plus text-lg"></i>
|
||||
Agregar
|
||||
@endif
|
||||
</x-button>
|
||||
</button>
|
||||
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('valor'){{$message}}@enderror
|
||||
@@ -20,20 +34,56 @@
|
||||
</p>
|
||||
|
||||
</form>
|
||||
<x-table striped :headers="$this->headers" :rows="$this->rows">
|
||||
@interact('column_valor', $row)
|
||||
{{Number::currency($row->valor)}}
|
||||
@endinteract
|
||||
@interact('column_action', $row)
|
||||
<x-button.circle icon="edit" wire:click="edit('{{$row->id}}')" :key="uniqid()"/>
|
||||
<x-button.circle icon="trash" color="red" wire:click="confirmDelete('{{$row->id}}')" :key="uniqid()"/>
|
||||
@endinteract
|
||||
</x-table>
|
||||
|
||||
<div class="overflox-x-auto">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Total</th>
|
||||
<th>Descripción</th>
|
||||
<th class="text-end">Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($this->rows as $row)
|
||||
<tr>
|
||||
<td>{{Number::currency($row->valor)}}</td>
|
||||
<td>{{$row->descripcion}}</td>
|
||||
<td class="w-0 whitespace-nowrap">
|
||||
<button class="btn btn-circle btn-sm" wire:click="edit('{{$row->id}}')">
|
||||
<i class="ti ti-edit"></i>
|
||||
</button>
|
||||
<button class="btn btn-circle btn-error btn-sm" wire:click="confirmDelete('{{$row->id}}')">
|
||||
<i class="ti ti-trash"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 grid lg:grid-cols-3 gap-4">
|
||||
<x-input label="Fondo" type="number" wire:model.live.debounce="fondo"/>
|
||||
<x-input label="Suma de Dinero" value="{{Number::currency($this->totalCalculo)}}" readonly/>
|
||||
<x-input label="Deposito" value="{{Number::currency($this->totalCalculo - (is_numeric($fondo) ? $fondo : 0))}}"
|
||||
readonly/>
|
||||
<label class="form-control">
|
||||
<div class="label">
|
||||
<span class="label-text">Fondo</span>
|
||||
</div>
|
||||
<input type="number" class="input input-bordered" wire:model.live="fondo"/>
|
||||
</label>
|
||||
|
||||
<label class="form-control">
|
||||
<div class="label">
|
||||
<span class="label-text">Suma de Dinero</span>
|
||||
</div>
|
||||
<input class="input input-bordered bg-neutral-content" value="{{Number::currency($this->totalCalculo)}}"
|
||||
readonly/>
|
||||
</label>
|
||||
<label class="form-control">
|
||||
<div class="label">
|
||||
<span class="label-text">Deposito</span>
|
||||
</div>
|
||||
<input class="input input-bordered bg-neutral-content"
|
||||
value="{{Number::currency($this->totalCalculo - (is_numeric($fondo) ? $fondo : 0))}}" readonly/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user