ldc-agis/resources/views/bo/partials/inputs/varchar-password.blade.php
2023-12-21 13:56:34 +01:00

49 lines
2.2 KiB
PHP

{{-- blade-formatter-disable --}}
{{--
VARIABLE || COMMENT || TYPE || REQUIRED || DEFAULT
$id || The id of the input tag. || string || REQUIRED ||
$name || The name of the input tag. || string || REQUIRED ||
$helper || The helper of the input. || string || REQUIRED ||
$label || The text displayed as a label. || string || OPTIONNAL || null
$required || Is the field required ? || boolean || OPTIONNAL || false
$placeholder || The placeholder of the input. || string || OPTIONNAL || __('Un beau mot de passe')
$hasWordCounter || Is the WordCounter needed ? || boolean || OPTIONNAL || false
$model || The model we're creating/editing || Model class || OPTIONNAL || null
--}}
@if(!empty($label))
<label for="{{ $id }}" class="col-form-label">
<b>{{ $label }} {{ $required ?? false ? '*' : '' }}</b>
</label>
@endif
@if(!empty($hasWordCounter ?? false))
<div class="word-counter" data-json='@json(['id'=> "$id"])'></div>
@endif
<div class="col-12 input-group d-flex w-100 justify-content-center">
<input id="{{ $id }}"
name="{{ $name }}"
type="password"
value="{{ old($name, $model->{$name} ?? '') }}"
@class([
'form-control',
'is-invalid' => $errors->has($name),
'need-word-counter-password' => !empty($hasWordCounter ?? false)
])
id="{{ $id }}"
aria-describedby="{{ $id }}Help"
placeholder="{{ $placeholder ?? __('Un beau mot de passe') }}"
autocomplete="current-password"
@disabled(!empty($disabled))
@readonly(!empty($readonly))
@required(!empty($required))>
@php $dataPassword = ['inputId' => $id]; @endphp
<span class="btn btn-primary password-visibility w-fit d-flex justify-content-center align-items-center p-0 @if(!empty($hasWordCounter ?? false)) need-word-counter-password-btn @endif"
data-json='@json($dataPassword)'>
</span>
</div>
@include('modules.input-error', [
'inputName' => $name,
'helperId' => "{$id}Help",
'helper' => $helper
])