add landing pages for meetups

This commit is contained in:
Benjamin Takats
2023-01-14 20:35:54 +01:00
parent 8120b13bff
commit 2f00e34e10
55 changed files with 3161 additions and 17 deletions

View File

@@ -0,0 +1,139 @@
@aware(['component'])
@props(['rows'])
@php
$theme = $component->getTheme();
@endphp
@if ($component->hasConfigurableAreaFor('before-pagination'))
@include($component->getConfigurableAreaFor('before-pagination'), $component->getParametersForConfigurableArea('before-pagination'))
@endif
@if ($theme === 'tailwind')
<div>
@if ($component->paginationVisibilityIsEnabled())
<div class="mt-4 px-4 md:p-0 sm:flex justify-between items-center space-y-4 sm:space-y-0">
<div>
@if ($component->paginationIsEnabled() && $component->isPaginationMethod('standard') && $rows->lastPage() > 1)
<p class="paged-pagination-results text-sm text-gray-700 leading-5 dark:text-white">
<span>@lang('Showing')</span>
<span class="font-medium">{{ $rows->firstItem() }}</span>
<span>@lang('to')</span>
<span class="font-medium">{{ $rows->lastItem() }}</span>
<span>@lang('of')</span>
<span class="font-medium">{{ $rows->total() }}</span>
<span>@lang('results')</span>
</p>
@elseif ($component->paginationIsEnabled() && $component->isPaginationMethod('simple'))
<p class="paged-pagination-results text-sm text-gray-700 leading-5 dark:text-white">
<span>@lang('Showing')</span>
<span class="font-medium">{{ $rows->firstItem() }}</span>
<span>@lang('to')</span>
<span class="font-medium">{{ $rows->lastItem() }}</span>
</p>
@else
<p class="total-pagination-results text-sm text-gray-700 leading-5 dark:text-white">
@lang('Showing')
<span class="font-medium">{{ $rows->count() }}</span>
@lang('results')
</p>
@endif
</div>
@if ($component->paginationIsEnabled())
{{ $rows->links('livewire-tables::specific.tailwind.pagination') }}
@endif
</div>
@endif
</div>
@elseif ($theme === 'bootstrap-4')
<div>
@if ($component->paginationVisibilityIsEnabled())
@if ($component->paginationIsEnabled() && $component->isPaginationMethod('standard') && $rows->lastPage() > 1)
<div class="row mt-3">
<div class="col-12 col-md-6 overflow-auto">
{{ $rows->links('livewire-tables::specific.bootstrap-4.pagination') }}
</div>
<div class="col-12 col-md-6 text-center text-md-right text-muted">
<span>@lang('Showing')</span>
<strong>{{ $rows->count() ? $rows->firstItem() : 0 }}</strong>
<span>@lang('to')</span>
<strong>{{ $rows->count() ? $rows->lastItem() : 0 }}</strong>
<span>@lang('of')</span>
<strong>{{ $rows->total() }}</strong>
<span>@lang('results')</span>
</div>
</div>
@elseif ($component->paginationIsEnabled() && $component->isPaginationMethod('simple'))
<div class="row mt-3">
<div class="col-12 col-md-6 overflow-auto">
{{ $rows->links('livewire-tables::specific.bootstrap-4.pagination') }}
</div>
<div class="col-12 col-md-6 text-center text-md-right text-muted">
<span>@lang('Showing')</span>
<strong>{{ $rows->count() ? $rows->firstItem() : 0 }}</strong>
<span>@lang('to')</span>
<strong>{{ $rows->count() ? $rows->lastItem() : 0 }}</strong>
</div>
</div>
@else
<div class="row mt-3">
<div class="col-12 text-muted">
@lang('Showing')
<strong>{{ $rows->count() }}</strong>
@lang('results')
</div>
</div>
@endif
@endif
</div>
@elseif ($theme === 'bootstrap-5')
<div>
@if ($component->paginationVisibilityIsEnabled())
@if ($component->paginationIsEnabled() && $component->isPaginationMethod('standard') && $rows->lastPage() > 1)
<div class="row mt-3">
<div class="col-12 col-md-6 overflow-auto">
{{ $rows->links('livewire-tables::specific.bootstrap-4.pagination') }}
</div>
<div class="col-12 col-md-6 text-center text-md-end text-muted">
<span>@lang('Showing')</span>
<strong>{{ $rows->count() ? $rows->firstItem() : 0 }}</strong>
<span>@lang('to')</span>
<strong>{{ $rows->count() ? $rows->lastItem() : 0 }}</strong>
<span>@lang('of')</span>
<strong>{{ $rows->total() }}</strong>
<span>@lang('results')</span>
</div>
</div>
@elseif ($component->paginationIsEnabled() && $component->isPaginationMethod('simple'))
<div class="row mt-3">
<div class="col-12 col-md-6 overflow-auto">
{{ $rows->links('livewire-tables::specific.bootstrap-4.pagination') }}
</div>
<div class="col-12 col-md-6 text-center text-md-end text-muted">
<span>@lang('Showing')</span>
<strong>{{ $rows->count() ? $rows->firstItem() : 0 }}</strong>
<span>@lang('to')</span>
<strong>{{ $rows->count() ? $rows->lastItem() : 0 }}</strong>
</div>
</div>
@else
<div class="row mt-3">
<div class="col-12 text-muted">
@lang('Showing')
<strong>{{ $rows->count() }}</strong>
@lang('results')
</div>
</div>
@endif
@endif
</div>
@endif
@if ($component->hasConfigurableAreaFor('after-pagination'))
@include($component->getConfigurableAreaFor('after-pagination'), $component->getParametersForConfigurableArea('after-pagination'))
@endif

View File

@@ -0,0 +1,97 @@
@aware(['component'])
@php
$theme = $component->getTheme();
$customAttributes = [
'wrapper' => $this->getTableWrapperAttributes(),
'table' => $this->getTableAttributes(),
'thead' => $this->getTheadAttributes(),
'tbody' => $this->getTbodyAttributes(),
];
@endphp
@if ($theme === 'tailwind')
<div {{
$attributes->merge($customAttributes['wrapper'])
->class(['shadow overflow-y-scroll border-b border-gray-200 dark:border-gray-700 sm:rounded-lg' => $customAttributes['wrapper']['default'] ?? true])
->except('default')
}}>
<table {{
$attributes->merge($customAttributes['table'])
->class(['min-w-full divide-y divide-gray-200 dark:divide-none' => $customAttributes['table']['default'] ?? true])
->except('default')
}}>
<thead {{
$attributes->merge($customAttributes['thead'])
->class(['bg-gray-50' => $customAttributes['thead']['default'] ?? true])
->except('default')
}}>
<tr>
{{ $thead }}
</tr>
</thead>
<tbody
@if ($component->reorderIsEnabled())
wire:sortable="{{ $component->getReorderMethod() }}"
@endif
{{
$attributes->merge($customAttributes['tbody'])
->class(['bg-white divide-y divide-gray-200 dark:bg-gray-800 dark:divide-none' => $customAttributes['tbody']['default'] ?? true])
->except('default')
}}
>
{{ $slot }}
</tbody>
@if (isset($tfoot))
<tfoot>
{{ $tfoot }}
</tfoot>
@endif
</table>
</div>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<div {{
$attributes->merge($customAttributes['wrapper'])
->class(['table-responsive' => $customAttributes['wrapper']['default'] ?? true])
->except('default')
}}>
<table {{
$attributes->merge($customAttributes['table'])
->class(['table table-striped' => $customAttributes['table']['default'] ?? true])
->except('default')
}}>
<thead {{
$attributes->merge($customAttributes['thead'])
->class(['' => $customAttributes['thead']['default'] ?? true])
->except('default')
}}>
<tr>
{{ $thead }}
</tr>
</thead>
<tbody
@if ($component->reorderIsEnabled())
wire:sortable="{{ $component->getReorderMethod() }}"
@endif
{{
$attributes->merge($customAttributes['tbody'])
->class(['' => $customAttributes['tbody']['default'] ?? true])
->except('default')
}}
>
{{ $slot }}
</tbody>
@if (isset($tfoot))
<tfoot>
{{ $tfoot }}
</tfoot>
@endif
</table>
</div>
@endif

View File

@@ -0,0 +1,22 @@
@aware(['component'])
@php
$attributes = $attributes->merge(['wire:key' => 'empty-message-'.$component->id]);
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<tr {{ $attributes }}>
<td colspan="{{ $component->getColspanCount() }}">
<div class="flex justify-center items-center space-x-2 dark:bg-gray-800">
<span class="font-medium py-8 text-gray-400 text-lg dark:text-white">{{ $component->getEmptyMessage() }}</span>
</div>
</td>
</tr>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<tr {{ $attributes }}>
<td colspan="{{ $component->getColspanCount() }}">
{{ $component->getEmptyMessage() }}
</td>
</tr>
@endif

View File

