From 2b42e21b96debef7d00a0e15399d0bd24fe4177d Mon Sep 17 00:00:00 2001 From: Ophir Lojkine Date: Sat, 28 Nov 2026 23:46:33 +0000 Subject: [PATCH] Move list, datagrid, and big-number references to Markdown --- .../content/components/big_number.md | 61 ++++++++++++++ .../examples/01-change-and-progress.md | 22 +++++ .../examples/02-dropdowns-and-layout.md | 32 +++++++ .../content/components/datagrid.md | 55 ++++++++++++ .../datagrid/examples/01-sections.md | 12 +++ .../datagrid/examples/02-icons-and-colors.md | 24 ++++++ .../datagrid/examples/03-picture.md | 20 +++++ .../official-site/content/components/list.md | 73 ++++++++++++++++ .../components/list/examples/01-compact.md | 11 +++ .../components/list/examples/02-empty.md | 9 ++ .../components/list/examples/03-markdown.md | 31 +++++++ .../components/list/examples/04-full-list.md | 29 +++++++ .../sqlpage/migrations/01_documentation.sql | 83 ------------------- .../sqlpage/migrations/49_big_number.sql | 66 --------------- .../migrations/82_reference_catalog.sql | 3 - .../99_shared_id_class_attributes.sql | 11 --- 16 files changed, 379 insertions(+), 163 deletions(-) create mode 100644 examples/official-site/content/components/big_number.md create mode 100644 examples/official-site/content/components/big_number/examples/01-change-and-progress.md create mode 100644 examples/official-site/content/components/big_number/examples/02-dropdowns-and-layout.md create mode 100644 examples/official-site/content/components/datagrid.md create mode 100644 examples/official-site/content/components/datagrid/examples/01-sections.md create mode 100644 examples/official-site/content/components/datagrid/examples/02-icons-and-colors.md create mode 100644 examples/official-site/content/components/datagrid/examples/03-picture.md create mode 100644 examples/official-site/content/components/list.md create mode 100644 examples/official-site/content/components/list/examples/01-compact.md create mode 100644 examples/official-site/content/components/list/examples/02-empty.md create mode 100644 examples/official-site/content/components/list/examples/03-markdown.md create mode 100644 examples/official-site/content/components/list/examples/04-full-list.md delete mode 100644 examples/official-site/sqlpage/migrations/49_big_number.sql diff --git a/examples/official-site/content/components/big_number.md b/examples/official-site/content/components/big_number.md new file mode 100644 index 000000000..a0b9b96a0 --- /dev/null +++ b/examples/official-site/content/components/big_number.md @@ -0,0 +1,61 @@ +--- +icon: chart-area +since: 0.28.0 +category: display-data +summary: Highlight a metric with a trend or progress indicator. +top: + - class + - name: columns + type: INTEGER + description: The number of columns to display the big numbers in (default is one column per item). + - id + - name: wrap + type: BOOLEAN + description: Wrap long titles and descriptions onto multiple lines. By default, they are truncated with + an ellipsis. +row: + - name: change_percent + type: INTEGER + description: The percentage change in value (e.g., 7 for 7% increase, -8 for 8% decrease). + - class + - name: color + type: COLOR + description: The color of the card background and its main value. + - name: description + type: TEXT + description: A description or additional context for the big number. + - name: dropdown_item + type: JSON + description: A list of JSON objects containing links. e.g. {"label":"This week", "link":"?days=7"} + - id + - name: progress_color + type: TEXT + description: The color of the progress bar (e.g., "primary", "success", "danger"). + - name: progress_percent + type: INTEGER + description: The value of the progress (0-100). + - name: title + type: TEXT + description: The title or label for the big number. + - name: title_link + type: TEXT + description: A link for the Big Number title. If set, the entire title becomes clickable. + - name: title_link_new_tab + type: BOOLEAN + description: If true, the title link will open in a new tab/window. + - name: unit + type: TEXT + description: The unit of measurement for the value. + - name: value + type: TEXT + required: true + description: The main value to be displayed prominently. + - name: value_link + type: TEXT + description: A link for the Big Number value. If set, the entire value becomes clickable. + - name: value_link_new_tab + type: BOOLEAN + description: If true, the value link will open in a new tab/window. +--- + +A component to display key metrics or statistics with optional description, change indicator, and progress bar. Useful in dashboards. diff --git a/examples/official-site/content/components/big_number/examples/01-change-and-progress.md b/examples/official-site/content/components/big_number/examples/01-change-and-progress.md new file mode 100644 index 000000000..e0b4cf8fe --- /dev/null +++ b/examples/official-site/content/components/big_number/examples/01-change-and-progress.md @@ -0,0 +1,22 @@ +--- +rows: + - component: big_number + - title: Sales + value: 75 + unit: '%' + title_link: '#sales_dashboard' + title_link_new_tab: true + value_link: '#sales_details' + value_link_new_tab: false + description: Conversion rate + change_percent: 9 + progress_percent: 75 + progress_color: blue + - title: Revenue + value: 4,300 + unit: $ + description: Year on year + change_percent: -8 +--- + +Big numbers with change indicators and progress bars diff --git a/examples/official-site/content/components/big_number/examples/02-dropdowns-and-layout.md b/examples/official-site/content/components/big_number/examples/02-dropdowns-and-layout.md new file mode 100644 index 000000000..662d83696 --- /dev/null +++ b/examples/official-site/content/components/big_number/examples/02-dropdowns-and-layout.md @@ -0,0 +1,32 @@ +--- +rows: + - component: big_number + columns: 3 + id: colorfull_dashboard + - title: Users + value: 1,234 + color: red + title_link: '#users' + title_link_new_tab: false + value_link: '#users_details' + value_link_new_tab: true + - title: Orders + value: 56 + color: green + title_link: '#orders' + title_link_new_tab: true + - title: Revenue + value: 9,876 + unit: € + color: blue + change_percent: -7 + dropdown_item: + - label: This week + link: ?days=7&component=big_number#colorfull_dashboard + - label: This month + link: ?days=30&component=big_number#colorfull_dashboard + - label: This quarter + link: ?days=90&component=big_number#colorfull_dashboard +--- + +Big numbers with dropdowns and customized layout diff --git a/examples/official-site/content/components/datagrid.md b/examples/official-site/content/components/datagrid.md new file mode 100644 index 000000000..c29817693 --- /dev/null +++ b/examples/official-site/content/components/datagrid.md @@ -0,0 +1,55 @@ +--- +icon: grid-dots +category: display-data +summary: Lay out labeled values in a compact grid. +top: + - class + - name: description + type: TEXT + description: A short paragraph displayed below the title. + - name: description_md + type: TEXT + description: A short paragraph displayed below the title - formatted using markdown. + - name: icon + type: ICON + description: Name of an icon to display on the left side of the title. + - id + - name: image_url + type: URL + description: URL of an image to display on the left side of the title. + - name: title + type: TEXT + description: Text header at the top of the data grid. +row: + - name: active + type: BOOLEAN + description: Whether this item in the grid is considered "active". Active items are displayed more prominently. + - name: color + type: COLOR + description: If set to a color name, the value will be displayed in a pill of that color. + - name: description + type: TEXT + description: Value to display below the name. + - name: footer + type: TEXT + description: Muted text to display below the value. + - name: icon + type: ICON + description: An icon name (from tabler-icons.io) to display on the left side of the value. + - id + - name: image_url + type: URL + description: URL of a small image (such as an avatar) to display on the left side of the value. + - name: link + type: URL + description: A target URL to which the user should be taken when they click on the value. + - name: title + type: TEXT + required: true + description: Name of the piece of information. + - name: tooltip + type: TEXT + description: A tooltip to display when the user passes their mouse over the value. +--- + +Display small pieces of information in a clear and readable way. Each item has a name and is associated with a value. diff --git a/examples/official-site/content/components/datagrid/examples/01-sections.md b/examples/official-site/content/components/datagrid/examples/01-sections.md new file mode 100644 index 000000000..48369e46d --- /dev/null +++ b/examples/official-site/content/components/datagrid/examples/01-sections.md @@ -0,0 +1,12 @@ +--- +rows: + - component: datagrid + - title: Language + description: SQL + - title: Creation date + description: '1974' + - title: Language family + description: Query language +--- + +Just some sections of information. diff --git a/examples/official-site/content/components/datagrid/examples/02-icons-and-colors.md b/examples/official-site/content/components/datagrid/examples/02-icons-and-colors.md new file mode 100644 index 000000000..6024d81a8 --- /dev/null +++ b/examples/official-site/content/components/datagrid/examples/02-icons-and-colors.md @@ -0,0 +1,24 @@ +--- +rows: + - component: datagrid + title: Ophir Lojkine + image_url: https://avatars.githubusercontent.com/u/552629 + description_md: Member since **2021** + - title: Pseudo + description: lovasoa + image_url: https://avatars.githubusercontent.com/u/552629 + - title: Status + description: Active + color: green + - title: Email Status + description: Validated + icon: check + active: true + tooltip: Email address has been validated. + - title: Personal page + description: ophir.dev + link: https://ophir.dev/ + tooltip: About me +--- + +A beautiful data grid with nice colors and icons. diff --git a/examples/official-site/content/components/datagrid/examples/03-picture.md b/examples/official-site/content/components/datagrid/examples/03-picture.md new file mode 100644 index 000000000..26d049fa1 --- /dev/null +++ b/examples/official-site/content/components/datagrid/examples/03-picture.md @@ -0,0 +1,20 @@ +--- +rows: + - component: datagrid + title: Website Ideas + icon: bulb + - title: Search engine + link: https://google.com + description: Google + color: red + icon: brand-google + footer: Owned by Alphabet Inc. + - title: Encyclopedia + link: https://wikipedia.org + description: Wikipedia + color: blue + icon: world + footer: Owned by the Wikimedia Foundation +--- + +Using a picture in the data grid card header. diff --git a/examples/official-site/content/components/list.md b/examples/official-site/content/components/list.md new file mode 100644 index 000000000..253463b6e --- /dev/null +++ b/examples/official-site/content/components/list.md @@ -0,0 +1,73 @@ +--- +icon: list +category: display-data +summary: Present rows as a vertical list with optional links and icons. +top: + - class + - name: compact + type: BOOLEAN + description: Whether to display the list in a more compact format, allowing more items to be displayed + on the screen. + - name: empty_description + type: TEXT + description: Description to display if the list is empty. + - name: empty_description_md + type: TEXT + description: Description to display if the list is empty, in Markdown format. + - name: empty_link + type: URL + description: URL to which the user should be taken if they click on the empty list. + - name: empty_title + type: TEXT + description: Title text to display if the list is empty. + - id + - name: title + type: TEXT + description: Text header at the top of the list. + - name: wrap + type: BOOLEAN + description: Wrap list items onto multiple lines if they are too long +row: + - name: active + type: BOOLEAN + description: Whether this item in the list is considered "active". Active items are displayed more prominently. + - class + - name: color + type: COLOR + description: The name of a color, to be displayed as a dot near the list item contents. + - name: delete_link + type: URL + description: A page that will be loaded when the user clicks on the delete button for this specific item. + The link will be submitted as a POST request. + - name: description + type: TEXT + description: A description of the list item, displayed as greyed-out text. + - name: description_md + type: TEXT + description: A description of the list item, displayed as greyed-out text, in Markdown format, allowing + you to use rich text formatting, including `**bold**` and `*italic*` text. + - name: edit_link + type: URL + description: A URL to which the user should be taken when they click on the "edit" icon. Does not show + the icon when omitted. + - name: icon + type: ICON + description: Name of an icon to display on the left side of the item. + - id + - name: image_url + type: URL + description: The URL of a small image to display on the left side of the item. + - name: link + type: URL + description: An URL to which the user should be taken when they click on the list item. + - name: title + type: TEXT + required: true + description: Name of the list item, displayed prominently. + - name: view_link + type: URL + description: A URL to which the user should be taken when they click on the "view" icon. Does not show + the icon when omitted. +--- + +A vertical list of items. Each item can be clickable and link to another page. diff --git a/examples/official-site/content/components/list/examples/01-compact.md b/examples/official-site/content/components/list/examples/01-compact.md new file mode 100644 index 000000000..53df3fc27 --- /dev/null +++ b/examples/official-site/content/components/list/examples/01-compact.md @@ -0,0 +1,11 @@ +--- +rows: + - component: list + compact: true + title: SQLPage lists are... + - title: Beautiful + - title: Useful + - title: Versatile +--- + +A basic compact list diff --git a/examples/official-site/content/components/list/examples/02-empty.md b/examples/official-site/content/components/list/examples/02-empty.md new file mode 100644 index 000000000..147f5eac9 --- /dev/null +++ b/examples/official-site/content/components/list/examples/02-empty.md @@ -0,0 +1,9 @@ +--- +rows: + - component: list + empty_title: No items yet + empty_description: This list is empty. Click here to create a new item ! + empty_link: documentation.sql +--- + +The empty state appears when the query after `select 'list' as component` returns no rows. `empty_link` makes that state clickable. diff --git a/examples/official-site/content/components/list/examples/03-markdown.md b/examples/official-site/content/components/list/examples/03-markdown.md new file mode 100644 index 000000000..5de310e98 --- /dev/null +++ b/examples/official-site/content/components/list/examples/03-markdown.md @@ -0,0 +1,31 @@ +--- +rows: + - component: list + wrap: true + - title: SQL Websites + image_url: /favicon.ico + description_md: Write SQL, get a website. SQLPage is a **SQL**-based **site** generator for **PostgreSQL**, + **MySQL**, **SQLite** and **SQL Server**. + link: / + - title: SQL Forms + image_url: https://upload.wikimedia.org/wikipedia/commons/b/b6/FileStack_retouched.jpg + description_md: Easily collect data **from users to your database** using the *form* component. Handle + the data in SQL with `INSERT` or `UPDATE` queries. + link: ?component=form + - title: SQL Maps + image_url: https://upload.wikimedia.org/wikipedia/commons/1/15/Vatican_City_map_EN.png + description_md: Show database contents on a map using the *map* component. Works well with *PostGIS* and + *SpatiaLite*. + link: ?component=map + - title: Advanced features + icon: settings + description_md: '[Authenticate users](?component=authentication), [edit data](?component=form), [generate + an API](?component=json), [maintain your database schema](/your-first-sql-website/migrations.sql), and + more.' +--- + +### A list with rich text descriptions + +This example illustrates creating a nice list where each item has a title, a description, an image, and a link to another page. + +> Be careful, nested links are not supported. If you use the list's `link` property, then your markdown `description_md` should not contain any link. diff --git a/examples/official-site/content/components/list/examples/04-full-list.md b/examples/official-site/content/components/list/examples/04-full-list.md new file mode 100644 index 000000000..cdb65986a --- /dev/null +++ b/examples/official-site/content/components/list/examples/04-full-list.md @@ -0,0 +1,29 @@ +--- +rows: + - component: list + title: Top SQLPage features + compact: true + - title: Authentication + link: ?component=authentication + description: Authenticate users with a login form or HTTP basic authentication + color: red + icon: lock + active: true + view_link: ?component=authentication#view + - title: Editing data + link: ?component=form + description: SQLPage makes it easy to UPDATE, INSERT and DELETE data in your database tables + color: blue + icon: database + edit_link: ?component=form#edit + delete_link: ?component=form#delete + - title: API + link: ?component=json + description: Generate a REST API from a single SQL query to connect with other applications and services + color: green + icon: plug-connected + edit_link: ?component=json#edit + delete_link: ?component=json#delete +--- + +A beautiful list with bells and whistles. diff --git a/examples/official-site/sqlpage/migrations/01_documentation.sql b/examples/official-site/sqlpage/migrations/01_documentation.sql index 6271bbc71..4379db196 100644 --- a/examples/official-site/sqlpage/migrations/01_documentation.sql +++ b/examples/official-site/sqlpage/migrations/01_documentation.sql @@ -55,89 +55,6 @@ SELECT example.rowid AS example_id, ) || ';', char(10) || char(10)) FROM json_each(example.properties) AS statement) AS source FROM example; -INSERT INTO component(name, icon, description) VALUES - ('list', 'list', 'A vertical list of items. Each item can be clickable and link to another page.'); -INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'list', * FROM (VALUES - -- top level - ('title', 'Text header at the top of the list.', 'TEXT', TRUE, TRUE), - ('empty_title', 'Title text to display if the list is empty.', 'TEXT', TRUE, TRUE), - ('empty_description', 'Description to display if the list is empty.', 'TEXT', TRUE, TRUE), - ('empty_description_md', 'Description to display if the list is empty, in Markdown format.', 'TEXT', TRUE, TRUE), - ('empty_link', 'URL to which the user should be taken if they click on the empty list.', 'URL', TRUE, TRUE), - ('compact', 'Whether to display the list in a more compact format, allowing more items to be displayed on the screen.', 'BOOLEAN', TRUE, TRUE), - ('wrap', 'Wrap list items onto multiple lines if they are too long', 'BOOLEAN', TRUE, TRUE), - -- item level - ('title', 'Name of the list item, displayed prominently.', 'TEXT', FALSE, FALSE), - ('description', 'A description of the list item, displayed as greyed-out text.', 'TEXT', FALSE, TRUE), - ('description_md', 'A description of the list item, displayed as greyed-out text, in Markdown format, allowing you to use rich text formatting, including `**bold**` and `*italic*` text.', 'TEXT', FALSE, TRUE), - ('link', 'An URL to which the user should be taken when they click on the list item.', 'URL', FALSE, TRUE), - ('icon', 'Name of an icon to display on the left side of the item.', 'ICON', FALSE, TRUE), - ('image_url', 'The URL of a small image to display on the left side of the item.', 'URL', FALSE, TRUE), - ('color', 'The name of a color, to be displayed as a dot near the list item contents.', 'COLOR', FALSE, TRUE), - ('active', 'Whether this item in the list is considered "active". Active items are displayed more prominently.', 'BOOLEAN', FALSE, TRUE), - ('view_link', 'A URL to which the user should be taken when they click on the "view" icon. Does not show the icon when omitted.', 'URL', FALSE, TRUE), - ('edit_link', 'A URL to which the user should be taken when they click on the "edit" icon. Does not show the icon when omitted.', 'URL', FALSE, TRUE), - ('delete_link', 'A page that will be loaded when the user clicks on the delete button for this specific item. The link will be submitted as a POST request.', 'URL', FALSE, TRUE) -) x; - -INSERT INTO example(component, description, properties) VALUES - ('list', 'A basic compact list', json('[{"component":"list", "compact": true, "title": "SQLPage lists are..."},{"title":"Beautiful"},{"title":"Useful"},{"title":"Versatile"}]')), - ('list', 'The empty state appears when the query after `select ''list'' as component` returns no rows. `empty_link` makes that state clickable.', json('[{"component":"list", "empty_title": "No items yet", "empty_description": "This list is empty. Click here to create a new item !", "empty_link": "documentation.sql"}]')), - ('list', ' -### A list with rich text descriptions - -This example illustrates creating a nice list where each item has a title, a description, an image, and a link to another page. - -> Be careful, nested links are not supported. If you use the list''s `link` property, then your markdown `description_md` should not contain any link. -', json('[{"component":"list", "wrap": true}, - {"title":"SQL Websites", "image_url": "/favicon.ico", "description_md":"Write SQL, get a website. SQLPage is a **SQL**-based **site** generator for **PostgreSQL**, **MySQL**, **SQLite** and **SQL Server**.", "link": "/"}, - {"title":"SQL Forms", "image_url": "https://upload.wikimedia.org/wikipedia/commons/b/b6/FileStack_retouched.jpg", "description_md":"Easily collect data **from users to your database** using the *form* component. Handle the data in SQL with `INSERT` or `UPDATE` queries.", "link": "?component=form"}, - {"title":"SQL Maps", "image_url": "https://upload.wikimedia.org/wikipedia/commons/1/15/Vatican_City_map_EN.png", "description_md":"Show database contents on a map using the *map* component. Works well with *PostGIS* and *SpatiaLite*.", "link": "?component=map"}, - {"title":"Advanced features", "icon": "settings", "description_md":"[Authenticate users](?component=authentication), [edit data](?component=form), [generate an API](?component=json), [maintain your database schema](/your-first-sql-website/migrations.sql), and more."} - ]')), - ('list', 'A beautiful list with bells and whistles.', - json('[{"component":"list", "title":"Top SQLPage features", "compact": true }, - {"title":"Authentication", "link":"?component=authentication", "description": "Authenticate users with a login form or HTTP basic authentication", "color": "red", "icon":"lock", "active": true, "view_link": "?component=authentication#view" }, - {"title":"Editing data", "link":"?component=form", "description": "SQLPage makes it easy to UPDATE, INSERT and DELETE data in your database tables", "color": "blue", "icon":"database", "edit_link": "?component=form#edit", "delete_link": "?component=form#delete" }, - {"title":"API", "link":"?component=json", "description": "Generate a REST API from a single SQL query to connect with other applications and services", "color": "green", "icon":"plug-connected", "edit_link": "?component=json#edit", "delete_link": "?component=json#delete" } - ]')); - -INSERT INTO component(name, icon, description) VALUES - ('datagrid', 'grid-dots', 'Display small pieces of information in a clear and readable way. Each item has a name and is associated with a value.'); -INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'datagrid', * FROM (VALUES - -- top level - ('title', 'Text header at the top of the data grid.', 'TEXT', TRUE, TRUE), - ('description', 'A short paragraph displayed below the title.', 'TEXT', TRUE, TRUE), - ('description_md', 'A short paragraph displayed below the title - formatted using markdown.', 'TEXT', TRUE, TRUE), - ('icon', 'Name of an icon to display on the left side of the title.', 'ICON', TRUE, TRUE), - ('image_url', 'URL of an image to display on the left side of the title.', 'URL', TRUE, TRUE), - -- item level - ('title', 'Name of the piece of information.', 'TEXT', FALSE, FALSE), - ('description', 'Value to display below the name.', 'TEXT', FALSE, TRUE), - ('footer', 'Muted text to display below the value.', 'TEXT', FALSE, TRUE), - ('image_url', 'URL of a small image (such as an avatar) to display on the left side of the value.', 'URL', FALSE, TRUE), - ('link', 'A target URL to which the user should be taken when they click on the value.', 'URL', FALSE, TRUE), - ('icon', 'An icon name (from tabler-icons.io) to display on the left side of the value.', 'ICON', FALSE, TRUE), - ('color', 'If set to a color name, the value will be displayed in a pill of that color.', 'COLOR', FALSE, TRUE), - ('active', 'Whether this item in the grid is considered "active". Active items are displayed more prominently.', 'BOOLEAN', FALSE, TRUE), - ('tooltip', 'A tooltip to display when the user passes their mouse over the value.', 'TEXT', FALSE, TRUE) -) x; - -INSERT INTO example(component, description, properties) VALUES - ('datagrid', 'Just some sections of information.', json('[{"component":"datagrid"},{"title":"Language","description":"SQL"},{"title":"Creation date","description":"1974"}, {"title":"Language family","description":"Query language"}]')), - ('datagrid', 'A beautiful data grid with nice colors and icons.', - json('[{"component":"datagrid", "title": "Ophir Lojkine", "image_url": "https://avatars.githubusercontent.com/u/552629", "description_md": "Member since **2021**"}, - {"title": "Pseudo", "description": "lovasoa", "image_url": "https://avatars.githubusercontent.com/u/552629" }, - {"title": "Status", "description": "Active", "color": "green"}, - {"title": "Email Status", "description": "Validated", "icon": "check", "active": true, "tooltip": "Email address has been validated."}, - {"title": "Personal page", "description": "ophir.dev", "link": "https://ophir.dev/", "tooltip": "About me"} - ]')), - ('datagrid', 'Using a picture in the data grid card header.', json('[ - {"component":"datagrid", "title": "Website Ideas", "icon": "bulb"}, - {"title": "Search engine", "link":"https://google.com", "description": "Google", "color": "red", "icon":"brand-google", "footer": "Owned by Alphabet Inc."}, - {"title": "Encyclopedia", "link":"https://wikipedia.org", "description": "Wikipedia", "color": "blue", "icon":"world", "footer": "Owned by the Wikimedia Foundation"} - ]')); - INSERT INTO component(name, icon, description) VALUES diff --git a/examples/official-site/sqlpage/migrations/49_big_number.sql b/examples/official-site/sqlpage/migrations/49_big_number.sql deleted file mode 100644 index acdb2858d..000000000 --- a/examples/official-site/sqlpage/migrations/49_big_number.sql +++ /dev/null @@ -1,66 +0,0 @@ --- Big Number Component Documentation - --- Component Definition -INSERT INTO component(name, icon, description, introduced_in_version) VALUES - ('big_number', 'chart-area', 'A component to display key metrics or statistics with optional description, change indicator, and progress bar. Useful in dashboards.', '0.28.0'); - --- Inserting parameter information for the big_number component -INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'big_number', * FROM (VALUES - -- Top-level parameters (for the whole big_number list) - ('columns', 'The number of columns to display the big numbers in (default is one column per item).', 'INTEGER', TRUE, TRUE), - ('wrap', 'Wrap long titles and descriptions onto multiple lines. By default, they are truncated with an ellipsis.', 'BOOLEAN', TRUE, TRUE), - -- id and class, at both levels, come from 99_shared_id_class_attributes.sql - -- Item-level parameters (for each big number) - ('title', 'The title or label for the big number.', 'TEXT', FALSE, TRUE), - ('title_link', 'A link for the Big Number title. If set, the entire title becomes clickable.', 'TEXT', FALSE, TRUE), - ('title_link_new_tab', 'If true, the title link will open in a new tab/window.', 'BOOLEAN', FALSE, TRUE), - ('value_link', 'A link for the Big Number value. If set, the entire value becomes clickable.', 'TEXT', FALSE, TRUE), - ('value_link_new_tab', 'If true, the value link will open in a new tab/window.', 'BOOLEAN', FALSE, TRUE), - ('value', 'The main value to be displayed prominently.', 'TEXT', FALSE, FALSE), - ('unit', 'The unit of measurement for the value.', 'TEXT', FALSE, TRUE), - ('description', 'A description or additional context for the big number.', 'TEXT', FALSE, TRUE), - ('change_percent', 'The percentage change in value (e.g., 7 for 7% increase, -8 for 8% decrease).', 'INTEGER', FALSE, TRUE), - ('progress_percent', 'The value of the progress (0-100).', 'INTEGER', FALSE, TRUE), - ('progress_color', 'The color of the progress bar (e.g., "primary", "success", "danger").', 'TEXT', FALSE, TRUE), - ('dropdown_item', 'A list of JSON objects containing links. e.g. {"label":"This week", "link":"?days=7"}', 'JSON', FALSE, TRUE), - ('color', 'The color of the card background and its main value.', 'COLOR', FALSE, TRUE) -) x; - -INSERT INTO example(component, description, properties) VALUES - ('big_number', 'Big numbers with change indicators and progress bars', - json('[ - {"component":"big_number"}, - { - "title":"Sales", - "value":75, - "unit":"%", - "title_link": "#sales_dashboard", - "title_link_new_tab": true, - "value_link": "#sales_details", - "value_link_new_tab": false, - "description":"Conversion rate", - "change_percent": 9, - "progress_percent": 75, - "progress_color": "blue" - }, - { - "title":"Revenue", - "value":"4,300", - "unit":"$", - "description":"Year on year", - "change_percent": -8 - } - ]')); - -INSERT INTO example(component, description, properties) VALUES - ('big_number', 'Big numbers with dropdowns and customized layout', - json('[ - {"component":"big_number", "columns":3, "id":"colorfull_dashboard"}, - {"title":"Users", "value":"1,234", "color": "red", "title_link": "#users", "title_link_new_tab": false, "value_link": "#users_details", "value_link_new_tab": true }, - {"title":"Orders", "value":56, "color": "green", "title_link": "#orders", "title_link_new_tab": true }, - {"title":"Revenue", "value":"9,876", "unit": "€", "color": "blue", "change_percent": -7, "dropdown_item": [ - {"label":"This week", "link":"?days=7&component=big_number#colorfull_dashboard"}, - {"label":"This month", "link":"?days=30&component=big_number#colorfull_dashboard"}, - {"label":"This quarter", "link":"?days=90&component=big_number#colorfull_dashboard"} - ]} - ]')); diff --git a/examples/official-site/sqlpage/migrations/82_reference_catalog.sql b/examples/official-site/sqlpage/migrations/82_reference_catalog.sql index ef22e0f6f..45ba097f2 100644 --- a/examples/official-site/sqlpage/migrations/82_reference_catalog.sql +++ b/examples/official-site/sqlpage/migrations/82_reference_catalog.sql @@ -26,11 +26,8 @@ ALTER TABLE sqlpage_functions ADD COLUMN catalog_summary TEXT; ALTER TABLE sqlpage_function_parameters ADD COLUMN optional BOOLEAN NOT NULL DEFAULT FALSE; WITH copy(name, category, summary) AS (VALUES - ('big_number', 'display-data', 'Highlight a metric with a trend or progress indicator.'), ('card', 'display-data', 'Arrange records in cards with images, links, or embedded content.'), ('carousel', 'display-data', 'Show a slideshow of images with optional captions and controls.'), - ('datagrid', 'display-data', 'Lay out labeled values in a compact grid.'), - ('list', 'display-data', 'Present rows as a vertical list with optional links and icons.'), ('map', 'display-data', 'Plot locations and geographic shapes on an interactive map.'), ('timeline', 'display-data', 'Arrange events along a vertical timeline.'), ('tracking', 'display-data', 'Show a sequence of activity or status changes as colored segments.'), diff --git a/examples/official-site/sqlpage/migrations/99_shared_id_class_attributes.sql b/examples/official-site/sqlpage/migrations/99_shared_id_class_attributes.sql index 28082196c..24d15832e 100644 --- a/examples/official-site/sqlpage/migrations/99_shared_id_class_attributes.sql +++ b/examples/official-site/sqlpage/migrations/99_shared_id_class_attributes.sql @@ -13,15 +13,9 @@ INSERT INTO parameter(component, top_level, name, description, type, optional) SELECT *, 'id', 'id attribute added to the container in HTML. It can be used to target this item through css or for scrolling to this item through links (use "#id" in link url).', 'TEXT', TRUE FROM (VALUES - ('big_number', TRUE), - ('big_number', FALSE), ('card', FALSE), ('csv', TRUE), - ('datagrid', TRUE), - ('datagrid', FALSE), ('hero', TRUE), - ('list', TRUE), - ('list', FALSE), ('map', TRUE), ('timeline', TRUE), ('timeline', FALSE), @@ -32,14 +26,9 @@ FROM (VALUES INSERT INTO parameter(component, top_level, name, description, type, optional) SELECT *, 'class', 'class attribute added to the container in HTML. It can be used to apply custom styling to this item through css. Added in v0.18.0.', 'TEXT', TRUE FROM (VALUES - ('big_number', TRUE), - ('big_number', FALSE), ('card', TRUE), ('card', FALSE), ('csv', TRUE), - ('datagrid', TRUE), - ('list', TRUE), - ('list', FALSE), ('map', TRUE), ('timeline', TRUE), ('timeline', FALSE),