phases one of time logged now with log display
This commit is contained in:
@@ -28,7 +28,8 @@
|
||||
|
||||
if ($field) {
|
||||
$hasInlineLabel ??= $field->hasInlineLabel();
|
||||
$hasNestedRecursiveValidationRules ??= $field instanceof \Filament\Forms\Components\Contracts\HasNestedRecursiveValidationRules;
|
||||
$hasNestedRecursiveValidationRules ??=
|
||||
$field instanceof \Filament\Forms\Components\Contracts\HasNestedRecursiveValidationRules;
|
||||
$id ??= $field->getId();
|
||||
$isDisabled ??= $field->isDisabled();
|
||||
$label ??= $field->getLabel();
|
||||
@@ -50,83 +51,88 @@
|
||||
$aboveErrorMessageSchema = $field?->getChildSchema($field::ABOVE_ERROR_MESSAGE_SCHEMA_KEY)?->toHtmlString();
|
||||
$belowErrorMessageSchema = $field?->getChildSchema($field::BELOW_ERROR_MESSAGE_SCHEMA_KEY)?->toHtmlString();
|
||||
|
||||
$hasError = $hasErrors && (filled($errorMessage) || filled($errorMessages) || (filled($statePath) && ($errors->has($statePath) || ($hasNestedRecursiveValidationRules && $errors->has("{$statePath}.*")))));
|
||||
$hasError =
|
||||
$hasErrors &&
|
||||
(filled($errorMessage) ||
|
||||
filled($errorMessages) ||
|
||||
(filled($statePath) &&
|
||||
($errors->has($statePath) || ($hasNestedRecursiveValidationRules && $errors->has("{$statePath}.*")))));
|
||||
|
||||
if ($hasError && filled($statePath) && blank($errorMessage) && blank($errorMessages)) {
|
||||
if ($shouldShowAllValidationMessages) {
|
||||
$errorMessages = $errors->has($statePath) ? $errors->get($statePath) : ($hasNestedRecursiveValidationRules ? $errors->get("{$statePath}.*") : []);
|
||||
$errorMessages = $errors->has($statePath)
|
||||
? $errors->get($statePath)
|
||||
: ($hasNestedRecursiveValidationRules
|
||||
? $errors->get("{$statePath}.*")
|
||||
: []);
|
||||
|
||||
if (count($errorMessages) === 1) {
|
||||
$errorMessage = Arr::first($errorMessages);
|
||||
$errorMessages = [];
|
||||
}
|
||||
} else {
|
||||
$errorMessage = $errors->has($statePath) ? $errors->first($statePath) : ($hasNestedRecursiveValidationRules ? $errors->first("{$statePath}.*") : null);
|
||||
$errorMessage = $errors->has($statePath)
|
||||
? $errors->first($statePath)
|
||||
: ($hasNestedRecursiveValidationRules
|
||||
? $errors->first("{$statePath}.*")
|
||||
: null);
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div
|
||||
data-field-wrapper
|
||||
{{
|
||||
$attributes
|
||||
->merge($field?->getExtraFieldWrapperAttributes() ?? [], escape: false)
|
||||
->class([
|
||||
'fi-fo-field',
|
||||
'fi-fo-field-has-inline-label' => $hasInlineLabel,
|
||||
])
|
||||
}}
|
||||
>
|
||||
<div data-field-wrapper
|
||||
{{ $attributes->merge($field?->getExtraFieldWrapperAttributes() ?? [], escape: false)->class(['fi-fo-field', 'fi-fo-field-has-inline-label' => $hasInlineLabel]) }}>
|
||||
@if (filled($label) && $labelSrOnly)
|
||||
<{{ $labelTag }}
|
||||
@if ($labelTag === 'label')
|
||||
for="{{ $id }}"
|
||||
@if ($labelTag === 'label') for="{{ $id }}"
|
||||
@else
|
||||
id="{{ $id }}-label"
|
||||
@endif
|
||||
class="fi-fo-field-label fi-sr-only"
|
||||
>
|
||||
id="{{ $id }}-label" @endif
|
||||
class="fi-fo-field-label fi-sr-only">
|
||||
{{ $label }}
|
||||
</{{ $labelTag }}>
|
||||
</{{ $labelTag }}>
|
||||
@endif
|
||||
|
||||
@if ((filled($label) && (! $labelSrOnly)) || $hasInlineLabel || $aboveLabelSchema || $belowLabelSchema || $beforeLabelSchema || $afterLabelSchema || $labelPrefix || $labelSuffix)
|
||||
<div
|
||||
@class([
|
||||
'fi-fo-field-label-col',
|
||||
"fi-vertical-align-{$inlineLabelVerticalAlignment->value}" => $hasInlineLabel,
|
||||
])
|
||||
>
|
||||
@if (
|
||||
(filled($label) && !$labelSrOnly) ||
|
||||
$hasInlineLabel ||
|
||||
$aboveLabelSchema ||
|
||||
$belowLabelSchema ||
|
||||
$beforeLabelSchema ||
|
||||
$afterLabelSchema ||
|
||||
$labelPrefix ||
|
||||
$labelSuffix)
|
||||
<div @class([
|
||||
'fi-fo-field-label-col',
|
||||
"fi-vertical-align-{$inlineLabelVerticalAlignment->value}" => $hasInlineLabel,
|
||||
])>
|
||||
{{ $aboveLabelSchema }}
|
||||
|
||||
<div
|
||||
@class([
|
||||
'fi-fo-field-label-ctn',
|
||||
($label instanceof \Illuminate\View\ComponentSlot) ? $label->attributes->get('class') : null,
|
||||
])
|
||||
>
|
||||
<div @class([
|
||||
'fi-fo-field-label-ctn',
|
||||
$label instanceof \Illuminate\View\ComponentSlot
|
||||
? $label->attributes->get('class')
|
||||
: null,
|
||||
])>
|
||||
{{ $beforeLabelSchema }}
|
||||
|
||||
@if ((filled($label) && (! $labelSrOnly)) || $labelPrefix || $labelSuffix)
|
||||
@if ((filled($label) && !$labelSrOnly) || $labelPrefix || $labelSuffix)
|
||||
<{{ $labelTag }}
|
||||
@if ($labelTag === 'label')
|
||||
for="{{ $id }}"
|
||||
@if ($labelTag === 'label') for="{{ $id }}"
|
||||
@else
|
||||
id="{{ $id }}-label"
|
||||
@endif
|
||||
class="fi-fo-field-label"
|
||||
>
|
||||
id="{{ $id }}-label" @endif
|
||||
class="fi-fo-field-label">
|
||||
{{ $labelPrefix }}
|
||||
|
||||
@if (filled($label) && (! $labelSrOnly))
|
||||
@if (filled($label) && !$labelSrOnly)
|
||||
<span class="fi-fo-field-label-content">
|
||||
{{ $label }}@if ($required && (! $isDisabled))<sup class="fi-fo-field-label-required-mark">*</sup>
|
||||
{{ $label }}@if ($required && !$isDisabled)
|
||||
<sup class="fi-fo-field-label-required-mark">*</sup>
|
||||
@endif
|
||||
</span>
|
||||
@endif
|
||||
|
||||
{{ $labelSuffix }}
|
||||
</{{ $labelTag }}>
|
||||
</{{ $labelTag }}>
|
||||
@endif
|
||||
|
||||
{{ $afterLabelSchema }}
|
||||
@@ -136,7 +142,15 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ((! \Filament\Support\is_slot_empty($slot)) || $hasError || $aboveContentSchema || $belowContentSchema || $beforeContentSchema || $afterContentSchema || $aboveErrorMessageSchema || $belowErrorMessageSchema)
|
||||
@if (
|
||||
!\Filament\Support\is_slot_empty($slot) ||
|
||||
$hasError ||
|
||||
$aboveContentSchema ||
|
||||
$belowContentSchema ||
|
||||
$beforeContentSchema ||
|
||||
$afterContentSchema ||
|
||||
$aboveErrorMessageSchema ||
|
||||
$belowErrorMessageSchema)
|
||||
<div class="fi-fo-field-content-col">
|
||||
{{ $aboveContentSchema }}
|
||||
|
||||
@@ -160,10 +174,7 @@
|
||||
{{ $aboveErrorMessageSchema }}
|
||||
|
||||
@if (filled($errorMessages))
|
||||
<ul
|
||||
data-validation-error
|
||||
class="fi-fo-field-wrp-error-list"
|
||||
>
|
||||
<ul data-validation-error class="fi-fo-field-wrp-error-list">
|
||||
@foreach ($errorMessages as $errorMessage)
|
||||
<li class="fi-fo-field-wrp-error-message">
|
||||
@if ($areHtmlErrorMessagesAllowed)
|
||||
@@ -175,17 +186,11 @@
|
||||
@endforeach
|
||||
</ul>
|
||||
@elseif ($areHtmlErrorMessagesAllowed)
|
||||
<div
|
||||
data-validation-error
|
||||
class="fi-fo-field-wrp-error-message"
|
||||
>
|
||||
<div data-validation-error class="fi-fo-field-wrp-error-message">
|
||||
{!! $errorMessage !!}
|
||||
</div>
|
||||
@else
|
||||
<p
|
||||
data-validation-error
|
||||
class="fi-fo-field-wrp-error-message"
|
||||
>
|
||||
<p data-validation-error class="fi-fo-field-wrp-error-message">
|
||||
{{ $errorMessage }}
|
||||
</p>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user