Crate nova_forms

Source

Macros§

group
impl_datatype
Implements the required traits for creating a datatype.
init_nova_forms
Initializes the Nova Forms AppContextProvider and RenderContextProvider.
input
node
qs
Creates a QueryString.
value
values
wire
Wires multiple input signals to an output signal using the given function.

Structs§

Accept
A datatype for checkboxes that require them to be true. This is useful for a checkbox that needs to be checked before submitting a form, for example a terms and conditions checkbox.
AppContext
The base context provides general information about the environment.
BaseGroupContext
ButtonGroupProps
Props for the ButtonGroup component.
ButtonProps
Props for the Button component.
CheckboxProps
Props for the Checkbox component.
ChoiceProps
Props for the Choice component.
ChoicesProps
Props for the Choices component.
ColsProps
Props for the Cols component.
ColspanProps
Props for the Colspan component.
Date
A date without a time.
DateTime
A date and time. Important note: This type does not support time zones. To ensure that you are working with the clients timezone, you can use the local_utc_offset field in the MetaData to translate this PrimitiveDateTime to an OffsetDateTime with the correct offset.
DialogProps
Props for the Dialog component.
EmailRule
Field
FieldWiring
Used to wire an input field to the form context. For example, refer to the input field components in this library.
FileId
A unique identifier for a file.
FileInfo
Contains information about a file, but not the file contents itself.
FileUploadProps
Props for the FileUpload component.
FormContext
FormData
GroupContext
GroupData
GroupProps
Props for the Group component.
IbanRule
IconProps
Props for the Icon component.
InputContext
InputData
InputProps
Props for the Input component.
MetaData
The metadata of the form. This contains useful information about the client environment. The locale identifies the language of the client. The local_utc_offset identifies the timezone of the client.
ModalProps
Props for the Modal component.
NonEmptyString
A datatype representing a non-empty string.
NovaFormProps
Props for the NovaForm component.
NovaFormWrapperProps
Props for the NovaFormWrapper component.
Optional
A datatype that represents an optional value.
PageProps
Props for the Page component.
PageStepperProps
Props for the PageStepper component.
PagesProps
Props for the Pages component.
PhoneRule
PostalCodeCHRule
PostalCodeServiceServerFn
Serialized arguments for the [postal_code_service_server_fn] server function.
PreviewProps
Props for the Preview component.
PrintOnlyProps
Props for the PrintOnly component.
QueryString
Used to bind a form input element to a form data element. Note that QueryString supports a maximal depth of 16. Creating query strings consisting of more than 16 parts will panic.
RadioProps
Props for the Radio component.
RegionalField
RenderContext
The context that is used to render the form. This context is only available in the backend.
RepeatableProps
Props for the Repeatable component.
ScreenOnlyProps
Props for the ScreenOnly component.
SectionProps
Props for the Section component.
SelectButtonProps
Props for the SelectButton component.
SelectProps
Props for the Select component.
SiteRoot
SummaryProps
Props for the Summary component.
Time
A time without a date. Important note: This type does not support time zones. To ensure that you are working with the clients timezone, you can use the local_utc_offset field in the MetaData to translate this PrimitiveDateTime to an OffsetDateTime with the correct offset.
ToolbarLocaleSelectProps
Props for the ToolbarLocaleSelect component.
ToolbarPageSelectProps
Props for the ToolbarPageSelect component.
ToolbarPreviewButtonProps
Props for the ToolbarPreviewButton component.
ToolbarProps
Props for the Toolbar component.
ToolbarSubmitButtonProps
Props for the ToolbarSubmitButton component.
UploadFile
Serialized arguments for the [upload_file] server function.

Enums§

AcceptError
The error type for the Accept datatype. This error is returned when the input is not accepted and can be used to display an error message by providing a custom translation.
Data
DateTimeError
The error type for the DateTime datatype. This error is returned when the input is not a valid date and time and can be used to display an error message by providing a custom translation.
DialogKind
The kind of dialog to display. There are four kinds of dialogs: success, info, warn, and error.
FieldError
Node
NonEmptyStringError
The error type for the NonEmptyString datatype. This error is returned when the input is an empty string and can be used to display an error message by providing a custom translation.
QueryStringPart
A part of a query string. Either an index for arrays or a key to access a value.
RegionalFieldError
SubmitError
Possible errors that can occur when submitting a form.
SubmitState
The current state of the form submission.
Translation
Can be used to provide custom translations. If not provided, the default english translations will be used.

Traits§

Datatype
A trait for defining custom datatypes. Implemented on all types that can be used as a form input.
RegionalRule
Rule

Functions§

Button
A button that only contains an icon.
ButtonGroup
A button that only contains an icon.
Checkbox
A component that renders a checkbox.
Choice
Required Props
Choices
A component that renders radio buttons from an enum.
Cols
A component renders multiple columns.
Colspan
A component creates a colspan over multiple columns.
Dialog
A dialog component.
FileUpload
A component that allows users to upload files. The files are automatically uploaded to the server and stored in the FileStore.
Group
A component that binds all of its contents to a part of the form data.
Icon
Required Props
Input
A component that renders an input field. It takes a datatype as a type parameter and automatically handles parsing and validation.
Modal
A modal dialog.
NovaForm
Creates a new nova form. The form will automatically handle validation, serialization, and submission. This implicitly creates a HTML form tag that contains your entire form. It also provides a toolbar with a page select, locale select, preview button, and submit button.
NovaFormWrapper
A container for a form. Adds a header with a logo, title, and subtitle, as well as a footer with the title.
Page
Creates a new page in the form.
PageStepper
Creates a new page in the form.
Pages
Required Props
Preview
PrintOnly
Only renders the children when printing to PDF.
Radio
A component that renders radio buttons from an enum.
Repeatable
Creates a repeatable group of items.
ScreenOnly
Only renders the children when printing to PDF.
Section
Required Props
Select
A component that renders a select field from an enum.
SelectButton
Required Props
Summary
Toolbar
Required Props
ToolbarLocaleSelect
Required Props
ToolbarPageSelect
ToolbarPreviewButton
ToolbarSubmitButton
expect_translation
node
on_err
Calls the input function only if the returned functions result is an error.
on_ok
Calls the input function only if the returned functions result is ok.
postal_code_service
Provides a signal to get the city for a given swiss zip code. This uses the swiss postal service address checker API (https://service.post.ch/zopa/app/api/addresschecker/v1/zips).
provide_translation
Adds custom translations to a type T. This is useful for adding custom error messages to error enums or other elements.
set
Returns a function that sets a signal.
start_preview
stop_preview
use_translation

Type Aliases§

Email
EmailError
Iban
IbanError
Phone
PhoneError
PostalCodeCH
PostalCodeCHError
Version