diff --git a/app/Http/Livewire/Admin/Menu/Level.php b/app/Http/Livewire/Admin/Menu/Level.php index c0a429b..a05e799 100644 --- a/app/Http/Livewire/Admin/Menu/Level.php +++ b/app/Http/Livewire/Admin/Menu/Level.php @@ -3,18 +3,30 @@ namespace App\Http\Livewire\Admin\Menu; use App\Models\MenuLevel; +use App\Traits\General; +use Illuminate\Database\Eloquent\Model; use Livewire\Component; class Level extends Component { - public string $pageHeader='Menu Level'; + use General; + + public string $pageHeader = 'Menu Level'; public array $menuLevel; - public function mount(){ + public $editMenuRecord = null; + + protected $listeners = ['editMenuLevel']; + + public function mount() + { + $this->formInfo('create', 'Create', 'Create', 'Create Menu Levels'); + $this->formType = "create"; $this->resetInput(); } - public function resetForm(){ + public function resetForm() + { $this->resetErrorBag(); } @@ -38,21 +50,52 @@ protected function validationAttributes() ]; } - public function resetInput(){ - $this->menuLevel=['name'=>'']; + public function resetInput() + { + $this->menuLevel = ['name' => '']; } + public function editMenuLevel($row) + { + $this->editMenuRecord = MenuLevel::find($row)->first(); + $this->menuLevel['name'] = $this->editMenuRecord->name; + $this->formInfo('update', 'Update', 'Update ' . $this->menuLevel['name'], 'Update ' . $this->menuLevel['name']); + $this->dispatchBrowserEvent('FirstModel', ['show' => true]); + } - public function submit(){ + public function submit() + { $this->validate(); - $level=new MenuLevel(); - $level->name=$this->menuLevel['name']; - $level->save(); - $this->resetForm(); - $this->resetInput(); - $this->dispatchBrowserEvent('FirstModel',['show'=>false]); - $this->dispatchBrowserEvent('Toast',['show'=>true,'type'=>'success','message'=>"'".$level->name."'".' was added to Menu Level!']); + + switch ($this->formType) { + + case 'create': + $level = new MenuLevel(); + $level->name = $this->menuLevel['name']; + $level->save(); + + break; + + case 'update': + $this->editMenuRecord->name = $this->menuLevel['name']; + $this->editMenuRecord->save(); + break; + } + if ($this->formType === 'create' || $this->formType === 'update') { + $this->emit('refreshDatatable'); + $this->resetForm(); + $this->resetInput(); + $this->dispatchBrowserEvent('FirstModel', ['show' => false]); + + if($this->formType === 'update'){ + $this->dispatchBrowserEvent('Toast', ['show' => true, 'type' => 'success', 'message' => "'" . $this->editMenuRecord->name . "'" . ' was updated!']); + }else{ + $this->dispatchBrowserEvent('Toast', ['show' => true, 'type' => 'success', 'message' => "'" . $level->name . "'" . ' was added to Menu Level!']); + } + + } + } public function render() diff --git a/app/Http/Livewire/Admin/Menu/MenuLevelTable.php b/app/Http/Livewire/Admin/Menu/MenuLevelTable.php new file mode 100644 index 0000000..823d470 --- /dev/null +++ b/app/Http/Livewire/Admin/Menu/MenuLevelTable.php @@ -0,0 +1,72 @@ + null, + ]; + + + + + public function configure(): void + { + $this->setPrimaryKey('id') + ->setPerPageAccepted([10, 25, 50, 100]) + ->setPerPage(10) + ->setSortingStatus(true) + ->setSortingPillsStatus(false) + ->setPageName('menu-levels') + ->setPaginationVisibilityStatus(true) + ->setPaginationStatus(true) + ->setDefaultSort('id', 'desc') + ->setQueryStringStatus(false) + -> setUseHeaderAsFooterEnabled(); + } + + + + + public function columns(): array + { + return [ + Column::make("Id", "id") + ->searchable(), + Column::make("Name", "name") + ->searchable() + ->sortable(), + Column::make("Created at", "created_at") + ->sortable(), + Column::make("Updated at", "updated_at") + ->sortable(), + Column::make('Edit') + ->label( + fn($row, Column $column) => 'Edit' + ), + LinkColumn::make('Action') + ->title(fn($row) => 'Edit') + ->location(fn($row) => route('admin.menu', $row)), + Column::make('Name') + ->format( + fn($value, $row, Column $column) => ' + + ' + ) + ->html(), + + ]; + } +} diff --git a/app/Http/Livewire/UserTable.php b/app/Http/Livewire/UserTable.php new file mode 100644 index 0000000..de499f8 --- /dev/null +++ b/app/Http/Livewire/UserTable.php @@ -0,0 +1,34 @@ +setPrimaryKey('id'); + + } + + public function columns(): array + { + return [ + Column::make("Id", "id") + ->sortable(), + Column::make("Name", "name") + ->sortable(), + Column::make("Email", "email") + ->sortable(), + Column::make("Created at", "created_at") + ->sortable(), + Column::make("Updated at", "updated_at") + ->sortable(), + ]; + } +} diff --git a/app/Traits/General.php b/app/Traits/General.php new file mode 100644 index 0000000..403ce7b --- /dev/null +++ b/app/Traits/General.php @@ -0,0 +1,23 @@ +formType = $formType; + $this->buttonName = $buttonName; + $this->submitName = $submitName; + $this->modalHeader = $modalHeader; + break; + } + } +} diff --git a/app/View/Components/Svg/Edit.php b/app/View/Components/Svg/Edit.php new file mode 100644 index 0000000..0ab5b6e --- /dev/null +++ b/app/View/Components/Svg/Edit.php @@ -0,0 +1,28 @@ + 'tailwind', +]; diff --git a/resources/js/components/main.js b/resources/js/components/main.js index 0157dd1..d58005e 100644 --- a/resources/js/components/main.js +++ b/resources/js/components/main.js @@ -32,9 +32,7 @@ export function Main(data) { // First Model window.addEventListener('FirstModel', event => { - if (event.detail.show === false) { - this.isFirstModelButtonClicked = false - } + (event.detail.show === true) ? this.isFirstModelButtonClicked = true : this.isFirstModelButtonClicked = false; }); // Toast diff --git a/resources/views/components/item/button.blade.php b/resources/views/components/item/button.blade.php index 0364d59..56c226e 100644 --- a/resources/views/components/item/button.blade.php +++ b/resources/views/components/item/button.blade.php @@ -1,7 +1,7 @@ @props([ 'size'=>'medium', 'type'=>'button', -'defaultBg'=>'transition-all duration-300 inline-flex justify-center items-center gap-2 rounded-md border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-blue-600 transition-all text-sm dark:bg-oblue-100 dark:hover:bg-oblue-100 dark:border-olblue-800 dark:text-gray-400 dark:hover:text-white dark:focus:ring-offset-oblue-100', +'defaultBg'=>'transition-all duration-300 inline-flex justify-center items-center gap-2 rounded-md border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-blue-600 transition-all text-sm dark:bg-oblue-100 dark:hover:bg-oblue-100 dark:border-olblue-800/[0.5] dark:text-gray-400 dark:hover:text-white dark:focus:ring-offset-oblue-100', 'primaryBg'=>'transition-all duration-300 inline-flex justify-center items-center gap-2 rounded-md border font-medium bg-blue-600 text-gray-100 shadow-sm align-middle hover:bg-blue-700 border-blue-700 dark:border-blue-400 hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-blue-300 transition-all text-sm ' ]) @switch($size) diff --git a/resources/views/components/item/input.blade.php b/resources/views/components/item/input.blade.php index 5f3e87e..3d5b40b 100644 --- a/resources/views/components/item/input.blade.php +++ b/resources/views/components/item/input.blade.php @@ -3,8 +3,8 @@ 'placeholder'=>'', 'size'=>'small', 'sizeSmall'=>'py-2 px-3 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-oblue-300 dark:border-olblue-800/[0.5] dark:text-gray-400', -'sizeMedium'=>'py-2 px-3 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400', -'sizeLarge'=>'y-3 px-4 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 sm:p-5', +'sizeMedium'=>'py-2 px-3 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-oblue-800 dark:border-gray-700 dark:text-gray-400', +'sizeLarge'=>'y-3 px-4 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-oblue-800 dark:border-gray-700 dark:text-gray-400 sm:p-5', ]) merge() }} type="text" id="{{$name}}" placeholder="{{$placeholder}}" name="{{$name}}" diff --git a/resources/views/components/item/modal.blade.php b/resources/views/components/item/modal.blade.php index 197aa8f..5d277b1 100644 --- a/resources/views/components/item/modal.blade.php +++ b/resources/views/components/item/modal.blade.php @@ -10,12 +10,12 @@ @switch($type) - @case('add') + @case('create') @break @case('update') - + @break @case('delete') @@ -55,7 +55,7 @@ class="max-h-full !min-w-full overflow-hidden flex flex-col bg-white border shad

@switch($type) - @case('add') + @case('create') @break diff --git a/resources/views/components/svg/edit.blade.php b/resources/views/components/svg/edit.blade.php new file mode 100644 index 0000000..be66bac --- /dev/null +++ b/resources/views/components/svg/edit.blade.php @@ -0,0 +1,3 @@ +merge(['class' => 'flex-none']) }} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" > + + diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 8982cd2..2a2aceb 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -17,6 +17,9 @@ @vite(['resources/css/app.css', 'resources/js/app.js']) + @livewireStyles diff --git a/resources/views/livewire/admin/menu/level.blade.php b/resources/views/livewire/admin/menu/level.blade.php index ee526be..cbfe4d3 100644 --- a/resources/views/livewire/admin/menu/level.blade.php +++ b/resources/views/livewire/admin/menu/level.blade.php @@ -6,23 +6,22 @@ - - - + +
- +
- +
- - - + +
+ +
- -

