pub mod element {
#[doc(alias = "tbody")]
#[non_exhaustive]
#[derive(PartialEq, Clone, Default)]
pub struct TableBody {
sys: html_sys::tables::TableBody,
children: Vec<super::child::TableBodyChild>,
}
impl TableBody {
pub fn builder() -> super::builder::TableBodyBuilder {
super::builder::TableBodyBuilder::new(Default::default())
}
}
impl TableBody {
pub fn data_map(&self) -> &html_sys::DataMap {
&self.sys.data_map
}
pub fn data_map_mut(&mut self) -> &mut html_sys::DataMap {
&mut self.sys.data_map
}
}
impl TableBody {
pub fn role(&self) -> std::option::Option<&str> {
self.sys.role.as_deref()
}
pub fn set_role(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.role = value.map(|v| v.into());
}
pub fn aria_active_descendant_element(&self) -> std::option::Option<&str> {
self.sys.aria_active_descendant_element.as_deref()
}
pub fn set_aria_active_descendant_element(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_active_descendant_element = value.map(|v| v.into());
}
pub fn aria_atomic(&self) -> bool {
self.sys.aria_atomic
}
pub fn set_aria_atomic(&mut self, value: bool) {
self.sys.aria_atomic = value;
}
pub fn aria_auto_complete(&self) -> std::option::Option<&str> {
self.sys.aria_auto_complete.as_deref()
}
pub fn set_aria_auto_complete(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_auto_complete = value.map(|v| v.into());
}
pub fn aria_braille_label(&self) -> std::option::Option<&str> {
self.sys.aria_braille_label.as_deref()
}
pub fn set_aria_braille_label(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_braille_label = value.map(|v| v.into());
}
pub fn aria_braille_role_description(&self) -> std::option::Option<&str> {
self.sys.aria_braille_role_description.as_deref()
}
pub fn set_aria_braille_role_description(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_braille_role_description = value.map(|v| v.into());
}
pub fn aria_busy(&self) -> bool {
self.sys.aria_busy
}
pub fn set_aria_busy(&mut self, value: bool) {
self.sys.aria_busy = value;
}
pub fn aria_checked(&self) -> std::option::Option<&str> {
self.sys.aria_checked.as_deref()
}
pub fn set_aria_checked(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_checked = value.map(|v| v.into());
}
pub fn aria_col_count(&self) -> std::option::Option<i64> {
self.sys.aria_col_count
}
pub fn set_aria_col_count(&mut self, value: std::option::Option<i64>) {
self.sys.aria_col_count = value;
}
pub fn aria_col_index(&self) -> std::option::Option<i64> {
self.sys.aria_col_index
}
pub fn set_aria_col_index(&mut self, value: std::option::Option<i64>) {
self.sys.aria_col_index = value;
}
pub fn aria_col_index_text(&self) -> std::option::Option<&str> {
self.sys.aria_col_index_text.as_deref()
}
pub fn set_aria_col_index_text(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_col_index_text = value.map(|v| v.into());
}
pub fn aria_col_span(&self) -> std::option::Option<i64> {
self.sys.aria_col_span
}
pub fn set_aria_col_span(&mut self, value: std::option::Option<i64>) {
self.sys.aria_col_span = value;
}
pub fn aria_controls_elements(&self) -> std::option::Option<&str> {
self.sys.aria_controls_elements.as_deref()
}
pub fn set_aria_controls_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_controls_elements = value.map(|v| v.into());
}
pub fn aria_current(&self) -> std::option::Option<&str> {
self.sys.aria_current.as_deref()
}
pub fn set_aria_current(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_current = value.map(|v| v.into());
}
pub fn aria_described_by_elements(&self) -> std::option::Option<&str> {
self.sys.aria_described_by_elements.as_deref()
}
pub fn set_aria_described_by_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_described_by_elements = value.map(|v| v.into());
}
pub fn aria_description(&self) -> std::option::Option<&str> {
self.sys.aria_description.as_deref()
}
pub fn set_aria_description(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_description = value.map(|v| v.into());
}
pub fn aria_details_elements(&self) -> std::option::Option<&str> {
self.sys.aria_details_elements.as_deref()
}
pub fn set_aria_details_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_details_elements = value.map(|v| v.into());
}
pub fn aria_disabled(&self) -> bool {
self.sys.aria_disabled
}
pub fn set_aria_disabled(&mut self, value: bool) {
self.sys.aria_disabled = value;
}
pub fn aria_drop_effect(&self) -> std::option::Option<&str> {
self.sys.aria_drop_effect.as_deref()
}
pub fn set_aria_drop_effect(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_drop_effect = value.map(|v| v.into());
}
pub fn aria_error_message_elements(&self) -> std::option::Option<&str> {
self.sys.aria_error_message_elements.as_deref()
}
pub fn set_aria_error_message_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_error_message_elements = value.map(|v| v.into());
}
pub fn aria_expanded(&self) -> bool {
self.sys.aria_expanded
}
pub fn set_aria_expanded(&mut self, value: bool) {
self.sys.aria_expanded = value;
}
pub fn aria_flow_to_elements(&self) -> std::option::Option<&str> {
self.sys.aria_flow_to_elements.as_deref()
}
pub fn set_aria_flow_to_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_flow_to_elements = value.map(|v| v.into());
}
pub fn aria_grabbed(&self) -> bool {
self.sys.aria_grabbed
}
pub fn set_aria_grabbed(&mut self, value: bool) {
self.sys.aria_grabbed = value;
}
pub fn aria_has_popup(&self) -> std::option::Option<&str> {
self.sys.aria_has_popup.as_deref()
}
pub fn set_aria_has_popup(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_has_popup = value.map(|v| v.into());
}
pub fn aria_hidden(&self) -> bool {
self.sys.aria_hidden
}
pub fn set_aria_hidden(&mut self, value: bool) {
self.sys.aria_hidden = value;
}
pub fn aria_invalid(&self) -> std::option::Option<&str> {
self.sys.aria_invalid.as_deref()
}
pub fn set_aria_invalid(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_invalid = value.map(|v| v.into());
}
pub fn aria_key_shortcuts(&self) -> std::option::Option<&str> {
self.sys.aria_key_shortcuts.as_deref()
}
pub fn set_aria_key_shortcuts(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_key_shortcuts = value.map(|v| v.into());
}
pub fn aria_label(&self) -> std::option::Option<&str> {
self.sys.aria_label.as_deref()
}
pub fn set_aria_label(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_label = value.map(|v| v.into());
}
pub fn aria_labelled_by_elements(&self) -> std::option::Option<&str> {
self.sys.aria_labelled_by_elements.as_deref()
}
pub fn set_aria_labelled_by_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_labelled_by_elements = value.map(|v| v.into());
}
pub fn aria_level(&self) -> std::option::Option<i64> {
self.sys.aria_level
}
pub fn set_aria_level(&mut self, value: std::option::Option<i64>) {
self.sys.aria_level = value;
}
pub fn aria_live(&self) -> std::option::Option<&str> {
self.sys.aria_live.as_deref()
}
pub fn set_aria_live(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_live = value.map(|v| v.into());
}
pub fn aria_modal(&self) -> bool {
self.sys.aria_modal
}
pub fn set_aria_modal(&mut self, value: bool) {
self.sys.aria_modal = value;
}
pub fn aria_multi_line(&self) -> bool {
self.sys.aria_multi_line
}
pub fn set_aria_multi_line(&mut self, value: bool) {
self.sys.aria_multi_line = value;
}
pub fn aria_multi_selectable(&self) -> bool {
self.sys.aria_multi_selectable
}
pub fn set_aria_multi_selectable(&mut self, value: bool) {
self.sys.aria_multi_selectable = value;
}
pub fn aria_orientation(&self) -> std::option::Option<&str> {
self.sys.aria_orientation.as_deref()
}
pub fn set_aria_orientation(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_orientation = value.map(|v| v.into());
}
pub fn aria_owns_elements(&self) -> std::option::Option<&str> {
self.sys.aria_owns_elements.as_deref()
}
pub fn set_aria_owns_elements(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_owns_elements = value.map(|v| v.into());
}
pub fn aria_placeholder(&self) -> std::option::Option<&str> {
self.sys.aria_placeholder.as_deref()
}
pub fn set_aria_placeholder(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_placeholder = value.map(|v| v.into());
}
pub fn aria_pos_in_set(&self) -> std::option::Option<i64> {
self.sys.aria_pos_in_set
}
pub fn set_aria_pos_in_set(&mut self, value: std::option::Option<i64>) {
self.sys.aria_pos_in_set = value;
}
pub fn aria_pressed(&self) -> std::option::Option<&str> {
self.sys.aria_pressed.as_deref()
}
pub fn set_aria_pressed(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_pressed = value.map(|v| v.into());
}
pub fn aria_read_only(&self) -> bool {
self.sys.aria_read_only
}
pub fn set_aria_read_only(&mut self, value: bool) {
self.sys.aria_read_only = value;
}
pub fn aria_relevant(&self) -> std::option::Option<&str> {
self.sys.aria_relevant.as_deref()
}
pub fn set_aria_relevant(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_relevant = value.map(|v| v.into());
}
pub fn aria_required(&self) -> bool {
self.sys.aria_required
}
pub fn set_aria_required(&mut self, value: bool) {
self.sys.aria_required = value;
}
pub fn aria_role_description(&self) -> std::option::Option<&str> {
self.sys.aria_role_description.as_deref()
}
pub fn set_aria_role_description(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_role_description = value.map(|v| v.into());
}
pub fn aria_row_count(&self) -> std::option::Option<i64> {
self.sys.aria_row_count
}
pub fn set_aria_row_count(&mut self, value: std::option::Option<i64>) {
self.sys.aria_row_count = value;
}
pub fn aria_row_index(&self) -> std::option::Option<i64> {
self.sys.aria_row_index
}
pub fn set_aria_row_index(&mut self, value: std::option::Option<i64>) {
self.sys.aria_row_index = value;
}
pub fn aria_row_index_text(&self) -> std::option::Option<&str> {
self.sys.aria_row_index_text.as_deref()
}
pub fn set_aria_row_index_text(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_row_index_text = value.map(|v| v.into());
}
pub fn aria_row_span(&self) -> std::option::Option<i64> {
self.sys.aria_row_span
}
pub fn set_aria_row_span(&mut self, value: std::option::Option<i64>) {
self.sys.aria_row_span = value;
}
pub fn aria_selected(&self) -> bool {
self.sys.aria_selected
}
pub fn set_aria_selected(&mut self, value: bool) {
self.sys.aria_selected = value;
}
pub fn aria_set_size(&self) -> std::option::Option<i64> {
self.sys.aria_set_size
}
pub fn set_aria_set_size(&mut self, value: std::option::Option<i64>) {
self.sys.aria_set_size = value;
}
pub fn aria_sort(&self) -> std::option::Option<&str> {
self.sys.aria_sort.as_deref()
}
pub fn set_aria_sort(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_sort = value.map(|v| v.into());
}
pub fn aria_value_max(&self) -> std::option::Option<f64> {
self.sys.aria_value_max
}
pub fn set_aria_value_max(&mut self, value: std::option::Option<f64>) {
self.sys.aria_value_max = value;
}
pub fn aria_value_min(&self) -> std::option::Option<f64> {
self.sys.aria_value_min
}
pub fn set_aria_value_min(&mut self, value: std::option::Option<f64>) {
self.sys.aria_value_min = value;
}
pub fn aria_value_now(&self) -> std::option::Option<f64> {
self.sys.aria_value_now
}
pub fn set_aria_value_now(&mut self, value: std::option::Option<f64>) {
self.sys.aria_value_now = value;
}
pub fn aria_value_text(&self) -> std::option::Option<&str> {
self.sys.aria_value_text.as_deref()
}
pub fn set_aria_value_text(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.aria_value_text = value.map(|v| v.into());
}
pub fn access_key(&self) -> std::option::Option<&str> {
self.sys.access_key.as_deref()
}
pub fn set_access_key(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.access_key = value.map(|v| v.into());
}
pub fn auto_capitalize(&self) -> std::option::Option<&str> {
self.sys.auto_capitalize.as_deref()
}
pub fn set_auto_capitalize(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.auto_capitalize = value.map(|v| v.into());
}
pub fn autofocus(&self) -> bool {
self.sys.autofocus
}
pub fn set_autofocus(&mut self, value: bool) {
self.sys.autofocus = value;
}
pub fn class(&self) -> std::option::Option<&str> {
self.sys.class.as_deref()
}
pub fn set_class(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.class = value.map(|v| v.into());
}
pub fn content_editable(&self) -> std::option::Option<&str> {
self.sys.content_editable.as_deref()
}
pub fn set_content_editable(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.content_editable = value.map(|v| v.into());
}
pub fn direction(&self) -> std::option::Option<&str> {
self.sys.direction.as_deref()
}
pub fn set_direction(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.direction = value.map(|v| v.into());
}
pub fn draggable(&self) -> bool {
self.sys.draggable
}
pub fn set_draggable(&mut self, value: bool) {
self.sys.draggable = value;
}
pub fn enter_key_hint(&self) -> std::option::Option<&str> {
self.sys.enter_key_hint.as_deref()
}
pub fn set_enter_key_hint(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.enter_key_hint = value.map(|v| v.into());
}
pub fn export_parts(&self) -> std::option::Option<&str> {
self.sys.export_parts.as_deref()
}
pub fn set_export_parts(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.export_parts = value.map(|v| v.into());
}
pub fn hidden(&self) -> std::option::Option<&str> {
self.sys.hidden.as_deref()
}
pub fn set_hidden(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.hidden = value.map(|v| v.into());
}
pub fn id(&self) -> std::option::Option<&str> {
self.sys.id.as_deref()
}
pub fn set_id(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.id = value.map(|v| v.into());
}
pub fn inert(&self) -> bool {
self.sys.inert
}
pub fn set_inert(&mut self, value: bool) {
self.sys.inert = value;
}
pub fn input_mode(&self) -> std::option::Option<&str> {
self.sys.input_mode.as_deref()
}
pub fn set_input_mode(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.input_mode = value.map(|v| v.into());
}
pub fn is_(&self) -> std::option::Option<&str> {
self.sys.is_.as_deref()
}
pub fn set_is_(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.is_ = value.map(|v| v.into());
}
pub fn item_id(&self) -> std::option::Option<&str> {
self.sys.item_id.as_deref()
}
pub fn set_item_id(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.item_id = value.map(|v| v.into());
}
pub fn item_prop(&self) -> std::option::Option<&str> {
self.sys.item_prop.as_deref()
}
pub fn set_item_prop(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.item_prop = value.map(|v| v.into());
}
pub fn item_ref(&self) -> std::option::Option<&str> {
self.sys.item_ref.as_deref()
}
pub fn set_item_ref(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.item_ref = value.map(|v| v.into());
}
pub fn item_scope(&self) -> std::option::Option<&str> {
self.sys.item_scope.as_deref()
}
pub fn set_item_scope(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.item_scope = value.map(|v| v.into());
}
pub fn item_type(&self) -> std::option::Option<&str> {
self.sys.item_type.as_deref()
}
pub fn set_item_type(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.item_type = value.map(|v| v.into());
}
pub fn lang(&self) -> std::option::Option<&str> {
self.sys.lang.as_deref()
}
pub fn set_lang(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.lang = value.map(|v| v.into());
}
pub fn nonce(&self) -> std::option::Option<&str> {
self.sys.nonce.as_deref()
}
pub fn set_nonce(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.nonce = value.map(|v| v.into());
}
pub fn part(&self) -> std::option::Option<&str> {
self.sys.part.as_deref()
}
pub fn set_part(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.part = value.map(|v| v.into());
}
pub fn slot(&self) -> std::option::Option<&str> {
self.sys.slot.as_deref()
}
pub fn set_slot(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.slot = value.map(|v| v.into());
}
pub fn spellcheck(&self) -> std::option::Option<&str> {
self.sys.spellcheck.as_deref()
}
pub fn set_spellcheck(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.spellcheck = value.map(|v| v.into());
}
pub fn style(&self) -> std::option::Option<&str> {
self.sys.style.as_deref()
}
pub fn set_style(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.style = value.map(|v| v.into());
}
pub fn tab_index(&self) -> std::option::Option<i64> {
self.sys.tab_index
}
pub fn set_tab_index(&mut self, value: std::option::Option<i64>) {
self.sys.tab_index = value;
}
pub fn title(&self) -> std::option::Option<&str> {
self.sys.title.as_deref()
}
pub fn set_title(
&mut self,
value: std::option::Option<impl Into<std::borrow::Cow<'static, str>>>,
) {
self.sys.title = value.map(|v| v.into());
}
pub fn translate(&self) -> bool {
self.sys.translate
}
pub fn set_translate(&mut self, value: bool) {
self.sys.translate = value;
}
}
impl TableBody {
pub fn children(&self) -> &[super::child::TableBodyChild] {
self.children.as_ref()
}
pub fn children_mut(&mut self) -> &mut Vec<super::child::TableBodyChild> {
&mut self.children
}
}
impl crate::Render for TableBody {
fn render(
&self,
f: &mut std::fmt::Formatter<'_>,
depth: usize,
) -> std::fmt::Result {
write!(f, "{:level$}", "", level = depth * 4)?;
html_sys::RenderElement::write_opening_tag(&self.sys, f)?;
if !self.children.is_empty() {
write!(f, "\n")?;
}
for el in &self.children {
crate::Render::render(&el, f, depth)?;
write!(f, "\n")?;
}
write!(f, "{:level$}", "", level = depth * 4)?;
html_sys::RenderElement::write_closing_tag(&self.sys, f)?;
Ok(())
}
}
impl std::fmt::Debug for TableBody {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
crate::Render::render(self, f, 0)?;
Ok(())
}
}
impl std::fmt::Display for TableBody {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
html_sys::RenderElement::write_opening_tag(&self.sys, f)?;
for el in &self.children {
write!(f, "{el}")?;
}
html_sys::RenderElement::write_closing_tag(&self.sys, f)?;
Ok(())
}
}
impl crate::HtmlElement for TableBody {}
impl std::convert::Into<html_sys::tables::TableBody> for TableBody {
fn into(self) -> html_sys::tables::TableBody {
self.sys
}
}
impl From<html_sys::tables::TableBody> for TableBody {
fn from(sys: html_sys::tables::TableBody) -> Self {
Self { sys, children: vec![] }
}
}
}
pub mod child {
#[derive(PartialEq, Clone)]
pub enum TableBodyChild {
Script(crate::generated::all::Script),
TableRow(crate::generated::all::TableRow),
Template(crate::generated::all::Template),
}
impl std::convert::From<crate::generated::all::Script> for TableBodyChild {
fn from(value: crate::generated::all::Script) -> Self {
Self::Script(value)
}
}
impl std::convert::From<crate::generated::all::TableRow> for TableBodyChild {
fn from(value: crate::generated::all::TableRow) -> Self {
Self::TableRow(value)
}
}
impl std::convert::From<crate::generated::all::Template> for TableBodyChild {
fn from(value: crate::generated::all::Template) -> Self {
Self::Template(value)
}
}
impl crate::Render for TableBodyChild {
fn render(
&self,
f: &mut std::fmt::Formatter<'_>,
depth: usize,
) -> std::fmt::Result {
match self {
Self::Script(el) => crate::Render::render(el, f, depth + 1),
Self::TableRow(el) => crate::Render::render(el, f, depth + 1),
Self::Template(el) => crate::Render::render(el, f, depth + 1),
}
}
}
impl std::fmt::Debug for TableBodyChild {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
crate::Render::render(self, f, 0)?;
Ok(())
}
}
impl std::fmt::Display for TableBodyChild {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Script(el) => write!(f, "{el}"),
Self::TableRow(el) => write!(f, "{el}"),
Self::Template(el) => write!(f, "{el}"),
}
}
}
}
pub mod builder {
pub struct TableBodyBuilder {
element: super::element::TableBody,
}
impl TableBodyBuilder {
pub(crate) fn new(element: super::element::TableBody) -> Self {
Self { element }
}
pub fn build(&mut self) -> super::element::TableBody {
self.element.clone()
}
pub fn data(
&mut self,
data_key: impl Into<std::borrow::Cow<'static, str>>,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut TableBodyBuilder {
self.element.data_map_mut().insert(data_key.into(), value.into());
self
}
pub fn script<F>(&mut self, f: F) -> &mut Self
where
F: for<'a> FnOnce(
&'a mut crate::generated::all::builders::ScriptBuilder,
) -> &'a mut crate::generated::all::builders::ScriptBuilder,
{
let ty: crate::generated::all::Script = Default::default();
let mut ty_builder = crate::generated::all::builders::ScriptBuilder::new(ty);
(f)(&mut ty_builder);
let ty = ty_builder.build();
self.element.children_mut().push(ty.into());
self
}
pub fn table_row<F>(&mut self, f: F) -> &mut Self
where
F: for<'a> FnOnce(
&'a mut crate::generated::all::builders::TableRowBuilder,
) -> &'a mut crate::generated::all::builders::TableRowBuilder,
{
let ty: crate::generated::all::TableRow = Default::default();
let mut ty_builder = crate::generated::all::builders::TableRowBuilder::new(
ty,
);
(f)(&mut ty_builder);
let ty = ty_builder.build();
self.element.children_mut().push(ty.into());
self
}
pub fn template<F>(&mut self, f: F) -> &mut Self
where
F: for<'a> FnOnce(
&'a mut crate::generated::all::builders::TemplateBuilder,
) -> &'a mut crate::generated::all::builders::TemplateBuilder,
{
let ty: crate::generated::all::Template = Default::default();
let mut ty_builder = crate::generated::all::builders::TemplateBuilder::new(
ty,
);
(f)(&mut ty_builder);
let ty = ty_builder.build();
self.element.children_mut().push(ty.into());
self
}
pub fn role(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_role(Some(value.into()));
self
}
pub fn aria_active_descendant_element(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_active_descendant_element(Some(value.into()));
self
}
pub fn aria_atomic(&mut self, value: bool) -> &mut Self {
self.element.set_aria_atomic(value);
self
}
pub fn aria_auto_complete(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_auto_complete(Some(value.into()));
self
}
pub fn aria_braille_label(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_braille_label(Some(value.into()));
self
}
pub fn aria_braille_role_description(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_braille_role_description(Some(value.into()));
self
}
pub fn aria_busy(&mut self, value: bool) -> &mut Self {
self.element.set_aria_busy(value);
self
}
pub fn aria_checked(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_checked(Some(value.into()));
self
}
pub fn aria_col_count(&mut self, value: i64) -> &mut Self {
self.element.set_aria_col_count(Some(value));
self
}
pub fn aria_col_index(&mut self, value: i64) -> &mut Self {
self.element.set_aria_col_index(Some(value));
self
}
pub fn aria_col_index_text(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_col_index_text(Some(value.into()));
self
}
pub fn aria_col_span(&mut self, value: i64) -> &mut Self {
self.element.set_aria_col_span(Some(value));
self
}
pub fn aria_controls_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_controls_elements(Some(value.into()));
self
}
pub fn aria_current(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_current(Some(value.into()));
self
}
pub fn aria_described_by_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_described_by_elements(Some(value.into()));
self
}
pub fn aria_description(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_description(Some(value.into()));
self
}
pub fn aria_details_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_details_elements(Some(value.into()));
self
}
pub fn aria_disabled(&mut self, value: bool) -> &mut Self {
self.element.set_aria_disabled(value);
self
}
pub fn aria_drop_effect(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_drop_effect(Some(value.into()));
self
}
pub fn aria_error_message_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_error_message_elements(Some(value.into()));
self
}
pub fn aria_expanded(&mut self, value: bool) -> &mut Self {
self.element.set_aria_expanded(value);
self
}
pub fn aria_flow_to_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_flow_to_elements(Some(value.into()));
self
}
pub fn aria_grabbed(&mut self, value: bool) -> &mut Self {
self.element.set_aria_grabbed(value);
self
}
pub fn aria_has_popup(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_has_popup(Some(value.into()));
self
}
pub fn aria_hidden(&mut self, value: bool) -> &mut Self {
self.element.set_aria_hidden(value);
self
}
pub fn aria_invalid(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_invalid(Some(value.into()));
self
}
pub fn aria_key_shortcuts(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_key_shortcuts(Some(value.into()));
self
}
pub fn aria_label(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_label(Some(value.into()));
self
}
pub fn aria_labelled_by_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_labelled_by_elements(Some(value.into()));
self
}
pub fn aria_level(&mut self, value: i64) -> &mut Self {
self.element.set_aria_level(Some(value));
self
}
pub fn aria_live(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_live(Some(value.into()));
self
}
pub fn aria_modal(&mut self, value: bool) -> &mut Self {
self.element.set_aria_modal(value);
self
}
pub fn aria_multi_line(&mut self, value: bool) -> &mut Self {
self.element.set_aria_multi_line(value);
self
}
pub fn aria_multi_selectable(&mut self, value: bool) -> &mut Self {
self.element.set_aria_multi_selectable(value);
self
}
pub fn aria_orientation(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_orientation(Some(value.into()));
self
}
pub fn aria_owns_elements(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_owns_elements(Some(value.into()));
self
}
pub fn aria_placeholder(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_placeholder(Some(value.into()));
self
}
pub fn aria_pos_in_set(&mut self, value: i64) -> &mut Self {
self.element.set_aria_pos_in_set(Some(value));
self
}
pub fn aria_pressed(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_pressed(Some(value.into()));
self
}
pub fn aria_read_only(&mut self, value: bool) -> &mut Self {
self.element.set_aria_read_only(value);
self
}
pub fn aria_relevant(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_relevant(Some(value.into()));
self
}
pub fn aria_required(&mut self, value: bool) -> &mut Self {
self.element.set_aria_required(value);
self
}
pub fn aria_role_description(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_role_description(Some(value.into()));
self
}
pub fn aria_row_count(&mut self, value: i64) -> &mut Self {
self.element.set_aria_row_count(Some(value));
self
}
pub fn aria_row_index(&mut self, value: i64) -> &mut Self {
self.element.set_aria_row_index(Some(value));
self
}
pub fn aria_row_index_text(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_row_index_text(Some(value.into()));
self
}
pub fn aria_row_span(&mut self, value: i64) -> &mut Self {
self.element.set_aria_row_span(Some(value));
self
}
pub fn aria_selected(&mut self, value: bool) -> &mut Self {
self.element.set_aria_selected(value);
self
}
pub fn aria_set_size(&mut self, value: i64) -> &mut Self {
self.element.set_aria_set_size(Some(value));
self
}
pub fn aria_sort(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_sort(Some(value.into()));
self
}
pub fn aria_value_max(&mut self, value: f64) -> &mut Self {
self.element.set_aria_value_max(Some(value));
self
}
pub fn aria_value_min(&mut self, value: f64) -> &mut Self {
self.element.set_aria_value_min(Some(value));
self
}
pub fn aria_value_now(&mut self, value: f64) -> &mut Self {
self.element.set_aria_value_now(Some(value));
self
}
pub fn aria_value_text(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_aria_value_text(Some(value.into()));
self
}
pub fn access_key(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_access_key(Some(value.into()));
self
}
pub fn auto_capitalize(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_auto_capitalize(Some(value.into()));
self
}
pub fn autofocus(&mut self, value: bool) -> &mut Self {
self.element.set_autofocus(value);
self
}
pub fn class(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_class(Some(value.into()));
self
}
pub fn content_editable(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_content_editable(Some(value.into()));
self
}
pub fn direction(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_direction(Some(value.into()));
self
}
pub fn draggable(&mut self, value: bool) -> &mut Self {
self.element.set_draggable(value);
self
}
pub fn enter_key_hint(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_enter_key_hint(Some(value.into()));
self
}
pub fn export_parts(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_export_parts(Some(value.into()));
self
}
pub fn hidden(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_hidden(Some(value.into()));
self
}
pub fn id(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_id(Some(value.into()));
self
}
pub fn inert(&mut self, value: bool) -> &mut Self {
self.element.set_inert(value);
self
}
pub fn input_mode(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_input_mode(Some(value.into()));
self
}
pub fn is_(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_is_(Some(value.into()));
self
}
pub fn item_id(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_item_id(Some(value.into()));
self
}
pub fn item_prop(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_item_prop(Some(value.into()));
self
}
pub fn item_ref(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_item_ref(Some(value.into()));
self
}
pub fn item_scope(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_item_scope(Some(value.into()));
self
}
pub fn item_type(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_item_type(Some(value.into()));
self
}
pub fn lang(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_lang(Some(value.into()));
self
}
pub fn nonce(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_nonce(Some(value.into()));
self
}
pub fn part(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_part(Some(value.into()));
self
}
pub fn slot(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_slot(Some(value.into()));
self
}
pub fn spellcheck(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_spellcheck(Some(value.into()));
self
}
pub fn style(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_style(Some(value.into()));
self
}
pub fn tab_index(&mut self, value: i64) -> &mut Self {
self.element.set_tab_index(Some(value));
self
}
pub fn title(
&mut self,
value: impl Into<std::borrow::Cow<'static, str>>,
) -> &mut Self {
self.element.set_title(Some(value.into()));
self
}
pub fn translate(&mut self, value: bool) -> &mut Self {
self.element.set_translate(value);
self
}
pub fn push<T>(&mut self, child_el: T) -> &mut Self
where
T: Into<crate::generated::all::children::TableBodyChild>,
{
let child_el = child_el.into();
self.element.children_mut().push(child_el);
self
}
pub fn extend<I, T>(&mut self, iter: I) -> &mut Self
where
I: IntoIterator<Item = T>,
T: Into<crate::generated::all::children::TableBodyChild>,
{
let iter = iter.into_iter().map(|child_el| child_el.into());
self.element.children_mut().extend(iter);
self
}
}
}