global_attributes.rs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842
  1. use dioxus_core::*;
  2. use std::fmt::Arguments;
  3. macro_rules! no_namespace_trait_methods {
  4. (
  5. $(
  6. $(#[$attr:meta])*
  7. $name:ident;
  8. )*
  9. ) => {
  10. $(
  11. $(#[$attr])*
  12. fn $name<'a>(&self, cx: NodeFactory<'a>, val: Arguments) -> Attribute<'a> {
  13. cx.attr(stringify!($name), val, None, false)
  14. }
  15. )*
  16. };
  17. }
  18. macro_rules! style_trait_methods {
  19. (
  20. $(
  21. $(#[$attr:meta])*
  22. $name:ident: $lit:literal,
  23. )*
  24. ) => {
  25. $(
  26. #[inline]
  27. $(#[$attr])*
  28. fn $name<'a>(&self, cx: NodeFactory<'a>, val: Arguments) -> Attribute<'a> {
  29. cx.attr($lit, val, Some("style"), false)
  30. }
  31. )*
  32. };
  33. }
  34. macro_rules! aria_trait_methods {
  35. (
  36. $(
  37. $(#[$attr:meta])*
  38. $name:ident: $lit:literal,
  39. )*
  40. ) => {
  41. $(
  42. $(#[$attr])*
  43. fn $name<'a>(&self, cx: NodeFactory<'a>, val: Arguments) -> Attribute<'a> {
  44. cx.attr($lit, val, None, false)
  45. }
  46. )*
  47. };
  48. }
  49. pub trait GlobalAttributes {
  50. /// Prevent the default action for this element.
  51. ///
  52. /// For more information, see the MDN docs:
  53. /// <https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault>
  54. fn prevent_default<'a>(&self, cx: NodeFactory<'a>, val: Arguments) -> Attribute<'a> {
  55. cx.attr("dioxus-prevent-default", val, None, false)
  56. }
  57. no_namespace_trait_methods! {
  58. accesskey;
  59. /// The HTML class attribute is used to specify a class for an HTML element.
  60. ///
  61. /// ## Details
  62. /// Multiple HTML elements can share the same class.
  63. ///
  64. /// The class global attribute is a space-separated list of the case-sensitive classes of the element.
  65. /// Classes allow CSS and Javascript to select and access specific elements via the class selectors or
  66. /// functions like the DOM method document.getElementsByClassName.
  67. ///
  68. /// ## Example
  69. ///
  70. /// ### HTML:
  71. /// ```html
  72. /// <p class="note editorial">Above point sounds a bit obvious. Remove/rewrite?</p>
  73. /// ```
  74. ///
  75. /// ### CSS:
  76. /// ```css
  77. /// .note {
  78. /// font-style: italic;
  79. /// font-weight: bold;
  80. /// }
  81. ///
  82. /// .editorial {
  83. /// background: rgb(255, 0, 0, .25);
  84. /// padding: 10px;
  85. /// }
  86. /// ```
  87. class;
  88. contenteditable;
  89. data;
  90. dir;
  91. draggable;
  92. hidden;
  93. id;
  94. lang;
  95. spellcheck;
  96. style;
  97. tabindex;
  98. title;
  99. translate;
  100. role;
  101. /// dangerous_inner_html is Dioxus's replacement for using innerHTML in the browser DOM. In general, setting
  102. /// HTML from code is risky because it’s easy to inadvertently expose your users to a cross-site scripting (XSS)
  103. /// attack. So, you can set HTML directly from Dioxus, but you have to type out dangerous_inner_html to remind
  104. /// yourself that it’s dangerous
  105. dangerous_inner_html;
  106. }
  107. // This macro creates an explicit method call for each of the style attributes.
  108. //
  109. // The left token specifies the name of the attribute in the rsx! macro, and the right string literal specifies the
  110. // actual name of the attribute generated.
  111. //
  112. // This roughly follows the html spec
  113. style_trait_methods! {
  114. align_content: "align-content",
  115. align_items: "align-items",
  116. align_self: "align-self",
  117. alignment_adjust: "alignment-adjust",
  118. alignment_baseline: "alignment-baseline",
  119. all: "all",
  120. alt: "alt",
  121. animation: "animation",
  122. animation_delay: "animation-delay",
  123. animation_direction: "animation-direction",
  124. animation_duration: "animation-duration",
  125. animation_fill_mode: "animation-fill-mode",
  126. animation_iteration_count: "animation-iteration-count",
  127. animation_name: "animation-name",
  128. animation_play_state: "animation-play-state",
  129. animation_timing_function: "animation-timing-function",
  130. azimuth: "azimuth",
  131. backface_visibility: "backface-visibility",
  132. background: "background",
  133. background_attachment: "background-attachment",
  134. background_clip: "background-clip",
  135. background_color: "background-color",
  136. background_image: "background-image",
  137. background_origin: "background-origin",
  138. background_position: "background-position",
  139. background_repeat: "background-repeat",
  140. background_size: "background-size",
  141. background_blend_mode: "background-blend-mode",
  142. baseline_shift: "baseline-shift",
  143. bleed: "bleed",
  144. bookmark_label: "bookmark-label",
  145. bookmark_level: "bookmark-level",
  146. bookmark_state: "bookmark-state",
  147. border: "border",
  148. border_color: "border-color",
  149. border_style: "border-style",
  150. border_width: "border-width",
  151. border_bottom: "border-bottom",
  152. border_bottom_color: "border-bottom-color",
  153. border_bottom_style: "border-bottom-style",
  154. border_bottom_width: "border-bottom-width",
  155. border_left: "border-left",
  156. border_left_color: "border-left-color",
  157. border_left_style: "border-left-style",
  158. border_left_width: "border-left-width",
  159. border_right: "border-right",
  160. border_right_color: "border-right-color",
  161. border_right_style: "border-right-style",
  162. border_right_width: "border-right-width",
  163. border_top: "border-top",
  164. border_top_color: "border-top-color",
  165. border_top_style: "border-top-style",
  166. border_top_width: "border-top-width",
  167. border_collapse: "border-collapse",
  168. border_image: "border-image",
  169. border_image_outset: "border-image-outset",
  170. border_image_repeat: "border-image-repeat",
  171. border_image_slice: "border-image-slice",
  172. border_image_source: "border-image-source",
  173. border_image_width: "border-image-width",
  174. border_radius: "border-radius",
  175. border_bottom_left_radius: "border-bottom-left-radius",
  176. border_bottom_right_radius: "border-bottom-right-radius",
  177. border_top_left_radius: "border-top-left-radius",
  178. border_top_right_radius: "border-top-right-radius",
  179. border_spacing: "border-spacing",
  180. bottom: "bottom",
  181. box_decoration_break: "box-decoration-break",
  182. box_shadow: "box-shadow",
  183. box_sizing: "box-sizing",
  184. box_snap: "box-snap",
  185. break_after: "break-after",
  186. break_before: "break-before",
  187. break_inside: "break-inside",
  188. buffered_rendering: "buffered-rendering",
  189. caption_side: "caption-side",
  190. clear: "clear",
  191. clear_side: "clear-side",
  192. clip: "clip",
  193. clip_path: "clip-path",
  194. clip_rule: "clip-rule",
  195. color: "color",
  196. color_adjust: "color-adjust",
  197. color_correction: "color-correction",
  198. color_interpolation: "color-interpolation",
  199. color_interpolation_filters: "color-interpolation-filters",
  200. color_profile: "color-profile",
  201. color_rendering: "color-rendering",
  202. column_fill: "column-fill",
  203. column_gap: "column-gap",
  204. column_rule: "column-rule",
  205. column_rule_color: "column-rule-color",
  206. column_rule_style: "column-rule-style",
  207. column_rule_width: "column-rule-width",
  208. column_span: "column-span",
  209. columns: "columns",
  210. column_count: "column-count",
  211. column_width: "column-width",
  212. contain: "contain",
  213. content: "content",
  214. counter_increment: "counter-increment",
  215. counter_reset: "counter-reset",
  216. counter_set: "counter-set",
  217. cue: "cue",
  218. cue_after: "cue-after",
  219. cue_before: "cue-before",
  220. cursor: "cursor",
  221. direction: "direction",
  222. display: "display",
  223. display_inside: "display-inside",
  224. display_outside: "display-outside",
  225. display_extras: "display-extras",
  226. display_box: "display-box",
  227. dominant_baseline: "dominant-baseline",
  228. elevation: "elevation",
  229. empty_cells: "empty-cells",
  230. enable_background: "enable-background",
  231. fill: "fill",
  232. fill_opacity: "fill-opacity",
  233. fill_rule: "fill-rule",
  234. filter: "filter",
  235. float: "float",
  236. float_defer_column: "float-defer-column",
  237. float_defer_page: "float-defer-page",
  238. float_offset: "float-offset",
  239. float_wrap: "float-wrap",
  240. flow_into: "flow-into",
  241. flow_from: "flow-from",
  242. flex: "flex",
  243. flex_basis: "flex-basis",
  244. flex_grow: "flex-grow",
  245. flex_shrink: "flex-shrink",
  246. flex_flow: "flex-flow",
  247. flex_direction: "flex-direction",
  248. flex_wrap: "flex-wrap",
  249. flood_color: "flood-color",
  250. flood_opacity: "flood-opacity",
  251. font: "font",
  252. font_family: "font-family",
  253. font_size: "font-size",
  254. font_stretch: "font-stretch",
  255. font_style: "font-style",
  256. font_weight: "font-weight",
  257. font_feature_settings: "font-feature-settings",
  258. font_kerning: "font-kerning",
  259. font_language_override: "font-language-override",
  260. font_size_adjust: "font-size-adjust",
  261. font_synthesis: "font-synthesis",
  262. font_variant: "font-variant",
  263. font_variant_alternates: "font-variant-alternates",
  264. font_variant_caps: "font-variant-caps",
  265. font_variant_east_asian: "font-variant-east-asian",
  266. font_variant_ligatures: "font-variant-ligatures",
  267. font_variant_numeric: "font-variant-numeric",
  268. font_variant_position: "font-variant-position",
  269. footnote_policy: "footnote-policy",
  270. glyph_orientation_horizontal: "glyph-orientation-horizontal",
  271. glyph_orientation_vertical: "glyph-orientation-vertical",
  272. grid: "grid",
  273. grid_auto_flow: "grid-auto-flow",
  274. grid_auto_columns: "grid-auto-columns",
  275. grid_auto_rows: "grid-auto-rows",
  276. grid_template: "grid-template",
  277. grid_template_areas: "grid-template-areas",
  278. grid_template_columns: "grid-template-columns",
  279. grid_template_rows: "grid-template-rows",
  280. grid_area: "grid-area",
  281. grid_column: "grid-column",
  282. grid_column_start: "grid-column-start",
  283. grid_column_end: "grid-column-end",
  284. grid_row: "grid-row",
  285. grid_row_start: "grid-row-start",
  286. grid_row_end: "grid-row-end",
  287. hanging_punctuation: "hanging-punctuation",
  288. height: "height",
  289. hyphenate_character: "hyphenate-character",
  290. hyphenate_limit_chars: "hyphenate-limit-chars",
  291. hyphenate_limit_last: "hyphenate-limit-last",
  292. hyphenate_limit_lines: "hyphenate-limit-lines",
  293. hyphenate_limit_zone: "hyphenate-limit-zone",
  294. hyphens: "hyphens",
  295. icon: "icon",
  296. image_orientation: "image-orientation",
  297. image_resolution: "image-resolution",
  298. image_rendering: "image-rendering",
  299. ime: "ime",
  300. ime_align: "ime-align",
  301. ime_mode: "ime-mode",
  302. ime_offset: "ime-offset",
  303. ime_width: "ime-width",
  304. initial_letters: "initial-letters",
  305. inline_box_align: "inline-box-align",
  306. isolation: "isolation",
  307. justify_content: "justify-content",
  308. justify_items: "justify-items",
  309. justify_self: "justify-self",
  310. kerning: "kerning",
  311. left: "left",
  312. letter_spacing: "letter-spacing",
  313. lighting_color: "lighting-color",
  314. line_box_contain: "line-box-contain",
  315. line_break: "line-break",
  316. line_grid: "line-grid",
  317. line_height: "line-height",
  318. line_slack: "line-slack",
  319. line_snap: "line-snap",
  320. list_style: "list-style",
  321. list_style_image: "list-style-image",
  322. list_style_position: "list-style-position",
  323. list_style_type: "list-style-type",
  324. margin: "margin",
  325. margin_bottom: "margin-bottom",
  326. margin_left: "margin-left",
  327. margin_right: "margin-right",
  328. margin_top: "margin-top",
  329. marker: "marker",
  330. marker_end: "marker-end",
  331. marker_mid: "marker-mid",
  332. marker_pattern: "marker-pattern",
  333. marker_segment: "marker-segment",
  334. marker_start: "marker-start",
  335. marker_knockout_left: "marker-knockout-left",
  336. marker_knockout_right: "marker-knockout-right",
  337. marker_side: "marker-side",
  338. marks: "marks",
  339. marquee_direction: "marquee-direction",
  340. marquee_play_count: "marquee-play-count",
  341. marquee_speed: "marquee-speed",
  342. marquee_style: "marquee-style",
  343. mask: "mask",
  344. mask_image: "mask-image",
  345. mask_repeat: "mask-repeat",
  346. mask_position: "mask-position",
  347. mask_clip: "mask-clip",
  348. mask_origin: "mask-origin",
  349. mask_size: "mask-size",
  350. mask_box: "mask-box",
  351. mask_box_outset: "mask-box-outset",
  352. mask_box_repeat: "mask-box-repeat",
  353. mask_box_slice: "mask-box-slice",
  354. mask_box_source: "mask-box-source",
  355. mask_box_width: "mask-box-width",
  356. mask_type: "mask-type",
  357. max_height: "max-height",
  358. max_lines: "max-lines",
  359. max_width: "max-width",
  360. min_height: "min-height",
  361. min_width: "min-width",
  362. mix_blend_mode: "mix-blend-mode",
  363. nav_down: "nav-down",
  364. nav_index: "nav-index",
  365. nav_left: "nav-left",
  366. nav_right: "nav-right",
  367. nav_up: "nav-up",
  368. object_fit: "object-fit",
  369. object_position: "object-position",
  370. offset_after: "offset-after",
  371. offset_before: "offset-before",
  372. offset_end: "offset-end",
  373. offset_start: "offset-start",
  374. opacity: "opacity",
  375. order: "order",
  376. orphans: "orphans",
  377. outline: "outline",
  378. outline_color: "outline-color",
  379. outline_style: "outline-style",
  380. outline_width: "outline-width",
  381. outline_offset: "outline-offset",
  382. overflow: "overflow",
  383. overflow_x: "overflow-x",
  384. overflow_y: "overflow-y",
  385. overflow_style: "overflow-style",
  386. overflow_wrap: "overflow-wrap",
  387. padding: "padding",
  388. padding_bottom: "padding-bottom",
  389. padding_left: "padding-left",
  390. padding_right: "padding-right",
  391. padding_top: "padding-top",
  392. page: "page",
  393. page_break_after: "page-break-after",
  394. page_break_before: "page-break-before",
  395. page_break_inside: "page-break-inside",
  396. paint_order: "paint-order",
  397. pause: "pause",
  398. pause_after: "pause-after",
  399. pause_before: "pause-before",
  400. perspective: "perspective",
  401. perspective_origin: "perspective-origin",
  402. pitch: "pitch",
  403. pitch_range: "pitch-range",
  404. play_during: "play-during",
  405. pointer_events: "pointer-events",
  406. position: "position",
  407. quotes: "quotes",
  408. region_fragment: "region-fragment",
  409. resize: "resize",
  410. rest: "rest",
  411. rest_after: "rest-after",
  412. rest_before: "rest-before",
  413. richness: "richness",
  414. right: "right",
  415. ruby_align: "ruby-align",
  416. ruby_merge: "ruby-merge",
  417. ruby_position: "ruby-position",
  418. scroll_behavior: "scroll-behavior",
  419. scroll_snap_coordinate: "scroll-snap-coordinate",
  420. scroll_snap_destination: "scroll-snap-destination",
  421. scroll_snap_points_x: "scroll-snap-points-x",
  422. scroll_snap_points_y: "scroll-snap-points-y",
  423. scroll_snap_type: "scroll-snap-type",
  424. shape_image_threshold: "shape-image-threshold",
  425. shape_inside: "shape-inside",
  426. shape_margin: "shape-margin",
  427. shape_outside: "shape-outside",
  428. shape_padding: "shape-padding",
  429. shape_rendering: "shape-rendering",
  430. size: "size",
  431. speak: "speak",
  432. speak_as: "speak-as",
  433. speak_header: "speak-header",
  434. speak_numeral: "speak-numeral",
  435. speak_punctuation: "speak-punctuation",
  436. speech_rate: "speech-rate",
  437. stop_color: "stop-color",
  438. stop_opacity: "stop-opacity",
  439. stress: "stress",
  440. string_set: "string-set",
  441. stroke: "stroke",
  442. stroke_dasharray: "stroke-dasharray",
  443. stroke_dashoffset: "stroke-dashoffset",
  444. stroke_linecap: "stroke-linecap",
  445. stroke_linejoin: "stroke-linejoin",
  446. stroke_miterlimit: "stroke-miterlimit",
  447. stroke_opacity: "stroke-opacity",
  448. stroke_width: "stroke-width",
  449. tab_size: "tab-size",
  450. table_layout: "table-layout",
  451. text_align: "text-align",
  452. text_align_all: "text-align-all",
  453. text_align_last: "text-align-last",
  454. text_anchor: "text-anchor",
  455. text_combine_upright: "text-combine-upright",
  456. text_decoration: "text-decoration",
  457. text_decoration_color: "text-decoration-color",
  458. text_decoration_line: "text-decoration-line",
  459. text_decoration_style: "text-decoration-style",
  460. text_decoration_skip: "text-decoration-skip",
  461. text_emphasis: "text-emphasis",
  462. text_emphasis_color: "text-emphasis-color",
  463. text_emphasis_style: "text-emphasis-style",
  464. text_emphasis_position: "text-emphasis-position",
  465. text_emphasis_skip: "text-emphasis-skip",
  466. text_height: "text-height",
  467. text_indent: "text-indent",
  468. text_justify: "text-justify",
  469. text_orientation: "text-orientation",
  470. text_overflow: "text-overflow",
  471. text_rendering: "text-rendering",
  472. text_shadow: "text-shadow",
  473. text_size_adjust: "text-size-adjust",
  474. text_space_collapse: "text-space-collapse",
  475. text_spacing: "text-spacing",
  476. text_transform: "text-transform",
  477. text_underline_position: "text-underline-position",
  478. text_wrap: "text-wrap",
  479. top: "top",
  480. touch_action: "touch-action",
  481. transform: "transform",
  482. transform_box: "transform-box",
  483. transform_origin: "transform-origin",
  484. transform_style: "transform-style",
  485. transition: "transition",
  486. transition_delay: "transition-delay",
  487. transition_duration: "transition-duration",
  488. transition_property: "transition-property",
  489. unicode_bidi: "unicode-bidi",
  490. vector_effect: "vector-effect",
  491. vertical_align: "vertical-align",
  492. visibility: "visibility",
  493. voice_balance: "voice-balance",
  494. voice_duration: "voice-duration",
  495. voice_family: "voice-family",
  496. voice_pitch: "voice-pitch",
  497. voice_range: "voice-range",
  498. voice_rate: "voice-rate",
  499. voice_stress: "voice-stress",
  500. voice_volumn: "voice-volumn",
  501. volume: "volume",
  502. white_space: "white-space",
  503. widows: "widows",
  504. width: "width",
  505. will_change: "will-change",
  506. word_break: "word-break",
  507. word_spacing: "word-spacing",
  508. word_wrap: "word-wrap",
  509. wrap_flow: "wrap-flow",
  510. wrap_through: "wrap-through",
  511. writing_mode: "writing-mode",
  512. gap: "gap",
  513. list_styler_type: "list-style-type",
  514. row_gap: "row-gap",
  515. transition_timing_function: "transition-timing-function",
  516. user_select: "user-select",
  517. webkit_user_select: "-webkit-user-select",
  518. z_index : "z-index",
  519. }
  520. aria_trait_methods! {
  521. aria_current: "aria-current",
  522. aria_details: "aria-details",
  523. aria_disabled: "aria-disabled",
  524. aria_hidden: "aria-hidden",
  525. aria_invalid: "aria-invalid",
  526. aria_keyshortcuts: "aria-keyshortcuts",
  527. aria_label: "aria-label",
  528. aria_roledescription: "aria-roledescription",
  529. // Widget Attributes
  530. aria_autocomplete: "aria-autocomplete",
  531. aria_checked: "aria-checked",
  532. aria_expanded: "aria-expanded",
  533. aria_haspopup: "aria-haspopup",
  534. aria_level: "aria-level",
  535. aria_modal: "aria-modal",
  536. aria_multiline: "aria-multiline",
  537. aria_multiselectable: "aria-multiselectable",
  538. aria_orientation: "aria-orientation",
  539. aria_placeholder: "aria-placeholder",
  540. aria_pressed: "aria-pressed",
  541. aria_readonly: "aria-readonly",
  542. aria_required: "aria-required",
  543. aria_selected: "aria-selected",
  544. aria_sort: "aria-sort",
  545. aria_valuemax: "aria-valuemax",
  546. aria_valuemin: "aria-valuemin",
  547. aria_valuenow: "aria-valuenow",
  548. aria_valuetext: "aria-valuetext",
  549. // Live Region Attributes
  550. aria_atomic: "aria-atomic",
  551. aria_busy: "aria-busy",
  552. aria_live: "aria-live",
  553. aria_relevant: "aria-relevant",
  554. aria_dropeffect: "aria-dropeffect",
  555. aria_grabbed: "aria-grabbed",
  556. // Relationship Attributes
  557. aria_activedescendant: "aria-activedescendant",
  558. aria_colcount: "aria-colcount",
  559. aria_colindex: "aria-colindex",
  560. aria_colspan: "aria-colspan",
  561. aria_controls: "aria-controls",
  562. aria_describedby: "aria-describedby",
  563. aria_errormessage: "aria-errormessage",
  564. aria_flowto: "aria-flowto",
  565. aria_labelledby: "aria-labelledby",
  566. aria_owns: "aria-owns",
  567. aria_posinset: "aria-posinset",
  568. aria_rowcount: "aria-rowcount",
  569. aria_rowindex: "aria-rowindex",
  570. aria_rowspan: "aria-rowspan",
  571. aria_setsize: "aria-setsize",
  572. }
  573. }
  574. pub trait SvgAttributes {
  575. /// Prevent the default action for this element.
  576. ///
  577. /// For more information, see the MDN docs:
  578. /// <https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault>
  579. fn prevent_default<'a>(&self, cx: NodeFactory<'a>, val: Arguments) -> Attribute<'a> {
  580. cx.attr("dioxus-prevent-default", val, None, false)
  581. }
  582. aria_trait_methods! {
  583. accent_height: "accent-height",
  584. accumulate: "accumulate",
  585. additive: "additive",
  586. alignment_baseline: "alignment-baseline",
  587. alphabetic: "alphabetic",
  588. amplitude: "amplitude",
  589. arabic_form: "arabic-form",
  590. ascent: "ascent",
  591. attributeName: "attributeName",
  592. attributeType: "attributeType",
  593. azimuth: "azimuth",
  594. baseFrequency: "baseFrequency",
  595. baseline_shift: "baseline-shift",
  596. baseProfile: "baseProfile",
  597. bbox: "bbox",
  598. begin: "begin",
  599. bias: "bias",
  600. by: "by",
  601. calcMode: "calcMode",
  602. cap_height: "cap-height",
  603. class: "class",
  604. clip: "clip",
  605. clipPathUnits: "clipPathUnits",
  606. clip_path: "clip-path",
  607. clip_rule: "clip-rule",
  608. color: "color",
  609. color_interpolation: "color-interpolation",
  610. color_interpolation_filters: "color-interpolation-filters",
  611. color_profile: "color-profile",
  612. color_rendering: "color-rendering",
  613. contentScriptType: "contentScriptType",
  614. contentStyleType: "contentStyleType",
  615. crossorigin: "crossorigin",
  616. cursor: "cursor",
  617. cx: "cx",
  618. cy: "cy",
  619. d: "d",
  620. decelerate: "decelerate",
  621. descent: "descent",
  622. diffuseConstant: "diffuseConstant",
  623. direction: "direction",
  624. display: "display",
  625. divisor: "divisor",
  626. dominant_baseline: "dominant-baseline",
  627. dur: "dur",
  628. dx: "dx",
  629. dy: "dy",
  630. edgeMode: "edgeMode",
  631. elevation: "elevation",
  632. enable_background: "enable-background",
  633. end: "end",
  634. exponent: "exponent",
  635. fill: "fill",
  636. fill_opacity: "fill-opacity",
  637. fill_rule: "fill-rule",
  638. filter: "filter",
  639. filterRes: "filterRes",
  640. filterUnits: "filterUnits",
  641. flood_color: "flood-color",
  642. flood_opacity: "flood-opacity",
  643. font_family: "font-family",
  644. font_size: "font-size",
  645. font_size_adjust: "font-size-adjust",
  646. font_stretch: "font-stretch",
  647. font_style: "font-style",
  648. font_variant: "font-variant",
  649. font_weight: "font-weight",
  650. format: "format",
  651. from: "from",
  652. fr: "fr",
  653. fx: "fx",
  654. fy: "fy",
  655. g1: "g1",
  656. g2: "g2",
  657. glyph_name: "glyph-name",
  658. glyph_orientation_horizontal: "glyph-orientation-horizontal",
  659. glyph_orientation_vertical: "glyph-orientation-vertical",
  660. glyphRef: "glyphRef",
  661. gradientTransform: "gradientTransform",
  662. gradientUnits: "gradientUnits",
  663. hanging: "hanging",
  664. height: "height",
  665. href: "href",
  666. hreflang: "hreflang",
  667. horiz_adv_x: "horiz-adv-x",
  668. horiz_origin_x: "horiz-origin-x",
  669. id: "id",
  670. ideographic: "ideographic",
  671. image_rendering: "image-rendering",
  672. _in: "_in",
  673. in2: "in2",
  674. intercept: "intercept",
  675. k: "k",
  676. k1: "k1",
  677. k2: "k2",
  678. k3: "k3",
  679. k4: "k4",
  680. kernelMatrix: "kernelMatrix",
  681. kernelUnitLength: "kernelUnitLength",
  682. kerning: "kerning",
  683. keyPoints: "keyPoints",
  684. keySplines: "keySplines",
  685. keyTimes: "keyTimes",
  686. lang: "lang",
  687. lengthAdjust: "lengthAdjust",
  688. letter_spacing: "letter-spacing",
  689. lighting_color: "lighting-color",
  690. limitingConeAngle: "limitingConeAngle",
  691. local: "local",
  692. marker_end: "marker-end",
  693. marker_mid: "marker-mid",
  694. marker_start: "marker_start",
  695. markerHeight: "markerHeight",
  696. markerUnits: "markerUnits",
  697. markerWidth: "markerWidth",
  698. mask: "mask",
  699. maskContentUnits: "maskContentUnits",
  700. maskUnits: "maskUnits",
  701. mathematical: "mathematical",
  702. max: "max",
  703. media: "media",
  704. method: "method",
  705. min: "min",
  706. mode: "mode",
  707. name: "name",
  708. numOctaves: "numOctaves",
  709. offset: "offset",
  710. opacity: "opacity",
  711. operator: "operator",
  712. order: "order",
  713. orient: "orient",
  714. orientation: "orientation",
  715. origin: "origin",
  716. overflow: "overflow",
  717. overline_position: "overline-position",
  718. overline_thickness: "overline-thickness",
  719. panose_1: "panose-1",
  720. paint_order: "paint-order",
  721. path: "path",
  722. pathLength: "pathLength",
  723. patternContentUnits: "patternContentUnits",
  724. patternTransform: "patternTransform",
  725. patternUnits: "patternUnits",
  726. ping: "ping",
  727. pointer_events: "pointer-events",
  728. points: "points",
  729. pointsAtX: "pointsAtX",
  730. pointsAtY: "pointsAtY",
  731. pointsAtZ: "pointsAtZ",
  732. preserveAlpha: "preserveAlpha",
  733. preserveAspectRatio: "preserveAspectRatio",
  734. primitiveUnits: "primitiveUnits",
  735. r: "r",
  736. radius: "radius",
  737. referrerPolicy: "referrerPolicy",
  738. refX: "refX",
  739. refY: "refY",
  740. rel: "rel",
  741. rendering_intent: "rendering-intent",
  742. repeatCount: "repeatCount",
  743. repeatDur: "repeatDur",
  744. requiredExtensions: "requiredExtensions",
  745. requiredFeatures: "requiredFeatures",
  746. restart: "restart",
  747. result: "result",
  748. role: "role",
  749. rotate: "rotate",
  750. rx: "rx",
  751. ry: "ry",
  752. scale: "scale",
  753. seed: "seed",
  754. shape_rendering: "shape-rendering",
  755. slope: "slope",
  756. spacing: "spacing",
  757. specularConstant: "specularConstant",
  758. specularExponent: "specularExponent",
  759. speed: "speed",
  760. spreadMethod: "spreadMethod",
  761. startOffset: "startOffset",
  762. stdDeviation: "stdDeviation",
  763. stemh: "stemh",
  764. stemv: "stemv",
  765. stitchTiles: "stitchTiles",
  766. stop_color: "stop_color",
  767. stop_opacity: "stop_opacity",
  768. strikethrough_position: "strikethrough-position",
  769. strikethrough_thickness: "strikethrough-thickness",
  770. string: "string",
  771. stroke: "stroke",
  772. stroke_dasharray: "stroke-dasharray",
  773. stroke_dashoffset: "stroke-dashoffset",
  774. stroke_linecap: "stroke-linecap",
  775. stroke_linejoin: "stroke-linejoin",
  776. stroke_miterlimit: "stroke-miterlimit",
  777. stroke_opacity: "stroke-opacity",
  778. stroke_width: "stroke-width",
  779. style: "style",
  780. surfaceScale: "surfaceScale",
  781. systemLanguage: "systemLanguage",
  782. tabindex: "tabindex",
  783. tableValues: "tableValues",
  784. target: "target",
  785. targetX: "targetX",
  786. targetY: "targetY",
  787. text_anchor: "text-anchor",
  788. text_decoration: "text-decoration",
  789. text_rendering: "text-rendering",
  790. textLength: "textLength",
  791. to: "to",
  792. transform: "transform",
  793. transform_origin: "transform-origin",
  794. r#type: "_type",
  795. u1: "u1",
  796. u2: "u2",
  797. underline_position: "underline-position",
  798. underline_thickness: "underline-thickness",
  799. unicode: "unicode",
  800. unicode_bidi: "unicode-bidi",
  801. unicode_range: "unicode-range",
  802. units_per_em: "units-per-em",
  803. v_alphabetic: "v-alphabetic",
  804. v_hanging: "v-hanging",
  805. v_ideographic: "v-ideographic",
  806. v_mathematical: "v-mathematical",
  807. values: "values",
  808. vector_effect: "vector-effect",
  809. version: "version",
  810. vert_adv_y: "vert-adv-y",
  811. vert_origin_x: "vert-origin-x",
  812. vert_origin_y: "vert-origin-y",
  813. view_box: "viewBox",
  814. view_target: "viewTarget",
  815. visibility: "visibility",
  816. width: "width",
  817. widths: "widths",
  818. word_spacing: "word-spacing",
  819. writing_mode: "writing-mode",
  820. x: "x",
  821. x_height: "x-height",
  822. x1: "x1",
  823. x2: "x2",
  824. xmlns: "xmlns",
  825. x_channel_selector: "xChannelSelector",
  826. y: "y",
  827. y1: "y1",
  828. y2: "y2",
  829. y_channel_selector: "yChannelSelector",
  830. z: "z",
  831. zoomAndPan: "zoomAndPan",
  832. }
  833. }