Skip to content

Commit

Permalink
chore: fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangums authored and github-actions[bot] committed Jun 26, 2024
1 parent d1b8eae commit ceddbc0
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 88 deletions.
168 changes: 83 additions & 85 deletions packages/widgets/resources/views/chart-widget.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,96 +36,94 @@ class="w-max sm:-my-2"
wire:poll.{{ $pollingInterval }}="updateChartData"
@endif
>

@if ($empty)
@if ($emptyState = $this->getEmptyState())
{{ $emptyState }}
@else
<div>
<x-filament-widgets::empty-state
:actions="$this->getEmptyStateActions()"
:description="$this->getEmptyStateDescription()"
:heading="$this->getEmptyStateHeading()"
:icon="$this->getEmptyStateIcon()"
/>
</div>
@endif
@else
<div
@if (FilamentView::hasSpaMode())
ax-load="visible"
@else
ax-load
@endif
ax-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('chart', 'filament/widgets') }}"
wire:ignore
x-data="chart({
cachedData: @js($this->getCachedData()),
options: @js($this->getOptions()),
type: @js($this->getType()),
})"
x-ignore
@class([
match ($color) {
'gray' => null,
default => 'fi-color-custom',
},
is_string($color) ? "fi-color-{$color}" : null,
])
>
<canvas
x-ref="canvas"
@if ($maxHeight = $this->getMaxHeight())
style="max-height: {{ $maxHeight }}"
@if ($empty)
@if ($emptyState = $this->getEmptyState())
{{ $emptyState }}
@else
<div>
<x-filament-widgets::empty-state
:actions="$this->getEmptyStateActions()"
:description="$this->getEmptyStateDescription()"
:heading="$this->getEmptyStateHeading()"
:icon="$this->getEmptyStateIcon()"
/>
</div>
@endif
></canvas>
@else
<div
@if (FilamentView::hasSpaMode())
ax-load="visible"
@else
ax-load
@endif
ax-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('chart', 'filament/widgets') }}"
wire:ignore
x-data="chart({
cachedData: @js($this->getCachedData()),
options: @js($this->getOptions()),
type: @js($this->getType()),
})"
x-ignore
@class([
match ($color) {
'gray' => null,
default => 'fi-color-custom',
},
is_string($color) ? "fi-color-{$color}" : null,
])
>
<canvas
x-ref="canvas"
@if ($maxHeight = $this->getMaxHeight())
style="max-height: {{ $maxHeight }}"
@endif
></canvas>

<span
x-ref="backgroundColorElement"
@class([
match ($color) {
'gray' => 'text-gray-100 dark:text-gray-800',
default => 'text-custom-50 dark:text-custom-400/10',
},
])
@style([
\Filament\Support\get_color_css_variables(
$color,
shades: [50, 400],
alias: 'widgets::chart-widget.background',
) => $color !== 'gray',
])
></span>
<span
x-ref="backgroundColorElement"
@class([
match ($color) {
'gray' => 'text-gray-100 dark:text-gray-800',
default => 'text-custom-50 dark:text-custom-400/10',
},
])
@style([
\Filament\Support\get_color_css_variables(
$color,
shades: [50, 400],
alias: 'widgets::chart-widget.background',
) => $color !== 'gray',
])
></span>

<span
x-ref="borderColorElement"
@class([
match ($color) {
'gray' => 'text-gray-400',
default => 'text-custom-500 dark:text-custom-400',
},
])
@style([
\Filament\Support\get_color_css_variables(
$color,
shades: [400, 500],
alias: 'widgets::chart-widget.border',
) => $color !== 'gray',
])
></span>
<span
x-ref="borderColorElement"
@class([
match ($color) {
'gray' => 'text-gray-400',
default => 'text-custom-500 dark:text-custom-400',
},
])
@style([
\Filament\Support\get_color_css_variables(
$color,
shades: [400, 500],
alias: 'widgets::chart-widget.border',
) => $color !== 'gray',
])
></span>

<span
x-ref="gridColorElement"
class="text-gray-200 dark:text-gray-800"
></span>

<span
x-ref="textColorElement"
class="text-gray-500 dark:text-gray-400"
></span>
</div>
@endif
<span
x-ref="gridColorElement"
class="text-gray-200 dark:text-gray-800"
></span>

<span
x-ref="textColorElement"
class="text-gray-500 dark:text-gray-400"
></span>
</div>
@endif
</div>
</x-filament::section>
</x-filament-widgets::widget>
6 changes: 3 additions & 3 deletions packages/widgets/src/Concerns/HasEmptyState.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Filament\Widgets\Concerns;

use Filament\Support\Concerns\EvaluatesClosures;
use Filament\Support\Facades\FilamentIcon;
use Closure;
use Filament\Actions\Action;
use Filament\Actions\ActionGroup;
use Filament\Support\Concerns\EvaluatesClosures;
use Filament\Support\Facades\FilamentIcon;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Contracts\View\View;
use Closure;

trait HasEmptyState
{
Expand Down

0 comments on commit ceddbc0

Please sign in to comment.