diff --git a/resources/views/vendor/livewire-tables/.gitkeep b/resources/views/vendor/livewire-tables/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/vendor/livewire-tables/components/pagination.blade.php b/resources/views/vendor/livewire-tables/components/pagination.blade.php new file mode 100644 index 0000000..5cbc922 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/pagination.blade.php @@ -0,0 +1,106 @@ +@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') +
+ @if ($component->paginationVisibilityIsEnabled()) +
+
+ @if ($component->paginationIsEnabled() && $rows->lastPage() > 1) +

+ @lang('Showing') + {{ $rows->firstItem() }} + @lang('to') + {{ $rows->lastItem() }} + @lang('of') + {{ $rows->total() }} + @lang('results') +

+ @else +

+ @lang('Showing') + {{ $rows->count() }} + @lang('results') +

+ @endif +
+ + @if ($component->paginationIsEnabled()) + {{ $rows->links('livewire-tables::specific.tailwind.pagination') }} + @endif +
+ @endif +
+@elseif ($theme === 'bootstrap-4') +
+ @if ($component->paginationVisibilityIsEnabled()) + @if ($component->paginationIsEnabled() && $rows->lastPage() > 1) +
+
+ {{ $rows->links('livewire-tables::specific.bootstrap-4.pagination') }} +
+ +
+ @lang('Showing') + {{ $rows->count() ? $rows->firstItem() : 0 }} + @lang('to') + {{ $rows->count() ? $rows->lastItem() : 0 }} + @lang('of') + {{ $rows->total() }} + @lang('results') +
+
+ @else +
+
+ @lang('Showing') + {{ $rows->count() }} + @lang('results') +
+
+ @endif + @endif +
+@elseif ($theme === 'bootstrap-5') +
+ @if ($component->paginationVisibilityIsEnabled()) + @if ($component->paginationIsEnabled() && $rows->lastPage() > 1) +
+
+ {{ $rows->links('livewire-tables::specific.bootstrap-4.pagination') }} +
+ +
+ @lang('Showing') + {{ $rows->count() ? $rows->firstItem() : 0 }} + @lang('to') + {{ $rows->count() ? $rows->lastItem() : 0 }} + @lang('of') + {{ $rows->total() }} + @lang('results') +
+
+ @else +
+
+ @lang('Showing') + {{ $rows->count() }} + @lang('results') +
+
+ @endif + @endif +
+@endif + +@if ($component->hasConfigurableAreaFor('after-pagination')) + @include($component->getConfigurableAreaFor('after-pagination'), $component->getParametersForConfigurableArea('after-pagination')) +@endif diff --git a/resources/views/vendor/livewire-tables/components/table.blade.php b/resources/views/vendor/livewire-tables/components/table.blade.php new file mode 100644 index 0000000..0b1c7ef --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table.blade.php @@ -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') +
merge($customAttributes['wrapper']) + ->class([' overflow-y-auto border border-gray-200 dark:border-oblue-100 sm:rounded-xl' => $customAttributes['wrapper']['default'] ?? true]) + ->except('default') + }}> + merge($customAttributes['table']) + ->class(['min-w-full divide-y divide-gray-200 dark:divide-none' => $customAttributes['table']['default'] ?? true]) + ->except('default') + }}> + merge($customAttributes['thead']) + ->class(['bg-transparent' => $customAttributes['thead']['default'] ?? true]) + ->except('default') + }}> + + {{ $thead }} + + + reorderIsEnabled()) + wire:sortable="{{ $component->getReorderMethod() }}" + @endif + + {{ + $attributes->merge($customAttributes['tbody']) + ->class(['bg-white divide-y divide-gray-200 dark:bg-oblue-600 dark:divide-none' => $customAttributes['tbody']['default'] ?? true]) + ->except('default') + }} + > + {{ $slot }} + + + @if (isset($tfoot)) + + {{ $tfoot }} + + @endif +
+
+@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') +
merge($customAttributes['wrapper']) + ->class(['table-responsive' => $customAttributes['wrapper']['default'] ?? true]) + ->except('default') + }}> + merge($customAttributes['table']) + ->class(['table table-striped' => $customAttributes['table']['default'] ?? true]) + ->except('default') + }}> + merge($customAttributes['thead']) + ->class(['' => $customAttributes['thead']['default'] ?? true]) + ->except('default') + }}> + + {{ $thead }} + + + + reorderIsEnabled()) + wire:sortable="{{ $component->getReorderMethod() }}" + @endif + + {{ + $attributes->merge($customAttributes['tbody']) + ->class(['' => $customAttributes['tbody']['default'] ?? true]) + ->except('default') + }} + > + {{ $slot }} + + + @if (isset($tfoot)) + + {{ $tfoot }} + + @endif +
+
+@endif diff --git a/resources/views/vendor/livewire-tables/components/table/empty.blade.php b/resources/views/vendor/livewire-tables/components/table/empty.blade.php new file mode 100644 index 0000000..308b48a --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/empty.blade.php @@ -0,0 +1,22 @@ +@aware(['component']) + +@php + $attributes = $attributes->merge(['wire:key' => 'empty-message-'.$component->id]); + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') + + +
+ {{ $component->getEmptyMessage() }} +
+ + +@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + + + {{ $component->getEmptyMessage() }} + + +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/row-contents.blade.php b/resources/views/vendor/livewire-tables/components/table/row-contents.blade.php new file mode 100644 index 0000000..1d37b8c --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/row-contents.blade.php @@ -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') + + +
+ @foreach($columns as $colIndex => $column) + @continue($column->isHidden()) + @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) + +

