-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
664 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<button type="button" | ||
@foreach ($attributes as $key => $value) | ||
{{ $key }}="{{ $value }}" | ||
@endforeach | ||
> | ||
@if (array_key_exists('icon', $options)) | ||
<i class="{{ $options['icon'] }}"></i> | ||
@endif | ||
|
||
{{ $options['text'] ?? '' }} | ||
</button> |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<a | ||
@foreach ($attributes as $key => $value) | ||
@if ($key === 'href' && is_callable($value)) | ||
{{ $key }}="{{ app()->call($value, ['model' => $model]) }}" | ||
@else | ||
{{ $key }}="{{ $value }}" | ||
@endif | ||
@endforeach | ||
> | ||
@if (array_key_exists('icon', $options)) | ||
<i class="{{ $options['icon'] }}"></i> | ||
@endif | ||
|
||
{{ $options['text'] ?? '' }} | ||
</a> |
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
18 changes: 9 additions & 9 deletions
18
src/Http/Livewire/TableComponent.php → src/TableComponent.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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Rappasoft\LaravelLivewireTables\Traits; | ||
|
||
/** | ||
* Trait CanBeHidden. | ||
*/ | ||
trait CanBeHidden | ||
{ | ||
/** | ||
* @var bool | ||
*/ | ||
protected $hidden = false; | ||
|
||
/** | ||
* @param $condition | ||
* | ||
* @return $this | ||
*/ | ||
public function hideIf($condition): self | ||
{ | ||
$this->hidden = $condition === true; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @param bool $hidden | ||
* | ||
* @return $this | ||
*/ | ||
public function hide($hidden = true): self | ||
{ | ||
$this->hidden = $hidden; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isHidden(): bool | ||
{ | ||
return $this->hidden; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/Http/Livewire/Traits/Checkboxes.php → src/Traits/Checkboxes.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
Oops, something went wrong.