Skip to content

Commit 56a4f6b

Browse files
committed
Merge branch 'main' of github.com:vormkracht10/filament-fields
2 parents d5367fb + c06b4f8 commit 56a4f6b

File tree

10 files changed

+32
-32
lines changed

10 files changed

+32
-32
lines changed

src/Concerns/HasConfigurableFields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ private function prepareCustomFieldOptions(array $fields): array
3333
return [$key => $formattedName];
3434
})->toArray();
3535
}
36-
}
36+
}

src/Concerns/HasEnumNames.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ abstract public static function cases(): array;
88

99
public static function names(): array
1010
{
11-
return array_map(fn($enum) => $enum->name, static::cases());
11+
return array_map(fn ($enum) => $enum->name, static::cases());
1212
}
1313
}

src/Concerns/HasEnumValues.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ abstract public static function cases(): array;
88

99
public static function values(): array
1010
{
11-
return array_map(fn($enum) => $enum->value, static::cases());
11+
return array_map(fn ($enum) => $enum->value, static::cases());
1212
}
1313
}

src/Concerns/HasFieldTypeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use Exception;
66
use Illuminate\Support\Str;
7-
use Vormkracht10\Fields\Facades\Fields;
87
use Vormkracht10\Fields\Enums\Field;
8+
use Vormkracht10\Fields\Facades\Fields;
99

1010
trait HasFieldTypeResolver
1111
{

src/Concerns/HasFieldsMapper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
use Illuminate\Support\Collection;
66
use Livewire\Attributes\On;
7-
use Vormkracht10\Fields\Fields;
87
use Vormkracht10\Fields\Contracts\FieldInspector;
98
use Vormkracht10\Fields\Enums\Field;
9+
use Vormkracht10\Fields\Fields;
1010
use Vormkracht10\Fields\Fields\Checkbox;
1111
use Vormkracht10\Fields\Fields\CheckboxList;
1212
use Vormkracht10\Fields\Fields\Color;
@@ -106,7 +106,7 @@ private function resolveFormFields(): array
106106
$customFields = $this->resolveCustomFields();
107107

108108
return $this->record->fields
109-
->map(fn($field) => $this->resolveFieldInput($field, $customFields))
109+
->map(fn ($field) => $this->resolveFieldInput($field, $customFields))
110110
->filter()
111111
->values()
112112
->all();
@@ -115,7 +115,7 @@ private function resolveFormFields(): array
115115
private function resolveCustomFields(): Collection
116116
{
117117
return collect(Fields::getFields())
118-
->map(fn($fieldClass) => new $fieldClass);
118+
->map(fn ($fieldClass) => new $fieldClass);
119119
}
120120

121121
private function resolveFieldInput(Model $field, Collection $customFields): ?object

src/Fields/CheckboxList.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@ public function getForm(): array
9494
//
9595
Forms\Components\TextInput::make('config.noSearchResultsMessage')
9696
->label(__('No search results message'))
97-
->visible(fn(Forms\Get $get): bool => $get('config.searchable')),
97+
->visible(fn (Forms\Get $get): bool => $get('config.searchable')),
9898
Forms\Components\TextInput::make('config.searchPrompt')
9999
->label(__('Search prompt'))
100-
->visible(fn(Forms\Get $get): bool => $get('config.searchable')),
100+
->visible(fn (Forms\Get $get): bool => $get('config.searchable')),
101101
Forms\Components\TextInput::make('config.searchDebounce')
102102
->numeric()
103103
->minValue(0)
104104
->step(100)
105105
->label(__('Search debounce'))
106-
->visible(fn(Forms\Get $get): bool => $get('config.searchable')),
106+
->visible(fn (Forms\Get $get): bool => $get('config.searchable')),
107107
]),
108108
]),
109109
])->columnSpanFull(),

src/Fields/Repeater.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ public function getForm(): array
109109
Forms\Components\Toggle::make('config.reorderableWithButtons')
110110
->label(__('Reorderable with buttons'))
111111
->dehydrated()
112-
->disabled(fn(Forms\Get $get): bool => $get('config.reorderable') === false)
112+
->disabled(fn (Forms\Get $get): bool => $get('config.reorderable') === false)
113113
->inline(false),
114114
]),
115115
Forms\Components\Toggle::make('config.collapsible')
116116
->label(__('Collapsible'))
117117
->inline(false),
118118
Forms\Components\Toggle::make('config.collapsed')
119119
->label(__('Collapsed'))
120-
->visible(fn(Forms\Get $get): bool => $get('config.collapsible') === true)
120+
->visible(fn (Forms\Get $get): bool => $get('config.collapsible') === true)
121121
->inline(false),
122122
Forms\Components\Toggle::make('config.cloneable')
123123
->label(__('Cloneable'))
@@ -132,9 +132,9 @@ public function getForm(): array
132132
->live(debounce: 250)
133133
->labelKey('name')
134134
->maxDepth(0)
135-
->addable(fn(string $operation) => $operation !== 'create')
136-
->disabled(fn(string $operation) => $operation === 'create')
137-
->hint(fn(string $operation) => $operation === 'create' ? __('Fields can be added once the field is created.') : '')
135+
->addable(fn (string $operation) => $operation !== 'create')
136+
->disabled(fn (string $operation) => $operation === 'create')
137+
->hint(fn (string $operation) => $operation === 'create' ? __('Fields can be added once the field is created.') : '')
138138
->hintColor('primary')
139139
->form([
140140
Section::make('Field')
@@ -149,7 +149,7 @@ public function getForm(): array
149149
->required()
150150
->placeholder(__('Name'))
151151
->live(debounce: 250)
152-
->afterStateUpdated(fn(Set $set, ?string $state) => $set('slug', Str::slug($state))),
152+
->afterStateUpdated(fn (Set $set, ?string $state) => $set('slug', Str::slug($state))),
153153
TextInput::make('slug')
154154
->readonly(),
155155
Select::make('field_type')
@@ -179,10 +179,10 @@ function () {
179179
])->columnSpanFull(),
180180
Section::make('Configuration')
181181
->columns(3)
182-
->schema(fn(Get $get) => $this->getFieldTypeFormSchema(
182+
->schema(fn (Get $get) => $this->getFieldTypeFormSchema(
183183
$get('field_type')
184184
))
185-
->visible(fn(Get $get) => filled($get('field_type'))),
185+
->visible(fn (Get $get) => filled($get('field_type'))),
186186
]),
187187
])->columns(2),
188188
])->columnSpanFull(),

