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: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@
10
10
- Revert a change introduced in v0.15.0:
11
11
- Re-add the systematic `CAST(? AS TEXT)` around variables, which helps the database know which type it is dealing with in advance. This fixes a regression in 0.15 where some SQLite websites were broken because of missing affinity information. In SQLite `SELECT '1' = 1` returns `false` but `SELECT CAST('1' AS TEXT) = 1` returns `true`.
12
12
- Fix a bug where [cookie](https://sql.ophir.dev/documentation.sql?component=cookie#component) removal set the cookie value to the empty string instead of removing the cookie completely.
13
+
- Support form submission using the [button](https://sql.ophir.dev/documentation.sql?component=button#component) component using its new `form` property. This allows you to create a form with multiple submit buttons that submit the form to different targets.
13
14
14
15
## 0.15.0 (2023-10-29)
15
16
- New function: [`sqlpage.path`](https://sql.ophir.dev/functions.sql?function=path#function) to get the path of the current page.
Copy file name to clipboardExpand all lines: examples/official-site/sqlpage/migrations/01_documentation.sql
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -235,6 +235,7 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S
235
235
('validate_color', 'The color of the button at the bottom of the form that submits the values. Omit this property to use the default color.', 'COLOR', TRUE, TRUE),
236
236
('validate_outline', 'A color to outline the validation button.', 'COLOR', TRUE, TRUE),
237
237
('reset', 'The text to display in the button at the bottom of the form that resets the form to its original state. Omit this property not to show a reset button at all.', 'TEXT', TRUE, TRUE),
238
+
('id', 'A unique identifier for the form, which can then be used to validate the form from a button outside of the form.', 'TEXT', TRUE, TRUE),
238
239
-- item level
239
240
('type', 'The type of input to use: text for a simple text field, textarea for a multi-line text input control, number for field that accepts only numbers, checkbox or radio for a button that is part of a group specified in the ''name'' parameter. This is set to "text" by default.', 'TEXT', FALSE, TRUE),
240
241
('name', 'The name of the input field, that you can use in the target page to get the value the user entered for the field.', 'TEXT', FALSE, FALSE),
Copy file name to clipboardExpand all lines: examples/official-site/sqlpage/migrations/18_button.sql
+18-2Lines changed: 18 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,14 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S
11
11
('size', 'The size of the buttons (e.g., sm, lg).', 'TEXT', TRUE, TRUE),
12
12
('shape', 'Shape of the buttons (e.g., pill, square)', 'TEXT', TRUE, TRUE),
13
13
-- Item-level parameters (for each button)
14
-
('link', 'The URL to which the button should navigate when clicked.', 'URL', FALSE, TRUE),
14
+
('link', 'The URL to which the button should navigate when clicked. If the form attribute is specified, then this overrides the page to which the form is submitted.', 'URL', FALSE, TRUE),
15
15
('color', 'The color of the button (e.g., red, green, blue, but also primary, warning, danger, orange, etc.).', 'COLOR', FALSE, TRUE),
16
16
('title', 'The text displayed on the button.', 'TEXT', FALSE, TRUE),
17
17
('disabled', 'Whether the button is disabled or not.', 'BOOLEAN', FALSE, TRUE),
18
18
('outline', 'Outline color of the button (e.g. red, purple, ...)', 'COLOR', FALSE, TRUE),
19
19
('space_after', 'Whether there should be extra space to the right of the button. In a line of buttons, this will put the buttons before this one on the left, and the ones after on the right.', 'BOOLEAN', FALSE, TRUE),
20
-
('icon', 'Name of an icon to be displayed on the left side of the button.', 'ICON', FALSE, TRUE)
20
+
('icon', 'Name of an icon to be displayed on the left side of the button.', 'ICON', FALSE, TRUE),
21
+
('form', 'Identifier (id) of the form to which the button should submit.', 'TEXT', FALSE, TRUE)
21
22
) x;
22
23
23
24
-- Inserting example information for the button component
@@ -58,4 +59,19 @@ INSERT INTO example(component, description, properties) VALUES
0 commit comments