-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Typehinting in blade components (#2081)
- Loading branch information
1 parent
772c49c
commit de8d3bb
Showing
34 changed files
with
325 additions
and
299 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
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
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
19 changes: 11 additions & 8 deletions
19
resources/views/components/tools/filters/boolean.blade.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
@php($defaultValue = ($filter->hasFilterDefaultValue() ? (bool) $filter->getFilterDefaultValue() : false)) | ||
<div class="flex flex-cols" | ||
@php | ||
/** @var \Rappasoft\LaravelLivewireTables\Views\Filters\BooleanFilter $filter */ | ||
$defaultValue = ($filter->hasFilterDefaultValue() ? (bool) $filter->getFilterDefaultValue() : false) | ||
@endphp | ||
<div class="flex flex-cols" | ||
x-data="newBooleanFilter('{{ $filter->getKey() }}', '{{ $tableName }}', '{{ $defaultValue }}')" | ||
> | ||
> | ||
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap /> | ||
<input id="thisId" type="checkbox" name="switch" class="hidden" :checked="value" /> | ||
|
||
<button id="{{ $tableName }}-filter-{{ $filter->getKey() }}" | ||
x-ref="switchButton" | ||
type="button" | ||
type="button" | ||
@click="toggleStatusWithUpdate" | ||
:class="(value == 1 || value == true) ? 'bg-blue-600' : 'bg-neutral-200'" | ||
:class="(value == 1 || value == true) ? 'bg-blue-600' : 'bg-neutral-200'" | ||
class="relative inline-flex h-6 py-0.5 ml-4 focus:outline-none rounded-full w-10" | ||
x-cloak> | ||
<span :class="(value == 1 || value == true) ? 'translate-x-[18px]' : 'translate-x-0.5'" class="w-5 h-5 duration-200 ease-in-out bg-white rounded-full shadow-md"></span> | ||
</button> | ||
<template x-if="(value == 1 || value == true)"> | ||
<button @click="toggleStatusWithReset" type="button" | ||
class="flex-shrink-0 ml-1 h-6 w-6 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white" | ||
> | ||
> | ||
|
||
<span class="sr-only">{{ __($localisationPath.'Remove filter option') }}</span> | ||
<x-heroicon-m-x-mark class="h-6 w-6" /> | ||
</button> | ||
</template> | ||
</div> | ||
</div> |
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 |
---|---|---|
@@ -1,20 +1,21 @@ | ||
@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\DateFilter $filter */ @endphp | ||
<div> | ||
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap /> | ||
<div @class([ | ||
"rounded-md shadow-sm" => $isTailwind, | ||
"mb-3 mb-md-0 input-group" => $isBootstrap, | ||
'rounded-md shadow-sm' => $isTailwind, | ||
'mb-3 mb-md-0 input-group' => $isBootstrap, | ||
])> | ||
<input {{ $filter->getWireMethod("filterComponents.".$filter->getKey()) }} | ||
<input {{ $filter->getWireMethod('filterComponents.'.$filter->getKey()) }} | ||
wire:key="{{ $filter->generateWireKey($tableName, 'date') }}" | ||
id="{{ $tableName }}-filter-{{ $filter->getKey() }}@if($filter->hasCustomPosition())-{{ $filter->getCustomPosition() }}@endif" | ||
type="date" | ||
@if($filter->hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif | ||
@if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif | ||
@if($filter->hasConfig('placeholder')) placeholder="{{ $filter->getConfig('placeholder') }}" @endif | ||
@class([ | ||
"block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600" => $isTailwind, | ||
"form-control" => $isBootstrap, | ||
'block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600' => $isTailwind, | ||
'form-control' => $isBootstrap, | ||
]) | ||
/> | ||
</div> | ||
</div> | ||
</div> |
13 changes: 7 additions & 6 deletions
13
resources/views/components/tools/filters/datetime.blade.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
@php /** @var \Rappasoft\LaravelLivewireTables\Views\Filters\DateTimeFilter $filter */ @endphp | ||
<div> | ||
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap /> | ||
|
||
<div @class([ | ||
"rounded-md shadow-sm" => $isTailwind, | ||
"mb-3 mb-md-0 input-group" => $isBootstrap, | ||
'rounded-md shadow-sm' => $isTailwind, | ||
'mb-3 mb-md-0 input-group' => $isBootstrap, | ||
])> | ||
<input {{ $filter->getWireMethod("filterComponents.".$filter->getKey()) }} | ||
<input {{ $filter->getWireMethod('filterComponents.'.$filter->getKey()) }} | ||
wire:key="{{ $filter->generateWireKey($tableName, 'datetime') }}" | ||
id="{{ $tableName }}-filter-{{ $filter->getKey() }}@if($filter->hasCustomPosition())-{{ $filter->getCustomPosition() }}@endif" | ||
type="datetime-local" | ||
@if($filter->hasConfig('min')) min="{{ $filter->getConfig('min') }}" @endif | ||
@if($filter->hasConfig('max')) max="{{ $filter->getConfig('max') }}" @endif | ||
@if($filter->hasConfig('placeholder')) placeholder="{{ $filter->getConfig('placeholder') }}" @endif | ||
@class([ | ||
"block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600" => $isTailwind, | ||
"form-control" => $isBootstrap, | ||
'block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:text-white dark:border-gray-600' => $isTailwind, | ||
'form-control' => $isBootstrap, | ||
]) | ||
/> | ||
</div> | ||
</div> | ||
</div> |
2 changes: 2 additions & 0 deletions
2
resources/views/components/tools/filters/livewire-component-array-filter.blade.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
2 changes: 2 additions & 0 deletions
2
resources/views/components/tools/filters/livewire-component-filter.blade.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.