Skip to content

Commit 2c7d13f

Browse files
committed
Added new loading component and used it on the toolbar
1 parent d51eb14 commit 2c7d13f

File tree

8 files changed

+16
-11
lines changed

8 files changed

+16
-11
lines changed

resources/views/components/confirmation-message.blade.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
<x-lv-button variant="danger" @click="await $wire.call('confirmAndExecuteAction', action, id, false); open = false" wire:loading.attr="disabled">
1818
{{ __("Yes, I'm sure") }}
1919
</x-lv-button>
20-
<span wire:loading class="animate-spin">
21-
{!! UI::icon('loader') !!}
22-
</span>
20+
21+
<x-lv-loading wire:loading />
2322
</div>
2423
</x-lv-modal>
2524
</div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<span {{ $attributes->merge(['class' => 'animate-spin']) }}>
2+
{!! UI::icon('loader', '', 'text-gray-500') !!}
3+
</span>

resources/views/components/toolbar/bulk-actions.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@if ($this->hasBulkActions && isset($headers) <= 0)
1010
<button
1111
wire:click="$set('allSelected', {{ !$allSelected }})"
12-
class="border border-transparent hover:border-gray-300 focus:border-gray-300 focus:outline-none flex items-center gap-1 text-xs px-3 py-2 rounded hover:shadow-sm font-medium"
12+
class="border border-transparent hover:border-gray-300 focus:border-gray-300 focus:outline-none flex items-center text-xs px-3 py-2 rounded hover:shadow-sm font-medium"
1313
>
1414
{{ __($allSelected ? 'Unselect all' : 'Select all') }}
1515
</button>

resources/views/components/toolbar/filters.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
@if (count($filters) > 0)
1818
{{-- Clear filters button --}}
19-
<div class="p-4 bg-gray-100 text-right flex justify-end">
19+
<div class="px-4 py-2 bg-gray-100 text-right flex justify-end border-t border-gray-200">
2020
<button wire:click.prevent="clearFilters" @click="open = false" class="text-gray-600 flex items-center hover:text-gray-700 focus:outline-none text-sm">
21-
<i data-feather="x-circle" class="mr-2 w-5 h-5"></i>
21+
<i data-feather="slash" class="mr-2 w-4 h-4"></i>
2222
{{__('Clear filters')}}
2323
</button>
2424
</div>

resources/views/components/toolbar/sorting.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</x-lv-select-button>
1717
</x-slot>
1818

19-
<x-lv-drop-down.header label="Sort by" />
19+
<x-lv-drop-down.header label="{{ __('Sort by') }}" />
2020

2121
{{-- Each sortable item --}}
2222
@foreach ($sortableBy as $title => $column)

resources/views/components/toolbar/toolbar.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
{{-- Actions on the left --}}
1616
<div class="flex space-x-1 flex-1 justify-end items-center mb-4">
17+
<x-lv-loading class="mb-0" wire:loading />
18+
1719
{{-- Bulk actions --}}
1820
<div>
1921
@include('laravel-views::components.toolbar.bulk-actions')

resources/views/components/tooltip.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
@props(['tooltip' => ''])
22

3-
<div x-data="{ tooltip: false }" class="cursor-pointer relative z-30 inline-flex" @mousemove.away="tooltip = false">
3+
<div x-data="{ tooltip: false }" class="cursor-pointer relative inline-flex" @mousemove.away="tooltip = false">
44
<span @mousemove="tooltip = true" @mouseleave="tooltip = false">
55
{{ $slot }}
66
</span>
77

88
<div class="relative" x-cloak x-show.transition.origin.top="tooltip">
9-
<div class="flex justify-center absolute top-0 z-30 w-32 p-2 -mt-3 text-sm leading-tight text-white transform -translate-x-1/2 -translate-y-full bg-gray-800 rounded-md shadow-md">
9+
<div class="flex justify-center absolute top-0 z-10 w-32 p-2 -mt-3 text-sm leading-tight text-white transform -translate-x-1/2 -translate-y-full bg-gray-800 rounded-md shadow-md">
1010
{{ $tooltip }}
1111
</div>
12-
<svg class="absolute z-30 w-6 h-6 text-gray-800 transform -translate-x-8 -translate-y-5 fill-current stroke-current" width="8" height="8">
12+
<svg class="absolute z-10 w-6 h-6 text-gray-800 transform -translate-x-8 -translate-y-5 fill-current stroke-current" width="8" height="8">
1313
<rect x="12" y="-10" width="8" height="8" transform="rotate(45)" />
1414
</svg>
1515
</div>

src/LaravelViews.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public function components()
3333
'form.checkbox' => 'checkbox',
3434
'form.input' => 'input',
3535
'tooltip' => 'tooltip',
36-
'confirmation-message' => 'confirmation-message'
36+
'confirmation-message' => 'confirmation-message',
37+
'loading' => 'loading'
3738
];
3839
}
3940

0 commit comments

Comments
 (0)