#![allow(non_upper_case_globals)]
macro_rules! define_accessibility_attributes {
() => {
pub const accessibility_text: $crate::AttributeDescription =
("accessibility_text", None, false);
pub const accessibility_description: $crate::AttributeDescription =
("accessibility_description", None, false);
pub const accessibility_group: $crate::AttributeDescription =
("accessibility_group", None, false);
pub const accessibility_mode: $crate::AttributeDescription =
("accessibility_mode", None, false);
pub const accessibility_role: $crate::AttributeDescription =
("accessibility_role", None, false);
pub const accessibility_actions: $crate::AttributeDescription =
("accessibility_actions", None, false);
pub const accessibility_disabled: $crate::AttributeDescription =
("accessibility_disabled", None, false);
pub const accessibility_selected: $crate::AttributeDescription =
("accessibility_selected", None, false);
pub const accessibility_checked: $crate::AttributeDescription =
("accessibility_checked", None, false);
pub const accessibility_value_min: $crate::AttributeDescription =
("accessibility_value_min", None, false);
pub const accessibility_value_max: $crate::AttributeDescription =
("accessibility_value_max", None, false);
pub const accessibility_value_current: $crate::AttributeDescription =
("accessibility_value_current", None, false);
pub const accessibility_value_range_min: $crate::AttributeDescription =
("accessibility_value_range_min", None, false);
pub const accessibility_value_range_max: $crate::AttributeDescription =
("accessibility_value_range_max", None, false);
pub const accessibility_value_range_current: $crate::AttributeDescription =
("accessibility_value_range_current", None, false);
pub const accessibility_value_text: $crate::AttributeDescription =
("accessibility_value_text", None, false);
};
}
macro_rules! define_accessibility_extension_methods {
() => {
fn accessibility_text(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_text", None, value, false)
}
fn accessibility_description(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_description", None, value, false)
}
fn accessibility_group(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_group", None, value, false)
}
fn accessibility_mode(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_mode", None, value, false)
}
fn accessibility_role(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_role", None, value, false)
}
fn accessibility_actions(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_actions", None, value, false)
}
fn accessibility_disabled(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_disabled", None, value, false)
}
fn accessibility_selected(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_selected", None, value, false)
}
fn accessibility_checked(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_checked", None, value, false)
}
fn accessibility_value_min(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_value_min", None, value, false)
}
fn accessibility_value_max(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_value_max", None, value, false)
}
fn accessibility_value_current(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_value_current", None, value, false)
}
fn accessibility_value_range_min(
self,
value: impl dioxus_core::IntoAttributeValue,
) -> Self {
self.push_attribute("accessibility_value_range_min", None, value, false)
}
fn accessibility_value_range_max(
self,
value: impl dioxus_core::IntoAttributeValue,
) -> Self {
self.push_attribute("accessibility_value_range_max", None, value, false)
}
fn accessibility_value_range_current(
self,
value: impl dioxus_core::IntoAttributeValue,
) -> Self {
self.push_attribute("accessibility_value_range_current", None, value, false)
}
fn accessibility_value_text(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("accessibility_value_text", None, value, false)
}
};
}
macro_rules! define_element {
(
$(#[$meta:meta])*
$name:ident => $tag:literal, $extension:ident {
$( $attr:ident ),* $(,)?
}
) => {
define_element! {
$(#[$meta])*
$name => $tag {
$( $attr ),*
}
}
#[doc(hidden)]
pub trait $extension: dioxus_core::HasAttributes + Sized {
define_accessibility_extension_methods!();
fn focus_scope(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("focus_scope", None, value, false)
}
fn focus_trap(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("focus_trap", None, value, false)
}
fn focus_navigation(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("focus_navigation", None, value, false)
}
fn key_capture(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("key_capture", None, value, false)
}
fn axis_capture(self, value: impl dioxus_core::IntoAttributeValue) -> Self {
self.push_attribute("axis_capture", None, value, false)
}
$(
fn $attr(
self,
value: impl dioxus_core::IntoAttributeValue,
) -> Self {
let description = $name::$attr;
self.push_attribute(
description.0,
description.1,
value,
description.2,
)
}
)*
}
};
(
$(#[$meta:meta])*
$name:ident => $tag:literal {
$( $attr:ident ),* $(,)?
}
) => {
$(#[$meta])*
pub mod $name {
pub const TAG_NAME: &'static str = $tag;
pub const NAME_SPACE: Option<&'static str> = Some("arkui");
pub const native_ref: $crate::AttributeDescription = ("native_ref", None, false);
define_accessibility_attributes!();
pub const focus_scope: $crate::AttributeDescription = ("focus_scope", None, false);
pub const focus_trap: $crate::AttributeDescription = ("focus_trap", None, false);
pub const focus_navigation: $crate::AttributeDescription = ("focus_navigation", None, false);
pub const key_capture: $crate::AttributeDescription = ("key_capture", None, false);
pub const axis_capture: $crate::AttributeDescription = ("axis_capture", None, false);
$(
pub const $attr: $crate::AttributeDescription = (stringify!($attr), None, false);
)*
}
};
}
define_element! {
portal => "portal" {
portal_layer, width, height, alignment, hit_test_behavior, z_index,
}
}
define_element! {
xcomponent => "xcomponent" {
focusable, focus_on_touch, default_focus, tab_stop, focused,
background_color, margin, margin_top, margin_bottom, margin_left,
margin_right, margin_x, margin_y, margin_horizontal, margin_vertical, width, height,
opacity, border_radius, border_width, border_color, visibility,
enabled, clip, hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
column => "column", ColumnExtension {
font_size, font_color, font_weight, foreground_color, background_color, padding, padding_top, padding_right, padding_bottom, padding_left, padding_x, padding_y, padding_horizontal, padding_vertical, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, max_width_constraint, constraint_size, min_width, max_width, min_height, max_height, align_items, justify_content,
align_self, item_alignment, layout_weight, opacity, border_radius, border_width,
border_color, border_style, shadow, custom_shadow, visibility, enabled, clip, focusable,
focus_on_touch, default_focus, tab_stop, hit_test_behavior, alignment, aspect_ratio, position, z_index,
}
}
define_element! {
row => "row", RowExtension {
font_size, font_color, font_weight, foreground_color, background_color, padding, padding_top, padding_right, padding_bottom, padding_left, padding_x, padding_y, padding_horizontal, padding_vertical, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, max_width_constraint, constraint_size, min_width, max_width, min_height, max_height, align_items, justify_content,
align_self, item_alignment, layout_weight, opacity, border_radius, border_width,
border_color, border_style, shadow, custom_shadow, visibility, enabled, clip, focusable,
focus_on_touch, default_focus, tab_stop, hit_test_behavior, alignment, aspect_ratio, position, z_index,
}
}
#[doc(hidden)]
pub mod extensions {
pub use super::{ColumnExtension, RowExtension};
}
define_element! {
custom => "custom" {
background_color, padding, margin, margin_top, margin_bottom, margin_left,
margin_right, margin_x, margin_y, margin_horizontal, margin_vertical, width, height, opacity,
border_radius, border_width, border_color, visibility, enabled, clip,
hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
stack => "stack" {
background_color, padding, padding_top, padding_right, padding_bottom, padding_left, padding_x, padding_y, padding_horizontal, padding_vertical, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, max_width_constraint, constraint_size, min_width, max_width, min_height, max_height, alignment, opacity,
border_radius, border_width, border_color, border_style, shadow, custom_shadow, visibility,
enabled, clip, focusable, focus_on_touch, default_focus, tab_stop, hit_test_behavior, aspect_ratio,
position, z_index,
}
}
define_element! {
flex => "flex" {
background_color, padding, padding_top, padding_right, padding_bottom, padding_left, padding_x, padding_y, padding_horizontal, padding_vertical, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, max_width_constraint, constraint_size, min_width, max_width, min_height, max_height, align_items, justify_content,
align_self, item_alignment, flex_direction, flex_wrap, flex_align_content,
layout_weight, opacity, border_radius, border_width, border_color, border_style,
shadow, custom_shadow, visibility, enabled, clip, focusable, focus_on_touch, default_focus, tab_stop,
hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
text => "text" {
font_size, font_color, font_weight, font_family, font_style, line_height,
text_align, text_letter_spacing, text_decoration, text_overflow, max_lines,
content, background_color, padding, padding_top, padding_right, padding_bottom, padding_left, padding_x, padding_y, padding_horizontal, padding_vertical, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, max_width_constraint, constraint_size, min_width, max_width, min_height, max_height, opacity, border_radius,
border_width, border_color, border_style, shadow, custom_shadow, visibility, enabled, clip,
focusable, focus_on_touch, default_focus, tab_stop, hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
button => "button" {
font_size, font_color, font_weight, foreground_color, background_color, padding, padding_top, padding_right, padding_bottom, padding_left, padding_x, padding_y, padding_horizontal, padding_vertical, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, max_width_constraint, constraint_size, min_width, max_width, min_height, max_height, button_type, label,
opacity, border_radius, border_width, border_color, border_style, shadow, custom_shadow,
visibility, enabled, clip, focusable, focus_on_touch, default_focus, tab_stop, focused, focus_status, hit_test_behavior,
align_self, item_alignment, alignment, aspect_ratio, position, z_index,
}
}
define_element! {
image => "image" {
src, object_fit, background_color, padding, padding_top, padding_right, padding_bottom, padding_left, padding_x, padding_y, padding_horizontal, padding_vertical, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, opacity, border_radius,
border_width, border_color, border_style, shadow, custom_shadow, visibility, enabled, clip,
focusable, focus_on_touch, default_focus, tab_stop, hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
checkbox => "checkbox" {
checked, checkbox_select_color, background_color, padding, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, opacity, border_radius,
border_width, border_color, shadow, custom_shadow, visibility, enabled, clip, focusable, focus_on_touch, hit_test_behavior,
aspect_ratio, position, z_index,
}
}
define_element! {
toggle => "toggle" {
checked, toggle_selected_color, toggle_unselected_color,
toggle_switch_point_color, background_color, padding, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, opacity, border_radius,
border_width, border_color, shadow, custom_shadow, visibility, enabled, clip, focusable, focus_on_touch, hit_test_behavior,
aspect_ratio, position, z_index,
}
}
define_element! {
radio => "radio" {
checked, radio_value, value, background_color, padding, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, opacity, border_radius,
border_width, border_color, shadow, custom_shadow, visibility, enabled, clip, focusable, focus_on_touch, hit_test_behavior,
aspect_ratio, position, z_index,
}
}
define_element! {
slider => "slider" {
value, slider_value, slider_min, slider_max, slider_step, background_color,
padding, margin, margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, opacity, border_radius,
border_width, border_color, shadow, custom_shadow, visibility, enabled, clip, focusable, focus_on_touch, hit_test_behavior,
block_color, selected_color, track_color, aspect_ratio, position, z_index,
}
}
define_element! {
progress => "progress" {
value, progress_value, progress_total, progress_color, progress_type,
background_color, padding, margin, margin_top, margin_bottom, margin_left,
margin_right, margin_x, margin_y, margin_horizontal, margin_vertical, width, height, opacity,
border_radius, border_width, border_color, visibility, enabled, clip,
hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
loadingprogress => "loadingprogress" {
loading_progress_color, loading_progress_enable_loading,
background_color, padding, margin, margin_top, margin_bottom, margin_left,
margin_right, margin_x, margin_y, margin_horizontal, margin_vertical, width, height, opacity,
border_radius, border_width, border_color, visibility, enabled, clip,
hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
scroll => "scroll" {
scroll_bar, scroll_direction, scroll_enabled, scroll_edge_effect, scroll_offset, background_color, padding, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, constraint_size, min_width, max_width, min_height, max_height,
layout_weight, opacity, border_radius,
border_width, border_color, visibility, enabled, clip, hit_test_behavior,
alignment, aspect_ratio, position, z_index,
}
}
define_element! {
swiper => "swiper" {
swiper_index, swiper_swipe_to_index, swiper_loop, swiper_auto_play, swiper_show_indicator,
swiper_disable_swipe, swiper_cached_count, swiper_display_count,
swiper_vertical, swiper_interval, swiper_duration, swiper_curve, swiper_item_space,
background_color, padding, margin, margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, opacity, border_radius,
border_width, border_color, border_style, shadow, custom_shadow, visibility, enabled, clip, hit_test_behavior,
aspect_ratio, position, z_index,
}
}
define_element! {
grid => "grid" {
virtual_source,
scroll_bar, grid_column_template, grid_row_template, grid_column_gap, grid_row_gap,
grid_cached_count, background_color, padding, margin, margin_top,
margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, layout_weight, opacity, border_radius, border_width,
border_color, visibility, enabled, clip, hit_test_behavior, aspect_ratio,
position, z_index,
}
}
define_element! {
griditem => "griditem" {
background_color, padding, margin, margin_top, margin_bottom, margin_left,
margin_right, margin_x, margin_y, margin_horizontal, margin_vertical, width, height, opacity,
border_radius, border_width, border_color, visibility, enabled, clip,
hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
list => "list" {
virtual_source,
scroll_bar, list_cached_count, list_sticky, scroll_to_index, background_color, padding, margin, margin_top,
margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, layout_weight, opacity, border_radius, border_width,
border_color, visibility, enabled, clip, hit_test_behavior, aspect_ratio,
position, z_index,
}
}
define_element! {
listitem => "listitem" {
background_color, padding, margin, margin_top, margin_bottom, margin_left,
margin_right, margin_x, margin_y, margin_horizontal, margin_vertical, width, height, opacity,
border_radius, border_width, border_color, visibility, enabled, clip,
hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
waterflow => "waterflow" {
virtual_source,
scroll_bar, water_flow_column_template, water_flow_row_template, water_flow_column_gap,
water_flow_row_gap, water_flow_cached_count, background_color, padding, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, layout_weight, opacity, border_radius,
border_width, border_color, visibility, enabled, clip, hit_test_behavior,
aspect_ratio, position, z_index,
}
}
define_element! {
flowitem => "flowitem" {
background_color, padding, margin, margin_top, margin_bottom, margin_left,
margin_right, margin_x, margin_y, margin_horizontal, margin_vertical, width, height, opacity,
border_radius, border_width, border_color, visibility, enabled, clip,
hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
refresh => "refresh" {
refresh_state, refreshing, refresh_offset, refresh_pull_to_refresh,
background_color, padding, margin, margin_top, margin_bottom, margin_left,
margin_right, margin_x, margin_y, margin_horizontal, margin_vertical, width, height, opacity,
border_radius, border_width, border_color, visibility, enabled, clip,
hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
calendar => "calendarpicker" {
background_color, padding, margin,
margin_top, margin_bottom, margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, opacity, border_radius, border_width,
border_color, visibility, enabled, clip, hit_test_behavior, aspect_ratio,
position, z_index,
}
}
define_element! {
datepicker => "datepicker" {
background_color, padding, margin, margin_top, margin_bottom,
margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical, width, height,
opacity, border_radius, border_width, border_color, visibility, enabled, clip,
hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
textinput => "textinput" {
value, placeholder, placeholder_color, caret_color, input_type, input_filter, max_length,
show_password_icon,
font_size, font_color,
font_weight, font_family, font_style, line_height, text_align, background_color, padding,
padding_top, padding_right, padding_bottom, padding_left, padding_x, padding_y, padding_horizontal, padding_vertical, margin, margin_top, margin_bottom,
margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, opacity, border_radius, border_width,
border_color, border_style, shadow, custom_shadow, visibility, enabled, clip, focusable, focus_on_touch, default_focus, tab_stop,
focused, focus_status,
hit_test_behavior, aspect_ratio, position, z_index,
}
}
define_element! {
textarea => "textarea" {
value, placeholder, placeholder_color, caret_color, font_size, font_color,
font_weight, font_family, font_style, line_height, text_align, background_color, padding,
padding_top, padding_right, padding_bottom, padding_left, padding_x, padding_y, padding_horizontal, padding_vertical, margin, margin_top, margin_bottom,
margin_left, margin_right, margin_x, margin_y, margin_horizontal, margin_vertical,
width, height, opacity, border_radius, border_width,
border_color, border_style, shadow, custom_shadow, visibility, enabled, clip, focusable, focus_on_touch, default_focus, tab_stop,
focused, focus_status,
hit_test_behavior, aspect_ratio, position, z_index,
}
}
#[doc(hidden)]
#[allow(non_camel_case_types)]
pub mod completions {
pub enum CompleteWithBraces {
column {},
custom {},
row {},
stack {},
flex {},
text {},
button {},
image {},
checkbox {},
toggle {},
radio {},
slider {},
progress {},
loadingprogress {},
scroll {},
swiper {},
grid {},
griditem {},
list {},
listitem {},
waterflow {},
flowitem {},
refresh {},
calendar {},
datepicker {},
textinput {},
textarea {},
xcomponent {},
portal {},
}
}