-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename accordion to foldable and harmonize it with other components
See #550
- Loading branch information
Showing
5 changed files
with
47 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
INSERT INTO component(name, icon, description) VALUES | ||
('foldable', 'chevrons-down', 'A foldable list of elements which can be expanded individually.'); | ||
|
||
INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'foldable', * FROM (VALUES | ||
('id', 'ID attribute added to the container in HTML. Used for targeting through CSS or for scrolling via links.', 'TEXT', TRUE, TRUE), | ||
('title', 'Title of the foldable item, displayed on the button.', 'TEXT', FALSE, TRUE), | ||
('description', 'Plain text description of the item, displayed when expanded.', 'TEXT', FALSE, TRUE), | ||
('description_md', 'Markdown description of the item, displayed when expanded.', 'TEXT', FALSE, TRUE) | ||
) x; | ||
|
||
INSERT INTO example(component, description, properties) VALUES | ||
('foldable', 'A SQLPage-themed foldable list with Markdown', json('[ | ||
{"component":"foldable"}, | ||
{"title":"Quick Prototyping", "description_md": "Build a functional web app prototype in minutes using just SQL queries:\n\n- Rapid development\n- Ideal for MVPs\n- Great for internal tools\n\nLearn more about [quick prototyping](/your-first-sql-website/)."}, | ||
{"title":"Data Visualization", "description_md": "Transform data into insights:\n\n1. **Charts**: Line, bar, pie\n2. **Graphs**: Network diagrams\n3. **Maps**: Geospatial data\n\n```sql\nSELECT ''chart'' as component;\nSELECT date as x, revenue as y FROM sales;\n```"}, | ||
{"title":"Form Handling", "description_md": "Effortless form processing:\n\n- *User input collection*\n- *Data validation*\n- *Database updates*\n\n> SQLPage handles the entire form lifecycle, from rendering to processing."} | ||
]')); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div class="accordion" id="#{{default id 'accordion_default'}}"> | ||
{{#each_row}} | ||
<div class="accordion-item"> | ||
<h2 class="accordion-header" id="heading-{{@row_index}}"> | ||
<button class="accordion-button" type="button" data-bs-toggle="collapse" | ||
data-bs-target="#collapse-{{@row_index}}" aria-controls="collapse-{{@index}}"> | ||
{{~#if title~}} | ||
{{title}} | ||
{{~else~}} | ||
{{@row_index}} | ||
{{/if}} | ||
</button> | ||
</h2> | ||
<div id="collapse-{{@row_index}}" class="accordion-collapse collapse {{#if (eq @row_index 0)}}show{{/if}}" | ||
aria-labelledby="heading-{{@row_index}}" | ||
data-bs-parent="#{{default id 'accordion_default'}}" | ||
> | ||
<div class="accordion-body"> | ||
{{~#if description~}} | ||
<p>{{description}}</p> | ||
{{/if}} | ||
{{~#if description_md~}} | ||
{{{markdown description_md}}} | ||
{{/if}} | ||
</div> | ||
</div> | ||
</div> | ||
{{/each_row}} | ||
</div> |