@@ -0,0 +1,66 @@
@aware(['component'])
@props(['row', 'rowIndex'])
@if ($component->collapsingColumnsAreEnabled() && $component->hasCollapsedColumns())
@php
$theme = $component->getTheme();
$columns = collect([]);
if ($component->shouldCollapseOnMobile() && $component->shouldCollapseOnTablet()) {
$columns->push($component->getCollapsedMobileColumns());
$columns->push($component->getCollapsedTabletColumns());
} elseif ($component->shouldCollapseOnTablet() && ! $component->shouldCollapseOnMobile()) {
$columns->push($component->getCollapsedTabletColumns());
} elseif ($component->shouldCollapseOnMobile() && ! $component->shouldCollapseOnTablet()) {
$columns->push($component->getCollapsedMobileColumns());
}
$columns = $columns->collapse();
// TODO: Column count
$colspan = $columns->count() + 1;
@endphp
@if ($theme === 'tailwind')
<tr
wire:key="row-{{ $rowIndex }}-collapsed-contents"
wire:loading.class.delay="opacity-50 dark:bg-gray-900 dark:opacity-60"
x-data
@toggle-row-content.window="$event.detail.row === {{ $rowIndex }} ? $el.classList.toggle('hidden') : null"
class="hidden md:hidden bg-white dark:bg-gray-700 dark:text-white"
>
<td class="pt-4 pb-2 px-4" colspan="{{ $colspan }}">
<div>
@foreach($columns as $colIndex => $column)
@continue($column->isHidden())
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
<p class="block mb-2 @if($column->shouldCollapseOnMobile()) sm:hidden @endif @if($column->shouldCollapseOnTablet()) md:hidden @endif">
<strong>{{ $column->getTitle() }}</strong>: {{ $column->renderContents($row) }}
</p>
@endforeach
</div>
</td>
</tr>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<tr
wire:key="row-{{ $rowIndex }}-collapsed-contents"
x-data
@toggle-row-content.window="$event.detail.row === {{ $rowIndex }} ? $el.classList.toggle('d-none') : null"
class="d-none d-md-none"
>
<td class="pt-3 p-2" colspan="{{ $colspan }}">
<div>
@foreach($columns as $colIndex => $column)
@continue($column->isHidden())
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
<p class="d-block mb-2 @if($column->shouldCollapseOnMobile()) d-sm-none @endif @if($column->shouldCollapseOnTablet()) d-md-none @endif">
<strong>{{ $column->getTitle() }}</strong>: {{ $column->renderContents($row) }}
</p>
@endforeach
</div>
</td>
</tr>
@endif
@endif

View File

@@ -0,0 +1,43 @@
@aware(['component', 'row', 'rowIndex'])
@props(['column', 'colIndex'])
@php
$attributes = $attributes->merge(['wire:key' => 'cell-'.$rowIndex.'-'.$colIndex.'-'.$component->id]);
$theme = $component->getTheme();
$customAttributes = $component->getTdAttributes($column, $row, $colIndex, $rowIndex)
@endphp
@if ($theme === 'tailwind')
<td
@if ($column->isClickable())
onclick="window.open('{{ $component->getTableRowUrl($row) }}', '{{ $component->getTableRowUrlTarget($row) ?? '_self' }}')"
@endif
{{
$attributes->merge($customAttributes)
->class(['px-6 py-4 whitespace-nowrap text-sm font-medium dark:text-white' => $customAttributes['default'] ?? true])
->class(['hidden sm:table-cell' => $column && $column->shouldCollapseOnMobile()])
->class(['hidden md:table-cell' => $column && $column->shouldCollapseOnTablet()])
->except('default')
}}
>
{{ $slot }}
</td>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<td
@if ($column->isClickable())
onclick="window.open('{{ $component->getTableRowUrl($row) }}', '{{ $component->getTableRowUrlTarget($row) ?? '_self' }}')"
style="cursor:pointer"
@endif
{{
$attributes->merge($customAttributes)
->class(['' => $customAttributes['default'] ?? true])
->class(['d-none d-sm-table-cell' => $column && $column->shouldCollapseOnMobile()])
->class(['d-none d-md-table-cell' => $column && $column->shouldCollapseOnTablet()])
->except('default')
}}
>
{{ $slot }}
</td>
@endif

View File

@@ -0,0 +1,43 @@
@aware(['component'])
@props(['row'])
@if ($component->bulkActionsAreEnabled() && $component->hasBulkActions())
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<x-livewire-tables::table.td.plain>
<div class="inline-flex rounded-md shadow-sm">
<input
wire:model="selected"
wire:loading.attr.delay="disabled"
value="{{ $row->{$this->getPrimaryKey()} }}"
type="checkbox"
class="rounded border-gray-300 text-indigo-600 shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600"
/>
</div>
</x-livewire-tables::table.td.plain>
@elseif ($theme === 'bootstrap-4')
<x-livewire-tables::table.td.plain>
<input
wire:model="selected"
wire:loading.attr.delay="disabled"
value="{{ $row->{$this->getPrimaryKey()} }}"
type="checkbox"
/>
</x-livewire-tables::table.td.plain>
@elseif ($theme === 'bootstrap-5')
<x-livewire-tables::table.td.plain>
<div class="form-check">
<input
wire:model="selected"
wire:loading.attr.delay="disabled"
value="{{ $row->{$this->getPrimaryKey()} }}"
type="checkbox"
class="form-check-input"
/>
</div>
</x-livewire-tables::table.td.plain>
@endif
@endif

View File

@@ -0,0 +1,24 @@
@aware(['component'])
@props(['column' => null, 'customAttributes' => []])
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<td {{ $attributes
->merge($customAttributes)
->class(['px-6 py-4 whitespace-nowrap text-sm font-medium dark:text-white' => $customAttributes['default'] ?? true])
->class(['hidden sm:table-cell' => $column && $column->shouldCollapseOnMobile()])
->class(['hidden md:table-cell' => $column && $column->shouldCollapseOnTablet()])
->except('default')
}}>{{ $slot }}</td>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<td {{ $attributes
->merge($customAttributes)
->class(['' => $customAttributes['default'] ?? true])
->class(['d-none d-sm-table-cell' => $column && $column->shouldCollapseOnMobile()])
->class(['d-none d-md-table-cell' => $column && $column->shouldCollapseOnTablet()])
->except('default')
}}>{{ $slot }}</td>
@endif

View File

@@ -0,0 +1,21 @@
@aware(['component'])
@php
$theme = $component->getTheme();
@endphp
@if ($this->currentlyReorderingIsEnabled())
@if ($theme === 'tailwind')
<x-livewire-tables::table.td.plain wire:sortable.handle>
<svg xmlns="http://www.w3.org/2000/svg" class="inline w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
</svg>
</x-livewire-tables::table.td.plain>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<x-livewire-tables::table.td.plain wire:sortable.handle>
<svg xmlns="http://www.w3.org/2000/svg" class="d-inline" style="width:1em;height:1em;" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
</svg>
</x-livewire-tables::table.td.plain>
@endif
@endif

View File

@@ -0,0 +1,67 @@
@aware(['component'])
@props(['rowIndex', 'hidden' => false])
@if ($component->collapsingColumnsAreEnabled() && $component->hasCollapsedColumns())
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<td
@if (! $hidden) x-data="{open:false}" @endif
{{
$attributes
->merge(['class' => 'p-3 table-cell text-center'])
->class([
'md:hidden' =>
(($component->shouldCollapseOnMobile() && $component->shouldCollapseOnTablet()) ||
($component->shouldCollapseOnTablet() && ! $component->shouldCollapseOnMobile()))
])
->class(['sm:hidden' => $component->shouldCollapseOnMobile() && ! $component->shouldCollapseOnTablet()])
}}
>
@if (! $hidden)
<button
x-on:click.prevent="$dispatch('toggle-row-content', {'row': {{ $rowIndex }}});open = !open"
>
<svg x-show="!open" xmlns="http://www.w3.org/2000/svg" class="text-green-600 h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<svg x-cloak x-show="open" xmlns="http://www.w3.org/2000/svg" class="text-yellow-600 h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</button>
@endif
</td>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<td
@if (! $hidden) x-data="{open:false}" @endif
{{
$attributes
->class([
'd-md-none' =>
(($component->shouldCollapseOnMobile() && $component->shouldCollapseOnTablet()) ||
($component->shouldCollapseOnTablet() && ! $component->shouldCollapseOnMobile()))
])
->class(['d-sm-none' => $component->shouldCollapseOnMobile() && ! $component->shouldCollapseOnTablet()])
}}
>
@if (! $hidden)
<button
x-on:click.prevent="$dispatch('toggle-row-content', {'row': {{ $rowIndex }}});open = !open"
class="p-0"
style="background:none;border:none;"
>
<svg x-show="!open" xmlns="http://www.w3.org/2000/svg" class="text-success" style="width:1.4em;height:1.4em;" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<svg x-cloak x-show="open" xmlns="http://www.w3.org/2000/svg" class="text-warning" style="width:1.4em;height:1.4em;" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</button>
@endif
</td>
@endif
@endif

View File

