This commit is contained in:
F4ilji
2026-04-10 09:01:47 +05:00
parent 1c6f09ed80
commit 9e35cf848d
25 changed files with 195 additions and 155 deletions
@@ -3,9 +3,6 @@
namespace App\Filament\Components\Forms\ItemForm\Blocks;
use App\Filament\Components\Forms\ItemForm\Blocks\BlockSchema;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Forms\Get;
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
class ParagraphBlock implements BlockSchema
@@ -14,16 +11,6 @@ class ParagraphBlock implements BlockSchema
public static function schema(): array
{
return [
Toggle::make('seo_active')
->label('Использовать блок как SEO-текст')
->helperText('Этот текст будет использоваться для SEO-оптимизации')
->live(onBlur: true)
->required()
->disabled(function ($state, Get $get) {
$data = $get('../../');
return self::findSeoActive($data) && !$state;
})
->dehydrated(),
TinyEditor::make('content')
->label('Текст')
->placeholder('Начните вводить текст...')
@@ -32,20 +19,4 @@ class ParagraphBlock implements BlockSchema
->helperText('Основное текстовое содержимое блока'),
];
}
private static function findSeoActive(array $data) : bool
{
$bool = false;
foreach ($data as $item) {
if ($item['type'] !== 'paragraph') {
continue;
}
if ($item['data']['seo_active'] === true) {
$bool = true;
break;
}
}
return $bool;
}
}
}
@@ -53,16 +53,6 @@ class TabBuilderItem
->label('Текст')
->icon('heroicon-o-document-text')
->schema([
Toggle::make('seo_active')
->label('Использовать блок как SEO-текст')
->helperText('Этот текст будет использоваться для SEO-оптимизации')
->live(onBlur: true)
->required()
->disabled(function ($state, Forms\Get $get) {
$data = $get('../../');
return self::findSeoActive($data) && !$state;
})
->dehydrated(),
TinyEditor::make('content')
->label('Текст')
->placeholder('Начните вводить текст...')
@@ -13,7 +13,6 @@ use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Forms\Form;
use Illuminate\Support\Str;
use TomatoPHP\FilamentIcons\Components\IconPicker;
class PageForm
{
@@ -109,11 +108,6 @@ class PageForm
->default(true)
->inline(false)
->helperText('Разрешить локальному поиску индексировать страницу'),
IconPicker::make('icon')
->label('Иконка страницы')
->default('heroicon-o-academic-cap')
->helperText('Выберите иконку для отображения в навигации')
->columns(6),
TextInput::make('search_data')
->hidden(),
]),