Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev committed Aug 18, 2024
1 parent 482c30a commit 58d1bdb
Show file tree
Hide file tree
Showing 59 changed files with 861 additions and 869 deletions.
28 changes: 14 additions & 14 deletions resources/views/components/checkbox-all.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
@php
$responsiveCheckboxColumnName = PowerComponents\LivewirePowerGrid\Responsive::CHECKBOX_COLUMN_NAME;
$responsiveCheckboxColumnName = \PowerComponents\LivewirePowerGrid\Components\SetUp\Responsive::CHECKBOX_COLUMN_NAME;
$isCheckboxFixedOnResponsive =
isset($this->setUp['responsive']) &&
Expand All @@ -9,25 +9,25 @@
: false;
@endphp
<th
@if ($isCheckboxFixedOnResponsive) fixed @endif
scope="col"
class="{{ theme_style($theme, 'checkbox.th') }}"
style="{{ theme_style($theme, 'checkbox.th.1') }}"
wire:key="{{ md5('checkbox-all') }}"
@if ($isCheckboxFixedOnResponsive) fixed @endif
scope="col"
class="{{ theme_style($theme, 'checkbox.th') }}"
style="{{ theme_style($theme, 'checkbox.th.1') }}"
wire:key="{{ md5('checkbox-all') }}"
>
<div
class="{{ theme_style($theme, 'checkbox.base') }}"
style="{{ theme_style($theme, 'checkbox.base.1') }}"
class="{{ theme_style($theme, 'checkbox.base') }}"
style="{{ theme_style($theme, 'checkbox.base.1') }}"
>
<label
class="{{ theme_style($theme, 'checkbox.label') }}"
style="{{ theme_style($theme, 'checkbox.label.1') }}"
class="{{ theme_style($theme, 'checkbox.label') }}"
style="{{ theme_style($theme, 'checkbox.label.1') }}"
>
<input
class="{{ theme_style($theme, 'checkbox.input') }}"
type="checkbox"
wire:click="selectCheckboxAll"
wire:model="checkboxAll"
class="{{ theme_style($theme, 'checkbox.input') }}"
type="checkbox"
wire:click="selectCheckboxAll"
wire:model="checkboxAll"
>
</label>
</div>
Expand Down
19 changes: 10 additions & 9 deletions resources/views/components/cols.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if (data_get($column, 'isAction') &&
in_array(
\PowerComponents\LivewirePowerGrid\Responsive::ACTIONS_COLUMN_NAME,
\PowerComponents\LivewirePowerGrid\Components\SetUp\Responsive::ACTIONS_COLUMN_NAME,
data_get($this->setUp, 'responsive.fixedColumns')
)) {
$isFixedOnResponsive = true;
Expand All @@ -33,16 +33,17 @@
: null;
@endphp
<th
x-data="{ sortable: @js(data_get($column, 'sortable')) }"
@if ($sortOrder) sort_order="{{ $sortOrder }}" @endif
class="{{ theme_style($theme, 'table.header.th') . ' ' . data_get($column, 'headerClass') }}"
@if ($isFixedOnResponsive) fixed @endif
@if (data_get($column, 'sortable')) x-multisort-shift-click="{{ $this->getId() }}" wire:click="sortBy('{{ $field }}')" @endif
style="{{ data_get($column, 'hidden') === true ? 'display:none' : '' }}; width: max-content; @if (data_get($column, 'sortable')) cursor:pointer; @endif {{ theme_style($theme, 'table.header.th.1') . ' ' . data_get($column, 'headerStyle') }}"
x-data="{ sortable: @js(data_get($column, 'sortable')) }"
@if ($sortOrder) sort_order="{{ $sortOrder }}" @endif
class="{{ theme_style($theme, 'table.header.th') . ' ' . data_get($column, 'headerClass') }}"
@if ($isFixedOnResponsive) fixed @endif
@if (data_get($column, 'sortable')) x-multisort-shift-click="{{ $this->getId() }}"
wire:click="sortBy('{{ $field }}')" @endif
style="{{ data_get($column, 'hidden') === true ? 'display:none' : '' }}; width: max-content; @if (data_get($column, 'sortable')) cursor:pointer; @endif {{ theme_style($theme, 'table.header.th.1') . ' ' . data_get($column, 'headerStyle') }}"
>
<div
@class(['flex gap-2' => !isBootstrap5(), theme_style($theme, 'cols.div')])
style="{{ theme_style($theme, 'cols.div.1') }}"
@class(['flex gap-2' => !isBootstrap5(), theme_style($theme, 'cols.div')])
style="{{ theme_style($theme, 'cols.div.1') }}"
>
<span data-value>{!! data_get($column, 'title') !!}</span>

Expand Down
20 changes: 10 additions & 10 deletions resources/views/components/table-footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ class="{{ theme_style($theme, 'table.body.tdSummarize') . ' ' . data_get($column
style="{{ data_get($column, 'hidden') === true ? 'display:none' : '' }}; {{ theme_style($theme, 'table.body.tdSummarize.1') . ' ' . data_get($column, 'bodyStyle') ?? '' }}"
>
@include('livewire-powergrid::components.summarize', [
'sum' => data_get($column, 'sum.footer') ? data_get($column, 'summarize.sum') : null,
'labelSum' => data_get($column, 'sum.label'),
'sum' => data_get($column, 'properties.summarize.sum.footer') ? data_get($column, 'properties.summarize_values.sum') : null,
'labelSum' => data_get($column, 'properties.summarize.sum.label'),
'count' => data_get($column, 'count.footer') ? data_get($column, 'summarize.count') : null,
'labelCount' => data_get($column, 'count.footer'),
'count' => data_get($column, 'properties.summarize.count.footer') ? data_get($column, 'properties.summarize_values.count') : null,
'labelCount' => data_get($column, 'properties.summarize.count.footer'),
'min' => data_get($column, 'min.footer') ? data_get($column, 'summarize.min') : null,
'labelMin' => data_get($column, 'min.footer'),
'min' => data_get($column, 'properties.summarize.min.footer') ? data_get($column, 'properties.summarize_values.min') : null,
'labelMin' => data_get($column, 'properties.summarize.min.footer'),
'max' => data_get($column, 'max.footer') ? data_get($column, 'summarize.max') : null,
'labelMax' => data_get($column, 'max.label'),
'max' => data_get($column, 'properties.summarize.max.footer') ? data_get($column, 'properties.summarize_values.max') : null,
'labelMax' => data_get($column, 'properties.summarize.max.label'),
'avg' => data_get($column, 'avg.footer') ? data_get($column, 'summarize.avg') : null,
'labelAvg' => data_get($column, 'avg.label'),
'avg' => data_get($column, 'properties.summarize.avg.footer') ? data_get($column, 'properties.summarize_values.avg') : null,
'labelAvg' => data_get($column, 'properties.summarize.avg.label'),
])
</td>
@endforeach
Expand Down
20 changes: 10 additions & 10 deletions resources/views/components/table-header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
<td class="{{ theme_style($theme, 'table.body.tdSummarize') . ' '.data_get($column, 'bodyClass') ?? '' }}"
style="{{ data_get($column, 'hidden') === true ? 'display:none': '' }}; {{ theme_style($theme, 'table.body.tdSummarize') . ' '.data_get($column, 'bodyStyle') ?? '' }}">
@include('livewire-powergrid::components.summarize', [
'sum' => data_get($column, 'sum.header') ? data_get($column, 'summarize.sum') : null,
'labelSum' => data_get($column, 'sum.label'),
'sum' => data_get($column, 'properties.summarize.sum.header') ? data_get($column, 'properties.summarize_values.sum') : null,
'labelSum' => data_get($column, 'properties.summarize.sum.label'),
'count' => data_get($column, 'count.header') ? data_get($column, 'summarize.count') : null,
'labelCount' => data_get($column, 'count.label'),
'count' => data_get($column, 'properties.summarize.count.header') ? data_get($column, 'properties.summarize_values.count') : null,
'labelCount' => data_get($column, 'properties.summarize.count.label'),
'min' => data_get($column, 'min.header') ? data_get($column, 'summarize.min') : null,
'labelMin' => data_get($column, 'min.label'),
'min' => data_get($column, 'properties.summarize.min.header') ? data_get($column, 'properties.summarize_values.min') : null,
'labelMin' => data_get($column, 'properties.summarize.min.label'),
'max' => data_get($column, 'max.header') ? data_get($column, 'summarize.max') : null,
'labelMax' => data_get($column, 'max.label'),
'max' => data_get($column, 'properties.summarize.max.header') ? data_get($column, 'properties.summarize_values.max') : null,
'labelMax' => data_get($column, 'properties.summarize.max.label'),
'avg' => data_get($column, 'avg.header') ? data_get($column, 'summarize.avg') : null,
'labelAvg' => data_get($column, 'avg.label'),
'avg' => data_get($column, 'properties.summarize.avg.header') ? data_get($column, 'properties.summarize_values.avg') : null,
'labelAvg' => data_get($column, 'properties.summarize.avg.label'),
])
</td>
@endforeach
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class="{{ $class }}"
:$tableName
:parentName="$this->getName()"
:columns="$this->visibleColumns"
:data="\PowerComponents\LivewirePowerGrid\ProcessDataSource::transform($data->skip($skip)->take($take), $this, true)"
:data="\PowerComponents\LivewirePowerGrid\DataSource\Processors\DataSourceBase::transform($data->skip($skip)->take($take), $this, true)"
/>
@endforeach
</div>
Expand Down
46 changes: 23 additions & 23 deletions resources/views/components/table/tr.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
>
@if ($loading)
<td
class="{{ theme_style($theme, 'table.body.tbodyEmpty') }}"
colspan="{{ ($checkbox ? 1 : 0) + count($columns) }}"
class="{{ theme_style($theme, 'table.body.tbodyEmpty') }}"
colspan="{{ ($checkbox ? 1 : 0) + count($columns) }}"
>
@if ($loadingComponent)
@include($loadingComponent)
Expand All @@ -18,28 +18,28 @@ class="{{ theme_style($theme, 'table.body.tbodyEmpty') }}"
@else
@if (data_get($setUp, 'detail.showCollapseIcon'))
<th
scope="col"
class="{{ theme_style($theme, 'table.header.th') }}"
style="{{ theme_style($theme, 'table.header.th.1') }}"
wire:key="show-collapse-{{ $tableName }}"
scope="col"
class="{{ theme_style($theme, 'table.header.th') }}"
style="{{ theme_style($theme, 'table.header.th.1') }}"
wire:key="show-collapse-{{ $tableName }}"
>
</th>
@endif

@isset($setUp['responsive'])
<th
fixed
x-show="hasHiddenElements"
class="{{ theme_style($theme, 'table.header.th') }}"
style="{{ theme_style($theme, 'table.header.th.1') }}"
fixed
x-show="hasHiddenElements"
class="{{ theme_style($theme, 'table.header.th') }}"
style="{{ theme_style($theme, 'table.header.th.1') }}"
>
</th>
@endisset

@if ($radio)
<th
class="{{ theme_style($theme, 'table.header.th') }}"
style="{{ theme_style($theme, 'table.header.th.1') }}"
class="{{ theme_style($theme, 'table.header.th') }}"
style="{{ theme_style($theme, 'table.header.th.1') }}"
>
</th>
@endif
Expand All @@ -50,27 +50,27 @@ class="{{ theme_style($theme, 'table.header.th') }}"

@foreach ($columns as $column)
<x-livewire-powergrid::cols
wire:key="cols-{{ data_get($column, 'field') }} }}"
:$column
:$theme
:$enabledFilters
wire:key="cols-{{ data_get($column, 'field') }} }}"
:$column
:$theme
:$enabledFilters
/>
@endforeach

@if (isset($actions) && count($actions))
@php
$responsiveActionsColumnName = PowerComponents\LivewirePowerGrid\Responsive::ACTIONS_COLUMN_NAME;
$responsiveActionsColumnName = \PowerComponents\LivewirePowerGrid\Components\SetUp\Responsive::ACTIONS_COLUMN_NAME;
$isActionFixedOnResponsive = isset($this->setUp['responsive']) && in_array($responsiveActionsColumnName, data_get($this->setUp, 'responsive.fixedColumns')) ? true : false;
@endphp

<th
@if ($isActionFixedOnResponsive) fixed @endif
class="{{ theme_style($theme, 'table.header.th') . ' ' . theme_style($theme, 'table.header.thAction') }}"
scope="col"
class="{{ theme_style($theme, 'table.header.th.1') . ' ' . theme_style($theme, 'table.header.thAction.1') }}"
colspan="999"
wire:key="{{ md5('actions') }}"
@if ($isActionFixedOnResponsive) fixed @endif
class="{{ theme_style($theme, 'table.header.th') . ' ' . theme_style($theme, 'table.header.thAction') }}"
scope="col"
class="{{ theme_style($theme, 'table.header.th.1') . ' ' . theme_style($theme, 'table.header.thAction.1') }}"
colspan="999"
wire:key="{{ md5('actions') }}"
>
{{ trans('livewire-powergrid::datatable.labels.action') }}
</th>
Expand Down
Loading

0 comments on commit 58d1bdb

Please sign in to comment.