1
0

global_attributes.rs 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955
  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. /// Specifies the alignment of flexible container's items within the flex container.
  115. align_content: "align-content",
  116. /// Specifies the default alignment for items within the flex container.
  117. align_items: "align-items",
  118. /// Specifies the alignment for selected items within the flex container.
  119. align_self: "align-self",
  120. /// Specifies the keyframe_based animations.
  121. animation: "animation",
  122. /// Specifies when the animation will start.
  123. animation_delay: "animation-delay",
  124. /// Specifies whether the animation should play in reverse on alternate cycles or not.
  125. animation_direction: "animation-direction",
  126. /// Specifies the number of seconds or milliseconds an animation should take to complete one cycle
  127. animation_duration: "animation-duration",
  128. /// Specifies how a CSS animation should apply styles to its target before and after it is executing
  129. animation_fill_mode: "animation-fill-mode",
  130. /// Specifies the number of times an animation cycle should be played before stopping.
  131. animation_iteration_count: "animation-iteration-count",
  132. /// Specifies the name of @keyframes defined animations that should be applied to the selected element
  133. animation_name: "animation-name",
  134. /// Specifies whether the animation is running or paused.
  135. animation_play_state: "animation-play-state",
  136. /// Specifies how a CSS animation should progress over the duration of each cycle.
  137. animation_timing_function: "animation-timing-function",
  138. /// Specifies whether or not the "back" side of a transformed element is visible when facing the user.
  139. backface_visibility: "backface-visibility",
  140. /// Defines a variety of background properties within one declaration.
  141. background: "background",
  142. /// Specify whether the background image is fixed in the viewport or scrolls.
  143. background_attachment: "background-attachment",
  144. /// Specifies the painting area of the background.
  145. background_clip: "background-clip",
  146. /// Defines an element's background color.
  147. background_color: "background-color",
  148. /// Defines an element's background image.
  149. background_image: "background-image",
  150. /// Specifies the positioning area of the background images.
  151. background_origin: "background-origin",
  152. /// Defines the origin of a background image.
  153. background_position: "background-position",
  154. /// Specify whether/how the background image is tiled.
  155. background_repeat: "background-repeat",
  156. /// Specifies the size of the background images.
  157. background_size: "background-size",
  158. /// Sets the width, style, and color for all four sides of an element's border.
  159. border: "border",
  160. /// Sets the width, style, and color of the bottom border of an element.
  161. border_bottom: "border-bottom",
  162. /// Sets the color of the bottom border of an element.
  163. border_bottom_color: "border-bottom-color",
  164. /// Defines the shape of the bottom_left border corner of an element.
  165. border_bottom_left_radius: "border-bottom-left-radius",
  166. /// Defines the shape of the bottom_right border corner of an element.
  167. border_bottom_right_radius: "border-bottom-right-radius",
  168. /// Sets the style of the bottom border of an element.
  169. border_bottom_style: "border-bottom-style",
  170. /// Sets the width of the bottom border of an element.
  171. border_bottom_width: "border-bottom-width",
  172. /// Specifies whether table cell borders are connected or separated.
  173. border_collapse: "border-collapse",
  174. /// Sets the color of the border on all the four sides of an element.
  175. border_color: "border-color",
  176. /// Specifies how an image is to be used in place of the border styles.
  177. border_image: "border-image",
  178. /// Specifies the amount by which the border image area extends beyond the border box.
  179. border_image_outset: "border-image-outset",
  180. /// Specifies whether the image_border should be repeated, rounded or stretched.
  181. border_image_repeat: "border-image-repeat",
  182. /// Specifies the inward offsets of the image_border.
  183. border_image_slice: "border-image-slice",
  184. /// Specifies the location of the image to be used as a border.
  185. border_image_source: "border-image-source",
  186. /// Specifies the width of the image_border.
  187. border_image_width: "border-image-width",
  188. /// Sets the width, style, and color of the left border of an element.
  189. border_left: "border-left",
  190. /// Sets the color of the left border of an element.
  191. border_left_color: "border-left-color",
  192. /// Sets the style of the left border of an element.
  193. border_left_style: "border-left-style",
  194. /// Sets the width of the left border of an element.
  195. border_left_width: "border-left-width",
  196. /// Defines the shape of the border corners of an element.
  197. border_radius: "border-radius",
  198. /// Sets the width, style, and color of the right border of an element.
  199. border_right: "border-right",
  200. /// Sets the color of the right border of an element.
  201. border_right_color: "border-right-color",
  202. /// Sets the style of the right border of an element.
  203. border_right_style: "border-right-style",
  204. /// Sets the width of the right border of an element.
  205. border_right_width: "border-right-width",
  206. /// Sets the spacing between the borders of adjacent table cells.
  207. border_spacing: "border-spacing",
  208. /// Sets the style of the border on all the four sides of an element.
  209. border_style: "border-style",
  210. /// Sets the width, style, and color of the top border of an element.
  211. border_top: "border-top",
  212. /// Sets the color of the top border of an element.
  213. border_top_color: "border-top-color",
  214. /// Defines the shape of the top_left border corner of an element.
  215. border_top_left_radius: "border-top-left-radius",
  216. /// Defines the shape of the top_right border corner of an element.
  217. border_top_right_radius: "border-top-right-radius",
  218. /// Sets the style of the top border of an element.
  219. border_top_style: "border-top-style",
  220. /// Sets the width of the top border of an element.
  221. border_top_width: "border-top-width",
  222. /// Sets the width of the border on all the four sides of an element.
  223. border_width: "border-width",
  224. /// Specify the location of the bottom edge of the positioned element.
  225. bottom: "bottom",
  226. /// Applies one or more drop_shadows to the element's box.
  227. box_shadow: "box-shadow",
  228. /// Alter the default CSS box model.
  229. box_sizing: "box-sizing",
  230. /// Specify the position of table's caption.
  231. caption_side: "caption-side",
  232. /// Specifies the placement of an element in relation to floating elements.
  233. clear: "clear",
  234. /// Defines the clipping region.
  235. clip: "clip",
  236. /// Specify the color of the text of an element.
  237. color: "color",
  238. /// Specifies the number of columns in a multi_column element.
  239. column_count: "column-count",
  240. /// Specifies how columns will be filled.
  241. column_fill: "column-fill",
  242. /// Specifies the gap between the columns in a multi_column element.
  243. column_gap: "column-gap",
  244. /// Specifies a straight line, or "rule", to be drawn between each column in a multi_column element.
  245. column_rule: "column-rule",
  246. /// Specifies the color of the rules drawn between columns in a multi_column layout.
  247. column_rule_color: "column-rule-color",
  248. /// Specifies the style of the rule drawn between the columns in a multi_column layout.
  249. column_rule_style: "column-rule-style",
  250. /// Specifies the width of the rule drawn between the columns in a multi_column layout.
  251. column_rule_width: "column-rule-width",
  252. /// Specifies how many columns an element spans across in a multi_column layout.
  253. column_span: "column-span",
  254. /// Specifies the optimal width of the columns in a multi_column element.
  255. column_width: "column-width",
  256. /// A shorthand property for setting column_width and column_count properties.
  257. columns: "columns",
  258. /// Inserts generated content.
  259. content: "content",
  260. /// Increments one or more counter values.
  261. counter_increment: "counter-increment",
  262. /// Creates or resets one or more counters.
  263. counter_reset: "counter-reset",
  264. /// Specify the type of cursor.
  265. cursor: "cursor",
  266. /// Define the text direction/writing direction.
  267. direction: "direction",
  268. /// Specifies how an element is displayed onscreen.
  269. display: "display",
  270. /// Show or hide borders and backgrounds of empty table cells.
  271. empty_cells: "empty-cells",
  272. /// Specifies the components of a flexible length.
  273. flex: "flex",
  274. /// Specifies the initial main size of the flex item.
  275. flex_basis: "flex-basis",
  276. /// Specifies the direction of the flexible items.
  277. flex_direction: "flex-direction",
  278. /// A shorthand property for the flex_direction and the flex_wrap properties.
  279. flex_flow: "flex-flow",
  280. /// Specifies how the flex item will grow relative to the other items inside the flex container.
  281. flex_grow: "flex-grow",
  282. /// Specifies how the flex item will shrink relative to the other items inside the flex container
  283. flex_shrink: "flex-shrink",
  284. /// Specifies whether the flexible items should wrap or not.
  285. flex_wrap: "flex-wrap",
  286. /// Specifies whether or not a box should float.
  287. float: "float",
  288. /// Defines a variety of font properties within one declaration.
  289. font: "font",
  290. /// Defines a list of fonts for element.
  291. font_family: "font-family",
  292. /// Defines the font size for the text.
  293. font_size: "font-size",
  294. /// Preserves the readability of text when font fallback occurs.
  295. font_size_adjust: "font-size-adjust",
  296. /// Selects a normal, condensed, or expanded face from a font.
  297. font_stretch: "font-stretch",
  298. /// Defines the font style for the text.
  299. font_style: "font-style",
  300. /// Specify the font variant.
  301. font_variant: "font-variant",
  302. /// Specify the font weight of the text.
  303. font_weight: "font-weight",
  304. /// Sets gaps (gutters) between rows and columns. Shorthand for row_gap and column_gap.
  305. gap: "gap",
  306. /// Specify the height of an element.
  307. height: "height",
  308. /// Specifies how flex items are aligned along the main axis of the flex container after any flexible lengths and auto margins have been resolved.
  309. justify_content: "justify-content",
  310. /// Specify the location of the left edge of the positioned element.
  311. left: "left",
  312. /// Sets the extra spacing between letters.
  313. letter_spacing: "letter-spacing",
  314. /// Sets the height between lines of text.
  315. line_height: "line-height",
  316. /// Defines the display style for a list and list elements.
  317. list_style: "list-style",
  318. /// Specifies the image to be used as a list_item marker.
  319. list_style_image: "list-style-image",
  320. /// Specifies the position of the list_item marker.
  321. list_style_position: "list-style-position",
  322. /// Specifies the marker style for a list_item.
  323. list_styler_type: "list-style-type",
  324. /// Sets the margin on all four sides of the element.
  325. margin: "margin",
  326. /// Sets the bottom margin of the element.
  327. margin_bottom: "margin-bottom",
  328. /// Sets the left margin of the element.
  329. margin_left: "margin-left",
  330. /// Sets the right margin of the element.
  331. margin_right: "margin-right",
  332. /// Sets the top margin of the element.
  333. margin_top: "margin-top",
  334. /// Specify the maximum height of an element.
  335. max_height: "max-height",
  336. /// Specify the maximum width of an element.
  337. max_width: "max-width",
  338. /// Specify the minimum height of an element.
  339. min_height: "min-height",
  340. /// Specify the minimum width of an element.
  341. min_width: "min-width",
  342. /// Specifies the transparency of an element.
  343. opacity: "opacity",
  344. /// Specifies the order in which a flex items are displayed and laid out within a flex container.
  345. order: "order",
  346. /// Sets the width, style, and color for all four sides of an element's outline.
  347. outline: "outline",
  348. /// Sets the color of the outline.
  349. outline_color: "outline-color",
  350. /// Set the space between an outline and the border edge of an element.
  351. outline_offset: "outline-offset",
  352. /// Sets a style for an outline.
  353. outline_style: "outline-style",
  354. /// Sets the width of the outline.
  355. outline_width: "outline-width",
  356. /// Specifies the treatment of content that overflows the element's box.
  357. overflow: "overflow",
  358. /// Specifies the treatment of content that overflows the element's box horizontally.
  359. overflow_x: "overflow-x",
  360. /// Specifies the treatment of content that overflows the element's box vertically.
  361. overflow_y: "overflow-y",
  362. /// Sets the padding on all four sides of the element.
  363. padding: "padding",
  364. /// Sets the padding to the bottom side of an element.
  365. padding_bottom: "padding-bottom",
  366. /// Sets the padding to the left side of an element.
  367. padding_left: "padding-left",
  368. /// Sets the padding to the right side of an element.
  369. padding_right: "padding-right",
  370. /// Sets the padding to the top side of an element.
  371. padding_top: "padding-top",
  372. /// Insert a page breaks after an element.
  373. page_break_after: "page-break-after",
  374. /// Insert a page breaks before an element.
  375. page_break_before: "page-break-before",
  376. /// Insert a page breaks inside an element.
  377. page_break_inside: "page-break-inside",
  378. /// Defines the perspective from which all child elements of the object are viewed.
  379. perspective: "perspective",
  380. /// Defines the origin (the vanishing point for the 3D space) for the perspective property.
  381. perspective_origin: "perspective-origin",
  382. /// Specifies how an element is positioned.
  383. position: "position",
  384. /// The pointer-events CSS property sets under what circumstances (if any) a particular graphic element can
  385. /// become the target of pointer events.
  386. ///
  387. /// MDN: [`pointer_events`](https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events)
  388. pointer_events: "pointer-events",
  389. /// Specifies quotation marks for embedded quotations.
  390. quotes: "quotes",
  391. /// Specifies whether or not an element is resizable by the user.
  392. resize: "resize",
  393. /// Specify the location of the right edge of the positioned element.
  394. right: "right",
  395. /// Specifies the gap between the rows in a multi_column element.
  396. row_gap: "row-gap",
  397. /// Specifies the length of the tab character.
  398. tab_size: "tab-size",
  399. /// Specifies a table layout algorithm.
  400. table_layout: "table-layout",
  401. /// Sets the horizontal alignment of inline content.
  402. text_align: "text-align",
  403. /// Specifies how the last line of a block or a line right before a forced line break is aligned when is justify.",
  404. text_align_last: "text-align-last",
  405. /// Specifies the decoration added to text.
  406. text_decoration: "text-decoration",
  407. /// Specifies the color of the text_decoration_line.
  408. text_decoration_color: "text-decoration-color",
  409. /// Specifies what kind of line decorations are added to the element.
  410. text_decoration_line: "text-decoration-line",
  411. /// Specifies the style of the lines specified by the text_decoration_line property
  412. text_decoration_style: "text-decoration-style",
  413. /// Indent the first line of text.
  414. text_indent: "text-indent",
  415. /// Specifies the justification method to use when the text_align property is set to justify.
  416. text_justify: "text-justify",
  417. /// Specifies how the text content will be displayed, when it overflows the block containers.
  418. text_overflow: "text-overflow",
  419. /// Applies one or more shadows to the text content of an element.
  420. text_shadow: "text-shadow",
  421. /// Transforms the case of the text.
  422. text_transform: "text-transform",
  423. /// Specify the location of the top edge of the positioned element.
  424. top: "top",
  425. /// Applies a 2D or 3D transformation to an element.
  426. transform: "transform",
  427. /// Defines the origin of transformation for an element.
  428. transform_origin: "transform-origin",
  429. /// Specifies how nested elements are rendered in 3D space.
  430. transform_style: "transform-style",
  431. /// Defines the transition between two states of an element.
  432. transition: "transition",
  433. /// Specifies when the transition effect will start.
  434. transition_delay: "transition-delay",
  435. /// Specifies the number of seconds or milliseconds a transition effect should take to complete.
  436. transition_duration: "transition-duration",
  437. /// Specifies the names of the CSS properties to which a transition effect should be applied.
  438. transition_property: "transition-property",
  439. /// Specifies the speed curve of the transition effect.
  440. transition_timing_function: "transition-timing-function",
  441. /// The user-select CSS property controls whether the user can select text.
  442. /// This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes.
  443. user_select: "user-select",
  444. webkit_user_select: "-webkit-user-select",
  445. /// Sets the vertical positioning of an element relative to the current text baseline.
  446. vertical_align: "vertical-align",
  447. /// Specifies whether or not an element is visible.
  448. visibility: "visibility",
  449. /// Specifies how white space inside the element is handled.
  450. white_space: "white-space",
  451. /// Specify the width of an element.
  452. width: "width",
  453. /// Specifies how to break lines within words.
  454. word_break: "word-break",
  455. /// Sets the spacing between words.
  456. word_spacing: "word-spacing",
  457. /// Specifies whether to break words when the content overflows the boundaries of its container.
  458. word_wrap: "word-wrap",
  459. /// Specifies a layering or stacking order for positioned elements.
  460. z_index : "z-index",
  461. }
  462. aria_trait_methods! {
  463. aria_current: "aria-current",
  464. aria_details: "aria-details",
  465. aria_disabled: "aria-disabled",
  466. aria_hidden: "aria-hidden",
  467. aria_invalid: "aria-invalid",
  468. aria_keyshortcuts: "aria-keyshortcuts",
  469. aria_label: "aria-label",
  470. aria_roledescription: "aria-roledescription",
  471. // Widget Attributes
  472. aria_autocomplete: "aria-autocomplete",
  473. aria_checked: "aria-checked",
  474. aria_expanded: "aria-expanded",
  475. aria_haspopup: "aria-haspopup",
  476. aria_level: "aria-level",
  477. aria_modal: "aria-modal",
  478. aria_multiline: "aria-multiline",
  479. aria_multiselectable: "aria-multiselectable",
  480. aria_orientation: "aria-orientation",
  481. aria_placeholder: "aria-placeholder",
  482. aria_pressed: "aria-pressed",
  483. aria_readonly: "aria-readonly",
  484. aria_required: "aria-required",
  485. aria_selected: "aria-selected",
  486. aria_sort: "aria-sort",
  487. aria_valuemax: "aria-valuemax",
  488. aria_valuemin: "aria-valuemin",
  489. aria_valuenow: "aria-valuenow",
  490. aria_valuetext: "aria-valuetext",
  491. // Live Region Attributes
  492. aria_atomic: "aria-atomic",
  493. aria_busy: "aria-busy",
  494. aria_live: "aria-live",
  495. aria_relevant: "aria-relevant",
  496. aria_dropeffect: "aria-dropeffect",
  497. aria_grabbed: "aria-grabbed",
  498. // Relationship Attributes
  499. aria_activedescendant: "aria-activedescendant",
  500. aria_colcount: "aria-colcount",
  501. aria_colindex: "aria-colindex",
  502. aria_colspan: "aria-colspan",
  503. aria_controls: "aria-controls",
  504. aria_describedby: "aria-describedby",
  505. aria_errormessage: "aria-errormessage",
  506. aria_flowto: "aria-flowto",
  507. aria_labelledby: "aria-labelledby",
  508. aria_owns: "aria-owns",
  509. aria_posinset: "aria-posinset",
  510. aria_rowcount: "aria-rowcount",
  511. aria_rowindex: "aria-rowindex",
  512. aria_rowspan: "aria-rowspan",
  513. aria_setsize: "aria-setsize",
  514. }
  515. }
  516. pub trait SvgAttributes {
  517. /// Prevent the default action for this element.
  518. ///
  519. /// For more information, see the MDN docs:
  520. /// <https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault>
  521. fn prevent_default<'a>(&self, cx: NodeFactory<'a>, val: Arguments) -> Attribute<'a> {
  522. cx.attr("dioxus-prevent-default", val, None, false)
  523. }
  524. aria_trait_methods! {
  525. accent_height: "accent-height",
  526. accumulate: "accumulate",
  527. additive: "additive",
  528. alignment_baseline: "alignment-baseline",
  529. alphabetic: "alphabetic",
  530. amplitude: "amplitude",
  531. arabic_form: "arabic-form",
  532. ascent: "ascent",
  533. attributeName: "attributeName",
  534. attributeType: "attributeType",
  535. azimuth: "azimuth",
  536. baseFrequency: "baseFrequency",
  537. baseline_shift: "baseline-shift",
  538. baseProfile: "baseProfile",
  539. bbox: "bbox",
  540. begin: "begin",
  541. bias: "bias",
  542. by: "by",
  543. calcMode: "calcMode",
  544. cap_height: "cap-height",
  545. class: "class",
  546. clip: "clip",
  547. clipPathUnits: "clipPathUnits",
  548. clip_path: "clip-path",
  549. clip_rule: "clip-rule",
  550. color: "color",
  551. color_interpolation: "color-interpolation",
  552. color_interpolation_filters: "color-interpolation-filters",
  553. color_profile: "color-profile",
  554. color_rendering: "color-rendering",
  555. contentScriptType: "contentScriptType",
  556. contentStyleType: "contentStyleType",
  557. crossorigin: "crossorigin",
  558. cursor: "cursor",
  559. cx: "cx",
  560. cy: "cy",
  561. d: "d",
  562. decelerate: "decelerate",
  563. descent: "descent",
  564. diffuseConstant: "diffuseConstant",
  565. direction: "direction",
  566. display: "display",
  567. divisor: "divisor",
  568. dominant_baseline: "dominant-baseline",
  569. dur: "dur",
  570. dx: "dx",
  571. dy: "dy",
  572. edgeMode: "edgeMode",
  573. elevation: "elevation",
  574. enable_background: "enable-background",
  575. end: "end",
  576. exponent: "exponent",
  577. fill: "fill",
  578. fill_opacity: "fill-opacity",
  579. fill_rule: "fill-rule",
  580. filter: "filter",
  581. filterRes: "filterRes",
  582. filterUnits: "filterUnits",
  583. flood_color: "flood-color",
  584. flood_opacity: "flood-opacity",
  585. font_family: "font-family",
  586. font_size: "font-size",
  587. font_size_adjust: "font-size-adjust",
  588. font_stretch: "font-stretch",
  589. font_style: "font-style",
  590. font_variant: "font-variant",
  591. font_weight: "font-weight",
  592. format: "format",
  593. from: "from",
  594. fr: "fr",
  595. fx: "fx",
  596. fy: "fy",
  597. g1: "g1",
  598. g2: "g2",
  599. glyph_name: "glyph-name",
  600. glyph_orientation_horizontal: "glyph-orientation-horizontal",
  601. glyph_orientation_vertical: "glyph-orientation-vertical",
  602. glyphRef: "glyphRef",
  603. gradientTransform: "gradientTransform",
  604. gradientUnits: "gradientUnits",
  605. hanging: "hanging",
  606. height: "height",
  607. href: "href",
  608. hreflang: "hreflang",
  609. horiz_adv_x: "horiz-adv-x",
  610. horiz_origin_x: "horiz-origin-x",
  611. id: "id",
  612. ideographic: "ideographic",
  613. image_rendering: "image-rendering",
  614. _in: "_in",
  615. in2: "in2",
  616. intercept: "intercept",
  617. k: "k",
  618. k1: "k1",
  619. k2: "k2",
  620. k3: "k3",
  621. k4: "k4",
  622. kernelMatrix: "kernelMatrix",
  623. kernelUnitLength: "kernelUnitLength",
  624. kerning: "kerning",
  625. keyPoints: "keyPoints",
  626. keySplines: "keySplines",
  627. keyTimes: "keyTimes",
  628. lang: "lang",
  629. lengthAdjust: "lengthAdjust",
  630. letter_spacing: "letter-spacing",
  631. lighting_color: "lighting-color",
  632. limitingConeAngle: "limitingConeAngle",
  633. local: "local",
  634. marker_end: "marker-end",
  635. marker_mid: "marker-mid",
  636. marker_start: "marker_start",
  637. markerHeight: "markerHeight",
  638. markerUnits: "markerUnits",
  639. markerWidth: "markerWidth",
  640. mask: "mask",
  641. maskContentUnits: "maskContentUnits",
  642. maskUnits: "maskUnits",
  643. mathematical: "mathematical",
  644. max: "max",
  645. media: "media",
  646. method: "method",
  647. min: "min",
  648. mode: "mode",
  649. name: "name",
  650. numOctaves: "numOctaves",
  651. offset: "offset",
  652. opacity: "opacity",
  653. operator: "operator",
  654. order: "order",
  655. orient: "orient",
  656. orientation: "orientation",
  657. origin: "origin",
  658. overflow: "overflow",
  659. overline_position: "overline-position",
  660. overline_thickness: "overline-thickness",
  661. panose_1: "panose-1",
  662. paint_order: "paint-order",
  663. path: "path",
  664. pathLength: "pathLength",
  665. patternContentUnits: "patternContentUnits",
  666. patternTransform: "patternTransform",
  667. patternUnits: "patternUnits",
  668. ping: "ping",
  669. pointer_events: "pointer-events",
  670. points: "points",
  671. pointsAtX: "pointsAtX",
  672. pointsAtY: "pointsAtY",
  673. pointsAtZ: "pointsAtZ",
  674. preserveAlpha: "preserveAlpha",
  675. preserveAspectRatio: "preserveAspectRatio",
  676. primitiveUnits: "primitiveUnits",
  677. r: "r",
  678. radius: "radius",
  679. referrerPolicy: "referrerPolicy",
  680. refX: "refX",
  681. refY: "refY",
  682. rel: "rel",
  683. rendering_intent: "rendering-intent",
  684. repeatCount: "repeatCount",
  685. repeatDur: "repeatDur",
  686. requiredExtensions: "requiredExtensions",
  687. requiredFeatures: "requiredFeatures",
  688. restart: "restart",
  689. result: "result",
  690. role: "role",
  691. rotate: "rotate",
  692. rx: "rx",
  693. ry: "ry",
  694. scale: "scale",
  695. seed: "seed",
  696. shape_rendering: "shape-rendering",
  697. slope: "slope",
  698. spacing: "spacing",
  699. specularConstant: "specularConstant",
  700. specularExponent: "specularExponent",
  701. speed: "speed",
  702. spreadMethod: "spreadMethod",
  703. startOffset: "startOffset",
  704. stdDeviation: "stdDeviation",
  705. stemh: "stemh",
  706. stemv: "stemv",
  707. stitchTiles: "stitchTiles",
  708. stop_color: "stop_color",
  709. stop_opacity: "stop_opacity",
  710. strikethrough_position: "strikethrough-position",
  711. strikethrough_thickness: "strikethrough-thickness",
  712. string: "string",
  713. stroke: "stroke",
  714. stroke_dasharray: "stroke-dasharray",
  715. stroke_dashoffset: "stroke-dashoffset",
  716. stroke_linecap: "stroke-linecap",
  717. stroke_linejoin: "stroke-linejoin",
  718. stroke_miterlimit: "stroke-miterlimit",
  719. stroke_opacity: "stroke-opacity",
  720. stroke_width: "stroke-width",
  721. style: "style",
  722. surfaceScale: "surfaceScale",
  723. systemLanguage: "systemLanguage",
  724. tabindex: "tabindex",
  725. tableValues: "tableValues",
  726. target: "target",
  727. targetX: "targetX",
  728. targetY: "targetY",
  729. text_anchor: "text-anchor",
  730. text_decoration: "text-decoration",
  731. text_rendering: "text-rendering",
  732. textLength: "textLength",
  733. to: "to",
  734. transform: "transform",
  735. transform_origin: "transform-origin",
  736. r#type: "_type",
  737. u1: "u1",
  738. u2: "u2",
  739. underline_position: "underline-position",
  740. underline_thickness: "underline-thickness",
  741. unicode: "unicode",
  742. unicode_bidi: "unicode-bidi",
  743. unicode_range: "unicode-range",
  744. units_per_em: "units-per-em",
  745. v_alphabetic: "v-alphabetic",
  746. v_hanging: "v-hanging",
  747. v_ideographic: "v-ideographic",
  748. v_mathematical: "v-mathematical",
  749. values: "values",
  750. vector_effect: "vector-effect",
  751. version: "version",
  752. vert_adv_y: "vert-adv-y",
  753. vert_origin_x: "vert-origin-x",
  754. vert_origin_y: "vert-origin-y",
  755. view_box: "viewBox",
  756. view_target: "viewTarget",
  757. visibility: "visibility",
  758. width: "width",
  759. widths: "widths",
  760. word_spacing: "word-spacing",
  761. writing_mode: "writing-mode",
  762. x: "x",
  763. x_height: "x-height",
  764. x1: "x1",
  765. x2: "x2",
  766. xmlns: "xmlns",
  767. x_channel_selector: "xChannelSelector",
  768. y: "y",
  769. y1: "y1",
  770. y2: "y2",
  771. y_channel_selector: "yChannelSelector",
  772. z: "z",
  773. zoomAndPan: "zoomAndPan",
  774. }
  775. }