From f8502cff575dda76c284600237e0a2d18a6fea69 Mon Sep 17 00:00:00 2001 From: lrljoe Date: Sat, 18 Mar 2023 04:01:13 +0000 Subject: [PATCH 1/8] Test Fixes - AdvanedFilterTest --- .../Helpers/AdvancedFilterHelpersTest.php | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/tests/Standard/Traits/Helpers/AdvancedFilterHelpersTest.php b/tests/Standard/Traits/Helpers/AdvancedFilterHelpersTest.php index ebeacc25..f166c60e 100755 --- a/tests/Standard/Traits/Helpers/AdvancedFilterHelpersTest.php +++ b/tests/Standard/Traits/Helpers/AdvancedFilterHelpersTest.php @@ -237,7 +237,7 @@ public function can_not_set_invalid_filter(): void } /** @test */ - /*public function can_see_if_filters_set_with_values(): void + public function can_see_if_filters_set_with_values(): void { $this->advancedTable->setFilterDefaults(); @@ -267,10 +267,10 @@ public function can_not_set_invalid_filter(): void $this->assertTrue($this->advancedTable->hasAppliedFiltersWithValues()); $this->advancedTable->setFilter('range', []); $this->assertFalse($this->advancedTable->hasAppliedFiltersWithValues()); - }*/ + } /** @test */ - /*public function can_get_all_applied_filters_with_values(): void + public function can_get_all_applied_filters_with_values(): void { $this->advancedTable->setFilter('breed', ['1']); @@ -281,7 +281,7 @@ public function can_not_set_invalid_filter(): void $this->advancedTable->setFilter('datepicker', '2020-10-10'); $this->assertSame(['breed' => [0 => '1'], 'datepicker' => '2020-10-10', 'species' => [0 => '0']], $this->advancedTable->getAppliedFiltersWithValues()); - }*/ + } /** @test */ /*public function can_see_if_filters_set_with_values_3(): void @@ -374,24 +374,22 @@ public function can_check_if_filter_layout_is_slidedown(): void } /** @test */ - /* public function can_check_if_filter_layout_slidedown_is_visible(): void { - $this->assertFalse($this->basicTable->getFilterSlideDownDefaultStatus()); + $this->assertFalse($this->advancedTable->getFilterSlideDownDefaultStatus()); - $this->basicTable->setFilterSlideDownDefaultStatusEnabled(); + $this->advancedTable->setFilterSlideDownDefaultStatusEnabled(); - $this->assertTrue($this->basicTable->getFilterSlideDownDefaultStatus()); - }*/ + $this->assertTrue($this->advancedTable->getFilterSlideDownDefaultStatus()); + } /** @test */ - /* public function can_check_if_filter_layout_slidedown_is_hidden(): void { - $this->assertFalse($this->basicTable->getFilterSlideDownDefaultStatus()); + $this->assertFalse($this->advancedTable->getFilterSlideDownDefaultStatus()); - $this->basicTable->setFilterSlideDownDefaultStatusDisabled(); + $this->advancedTable->setFilterSlideDownDefaultStatusDisabled(); - $this->assertFalse($this->basicTable->getFilterSlideDownDefaultStatus()); - }*/ + $this->assertFalse($this->advancedTable->getFilterSlideDownDefaultStatus()); + } } From 931846b6cd927f37587f0f118ac15e70287c7125 Mon Sep 17 00:00:00 2001 From: lrljoe Date: Sat, 18 Mar 2023 04:08:35 +0000 Subject: [PATCH 2/8] TW vs BS Fixes --- .../tools/filters/datePicker.blade.php | 85 +++++++++------ .../tools/filters/dateRange.blade.php | 80 +++++++++----- .../tools/filters/numberRange.blade.php | 100 +++++++++++------- .../tools/filters/slimSelect.blade.php | 81 +++++++++----- .../tools/filters/smartSelect.blade.php | 82 +++++++++----- 5 files changed, 272 insertions(+), 156 deletions(-) diff --git a/resources/views/components/tools/filters/datePicker.blade.php b/resources/views/components/tools/filters/datePicker.blade.php index d0082def..06da9518 100755 --- a/resources/views/components/tools/filters/datePicker.blade.php +++ b/resources/views/components/tools/filters/datePicker.blade.php @@ -7,52 +7,75 @@ $filterMenuLabel = '[aria-labelledby="filters-menu"]'; $filterName = $filter->getName(); $filterConfigs = $filter->getConfigs(); - $customFilterMenuWidth = $filterConfigs['customFilterMenuWidth']; + $customFilterMenuWidth = (!empty($filterConfigs['customFilterMenuWidth']) ? json_encode(explode( " ", $filterConfigs['customFilterMenuWidth'])) : ''); $pushFlatpickrCss = $filterConfigs['publishFlatpickrCSS']; $pushFlatpickrJS = $filterConfigs['publishFlatpickrJS']; $dateString = !is_null($this->{$tableName}['filters'][$filterKey]) && $this->{$tableName}['filters'][$filterKey] != '' ? $this->{$tableName}['filters'][$filterKey] : date('Y-m-d'); - + $filterContainerName = "datePickerContainer"; @endphp -
getName(); $filterConfigs = $filter->getConfigs(); - $customFilterMenuWidth = $filterConfigs['customFilterMenuWidth']; + $customFilterMenuWidth = (!empty($filterConfigs['customFilterMenuWidth']) ? json_encode(explode( " ", $filterConfigs['customFilterMenuWidth'])) : ''); $pushFlatpickrCss = $filterConfigs['publishFlatpickrCSS']; $pushFlatpickrJS = $filterConfigs['publishFlatpickrJS']; @@ -31,48 +31,70 @@ $endDate = strlen($endDate) > 2 ? $endDate : date('Y-m-d'); $dateString = $startDate . ' to ' . $endDate; + $filterContainerName = "dateRangeContainer"; @endphp -
getName(); $filterConfigs = $filter->getConfigs(); - $customFilterMenuWidth = $filterConfigs['customFilterMenuWidth']; + $customFilterMenuWidth = (!empty($filterConfigs['customFilterMenuWidth']) ? json_encode(explode( " ", $filterConfigs['customFilterMenuWidth'])) : ''); $suffix = $filter->getConfig('suffix'); $defaultMin = $currentMin = $filterMin = $minRange = $filter->getConfig('minRange'); @@ -22,9 +22,12 @@ } $lightStyling = $filter->getConfig('styling')['light']; $darkStyling = $filter->getConfig('styling')['dark']; + $filterContainerName = "numberRangeContainer"; + @endphp -
getName(); $filterConfigs = $filter->getConfigs(); - $customFilterMenuWidth = $filterConfigs['customFilterMenuWidth']; + $customFilterMenuWidth = (!empty($filterConfigs['customFilterMenuWidth']) ? json_encode(explode( " ", $filterConfigs['customFilterMenuWidth'])) : ''); $options = []; $empty = []; $options = $filter->getOptions(); $xRefKey = 'slimSelectSearchBox' . $filterKey; $smartSelectID = 'slimSelectSearchBox' . $filterKey . '-id'; + $filterContainerName = "smartSelectContainer"; @endphp -
getName(); $filterConfigs = $filter->getConfigs(); - $customFilterMenuWidth = $filterConfigs['customFilterMenuWidth']; + $customFilterMenuWidth = (!empty($filterConfigs['customFilterMenuWidth']) ? json_encode(explode( " ", $filterConfigs['customFilterMenuWidth'])) : ''); $wireKey = $tableName . '.filters.' . $filterKey; $selectedWireKey = 'filterData.' . $filterKey; @@ -17,46 +17,70 @@ $displayIdEnabled = $filterConfigs['displayIdEnabled'] ?? 'false'; $optionsMethod = $filterConfigs['optionsMethod']; $displayHtmlName = $filterConfigs['displayHtmlName'] ?? 'false'; + $filterContainerName = "smartSelectContainer"; @endphp -
- - @if ($theme === 'tailwind') -
@if ($theme === 'tailwind') -
+
@@ -158,8 +157,7 @@ -
+
@@ -170,8 +168,7 @@ -
+