[feat] Foldable component - ability to embed other sql files
Requesting a feature for Foldable component to be able to embed other sql files.
I can think of many useful scenarios, where a "break-down" of data could be presented upon expansion in neat ways on the UI, while also conserving valuable screen real-estate.
Examples -
-
Display a "Total = $12345" on the Foldable component
title, and then display a breakdown (using big_number for example) uopn expansion. The big_number component could be in a separate sql file that can be then re-used in multiple places. -
Display a "X New Offers" as
titleand upon expansion displaycardsorcolumnscomponents highlighting the offers / products with more details. The cards or column components are in a separate sql file, which can be re-used in multiple places like search products, carts, etc.
As you can see, this feature could help re-using the common sql files with components and help optimize screen real-estate in very useful ways.
Looking forward to hearing your thoughts. Cheers!
Hello ! This is indeed a very good idea, I can think of multiple scenarios where this would be useful. I will keep this in mind.
Yeah this would be great to have ability to use other components and sql files embed in foldable! 👍
I think this is the missing piece of sqlpage; the ability to compose pages from multiple sql files.
Looking at this issue https://github.com/sqlpage/SQLPage/issues/747, the embed feature is doing composition on the client side. It would be great to be able to do it on the server side. e.g.
select 'my_component.sql' as embed;
nvm, after posting my comment then I read this https://github.com/sqlpage/SQLPage/issues/20
I think dynamic components with sqlpage.run_sql() looks like a good option.
https://sql-page.com/component.sql?component=dynamic#component