feat: ✨ Added Input components
This commit is contained in:
parent
25b2d06572
commit
b2d73eeda0
5 changed files with 171 additions and 0 deletions
31
themes/default/views/components/input/checkbox.blade.php
Normal file
31
themes/default/views/components/input/checkbox.blade.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
/**
|
||||
* @required string $name
|
||||
* @required string $label
|
||||
*
|
||||
* @optional string $value
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div {{ $attributes->merge(['class' => 'form-check form-switch']) }}>
|
||||
<input class="form-check-input" name="{{$name}}" value="1"
|
||||
@if(old($name, $value ?? null) == 1) checked @endif
|
||||
type="checkbox"
|
||||
id="{{$name}}">
|
||||
<label class="form-check-label" for="{{$name}}">{{$label}}</label>
|
||||
</div>
|
||||
|
||||
@if(isset($tooltip) && !empty($tooltip))
|
||||
<span><i data-bs-toggle="tooltip" data-bs-placement="top" title="{{$tooltip}}"
|
||||
class="fas fa-info-circle"></i></span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@error($name)
|
||||
<div class="invalid-feedback">{{$message}}</div>
|
||||
@enderror
|
||||
|
||||
|
45
themes/default/views/components/input/number.blade.php
Normal file
45
themes/default/views/components/input/number.blade.php
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
/**
|
||||
* @required string $name
|
||||
* @required string $label
|
||||
* @required string $min
|
||||
* @required string $max
|
||||
*
|
||||
* @optional string $tooltip
|
||||
* @optional string $step
|
||||
* @optional string $prepend
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<div class="d-flex justify-content-between">
|
||||
<label for="{{$name}}">{{$label}}</label>
|
||||
@if(isset($tooltip) && !empty($tooltip))
|
||||
<span><i data-bs-toggle="tooltip" data-bs-placement="top" title="{{$tooltip}}"
|
||||
class="fas fa-info-circle"></i></span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if(isset($prepend))
|
||||
<div class="input-group">
|
||||
@endif
|
||||
<input value="{{old($name, $value)}}" id="{{$name}}"
|
||||
name="{{$name}}"
|
||||
type="number"
|
||||
min="{{$min}}"
|
||||
max="{{$max}}"
|
||||
@if(isset($step) && !empty($step))
|
||||
step="{{$step}}"
|
||||
@endif
|
||||
class="form-control @error($name)is-invalid @enderror">
|
||||
@if(isset($prepend))
|
||||
<span class="input-group-text">{{$prepend}}</span>
|
||||
@endif
|
||||
@if(isset($prepend))
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@error($name)
|
||||
<div class="invalid-feedback">{{$message}}</div>
|
||||
@enderror
|
||||
</div>
|
32
themes/default/views/components/input/select.blade.php
Normal file
32
themes/default/views/components/input/select.blade.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* @required string $name
|
||||
* @required string $label
|
||||
*
|
||||
* @optional bool $multiple
|
||||
* @optional string $style
|
||||
* @optional string $tooltip
|
||||
*/
|
||||
?>
|
||||
<div class="form-group mb-3">
|
||||
<div class="d-flex justify-content-between">
|
||||
<label for="{{$name}}">{{$label}}</label>
|
||||
@if(isset($tooltip) && !empty($tooltip))
|
||||
<span><i data-bs-toggle="tooltip" data-bs-placement="top" title="{{$tooltip}}" class="fas fa-info-circle"></i></span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<select
|
||||
class="form-control @if(isset($multiple) && $multiple) form-select-lg @endif @error($name) is-invalid @enderror"
|
||||
@if(isset($multiple) && $multiple)multiple @endif
|
||||
@if(isset($style) && !empty($style))style="{{$style}}" @endif
|
||||
name="{{$name}}@if(isset($multiple) && $multiple)[]@endif"
|
||||
id="{{$name}}">
|
||||
|
||||
{{$slot}}
|
||||
</select>
|
||||
|
||||
@error($name)
|
||||
<div class="invalid-feedback">{{$message}}</div>
|
||||
@enderror
|
||||
</div>
|
37
themes/default/views/components/input/text.blade.php
Normal file
37
themes/default/views/components/input/text.blade.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* @required string $name
|
||||
* @required string $label
|
||||
*
|
||||
* @optional string $type
|
||||
* @optional string $value
|
||||
* @optional string $tooltip
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<div class="d-flex justify-content-between">
|
||||
<label for="{{$name}}">{{$label}}</label>
|
||||
@if(isset($tooltip) && !empty($tooltip))
|
||||
<span><i data-bs-toggle="tooltip" data-bs-placement="top" title="{{$tooltip}}"
|
||||
class="fas fa-info-circle"></i></span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if(isset($prepend))
|
||||
<div class="input-group">
|
||||
@endif
|
||||
<input value="{{old($name, $value ?? null)}}" id="{{$name}}"
|
||||
name="{{$name}}"
|
||||
type="{{$type ?? 'text'}}" class="form-control @error($name)is-invalid @enderror"/>
|
||||
@if(isset($prepend))
|
||||
<span class="input-group-text">{{$prepend}}</span>
|
||||
@endif
|
||||
@if(isset($prepend))
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@error($name)
|
||||
<div class="invalid-feedback">{{$message}}</div>
|
||||
@enderror
|
||||
</div>
|
26
themes/default/views/components/input/textarea.blade.php
Normal file
26
themes/default/views/components/input/textarea.blade.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
/**
|
||||
* @required string $name
|
||||
* @required string $label
|
||||
*
|
||||
* @optional string $value
|
||||
* @optional string $rows
|
||||
* @optional string $tooltip
|
||||
* @optional bool $ckeditor
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<div class="d-flex justify-content-between">
|
||||
<label for="{{$name}}">{{$label}}</label>
|
||||
@if(isset($tooltip) && !empty($tooltip))
|
||||
<span><i data-bs-toggle="tooltip" data-bs-placement="top" title="{{$tooltip}}" class="fas fa-info-circle"></i></span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<textarea rows="{{$rows ?? 2}}" id="{{$name}}" name="{{$name}}" class="form-control @isset($ckeditor) ckeditor @endif @error($name)is-invalid @enderror">{{old($name, $value ?? null)}}</textarea>
|
||||
|
||||
@error($name)
|
||||
<div class="invalid-feedback">{{$message}}</div>
|
||||
@enderror
|
||||
</div>
|
Loading…
Reference in a new issue