-
Notifications
You must be signed in to change notification settings - Fork 65
Refresh tables #665
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
Refresh tables #665
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
56e9df1
feat(shiny-preset): Add styles for DT and tables
gadenbuie d25cf83
chore: simplify where styles and variables are stored
gadenbuie b72096b
feat(shiny-preset): Use card's `[data-full-screen]` attribute to styl…
gadenbuie d1845c2
feat(shiny-preset): stripes on even, fix hover/selected
gadenbuie 2d1a26e
Resave distributed files (GitHub Action)
gadenbuie 211cbe6
Merged origin/main into refresh/tables
gadenbuie 0d7d5ac
feat(shiny-preset): Use BS CSS vars for DT table styles
gadenbuie c6ce1cb
feat(shiny-preset): Use `--bslib-spacer`
gadenbuie 9905dc7
Resave distributed files (GitHub Action)
gadenbuie 9522dd1
feat(shiny-preset): Add `.bslib-card-table-sm` class
gadenbuie 7c5f9ad
chore: Apply suggestions from code review
gadenbuie 3886716
feat: Support even or odd table striping
gadenbuie 8d43b81
fix: table stripe is default but user can change it
gadenbuie 3115478
Resave data (GitHub Action)
gadenbuie 7746b0a
chore: Leave todo about card.scss option
gadenbuie 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
Binary file not shown.
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
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,97 @@ | ||
| // TODO: Many of these rules could be applied to all bslib themes | ||
| .table.dataTable { | ||
| // CSS variables are scoped to datatables in Bootstrap | ||
| --dt-row-selected: var(--bs-primary-rgb, "0,123,194"); | ||
| --dt-row-selected-text: var(--bs-white-rgb, "255,255,255"); | ||
| --dt-row-selected-link: var(--bs-light-rgh, "248,248,248"); | ||
| } | ||
|
|
||
| // Note CSS specificity hack because DT's CSS deps are loaded after the theme | ||
| .table.dataTable.dataTable { | ||
gadenbuie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| $class-stripe: "even"; | ||
| $class-unstriped: "odd"; | ||
|
|
||
| @if $table-striped-order == odd { | ||
| $class-stripe: "odd"; | ||
| $class-unstriped: "even"; | ||
| } | ||
|
|
||
| &.table-striped > tbody > tr.#{$class-unstriped}:not(.selected) > * { | ||
| box-shadow: none; | ||
| } | ||
|
|
||
| &.table-striped > tbody > tr.#{$class-stripe}:not(.selected) > * { | ||
| box-shadow: inset 0 0 0 9999px var(--bs-table-striped-bg); | ||
| } | ||
|
|
||
| tbody td.active, | ||
| tbody tr.active td { | ||
| background-color: var(--bs-table-active-bg); | ||
| } | ||
|
|
||
| &.table-hover > tbody > tr:hover:not(.selected) > * { | ||
| box-shadow: inset 0 0 0 9999px var(--bs-table-hover-bg); | ||
| } | ||
| } | ||
|
|
||
| thead, tbody, tfoot, tr, td, th { | ||
| border: none; | ||
| } | ||
|
|
||
| .table > thead { | ||
| border-bottom: 1px solid var(--bs-table-color); | ||
| } | ||
|
|
||
| th { | ||
| font-weight: 600; | ||
| } | ||
|
|
||
| .datatables { | ||
| // Table pagination row tweaks | ||
| .dataTables_wrapper div.dataTables_info { | ||
| padding-top: calc(var(--bslib-spacer, 1rem) * 1.65); | ||
| font-size: .95rem; | ||
| } | ||
|
|
||
| .dataTables_paginate { | ||
| padding-top: var(--bslib-spacer, 1rem); | ||
| } | ||
|
|
||
| .paginate_button a { | ||
| font-size: .95rem; | ||
| } | ||
|
|
||
| // create space between 'show ___ entries' and 'search' above table | ||
| .dataTables_length, .dataTables_filter { | ||
| padding-bottom: var(--bslib-spacer, 1rem); | ||
| } | ||
|
|
||
| // Scroll the data table container, not the entire wrapper | ||
| .dataTables_wrapper .dt-row { | ||
| max-width: 100%; | ||
| overflow: auto; | ||
| } | ||
|
|
||
| // Style the length and search inputs | ||
| .dataTables_wrapper .dataTables_length select, | ||
| .dataTables_wrapper .dataTables_filter input { | ||
| border: none; | ||
| border-bottom: 1px solid var(--bs-body-color); | ||
| border-radius: 0; | ||
| } | ||
| } | ||
|
|
||
| // TODO: This could be applied more generally via the card scss | ||
| .bslib-card-table-sm { | ||
gadenbuie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| &.bslib-card[data-full-screen="false"] .datatables .dataTables_wrapper { | ||
| font-size: 85%; | ||
|
|
||
| // hide the supporting elements when inside a non-full-screen card | ||
| .dataTables_length, // show ___ entries | ||
| .dataTables_filter, // search | ||
| .dataTables_info, // showing 1 to 10 of 100 entries | ||
| .dataTables_paginate { | ||
| display: none; | ||
| } | ||
| } | ||
| } | ||
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
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.