Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Slots #50

Closed
KenKodz opened this issue Oct 26, 2023 · 2 comments
Closed

Feature Request: Slots #50

KenKodz opened this issue Oct 26, 2023 · 2 comments

Comments

@KenKodz
Copy link
Contributor

KenKodz commented Oct 26, 2023

Would you be interested in adding slots to the table?

For instance, livewire-table::bar.bar could have x-slot:before-actions, x-slot:after-actions, x-slot:before-search, x-slot:after-search, etc. This would allow for customization without having to publish the templates.

@KenKodz
Copy link
Contributor Author

KenKodz commented Oct 26, 2023

Well, this stinks. livewire/livewire#5846

It seems that this isn't possible in Livewire v3. I was trying to get it working and was getting flustered as to why it wasn't working. Guess this will have to wait until this is added to v3.

@ramonrietdijk
Copy link
Owner

Hi @KenKodz!

Slots could be useful to prevent having to publish the views. However, I do recommend publishing them. If the views are published, the table would always use the same views, despite what happens in the package. If I were to change some things in the default layout in a future update, it could potentially break existing tables. By renaming, moving or deleting slots it would suddenly remove user defined content which I don't really like. Keeping the slots backwards compatible could limit the ability to change the layout without a breaking release.

I can understand that updating the views could take some time, but it is the easiest way to maintain and expand this package. The views in this package can be used as is, but they also act as a template to add any custom requirements. This is the same reason why I haven't added any classes or style methods, as I recommend overriding the templates themselves for the most flexibility.

Nonetheless, thank you for your suggestions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants