You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Cargo.toml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
[package]
2
2
name = "sqlpage"
3
-
version = "0.9.4"
3
+
version = "0.9.5"
4
4
edition = "2021"
5
5
description = "A SQL-only web application framework. Takes .sql files and formats the query result using pre-made configurable professional-looking components."
INSERT INTO component (name, description, icon, introduced_in_version)
2
+
VALUES (
3
+
'tab',
4
+
'Build a tabbed interface, with each tab being a link to a page. Each tab can be in two states: active or inactive.',
5
+
'row-insert-bottom',
6
+
'0.9.5'
7
+
);
8
+
-- Insert the parameters for the http_header component into the parameter table
9
+
INSERT INTO parameter (
10
+
component,
11
+
name,
12
+
description,
13
+
type,
14
+
top_level,
15
+
optional
16
+
)
17
+
VALUES (
18
+
'tab',
19
+
'title',
20
+
'Text to display on the tab.',
21
+
'TEXT',
22
+
FALSE,
23
+
FALSE
24
+
),
25
+
(
26
+
'tab',
27
+
'link',
28
+
'Link to the page to display when the tab is clicked. By default, the link refers to the current page, with a ''tab'' parameter set to the tab''s title.',
29
+
'TEXT',
30
+
FALSE,
31
+
TRUE
32
+
),
33
+
(
34
+
'tab',
35
+
'active',
36
+
'Whether the tab is active or not. Defaults to false.',
37
+
'BOOLEAN',
38
+
FALSE,
39
+
TRUE
40
+
),
41
+
(
42
+
'tab',
43
+
'icon',
44
+
'Name of the icon to display on the tab. See tabler-icons.io for a list of available icons.',
45
+
'TEXT',
46
+
FALSE,
47
+
TRUE
48
+
),
49
+
(
50
+
'tab',
51
+
'color',
52
+
'Color of the tab. See preview.tabler.io/colors.html for a list of available colors.',
53
+
'TEXT',
54
+
FALSE,
55
+
TRUE
56
+
),
57
+
(
58
+
'tab',
59
+
'description',
60
+
'Description of the tab. This is displayed when the user hovers over the tab.',
61
+
'TEXT',
62
+
FALSE,
63
+
TRUE
64
+
),
65
+
(
66
+
'tab',
67
+
'center',
68
+
'Whether the tabs should be centered or not. Defaults to false.',
69
+
'BOOLEAN',
70
+
TRUE,
71
+
TRUE
72
+
)
73
+
;
74
+
75
+
INSERT INTO example (component, description, properties)
76
+
VALUES (
77
+
'tab',
78
+
'This example shows a very basic set of three tabs. The first tab is active. You could use this at the top of a page for easy navigation.
79
+
80
+
To implement contents that change based on the active tab, use the `tab` parameter in the page query string.
81
+
For example, if the page is `/my-page.sql`, then the first tab will have a link of `/my-page.sql?tab=My+First+tab`.
82
+
83
+
You could then for instance display contents coming from the database based on the value of the `tab` parameter.
84
+
For instance: `SELECT ''text'' AS component, contents_md FROM my_page_contents WHERE tab = $tab`
85
+
',
86
+
JSON(
87
+
'[
88
+
{ "component": "tab" },
89
+
{ "title": "My First tab", "active": true },
90
+
{ "title": "This is tab two" },
91
+
{ "title": "Third tab is crazy" }
92
+
]'
93
+
)
94
+
),
95
+
(
96
+
'tab',
97
+
'This example shows a more sophisticated set of tabs. The tabs are centered, the active tab has a different color, and all the tabs have a custom link and icon.',
98
+
JSON(
99
+
'[
100
+
{ "component": "tab", "center": true },
101
+
{ "title": "Hero", "link": "?component=hero#component", "icon": "home", "description": "The hero component is a full-width banner with a title and an image." },
0 commit comments