generated from laravel-appkit/package-starter
-
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
6fe35e7
commit 867862d
Showing
35 changed files
with
486 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<div x-data="{{ UI::getJsRuntime() }}" class="[&_[x-cloak]]:hidden"> | ||
<div x-data="{{ UI::getJsRuntime() }}" {{ $attributes }}> | ||
{{ $slot }} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<p class="text-red-600 dark:text-red-400">{{ $error }}</p> | ||
<p {{ $attributes }}>{{ $error }}</p> |
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,17 @@ | ||
@php | ||
$id = 'smee'; | ||
// $id = $childComponents->first()->id; | ||
@endphp | ||
|
||
<div class="space-y-2"> | ||
<x-appkit::label for="{{ $id }}" :$label /> | ||
<div {{ $attributes }}> | ||
<x-appkit::label for="{{ $id }}" :$label {{ $labelElement }} /> | ||
|
||
<div> | ||
<div {{ $inputWrapperElement }}> | ||
{{ $slot }} | ||
</div> | ||
|
||
@if ($error) | ||
<x-appkit::field-error :$error /> | ||
@endif | ||
<x-appkit::field-error :$name :$error {{ $errorElement }} /> | ||
|
||
@if ($help) | ||
<x-appkit::help-text :$help /> | ||
<x-appkit::help-text :$help {{ $helpElement }} /> | ||
@endif | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<fieldset> | ||
<legend class="text-sm font-semibold leading-6 text-white">{{ $legend }}</legend> | ||
<fieldset {{ $attributes }}> | ||
<legend class="font-medium text-gray-900 leading-6 dark:text-white">{{ $legend }}</legend> | ||
|
||
{{ $slot }} | ||
</fieldset> |
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,9 @@ | ||
<form {!! $attributes !!}> | ||
<div class="space-y-6"> | ||
@if (isset($errors) && $errors->any()) | ||
<div class="{{ config('formulate.classes.form_error') }}">{{ config('formulate.form_error_message') }}</div> | ||
@endif | ||
|
||
{{ $slot }} | ||
</div> | ||
</form> |
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 +1 @@ | ||
<p class="text-gray-500 dark:text-gray-400">{{ $help }}</p> | ||
<p class="text-gray-500 dark:text-gray-400" {{ $attributes }}>{{ $help }}</p> |
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 +1 @@ | ||
<label for="{{ $for }}" class="font-medium text-gray-900 leading-6 dark:text-white" {{ $attributes }}>{{ $label }}</label> | ||
<label for="{{ $for }}" {{ $attributes }}>{{ $label }}</label> |
2 changes: 2 additions & 0 deletions
2
resources/views/components/repeating-group/add-another-button.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{-- class="mb-4" --}} | ||
<x-appkit::button type="button" @click="{{ $source }}.push('');" {{ $attributes }}>Add Another</x-appkit::button> |
10 changes: 10 additions & 0 deletions
10
resources/views/components/repeating-group/index.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{-- class="space-y-3 w-full" --}} | ||
<div {{ $attributes }}> | ||
<template x-for="(_, {{ $indexName }}) in {{ $source }}" :key='{{ $indexName }}'> | ||
{{ $slot }} | ||
</template> | ||
</div> | ||
|
||
@if ($addAnother) | ||
<x-appkit::repeating-group.add-another-button :$source /> | ||
@endif |
1 change: 1 addition & 0 deletions
1
resources/views/components/repeating-group/remove-button.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
<x-appkit::button @click.prevent="{{ $source }}.length > 1 && {{ $source }}.splice(index, 1);">Remove</x-appkit::button> |
11 changes: 11 additions & 0 deletions
11
resources/views/components/repeating-group/reorder-buttons.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<x-appkit::button @click.prevent="{{ $source }}.splice(index - 1, 0, {{ $source }}.splice(index, 1)[0]);" ::disabled="index == 0"> | ||
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-4 h-4'> | ||
<path stroke-linecap='round' stroke-linejoin='round' d='M8.25 6.75L12 3m0 0l3.75 3.75M12 3v18' /> | ||
</svg> | ||
</x-appkit::button> | ||
|
||
<x-appkit::button @click.prevent="{{ $source }}.splice(index + 1, 0, {{ $source }}.splice(index, 1)[0]);" ::disabled="index == {{ $source }}.length - 1"> | ||
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-4 h-4'> | ||
<path stroke-linecap='round' stroke-linejoin='round' d='M19.5 13.5L12 21m0 0l-7.5-7.5M12 21V3' /> | ||
</svg> | ||
</x-appkit::button> |
12 changes: 12 additions & 0 deletions
12
resources/views/components/repeating-group/reorder-handle.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{-- class="w-9 flex items-center cursor-move" --}} | ||
<div | ||
@mousedown="draggable = true" | ||
@touchstart="draggable = true" | ||
@mouseup="draggable = false" | ||
@touchend="draggable = false" | ||
{{ $attributes }} | ||
> | ||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-3 text-gray-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"> | ||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 10h16M4 14h16M4 18h16" /> | ||
</svg> | ||
</div> |
19 changes: 19 additions & 0 deletions
19
resources/views/components/repeating-group/reorder-item.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<div | ||
:draggable="draggable" | ||
@dragstart="draggingIndex = index; $event.dataTransfer.setData('text/plain', index);" | ||
@dragend="draggingIndex = null; droppingIndex = null;" | ||
:class="{'opacity-50': draggingIndex === index, 'pt-10 bg-indigo-500': droppingIndex == index && draggingIndex > index, 'pb-10 bg-blue-500': droppingIndex == index && draggingIndex < index}" | ||
class="relative transition-spacing duration-300 ease-in-out" | ||
> | ||
{{ $slot }} | ||
|
||
<div | ||
class="absolute inset-0 opacity-60 cursor-move transition-spacing duration-300 ease-in-out z-10" | ||
x-show.transition="draggingIndex !== null" | ||
@dragenter.prevent="droppingIndex = index" | ||
@dragleave="if (index === droppingIndex) { droppingIndex = null; }" | ||
@drop.prevent="{{ $source }}.splice(droppingIndex, 0, {{ $source }}.splice(draggingIndex, 1)[0]); draggable = false; $nextTick(() => { form.validate(); });" | ||
@dragover.prevent="$event.dataTransfer.dropEffect = 'move'" | ||
> | ||
</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
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,14 @@ | ||
<?php | ||
namespace AppKit\UI\Components; | ||
|
||
class Form extends BaseComponent | ||
{ | ||
protected $viewName = 'appkit-ui::components.form'; | ||
|
||
public function __construct( | ||
// public $action = '', | ||
// public $method = '', | ||
) { | ||
|
||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
namespace AppKit\UI\Components; | ||
|
||
class RepeatingGroup extends BaseComponent | ||
{ | ||
protected $viewName = 'appkit-ui::components.repeating-group.index'; | ||
|
||
public function __construct( | ||
public string $source, | ||
public string $indexName = 'index', | ||
public bool $orderable = false, | ||
public bool $addAnother = false, | ||
) { | ||
|
||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace AppKit\UI\Components\RepeatingGroup; | ||
|
||
use AppKit\UI\Components\BaseComponent; | ||
|
||
class AddAnotherButton extends BaseComponent | ||
{ | ||
protected $viewName = 'appkit-ui::components.repeating-group.add-another-button'; | ||
|
||
public function __construct( | ||
public string $source, | ||
) { | ||
|
||
} | ||
} |
Oops, something went wrong.