html_compose.attributes.form_attrs

  1from . import BaseAttribute
  2from typing import Literal
  3from ..base_types import StrLike
  4
  5
  6class FormAttrs:
  7    """
  8    This module contains functions for attributes in the 'form' element.
  9    Which is inherited by a class so we can generate type hints
 10    """
 11
 12    @staticmethod
 13    def accept_charset(value) -> BaseAttribute:
 14        """
 15        "form" attribute: accept-charset
 16        Character encodings to use for form submission
 17
 18        Args:
 19            value:
 20                ASCII case-insensitive match for "UTF-8"
 21
 22        Returns:
 23            An accept-charset attribute to be added to your element
 24
 25        """
 26
 27        return BaseAttribute("accept-charset", value)
 28
 29    @staticmethod
 30    def action(value) -> BaseAttribute:
 31        """
 32        "form" attribute: action
 33        URL to use for form submission
 34
 35        Args:
 36            value:
 37                Valid non-empty URL potentially surrounded by spaces
 38
 39        Returns:
 40            An action attribute to be added to your element
 41
 42        """
 43
 44        return BaseAttribute("action", value)
 45
 46    @staticmethod
 47    def autocomplete(value: Literal["on", "off"]) -> BaseAttribute:
 48        """
 49        "form" attribute: autocomplete
 50        Default setting for autofill feature for controls in the form
 51
 52        Args:
 53            value:
 54                ['on', 'off']
 55
 56        Returns:
 57            An autocomplete attribute to be added to your element
 58
 59        """
 60
 61        return BaseAttribute("autocomplete", value)
 62
 63    @staticmethod
 64    def enctype(
 65        value: Literal[
 66            "application/x-www-form-urlencoded",
 67            "multipart/form-data",
 68            "text/plain",
 69        ],
 70    ) -> BaseAttribute:
 71        """
 72        "form" attribute: enctype
 73        Entry list encoding type to use for form submission
 74
 75        Args:
 76            value:
 77                ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain']
 78
 79        Returns:
 80            An enctype attribute to be added to your element
 81
 82        """
 83
 84        return BaseAttribute("enctype", value)
 85
 86    @staticmethod
 87    def method(value: Literal["GET", "POST", "dialog"]) -> BaseAttribute:
 88        """
 89        "form" attribute: method
 90        Variant to use for form submission
 91
 92        Args:
 93            value:
 94                ['GET', 'POST', 'dialog']
 95
 96        Returns:
 97            An method attribute to be added to your element
 98
 99        """