@@ -0,0 +1,95 @@
@aware(['component'])
@props(['column', 'index'])
@php
$attributes = $attributes->merge(['wire:key' => 'header-col-'.$index.'-'.$component->id]);
$theme = $component->getTheme();
$customAttributes = $component->getThAttributes($column);
$customSortButtonAttributes = $component->getThSortButtonAttributes($column);
$direction = $column->hasField() ? $component->getSort($column->getColumnSelectName()) : null;
@endphp
@if ($theme === 'tailwind')
<th scope="col" {{
$attributes->merge($customAttributes)
->class(['px-6 py-3 text-left text-xs font-medium whitespace-nowrap text-gray-500 uppercase tracking-wider dark:bg-gray-800 dark:text-gray-400' => $customAttributes['default'] ?? true])
->class(['hidden sm:table-cell' => $column->shouldCollapseOnMobile()])
->class(['hidden md:table-cell' => $column->shouldCollapseOnTablet()])
->except('default')
}}>
@unless ($component->sortingIsEnabled() && $column->isSortable())
{{ $column->getTitle() }}
@else
<button
wire:click="sortBy('{{ $column->getColumnSelectName() }}')"
{{
$attributes->merge($customSortButtonAttributes)
->class(['flex items-center space-x-1 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider group focus:outline-none dark:text-gray-400' => $customSortButtonAttributes['default'] ?? true])
->except(['default', 'wire:key'])
}}
>
<span>{{ $column->getTitle() }}</span>
<span class="relative flex items-center">
@if ($direction === 'asc')
<svg class="w-3 h-3 group-hover:opacity-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"></path>
</svg>
<svg class="w-3 h-3 opacity-0 group-hover:opacity-100 absolute" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
@elseif ($direction === 'desc')
<svg class="w-3 h-3 opacity-0 group-hover:opacity-100 absolute" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<svg class="w-3 h-3 group-hover:opacity-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
@else
<svg class="w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity duration-300" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"></path>
</svg>
@endif
</span>
</button>
@endunless
</th>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<th scope="col" {{
$attributes->merge($customAttributes)
->class(['' => $customAttributes['default'] ?? true])
->class(['d-none d-sm-table-cell' => $column->shouldCollapseOnMobile()])
->class(['d-none d-md-table-cell' => $column->shouldCollapseOnTablet()])
->except('default')
}}>
@unless ($component->sortingIsEnabled() && $column->isSortable())
{{ $column->getTitle() }}
@else
<div
class="d-flex align-items-center"
wire:click="sortBy('{{ $column->getColumnSelectName() }}')"
style="cursor:pointer;"
>
<span>{{ $column->getTitle() }}</span>
<span class="relative d-flex align-items-center">
@if ($direction === 'asc')
<svg xmlns="http://www.w3.org/2000/svg" class="ml-1" style="width:1em;height:1em;" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7" />
</svg>
@elseif ($direction === 'desc')
<svg xmlns="http://www.w3.org/2000/svg" class="ml-1" style="width:1em;height:1em;" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
</svg>
@else
<svg xmlns="http://www.w3.org/2000/svg" class="ml-1" style="width:1em;height:1em;" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4" />
</svg>
@endif
</span>
</div>
@endunless
</th>
@endif

View File

@@ -0,0 +1,36 @@
@aware(['component'])
@if ($component->bulkActionsAreEnabled() && $component->hasBulkActions())
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<x-livewire-tables::table.th.plain>
<div class="inline-flex rounded-md shadow-sm">
<input
wire:model="selectAll"
type="checkbox"
class="rounded border-gray-300 text-indigo-600 shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600"
/>
</div>
</x-livewire-tables::table.th.plain>
@elseif ($theme === 'bootstrap-4')
<x-livewire-tables::table.th.plain>
<input
wire:model="selectAll"
type="checkbox"
/>
</x-livewire-tables::table.th.plain>
@elseif ($theme === 'bootstrap-5')
<x-livewire-tables::table.th.plain>
<div class="form-check">
<input
wire:model="selectAll"
type="checkbox"
class="form-check-input"
/>
</div>
</x-livewire-tables::table.th.plain>
@endif
@endif

View File

@@ -0,0 +1,11 @@
@aware(['component'])
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<th scope="col" {{ $attributes->merge(['class' => 'table-cell px-3 py-2 md:px-6 md:py-3 text-center md:text-left bg-gray-50 dark:bg-gray-800']) }}>{{ $slot }}</th>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<th scope="col">{{ $slot }}</th>
@endif

View File

@@ -0,0 +1,5 @@
@aware(['component'])
@if ($this->currentlyReorderingIsEnabled())
<x-livewire-tables::table.th.plain />
@endif

View File

@@ -0,0 +1,37 @@
@aware(['component'])
@if ($component->collapsingColumnsAreEnabled() && $component->hasCollapsedColumns())
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<th
scope="col"
{{
$attributes
->merge(['class' => 'table-cell dark:bg-gray-800'])
->class([
'md:hidden' =>
(($component->shouldCollapseOnMobile() && $component->shouldCollapseOnTablet()) ||
($component->shouldCollapseOnTablet() && ! $component->shouldCollapseOnMobile()))
])
->class(['sm:hidden' => $component->shouldCollapseOnMobile() && ! $component->shouldCollapseOnTablet()])
}}
></th>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<th
scope="col"
{{
$attributes
->merge(['class' => 'd-table-cell'])
->class([
'd-md-none' =>
(($component->shouldCollapseOnMobile() && $component->shouldCollapseOnTablet()) ||
($component->shouldCollapseOnTablet() && ! $component->shouldCollapseOnMobile()))
])
->class(['d-sm-none' => $component->shouldCollapseOnMobile() && ! $component->shouldCollapseOnTablet()])
}}
></th>
@endif
@endif

View File

@@ -0,0 +1,45 @@
@aware(['component'])
@props(['row', 'rowIndex'])
@php
$attributes = $attributes->merge(['wire:key' => 'row-'.$rowIndex.'-'.$component->id]);
$theme = $component->getTheme();
$customAttributes = $this->getTrAttributes($row, $rowIndex);
@endphp
@if ($theme === 'tailwind')
<tr
wire:loading.class.delay="opacity-50 dark:bg-gray-900 dark:opacity-60"
@if ($component->reorderIsEnabled() && $component->currentlyReorderingIsEnabled())
wire:sortable.item="{{ $row->getKey() }}"
@endif
{{
$attributes->merge($customAttributes)
->class(['bg-white dark:bg-gray-700 dark:text-white' => ($customAttributes['default'] ?? true) && $rowIndex % 2 === 0])
->class(['bg-gray-50 dark:bg-gray-800 dark:text-white' => ($customAttributes['default'] ?? true) && $rowIndex % 2 !== 0])
->class(['cursor-pointer' => $component->hasTableRowUrl()])
->except('default')
}}
>
{{ $slot }}
</tr>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<tr
wire:loading.class.delay=""
@if ($component->reorderIsEnabled() && $component->currentlyReorderingIsEnabled())
wire:sortable.item="{{ $row->getKey() }}"
@endif
{{
$attributes->merge($customAttributes)
->class(['' => ($customAttributes['default'] ?? true) && $rowIndex % 2 === 0])
->class(['' => ($customAttributes['default'] ?? true) && $rowIndex % 2 !== 0])
->except('default')
}}
>
{{ $slot }}
</tr>
@endif

View File

@@ -0,0 +1,119 @@
@aware(['component'])
@props(['rows'])
@if ($component->bulkActionsAreEnabled() && $component->hasBulkActions() && $component->hasSelected())
@php
$table = $component->getTableName();
$theme = $component->getTheme();
$colspan = $component->getColspanCount();
$selected = $component->getSelectedCount();
$selectAll = $component->selectAllIsEnabled();
@endphp
@if ($theme === 'tailwind')
<x-livewire-tables::table.tr.plain
wire:key="bulk-select-message-{{ $table }}"
class="bg-indigo-50 dark:bg-gray-900 dark:text-white"
>
<x-livewire-tables::table.td.plain :colspan="$colspan">
@if ($selectAll)
<div wire:key="all-selected-{{ $table }}">
<span>
@lang('You are currently selecting all')
<strong>{{ number_format($rows->total()) }}</strong>
@lang('rows').
</span>
<button
wire:click="clearSelected"
wire:loading.attr="disabled"
type="button"
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400"
>
@lang('Deselect All')
</button>
</div>
@else
<div wire:key="some-selected-{{ $table }}">
<span>
@lang('You have selected')
<strong>{{ $selected }}</strong>
@lang('rows, do you want to select all')
<strong>{{ number_format($rows->total()) }}</strong>?
</span>
<button
wire:click="setAllSelected"
wire:loading.attr="disabled"
type="button"
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400"
>
@lang('Select All')
</button>
<button
wire:click="clearSelected"
wire:loading.attr="disabled"
type="button"
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400"
>
@lang('Deselect All')
</button>
</div>
@endif
</x-livewire-tables::table.td.plain>
</x-livewire-tables::table.tr.plain>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<x-livewire-tables::table.tr.plain
wire:key="bulk-select-message-{{ $table }}"
>
<x-livewire-tables::table.td.plain :colspan="$colspan">
@if ($selectAll)
<div wire:key="all-selected-{{ $table }}">
<span>
@lang('You are currently selecting all')
<strong>{{ number_format($rows->total()) }}</strong>
@lang('rows').
</span>
<button
wire:click="clearSelected"
wire:loading.attr="disabled"
type="button"
class="btn btn-primary btn-sm"
>
@lang('Deselect All')
</button>
</div>
@else
<div wire:key="some-selected-{{ $table }}">
<span>
@lang('You have selected')
<strong>{{ $selected }}</strong>
@lang('rows, do you want to select all')
<strong>{{ number_format($rows->total()) }}</strong>?
</span>
<button
wire:click="setAllSelected"
wire:loading.attr="disabled"
type="button"
class="btn btn-primary btn-sm"
>
@lang('Select All')
</button>
<button
wire:click="clearSelected"
wire:loading.attr="disabled"
type="button"
class="btn btn-primary btn-sm"
>
@lang('Deselect All')
</button>
</div>
@endif
</x-livewire-tables::table.td.plain>
</x-livewire-tables::table.tr.plain>
@endif
@endif

