Skip to content

Commit ae9bef7

Browse files
committed
Make card() a custom element
1 parent 2722bb2 commit ae9bef7

12 files changed

+526
-689
lines changed

R/card.R

+3-10
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ card <- function(..., full_screen = FALSE, height = NULL, max_height = NULL, min
9090
max_height = validateCssUnit(max_height),
9191
min_height = validateCssUnit(min_height)
9292
),
93-
"data-bslib-card-init" = NA,
94-
"data-full-screen" = if (full_screen) "false",
93+
"data-full-screen" = if (full_screen) "false",
9594
!!!attribs,
9695
!!!children,
9796
if (full_screen) full_screen_toggle(attribs$id),
98-
card_init_js(),
9997
component_dependencies()
10098
)
10199

100+
tag <- web_component("bslib-card", tag)
101+
102102
tag <- bindFillRole(tag, container = TRUE, item = fill)
103103
tag <- tagAppendAttributes(tag, class = class)
104104

@@ -313,13 +313,6 @@ full_screen_toggle <- function(id_controls) {
313313
)
314314
}
315315

316-
card_init_js <- function() {
317-
tags$script(
318-
`data-bslib-card-init` = NA,
319-
HTML("bslib.Card.initializeAllCards();")
320-
)
321-
}
322-
323316
full_screen_toggle_icon <- function() {
324317
# https://www.visiwig.com/icons/
325318
# https://www.visiwig.com/icons-license/

inst/components/dist/components.js

-330
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/components/dist/components.js.map

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)