Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi authored and github-actions[bot] committed Oct 28, 2023
1 parent 8ea232a commit 82fab59
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 22 deletions.
22 changes: 11 additions & 11 deletions src/Concerns/Designer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static function ui(Form $zeusForm, bool $inline = false): array
return $sections;
}

private static function handelExt(Form $zeusForm): Section|array
private static function handelExt(Form $zeusForm): Section | array
{
$getExtComponent = Extensions::init($zeusForm, 'formComponents');
if ($getExtComponent === null) {
Expand All @@ -62,38 +62,38 @@ private static function handelFields(ZeusSection $section, bool $inline): array
{
$fields = [];

if (!$inline) {
if (! $inline) {
$fields[] = Bolt::renderHook('zeus-form-section.before');
}

foreach ($section->fields->sortBy('ordering') as $zeusField) {
if (!$inline) {
if (! $inline) {
$fields[] = Bolt::renderHook('zeus-form-field.before');
}

$fieldClass = new $zeusField->type;
$component = $fieldClass->renderClass::make('zeusData.'.$zeusField->id);
$component = $fieldClass->renderClass::make('zeusData.' . $zeusField->id);

$fields[] = $fieldClass->appendFilamentComponentsOptions($component, $zeusField);

if (!$inline) {
if (! $inline) {
$fields[] = Bolt::renderHook('zeus-form-field.after');
}
}

if (!$inline) {
if (! $inline) {
$fields[] = Bolt::renderHook('zeus-form-section.after');
}

return $fields;
}

private static function handelSections($zeusForm, $section, $fields): Tab|Step|Fieldset|Section
private static function handelSections($zeusForm, $section, $fields): Tab | Step | Fieldset | Section
{
$component = Section::make($section->name)
->description($section->description)
->aside(fn() => $section->aside)
->compact(fn() => $section->compact)
->aside(fn () => $section->aside)
->compact(fn () => $section->compact)
->collapsible();

if (optional($zeusForm->options)['show-as'] === 'tabs') {
Expand All @@ -107,7 +107,7 @@ private static function handelSections($zeusForm, $section, $fields): Tab|Step|F
->icon($section->icon ?? null);
}

$component->visible(function ($record, Get $get) use ($zeusForm,$section) {
$component->visible(function ($record, Get $get) use ($section) {
//dump(1,$zeusForm->fields()->whereJsonContains('sections.options->visibility->active',true)->count());

if (! isset($section->options['visibility']) || ! $section->options['visibility']['active']) {
Expand All @@ -129,7 +129,7 @@ private static function handelSections($zeusForm, $section, $fields): Tab|Step|F
});

return $component
->id(str($section->name)->slug().'-'.$section->id)
->id(str($section->name)->slug() . '-' . $section->id)
->schema($fields)
//->visible(false)
->columns($section->columns);
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/Schemata.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public static function getSectionsSchema(): array
->inline(false)
->visible(fn (Get $get) => $get('../../options.show-as') === 'page')
->label(__('compact section')),
self::visibility()
self::visibility(),
]),
]),
]),
Expand Down
6 changes: 0 additions & 6 deletions src/Facades/Bolt.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@

namespace LaraZeus\Bolt\Facades;

use Filament\Forms\Components\Fieldset;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\Placeholder;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Tabs;
use Filament\Forms\Components\Wizard;
use Filament\Support\Facades\FilamentView;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Carbon;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Facade;
use LaraZeus\Bolt\Models\Form;

class Bolt extends Facade
{
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/Classes/Toggle.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static function getOptions(): array
public function appendFilamentComponentsOptions($component, $zeusField)
{
parent::appendFilamentComponentsOptions($component, $zeusField);

return $component->live();
}
}
2 changes: 1 addition & 1 deletion src/Filament/Resources/FormResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

class FormResource extends BoltResource
{
use Schemata;
use HasOptions;
use Schemata;

protected static ?string $navigationIcon = 'clarity-form-line';

Expand Down
3 changes: 1 addition & 2 deletions src/Livewire/FillForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use LaraZeus\Bolt\Concerns\Designer;
use LaraZeus\Bolt\Events\FormMounted;
use LaraZeus\Bolt\Events\FormSent;
use LaraZeus\Bolt\Facades\Bolt;
use LaraZeus\Bolt\Facades\Extensions;
use LaraZeus\Bolt\Models\Form;
use Livewire\Component;
Expand All @@ -19,8 +18,8 @@
*/
class FillForms extends Component implements Forms\Contracts\HasForms
{
use Forms\Concerns\InteractsWithForms;
use Designer;
use Forms\Concerns\InteractsWithForms;

public Form $zeusForm;

Expand Down

0 comments on commit 82fab59

Please sign in to comment.