From ecb66a76b543d9f10860fee209972060c82e1d0f Mon Sep 17 00:00:00 2001 From: salam Date: Tue, 30 Sep 2025 18:37:20 +0200 Subject: [PATCH] plan options --- .../Resources/Kontos/Schemas/KontoForm.php | 131 +++++--- .../Resources/Kontos/Tables/KontosTable.php | 26 +- .../Resources/Plans/Schemas/PlanForm.php | 5 +- .../Resources/Plans/Tables/PlansTable.php | 21 +- app/Forms/Components/PlanRadioGroup.php | 24 -- app/Models/PaymentPlan.php | 10 - app/Models/Plan.php | 19 +- composer.json | 3 +- composer.lock | 304 +++++++++--------- .../2025_09_06_143006_create_plan_table.php | 4 +- database/seeders/PlansSeeder.php | 8 +- .../components/icon-picker-component.js | 1 + resources/css/filament/admin/theme.css | 2 +- .../components/custom-radio-group.blade.php | 22 -- 14 files changed, 277 insertions(+), 303 deletions(-) delete mode 100644 app/Forms/Components/PlanRadioGroup.php delete mode 100644 app/Models/PaymentPlan.php create mode 100644 public/js/guava/filament-icon-picker/components/icon-picker-component.js delete mode 100644 resources/views/forms/components/custom-radio-group.blade.php diff --git a/app/Filament/Resources/Kontos/Schemas/KontoForm.php b/app/Filament/Resources/Kontos/Schemas/KontoForm.php index a43b595..0a4b633 100644 --- a/app/Filament/Resources/Kontos/Schemas/KontoForm.php +++ b/app/Filament/Resources/Kontos/Schemas/KontoForm.php @@ -2,15 +2,20 @@ namespace App\Filament\Resources\Kontos\Schemas; -use Alkoumi\FilamentImageRadioButton\Forms\Components\ImageRadioGroup; use App\Models\Konto; use App\Models\Plan; use Danielebarbaro\LaravelVatEuValidator\Rules\VatNumber; use Filament\Forms\Components\Select; use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; -use Filament\Schemas\Components\Section; +use Filament\Schemas\Components\Tabs; +use Filament\Schemas\Components\Tabs\Tab; use Filament\Schemas\Schema; +use Filament\Support\Enums\Alignment; +use Filament\Support\Enums\IconPosition; +use Filament\Support\Enums\IconSize; +use Filament\Support\Icons\Heroicon; +use JaOcero\RadioDeck\Forms\Components\RadioDeck; use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput; class KontoForm @@ -20,57 +25,77 @@ class KontoForm return $schema ->components([ - // Radio Cards with default features - - // ImageRadioGroup::make('plan_id') - // ->animation(true) - // ->disk('promotion') - // ->label('Plan') - // ->required() - // ->columnSpanFull() - // ->options(fn () => Plan::pluck('promotion', 'id')->toArray()), - Section::make('Firma') - ->inlineLabel() - ->schema([ - TextInput::make('company') - ->label('Firma') - ->required(), - TextInput::make('uid_number') - ->label('UID Nummer') - ->rules([new VatNumber]) - ->required(), - Textarea::make('address') - ->label('Adresse') - ->required(), - TextInput::make('country') - ->label('Land') - ->default('Österreich') - ->required(), - ])->columnSpanFull(), - Section::make('Kontaktperson') - ->inlineLabel() - ->schema([ - 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') - ->unique(table: Konto::class) - ->required(), - PhoneInput::make('phone') - ->label('Telefon') - ->defaultCountry('AT'), + Tabs::make('Tabs') + ->tabs([ + Tab::make('Zahlungsplan') + ->schema([ + RadioDeck::make('plan_id') + ->label('Wählen sie eine Option') + ->options(fn () => Plan::pluck('name', 'id')->toArray()) + ->descriptions(Plan::options()) + ->icons(fn () => Plan::pluck('icon', 'id')->toArray()) + ->required() + ->iconPosition(IconPosition::Before) // Before | After + ->iconSize(IconSize::TwoExtraLarge) + ->alignment(Alignment::Center) // Start | Center | End + ->padding('px-4 py-6') // Padding around the deck + ->extraCardsAttributes([ // Extra attributes for card elements + 'class' => 'rounded-xl drop-shadow-xl mt-1', + ]) + ->extraOptionsAttributes([ // Extra attributes for option elements + 'class' => 'text-2xl md:text-3xl font-black tracking-tight lg:text-4xl', + ]) + // ->extraDescriptionsAttributes([ // Extra attributes for description elements + // 'class' => 'text-sm font-light', + // ]) + ->colors('primary') + ->columns(3) + ->columnSpanFull(), + ])->columnSpanFull(), + Tab::make('Firma') + ->inlineLabel() + ->schema([ + TextInput::make('company') + ->label('Firma') + ->required(), + TextInput::make('uid_number') + ->label('UID Nummer') + ->rules([new VatNumber]) + ->required(), + Textarea::make('address') + ->label('Adresse') + ->required(), + TextInput::make('country') + ->label('Land') + ->default('Österreich') + ->required(), + ])->columnSpanFull(), + Tab::make('Kontaktperson') + ->inlineLabel() + ->schema([ + 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') + ->unique(table: Konto::class) + ->required() + ->prefixIcon(Heroicon::Envelope), + PhoneInput::make('phone') + ->label('Telefon') + ->defaultCountry('AT'), + ])->columnSpanFull(), ])->columnSpanFull(), ]); diff --git a/app/Filament/Resources/Kontos/Tables/KontosTable.php b/app/Filament/Resources/Kontos/Tables/KontosTable.php index 08e0f1f..b0e5ee9 100644 --- a/app/Filament/Resources/Kontos/Tables/KontosTable.php +++ b/app/Filament/Resources/Kontos/Tables/KontosTable.php @@ -2,13 +2,14 @@ namespace App\Filament\Resources\Kontos\Tables; -use App\Forms\Components\PlanRadioGroup; use Filament\Actions\Action; use Filament\Actions\EditAction; use Filament\Forms\Components\RichEditor; use Filament\Forms\Components\TextInput; use Filament\Support\Enums\FontWeight; +use Filament\Support\Enums\IconSize; use Filament\Support\Enums\TextSize; +use Filament\Tables\Columns\IconColumn; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Table; @@ -20,6 +21,13 @@ class KontosTable ->columns([ TextColumn::make('company')->label('Firma') ->description(fn ($record): string => $record->address), + IconColumn::make('plan.icon') + ->width('30px') + ->label('') + ->size(IconSize::TwoExtraLarge) + ->color('primary') + ->icon(fn (string $state): string => $state) + ->extraAttributes(['class' => 'rounded-xl border border-gray-200 dark:border-gray-700 drop-shadow-xl']), TextColumn::make('plan.name') ->label('Zahlungs Plan') @@ -28,7 +36,7 @@ class KontosTable TextColumn::make('guthaben') ->size(TextSize::Large) ->weight(FontWeight::Bold) - ->label('Fertig') + ->label('Erstellt') ->color('primary') ->description('Gutachten') ->alignCenter(), @@ -43,20 +51,6 @@ class KontosTable ]) ->recordActions([ EditAction::make()->iconButton()->color('gray'), - Action::make('Konto') - ->iconButton() - ->color('gray') - ->icon('lucide-plane-takeoff') - ->schema([ - PlanRadioGroup::make('plan_id') - ->label('Plan') - ->options(fn () => Plan::pluck('name', 'id')->toArray()), - // ->options([ - // '1' => 'Basic', - // '2' => 'Smart', - // '3' => 'Premium', - // ]), - ]), Action::make('Bezahlen') ->iconButton() ->color('gray') diff --git a/app/Filament/Resources/Plans/Schemas/PlanForm.php b/app/Filament/Resources/Plans/Schemas/PlanForm.php index f609767..69ae951 100644 --- a/app/Filament/Resources/Plans/Schemas/PlanForm.php +++ b/app/Filament/Resources/Plans/Schemas/PlanForm.php @@ -2,7 +2,6 @@ namespace App\Filament\Resources\Plans\Schemas; -use Filament\Forms\Components\FileUpload; use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; use Filament\Schemas\Schema; @@ -18,10 +17,8 @@ class PlanForm Textarea::make('description')->label('Beschreibung')->required(), TextInput::make('preis')->required()->numeric(), TextInput::make('limit_user')->required()->label('Anzahl Benutzer')->numeric(), - TextInput::make('limit_auftraggeber')->required()->label('Anzahl Auftraggeber')->numeric(), TextInput::make('limit_gutachter')->required()->label('Anzahl Gutachter')->numeric(), - TextInput::make('limit_gutachten')->required()->label('Anzahl Projekte')->numeric(), - FileUpload::make('promotion')->disk('promotion'), + TextInput::make('icon'), ])->inlineLabel()->columns(1); } } diff --git a/app/Filament/Resources/Plans/Tables/PlansTable.php b/app/Filament/Resources/Plans/Tables/PlansTable.php index 257128e..22e1e79 100644 --- a/app/Filament/Resources/Plans/Tables/PlansTable.php +++ b/app/Filament/Resources/Plans/Tables/PlansTable.php @@ -3,7 +3,8 @@ namespace App\Filament\Resources\Plans\Tables; use Filament\Actions\EditAction; -use Filament\Tables\Columns\ImageColumn; +use Filament\Support\Enums\IconSize; +use Filament\Tables\Columns\IconColumn; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Table; @@ -13,15 +14,17 @@ class PlansTable { return $table ->columns([ - ImageColumn::make('promotion')->imageHeight(100)->disk('promotion'), + IconColumn::make('icon') + ->label('') + ->size(IconSize::TwoExtraLarge) + ->color('primary') + ->icon(fn (string $state): string => $state), TextColumn::make('name') ->description(fn ($record): string => $record->description) ->wrap(), TextColumn::make('payment')->label('Plan'), - TextColumn::make('limit_user')->label('B')->tooltip('Benutzer')->badge(), - TextColumn::make('limit_auftraggeber')->label('A')->tooltip('Auftraggeber')->badge(), - TextColumn::make('limit_gutachter')->label('G')->tooltip('Gutachter')->badge(), - TextColumn::make('limit_gutachten')->label('P')->tooltip('Projekte')->badge(), + TextColumn::make('limit_user')->label('Benutzer')->badge(), + TextColumn::make('limit_gutachter')->label('Gutachter')->badge(), TextColumn::make('preis')->money('EUR'), ]) ->recordActions([ @@ -29,9 +32,3 @@ class PlansTable ]); } } -// `file` varchar(255) DEFAULT NULL, -// `preis` int(11) NOT NULL DEFAULT 0, -// `limit_user` int(11) NOT NULL DEFAULT 1, -// `limit_auftraggeber` int(11) NOT NULL DEFAULT 1, -// `limit_gutachter` int(11) NOT NULL DEFAULT 1, -// `limit_gutachten` int(11) D diff --git a/app/Forms/Components/PlanRadioGroup.php b/app/Forms/Components/PlanRadioGroup.php deleted file mode 100644 index 957da04..0000000 --- a/app/Forms/Components/PlanRadioGroup.php +++ /dev/null @@ -1,24 +0,0 @@ -options = $options; - - return $this; - } - - public function getOptions(): array - { - return $this->evaluate($this->options); - } -} diff --git a/app/Models/PaymentPlan.php b/app/Models/PaymentPlan.php deleted file mode 100644 index 83a27b1..0000000 --- a/app/Models/PaymentPlan.php +++ /dev/null @@ -1,10 +0,0 @@ -toArray(); + foreach ($arr as $key => $value) { + $str = '
'.$value['payment'].'
'; + $str .= '
'.number_format($value['preis'], 2).'€
'; + $str .= '
    '; + $str .= '
  1. '.$value['limit_user'].' Benutzer
  2. '; + $str .= '
  3. '.$value['limit_gutachter'].' Gutachter
  4. '; + $str .= '
'; + $arr[$key + 1] = new HtmlString($str); + } + + return $arr; + } } diff --git a/composer.json b/composer.json index 814a714..911c6e2 100644 --- a/composer.json +++ b/composer.json @@ -11,11 +11,12 @@ "require": { "php": "^8.3", "agencetwogether/hookshelper": "^0.0.2", - "alkoumi/filament-image-radio-button": "^1.1", "awcodes/light-switch": "^2.0", "bezhansalleh/filament-shield": "*", + "codeat3/blade-phosphor-icons": "^2.3", "danielebarbaro/laravel-vat-eu-validator": "^2.0", "filament/filament": "^4.0", + "jaocero/radio-deck": "^2.0", "laravel/framework": "^12.0", "laravel/tinker": "^2.10.1", "livewire/livewire": "^3.6", diff --git a/composer.lock b/composer.lock index 0fad947..3a57e8d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fe30cc68d11a563e43d6f90831ac7b29", + "content-hash": "73c1ae2de1cd4105b50ac2d91b6220dd", "packages": [ { "name": "agencetwogether/hookshelper", @@ -79,80 +79,6 @@ ], "time": "2025-06-16T20:05:22+00:00" }, - { - "name": "alkoumi/filament-image-radio-button", - "version": "v1.1.7", - "source": { - "type": "git", - "url": "https://github.com/alkoumi/filament-image-radio-button.git", - "reference": "a8e91551adb1725a9219ae7c379a8474e7b4638f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/alkoumi/filament-image-radio-button/zipball/a8e91551adb1725a9219ae7c379a8474e7b4638f", - "reference": "a8e91551adb1725a9219ae7c379a8474e7b4638f", - "shasum": "" - }, - "require": { - "filament/filament": "^3.0|^4.0", - "php": "^8.1|^8.2|^8.3|^8.4", - "spatie/laravel-package-tools": "^1.15.0" - }, - "require-dev": { - "filament/upgrade": "^4.0", - "nunomaduro/collision": "*", - "orchestra/testbench": "^10.6" - }, - "type": "library", - "extra": { - "laravel": { - "aliases": { - "FilamentImageRadioButton": "Alkoumi\\FilamentImageRadioButton\\Facades\\FilamentImageRadioButton" - }, - "providers": [ - "Alkoumi\\FilamentImageRadioButton\\FilamentImageRadioButtonServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Alkoumi\\FilamentImageRadioButton\\": "src/", - "Alkoumi\\FilamentImageRadioButton\\Database\\Factories\\": "database/factories/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mohamed alkoumi", - "email": "mohammedelkoumi@gmail.com", - "role": "Developer" - } - ], - "description": "Filament Form Radio Button But With Images", - "homepage": "https://github.com/alkoumi/filament-image-radio-button", - "keywords": [ - "alkoumi", - "filament", - "filament-image-radio-button", - "image-radio-button", - "image-select", - "laravel" - ], - "support": { - "issues": "https://github.com/alkoumi/filament-image-radio-button/issues", - "source": "https://github.com/alkoumi/filament-image-radio-button" - }, - "funding": [ - { - "url": "https://github.com/alkoumi", - "type": "github" - } - ], - "time": "2025-08-27T14:45:42+00:00" - }, { "name": "anourvalar/eloquent-serialize", "version": "1.3.4", @@ -902,6 +828,77 @@ ], "time": "2024-07-16T11:13:48+00:00" }, + { + "name": "codeat3/blade-phosphor-icons", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/codeat3/blade-phosphor-icons.git", + "reference": "2812a27ec642359344429d344c7f7bbdfad489ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/codeat3/blade-phosphor-icons/zipball/2812a27ec642359344429d344c7f7bbdfad489ce", + "reference": "2812a27ec642359344429d344c7f7bbdfad489ce", + "shasum": "" + }, + "require": { + "blade-ui-kit/blade-icons": "^1.1", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0", + "php": "^7.4|^8.0" + }, + "require-dev": { + "codeat3/blade-icon-generation-helpers": "^0.10", + "codeat3/phpcs-styles": "^1.0", + "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0|^10.0", + "phpunit/phpunit": "^9.0|^10.5|^11.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Codeat3\\BladePhosphorIcons\\BladePhosphorIconsServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Codeat3\\BladePhosphorIcons\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Swapnil Sarwe", + "homepage": "https://swapnilsarwe.com" + }, + { + "name": "Dries Vints", + "homepage": "https://driesvints.com" + } + ], + "description": "A package to easily make use of \"Phosphor Icons\" in your Laravel Blade views.", + "homepage": "https://github.com/codeat3/blade-phosphor-icons", + "keywords": [ + "blade", + "laravel", + "phosphor-icons" + ], + "support": { + "issues": "https://github.com/codeat3/blade-phosphor-icons/issues", + "source": "https://github.com/codeat3/blade-phosphor-icons/tree/2.3.0" + }, + "funding": [ + { + "url": "https://github.com/swapnilsarwe", + "type": "github" + } + ], + "time": "2025-02-25T06:29:09+00:00" + }, { "name": "danharrin/date-format-converter", "version": "v0.3.1", @@ -2525,6 +2522,81 @@ ], "time": "2025-08-22T14:27:06+00:00" }, + { + "name": "jaocero/radio-deck", + "version": "v2.0", + "source": { + "type": "git", + "url": "https://github.com/199ocero/radio-deck.git", + "reference": "15b72137cdc0e91e8f0b98f1f0f7d3f0e1c209b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/199ocero/radio-deck/zipball/15b72137cdc0e91e8f0b98f1f0f7d3f0e1c209b4", + "reference": "15b72137cdc0e91e8f0b98f1f0f7d3f0e1c209b4", + "shasum": "" + }, + "require": { + "filament/forms": "^4.0", + "illuminate/contracts": "^11.0|^12.0", + "php": "^8.2", + "spatie/laravel-package-tools": "^1.15.0" + }, + "require-dev": { + "laravel/pint": "^1.24", + "nunomaduro/collision": "^8.1", + "orchestra/testbench": "^9.0", + "pestphp/pest": "^2.0", + "pestphp/pest-plugin-arch": "^2.0", + "pestphp/pest-plugin-laravel": "^2.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "JaOcero\\RadioDeck\\RadioDeckServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "JaOcero\\RadioDeck\\": "src/", + "JaOcero\\RadioDeck\\Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jay-Are Ocero", + "email": "199ocero@gmail.com", + "role": "Developer" + } + ], + "description": "Turn filament default radio button into a selectable card with icons, title and description.", + "homepage": "https://github.com/jaocero/radio-deck", + "keywords": [ + "filament-form", + "filament-plugin", + "filamentphp", + "jaocero", + "laravel", + "radio-deck" + ], + "support": { + "issues": "https://github.com/jaocero/radio-deck/issues", + "source": "https://github.com/jaocero/radio-deck" + }, + "funding": [ + { + "url": "https://github.com/jaocero", + "type": "github" + } + ], + "time": "2025-09-14T12:02:21+00:00" + }, { "name": "kirschbaum-development/eloquent-power-joins", "version": "4.2.8", @@ -2590,16 +2662,16 @@ }, { "name": "laravel/framework", - "version": "v12.31.1", + "version": "v12.32.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "281b711710c245dd8275d73132e92635be3094df" + "reference": "d41e4ba47706ec85bda85fe9362515592871cd21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/281b711710c245dd8275d73132e92635be3094df", - "reference": "281b711710c245dd8275d73132e92635be3094df", + "url": "https://api.github.com/repos/laravel/framework/zipball/d41e4ba47706ec85bda85fe9362515592871cd21", + "reference": "d41e4ba47706ec85bda85fe9362515592871cd21", "shasum": "" }, "require": { @@ -2627,7 +2699,6 @@ "monolog/monolog": "^3.0", "nesbot/carbon": "^3.8.4", "nunomaduro/termwind": "^2.0", - "phiki/phiki": "^2.0.0", "php": "^8.2", "psr/container": "^1.1.1|^2.0.1", "psr/log": "^1.0|^2.0|^3.0", @@ -2806,7 +2877,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2025-09-23T15:33:04+00:00" + "time": "2025-09-30T12:22:56+00:00" }, { "name": "laravel/prompts", @@ -4659,77 +4730,6 @@ }, "time": "2025-09-24T15:06:41+00:00" }, - { - "name": "phiki/phiki", - "version": "v2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phikiphp/phiki.git", - "reference": "160785c50c01077780ab217e5808f00ab8f05a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phikiphp/phiki/zipball/160785c50c01077780ab217e5808f00ab8f05a13", - "reference": "160785c50c01077780ab217e5808f00ab8f05a13", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "league/commonmark": "^2.5.3", - "php": "^8.2", - "psr/simple-cache": "^3.0" - }, - "require-dev": { - "illuminate/support": "^11.45", - "laravel/pint": "^1.18.1", - "orchestra/testbench": "^9.15", - "pestphp/pest": "^3.5.1", - "phpstan/extension-installer": "^1.4.3", - "phpstan/phpstan": "^2.0", - "symfony/var-dumper": "^7.1.6" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Phiki\\Adapters\\Laravel\\PhikiServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Phiki\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ryan Chandler", - "email": "support@ryangjchandler.co.uk", - "homepage": "https://ryangjchandler.co.uk", - "role": "Developer" - } - ], - "description": "Syntax highlighting using TextMate grammars in PHP.", - "support": { - "issues": "https://github.com/phikiphp/phiki/issues", - "source": "https://github.com/phikiphp/phiki/tree/v2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sponsors/ryangjchandler", - "type": "github" - }, - { - "url": "https://buymeacoffee.com/ryangjchandler", - "type": "other" - } - ], - "time": "2025-09-20T17:21:02+00:00" - }, { "name": "phpoption/phpoption", "version": "1.9.4", diff --git a/database/migrations/2025_09_06_143006_create_plan_table.php b/database/migrations/2025_09_06_143006_create_plan_table.php index 0c95e67..028e256 100644 --- a/database/migrations/2025_09_06_143006_create_plan_table.php +++ b/database/migrations/2025_09_06_143006_create_plan_table.php @@ -13,15 +13,13 @@ return new class extends Migration { Schema::create('plans', function (Blueprint $table) { $table->id(); + $table->string('icon')->nullable(); $table->string('name')->nullable(); $table->string('payment')->nullable(); $table->string('description')->nullable(); - $table->string('promotion')->nullable(); $table->integer('preis')->default(0); $table->integer('limit_user')->default(1); - $table->integer('limit_auftraggeber')->default(1); $table->integer('limit_gutachter')->default(1); - $table->integer('limit_gutachten')->nullable(); $table->timestamps(); }); } diff --git a/database/seeders/PlansSeeder.php b/database/seeders/PlansSeeder.php index 7c69cd6..7e50e5e 100644 --- a/database/seeders/PlansSeeder.php +++ b/database/seeders/PlansSeeder.php @@ -12,11 +12,11 @@ class PlansSeeder extends Seeder */ public function run(): void { - $sql = "INSERT INTO `plans` (`id`, `name`, `payment`, `description`, `promotion`, `preis`, `limit_user`, `limit_auftraggeber`, `limit_gutachter`, `limit_gutachten`, `created_at`, `updated_at`) + $sql = "INSERT INTO `plans` (`id`, `name`, `payment`, `description`, `icon`, `preis`, `limit_user`, `limit_gutachter`, `created_at`, `updated_at`) VALUES - ('1', 'Standard', 'Per Gutachten', 'Zahlungen werden für jedes Gutachten einzeln getätigt.', 'promotion/basic.jpg', '75', '1', '1', '1', '1', NULL, NULL), - ('2', 'Smart', 'Monatlich', 'Zahlung erfolgt monatlich, ohne Begrenzung der Gutachten.', 'promotion/smart.jpg', '150', '3', '1', '3', '-1', NULL, NULL), - ('3', 'Premium', 'Jährlich', 'Zahlung erfolgt jährlich, ohne Begrenzung für Gutachten, Gutachter oder Auftraggeber.', 'promotion/premium.jpg', '1750', '10', '5', '5', '-1', NULL, NULL); + ('1', 'Basic', 'Per Gutachten', 'Zahlungen per Gutachten.', 'phosphor-airplane-thin', '75', '1', '1', NULL, '2025-09-30 15:53:33'), + ('2', 'Standard', 'Monatlich', 'Zahlung erfolgt monatlich, ohne Begrenzung der Gutachten.', 'phosphor-airplane-takeoff-thin', '150', '3', '3', NULL, '2025-09-30 15:53:42'), + ('3', 'Premium', 'Jährlich', 'Zahlung erfolgt jährlich, ohne Begrenzung für Gutachten, Gutachter oder Auftraggeber.', 'phosphor-airplane-in-flight-thin', '1750', '10', '5', NULL, '2025-09-30 15:53:47'); "; DB::unprepared($sql); } diff --git a/public/js/guava/filament-icon-picker/components/icon-picker-component.js b/public/js/guava/filament-icon-picker/components/icon-picker-component.js new file mode 100644 index 0000000..592b3a1 --- /dev/null +++ b/public/js/guava/filament-icon-picker/components/icon-picker-component.js @@ -0,0 +1 @@ +function I(e){return Array.isArray?Array.isArray(e):ft(e)==="[object Array]"}var Et=1/0;function mt(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-Et?"-0":t}function Dt(e){return e==null?"":mt(e)}function F(e){return typeof e=="string"}function lt(e){return typeof e=="number"}function Ft(e){return e===!0||e===!1||Bt(e)&&ft(e)=="[object Boolean]"}function dt(e){return typeof e=="object"}function Bt(e){return dt(e)&&e!==null}function C(e){return e!=null}function V(e){return!e.trim().length}function ft(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var Mt="Incorrect 'index' type",It=e=>`Invalid value for key ${e}`,yt=e=>`Pattern length exceeds max of ${e}.`,_t=e=>`Missing ${e} property in key`,St=e=>`Property 'weight' in key '${e}' must be a positive integer`,ut=Object.prototype.hasOwnProperty,H=class{constructor(t){this._keys=[],this._keyMap={};let s=0;t.forEach(n=>{let i=gt(n);this._keys.push(i),this._keyMap[i.id]=i,s+=i.weight}),this._keys.forEach(n=>{n.weight/=s})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function gt(e){let t=null,s=null,n=null,i=1,r=null;if(F(e)||I(e))n=e,t=ct(e),s=U(e);else{if(!ut.call(e,"name"))throw new Error(_t("name"));let c=e.name;if(n=c,ut.call(e,"weight")&&(i=e.weight,i<=0))throw new Error(St(c));t=ct(c),s=U(c),r=e.getFn}return{path:t,id:s,weight:i,src:n,getFn:r}}function ct(e){return I(e)?e:e.split(".")}function U(e){return I(e)?e.join("."):e}function wt(e,t){let s=[],n=!1,i=(r,c,o)=>{if(C(r))if(!c[o])s.push(r);else{let h=c[o],u=r[h];if(!C(u))return;if(o===c.length-1&&(F(u)||lt(u)||Ft(u)))s.push(Dt(u));else if(I(u)){n=!0;for(let a=0,d=u.length;ae.score===t.score?e.idx{this._keysMap[s.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,F(this.docs[0])?this.docs.forEach((t,s)=>{this._addString(t,s)}):this.docs.forEach((t,s)=>{this._addObject(t,s)}),this.norm.clear())}add(t){let s=this.size();F(t)?this._addString(t,s):this._addObject(t,s)}removeAt(t){this.records.splice(t,1);for(let s=t,n=this.size();s{let c=i.getFn?i.getFn(t):this.getFn(t,i.path);if(C(c)){if(I(c)){let o=[],h=[{nestedArrIndex:-1,value:c}];for(;h.length;){let{nestedArrIndex:u,value:a}=h.pop();if(C(a))if(F(a)&&!V(a)){let d={v:a,i:u,n:this.norm.get(a)};o.push(d)}else I(a)&&a.forEach((d,f)=>{h.push({nestedArrIndex:f,value:d})})}n.$[r]=o}else if(F(c)&&!V(c)){let o={v:c,n:this.norm.get(c)};n.$[r]=o}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}};function At(e,t,{getFn:s=l.getFn,fieldNormWeight:n=l.fieldNormWeight}={}){let i=new O({getFn:s,fieldNormWeight:n});return i.setKeys(e.map(gt)),i.setSources(t),i.create(),i}function Nt(e,{getFn:t=l.getFn,fieldNormWeight:s=l.fieldNormWeight}={}){let{keys:n,records:i}=e,r=new O({getFn:t,fieldNormWeight:s});return r.setKeys(n),r.setIndexRecords(i),r}function N(e,{errors:t=0,currentLocation:s=0,expectedLocation:n=0,distance:i=l.distance,ignoreLocation:r=l.ignoreLocation}={}){let c=t/e.length;if(r)return c;let o=Math.abs(n-s);return i?c+o/i:o?1:c}function $t(e=[],t=l.minMatchCharLength){let s=[],n=-1,i=-1,r=0;for(let c=e.length;r=t&&s.push([n,i]),n=-1)}return e[r-1]&&r-n>=t&&s.push([n,r-1]),s}var L=32;function Tt(e,t,s,{location:n=l.location,distance:i=l.distance,threshold:r=l.threshold,findAllMatches:c=l.findAllMatches,minMatchCharLength:o=l.minMatchCharLength,includeMatches:h=l.includeMatches,ignoreLocation:u=l.ignoreLocation}={}){if(t.length>L)throw new Error(yt(L));let a=t.length,d=e.length,f=Math.max(0,Math.min(n,d)),g=r,A=f,p=o>1||h,m=p?Array(d):[],_;for(;(_=e.indexOf(t,A))>-1;){let E=N(t,{currentLocation:_,expectedLocation:f,distance:i,ignoreLocation:u});if(g=Math.min(E,g),A=_+a,p){let S=0;for(;S=it;D-=1){let k=D-1,rt=s[e.charAt(k)];if(p&&(m[k]=+!!rt),R[D]=(R[D+1]<<1|1)&rt,E&&(R[D]|=(M[D+1]|M[D])<<1|1|M[D+1]),R[D]&Ct&&(b=N(t,{errors:E,currentLocation:k,expectedLocation:f,distance:i,ignoreLocation:u}),b<=g)){if(g=b,A=k,A<=f)break;it=Math.max(1,2*f-A)}}if(N(t,{errors:E+1,currentLocation:f,expectedLocation:f,distance:i,ignoreLocation:u})>g)break;M=R}let K={isMatch:A>=0,score:Math.max(.001,b)};if(p){let E=$t(m,o);E.length?h&&(K.indices=E):K.isMatch=!1}return K}function vt(e){let t={};for(let s=0,n=e.length;se.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e,T=class{constructor(t,{location:s=l.location,threshold:n=l.threshold,distance:i=l.distance,includeMatches:r=l.includeMatches,findAllMatches:c=l.findAllMatches,minMatchCharLength:o=l.minMatchCharLength,isCaseSensitive:h=l.isCaseSensitive,ignoreDiacritics:u=l.ignoreDiacritics,ignoreLocation:a=l.ignoreLocation}={}){if(this.options={location:s,threshold:n,distance:i,includeMatches:r,findAllMatches:c,minMatchCharLength:o,isCaseSensitive:h,ignoreDiacritics:u,ignoreLocation:a},t=h?t:t.toLowerCase(),t=u?$(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;let d=(g,A)=>{this.chunks.push({pattern:g,alphabet:vt(g),startIndex:A})},f=this.pattern.length;if(f>L){let g=0,A=f%L,p=f-A;for(;g{let{isMatch:M,score:b,indices:x}=Tt(t,p,m,{location:r+_,distance:c,threshold:o,findAllMatches:h,minMatchCharLength:u,includeMatches:i,ignoreLocation:a});M&&(g=!0),f+=b,M&&x&&(d=[...d,...x])});let A={isMatch:g,score:g?f/this.chunks.length:1};return g&&i&&(A.indices=d),A}},B=class{constructor(t){this.pattern=t}static isMultiMatch(t){return ot(t,this.multiRegex)}static isSingleMatch(t){return ot(t,this.singleRegex)}search(){}};function ot(e,t){let s=e.match(t);return s?s[1]:null}var z=class extends B{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){let s=t===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}},Y=class extends B{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){let n=t.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}},G=class extends B{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){let s=t.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}},Q=class extends B{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){let s=!t.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}},X=class extends B{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){let s=t.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},J=class extends B{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){let s=!t.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}},v=class extends B{constructor(t,{location:s=l.location,threshold:n=l.threshold,distance:i=l.distance,includeMatches:r=l.includeMatches,findAllMatches:c=l.findAllMatches,minMatchCharLength:o=l.minMatchCharLength,isCaseSensitive:h=l.isCaseSensitive,ignoreDiacritics:u=l.ignoreDiacritics,ignoreLocation:a=l.ignoreLocation}={}){super(t),this._bitapSearch=new T(t,{location:s,threshold:n,distance:i,includeMatches:r,findAllMatches:c,minMatchCharLength:o,isCaseSensitive:h,ignoreDiacritics:u,ignoreLocation:a})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}},P=class extends B{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let s=0,n,i=[],r=this.pattern.length;for(;(n=t.indexOf(this.pattern,s))>-1;)s=n+r,i.push([n,s-1]);let c=!!i.length;return{isMatch:c,score:c?0:1,indices:i}}},Z=[z,P,G,Q,J,X,Y,v],ht=Z.length,Pt=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,jt="|";function Kt(e,t={}){return e.split(jt).map(s=>{let n=s.trim().split(Pt).filter(r=>r&&!!r.trim()),i=[];for(let r=0,c=n.length;r!!(e[j.AND]||e[j.OR]),Ht=e=>!!e[st.PATH],Ut=e=>!I(e)&&dt(e)&&!nt(e),at=e=>({[j.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function pt(e,t,{auto:s=!0}={}){let n=i=>{let r=Object.keys(i),c=Ht(i);if(!c&&r.length>1&&!nt(i))return n(at(i));if(Ut(i)){let h=c?i[st.PATH]:r[0],u=c?i[st.PATTERN]:i[h];if(!F(u))throw new Error(It(h));let a={keyId:U(h),pattern:u};return s&&(a.searcher=et(u,t)),a}let o={children:[],operator:r[0]};return r.forEach(h=>{let u=i[h];I(u)&&u.forEach(a=>{o.children.push(n(a))})}),o};return nt(e)||(e=at(e)),n(e)}function zt(e,{ignoreFieldNorm:t=l.ignoreFieldNorm}){e.forEach(s=>{let n=1;s.matches.forEach(({key:i,norm:r,score:c})=>{let o=i?i.weight:null;n*=Math.pow(c===0&&o?Number.EPSILON:c,(o||1)*(t?1:r))}),s.score=n})}function Yt(e,t){let s=e.matches;t.matches=[],C(s)&&s.forEach(n=>{if(!C(n.indices)||!n.indices.length)return;let{indices:i,value:r}=n,c={indices:i,value:r};n.key&&(c.key=n.key.src),n.idx>-1&&(c.refIndex=n.idx),t.matches.push(c)})}function Gt(e,t){t.score=e.score}function Qt(e,t,{includeMatches:s=l.includeMatches,includeScore:n=l.includeScore}={}){let i=[];return s&&i.push(Yt),n&&i.push(Gt),e.map(r=>{let{idx:c}=r,o={item:t[c],refIndex:c};return i.length&&i.forEach(h=>{h(r,o)}),o})}var y=class{constructor(t,s={},n){this.options={...l,...s},this.options.useExtendedSearch,this._keyStore=new H(this.options.keys),this.setCollection(t,n)}setCollection(t,s){if(this._docs=t,s&&!(s instanceof O))throw new Error(Mt);this._myIndex=s||At(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){C(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){let s=[];for(let n=0,i=this._docs.length;n-1&&(h=h.slice(0,s)),Qt(h,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(t){let s=et(t,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:r,i:c,n:o})=>{if(!C(r))return;let{isMatch:h,score:u,indices:a}=s.searchIn(r);h&&i.push({item:r,idx:c,matches:[{score:u,value:r,norm:o,indices:a}]})}),i}_searchLogical(t){let s=pt(t,this.options),n=(o,h,u)=>{if(!o.children){let{keyId:d,searcher:f}=o,g=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(h,d),searcher:f});return g&&g.length?[{idx:u,item:h,matches:g}]:[]}let a=[];for(let d=0,f=o.children.length;d{if(C(o)){let u=n(s,o,h);u.length&&(r[h]||(r[h]={idx:h,item:o,matches:[]},c.push(r[h])),u.forEach(({matches:a})=>{r[h].matches.push(...a)}))}}),c}_searchObjectList(t){let s=et(t,this.options),{keys:n,records:i}=this._myIndex,r=[];return i.forEach(({$:c,i:o})=>{if(!C(c))return;let h=[];n.forEach((u,a)=>{h.push(...this._findMatches({key:u,value:c[a],searcher:s}))}),h.length&&r.push({idx:o,item:c,matches:h})}),r}_findMatches({key:t,value:s,searcher:n}){if(!C(s))return[];let i=[];if(I(s))s.forEach(({v:r,i:c,n:o})=>{if(!C(r))return;let{isMatch:h,score:u,indices:a}=n.searchIn(r);h&&i.push({score:u,key:t,value:r,idx:c,norm:o,indices:a})});else{let{v:r,n:c}=s,{isMatch:o,score:h,indices:u}=n.searchIn(r);o&&i.push({score:h,key:t,value:r,norm:c,indices:u})}return i}};y.version="7.1.0";y.createIndex=At;y.parseIndex=Nt;y.config=l;y.parseQuery=pt;Vt(q);function Xt({key:e,state:t,displayName:s,isDropdown:n,shouldCloseOnSelect:i,getSetUsing:r,getIconsUsing:c,getIconSvgUsing:o,verifyStateUsing:h}){return{state:t,displayName:s,isDropdown:n,shouldCloseOnSelect:i,dropdownOpen:!1,set:null,icons:[],search:"",fuse:null,results:[],resultsVisible:[],minimumItems:300,resultsPerPage:50,resultsIndex:0,isLoading:!1,async init(){await h(this.state).then(u=>this.state=u),await this.loadIcons(),this.$wire.on(`custom-icon-uploaded::${e}`,u=>{this.displayName=u.label,this.set=u.set,this.afterSetUpdated()})},deferLoadingState(){return setTimeout(()=>this.isLoading=!0,150)},async loadIcons(){return this.isLoading=!0,await c(this.set).then(u=>{this.icons=u,this.createFuseObject(),this.resetSearchResults(),this.isLoading=!1})},async loadSet(){return this.isLoading=!0,await r(this.state).then(u=>{this.set=u,this.isLoading=!1})},afterStateUpdated(){},afterSetUpdated(){this.loadIcons()},async updateSelectedIcon(u=!0){this.icons.find(d=>d.id===this.state)||u&&(await this.loadSet(),await this.loadIcons(),await this.updateSelectedIcon(!1))},setElementIcon(u,a,d=null){o(a).then(f=>u.innerHTML=f).finally(d)},createFuseObject(){let u={includeScore:!0,keys:["id"]};this.fuse=new y(this.icons,u)},resetSearchResults(){this.resultsPerPage=20,this.resultsIndex=0,this.results=this.icons,this.resultsVisible=[],this.addSearchResultsChunk()},setSelect:{async"x-on:change"(u){let a=u.target.value;this.set=a||null,this.afterSetUpdated()}},searchInput:{"x-on:input.debounce"(u){let a=u.target.value,d=this.deferLoadingState();a.length?(this.resultsVisible=[],this.resultsIndex=0,this.results=this.fuse.search(a).map(f=>f.item),this.addSearchResultsChunk()):this.resetSearchResults(),clearTimeout(d),this.isLoading=!1}},dropdownTrigger:{"x-on:click.prevent"(){this.dropdownOpen=!0}},dropdownMenu:{"x-show"(){return!this.isDropdown||this.dropdownOpen},"x-on:click.outside"(){this.dropdownOpen=!1}},addSearchResultsChunk(){let u=this.resultsIndex+this.resultsPerPage;uthis.dropdownOpen=!1)):(this.state=null,this.displayName=null)}}}export{Xt as default}; diff --git a/resources/css/filament/admin/theme.css b/resources/css/filament/admin/theme.css index a9e1639..388ffee 100644 --- a/resources/css/filament/admin/theme.css +++ b/resources/css/filament/admin/theme.css @@ -4,7 +4,7 @@ @source '../../../../resources/views/**/*'; @source '../../../../resources/views/filament/**/*'; @source '../../../../vendor/awcodes/light-switch/resources/**/*.blade.php'; -@source '../../../../vendor/alkoumi/filament-image-radio-button/resources/views/**/*.blade.php'; +@source '../../../../vendor/jaocero/radio-deck/resources/views'; .fi-simple-main { @apply relative sm:max-w-3xl; diff --git a/resources/views/forms/components/custom-radio-group.blade.php b/resources/views/forms/components/custom-radio-group.blade.php deleted file mode 100644 index b6fda25..0000000 --- a/resources/views/forms/components/custom-radio-group.blade.php +++ /dev/null @@ -1,22 +0,0 @@ -@php - $state = $getState(); // Get the current state of the radio group - $options = $getOptions(); // Assuming you have a method to get options in your component - $name = $getName(); // Get the field name for the input -@endphp - -
- @foreach ($options as $value => $label) - -
- @endforeach -