+ {{ $column->getTitle() }}: {{ $column->renderContents($row) }} +

+ @endforeach +
+ + + @elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + + +
+ @foreach($columns as $colIndex => $column) + @continue($column->isHidden()) + @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) + +

+ {{ $column->getTitle() }}: {{ $column->renderContents($row) }} +

+ @endforeach +
+ + + @endif +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/td.blade.php b/resources/views/vendor/livewire-tables/components/table/td.blade.php new file mode 100644 index 0000000..3a0beae --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/td.blade.php @@ -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') + isClickable()) + onclick="window.open('{{ $component->getTableRowUrl($row) }}', '{{ $component->getTableRowUrlTarget($row) ?? '_self' }}')" + @endif + + {{ + $attributes->merge($customAttributes) + ->class(['px-6 py-4 whitespace-nowrap border-t dark:border-oblue-100 text-sm font-medium text-gray-600 dark:text-olblue-400' => $customAttributes['default'] ?? true]) + ->class(['hidden sm:table-cell' => $column && $column->shouldCollapseOnMobile()]) + ->class(['hidden md:table-cell' => $column && $column->shouldCollapseOnTablet()]) + ->except('default') + }} + > + {{ $slot }} + +@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + 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 }} + +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/td/bulk-actions.blade.php b/resources/views/vendor/livewire-tables/components/table/td/bulk-actions.blade.php new file mode 100644 index 0000000..57bb4d0 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/td/bulk-actions.blade.php @@ -0,0 +1,31 @@ +@aware(['component']) +@props(['row']) + +@if ($component->bulkActionsAreEnabled() && $component->hasBulkActions()) + @php + $theme = $component->getTheme(); + @endphp + + @if ($theme === 'tailwind') + +
+ +
+
+ @elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + + + + @endif +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/td/plain.blade.php b/resources/views/vendor/livewire-tables/components/table/td/plain.blade.php new file mode 100644 index 0000000..8583c10 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/td/plain.blade.php @@ -0,0 +1,24 @@ +@aware(['component']) +@props(['column' => null, 'customAttributes' => []]) + +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') + 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 }} +@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + merge($customAttributes) + ->class(['' => $customAttributes['default'] ?? true]) + ->class(['none d-sm-table-cell' => $column && $column->shouldCollapseOnMobile()]) + ->class(['none d-md-table-cell' => $column && $column->shouldCollapseOnTablet()]) + ->except('default') + }}>{{ $slot }} +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/td/reorder.blade.php b/resources/views/vendor/livewire-tables/components/table/td/reorder.blade.php new file mode 100644 index 0000000..222fef5 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/td/reorder.blade.php @@ -0,0 +1,21 @@ +@aware(['component']) + +@php + $theme = $component->getTheme(); +@endphp + +@if ($this->currentlyReorderingIsEnabled()) + @if ($theme === 'tailwind') + + + + + + @elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + + + + + + @endif +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/td/row-contents.blade.php b/resources/views/vendor/livewire-tables/components/table/td/row-contents.blade.php new file mode 100644 index 0000000..db155fa --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/td/row-contents.blade.php @@ -0,0 +1,67 @@ +@aware(['component']) +@props(['rowIndex', 'hidden' => false]) + +@if ($component->collapsingColumnsAreEnabled() && $component->hasCollapsedColumns()) + @php + $theme = $component->getTheme(); + @endphp + + @if ($theme === 'tailwind') + 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) + + @endif + + @elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + class([ + 'd-md-none' => + (($component->shouldCollapseOnMobile() && $component->shouldCollapseOnTablet()) || + ($component->shouldCollapseOnTablet() && ! $component->shouldCollapseOnMobile())) + ]) + ->class(['d-sm-none' => $component->shouldCollapseOnMobile() && ! $component->shouldCollapseOnTablet()]) + }} + > + @if (! $hidden) + + @endif + + @endif +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/th.blade.php b/resources/views/vendor/livewire-tables/components/table/th.blade.php new file mode 100644 index 0000000..570a617 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/th.blade.php @@ -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') + merge($customAttributes) + ->class(['px-6 py-3 text-left text-xs font-medium whitespace-nowrap text-gray-500 uppercase tracking-wider bg-gray-100 dark:bg-oblue-500 dark:text-olblue-600' => $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 + + @endunless + +@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + 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 +
+ {{ $column->getTitle() }} + + + @if ($direction === 'asc') + + + + @elseif ($direction === 'desc') + + + + @else + + + + @endif + +
+ @endunless + +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/th/bulk-actions.blade.php b/resources/views/vendor/livewire-tables/components/table/th/bulk-actions.blade.php new file mode 100644 index 0000000..c28339c --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/th/bulk-actions.blade.php @@ -0,0 +1,26 @@ +@aware(['component']) + +@if ($component->bulkActionsAreEnabled() && $component->hasBulkActions()) + @php + $theme = $component->getTheme(); + @endphp + + @if ($theme === 'tailwind') + +
+ +
+
+ @elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + + + + @endif +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/th/plain.blade.php b/resources/views/vendor/livewire-tables/components/table/th/plain.blade.php new file mode 100644 index 0000000..d146928 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/th/plain.blade.php @@ -0,0 +1,11 @@ +@aware(['component']) + +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') + merge(['class' => 'table-cell px-3 py-2 md:px-6 md:py-3 text-center md:text-left bg-gray-50 dark:bg-oblue-700']) }}>{{ $slot }} +@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + {{ $slot }} +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/th/reorder.blade.php b/resources/views/vendor/livewire-tables/components/table/th/reorder.blade.php new file mode 100644 index 0000000..8510862 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/th/reorder.blade.php @@ -0,0 +1,5 @@ +@aware(['component']) + +@if ($this->currentlyReorderingIsEnabled()) + +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/th/row-contents.blade.php b/resources/views/vendor/livewire-tables/components/table/th/row-contents.blade.php new file mode 100644 index 0000000..48febd0 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/th/row-contents.blade.php @@ -0,0 +1,37 @@ +@aware(['component']) + +@if ($component->collapsingColumnsAreEnabled() && $component->hasCollapsedColumns()) + @php + $theme = $component->getTheme(); + @endphp + + @if ($theme === 'tailwind') + merge(['class' => 'table-cell dark:bg-oblue-700']) + ->class([ + 'md:hidden' => + (($component->shouldCollapseOnMobile() && $component->shouldCollapseOnTablet()) || + ($component->shouldCollapseOnTablet() && ! $component->shouldCollapseOnMobile())) + ]) + ->class(['sm:hidden' => $component->shouldCollapseOnMobile() && ! $component->shouldCollapseOnTablet()]) + }} + > + @elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + 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()]) + }} + > + @endif +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/tr.blade.php b/resources/views/vendor/livewire-tables/components/table/tr.blade.php new file mode 100644 index 0000000..19253de --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/tr.blade.php @@ -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') + reorderIsEnabled() && $component->currentlyReorderingIsEnabled()) + wire:sortable.item="{{ $row->getKey() }}" + @endif + + {{ + $attributes->merge($customAttributes) + ->class(['bg-white dark:bg-oblue-400 dark:text-white' => ($customAttributes['default'] ?? true) && $rowIndex % 2 === 0]) + ->class(['bg-gray-50 dark:bg-oblue-500 dark:text-white' => ($customAttributes['default'] ?? true) && $rowIndex % 2 !== 0]) + ->class(['cursor-pointer' => $component->hasTableRowUrl()]) + ->except('default') + }} + > + {{ $slot }} + +@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + 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 }} + +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/tr/bulk-actions.blade.php b/resources/views/vendor/livewire-tables/components/table/tr/bulk-actions.blade.php new file mode 100644 index 0000000..744fd3c --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/tr/bulk-actions.blade.php @@ -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') + + + @if ($selectAll) +
+ + @lang('You are currently selecting all') + {{ number_format($rows->total()) }} + @lang('rows'). + + + +
+ @else +
+ + @lang('You have selected') + {{ $selected }} + @lang('rows, do you want to select all') + {{ number_format($rows->total()) }}? + + + + + +
+ @endif +
+
+ @elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + + + @if ($selectAll) +
+ + @lang('You are currently selecting all') + {{ number_format($rows->total()) }} + @lang('rows'). + + + +
+ @else +
+ + @lang('You have selected') + {{ $selected }} + @lang('rows, do you want to select all') + {{ number_format($rows->total()) }}? + + + + + +
+ @endif +
+
+ @endif +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/tr/footer.blade.php b/resources/views/vendor/livewire-tables/components/table/tr/footer.blade.php new file mode 100644 index 0000000..43bbd5a --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/tr/footer.blade.php @@ -0,0 +1,30 @@ +@aware(['component']) +@props(['rows']) + + + + @if ($this->currentlyReorderingIsEnabled()) + + @endif + + @if ($this->bulkActionsAreEnabled() && $this->hasBulkActions()) + + @endif + + @if ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns()) + + @endif + + @foreach($this->getColumns() as $colIndex => $column) + @continue($column->isHidden()) + @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) + @continue($this->currentlyReorderingIsDisabled() && $column->isReorderColumn() && $this->hideReorderColumnUnlessReorderingIsEnabled()) + + + {{ $column->getFooterContents($rows) }} + + @endforeach + \ No newline at end of file diff --git a/resources/views/vendor/livewire-tables/components/table/tr/plain.blade.php b/resources/views/vendor/livewire-tables/components/table/tr/plain.blade.php new file mode 100644 index 0000000..91038e6 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/tr/plain.blade.php @@ -0,0 +1,24 @@ +@aware(['component']) +@props(['customAttributes' => []]) + +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') + merge($customAttributes) + ->class(['bg-white dark:bg-gray-700 dark:text-white' => $customAttributes['default'] ?? true]) + ->except('default') + }}> + {{ $slot }} + +@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + merge($customAttributes) + ->class(['' => $customAttributes['default'] ?? true]) + ->except('default') + }}> + {{ $slot }} + +@endif diff --git a/resources/views/vendor/livewire-tables/components/table/tr/secondary-header.blade.php b/resources/views/vendor/livewire-tables/components/table/tr/secondary-header.blade.php new file mode 100644 index 0000000..b34e35e --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/table/tr/secondary-header.blade.php @@ -0,0 +1,30 @@ +@aware(['component']) +@props(['rows']) + + + + @if ($this->currentlyReorderingIsEnabled()) + + @endif + + @if ($this->bulkActionsAreEnabled() && $this->hasBulkActions()) + + @endif + + @if ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns()) + + @endif + + @foreach($this->getColumns() as $colIndex => $column) + @continue($column->isHidden()) + @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) + @continue($this->currentlyReorderingIsDisabled() && $column->isReorderColumn() && $this->hideReorderColumnUnlessReorderingIsEnabled()) + + + {{ $column->getSecondaryHeaderContents($rows) }} + + @endforeach + \ No newline at end of file diff --git a/resources/views/vendor/livewire-tables/components/tools.blade.php b/resources/views/vendor/livewire-tables/components/tools.blade.php new file mode 100644 index 0000000..24c3c0e --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/tools.blade.php @@ -0,0 +1,15 @@ +@aware(['component']) + +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') +
+ {{ $slot }} +
+@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') +
+ {{ $slot }} +
+@endif diff --git a/resources/views/vendor/livewire-tables/components/tools/filter-pills.blade.php b/resources/views/vendor/livewire-tables/components/tools/filter-pills.blade.php new file mode 100644 index 0000000..7270f28 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/tools/filter-pills.blade.php @@ -0,0 +1,137 @@ +@aware(['component']) + +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') +
+ @if ($component->filtersAreEnabled() && $component->filterPillsAreEnabled() && $component->hasAppliedVisibleFiltersForPills()) +
+ @lang('Applied Filters'): + + @foreach($component->getAppliedFiltersWithValues() as $filterSelectName => $value) + @php + $filter = $component->getFilterByKey($filterSelectName); + @endphp + + @continue(is_null($filter)) + @continue($filter->isHiddenFromPills()) + + + {{ $filter->getFilterPillTitle() }}: {{ $filter->getFilterPillValue($value) }} + + + + @endforeach + + +
+ @endif +
+@elseif ($theme === 'bootstrap-4') +
+ @if ($component->filtersAreEnabled() && $component->filterPillsAreEnabled() && $component->hasAppliedVisibleFiltersForPills()) +
+ @lang('Applied Filters'): + + @foreach($component->getAppliedFiltersWithValues() as $filterSelectName => $value) + @php + $filter = $component->getFilterByKey($filterSelectName); + @endphp + + @continue(is_null($filter)) + @continue($filter->isHiddenFromPills()) + + + {{ $filter->getFilterPillTitle() }}: {{ $filter->getFilterPillValue($value) }} + + + @lang('Remove filter option') + + + + + + @endforeach + + + @lang('Clear') + +
+ @endif +
+@elseif ($theme === 'bootstrap-5') +
+ @if ($component->filtersAreEnabled() && $component->filterPillsAreEnabled() && $component->hasAppliedVisibleFiltersForPills()) +
+ @lang('Applied Filters'): + + @foreach($component->getAppliedFiltersWithValues() as $filterSelectName => $value) + @php + $filter = $component->getFilterByKey($filterSelectName); + @endphp + + @continue(is_null($filter)) + @continue($filter->isHiddenFromPills()) + + + {{ $filter->getFilterPillTitle() }}: {{ $filter->getFilterPillValue($value) }} + + + @lang('Remove filter option') + + + + + + @endforeach + + + @lang('Clear') + +
+ @endif +
+@endif diff --git a/resources/views/vendor/livewire-tables/components/tools/filters/date.blade.php b/resources/views/vendor/livewire-tables/components/tools/filters/date.blade.php new file mode 100644 index 0000000..1541167 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/tools/filters/date.blade.php @@ -0,0 +1,29 @@ +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') +
+ 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" + /> +
+@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') +
+ hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif + @if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif + class="form-control" + /> +
+@endif diff --git a/resources/views/vendor/livewire-tables/components/tools/filters/datetime.blade.php b/resources/views/vendor/livewire-tables/components/tools/filters/datetime.blade.php new file mode 100644 index 0000000..74a57b1 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/tools/filters/datetime.blade.php @@ -0,0 +1,29 @@ +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') +
+ 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" + /> +
+@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') +
+ hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif + @if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif + class="form-control" + /> +
+@endif diff --git a/resources/views/vendor/livewire-tables/components/tools/filters/multi-select.blade.php b/resources/views/vendor/livewire-tables/components/tools/filters/multi-select.blade.php new file mode 100644 index 0000000..01f42d4 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/tools/filters/multi-select.blade.php @@ -0,0 +1,60 @@ +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') +
+
+ 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" + > + +
+ + @foreach($filter->getOptions() as $key => $value) +
+ 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" + > + +
+ @endforeach +
+@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') +
+ getAppliedFilterWithValue($filter->getKey()) ?? []) === count($filter->getOptions()) ? 'checked' : ''}} + class="form-check-input" + > + +
+ + @foreach($filter->getOptions() as $key => $value) +
+ + +
+ @endforeach +@endif diff --git a/resources/views/vendor/livewire-tables/components/tools/filters/number.blade.php b/resources/views/vendor/livewire-tables/components/tools/filters/number.blade.php new file mode 100644 index 0000000..eba2665 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/tools/filters/number.blade.php @@ -0,0 +1,29 @@ +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') +
+ 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" + /> +
+@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') +
+ hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif + @if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif + class="form-control" + /> +
+@endif diff --git a/resources/views/vendor/livewire-tables/components/tools/filters/select.blade.php b/resources/views/vendor/livewire-tables/components/tools/filters/select.blade.php new file mode 100644 index 0000000..564f109 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/tools/filters/select.blade.php @@ -0,0 +1,29 @@ +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') +
+ +
+@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + +@endif diff --git a/resources/views/vendor/livewire-tables/components/tools/filters/text-field.blade.php b/resources/views/vendor/livewire-tables/components/tools/filters/text-field.blade.php new file mode 100644 index 0000000..73edc44 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/tools/filters/text-field.blade.php @@ -0,0 +1,29 @@ +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') +
+ 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" + /> +
+@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') +
+ hasConfig('placeholder')) placeholder="{{ $filter->getConfig('placeholder') }}" @endif + @if($filter->hasConfig('maxlength')) maxlength="{{ $filter->getConfig('maxlength') }}" @endif + class="form-control" + /> +
+@endif diff --git a/resources/views/vendor/livewire-tables/components/tools/sorting-pills.blade.php b/resources/views/vendor/livewire-tables/components/tools/sorting-pills.blade.php new file mode 100644 index 0000000..4310df0 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/tools/sorting-pills.blade.php @@ -0,0 +1,140 @@ +@aware(['component']) + +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') +
+ @if ($component->sortingPillsAreEnabled() && $component->hasSorts()) +
+ @lang('Applied Sorting'): + + @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)) + + + {{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirection($component, $direction) }} + + + + @endforeach + + +
+ @endif +
+@elseif ($theme === 'bootstrap-4') +
+ @if ($component->sortingPillsAreEnabled() && $component->hasSorts()) +
+ @lang('Applied Sorting'): + + @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)) + + + {{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirection($component, $direction) }} + + + @lang('Remove sort option') + + + + + + @endforeach + + + @lang('Clear') + +
+ @endif +
+@elseif ($theme === 'bootstrap-5') +
+ @if ($component->sortingPillsAreEnabled() && $component->hasSorts()) +
+ @lang('Applied Sorting'): + + @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)) + + + {{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirection($component, $direction) }} + + + @lang('Remove sort option') + + + + + + @endforeach + + + @lang('Clear') + +
+ @endif +
+@endif diff --git a/resources/views/vendor/livewire-tables/components/tools/toolbar.blade.php b/resources/views/vendor/livewire-tables/components/tools/toolbar.blade.php new file mode 100644 index 0000000..b71b8d2 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/tools/toolbar.blade.php @@ -0,0 +1,877 @@ +@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') +
+
+ @if ($component->hasConfigurableAreaFor('toolbar-left-start')) + @include($component->getConfigurableAreaFor('toolbar-left-start'), $component->getParametersForConfigurableArea('toolbar-left-start')) + @endif + + @if ($component->reorderIsEnabled()) + + @endif + + @if ($component->searchIsEnabled() && $component->searchVisibilityIsEnabled()) +
+ + getSearchOptions() }}="{{ $component->getTableName() }}.search" + placeholder="{{ __('Search') }}" + type="text" + class="py-2 px-3 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-oblue-100 dark:border-olblue-800/[0.5] dark:text-gray-400 @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()) + + + + + + @endif +
+ @endif + + @if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters()) +
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" + > +
+ +
+ + @if ($component->isFilterLayoutPopover()) + + @endif +
+ @endif + + @if ($component->hasConfigurableAreaFor('toolbar-left-end')) + @include($component->getConfigurableAreaFor('toolbar-left-end'), $component->getParametersForConfigurableArea('toolbar-left-end')) + @endif +
+ +
+ @if ($component->hasConfigurableAreaFor('toolbar-right-start')) + @include($component->getConfigurableAreaFor('toolbar-right-start'), $component->getParametersForConfigurableArea('toolbar-right-start')) + @endif + + @if ($component->showBulkActionsDropdown()) +
+
+
+ + + +
+ +
+
+ +
+
+
+
+ @endif + + @if ($component->columnSelectIsEnabled()) +
+
+
+ + + +
+ +
+
+ +
+
+
+
+ @endif + + @if ($component->paginationIsEnabled() && $component->perPageVisibilityIsEnabled()) +
+ +
+ @endif + + @if ($component->hasConfigurableAreaFor('toolbar-right-end')) + @include($component->getConfigurableAreaFor('toolbar-right-end'), $component->getParametersForConfigurableArea('toolbar-right-end')) + @endif +
+
+ + @if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters() && $component->isFilterLayoutSlideDown()) +
+
+ @foreach($component->getFilters() as $filter) + @if($filter->isVisibleInMenus()) +
+ + + {{ $filter->render($component) }} +
+ @endif + @endforeach +
+
+ @endif +@elseif ($theme === 'bootstrap-4') +
+
+ @if ($component->hasConfigurableAreaFor('toolbar-left-start')) + @include($component->getConfigurableAreaFor('toolbar-left-start'), $component->getParametersForConfigurableArea('toolbar-left-start')) + @endif + + @if ($component->reorderIsEnabled()) +
+ +
+ @endif + + @if ($component->searchIsEnabled() && $component->searchVisibilityIsEnabled()) +
+ getSearchOptions() }}="{{ $component->getTableName() }}.search" + placeholder="{{ __('Search') }}" + type="text" + class="form-control" + > + + @if ($component->hasSearch()) +
+ +
+ @endif +
+ @endif + + @if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters()) +
+
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" + > +
+ +
+ + @if ($component->isFilterLayoutPopover()) + + @endif +
+
+ @endif + + @if ($component->hasConfigurableAreaFor('toolbar-left-end')) + @include($component->getConfigurableAreaFor('toolbar-left-end'), $component->getParametersForConfigurableArea('toolbar-left-end')) + @endif +
+ +
+ @if ($component->hasConfigurableAreaFor('toolbar-right-start')) + @include($component->getConfigurableAreaFor('toolbar-right-start'), $component->getParametersForConfigurableArea('toolbar-right-start')) + @endif + + @if ($component->showBulkActionsDropdown()) +
+ +
+ @endif + + @if ($component->columnSelectIsEnabled()) +
+ +
+ @endif + + @if ($component->paginationIsEnabled() && $component->perPageVisibilityIsEnabled()) +
+ +
+ @endif + + @if ($component->hasConfigurableAreaFor('toolbar-right-end')) + @include($component->getConfigurableAreaFor('toolbar-right-end'), $component->getParametersForConfigurableArea('toolbar-right-end')) + @endif +
+
+ + @if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters() && $component->isFilterLayoutSlideDown()) +
+
+
+ @foreach($component->getFilters() as $filter) + @if($filter->isVisibleInMenus()) +
+ + + {{ $filter->render($component) }} +
+ @endif + @endforeach +
+
+
+ @endif +@elseif ($theme === 'bootstrap-5') +
+
+ @if ($component->hasConfigurableAreaFor('toolbar-left-start')) + @include($component->getConfigurableAreaFor('toolbar-left-start'), $component->getParametersForConfigurableArea('toolbar-left-start')) + @endif + + @if ($component->reorderIsEnabled()) +
+ +
+ @endif + + @if ($component->searchIsEnabled() && $component->searchVisibilityIsEnabled()) +
+ getSearchOptions() }}="{{ $component->getTableName() }}.search" + placeholder="{{ __('Search') }}" + type="text" + class="form-control" + > + + @if ($component->hasSearch()) + + @endif +
+ @endif + + @if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters()) +
+
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" + > +
+ +
+ + @if ($component->isFilterLayoutPopover()) + + @endif +
+
+ @endif + + @if ($component->hasConfigurableAreaFor('toolbar-left-end')) + @include($component->getConfigurableAreaFor('toolbar-left-end'), $component->getParametersForConfigurableArea('toolbar-left-end')) + @endif +
+ +
+ @if ($component->hasConfigurableAreaFor('toolbar-right-start')) + @include($component->getConfigurableAreaFor('toolbar-right-start'), $component->getParametersForConfigurableArea('toolbar-right-start')) + @endif + + @if ($component->showBulkActionsDropdown()) +
+ +
+ @endif + + @if ($component->columnSelectIsEnabled()) +
+ +
+ @endif + + @if ($component->paginationIsEnabled() && $component->perPageVisibilityIsEnabled()) +
+ +
+ @endif + + @if ($component->hasConfigurableAreaFor('toolbar-right-end')) + @include($component->getConfigurableAreaFor('toolbar-right-end'), $component->getParametersForConfigurableArea('toolbar-righ-end')) + @endif +
+
+ + @if ($component->filtersAreEnabled() && $component->filtersVisibilityIsEnabled() && $component->hasVisibleFilters() && $component->isFilterLayoutSlideDown()) +
+
+
+ @foreach($component->getFilters() as $filter) + @if($filter->isVisibleInMenus()) +
+ + + {{ $filter->render($component) }} +
+ @endif + @endforeach +
+
+
+ @endif +@endif + +@if ($component->hasConfigurableAreaFor('after-toolbar')) + @include($component->getConfigurableAreaFor('after-toolbar'), $component->getParametersForConfigurableArea('after-toolbar')) +@endif diff --git a/resources/views/vendor/livewire-tables/components/wrapper.blade.php b/resources/views/vendor/livewire-tables/components/wrapper.blade.php new file mode 100644 index 0000000..d988613 --- /dev/null +++ b/resources/views/vendor/livewire-tables/components/wrapper.blade.php @@ -0,0 +1,23 @@ +@props(['component']) + +@php + $refresh = $this->getRefreshStatus(); + $theme = $component->getTheme(); +@endphp + +
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 }} +
diff --git a/resources/views/vendor/livewire-tables/datatable.blade.php b/resources/views/vendor/livewire-tables/datatable.blade.php new file mode 100644 index 0000000..65cdb6b --- /dev/null +++ b/resources/views/vendor/livewire-tables/datatable.blade.php @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + @foreach($columns as $index => $column) + @continue($column->isHidden()) + @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) + @continue($this->currentlyReorderingIsDisabled() && $column->isReorderColumn() && $this->hideReorderColumnUnlessReorderingIsEnabled()) + + + @endforeach + + + @if($this->secondaryHeaderIsEnabled() && $this->hasColumnsWithSecondaryHeader()) + + @endif + + + + @forelse ($rows as $rowIndex => $row) + + + + + + @foreach($columns as $colIndex => $column) + @continue($column->isHidden()) + @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) + @continue($this->currentlyReorderingIsDisabled() && $column->isReorderColumn() && $this->hideReorderColumnUnlessReorderingIsEnabled()) + + + {{ $column->renderContents($row) }} + + @endforeach + + + + @empty + + @endforelse + + @if ($this->footerIsEnabled() && $this->hasColumnsWithFooter()) + + @if ($this->useHeaderAsFooterIsEnabled()) + + @else + + @endif + + @endif + + + + + @isset($customView) + @include($customView) + @endisset + diff --git a/resources/views/vendor/livewire-tables/includes/columns/boolean.blade.php b/resources/views/vendor/livewire-tables/includes/columns/boolean.blade.php new file mode 100644 index 0000000..f959f22 --- /dev/null +++ b/resources/views/vendor/livewire-tables/includes/columns/boolean.blade.php @@ -0,0 +1,57 @@ +@php + $theme = $component->getTheme(); +@endphp + +@if ($theme === 'tailwind') + @if ($status) + @if ($type === 'icons') + + + + @elseif ($type === 'yes-no') + @if ($successValue === true) + Yes + @else + No + @endif + @endif + @else + @if ($type === 'icons') + + + + @elseif ($type === 'yes-no') + @if ($successValue === false) + Yes + @else + No + @endif + @endif + @endif +@elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') + @if ($status) + @if ($type === 'icons') + + + + @elseif ($type === 'yes-no') + @if ($successValue === true) + Yes + @else + No + @endif + @endif + @else + @if ($type === 'icons') + + + + @elseif ($type === 'yes-no') + @if ($successValue === false) + Yes + @else + No + @endif + @endif + @endif +@endif diff --git a/resources/views/vendor/livewire-tables/includes/columns/button-group.blade.php b/resources/views/vendor/livewire-tables/includes/columns/button-group.blade.php new file mode 100644 index 0000000..7859611 --- /dev/null +++ b/resources/views/vendor/livewire-tables/includes/columns/button-group.blade.php @@ -0,0 +1,5 @@ +
arrayToAttributes($attributes) : '' !!}> + @foreach($buttons as $button) + {!! $button->getContents($row) !!} + @endforeach +
\ No newline at end of file diff --git a/resources/views/vendor/livewire-tables/includes/columns/image.blade.php b/resources/views/vendor/livewire-tables/includes/columns/image.blade.php new file mode 100644 index 0000000..ab680db --- /dev/null +++ b/resources/views/vendor/livewire-tables/includes/columns/image.blade.php @@ -0,0 +1 @@ +arrayToAttributes($attributes) : '' !!} /> \ No newline at end of file diff --git a/resources/views/vendor/livewire-tables/includes/columns/link.blade.php b/resources/views/vendor/livewire-tables/includes/columns/link.blade.php new file mode 100644 index 0000000..6033317 --- /dev/null +++ b/resources/views/vendor/livewire-tables/includes/columns/link.blade.php @@ -0,0 +1 @@ +arrayToAttributes($attributes) : '' !!}>{{ $title }} \ No newline at end of file diff --git a/resources/views/vendor/livewire-tables/includes/debug.blade.php b/resources/views/vendor/livewire-tables/includes/debug.blade.php new file mode 100644 index 0000000..d5e295d --- /dev/null +++ b/resources/views/vendor/livewire-tables/includes/debug.blade.php @@ -0,0 +1,20 @@ +
+ @if ($component->debugIsEnabled()) + @php + $debuggable = [ + 'query' => $component->getQuerySql(), + 'filters' => $component->getAppliedFilters(), + 'sorts' => $component->getSorts(), + 'search' => $component->getSearch(), + 'select-all' => $component->getSelectAllStatus(), + 'selected' => $component->getSelected(), + ]; + @endphp + +

