generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
1744d66
commit 00610d8
Showing
18 changed files
with
213 additions
and
17 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 was deleted.
Oops, something went wrong.
File renamed without changes.
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,17 @@ | ||
<form {{ $attributes | ||
->cssClass([ | ||
'layer' => 'grid grid-flow-row auto-rows-min gap-3', | ||
'actions' => 'flex flex-nowrap items-center gap-x-3 overflow-x-auto' | ||
]) | ||
->classMerge([ | ||
'layer', | ||
]) | ||
}}> | ||
{{ $slot }} | ||
|
||
@if ($actions) | ||
<div {{ $attributes->classFor('actions') }}> | ||
{{ $actions }} | ||
</div> | ||
@endif | ||
</form> |
File renamed without changes.
File renamed without changes.
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,7 @@ | ||
{{ html() | ||
->div($slot) | ||
->class([ | ||
'container', | ||
'w-full max-w-4xl xl:max-w-5xl' => ! $fluid, | ||
]) | ||
}} |
File renamed without changes.
File renamed without changes.
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,24 @@ | ||
<?php | ||
|
||
namespace Foxws\WireUse\Navigation\Components; | ||
|
||
use Closure; | ||
use Foxws\WireUse\Views\Support\Component; | ||
use Illuminate\View\View; | ||
use Spatie\Html\Html; | ||
|
||
class Input extends Component | ||
{ | ||
public function __construct( | ||
public ?Html $prepend = null, | ||
public ?Html $append = null, | ||
public ?Html $label = null, | ||
public ?Html $hint = null, | ||
) { | ||
} | ||
|
||
public function render(): View|Closure|string | ||
{ | ||
return view('wireuse::forms.input'); | ||
} | ||
} |
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,20 @@ | ||
<?php | ||
|
||
namespace Foxws\WireUse\Layout\Components; | ||
|
||
use Closure; | ||
use Foxws\WireUse\Views\Support\Component; | ||
use Illuminate\View\View; | ||
|
||
class Container extends Component | ||
{ | ||
public function __construct( | ||
public bool $fluid = false, | ||
) { | ||
} | ||
|
||
public function render(): View|Closure|string | ||
{ | ||
return view('wireuse::layout.container'); | ||
} | ||
} |
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,20 @@ | ||
<?php | ||
|
||
namespace Foxws\WireUse\Layout\Components; | ||
|
||
use Closure; | ||
use Foxws\WireUse\Views\Support\Component; | ||
use Illuminate\View\View; | ||
|
||
class Join extends Component | ||
{ | ||
public function __construct( | ||
public bool $fluid = false, | ||
) { | ||
} | ||
|
||
public function render(): View|Closure|string | ||
{ | ||
return view('wireuse::layout.join'); | ||
} | ||
} |
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,29 @@ | ||
<?php | ||
|
||
namespace Foxws\WireUse\Support\Elements\Attributes; | ||
|
||
use Illuminate\Support\Stringable; | ||
|
||
trait Livewire | ||
{ | ||
public function wireKey(string $value): static | ||
{ | ||
return $this->attribute('wire:key', $value); | ||
} | ||
|
||
public function wireIgnore(bool $self = false): static | ||
{ | ||
return $self | ||
? $this->attribute('wire:ignore.self') | ||
: $this->attribute('wire:ignore'); | ||
} | ||
|
||
public function wireModel(string $key, ?string $modifiers = null): static | ||
{ | ||
$directive = str('wire:model') | ||
->when($modifiers, fn (Stringable $str) => $str->append(".{$modifiers}")) | ||
->squish(); | ||
|
||
return $this->attribute($directive->value(), $key); | ||
} | ||
} |
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 @@ | ||
<?php | ||
|
||
namespace Foxws\WireUse\Support\Html\Elements; | ||
|
||
use Spatie\Html\Elements\Form as FormElement; | ||
|
||
class Form extends FormElement | ||
{ | ||
public function wireSubmit(?string $action = null): static | ||
{ | ||
$this->attributeIfNotNull($action, 'wire:submit', $action); | ||
|
||
return $this; | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
namespace Foxws\WireUse\Support\Html; | ||
|
||
use Foxws\WireUse\Support\Html\Elements\Form as FormElement; | ||
use Livewire\Form; | ||
use Spatie\Html\Html; | ||
|
||
class HtmlExtended extends Html | ||
{ | ||
protected ?Form $form = null; | ||
|
||
public function wireForm(Form $value, ?string $action = null): FormElement | ||
{ | ||
$this->form = $value; | ||
|
||
$form = FormElement::create(); | ||
|
||
return $form | ||
->wireSubmit($action); | ||
} | ||
} |
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,42 @@ | ||
<?php | ||
|
||
namespace Foxws\WireUse\Support\Html\Mixins; | ||
|
||
use Illuminate\Support\Stringable; | ||
use Spatie\Html\BaseElement; | ||
|
||
class BaseElementMixin | ||
{ | ||
public function wireKey() | ||
{ | ||
return function (string $value) { | ||
/** @var BaseElement $this */ | ||
|
||
return $this->attribute('wire:key', $value); | ||
}; | ||
} | ||
|
||
public function wireIgnore() | ||
{ | ||
return function (bool $self = false) { | ||
/** @var BaseElement $this */ | ||
|
||
return $self | ||
? $this->attribute('wire:ignore.self') | ||
: $this->attribute('wire:ignore'); | ||
}; | ||
} | ||
|
||
public function wireModel() | ||
{ | ||
return function (string $key, ?string $modifiers = null) { | ||
/** @var BaseElement $this */ | ||
|
||
$directive = str('wire:model') | ||
->when($modifiers, fn (Stringable $str) => $str->append(".{$modifiers}")) | ||
->squish(); | ||
|
||
return $this->attribute($directive->value(), $key); | ||
}; | ||
} | ||
} |
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