Skip to content

Commit

Permalink
Merge pull request #171 from Power-Components/dev
Browse files Browse the repository at this point in the history
Dev - 1.5.6
  • Loading branch information
luanfreitasdev authored Dec 4, 2021
2 parents 05f817e + 4d031bf commit 2fc4279
Show file tree
Hide file tree
Showing 43 changed files with 1,381 additions and 1,131 deletions.
6 changes: 5 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ includes:
- ./vendor/nunomaduro/larastan/extension.neon

parameters:
ignoreErrors:
- '#Cannot call method [a-zA-Z0-9\\_]#'

paths:
- src

excludePaths:

level: 8
level: max
checkMissingIterableValueType: false

43 changes: 23 additions & 20 deletions phpunit.mysql.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="mysql"/>
<server name="DB_HOST" value="127.0.0.1"/>
<server name="DB_PORT" value="3307"/>
<server name="DB_USERNAME" value="root"/>
<server name="DB_PASSWORD" value="password"/>
<server name="DB_DATABASE" value="powergridtest"/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
<exclude>./tests/Feature/FilterInputOptionsCollectionTest.php</exclude>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="mysql"/>
<server name="DB_HOST" value="127.0.0.1"/>
<server name="DB_PORT" value="3307"/>
<server name="DB_USERNAME" value="root"/>
<server name="DB_PASSWORD" value="password"/>
<server name="DB_DATABASE" value="powergridtest"/>
</php>
</phpunit>
3 changes: 2 additions & 1 deletion phpunit.pgsql.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
<exclude>./tests/Feature/FilterInputOptionsCollectionTest.php</exclude>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
Expand All @@ -23,4 +24,4 @@
<server name="DB_PASSWORD" value="password"/>
<server name="DB_DATABASE" value="powergridtest"/>
</php>
</phpunit>
</phpunit>
1 change: 1 addition & 0 deletions phpunit.sqlite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
<exclude>./tests/Feature/FilterInputOptionsCollectionTest.php</exclude>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
Expand Down
43 changes: 23 additions & 20 deletions phpunit.sqlsrv.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="sqlsrv"/>
<server name="DB_HOST" value="127.0.0.1"/>
<server name="DB_PORT" value="1434"/>
<server name="DB_USERNAME" value="sa"/>
<server name="DB_PASSWORD" value="yourStrong(!)Password"/>
<server name="DB_DATABASE" value="tempdb"/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
<exclude>./tests/Feature/FilterInputOptionsCollectionTest.php</exclude>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="sqlsrv"/>
<server name="DB_HOST" value="127.0.0.1"/>
<server name="DB_PORT" value="1434"/>
<server name="DB_USERNAME" value="sa"/>
<server name="DB_PASSWORD" value="yourStrong(!)Password"/>
<server name="DB_DATABASE" value="tempdb"/>
</php>
</phpunit>
18 changes: 9 additions & 9 deletions resources/lang/id/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
'pagination' => [
'showing' => 'Menampilkan',
'to' => 'kepada',
'to' => 'hingga',
'of' => 'dari',
'results' => 'Hasil',
'all' => 'Semua',
Expand All @@ -41,15 +41,15 @@
'contains_not' => 'Tidak terkait',
'starts_with' => 'Dimulai dengan',
'ends_with' => 'Diakhiri dengan',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
'is_null' => 'Tidak ada',
'is_not_null' => 'Ada',
'is_blank' => 'Kosong',
'is_not_blank' => 'Tidak kosong',
'is_empty' => 'Kosong atau tidak ada',
'is_not_empty' => 'Tidak kosong dan ada',
],
'export' => [
'exporting' => 'Please wait!',
'completed' => 'Export completed! Your files are ready for download',
'exporting' => 'Harap tunggu!',
'completed' => 'Ekspor selesai! File anda siap diunduh',
],
];
2 changes: 1 addition & 1 deletion resources/stubs/table.collection.stub
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ final class {{ componentName }} extends PowerGridComponent
/**
* PowerGrid Columns.
*
* @return array<int, \PowerComponents\LivewirePowerGrid\Column>
* @return array<int, Column>
*/
public function columns(): array
{
Expand Down
2 changes: 1 addition & 1 deletion resources/stubs/table.fillable.stub
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ final class {{ componentName }} extends PowerGridComponent
/**
* PowerGrid Columns.
*
* @return array<int, \PowerComponents\LivewirePowerGrid\Column>
* @return array<int, Column>
*/
public function columns(): array
{
Expand Down
2 changes: 1 addition & 1 deletion resources/stubs/table.model.stub
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ final class {{ componentName }} extends PowerGridComponent
/**
* PowerGrid Columns.
*
* @return array<int, \PowerComponents\LivewirePowerGrid\Column>
* @return array<int, Column>
*/
public function columns(): array
{
Expand Down
34 changes: 16 additions & 18 deletions resources/views/components/frameworks/bootstrap5/footer.blade.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
@if(!is_array($data))
<div class="d-flex justify-content-between">

@if($perPageInput)
<div class="d-flex justify-content-center">
<div>
<label class="col-12 col-sm-6 col-md-6"
style="width: 120px;">
<select wire:model="perPage" class="form-select"
style="width: 110px;">
<footer class="mt-50 pb-1 w-100 align-items-end px-1 d-flex flex-wrap">
<div class="col-auto me-auto">
@if($perPageInput)
<div class="d-flex justify-content-center align-items-center">
<label class="w-auto">
<select wire:model="perPage" class="form-select pe-3">
@foreach($perPageValues as $value)
<option value="{{$value}}">
@if($value == 0)
Expand All @@ -18,15 +15,16 @@
@endforeach
</select>
</label>
<small class="ms-50">
{{ trans('livewire-powergrid::datatable.labels.results_per_page') }}
</small>
</div>
<span
style="padding-top: 8px;padding-left: 6px;">
{{ trans('livewire-powergrid::datatable.labels.results_per_page') }}
</span>
</div>
@endif
<div>
{!! $data->links(powerGridThemeRoot().'.pagination') !!}
@endif
</div>
</div>
<div class="col-auto overflow-auto mt-1 mt-sm-0">
@if(method_exists($data, 'links'))
{!! $data->links(powerGridThemeRoot().'.pagination', ['recordCount' => $recordCount]) !!}
@endif
</div>
</footer>
@endif
113 changes: 69 additions & 44 deletions resources/views/components/frameworks/bootstrap5/pagination.blade.php
Original file line number Diff line number Diff line change
@@ -1,48 +1,73 @@
<div>
@if ($paginator->hasPages())
<nav>
<ul class="pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
<span class="page-link" aria-hidden="true">&lsaquo;</span>
</li>
@else
<li class="page-item">
<button type="button" dusk="previousPage" class="page-link" wire:click="previousPage" wire:loading.attr="disabled" rel="prev" aria-label="@lang('pagination.previous')">&lsaquo;</button>
</li>
@endif

{{-- Pagination Elements --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
<li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>
@endif
<div class="d-flex align-items-center justify-content-between">
@if($recordCount === 'full')
<small class="text-muted d-block">
{{ trans('livewire-powergrid::datatable.pagination.showing') }}
<span class="font-semibold">{{ $paginator->firstItem() }}</span>
{{ trans('livewire-powergrid::datatable.pagination.to') }}
<span class="font-semibold">{{ $paginator->lastItem() }}</span>
{{ trans('livewire-powergrid::datatable.pagination.of') }}
<span class="font-semibold">{{ $paginator->total() }}</span>
{{ trans('livewire-powergrid::datatable.pagination.results') }}
</small>
@elseif($recordCount === 'short')
<small class="text-muted d-block">
<span class="font-semibold"> {{ $paginator->firstItem() }}</span>
-
<span class="font-semibold"> {{ $paginator->lastItem() }}</span>
|
<span class="font-semibold"> {{ $paginator->total() }}</span>
</small>
@elseif($recordCount === 'min')
<small class="text-muted d-block">
<span class="font-semibold"> {{ $paginator->firstItem() }}</span>
-
<span class="font-semibold"> {{ $paginator->lastItem() }}</span>
</small>
@endif
@if ($paginator->hasPages())
<nav>
<ul class="pagination mb-0 ms-1">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
<span class="page-link" aria-hidden="true">&lsaquo;</span>
</li>
@else
<li class="page-item">
<button type="button" dusk="previousPage" class="page-link" wire:click="previousPage" wire:loading.attr="disabled" rel="prev" aria-label="@lang('pagination.previous')">&lsaquo;</button>
</li>
@endif

{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
<li class="page-item active" wire:key="paginator-page-{{ $page }}" aria-current="page"><span class="page-link">{{ $page }}</span></li>
@else
<li class="page-item" wire:key="paginator-page-{{ $page }}"><button type="button" class="page-link" wire:click="gotoPage({{ $page }})">{{ $page }}</button></li>
@endif
@endforeach
@endif
@endforeach
{{-- Pagination Elements --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
<li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>
@endif

{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<li class="page-item">
<button type="button" dusk="nextPage" class="page-link" wire:click="nextPage" wire:loading.attr="disabled" rel="next" aria-label="@lang('pagination.next')">&rsaquo;</button>
</li>
@else
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
<span class="page-link" aria-hidden="true">&rsaquo;</span>
</li>
{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
<li class="page-item active" wire:key="paginator-page-{{ $page }}" aria-current="page"><span class="page-link">{{ $page }}</span></li>
@else
<li class="page-item" wire:key="paginator-page-{{ $page }}"><button type="button" class="page-link" wire:click="gotoPage({{ $page }})">{{ $page }}</button></li>
@endif
@endforeach
@endif
</ul>
</nav>
@endif
@endforeach

{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<li class="page-item">
<button type="button" dusk="nextPage" class="page-link" wire:click="nextPage" wire:loading.attr="disabled" rel="next" aria-label="@lang('pagination.next')">&rsaquo;</button>
</li>
@else
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
<span class="page-link" aria-hidden="true">&rsaquo;</span>
</li>
@endif
</ul>
</nav>
@endif
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class="form-check-input"
</div>
@else
<div class="text-center">
@if($row->{$column->field} === 0)
@if($row->{$column->field} == 0)
<div style="padding-top: 0.1em; padding-bottom: 0.1rem"
class="badge bg-danger">
{{ $column->toggleable['default'][1] }}
Expand Down
Loading

0 comments on commit 2fc4279

Please sign in to comment.