mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
feat: Add RepeatableEntry table layout and TableColumn component (#17865)
* Add RepeatableEntry table layout and TableColumn component with tests * chore: fix code style * consistency with repeater * Update EntriesDemo.php --------- Co-authored-by: oddvalue <oddvalue@users.noreply.github.com> Co-authored-by: Dan Harrin <git@danharrin.com>
This commit is contained in:
co-authored by
oddvalue
Dan Harrin
parent
73fd07ee07
commit
7c5cd978d7
@@ -9,6 +9,7 @@ use Filament\Infolists\Components\IconEntry;
|
||||
use Filament\Infolists\Components\ImageEntry;
|
||||
use Filament\Infolists\Components\KeyValueEntry;
|
||||
use Filament\Infolists\Components\RepeatableEntry;
|
||||
use Filament\Infolists\Components\RepeatableEntry\TableColumn;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Components\Flex;
|
||||
use Filament\Schemas\Components\Group;
|
||||
@@ -714,6 +715,25 @@ class EntriesDemo extends Component implements HasSchemas
|
||||
->columns(2)
|
||||
->grid(2),
|
||||
]),
|
||||
Group::make()
|
||||
->id('repeatableTable')
|
||||
->extraAttributes([
|
||||
'class' => 'p-16 max-w-5xl',
|
||||
])
|
||||
->schema([
|
||||
RepeatableEntry::make('comments')
|
||||
->table([
|
||||
TableColumn::make('Author'),
|
||||
TableColumn::make('Title'),
|
||||
TableColumn::make('Published'),
|
||||
])
|
||||
->schema([
|
||||
TextEntry::make('author'),
|
||||
TextEntry::make('title'),
|
||||
IconEntry::make('is_published')
|
||||
->boolean(),
|
||||
]),
|
||||
]),
|
||||
Group::make()
|
||||
->id('suffixAction')
|
||||
->extraAttributes([
|
||||
@@ -736,11 +756,13 @@ class EntriesDemo extends Component implements HasSchemas
|
||||
'author' => ['name' => 'Jane Doe'],
|
||||
'title' => 'Wow!',
|
||||
'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam euismod, nisl eget aliquam ultricies, nunc nisl aliquet nunc, quis aliquam nisl.',
|
||||
'is_published' => true,
|
||||
],
|
||||
[
|
||||
'author' => ['name' => 'John Doe'],
|
||||
'title' => 'This isn\'t working. Help!',
|
||||
'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam euismod, nisl eget aliquam ultricies, nunc nisl aliquet nunc, quis aliquam nisl.',
|
||||
'is_published' => false,
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
@@ -2228,6 +2228,15 @@ export default {
|
||||
deviceScaleFactor: 3,
|
||||
},
|
||||
},
|
||||
'infolists/entries/repeatable/table': {
|
||||
url: 'infolists/entries',
|
||||
selector: '#repeatableTable',
|
||||
viewport: {
|
||||
width: 1920,
|
||||
height: 640,
|
||||
deviceScaleFactor: 3,
|
||||
},
|
||||
},
|
||||
'infolists/entries/actions/suffix': {
|
||||
url: 'infolists/entries',
|
||||
selector: '#suffixAction',
|
||||
|
||||
Reference in New Issue
Block a user