Changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Filament\Components\Forms\ItemForm\Pages;
|
namespace App\Filament\Components\Forms\ItemForm\Defaults;
|
||||||
|
|
||||||
use App\Enums\CustomFormStatus;
|
use App\Enums\CustomFormStatus;
|
||||||
use App\Enums\PostStatus;
|
use App\Enums\PostStatus;
|
||||||
@@ -121,173 +121,7 @@ class ContentBuilderItem
|
|||||||
RichEditor::make('content')->required(),
|
RichEditor::make('content')->required(),
|
||||||
])->minItems(1),
|
])->minItems(1),
|
||||||
]),
|
]),
|
||||||
Builder\Block::make('tabs')
|
TabBuilderItem::getItem(),
|
||||||
->label('Вкладки')
|
|
||||||
->schema([
|
|
||||||
Forms\Components\Repeater::make('tab')->schema([
|
|
||||||
TextInput::make('title')
|
|
||||||
->required()
|
|
||||||
->maxLength(255)->columnSpanFull(),
|
|
||||||
\Filament\Forms\Components\Builder::make('content')->label('')->blocks([
|
|
||||||
Builder\Block::make('heading')->label('Заголовок')
|
|
||||||
->schema([
|
|
||||||
TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)),
|
|
||||||
TextInput::make('content')
|
|
||||||
->label('')
|
|
||||||
->live(onBlur: true)
|
|
||||||
->afterStateUpdated(function (string $operation, string $state, Forms\Set $set, $get) {
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
Builder\Block::make('paragraph')
|
|
||||||
->schema([
|
|
||||||
RichEditor::make('content')
|
|
||||||
->toolbarButtons([
|
|
||||||
'blockquote',
|
|
||||||
'bold',
|
|
||||||
'bulletList',
|
|
||||||
'italic',
|
|
||||||
'link',
|
|
||||||
'orderedList',
|
|
||||||
'redo',
|
|
||||||
'strike',
|
|
||||||
'underline',
|
|
||||||
'undo',
|
|
||||||
])
|
|
||||||
->label(''),
|
|
||||||
])->label('Текст'),
|
|
||||||
Builder\Block::make('files')
|
|
||||||
->schema([
|
|
||||||
Forms\Components\Repeater::make('file')->schema([
|
|
||||||
TextInput::make('title')
|
|
||||||
->required()
|
|
||||||
->maxLength(255)
|
|
||||||
->autofocus(),
|
|
||||||
FileUpload::make('path')
|
|
||||||
->required()
|
|
||||||
->acceptedFileTypes([
|
|
||||||
'application/pdf',
|
|
||||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
||||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
||||||
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
||||||
'application/zip'
|
|
||||||
])
|
|
||||||
->maxSize(512000)
|
|
||||||
->disk('public')
|
|
||||||
->directory('files')
|
|
||||||
->downloadable()
|
|
||||||
->visibility('public')
|
|
||||||
]),
|
|
||||||
]),
|
|
||||||
Builder\Block::make('person')
|
|
||||||
->schema([
|
|
||||||
TextInput::make('name')
|
|
||||||
->label('Имя')
|
|
||||||
->required()
|
|
||||||
->maxLength(255),
|
|
||||||
FileUpload::make('photo')
|
|
||||||
->label('Фотография')
|
|
||||||
->image()
|
|
||||||
->disk('public')
|
|
||||||
->directory('images')
|
|
||||||
->imageEditor(),
|
|
||||||
Forms\Components\Repeater::make('info')->schema([
|
|
||||||
Forms\Components\Grid::make(2)->schema([
|
|
||||||
TextInput::make('column')
|
|
||||||
->required()
|
|
||||||
->maxLength(255),
|
|
||||||
TextInput::make('content')
|
|
||||||
->required()
|
|
||||||
->maxLength(255),
|
|
||||||
]),
|
|
||||||
])->minItems(1),
|
|
||||||
]),
|
|
||||||
Builder\Block::make('stepper')
|
|
||||||
->schema([
|
|
||||||
TextInput::make('step_name')
|
|
||||||
->label('Название шага')
|
|
||||||
->required()
|
|
||||||
->maxLength(255),
|
|
||||||
Forms\Components\Repeater::make('steps')->schema([
|
|
||||||
TextInput::make('title')
|
|
||||||
->required()
|
|
||||||
->maxLength(255)->columnSpanFull(),
|
|
||||||
RichEditor::make('content')->required(),
|
|
||||||
])->minItems(1),
|
|
||||||
]),
|
|
||||||
Builder\Block::make('images')
|
|
||||||
->schema([
|
|
||||||
FileUpload::make('url')
|
|
||||||
->label('Изображение(-я)')
|
|
||||||
->image()
|
|
||||||
->multiple()
|
|
||||||
->reorderable()
|
|
||||||
->maxFiles(5)
|
|
||||||
->disk('public')
|
|
||||||
->directory('images')
|
|
||||||
->imageEditor()
|
|
||||||
->required(),
|
|
||||||
TextInput::make('alt')
|
|
||||||
->label('Описание')
|
|
||||||
->placeholder('Необязяательно')
|
|
||||||
])->label('Слайдер изображений'),
|
|
||||||
Builder\Block::make('image')
|
|
||||||
->schema([
|
|
||||||
FileUpload::make('url')
|
|
||||||
->label('Изображение(-я)')
|
|
||||||
->image()
|
|
||||||
->multiple()
|
|
||||||
->reorderable()
|
|
||||||
->maxFiles(5)
|
|
||||||
->disk('public')
|
|
||||||
->directory('images')
|
|
||||||
->imageEditor()
|
|
||||||
->required(),
|
|
||||||
TextInput::make('alt')
|
|
||||||
->label('Описание')
|
|
||||||
->placeholder('Необязяательно')
|
|
||||||
])->label('Изображение'),
|
|
||||||
Builder\Block::make('video')
|
|
||||||
->schema([
|
|
||||||
TextInput::make('mime')->readOnly(),
|
|
||||||
TextInput::make('title')
|
|
||||||
->required()
|
|
||||||
->maxLength(255)
|
|
||||||
->autofocus(),
|
|
||||||
FileUpload::make('path')
|
|
||||||
->required()
|
|
||||||
->acceptedFileTypes([
|
|
||||||
'video/mp4',
|
|
||||||
'video/quicktime',
|
|
||||||
'video/x-msvideo',
|
|
||||||
'video/x-ms-wmv',
|
|
||||||
'video/avi',
|
|
||||||
'video/webm',
|
|
||||||
'video/ogg',
|
|
||||||
'video/3gpp',
|
|
||||||
'video/3gpp2',
|
|
||||||
'video/x-m4v',
|
|
||||||
])
|
|
||||||
->disk('public')
|
|
||||||
->directory('videos')
|
|
||||||
->afterStateUpdated(fn (callable $set, $state) => $set('mime', $state?->getMimeType())),
|
|
||||||
]),
|
|
||||||
Builder\Block::make('postsList')
|
|
||||||
->schema([
|
|
||||||
Forms\Components\Grid::make(2)->schema([
|
|
||||||
TextInput::make('count')
|
|
||||||
->label('Количество запией')
|
|
||||||
->integer(),
|
|
||||||
Select::make('category')
|
|
||||||
->options(Category::all()->pluck('title', 'id'))
|
|
||||||
]),
|
|
||||||
])->label('Список новостей'),
|
|
||||||
])
|
|
||||||
->collapsed()
|
|
||||||
->blockNumbers(false)
|
|
||||||
->collapsible()
|
|
||||||
->addActionLabel('Добавить новый блок'),
|
|
||||||
])->minItems(1),
|
|
||||||
]),
|
|
||||||
Builder\Block::make('images')
|
Builder\Block::make('images')
|
||||||
->schema([
|
->schema([
|
||||||
FileUpload::make('url')
|
FileUpload::make('url')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Filament\Components\Forms\ItemForm\Pages;
|
namespace App\Filament\Components\Forms\ItemForm\Defaults;
|
||||||
|
|
||||||
use App\Enums\CustomFormStatus;
|
use App\Enums\CustomFormStatus;
|
||||||
use App\Enums\PostStatus;
|
use App\Enums\PostStatus;
|
||||||
@@ -25,7 +25,7 @@ use Illuminate\Support\Str;
|
|||||||
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||||
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
|
||||||
|
|
||||||
class ContentBuilderItem
|
class TabBuilderItem
|
||||||
{
|
{
|
||||||
public static function getItem()
|
public static function getItem()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user