-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Form row component experiment #17921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 24 commits
8ce3001
9023eda
514711d
7c0c3b2
e138c93
5c716c3
671e79f
a59914e
253026d
c4923fa
d2e3a13
c3efdd0
433a3e1
2554b50
33e7425
a3bad98
b766f6e
3863e82
682c1a8
f8362f4
02a4268
1c09657
cde2297
150c205
3b4c51b
f056147
235dcbc
5782484
eea1922
dc6ee34
08630d9
750c376
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <!-- form-label blade component --> | ||
| @props([ | ||
| 'label', | ||
| ]) | ||
|
|
||
| <label {{ $attributes->merge(['class' => 'control-label']) }}> | ||
| {{ $label }} | ||
|
||
| </label> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| <!-- form-row blade component --> | ||
| @props([ | ||
| 'errors', | ||
| 'label' => null, | ||
| 'name' => null, | ||
| 'help_text' => null, | ||
| 'label_style' => null, | ||
| 'label_class' => 'col-md-3 col-sm-12 col-xs-12', | ||
| 'input_div_class' => 'col-md-8 col-sm-12', | ||
| 'type' => 'checkbox', | ||
| 'item' => null, | ||
| 'disabled' => false, | ||
| 'error_offset_class' => 'col-md-7 col-md-offset-3', | ||
| 'info_tooltip_text' => null, | ||
| 'value_text' => null, | ||
| 'checkbox_value' => null, | ||
| ]) | ||
|
|
||
| <div {{ $attributes->merge(['class' => 'form-group']) }}> | ||
|
|
||
| <x-form-label | ||
| :label="$label ?? null" | ||
| :style="$label_style ?? null" | ||
| class="{{ $label_class }}" | ||
| /> | ||
|
|
||
| <div {{ $attributes->merge(['class' => $input_div_class]) }}> | ||
|
|
||
| <label class="form-control{{ $disabled ? ' form-control--disabled' : '' }}"> | ||
| <input type="checkbox" name="{{ $name }}" aria-label="{{ $name }}" value="{{ $checkbox_value }}" @checked(old($name, $item->$name)) {!! $disabled ? 'class="disabled" disabled' : '' !!}> | ||
| {{ $value_text ?? $label }} | ||
| </label> | ||
|
|
||
| </div> | ||
|
|
||
|
|
||
|
|
||
|
|
||
| @if ($info_tooltip_text) | ||
| <!-- Info Tooltip --> | ||
| <div class="col-md-1 text-left" style="padding-left:0; margin-top: 5px;"> | ||
| <x-input.info-tooltip> | ||
| {{ $info_tooltip_text }} | ||
| </x-input.info-tooltip> | ||
| </div> | ||
| @endif | ||
|
|
||
|
|
||
| @error($name) | ||
| <!-- Form Error --> | ||
| <div {{ $attributes->merge(['class' => $error_offset_class]) }}> | ||
| <span class="alert-msg" role="alert"> | ||
| <i class="fas fa-times" aria-hidden="true"></i> | ||
| {{ $message }} | ||
| </span> | ||
| </div> | ||
| @enderror | ||
|
|
||
| @if ($help_text) | ||
| <!-- Help Text --> | ||
| <div {{ $attributes->merge(['class' => $error_offset_class]) }}> | ||
| <p class="help-block"> | ||
| {!! $help_text !!} | ||
| </p> | ||
| </div> | ||
| @endif | ||
|
|
||
| </div> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| <!-- form-row blade component --> | ||
| @props([ | ||
| 'errors', | ||
| 'label', | ||
| 'name' => null, | ||
| 'help_text' => null, | ||
| 'label_style' => null, | ||
| 'label_class' => 'col-md-3 col-sm-12 col-xs-12', | ||
| 'div_style' => null, | ||
| 'input_div_class' => 'col-md-8 col-sm-12', | ||
| 'input_style' => null, | ||
| 'item' => null, | ||
| 'type' => 'text', | ||
| 'placeholder' => null, | ||
| 'maxlength' => 191, | ||
| 'minlength' => null, | ||
| 'min' => null, | ||
| 'max' => null, | ||
| 'step' => null, | ||
| 'disabled' => false, | ||
| 'error_offset_class' => 'col-md-7 col-md-offset-3', | ||
| 'info_tooltip_text' => null, | ||
| ]) | ||
|
|
||
| <div {{ $attributes->merge(['class' => 'form-group']) }}> | ||
|
|
||
| <x-form-label | ||
| :$label | ||
| :for="$name" | ||
| :style="$label_style ?? null" | ||
| class="{{ $label_class }}" | ||
| /> | ||
|
|
||
| <div {{ $attributes->merge(['class' => $input_div_class]) }} {{ ($div_style) ? $attributes->merge(['style' => $div_style]):'' }}> | ||
snipe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| @php | ||
| $blade_type = in_array($type, ['text', 'email', 'url', 'tel', 'number', 'password']) ? 'text' : $type; | ||
| @endphp | ||
|
|
||
| <x-dynamic-component | ||
| :component="'input.'.$blade_type" | ||
| :aria-label="$name" | ||
| :$name | ||
| :$placeholder | ||
| :$input_style | ||
| :$item | ||
| :id="$name" | ||
| :required="Helper::checkIfRequired($item, $name)" | ||
| :value="old($name, $item->{$name})" | ||
| :$type | ||
| :$maxlength | ||
| :$minlength | ||
| :$disabled | ||
| :$min | ||
| :$max | ||
| :$step | ||
| /> | ||
| </div> | ||
|
|
||
|
|
||
| @if ($info_tooltip_text) | ||
| <!-- Info Tooltip --> | ||
| <div class="col-md-1 text-left" style="padding-left:0; margin-top: 5px;"> | ||
| <x-input.info-tooltip> | ||
| {{ $info_tooltip_text }} | ||
| </x-input.info-tooltip> | ||
| </div> | ||
| @endif | ||
|
|
||
|
|
||
| @error($name) | ||
| <!-- Form Error --> | ||
| <div {{ $attributes->merge(['class' => $error_offset_class]) }}> | ||
| <span class="alert-msg" role="alert"> | ||
| <i class="fas fa-times" aria-hidden="true"></i> | ||
| {{ $message }} | ||
| </span> | ||
| </div> | ||
| @enderror | ||
|
|
||
| @if ($help_text) | ||
| <!-- Help Text --> | ||
| <div {{ $attributes->merge(['class' => $error_offset_class]) }}> | ||
| <p class="help-block"> | ||
| {!! $help_text !!} | ||
| </p> | ||
| </div> | ||
| @endif | ||
|
|
||
| </div> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| @props([ | ||
| 'item' => null, | ||
| 'input_style' => null, | ||
| 'end_date' => null, | ||
| ]) | ||
|
|
||
| <!-- Datepicker --> | ||
| <div {{ $attributes->merge(['class' => 'input-group date']) }} data-provide="datepicker" data-date-today-highlight="true" data-date-language="{{ auth()->user()->locale }}" data-date-locale="{{ auth()->user()->locale }}" data-date-format="yyyy-mm-dd" data-date-autoclose="true" data-date-clear-btn="true"{{ $end_date ? ' data-date-end-date=' . $end_date : '' }}> | ||
| <input type="text" {{ $attributes->merge(['class' => 'form-control']) }}> | ||
|
Comment on lines
+8
to
+9
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having a I noticed the same on |
||
| <span class="input-group-addon"><x-icon type="calendar" /></span> | ||
|
|
||
| </div> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <a href="#" data-tooltip="true" title="{{ $slot }}" style="padding-left: 0px;"> | ||
| <x-icon type="more-info" style="font-size: 20px;" /> | ||
| <span class="sr-only">{{ $slot }}</span> | ||
| </a> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| @props([ | ||
| 'item' => null, | ||
| 'field_name' => null, | ||
| 'input_style' => null, | ||
| 'required' => false, | ||
| ]) | ||
| <!-- input-text blade component --> | ||
| <input {{ $attributes->merge(['class' => 'form-control']) }} {{ ($input_style) ? $attributes->merge(['style' => $input_style]): '' }} {{ ($required ?? false) ? 'required' : '' }} /> | ||
snipe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Uh oh!
There was an error while loading. Please reload this page.