src/Fields/Select.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,44 +104,44 @@ public function getForm(): array
104104
->label(__('Preload'))
105105
->live()
106106
->inline(false)
107-
->visible(fn(Forms\Get $get): bool => $get('config.searchable')),
107+
->visible(fn (Forms\Get $get): bool => $get('config.searchable')),
108108
// self::optionFormFields(),
109109
self::affixFormFields(),
110110
Forms\Components\Grid::make(2)
111111
->schema([
112112
Forms\Components\TextInput::make('config.loadingMessage')
113113
->label(__('Loading message'))
114-
->visible(fn(Forms\Get $get): bool => $get('config.searchable')),
114+
->visible(fn (Forms\Get $get): bool => $get('config.searchable')),
115115
Forms\Components\TextInput::make('config.noSearchResultsMessage')
116116
->label(__('No search results message'))
117-
->visible(fn(Forms\Get $get): bool => $get('config.searchable')),
117+
->visible(fn (Forms\Get $get): bool => $get('config.searchable')),
118118
Forms\Components\TextInput::make('config.searchPrompt')
119119
->label(__('Search prompt'))
120-
->visible(fn(Forms\Get $get): bool => $get('config.searchable')),
120+
->visible(fn (Forms\Get $get): bool => $get('config.searchable')),
121121
Forms\Components\TextInput::make('config.searchingMessage')
122122
->label(__('Searching message'))
123-
->visible(fn(Forms\Get $get): bool => $get('config.searchable')),
123+
->visible(fn (Forms\Get $get): bool => $get('config.searchable')),
124124
Forms\Components\TextInput::make('config.searchDebounce')
125125
->numeric()
126126
->minValue(0)
127127
->step(100)
128128
->label(__('Search debounce'))
129-
->visible(fn(Forms\Get $get): bool => $get('config.searchable')),
129+
->visible(fn (Forms\Get $get): bool => $get('config.searchable')),
130130
Forms\Components\TextInput::make('config.optionsLimit')
131131
->numeric()
132132
->minValue(0)
133133
->label(__('Options limit'))
134-
->visible(fn(Forms\Get $get): bool => $get('config.searchable')),
134+
->visible(fn (Forms\Get $get): bool => $get('config.searchable')),
135135
Forms\Components\TextInput::make('config.minItemsForSearch')
136136
->numeric()
137137
->minValue(0)
138138
->label(__('Min items for search'))
139-
->visible(fn(Forms\Get $get): bool => $get('config.searchable')),
139+
->visible(fn (Forms\Get $get): bool => $get('config.searchable')),
140140
Forms\Components\TextInput::make('config.maxItemsForSearch')
141141
->numeric()
142142
->minValue(0)
143143
->label(__('Max items for search'))
144-
->visible(fn(Forms\Get $get): bool => $get('config.searchable')),
144+
->visible(fn (Forms\Get $get): bool => $get('config.searchable')),
145145
]),
146146
]),
147147
])->columnSpanFull(),

src/Fields/Text.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function getForm(): array
112112
->numeric()
113113
->minValue(0)
114114
->label(__('Step'))
115-
->visible(fn(Forms\Get $get): bool => $get('config.type') === 'numeric'),
115+
->visible(fn (Forms\Get $get): bool => $get('config.type') === 'numeric'),
116116
Forms\Components\Select::make('config.inputMode')
117117
->label(__('Input mode'))
118118
->options([
@@ -125,13 +125,13 @@ public function getForm(): array
125125
'email' => __('Email'),
126126
'url' => __('URL'),
127127
])
128-
->visible(fn(Forms\Get $get): bool => $get('config.type') === 'numeric'),
128+
->visible(fn (Forms\Get $get): bool => $get('config.type') === 'numeric'),
129129
Forms\Components\Toggle::make('config.revealable')
130130
->label(__('Revealable'))
131-
->visible(fn(Forms\Get $get): bool => $get('config.type') === 'password'),
131+
->visible(fn (Forms\Get $get): bool => $get('config.type') === 'password'),
132132
Forms\Components\TextInput::make('config.telRegex')
133133
->label(__('Telephone regex'))
134-
->visible(fn(Forms\Get $get): bool => $get('config.type') === 'tel'),
134+
->visible(fn (Forms\Get $get): bool => $get('config.type') === 'tel'),
135135
]),
136136
]),
137137
])->columnSpanFull(),

src/Filament/RelationManagers/FieldsRelationManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
use Illuminate\Database\Eloquent\Model;
1616
use Illuminate\Support\Str;
1717
use Livewire\Component;
18-
use Vormkracht10\Fields\Facades\Fields;
1918
use Vormkracht10\Fields\Concerns\HasConfigurableFields;
2019
use Vormkracht10\Fields\Concerns\HasFieldTypeResolver;
20+
use Vormkracht10\Fields\Facades\Fields;
2121
use Vormkracht10\Fields\Models\Field;
2222

2323
class FieldsRelationManager extends RelationManager

0 commit comments

Comments
 (0)