From 4e8c3e0ff7a61d766d877db72bbc3156eb52cfa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Galv=C3=A3o?= Date: Wed, 16 Apr 2025 19:08:16 -0300 Subject: [PATCH 01/15] fix: full page widget layout --- resources/views/components/map.blade.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/views/components/map.blade.php b/resources/views/components/map.blade.php index 8542bcf..dc5c019 100644 --- a/resources/views/components/map.blade.php +++ b/resources/views/components/map.blade.php @@ -216,26 +216,26 @@ }, toggleFullpage: function () { if (this.fullpage == false) { - document.querySelector('.fi-main-ctn').style.position = 'relative'; - document.querySelector('.fi-main-ctn').style.maxHeight = '100vh'; - document.querySelector('.fi-main-ctn').style.overflow = 'hidden'; + document.querySelector('.fi-main-ctn').style.height = '100vh'; + document.querySelector('.fi-main').style.position = 'relative'; + document.querySelector('.fi-main').style.overflow = 'hidden'; this.$refs.map.style.height = this.mapFullpageHeight; this.$refs.map.style.minHeight = this.mapFullpageHeight; this.$refs.map.style.position = 'absolute'; - this.$refs.map.style.top = document.querySelector('.fi-topbar').offsetHeight + 'px'; + this.$refs.map.style.top = '0'; this.$refs.map.style.left = '0'; this.$refs.map.style.zIndex = '5'; this.fullpage = true; return; } - document.querySelector('.fi-main-ctn').style.position = ''; + document.querySelector('.fi-main-ctn').style.maxHeight = null; + document.querySelector('.fi-main').style.position = ''; + document.querySelector('.fi-main').style.overflow = null; this.$refs.map.style.height = this.mapDefaultHeight; this.$refs.map.style.minHeight = '100%'; this.$refs.map.style.position = ''; this.$refs.map.style.top = 'inherit'; - document.querySelector('.fi-main-ctn').style.maxHeight = null; - document.querySelector('.fi-main-ctn').style.overflow = null; this.fullpage = false; }, setTileLayer: function (mode) { From 0537d617c733e8706915ef10fcd02d297ebaa9b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Galv=C3=A3o?= Date: Thu, 17 Apr 2025 15:18:09 -0300 Subject: [PATCH 02/15] feat: adapt filament section to local card component --- .../views/components/card/heading.blade.php | 5 ++ .../views/components/card/index.blade.php | 60 +++++++++++++++++ resources/views/components/map.blade.php | 12 +++- resources/views/widgets/map.blade.php | 64 ++++++------------- src/Widgets/MapWidget.php | 2 +- 5 files changed, 96 insertions(+), 47 deletions(-) create mode 100644 resources/views/components/card/heading.blade.php create mode 100644 resources/views/components/card/index.blade.php diff --git a/resources/views/components/card/heading.blade.php b/resources/views/components/card/heading.blade.php new file mode 100644 index 0000000..3f81bc8 --- /dev/null +++ b/resources/views/components/card/heading.blade.php @@ -0,0 +1,5 @@ +

class(['fi-maps-card-header-heading text-base font-semibold leading-6 text-gray-950 dark:text-white']) }} +> + {{ $slot }} +

diff --git a/resources/views/components/card/index.blade.php b/resources/views/components/card/index.blade.php new file mode 100644 index 0000000..aa796ca --- /dev/null +++ b/resources/views/components/card/index.blade.php @@ -0,0 +1,60 @@ +@props([ + 'hasBorder' => true, + 'heading' => null, + 'footer' => null, +]) + +@php + $hasHeading = filled($heading); + $hasHeader = $hasHeading; + + $hasFooter = filled($footer); +@endphp + +
+ @if ($hasHeader) +
'px-4 py-2.5', + false => 'px-6 py-4', + } + ])> +
+ @if ($hasHeading) +
+ @if ($hasHeading) + + {{ $heading }} + + @endif +
+ @endif +
+
+ @endif + +
'p-6', + false => '', + }, + ]) + > + {{ $slot }} +
+ + @if ($hasFooter) +
'px-4 py-2.5', + false => 'px-6 py-4', + } + ])> + {{ $footer }} +
+ @endif +
diff --git a/resources/views/components/map.blade.php b/resources/views/components/map.blade.php index dc5c019..57d2462 100644 --- a/resources/views/components/map.blade.php +++ b/resources/views/components/map.blade.php @@ -12,6 +12,7 @@ 'modals' => null, 'rounded' => true, 'fullpage' => false, + 'pollingInterval' => null, ]) @php @@ -20,7 +21,15 @@ fn (\Webbingbrasil\FilamentMaps\Actions\Action $action ): bool => ! $action->isHidden(), ); @endphp -
+
class([ 'h-full w-full overflow-hidden', @@ -28,6 +37,7 @@ ]) }} {{ $extraAttributeBag }}>
- - @if ($heading) -
$hasBorder, - 'px-6 py-4' => !$hasBorder, - ])> -
- {{ $heading }} -
-
- @endif - -
getPollingInterval()) - wire:poll.5s.visible - @endif - @class(['px-4 py-2' => $hasBorder])> - -
- - @if ($footer) -
$hasBorder, - 'px-6 py-4' => !$hasBorder, - ])> - {{ $footer }} -
- @endif -
+ + + + - diff --git a/src/Widgets/MapWidget.php b/src/Widgets/MapWidget.php index 07fe200..1de4869 100644 --- a/src/Widgets/MapWidget.php +++ b/src/Widgets/MapWidget.php @@ -125,7 +125,7 @@ public function rounded(bool $rounded = true): self public function getRounded(): bool { - return $this->rounded; + return $this->rounded && $this->getHasBorder(); } public function isFullPage(): bool From ed336c73fafc636aa00879492e5cda02fec36ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Galv=C3=A3o?= Date: Thu, 17 Apr 2025 16:27:10 -0300 Subject: [PATCH 03/15] style: remove unused class --- resources/views/button-action.blade.php | 1 - resources/views/fullscreen-action.blade.php | 24 ++++++++++----------- resources/views/zoom-action.blade.php | 6 ++---- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/resources/views/button-action.blade.php b/resources/views/button-action.blade.php index 65af881..d6a88d4 100644 --- a/resources/views/button-action.blade.php +++ b/resources/views/button-action.blade.php @@ -2,5 +2,4 @@ :action="$action" :label="$getLabel()" component="filament-maps::icon-button" - class="filament-page-icon-button-action" /> diff --git a/resources/views/fullscreen-action.blade.php b/resources/views/fullscreen-action.blade.php index 977faf1..ea17e2b 100644 --- a/resources/views/fullscreen-action.blade.php +++ b/resources/views/fullscreen-action.blade.php @@ -3,20 +3,18 @@ $enterFullscreen = $action; $exitFullscreen = (clone $action)->icon('filamentmapsicon-fullscreen-exit'); @endphp -