View File

@@ -0,0 +1,30 @@
@aware(['component'])
@props(['rows'])
<x-livewire-tables::table.tr.plain
:customAttributes="$this->getFooterTrAttributes($rows)"
wire:key="footer-{{ $this->getTableName() }}"
>
@if ($this->currentlyReorderingIsEnabled())
<x-livewire-tables::table.td.plain />
@endif
@if ($this->bulkActionsAreEnabled() && $this->hasBulkActions())
<x-livewire-tables::table.td.plain />
@endif
@if ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns())
<x-livewire-tables::table.td.row-contents rowIndex="-1" :hidden="true" />
@endif
@foreach($this->getColumns() as $colIndex => $column)
@continue($column->isHidden())
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
@continue($this->currentlyReorderingIsDisabled() && $column->isReorderColumn() && $this->hideReorderColumnUnlessReorderingIsEnabled())
<x-livewire-tables::table.td.plain :column="$column" :customAttributes="$this->getFooterTdAttributes($column, $rows, $colIndex)">
{{ $column->getFooterContents($rows) }}
</x-livewire-tables::table.td.plain>
@endforeach
</x-livewire-tables::table.tr.plain>

View File

@@ -0,0 +1,24 @@
@aware(['component'])
@props(['customAttributes' => []])
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<tr {{ $attributes
->merge($customAttributes)
->class(['bg-white dark:bg-gray-700 dark:text-white' => $customAttributes['default'] ?? true])
->except('default')
}}>
{{ $slot }}
</tr>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<tr {{ $attributes
->merge($customAttributes)
->class(['' => $customAttributes['default'] ?? true])
->except('default')
}}>
{{ $slot }}
</tr>
@endif

View File

@@ -0,0 +1,30 @@
@aware(['component'])
@props(['rows'])
<x-livewire-tables::table.tr.plain
:customAttributes="$this->getSecondaryHeaderTrAttributes($rows)"
wire:key="secondary-header-{{ $this->getTableName() }}"
>
@if ($this->currentlyReorderingIsEnabled())
<x-livewire-tables::table.td.plain />
@endif
@if ($this->bulkActionsAreEnabled() && $this->hasBulkActions())
<x-livewire-tables::table.td.plain />
@endif
@if ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns())
<x-livewire-tables::table.td.row-contents rowIndex="-1" :hidden="true" />
@endif
@foreach($this->getColumns() as $colIndex => $column)
@continue($column->isHidden())
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
@continue($this->currentlyReorderingIsDisabled() && $column->isReorderColumn() && $this->hideReorderColumnUnlessReorderingIsEnabled())
<x-livewire-tables::table.td.plain :column="$column" :customAttributes="$this->getSecondaryHeaderTdAttributes($column, $rows, $colIndex)">
{{ $column->getSecondaryHeaderContents($rows) }}
</x-livewire-tables::table.td.plain>
@endforeach
</x-livewire-tables::table.tr.plain>

View File

@@ -0,0 +1,15 @@
@aware(['component'])
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<div class="flex-col">
{{ $slot }}
</div>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<div class="d-flex flex-column">
{{ $slot }}
</div>
@endif

View File

@@ -0,0 +1,137 @@
@aware(['component'])
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<div>
@if ($component->filtersAreEnabled() && $component->filterPillsAreEnabled() && $component->hasAppliedVisibleFiltersForPills())
<div class="mb-4 px-4 md:p-0">
<small class="text-gray-700 dark:text-white">@lang('Applied Filters'):</small>
@foreach($component->getAppliedFiltersWithValues() as $filterSelectName => $value)
@php
$filter = $component->getFilterByKey($filterSelectName);
@endphp
@continue(is_null($filter))
@continue($filter->isHiddenFromPills())
<span
wire:key="{{ $component->getTableName() }}-filter-pill-{{ $filter->getKey() }}"
class="max-w-2xl truncate inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium leading-4 bg-indigo-100 text-indigo-800 capitalize dark:bg-indigo-200 dark:text-indigo-900"
>
{{ $filter->getFilterPillTitle() }}: {{ $filter->getFilterPillValue($value) }}
<button
wire:click="resetFilter('{{ $filter->getKey() }}')"
type="button"
class="flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"
>
<span class="sr-only">@lang('Remove filter option')</span>
<svg class="h-2 w-2" stroke="currentColor" fill="none" viewBox="0 0 8 8">
<path stroke-linecap="round" stroke-width="1.5" d="M1 1l6 6m0-6L1 7" />
</svg>
</button>
</span>
@endforeach
<button
wire:click.prevent="setFilterDefaults"
class="focus:outline-none active:outline-none"
>
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-200 dark:text-gray-900">
@lang('Clear')
</span>
</button>
</div>
@endif
</div>
@elseif ($theme === 'bootstrap-4')
<div>
@if ($component->filtersAreEnabled() && $component->filterPillsAreEnabled() && $component->hasAppliedVisibleFiltersForPills())
<div class="mb-3">
<small>@lang('Applied Filters'):</small>
@foreach($component->getAppliedFiltersWithValues() as $filterSelectName => $value)
@php
$filter = $component->getFilterByKey($filterSelectName);
@endphp
@continue(is_null($filter))
@continue($filter->isHiddenFromPills())
<span
wire:key="{{ $component->getTableName() }}-filter-pill-{{ $filter->getKey() }}"
class="badge badge-pill badge-info d-inline-flex align-items-center"
>
{{ $filter->getFilterPillTitle() }}: {{ $filter->getFilterPillValue($value) }}
<a
href="#"
wire:click="resetFilter('{{ $filter->getKey() }}')"
class="text-white ml-2"
>
<span class="sr-only">@lang('Remove filter option')</span>
<svg style="width:.5em;height:.5em" stroke="currentColor" fill="none" viewBox="0 0 8 8">
<path stroke-linecap="round" stroke-width="1.5" d="M1 1l6 6m0-6L1 7" />
</svg>
</a>
</span>
@endforeach
<a
href="#"
wire:click.prevent="setFilterDefaults"
class="badge badge-pill badge-light"
>
@lang('Clear')
</a>
</div>
@endif
</div>
@elseif ($theme === 'bootstrap-5')
<div>
@if ($component->filtersAreEnabled() && $component->filterPillsAreEnabled() && $component->hasAppliedVisibleFiltersForPills())
<div class="mb-3">
<small>@lang('Applied Filters'):</small>
@foreach($component->getAppliedFiltersWithValues() as $filterSelectName => $value)
@php
$filter = $component->getFilterByKey($filterSelectName);
@endphp
@continue(is_null($filter))
@continue($filter->isHiddenFromPills())
<span
wire:key="{{ $component->getTableName() }}-filter-pill-{{ $filter->getKey() }}"
class="badge rounded-pill bg-info d-inline-flex align-items-center"
>
{{ $filter->getFilterPillTitle() }}: {{ $filter->getFilterPillValue($value) }}
<a
href="#"
wire:click="resetFilter('{{ $filter->getKey() }}')"
class="text-white ms-2"
>
<span class="visually-hidden">@lang('Remove filter option')</span>
<svg style="width:.5em;height:.5em" stroke="currentColor" fill="none" viewBox="0 0 8 8">
<path stroke-linecap="round" stroke-width="1.5" d="M1 1l6 6m0-6L1 7" />
</svg>
</a>
</span>
@endforeach
<a
href="#"
wire:click.prevent="setFilterDefaults"
class="badge rounded-pill bg-light text-dark text-decoration-none"
>
@lang('Clear')
</a>
</div>
@endif
</div>
@endif

View File