100
101        return BaseAttribute("method", value)
102
103    @staticmethod
104    def name(value: StrLike) -> BaseAttribute:
105        """
106        "form" attribute: name
107        Name of form to use in the document.forms API
108
109        Args:
110            value:
111                Text*
112
113        Returns:
114            An name attribute to be added to your element
115
116        """
117
118        return BaseAttribute("name", value)
119
120    @staticmethod
121    def novalidate(value: bool) -> BaseAttribute:
122        """
123        "form" attribute: novalidate
124        Bypass form control validation for form submission
125
126        Args:
127            value:
128                Boolean attribute
129
130        Returns:
131            An novalidate attribute to be added to your element
132
133        """
134
135        return BaseAttribute("novalidate", value)
136
137    @staticmethod
138    def target(value) -> BaseAttribute:
139        """
140        "form" attribute: target
141        Navigable for form submission
142
143        Args:
144            value:
145                Valid navigable target name or keyword
146
147        Returns:
148            An target attribute to be added to your element
149
150        """
151
152        return BaseAttribute("target", value)
class FormAttrs:
  7class FormAttrs:
  8    """
  9    This module contains functions for attributes in the 'form' element.
 10    Which is inherited by a class so we can generate type hints
 11    """
 12
 13    @staticmethod
 14    def accept_charset(value) -> BaseAttribute:
 15        """
 16        "form" attribute: accept-charset
 17        Character encodings to use for form submission
 18
 19        Args:
 20            value:
 21                ASCII case-insensitive match for "UTF-8"
 22
 23        Returns:
 24            An accept-charset attribute to be added to your element
 25
 26        """
 27
 28        return BaseAttribute("accept-charset", value)
 29
 30    @staticmethod
 31    def action(value) -> BaseAttribute:
 32        """
 33        "form" attribute: action
 34        URL to use for form submission
 35
 36        Args:
 37            value:
 38                Valid non-empty URL potentially surrounded by spaces
 39
 40        Returns:
 41            An action attribute to be added to your element
 42
 43        """
 44
 45        return BaseAttribute("action", value)
 46
 47    @staticmethod
 48    def autocomplete(value: Literal["on", "off"]) -> BaseAttribute:
 49        """
 50        "form" attribute: autocomplete
 51        Default setting for autofill feature for controls in the form
 52
 53        Args:
 54            value:
 55                ['on', 'off']
 56
 57        Returns:
 58            An autocomplete attribute to be added to your element
 59
 60        """
 61
 62        return BaseAttribute("autocomplete", value)
 63
 64    @staticmethod
 65    def enctype(
 66        value: Literal[
 67            "application/x-www-form-urlencoded",
 68            "multipart/form-data",
 69            "text/plain",
 70        ],
 71    ) -> BaseAttribute:
 72        """
 73        "form" attribute: enctype
 74        Entry list encoding type to use for form submission
 75
 76        Args:
 77            value:
 78                ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain']
 79
 80        Returns:
 81            An enctype attribute to be added to your element
 82
 83        """
 84
 85        return BaseAttribute("enctype", value)
 86
 87    @staticmethod
 88    def method(value: Literal["GET", "POST", "dialog"]) -> BaseAttribute:
 89        """
 90        "form" attribute: method
 91        Variant to use for form submission
 92
 93        Args:
 94            value:
 95                ['GET', 'POST', 'dialog']
 96
 97        Returns:
 98            An method attribute to be added to your element
 99
100        """
101
102        return BaseAttribute("method", value)
103
104    @staticmethod
105    def name(value: StrLike) -> BaseAttribute:
106        """
107        "form" attribute: name
108        Name of form to use in the document.forms API
109
110        Args:
111            value:
112                Text*
113
114        Returns:
115            An name attribute to be added to your element
116
117        """
118
119        return BaseAttribute("name", value)
120
121    @staticmethod
122    def novalidate(value: bool) -> BaseAttribute:
123        """
124        "form" attribute: novalidate
125        Bypass form control validation for form submission
126
127        Args:
128            value:
129                Boolean attribute
130
131        Returns:
132            An novalidate attribute to be added to your element
133
134        """
135
136        return BaseAttribute("novalidate", value)
137
138    @staticmethod
139    def target(value) -> BaseAttribute:
140        """
141        "form" attribute: target
142        Navigable for form submission
143
144        Args:
145            value:
146                Valid navigable target name or keyword
147
148        Returns:
149            An target attribute to be added to your element
150
151        """
152
153        return BaseAttribute("target", value)

This module contains functions for attributes in the 'form' element. Which is inherited by a class so we can generate type hints

@staticmethod
def accept_charset(value) -> html_compose.base_attribute.BaseAttribute:
13    @staticmethod
14    def accept_charset(value) -> BaseAttribute:
15        """
16        "form" attribute: accept-charset
17        Character encodings to use for form submission
18
19        Args:
20            value:
21                ASCII case-insensitive match for "UTF-8"
22
23        Returns:
24            An accept-charset attribute to be added to your element
25
26        """
27
28        return BaseAttribute("accept-charset", value)

"form" attribute: accept-charset Character encodings to use for form submission

Args: value: ASCII case-insensitive match for "UTF-8"

Returns: An accept-charset attribute to be added to your element

@staticmethod
def action(value) -> html_compose.base_attribute.BaseAttribute:
30    @staticmethod
31    def action(value) -> BaseAttribute:
32        """
33        "form" attribute: action
34        URL to use for form submission
35
36        Args:
37            value:
38                Valid non-empty URL potentially surrounded by spaces
39
40        Returns:
41            An action attribute to be added to your element
42
43        """
44
45        return BaseAttribute("action", value)

