Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/gtPublic

Prefix ids with table#1963

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
arbelt wants to merge25 commits intorstudio:master
base:master
Choose a base branch
Loading
fromarbelt:prefix-ids-with-table-id
Open
Changes from1 commit
Commits
Show all changes
25 commits
Select commitHold shift + click to select a range
b235bc8
Merge pull request #1965 from rstudio/ci-remove-connect-deploy
rich-iannoneMar 5, 2025
349c59e
initial add table_id
arbeltMar 1, 2025
a6a06e2
Add table_id parameter to render_row_data and update related functions
arbeltMar 1, 2025
17e09e8
Refactor ID attributes to use valid_html_id with tbl_id for improved …
arbeltMar 1, 2025
addfce8
Refactor header construction in render_row_data for improved ID handl…
arbeltMar 1, 2025
cb8309c
Fix handling of current_group_id in render_row_data to support vector…
arbeltMar 1, 2025
2ef58be
Fix: Avoid re-applying valid_html_id to row_id_i for stub cells in re…
arbeltMar 1, 2025
a3a6935
Refactor header component construction in render_row_data to separate…
arbeltMar 1, 2025
e33199a
Refactor header creation in render_row_data to handle group IDs and c…
arbeltMar 1, 2025
c8d44fd
Refactor render_row_data to improve group ID and row header ID handli…
arbeltMar 1, 2025
03bd760
Refactor render_row_data to improve header assignment logic, enhancin…
arbeltMar 1, 2025
b8e27e2
Enhance valid_html_id function to check for NA values in tbl_id, ensu…
arbeltMar 1, 2025
d4b63ab
Refactor create_body_component_h to correctly handle row ID generatio…
arbeltMar 1, 2025
2a865c6
Refactor render_row_data to streamline group ID handling, ensuring ac…
arbeltMar 6, 2025
28c59dd
update testing functions to accommodate prefixed element ids
arbeltMar 6, 2025
4bbb51d
use c to add stub indent class instead of paste
arbeltMar 7, 2025
834be43
update snapshot for tab_stub_indent after extra_classes fix
arbeltMar 7, 2025
d989bd9
Merge branch 'master' into prefix-ids-with-table-id
arbeltMar 7, 2025
cbbeb7a
don't manipulate or prefix empty ids in 'valid_html_id`
arbeltMar 11, 2025
86c21e7
more meaningful tests
arbeltMar 11, 2025
b5a27ed
fix test helper `remove_id_prefixes` and remove dep on stringr
arbeltMar 12, 2025
6e68d24
remove stringr dep from table_id test
arbeltMar 13, 2025
0c6617b
Merge branch 'master' into prefix-ids-with-table-id
arbeltApr 14, 2025
0e20650
Merge branch 'master' into prefix-ids-with-table-id
arbeltMay 26, 2025
fd4847e
Merge branch 'master' into prefix-ids-with-table-id
arbeltJun 20, 2025
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
PrevPrevious commit
NextNext commit
Add table_id parameter to render_row_data and update related functions
  • Loading branch information
@arbelt
arbelt committedMar 6, 2025
commita6a06e287a6e3f7d90c62c360a58c083a7548bc9
14 changes: 10 additions & 4 deletionsR/utils_render_html.R
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1445,6 +1445,8 @@ create_body_component_h <- function(data) {
# needs to be repeated to match the size of the other fields
group_ids <- vctrs::vec_rep_each(group_ids, times = ns)
body_rows_data_flat$current_group_id <- group_ids
# Pass the table_id to render_row_data
body_rows_data_flat$tbl_id <- tbl_id
## here we have to make sur the lengths can be recycled to each others.
# vctrs::vec_recycle_common()
body_rows_uncollapsed <- vctrs::vec_chop(
Expand DownExpand Up@@ -1527,7 +1529,8 @@ render_row_data <- function(
row_span_vals,
alignment_classes,
extra_classes,
row_styles
row_styles,
tbl_id = NULL # Add parameter for table_id
) {
n <- length(row_df)

Expand All@@ -1546,15 +1549,18 @@ render_row_data <- function(
scope[!is.na(row_span_vals) & row_span_vals > 1] <- "rowgroup"

has_group <- !is.na(current_group_id)

# Use tbl_id when calling valid_html_id
header <- paste0(
ifelse(has_group, current_group_id, ""), ifelse(has_group, " ", ""),
ifelse(has_group,valid_html_id(current_group_id, tbl_id), ""), ifelse(has_group, " ", ""),
row_id_i, ifelse(has_group | nzchar(row_id_i), " ", ""),
col_id_i
valid_html_id(col_id_i, tbl_id)
)

# For stub cells, also use valid_html_id for consistent IDs
base_attributes <- ifelse(
has_stub_class,
paste0("id=\"", row_id_i, "\" ", "scope=\"", scope, "\" "),
paste0("id=\"",valid_html_id(row_id_i, tbl_id), "\" ", "scope=\"", scope, "\" "),
paste0("headers=\"", header, "\" ")
)

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp