-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00eaf9f
commit ab1a455
Showing
5 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 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,57 @@ | ||
library(shiny) | ||
library(shinyNextUI) | ||
|
||
ui <- nextui_page( | ||
dark_mode = TRUE, | ||
spacer(y = 5), | ||
p(class = "font-extrabold text-2xl uppercase my-2", "No data"), | ||
spacer(y = 2), | ||
table(iris[0, ], hideHeader = TRUE), | ||
spacer(y = 5), | ||
p(class = "font-extrabold text-2xl uppercase my-2", "Single selection table"), | ||
spacer(y = 2), | ||
table( | ||
iris[1:5, ], | ||
removeWrapper = TRUE, | ||
isStriped = TRUE, | ||
color = "primary", | ||
selectionMode = "single", | ||
defaultSelectedKeys = JS("['2']") | ||
), | ||
spacer(y = 5), | ||
p(class = "font-extrabold text-2xl uppercase my-2", "Multiple selection table"), | ||
spacer(y = 2), | ||
table( | ||
iris[1:5, ], | ||
color = "primary", | ||
selectionMode = "multiple", | ||
defaultSelectedKeys = JS("['1', '2']"), | ||
disabledKeys = JS("['3']") | ||
), | ||
spacer(y = 5), | ||
p(class = "font-extrabold text-2xl uppercase my-2", "Top/Bottom content"), | ||
spacer(y = 2), | ||
table( | ||
iris[1:5, ], | ||
isCompact = TRUE, | ||
topContent = div( | ||
class = "flex justify-between", | ||
p("Top content ..."), | ||
chip("My chip"), | ||
badge(button("CLick me"), color = "success", placement = "top-right", content = "New") | ||
), | ||
bottomContent = div( | ||
class = "flex justify-between", | ||
p("Bottom content ..."), | ||
link( | ||
href = "https://nextui.org/docs/components/table", | ||
target = "_blank", | ||
"To the doc." | ||
) | ||
) | ||
) | ||
) | ||
|
||
server <- function(input, output, session) {} | ||
|
||
shinyApp(ui, server) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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,13 @@ | ||
library(shinytest2) | ||
test_that("table works as expected", { | ||
# Don't run these tests on the CRAN build servers | ||
skip_on_cran() | ||
shiny_app_path <- | ||
system.file("examples/table/app.R", package = "shinyNextUI") | ||
app <- AppDriver$new( | ||
shiny_app_path, | ||
name = "table-app", | ||
variant = platform_variant() | ||
) | ||
app$expect_values() | ||
}) |