@props(['label', 'model', 'type' => 'text', 'span' => '3', 'rut' => false, 'errorKey' => null])
<div class="col-md-{{ $span }}"><label class="form-label">{{ $label }} <span class="required">*</span></label><input type="{{ $type }}" class="form-control" @if($rut) placeholder="12.345.678-9" :class="errors[{{ $errorKey }}] && 'is-invalid'" @endif x-model="{{ $model }}" @if($rut) @input="{{ $model }} = formatRut($event.target.value); validateRutField({{ $errorKey }}, {{ $model }})" maxlength="12" inputmode="text" @endif>@if($rut)<div class="field-error" x-text="errors[{{ $errorKey }}]"></div>@endif</div>
