Code Monkey home page Code Monkey logo

filament-clusters's Introduction

Filament Cluster Banner

Filament Clusters

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Filament Clusters allows you to visually cluster multiple fields together.

Functionality wise it is similar to the Group component except that the fields look visually as one, which is useful for tighly coupled form fields, such as a currency and amount which only make sense together.

Showcase

Screenshot 01

Screenshot 02

Support us

Your support is key to the continual advancement of our plugin. We appreciate every user who has contributed to our journey so far.

While our plugin is available for all to use, if you are utilizing it for commercial purposes and believe it adds significant value to your business, we kindly ask you to consider supporting us through GitHub Sponsors. This sponsorship will assist us in continuous development and maintenance to keep our plugin robust and up-to-date. Any amount you contribute will greatly help towards reaching our goals. Join us in making this plugin even better and driving further innovation.

Installation

You can install the package via composer:

composer require guava/filament-clusters

Usage

It's simple as:

use Guava\FilamentClusters\Forms\Cluster;

Cluster::make([
    // Your schema
]);

For example for a currency and amount cluster:

use Guava\FilamentClusters\Forms\Cluster;

Cluster::make([
    \Filament\Forms\Components\Select::make('currency')
        ->options(['EUR', 'USD']),
    
    \Filament\Forms\Components\TextInput::make('amount')
        ->numeric()
        ->required(),
]),

Customization

You can add a label, hint, helper text or actions to your Cluster:

use Guava\FilamentClusters\Forms\Cluster;

Cluster::make([
    // Schema
])
    ->label('My label')
    ->hint('Useful hint')
    ->helperText('Help when you\'re stuck');

Grid

By default, the cluster automatically distributes the space among each child component. You can however customize it using columns and columnSpan for each child, just like you're used to from Filament:

use Guava\FilamentClusters\Forms\Cluster;

Cluster::make([
    // Schema
])->columns(5);

Vertical Clusters

To create a vertical clusters, you simply need set the columns of the Cluster to 1:

Cluster::make([
    // Schema
])->columns(1);

Different Breakpoints

The breakpoints use the same system as Filament`s columns, so you can customize each breakpoint by passing in an array:

Cluster::make([
    // Schema
])->columns([
    'default' => 1,
    'lg' => 3,
]);

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

filament-clusters's People

Contributors

lukas-frey avatar dev-idkwhoami avatar saulens22 avatar dependabot[bot] avatar

Stargazers

George Daneke  avatar Olga Karagedik avatar Ricardo Sawir avatar Yudi Purwanto avatar Jean-Charles Bournot avatar Chuck Rincón avatar  avatar SoloAssist2 avatar Loan Besson avatar Daniel RAMESAY avatar João Paulo Leite Nascimento avatar Navid Sedehi avatar Dean Jansen avatar MoeBrowne avatar Marco Germani avatar Sebastian Popp avatar  avatar Imad  avatar Wayan jimmy avatar Jakub Velička avatar yingbo cheng avatar Bubixon avatar ngheongheo avatar  avatar Owain avatar Ion Căliman avatar Enggar Tivandi avatar Chris Jones avatar entropie app avatar Blaze avatar  avatar Noradin Hassan avatar Jacob Timmerman avatar Cerry avatar Nathan Bomshteyn avatar Baran Sekin avatar Jèfferson Gonçalves avatar Jordan Jones avatar Atila Silva avatar Sadegh Barzegar avatar Zainal Hasan avatar Noah Gillard avatar Aaron Holbrook avatar Ralfs Garkaklis avatar miles avatar Muhammed Cetin avatar AriaieBOY avatar maazin avatar Jacob Baker-Kretzmar avatar Mumtaz Moon avatar Mehmet Fatih GÖÇGÜN avatar Aytaç KAYIN avatar Apsonex Inc. avatar Kit Burton-Senior avatar Faraz Samapoor avatar Antoine avatar  avatar Marc Beinder avatar Ihsan Devs avatar Dane Medussa avatar Ilyosjon Kamoldinov avatar  avatar Saif Allah Khaled avatar Heiko Klingele avatar Nazar Ali avatar Camille Scholtz avatar Amid avatar Andreas avatar John Bacon avatar zaX avatar Matheus Alves avatar John Sanabria avatar Donald Nguyen avatar  avatar Iago Bruno avatar Rawand J. Rasool avatar RX-77 avatar Caspar Bisschop avatar Thomas Georgel avatar Ionut Marinescu avatar Tristan Bendixen avatar  avatar chaoswey avatar Recca Tsai avatar MEHDI avatar Bob Tantlinger avatar php coder avatar Cha avatar MarcS avatar Vladislav Kambulov avatar Adam Kelso avatar Luca Mago avatar Olivier Mourlevat avatar Max Carvalho avatar  avatar Chrispian avatar Chris Reed avatar William avatar  avatar EverForge avatar

Watchers

 avatar  avatar  avatar

filament-clusters's Issues

[Bug]: Checkbox not rendering

What happened?

The checkbox is not being rendered when inside a cluster.

image

How to reproduce the bug

Cluster::make()
  ->label(__('Icon color'))
  ->schema([
      Forms\Components\ColorPicker::make('icon_color'),
      Forms\Components\Checkbox::make('icon_no_color'),
  ])->columns(2),

Package Version

LTS

PHP Version

8.2.x

Laravel Version

10.x

Which operating systems does with happen with?

macOS

Notes

No response

[Bug]: Cannot access protected property Marked As Required

What happened?

I have used this code
Cluster::make([
TextInput::make('unit_price') ->required()
//->label('Net Unit Price')
,
TextInput::make('unit_price_mad')
//->label('Net Unit Price')
])->hiddenLabel(),

and it give me this error:
Cannot access protected property Guava\Filament Clusters\Forms\Cluster::$is Marked As Required

How to reproduce the bug

Cluster::make([
TextInput::make('unit_price') ->required()
//->label('Net Unit Price')
,
TextInput::make('unit_price_mad')
//->label('Net Unit Price')
])->hiddenLabel(),

Package Version

2.0.0

PHP Version

8.2.2

Laravel Version

10

Which operating systems does with happen with?

macOS

Notes

No response

[Bug]: Fix documentation

What happened?

Screenshots on Filament website not showing

How to reproduce the bug

Check Filament website

Package Version

1

PHP Version

n/a

Laravel Version

n/a

Which operating systems does with happen with?

No response

Notes

No response

[Bug]: Cluster::getExtraFieldWrapperAttributes does not exist.

What happened?

With the Introduction of extra Field Wrappers for Form Components (filamentphp/filament#12782) in Filament v3.2.80 the Cluster Component cannot be used anymore:

Method Guava\FilamentClusters\Forms\Cluster::getExtraFieldWrapperAttributes does not exist.

How to reproduce the bug

Cluster::make([
Select::make('xxx'),
])

Package Version

2.0.0

PHP Version

8.2.0

Laravel Version

11

Which operating systems does with happen with?

No response

Notes

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.