Skip to content

Commit fd4adc7

Browse files
committed
Refactor: added new links in 49_big_number.sql
1 parent 26f6fb8 commit fd4adc7

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
-- Big Number Component Documentation
2+
3+
-- Component Definition
4+
INSERT INTO component(name, icon, description, introduced_in_version) VALUES
5+
('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');
6+
7+
-- Inserting parameter information for the big_number component
8+
INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'big_number', * FROM (VALUES
9+
-- Top-level parameters (for the whole big_number list)
10+
('columns', 'The number of columns to display the big numbers in (default is one column per item).', 'INTEGER', TRUE, TRUE),
11+
('id', 'An optional ID to be used as an anchor for links.', 'TEXT', TRUE, TRUE),
12+
('class', 'An optional CSS class to be added to the component for custom styling', 'TEXT', TRUE, TRUE),
13+
-- Item-level parameters (for each big number)
14+
('title', 'The title or label for the big number.', 'TEXT', FALSE, TRUE),
15+
('title_link', 'A link for the Big Number title. If set, the entire title becomes clickable.', 'TEXT', FALSE, TRUE),
16+
('title_link_new_tab', 'If true, the title link will open in a new tab/window.', 'BOOLEAN', FALSE, TRUE),
17+
('value_link', 'A link for the Big Number value. If set, the entire value becomes clickable.', 'TEXT', FALSE, TRUE),
18+
('value_link_new_tab', 'If true, the value link will open in a new tab/window.', 'BOOLEAN', FALSE, TRUE),
19+
('value', 'The main value to be displayed prominently.', 'TEXT', FALSE, FALSE),
20+
('unit', 'The unit of measurement for the value.', 'TEXT', FALSE, TRUE),
21+
('description', 'A description or additional context for the big number.', 'TEXT', FALSE, TRUE),
22+
('change_percent', 'The percentage change in value (e.g., 7 for 7% increase, -8 for 8% decrease).', 'INTEGER', FALSE, TRUE),
23+
('progress_percent', 'The value of the progress (0-100).', 'INTEGER', FALSE, TRUE),
24+
('progress_color', 'The color of the progress bar (e.g., "primary", "success", "danger").', 'TEXT', FALSE, TRUE),
25+
('dropdown_item', 'A list of JSON objects containing links. e.g. {"label":"This week", "link":"?days=7"}', 'JSON', FALSE, TRUE),
26+
('color', 'The color of the card', 'COLOR', FALSE, TRUE)
27+
) x;
28+
29+
INSERT INTO example(component, description, properties) VALUES
30+
('big_number', 'Big numbers with change indicators and progress bars',
31+
json('[
32+
{"component":"big_number"},
33+
{
34+
"title":"Sales",
35+
"value":75,
36+
"unit":"%",
37+
"title_link": "/sales_dashboard.sql",
38+
"title_link_new_tab": true,
39+
"value_link": "/sales_details.sql",
40+
"value_link_new_tab": false,
41+
"description":"Conversion rate",
42+
"change_percent": 9,
43+
"progress_percent": 75,
44+
"progress_color": "blue"
45+
},
46+
{
47+
"title":"Revenue",
48+
"value":"4,300",
49+
"unit":"$",
50+
"description":"Year on year",
51+
"change_percent": -8
52+
}
53+
]'));
54+
55+
INSERT INTO example(component, description, properties) VALUES
56+
('big_number', 'Big numbers with dropdowns and customized layout',
57+
json('[
58+
{"component":"big_number", "columns":3, "id":"colorfull_dashboard"},
59+
{"title":"Users", "value":"1,234", "color": "red", "title_link": "/users_dashboard.sql", "title_link_new_tab": false, "value_link": "/users_details.sql", "value_link_new_tab": true },
60+
{"title":"Orders", "value":56, "color": "green", "title_link": "/orders.sql", "title_link_new_tab": true },
61+
{"title":"Revenue", "value":"9,876", "unit": "€", "color": "blue", "change_percent": -7, "dropdown_item": [
62+
{"label":"This week", "link":"?days=7&component=big_number#colorfull_dashboard"},
63+
{"label":"This month", "link":"?days=30&component=big_number#colorfull_dashboard"},
64+
{"label":"This quarter", "link":"?days=90&component=big_number#colorfull_dashboard"}
65+
]}
66+
]'));

0 commit comments

Comments
 (0)