@@ -0,0 +1,29 @@
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<div class="rounded-md shadow-sm">
<input
wire:model.stop="{{ $component->getTableName() }}.filters.{{ $filter->getKey() }}"
wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
type="date"
@if($filter->hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif
@if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif
class="block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600"
/>
</div>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<div class="mb-3 mb-md-0 input-group">
<input
wire:model.stop="{{ $component->getTableName() }}.filters.{{ $filter->getKey() }}"
wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
type="date"
@if($filter->hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif
@if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif
class="form-control"
/>
</div>
@endif

View File

@@ -0,0 +1,29 @@
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<div class="rounded-md shadow-sm">
<input
wire:model.stop="{{ $component->getTableName() }}.filters.{{ $filter->getKey() }}"
wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
type="datetime-local"
@if($filter->hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif
@if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif
class="block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600"
/>
</div>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<div class="mb-3 mb-md-0 input-group">
<input
wire:model.stop="{{ $component->getTableName() }}.filters.{{ $filter->getKey() }}"
wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
type="datetime-local"
@if($filter->hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif
@if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif
class="form-control"
/>
</div>
@endif

View File

@@ -0,0 +1,60 @@
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<div class="rounded-md">
<div>
<input
type="checkbox"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}-select-all"
wire:input="selectAllFilterOptions('{{ $filter->getKey() }}')"
{{ count($component->getAppliedFilterWithValue($filter->getKey()) ?? []) === count($filter->getOptions()) ? 'checked' : ''}}
class="text-indigo-600 rounded border-gray-300 shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600 disabled:opacity-50 disabled:cursor-wait"
>
<label for="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}-select-all" class="dark:text-white">@lang('All')</label>
</div>
@foreach($filter->getOptions() as $key => $value)
<div wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}-multiselect-{{ $key }}">
<input
type="checkbox"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}"
value="{{ $key }}"
wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}"
wire:model.stop="{{ $component->getTableName() }}.filters.{{ $filter->getKey() }}"
{{ count($component->getAppliedFilterWithValue($filter->getKey()) ?? []) === count($filter->getOptions()) ? 'disabled' : ''}}
:class="{'disabled:bg-gray-400 disabled:hover:bg-gray-400' : {{ count($component->getAppliedFilterWithValue($filter->getKey()) ?? []) === count($filter->getOptions()) ? 'true' : 'false' }}}"
class="text-indigo-600 rounded border-gray-300 shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600 disabled:opacity-50 disabled:cursor-wait"
>
<label for="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}" class="dark:text-white">{{ $value }}</label>
</div>
@endforeach
</div>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<div class="form-check">
<input
type="checkbox"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}-select-all"
wire:input="selectAllFilterOptions('{{ $filter->getKey() }}')"
{{ count($component->getAppliedFilterWithValue($filter->getKey()) ?? []) === count($filter->getOptions()) ? 'checked' : ''}}
class="form-check-input"
>
<label class="form-check-label" for="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}-select-all">@lang('All')</label>
</div>
@foreach($filter->getOptions() as $key => $value)
<div class="form-check" wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}-multiselect-{{ $key }}">
<input
class="form-check-input"
type="checkbox"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}"
value="{{ $key }}"
wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}"
wire:model.stop="{{ $component->getTableName() }}.filters.{{ $filter->getKey() }}"
>
<label class="form-check-label" for="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}">{{ $value }}</label>
</div>
@endforeach
@endif

View File

