-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* v3 - Fix - Correct setFilter behaviour (#1451) * Fix for setFilter * Update return types --------- Co-authored-by: lrljoe <[email protected]> * Fixes for missing brackets (#1455) * v3 Toolbar - Splitting of Views/Blades (#1454) * Initial Commit - Full Split of Toolbar * Remove Confirms Code * Fix superfluous endif * Combining Blades - Stage 1 * More Merging * Bulk Actions - Icon Adjustment * Further clean up of toolbar - filter button * Stripping Toolbar Theme Distinctions * Adjust childElementOpen to respect hierachy * To remove files * Merge Column-Select into Single Blade * Clean Up Blades * Fix missing BootStrap Classes from Toolbar Blade (#1466) * Adding x-cloak where it is missing for x-show (#1463) * V3 - QueryString migration into Traits (#1465) * Initial migration of queryString to Traits * Lock $queryStringStatus * Return empty arrays for Traits * Add WithQueryString Trait * Add Config/Helper Traits to WithQueryString * Add default queryStringStatus --------- Co-authored-by: lrljoe <[email protected]> * Update Changelog (#1467) * v3 DateRange - Icon Styling, FilterHelper Method (#1490) * DateRange - Icon Styling, FilterHelper Method * Add can_get_datestring test * Add non-array test for DateRangeFilter --------- Co-authored-by: lrljoe <[email protected]> * V3 DateRangeFilter - Remove Icon, Add Placeholder (#1492) * Remove DateRangeFilter Icon * DateRangeFilter - Remove Icon & Add Placeholder * Use FilterHelper method to generate wire:key, add placeholder with docs (#1493) * For all Filters (Except MultiSelect currently), use the FilterHelper method to generate the wire:key rather than doing it in the blade. This centralises for future updates MultiSelectFilter will follow in due course, as it requires some tidying & updates. * Add placeholder config option to: DateRangeFilter, DateFilter, DateTimeFilter, NumberFilter and update docs to reflect the availability of the option * Clean up classes on Filters * Minor tweaks to toolbar/column select styling (#1494) --------- Co-authored-by: lrljoe <[email protected]>
- Loading branch information
Showing
20 changed files
with
304 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 21 additions & 47 deletions
68
resources/views/components/tools/filters/date-range.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,27 @@ | ||
@php | ||
$filterKey = $filter->getKey(); | ||
$filterConfigs = $filter->getConfigs(); | ||
$dateString = ''; | ||
$dateInput = isset($this->filters[$filterKey]) ? $this->filters[$filterKey] : ''; | ||
if ($dateInput != '') { | ||
if (is_array($dateInput)) { | ||
$startDate = isset($dateInput['minDate']) ? $dateInput['minDate'] : (isset($dateInput[1]) ? $dateInput[1] : date('Y-m-d')); | ||
$endDate = isset($dateInput['maxDate']) ? $dateInput['maxDate'] : (isset($dateInput[0]) ? $dateInput[0] : date('Y-m-d')); | ||
$dateString = $startDate . ' to ' . $endDate; | ||
} else { | ||
$dateArray = explode(',', $dateInput); | ||
$startDate = isset($dateArray[0]) ? $dateArray[0] : date('Y-m-d'); | ||
$endDate = isset($dateArray[2]) ? $dateArray[2] : date('Y-m-d'); | ||
$dateString = $startDate . ' to ' . $endDate; | ||
} | ||
} | ||
@endphp | ||
|
||
<div x-cloak id="{{ $tableName }}-dateRangeFilter-{{ $filterKey }}" x-data="flatpickrFilter($wire, '{{ $filterKey }}', @js($filter->getConfigs()), $refs.dateRangeInput, '{{ App::currentLocale() }}')" > | ||
|
||
|
||
<div> | ||
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap /> | ||
|
||
|
||
<div | ||
@class([ | ||
'w-full rounded-md shadow-sm text-right' => $isTailwind, | ||
'd-inline-block w-100 mb-3 mb-md-0 input-group' => $isBootstrap, | ||
]) | ||
> | ||
<input | ||
type="text" | ||
x-ref="dateRangeInput" | ||
x-on:click="init" | ||
value="{{ $dateString }}" | ||
wire:key="{{ $tableName }}-filter-dateRange-{{ $filterKey }}" | ||
id="{{ $tableName }}-filter-dateRange-{{ $filterKey }}" | ||
@class([ | ||
'w-full inline transition duration-150 ease-in-out border-gray-300 rounded-md shadow-sm 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' => $isTailwind, | ||
'd-inline-block form-control w-100 pr-2 transition duration-150 ease-in-out border border-gray rounded-sm shadow-sm 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' => $isBootstrap, | ||
]) | ||
/> | ||
|
||
<x-heroicon-o-calendar-days class="w-3 h-3 group-hover:opacity-0" /> | ||
|
||
</div> | ||
|
||
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap /> | ||
<div | ||
@class([ | ||
'w-full rounded-md shadow-sm text-left ' => $isTailwind, | ||
'd-inline-block w-100 mb-3 mb-md-0 input-group' => $isBootstrap, | ||
]) | ||
> | ||
<input | ||
type="text" | ||
x-ref="dateRangeInput" | ||
x-on:click="init" | ||
value="{{ $filter->getDateString(isset($this->appliedFilters[$filterKey]) ? $this->appliedFilters[$filterKey] : '') }}" | ||
wire:key="{{ $filter->generateWireKey($tableName, 'dateRange') }}" | ||
id="{{ $tableName }}-filter-dateRange-{{ $filterKey }}" | ||
@class([ | ||
'w-full inline-block align-middle transition duration-150 ease-in-out 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' => $isTailwind, | ||
'd-inline-block w-100 form-control' => $isBootstrap, | ||
]) | ||
@if($filter->hasConfig('placeholder')) placeholder="{{ $filter->getConfig('placeholder') }}" @endif | ||
/> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.