Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions resources/views/bootstrap-5/select.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
data-filter-field="{{ $filterField }}"
@endif

@if($filterBy)
data-filter-by="{{ $filterBy }}"
@endif

@if($tags)
data-tags="true"
@endif
Expand Down
4 changes: 4 additions & 0 deletions resources/views/material-admin-26/select.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
data-filter-field="{{ $filterField }}"
@endif

@if($filterBy)
data-filter-by="{{ $filterBy }}"
@endif

@if($tags)
data-tags="true"
@endif
Expand Down
3 changes: 3 additions & 0 deletions src/Views/Components/Select2.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Select2 extends Select
public string $ajaxUrl;
public string $selectedUrl;
public string $filterField;
public string $filterBy;
public string $fallback;
public string $parentModal;
/**
Expand Down Expand Up @@ -45,6 +46,7 @@ public function __construct(
string $nameField = '',
string $idField = '',
string $filterField = '',
string $filterBy = '',
string $fallback = '',
string $parentModal = '',
public string $iconPrefix = '',
Expand Down Expand Up @@ -99,6 +101,7 @@ public function __construct(
$this->ajaxUrl = $ajaxUrl;
$this->selectedUrl = $selectedUrl;
$this->filterField = $filterField;
$this->filterBy = $filterBy;
$this->hideSearch = $hideSearch;
$this->allowClear = $allowClear;
$this->fallback = $fallback;
Expand Down
21 changes: 11 additions & 10 deletions tests/Feature/AccordionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
namespace Javaabu\Forms\Tests\Feature;

use Javaabu\Forms\Tests\TestCase;
use PHPUnit\Framework\Attributes\Test;

class AccordionTest extends TestCase
{
/** @test */
#[Test]
public function it_can_generate_bootstrap_5_accordion_header()
{
$this->setFrameworkBootstrap5();
Expand All @@ -26,7 +27,7 @@ public function it_can_generate_bootstrap_5_accordion_header()

}

/** @test */
#[Test]
public function it_can_generate_material_admin_26_accordion_header()
{
$this->setFrameworkMaterialAdmin26();
Expand All @@ -39,7 +40,7 @@ public function it_can_generate_material_admin_26_accordion_header()
->seeInElement('.accordion__title#item-2', 'Accordion Item #2');
}

/** @test */
#[Test]
public function it_can_generate_bootstrap_5_accordion_collapse()
{
$this->setFrameworkBootstrap5();
Expand All @@ -57,7 +58,7 @@ public function it_can_generate_bootstrap_5_accordion_collapse()

}

/** @test */
#[Test]
public function it_can_generate_material_admin_26_accordion_collapse()
{
$this->setFrameworkMaterialAdmin26();
Expand All @@ -75,7 +76,7 @@ public function it_can_generate_material_admin_26_accordion_collapse()

}

/** @test */
#[Test]
public function it_can_generate_bootstrap_5_accordion_item()
{
$this->setFrameworkBootstrap5();
Expand Down Expand Up @@ -108,7 +109,7 @@ public function it_can_generate_bootstrap_5_accordion_item()

}

/** @test */
#[Test]
public function it_can_generate_material_admin_26_accordion_item()
{
$this->setFrameworkMaterialAdmin26();
Expand All @@ -133,7 +134,7 @@ public function it_can_generate_material_admin_26_accordion_item()

}

/** @test */
#[Test]
public function it_can_generate_bootstrap_5_accordion_using_named_items()
{
$this->setFrameworkBootstrap5();
Expand Down Expand Up @@ -169,7 +170,7 @@ public function it_can_generate_bootstrap_5_accordion_using_named_items()

}

/** @test */
#[Test]
public function it_can_generate_material_admin_accordion_using_named_items()
{
$this->setFrameworkMaterialAdmin26();
Expand Down Expand Up @@ -197,7 +198,7 @@ public function it_can_generate_material_admin_accordion_using_named_items()

}

/** @test */
#[Test]
public function it_can_generate_bootstrap_5_accordion_using_unnamed_items()
{
$this->setFrameworkBootstrap5();
Expand Down Expand Up @@ -233,7 +234,7 @@ public function it_can_generate_bootstrap_5_accordion_using_unnamed_items()

}

/** @test */
#[Test]
public function it_can_generate_bootstrap_5_accordion_using_slot()
{
$this->setFrameworkBootstrap5();
Expand Down
5 changes: 3 additions & 2 deletions tests/Feature/BulkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
namespace Javaabu\Forms\Tests\Feature;

use Javaabu\Forms\Tests\TestCase;
use PHPUnit\Framework\Attributes\Test;

class BulkTest extends TestCase
{
/** @test */
#[Test]
public function it_can_generated_bulk_actions_for_material_admin_26()
{
$this->setFrameworkMaterialAdmin26();
Expand All @@ -23,7 +24,7 @@ public function it_can_generated_bulk_actions_for_material_admin_26()
});
}

/** @test */
#[Test]
public function it_can_generated_bulk_actions_for_bootstrap_5()
{
$this->setFrameworkBootstrap5();
Expand Down
17 changes: 9 additions & 8 deletions tests/Feature/ButtonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
namespace Javaabu\Forms\Tests\Feature;

use Javaabu\Forms\Tests\TestCase;
use PHPUnit\Framework\Attributes\Test;

class ButtonTest extends TestCase
{
/** @test */
#[Test]
public function it_can_generate_bootstrap_5_button_group()
{
$this->setFrameworkBootstrap5();
Expand All @@ -19,7 +20,7 @@ public function it_can_generate_bootstrap_5_button_group()
});
}

/** @test */
#[Test]
public function it_can_generate_material_admin_26_group()
{
$this->setFrameworkMaterialAdmin26();
Expand All @@ -32,7 +33,7 @@ public function it_can_generate_material_admin_26_group()
});
}

/** @test */
#[Test]
public function it_can_generate_bootstrap_5_button()
{
$this->setFrameworkBootstrap5();
Expand All @@ -43,7 +44,7 @@ public function it_can_generate_bootstrap_5_button()
->seeInElement('button[type="button"].btn.btn-danger', 'Button');
}

/** @test */
#[Test]
public function it_can_generate_material_admin_26_button()
{
$this->setFrameworkMaterialAdmin26();
Expand All @@ -54,7 +55,7 @@ public function it_can_generate_material_admin_26_button()
->seeInElement('button[type="button"].btn.btn-danger', 'Button');
}

/** @test */
#[Test]
public function it_can_generate_bootstrap_5_submit_button()
{
$this->setFrameworkBootstrap5();
Expand All @@ -65,7 +66,7 @@ public function it_can_generate_bootstrap_5_submit_button()
->seeInElement('button[type="submit"].btn.btn-danger', 'Button');
}

/** @test */
#[Test]
public function it_can_generate_material_admin_26_submit_button()
{
$this->setFrameworkMaterialAdmin26();
Expand All @@ -76,7 +77,7 @@ public function it_can_generate_material_admin_26_submit_button()
->seeInElement('button[type="submit"].btn.btn-danger', 'Button');
}

/** @test */
#[Test]
public function it_can_generate_bootstrap_5_link_button()
{
$this->setFrameworkBootstrap5();
Expand All @@ -87,7 +88,7 @@ public function it_can_generate_bootstrap_5_link_button()
->seeInElement('a[href="/test"].btn.btn-danger', 'Button');
}

/** @test */
#[Test]
public function it_can_generate_material_admin_26_link_button()
{
$this->setFrameworkMaterialAdmin26();
Expand Down
Loading