@@ -0,0 +1,29 @@
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<div class="rounded-md shadow-sm">
<input
wire:model.stop="{{ $component->getTableName() }}.filters.{{ $filter->getKey() }}"
wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
type="number"
@if($filter->hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif
@if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif
class="block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600"
/>
</div>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<div class="mb-3 mb-md-0 input-group">
<input
wire:model.stop="{{ $component->getTableName() }}.filters.{{ $filter->getKey() }}"
wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
type="number"
@if($filter->hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif
@if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif
class="form-control"
/>
</div>
@endif

View File

@@ -0,0 +1,45 @@
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<div class="rounded-md shadow-sm">
<select
wire:model.stop="{{ $component->getTableName() }}.filters.{{ $filter->getKey() }}"
wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
class="block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600"
>
@foreach($filter->getOptions() as $key => $value)
@if (is_iterable($value))
<optgroup label="{{ $key }}">
@foreach ($value as $optionKey => $optionValue)
<option value="{{ $optionKey }}">{{ $optionValue }}</option>
@endforeach
</optgroup>
@else
<option value="{{ $key }}">{{ $value }}</option>
@endif
@endforeach
</select>
</div>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<select
wire:model.stop="{{ $component->getTableName() }}.filters.{{ $filter->getKey() }}"
wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
class="{{ $theme === 'bootstrap-4' ? 'form-control' : 'form-select' }}"
>
@foreach($filter->getOptions() as $key => $value)
@if (is_iterable($value))
<optgroup label="{{ $key }}">
@foreach ($value as $optionKey => $optionValue)
<option value="{{ $optionKey }}">{{ $optionValue }}</option>
@endforeach
</optgroup>
@else
<option value="{{ $key }}">{{ $value }}</option>
@endif
@endforeach
</select>
@endif

View File

@@ -0,0 +1,29 @@
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<div class="rounded-md shadow-sm">
<input
wire:model.stop="{{ $component->getTableName() }}.filters.{{ $filter->getKey() }}"
wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
type="text"
@if($filter->hasConfig('placeholder')) placeholder="{{ $filter->getConfig('placeholder') }}" @endif
@if($filter->hasConfig('maxlength')) maxlength="{{ $filter->getConfig('maxlength') }}" @endif
class="block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600"
/>
</div>
@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5')
<div class="mb-3 mb-md-0 input-group">
<input
wire:model.stop="{{ $component->getTableName() }}.filters.{{ $filter->getKey() }}"
wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
id="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
type="text"
@if($filter->hasConfig('placeholder')) placeholder="{{ $filter->getConfig('placeholder') }}" @endif
@if($filter->hasConfig('maxlength')) maxlength="{{ $filter->getConfig('maxlength') }}" @endif
class="form-control"
/>
</div>
@endif

View File

@@ -0,0 +1,140 @@
@aware(['component'])
@php
$theme = $component->getTheme();
@endphp
@if ($theme === 'tailwind')
<div>
@if ($component->sortingPillsAreEnabled() && $component->hasSorts())
<div class="mb-4 px-4 md:p-0">
<small class="text-gray-700 dark:text-white">@lang('Applied Sorting'):</small>
@foreach($component->getSorts() as $columnSelectName => $direction)
@php
$column = $component->getColumnBySelectName($columnSelectName);
@endphp
@continue(is_null($column))
@continue($column->isHidden())
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
<span
wire:key="sorting-pill-{{ $columnSelectName }}"
class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium leading-4 bg-indigo-100 text-indigo-800 capitalize dark:bg-indigo-200 dark:text-indigo-900"
>
{{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirection($component, $direction) }}
<button
wire:click="clearSort('{{ $columnSelectName }}')"
type="button"
class="flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"
>
<span class="sr-only">@lang('Remove sort option')</span>
<svg class="h-2 w-2" stroke="currentColor" fill="none" viewBox="0 0 8 8">
<path stroke-linecap="round" stroke-width="1.5" d="M1 1l6 6m0-6L1 7" />
</svg>
</button>
</span>
@endforeach
<button
wire:click.prevent="clearSorts"
class="focus:outline-none active:outline-none"
>
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-200 dark:text-gray-900">
@lang('Clear')
</span>
</button>
</div>
@endif
</div>
@elseif ($theme === 'bootstrap-4')
<div>
@if ($component->sortingPillsAreEnabled() && $component->hasSorts())
<div class="mb-3">
<small>@lang('Applied Sorting'):</small>
@foreach($component->getSorts() as $columnSelectName => $direction)
@php
$column = $component->getColumnBySelectName($columnSelectName);
@endphp
@continue(is_null($column))
@continue($column->isHidden())
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
<span
wire:key="sorting-pill-{{ $columnSelectName }}"
class="badge badge-pill badge-info d-inline-flex align-items-center"
>
{{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirection($component, $direction) }}
<a
href="#"
wire:click="clearSort('{{ $columnSelectName }}')"
class="text-white ml-2"
>
<span class="sr-only">@lang('Remove sort option')</span>
<svg style="width:.5em;height:.5em" stroke="currentColor" fill="none" viewBox="0 0 8 8">
<path stroke-linecap="round" stroke-width="1.5" d="M1 1l6 6m0-6L1 7" />
</svg>
</a>
</span>
@endforeach
<a
href="#"
wire:click.prevent="clearSorts"
class="badge badge-pill badge-light"
>
@lang('Clear')
</a>
</div>
@endif
</div>
@elseif ($theme === 'bootstrap-5')
<div>
@if ($component->sortingPillsAreEnabled() && $component->hasSorts())
<div class="mb-3">
<small>@lang('Applied Sorting'):</small>
@foreach($component->getSorts() as $columnSelectName => $direction)
@php
$column = $component->getColumnBySelectName($columnSelectName);
@endphp
@continue(is_null($column))
@continue($column->isHidden())
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
<span
wire:key="sorting-pill-{{ $columnSelectName }}"
class="badge rounded-pill bg-info d-inline-flex align-items-center"
>
{{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirection($component, $direction) }}
<a
href="#"
wire:click="clearSort('{{ $columnSelectName }}')"
class="text-white ms-2"
>
<span class="visually-hidden">@lang('Remove sort option')</span>
<svg style="width:.5em;height:.5em" stroke="currentColor" fill="none" viewBox="0 0 8 8">
<path stroke-linecap="round" stroke-width="1.5" d="M1 1l6 6m0-6L1 7" />
</svg>
</a>
</span>
@endforeach
<a
href="#"
wire:click.prevent="clearSorts"
class="badge rounded-pill bg-light text-dark text-decoration-none"
>
@lang('Clear')
</a>
</div>
@endif
</div>
@endif

View File

@@ -0,0 +1,878 @@
@aware(['component'])
@php
$theme = $component->getTheme();
@endphp
@if ($component->hasConfigurableAreaFor('before-toolbar'))
@include($component->getConfigurableAreaFor('before-toolbar'), $component->getParametersForConfigurableArea('before-toolbar'))
@endif
@if ($theme === 'tailwind')
<div class="md:flex md:justify-between mb-4 px-4 md:p-0">
<div class="w-full mb-4 md:mb-0 md:w-2/4 md:flex space-y-4 md:space-y-0 md:space-x-2">
@if ($component->hasConfigurableAreaFor('toolbar-left-start'))
@include($component->getConfigurableAreaFor('toolbar-left-start'), $component->getParametersForConfigurableArea('toolbar-left-start'))
@endif
@if ($component->reorderIsEnabled())
<button
wire:click="{{ $component->currentlyReorderingIsEnabled() ? 'disableReordering' : 'enableReordering' }}"
type="button"
class="inline-flex justify-center items-center w-full md:w-auto px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:text-gray-500 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 active:bg-gray-50 active:text-gray-800 transition ease-in-out duration-150 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600"
>
@if ($component->currentlyReorderingIsEnabled())
@lang('Done Reordering')
@else
@lang('Reorder')
@endif
</button>
@endif
@if ($component->searchIsEnabled() && $component->searchVisibilityIsEnabled())
<div class="flex rounded-md shadow-sm">
<input
wire:model{{ $component->getSearchOptions() }}="{{ $component->getTableName() }}.search"
placeholder="{{ __('Search') }}"
type="text"
class="block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out sm:text-sm sm:leading-5 dark:bg-gray-700 dark:text-white dark:border-gray-600 @if ($component->hasSearch()) rounded-none rounded-l-md focus:ring-0 focus:border-gray-300 @else focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md @endif"
/>
@if ($component->hasSearch())
<span wire:click.prevent="clearSearch" class="inline-flex items-center px-3 text-gray-500 bg-gray-50 rounded-r-md border border-l-0 border-gray-300 cursor-pointer sm:text-sm dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600">
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</span>
@endif
</div>
@endif
@if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters())
<div
@if ($component->isFilterLayoutPopover())
x-data="{ open: false }"
x-on:keydown.escape.stop="open = false"
x-on:mousedown.away="open = false"
@endif
class="relative block md:inline-block text-left"
>
<div>
<button
type="button"
class="inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600"
@if ($component->isFilterLayoutPopover())
x-on:click="open = !open"
aria-haspopup="true"
x-bind:aria-expanded="open"
aria-expanded="true"
@endif
@if ($component->isFilterLayoutSlideDown())
x-on:click="filtersOpen = !filtersOpen"
@endif
>
@lang('Filters')
@if ($count = $component->getFilterBadgeCount())
<span class="ml-1 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium leading-4 bg-indigo-100 text-indigo-800 capitalize dark:bg-indigo-200 dark:text-indigo-900">
{{ $count }}
</span>
@endif
<svg class="-mr-1 ml-2 h-5 w-5" xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" />
</svg>
</button>
</div>
@if ($component->isFilterLayoutPopover())
<div
x-cloak
x-show="open"
x-transition:enter="transition ease-out duration-100"
x-transition:enter-start="transform opacity-0 scale-95"
x-transition:enter-end="transform opacity-100 scale-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="transform opacity-100 scale-100"
x-transition:leave-end="transform opacity-0 scale-95"
class="origin-top-left absolute left-0 mt-2 w-full md:w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 divide-y divide-gray-100 focus:outline-none z-50 dark:bg-gray-700 dark:text-white dark:divide-gray-600"
role="menu"
aria-orientation="vertical"
aria-labelledby="filters-menu"
>
@foreach($component->getFilters() as $filter)
@if($filter->isVisibleInMenus())
<div class="py-1" role="none">
<div class="block px-4 py-2 text-sm text-gray-700 space-y-1" role="menuitem">
<label for="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
class="block text-sm font-medium leading-5 text-gray-700 dark:text-white">
{{ $filter->getName() }}
</label>
{{ $filter->render($component) }}
</div>
</div>
@endif
@endforeach
@if ($component->hasAppliedVisibleFiltersWithValuesThatCanBeCleared())
<div class="block px-4 py-3 text-sm text-gray-700 dark:text-white" role="menuitem">
<button
wire:click.prevent="setFilterDefaults"
x-on:click="open = false"
type="button"
class="w-full inline-flex items-center justify-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:border-gray-600 dark:text-white dark:hover:border-gray-500"
>
@lang('Clear')
</button>
</div>
@endif
</div>
@endif
</div>
@endif
@if ($component->hasConfigurableAreaFor('toolbar-left-end'))
@include($component->getConfigurableAreaFor('toolbar-left-end'), $component->getParametersForConfigurableArea('toolbar-left-end'))
@endif
</div>
<div class="md:flex md:items-center space-y-4 md:space-y-0 md:space-x-2">
@if ($component->hasConfigurableAreaFor('toolbar-right-start'))
@include($component->getConfigurableAreaFor('toolbar-right-start'), $component->getParametersForConfigurableArea('toolbar-right-start'))
@endif
@if ($component->showBulkActionsDropdown())
<div class="w-full md:w-auto mb-4 md:mb-0">
<div
x-data="{ open: false }"
@keydown.window.escape="open = false"
x-on:click.away="open = false"
class="relative inline-block text-left z-10 w-full md:w-auto"
>
<div>
<span class="rounded-md shadow-sm">
<button
x-on:click="open = !open"
type="button"
class="inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600"
aria-haspopup="true"
x-bind:aria-expanded="open"
aria-expanded="true"
>
@lang('Bulk Actions')
<svg class="-mr-1 ml-2 h-5 w-5" x-description="Heroicon name: chevron-down" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path>
</svg>
</button>
</span>
</div>
<div
x-cloak
x-show="open"
x-transition:enter="transition ease-out duration-100"
x-transition:enter-start="transform opacity-0 scale-95"
x-transition:enter-end="transform opacity-100 scale-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="transform opacity-100 scale-100"
x-transition:leave-end="transform opacity-0 scale-95"
class="origin-top-right absolute right-0 mt-2 w-full md:w-48 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 divide-y divide-gray-100 focus:outline-none z-50"
>
<div class="rounded-md bg-white shadow-xs dark:bg-gray-700 dark:text-white">
<div class="py-1" role="menu" aria-orientation="vertical">
@foreach($component->getBulkActions() as $action => $title)
<button
wire:click="{{ $action }}"
wire:key="bulk-action-{{ $action }}-{{ $component->getTableName() }}"
type="button"
class="block w-full px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900 flex items-center space-x-2 dark:text-white dark:hover:bg-gray-600"
role="menuitem"
>
<span>{{ $title }}</span>
</button>
@endforeach
</div>
</div>
</div>
</div>
</div>
@endif
@if ($component->columnSelectIsEnabled())
<div class="mb-4 w-full md:w-auto md:mb-0 md:ml-2">
<div
x-data="{ open: false }"
@keydown.window.escape="open = false"
x-on:click.away="open = false"
class="inline-block relative w-full text-left md:w-auto"
wire:key="column-select-button-{{ $component->getTableName() }}"
>
<div>
<span class="rounded-md shadow-sm">
<button
x-on:click="open = !open"
type="button"
class="inline-flex justify-center px-4 py-2 w-full text-sm font-medium text-gray-700 bg-white rounded-md border border-gray-300 shadow-sm hover:bg-gray-50 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600"
aria-haspopup="true"
x-bind:aria-expanded="open"
aria-expanded="true"
>
@lang('Columns')
<svg class="-mr-1 ml-2 w-5 h-5" x-description="Heroicon name: chevron-down" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path>
</svg>
</button>
</span>
</div>
<div
x-cloak
x-show="open"
x-transition:enter="transition ease-out duration-100"
x-transition:enter-start="transform opacity-0 scale-95"
x-transition:enter-end="transform opacity-100 scale-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="transform opacity-100 scale-100"
x-transition:leave-end="transform opacity-0 scale-95"
class="absolute right-0 z-50 mt-2 w-full bg-white rounded-md divide-y divide-gray-100 ring-1 ring-black ring-opacity-5 shadow-lg origin-top-right md:w-48 focus:outline-none"
>
<div class="bg-white rounded-md shadow-xs dark:bg-gray-700 dark:text-white">
<div class="p-2" role="menu" aria-orientation="vertical" aria-labelledby="column-select-menu">
<div>
<label
wire:loading.attr="disabled"
class="inline-flex items-center px-2 py-1 disabled:opacity-50 disabled:cursor-wait"
>
<input
class="text-indigo-600 transition duration-150 ease-in-out border-gray-300 rounded shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600 disabled:opacity-50 disabled:cursor-wait"
@if($component->allDefaultVisibleColumnsAreSelected())
checked
wire:click="deselectAllColumns"
@else
unchecked
wire:click="selectAllColumns"
@endif
wire:loading.attr="disabled"
type="checkbox"
/>
<span class="ml-2">{{ __('All Columns') }}</span>
</label>
</div>
@foreach($component->getColumns() as $column)
@if ($column->isVisible() && $column->isSelectable())
<div wire:key="columnSelect-{{ $loop->index }}-{{ $component->getTableName() }}">
<label
wire:loading.attr="disabled"
wire:target="selectedColumns"
class="inline-flex items-center px-2 py-1 disabled:opacity-50 disabled:cursor-wait"
>
<input
class="text-indigo-600 rounded border-gray-300 shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600 disabled:opacity-50 disabled:cursor-wait"
wire:model="selectedColumns"
wire:target="selectedColumns"
wire:loading.attr="disabled"
type="checkbox"
value="{{ $column->getSlug() }}"
/>
<span class="ml-2">{{ $column->getTitle() }}</span>
</label>
</div>
@endif
@endforeach
</div>
</div>
</div>
</div>
</div>
@endif
@if ($component->paginationIsEnabled() && $component->perPageVisibilityIsEnabled())
<div>
<select
wire:model="perPage"
id="perPage"
class="block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out sm:text-sm sm:leading-5 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-700 dark:text-white dark:border-gray-600"
>
@foreach ($component->getPerPageAccepted() as $item)
<option value="{{ $item }}" wire:key="per-page-{{ $item }}-{{ $component->getTableName() }}">{{ $item === -1 ? __('All') : $item }}</option>
@endforeach
</select>
</div>
@endif
@if ($component->hasConfigurableAreaFor('toolbar-right-end'))
@include($component->getConfigurableAreaFor('toolbar-right-end'), $component->getParametersForConfigurableArea('toolbar-right-end'))
@endif
</div>
</div>
@if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters() && $component->isFilterLayoutSlideDown())
<div
x-cloak
x-show="filtersOpen"
x-transition:enter="transition ease-out duration-100"
x-transition:enter-start="transform opacity-0"
x-transition:enter-end="transform opacity-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="transform opacity-100"
x-transition:leave-end="transform opacity-0"
>
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-6 px-4 md:p-0 mb-6">
@foreach($component->getFilters() as $filter)
@if($filter->isVisibleInMenus())
<div class="space-y-1">
<label for="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
class="block text-sm font-medium leading-5 text-gray-700 dark:text-white">
{{ $filter->getName() }}
</label>
{{ $filter->render($component) }}
</div>
@endif
@endforeach
</div>
</div>
@endif
@elseif ($theme === 'bootstrap-4')
<div class="d-md-flex justify-content-between mb-3">
<div class="d-md-flex">
@if ($component->hasConfigurableAreaFor('toolbar-left-start'))
@include($component->getConfigurableAreaFor('toolbar-left-start'), $component->getParametersForConfigurableArea('toolbar-left-start'))
@endif
@if ($component->reorderIsEnabled())
<div class="mr-0 mr-md-2 mb-3 mb-md-0">
<button
wire:click="{{ $component->currentlyReorderingIsEnabled() ? 'disableReordering' : 'enableReordering' }}"
type="button"
class="btn btn-default d-block w-100 d-md-inline"
>
@if ($component->currentlyReorderingIsEnabled())
@lang('Done Reordering')
@else
@lang('Reorder')
@endif
</button>
</div>
@endif
@if ($component->searchIsEnabled() && $component->searchVisibilityIsEnabled())
<div class="mb-3 mb-md-0 input-group">
<input
wire:model{{ $component->getSearchOptions() }}="{{ $component->getTableName() }}.search"
placeholder="{{ __('Search') }}"
type="text"
class="form-control"
>
@if ($component->hasSearch())
<div class="input-group-append">
<button wire:click.prevent="clearSearch" class="btn btn-outline-secondary" type="button">
<svg style="width:.75em;height:.75em" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
@endif
</div>
@endif
@if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters())
<div class="ml-0 ml-md-2 mb-3 mb-md-0">
<div
@if ($component->isFilterLayoutPopover())
x-data="{ open: false }"
x-on:keydown.escape.stop="open = false"
x-on:mousedown.away="open = false"
@endif
class="btn-group d-block d-md-inline"
>
<div>
<button
type="button"
class="btn dropdown-toggle d-block w-100 d-md-inline"
@if ($component->isFilterLayoutPopover())
x-on:click="open = !open"
aria-haspopup="true"
x-bind:aria-expanded="open"
aria-expanded="true"
@endif
@if ($component->isFilterLayoutSlideDown())
x-on:click="filtersOpen = !filtersOpen"
@endif
>
@lang('Filters')
@if ($count = $component->getFilterBadgeCount())
<span class="badge badge-info">
{{ $count }}
</span>
@endif
<span class="caret"></span>
</button>
</div>
@if ($component->isFilterLayoutPopover())
<ul
x-cloak
class="dropdown-menu w-100 mt-md-5"
x-bind:class="{'show' : open}"
role="menu"
>
@foreach($component->getFilters() as $filter)
@if($filter->isVisibleInMenus())
<div wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}" class="p-2">
<label for="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}" class="mb-2">
{{ $filter->getName() }}
</label>
{{ $filter->render($component) }}
</div>
@endif
@endforeach
@if ($component->hasAppliedVisibleFiltersWithValuesThatCanBeCleared())
<div class="dropdown-divider"></div>
<button
wire:click.prevent="setFilterDefaults"
x-on:click="open = false"
class="dropdown-item btn text-center"
>
@lang('Clear')
</button>
@endif
</ul>
@endif
</div>
</div>
@endif
@if ($component->hasConfigurableAreaFor('toolbar-left-end'))
@include($component->getConfigurableAreaFor('toolbar-left-end'), $component->getParametersForConfigurableArea('toolbar-left-end'))
@endif
</div>
<div class="d-md-flex">
@if ($component->hasConfigurableAreaFor('toolbar-right-start'))
@include($component->getConfigurableAreaFor('toolbar-right-start'), $component->getParametersForConfigurableArea('toolbar-right-start'))
@endif
@if ($component->showBulkActionsDropdown())
<div class="mb-3 mb-md-0">
<div class="dropdown d-block d-md-inline">
<button class="btn dropdown-toggle d-block w-100 d-md-inline" type="button" id="{{ $component->getTableName() }}-bulkActionsDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@lang('Bulk Actions')
</button>
<div class="dropdown-menu dropdown-menu-right w-100" aria-labelledby="{{ $component->getTableName() }}-bulkActionsDropdown">
@foreach($component->getBulkActions() as $action => $title)
<a
href="#"
wire:click="{{ $action }}"
wire:key="bulk-action-{{ $action }}-{{ $component->getTableName() }}"
class="dropdown-item"
>
{{ $title }}
</a>
@endforeach
</div>
</div>
</div>
@endif
@if ($component->columnSelectIsEnabled())
<div class="mb-3 mb-md-0 pl-0 pl-md-2">
<div
x-data="{ open: false }"
x-on:keydown.escape.stop="open = false"
x-on:mousedown.away="open = false"
class="dropdown d-block d-md-inline"
wire:key="column-select-button-{{ $component->getTableName() }}"
>
<button
x-on:click="open = !open"
class="btn dropdown-toggle d-block w-100 d-md-inline"
type="button"
id="columnSelect-{{ $component->getTableName() }}"
aria-haspopup="true"
x-bind:aria-expanded="open"
>
@lang('Columns')
</button>
<div
class="dropdown-menu dropdown-menu-right w-100 mt-0 mt-md-3"
x-bind:class="{'show' : open}"
aria-labelledby="columnSelect-{{ $component->getTableName() }}"
>
<div>
<label
wire:loading.attr="disabled"
class="px-2 mb-1"
>
<input
@if($component->allDefaultVisibleColumnsAreSelected())
checked
wire:click="deselectAllColumns"
@else
unchecked
wire:click="selectAllColumns"
@endif
wire:loading.attr="disabled"
type="checkbox"
/>
<span class="ml-2">{{ __('All Columns') }}</span>
</label>
</div>
@foreach($component->getColumns() as $column)
@if ($column->isVisible() && $column->isSelectable())
<div wire:key="columnSelect-{{ $loop->index }}-{{ $component->getTableName() }}">
<label
wire:loading.attr="disabled"
wire:target="selectedColumns"
class="px-2 {{ $loop->last ? 'mb-0' : 'mb-1' }}"
>
<input
wire:model="selectedColumns"
wire:target="selectedColumns"
wire:loading.attr="disabled"
type="checkbox"
value="{{ $column->getSlug() }}"
/>
<span class="ml-2">{{ $column->getTitle() }}</span>
</label>
</div>
@endif
@endforeach
</div>
</div>
</div>
@endif
@if ($component->paginationIsEnabled() && $component->perPageVisibilityIsEnabled())
<div class="ml-0 ml-md-2">
<select
wire:model="perPage"
id="perPage"
class="form-control"
>
@foreach ($component->getPerPageAccepted() as $item)
<option value="{{ $item }}" wire:key="per-page-{{ $item }}-{{ $component->getTableName() }}">{{ $item === -1 ? __('All') : $item }}</option>
@endforeach
</select>
</div>
@endif
@if ($component->hasConfigurableAreaFor('toolbar-right-end'))
@include($component->getConfigurableAreaFor('toolbar-right-end'), $component->getParametersForConfigurableArea('toolbar-right-end'))
@endif
</div>
</div>
@if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters() && $component->isFilterLayoutSlideDown())
<div
x-cloak
x-show="filtersOpen"
>
<div class="container">
<div class="row">
@foreach($component->getFilters() as $filter)
@if($filter->isVisibleInMenus())
<div class="col-12 col-sm-6 col-md-4 col-lg-3 mb-4">
<label for="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
class="d-block">
{{ $filter->getName() }}
</label>
{{ $filter->render($component) }}
</div>
@endif
@endforeach
</div>
</div>
</div>
@endif
@elseif ($theme === 'bootstrap-5')
<div class="d-md-flex justify-content-between mb-3">
<div class="d-md-flex">
@if ($component->hasConfigurableAreaFor('toolbar-left-start'))
@include($component->getConfigurableAreaFor('toolbar-left-start'), $component->getParametersForConfigurableArea('toolbar-left-start'))
@endif
@if ($component->reorderIsEnabled())
<div class="me-0 me-md-2 mb-3 mb-md-0">
<button
wire:click="{{ $component->currentlyReorderingIsEnabled() ? 'disableReordering' : 'enableReordering' }}"
type="button"
class="btn btn-default d-block w-100 d-md-inline"
>
@if ($component->currentlyReorderingIsEnabled())
@lang('Done Reordering')
@else
@lang('Reorder')
@endif
</button>
</div>
@endif
@if ($component->searchIsEnabled() && $component->searchVisibilityIsEnabled())
<div class="mb-3 mb-md-0 input-group">
<input
wire:model{{ $component->getSearchOptions() }}="{{ $component->getTableName() }}.search"
placeholder="{{ __('Search') }}"
type="text"
class="form-control"
>
@if ($component->hasSearch())
<button wire:click.prevent="clearSearch" class="btn btn-outline-secondary" type="button">
<svg style="width:.75em;height:.75em" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
@endif
</div>
@endif
@if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters())
<div class="{{ $component->searchIsEnabled() ? 'ms-0 ms-md-2' : '' }} mb-3 mb-md-0">
<div
@if ($component->isFilterLayoutPopover())
x-data="{ open: false }"
x-on:keydown.escape.stop="open = false"
x-on:mousedown.away="open = false"
@endif
class="btn-group d-block d-md-inline"
>
<div>
<button
type="button"
class="btn dropdown-toggle d-block w-100 d-md-inline"
@if ($component->isFilterLayoutPopover())
x-on:click="open = !open"
aria-haspopup="true"
x-bind:aria-expanded="open"
aria-expanded="true"
@endif
@if ($component->isFilterLayoutSlideDown())
x-on:click="filtersOpen = !filtersOpen"
@endif
>
@lang('Filters')
@if ($count = $component->getFilterBadgeCount())
<span class="badge bg-info">
{{ $count }}
</span>
@endif
<span class="caret"></span>
</button>
</div>
@if ($component->isFilterLayoutPopover())
<ul
x-cloak
class="dropdown-menu w-100"
x-bind:class="{'show' : open}"
role="menu"
>
@foreach($component->getFilters() as $filter)
@if($filter->isVisibleInMenus())
<div wire:key="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}" class="p-2">
<label for="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}" class="mb-2">
{{ $filter->getName() }}
</label>
{{ $filter->render($component) }}
</div>
@endif
@endforeach
@if ($component->hasAppliedVisibleFiltersWithValuesThatCanBeCleared())
<div class="dropdown-divider"></div>
<button
wire:click.prevent="setFilterDefaults"
x-on:click="open = false"
class="dropdown-item text-center"
>
@lang('Clear')
</button>
@endif
</ul>
@endif
</div>
</div>
@endif
@if ($component->hasConfigurableAreaFor('toolbar-left-end'))
@include($component->getConfigurableAreaFor('toolbar-left-end'), $component->getParametersForConfigurableArea('toolbar-left-end'))
@endif
</div>
<div class="d-md-flex">
@if ($component->hasConfigurableAreaFor('toolbar-right-start'))
@include($component->getConfigurableAreaFor('toolbar-right-start'), $component->getParametersForConfigurableArea('toolbar-right-start'))
@endif
@if ($component->showBulkActionsDropdown())
<div class="mb-3 mb-md-0">
<div class="dropdown d-block d-md-inline">
<button class="btn dropdown-toggle d-block w-100 d-md-inline" type="button" id="{{ $component->getTableName() }}-bulkActionsDropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@lang('Bulk Actions')
</button>
<div class="dropdown-menu dropdown-menu-end w-100" aria-labelledby="{{ $component->getTableName() }}-bulkActionsDropdown">
@foreach($component->getBulkActions() as $action => $title)
<a
href="#"
wire:click.prevent="{{ $action }}"
wire:key="bulk-action-{{ $action }}-{{ $component->getTableName() }}"
class="dropdown-item"
>
{{ $title }}
</a>
@endforeach
</div>
</div>
</div>
@endif
@if ($component->columnSelectIsEnabled())
<div class="mb-3 mb-md-0 md-0 ms-md-2">
<div
x-data="{ open: false }"
x-on:keydown.escape.stop="open = false"
x-on:mousedown.away="open = false"
class="dropdown d-block d-md-inline"
wire:key="column-select-button-{{ $component->getTableName() }}"
>
<button
x-on:click="open = !open"
class="btn dropdown-toggle d-block w-100 d-md-inline"
type="button"
id="columnSelect-{{ $component->getTableName() }}"
aria-haspopup="true"
x-bind:aria-expanded="open"
>
@lang('Columns')
</button>
<div
class="dropdown-menu dropdown-menu-end w-100"
x-bind:class="{'show' : open}"
aria-labelledby="columnSelect-{{ $component->getTableName() }}"
>
<div class="form-check ms-2">
<input
@if($component->allDefaultVisibleColumnsAreSelected())
checked
wire:click="deselectAllColumns"
@else
unchecked
wire:click="selectAllColumns"
@endif
wire:loading.attr="disabled"
type="checkbox"
class="form-check-input"
/>
<label
wire:loading.attr="disabled"
class="form-check-label"
>
{{ __('All Columns') }}
</label>
</div>
@foreach($component->getColumns() as $column)
@if ($column->isVisible() && $column->isSelectable())
<div wire:key="columnSelect-{{ $loop->index }}-{{ $component->getTableName() }}"
class="form-check ms-2"
>
<input
wire:model="selectedColumns"
wire:target="selectedColumns"
wire:loading.attr="disabled"
type="checkbox"
class="form-check-input"
value="{{ $column->getSlug() }}"
/>
<label
wire:loading.attr="disabled"
wire:target="selectedColumns"
class="{{ $loop->last ? 'mb-0' : 'mb-1' }} form-check-label"
>{{ $column->getTitle() }}</label>
</label>
</div>
@endif
@endforeach
</div>
</div>
</div>
@endif
@if ($component->paginationIsEnabled() && $component->perPageVisibilityIsEnabled())
<div class="ms-0 ms-md-2">
<select
wire:model="perPage"
id="perPage"
class="form-select"
>
@foreach ($component->getPerPageAccepted() as $item)
<option value="{{ $item }}" wire:key="per-page-{{ $item }}-{{ $component->getTableName() }}">{{ $item === -1 ? __('All') : $item }}</option>
@endforeach
</select>
</div>
@endif
@if ($component->hasConfigurableAreaFor('toolbar-right-end'))
@include($component->getConfigurableAreaFor('toolbar-right-end'), $component->getParametersForConfigurableArea('toolbar-righ-end'))
@endif
</div>
</div>
@if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters() && $component->isFilterLayoutSlideDown())
<div
x-cloak
x-show="filtersOpen"
>
<div class="container">
<div class="row">
@foreach($component->getFilters() as $filter)
@if($filter->isVisibleInMenus())
<div class="col-12 col-sm-6 col-md-4 col-lg-3 mb-4">
<label for="{{ $component->getTableName() }}-filter-{{ $filter->getKey() }}"
class="d-block">
{{ $filter->getName() }}
</label>
{{ $filter->render($component) }}
</div>
@endif
@endforeach
</div>
</div>
</div>
@endif
@endif
@if ($component->hasConfigurableAreaFor('after-toolbar'))
@include($component->getConfigurableAreaFor('after-toolbar'), $component->getParametersForConfigurableArea('after-toolbar'))
@endif

View File

@@ -0,0 +1,23 @@
@props(['component'])
@php
$refresh = $this->getRefreshStatus();
$theme = $component->getTheme();
@endphp
<div
{{ $attributes->merge($this->getComponentWrapperAttributes()) }}
@if ($component->hasRefresh())
wire:poll{{ $component->getRefreshOptions() }}
@endif
@if ($component->isFilterLayoutSlideDown())
x-data="{ filtersOpen: false }"
@endif
>
@include('livewire-tables::includes.debug')
@include('livewire-tables::includes.offline')
{{ $slot }}
</div>