Source code for dazzler.components.core._form
"""Autogenerated file: DO NOT EDIT!"""
import typing # noqa: F401
from dazzler.system import Component, Aspect, UNDEFINED # noqa: F401
[docs]class Form(Component):
"""
A form element with auto fields.
:CSS:
- ``dazzler-core-form``
- ``form-header``
- ``form-body``
- ``form-field``
- ``field-error``
- ``form-label``
- ``form-input``
- ``form-footer``
- ``form-submit``
"""
fields = Aspect(docstring="Fields of the form, either provide a component or a type for the input.") # noqa: E501
header = Aspect(docstring="Render on top of the form (CSS: form-header)")
body = Aspect(docstring="Render in the middle of the form, after the fields. (CSS: form-body)") # noqa: E501
footer = Aspect(docstring="Render at the bottom of the form (CSS: form-footer)") # noqa: E501
action = Aspect(docstring="Url to submit the form.")
method = Aspect(docstring="Http method to submit the form. (Possible values: 'get', 'post', 'put', 'patch')") # noqa: E501
target = Aspect(docstring="How will the response display. (Possible values: '_blank', '_self', '_parent', '_top')") # noqa: E501
name = Aspect(docstring="Name of the form.")
auto_complete = Aspect(docstring="Specifies auto complete for the form. (Possible values: 'on', 'off')") # noqa: E501
enctype = Aspect(docstring="How the data is encode before submit. (Possible values: 'application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain')") # noqa: E501
accept_charset = Aspect(docstring="Character encoding for submission.")
no_validate = Aspect(docstring="Specify the form should be validated on submission.") # noqa: E501
errors = Aspect(default=UNDEFINED, docstring="Errors to show with the fields. Keys are name. (default={})") # noqa: E501
include_submit = Aspect(default=True, docstring="Include a submit button on the form. (default=True)") # noqa: E501
submit_label = Aspect(default='Submit', docstring="Label of the submit button. (default='Submit')") # noqa: E501
stacked = Aspect(docstring="Stack the form label and input.")
class_name = Aspect(docstring="Class name automatically added by dazzler api with a prefix for the component library.ie: core component Container become ``dazzler-core-container``.When added on the component, the class names will be concatenated.") # noqa: E501
style = Aspect(docstring="Style object for the top level wrapper of the component.") # noqa: E501
color = Aspect(docstring="Font color")
background = Aspect(docstring="Background color/image")
padding = Aspect(docstring="Space around the content before the border")
padding_top = Aspect()
padding_bottom = Aspect()
padding_left = Aspect()
padding_right = Aspect()
margin = Aspect(docstring="Space after the element border")
margin_top = Aspect()
margin_bottom = Aspect()
margin_left = Aspect()
margin_right = Aspect()
overflow = Aspect(docstring="Overflow the content and show a scrollbar.")
height = Aspect(docstring="Height of the component.")
min_height = Aspect()
max_height = Aspect(docstring="Maximum height before overflow.")
width = Aspect(docstring="Width of the component.")
min_width = Aspect()
max_width = Aspect(docstring="Maximum width before overflowing.")
font_family = Aspect(docstring="Font to use.")
font_size = Aspect(docstring="Size of the font.")
font_weight = Aspect(docstring="Boldness")
font_style = Aspect(docstring="Italic")
text_align = Aspect(docstring="Left center right.")
border = Aspect(docstring="Border around the component.")
border_radius = Aspect(docstring="Round the corner of the component, needs a background or border.") # noqa: E501
cursor = Aspect(docstring="Cursor when the mouse is over the component.")
flex_grow = Aspect(docstring="Grow factor for flex item.")
flex_shrink = Aspect(docstring="Shrink factor for flex item.")
align_self = Aspect(docstring="Flex alignment for the component. (Possible values: 'flex-start', 'flex-end', 'center', 'stretch', 'baseline', 'auto')") # noqa: E501
display = Aspect(docstring="CSS, How to display the component.")
rounded = Aspect(docstring="Round the edge of the container with borderRadius: 3px;") # noqa: E501
bordered = Aspect(docstring="Apply default bordering with neutral dark grey,") # noqa: E501
centered = Aspect(docstring="Center the content in the middle of the container.") # noqa: E501
scrollable = Aspect(docstring="Set the overflow content to scroll.")
hidden = Aspect(docstring="Hide the component;")
unselectable = Aspect(docstring="Do not allow for the text to be selected.") # noqa: E501
preset_color = Aspect(docstring="Preset color to apply to the font. (Possible values: 'primary', 'primary-light', 'primary-dark', 'secondary', 'secondary-light', 'secondary-dark', 'tertiary', 'tertiary-light', 'tertiary-dark', 'danger', 'danger-light', 'danger-dark', 'warning', 'warning-light', 'warning-dark', 'success', 'success-light', 'success-dark', 'neutral', 'neutral-light', 'neutral-dark', 'dark', 'dark-light', 'dark-dark', 'darker', 'darker-light', 'darker-dark')") # noqa: E501
preset_background = Aspect(docstring="Preset color to apply to the background. (Possible values: 'primary', 'primary-light', 'primary-dark', 'secondary', 'secondary-light', 'secondary-dark', 'tertiary', 'tertiary-light', 'tertiary-dark', 'danger', 'danger-light', 'danger-dark', 'warning', 'warning-light', 'warning-dark', 'success', 'success-light', 'success-dark', 'neutral', 'neutral-light', 'neutral-dark', 'dark', 'dark-light', 'dark-dark', 'darker', 'darker-light', 'darker-dark')") # noqa: E501
preset_size = Aspect(docstring="Scale the size of the container using a preset. (Possible values: 'tiny', 'small', 'medium', 'large', 'larger', 'x-large', 'xx-large')") # noqa: E501
[docs] def __init__(
self,
fields: typing.Optional[typing.List[typing.Dict[str, typing.Union[str, typing.Any]]]] = UNDEFINED, # noqa: E501
header: typing.Optional[typing.Any] = UNDEFINED,
body: typing.Optional[typing.Any] = UNDEFINED,
footer: typing.Optional[typing.Any] = UNDEFINED,
action: typing.Optional[str] = UNDEFINED,
method: typing.Optional[typing.Any] = UNDEFINED,
target: typing.Optional[typing.Any] = UNDEFINED,
name: typing.Optional[str] = UNDEFINED,
auto_complete: typing.Optional[typing.Any] = UNDEFINED,
enctype: typing.Optional[typing.Any] = UNDEFINED,
accept_charset: typing.Optional[str] = UNDEFINED,
no_validate: typing.Optional[bool] = UNDEFINED,
errors: typing.Optional[typing.Dict] = UNDEFINED,
include_submit: typing.Optional[bool] = True,
submit_label: typing.Optional[str] = 'Submit',
stacked: typing.Optional[bool] = UNDEFINED,
class_name: typing.Optional[str] = UNDEFINED,
style: typing.Optional[typing.Dict] = UNDEFINED,
color: typing.Optional[str] = UNDEFINED,
background: typing.Optional[str] = UNDEFINED,
padding: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
padding_top: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
padding_bottom: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
padding_left: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
padding_right: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
margin: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
margin_top: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
margin_bottom: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
margin_left: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
margin_right: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
overflow: typing.Optional[str] = UNDEFINED,
height: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
min_height: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
max_height: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
width: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
min_width: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
max_width: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
font_family: typing.Optional[str] = UNDEFINED,
font_size: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
font_weight: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
font_style: typing.Optional[str] = UNDEFINED,
text_align: typing.Optional[str] = UNDEFINED,
border: typing.Optional[str] = UNDEFINED,
border_radius: typing.Optional[typing.Union[str, typing.Union[float, int]]] = UNDEFINED, # noqa: E501
cursor: typing.Optional[str] = UNDEFINED,
flex_grow: typing.Optional[typing.Union[float, int]] = UNDEFINED,
flex_shrink: typing.Optional[typing.Union[float, int]] = UNDEFINED, # noqa: E501
align_self: typing.Optional[typing.Any] = UNDEFINED,
display: typing.Optional[str] = UNDEFINED,
rounded: typing.Optional[bool] = UNDEFINED,
bordered: typing.Optional[bool] = UNDEFINED,
centered: typing.Optional[bool] = UNDEFINED,
scrollable: typing.Optional[bool] = UNDEFINED,
hidden: typing.Optional[bool] = UNDEFINED,
unselectable: typing.Optional[bool] = UNDEFINED,
preset_color: typing.Optional[typing.Any] = UNDEFINED,
preset_background: typing.Optional[typing.Any] = UNDEFINED,
preset_size: typing.Optional[typing.Any] = UNDEFINED,
identity: str = None
):
"""
:param fields: Fields of the form, either provide a component or a
type for the input.
:param header: Render on top of the form (CSS: form-header)
:param body: Render in the middle of the form, after the fields.
(CSS: form-body)
:param footer: Render at the bottom of the form (CSS: form-footer)
:param action: Url to submit the form.
:param method: Http method to submit the form. (Possible values:
'get', 'post', 'put', 'patch')
:param target: How will the response display. (Possible values:
'_blank', '_self', '_parent', '_top')
:param name: Name of the form.
:param auto_complete: Specifies auto complete for the form.
(Possible values: 'on', 'off')
:param enctype: How the data is encode before submit. (Possible
values: 'application/x-www-form-urlencoded', 'multipart/form-data',
'text/plain')
:param accept_charset: Character encoding for submission.
:param no_validate: Specify the form should be validated on
submission.
:param errors: Errors to show with the fields. Keys are name.
(default={})
:param include_submit: Include a submit button on the form.
(default=True)
:param submit_label: Label of the submit button. (default='Submit')
:param stacked: Stack the form label and input.
:param class_name: Class name automatically added by dazzler api
with a prefix for the component library. ie: core component
Container become ``dazzler-core-container``. When added on the
component, the class names will be concatenated.
:param style: Style object for the top level wrapper of the
component.
:param color: Font color
:param background: Background color/image
:param padding: Space around the content before the border
:param padding_top:
:param padding_bottom:
:param padding_left:
:param padding_right:
:param margin: Space after the element border
:param margin_top:
:param margin_bottom:
:param margin_left:
:param margin_right:
:param overflow: Overflow the content and show a scrollbar.
:param height: Height of the component.
:param min_height:
:param max_height: Maximum height before overflow.
:param width: Width of the component.
:param min_width:
:param max_width: Maximum width before overflowing.
:param font_family: Font to use.
:param font_size: Size of the font.
:param font_weight: Boldness
:param font_style: Italic
:param text_align: Left center right.
:param border: Border around the component.
:param border_radius: Round the corner of the component, needs a
background or border.
:param cursor: Cursor when the mouse is over the component.
:param flex_grow: Grow factor for flex item.
:param flex_shrink: Shrink factor for flex item.
:param align_self: Flex alignment for the component. (Possible
values: 'flex-start', 'flex-end', 'center', 'stretch', 'baseline',
'auto')
:param display: CSS, How to display the component.
:param rounded: Round the edge of the container with borderRadius:
3px;
:param bordered: Apply default bordering with neutral dark grey,
:param centered: Center the content in the middle of the container.
:param scrollable: Set the overflow content to scroll.
:param hidden: Hide the component;
:param unselectable: Do not allow for the text to be selected.
:param preset_color: Preset color to apply to the font. (Possible
values: 'primary', 'primary-light', 'primary-dark', 'secondary',
'secondary-light', 'secondary-dark', 'tertiary', 'tertiary-light',
'tertiary-dark', 'danger', 'danger-light', 'danger-dark',
'warning', 'warning-light', 'warning-dark', 'success', 'success-
light', 'success-dark', 'neutral', 'neutral-light', 'neutral-dark',
'dark', 'dark-light', 'dark-dark', 'darker', 'darker-light',
'darker-dark')
:param preset_background: Preset color to apply to the background.
(Possible values: 'primary', 'primary-light', 'primary-dark',
'secondary', 'secondary-light', 'secondary-dark', 'tertiary',
'tertiary-light', 'tertiary-dark', 'danger', 'danger-light',
'danger-dark', 'warning', 'warning-light', 'warning-dark',
'success', 'success-light', 'success-dark', 'neutral', 'neutral-
light', 'neutral-dark', 'dark', 'dark-light', 'dark-dark',
'darker', 'darker-light', 'darker-dark')
:param preset_size: Scale the size of the container using a preset.
(Possible values: 'tiny', 'small', 'medium', 'large', 'larger',
'x-large', 'xx-large')
"""
Component.__init__(self, locals(), identity)