@lang('Debugging Values'):

+ + @if (! app()->runningInConsole()) +
@dump($debuggable)
+ @endif + @endif +
diff --git a/resources/views/vendor/livewire-tables/includes/offline.blade.php b/resources/views/vendor/livewire-tables/includes/offline.blade.php new file mode 100644 index 0000000..30c9ad6 --- /dev/null +++ b/resources/views/vendor/livewire-tables/includes/offline.blade.php @@ -0,0 +1,30 @@ +@if ($component->offlineIndicatorIsEnabled()) + @if ($theme === 'tailwind') + + @elseif ($theme === 'bootstrap-4' || $theme === 'bootstrap-5') +
+
+ + + + + @lang('You are not connected to the internet.') +
+
+ @endif +@endif diff --git a/resources/views/vendor/livewire-tables/specific/bootstrap-4/pagination.blade.php b/resources/views/vendor/livewire-tables/specific/bootstrap-4/pagination.blade.php new file mode 100644 index 0000000..95a14bc --- /dev/null +++ b/resources/views/vendor/livewire-tables/specific/bootstrap-4/pagination.blade.php @@ -0,0 +1,50 @@ +
+ @if ($paginator->hasPages()) + @php(isset($this->numberOfPaginatorsRendered[$paginator->getPageName()]) ? $this->numberOfPaginatorsRendered[$paginator->getPageName()]++ : $this->numberOfPaginatorsRendered[$paginator->getPageName()] = 1) + + + @endif +
\ No newline at end of file diff --git a/resources/views/vendor/livewire-tables/specific/tailwind/pagination.blade.php b/resources/views/vendor/livewire-tables/specific/tailwind/pagination.blade.php new file mode 100644 index 0000000..fa14d70 --- /dev/null +++ b/resources/views/vendor/livewire-tables/specific/tailwind/pagination.blade.php @@ -0,0 +1,104 @@ +
+ @if ($paginator->hasPages()) + @php(isset($this->numberOfPaginatorsRendered[$paginator->getPageName()]) ? $this->numberOfPaginatorsRendered[$paginator->getPageName()]++ : $this->numberOfPaginatorsRendered[$paginator->getPageName()] = 1) + + + @endif +
diff --git a/resources/views/vendor/livewire-tables/stubs/custom.blade.php b/resources/views/vendor/livewire-tables/stubs/custom.blade.php new file mode 100644 index 0000000..e69de29 diff --git a/tailwind.config.js b/tailwind.config.js index 045cb02..657e868 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -9,7 +9,9 @@ module.exports = { './storage/framework/views/*.php', './resources/views/**/*.blade.php', './node_modules/preline/dist/*.js', + './vendor/rappasoft/laravel-livewire-tables/resources/views/**/*.blade.php', ], + tailwindConfig: './styles/tailwind.config.js', darkMode: 'class', variants: {