126 lines
6.1 KiB
PHP
126 lines
6.1 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Gutachters\Schemas;
|
|
|
|
use Filament\Forms\Components\FileUpload;
|
|
use Filament\Forms\Components\Radio;
|
|
use Filament\Forms\Components\RichEditor;
|
|
use Filament\Forms\Components\Select;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Schemas\Components\Tabs;
|
|
use Filament\Schemas\Components\Tabs\Tab;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput;
|
|
|
|
class GutachterForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
Tabs::make('Tabs')
|
|
->tabs([
|
|
|
|
Tab::make('Gutachter')
|
|
->icon('lucide-stamp')
|
|
->inlineLabel()
|
|
->schema([
|
|
TextInput::make('company')
|
|
->label('Firma')
|
|
->required(),
|
|
TextInput::make('title')
|
|
->label('Title')
|
|
->required(),
|
|
Select::make('gender')
|
|
->label('Geschlecht')
|
|
->options([
|
|
'Herr' => 'Herr',
|
|
'Frau' => 'Frau',
|
|
'Non-binary' => 'Non-binary',
|
|
])
|
|
->required(),
|
|
TextInput::make('name')
|
|
->label('Name')
|
|
->required(),
|
|
TextInput::make('email')
|
|
->label('E-Mail')
|
|
->required()
|
|
->prefixIcon(Heroicon::Envelope),
|
|
PhoneInput::make('phone')
|
|
->label('Telefon')
|
|
->defaultCountry('AT'),
|
|
]),
|
|
Tab::make('Anzeige')
|
|
->icon('lucide-contact')
|
|
->schema([
|
|
RichEditor::make('gutachten_layout')
|
|
->json()
|
|
->extraInputAttributes(['style' => 'min-height: 20rem; max-height: 50vh; overflow-y: auto;'])
|
|
->toolbarButtons([
|
|
['bold', 'italic', 'underline', 'horizontalRule', 'clearFormatting'],
|
|
['h1', 'h2', 'h3', 'alignStart', 'alignCenter', 'alignEnd', 'textColor'],
|
|
])->floatingToolbars([
|
|
'paragraph' => [
|
|
'bold', 'italic', 'underline', 'strike', 'subscript', 'superscript',
|
|
],
|
|
'heading' => [
|
|
'h1', 'h2', 'h3',
|
|
],
|
|
])
|
|
->textColors([
|
|
'#fb2c36' => 'Rot',
|
|
'#ff6900' => 'Orange',
|
|
'#fe9a00' => 'Bernstein',
|
|
'#f0b100' => 'Gelb',
|
|
'#7ccf00' => 'Limette',
|
|
'#00c950' => 'Grün',
|
|
'#00bc7d' => 'Smaragd',
|
|
'#00bba7' => 'Blaugrün',
|
|
'#00b8db' => 'Cyan',
|
|
'#00a6f4' => 'Himmelblau',
|
|
'#2b7fff' => 'Blau',
|
|
'#615fff' => 'Indigo',
|
|
'#8e51ff' => 'Violett',
|
|
'#ad46ff' => 'Lila',
|
|
'#e12afb' => 'Fuchisa',
|
|
'#f6339a' => 'Rosa',
|
|
'#ff2056' => 'Rose',
|
|
'#a6a09b' => 'Steingrau Hell',
|
|
'#44403b' => 'Steingrau Dunkel',
|
|
'#cad5e2' => 'Schiefer Hell',
|
|
'#314158' => 'Schiefer Dunkel',
|
|
])
|
|
->label('Adresse')
|
|
->required(),
|
|
]),
|
|
Tab::make('Logo')
|
|
->icon('phosphor-image')
|
|
->schema([
|
|
FileUpload::make('logo')
|
|
->image()
|
|
->imageEditor()
|
|
->imageEditorAspectRatios([
|
|
null,
|
|
'16:9',
|
|
'4:3',
|
|
'1:1',
|
|
])
|
|
->disk('public')
|
|
->directory('gutachter-logo')
|
|
->visibility('public')
|
|
->label('Logo'),
|
|
Radio::make('logo_align')
|
|
->Label('Position')
|
|
->default('right')
|
|
->options([
|
|
'left' => 'Links',
|
|
'center' => 'Zentriert',
|
|
'right' => 'Rechts',
|
|
]),
|
|
])->columns(2),
|
|
])->columnSpanFull(),
|
|
]);
|
|
}
|
|
}
|