Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
marco76tv committed Jun 3, 2024
1 parent fb304a8 commit 4ddf33c
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 0 deletions.
59 changes: 59 additions & 0 deletions Filament/Widgets/OverlookWidget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php
/**
* @see https://github.com/awcodes/overlook/blob/2.x/src/Widgets/OverlookWidget.php
*/

namespace Modules\UI\Filament\Widgets;

use Exception;
use NumberFormatter;
use Filament\Widgets\Widget;
use Awcodes\Overlook\OverlookPlugin;
use Modules\Quaeris\Actions\Dashboard\StatsAction;
use Awcodes\Overlook\Contracts\CustomizeOverlookWidget;

class OverlookWidget extends Widget
{
protected static string $view = 'ui::filament.widgets.overlook';

protected int | string | array $columnSpan = 1;

public string $icon='heroicon-o-envelope';
public string $title='';


/*
public array $grid = [
'default' => 6,
'sm' => 6,
'md' => 6,
'lg' => 6,
'xl' => 6,
'2xl' => null,
];
*/

public array $stats=[];

/*
public function mount(array $filter): void
{
$this->filter = $filter;
$this->data = $this->getData();
// dddx($this->data);
if (empty($this->grid)) {
$this->grid = [
'default' => 2,
'sm' => 2,
'md' => 3,
'lg' => 3,
'xl' => 3,
'2xl' => null,
];
}
}
*/


}
27 changes: 27 additions & 0 deletions Filament/Widgets/RowWidget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* @see https://github.com/awcodes/overlook/blob/2.x/src/Widgets/OverlookWidget.php
*/

namespace Modules\Quaeris\Filament\Widgets;

use Exception;
use NumberFormatter;
use Filament\Widgets\Widget;
use Awcodes\Overlook\OverlookPlugin;
use Modules\Quaeris\Actions\Dashboard\StatsAction;
use Awcodes\Overlook\Contracts\CustomizeOverlookWidget;

class RowWidget extends Widget
{
protected static string $view = 'ui::filament.widgets.row';

protected int | string | array $columnSpan = 'full';

public array $grid = [];

public array $widgets = [];



}
14 changes: 14 additions & 0 deletions Resources/svg/telegram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/svg/telegram.svg.webp
Binary file not shown.
33 changes: 33 additions & 0 deletions Resources/views/filament/widgets/overlook.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<x-filament-widgets::widget id="overlook-widget">

<x-filament::section class="relative overflow-hidden overlook-card bg-gradient-to-tr group">


<div class="grid items-center sm:gap-6 sm:grid-cols-2">
<div class="py-4">
<div class="text-center overlook-name ">{{ $title }}</div>
</div>
<div>
@foreach($stats as $stat)
<div class="flex items-center justify-between text-gray-400">
<div class="flex items-center space-x-1">
{{--
<x-heroicon-o-chat-bubble-left class="size-4" />
--}}
<x-filament::icon :icon="$stat['icon']" class="size-4" />
<h4 class="text-gray-700 dark:text-white">{{ $stat['label'] }}</h4>
</div>
<span class="text-sm">{{ $stat['value'] }}</span>
</div>
@endforeach
</div>

</div>

<x-filament::icon :icon="$icon" :size="24"
class="absolute w-auto transition left-2 text-primary-500 h-36 z-1 overlook-icon -bottom-12 opacity-10 dark:opacity-10 group-hover:scale-110 group-hover:-rotate-12 group-hover:opacity-30" />

</x-filament::section>


</x-filament-widgets::widget>
17 changes: 17 additions & 0 deletions Resources/views/filament/widgets/row.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<x-filament-widgets::widget id="overlook-widget" >
<x-filament::grid
:default="$grid['default'] ?? 1"
:sm="$grid['sm'] ?? null"
:md="$grid['md'] ?? null"
:lg="$grid['lg'] ?? null"
:xl="$grid['xl'] ?? null"
class="gap-6"
>
{{--
@foreach ($widgets as $k=>$v)
<x-filament::grid.column>
{{ $k }}
</x-filament::grid.column>
@endforeach
--}}
</x-filament-widgets::widget>

0 comments on commit 4ddf33c

Please sign in to comment.