Skip to content
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

Make card() a custom element #1009

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions R/card.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ card <- function(..., full_screen = FALSE, height = NULL, max_height = NULL, min
max_height = validateCssUnit(max_height),
min_height = validateCssUnit(min_height)
),
"data-bslib-card-init" = NA,
"data-full-screen" = if (full_screen) "false",
!!!attribs,
!!!children,
if (full_screen) full_screen_toggle(attribs$id),
card_init_js(),
component_dependencies()
)

tag <- bindFillRole(tag, container = TRUE, item = fill)
tag <- tagAppendAttributes(tag, class = class)

tag <- web_component("bslib-card", tag)

as_fragment(
tag_require(tag, version = 5, caller = "card()")
)
Expand Down Expand Up @@ -313,13 +313,6 @@ full_screen_toggle <- function(id_controls) {
)
}

card_init_js <- function() {
tags$script(
`data-bslib-card-init` = NA,
HTML("bslib.Card.initializeAllCards();")
)
}

full_screen_toggle_icon <- function() {
# https://www.visiwig.com/icons/
# https://www.visiwig.com/icons-license/
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
330 changes: 0 additions & 330 deletions inst/components/dist/components.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions inst/components/dist/components.js.map

Large diffs are not rendered by default.

Loading