-
-
Notifications
You must be signed in to change notification settings - Fork 154
New modal component #934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
New modal component #934
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0354c6d
New modal component and upgrade of the button component to allow the …
olivierauverlot 49ee73b
Modal component
olivierauverlot e06f9a5
Update examples/official-site/sqlpage/migrations/63_modal.sql
olivierauverlot 0fde9ea
Support for embed content in modal box
olivierauverlot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,28 @@ | ||
| INSERT INTO component(name, icon, description, introduced_in_version) VALUES | ||
| ('modal', 'app-window', 'Defines the content of a modal box. Useful for displaying additional information or help.', '0.36.0'); | ||
|
|
||
| INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'modal', * FROM (VALUES | ||
| ('title','Description of the modal box.','TEXT',TRUE,FALSE), | ||
| ('close','The text to display in the Close button.','TEXT',TRUE,FALSE), | ||
| ('contents','A paragraph of text to display, without any formatting, without having to make additional queries.','TEXT',FALSE,TRUE), | ||
| ('contents_md','Rich text in the markdown format. Among others, this allows you to write bold text using **bold**, italics using *italics*, and links using [text](https://example.com).','TEXT',FALSE,TRUE), | ||
| ('unsafe_contents_md','Markdown format with html blocks. Use this only with trusted content. See the html-blocks section of the Commonmark spec for additional info.','TEXT',FALSE,TRUE), | ||
| ('scrollable','Dreate a scrollable modal that allows scroll the modal body.','BOOLEAN',TRUE,TRUE), | ||
| ('class','Class attribute added to the container in HTML. It can be used to apply custom styling to this item through css.','TEXT',TRUE,TRUE), | ||
| ('id','ID attribute added to the container in HTML. It can be used to target this item through css or for displaying this item.','TEXT',TRUE,FALSE) | ||
| ) x; | ||
|
|
||
| INSERT INTO example(component, description, properties) VALUES | ||
| ('modal', | ||
| 'This example shows how to create a modal box that displays a paragraph of text. The modal window is opened with the help of a button.', | ||
| json('[ | ||
| {"component": "modal","id": "my_modal","title": "A modal box","close": "Close"}, | ||
| {"contents":"I''m a modal window, and I allow you to display additional information or help for the user."}, | ||
| {"component": "button"}, | ||
| {"title":"Open","modal":"my_modal"} | ||
| ]') | ||
| ); | ||
|
|
||
| INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'button', * FROM (VALUES | ||
| ('modal','Display the modal window corresponding to the specified ID.','TEXT',FALSE,TRUE) | ||
| ) x; | ||
This file contains hidden or 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 hidden or 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,28 @@ | ||
| <div class="modal{{~#if class}} {{class}}{{/if~}}" id="{{id}}" tabindex="-1" aria-hidden="false" aria-labelledby="{{title}}"> | ||
| <div class="modal-dialog{{#if scrollable}} modal-dialog-scrollable"{{/if}} role="document"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <h5 class="modal-title">{{title}}</h5> | ||
| <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{close}}"></button> | ||
| </div> | ||
| <div class="modal-body"> | ||
| {{~#each_row~}} | ||
| <p> | ||
| {{~#if contents_md~}} | ||
| {{{markdown contents_md}}} | ||
| {{else}} | ||
| {{~#if unsafe_contents_md~}} | ||
| {{{markdown unsafe_contents_md 'allow_unsafe'}}} | ||
| {{else}} | ||
lovasoa marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| {{~contents~}} | ||
| {{~/if~}} | ||
| {{~/if~}} | ||
| </p> | ||
| {{~/each_row~}} | ||
| </div> | ||
| <div class="modal-footer"> | ||
| <button type="button" class="btn me-primary" data-bs-dismiss="modal">{{close}}</button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.