Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@php
use Filament\Forms\Components\Actions\Action;
use Filament\Actions\Action;
use Z3d0X\FilamentFabricator\Enums\BlockPickerStyle;

$containers = $getChildComponentContainers();
Expand All @@ -26,6 +26,7 @@
$isReorderableWithButtons = $isReorderableWithButtons();
$isReorderableWithDragAndDrop = $isReorderableWithDragAndDrop();

$key = $getKey();
$statePath = $getStatePath();
@endphp

Expand Down Expand Up @@ -209,6 +210,7 @@ class="fi-fo-builder-block-picker-ctn rounded-lg bg-white dark:bg-gray-900"
:after-item="$uuid"
:columns="$blockPickerColumns"
:blocks="$blockPickerBlocks"
:key="$key"
:state-path="$statePath"
:width="$blockPickerWidth"
>
Expand All @@ -222,6 +224,7 @@ class="fi-fo-builder-block-picker-ctn rounded-lg bg-white dark:bg-gray-900"
:after-item="$uuid"
:columns="$blockPickerColumns"
:blocks="$blockPickerBlocks"
:key="$key"
:state-path="$statePath"
:width="$blockPickerWidth"
>
Expand Down Expand Up @@ -255,6 +258,7 @@ class="absolute -top-3 left-3 px-1 text-sm font-medium"
:action="$addAction"
:blocks="$blockPickerBlocks"
:columns="$blockPickerColumns"
:key="$key"
:state-path="$statePath"
:width="$blockPickerWidth"
class="flex justify-center"
Expand All @@ -268,6 +272,7 @@ class="flex justify-center"
:action="$addAction"
:blocks="$blockPickerBlocks"
:columns="$blockPickerColumns"
:key="$key"
:state-path="$statePath"
:width="$blockPickerWidth"
class="flex justify-center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
'afterItem' => null,
'blocks',
'columns' => null,
'key',
'statePath',
'trigger',
'width' => null,
Expand All @@ -17,26 +18,18 @@
</x-slot>

<x-filament::dropdown.list>
<x-filament::grid
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the component is still available, I think it's best we keep it until it's deprecated

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about x-filament-schemas::grid?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component no longer exists on filament v4 you must use a div instead.

:default="$columns['default'] ?? 1"
:sm="$columns['sm'] ?? null"
:md="$columns['md'] ?? null"
:lg="$columns['lg'] ?? null"
:xl="$columns['xl'] ?? null"
:two-xl="$columns['2xl'] ?? null"
direction="column"
>
<div class="grid gap-1 {{ $columns ? 'grid-cols-' . ($columns['default'] ?? 1) : 'grid-cols-1' }}">
@foreach ($blocks as $block)
@php
$wireClickActionArguments = ['block' => $block->getName()];

if ($afterItem) {
if (filled($afterItem)) {
$wireClickActionArguments['afterItem'] = $afterItem;
}

$wireClickActionArguments = \Illuminate\Support\Js::from($wireClickActionArguments);

$wireClickAction = "mountFormComponentAction('{$statePath}', '{$action->getName()}', {$wireClickActionArguments})";
$wireClickAction = "mountAction('{$action->getName()}', {$wireClickActionArguments}, { schemaComponent: '{$key}' })";
@endphp

<x-filament::dropdown.list.item
Expand All @@ -47,6 +40,6 @@
{{ $block->getLabel() }}
</x-filament::dropdown.list.item>
@endforeach
</x-filament::grid>
</div>
</x-filament::dropdown.list>
</x-filament::dropdown>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
'afterItem' => null,
'blocks',
'columns' => null,
'key',
'statePath',
'trigger',
'width' => null,
Expand All @@ -23,26 +24,26 @@
@php
$wireClickActionArguments = ['block' => $block->getName()];

if ($afterItem) {
if (filled($afterItem)) {
$wireClickActionArguments['afterItem'] = $afterItem;
}

$wireClickActionArguments = \Illuminate\Support\Js::from($wireClickActionArguments);

$wireClickAction = "mountFormComponentAction('{$statePath}', '{$action->getName()}', {$wireClickActionArguments})";
$wireClickAction = "mountAction('{$action->getName()}', {$wireClickActionArguments}, { schemaComponent: '{$key}' })";
@endphp


<button
type="button"
class="flex flex-col items-center justify-center border border-gray-200 dark:border-white/10 w-full h-full gap-4 whitespace-nowrap rounded-md p-2 text-sm transition-colors duration-75 outline-none hover:bg-gray-50 focus-visible:bg-gray-50 dark:hover:bg-white/5 dark:focus-visible:bg-white/5"
class="flex flex-col items-center justify-center border border-gray-200 dark:border-white/10 size-full gap-4 whitespace-nowrap rounded-md p-2 text-sm transition-colors duration-75 outline-none hover:bg-gray-50 focus-visible:bg-gray-50 dark:hover:bg-white/5 dark:focus-visible:bg-white/5"
x-on:click="close"
wire:click="{{ $wireClickAction }}"
>
@if ($icon = $block->getIcon())
<x-filament::icon
:icon="$icon"
class="h-8 w-8 text-gray-400 dark:text-gray-500"
class="size-8 text-gray-400 dark:text-gray-500"
/>
@endif
<div>
Expand Down