39 lines
2.1 KiB
PHP
39 lines
2.1 KiB
PHP
{{--
|
|
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 class="col-form-label" for="{{ $id }}">
|
|
<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
|
|
class="form-control @if ($errors->has($name)) is-invalid @endif @if (!empty($hasWordCounter ?? false)) need-word-counter-password @endif"
|
|
id="{{ $id }}" id="{{ $id }}" name="{{ $name }}" type="password"
|
|
value="{{ old($name, $model->{$name} ?? '') }}" aria-describedby="{{ $id }}Help"
|
|
placeholder="{{ $placeholder ?? __('Un beau mot de passe') }}" autocomplete="current-password"
|
|
@if (!empty($required)) required @endif>
|
|
@php $dataPassword = ['inputId' => $id]; @endphp
|
|
<span
|
|
class="btn btn-primary password-visibility d-flex justify-content-center align-items-center @if (!empty($hasWordCounter ?? false)) need-word-counter-password-btn @endif w-fit p-0"
|
|
data-json='@json($dataPassword)'>
|
|
</span>
|
|
</div>
|
|
@include('modules.input-error', [
|
|
'inputName' => $name,
|
|
'helperId' => $id . 'Help',
|
|
'helper' => $helper,
|
|
])
|