"form" attribute: action URL to use for form submission

Args: value: Valid non-empty URL potentially surrounded by spaces

Returns: An action attribute to be added to your element

@staticmethod
def autocomplete(value: Literal['on', 'off']) -> html_compose.base_attribute.BaseAttribute:
47    @staticmethod
48    def autocomplete(value: Literal["on", "off"]) -> BaseAttribute:
49        """
50        "form" attribute: autocomplete
51        Default setting for autofill feature for controls in the form
52
53        Args:
54            value:
55                ['on', 'off']
56
57        Returns:
58            An autocomplete attribute to be added to your element
59
60        """
61
62        return BaseAttribute("autocomplete", value)

"form" attribute: autocomplete Default setting for autofill feature for controls in the form

Args: value: ['on', 'off']

Returns: An autocomplete attribute to be added to your element

@staticmethod
def enctype( value: Literal['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain']) -> html_compose.base_attribute.BaseAttribute:
64    @staticmethod
65    def enctype(
66        value: Literal[
67            "application/x-www-form-urlencoded",
68            "multipart/form-data",
69            "text/plain",
70        ],
71    ) -> BaseAttribute:
72        """
73        "form" attribute: enctype
74        Entry list encoding type to use for form submission
75
76        Args:
77            value:
78                ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain']
79
80        Returns:
81            An enctype attribute to be added to your element
82
83        """
84
85        return BaseAttribute("enctype", value)

"form" attribute: enctype Entry list encoding type to use for form submission

Args: value: ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain']

Returns: An enctype attribute to be added to your element

@staticmethod
def method( value: Literal['GET', 'POST', 'dialog']) -> html_compose.base_attribute.BaseAttribute:
 87    @staticmethod
 88    def method(value: Literal["GET", "POST", "dialog"]) -> BaseAttribute:
 89        """
 90        "form" attribute: method
 91        Variant to use for form submission
 92
 93        Args:
 94            value:
 95                ['GET', 'POST', 'dialog']
 96
 97        Returns:
 98            An method attribute to be added to your element
 99
100        """
101
102        return BaseAttribute("method", value)

"form" attribute: method Variant to use for form submission

Args: value: ['GET', 'POST', 'dialog']

Returns: An method attribute to be added to your element

@staticmethod
def name( value: str | float | int | bool) -> html_compose.base_attribute.BaseAttribute:
104    @staticmethod
105    def name(value: StrLike) -> BaseAttribute:
106        """
107        "form" attribute: name
108        Name of form to use in the document.forms API
109
110        Args:
111            value:
112                Text*
113
114        Returns:
115            An name attribute to be added to your element
116
117        """
118
119        return BaseAttribute("name", value)

"form" attribute: name Name of form to use in the document.forms API

Args: value: Text*

Returns: An name attribute to be added to your element

@staticmethod
def novalidate(value: bool) -> html_compose.base_attribute.BaseAttribute:
121    @staticmethod
122    def novalidate(value: bool) -> BaseAttribute:
123        """
124        "form" attribute: novalidate
125        Bypass form control validation for form submission
126
127        Args:
128            value:
129                Boolean attribute
130
131        Returns:
132            An novalidate attribute to be added to your element
133
134        """
135
136        return BaseAttribute("novalidate", value)

"form" attribute: novalidate Bypass form control validation for form submission

Args: value: Boolean attribute

Returns: An novalidate attribute to be added to your element

@staticmethod
def target(value) -> html_compose.base_attribute.BaseAttribute:
138    @staticmethod
139    def target(value) -> BaseAttribute:
140        """
141        "form" attribute: target
142        Navigable for form submission
143
144        Args:
145            value:
146                Valid navigable target name or keyword
147
148        Returns:
149            An target attribute to be added to your element
150
151        """
152
153        return BaseAttribute("target", value)

"form" attribute: target Navigable for form submission

Args: value: Valid navigable target name or keyword

Returns: An target attribute to be added to your element