diff --git a/src/DataSource/Processors/CollectionProcessor.php b/src/DataSource/Processors/CollectionProcessor.php
index 91ed5cc2e..7c3c53574 100644
--- a/src/DataSource/Processors/CollectionProcessor.php
+++ b/src/DataSource/Processors/CollectionProcessor.php
@@ -13,7 +13,8 @@ class CollectionProcessor extends DataSourceBase
{
public static function match(mixed $key): bool
{
- return $key instanceof Collection;
+ return $key instanceof Collection
+ || is_iterable($key);
}
public function process(array $properties = []): array
diff --git a/tests/Concerns/Components/DishesCollectionTable.php b/tests/Concerns/Components/DishesCollectionTable.php
deleted file mode 100644
index 13d734f32..000000000
--- a/tests/Concerns/Components/DishesCollectionTable.php
+++ /dev/null
@@ -1,168 +0,0 @@
- 1,
- 'name' => 'Name 1',
- 'price' => 1.58,
- 'in_stock' => true,
- 'created_at' => '2021-01-01 00:00:00',
- 'chef_name' => '',
- ],
- [
- 'id' => 2,
- 'name' => 'Name 2',
- 'price' => 1.68,
- 'in_stock' => true,
- 'created_at' => '2021-02-02 00:00:00',
- 'chef_name' => null,
- ],
- [
- 'id' => 3,
- 'name' => 'Name 3',
- 'price' => 1.78,
- 'in_stock' => false,
- 'created_at' => '2021-03-03 00:00:00',
- 'chef_name' => 'Luan',
- ],
- [
- 'id' => 4,
- 'name' => 'Name 4',
- 'price' => 1.88,
- 'in_stock' => true,
- 'created_at' => '2021-04-04 00:00:00',
- 'chef_name' => 'Luan',
- ],
- [
- 'id' => 5,
- 'name' => 'Name 5',
- 'price' => 1.98,
- 'in_stock' => false,
- 'created_at' => '2021-05-05 00:00:00',
- 'chef_name' => 'Luan',
- ],
- ]);
- }
-
- public function setUp(): array
- {
- $this->showCheckBox();
-
- return [
- PowerGrid::exportable('export')
- ->striped()
- ->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV),
-
- PowerGrid::header()
- ->showToggleColumns()
- ->showSearchInput(),
-
- PowerGrid::footer()
- ->showPerPage()
- ->showRecordCount(),
- ];
- }
-
- public function fields(): PowerGridFields
- {
- return PowerGrid::fields()
- ->add('id')
- ->add('name')
- ->add('chef_name')
- ->add('price')
- ->add('in_stock')
- ->add('in_stock_label', function ($entry) {
- return $entry->in_stock ? 'sim' : 'não';
- })
- ->add('created_at_formatted', function ($entry) {
- return Carbon::parse($entry->created_at)->format('d/m/Y');
- });
- }
-
- public function columns(): array
- {
- return [
- Column::add()
- ->title(__('ID'))
- ->field('id')
- ->searchable()
- ->sortable(),
-
- Column::add()
- ->title(__('Name'))
- ->field('name')
- ->searchable()
- ->sortable(),
-
- Column::add()
- ->title(__('Chef'))
- ->field('chef_name')
- ->searchable()
- ->sortable(),
-
- Column::add()
- ->title(__('Price'))
- ->field('price')
- ->sortable(),
-
- Column::add()
- ->title(__('In Stock'))
- ->toggleable(true, 'yes', 'no')
- ->field('in_stock'),
-
- Column::add()
- ->title(__('Created At'))
- ->field('created_at_formatted'),
-
- Column::action('Action'),
- ];
- }
-
- public function actions($row): array
- {
- return [
- Button::add('edit-stock')
- ->slot('
Edit
')
- ->class('text-center')
- ->openModal('edit-stock', ['dishId' => $row->id]),
-
- Button::add('edit-stock-for-rules')
- ->slot('Edit for Rules
')
- ->class('text-center')
- ->openModal('edit-stock-for-rules', ['dishId' => $row->id]),
-
- Button::add('destroy')
- ->slot(__('Delete'))
- ->class('text-center')
- ->dispatch('deletedEvent', ['dishId' => $row->id]),
- ];
- }
-
- public function filters(): array
- {
- return $this->testFilters;
- }
-
- public function setTestThemeClass(string $themeClass): void
- {
- config(['livewire-powergrid.theme' => $themeClass]);
- }
-}
diff --git a/tests/Concerns/Components/DishesArrayTable.php b/tests/Concerns/Components/DishesIterableTable.php
similarity index 92%
rename from tests/Concerns/Components/DishesArrayTable.php
rename to tests/Concerns/Components/DishesIterableTable.php
index 5b44fd033..c0f37d399 100644
--- a/tests/Concerns/Components/DishesArrayTable.php
+++ b/tests/Concerns/Components/DishesIterableTable.php
@@ -10,14 +10,16 @@
PowerGridComponent,
PowerGridFields};
-class DishesArrayTable extends PowerGridComponent
+class DishesIterableTable extends PowerGridComponent
{
- public string $tableName = 'testing-dishes-array-table';
+ public string $tableName = 'testing-dishes-iterable-table';
public array $eventId = [];
public array $testFilters = [];
+ public string $iterableType = 'array';
+
protected function getListeners()
{
return array_merge(
@@ -33,9 +35,9 @@ public function openModal(array $params)
$this->eventId = $params;
}
- public function datasource(): array
+ public function datasource()
{
- return [
+ $data = [
[
'id' => 1,
'name' => 'Name 1',
@@ -77,6 +79,12 @@ public function datasource(): array
'chef_name' => 'Luan',
],
];
+
+ if ($this->iterableType === 'collection') {
+ return collect($data);
+ }
+
+ return $data;
}
public function setUp(): array
diff --git a/tests/Feature/CollectionSearchTest.php b/tests/Feature/CollectionSearchTest.php
index 25896d889..75ddba5d9 100644
--- a/tests/Feature/CollectionSearchTest.php
+++ b/tests/Feature/CollectionSearchTest.php
@@ -1,12 +1,14 @@
'collection',
+ ])
->call('setTestThemeClass', $params->theme)
->set('search', 'Name 1')
->assertSee('Name 1')
@@ -29,6 +31,6 @@
})->with('search');
dataset('search', [
- 'tailwind' => [DishesCollectionTable::class, (object) ['theme' => Tailwind::class]],
- 'bootstrap' => [DishesCollectionTable::class, (object) ['theme' => Bootstrap5::class]],
+ 'tailwind' => [DishesIterableTable::class, (object) ['theme' => Tailwind::class]],
+ 'bootstrap' => [DishesIterableTable::class, (object) ['theme' => Bootstrap5::class]],
]);
diff --git a/tests/Feature/Filters/FilterBooleanTest.php b/tests/Feature/Filters/FilterBooleanTest.php
index 5b70fcac2..70f9200c8 100644
--- a/tests/Feature/Filters/FilterBooleanTest.php
+++ b/tests/Feature/Filters/FilterBooleanTest.php
@@ -1,8 +1,8 @@
filters)
->toMatchArray([]);
})->group('filters', 'filterBoolean')
- ->with('filter_boolean_themes_collection', 'filter_boolean_themes_array');
+ ->with('iterable_datasource');
it('properly filters by bool true - using collection', function (string $component, string $theme) {
$component = livewire($component, [
@@ -169,7 +169,7 @@ public function filters(): array
expect($component->filters)
->toMatchArray([]);
})->group('filters', 'filterBoolean')
- ->with('filter_boolean_themes_collection');
+ ->with('iterable_datasource');
it('properly filters by bool true - using collection - custom builder', function (string $componentName, string $theme) {
$component = livewire($componentName, [
@@ -192,9 +192,9 @@ public function filters(): array
->assertSee('Name 4')
->assertDontSee('Name 5');
})->group('filters', 'filterBoolean')
- ->with('filter_boolean_themes_collection');
+ ->with('iterable_datasource');
-$customCollection = new class() extends DishesCollectionTable
+$customCollection = new class() extends DishesIterableTable
{
public int $dishId;
@@ -214,7 +214,9 @@ public function filters(): array
};
it('properly filters by bool true - using collection - custom builder - using tablename in field', function (string $component, string $theme) {
- $component = livewire($component)
+ $component = livewire($component, [
+ 'iterableType' => 'collection',
+ ])
->call('setTestThemeClass', $theme)
->assertSeeHtml('wire:input.live.debounce.600ms="filterBoolean(\'in_stock\', $event.target.value, \'In Stock\')"');
@@ -320,7 +322,7 @@ public function filters(): array
expect($component->filters)
->toMatchArray([]);
})->group('filters', 'filterBoolean')
- ->with('filter_boolean_themes_collection', 'filter_boolean_themes_array');
+ ->with('iterable_datasource');
it('properly filters by bool "all"', function (string $component, object $params) {
$component = livewire($component, [
@@ -352,8 +354,10 @@ public function filters(): array
})->group('filters', 'filterBoolean')
->with('filter_boolean_join', 'filter_boolean_query_builder');
-it('properly filters by bool "all" - using collection & array table', function (string $component, string $theme) {
- $component = livewire($component)
+it('properly filters by bool "all" - using collection', function (string $component, string $theme, string $iterableType) {
+ $component = livewire($component, [
+ 'iterableType' => $iterableType,
+ ])
->call('setTestThemeClass', $theme);
expect($component->filters)
@@ -373,7 +377,7 @@ public function filters(): array
],
]);
})->group('filters', 'filterBoolean')
- ->with('filter_boolean_themes_collection', 'filter_boolean_themes_array');
+ ->with('iterable_datasource');
dataset('filter_boolean_join', [
'tailwind -> id' => [DishesTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class, 'field' => 'id']],
@@ -390,14 +394,11 @@ public function filters(): array
'daisyui query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class, 'field' => 'id']],
]);
-dataset('filter_boolean_themes_array', [
- [DishesArrayTable::class, \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class],
- [DishesArrayTable::class, \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class],
- [DishesArrayTable::class, \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class],
-]);
-
-dataset('filter_boolean_themes_collection', [
- 'tailwind' => [DishesCollectionTable::class, \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class],
- 'bootstrap' => [DishesCollectionTable::class, \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class],
- 'daisyui' => [DishesCollectionTable::class, \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class],
+dataset('iterable_datasource', [
+ 'tailwind datasource array' => [DishesIterableTable::class, \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class, 'array'],
+ 'bootstrap datasource array' => [DishesIterableTable::class, \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class, 'array'],
+ 'daisyui datasource array' => [DishesIterableTable::class, \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class, 'array'],
+ 'tailwind datasource collection' => [DishesIterableTable::class, \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class, 'collection'],
+ 'bootstrap datasource collection' => [DishesIterableTable::class, \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class, 'collection'],
+ 'daisyui datasource collection' => [DishesIterableTable::class, \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class, 'collection'],
]);
diff --git a/tests/Feature/Filters/FilterMultiSelectTest.php b/tests/Feature/Filters/FilterMultiSelectTest.php
index c5d2b580f..5e8d4e3f5 100644
--- a/tests/Feature/Filters/FilterMultiSelectTest.php
+++ b/tests/Feature/Filters/FilterMultiSelectTest.php
@@ -3,12 +3,13 @@
use PowerComponents\LivewirePowerGrid\Components\Filters\{FilterMultiSelectAsync};
use PowerComponents\LivewirePowerGrid\Facades\Filter;
use PowerComponents\LivewirePowerGrid\PowerGridComponent;
-use PowerComponents\LivewirePowerGrid\Tests\{Concerns\Components\DishesArrayTable,
- Concerns\Components\DishesCollectionTable,
+use PowerComponents\LivewirePowerGrid\Tests\{
Concerns\Components\DishesFiltersTable,
+ Concerns\Components\DishesIterableTable,
Concerns\Components\DishesQueryBuilderTable,
Concerns\Components\DishesTable};
use PowerComponents\LivewirePowerGrid\Tests\Concerns\Models\Category;
+use PowerComponents\LivewirePowerGrid\Themes\{Bootstrap5, DaisyUI, Tailwind};
use function PowerComponents\LivewirePowerGrid\Tests\Plugins\livewire;
@@ -34,7 +35,7 @@ public function filters(): array
}
};
-$customCollection = new class() extends DishesCollectionTable
+$customCollection = new class() extends DishesIterableTable
{
public int $dishId;
@@ -85,7 +86,9 @@ public function filters(): array
->with('filter_multi_select_themes_with_join', 'filter_multi_select_query_builder');
it('properly filter with id using custom builder', function (string $component, object $params) {
- livewire($component)
+ livewire($component, [
+ 'iterableType' => 'collection',
+ ])
->call('setTestThemeClass', $params->theme)
->set('filters', [
'multi_select' => [
@@ -98,9 +101,9 @@ public function filters(): array
->assertDontSee('Francesinha vegana');
})->group('filters')
->with([
- 'tailwind -> id' => [$customBuilder::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class]],
- 'bootstrap -> id' => [$customBuilder::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class]],
- 'daisyui -> id' => [$customBuilder::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class]],
+ 'tailwind -> id' => [$customBuilder::class, (object) ['theme' => Tailwind::class]],
+ 'bootstrap -> id' => [$customBuilder::class, (object) ['theme' => Bootstrap5::class]],
+ 'daisyui -> id' => [$customBuilder::class, (object) ['theme' => DaisyUI::class]],
]);
it('properly filter with category_id using custom collection', function (string $component, object $params) {
@@ -119,9 +122,9 @@ public function filters(): array
->assertDontSee('Name 2');
})->group('filters')
->with([
- 'tailwind -> id' => [$customCollection::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class]],
- 'bootstrap -> id' => [$customCollection::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class]],
- 'daisyui -> id' => [$customCollection::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class]],
+ 'tailwind -> id' => [$customCollection::class, (object) ['theme' => Tailwind::class]],
+ 'bootstrap -> id' => [$customCollection::class, (object) ['theme' => Bootstrap5::class]],
+ 'daisyui -> id' => [$customCollection::class, (object) ['theme' => DaisyUI::class]],
]);
it('properly filter with category_id - multiple select async', function (string $component) {
@@ -185,28 +188,16 @@ public function filters(): array
->with('filter_multi_select_themes_with_join', 'filter_multi_select_query_builder');
dataset('filter_multi_select_themes_with_join', [
- 'tailwind -> id' => [DishesFiltersTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class, 'join' => false]],
- 'bootstrap -> id' => [DishesFiltersTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class, 'join' => false]],
- 'tailwind join' => [DishesFiltersTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class, 'join' => true]],
- 'bootstrap join' => [DishesFiltersTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class, 'join' => true]],
- 'daisyui -> id' => [DishesFiltersTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class, 'join' => false]],
- 'daisyui join' => [DishesFiltersTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class, 'join' => true]],
+ 'tailwind -> id' => [DishesFiltersTable::class, (object) ['theme' => Tailwind::class, 'join' => false]],
+ 'bootstrap -> id' => [DishesFiltersTable::class, (object) ['theme' => Bootstrap5::class, 'join' => false]],
+ 'tailwind join' => [DishesFiltersTable::class, (object) ['theme' => Tailwind::class, 'join' => true]],
+ 'bootstrap join' => [DishesFiltersTable::class, (object) ['theme' => Bootstrap5::class, 'join' => true]],
+ 'daisyui -> id' => [DishesFiltersTable::class, (object) ['theme' => DaisyUI::class, 'join' => false]],
+ 'daisyui join' => [DishesFiltersTable::class, (object) ['theme' => DaisyUI::class, 'join' => true]],
]);
dataset('filter_multi_select_query_builder', [
- 'tailwind query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class, 'field' => 'id']],
- 'bootstrap query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class, 'field' => 'id']],
- 'daisyui query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class, 'field' => 'id']],
-]);
-
-dataset('filter_multi_select_themes_array', [
- [DishesArrayTable::class, \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class],
- [DishesArrayTable::class, \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class],
- [DishesArrayTable::class, \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class],
-]);
-
-dataset('filter_multi_select_themes_collection', [
- 'tailwind' => [DishesCollectionTable::class, \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class],
- 'bootstrap' => [DishesCollectionTable::class, \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class],
- 'daisyui' => [DishesCollectionTable::class, \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class],
+ 'tailwind query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => Tailwind::class, 'field' => 'id']],
+ 'bootstrap query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => Bootstrap5::class, 'field' => 'id']],
+ 'daisyui query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => DaisyUI::class, 'field' => 'id']],
]);
diff --git a/tests/Feature/Filters/FilterSelectTest.php b/tests/Feature/Filters/FilterSelectTest.php
index 1ea247165..1c26f7d5c 100644
--- a/tests/Feature/Filters/FilterSelectTest.php
+++ b/tests/Feature/Filters/FilterSelectTest.php
@@ -4,13 +4,13 @@
use PowerComponents\LivewirePowerGrid\Facades\Filter;
use PowerComponents\LivewirePowerGrid\Tests\{
Concerns\Components\DishTableBase,
- Concerns\Components\DishesArrayTable,
- Concerns\Components\DishesCollectionTable,
+ Concerns\Components\DishesIterableTable,
Concerns\Components\DishesQueryBuilderTable,
Concerns\Components\DishesTable,
Concerns\Components\DishesTableWithJoin
};
use PowerComponents\LivewirePowerGrid\Tests\Concerns\Models\Category;
+use PowerComponents\LivewirePowerGrid\Themes\{Bootstrap5, DaisyUI, Tailwind};
use function PowerComponents\LivewirePowerGrid\Tests\Plugins\livewire;
@@ -53,7 +53,7 @@ public function filters(): array
}
};
-$customCollection = new class() extends DishesCollectionTable
+$customCollection = new class() extends DishesIterableTable
{
public int $dishId;
@@ -105,13 +105,15 @@ public function filters(): array
})->group('filters', 'filterSelect')
->with([
- 'tailwind -> id' => [$customBuilder::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class, 'field' => 'id']],
- 'bootstrap -> id' => [$customBuilder::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class, 'field' => 'id']],
- 'daisyui -> id' => [$customBuilder::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class, 'field' => 'id']],
+ 'tailwind -> id' => [$customBuilder::class, (object) ['theme' => Tailwind::class, 'field' => 'id']],
+ 'bootstrap -> id' => [$customBuilder::class, (object) ['theme' => Bootstrap5::class, 'field' => 'id']],
+ 'daisyui -> id' => [$customBuilder::class, (object) ['theme' => DaisyUI::class, 'field' => 'id']],
]);
it('property filter using computed datasource', function (string $component, object $params) {
- livewire($component)
+ livewire($component, [
+ 'iterableType' => 'collection',
+ ])
->call('setTestThemeClass', $params->theme)
->assertSee('Pastel de Nata')
->set('filters', filterSelect('category_id', 1))
@@ -120,9 +122,9 @@ public function filters(): array
})->group('filters', 'filterSelect')
->with([
- 'tailwind -> id' => [$computedDatasource::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class, 'field' => 'id']],
- 'bootstrap -> id' => [$computedDatasource::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class, 'field' => 'id']],
- 'daisyui -> id' => [$computedDatasource::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class, 'field' => 'id']],
+ 'tailwind -> id' => [$computedDatasource::class, (object) ['theme' => Tailwind::class, 'field' => 'id']],
+ 'bootstrap -> id' => [$computedDatasource::class, (object) ['theme' => Bootstrap5::class, 'field' => 'id']],
+ 'daisyui -> id' => [$computedDatasource::class, (object) ['theme' => DaisyUI::class, 'field' => 'id']],
]);
it('property filter using custom collection', function (string $component) {
@@ -133,9 +135,9 @@ public function filters(): array
->assertDontSee('Name 3');
})->group('filters', 'filterSelect')
->with([
- 'tailwind -> id' => [$customCollection::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class, 'field' => 'id']],
- 'bootstrap -> id' => [$customCollection::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class, 'field' => 'id']],
- 'daisyui -> id' => [$customCollection::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class, 'field' => 'id']],
+ 'tailwind -> id' => [$customCollection::class, (object) ['theme' => Tailwind::class, 'field' => 'id']],
+ 'bootstrap -> id' => [$customCollection::class, (object) ['theme' => Bootstrap5::class, 'field' => 'id']],
+ 'daisyui -> id' => [$customCollection::class, (object) ['theme' => DaisyUI::class, 'field' => 'id']],
]);
it('properly filter with category_id', function (string $component, object $params) {
@@ -193,30 +195,30 @@ public function filters(): array
->with('filter_select_join', 'filter_select_query_builder');
dataset('filter_select_join', [
- 'tailwind -> id' => [DishesTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class, 'field' => 'id']],
- 'bootstrap -> id' => [DishesTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class, 'field' => 'id']],
- 'tailwind -> dishes.id' => [DishesTableWithJoin::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class, 'field' => 'dishes.id']],
- 'bootstrap -> dishes.id' => [DishesTableWithJoin::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class, 'field' => 'dishes.id']],
- 'daisyui -> id' => [DishesTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class, 'field' => 'id']],
- 'daisyui -> dishes.id' => [DishesTableWithJoin::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class, 'field' => 'dishes.id']],
+ 'tailwind -> id' => [DishesTable::class, (object) ['theme' => Tailwind::class, 'field' => 'id']],
+ 'bootstrap -> id' => [DishesTable::class, (object) ['theme' => Bootstrap5::class, 'field' => 'id']],
+ 'tailwind -> dishes.id' => [DishesTableWithJoin::class, (object) ['theme' => Tailwind::class, 'field' => 'dishes.id']],
+ 'bootstrap -> dishes.id' => [DishesTableWithJoin::class, (object) ['theme' => Bootstrap5::class, 'field' => 'dishes.id']],
+ 'daisyui -> id' => [DishesTable::class, (object) ['theme' => DaisyUI::class, 'field' => 'id']],
+ 'daisyui -> dishes.id' => [DishesTableWithJoin::class, (object) ['theme' => DaisyUI::class, 'field' => 'dishes.id']],
]);
dataset('filter_select_query_builder', [
- 'tailwind query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class, 'field' => 'id']],
- 'bootstrap query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class, 'field' => 'id']],
- 'daisyui query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class, 'field' => 'id']],
+ 'tailwind query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => Tailwind::class, 'field' => 'id']],
+ 'bootstrap query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => Bootstrap5::class, 'field' => 'id']],
+ 'daisyui query builder -> id' => [DishesQueryBuilderTable::class, (object) ['theme' => DaisyUI::class, 'field' => 'id']],
]);
dataset('filter_select_themes_array', [
- [DishesArrayTable::class, \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class],
- [DishesArrayTable::class, \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class],
- [DishesArrayTable::class, \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class],
+ [DishesArrayTable::class, Tailwind::class],
+ [DishesArrayTable::class, Bootstrap5::class],
+ [DishesArrayTable::class, DaisyUI::class],
]);
dataset('filter_select_themes_collection', [
- 'tailwind' => [DishesCollectionTable::class, \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class],
- 'bootstrap' => [DishesCollectionTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class]],
- 'daisyui' => [DishesCollectionTable::class, (object) ['theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class]],
+ 'tailwind' => [DishesCollectionTable::class, Tailwind::class],
+ 'bootstrap' => [DishesCollectionTable::class, (object) ['theme' => Bootstrap5::class]],
+ 'daisyui' => [DishesCollectionTable::class, (object) ['theme' => DaisyUI::class]],
]);
function filterSelect(string $dataField, ?string $value): array